@nulogy/components 15.2.1 → 15.2.3

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 (288) hide show
  1. package/README.md +3 -3
  2. package/dist/main.js +53108 -54055
  3. package/dist/main.module.js +8809 -9756
  4. package/dist/src/Alert/Alert.js +2 -14
  5. package/dist/src/Alert/Alert.story.d.ts +15 -19
  6. package/dist/src/Alert/Alert.story.js +25 -14
  7. package/dist/src/AppTag/components/LogoWrapper.d.ts +0 -1
  8. package/dist/src/AppTag/components/NulogyLogo.js +2 -14
  9. package/dist/src/AsyncSelect/AsyncSelect.graphql.story.js +4 -13
  10. package/dist/src/AsyncSelect/AsyncSelect.js +14 -16
  11. package/dist/src/AsyncSelect/AsyncSelectComponents.js +9 -21
  12. package/dist/src/AsyncSelect/fixtures.js +4 -13
  13. package/dist/src/Banner/Banner.js +1 -15
  14. package/dist/src/BottomSheet/BottomSheet.js +2 -15
  15. package/dist/src/BottomSheet/BottomSheet.parts.d.ts +2 -2
  16. package/dist/src/BottomSheet/BottomSheet.parts.js +8 -22
  17. package/dist/src/BottomSheet/BottomSheet.styled.d.ts +4 -5
  18. package/dist/src/Box/Box.d.ts +12 -4
  19. package/dist/src/BrandedNavBar/DesktopMenu.js +22 -36
  20. package/dist/src/BrandedNavBar/MenuTrigger.js +4 -16
  21. package/dist/src/BrandedNavBar/MenuTriggerButton.js +8 -22
  22. package/dist/src/BrandedNavBar/MobileMenu.js +28 -35
  23. package/dist/src/BrandedNavBar/NavBar.js +7 -21
  24. package/dist/src/BrandedNavBar/NavBar.story.d.ts +4 -6
  25. package/dist/src/BrandedNavBar/NavBar.story.js +12 -4
  26. package/dist/src/BrandedNavBar/NavBarBackground.d.ts +0 -1
  27. package/dist/src/BrandedNavBar/NavBarDropdownMenu.js +14 -8
  28. package/dist/src/BrandedNavBar/SmallNavBar.js +4 -16
  29. package/dist/src/BrandedNavBar/SmallNavBar.story.d.ts +5 -2
  30. package/dist/src/BrandedNavBar/SmallNavBar.story.js +27 -6
  31. package/dist/src/BrandedNavBar/SubMenuTrigger.js +4 -16
  32. package/dist/src/BrandedNavBar/SubMenuTriggerButton.js +2 -14
  33. package/dist/src/BrandedNavBar/renderSubMenuItems.js +7 -17
  34. package/dist/src/Branding/Branding.js +2 -14
  35. package/dist/src/Branding/BrandingText.d.ts +0 -1
  36. package/dist/src/Branding/LettermarkLogo.js +2 -14
  37. package/dist/src/Branding/WordmarkLogo.js +2 -14
  38. package/dist/src/Breadcrumbs/Breadcrumbs.js +2 -14
  39. package/dist/src/Breadcrumbs/BreadcrumbsList.d.ts +0 -1
  40. package/dist/src/Breadcrumbs/BreadcrumbsListItem.d.ts +0 -1
  41. package/dist/src/Button/Button.js +2 -14
  42. package/dist/src/Button/CloseButton.js +1 -1
  43. package/dist/src/Button/ControlIcon.js +2 -16
  44. package/dist/src/Button/DangerButton.d.ts +0 -1
  45. package/dist/src/Button/IconicButton.js +55 -73
  46. package/dist/src/Button/PrimaryButton.d.ts +0 -1
  47. package/dist/src/Button/QuietButton.d.ts +0 -1
  48. package/dist/src/ButtonGroup/ButtonGroup.d.ts +0 -1
  49. package/dist/src/ButtonGroup/ButtonGroup.js +8 -2
  50. package/dist/src/Card/Card.js +2 -14
  51. package/dist/src/Card/Card.story.js +1 -1
  52. package/dist/src/Card/CardSet.d.ts +0 -1
  53. package/dist/src/Checkbox/Checkbox.js +20 -6
  54. package/dist/src/Checkbox/Checkbox.story.js +4 -1
  55. package/dist/src/Checkbox/CheckboxGroup.js +4 -16
  56. package/dist/src/DatePickers/DatePicker.js +2 -14
  57. package/dist/src/DatePickers/MonthPicker.js +2 -14
  58. package/dist/src/DatePickers/WeekPicker.js +10 -17
  59. package/dist/src/DatePickers/custom/weekPickerStyles.d.ts +0 -1
  60. package/dist/src/DatePickers/shared/components/BasePicker.js +9 -15
  61. package/dist/src/DatePickers/shared/components/DatePickerInput.js +2 -13
  62. package/dist/src/DatePickers/shared/styles.d.ts +0 -1
  63. package/dist/src/DatePickers/shared/types.d.ts +0 -1
  64. package/dist/src/DatePickers/stories/DatePicker.story.d.ts +7 -3
  65. package/dist/src/DatePickers/stories/DatePicker.story.js +54 -22
  66. package/dist/src/DatePickers/stories/WeekPicker.story.js +1 -1
  67. package/dist/src/DateRange/DateRange.js +36 -22
  68. package/dist/src/DateRange/DateRangeStyles.d.ts +0 -1
  69. package/dist/src/DateRange/EndTime.d.ts +3 -4
  70. package/dist/src/DateRange/StartTime.d.ts +3 -4
  71. package/dist/src/Decorations/index.js +1 -1
  72. package/dist/src/DescriptionList/DescriptionList.js +1 -13
  73. package/dist/src/DescriptionList/DescriptionList.parts.d.ts +0 -1
  74. package/dist/src/DescriptionList/DescriptionList.parts.js +156 -77
  75. package/dist/src/DescriptionList/DescriptionListContext.js +1 -15
  76. package/dist/src/DescriptionList/lib/utils.js +1 -1
  77. package/dist/src/DescriptionList/stories/DescriptionList.column.story.js +1 -1
  78. package/dist/src/DescriptionList/stories/DescriptionList.group-min-width.story.d.ts +7 -8
  79. package/dist/src/DescriptionList/stories/DescriptionList.group-min-width.story.js +15 -12
  80. package/dist/src/DescriptionList/stories/DescriptionList.layout.story.js +1 -1
  81. package/dist/src/DescriptionList/stories/DescriptionList.playground.story.d.ts +7 -8
  82. package/dist/src/DescriptionList/stories/DescriptionList.playground.story.js +203 -195
  83. package/dist/src/DescriptionList/stories/fixtures.d.ts +2 -2
  84. package/dist/src/Divider/Divider.d.ts +0 -1
  85. package/dist/src/DropdownMenu/DropdownItem.d.ts +0 -1
  86. package/dist/src/DropdownMenu/DropdownMenu.js +13 -17
  87. package/dist/src/DropdownMenu/DropdownMenu.story.js +2 -2
  88. package/dist/src/DropdownMenu/DropdownMenuContainer.d.ts +0 -1
  89. package/dist/src/DropdownMenu/DropdownMenuContainer.js +10 -1
  90. package/dist/src/DropdownMenu/DropdownText.d.ts +1 -2
  91. package/dist/src/FieldLabel/FieldLabel.js +2 -14
  92. package/dist/src/FieldLabel/HelpText.d.ts +1 -2
  93. package/dist/src/FieldLabel/LabelText.d.ts +0 -1
  94. package/dist/src/FieldLabel/MaybeFieldLabel.js +1 -15
  95. package/dist/src/FieldLabel/RequirementText.js +1 -1
  96. package/dist/src/Flex/Flex.d.ts +0 -1
  97. package/dist/src/Flex/Flex.story.js +3 -17
  98. package/dist/src/Form/Field.d.ts +0 -1
  99. package/dist/src/Form/Fieldset.d.ts +0 -1
  100. package/dist/src/Form/Form.js +3 -17
  101. package/dist/src/Form/FormSection.js +3 -17
  102. package/dist/src/Icon/Icon.js +9 -24
  103. package/dist/src/Icon/LoadingIcon.js +2 -14
  104. package/dist/src/Input/Input.js +3 -15
  105. package/dist/src/Input/InputField.js +4 -16
  106. package/dist/src/Input/Prefix.js +2 -16
  107. package/dist/src/Input/Suffix.js +2 -14
  108. package/dist/src/Layout/ApplicationFrame.js +2 -14
  109. package/dist/src/Layout/Header.d.ts +1 -1
  110. package/dist/src/Layout/Header.js +4 -17
  111. package/dist/src/Layout/Header.story.d.ts +10 -9
  112. package/dist/src/Layout/Header.story.js +9 -8
  113. package/dist/src/Layout/Page.js +5 -19
  114. package/dist/src/Layout/Sidebar.js +4 -18
  115. package/dist/src/Layout/Sidebar.story.d.ts +4 -1
  116. package/dist/src/Layout/Sidebar.story.js +24 -31
  117. package/dist/src/Link/Link.js +13 -21
  118. package/dist/src/List/List.d.ts +0 -1
  119. package/dist/src/Modal/Modal.story.d.ts +39 -61
  120. package/dist/src/Modal/Modal.story.js +110 -85
  121. package/dist/src/Modal/ModalCloseButton.d.ts +0 -1
  122. package/dist/src/Modal/ModalFooter.d.ts +0 -1
  123. package/dist/src/Modal/ModalHeader.d.ts +0 -1
  124. package/dist/src/NDSProvider/ComponentVariantContext.js +1 -1
  125. package/dist/src/NDSProvider/GlobalStyles.d.ts +0 -1
  126. package/dist/src/NDSProvider/ModalStyleOverride.d.ts +0 -1
  127. package/dist/src/NDSProvider/Reset.d.ts +0 -1
  128. package/dist/src/NDSProvider/renderWithNDSProvider.spec-utils.d.ts +3 -1
  129. package/dist/src/NDSProvider/renderWithNDSProvider.spec-utils.js +3 -1
  130. package/dist/src/NavBarSearch/NavBarSearch.js +2 -14
  131. package/dist/src/Navigation/Navigation.js +3 -16
  132. package/dist/src/Navigation/components/AppSwitcher/NulogyAppSwitcher.js +6 -3
  133. package/dist/src/Navigation/components/AppSwitcher/parts/Item.js +1 -15
  134. package/dist/src/Navigation/components/AppSwitcher/parts/Link.js +2 -16
  135. package/dist/src/Navigation/components/AppSwitcher/parts/index.d.ts +4 -5
  136. package/dist/src/Navigation/components/DesktopNav/DesktopNav.js +2 -2
  137. package/dist/src/Navigation/components/MenuSubItem/MenuSubItem.js +4 -5
  138. package/dist/src/Navigation/components/MenuSubItem/parts/styled.d.ts +0 -1
  139. package/dist/src/Navigation/components/MenuSubItem/parts/styled.js +49 -7
  140. package/dist/src/Navigation/components/MobileNav/MobileNav.js +2 -2
  141. package/dist/src/Navigation/components/MobileNav/parts/MobileMenuItem.js +12 -21
  142. package/dist/src/Navigation/components/MobileNav/parts/styled.d.ts +1 -2
  143. package/dist/src/Navigation/components/MobileNav/parts/styled.js +35 -4
  144. package/dist/src/Navigation/components/NulogyLogo/SvgNulogyLogo.js +1 -1
  145. package/dist/src/Navigation/components/UserMenu/UserMenu.d.ts +0 -1
  146. package/dist/src/Navigation/components/UserMenu/parts/Header.js +1 -1
  147. package/dist/src/Navigation/components/UserMenu/parts/Item.js +7 -16
  148. package/dist/src/Navigation/components/UserMenu/parts/MobileItem.js +7 -16
  149. package/dist/src/Navigation/components/UserMenu/parts/styled.d.ts +0 -1
  150. package/dist/src/Navigation/components/UserMenu/parts/styled.js +43 -18
  151. package/dist/src/Navigation/components/shared/NavigationLogo.js +4 -16
  152. package/dist/src/Navigation/components/shared/NavigationLogoLink.js +2 -14
  153. package/dist/src/Navigation/components/shared/NavigationMenuContent.d.ts +0 -1
  154. package/dist/src/Navigation/components/shared/NavigationMenuItem.js +10 -24
  155. package/dist/src/Navigation/components/shared/components.d.ts +0 -1
  156. package/dist/src/Navigation/components/shared/components.js +29 -5
  157. package/dist/src/Navigation/hooks/useResponsiveMenu.d.ts +0 -1
  158. package/dist/src/Navigation/stories/Navigation.mobileVisibility.story.js +21 -9
  159. package/dist/src/Navigation/stories/fixtures/logos/CustomLogo2.js +1 -1
  160. package/dist/src/Navigation/stories/fixtures/logos/CustomLogo3.js +1 -1
  161. package/dist/src/Navigation/stories/fixtures/logos/Customlogo1.js +1 -1
  162. package/dist/src/Overlay/Overlay.d.ts +0 -1
  163. package/dist/src/Pagination/PageNumber.d.ts +0 -1
  164. package/dist/src/Pagination/Pagination.js +3 -16
  165. package/dist/src/Pagination/PaginationButton.d.ts +0 -1
  166. package/dist/src/Popper/Popper.js +29 -6
  167. package/dist/src/Primitives/index.d.ts +0 -1
  168. package/dist/src/Radio/Radio.js +11 -18
  169. package/dist/src/Radio/Radio.story.d.ts +322 -32
  170. package/dist/src/Radio/Radio.story.js +36 -22
  171. package/dist/src/Radio/RadioGroup.js +4 -16
  172. package/dist/src/RangeContainer/RangeContainer.js +6 -15
  173. package/dist/src/Select/MenuList.js +14 -19
  174. package/dist/src/Select/Select.d.ts +2 -2
  175. package/dist/src/Select/Select.js +16 -17
  176. package/dist/src/Select/Select.spec-utils.js +1 -0
  177. package/dist/src/Select/Select.story.d.ts +5 -1
  178. package/dist/src/Select/Select.story.fixture.js +8 -30
  179. package/dist/src/Select/Select.story.js +107 -31
  180. package/dist/src/Select/SelectComponents.js +7 -7
  181. package/dist/src/Select/SelectOption.js +1 -1
  182. package/dist/src/Select/customReactSelectStyles.js +152 -44
  183. package/dist/src/Select/lib.js +1 -2
  184. package/dist/src/SortingTable/SortingTable.js +6 -15
  185. package/dist/src/StatusIndicator/StatusIndicator.d.ts +0 -1
  186. package/dist/src/StatusIndicator/StatusIndicator.js +16 -1
  187. package/dist/src/Summary/Summary.js +2 -14
  188. package/dist/src/Summary/SummaryDivider.js +1 -1
  189. package/dist/src/Summary/SummaryItem.js +2 -14
  190. package/dist/src/Switcher/Switch.js +23 -19
  191. package/dist/src/Switcher/Switcher.js +4 -16
  192. package/dist/src/Table/BaseTable.js +2 -14
  193. package/dist/src/Table/StatefulTable.d.ts +1 -1
  194. package/dist/src/Table/StatefulTable.js +17 -9
  195. package/dist/src/Table/StyledTh.d.ts +0 -1
  196. package/dist/src/Table/StyledTh.js +11 -2
  197. package/dist/src/Table/Table.js +2 -14
  198. package/dist/src/Table/Table.types.d.ts +0 -1
  199. package/dist/src/Table/TableBody.js +11 -11
  200. package/dist/src/Table/TableFoot.js +5 -8
  201. package/dist/src/Table/TableHead.js +1 -4
  202. package/dist/src/Table/addExpandableControl.js +5 -2
  203. package/dist/src/Table/addSelectableControl.js +5 -2
  204. package/dist/src/Table/stories/BaseTable.story.d.ts +11 -7
  205. package/dist/src/Table/stories/BaseTable.story.js +156 -34
  206. package/dist/src/Table/stories/SortingColumnHeader.story.d.ts +5 -2
  207. package/dist/src/Table/stories/SortingColumnHeader.story.js +20 -3
  208. package/dist/src/Table/stories/Table.story.d.ts +7 -14
  209. package/dist/src/Table/stories/Table.story.js +172 -127
  210. package/dist/src/Table/stories/TableWithCustomSorting.story.js +4 -1
  211. package/dist/src/Table/stories/TableWithFiltering.story.js +8 -2
  212. package/dist/src/Table/stories/TableWithServerSidePagination.story.js +4 -15
  213. package/dist/src/Tabs/Tab.js +11 -18
  214. package/dist/src/Tabs/TabContainer.d.ts +0 -1
  215. package/dist/src/Tabs/TabScrollIndicator.js +2 -14
  216. package/dist/src/Tabs/Tabs.js +5 -7
  217. package/dist/src/Textarea/Textarea.js +3 -15
  218. package/dist/src/TimePicker/TimePicker.js +2 -14
  219. package/dist/src/TimePicker/TimePickerDropdown.d.ts +0 -1
  220. package/dist/src/TimePicker/TimePickerInput.d.ts +0 -1
  221. package/dist/src/TimePicker/TimePickerInput.js +6 -4
  222. package/dist/src/TimeRange/TimeRange.js +20 -20
  223. package/dist/src/Toast/Toast.js +4 -16
  224. package/dist/src/ToastContainer/ToastContainer.js +4 -16
  225. package/dist/src/ToastContainer/ToastContainer.story.js +1 -1
  226. package/dist/src/ToastContainer/ToastFunction.js +7 -19
  227. package/dist/src/Toggle/Toggle.js +4 -17
  228. package/dist/src/Toggle/ToggleButton.js +2 -14
  229. package/dist/src/Tooltip/Tooltip.story.d.ts +15 -52
  230. package/dist/src/Tooltip/Tooltip.story.js +80 -72
  231. package/dist/src/Tooltip/TooltipContainer.d.ts +0 -1
  232. package/dist/src/Tooltip/TooltipContainer.js +16 -1
  233. package/dist/src/Tooltip/components/TooltipComponents.js +9 -24
  234. package/dist/src/TopBar/TopBar.styled.d.ts +14 -7
  235. package/dist/src/TopBar/components/BackLink.js +2 -14
  236. package/dist/src/TopBar/components/Menu.js +2 -15
  237. package/dist/src/TopBar/components/MenuItemLink.js +2 -14
  238. package/dist/src/TopBar/components/PageTitle.js +2 -14
  239. package/dist/src/TopBar/stories/TopBar.backButton.story.js +3 -3
  240. package/dist/src/TopBar/stories/TopBar.menu.story.js +9 -20
  241. package/dist/src/TopBar/stories/TopBar.story.js +3 -3
  242. package/dist/src/TruncatedText/TruncatedText.js +8 -16
  243. package/dist/src/TruncatedText/components/MaybeTooltip.d.ts +1 -1
  244. package/dist/src/TruncatedText/components/TruncatedTextFillWidth.js +3 -15
  245. package/dist/src/TruncatedText/components/TruncatedTextMaxCharacters.js +4 -16
  246. package/dist/src/Type/Headings.d.ts +4 -5
  247. package/dist/src/Type/Text.d.ts +0 -1
  248. package/dist/src/Validation/InlineValidation.js +2 -14
  249. package/dist/src/VerticalDivider/VerticalDivider.d.ts +0 -1
  250. package/dist/src/VisualTests/WithSpace.story.js +18 -18
  251. package/dist/src/hooks/useMediaQuery/useMediaQuery.js +1 -2
  252. package/dist/src/i18n.js +1 -1
  253. package/dist/src/locale.story.js +1 -1
  254. package/dist/src/testing/matchers/toHaveStyle.d.ts +15 -0
  255. package/dist/src/testing/matchers/toHaveStyle.js +50 -0
  256. package/dist/src/testing/matchers/toMatchDate.d.ts +1 -0
  257. package/dist/src/testing/matchers/toMatchDate.js +1 -1
  258. package/dist/src/theme/mergeThemes.util.js +7 -1
  259. package/dist/src/theme/useNDSTheme.js +9 -3
  260. package/dist/src/utils/ClickInputLabel.d.ts +0 -1
  261. package/dist/src/utils/DetectOutsideClick.d.ts +3 -0
  262. package/dist/src/utils/DetectOutsideClick.js +3 -0
  263. package/dist/src/utils/PopperArrow.js +5 -1
  264. package/dist/src/utils/ScrollIndicators.js +1 -1
  265. package/dist/src/utils/generateId.d.ts +5 -0
  266. package/dist/src/utils/generateId.js +5 -0
  267. package/dist/src/utils/index.d.ts +0 -1
  268. package/dist/src/utils/index.js +0 -1
  269. package/dist/src/utils/numberFromDimension/numberFromDimension.spec.js +1 -0
  270. package/dist/src/utils/story/code.d.ts +0 -1
  271. package/dist/src/utils/story/dashed.d.ts +2 -2
  272. package/dist/src/utils/story/placeholder.js +1 -1
  273. package/dist/src/utils/story/resizable.d.ts +2 -2
  274. package/dist/src/utils/story/resizable.js +1 -1
  275. package/dist/src/utils/story/simulatedAPIRequests.js +8 -19
  276. package/dist/src/utils/subPx.js +1 -1
  277. package/dist/src/utils/testing/useConditionalAutoClick.js +3 -3
  278. package/dist/src/utils/testing/useUrlProps.js +1 -1
  279. package/dist/src/utils/ts/FocusManager.js +1 -1
  280. package/dist/src/utils/useWindowDimension.story.d.ts +1 -1
  281. package/dist/src/utils/withMenuState.js +1 -1
  282. package/dist/vitest.config.d.ts +2 -0
  283. package/dist/vitest.config.js +11 -0
  284. package/package.json +45 -85
  285. package/dist/src/NDSProvider/mountWithNDSProvider.spec-utils.d.ts +0 -1
  286. package/dist/src/NDSProvider/mountWithNDSProvider.spec-utils.js +0 -4
  287. package/dist/src/utils/withWindowDimensions.d.ts +0 -3
  288. package/dist/src/utils/withWindowDimensions.js +0 -28
@@ -1,24 +1,16 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import React from "react";
13
2
  import { Text } from "../Type";
14
3
  import TruncatedTextFillWidth from "./components/TruncatedTextFillWidth";
15
4
  import TruncatedTextMaxCharacters from "./components/TruncatedTextMaxCharacters";
16
- const TruncatedText = (_a) => {
17
- var { indicator = "...", element = React.createElement(Text, null), maxCharacters = 20, fullWidth = false, showTooltip = true, "data-testid": dataTestId = "truncated-text", children } = _a, rest = __rest(_a, ["indicator", "element", "maxCharacters", "fullWidth", "showTooltip", "data-testid", "children"]);
18
- const props = Object.assign({ indicator,
5
+ const TruncatedText = ({ indicator = "...", element = React.createElement(Text, null), maxCharacters = 20, fullWidth = false, showTooltip = true, "data-testid": dataTestId = "truncated-text", children, ...rest }) => {
6
+ const props = {
7
+ indicator,
19
8
  element,
20
9
  maxCharacters,
21
- showTooltip, "data-testid": dataTestId }, rest);
22
- return fullWidth ? (React.createElement(TruncatedTextFillWidth, Object.assign({}, props), children)) : (React.createElement(TruncatedTextMaxCharacters, Object.assign({}, props), children));
10
+ showTooltip,
11
+ "data-testid": dataTestId,
12
+ ...rest,
13
+ };
14
+ return fullWidth ? (React.createElement(TruncatedTextFillWidth, { ...props }, children)) : (React.createElement(TruncatedTextMaxCharacters, { ...props }, children));
23
15
  };
24
16
  export default TruncatedText;
@@ -19,6 +19,6 @@ export type MaybeTooltipProps = {
19
19
  /** The trigger element(s) */
20
20
  children?: React.ReactNode;
21
21
  };
22
- declare function MaybeTooltip({ tooltip, showTooltip, placement, defaultOpen, showDelay, maxWidth, supportMobileTap, // Note: supportMobileTap is handled internally by the new Tooltip
22
+ declare function MaybeTooltip({ tooltip, showTooltip, placement, defaultOpen, showDelay, maxWidth, supportMobileTap: _supportMobileTap, // Note: supportMobileTap is handled internally by the new Tooltip
23
23
  className, children, }: MaybeTooltipProps): React.JSX.Element;
24
24
  export default MaybeTooltip;
@@ -1,19 +1,7 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import React, { useState } from "react";
13
2
  import { Text } from "../../Type";
14
3
  import MaybeTooltip from "./MaybeTooltip";
15
- const TruncatedTextFillWidth = (_a) => {
16
- var { element, showTooltip, tooltipProps, children, "data-testid": testId } = _a, props = __rest(_a, ["element", "showTooltip", "tooltipProps", "children", "data-testid"]);
4
+ const TruncatedTextFillWidth = ({ element, showTooltip, tooltipProps, children, "data-testid": testId, ...props }) => {
17
5
  const [hasOverflowText, setHasOverflowText] = useState(false);
18
6
  const hasTooltip = showTooltip && hasOverflowText;
19
7
  const updateOverflow = (e) => {
@@ -22,7 +10,7 @@ const TruncatedTextFillWidth = (_a) => {
22
10
  setHasOverflowText(true);
23
11
  }
24
12
  };
25
- return (React.createElement(MaybeTooltip, Object.assign({ showTooltip: hasTooltip, tooltip: children, defaultOpen: true }, tooltipProps),
26
- React.createElement(Text, Object.assign({ as: element.type, cursor: hasTooltip ? "pointer" : "initial", onMouseEnter: updateOverflow, width: "100%", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", "data-testid": testId }, element.props, props), children)));
13
+ return (React.createElement(MaybeTooltip, { showTooltip: hasTooltip, tooltip: children, defaultOpen: true, ...tooltipProps },
14
+ React.createElement(Text, { as: element.type, cursor: hasTooltip ? "pointer" : "initial", onMouseEnter: updateOverflow, width: "100%", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", "data-testid": testId, ...element.props, ...props }, children)));
27
15
  };
28
16
  export default TruncatedTextFillWidth;
@@ -1,24 +1,12 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import React from "react";
13
2
  import { Text } from "../../Type";
14
3
  import MaybeTooltip from "./MaybeTooltip";
15
- const TruncatedTextMaxCharacters = (_a) => {
16
- var { children, element, indicator, maxCharacters, showTooltip, tooltipProps, "data-testid": testId } = _a, props = __rest(_a, ["children", "element", "indicator", "maxCharacters", "showTooltip", "tooltipProps", "data-testid"]);
17
- const innerText = children !== null && children !== void 0 ? children : "";
4
+ const TruncatedTextMaxCharacters = ({ children, element, indicator, maxCharacters, showTooltip, tooltipProps, "data-testid": testId, ...props }) => {
5
+ const innerText = children ?? "";
18
6
  const requiresTruncation = innerText.length > maxCharacters;
19
7
  const truncatedText = requiresTruncation ? innerText.slice(0, maxCharacters) + indicator : innerText;
20
8
  const hasTooltip = showTooltip && requiresTruncation;
21
- return (React.createElement(MaybeTooltip, Object.assign({ showTooltip: hasTooltip, tooltip: innerText }, tooltipProps),
22
- React.createElement(Text, Object.assign({ as: element.type, cursor: hasTooltip ? "pointer" : "initial", width: "fit-content", "data-testid": testId }, element.props, props), truncatedText)));
9
+ return (React.createElement(MaybeTooltip, { showTooltip: hasTooltip, tooltip: innerText, ...tooltipProps },
10
+ React.createElement(Text, { as: element.type, cursor: hasTooltip ? "pointer" : "initial", width: "fit-content", "data-testid": testId, ...element.props, ...props }, truncatedText)));
23
11
  };
24
12
  export default TruncatedTextMaxCharacters;
@@ -1,11 +1,10 @@
1
- /// <reference types="react" />
2
1
  import { TextProps } from "./Text";
3
2
  export declare const Heading1: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "textTransform" | "disabled" | keyof import("react").HTMLAttributes<HTMLParagraphElement> | "inline" | "compact" | keyof import("../StyledProps").StyledProps> & import("react").HTMLAttributes<HTMLParagraphElement> & {
4
3
  variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
5
4
  inline?: boolean;
6
5
  compact?: boolean;
7
6
  disabled?: boolean;
8
- textTransform?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "full-width" | "capitalize" | "full-size-kana" | "lowercase" | "uppercase";
7
+ textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
9
8
  fontSize?: string;
10
9
  } & import("../StyledProps").StyledProps, "ref"> & {
11
10
  ref?: import("react").Ref<HTMLParagraphElement>;
@@ -17,7 +16,7 @@ export declare const Heading2: import("styled-components/dist/types").IStyledCom
17
16
  inline?: boolean;
18
17
  compact?: boolean;
19
18
  disabled?: boolean;
20
- textTransform?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "full-width" | "capitalize" | "full-size-kana" | "lowercase" | "uppercase";
19
+ textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
21
20
  fontSize?: string;
22
21
  } & import("../StyledProps").StyledProps, "ref"> & {
23
22
  ref?: import("react").Ref<HTMLParagraphElement>;
@@ -29,7 +28,7 @@ export declare const Heading3: import("styled-components/dist/types").IStyledCom
29
28
  inline?: boolean;
30
29
  compact?: boolean;
31
30
  disabled?: boolean;
32
- textTransform?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "full-width" | "capitalize" | "full-size-kana" | "lowercase" | "uppercase";
31
+ textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
33
32
  fontSize?: string;
34
33
  } & import("../StyledProps").StyledProps, "ref"> & {
35
34
  ref?: import("react").Ref<HTMLParagraphElement>;
@@ -41,7 +40,7 @@ export declare const Heading4: import("styled-components/dist/types").IStyledCom
41
40
  inline?: boolean;
42
41
  compact?: boolean;
43
42
  disabled?: boolean;
44
- textTransform?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "full-width" | "capitalize" | "full-size-kana" | "lowercase" | "uppercase";
43
+ textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
45
44
  fontSize?: string;
46
45
  } & import("../StyledProps").StyledProps, "ref"> & {
47
46
  ref?: import("react").Ref<HTMLParagraphElement>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
3
2
  import { StyledProps } from "../StyledProps";
4
3
  export type TextProps = React.HTMLAttributes<HTMLParagraphElement> & {
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import React from "react";
13
2
  import styled from "styled-components";
14
3
  import { Text } from "../Type";
@@ -23,9 +12,8 @@ const Wrapper = styled.div(({ theme }) => ({
23
12
  marginBottom: 0,
24
13
  },
25
14
  }));
26
- export default function InlineValidation(_a) {
27
- var { className, errorMessage, errorList, children } = _a, boxProps = __rest(_a, ["className", "errorMessage", "errorList", "children"]);
28
- return errorMessage || errorList ? (React.createElement(Flex, Object.assign({ className: className, color: "red" }, boxProps),
15
+ export default function InlineValidation({ className, errorMessage, errorList, children, ...boxProps }) {
16
+ return errorMessage || errorList ? (React.createElement(Flex, { className: className, color: "red", ...boxProps },
29
17
  React.createElement(Icon, { icon: "error", mr: "x1" }),
30
18
  React.createElement(Wrapper, null,
31
19
  errorMessage && React.createElement(Text, null, errorMessage),
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { StyledProps } from "../StyledProps";
3
2
  export interface DividerProps extends StyledProps, React.HTMLAttributes<HTMLDivElement> {
4
3
  secondary?: boolean;
@@ -7,35 +7,35 @@ const spaceProps = {
7
7
  p: "x1",
8
8
  mt: "x5",
9
9
  };
10
- export const _Alert = () => React.createElement(Alert, Object.assign({}, spaceProps), "Danger alert");
11
- export const _AsyncSelect = () => (React.createElement(AsyncSelect, Object.assign({ placeholder: "Filter Countries", className: "Select", classNamePrefix: "SelectTest", labelText: "Country" }, spaceProps)));
12
- export const _Breadcrumbs = () => (React.createElement(Breadcrumbs, Object.assign({}, spaceProps),
10
+ export const _Alert = () => React.createElement(Alert, { ...spaceProps }, "Danger alert");
11
+ export const _AsyncSelect = () => (React.createElement(AsyncSelect, { placeholder: "Filter Countries", className: "Select", classNamePrefix: "SelectTest", labelText: "Country", ...spaceProps }));
12
+ export const _Breadcrumbs = () => (React.createElement(Breadcrumbs, { ...spaceProps },
13
13
  React.createElement(Link, { href: "/" }, "Home"),
14
14
  React.createElement(Link, { href: "/Tenants" }, "Tenants"),
15
15
  React.createElement(Text, null, "Current Tenant")));
16
- export const _PrimaryButton = () => React.createElement(PrimaryButton, Object.assign({}, spaceProps), "Create project");
17
- export const _DatePicker = () => React.createElement(DatePicker, Object.assign({}, spaceProps));
18
- export const _DropdownMenu = () => (React.createElement(DropdownMenu, Object.assign({ defaultOpen: true, openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown" }, spaceProps),
16
+ export const _PrimaryButton = () => React.createElement(PrimaryButton, { ...spaceProps }, "Create project");
17
+ export const _DatePicker = () => React.createElement(DatePicker, { ...spaceProps });
18
+ export const _DropdownMenu = () => (React.createElement(DropdownMenu, { defaultOpen: true, openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown", ...spaceProps },
19
19
  React.createElement(DropdownLink, { href: "/" }, "Dropdown Link"),
20
20
  React.createElement(DropdownButton, { onClick: () => { } }, "Dropdown Button"),
21
21
  React.createElement(DropdownItem, null,
22
22
  React.createElement("a", { href: "/", style: { textDecoration: "none" } }, "Custom Link Component"))));
23
- export const _FieldLabel = () => (React.createElement(FieldLabel, Object.assign({ labelText: "Default label", helpText: "I am help text. I can give more details on the input below!", requirementText: "(Required)" }, spaceProps),
23
+ export const _FieldLabel = () => (React.createElement(FieldLabel, { labelText: "Default label", helpText: "I am help text. I can give more details on the input below!", requirementText: "(Required)", ...spaceProps },
24
24
  React.createElement(Input, { id: "birthplace", labelText: "Place of birth", requirementText: "(Optional)" })));
25
25
  export const _Form = () => (React.createElement(Form, { mt: "x2", p: "x1" },
26
26
  React.createElement(Input, { id: "name", labelText: "Name" }),
27
27
  React.createElement(Input, { id: "birthdate", placeholder: "DD-MM-YYYY", labelText: "Date of birth", requirementText: "(Optional)", helpText: "Enter a date below" }),
28
28
  React.createElement(Input, { id: "birthplace", labelText: "Place of birth", requirementText: "(Optional)" })));
29
29
  export const _Link = () => (React.createElement(Link, { as: "button", mt: "x2", p: "x1" }, "Link"));
30
- export const _List = () => (React.createElement(List, Object.assign({ leftAlign: true }, spaceProps),
30
+ export const _List = () => (React.createElement(List, { leftAlign: true, ...spaceProps },
31
31
  React.createElement(ListItem, null, "List Item 1"),
32
32
  React.createElement(ListItem, null, "List Item 2 that is really really really really really really really really really long"),
33
33
  React.createElement(ListItem, { mt: "x1" }, "List Item 3")));
34
- export const _Pagination = () => React.createElement(Pagination, Object.assign({ currentPage: 3, totalPages: 4 }, spaceProps));
34
+ export const _Pagination = () => React.createElement(Pagination, { currentPage: 3, totalPages: 4, ...spaceProps });
35
35
  export const _Radio = () => (React.createElement(React.Fragment, null,
36
- React.createElement(Radio, Object.assign({ id: "radio", error: true, labelText: "I am error" }, spaceProps)),
37
- React.createElement(Radio, Object.assign({ id: "radio", defaultChecked: true, error: true, labelText: "I am error" }, spaceProps))));
38
- export const _Select = () => (React.createElement(Select, Object.assign({ defaultValue: 2, placeholder: "Please select inventory status", options: [
36
+ React.createElement(Radio, { id: "radio", error: true, labelText: "I am error", ...spaceProps }),
37
+ React.createElement(Radio, { id: "radio", defaultChecked: true, error: true, labelText: "I am error", ...spaceProps })));
38
+ export const _Select = () => (React.createElement(Select, { defaultValue: 2, placeholder: "Please select inventory status", options: [
39
39
  {
40
40
  label: "option 1",
41
41
  value: 1,
@@ -48,7 +48,7 @@ export const _Select = () => (React.createElement(Select, Object.assign({ defaul
48
48
  label: "option 3",
49
49
  value: 3,
50
50
  },
51
- ], labelText: "Inventory status" }, spaceProps)));
51
+ ], labelText: "Inventory status", ...spaceProps }));
52
52
  const columns = [
53
53
  { label: "Date", dataKey: "date" },
54
54
  { label: "Expected Quantity", dataKey: "expectedQuantity" },
@@ -104,12 +104,12 @@ const rowData = [
104
104
  id: "r9",
105
105
  },
106
106
  ];
107
- export const _Table = () => React.createElement(Table, Object.assign({ columns: columns, rows: rowData }, spaceProps));
108
- export const _Tabs = () => (React.createElement(Tabs, Object.assign({}, spaceProps),
107
+ export const _Table = () => React.createElement(Table, { columns: columns, rows: rowData, ...spaceProps });
108
+ export const _Tabs = () => (React.createElement(Tabs, { ...spaceProps },
109
109
  React.createElement(Tab, { className: "Tab1", label: "Tab 1" }, "Tab 1 Content"),
110
110
  React.createElement(Tab, { className: "Tab2", label: "Tab 2" }, "Tab 2 Content"),
111
111
  React.createElement(Tab, { className: "Tab3", label: "Tab 3" }, "Tab 3 Content"),
112
112
  React.createElement(Tab, { className: "Tab4", label: "Tab 4" }, "Tab 4 Content")));
113
- export const _TimePicker = () => React.createElement(TimePicker, Object.assign({ labelText: "End Time", defaultValue: "12:38 PM" }, spaceProps));
114
- export const _TruncatedText = () => (React.createElement(TruncatedText, Object.assign({}, spaceProps), "Special instructions are provided for the shipment"));
115
- export const _InlineValidation = () => React.createElement(InlineValidation, Object.assign({ errorMessage: "Something has gone wrong" }, spaceProps));
113
+ export const _TimePicker = () => React.createElement(TimePicker, { labelText: "End Time", defaultValue: "12:38 PM", ...spaceProps });
114
+ export const _TruncatedText = () => (React.createElement(TruncatedText, { ...spaceProps }, "Special instructions are provided for the shipment"));
115
+ export const _InlineValidation = () => React.createElement(InlineValidation, { errorMessage: "Something has gone wrong", ...spaceProps });
@@ -1,10 +1,9 @@
1
1
  import { ThemeContext } from "styled-components";
2
2
  import React, { useCallback, useEffect, useState } from "react";
3
3
  function useMediaQuery(q) {
4
- var _a;
5
4
  const isUnsupported = typeof window === "undefined" || typeof window.matchMedia === "undefined";
6
5
  const theme = React.useContext(ThemeContext);
7
- const query = ((_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a[q]) ? `(min-width: ${theme.breakpoints[q]})` : q;
6
+ const query = theme?.breakpoints?.[q] ? `(min-width: ${theme.breakpoints[q]})` : q;
8
7
  const getMatches = useCallback((query) => {
9
8
  if (isUnsupported) {
10
9
  return false;
package/dist/src/i18n.js CHANGED
@@ -48,7 +48,7 @@ i18n.init({
48
48
  defaultNS: "nds",
49
49
  resources,
50
50
  lng: "en_US",
51
- keySeparator: false,
51
+ keySeparator: false, // we do not use keys in form messages.welcome
52
52
  interpolation: {
53
53
  escapeValue: false, // react already safes from xss
54
54
  },
@@ -77,7 +77,7 @@ const getRows = () => {
77
77
  const row = { key, id: key };
78
78
  Object.keys(locales).forEach((locale) => {
79
79
  const translations = locales[locale].keys;
80
- row[locale] = (translations === null || translations === void 0 ? void 0 : translations[key]) || "-";
80
+ row[locale] = translations?.[key] || "-";
81
81
  });
82
82
  return row;
83
83
  });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Helper function to check if an element has a specific computed style.
3
+ * @param element - The DOM element to check
4
+ * @param styleString - CSS style string in the format "property: value" (e.g., "opacity: 0", "z-index: 1001")
5
+ * @returns true if the computed style matches, false otherwise
6
+ */
7
+ export declare function hasComputedStyle(element: HTMLElement | null, styleString: string): boolean;
8
+ declare module "vitest" {
9
+ interface Assertion {
10
+ toHaveComputedStyle(styleString: string): void;
11
+ }
12
+ interface AsymmetricMatchersContaining {
13
+ toHaveComputedStyle(styleString: string): void;
14
+ }
15
+ }
@@ -0,0 +1,50 @@
1
+ import { expect } from "vitest";
2
+ /**
3
+ * Helper function to check if an element has a specific computed style.
4
+ * @param element - The DOM element to check
5
+ * @param styleString - CSS style string in the format "property: value" (e.g., "opacity: 0", "z-index: 1001")
6
+ * @returns true if the computed style matches, false otherwise
7
+ */
8
+ export function hasComputedStyle(element, styleString) {
9
+ if (!element) {
10
+ return false;
11
+ }
12
+ const [property, value] = styleString.split(":").map((s) => s.trim());
13
+ const computedStyle = window.getComputedStyle(element);
14
+ const actualValue = computedStyle.getPropertyValue(property);
15
+ // Normalize values for comparison
16
+ // Handle numeric values (e.g., "0" vs "0px" for opacity, "1001" vs "1001px" for z-index)
17
+ const normalizedExpected = value.trim();
18
+ const normalizedActual = actualValue.trim();
19
+ // For numeric values, compare as numbers
20
+ const expectedNum = parseFloat(normalizedExpected);
21
+ const actualNum = parseFloat(normalizedActual);
22
+ if (!isNaN(expectedNum) && !isNaN(actualNum)) {
23
+ return expectedNum === actualNum;
24
+ }
25
+ // For non-numeric values, do exact string comparison
26
+ return normalizedExpected === normalizedActual;
27
+ }
28
+ /**
29
+ * Custom Vitest matcher to check computed styles.
30
+ * Usage: expect(element).toHaveComputedStyle("opacity: 0")
31
+ */
32
+ expect.extend({
33
+ toHaveComputedStyle(received, styleString) {
34
+ const pass = hasComputedStyle(received, styleString);
35
+ const [property, value] = styleString.split(":").map((s) => s.trim());
36
+ if (pass) {
37
+ return {
38
+ message: () => `expected element not to have computed style ${property}: ${value}`,
39
+ pass: true,
40
+ };
41
+ }
42
+ else {
43
+ const actualValue = received ? window.getComputedStyle(received).getPropertyValue(property) : "element is null";
44
+ return {
45
+ message: () => `expected element to have computed style ${property}: ${value}, but got ${actualValue}`,
46
+ pass: false,
47
+ };
48
+ }
49
+ },
50
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ import { expect } from "vitest";
2
2
  expect.extend({
3
3
  toMatchDate(received, date) {
4
4
  const pass = date.getMonth() === received.getMonth() &&
@@ -1,6 +1,12 @@
1
1
  export const mergeThemes = (theme, customTheme) => Object.keys(theme).reduce((mergedTheme, group) => {
2
2
  if (customTheme && mergedTheme[group] && customTheme[group]) {
3
- return Object.assign(Object.assign({}, mergedTheme), { [group]: Object.assign(Object.assign({}, mergedTheme[group]), customTheme[group]) });
3
+ return {
4
+ ...mergedTheme,
5
+ [group]: {
6
+ ...mergedTheme[group],
7
+ ...customTheme[group],
8
+ },
9
+ };
4
10
  }
5
11
  return mergedTheme;
6
12
  }, theme);
@@ -4,9 +4,12 @@ import { useFeatureFlags } from "../NDSProvider/FeatureFlagsContext";
4
4
  import { mergeThemes } from "./mergeThemes.util";
5
5
  import { legacy, themes } from "./theme";
6
6
  const THEME_VARIANTS = new Set(["desktop", "touch"]);
7
- export const buildBreakPoints = (breakpointsConfig) => (Object.assign(Object.assign({}, breakpointsConfig), { map: function (fn) {
7
+ export const buildBreakPoints = (breakpointsConfig) => ({
8
+ ...breakpointsConfig,
9
+ map: function (fn) {
8
10
  return Object.values(breakpointsConfig).map(fn);
9
- } }));
11
+ },
12
+ });
10
13
  const validateVariantOrThrow = (variant) => {
11
14
  if (!THEME_VARIANTS.has(variant)) {
12
15
  throw new Error(`Invalid variant "${variant}" provided to NDSProvider. Valid variants are: ${Array.from(THEME_VARIANTS).join(", ")}.`);
@@ -28,5 +31,8 @@ export function useNDSTheme(variant = "desktop", customTheme) {
28
31
  setThemeVariant(newTheme);
29
32
  }, [variant, isTabletSize, experimentalDesktopTypographyScale]);
30
33
  const mergedTheme = mergeThemes(themeVariant, customTheme);
31
- return Object.assign(Object.assign({}, mergedTheme), { breakpoints: buildBreakPoints(mergedTheme.breakpoints) });
34
+ return {
35
+ ...mergedTheme,
36
+ breakpoints: buildBreakPoints(mergedTheme.breakpoints),
37
+ };
32
38
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
3
2
  declare const ClickInputLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
4
3
  variant?: ComponentVariant;
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @deprecated use `useClickOutside` instead
3
+ */
1
4
  export default class DetectOutsideClick extends React.Component<any, any, any> {
2
5
  constructor(props: any);
3
6
  handleOutsideClick(e: any): void;
@@ -1,4 +1,7 @@
1
1
  import React from "react";
2
+ /**
3
+ * @deprecated use `useClickOutside` instead
4
+ */
2
5
  export default class DetectOutsideClick extends React.Component {
3
6
  constructor(props) {
4
7
  super(props);
@@ -128,5 +128,9 @@ const PopperArrow = styled.div(({ theme }) => ({
128
128
  position: "absolute",
129
129
  width: 0,
130
130
  },
131
- }), ({ placement = "bottom", borderColor = "grey", backgroundColor = "white", theme }) => (Object.assign({}, drawArrow(placement, borderColor, backgroundColor, theme))), ({ placement = "bottom", theme }) => (Object.assign({}, positionArrow(placement, theme))));
131
+ }), ({ placement = "bottom", borderColor = "grey", backgroundColor = "white", theme }) => ({
132
+ ...drawArrow(placement, borderColor, backgroundColor, theme),
133
+ }), ({ placement = "bottom", theme }) => ({
134
+ ...positionArrow(placement, theme),
135
+ }));
132
136
  export default PopperArrow;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { Icon } from "../Icon";
3
2
  import styled from "styled-components";
4
3
  import { position } from "styled-system";
4
+ import { Icon } from "../Icon";
5
5
  const ScrollIndicatorWrapper = styled.div(({ theme }) => ({
6
6
  position: "absolute",
7
7
  left: `calc(50% - ${theme.space.x3})`,
@@ -1,2 +1,7 @@
1
1
  export default generateId;
2
+ /**
3
+ * Generates a unique ID for an element.
4
+ * @returns {string} A unique ID.
5
+ * @deprecated use `useId` instead
6
+ */
2
7
  declare function generateId(): string;
@@ -1,5 +1,10 @@
1
1
  const prefix = "random-id-";
2
2
  let randomId = 0;
3
+ /**
4
+ * Generates a unique ID for an element.
5
+ * @returns {string} A unique ID.
6
+ * @deprecated use `useId` instead
7
+ */
3
8
  const generateId = () => {
4
9
  randomId += 1;
5
10
  return prefix + randomId;
@@ -2,7 +2,6 @@ export { default as ClickInputLabel } from "./ClickInputLabel";
2
2
  export { default as omit } from "./omit";
3
3
  export { default as subPx } from "./subPx";
4
4
  export { default as generateId } from "./generateId";
5
- export { default as withWindowDimensions } from "./withWindowDimensions";
6
5
  export { default as DetectOutsideClick } from "./DetectOutsideClick";
7
6
  export { default as PopperArrow } from "./PopperArrow";
8
7
  export { default as ScrollIndicators } from "./ScrollIndicators";
@@ -2,7 +2,6 @@ export { default as ClickInputLabel } from "./ClickInputLabel";
2
2
  export { default as omit } from "./omit";
3
3
  export { default as subPx } from "./subPx";
4
4
  export { default as generateId } from "./generateId";
5
- export { default as withWindowDimensions } from "./withWindowDimensions";
6
5
  export { default as DetectOutsideClick } from "./DetectOutsideClick";
7
6
  export { default as PopperArrow } from "./PopperArrow";
8
7
  export { default as ScrollIndicators } from "./ScrollIndicators";
@@ -1,3 +1,4 @@
1
+ import { describe, it, expect } from "vitest";
1
2
  import numberFromDimension from ".";
2
3
  describe("numberFromDimension", () => {
3
4
  it("returns the numerical value from a css dimension", () => {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * A styled component for displaying code in a storybook.
4
3
  *
@@ -5,5 +5,5 @@ import { ComponentType } from "react";
5
5
  * Do not export for production.
6
6
  */
7
7
  export declare const dashed: <P extends Record<string, unknown>>(component: ComponentType<P>) => import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(import("react").PropsWithoutRef<P> & import("react").RefAttributes<import("react").Component<P, any, any>>) | (import("react").PropsWithRef<P & {
8
- children?: import("react").ReactNode;
9
- }> & import("styled-components/dist/types").BaseObject), import("styled-components/dist/types").BaseObject>> & string & (Omit<import("react").ComponentClass<P, any>, keyof import("react").Component<any, {}, any>> | Omit<import("react").FunctionComponent<P>, keyof import("react").Component<any, {}, any>>);
8
+ children?: import("react").ReactNode | undefined;
9
+ }> & import("styled-components/dist/types").BaseObject), import("styled-components/dist/types").BaseObject>> & (string & (Omit<import("react").ComponentClass<P, any>, keyof import("react").Component<any, {}, any>> | Omit<import("react").FunctionComponent<P>, keyof import("react").Component<any, {}, any>>));
@@ -24,7 +24,7 @@ const Svg = styled.svg(({ theme }) => ({
24
24
  * To be used in Storybook exclusively. Do not export for production.
25
25
  */
26
26
  export function Placeholder(props) {
27
- return (React.createElement(Contianer, Object.assign({}, props),
27
+ return (React.createElement(Contianer, { ...props },
28
28
  React.createElement(Svg, { fill: "none" },
29
29
  React.createElement("defs", null,
30
30
  React.createElement("pattern", { id: "diagonal-stripes", x: "0", y: "0", width: "10", height: "10", patternUnits: "userSpaceOnUse" },
@@ -11,14 +11,14 @@ export declare const WidthText: import("styled-components/dist/types").IStyledCo
11
11
  inline?: boolean;
12
12
  compact?: boolean;
13
13
  disabled?: boolean;
14
- textTransform?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "full-width" | "capitalize" | "full-size-kana" | "lowercase" | "uppercase";
14
+ textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
15
15
  fontSize?: string;
16
16
  } & import("../..").StyledProps & import("framer-motion").MotionProps, "ref"> & React.RefAttributes<HTMLElement | SVGElement>, never>> & string & Omit<import("framer-motion").CustomDomComponent<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "textTransform" | "disabled" | keyof React.HTMLAttributes<HTMLParagraphElement> | "inline" | "compact" | keyof import("../..").StyledProps> & React.HTMLAttributes<HTMLParagraphElement> & {
17
17
  variant?: import("../../NDSProvider/ComponentVariantContext").ComponentVariant;
18
18
  inline?: boolean;
19
19
  compact?: boolean;
20
20
  disabled?: boolean;
21
- textTransform?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "full-width" | "capitalize" | "full-size-kana" | "lowercase" | "uppercase";
21
+ textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
22
22
  fontSize?: string;
23
23
  } & import("../..").StyledProps>, keyof React.Component<any, {}, any>>;
24
24
  export declare const ResizeHandle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -13,7 +13,7 @@ export const Resizable = ({ children, containerWidth = "100%", onResize, showCon
13
13
  return (React.createElement(ReResizable, { enable: { right: true }, size: { width: width }, handleComponent: { right: React.createElement(ResizeHandle, null) }, onResizeStart: () => setShowWidth(true), onResizeStop: () => setShowWidth(false), onResize: (_, __, ref) => {
14
14
  const width = Math.round(ref.getBoundingClientRect().width);
15
15
  setWidth(`${width - (showContainerOutline ? CONTAINER_BORDER_WIDTH : 0)}px`);
16
- onResize === null || onResize === void 0 ? void 0 : onResize(width - (showContainerOutline ? CONTAINER_BORDER_WIDTH : 0));
16
+ onResize?.(width - (showContainerOutline ? CONTAINER_BORDER_WIDTH : 0));
17
17
  } }, showContainerOutline ? (React.createElement(DashedBox, null,
18
18
  children,
19
19
  WidthIndicator)) : (React.createElement(Box, null,
@@ -1,22 +1,11 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1
+ export async function filterOptions(inputValue, options, simulatedNetworkDelayMs = 450) {
2
+ const filteredOptions = options.filter((option) => {
3
+ return option.label.toLowerCase().startsWith(inputValue.toLowerCase());
8
4
  });
9
- };
10
- export function filterOptions(inputValue, options, simulatedNetworkDelayMs = 450) {
11
- return __awaiter(this, void 0, void 0, function* () {
12
- const filteredOptions = options.filter((option) => {
13
- return option.label.toLowerCase().startsWith(inputValue.toLowerCase());
14
- });
15
- const responseBody = JSON.stringify(filteredOptions);
16
- return new Promise((resolve) => {
17
- setTimeout(() => {
18
- resolve(new Response(responseBody));
19
- }, simulatedNetworkDelayMs);
20
- });
5
+ const responseBody = JSON.stringify(filteredOptions);
6
+ return new Promise((resolve) => {
7
+ setTimeout(() => {
8
+ resolve(new Response(responseBody));
9
+ }, simulatedNetworkDelayMs);
21
10
  });
22
11
  }
@@ -5,6 +5,6 @@
5
5
  * @returns A CSS calc() expression
6
6
  */
7
7
  export default function subPx(baseValue, subtractValue) {
8
- const valueToSubtract = subtractValue !== null && subtractValue !== void 0 ? subtractValue : "1px";
8
+ const valueToSubtract = subtractValue ?? "1px";
9
9
  return `calc(${baseValue} - ${valueToSubtract})`;
10
10
  }