Skip to content

Commit a8c37fa

Browse files
authored
Merge branch 'master' into gomezivann-dialog-review
2 parents e6c973d + fd47ea5 commit a8c37fa

40 files changed

+1916
-1018
lines changed

app/package-lock.json

Lines changed: 677 additions & 952 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
]
3737
},
3838
"devDependencies": {
39-
"cypress": "^3.7.0",
39+
"cypress": "^12.7.0",
4040
"cypress-image-snapshot": "^3.1.1"
4141
}
4242
}

lib/src/common/variables.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ export const componentTokens = {
915915
linkMarginRight: "16px",
916916
linkMarginLeft: "16px",
917917
linkFocusColor: globalTokens.hal_blue_l_50,
918-
scrollBarThumbColor: "#66666626",
918+
scrollBarThumbColor: globalTokens.color_grey_a_200,
919919
scrollBarTrackColor: globalTokens.transparent,
920920
},
921921
slider: {

lib/src/file-input/FileInput.test.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -280,30 +280,4 @@ describe("FileInput component tests", () => {
280280
]);
281281
});
282282
});
283-
test("File input sends value when submitted in a form", () => {
284-
const newFile = new File(["newFile"], "newFile.pdf", { type: "pdf" });
285-
const handlerOnSubmit = jest.fn((e) => {
286-
e.preventDefault();
287-
const formData = new FormData(e.target);
288-
const formProps = Object.fromEntries(formData);
289-
expect(formProps).toStrictEqual({ file: newFile });
290-
});
291-
const { getByText, getByLabelText } = render(
292-
<form onSubmit={handlerOnSubmit}>
293-
<DxcFileInput
294-
label="File input label"
295-
name="file"
296-
helperText="File input helper text"
297-
mode="filedrop"
298-
buttonLabel="Choose"
299-
dropAreaLabel="(or drop the files)"
300-
/>
301-
<button type="submit">Submit</button>
302-
</form>
303-
);
304-
const inputFile = getByLabelText("File input label", { hidden: true });
305-
const submit = getByText("Submit");
306-
fireEvent.change(inputFile, { target: { files: [newFile] } });
307-
userEvent.click(submit);
308-
});
309283
});

lib/src/file-input/FileInput.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const DxcFileInput = React.forwardRef<RefType, FileInputPropsType>(
105105
const selectedFiles = e.target.files;
106106
const filesArray = Object.keys(selectedFiles).map((key) => selectedFiles[key]);
107107
addFile(filesArray);
108+
e.target.value = null;
108109
};
109110

110111
const onDelete = useCallback(
@@ -179,10 +180,8 @@ const DxcFileInput = React.forwardRef<RefType, FileInputPropsType>(
179180
accept={accept}
180181
multiple={multiple}
181182
onChange={selectFiles}
182-
name={name}
183183
disabled={disabled}
184184
readOnly
185-
aria-hidden="true"
186185
/>
187186
<DxcButton
188187
mode="secondary"
@@ -223,10 +222,8 @@ const DxcFileInput = React.forwardRef<RefType, FileInputPropsType>(
223222
accept={accept}
224223
multiple={multiple}
225224
onChange={selectFiles}
226-
name={name}
227225
disabled={disabled}
228226
readOnly
229-
aria-hidden="true"
230227
/>
231228
<DragDropArea
232229
isDragging={isDragging}

lib/src/file-input/FileItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const FileItem = ({
5656
onClick={() => {
5757
onDelete(fileName);
5858
}}
59+
type="button"
5960
title={translatedLabels.fileInput.deleteFileActionTitle}
6061
aria-label={translatedLabels.fileInput.deleteFileActionTitle}
6162
tabIndex={tabIndex}

lib/src/nav-tabs/Tab.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const DxcTab = forwardRef(
3535
<Tab
3636
href={!disabled && href ? href : undefined}
3737
disabled={disabled}
38+
active={active}
3839
iconPosition={iconPosition}
3940
hasIcon={hasIcons}
4041
ref={(anchorRef) => {
@@ -112,6 +113,7 @@ const TabContainer = styled.div<TabContainerProps>`
112113
type TabStyleProps = {
113114
disabled: boolean;
114115
hasIcon: boolean;
116+
active?: boolean;
115117
iconPosition: "top" | "left";
116118
};
117119
const Tab = styled.a<TabStyleProps>`
@@ -122,7 +124,8 @@ const Tab = styled.a<TabStyleProps>`
122124
123125
text-decoration-color: transparent;
124126
cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
125-
background: ${(props) => props.theme.selectedBackgroundColor};
127+
background: ${(props) =>
128+
props.active ? props.theme.selectedBackgroundColor : props.theme.unselectedBackgroundColor};
126129
127130
height: ${(props) => (props.hasIcon && props.iconPosition === "top" ? "66px" : "32px")};
128131
min-width: 164px;

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"lint": "next lint"
99
},
1010
"dependencies": {
11-
"@dxc-technology/halstack-react": "0.0.0-a5b9b2c",
11+
"@dxc-technology/halstack-react": "0.0.0-50c4df3",
1212
"@radix-ui/react-popover": "0.1.6",
1313
"@types/styled-components": "^5.1.18",
1414
"axios": "^0.27.2",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Head from "next/head";
2+
import type { ReactElement } from "react";
3+
import InsetPageLayout from "../../../screens/components/inset/InsetPageLayout";
4+
import InsetSpecsPage from "../../../screens/components/inset/specs/InsetSpecsPage";
5+
6+
const Specifications = () => {
7+
return (
8+
<>
9+
<Head>
10+
<title>Inset Specs — Halstack Design System</title>
11+
</Head>
12+
<InsetSpecsPage></InsetSpecsPage>
13+
</>
14+
);
15+
};
16+
17+
Specifications.getLayout = function getLayout(page: ReactElement) {
18+
return <InsetPageLayout>{page}</InsetPageLayout>;
19+
};
20+
21+
export default Specifications;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Head from "next/head";
2+
import type { ReactElement } from "react";
3+
import InsetPageLayout from "screens/components/inset/InsetPageLayout";
4+
import InsetUsagePage from "screens/components/inset/usage/InsetUsagePage";
5+
6+
const Usage = () => {
7+
return (
8+
<>
9+
<Head>
10+
<title>Inset Usage — Halstack Design System</title>
11+
</Head>
12+
<InsetUsagePage></InsetUsagePage>
13+
</>
14+
);
15+
};
16+
17+
Usage.getLayout = function getLayout(page: ReactElement) {
18+
return <InsetPageLayout>{page}</InsetPageLayout>;
19+
};
20+
21+
export default Usage;

0 commit comments

Comments
 (0)