@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,170 @@
1
+ import React from "react";
2
+ import DxcAlert from "./Alert";
3
+ import Title from "../../.storybook/components/Title";
4
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
+
6
+ export default {
7
+ title: "Alert",
8
+ component: DxcAlert,
9
+ };
10
+
11
+ export const Chromatic = () => (
12
+ <>
13
+ <ExampleContainer>
14
+ <Title title="Info" theme="light" level={4} />
15
+ <DxcAlert inlineText="Info type alert with inline text." />
16
+ </ExampleContainer>
17
+ <ExampleContainer>
18
+ <Title title="Confirm" theme="light" level={4} />
19
+ <DxcAlert type="confirm" inlineText="Confirm type alert with inline text." />
20
+ </ExampleContainer>
21
+ <ExampleContainer>
22
+ <Title title="Warning" theme="light" level={4} />
23
+ <DxcAlert type="warning" inlineText="Warning type alert with inline text." />
24
+ </ExampleContainer>
25
+ <ExampleContainer>
26
+ <Title title="Error" theme="light" level={4} />
27
+ <DxcAlert type="error" inlineText="Error type alert with inline text." />
28
+ </ExampleContainer>
29
+ <ExampleContainer>
30
+ <Title title="With close button" theme="light" level={4} />
31
+ <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
32
+ </ExampleContainer>
33
+ <ExampleContainer pseudoState="pseudo-hover">
34
+ <Title title="With hovered close button" theme="light" level={4} />
35
+ <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
36
+ </ExampleContainer>
37
+ <ExampleContainer pseudoState="pseudo-focus">
38
+ <Title title="With focused close button" theme="light" level={4} />
39
+ <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
40
+ </ExampleContainer>
41
+ <ExampleContainer pseudoState="pseudo-active">
42
+ <Title title="With actived close button" theme="light" level={4} />
43
+ <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
44
+ </ExampleContainer>
45
+ <ExampleContainer>
46
+ <Title title="With children" theme="light" level={4} />
47
+ <DxcAlert>
48
+ <div>
49
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
50
+ lobortis eget.
51
+ </div>
52
+ </DxcAlert>
53
+ </ExampleContainer>
54
+ <ExampleContainer>
55
+ <Title title="With inline text and children" theme="light" level={4} />
56
+ <DxcAlert inlineText="Info type alert with inline text.">
57
+ <div>
58
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
59
+ lobortis eget.
60
+ </div>
61
+ </DxcAlert>
62
+ </ExampleContainer>
63
+ <Title title="Margins" theme="light" level={2} />
64
+ <ExampleContainer>
65
+ <Title title="Xxsmall" theme="light" level={4} />
66
+ <DxcAlert margin="xxsmall" inlineText="Info type alert with inline text and xxsmall margin." />
67
+ </ExampleContainer>
68
+ <ExampleContainer>
69
+ <Title title="Xsmall" theme="light" level={4} />
70
+ <DxcAlert margin="xsmall" inlineText="Info type alert with inline text and xsmall margin." />
71
+ </ExampleContainer>
72
+ <ExampleContainer>
73
+ <Title title="Small" theme="light" level={4} />
74
+ <DxcAlert margin="small" inlineText="Info type alert with inline text and small margin." />
75
+ </ExampleContainer>
76
+ <ExampleContainer>
77
+ <Title title="Medium" theme="light" level={4} />
78
+ <DxcAlert margin="medium" inlineText="Info type alert with inline text and medium margin." />
79
+ </ExampleContainer>
80
+ <ExampleContainer>
81
+ <Title title="Large" theme="light" level={4} />
82
+ <DxcAlert margin="large" inlineText="Info type alert with inline text and large margin." />
83
+ </ExampleContainer>
84
+ <ExampleContainer>
85
+ <Title title="Xlarge" theme="light" level={4} />
86
+ <DxcAlert margin="xlarge" inlineText="Info type alert with inline text and xlarge margin." />
87
+ </ExampleContainer>
88
+ <ExampleContainer>
89
+ <Title title="Xxlarge" theme="light" level={4} />
90
+ <DxcAlert margin="xxlarge" inlineText="Info type alert with inline text and xxlarge margin." />
91
+ </ExampleContainer>
92
+ <Title title="Sizes" theme="light" level={2} />
93
+ <ExampleContainer>
94
+ <Title title="FitContent" theme="light" level={4} />
95
+ <DxcAlert
96
+ size="fitContent"
97
+ inlineText="Info type alert with inline text, children, close button and fitContent size."
98
+ onClose={() => {}}
99
+ >
100
+ <div>
101
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
102
+ lobortis eget.
103
+ </div>
104
+ </DxcAlert>
105
+ </ExampleContainer>
106
+ <ExampleContainer>
107
+ <Title title="Small" theme="light" level={4} />
108
+ <DxcAlert
109
+ size="small"
110
+ inlineText="Info type alert with inline text, children, close button and small size."
111
+ onClose={() => {}}
112
+ >
113
+ <div>
114
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
115
+ lobortis eget.
116
+ </div>
117
+ </DxcAlert>
118
+ </ExampleContainer>
119
+ <ExampleContainer>
120
+ <Title title="Medium" theme="light" level={4} />
121
+ <DxcAlert
122
+ size="medium"
123
+ inlineText="Info type alert with inline text, children, close button and medium size."
124
+ onClose={() => {}}
125
+ >
126
+ <div>
127
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
128
+ lobortis eget.
129
+ </div>
130
+ </DxcAlert>
131
+ </ExampleContainer>
132
+ <ExampleContainer>
133
+ <Title title="Large" theme="light" level={4} />
134
+ <DxcAlert
135
+ size="large"
136
+ inlineText="Info type alert with inline text, children, close button and large size."
137
+ onClose={() => {}}
138
+ >
139
+ <div>
140
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
141
+ lobortis eget.
142
+ </div>
143
+ </DxcAlert>
144
+ </ExampleContainer>
145
+ <ExampleContainer>
146
+ <Title title="FillParent" theme="light" level={4} />
147
+ <DxcAlert
148
+ size="fillParent"
149
+ inlineText="Info type alert with inline text, children, close button and fillParent size."
150
+ onClose={() => {}}
151
+ >
152
+ <div>
153
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
154
+ lobortis eget.
155
+ </div>
156
+ </DxcAlert>
157
+ </ExampleContainer>
158
+ </>
159
+ );
160
+
161
+ export const ModalAlert = () => (
162
+ <ExampleContainer>
163
+ <DxcAlert inlineText="Modal alert." mode="modal" onClose={() => {}}>
164
+ <div>
165
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
166
+ lobortis eget.
167
+ </div>
168
+ </DxcAlert>
169
+ </ExampleContainer>
170
+ );
package/alert/types.d.ts CHANGED
@@ -38,7 +38,7 @@ declare type Props = {
38
38
  */
39
39
  margin?: Space | Margin;
40
40
  /**
41
- * Size of the component ('small' | 'medium' | 'large' | 'fillParent' | 'fitContent').
41
+ * Size of the component.
42
42
  */
43
43
  size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
44
44
  /**
package/box/Box.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import BoxPropsType from "./types";
3
- declare const DxcBox: ({ shadowDepth, display, children, margin, padding, size, tabIndex, }: BoxPropsType) => JSX.Element;
3
+ declare const DxcBox: ({ shadowDepth, display, children, margin, padding, size, }: BoxPropsType) => JSX.Element;
4
4
  export default DxcBox;
package/box/Box.js CHANGED
@@ -40,9 +40,7 @@ var DxcBox = function DxcBox(_ref) {
40
40
  margin = _ref.margin,
41
41
  padding = _ref.padding,
42
42
  _ref$size = _ref.size,
43
- size = _ref$size === void 0 ? "fitContent" : _ref$size,
44
- _ref$tabIndex = _ref.tabIndex,
45
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
43
+ size = _ref$size === void 0 ? "fitContent" : _ref$size;
46
44
  var colorsTheme = (0, _useTheme["default"])();
47
45
  return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
48
46
  theme: colorsTheme.box
@@ -51,8 +49,7 @@ var DxcBox = function DxcBox(_ref) {
51
49
  display: display,
52
50
  margin: margin,
53
51
  padding: padding,
54
- size: size,
55
- tabIndex: tabIndex
52
+ size: size
56
53
  }, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
57
54
  color: colorsTheme.box.backgroundColor
58
55
  }, children)));
package/box/types.d.ts CHANGED
@@ -39,9 +39,5 @@ declare type Props = {
39
39
  * Size of the component.
40
40
  */
41
41
  size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
42
- /**
43
- * Value of the tabindex attribute.
44
- */
45
- tabIndex?: number;
46
42
  };
47
43
  export default Props;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import ButtonPropsType from "./types";
3
- declare const DxcButton: ({ label, mode, disabled, iconPosition, type, icon, iconSrc, onClick, margin, size, tabIndex }: ButtonPropsType) => JSX.Element;
3
+ declare const DxcButton: ({ label, mode, disabled, iconPosition, type, icon, iconSrc, onClick, margin, size, tabIndex, }: ButtonPropsType) => JSX.Element;
4
4
  export default DxcButton;
package/button/Button.js CHANGED
@@ -47,7 +47,7 @@ var DxcButton = function DxcButton(_ref) {
47
47
  icon = _ref.icon,
48
48
  _ref$iconSrc = _ref.iconSrc,
49
49
  iconSrc = _ref$iconSrc === void 0 ? "" : _ref$iconSrc,
50
- onClick = _ref.onClick,
50
+ _onClick = _ref.onClick,
51
51
  margin = _ref.margin,
52
52
  _ref$size = _ref.size,
53
53
  size = _ref$size === void 0 ? "fitContent" : _ref$size,
@@ -72,7 +72,9 @@ var DxcButton = function DxcButton(_ref) {
72
72
  disableRipple: true,
73
73
  "aria-disabled": disabled,
74
74
  tabIndex: disabled ? -1 : tabIndex,
75
- onClick: onClick
75
+ onClick: function onClick() {
76
+ _onClick();
77
+ }
76
78
  }, label && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
77
79
  icon: icon,
78
80
  iconPosition: iconPosition