@dxc-technology/halstack-react 0.0.0-ee92231 → 0.0.0-efa7c74

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.
Files changed (92) hide show
  1. package/alert/Alert.stories.tsx +170 -0
  2. package/alert/types.d.ts +1 -1
  3. package/box/Box.d.ts +1 -1
  4. package/box/Box.js +2 -5
  5. package/box/types.d.ts +0 -4
  6. package/button/Button.d.ts +1 -1
  7. package/button/Button.js +4 -2
  8. package/button/Button.stories.tsx +216 -233
  9. package/button/types.d.ts +2 -2
  10. package/card/Card.js +4 -5
  11. package/card/Card.stories.tsx +201 -0
  12. package/card/ice-cream.jpg +0 -0
  13. package/card/types.d.ts +4 -6
  14. package/checkbox/types.d.ts +1 -1
  15. package/chip/Chip.stories.tsx +121 -0
  16. package/common/variables.js +13 -5
  17. package/date-input/DateInput.stories.tsx +138 -0
  18. package/dialog/Dialog.stories.tsx +212 -0
  19. package/file-input/FileInput.d.ts +4 -0
  20. package/file-input/FileInput.js +7 -28
  21. package/file-input/FileItem.d.ts +14 -0
  22. package/file-input/FileItem.js +4 -15
  23. package/file-input/types.d.ts +87 -0
  24. package/file-input/types.js +5 -0
  25. package/footer/types.d.ts +1 -1
  26. package/header/Header.stories.tsx +162 -0
  27. package/header/types.d.ts +4 -2
  28. package/heading/Heading.d.ts +4 -0
  29. package/heading/Heading.js +6 -23
  30. package/heading/Heading.stories.tsx +53 -0
  31. package/heading/types.d.ts +33 -0
  32. package/heading/types.js +5 -0
  33. package/link/Link.js +2 -2
  34. package/link/Link.stories.tsx +146 -0
  35. package/number-input/NumberInput.d.ts +4 -0
  36. package/number-input/NumberInput.js +2 -44
  37. package/number-input/{NumberInput.stories.jsx → NumberInput.stories.tsx} +0 -0
  38. package/number-input/NumberInputContext.d.ts +4 -0
  39. package/number-input/NumberInputContext.js +5 -2
  40. package/number-input/numberInputContextTypes.d.ts +19 -0
  41. package/number-input/numberInputContextTypes.js +5 -0
  42. package/number-input/types.d.ts +117 -0
  43. package/number-input/types.js +5 -0
  44. package/package.json +1 -1
  45. package/password-input/types.d.ts +13 -8
  46. package/radio/types.d.ts +2 -2
  47. package/resultsetTable/ResultsetTable.d.ts +4 -0
  48. package/resultsetTable/ResultsetTable.js +0 -25
  49. package/resultsetTable/types.d.ts +63 -0
  50. package/resultsetTable/types.js +5 -0
  51. package/select/Select.stories.tsx +572 -0
  52. package/sidenav/Sidenav.d.ts +9 -0
  53. package/sidenav/Sidenav.js +4 -13
  54. package/sidenav/Sidenav.stories.tsx +165 -0
  55. package/sidenav/types.d.ts +50 -0
  56. package/sidenav/types.js +5 -0
  57. package/slider/Slider.d.ts +1 -1
  58. package/slider/Slider.js +41 -30
  59. package/slider/Slider.stories.tsx +177 -0
  60. package/slider/types.d.ts +2 -7
  61. package/table/Table.js +1 -1
  62. package/tabs/Tabs.js +3 -1
  63. package/tabs/Tabs.stories.tsx +121 -0
  64. package/tabs/types.d.ts +2 -3
  65. package/tag/Tag.d.ts +4 -0
  66. package/tag/Tag.js +3 -24
  67. package/tag/{Tag.stories.jsx → Tag.stories.tsx} +0 -0
  68. package/tag/types.d.ts +60 -0
  69. package/tag/types.js +5 -0
  70. package/text-input/TextInput.d.ts +4 -0
  71. package/text-input/TextInput.js +4 -44
  72. package/text-input/types.d.ts +157 -0
  73. package/text-input/types.js +5 -0
  74. package/toggle-group/ToggleGroup.d.ts +4 -0
  75. package/toggle-group/ToggleGroup.js +5 -31
  76. package/toggle-group/ToggleGroup.stories.tsx +178 -0
  77. package/toggle-group/types.d.ts +84 -0
  78. package/toggle-group/types.js +5 -0
  79. package/wizard/Wizard.d.ts +4 -0
  80. package/wizard/Wizard.js +11 -51
  81. package/wizard/Wizard.stories.jsx +224 -0
  82. package/wizard/types.d.ts +64 -0
  83. package/wizard/types.js +5 -0
  84. package/file-input/index.d.ts +0 -81
  85. package/heading/index.d.ts +0 -17
  86. package/number-input/index.d.ts +0 -113
  87. package/resultsetTable/index.d.ts +0 -19
  88. package/sidenav/index.d.ts +0 -13
  89. package/tag/index.d.ts +0 -24
  90. package/text-input/index.d.ts +0 -135
  91. package/toggle-group/index.d.ts +0 -21
  92. package/wizard/index.d.ts +0 -18
@@ -0,0 +1,64 @@
1
+ /// <reference types="react" />
2
+ declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ declare type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+ declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
10
+ declare type Step = {
11
+ /**
12
+ * Step label.
13
+ */
14
+ label: string;
15
+ /**
16
+ * Description that will be placed next to the step.
17
+ */
18
+ description?: string;
19
+ /**
20
+ * Element used as the icon to be displayed in the step.
21
+ */
22
+ icon?: SVG;
23
+ /**
24
+ * @deprecated URL of the icon to be displayed in the step.
25
+ */
26
+ iconSrc?: string;
27
+ /**
28
+ * Whether the step is disabled or not.
29
+ */
30
+ disabled?: boolean;
31
+ /**
32
+ * Whether the step is valid or not.
33
+ */
34
+ valid?: boolean;
35
+ };
36
+ declare type Props = {
37
+ /**
38
+ * The wizard can be showed in horizontal or vertical.
39
+ */
40
+ mode?: "horizontal" | "vertical";
41
+ /**
42
+ * Defines which step is marked as the current. The numeration starts in 0.
43
+ */
44
+ currentStep?: number;
45
+ /**
46
+ * This function will be called when the user clicks a step. The step
47
+ * number will be passed as a parameter.
48
+ */
49
+ onStepClick?: (newCurrentStep: number) => void;
50
+ /**
51
+ * An array of objects representing the steps.
52
+ */
53
+ steps: [Step, ...Step[]];
54
+ /**
55
+ * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
56
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
57
+ */
58
+ margin?: Space | Margin;
59
+ /**
60
+ * Value of the tabindex attribute that is given to all the steps.
61
+ */
62
+ tabIndex?: number;
63
+ };
64
+ export default Props;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,81 +0,0 @@
1
- type Size = "small" | "medium" | "large" | "fillParent";
2
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- type FileData = {
10
- error?: string;
11
- file?: File;
12
- preview?: string;
13
- };
14
-
15
- type Props = {
16
- /**
17
- * Name attribute of the file input element.
18
- */
19
- name?: string;
20
- /**
21
- * Text to be placed above the file input.
22
- */
23
- label?: string;
24
- /**
25
- * Uses one of the available file input modes:
26
- * 'file': Files are selected by clicking the button and selecting it through the file explorer.
27
- * 'filedrop': Files can be selected by clicking the button and selecting it through the file explorer or by dropping them inside the drag and drop area.
28
- * 'dropzone': Files can be selected by clicking the button and selecting it through the file explorer or by dropping them inside the drag and drop area.
29
- * The drag and drop area of this mode is bigger than the one of the filedrop mode.
30
- */
31
- mode?: "file" | "filedrop" | "dropzone";
32
- /**
33
- * Helper text to be placed above the file input.
34
- */
35
- helperText?: string;
36
- /**
37
- * Defines the file types accepted by the component. It is not possible to select a file with a non valid type.
38
- */
39
- accept?: string;
40
- /**
41
- * An array of FileData representing the selected files.
42
- */
43
- value?: FileData[];
44
- /**
45
- * Minimum file size allowed (in bytes). If the file size does not comply the minSize, an error will be passed to the FileData.
46
- */
47
- minSize?: number;
48
- /**
49
- * Maximum file size allowed (in bytes). If the file size does not comply the maxSize, an error will be passed to the FileData.
50
- */
51
- maxSize?: number;
52
- /**
53
- * If true and if the file is an image, a preview of it will be shown. If it is not an image, an icon refering to the file's type will be shown.
54
- * If mode is not multiple and there is one file already selected, the file will be replaced by the last selected one.
55
- */
56
- showPreview?: boolean;
57
- /**
58
- * If true, more than one file can be selected. If false, only one file can be selected.
59
- */
60
- multiple?: boolean;
61
- /**
62
- * If true, the component will be disabled.
63
- */
64
- disabled?: boolean;
65
- /**
66
- * This function will be called when the user selects or drops a file. The list of files will be sent as a parameter.
67
- * In this function, the files can be updated or returned as they come. These files must be passed to the value in order to be shown.
68
- */
69
- callbackFile?: (files: FileData[]) => void;
70
- /**
71
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
72
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
73
- */
74
- margin?: Space | Margin;
75
- /**
76
- * Value of the tabindex attribute.
77
- */
78
- tabIndex?: number;
79
- };
80
-
81
- export default function DxcFileInput(props: Props): JSX.Element;
@@ -1,17 +0,0 @@
1
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- type Margin = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
-
9
- type Props = {
10
- level?: 1 | 2 | 3 | 4 | 5;
11
- text?: string;
12
- as?: "h1" | "h2" | "h3" | "h4" | "h5";
13
- weight?: "light" | "normal" | "bold";
14
- margin?: Space | Margin;
15
- };
16
-
17
- export default function DxcHeading(props: Props): JSX.Element;
@@ -1,113 +0,0 @@
1
- type Size = "small" | "medium" | "large" | "fillParent";
2
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- type Props = {
10
- /**
11
- * Text to be placed above the number.
12
- */
13
- label?: string;
14
- /**
15
- * Name attribute of the input element.
16
- */
17
- name?: string;
18
- /**
19
- * Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
20
- */
21
- value?: string;
22
- /**
23
- * Helper text to be placed above the number.
24
- */
25
- helperText?: string;
26
- /**
27
- * Text to be put as placeholder of the number.
28
- */
29
- placeholder?: string;
30
- /**
31
- * If true, the component will be disabled.
32
- */
33
- disabled?: boolean;
34
- /**
35
- * If true, the number will be optional, showing '(Optional)'
36
- * next to the label. Otherwise, the field will be considered required
37
- * and an error will be passed as a parameter to the OnBlur and onChange
38
- * functions when it has not been filled.
39
- */
40
- optional?: boolean;
41
- /**
42
- * Prefix to be placed before the number value.
43
- */
44
- prefix?: string;
45
- /**
46
- * Suffix to be placed after the number value.
47
- */
48
- suffix?: string;
49
- /**
50
- * Minimum value allowed by the number input. If the typed value by the user is
51
- * lower than min, the onBlur and onChange functions will be called with
52
- * the current value and an internal error informing that the current
53
- * value is not correct. If a valid state is reached, the error parameter
54
- * will be null in both events.
55
- */
56
- min?: number;
57
- /**
58
- * Maximum value allowed by the number input. If the typed value by the user
59
- * surpasses max, the onBlur and onChange functions will be called with
60
- * the current value and an internal error informing that the current
61
- * value is not correct. If a valid state is reached, the error parameter
62
- * will be null in both events.
63
- */
64
- max?: number;
65
- /**
66
- * The step interval to use when using the up and down arrows to adjust the value.
67
- */
68
- step?: number;
69
- /**
70
- * This function will be called when the user types within the input
71
- * element of the component. An object including the current value and
72
- * the error (if the value entered is not valid) will be passed to this
73
- * function. If there is no error, error will be null.
74
- */
75
- onChange?: (val: { value: string; error: string }) => void;
76
- /**
77
- * This function will be called when the input element loses the focus.
78
- * An object including the input value and the error (if the value
79
- * entered is not valid) will be passed to this function. If there is no error,
80
- * error will be null.
81
- */
82
- onBlur?: (val: { value: string; error: string }) => void;
83
- /**
84
- * If it is defined, the component will change its appearance, showing
85
- * the error below the input component. If it is not defined, the error
86
- * messages will be managed internally, but never displayed on its own.
87
- */
88
- error?: string;
89
- /**
90
- * HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
91
- * Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
92
- */
93
- autocomplete?: string;
94
- /**
95
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
96
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
97
- */
98
- margin?: Space | Margin;
99
- /**
100
- * Size of the component ('small' | 'medium' | 'large' | 'fillParent').
101
- */
102
- size?: Size;
103
- /**
104
- * Value of the tabindex attribute.
105
- */
106
- tabIndex?: number;
107
- /**
108
- * Reference to the component.
109
- */
110
- ref?: React.RefObject<HTMLDivElement>;
111
- };
112
-
113
- export default function DxcNumberInput(props: Props): JSX.Element;
@@ -1,19 +0,0 @@
1
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- type Margin = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
-
9
- type Props = {
10
- columns?: any;
11
- rows?: any;
12
- itemsPerPage?: number;
13
- itemsPerPageOptions?: number[];
14
- itemsPerPageFunction?: void,
15
- margin?: Space | Margin;
16
- tabIndex?: number;
17
- };
18
-
19
- export default function DxcResultsetTable(props: Props): JSX.Element;
@@ -1,13 +0,0 @@
1
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- type Padding = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
-
9
- type Props = {
10
- padding?: Space | Padding;
11
- };
12
-
13
- export default function DxcSidenav(props: Props): JSX.Element;
package/tag/index.d.ts DELETED
@@ -1,24 +0,0 @@
1
- type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
2
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
-
10
- type Props = {
11
- icon?: any;
12
- iconSrc?: string;
13
- label?: string;
14
- linkHref?: string;
15
- onClick?: void,
16
- iconBgColor?: string;
17
- labelPosition?: "before" | "after";
18
- newWindow?: boolean;
19
- margin?: Space | Margin;
20
- size?: Size;
21
- tabIndex?: number;
22
- };
23
-
24
- export default function DxcTag(props: Props): JSX.Element;
@@ -1,135 +0,0 @@
1
- type Size = "small" | "medium" | "large" | "fillParent";
2
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
10
- type Action = {
11
- onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
12
- icon: string | SVG;
13
- };
14
-
15
- type Props = {
16
- /**
17
- * Text to be placed above the input. This label will be used as the aria-label attribute of the list of suggestions.
18
- */
19
- label?: string;
20
- /**
21
- * Name attribute of the input element.
22
- */
23
- name?: string;
24
- /**
25
- * Value of the input. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
26
- */
27
- value?: string;
28
- /**
29
- * Helper text to be placed above the input.
30
- */
31
- helperText?: string;
32
- /**
33
- * Text to be put as placeholder of the input.
34
- */
35
- placeholder?: string;
36
- /**
37
- * Action to be shown in the input. This is an object composed of an onClick function and an icon,
38
- * being the latter either an inline svg or a URL to the image.
39
- */
40
- action?: Action;
41
- /**
42
- * If true, the input will have an action to clear the entered value.
43
- */
44
- clearable?: boolean;
45
- /**
46
- * If true, the component will be disabled.
47
- */
48
- disabled?: boolean;
49
- /**
50
- * If true, the input will be optional, showing '(Optional)'
51
- * next to the label. Otherwise, the field will be considered required and an error will be
52
- * passed as a parameter to the OnBlur and onChange functions when it has
53
- * not been filled.
54
- */
55
- optional?: boolean;
56
- /**
57
- * Prefix to be placed before the input value.
58
- */
59
- prefix?: string;
60
- /**
61
- * Suffix to be placed after the input value.
62
- */
63
- suffix?: string;
64
- /**
65
- * This function will be called when the user types within the input
66
- * element of the component. An object including the current value and
67
- * the error (if the value entered is not valid) will be passed to this
68
- * function. If there is no error, error will be null.
69
- */
70
- onChange?: (val: { value: string; error: string }) => void;
71
- /**
72
- * This function will be called when the input element loses the focus.
73
- * An object including the input value and the error (if the value
74
- * entered is not valid) will be passed to this function. If there is no error,
75
- * error will be null.
76
- */
77
- onBlur?: (obj: { value: string; error: string }) => void;
78
- /**
79
- * If it is defined, the component will change its appearance, showing
80
- * the error below the input component. If it is not defined, the error
81
- * messages will be managed internally, but never displayed on its own.
82
- */
83
- error?: string;
84
- /**
85
- * These are the options to be displayed as suggestions. It can be either an array or a function:
86
- * - Array: Array of options that will be filtered by the component.
87
- * - Function: This function will be called when the user changes the value, we will send as a parameter the new value;
88
- * apart from that this function should return one promise on which we should make 'then' to get the suggestions filtered.
89
- */
90
- suggestions?: string[] | (() => void);
91
- /**
92
- * Regular expression that defines the valid format allowed by the input.
93
- * This will be checked both when the input element loses the focus and
94
- * while typing within it. If the string entered does not match the
95
- * pattern, the onBlur and onChange functions will be called with the
96
- * current value and an internal error informing that this value does not
97
- * match the pattern. If the pattern is met, the error parameter of both
98
- * events will be null.
99
- */
100
- pattern?: string;
101
- /**
102
- * Specifies the minimun and maximum length allowed by the input.
103
- * This will be checked both when the input element loses the
104
- * focus and while typing within it. If the string entered does not
105
- * comply the length, the onBlur and onChange functions will be called
106
- * with the current value and an internal error informing that the value
107
- * length does not comply the specified range. If a valid length is
108
- * reached, the error parameter of both events will be null.
109
- */
110
- length?: { min?: number; max?: number };
111
- /**
112
- * HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
113
- * Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
114
- */
115
- autocomplete?: string;
116
- /**
117
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
118
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
119
- */
120
- margin?: Space | Margin;
121
- /**
122
- * Size of the component ('small' | 'medium' | 'large' | 'fillParent').
123
- */
124
- size?: Size;
125
- /**
126
- * Value of the tabindex attribute.
127
- */
128
- tabIndex?: number;
129
- /**
130
- * Reference to the component.
131
- */
132
- ref?: React.RefObject<HTMLDivElement>;
133
- };
134
-
135
- export default function DxcTextInput(props: Props): JSX.Element;
@@ -1,21 +0,0 @@
1
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- type Margin = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
-
9
- type Props = {
10
- label?: string;
11
- helperText?: string;
12
- value?: any;
13
- onChange?: void;
14
- disabled?: boolean;
15
- options?: any;
16
- multiple?: boolean;
17
- margin?: Space | Margin;
18
- tabIndex?: number;
19
- };
20
-
21
- export default function DxcToggleGroup(props: Props): JSX.Element;
package/wizard/index.d.ts DELETED
@@ -1,18 +0,0 @@
1
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
- type Margin = {
3
- top?: Space;
4
- bottom?: Space;
5
- left?: Space;
6
- right?: Space;
7
- };
8
-
9
- type Props = {
10
- mode?: "horizontal" | "vertical";
11
- currentStep?: number;
12
- onStepClick?: void;
13
- steps?: any;
14
- margin?: Space | Margin;
15
- tabIndex?: number;
16
- };
17
-
18
- export default function DxcWizard(props: Props): JSX.Element;