@dxc-technology/halstack-react 0.0.0-9bd9511 → 0.0.0-9c20370

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 (213) hide show
  1. package/BackgroundColorContext.d.ts +3 -3
  2. package/BackgroundColorContext.js +12 -2
  3. package/HalstackContext.d.ts +1330 -7
  4. package/HalstackContext.js +84 -67
  5. package/accordion/Accordion.d.ts +1 -1
  6. package/accordion/Accordion.js +74 -55
  7. package/accordion/Accordion.stories.tsx +3 -101
  8. package/accordion/Accordion.test.js +34 -19
  9. package/accordion/types.d.ts +4 -16
  10. package/accordion-group/AccordionGroup.d.ts +4 -3
  11. package/accordion-group/AccordionGroup.js +49 -42
  12. package/accordion-group/AccordionGroup.stories.tsx +77 -76
  13. package/accordion-group/AccordionGroup.test.js +62 -54
  14. package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
  15. package/accordion-group/AccordionGroupAccordion.js +43 -0
  16. package/accordion-group/types.d.ts +6 -18
  17. package/alert/Alert.js +47 -20
  18. package/alert/Alert.test.js +46 -29
  19. package/alert/types.d.ts +3 -3
  20. package/badge/Badge.js +14 -2
  21. package/badge/types.d.ts +1 -1
  22. package/bleed/Bleed.js +21 -13
  23. package/bleed/Bleed.stories.tsx +1 -0
  24. package/bleed/types.d.ts +2 -2
  25. package/box/Box.d.ts +1 -1
  26. package/box/Box.js +33 -33
  27. package/box/Box.stories.tsx +25 -53
  28. package/box/Box.test.js +7 -2
  29. package/box/types.d.ts +3 -15
  30. package/bulleted-list/BulletedList.js +36 -9
  31. package/bulleted-list/BulletedList.stories.tsx +7 -1
  32. package/bulleted-list/types.d.ts +32 -5
  33. package/button/Button.d.ts +1 -1
  34. package/button/Button.js +83 -71
  35. package/button/Button.stories.tsx +4 -4
  36. package/button/Button.test.js +28 -8
  37. package/button/types.d.ts +8 -4
  38. package/card/Card.d.ts +1 -1
  39. package/card/Card.js +67 -62
  40. package/card/Card.stories.tsx +12 -42
  41. package/card/Card.test.js +22 -11
  42. package/card/types.d.ts +4 -10
  43. package/checkbox/Checkbox.js +71 -27
  44. package/checkbox/Checkbox.test.js +60 -33
  45. package/checkbox/types.d.ts +4 -4
  46. package/chip/Chip.js +51 -48
  47. package/chip/Chip.stories.tsx +25 -17
  48. package/chip/Chip.test.js +29 -17
  49. package/chip/types.d.ts +4 -4
  50. package/common/OpenSans.css +68 -80
  51. package/common/coreTokens.d.ts +146 -0
  52. package/common/coreTokens.js +167 -0
  53. package/common/utils.d.ts +1 -0
  54. package/common/utils.js +8 -3
  55. package/common/variables.d.ts +226 -175
  56. package/common/variables.js +956 -1133
  57. package/date-input/Calendar.js +55 -12
  58. package/date-input/DateInput.js +82 -35
  59. package/date-input/DateInput.test.js +351 -164
  60. package/date-input/DatePicker.js +38 -8
  61. package/date-input/Icons.js +12 -0
  62. package/date-input/YearPicker.js +30 -5
  63. package/date-input/types.d.ts +7 -7
  64. package/dialog/Dialog.d.ts +1 -1
  65. package/dialog/Dialog.js +83 -86
  66. package/dialog/Dialog.stories.tsx +127 -221
  67. package/dialog/Dialog.test.js +331 -18
  68. package/dialog/types.d.ts +1 -14
  69. package/dropdown/Dropdown.js +86 -32
  70. package/dropdown/Dropdown.test.js +211 -104
  71. package/dropdown/DropdownMenu.js +22 -8
  72. package/dropdown/DropdownMenuItem.js +15 -6
  73. package/dropdown/types.d.ts +8 -8
  74. package/file-input/FileInput.js +218 -134
  75. package/file-input/FileInput.test.js +343 -331
  76. package/file-input/FileItem.js +39 -12
  77. package/file-input/types.d.ts +10 -10
  78. package/flex/Flex.js +39 -25
  79. package/flex/Flex.stories.tsx +35 -26
  80. package/flex/types.d.ts +74 -9
  81. package/footer/Footer.d.ts +1 -1
  82. package/footer/Footer.js +80 -68
  83. package/footer/Footer.stories.tsx +12 -89
  84. package/footer/Footer.test.js +47 -40
  85. package/footer/Icons.js +4 -0
  86. package/footer/types.d.ts +15 -17
  87. package/grid/Grid.d.ts +7 -0
  88. package/grid/Grid.js +91 -0
  89. package/grid/Grid.stories.tsx +219 -0
  90. package/grid/types.d.ts +115 -0
  91. package/header/Header.d.ts +4 -3
  92. package/header/Header.js +72 -55
  93. package/header/Header.stories.tsx +7 -71
  94. package/header/Header.test.js +26 -13
  95. package/header/Icons.js +4 -0
  96. package/header/types.d.ts +2 -16
  97. package/heading/Heading.js +28 -7
  98. package/heading/Heading.test.js +88 -71
  99. package/heading/types.d.ts +3 -3
  100. package/inset/Inset.js +21 -13
  101. package/inset/Inset.stories.tsx +2 -1
  102. package/inset/types.d.ts +2 -2
  103. package/layout/ApplicationLayout.d.ts +5 -5
  104. package/layout/ApplicationLayout.js +57 -15
  105. package/layout/Icons.js +10 -0
  106. package/layout/SidenavContext.d.ts +1 -1
  107. package/layout/SidenavContext.js +4 -0
  108. package/layout/types.d.ts +5 -6
  109. package/link/Link.js +41 -21
  110. package/link/Link.test.js +42 -26
  111. package/link/types.d.ts +4 -4
  112. package/main.d.ts +2 -1
  113. package/main.js +55 -0
  114. package/nav-tabs/NavTabs.d.ts +2 -2
  115. package/nav-tabs/NavTabs.js +43 -16
  116. package/nav-tabs/NavTabs.stories.tsx +14 -0
  117. package/nav-tabs/NavTabs.test.js +44 -37
  118. package/nav-tabs/Tab.js +71 -45
  119. package/nav-tabs/types.d.ts +10 -11
  120. package/number-input/NumberInput.js +30 -20
  121. package/number-input/NumberInput.test.js +249 -113
  122. package/number-input/NumberInputContext.js +5 -0
  123. package/number-input/numberInputContextTypes.d.ts +1 -1
  124. package/number-input/types.d.ts +4 -4
  125. package/package.json +7 -7
  126. package/paginator/Icons.js +10 -0
  127. package/paginator/Paginator.js +39 -17
  128. package/paginator/Paginator.test.js +156 -104
  129. package/paginator/types.d.ts +1 -1
  130. package/paragraph/Paragraph.d.ts +3 -4
  131. package/paragraph/Paragraph.js +18 -8
  132. package/password-input/PasswordInput.js +51 -22
  133. package/password-input/PasswordInput.test.js +94 -51
  134. package/password-input/types.d.ts +4 -4
  135. package/progress-bar/ProgressBar.d.ts +2 -2
  136. package/progress-bar/ProgressBar.js +39 -14
  137. package/progress-bar/ProgressBar.test.js +53 -36
  138. package/progress-bar/types.d.ts +4 -3
  139. package/quick-nav/QuickNav.js +24 -2
  140. package/quick-nav/types.d.ts +2 -2
  141. package/radio-group/Radio.js +53 -22
  142. package/radio-group/RadioGroup.js +84 -41
  143. package/radio-group/RadioGroup.test.js +288 -186
  144. package/radio-group/types.d.ts +4 -4
  145. package/resultsetTable/Icons.js +3 -0
  146. package/resultsetTable/ResultsetTable.js +56 -21
  147. package/resultsetTable/ResultsetTable.test.js +75 -42
  148. package/resultsetTable/types.d.ts +5 -5
  149. package/select/Icons.js +3 -0
  150. package/select/Listbox.js +35 -10
  151. package/select/Option.js +24 -8
  152. package/select/Select.js +143 -56
  153. package/select/Select.test.js +839 -456
  154. package/select/types.d.ts +12 -12
  155. package/sidenav/Icons.d.ts +7 -0
  156. package/sidenav/Icons.js +51 -0
  157. package/sidenav/Sidenav.d.ts +2 -2
  158. package/sidenav/Sidenav.js +116 -104
  159. package/sidenav/Sidenav.stories.tsx +60 -60
  160. package/sidenav/Sidenav.test.js +10 -3
  161. package/sidenav/types.d.ts +26 -23
  162. package/slider/Slider.js +84 -38
  163. package/slider/Slider.test.js +104 -76
  164. package/slider/types.d.ts +4 -4
  165. package/spinner/Spinner.js +51 -28
  166. package/spinner/Spinner.stories.jsx +28 -28
  167. package/spinner/Spinner.test.js +35 -26
  168. package/spinner/types.d.ts +3 -3
  169. package/switch/Switch.js +66 -24
  170. package/switch/Switch.test.js +97 -52
  171. package/switch/types.d.ts +4 -4
  172. package/table/Table.js +22 -4
  173. package/table/Table.test.js +7 -2
  174. package/table/types.d.ts +3 -3
  175. package/tabs/Tab.js +39 -22
  176. package/tabs/Tabs.js +131 -62
  177. package/tabs/Tabs.test.js +122 -67
  178. package/tabs/types.d.ts +8 -8
  179. package/tag/Tag.js +54 -27
  180. package/tag/Tag.test.js +31 -20
  181. package/tag/types.d.ts +7 -7
  182. package/text-input/Icons.js +3 -0
  183. package/text-input/Suggestion.js +24 -8
  184. package/text-input/Suggestions.js +36 -11
  185. package/text-input/TextInput.js +144 -59
  186. package/text-input/TextInput.stories.tsx +1 -1
  187. package/text-input/TextInput.test.js +858 -539
  188. package/text-input/types.d.ts +9 -9
  189. package/textarea/Textarea.js +73 -38
  190. package/textarea/Textarea.test.js +173 -98
  191. package/textarea/types.d.ts +4 -4
  192. package/toggle-group/ToggleGroup.d.ts +2 -2
  193. package/toggle-group/ToggleGroup.js +59 -21
  194. package/toggle-group/ToggleGroup.test.js +72 -40
  195. package/toggle-group/types.d.ts +11 -11
  196. package/typography/Typography.d.ts +2 -2
  197. package/typography/Typography.js +23 -110
  198. package/typography/Typography.stories.tsx +1 -1
  199. package/typography/types.d.ts +1 -1
  200. package/useTheme.d.ts +1234 -1
  201. package/useTheme.js +6 -0
  202. package/useTranslatedLabels.d.ts +84 -2
  203. package/useTranslatedLabels.js +5 -0
  204. package/utils/BaseTypography.d.ts +21 -0
  205. package/utils/BaseTypography.js +108 -0
  206. package/utils/FocusLock.d.ts +13 -0
  207. package/utils/FocusLock.js +138 -0
  208. package/wizard/Wizard.js +47 -13
  209. package/wizard/Wizard.test.js +81 -54
  210. package/wizard/types.d.ts +7 -8
  211. package/card/ice-cream.jpg +0 -0
  212. package/translatedLabelsType.d.ts +0 -82
  213. /package/{translatedLabelsType.js → grid/types.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- type BackgroundColorContext = "dark" | "light";
3
- declare const BackgroundColorContext: React.Context<BackgroundColorContext>;
4
- type BackgroundColorProviderPropsType = {
2
+ export declare type BackgroundColors = "dark" | "light";
3
+ declare const BackgroundColorContext: React.Context<BackgroundColors>;
4
+ declare type BackgroundColorProviderPropsType = {
5
5
  color: string;
6
6
  children: React.ReactNode;
7
7
  };
@@ -1,30 +1,39 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  var _typeof = require("@babel/runtime/helpers/typeof");
6
+
5
7
  Object.defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
8
10
  exports["default"] = exports.BackgroundColorProvider = void 0;
11
+
9
12
  var _react = _interopRequireWildcard(require("react"));
13
+
10
14
  var _color = _interopRequireDefault(require("color"));
15
+
11
16
  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); }
17
+
12
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(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; }
19
+
13
20
  var BackgroundColorContext = /*#__PURE__*/_react["default"].createContext(null);
21
+
14
22
  var getColorType = function getColorType(hexColor) {
15
23
  try {
16
24
  if (hexColor) {
17
25
  var hslColor = (0, _color["default"])(hexColor).hsl();
18
- var lightnessColor = hslColor.color[2];
26
+ var lightnessColor = hslColor.lightness();
19
27
  return lightnessColor <= 30 ? "dark" : "light";
20
28
  }
21
29
  } catch (e) {
22
30
  return "light";
23
31
  }
24
32
  };
33
+
25
34
  var BackgroundColorProvider = function BackgroundColorProvider(_ref) {
26
35
  var color = _ref.color,
27
- children = _ref.children;
36
+ children = _ref.children;
28
37
  var colorType = (0, _react.useMemo)(function () {
29
38
  return getColorType(color);
30
39
  }, [color]);
@@ -32,6 +41,7 @@ var BackgroundColorProvider = function BackgroundColorProvider(_ref) {
32
41
  value: colorType
33
42
  }, children);
34
43
  };
44
+
35
45
  exports.BackgroundColorProvider = BackgroundColorProvider;
36
46
  var _default = BackgroundColorContext;
37
47
  exports["default"] = _default;