@dxc-technology/halstack-react 0.0.0-e201636 → 0.0.0-e26622f

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 (152) hide show
  1. package/accordion/Accordion.js +122 -103
  2. package/accordion/Accordion.stories.tsx +2 -3
  3. package/accordion/Accordion.test.js +9 -10
  4. package/accordion/types.d.ts +5 -4
  5. package/accordion-group/AccordionGroup.js +2 -21
  6. package/accordion-group/AccordionGroup.stories.tsx +27 -1
  7. package/accordion-group/AccordionGroup.test.js +20 -45
  8. package/accordion-group/types.d.ts +10 -3
  9. package/alert/Alert.js +1 -1
  10. package/bleed/Bleed.js +1 -34
  11. package/bleed/Bleed.stories.tsx +94 -95
  12. package/bleed/types.d.ts +1 -1
  13. package/box/Box.js +1 -1
  14. package/box/types.d.ts +1 -0
  15. package/bulleted-list/BulletedList.d.ts +7 -0
  16. package/bulleted-list/BulletedList.js +123 -0
  17. package/bulleted-list/BulletedList.stories.tsx +200 -0
  18. package/bulleted-list/types.d.ts +11 -0
  19. package/{list → bulleted-list}/types.js +0 -0
  20. package/button/Button.js +43 -61
  21. package/button/Button.stories.tsx +9 -0
  22. package/button/types.d.ts +7 -7
  23. package/card/Card.js +34 -36
  24. package/card/types.d.ts +1 -0
  25. package/checkbox/Checkbox.js +87 -95
  26. package/checkbox/Checkbox.test.js +93 -16
  27. package/checkbox/types.d.ts +2 -2
  28. package/chip/types.d.ts +1 -1
  29. package/common/variables.js +56 -18
  30. package/date-input/DateInput.js +3 -3
  31. package/dialog/Dialog.js +52 -28
  32. package/dialog/Dialog.stories.tsx +57 -2
  33. package/dialog/Dialog.test.js +34 -4
  34. package/dialog/types.d.ts +3 -2
  35. package/dropdown/Dropdown.d.ts +1 -1
  36. package/dropdown/Dropdown.js +244 -247
  37. package/dropdown/Dropdown.stories.tsx +126 -63
  38. package/dropdown/Dropdown.test.js +509 -108
  39. package/dropdown/DropdownMenu.d.ts +4 -0
  40. package/dropdown/DropdownMenu.js +80 -0
  41. package/dropdown/DropdownMenuItem.d.ts +4 -0
  42. package/dropdown/DropdownMenuItem.js +92 -0
  43. package/dropdown/types.d.ts +25 -5
  44. package/flex/Flex.d.ts +4 -0
  45. package/flex/Flex.js +69 -0
  46. package/flex/Flex.stories.tsx +103 -0
  47. package/flex/types.d.ts +32 -0
  48. package/{row → flex}/types.js +0 -0
  49. package/footer/Footer.stories.tsx +8 -1
  50. package/footer/Icons.js +1 -1
  51. package/footer/types.d.ts +2 -1
  52. package/header/Header.js +74 -72
  53. package/header/Header.stories.tsx +4 -4
  54. package/header/Icons.js +2 -2
  55. package/header/types.d.ts +3 -2
  56. package/inset/Inset.js +1 -34
  57. package/inset/Inset.stories.tsx +36 -36
  58. package/inset/types.d.ts +1 -1
  59. package/layout/ApplicationLayout.d.ts +15 -6
  60. package/layout/ApplicationLayout.js +37 -65
  61. package/layout/ApplicationLayout.stories.tsx +80 -44
  62. package/layout/types.d.ts +17 -27
  63. package/link/Link.js +1 -1
  64. package/link/Link.stories.tsx +13 -6
  65. package/link/types.d.ts +1 -1
  66. package/main.d.ts +5 -8
  67. package/main.js +28 -52
  68. package/number-input/NumberInput.test.js +1 -1
  69. package/package.json +10 -9
  70. package/paginator/Paginator.test.js +42 -0
  71. package/paragraph/Paragraph.d.ts +6 -0
  72. package/paragraph/Paragraph.js +38 -0
  73. package/paragraph/Paragraph.stories.tsx +44 -0
  74. package/password-input/PasswordInput.test.js +13 -12
  75. package/progress-bar/ProgressBar.d.ts +2 -2
  76. package/progress-bar/ProgressBar.js +56 -50
  77. package/progress-bar/ProgressBar.stories.jsx +3 -1
  78. package/progress-bar/ProgressBar.test.js +67 -22
  79. package/progress-bar/types.d.ts +3 -4
  80. package/quick-nav/QuickNav.js +25 -20
  81. package/quick-nav/QuickNav.stories.tsx +131 -26
  82. package/radio-group/Radio.d.ts +1 -1
  83. package/radio-group/Radio.js +43 -28
  84. package/radio-group/RadioGroup.js +26 -29
  85. package/radio-group/RadioGroup.stories.tsx +1 -0
  86. package/radio-group/RadioGroup.test.js +28 -58
  87. package/radio-group/types.d.ts +2 -2
  88. package/resultsetTable/ResultsetTable.test.js +42 -0
  89. package/select/Listbox.d.ts +1 -1
  90. package/select/Listbox.js +53 -7
  91. package/select/Select.js +42 -43
  92. package/select/Select.stories.tsx +131 -98
  93. package/select/Select.test.js +105 -50
  94. package/select/types.d.ts +2 -5
  95. package/sidenav/Sidenav.d.ts +6 -5
  96. package/sidenav/Sidenav.js +176 -55
  97. package/sidenav/Sidenav.stories.tsx +154 -156
  98. package/sidenav/Sidenav.test.js +25 -37
  99. package/sidenav/types.d.ts +50 -27
  100. package/slider/Slider.js +116 -92
  101. package/slider/Slider.stories.tsx +7 -1
  102. package/slider/Slider.test.js +121 -21
  103. package/slider/types.d.ts +2 -2
  104. package/switch/Switch.d.ts +1 -1
  105. package/switch/Switch.js +132 -66
  106. package/switch/Switch.stories.tsx +8 -30
  107. package/switch/Switch.test.js +144 -17
  108. package/switch/types.d.ts +3 -4
  109. package/tabs/Tab.d.ts +4 -0
  110. package/tabs/Tab.js +135 -0
  111. package/tabs/Tabs.js +360 -104
  112. package/tabs/Tabs.stories.tsx +74 -0
  113. package/tabs/Tabs.test.js +217 -6
  114. package/tabs/types.d.ts +15 -5
  115. package/tabs-nav/NavTabs.js +5 -5
  116. package/tabs-nav/Tab.js +3 -5
  117. package/tabs-nav/types.d.ts +1 -1
  118. package/tag/Tag.js +1 -1
  119. package/tag/types.d.ts +1 -1
  120. package/text-input/Icons.d.ts +8 -0
  121. package/text-input/Icons.js +60 -0
  122. package/text-input/Suggestion.js +7 -5
  123. package/text-input/Suggestions.d.ts +4 -0
  124. package/text-input/Suggestions.js +134 -0
  125. package/text-input/TextInput.js +181 -278
  126. package/text-input/TextInput.stories.tsx +189 -182
  127. package/text-input/TextInput.test.js +165 -163
  128. package/text-input/types.d.ts +22 -3
  129. package/toggle-group/types.d.ts +1 -1
  130. package/typography/Typography.d.ts +4 -0
  131. package/typography/Typography.js +131 -0
  132. package/typography/Typography.stories.tsx +198 -0
  133. package/typography/types.d.ts +18 -0
  134. package/{stack → typography}/types.js +0 -0
  135. package/wizard/Wizard.js +9 -16
  136. package/wizard/Wizard.stories.tsx +20 -1
  137. package/wizard/types.d.ts +5 -4
  138. package/list/List.d.ts +0 -4
  139. package/list/List.js +0 -47
  140. package/list/List.stories.tsx +0 -95
  141. package/list/types.d.ts +0 -7
  142. package/row/Row.d.ts +0 -3
  143. package/row/Row.js +0 -127
  144. package/row/Row.stories.tsx +0 -237
  145. package/row/types.d.ts +0 -28
  146. package/stack/Stack.d.ts +0 -3
  147. package/stack/Stack.js +0 -97
  148. package/stack/Stack.stories.tsx +0 -164
  149. package/stack/types.d.ts +0 -24
  150. package/text/Text.d.ts +0 -7
  151. package/text/Text.js +0 -30
  152. package/text/Text.stories.tsx +0 -19
@@ -13,8 +13,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
13
13
 
14
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
15
 
16
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
17
-
18
16
  var _react = _interopRequireWildcard(require("react"));
19
17
 
20
18
  var _Header = _interopRequireDefault(require("../header/Header"));
@@ -29,13 +27,11 @@ var _variables = require("../common/variables.js");
29
27
 
30
28
  var _Icons = require("./Icons");
31
29
 
32
- var _uuid = require("uuid");
33
-
34
30
  var _SidenavContext = require("./SidenavContext");
35
31
 
36
32
  var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
37
33
 
38
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
34
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
39
35
 
40
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); }
41
37
 
@@ -43,24 +39,15 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
43
39
 
44
40
  var year = new Date().getFullYear();
45
41
 
46
- var Header = function Header(_ref) {
42
+ var Main = function Main(_ref) {
47
43
  var children = _ref.children;
48
44
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
49
45
  };
50
46
 
51
- var Main = function Main(_ref2) {
52
- var children = _ref2.children;
53
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
54
- };
55
-
56
- var Footer = function Footer(_ref3) {
57
- var children = _ref3.children;
58
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
59
- };
60
-
61
- var Sidenav = function Sidenav(_ref4) {
62
- var childProps = (0, _extends2["default"])({}, _ref4);
63
- return /*#__PURE__*/_react["default"].createElement(_Sidenav["default"], childProps, childProps.children);
47
+ var defaultHeader = function defaultHeader() {
48
+ return /*#__PURE__*/_react["default"].createElement(_Header["default"], {
49
+ underlined: true
50
+ });
64
51
  };
65
52
 
66
53
  var defaultFooter = function defaultFooter() {
@@ -89,47 +76,37 @@ var defaultFooter = function defaultFooter() {
89
76
  });
90
77
  };
91
78
 
92
- var defaultHeader = function defaultHeader() {
93
- return /*#__PURE__*/_react["default"].createElement(_Header["default"], {
94
- underlined: true
95
- });
96
- };
97
-
98
79
  var childTypeExists = function childTypeExists(children, childType) {
99
80
  return children.find(function (child) {
100
81
  return (child === null || child === void 0 ? void 0 : child.type) === childType;
101
82
  });
102
83
  };
103
84
 
104
- var DxcApplicationLayout = function DxcApplicationLayout(_ref5) {
105
- var _ref5$visibilityToggl = _ref5.visibilityToggleLabel,
106
- visibilityToggleLabel = _ref5$visibilityToggl === void 0 ? "" : _ref5$visibilityToggl,
107
- children = _ref5.children;
108
-
109
- var _useState = (0, _react.useState)("appLayout-".concat((0, _uuid.v4)())),
110
- _useState2 = (0, _slicedToArray2["default"])(_useState, 1),
111
- appLayoutId = _useState2[0];
85
+ var DxcApplicationLayout = function DxcApplicationLayout(_ref2) {
86
+ var _ref2$visibilityToggl = _ref2.visibilityToggleLabel,
87
+ visibilityToggleLabel = _ref2$visibilityToggl === void 0 ? "" : _ref2$visibilityToggl,
88
+ header = _ref2.header,
89
+ sidenav = _ref2.sidenav,
90
+ footer = _ref2.footer,
91
+ children = _ref2.children;
112
92
 
113
- var visibilityToggleLabelId = "label-".concat(appLayoutId);
93
+ var _useState = (0, _react.useState)(false),
94
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
95
+ isSidenavVisibleResponsive = _useState2[0],
96
+ setIsSidenavVisibleResponsive = _useState2[1];
114
97
 
115
98
  var _useState3 = (0, _react.useState)(false),
116
99
  _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
117
- isSidenavVisibleResponsive = _useState4[0],
118
- setIsSidenavVisibleResponsive = _useState4[1];
119
-
120
- var _useState5 = (0, _react.useState)(false),
121
- _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
122
- isResponsive = _useState6[0],
123
- setIsResponsive = _useState6[1];
100
+ isResponsive = _useState4[0],
101
+ setIsResponsive = _useState4[1];
124
102
 
125
103
  var ref = (0, _react.useRef)(null);
126
104
  var translatedLabels = (0, _useTranslatedLabels["default"])();
127
105
 
128
106
  var childrenArray = _react["default"].Children.toArray(children);
129
107
 
130
- var header = childTypeExists(childrenArray, _Header["default"]) || childTypeExists(childrenArray, Header) || defaultHeader();
131
- var footer = childTypeExists(childrenArray, _Footer["default"]) || childTypeExists(childrenArray, Footer) || defaultFooter();
132
- var sidenav = childTypeExists(childrenArray, Sidenav);
108
+ var headerContent = header || defaultHeader();
109
+ var footerContent = footer || defaultFooter();
133
110
  var main = childTypeExists(childrenArray, Main);
134
111
 
135
112
  var handleResize = function handleResize() {
@@ -142,58 +119,53 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref5) {
142
119
  });
143
120
  };
144
121
 
145
- (0, _react.useEffect)(function () {
122
+ (0, _react.useLayoutEffect)(function () {
146
123
  handleResize();
147
124
  window.addEventListener("resize", handleResize);
148
125
  return function () {
149
126
  window.removeEventListener("resize", handleResize);
150
127
  };
151
- }, [setIsResponsive]);
128
+ }, []);
152
129
  (0, _react.useEffect)(function () {
153
130
  !isResponsive && setIsSidenavVisibleResponsive(false);
154
- }, [isResponsive, setIsSidenavVisibleResponsive]);
131
+ }, [isResponsive]);
155
132
  return /*#__PURE__*/_react["default"].createElement(ApplicationLayoutContainer, {
156
133
  hasSidenav: sidenav ? true : false,
157
134
  isSidenavVisible: isSidenavVisibleResponsive,
158
135
  ref: ref
159
- }, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null, header), sidenav && isResponsive && /*#__PURE__*/_react["default"].createElement(VisibilityToggle, null, /*#__PURE__*/_react["default"].createElement(HamburgerTrigger, {
136
+ }, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null, headerContent), sidenav && isResponsive && /*#__PURE__*/_react["default"].createElement(VisibilityToggle, null, /*#__PURE__*/_react["default"].createElement(HamburgerTrigger, {
160
137
  onClick: handleSidenavVisibility,
161
- "aria-labelledby": visibilityToggleLabel ? visibilityToggleLabelId : undefined,
162
138
  "aria-label": visibilityToggleLabel ? undefined : translatedLabels.applicationLayout.visibilityToggleTitle,
163
139
  title: translatedLabels.applicationLayout.visibilityToggleTitle
164
- }, _Icons.hamburgerIcon), visibilityToggleLabel && /*#__PURE__*/_react["default"].createElement(VisibilityToggleLabel, {
165
- id: visibilityToggleLabelId
166
- }, visibilityToggleLabel)), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(_SidenavContext.SidenavContextProvider, {
140
+ }, _Icons.hamburgerIcon, visibilityToggleLabel)), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(_SidenavContext.SidenavContextProvider, {
167
141
  value: setIsSidenavVisibleResponsive
168
- }, sidenav && (isResponsive ? isSidenavVisibleResponsive : true) && /*#__PURE__*/_react["default"].createElement(SidenavContainer, null, sidenav)), /*#__PURE__*/_react["default"].createElement(MainContainer, null, /*#__PURE__*/_react["default"].createElement(MainContentContainer, null, main), footer)));
142
+ }, sidenav && (isResponsive ? isSidenavVisibleResponsive : true) && /*#__PURE__*/_react["default"].createElement(SidenavContainer, null, sidenav)), /*#__PURE__*/_react["default"].createElement(MainContainer, null, /*#__PURE__*/_react["default"].createElement(MainContentContainer, null, main), footerContent)));
169
143
  };
170
144
 
171
145
  var ApplicationLayoutContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n top: 64px;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n\n @media (max-width: ", "rem) {\n ", ";\n ", "\n }\n"])), _variables.responsiveSizes.medium, function (props) {
172
- return props.hasSidenav && "top: 112px";
146
+ return props.hasSidenav && "top: 116px";
173
147
  }, function (props) {
174
148
  return props.isSidenavVisible && "overflow: hidden;";
175
149
  });
176
150
 
177
151
  var HeaderContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 3;\n"])));
178
152
 
179
- var VisibilityToggle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 64px;\n left: 0;\n right: 0;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 12px 16px;\n gap: 10px;\n width: 100%;\n background-color: #f2f2f2;\n user-select: none;\n z-index: 2;\n"])));
180
-
181
- var HamburgerTrigger = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n border: 0px solid transparent;\n border-radius: 2px;\n padding: 3px;\n background-color: transparent;\n box-shadow: 0 0 0 2px transparent;\n cursor: pointer;\n\n :hover {\n background-color: #e6e6e6;\n }\n :active {\n background-color: #cccccc;\n }\n :focus,\n :focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px #0095ff;\n }\n & > svg {\n height: 20px;\n width: 20px;\n }\n"])));
153
+ var VisibilityToggle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 64px;\n left: 0;\n right: 0;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 4px 16px;\n width: 100%;\n background-color: #f2f2f2;\n user-select: none;\n z-index: 2;\n"])));
182
154
 
183
- var VisibilityToggleLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: Open Sans, sans-serif;\n font-weight: 600;\n font-size: 14px;\n"])));
155
+ var HamburgerTrigger = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n border: 0px solid transparent;\n border-radius: 2px;\n padding: 12px 4px;\n background-color: transparent;\n box-shadow: 0 0 0 2px transparent;\n font-family: Open Sans, sans-serif;\n font-weight: 600;\n font-size: 14px;\n color: #000;\n cursor: pointer;\n :active {\n background-color: #cccccc;\n }\n :focus,\n :focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px #0095ff;\n }\n & > svg {\n height: 20px;\n width: 20px;\n }\n"])));
184
156
 
185
- var BodyContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex: 1;\n"])));
157
+ var BodyContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex: 1;\n"])));
186
158
 
187
- var SidenavContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n position: sticky;\n top: 64px;\n display: flex;\n height: calc(100vh - 64px);\n z-index: 1;\n\n @media (max-width: ", "rem) {\n position: fixed;\n top: 112px;\n }\n"])), _variables.responsiveSizes.medium);
159
+ var SidenavContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n position: sticky;\n top: 64px;\n display: flex;\n height: calc(100vh - 64px);\n z-index: 1;\n\n @media (max-width: ", "rem) {\n position: absolute;\n top: 0px;\n height: 100%;\n }\n"])), _variables.responsiveSizes.medium);
188
160
 
189
- var MainContainer = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n"])));
161
+ var MainContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n"])));
190
162
 
191
- var MainContentContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1;\n"])));
163
+ var MainContentContainer = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1;\n"])));
192
164
 
193
- DxcApplicationLayout.Header = Header;
165
+ DxcApplicationLayout.Header = _Header["default"];
194
166
  DxcApplicationLayout.Main = Main;
195
- DxcApplicationLayout.Footer = Footer;
196
- DxcApplicationLayout.SideNav = Sidenav;
167
+ DxcApplicationLayout.Footer = _Footer["default"];
168
+ DxcApplicationLayout.SideNav = _Sidenav["default"];
197
169
  DxcApplicationLayout.useResponsiveSidenavVisibility = _SidenavContext.useResponsiveSidenavVisibility;
198
170
  var _default = DxcApplicationLayout;
199
171
  exports["default"] = _default;
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import DxcApplicationLayout from "./ApplicationLayout";
3
- import DxcSidenav from "../sidenav/Sidenav";
4
3
  import Title from "../../.storybook/components/Title";
5
4
  import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
6
5
 
@@ -30,15 +29,25 @@ export const DefaultApplicationLayout = () => (
30
29
 
31
30
  export const ApplicationLayoutWithDefaultSidenav = () => (
32
31
  <>
33
- <DxcApplicationLayout>
34
- <DxcApplicationLayout.SideNav>
35
- <DxcSidenav.Title>Application layout with sidenav</DxcSidenav.Title>
36
- <p>SideNav Content</p>
37
- <p>SideNav Content</p>
38
- <p>SideNav Content</p>
39
- <p>SideNav Content</p>
40
- <p>SideNav Content</p>
41
- </DxcApplicationLayout.SideNav>
32
+ <DxcApplicationLayout
33
+ sidenav={
34
+ <DxcApplicationLayout.SideNav
35
+ title={
36
+ <DxcApplicationLayout.SideNav.Title>
37
+ Application layout with push sidenav
38
+ </DxcApplicationLayout.SideNav.Title>
39
+ }
40
+ >
41
+ <DxcApplicationLayout.SideNav.Section>
42
+ <p>SideNav Content</p>
43
+ <p>SideNav Content</p>
44
+ <p>SideNav Content</p>
45
+ <p>SideNav Content</p>
46
+ <p>SideNav Content</p>
47
+ </DxcApplicationLayout.SideNav.Section>
48
+ </DxcApplicationLayout.SideNav>
49
+ }
50
+ >
42
51
  <DxcApplicationLayout.Main>
43
52
  <p>Main Content</p>
44
53
  <p>Main Content</p>
@@ -51,15 +60,26 @@ export const ApplicationLayoutWithDefaultSidenav = () => (
51
60
 
52
61
  export const ApplicationLayoutWithResponsiveSidenav = () => (
53
62
  <>
54
- <DxcApplicationLayout visibilityToggleLabel="Example">
55
- <DxcApplicationLayout.SideNav>
56
- <DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
57
- <p>SideNav Content</p>
58
- <p>SideNav Content</p>
59
- <p>SideNav Content</p>
60
- <p>SideNav Content</p>
61
- <p>SideNav Content</p>
62
- </DxcApplicationLayout.SideNav>
63
+ <DxcApplicationLayout
64
+ visibilityToggleLabel="Example"
65
+ sidenav={
66
+ <DxcApplicationLayout.SideNav
67
+ title={
68
+ <DxcApplicationLayout.SideNav.Title>
69
+ Application layout with push sidenav
70
+ </DxcApplicationLayout.SideNav.Title>
71
+ }
72
+ >
73
+ <DxcApplicationLayout.SideNav.Section>
74
+ <p>SideNav Content</p>
75
+ <p>SideNav Content</p>
76
+ <p>SideNav Content</p>
77
+ <p>SideNav Content</p>
78
+ <p>SideNav Content</p>
79
+ </DxcApplicationLayout.SideNav.Section>
80
+ </DxcApplicationLayout.SideNav>
81
+ }
82
+ >
63
83
  <DxcApplicationLayout.Main>
64
84
  <p>Main Content</p>
65
85
  <p>Main Content</p>
@@ -74,23 +94,31 @@ ApplicationLayoutWithResponsiveSidenav.parameters = {
74
94
  viewport: {
75
95
  defaultViewport: "pixel",
76
96
  },
97
+ chromatic: { viewports: [540] },
77
98
  };
78
99
 
79
100
  export const ApplicationLayoutWithCustomHeader = () => (
80
101
  <>
81
- <DxcApplicationLayout>
82
- <DxcApplicationLayout.Header>
83
- {" "}
84
- <p>Custom Header</p>{" "}
85
- </DxcApplicationLayout.Header>
86
- <DxcApplicationLayout.SideNav>
87
- <DxcSidenav.Title>Application layout with custom header</DxcSidenav.Title>
88
- <p>SideNav Content</p>
89
- <p>SideNav Content</p>
90
- <p>SideNav Content</p>
91
- <p>SideNav Content</p>
92
- <p>SideNav Content</p>
93
- </DxcApplicationLayout.SideNav>
102
+ <DxcApplicationLayout
103
+ header={<p>Custom Header</p>}
104
+ sidenav={
105
+ <DxcApplicationLayout.SideNav
106
+ title={
107
+ <DxcApplicationLayout.SideNav.Title>
108
+ Application layout with push sidenav
109
+ </DxcApplicationLayout.SideNav.Title>
110
+ }
111
+ >
112
+ <DxcApplicationLayout.SideNav.Section>
113
+ <p>SideNav Content</p>
114
+ <p>SideNav Content</p>
115
+ <p>SideNav Content</p>
116
+ <p>SideNav Content</p>
117
+ <p>SideNav Content</p>
118
+ </DxcApplicationLayout.SideNav.Section>
119
+ </DxcApplicationLayout.SideNav>
120
+ }
121
+ >
94
122
  <DxcApplicationLayout.Main>
95
123
  <p>Main Content</p>
96
124
  <p>Main Content</p>
@@ -103,24 +131,32 @@ export const ApplicationLayoutWithCustomHeader = () => (
103
131
 
104
132
  export const ApplicationLayoutWithCustomFooter = () => (
105
133
  <>
106
- <DxcApplicationLayout>
107
- <DxcApplicationLayout.SideNav>
108
- <DxcSidenav.Title>Application layout with custom footer</DxcSidenav.Title>
109
- <p>SideNav Content</p>
110
- <p>SideNav Content</p>
111
- <p>SideNav Content</p>
112
- <p>SideNav Content</p>
113
- <p>SideNav Content</p>
114
- </DxcApplicationLayout.SideNav>
134
+ <DxcApplicationLayout
135
+ footer={<p>Custom Footer</p>}
136
+ sidenav={
137
+ <DxcApplicationLayout.SideNav
138
+ title={
139
+ <DxcApplicationLayout.SideNav.Title>
140
+ Application layout with push sidenav
141
+ </DxcApplicationLayout.SideNav.Title>
142
+ }
143
+ >
144
+ <DxcApplicationLayout.SideNav.Section>
145
+ <p>SideNav Content</p>
146
+ <p>SideNav Content</p>
147
+ <p>SideNav Content</p>
148
+ <p>SideNav Content</p>
149
+ <p>SideNav Content</p>
150
+ </DxcApplicationLayout.SideNav.Section>
151
+ </DxcApplicationLayout.SideNav>
152
+ }
153
+ >
115
154
  <DxcApplicationLayout.Main>
116
155
  <p>Main Content</p>
117
156
  <p>Main Content</p>
118
157
  <p>Main Content</p>
119
158
  <p>Main Content</p>
120
159
  </DxcApplicationLayout.Main>
121
- <DxcApplicationLayout.Footer>
122
- <p>Custom Footer</p>
123
- </DxcApplicationLayout.Footer>
124
160
  </DxcApplicationLayout>
125
161
  </>
126
162
  );
package/layout/types.d.ts CHANGED
@@ -1,42 +1,20 @@
1
1
  /// <reference types="react" />
2
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- declare type Padding = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- declare type ChildrenType = AppLayoutHeaderPropsType | AppLayoutMainPropsType | AppLayoutFooterPropsType | AppLayoutSidenavPropsType;
10
- export declare type AppLayoutHeaderPropsType = {
11
- /**
12
- * Everything between this tags will be displayed as a header, at the top of the screen.
13
- * This is optional and if it is not specified, the DxcHeader will be shown by default.
14
- */
15
- children?: React.ReactNode;
16
- };
2
+ declare type ChildrenType = AppLayoutMainPropsType | AppLayoutSidenavPropsType;
17
3
  export declare type AppLayoutMainPropsType = {
18
4
  /**
19
5
  * Everything between the tags will be displayed as the content of the main part of the application.
20
6
  */
21
7
  children: React.ReactNode;
22
8
  };
23
- export declare type AppLayoutFooterPropsType = {
24
- /**
25
- * Everything between the tags will be displayed as a footer, at the bottom of the screen.
26
- * This is optional and if it is not specified, the DxcFooter will be shown by default.
27
- */
28
- children?: React.ReactNode;
29
- };
30
9
  export declare type AppLayoutSidenavPropsType = {
31
10
  /**
32
- * Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
33
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
11
+ * The area inside the sidenav. This area can be used to render the content inside the sidenav.
34
12
  */
35
- padding?: Space | Padding;
13
+ children: React.ReactNode;
36
14
  /**
37
- * The area inside the sidenav. This area can be used to render custom content.
15
+ * The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
38
16
  */
39
- children: React.ReactNode;
17
+ title?: React.ReactNode;
40
18
  };
41
19
  declare type AppLayoutPropsType = {
42
20
  /**
@@ -44,6 +22,18 @@ declare type AppLayoutPropsType = {
44
22
  * visibility of the sidenav.
45
23
  */
46
24
  visibilityToggleLabel?: string;
25
+ /**
26
+ * Header content.
27
+ */
28
+ header?: React.ReactNode;
29
+ /**
30
+ * Sidenav content
31
+ */
32
+ sidenav?: React.ReactNode;
33
+ /**
34
+ * Footer content
35
+ */
36
+ footer?: React.ReactNode;
47
37
  /**
48
38
  * The area inside the sidenav. This area can be used to render custom content.
49
39
  */
package/link/Link.js CHANGED
@@ -82,7 +82,7 @@ var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
82
82
  })));
83
83
  });
84
84
 
85
- var StyledLink = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n width: fit-content;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
85
+ var StyledLink = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: baseline;\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n width: fit-content;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
86
86
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
87
87
  }, function (props) {
88
88
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
@@ -9,7 +9,7 @@ export default {
9
9
  };
10
10
 
11
11
  const icon = (
12
- <svg viewBox="0 0 24 24" enable-background="new 0 0 24 24" fill="currentColor">
12
+ <svg viewBox="0 0 24 24" enableBackground="new 0 0 24 24" fill="currentColor">
13
13
  <g id="Bounding_Box">
14
14
  <rect fill="none" width="24" height="24" />
15
15
  </g>
@@ -68,11 +68,18 @@ export const Chromatic = () => (
68
68
  </ExampleContainer>
69
69
  <ExampleContainer pseudoState="pseudo-hover">
70
70
  <Title title="Long text with hover" theme="light" level={4} />
71
- Lorem <DxcLink href="https://www.google.com">Test</DxcLink> ipsum dolor sit amet, consectetur adipiscing elit, sed
72
- do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
73
- ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
74
- esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
75
- officia deserunt mollit anim id est laborum.
71
+ Lorem{" "}
72
+ <DxcLink href="https://www.google.com" icon={icon}>
73
+ Test
74
+ </DxcLink>{" "}
75
+ ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
76
+ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
77
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
78
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit{" "}
79
+ <DxcLink href="https://www.google.com" icon={icon} iconPosition="after">
80
+ Test
81
+ </DxcLink>{" "}
82
+ anim id est laborum.
76
83
  </ExampleContainer>
77
84
  <ExampleContainer pseudoState="pseudo-focus">
78
85
  <Title title="Long text with focus" theme="light" level={4} />
package/link/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare type Margin = {
6
6
  left?: Space;
7
7
  right?: Space;
8
8
  };
9
- declare type SVG = React.SVGProps<SVGSVGElement>;
9
+ declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
10
10
  export declare type LinkProps = {
11
11
  /**
12
12
  * If true, the color is inherited from parent.
package/main.d.ts CHANGED
@@ -5,8 +5,6 @@ import DxcCard from "./card/Card";
5
5
  import DxcCheckbox from "./checkbox/Checkbox";
6
6
  import DxcDialog from "./dialog/Dialog";
7
7
  import DxcDropdown from "./dropdown/Dropdown";
8
- import DxcFooter from "./footer/Footer";
9
- import DxcHeader from "./header/Header";
10
8
  import DxcSlider from "./slider/Slider";
11
9
  import DxcSwitch from "./switch/Switch";
12
10
  import DxcTabs from "./tabs/Tabs";
@@ -16,7 +14,6 @@ import DxcTable from "./table/Table";
16
14
  import DxcBox from "./box/Box";
17
15
  import DxcTag from "./tag/Tag";
18
16
  import DxcPaginator from "./paginator/Paginator";
19
- import DxcSidenav from "./sidenav/Sidenav";
20
17
  import DxcWizard from "./wizard/Wizard";
21
18
  import DxcLink from "./link/Link";
22
19
  import DxcHeading from "./heading/Heading";
@@ -33,15 +30,15 @@ import DxcNumberInput from "./number-input/NumberInput";
33
30
  import DxcTextarea from "./textarea/Textarea";
34
31
  import DxcSelect from "./select/Select";
35
32
  import DxcFileInput from "./file-input/FileInput";
36
- import DxcStack from "./stack/Stack";
37
- import DxcRow from "./row/Row";
38
- import DxcText from "./text/Text";
39
- import DxcList from "./list/List";
40
33
  import DxcRadioGroup from "./radio-group/RadioGroup";
41
34
  import DxcBleed from "./bleed/Bleed";
42
35
  import DxcInset from "./inset/Inset";
43
36
  import DxcQuickNav from "./quick-nav/QuickNav";
44
37
  import DxcNavTabs from "./tabs-nav/NavTabs";
38
+ import DxcFlex from "./flex/Flex";
39
+ import DxcTypography from "./typography/Typography";
40
+ import DxcParagraph from "./paragraph/Paragraph";
41
+ import DxcBulletedList from "./bulleted-list/BulletedList";
45
42
  import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
46
43
  import { BackgroundColorProvider } from "./BackgroundColorContext";
47
- export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcHeader, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcSidenav, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, HalstackContext, HalstackLanguageContext, HalstackProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcStack, DxcRow, DxcText, DxcList, DxcRadioGroup, DxcBleed, DxcInset, DxcQuickNav, DxcNavTabs, };
44
+ export { DxcAlert, DxcButton, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, HalstackContext, HalstackLanguageContext, HalstackProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcRadioGroup, DxcBleed, DxcInset, DxcQuickNav, DxcNavTabs, DxcFlex, DxcTypography, DxcParagraph, DxcBulletedList, };