@dxc-technology/halstack-react 5.0.0 → 6.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.
Files changed (128) hide show
  1. package/HalstackContext.d.ts +4 -2
  2. package/HalstackContext.js +110 -58
  3. package/accordion/Accordion.stories.tsx +1 -1
  4. package/accordion-group/AccordionGroup.js +1 -0
  5. package/alert/Alert.js +4 -1
  6. package/badge/Badge.d.ts +1 -1
  7. package/badge/Badge.js +5 -3
  8. package/badge/types.d.ts +1 -0
  9. package/bleed/Bleed.js +1 -34
  10. package/bleed/Bleed.stories.tsx +94 -95
  11. package/bleed/types.d.ts +1 -1
  12. package/box/Box.js +22 -32
  13. package/bulleted-list/BulletedList.d.ts +7 -0
  14. package/bulleted-list/BulletedList.js +123 -0
  15. package/bulleted-list/BulletedList.stories.tsx +200 -0
  16. package/bulleted-list/types.d.ts +11 -0
  17. package/{list → bulleted-list}/types.js +0 -0
  18. package/button/Button.js +3 -1
  19. package/card/Card.js +34 -36
  20. package/checkbox/Checkbox.js +4 -1
  21. package/common/variables.js +211 -88
  22. package/date-input/DateInput.js +5 -2
  23. package/dropdown/Dropdown.stories.tsx +1 -1
  24. package/file-input/FileInput.js +9 -6
  25. package/file-input/FileItem.js +7 -5
  26. package/flex/Flex.d.ts +4 -0
  27. package/flex/Flex.js +57 -0
  28. package/flex/Flex.stories.tsx +103 -0
  29. package/flex/types.d.ts +21 -0
  30. package/{radio → flex}/types.js +0 -0
  31. package/footer/Footer.js +7 -5
  32. package/footer/Icons.js +1 -1
  33. package/header/Header.js +7 -4
  34. package/inset/Inset.js +1 -34
  35. package/inset/Inset.stories.tsx +36 -36
  36. package/inset/types.d.ts +1 -1
  37. package/layout/ApplicationLayout.d.ts +16 -6
  38. package/layout/ApplicationLayout.js +70 -117
  39. package/layout/ApplicationLayout.stories.tsx +83 -93
  40. package/layout/Icons.d.ts +5 -0
  41. package/layout/Icons.js +13 -2
  42. package/layout/SidenavContext.d.ts +5 -0
  43. package/layout/SidenavContext.js +19 -0
  44. package/layout/types.d.ts +18 -33
  45. package/link/Link.d.ts +3 -2
  46. package/link/Link.js +57 -70
  47. package/link/Link.stories.tsx +88 -53
  48. package/link/Link.test.js +7 -15
  49. package/link/types.d.ts +7 -23
  50. package/main.d.ts +7 -10
  51. package/main.js +38 -56
  52. package/number-input/types.d.ts +1 -1
  53. package/package.json +3 -1
  54. package/paginator/Paginator.js +17 -38
  55. package/paginator/Paginator.test.js +42 -0
  56. package/paragraph/Paragraph.d.ts +6 -0
  57. package/paragraph/Paragraph.js +38 -0
  58. package/paragraph/Paragraph.stories.tsx +44 -0
  59. package/password-input/PasswordInput.js +7 -4
  60. package/password-input/PasswordInput.test.js +1 -2
  61. package/password-input/types.d.ts +1 -1
  62. package/progress-bar/ProgressBar.js +1 -1
  63. package/progress-bar/ProgressBar.stories.jsx +11 -11
  64. package/quick-nav/QuickNav.js +74 -20
  65. package/quick-nav/QuickNav.stories.tsx +43 -16
  66. package/quick-nav/types.d.ts +4 -4
  67. package/radio-group/Radio.js +1 -1
  68. package/radio-group/RadioGroup.js +10 -7
  69. package/resultsetTable/ResultsetTable.test.js +42 -0
  70. package/select/Listbox.d.ts +1 -1
  71. package/select/Listbox.js +35 -8
  72. package/select/Select.js +83 -78
  73. package/select/Select.stories.tsx +144 -100
  74. package/select/Select.test.js +299 -194
  75. package/select/types.d.ts +3 -4
  76. package/sidenav/Sidenav.d.ts +6 -5
  77. package/sidenav/Sidenav.js +172 -52
  78. package/sidenav/Sidenav.stories.tsx +154 -156
  79. package/sidenav/Sidenav.test.js +25 -37
  80. package/sidenav/types.d.ts +50 -27
  81. package/spinner/Spinner.js +1 -1
  82. package/switch/Switch.js +4 -1
  83. package/tabs/Tabs.stories.tsx +0 -6
  84. package/tabs-nav/NavTabs.d.ts +8 -0
  85. package/tabs-nav/NavTabs.js +125 -0
  86. package/tabs-nav/NavTabs.stories.tsx +170 -0
  87. package/tabs-nav/NavTabs.test.js +82 -0
  88. package/tabs-nav/Tab.d.ts +4 -0
  89. package/tabs-nav/Tab.js +132 -0
  90. package/tabs-nav/types.d.ts +53 -0
  91. package/{row → tabs-nav}/types.js +0 -0
  92. package/text-input/Suggestion.d.ts +4 -0
  93. package/text-input/Suggestion.js +55 -0
  94. package/text-input/TextInput.js +46 -72
  95. package/text-input/TextInput.test.js +1 -1
  96. package/text-input/types.d.ts +14 -2
  97. package/textarea/Textarea.js +10 -19
  98. package/textarea/types.d.ts +1 -1
  99. package/typography/Typography.d.ts +4 -0
  100. package/typography/Typography.js +131 -0
  101. package/typography/Typography.stories.tsx +198 -0
  102. package/typography/types.d.ts +18 -0
  103. package/{stack → typography}/types.js +0 -0
  104. package/useTranslatedLabels.d.ts +2 -0
  105. package/useTranslatedLabels.js +20 -0
  106. package/wizard/Wizard.js +36 -41
  107. package/wizard/Wizard.stories.tsx +20 -1
  108. package/wizard/types.d.ts +4 -3
  109. package/list/List.d.ts +0 -4
  110. package/list/List.js +0 -47
  111. package/list/List.stories.tsx +0 -95
  112. package/list/types.d.ts +0 -7
  113. package/radio/Radio.d.ts +0 -4
  114. package/radio/Radio.js +0 -173
  115. package/radio/Radio.stories.tsx +0 -192
  116. package/radio/Radio.test.js +0 -71
  117. package/radio/types.d.ts +0 -54
  118. package/row/Row.d.ts +0 -3
  119. package/row/Row.js +0 -127
  120. package/row/Row.stories.tsx +0 -237
  121. package/row/types.d.ts +0 -28
  122. package/stack/Stack.d.ts +0 -3
  123. package/stack/Stack.js +0 -97
  124. package/stack/Stack.stories.tsx +0 -164
  125. package/stack/types.d.ts +0 -24
  126. package/text/Text.d.ts +0 -7
  127. package/text/Text.js +0 -30
  128. package/text/Text.stories.tsx +0 -19
@@ -0,0 +1,198 @@
1
+ import React from "react";
2
+ import Title from "../../.storybook/components/Title";
3
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
4
+ import DxcTypography from "./Typography";
5
+
6
+ export default {
7
+ title: "Typography",
8
+ component: DxcTypography,
9
+ };
10
+
11
+ export const Chromatic = () => (
12
+ <>
13
+ <ExampleContainer>
14
+ <Title title="Default Typography" theme="light" level={4} />
15
+ <DxcTypography>Default typography.</DxcTypography>
16
+ </ExampleContainer>
17
+ <ExampleContainer>
18
+ <Title title="Typography font sizes" theme="light" level={4} />
19
+ <DxcTypography display="block" fontSize="3.75rem">
20
+ 3.75rem.
21
+ </DxcTypography>
22
+ <DxcTypography display="block" fontSize="3rem">
23
+ 3rem.
24
+ </DxcTypography>
25
+ <DxcTypography display="block" fontSize="2rem">
26
+ 2rem.
27
+ </DxcTypography>
28
+ <DxcTypography display="block" fontSize="1.5rem">
29
+ 1.5rem.
30
+ </DxcTypography>
31
+ <DxcTypography display="block" fontSize="1.25rem">
32
+ 1.25rem.
33
+ </DxcTypography>
34
+ <DxcTypography display="block" fontSize="1rem">
35
+ 1rem.
36
+ </DxcTypography>
37
+ <DxcTypography display="block" fontSize="0.875rem">
38
+ 0.875rem.
39
+ </DxcTypography>
40
+ <DxcTypography display="block" fontSize="0.75rem">
41
+ 0.75rem.
42
+ </DxcTypography>
43
+ </ExampleContainer>
44
+ <ExampleContainer>
45
+ <Title title="Typography letter spacing" theme="light" level={4} />
46
+ <DxcTypography display="block" letterSpacing="-0.025em">
47
+ -0.025em.
48
+ </DxcTypography>
49
+ <DxcTypography display="block" letterSpacing="-0.0125em">
50
+ -0.0125em.
51
+ </DxcTypography>
52
+ <DxcTypography display="block" letterSpacing="0em">
53
+ 0em.
54
+ </DxcTypography>
55
+ <DxcTypography display="block" letterSpacing="0.025em">
56
+ 0.025em.
57
+ </DxcTypography>
58
+ <DxcTypography display="block" letterSpacing="0.05em">
59
+ 0.05em.
60
+ </DxcTypography>
61
+ <DxcTypography display="block" letterSpacing="0.1em">
62
+ 0.1em.
63
+ </DxcTypography>{" "}
64
+ </ExampleContainer>
65
+ <ExampleContainer>
66
+ <Title title="Typography line height" theme="light" level={4} />
67
+ <DxcTypography display="block" lineHeight="1em">
68
+ 1em.
69
+ </DxcTypography>
70
+ <DxcTypography display="block" lineHeight="1.25em">
71
+ 1.25em.
72
+ </DxcTypography>
73
+ <DxcTypography display="block" lineHeight="1.365em">
74
+ 1.365em.
75
+ </DxcTypography>
76
+ <DxcTypography display="block" lineHeight="1.5em">
77
+ 1.5em.
78
+ </DxcTypography>
79
+ <DxcTypography display="block" lineHeight="1.715em">
80
+ 1.715em.
81
+ </DxcTypography>
82
+ <DxcTypography display="block" lineHeight="2em">
83
+ 2em.
84
+ </DxcTypography>
85
+ </ExampleContainer>
86
+ <ExampleContainer>
87
+ <Title title="Typography font weight" theme="light" level={4} />
88
+ <DxcTypography display="block" fontWeight="300">
89
+ 300.
90
+ </DxcTypography>
91
+ <DxcTypography display="block" fontWeight="400">
92
+ 400.
93
+ </DxcTypography>
94
+ <DxcTypography display="block" fontWeight="600">
95
+ 600.
96
+ </DxcTypography>
97
+ <DxcTypography display="block" fontWeight="700">
98
+ 700.
99
+ </DxcTypography>
100
+ </ExampleContainer>
101
+ <ExampleContainer>
102
+ <Title title="Typography decoration" theme="light" level={4} />
103
+ <DxcTypography display="block" textDecoration="underline">
104
+ Underline.
105
+ </DxcTypography>
106
+ <DxcTypography display="block" textDecoration="line-through">
107
+ Line-through.
108
+ </DxcTypography>
109
+ </ExampleContainer>
110
+ <ExampleContainer>
111
+ <Title title="Typography font family" theme="light" level={4} />
112
+ <DxcTypography display="block" fontFamily="Open Sans, sans-serif">
113
+ Open Sans, sans-serif.
114
+ </DxcTypography>
115
+ <DxcTypography display="block" fontFamily="Source Code Pro, monospace">
116
+ Source Code Pro, monospace.
117
+ </DxcTypography>
118
+ </ExampleContainer>
119
+ <ExampleContainer>
120
+ <Title title="Typography font style" theme="light" level={4} />
121
+ <DxcTypography display="block" fontStyle="italic">
122
+ Italic.
123
+ </DxcTypography>
124
+ <DxcTypography display="block" fontStyle="normal">
125
+ Normal.
126
+ </DxcTypography>
127
+ </ExampleContainer>
128
+ <ExampleContainer>
129
+ <Title title="Typography align" theme="light" level={4} />
130
+ <DxcTypography display="block" textAlign="left">
131
+ Left.
132
+ </DxcTypography>
133
+ <DxcTypography display="block" textAlign="center">
134
+ Center.
135
+ </DxcTypography>
136
+ <DxcTypography display="block" textAlign="right">
137
+ Right.
138
+ </DxcTypography>
139
+ </ExampleContainer>
140
+ <ExampleContainer>
141
+ <Title title="Typography whitespace" theme="light" level={4} />
142
+ <div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
143
+ <DxcTypography whiteSpace="normal" fontSize="2rem">
144
+ {" "} Normal: A bunch of words you see.
145
+ </DxcTypography>
146
+ </div>
147
+ <div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
148
+ <DxcTypography whiteSpace="nowrap" fontSize="2rem">
149
+ {" "}No-wrap: A bunch of words you see.
150
+ </DxcTypography>
151
+ </div>
152
+ <div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
153
+ <DxcTypography whiteSpace="pre" fontSize="2rem">
154
+ {" "} pre: A bunch of words you see.
155
+ </DxcTypography>
156
+ </div>
157
+ <div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
158
+ <DxcTypography whiteSpace="pre-line" fontSize="2rem">
159
+ {" "}pre-line: A bunch of words you see.
160
+ </DxcTypography>
161
+ </div>
162
+ <div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
163
+ <DxcTypography whiteSpace="pre-wrap" fontSize="2rem">
164
+ {" "} pre-wrap: A bunch of words you see.
165
+ </DxcTypography>
166
+ </div>
167
+ </ExampleContainer>{" "}
168
+ <ExampleContainer>
169
+ <Title title="Typography display" theme="light" level={4} />
170
+ <DxcTypography display="block" textAlign="left">
171
+ Display Block.
172
+ <DxcTypography>A different text.</DxcTypography>
173
+ </DxcTypography>
174
+ <DxcTypography display="inline" textAlign="left">
175
+ Display Inline.
176
+ <DxcTypography>A different text.</DxcTypography>
177
+ </DxcTypography>
178
+ </ExampleContainer>
179
+ <ExampleContainer>
180
+ <Title title="Typography text-overflow" theme="light" level={4} />
181
+ <div style={{ width: "75px" }}>
182
+ <DxcTypography display="block" textOverflow="clip">
183
+ Overflow clip.
184
+ </DxcTypography>
185
+ </div>
186
+ <div style={{ width: "75px" }}>
187
+ <DxcTypography display="block" textOverflow="ellipsis">
188
+ Overflow ellipsis.
189
+ </DxcTypography>
190
+ </div>
191
+ <div style={{ width: "75px" }}>
192
+ <DxcTypography display="block" textOverflow="unset">
193
+ Overflow unset.
194
+ </DxcTypography>
195
+ </div>
196
+ </ExampleContainer>
197
+ </>
198
+ );
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ as?: keyof HTMLElementTagNameMap;
4
+ display?: "inline" | "block";
5
+ fontFamily?: "Open Sans, sans-serif" | "Source Code Pro, monospace";
6
+ fontSize?: "0.75rem" | "0.875rem" | "1rem" | "1.25rem" | "1.5rem" | "2rem" | "3rem" | "3.75rem";
7
+ fontStyle?: "italic" | "normal";
8
+ fontWeight?: "300" | "400" | "600" | "700";
9
+ letterSpacing?: "-0.025em" | "-0.0125em" | "0em" | "0.025em" | "0.05em" | "0.1em";
10
+ lineHeight?: "1em" | "1.25em" | "1.365em" | "1.5em" | "1.715em" | "2em";
11
+ textAlign?: "left" | "center" | "right";
12
+ color?: string;
13
+ textDecoration?: "none" | "underline" | "line-through";
14
+ textOverflow?: "clip" | "ellipsis" | "unset";
15
+ whiteSpace?: "normal" | "nowrap" | "pre" | "pre-line" | "pre-wrap";
16
+ children: React.ReactNode;
17
+ };
18
+ export default Props;
File without changes
@@ -0,0 +1,2 @@
1
+ declare const useTranslatedLabels: () => any;
2
+ export default useTranslatedLabels;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _variables = require("./common/variables");
11
+
12
+ var _HalstackContext = require("./HalstackContext");
13
+
14
+ var useTranslatedLabels = function useTranslatedLabels() {
15
+ var labels = (0, _react.useContext)(_HalstackContext.HalstackLanguageContext);
16
+ return labels || _variables.defaultTranslatedComponentLabels;
17
+ };
18
+
19
+ var _default = useTranslatedLabels;
20
+ exports["default"] = _default;
package/wizard/Wizard.js CHANGED
@@ -139,17 +139,14 @@ var DxcWizard = function DxcWizard(_ref) {
139
139
  current: i === renderedCurrent,
140
140
  visited: i < renderedCurrent,
141
141
  disabled: step.disabled
142
- }, step.icon ? /*#__PURE__*/_react["default"].createElement(StepIconContainer, {
143
- disabled: step.disabled
144
- }, typeof step.icon === "string" ? /*#__PURE__*/_react["default"].createElement(Icon, {
142
+ }, step.icon ? /*#__PURE__*/_react["default"].createElement(StepIconContainer, null, typeof step.icon === "string" ? /*#__PURE__*/_react["default"].createElement(Icon, {
145
143
  src: step.icon
146
- }) : step.icon) : /*#__PURE__*/_react["default"].createElement(Number, {
147
- disabled: step.disabled,
148
- current: i === renderedCurrent
149
- }, i + 1)), step.valid !== undefined && (step.valid ? /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.validIcon) : /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.invalidIcon))), (step.label || step.description) && /*#__PURE__*/_react["default"].createElement(InfoContainer, null, step.label && /*#__PURE__*/_react["default"].createElement(Label, {
144
+ }) : step.icon) : /*#__PURE__*/_react["default"].createElement(Number, null, i + 1)), step.valid !== undefined && (step.valid ? /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.validIcon) : /*#__PURE__*/_react["default"].createElement(ValidityIconContainer, null, icons.invalidIcon))), (step.label || step.description) && /*#__PURE__*/_react["default"].createElement(InfoContainer, null, step.label && /*#__PURE__*/_react["default"].createElement(Label, {
145
+ current: i === renderedCurrent,
150
146
  disabled: step.disabled,
151
147
  visited: i <= innerCurrent
152
148
  }, step.label), step.description && /*#__PURE__*/_react["default"].createElement(Description, {
149
+ current: i === renderedCurrent,
153
150
  disabled: step.disabled,
154
151
  visited: i <= innerCurrent
155
152
  }, step.description))), i === steps.length - 1 ? "" : /*#__PURE__*/_react["default"].createElement(StepSeparator, {
@@ -158,7 +155,7 @@ var DxcWizard = function DxcWizard(_ref) {
158
155
  })));
159
156
  };
160
157
 
161
- var StepsContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n justify-content: \"center\";\n ", ";\n font-family: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
158
+ var StepsContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n justify-content: center;\n ", ";\n font-family: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
162
159
  return props.mode === "vertical" ? "column" : "row";
163
160
  }, function (props) {
164
161
  return props.mode === "vertical" && "height: 500px";
@@ -177,16 +174,16 @@ var StepsContainer = _styledComponents["default"].div(_templateObject || (_templ
177
174
  });
178
175
 
179
176
  var StepContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n ", "\n flex-grow: ", ";\n flex-direction: ", ";\n ", "\n"])), function (props) {
180
- return props.mode === "vertical" ? "" : "align-items: center;";
177
+ return props.mode !== "vertical" && "align-items: center;";
181
178
  }, function (props) {
182
179
  return props.lastStep ? "0" : "1";
183
180
  }, function (props) {
184
181
  return props.mode === "vertical" ? "column" : "row";
185
182
  }, function (props) {
186
- return props.mode === "vertical" ? "width: 100%;" : "";
183
+ return props.mode === "vertical" && "width: fit-content;";
187
184
  });
188
185
 
189
- var Step = _styledComponents["default"].button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n border: none;\n background: inherit;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: ", ";\n\n padding: 0px;\n ", ";\n\n &:hover {\n ", ";\n }\n &:focus {\n outline: ", " auto 1px;\n }\n"])), function (props) {
186
+ var Step = _styledComponents["default"].button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: flex-start;\n align-items: center;\n border: none;\n border-radius: 0.25rem;\n background: inherit;\n margin: ", ";\n\n padding: 0px;\n ", ";\n\n &:hover {\n ", ";\n }\n &:focus {\n outline: 2px solid ", ";\n }\n"])), function (props) {
190
187
  return props.first ? props.mode === "vertical" ? "0 0 24px 0" : "0 24px 0 0" : props.last ? props.mode === "vertical" ? "24px 0 0 0" : "0 0 0 24px" : props.mode === "vertical" ? "24px 0" : "0 24px";
191
188
  }, function (props) {
192
189
  return props.disabled ? "cursor: not-allowed" : "";
@@ -200,40 +197,40 @@ var StepHeader = _styledComponents["default"].div(_templateObject4 || (_template
200
197
  return props.validityIcon && "padding-bottom: 4px;";
201
198
  });
202
199
 
203
- var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n\n ", "\n ", ";\n\n border-radius: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n"])), function (props) {
204
- return props.disabled ? props.theme.disabledCircleWidth : props.current ? props.theme.selectedCircleWidth : props.theme.circleWidth;
200
+ var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n\n ", "\n ", ";\n\n border-radius: ", ";\n\n display: flex;\n justify-content: center;\n align-items: center;\n"])), function (props) {
201
+ return props.disabled ? props.theme.disabledStepWidth : props.current ? props.theme.selectedStepWidth : props.theme.stepWidth;
205
202
  }, function (props) {
206
- return props.disabled ? props.theme.disabledCircleHeight : props.current ? props.theme.selectedCircleHeight : props.theme.circleHeight;
203
+ return props.disabled ? props.theme.disabledStepHeight : props.current ? props.theme.selectedStepHeight : props.theme.stepHeight;
207
204
  }, function (props) {
208
- return "\n ".concat(!props.current && !props.disabled ? "border: ".concat(props.theme.circleBorderThickness, " ").concat(props.theme.circleBorderStyle, " ").concat(props.theme.circleBorderColor, ";") : props.current && !props.disabled ? "border: ".concat(props.theme.selectedCircleBorderThickness, " ").concat(props.theme.selectedCircleBorderStyle, " ").concat(props.theme.selectedCircleBorderColor, ";") : props.disabled ? "border: ".concat(props.theme.disabledCircleBorderThickness, " ").concat(props.theme.disabledCircleBorderStyle, " ").concat(props.theme.disabledCircleBorderColor, ";") : "", "\n background: ").concat(props.disabled ? "".concat(props.theme.disabledBackgroundColor) : props.current ? "".concat(props.theme.stepContainerSelectedBackgroundColor) : "".concat(props.theme.stepContainerBackgroundColor), ";\n ");
205
+ return "\n ".concat(props.disabled ? "border: ".concat(props.theme.disabledStepBorderThickness, " ").concat(props.theme.disabledStepBorderStyle, " ").concat(props.theme.disabledStepBorderColor, ";") : props.current ? "border: ".concat(props.theme.selectedStepBorderThickness, " ").concat(props.theme.selectedStepBorderStyle, " ").concat(props.theme.selectedStepBorderColor, ";") : props.visited ? "border: ".concat(props.theme.stepBorderThickness, " ").concat(props.theme.stepBorderStyle, " ").concat(props.theme.visitedStepBorderColor, ";") : "border: ".concat(props.theme.stepBorderThickness, " ").concat(props.theme.stepBorderStyle, " ").concat(props.theme.unvisitedStepBorderColor, ";"), "\n background: ").concat(props.disabled ? "".concat(props.theme.disabledStepBackgroundColor) : props.current ? "".concat(props.theme.selectedStepBackgroundColor) : !props.visited ? "".concat(props.theme.unvisitedStepBackgroundColor) : "".concat(props.theme.visitedStepBackgroundColor), ";\n ");
209
206
  }, function (props) {
210
- return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.current ? props.theme.stepContainerSelectedFontColor : props.theme.stepContainerFontColor, ";");
207
+ return props.disabled ? "color: ".concat(props.theme.disabledStepFontColor, ";") : "color: ".concat(props.current ? props.theme.selectedStepFontColor : !props.visited ? props.theme.unvisitedStepFontColor : props.theme.visitedStepFontColor, ";");
211
208
  }, function (props) {
212
- return !props.current && !props.disabled ? props.theme.circleBorderRadius : props.current ? props.theme.selectedCircleBorderRadius : props.disabled ? props.theme.disabledCircleBorderRadius : "";
209
+ return !props.current && !props.disabled ? props.theme.stepBorderRadius : props.current ? props.theme.selectedStepBorderRadius : props.disabled ? props.theme.disabledStepBorderRadius : "";
213
210
  });
214
211
 
215
212
  var Icon = _styledComponents["default"].img(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n"])), function (props) {
216
- return props.theme.stepContainerIconSize;
213
+ return props.theme.stepIconSize;
217
214
  }, function (props) {
218
- return props.theme.stepContainerIconSize;
215
+ return props.theme.stepIconSize;
219
216
  });
220
217
 
221
218
  var StepIconContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n overflow: hidden;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
222
- return props.theme.stepContainerIconSize;
219
+ return props.theme.stepIconSize;
223
220
  }, function (props) {
224
- return props.theme.stepContainerIconSize;
221
+ return props.theme.stepIconSize;
225
222
  });
226
223
 
227
224
  var Number = _styledComponents["default"].p(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n opacity: 1;\n margin: 0px 0px 0px 1px;\n"])), function (props) {
228
- return props.theme.stepContainerFontSize;
225
+ return props.theme.stepFontSize;
229
226
  }, function (props) {
230
- return props.theme.stepContainerFontFamily;
227
+ return props.theme.stepFontFamily;
231
228
  }, function (props) {
232
- return props.theme.stepContainerFontStyle;
229
+ return props.theme.stepFontStyle;
233
230
  }, function (props) {
234
- return props.theme.stepContainerFontWeight;
231
+ return props.theme.stepFontWeight;
235
232
  }, function (props) {
236
- return props.theme.stepContainerLetterSpacing;
233
+ return props.theme.stepFontTracking;
237
234
  });
238
235
 
239
236
  var ValidityIconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n width: 18px;\n height: 18px;\n position: absolute;\n top: 22.5px;\n left: 22.5px;\n"])));
@@ -251,37 +248,35 @@ var Label = _styledComponents["default"].p(_templateObject11 || (_templateObject
251
248
  }, function (props) {
252
249
  return props.theme.labelFontWeight;
253
250
  }, function (props) {
254
- return props.theme.labelLetterSpacing;
251
+ return props.theme.labelFontTracking;
255
252
  }, function (props) {
256
- return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedLabelFontColor : props.theme.labelFontColor, ";");
253
+ return props.disabled ? "color: ".concat(props.theme.disabledLabelFontColor, ";") : "color: ".concat(!props.visited ? props.theme.unvisitedLabelFontColor : props.current ? props.theme.selectedLabelFontColor : props.theme.visitedLabelFontColor, ";");
257
254
  }, function (props) {
258
255
  return props.theme.labelFontTextTransform;
259
256
  });
260
257
 
261
258
  var Description = _styledComponents["default"].p(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n text-align: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n ", ";\n margin: 0;\n"])), function (props) {
262
- return props.theme.descriptionTextAlign;
259
+ return props.theme.helperTextTextAlign;
263
260
  }, function (props) {
264
- return props.theme.descriptionFontFamily;
261
+ return props.theme.helperTextFontFamily;
265
262
  }, function (props) {
266
- return props.theme.descriptionFontSize;
263
+ return props.theme.helperTextFontSize;
267
264
  }, function (props) {
268
- return props.theme.descriptionFontStyle;
265
+ return props.theme.helperTextFontStyle;
269
266
  }, function (props) {
270
- return props.theme.descriptionFontWeight;
267
+ return props.theme.helperTextFontWeight;
271
268
  }, function (props) {
272
- return props.theme.descriptionLetterSpacing;
269
+ return props.theme.helperTextFontTracking;
273
270
  }, function (props) {
274
- return props.theme.descriptionFontTextTransform;
271
+ return props.theme.helperTextFontTextTransform;
275
272
  }, function (props) {
276
- return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedDescriptionFontColor : props.theme.descriptionFontColor, ";");
273
+ return props.disabled ? "color: ".concat(props.theme.disabledHelperTextFontColor, ";") : "color: ".concat(!props.visited ? props.theme.unvisitedHelperTextFontColor : props.current ? props.theme.selectedHelperTextFontColor : props.theme.visitedHelperTextFontColor, ";");
277
274
  });
278
275
 
279
- var StepSeparator = _styledComponents["default"].div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"])), function (props) {
280
- return props.mode === "horizontal" ? "" : "0";
281
- }, function (props) {
282
- return props.mode === "horizontal" ? "0" : "";
276
+ var StepSeparator = _styledComponents["default"].div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"])), function (props) {
277
+ return props.mode === "horizontal" ? "height: 0;" : "width: 0;";
283
278
  }, function (props) {
284
- return props.mode === "vertical" ? "margin: 0 18px;" : "";
279
+ return props.mode === "vertical" && "margin: 0 18px;";
285
280
  }, function (props) {
286
281
  return "".concat(props.theme.separatorBorderStyle, " ").concat(props.theme.separatorBorderThickness, " ").concat(props.theme.separatorColor);
287
282
  });
@@ -132,14 +132,28 @@ export const Chromatic = () => (
132
132
  <ExampleContainer>
133
133
  <Title title="Current step in the third step, labels and description" theme="light" level={4} />
134
134
  <DxcWizard defaultCurrentStep={2} steps={stepWithLabelDescription}></DxcWizard>
135
+ </ExampleContainer>
136
+ <ExampleContainer>
135
137
  <Title title="With long description in horizontal" theme="light" level={4} />
136
138
  <DxcWizard steps={stepWithLongDescription}></DxcWizard>
139
+ </ExampleContainer>
140
+ <ExampleContainer>
137
141
  <Title title="With long description in vertical" theme="light" level={4} />
138
142
  <DxcWizard mode="vertical" steps={stepWithLongDescription}></DxcWizard>
143
+ </ExampleContainer>
144
+ <ExampleContainer>
139
145
  <Title title="Disabled steps" theme="light" level={4} />
140
146
  <DxcWizard steps={stepDisabled}></DxcWizard>
147
+ </ExampleContainer>
148
+ <ExampleContainer pseudoState="pseudo-focus">
149
+ <Title title="Focused steps" theme="light" level={4} />
150
+ <DxcWizard steps={stepIcons}></DxcWizard>
151
+ </ExampleContainer>
152
+ <ExampleContainer>
141
153
  <Title title="With icons" theme="light" level={4} />
142
154
  <DxcWizard steps={stepIcons}></DxcWizard>
155
+ </ExampleContainer>
156
+ <ExampleContainer>
143
157
  <Title title="With large icons" theme="light" level={4} />
144
158
  <DxcWizard steps={stepLargeIcons}></DxcWizard>
145
159
  </ExampleContainer>
@@ -204,7 +218,12 @@ export const Chromatic = () => (
204
218
  </>
205
219
  );
206
220
 
207
- const WizardSelected = () => <DxcWizard steps={stepWithLabel}></DxcWizard>;
221
+ const WizardSelected = () => (
222
+ <ExampleContainer>
223
+ <Title title="Clicked step" theme="light" level={4} />
224
+ <DxcWizard steps={stepWithLabel} mode="vertical"></DxcWizard>
225
+ </ExampleContainer>
226
+ );
208
227
 
209
228
  export const WizardStepActived = WizardSelected.bind({});
210
229
  WizardStepActived.play = async ({ canvasElement }) => {
package/wizard/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- declare type Margin = {
2
+ export declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ export declare type Margin = {
4
4
  top?: Space;
5
5
  bottom?: Space;
6
6
  left?: Space;
@@ -29,11 +29,12 @@ declare type Step = {
29
29
  */
30
30
  valid?: boolean;
31
31
  };
32
+ export declare type Mode = "horizontal" | "vertical";
32
33
  declare type Props = {
33
34
  /**
34
35
  * The wizard can be showed in horizontal or vertical.
35
36
  */
36
- mode?: "horizontal" | "vertical";
37
+ mode?: Mode;
37
38
  /**
38
39
  * Initially selected step, only when it is uncontrolled.
39
40
  */
package/list/List.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import ListPropsType from "./types";
3
- declare function List({ children, type, gutter }: ListPropsType): JSX.Element;
4
- export default List;
package/list/List.js DELETED
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
-
12
- var _react = _interopRequireDefault(require("react"));
13
-
14
- var _styledComponents = _interopRequireDefault(require("styled-components"));
15
-
16
- var _Stack = _interopRequireDefault(require("../stack/Stack"));
17
-
18
- var _Text = _interopRequireDefault(require("../text/Text"));
19
-
20
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
21
-
22
- function List(_ref) {
23
- var children = _ref.children,
24
- _ref$type = _ref.type,
25
- type = _ref$type === void 0 ? "disc" : _ref$type,
26
- _ref$gutter = _ref.gutter,
27
- gutter = _ref$gutter === void 0 ? "xxsmall" : _ref$gutter;
28
- return /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
29
- as: type === "number" ? "ol" : "ul",
30
- gutter: gutter
31
- }, _react["default"].Children.map(children, function (child, index) {
32
- return /*#__PURE__*/_react["default"].createElement(ListItem, null, type === "number" ? /*#__PURE__*/_react["default"].createElement(Number, null, /*#__PURE__*/_react["default"].createElement(_Text["default"], null, index + 1, ".")) : type === "square" ? /*#__PURE__*/_react["default"].createElement(Square, null) : type === "circle" ? /*#__PURE__*/_react["default"].createElement(Circle, null) : /*#__PURE__*/_react["default"].createElement(Disc, null), child);
33
- }));
34
- }
35
-
36
- var Number = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n user-select: none;\n margin-right: 10px;\n flex-shrink: 0;\n"])));
37
-
38
- var Square = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: black;\n width: 5px;\n height: 5px;\n flex-shrink: 0;\n margin-top: 10px;\n margin-right: 10px;\n"])));
39
-
40
- var Circle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n width: 5px;\n height: 5px;\n border-radius: 50%;\n border: 1px solid black;\n flex-shrink: 0;\n margin-top: 10px;\n margin-right: 10px;\n box-sizing: border-box;\n"])));
41
-
42
- var Disc = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: black;\n width: 5px;\n height: 5px;\n border-radius: 50%;\n flex-shrink: 0;\n margin-top: 10px;\n margin-right: 10px;\n"])));
43
-
44
- var ListItem = _styledComponents["default"].li(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n padding: 0px;\n list-style: none;\n display: flex;\n"])));
45
-
46
- var _default = List;
47
- exports["default"] = _default;
@@ -1,95 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import Title from "../../.storybook/components/Title";
4
- import DxcList from "./List";
5
- import DxcText from "../text/Text";
6
-
7
- export default {
8
- title: "List",
9
- component: DxcList,
10
- };
11
-
12
- export const Chromatic = () => (
13
- <>
14
- <Title title="Default list" theme="light" level={4} />
15
- <DxcList>
16
- <DxcText>Text 1.</DxcText>
17
- <DxcText>Text 2.</DxcText>
18
- </DxcList>
19
- <Title title="Number" theme="light" level={4} />
20
- <DxcList type="number">
21
- <DxcText>Text 1.</DxcText>
22
- <DxcText>Text 2.</DxcText>
23
- </DxcList>
24
- <Title title="Square" theme="light" level={4} />
25
- <DxcList type="square">
26
- <DxcText>Text 1.</DxcText>
27
- <DxcText>Text 2.</DxcText>
28
- </DxcList>
29
- <Title title="Circle" theme="light" level={4} />
30
- <DxcList type="circle">
31
- <DxcText>Text 1.</DxcText>
32
- <DxcText>Text 2.</DxcText>
33
- </DxcList>
34
- <Title title="Multiple lines" theme="light" level={4} />
35
- <Container>
36
- <DxcList>
37
- <DxcText>
38
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
39
- magna aliqua.
40
- </DxcText>
41
- <DxcText>Text 2.</DxcText>
42
- </DxcList>
43
- </Container>
44
- <Title title="gutter = xxxsmall" theme="light" level={4} />
45
- <DxcList gutter="xxsmall">
46
- <DxcText>Text 1.</DxcText>
47
- <DxcText>Text 2.</DxcText>
48
- </DxcList>
49
- <Title title="gutter = xxsmall" theme="light" level={4} />
50
- <DxcList gutter="xxsmall">
51
- <DxcText>Text 1.</DxcText>
52
- <DxcText>Text 2.</DxcText>
53
- </DxcList>
54
- <Title title="gutter = xsmall" theme="light" level={4} />
55
- <DxcList gutter="xsmall">
56
- <DxcText>Text 1.</DxcText>
57
- <DxcText>Text 2.</DxcText>
58
- </DxcList>
59
- <Title title="gutter = small" theme="light" level={4} />
60
- <DxcList gutter="small">
61
- <DxcText>Text 1.</DxcText>
62
- <DxcText>Text 2.</DxcText>
63
- </DxcList>
64
- <Title title="gutter = medium" theme="light" level={4} />
65
- <DxcList gutter="medium">
66
- <DxcText>Text 1.</DxcText>
67
- <DxcText>Text 2.</DxcText>
68
- </DxcList>
69
- <Title title="gutter = large" theme="light" level={4} />
70
- <DxcList gutter="large">
71
- <DxcText>Text 1.</DxcText>
72
- <DxcText>Text 2.</DxcText>
73
- </DxcList>
74
- <Title title="gutter = xlarge" theme="light" level={4} />
75
- <DxcList gutter="xlarge">
76
- <DxcText>Text 1.</DxcText>
77
- <DxcText>Text 2.</DxcText>
78
- </DxcList>
79
- <Title title="gutter = xxlarge" theme="light" level={4} />
80
- <DxcList gutter="xxlarge">
81
- <DxcText>Text 1.</DxcText>
82
- <DxcText>Text 2.</DxcText>
83
- </DxcList>
84
- <Title title="gutter = xxxlarge" theme="light" level={4} />
85
- <DxcList gutter="xxxlarge">
86
- <DxcText>Text 1.</DxcText>
87
- <DxcText>Text 2.</DxcText>
88
- </DxcList>
89
-
90
- </>
91
- );
92
-
93
- const Container = styled.div`
94
- width: 400px;
95
- `;
package/list/types.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- declare type Props = {
3
- children: React.ReactNode;
4
- gutter?: "none" | "xxxsmall" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
5
- type?: "disc" | "circle" | "square" | "number";
6
- };
7
- export default Props;
package/radio/Radio.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import RadioPropsType from "./types";
3
- declare const DxcRadio: ({ checked, value, label, labelPosition, name, disabled, onClick, required, margin, size, }: RadioPropsType) => JSX.Element;
4
- export default DxcRadio;