@dxc-technology/halstack-react 7.0.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HalstackContext.js +98 -50
- package/accordion/Accordion.js +7 -13
- package/accordion/Accordion.stories.tsx +102 -13
- package/alert/Alert.stories.tsx +28 -0
- package/box/Box.js +1 -3
- package/box/Box.stories.tsx +15 -0
- package/button/Button.js +11 -13
- package/button/Button.stories.tsx +150 -8
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +16 -15
- package/checkbox/Checkbox.stories.tsx +131 -59
- package/checkbox/types.d.ts +4 -0
- package/chip/Chip.js +16 -22
- package/chip/Chip.stories.tsx +96 -9
- package/common/variables.js +286 -290
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.js +134 -237
- package/date-input/DateInput.stories.tsx +199 -33
- package/date-input/DateInput.test.js +494 -138
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +146 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +75 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +126 -0
- package/date-input/types.d.ts +51 -0
- package/dialog/Dialog.js +60 -73
- package/dialog/Dialog.stories.tsx +211 -159
- package/dialog/Dialog.test.js +301 -2
- package/dropdown/Dropdown.js +35 -35
- package/dropdown/Dropdown.stories.tsx +210 -84
- package/dropdown/Dropdown.test.js +17 -22
- package/dropdown/DropdownMenu.js +8 -18
- package/dropdown/DropdownMenuItem.js +4 -15
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +169 -222
- package/file-input/FileInput.stories.tsx +122 -11
- package/file-input/FileInput.test.js +12 -53
- package/file-input/FileItem.d.ts +4 -14
- package/file-input/FileItem.js +39 -63
- package/file-input/types.d.ts +17 -0
- package/footer/Footer.stories.tsx +91 -0
- package/header/Header.js +18 -20
- package/header/Header.stories.tsx +149 -6
- package/link/Link.js +1 -1
- package/link/Link.stories.tsx +60 -0
- package/main.d.ts +1 -1
- package/main.js +1 -1
- package/{tabs-nav → nav-tabs}/NavTabs.js +1 -1
- package/{tabs-nav → nav-tabs}/NavTabs.stories.tsx +96 -6
- package/{tabs-nav → nav-tabs}/Tab.js +35 -15
- package/number-input/NumberInput.test.js +5 -6
- package/package.json +7 -12
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +5 -11
- package/paginator/Paginator.stories.tsx +24 -0
- package/paginator/Paginator.test.js +17 -10
- package/progress-bar/ProgressBar.js +4 -4
- package/progress-bar/ProgressBar.stories.jsx +35 -2
- package/quick-nav/QuickNav.stories.tsx +14 -0
- package/radio-group/RadioGroup.stories.tsx +131 -18
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.js +48 -105
- package/resultsetTable/ResultsetTable.stories.tsx +50 -25
- package/resultsetTable/ResultsetTable.test.js +40 -63
- package/resultsetTable/types.d.ts +2 -2
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +5 -34
- package/select/Option.js +11 -24
- package/select/Select.js +43 -24
- package/select/Select.stories.tsx +494 -150
- package/select/Select.test.js +17 -22
- package/select/types.d.ts +2 -2
- package/sidenav/Sidenav.js +8 -10
- package/sidenav/Sidenav.stories.tsx +148 -46
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +9 -8
- package/slider/Slider.stories.tsx +57 -0
- package/slider/types.d.ts +4 -0
- package/spinner/Spinner.js +2 -2
- package/spinner/Spinner.stories.jsx +27 -1
- package/switch/Switch.d.ts +3 -3
- package/switch/Switch.js +5 -4
- package/switch/Switch.stories.tsx +33 -0
- package/switch/types.d.ts +6 -1
- package/table/Table.stories.jsx +80 -1
- package/table/Table.test.js +1 -1
- package/tabs/Tab.js +3 -5
- package/tabs/Tabs.js +3 -3
- package/tabs/Tabs.stories.tsx +45 -5
- package/tag/Tag.stories.tsx +14 -1
- package/text-input/Suggestion.js +32 -5
- package/text-input/TextInput.js +7 -11
- package/text-input/TextInput.stories.tsx +92 -4
- package/text-input/TextInput.test.js +587 -634
- package/textarea/Textarea.stories.jsx +60 -1
- package/toggle-group/ToggleGroup.stories.tsx +42 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +139 -0
- package/wizard/Wizard.stories.tsx +20 -0
- package/common/RequiredComponent.js +0 -32
- /package/{tabs-nav → nav-tabs}/NavTabs.d.ts +0 -0
- /package/{tabs-nav → nav-tabs}/NavTabs.test.js +0 -0
- /package/{tabs-nav → nav-tabs}/Tab.d.ts +0 -0
- /package/{tabs-nav → nav-tabs}/types.d.ts +0 -0
- /package/{tabs-nav → nav-tabs}/types.js +0 -0
|
@@ -11,6 +11,7 @@ import DxcFlex from "../flex/Flex";
|
|
|
11
11
|
import Suggestions from "./Suggestions";
|
|
12
12
|
import { ThemeProvider } from "styled-components";
|
|
13
13
|
import useTheme from "../useTheme";
|
|
14
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
14
15
|
|
|
15
16
|
export default {
|
|
16
17
|
title: "Text input",
|
|
@@ -27,7 +28,7 @@ const action = {
|
|
|
27
28
|
),
|
|
28
29
|
};
|
|
29
30
|
|
|
30
|
-
const
|
|
31
|
+
const actionLargeIconSVG = {
|
|
31
32
|
onClick: () => {},
|
|
32
33
|
icon: (
|
|
33
34
|
<svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
|
|
@@ -37,6 +38,11 @@ const actionLargeIcon = {
|
|
|
37
38
|
),
|
|
38
39
|
};
|
|
39
40
|
|
|
41
|
+
const actionLargeIconURL = {
|
|
42
|
+
onClick: () => {},
|
|
43
|
+
icon: "https://iconape.com/wp-content/files/yd/367773/svg/logo-linkedin-logo-icon-png-svg.png",
|
|
44
|
+
};
|
|
45
|
+
|
|
40
46
|
const country = ["Afghanistan"];
|
|
41
47
|
const countries = [
|
|
42
48
|
"Afghanistan",
|
|
@@ -61,8 +67,16 @@ const countries = [
|
|
|
61
67
|
"Dominica",
|
|
62
68
|
"Denmark",
|
|
63
69
|
"Djibouti",
|
|
70
|
+
"*",
|
|
64
71
|
];
|
|
65
72
|
|
|
73
|
+
const opinionatedTheme = {
|
|
74
|
+
textInput: {
|
|
75
|
+
fontColor: "#000000",
|
|
76
|
+
hoverBorderColor: "#a46ede",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
66
80
|
export const Chromatic = () => (
|
|
67
81
|
<>
|
|
68
82
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
@@ -98,12 +112,21 @@ export const Chromatic = () => (
|
|
|
98
112
|
<DxcTextInput label="Text input" clearable defaultValue="Text" helperText="Help message" optional />
|
|
99
113
|
</ExampleContainer>
|
|
100
114
|
<ExampleContainer>
|
|
101
|
-
<Title title="Clearable and large icon action" theme="light" level={4} />
|
|
115
|
+
<Title title="Clearable and large icon action (SVG)" theme="light" level={4} />
|
|
102
116
|
<DxcTextInput
|
|
103
117
|
label="Text input"
|
|
104
118
|
defaultValue="Text text text text text text text text text text"
|
|
105
119
|
clearable
|
|
106
|
-
action={
|
|
120
|
+
action={actionLargeIconSVG}
|
|
121
|
+
/>
|
|
122
|
+
</ExampleContainer>
|
|
123
|
+
<ExampleContainer>
|
|
124
|
+
<Title title="Clearable and large icon action (URL)" theme="light" level={4} />
|
|
125
|
+
<DxcTextInput
|
|
126
|
+
label="Text input"
|
|
127
|
+
defaultValue="Text text text text text text text text text text"
|
|
128
|
+
clearable
|
|
129
|
+
action={actionLargeIconURL}
|
|
107
130
|
/>
|
|
108
131
|
</ExampleContainer>
|
|
109
132
|
<ExampleContainer>
|
|
@@ -297,6 +320,66 @@ export const Chromatic = () => (
|
|
|
297
320
|
<Title title="FillParent size" theme="light" level={4} />
|
|
298
321
|
<DxcTextInput label="FillParent" size="fillParent" />
|
|
299
322
|
</ExampleContainer>
|
|
323
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
324
|
+
<ExampleContainer>
|
|
325
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
326
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
327
|
+
<Title title="Hovered input" theme="light" level={4} />
|
|
328
|
+
<DxcTextInput label="Text input" helperText="Help message" />
|
|
329
|
+
</ExampleContainer>
|
|
330
|
+
<ExampleContainer pseudoState="pseudo-focus-within">
|
|
331
|
+
<Title title="Focused input" theme="light" level={4} />
|
|
332
|
+
<DxcTextInput label="Text input" helperText="Help message" />
|
|
333
|
+
</ExampleContainer>
|
|
334
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
335
|
+
<Title title="Hovered action" theme="light" level={4} />
|
|
336
|
+
<DxcTextInput label="Text input" helperText="Help message" defaultValue="Text" clearable />
|
|
337
|
+
</ExampleContainer>
|
|
338
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
339
|
+
<Title title="Actived action" theme="light" level={4} />
|
|
340
|
+
<DxcTextInput label="Text input" helperText="Help message" action={action} clearable />
|
|
341
|
+
</ExampleContainer>
|
|
342
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
343
|
+
<Title title="Focused action" theme="light" level={4} />
|
|
344
|
+
<DxcTextInput label="Text input" helperText="Help message" action={action} clearable />
|
|
345
|
+
</ExampleContainer>
|
|
346
|
+
<ExampleContainer>
|
|
347
|
+
<Title title="Prefix" theme="light" level={4} />
|
|
348
|
+
<DxcTextInput label="With prefix" prefix="+34" helperText="Help message" />
|
|
349
|
+
</ExampleContainer>
|
|
350
|
+
<ExampleContainer>
|
|
351
|
+
<Title title="Suffix and action" theme="light" level={4} />
|
|
352
|
+
<DxcTextInput label="With suffix" helperText="Help message" suffix="USD" action={action} />
|
|
353
|
+
</ExampleContainer>
|
|
354
|
+
<ExampleContainer>
|
|
355
|
+
<Title title="Invalid" theme="light" level={4} />
|
|
356
|
+
<DxcTextInput
|
|
357
|
+
label="Error text input"
|
|
358
|
+
helperText="Help message"
|
|
359
|
+
error="Error message."
|
|
360
|
+
defaultValue="Text"
|
|
361
|
+
clearable
|
|
362
|
+
optional
|
|
363
|
+
action={action}
|
|
364
|
+
/>
|
|
365
|
+
</ExampleContainer>
|
|
366
|
+
<ExampleContainer>
|
|
367
|
+
<Title title="Disabled and placeholder" theme="light" level={4} />
|
|
368
|
+
<DxcTextInput label="Disabled text input" disabled placeholder="Placeholder" prefix="+34" suffix="USD" />
|
|
369
|
+
</ExampleContainer>
|
|
370
|
+
<ExampleContainer>
|
|
371
|
+
<Title title="Disabled, helper text, optional, value and action" theme="light" level={4} />
|
|
372
|
+
<DxcTextInput
|
|
373
|
+
label="Disabled text input"
|
|
374
|
+
helperText="Help message"
|
|
375
|
+
disabled
|
|
376
|
+
optional
|
|
377
|
+
defaultValue="Text"
|
|
378
|
+
action={action}
|
|
379
|
+
/>
|
|
380
|
+
</ExampleContainer>
|
|
381
|
+
</HalstackProvider>
|
|
382
|
+
</ExampleContainer>
|
|
300
383
|
</>
|
|
301
384
|
);
|
|
302
385
|
|
|
@@ -308,7 +391,11 @@ const AutosuggestListbox = () => {
|
|
|
308
391
|
<ExampleContainer>
|
|
309
392
|
<Title title="Autosuggest listbox" theme="light" level={2} />
|
|
310
393
|
<ExampleContainer>
|
|
311
|
-
<Title
|
|
394
|
+
<Title
|
|
395
|
+
title="List dialog uses a Radix Popover to appear over elements with a certain z-index"
|
|
396
|
+
theme="light"
|
|
397
|
+
level={3}
|
|
398
|
+
/>
|
|
312
399
|
<div
|
|
313
400
|
style={{
|
|
314
401
|
display: "flex",
|
|
@@ -322,6 +409,7 @@ const AutosuggestListbox = () => {
|
|
|
322
409
|
borderRadius: "4px",
|
|
323
410
|
overflow: "auto",
|
|
324
411
|
zIndex: "1300",
|
|
412
|
+
position: "relative",
|
|
325
413
|
}}
|
|
326
414
|
>
|
|
327
415
|
<DxcTextInput
|