@dxc-technology/halstack-react 0.0.0-8aa8e6b → 0.0.0-8c10296

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 (97) hide show
  1. package/HalstackContext.d.ts +4 -2
  2. package/HalstackContext.js +110 -58
  3. package/alert/Alert.js +4 -1
  4. package/badge/Badge.d.ts +1 -1
  5. package/badge/Badge.js +5 -3
  6. package/badge/types.d.ts +1 -0
  7. package/bleed/Bleed.js +1 -34
  8. package/bleed/Bleed.stories.tsx +31 -32
  9. package/bleed/types.d.ts +1 -1
  10. package/box/Box.js +22 -32
  11. package/button/Button.js +3 -1
  12. package/card/Card.js +34 -36
  13. package/checkbox/Checkbox.js +4 -1
  14. package/common/variables.js +176 -78
  15. package/date-input/DateInput.js +5 -2
  16. package/file-input/FileInput.js +9 -6
  17. package/file-input/FileItem.js +7 -5
  18. package/footer/Footer.js +7 -5
  19. package/header/Header.js +7 -4
  20. package/inline/Inline.d.ts +4 -0
  21. package/inline/Inline.js +54 -0
  22. package/inline/Inline.stories.tsx +240 -0
  23. package/inline/types.d.ts +32 -0
  24. package/{quick-nav-container → inline}/types.js +0 -0
  25. package/inset/Inset.js +1 -34
  26. package/inset/Inset.stories.tsx +32 -32
  27. package/inset/types.d.ts +1 -1
  28. package/layout/ApplicationLayout.d.ts +4 -3
  29. package/layout/ApplicationLayout.js +83 -102
  30. package/layout/ApplicationLayout.stories.tsx +14 -59
  31. package/layout/Icons.d.ts +5 -0
  32. package/layout/Icons.js +13 -2
  33. package/layout/SidenavContext.d.ts +5 -0
  34. package/layout/SidenavContext.js +19 -0
  35. package/layout/types.d.ts +5 -10
  36. package/link/Link.d.ts +3 -2
  37. package/link/Link.js +57 -70
  38. package/link/Link.stories.tsx +87 -52
  39. package/link/Link.test.js +7 -15
  40. package/link/types.d.ts +7 -23
  41. package/main.d.ts +5 -4
  42. package/main.js +25 -11
  43. package/number-input/types.d.ts +1 -1
  44. package/package.json +2 -1
  45. package/paginator/Paginator.js +17 -38
  46. package/paginator/Paginator.test.js +42 -0
  47. package/password-input/PasswordInput.js +7 -4
  48. package/password-input/PasswordInput.test.js +1 -2
  49. package/password-input/types.d.ts +1 -1
  50. package/progress-bar/ProgressBar.js +1 -1
  51. package/progress-bar/ProgressBar.stories.jsx +11 -11
  52. package/quick-nav/QuickNav.js +65 -17
  53. package/quick-nav/QuickNav.stories.tsx +2 -2
  54. package/quick-nav/types.d.ts +1 -1
  55. package/radio-group/Radio.js +1 -1
  56. package/radio-group/RadioGroup.js +8 -6
  57. package/resultsetTable/ResultsetTable.test.js +42 -0
  58. package/select/Listbox.d.ts +1 -1
  59. package/select/Listbox.js +35 -8
  60. package/select/Select.js +83 -78
  61. package/select/Select.stories.tsx +144 -100
  62. package/select/Select.test.js +299 -194
  63. package/select/types.d.ts +3 -4
  64. package/sidenav/Sidenav.d.ts +1 -1
  65. package/sidenav/Sidenav.js +20 -9
  66. package/spinner/Spinner.js +1 -1
  67. package/switch/Switch.js +4 -1
  68. package/tabs-nav/NavTabs.d.ts +8 -0
  69. package/tabs-nav/NavTabs.js +125 -0
  70. package/tabs-nav/NavTabs.stories.tsx +170 -0
  71. package/tabs-nav/NavTabs.test.js +82 -0
  72. package/tabs-nav/Tab.d.ts +4 -0
  73. package/tabs-nav/Tab.js +132 -0
  74. package/tabs-nav/types.d.ts +53 -0
  75. package/{radio → tabs-nav}/types.js +0 -0
  76. package/text-input/Suggestion.d.ts +4 -0
  77. package/text-input/Suggestion.js +55 -0
  78. package/text-input/TextInput.js +46 -72
  79. package/text-input/TextInput.test.js +1 -1
  80. package/text-input/types.d.ts +14 -2
  81. package/textarea/Textarea.js +10 -19
  82. package/textarea/types.d.ts +1 -1
  83. package/useTranslatedLabels.d.ts +2 -0
  84. package/useTranslatedLabels.js +20 -0
  85. package/wizard/Wizard.js +27 -25
  86. package/quick-nav-container/HeadingLink.d.ts +0 -8
  87. package/quick-nav-container/HeadingLink.js +0 -58
  88. package/quick-nav-container/QuickNavContainer.d.ts +0 -4
  89. package/quick-nav-container/QuickNavContainer.js +0 -69
  90. package/quick-nav-container/Section.d.ts +0 -9
  91. package/quick-nav-container/Section.js +0 -37
  92. package/quick-nav-container/types.d.ts +0 -34
  93. package/radio/Radio.d.ts +0 -4
  94. package/radio/Radio.js +0 -173
  95. package/radio/Radio.stories.tsx +0 -192
  96. package/radio/Radio.test.js +0 -71
  97. package/radio/types.d.ts +0 -54
@@ -122,7 +122,7 @@ declare type Props = {
122
122
  */
123
123
  margin?: Space | Margin;
124
124
  /**
125
- * Size of the component ('small' | 'medium' | 'large' | 'fillParent').
125
+ * Size of the component.
126
126
  */
127
127
  size?: "small" | "medium" | "large" | "fillParent";
128
128
  /**
@@ -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
@@ -147,9 +147,11 @@ var DxcWizard = function DxcWizard(_ref) {
147
147
  disabled: step.disabled,
148
148
  current: i === renderedCurrent
149
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, {
150
+ current: i === renderedCurrent,
150
151
  disabled: step.disabled,
151
152
  visited: i <= innerCurrent
152
153
  }, step.label), step.description && /*#__PURE__*/_react["default"].createElement(Description, {
154
+ current: i === renderedCurrent,
153
155
  disabled: step.disabled,
154
156
  visited: i <= innerCurrent
155
157
  }, step.description))), i === steps.length - 1 ? "" : /*#__PURE__*/_react["default"].createElement(StepSeparator, {
@@ -200,40 +202,40 @@ var StepHeader = _styledComponents["default"].div(_templateObject4 || (_template
200
202
  return props.validityIcon && "padding-bottom: 4px;";
201
203
  });
202
204
 
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;
205
+ 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) {
206
+ return props.disabled ? props.theme.disabledStepWidth : props.current ? props.theme.selectedStepWidth : props.theme.stepWidth;
205
207
  }, function (props) {
206
- return props.disabled ? props.theme.disabledCircleHeight : props.current ? props.theme.selectedCircleHeight : props.theme.circleHeight;
208
+ return props.disabled ? props.theme.disabledStepHeight : props.current ? props.theme.selectedStepHeight : props.theme.stepHeight;
207
209
  }, 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 ");
210
+ 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
211
  }, function (props) {
210
- return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.current ? props.theme.stepContainerSelectedFontColor : props.theme.stepContainerFontColor, ";");
212
+ return props.disabled ? "color: ".concat(props.theme.disabledStepFontColor, ";") : "color: ".concat(props.current ? props.theme.selectedStepFontColor : !props.visited ? props.theme.unvisitedStepFontColor : props.theme.visitedStepFontColor, ";");
211
213
  }, function (props) {
212
- return !props.current && !props.disabled ? props.theme.circleBorderRadius : props.current ? props.theme.selectedCircleBorderRadius : props.disabled ? props.theme.disabledCircleBorderRadius : "";
214
+ return !props.current && !props.disabled ? props.theme.stepBorderRadius : props.current ? props.theme.selectedStepBorderRadius : props.disabled ? props.theme.disabledStepBorderRadius : "";
213
215
  });
214
216
 
215
217
  var Icon = _styledComponents["default"].img(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n"])), function (props) {
216
- return props.theme.stepContainerIconSize;
218
+ return props.theme.stepIconSize;
217
219
  }, function (props) {
218
- return props.theme.stepContainerIconSize;
220
+ return props.theme.stepIconSize;
219
221
  });
220
222
 
221
223
  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;
224
+ return props.theme.stepIconSize;
223
225
  }, function (props) {
224
- return props.theme.stepContainerIconSize;
226
+ return props.theme.stepIconSize;
225
227
  });
226
228
 
227
229
  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;
230
+ return props.theme.stepFontSize;
229
231
  }, function (props) {
230
- return props.theme.stepContainerFontFamily;
232
+ return props.theme.stepFontFamily;
231
233
  }, function (props) {
232
- return props.theme.stepContainerFontStyle;
234
+ return props.theme.stepFontStyle;
233
235
  }, function (props) {
234
- return props.theme.stepContainerFontWeight;
236
+ return props.theme.stepFontWeight;
235
237
  }, function (props) {
236
- return props.theme.stepContainerLetterSpacing;
238
+ return props.theme.stepFontTracking;
237
239
  });
238
240
 
239
241
  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,29 +253,29 @@ var Label = _styledComponents["default"].p(_templateObject11 || (_templateObject
251
253
  }, function (props) {
252
254
  return props.theme.labelFontWeight;
253
255
  }, function (props) {
254
- return props.theme.labelLetterSpacing;
256
+ return props.theme.labelFontTracking;
255
257
  }, function (props) {
256
- return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedLabelFontColor : props.theme.labelFontColor, ";");
258
+ return props.disabled ? "color: ".concat(props.theme.disabledLabelFontColor, ";") : "color: ".concat(!props.visited ? props.theme.unvisitedLabelFontColor : props.current ? props.theme.selectedLabelFontColor : props.theme.visitedLabelFontColor, ";");
257
259
  }, function (props) {
258
260
  return props.theme.labelFontTextTransform;
259
261
  });
260
262
 
261
263
  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;
264
+ return props.theme.helperTextTextAlign;
263
265
  }, function (props) {
264
- return props.theme.descriptionFontFamily;
266
+ return props.theme.helperTextFontFamily;
265
267
  }, function (props) {
266
- return props.theme.descriptionFontSize;
268
+ return props.theme.helperTextFontSize;
267
269
  }, function (props) {
268
- return props.theme.descriptionFontStyle;
270
+ return props.theme.helperTextFontStyle;
269
271
  }, function (props) {
270
- return props.theme.descriptionFontWeight;
272
+ return props.theme.helperTextFontWeight;
271
273
  }, function (props) {
272
- return props.theme.descriptionLetterSpacing;
274
+ return props.theme.helperTextFontTracking;
273
275
  }, function (props) {
274
- return props.theme.descriptionFontTextTransform;
276
+ return props.theme.helperTextFontTextTransform;
275
277
  }, function (props) {
276
- return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedDescriptionFontColor : props.theme.descriptionFontColor, ";");
278
+ return props.disabled ? "color: ".concat(props.theme.disabledHelperTextFontColor, ";") : "color: ".concat(!props.visited ? props.theme.unvisitedHelperTextFontColor : props.current ? props.theme.selectedHelperTextFontColor : props.theme.visitedHelperTextFontColor, ";");
277
279
  });
278
280
 
279
281
  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) {
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- declare type HeadingLinkProps = {
3
- children: string;
4
- level?: 1 | 2 | 3 | 4 | 5;
5
- as?: "h1" | "h2" | "h3" | "h4" | "h5";
6
- };
7
- declare function HeadingLink({ children, level, as }: HeadingLinkProps): JSX.Element;
8
- export default HeadingLink;
@@ -1,58 +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 _slugify = _interopRequireDefault(require("slugify"));
17
-
18
- var _Heading = _interopRequireDefault(require("../heading/Heading"));
19
-
20
- var _templateObject, _templateObject2;
21
-
22
- function HeadingLink(_ref) {
23
- var children = _ref.children,
24
- level = _ref.level,
25
- as = _ref.as;
26
- var elementId = (0, _slugify["default"])(children, {
27
- lower: true
28
- });
29
- return /*#__PURE__*/_react["default"].createElement(HeadingLinkContainer, {
30
- id: elementId
31
- }, /*#__PURE__*/_react["default"].createElement(HeadingAnchor, {
32
- href: "#".concat(elementId)
33
- }, linkIcon), /*#__PURE__*/_react["default"].createElement(_Heading["default"], {
34
- weight: "bold",
35
- text: children,
36
- level: level,
37
- as: as
38
- }));
39
- }
40
-
41
- var linkIcon = /*#__PURE__*/_react["default"].createElement("svg", {
42
- "aria-hidden": "true",
43
- role: "img",
44
- viewBox: "0 0 16 16",
45
- width: "16",
46
- height: "16",
47
- fill: "currentColor"
48
- }, /*#__PURE__*/_react["default"].createElement("path", {
49
- fillRule: "evenodd",
50
- d: "M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"
51
- }));
52
-
53
- var HeadingLinkContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n scroll-margin-top: 64px;\n &:hover svg {\n opacity: 0.5;\n }\n"])));
54
-
55
- var HeadingAnchor = _styledComponents["default"].a(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: inherit;\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n padding: 8px;\n margin-left: -32px;\n & svg {\n width: 16px;\n height: 16px;\n opacity: 0;\n }\n &:focus {\n outline-color: #0095ff;\n outline-offset: -0.25rem;\n svg {\n opacity: 0.5;\n }\n }\n"])));
56
-
57
- var _default = HeadingLink;
58
- exports["default"] = _default;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import QuickNavContainerTypes from "./types";
3
- declare const DxcQuickNavContainer: ({ title, sections, startHeadingLevel }: QuickNavContainerTypes) => JSX.Element;
4
- export default DxcQuickNavContainer;
@@ -1,69 +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 _QuickNav = _interopRequireDefault(require("../quick-nav/QuickNav"));
17
-
18
- var _Stack = _interopRequireDefault(require("../stack/Stack"));
19
-
20
- var _Section = _interopRequireDefault(require("./Section"));
21
-
22
- var _templateObject, _templateObject2, _templateObject3;
23
-
24
- var DxcQuickNavContainer = function DxcQuickNavContainer(_ref) {
25
- var title = _ref.title,
26
- sections = _ref.sections,
27
- _ref$startHeadingLeve = _ref.startHeadingLevel,
28
- startHeadingLevel = _ref$startHeadingLeve === void 0 ? 1 : _ref$startHeadingLeve;
29
-
30
- var getSubSectionsLinks = function getSubSectionsLinks(sections) {
31
- var linksList = [];
32
- sections.map(function (section) {
33
- if (section.subSections) {
34
- linksList.push({
35
- label: section.title,
36
- links: getSubSectionsLinks(section.subSections)
37
- });
38
- } else {
39
- linksList.push({
40
- label: section.title
41
- });
42
- }
43
- });
44
- return linksList;
45
- };
46
-
47
- return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(ContentContainer, null, /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
48
- gutter: "xlarge"
49
- }, sections.map(function (section) {
50
- return /*#__PURE__*/_react["default"].createElement(_Section["default"], {
51
- title: section.title,
52
- subSections: section.subSections,
53
- level: startHeadingLevel,
54
- key: "section-".concat(section.title)
55
- }, section.content);
56
- }))), /*#__PURE__*/_react["default"].createElement(QuickNavContainer, null, /*#__PURE__*/_react["default"].createElement(_QuickNav["default"], {
57
- title: title,
58
- links: getSubSectionsLinks(sections)
59
- })));
60
- };
61
-
62
- var Container = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n width: 100%;\n"])));
63
-
64
- var ContentContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n"])));
65
-
66
- var QuickNavContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: calc(100vh - 150px);\n position: sticky;\n width: 300px;\n"])));
67
-
68
- var _default = DxcQuickNavContainer;
69
- exports["default"] = _default;
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- declare type SectionType = {
3
- title: string;
4
- level?: 1 | 2 | 3 | 4 | 5;
5
- subSections?: SectionType[];
6
- children?: React.ReactNode;
7
- };
8
- declare const Section: ({ title, subSections, level, children }: SectionType) => JSX.Element;
9
- export default Section;
@@ -1,37 +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 _react = _interopRequireDefault(require("react"));
11
-
12
- var _Stack = _interopRequireDefault(require("../stack/Stack"));
13
-
14
- var _HeadingLink = _interopRequireDefault(require("./HeadingLink"));
15
-
16
- // @ts-nocheck
17
- var Section = function Section(_ref) {
18
- var title = _ref.title,
19
- subSections = _ref.subSections,
20
- level = _ref.level,
21
- children = _ref.children;
22
- return /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
23
- gutter: level === 1 ? "xlarge" : level === 2 ? "large" : "medium"
24
- }, /*#__PURE__*/_react["default"].createElement(_HeadingLink["default"], {
25
- level: level
26
- }, title), children, subSections === null || subSections === void 0 ? void 0 : subSections.map(function (subSection) {
27
- return /*#__PURE__*/_react["default"].createElement(Section, {
28
- key: "subSection-".concat(subSection.title),
29
- title: subSection.title,
30
- subSections: subSection.subSections,
31
- level: level + 1 <= 5 ? level + 1 : 5
32
- }, subSection.content);
33
- }));
34
- };
35
-
36
- var _default = Section;
37
- exports["default"] = _default;
@@ -1,34 +0,0 @@
1
- /// <reference types="react" />
2
- declare type Props = {
3
- /**
4
- * Title of the quick nav component.
5
- */
6
- title: string;
7
- /**
8
- * Sections to be shown as the content of the quick nav container.
9
- */
10
- sections: SectionType[];
11
- /**
12
- * The level of the first heading of the content.
13
- */
14
- startHeadingLevel?: 1 | 2 | 3 | 4 | 5;
15
- };
16
- declare type SectionType = {
17
- /**
18
- * Title of each section.
19
- */
20
- title: string;
21
- /**
22
- * Level of each section.
23
- */
24
- level?: 1 | 2 | 3 | 4 | 5;
25
- /**
26
- * Content of each section.
27
- */
28
- content?: React.ReactNode;
29
- /**
30
- * Subsections of each section.
31
- */
32
- subSections?: SectionType[];
33
- };
34
- 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;
package/radio/Radio.js DELETED
@@ -1,173 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof3 = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
-
18
- var _react = _interopRequireWildcard(require("react"));
19
-
20
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
-
22
- var _Radio = _interopRequireDefault(require("@material-ui/core/Radio"));
23
-
24
- var _RequiredComponent = _interopRequireDefault(require("../common/RequiredComponent"));
25
-
26
- var _variables = require("../common/variables.js");
27
-
28
- var _utils = require("../common/utils.js");
29
-
30
- var _useTheme = _interopRequireDefault(require("../useTheme"));
31
-
32
- var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
33
-
34
- var _templateObject, _templateObject2;
35
-
36
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
-
38
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
-
40
- var DxcRadio = function DxcRadio(_ref) {
41
- var _ref$checked = _ref.checked,
42
- checked = _ref$checked === void 0 ? false : _ref$checked,
43
- value = _ref.value,
44
- _ref$label = _ref.label,
45
- label = _ref$label === void 0 ? "" : _ref$label,
46
- _ref$labelPosition = _ref.labelPosition,
47
- labelPosition = _ref$labelPosition === void 0 ? "before" : _ref$labelPosition,
48
- name = _ref.name,
49
- _ref$disabled = _ref.disabled,
50
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
51
- onClick = _ref.onClick,
52
- _ref$required = _ref.required,
53
- required = _ref$required === void 0 ? false : _ref$required,
54
- margin = _ref.margin,
55
- _ref$size = _ref.size,
56
- size = _ref$size === void 0 ? "fitContent" : _ref$size;
57
-
58
- var _useState = (0, _react.useState)(false),
59
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
60
- innerChecked = _useState2[0],
61
- setInnerChecked = _useState2[1];
62
-
63
- var colorsTheme = (0, _useTheme["default"])();
64
- var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
65
-
66
- var handlerRadioChange = function handlerRadioChange() {
67
- if (checked == null) {
68
- setInnerChecked(true);
69
- }
70
-
71
- if (typeof onClick === "function") {
72
- onClick(true);
73
- }
74
- };
75
-
76
- var labelComponent = /*#__PURE__*/_react["default"].createElement(LabelContainer, {
77
- checked: checked || innerChecked,
78
- disabled: disabled,
79
- onClick: !disabled && handlerRadioChange || null,
80
- backgroundType: backgroundType
81
- }, required && /*#__PURE__*/_react["default"].createElement(_RequiredComponent["default"], null), label);
82
-
83
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
84
- theme: colorsTheme.radio
85
- }, /*#__PURE__*/_react["default"].createElement(RadioContainer, {
86
- id: name,
87
- labelPosition: labelPosition,
88
- disabled: disabled,
89
- margin: margin,
90
- size: size,
91
- backgroundType: backgroundType
92
- }, labelPosition === "before" && labelComponent, /*#__PURE__*/_react["default"].createElement(_Radio["default"], {
93
- checked: checked != null && checked || innerChecked,
94
- name: name,
95
- onClick: handlerRadioChange,
96
- value: value,
97
- disabled: disabled,
98
- disableRipple: true
99
- }), labelPosition === "after" && labelComponent));
100
- };
101
-
102
- var sizes = {
103
- small: "120px",
104
- medium: "240px",
105
- large: "480px",
106
- fillParent: "100%",
107
- fitContent: "unset"
108
- };
109
-
110
- var calculateWidth = function calculateWidth(margin, size) {
111
- if (size === "fillParent") {
112
- return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
113
- }
114
-
115
- return sizes[size];
116
- };
117
-
118
- var RadioContainer = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n\n display: inline-flex;\n align-items: center;\n max-height: 42px;\n position: relative;\n vertical-align: top;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n cursor: ", ";\n .MuiButtonBase-root {\n width: auto;\n height: auto;\n padding: 10px;\n margin: 2px;\n ", ": ", ";\n padding-left: ", ";\n padding-right: ", ";\n margin-left: ", ";\n margin-right: ", ";\n .MuiIconButton-label {\n .MuiSvgIcon-root {\n height: ", ";\n width: ", ";\n }\n color: ", ";\n\n > div > :nth-child(2) path {\n color: ", ";\n }\n }\n\n &.Mui-focusVisible {\n background-color: transparent;\n .MuiSvgIcon-root {\n outline: ", "\n auto 1px;\n }\n }\n :hover {\n background-color: transparent;\n }\n .MuiTouchRipple-ripple {\n height: 40px !important;\n width: 40px !important;\n top: 0px !important;\n left: 0px !important;\n }\n }\n .MuiRadio-colorSecondary.Mui-checked {\n color: ", ";\n :hover {\n background-color: transparent;\n }\n }\n"])), function (props) {
119
- return calculateWidth(props.margin, props.size);
120
- }, function (props) {
121
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
122
- }, function (props) {
123
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
124
- }, function (props) {
125
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
126
- }, function (props) {
127
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
128
- }, function (props) {
129
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
130
- }, function (props) {
131
- return props.disabled === true ? "not-allowed" : "default";
132
- }, function (props) {
133
- return props.labelPosition === "after" ? "padding-right" : "padding-left";
134
- }, function (props) {
135
- return props.theme.circleLabelSpacing;
136
- }, function (props) {
137
- return props.labelPosition === "after" ? "0px" : "";
138
- }, function (props) {
139
- return props.labelPosition === "before" ? "0px" : "";
140
- }, function (props) {
141
- return props.labelPosition === "after" ? "0px" : "";
142
- }, function (props) {
143
- return props.labelPosition === "before" ? "0px" : "";
144
- }, function (props) {
145
- return props.theme.circleSize;
146
- }, function (props) {
147
- return props.theme.circleSize;
148
- }, function (props) {
149
- return props.backgroundType === "dark" ? props.disabled && props.theme.disabledColorOnDark || props.theme.colorOnDark : props.disabled && props.theme.disabledColor || props.theme.color;
150
- }, function (props) {
151
- return props.backgroundType === "dark" ? props.disabled && props.theme.disabledColorOnDark || props.theme.colorOnDark : props.disabled && props.theme.disabledColor || props.theme.color;
152
- }, function (props) {
153
- return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
154
- }, function (props) {
155
- return props.backgroundType === "dark" ? props.disabled && props.theme.disabledColorOnDark || props.theme.colorOnDark : props.disabled && props.theme.disabledColor || props.theme.color;
156
- });
157
-
158
- var LabelContainer = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n color: ", ";\n cursor: ", ";\n"])), function (props) {
159
- return props.theme.fontFamily;
160
- }, function (props) {
161
- return props.theme.fontSize;
162
- }, function (props) {
163
- return props.theme.fontWeight;
164
- }, function (props) {
165
- return props.theme.fontStyle;
166
- }, function (props) {
167
- return props.backgroundType === "dark" ? props.disabled && props.theme.disabledFontColorOnDark || props.theme.fontColorOnDark : props.disabled && props.theme.disabledFontColor || props.theme.fontColor;
168
- }, function (props) {
169
- return props.disabled === true ? "not-allowed" : "pointer";
170
- });
171
-
172
- var _default = DxcRadio;
173
- exports["default"] = _default;