@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,15 +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
- import { text } from "@storybook/addon-knobs";
13
1
  import React, { useState, useRef } from "react";
14
2
  import { ApplicationFrame, Breadcrumbs, Link, Page, Sidebar, Select, PrimaryButton, Box, Textarea, Heading3, Navigation, } from "..";
15
3
  import { useUrlProps } from "../utils/testing/useUrlProps";
@@ -20,22 +8,19 @@ export default {
20
8
  chromatic: { delay: 300 }, // time for sidebar animation
21
9
  },
22
10
  };
23
- const ExampleSidebar = (_a) => {
24
- var { isOpen, onClose } = _a, props = __rest(_a, ["isOpen", "onClose"]);
25
- return (React.createElement(Sidebar, Object.assign({ isOpen: isOpen, title: "Filters", onClose: onClose, footer: React.createElement(PrimaryButton, null, "Apply") }, props),
26
- React.createElement(Select, { options: [{ label: "first option", value: 1 }], labelText: "Delivery:" }),
27
- React.createElement(Select, { options: [], labelText: "Delivery:" }),
28
- React.createElement(Select, { options: [], labelText: "Delivery:" }),
29
- React.createElement(Select, { options: [], labelText: "Delivery:" }),
30
- React.createElement(Select, { options: [], labelText: "Delivery:" }),
31
- React.createElement(Select, { options: [], labelText: "Delivery:" }),
32
- React.createElement(Select, { options: [], labelText: "Delivery:" }),
33
- React.createElement(Select, { options: [], labelText: "Delivery:" }),
34
- React.createElement(Select, { options: [], labelText: "Delivery:" }),
35
- React.createElement(Select, { options: [], labelText: "Delivery:" }),
36
- React.createElement(Select, { options: [], labelText: "Delivery:" }),
37
- React.createElement(Select, { options: [], labelText: "Last Delivery:" })));
38
- };
11
+ const ExampleSidebar = ({ isOpen, onClose, ...props }) => (React.createElement(Sidebar, { isOpen: isOpen, title: "Filters", onClose: onClose, footer: React.createElement(PrimaryButton, null, "Apply"), ...props },
12
+ React.createElement(Select, { options: [{ label: "first option", value: 1 }], labelText: "Delivery:" }),
13
+ React.createElement(Select, { options: [], labelText: "Delivery:" }),
14
+ React.createElement(Select, { options: [], labelText: "Delivery:" }),
15
+ React.createElement(Select, { options: [], labelText: "Delivery:" }),
16
+ React.createElement(Select, { options: [], labelText: "Delivery:" }),
17
+ React.createElement(Select, { options: [], labelText: "Delivery:" }),
18
+ React.createElement(Select, { options: [], labelText: "Delivery:" }),
19
+ React.createElement(Select, { options: [], labelText: "Delivery:" }),
20
+ React.createElement(Select, { options: [], labelText: "Delivery:" }),
21
+ React.createElement(Select, { options: [], labelText: "Delivery:" }),
22
+ React.createElement(Select, { options: [], labelText: "Delivery:" }),
23
+ React.createElement(Select, { options: [], labelText: "Last Delivery:" })));
39
24
  export const _Sidebar = () => {
40
25
  const [isOpen, setIsOpen] = useState(false);
41
26
  const triggerRef = useRef(null);
@@ -53,7 +38,7 @@ export const _Sidebar = () => {
53
38
  React.createElement(Box, { minWidth: "300px" },
54
39
  React.createElement(PrimaryButton, { onClick: toggleSidebar, ref: triggerRef, id: "openSidebarTrigger" }, "Open Sidebar"),
55
40
  React.createElement(Box, { height: "3000px", width: "50%", bg: "lightBlue", mt: "x3", p: "x2" }, "Space for more content")),
56
- React.createElement(ExampleSidebar, Object.assign({ isOpen: isOpen, onClose: closeSidebar, triggerRef: triggerRef, "aria-controls": "openSidebarTrigger" }, urlProps)))));
41
+ React.createElement(ExampleSidebar, { isOpen: isOpen, onClose: closeSidebar, triggerRef: triggerRef, "aria-controls": "openSidebarTrigger", ...urlProps }))));
57
42
  };
58
43
  export const WithoutOverlay = () => {
59
44
  const [isOpen, setIsOpen] = useState(false);
@@ -93,7 +78,7 @@ export const OpenByDefault = () => {
93
78
  React.createElement(Box, { height: "3000px", width: "100%", bg: "lightBlue", mt: "x3", p: "x2" }, "Space for more content")),
94
79
  React.createElement(ExampleSidebar, { isOpen: isOpen, onClose: closeSidebar, triggerRef: triggerRef, "aria-controls": "openSidebarTrigger" }))));
95
80
  };
96
- export const WithCustomOffset = () => {
81
+ const WithCustomOffsetComponent = (args) => {
97
82
  const [isOpen, setIsOpen] = useState(true);
98
83
  const triggerRef = useRef(null);
99
84
  const toggleSidebar = () => {
@@ -109,7 +94,15 @@ export const WithCustomOffset = () => {
109
94
  React.createElement(Box, { minWidth: "300px" },
110
95
  React.createElement(PrimaryButton, { onClick: toggleSidebar, ref: triggerRef, id: "openSidebarTrigger" }, "Open Sidebar"),
111
96
  React.createElement(Box, { height: "3000px", width: "100%", bg: "lightBlue", mt: "x3", p: "x2" }, "Space for more content")),
112
- React.createElement(ExampleSidebar, { isOpen: isOpen, onClose: closeSidebar, triggerRef: triggerRef, "aria-controls": "openSidebarTrigger", offset: text("offset", "400px"), duration: text("duration", "0.5") }))));
97
+ React.createElement(ExampleSidebar, { isOpen: isOpen, onClose: closeSidebar, triggerRef: triggerRef, "aria-controls": "openSidebarTrigger", ...args }))));
98
+ };
99
+ export const WithCustomOffset = {
100
+ args: {
101
+ offset: "400px",
102
+ duration: 0.5,
103
+ },
104
+ name: "With custom offset",
105
+ render: (args) => React.createElement(WithCustomOffsetComponent, { ...args }),
113
106
  };
114
107
  export const DontCloseOnOutsideClick = () => {
115
108
  const [isOpen, setIsOpen] = useState(false);
@@ -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 styled from "styled-components";
13
2
  import { darken } from "polished";
14
3
  import { themeGet } from "@styled-system/theme-get";
@@ -17,8 +6,7 @@ import { addStyledProps } from "../StyledProps";
17
6
  import { AppTag } from "../AppTag";
18
7
  import { InlineFlex } from "../Flex";
19
8
  import { Icon } from "../Icon";
20
- export default function Link(_a) {
21
- var { children, forApp, openInNewTab } = _a, props = __rest(_a, ["children", "forApp", "openInNewTab"]);
9
+ export default function Link({ children, forApp, openInNewTab, ...props }) {
22
10
  const openInNewTabProps = openInNewTab ? { target: "_blank", rel: "noopener noreferrer" } : {};
23
11
  const renderContent = () => {
24
12
  if (forApp || openInNewTab) {
@@ -29,7 +17,7 @@ export default function Link(_a) {
29
17
  }
30
18
  return children;
31
19
  };
32
- return (React.createElement(Anchor, Object.assign({}, openInNewTabProps, props), renderContent()));
20
+ return (React.createElement(Anchor, { ...openInNewTabProps, ...props }, renderContent()));
33
21
  }
34
22
  const LinkWrapper = styled.span(({ underline = true }) => ({
35
23
  textDecoration: underline ? "underline" : "none",
@@ -45,10 +33,14 @@ function getColor(props) {
45
33
  return getColorFromProps(props) || props.theme.colors.blue;
46
34
  }
47
35
  const getHoverColor = (props) => (props.hover ? getColor(props) : darken("0.1", getColor(props)));
48
- const Anchor = styled.a((_a) => {
49
- var { underline = true, as } = _a, props = __rest(_a, ["underline", "as"]);
50
- return (Object.assign(Object.assign({}, resetButtonStyles), { padding: as === "button" ? "0" : undefined, textDecoration: underline ? "underline" : "none", fontSize: props.theme.fontSizes.base, color: getColor(props), "&:hover": {
51
- cursor: "pointer",
52
- color: getHoverColor(props),
53
- } }));
54
- }, addStyledProps);
36
+ const Anchor = styled.a(({ underline = true, as, ...props }) => ({
37
+ ...resetButtonStyles,
38
+ padding: as === "button" ? "0" : undefined,
39
+ textDecoration: underline ? "underline" : "none",
40
+ fontSize: props.theme.fontSizes.base,
41
+ color: getColor(props),
42
+ "&:hover": {
43
+ cursor: "pointer",
44
+ color: getHoverColor(props),
45
+ },
46
+ }), addStyledProps);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { StyledProps } from "../StyledProps";
3
2
  interface Props extends React.ComponentPropsWithRef<"ul">, StyledProps {
4
3
  className?: string;
@@ -1,66 +1,44 @@
1
+ import type { StoryObj } from "@storybook/react";
1
2
  import React from "react";
3
+ import { Modal as NDSModal } from "../index";
2
4
  declare const _default: {
3
5
  title: string;
4
- };
5
- export default _default;
6
- export declare const _Modal: () => React.JSX.Element;
7
- export declare const WithCloseButton: {
8
- (): React.JSX.Element;
9
- story: {
10
- name: string;
11
- };
12
- };
13
- export declare const WithScrollingContent: {
14
- (): React.JSX.Element;
15
- story: {
16
- name: string;
17
- };
18
- };
19
- export declare const WithScrollingContentWithoutFooterContent: {
20
- (): React.JSX.Element;
21
- story: {
22
- name: string;
23
- };
24
- };
25
- export declare const WithNoTitle: {
26
- (): React.JSX.Element;
27
- story: {
28
- name: string;
29
- };
30
- };
31
- export declare const WithNoFooterContent: {
32
- (): React.JSX.Element;
33
- story: {
34
- name: string;
35
- };
36
- };
37
- export declare const WithCustomMaxWidth: {
38
- (): React.JSX.Element;
39
- story: {
40
- name: string;
41
- };
42
- };
43
- export declare const WithSelect: {
44
- (): React.JSX.Element;
45
- story: {
46
- name: string;
47
- };
48
- };
49
- export declare const WithSelectAndScrollingContent: {
50
- (): React.JSX.Element;
51
- story: {
52
- name: string;
53
- };
54
- };
55
- export declare const WithParentSelector: {
56
- (): React.JSX.Element;
57
- story: {
58
- name: string;
59
- };
60
- };
61
- export declare const ExampleControlledModal: {
62
- (): React.JSX.Element;
63
- story: {
64
- name: string;
6
+ component: React.FC<React.PropsWithChildren<{
7
+ isOpen?: boolean;
8
+ title?: string;
9
+ ariaLabel?: string;
10
+ onRequestClose?: (...args: any[]) => any;
11
+ closeAriaLabel?: string;
12
+ onAfterOpen?: (...args: any[]) => any;
13
+ shouldFocusAfterRender?: boolean;
14
+ shouldReturnFocusAfterClose?: boolean;
15
+ ariaDescribedBy?: string;
16
+ maxWidth?: string;
17
+ portalClassName?: string;
18
+ overlayClassName?: string;
19
+ className?: string;
20
+ id?: string;
21
+ appElement?: JSX.Element;
22
+ ariaHideApp?: boolean;
23
+ footerContent?: React.ReactNode;
24
+ parentSelector?: (...args: any) => HTMLElement;
25
+ }>> & {
26
+ setAppElement: (element: string | HTMLElement) => void;
27
+ };
28
+ args: {
29
+ ariaHideApp: false;
65
30
  };
66
31
  };
32
+ export default _default;
33
+ type Story = StoryObj<typeof NDSModal>;
34
+ export declare const Default: Story;
35
+ export declare const WithCloseButton: Story;
36
+ export declare const WithScrollingContent: Story;
37
+ export declare const WithScrollingContentWithoutFooterContent: Story;
38
+ export declare const WithNoTitle: Story;
39
+ export declare const WithNoFooterContent: Story;
40
+ export declare const WithCustomMaxWidth: Story;
41
+ export declare const WithSelect: Story;
42
+ export declare const WithSelectAndScrollingContent: Story;
43
+ export declare const WithParentSelector: Story;
44
+ export declare const ExampleControlledModal: Story;
@@ -1,12 +1,7 @@
1
- import React from "react";
1
+ import React, { useState } from "react";
2
2
  import { Modal as NDSModal, Button, QuietButton, PrimaryButton, ButtonGroup, Form, Input, Select, Text, DatePicker, } from "../index";
3
- const env = process.env.NODE_ENV;
4
- if (env !== "test")
5
- NDSModal.setAppElement("#root");
6
- const envProps = {
7
- ariaHideApp: env === "test" ? false : undefined,
8
- };
9
- const Modal = (props) => React.createElement(NDSModal, Object.assign({}, envProps, props));
3
+ if (process.env.NODE_ENV !== "test")
4
+ NDSModal.setAppElement("#storybook-root");
10
5
  const options = [
11
6
  { value: "accepted", label: "Accepted" },
12
7
  { value: "assigned", label: "Assigned to a line" },
@@ -16,105 +11,135 @@ const options = [
16
11
  { value: "progress", label: "In progress" },
17
12
  { value: "quarantine", label: "In quarantine" },
18
13
  ];
19
- class ModalExample extends React.Component {
20
- constructor(props) {
21
- super(props);
22
- this.state = {
23
- isOpen: false,
24
- };
25
- this.openModal = this.openModal.bind(this);
26
- this.closeModal = this.closeModal.bind(this);
27
- }
28
- openModal() {
29
- this.setState({ isOpen: true });
30
- }
31
- closeModal() {
32
- this.setState({ isOpen: false });
33
- }
34
- render() {
35
- const { isOpen } = this.state;
36
- const controlledModalButtons = (React.createElement(ButtonGroup, null,
37
- React.createElement(PrimaryButton, { type: "submit", form: "myForm" }, "Add job to line"),
38
- React.createElement(QuietButton, { onClick: this.closeModal }, "Cancel")));
39
- return (React.createElement(React.Fragment, null,
40
- React.createElement(Button, { onClick: this.openModal }, "Open Modal"),
41
- React.createElement(Modal, { title: "Edit Profile", footerContent: controlledModalButtons, onRequestClose: this.closeModal, isOpen: isOpen, maxWidth: "456px" },
42
- React.createElement(Form, { id: "myForm", mb: "x2" },
43
- React.createElement(Input, { name: "name", id: "name", labelText: "Name" }),
44
- React.createElement(Input, { type: "number", name: "age", id: "age", labelText: "Age" }),
45
- React.createElement(DatePicker, { selected: new Date("Fri, 01 Jan 2019"), dateFormat: "MMMM d, yyyy", onChange: (val) => val, onInputChange: (val) => val })))));
46
- }
47
- }
48
- const modalButtons = (React.createElement(ButtonGroup, null,
14
+ const ModalButtons = (React.createElement(ButtonGroup, null,
49
15
  React.createElement(PrimaryButton, null, "Add job to line"),
50
16
  React.createElement(QuietButton, null, "Cancel")));
51
17
  export default {
52
18
  title: "Components/Modal",
19
+ component: NDSModal,
20
+ args: {
21
+ ariaHideApp: process.env.NODE_ENV === "test" ? false : undefined,
22
+ },
23
+ };
24
+ export const Default = {
25
+ args: {
26
+ children: "Content Content Content",
27
+ title: "Modal Title",
28
+ footerContent: ModalButtons,
29
+ onRequestClose: () => { },
30
+ },
53
31
  };
54
- export const _Modal = () => (React.createElement(Modal, { footerContent: modalButtons, title: "Modal Title" }, "Content Content Content"));
55
- export const WithCloseButton = () => (React.createElement(Modal, { title: "Modal Title", footerContent: modalButtons, onRequestClose: () => { } }, "Content Content Content"));
56
- WithCloseButton.story = {
32
+ export const WithCloseButton = {
33
+ args: {
34
+ children: "Content Content Content",
35
+ title: "Modal Title",
36
+ footerContent: ModalButtons,
37
+ onRequestClose: () => { },
38
+ },
57
39
  name: "with close button",
58
40
  };
59
- export const WithScrollingContent = () => (React.createElement(Modal, { title: "Modal Title", footerContent: modalButtons },
60
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
61
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
62
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
63
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
64
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
65
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content")));
66
- WithScrollingContent.story = {
41
+ export const WithScrollingContent = {
42
+ args: {
43
+ title: "Modal Title",
44
+ footerContent: ModalButtons,
45
+ children: (React.createElement(React.Fragment, null,
46
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
47
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
48
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
49
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
50
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
51
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"))),
52
+ },
67
53
  name: "with scrolling content",
68
54
  };
69
- export const WithScrollingContentWithoutFooterContent = () => (React.createElement(Modal, { title: "Modal Title" },
70
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
71
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
72
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
73
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
74
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
75
- React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content")));
76
- WithScrollingContentWithoutFooterContent.story = {
55
+ export const WithScrollingContentWithoutFooterContent = {
56
+ args: {
57
+ title: "Modal Title",
58
+ children: (React.createElement(React.Fragment, null,
59
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
60
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
61
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
62
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
63
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"),
64
+ React.createElement(Text, null, "Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content"))),
65
+ },
77
66
  name: "with scrolling content without footer content",
78
67
  };
79
- export const WithNoTitle = () => React.createElement(Modal, { footerContent: modalButtons }, "Content Content Content");
80
- WithNoTitle.story = {
68
+ export const WithNoTitle = {
69
+ args: {
70
+ children: "Content Content Content",
71
+ footerContent: ModalButtons,
72
+ },
81
73
  name: "with no title",
82
74
  };
83
- export const WithNoFooterContent = () => (React.createElement(Modal, { title: "Without footerContent", onRequestClose: () => { } }, "Content Content Content"));
84
- WithNoFooterContent.story = {
75
+ export const WithNoFooterContent = {
76
+ args: {
77
+ children: "Content Content Content",
78
+ title: "Without footerContent",
79
+ onRequestClose: () => { },
80
+ },
85
81
  name: "with no footerContent",
86
82
  };
87
- export const WithCustomMaxWidth = () => (React.createElement(Modal, { title: "Modal Title", footerContent: modalButtons, maxWidth: "1000px" }, "Content Content Content"));
88
- WithCustomMaxWidth.story = {
83
+ export const WithCustomMaxWidth = {
84
+ args: {
85
+ children: "Content Content Content",
86
+ title: "Modal Title",
87
+ footerContent: ModalButtons,
88
+ maxWidth: "1000px",
89
+ },
89
90
  name: "with custom maxWidth",
90
91
  };
91
- export const WithSelect = () => (React.createElement(Modal, { title: "Edit Profile", footerContent: modalButtons, onRequestClose: () => { }, maxWidth: "456px" },
92
- React.createElement(Form, { id: "myForm", mb: "x2" },
93
- React.createElement(Select, { maxHeight: "96px", placeholder: "Please select inventory status", options: options, labelText: "Inventory status" }))));
94
- WithSelect.story = {
92
+ export const WithSelect = {
93
+ args: {
94
+ title: "Edit Profile",
95
+ footerContent: ModalButtons,
96
+ maxWidth: "456px",
97
+ onRequestClose: () => { },
98
+ children: (React.createElement(Form, { id: "myForm", mb: "x2" },
99
+ React.createElement(Select, { maxHeight: "96px", placeholder: "Please select inventory status", options: options, labelText: "Inventory status" }))),
100
+ },
95
101
  name: "with select",
96
102
  };
97
- export const WithSelectAndScrollingContent = () => (React.createElement(Modal, { title: "Edit Profile", footerContent: modalButtons, onRequestClose: () => { }, maxWidth: "456px" },
98
- React.createElement(Form, { id: "myForm", mb: "x2" },
99
- React.createElement(Input, { name: "name", id: "name", labelText: "Name" }),
100
- React.createElement(Input, { type: "number", name: "age", id: "age", labelText: "Age" }),
101
- React.createElement(Input, { name: "name", id: "name", labelText: "Name" }),
102
- React.createElement(Input, { type: "number", name: "age", id: "age", labelText: "Age" }),
103
- React.createElement(Input, { name: "name", id: "name", labelText: "Name" }),
104
- React.createElement(Input, { type: "number", name: "age", id: "age", labelText: "Age" }),
105
- React.createElement(Select, { maxHeight: "96px", placeholder: "Please select inventory status", options: options, labelText: "Inventory status" }))));
106
- WithSelectAndScrollingContent.story = {
103
+ export const WithSelectAndScrollingContent = {
104
+ args: {
105
+ title: "Edit Profile",
106
+ footerContent: ModalButtons,
107
+ maxWidth: "456px",
108
+ onRequestClose: () => { },
109
+ children: (React.createElement(Form, { id: "myForm", mb: "x2" },
110
+ React.createElement(Input, { name: "name", id: "name", labelText: "Name" }),
111
+ React.createElement(Input, { type: "number", name: "age", id: "age", labelText: "Age" }),
112
+ React.createElement(Input, { name: "name", id: "name", labelText: "Name" }),
113
+ React.createElement(Input, { type: "number", name: "age", id: "age", labelText: "Age" }),
114
+ React.createElement(Input, { name: "name", id: "name", labelText: "Name" }),
115
+ React.createElement(Input, { type: "number", name: "age", id: "age", labelText: "Age" }),
116
+ React.createElement(Select, { maxHeight: "96px", placeholder: "Please select inventory status", options: options, labelText: "Inventory status" }))),
117
+ },
107
118
  name: "with select and scrolling content",
108
119
  };
109
- export const WithParentSelector = () => {
110
- const id = "wrapper";
111
- return (React.createElement("div", { id: id },
112
- React.createElement(Modal, { title: "Modal Title", footerContent: modalButtons, parentSelector: () => document.getElementById(id) }, "Content")));
113
- };
114
- WithParentSelector.story = {
120
+ export const WithParentSelector = {
121
+ args: {
122
+ title: "Modal Title",
123
+ footerContent: ModalButtons,
124
+ parentSelector: () => document.getElementById("parent-selector"),
125
+ },
115
126
  name: "with a parent selector",
127
+ render: (args) => (React.createElement("div", { id: "parent-selector" },
128
+ React.createElement(NDSModal, { ...args }, "Content"))),
116
129
  };
117
- export const ExampleControlledModal = () => React.createElement(ModalExample, null);
118
- ExampleControlledModal.story = {
130
+ export const ExampleControlledModal = {
131
+ render: () => React.createElement(ModalExample, null),
119
132
  name: "example controlled modal",
120
133
  };
134
+ const ModalExample = () => {
135
+ const [isOpen, setIsOpen] = useState(false);
136
+ return (React.createElement(React.Fragment, null,
137
+ React.createElement(Button, { onClick: () => setIsOpen(true) }, "Open Modal"),
138
+ React.createElement(NDSModal, { title: "Edit Profile", footerContent: React.createElement(ButtonGroup, null,
139
+ React.createElement(PrimaryButton, { type: "submit", form: "myForm" }, "Add job to line"),
140
+ React.createElement(QuietButton, { onClick: () => setIsOpen(false) }, "Cancel")), onRequestClose: () => setIsOpen(false), isOpen: isOpen, maxWidth: "456px" },
141
+ React.createElement(Form, { id: "myForm", mb: "x2" },
142
+ React.createElement(Input, { name: "name", id: "name", labelText: "Name" }),
143
+ React.createElement(Input, { type: "number", name: "age", id: "age", labelText: "Age" }),
144
+ React.createElement(DatePicker, { selected: new Date("Fri, 01 Jan 2019"), dateFormat: "MMMM d, yyyy", onChange: (val) => val, onInputChange: (val) => val })))));
145
+ };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const ModalCloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
3
2
  ref?: import("react").Ref<HTMLButtonElement>;
4
3
  }, "ref"> & import("react").RefAttributes<HTMLButtonElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const ModalFooter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
2
  export default ModalFooter;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const ModalHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
2
  hasCloseButton?: boolean;
4
3
  }>> & string;
@@ -8,5 +8,5 @@ export function useComponentVariant(selectedVariant) {
8
8
  if (!context) {
9
9
  throw new Error(`useComponentVariant must be used within the NDSProvider`);
10
10
  }
11
- return selectedVariant !== null && selectedVariant !== void 0 ? selectedVariant : context.variant;
11
+ return selectedVariant ?? context.variant;
12
12
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const GlobalStyles: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
2
  locale?: string;
4
3
  }>> & string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const ModalStyleOverride: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & {
3
2
  locale?: string;
4
3
  }>;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Reset: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & object>;
3
2
  export default Reset;
@@ -1 +1,3 @@
1
- export declare const renderWithNDSProvider: (component: any, locale?: string) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
1
+ import { type ReactNode } from "react";
2
+ import { RenderResult } from "@testing-library/react";
3
+ export declare const renderWithNDSProvider: (component: ReactNode, locale?: string) => RenderResult;
@@ -1,4 +1,6 @@
1
1
  import React from "react";
2
2
  import { render } from "@testing-library/react";
3
3
  import NDSProvider from "./NDSProvider";
4
- export const renderWithNDSProvider = (component, locale = "en_US") => render(React.createElement(NDSProvider, { locale: locale }, component));
4
+ export const renderWithNDSProvider = (component, locale = "en_US") => {
5
+ return render(React.createElement(NDSProvider, { locale: locale }, component));
6
+ };
@@ -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 { darken, transparentize } from "polished";
@@ -17,14 +6,13 @@ import { Flex } from "../Flex";
17
6
  import { Input } from "../Input";
18
7
  import { Icon } from "../Icon";
19
8
  import { subPx } from "../utils";
20
- const BaseNavBarSearch = (_a) => {
21
- var { name = "global-search", onSubmit } = _a, props = __rest(_a, ["name", "onSubmit"]);
9
+ const BaseNavBarSearch = ({ name = "global-search", onSubmit, ...props }) => {
22
10
  const handleOnSubmit = (e) => {
23
11
  e.preventDefault();
24
12
  onSubmit(e);
25
13
  };
26
14
  const { t } = useTranslation();
27
- return (React.createElement("form", Object.assign({}, props, { onSubmit: handleOnSubmit }),
15
+ return (React.createElement("form", { ...props, onSubmit: handleOnSubmit },
28
16
  React.createElement(Flex, { role: "search" },
29
17
  React.createElement(Input, { id: "navbar-search", type: "search", "aria-labelledby": name, required: true, placeholder: t("search nulogy") }),
30
18
  React.createElement("button", { id: name, "aria-label": name },
@@ -1,26 +1,13 @@
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 { useTheme } from "styled-components";
14
3
  import useMediaQuery from "../hooks/useMediaQuery";
15
4
  import DesktopNav from "./components/DesktopNav/DesktopNav";
16
5
  import MobileNav from "./components/MobileNav/MobileNav";
17
6
  import { NAVIGATION_DEFAULT_BREAKPOINT_THEME_KEY } from "./components/shared/constants";
18
- const Navigation = (_a) => {
19
- var _b;
20
- var { breakpoint = NAVIGATION_DEFAULT_BREAKPOINT_THEME_KEY } = _a, props = __rest(_a, ["breakpoint"]);
7
+ const Navigation = ({ breakpoint = NAVIGATION_DEFAULT_BREAKPOINT_THEME_KEY, ...props }) => {
21
8
  const theme = useTheme();
22
- const query = ((_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b[breakpoint]) ? breakpoint : `(min-width: ${breakpoint})`;
9
+ const query = theme?.breakpoints?.[breakpoint] ? breakpoint : `(min-width: ${breakpoint})`;
23
10
  const largeScreen = useMediaQuery(query);
24
- return React.createElement(React.Fragment, null, largeScreen ? React.createElement(DesktopNav, Object.assign({}, props)) : React.createElement(MobileNav, Object.assign({}, props)));
11
+ return React.createElement(React.Fragment, null, largeScreen ? React.createElement(DesktopNav, { ...props }) : React.createElement(MobileNav, { ...props }));
25
12
  };
26
13
  export default Navigation;