@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,10 +1,9 @@
1
- /// <reference types="react" />
2
1
  declare const HelpText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<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> & import("react").HTMLAttributes<HTMLParagraphElement> & {
3
2
  variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
4
3
  inline?: boolean;
5
4
  compact?: boolean;
6
5
  disabled?: boolean;
7
- textTransform?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "full-width" | "capitalize" | "full-size-kana" | "lowercase" | "uppercase";
6
+ textTransform?: "none" | "inherit" | "initial" | "-moz-initial" | "revert" | "unset" | "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "uppercase" | undefined;
8
7
  fontSize?: string;
9
8
  } & import("..").StyledProps, "ref"> & {
10
9
  ref?: import("react").Ref<HTMLParagraphElement>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const LabelContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
3
2
  export declare const LabelText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
4
3
  export default LabelText;
@@ -1,18 +1,4 @@
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 FieldLabel from "./FieldLabel";
14
- const MaybeFieldLabel = (_a) => {
15
- var { labelText, children } = _a, props = __rest(_a, ["labelText", "children"]);
16
- return labelText ? (React.createElement(FieldLabel, Object.assign({ labelText: labelText }, props), children)) : (React.createElement(React.Fragment, null, children));
17
- };
3
+ const MaybeFieldLabel = ({ labelText, children, ...props }) => labelText ? (React.createElement(FieldLabel, { labelText: labelText, ...props }, children)) : (React.createElement(React.Fragment, null, children));
18
4
  export default MaybeFieldLabel;
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { Text } from "../Type";
3
- const RequirementText = (props) => React.createElement(Text, Object.assign({ inline: true, ml: "x1", fontSize: "smaller", color: "darkGrey" }, props));
3
+ const RequirementText = (props) => React.createElement(Text, { inline: true, ml: "x1", fontSize: "smaller", color: "darkGrey", ...props });
4
4
  export default RequirementText;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BoxProps } from "../Box/Box";
3
2
  import type { GapProps } from "../StyledProps";
4
3
  export interface FlexProps extends BoxProps, GapProps {
@@ -1,23 +1,9 @@
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 { Box, Flex as NDSFlex } from "../index";
14
3
  import styled from "styled-components";
15
- const Flex = (_a) => {
16
- var { children } = _a, props = __rest(_a, ["children"]);
17
- return (React.createElement(NDSFlex, Object.assign({ padding: "x3", bg: "whiteGrey", minHeight: "400px", style: {
18
- boxSizing: "content-box",
19
- } }, props), children));
20
- };
4
+ const Flex = ({ children, ...props }) => (React.createElement(NDSFlex, { padding: "x3", bg: "whiteGrey", minHeight: "400px", style: {
5
+ boxSizing: "content-box",
6
+ }, ...props }, children));
21
7
  const StyledBox = styled(Box)(({ theme }) => ({
22
8
  padding: theme.space.x6,
23
9
  background: theme.colors.grey,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BoxProps } from "../Box/Box";
3
2
  export type FieldProps = BoxProps;
4
3
  declare const Field: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, never>> & string;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Fieldset: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, never>> & string;
3
2
  export default Fieldset;
@@ -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 * as React from "react";
13
2
  import styled from "styled-components";
14
3
  import { space } from "styled-system";
@@ -38,10 +27,7 @@ const FormStyles = ({ title, theme }) => ({
38
27
  },
39
28
  },
40
29
  });
41
- const Form = styled((_a) => {
42
- var { title, children } = _a, props = __rest(_a, ["title", "children"]);
43
- return (React.createElement("form", Object.assign({}, props),
44
- title && React.createElement(Heading2, null, title),
45
- children));
46
- })(space, FormStyles);
30
+ const Form = styled(({ title, children, ...props }) => (React.createElement("form", { ...props },
31
+ title && React.createElement(Heading2, null, title),
32
+ children)))(space, FormStyles);
47
33
  export default Form;
@@ -1,25 +1,11 @@
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 { Heading3 } from "../Type";
15
4
  import Field from "./Field";
16
5
  import Fieldset from "./Fieldset";
17
- const BaseFormSection = (_a) => {
18
- var { title, children } = _a, props = __rest(_a, ["title", "children"]);
19
- return (React.createElement("fieldset", Object.assign({}, props),
20
- title != null && React.createElement(FormSectionTitle, null, title),
21
- children));
22
- };
6
+ const BaseFormSection = ({ title, children, ...props }) => (React.createElement("fieldset", { ...props },
7
+ title != null && React.createElement(FormSectionTitle, null, title),
8
+ children));
23
9
  const FormSectionTitle = styled(Heading3).attrs({
24
10
  as: "legend",
25
11
  })({});
@@ -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, { useTheme } from "styled-components";
14
3
  import { position, space } from "styled-system";
@@ -16,22 +5,18 @@ import icons from "@nulogy/icons";
16
5
  import LoadingIcon from "./LoadingIcon";
17
6
  const getPathElements = (icon) => (React.createElement(React.Fragment, null, icon.path.map((path, index) => (React.createElement("path", { key: index, d: path })))));
18
7
  const ICON_SIZE_RATIO = 1.25;
19
- const Svg = React.forwardRef((_a, ref) => {
20
- var { color: fillColor = "currentColor", className = undefined, title = undefined, size, focusable = false, icon } = _a, props = __rest(_a, ["color", "className", "title", "size", "focusable", "icon"]);
8
+ const Svg = React.forwardRef(({ color: fillColor = "currentColor", className = undefined, title = undefined, size, focusable = false, icon, ...props }, ref) => {
21
9
  const theme = useTheme();
22
10
  size || (size = theme.sizes.x3);
23
11
  if (icon === "loading") {
24
- return (React.createElement(LoadingIcon, Object.assign({ ref: ref, "aria-hidden": title == null, width: theme.space[size] || size, height: theme.space[size] || size, fill: theme.colors[fillColor] ? theme.colors[fillColor] : fillColor, focusable: focusable, className: `${className} nds-icon--${icon}` }, props)));
12
+ return (React.createElement(LoadingIcon, { ref: ref, "aria-hidden": title == null, width: theme.space[size] || size, height: theme.space[size] || size, fill: theme.colors[fillColor] ? theme.colors[fillColor] : fillColor, focusable: focusable, className: `${className} nds-icon--${icon}`, ...props }));
25
13
  }
26
- return (icons[icon] && (React.createElement("svg", Object.assign({ ref: ref, "aria-hidden": title == null, width: theme.space[size] || size, height: theme.space[size] || size, fill: theme.colors[fillColor] ? theme.colors[fillColor] : fillColor, viewBox: icons[icon].viewBox, focusable: focusable, className: `${className} nds-icon--${icon}` }, props), getPathElements(icons[icon]))));
27
- });
28
- const Icon = styled(Svg)(space, ({ theme, color = "currentColor", size }) => {
29
- var _a, _b;
30
- return ({
31
- minWidth: (_b = (_a = theme.sizes[size]) !== null && _a !== void 0 ? _a : size) !== null && _b !== void 0 ? _b : theme.sizes.x3,
32
- color: color,
33
- });
14
+ return (icons[icon] && (React.createElement("svg", { ref: ref, "aria-hidden": title == null, width: theme.space[size] || size, height: theme.space[size] || size, fill: theme.colors[fillColor] ? theme.colors[fillColor] : fillColor, viewBox: icons[icon].viewBox, focusable: focusable, className: `${className} nds-icon--${icon}`, ...props }, getPathElements(icons[icon]))));
34
15
  });
16
+ const Icon = styled(Svg)(space, ({ theme, color = "currentColor", size }) => ({
17
+ minWidth: theme.sizes[size] ?? size ?? theme.sizes.x3,
18
+ color: color,
19
+ }));
35
20
  const CenteredIcon = styled(Svg)({
36
21
  position: "absolute",
37
22
  inset: 0,
@@ -45,8 +30,8 @@ const IconContainer = styled.span(space, {
45
30
  width: `${ICON_SIZE_RATIO}em`,
46
31
  });
47
32
  export const InlineIcon = React.forwardRef((props, ref) => {
48
- return (React.createElement(IconContainer, Object.assign({ ref: ref }, props),
49
- React.createElement(CenteredIcon, Object.assign({ size: `${ICON_SIZE_RATIO}em` }, props))));
33
+ return (React.createElement(IconContainer, { ref: ref, ...props },
34
+ React.createElement(CenteredIcon, { size: `${ICON_SIZE_RATIO}em`, ...props })));
50
35
  });
51
36
  export const InputIcon = styled(Icon)(({ theme }) => ({
52
37
  position: "absolute",
@@ -1,21 +1,9 @@
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
- const LoadingIcon = React.forwardRef((_a, ref) => {
15
- var { size } = _a, props = __rest(_a, ["size"]);
3
+ const LoadingIcon = React.forwardRef(({ size, ...props }, ref) => {
16
4
  const theme = useTheme();
17
5
  size || (size = theme.sizes.x3);
18
- return (React.createElement("svg", Object.assign({ ref: ref, viewBox: "0 0 24 24", width: size, height: size, fill: "none", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid" }, props),
6
+ return (React.createElement("svg", { ref: ref, viewBox: "0 0 24 24", width: size, height: size, fill: "none", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid", ...props },
19
7
  React.createElement("g", null,
20
8
  React.createElement("circle", { cx: "3.5", cy: "12", fill: "#C0C8D1", "transform-origin": "3.5 3.5" },
21
9
  React.createElement("animate", { attributeName: "r", values: "3;3;3.5;3", keySplines: "\n 0.1 0.8 0.2 1;\n 0.1 0.8 0.2 1;\n 0.1 0.8 0.2 1;", keyTimes: "0; 0.25;0.4; 1", calcMode: "spline", dur: "0.8s", repeatCount: "indefinite" }),
@@ -1,27 +1,15 @@
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, { forwardRef } from "react";
13
2
  import propTypes from "@styled-system/prop-types";
14
3
  import { getSubset, omitSubset } from "../utils/subset";
15
4
  import { Field } from "../Form";
16
5
  import { InlineValidation } from "../Validation";
17
6
  import { InputField } from "./InputField";
18
- const Input = forwardRef((_a, ref) => {
19
- var { errorMessage, errorList, className } = _a, props = __rest(_a, ["errorMessage", "errorList", "className"]);
7
+ const Input = forwardRef(({ errorMessage, errorList, className, ...props }, ref) => {
20
8
  const spaceProps = getSubset(props, propTypes.space);
21
9
  const layoutProps = getSubset(props, propTypes.space);
22
10
  const restProps = omitSubset(props, propTypes.space);
23
- return (React.createElement(Field, Object.assign({ className: className }, spaceProps, layoutProps),
24
- React.createElement(InputField, Object.assign({}, restProps, { error: !!(errorMessage || errorList), ref: ref })),
11
+ return (React.createElement(Field, { className: className, ...spaceProps, ...layoutProps },
12
+ React.createElement(InputField, { ...restProps, error: !!(errorMessage || errorList), ref: ref }),
25
13
  React.createElement(InlineValidation, { mt: "x1", errorMessage: errorMessage, errorList: errorList })));
26
14
  });
27
15
  export default Input;
@@ -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, { forwardRef } from "react";
13
2
  import styled, { useTheme } from "styled-components";
14
3
  import { space, variant } from "styled-system";
@@ -21,8 +10,7 @@ import { Tooltip } from "../Tooltip";
21
10
  import { subPx } from "../utils";
22
11
  import Prefix from "./Prefix";
23
12
  import Suffix from "./Suffix";
24
- export const InputField = forwardRef((_a, ref) => {
25
- var { iconRight, iconLeft, iconRightSize = "x3", iconLeftSize = "x3", iconLeftTooltip, iconRightTooltip, iconLeftTooltipProps, iconRightTooltipProps, error, required, labelText, requirementText, helpText, prefix, prefixWidth, prefixAlignment, suffix, suffixAlignment, suffixWidth, inputWidth, variant, htmlSize } = _a, props = __rest(_a, ["iconRight", "iconLeft", "iconRightSize", "iconLeftSize", "iconLeftTooltip", "iconRightTooltip", "iconLeftTooltipProps", "iconRightTooltipProps", "error", "required", "labelText", "requirementText", "helpText", "prefix", "prefixWidth", "prefixAlignment", "suffix", "suffixAlignment", "suffixWidth", "inputWidth", "variant", "htmlSize"]);
13
+ export const InputField = forwardRef(({ iconRight, iconLeft, iconRightSize = "x3", iconLeftSize = "x3", iconLeftTooltip, iconRightTooltip, iconLeftTooltipProps, iconRightTooltipProps, error, required, labelText, requirementText, helpText, prefix, prefixWidth, prefixAlignment, suffix, suffixAlignment, suffixWidth, inputWidth, variant, htmlSize, ...props }, ref) => {
26
14
  const componentVariant = useComponentVariant(variant);
27
15
  const theme = useTheme();
28
16
  return (React.createElement(MaybeFieldLabel, { labelText: labelText, requirementText: requirementText, helpText: helpText },
@@ -30,11 +18,11 @@ export const InputField = forwardRef((_a, ref) => {
30
18
  React.createElement(Prefix, { prefix: prefix, prefixWidth: prefixWidth, textAlign: prefixAlignment }),
31
19
  React.createElement(InputWrapper, { maxWidth: inputWidth },
32
20
  iconLeft &&
33
- (iconLeftTooltip ? (React.createElement(Tooltip, Object.assign({ tooltip: iconLeftTooltip }, iconLeftTooltipProps),
21
+ (iconLeftTooltip ? (React.createElement(Tooltip, { tooltip: iconLeftTooltip, ...iconLeftTooltipProps },
34
22
  React.createElement(InputIcon, { left: "x1", icon: iconLeft, size: iconLeftSize }))) : (React.createElement(InputIcon, { left: "x1", icon: iconLeft, size: iconLeftSize }))),
35
- React.createElement(StyledInput, Object.assign({ paddingLeft: iconLeft ? `calc(${theme.space[iconLeftSize]} + ${theme.space.x1_5})` : theme.space.x1, paddingRight: iconRight ? `calc(${theme.space[iconRightSize]} + ${theme.space.x1_5})` : theme.space.x1, "aria-invalid": error, "aria-required": required, required: required, error: error, ref: ref, size: htmlSize, variant: componentVariant, inputWidth: inputWidth }, props)),
23
+ React.createElement(StyledInput, { paddingLeft: iconLeft ? `calc(${theme.space[iconLeftSize]} + ${theme.space.x1_5})` : theme.space.x1, paddingRight: iconRight ? `calc(${theme.space[iconRightSize]} + ${theme.space.x1_5})` : theme.space.x1, "aria-invalid": error, "aria-required": required, required: required, error: error, ref: ref, size: htmlSize, variant: componentVariant, inputWidth: inputWidth, ...props }),
36
24
  iconRight &&
37
- (iconRightTooltip ? (React.createElement(Tooltip, Object.assign({ tooltip: iconRightTooltip }, iconRightTooltipProps),
25
+ (iconRightTooltip ? (React.createElement(Tooltip, { tooltip: iconRightTooltip, ...iconRightTooltipProps },
38
26
  React.createElement(InputIcon, { right: "x1", icon: iconRight, size: iconRightSize }))) : (React.createElement(InputIcon, { right: "x1", icon: iconRight, size: iconRightSize })))),
39
27
  React.createElement(Suffix, { suffix: suffix, suffixWidth: suffixWidth, textAlign: suffixAlignment }))));
40
28
  });
@@ -1,20 +1,6 @@
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 { Box } from "../Box";
14
3
  import { Text } from "../Type";
15
- const Prefix = (_a) => {
16
- var { prefix, prefixWidth } = _a, props = __rest(_a, ["prefix", "prefixWidth"]);
17
- return prefix ? (React.createElement(Box, { width: prefixWidth, pt: "x1", pr: "x1", pb: "x1" },
18
- React.createElement(Text, Object.assign({}, props), prefix))) : null;
19
- };
4
+ const Prefix = ({ prefix, prefixWidth, ...props }) => prefix ? (React.createElement(Box, { width: prefixWidth, pt: "x1", pr: "x1", pb: "x1" },
5
+ React.createElement(Text, { ...props }, prefix))) : null;
20
6
  export default Prefix;
@@ -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 from "react";
13
2
  import { Box } from "../Box";
14
3
  import { Text } from "../Type";
15
- export default function Suffix(_a) {
16
- var { suffix, suffixWidth } = _a, props = __rest(_a, ["suffix", "suffixWidth"]);
4
+ export default function Suffix({ suffix, suffixWidth, ...props }) {
17
5
  return suffix ? (React.createElement(Box, { width: suffixWidth, pt: "x1", pb: "x1", pl: "x1" },
18
- React.createElement(Text, Object.assign({}, props), suffix))) : null;
6
+ React.createElement(Text, { ...props }, suffix))) : null;
19
7
  }
@@ -1,21 +1,9 @@
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 Box from "../Box/Box";
14
3
  import Flex from "../Flex/Flex";
15
4
  import EnvironmentBanner from "../Navigation/components/EnvironmentBanner/EnvironmentBanner";
16
- const ApplicationFrame = (_a) => {
17
- var { navBar, children, environment } = _a, props = __rest(_a, ["navBar", "children", "environment"]);
18
- return (React.createElement(Flex, Object.assign({ flexDirection: "column", minHeight: "100vh" }, props),
5
+ const ApplicationFrame = ({ navBar, children, environment, ...props }) => {
6
+ return (React.createElement(Flex, { flexDirection: "column", minHeight: "100vh", ...props },
19
7
  React.createElement(Box, { position: "sticky", top: "0", zIndex: "navBar" },
20
8
  environment && React.createElement(EnvironmentBanner, null, environment),
21
9
  navBar),
@@ -1,7 +1,7 @@
1
1
  import React, { ReactNode } from "react";
2
2
  import { BoxProps } from "../Box";
3
3
  type Breakpoint = string | number;
4
- interface HeaderProps extends Omit<BoxProps, "title"> {
4
+ export interface HeaderProps extends Omit<BoxProps, "title"> {
5
5
  renderBreadcrumbs?: () => ReactNode;
6
6
  title?: ReactNode;
7
7
  subtitle?: string;
@@ -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 { useTheme } from "styled-components";
14
3
  import { Flex } from "../Flex";
@@ -16,16 +5,14 @@ import { Heading1, Text } from "../Type";
16
5
  import useMediaQuery from "../hooks/useMediaQuery";
17
6
  import numberFromDimension from "../utils/numberFromDimension";
18
7
  import BackgroundTriangles from "../Decorations";
19
- const Header = (_a) => {
20
- var _b, _c;
21
- var { background, renderBreadcrumbs, title, undecorated = false, children, subtitle, breakpoints, renderActions, renderSummary } = _a, rest = __rest(_a, ["background", "renderBreadcrumbs", "title", "undecorated", "children", "subtitle", "breakpoints", "renderActions", "renderSummary"]);
8
+ const Header = ({ background, renderBreadcrumbs, title, undecorated = false, children, subtitle, breakpoints, renderActions, renderSummary, ...rest }) => {
22
9
  const theme = useTheme();
23
- const smallBreakpoint = numberFromDimension((_b = breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.small) !== null && _b !== void 0 ? _b : theme.breakpoints.small);
24
- const mediumBreakpoint = numberFromDimension((_c = breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.medium) !== null && _c !== void 0 ? _c : theme.breakpoints.medium);
10
+ const smallBreakpoint = numberFromDimension(breakpoints?.small ?? theme.breakpoints.small);
11
+ const mediumBreakpoint = numberFromDimension(breakpoints?.medium ?? theme.breakpoints.medium);
25
12
  const m = useMediaQuery(`(max-width: ${mediumBreakpoint}px)`);
26
13
  const sm = useMediaQuery(`(max-width: ${smallBreakpoint}px)`);
27
14
  const bg = background ? background : undecorated ? "transparent" : "whiteGrey";
28
- return (React.createElement(Flex, Object.assign({ py: "x1", px: "x3", gap: "x2", position: "relative", bg: bg }, rest),
15
+ return (React.createElement(Flex, { py: "x1", px: "x3", gap: "x2", position: "relative", bg: bg, ...rest },
29
16
  React.createElement(Flex, { flexGrow: 3, justifyContent: "space-between", flexDirection: m || sm ? "column" : "row", zIndex: "content" },
30
17
  React.createElement(Flex, { flexDirection: "column" },
31
18
  renderBreadcrumbs && renderBreadcrumbs(),
@@ -1,15 +1,7 @@
1
1
  import React from "react";
2
- export declare const Default: () => React.JSX.Element;
3
- export declare const TitleAsReactElement: () => React.JSX.Element;
4
- export declare const WithActions: () => React.JSX.Element;
5
- export declare const WithSubTitle: () => React.JSX.Element;
6
- export declare const WithContent: () => React.JSX.Element;
7
- export declare const WithSummary: () => React.JSX.Element;
8
- export declare const WithAnUndecoratedBackground: () => React.JSX.Element;
9
- export declare const WithCustomBackground: () => React.JSX.Element;
10
- export declare const WithEverything: () => React.JSX.Element;
11
2
  declare const _default: {
12
3
  title: string;
4
+ component: ({ background, renderBreadcrumbs, title, undecorated, children, subtitle, breakpoints, renderActions, renderSummary, ...rest }: import("./Header").HeaderProps) => React.JSX.Element;
13
5
  parameters: {
14
6
  layout: string;
15
7
  chromatic: {
@@ -18,3 +10,12 @@ declare const _default: {
18
10
  };
19
11
  };
20
12
  export default _default;
13
+ export declare const Default: () => React.JSX.Element;
14
+ export declare const TitleAsReactElement: () => React.JSX.Element;
15
+ export declare const WithActions: () => React.JSX.Element;
16
+ export declare const WithSubTitle: () => React.JSX.Element;
17
+ export declare const WithContent: () => React.JSX.Element;
18
+ export declare const WithSummary: () => React.JSX.Element;
19
+ export declare const WithAnUndecoratedBackground: () => React.JSX.Element;
20
+ export declare const WithCustomBackground: () => React.JSX.Element;
21
+ export declare const WithEverything: () => React.JSX.Element;
@@ -6,6 +6,15 @@ import SummaryDivider from "../Summary/SummaryDivider";
6
6
  import DropdownMenu from "../DropdownMenu/DropdownMenu";
7
7
  import numberFromDimension from "../utils/numberFromDimension";
8
8
  import { legacy as theme } from "../theme/theme";
9
+ const viewports = [theme.breakpoints.small, theme.breakpoints.medium, theme.breakpoints.large].map(numberFromDimension);
10
+ export default {
11
+ title: "Components/Header",
12
+ component: Header,
13
+ parameters: {
14
+ layout: "fullscreen",
15
+ chromatic: { viewports },
16
+ },
17
+ };
9
18
  export const Default = () => (React.createElement(Header, { renderBreadcrumbs: () => (React.createElement(Breadcrumbs, null,
10
19
  React.createElement(Link, { href: "/" }, "Home"),
11
20
  React.createElement(Link, { href: "/" }, "Materials"))), title: "Materials Overview" }));
@@ -60,11 +69,3 @@ export const WithEverything = () => (React.createElement(Header, { breakpoints:
60
69
  React.createElement(DropdownLink, { href: "/" }, "Dropdown Link"),
61
70
  React.createElement(DropdownButton, null, "Dropdown Button"))) },
62
71
  React.createElement(Box, { border: "1px dashed", borderColor: "grey", py: "half", px: "x1", borderRadius: "small" }, "Extra content")));
63
- const viewports = [theme.breakpoints.small, theme.breakpoints.medium, theme.breakpoints.large].map(numberFromDimension);
64
- export default {
65
- title: "Components/Header",
66
- parameters: {
67
- layout: "fullscreen",
68
- chromatic: { viewports },
69
- },
70
- };
@@ -1,24 +1,10 @@
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 { Box } from "../Box";
14
3
  import { Flex } from "../Flex";
15
4
  import Header from "./Header";
16
- export const Page = (_a) => {
17
- var { breadcrumbs, title, children, headerContent, fullHeight, renderHeader } = _a, rest = __rest(_a, ["breadcrumbs", "title", "children", "headerContent", "fullHeight", "renderHeader"]);
18
- return (React.createElement(Flex, Object.assign({ flexDirection: "column", flexGrow: fullHeight ? 1 : 0 }, rest),
19
- renderHeader
20
- ? renderHeader()
21
- : (breadcrumbs || title || headerContent) && (React.createElement(Header, { renderBreadcrumbs: () => breadcrumbs, title: title }, headerContent)),
22
- React.createElement(Box, { p: "x3" }, children)));
23
- };
5
+ export const Page = ({ breadcrumbs, title, children, headerContent, fullHeight, renderHeader, ...rest }) => (React.createElement(Flex, { flexDirection: "column", flexGrow: fullHeight ? 1 : 0, ...rest },
6
+ renderHeader
7
+ ? renderHeader()
8
+ : (breadcrumbs || title || headerContent) && (React.createElement(Header, { renderBreadcrumbs: () => breadcrumbs, title: title }, headerContent)),
9
+ React.createElement(Box, { p: "x3" }, children)));
24
10
  export default Page;
@@ -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, { useEffect, useState, useRef } from "react";
13
2
  import { AnimatePresence } from "framer-motion";
14
3
  import { useTranslation } from "react-i18next";
@@ -37,15 +26,13 @@ const focusFirstElement = () => {
37
26
  }
38
27
  };
39
28
  const SidebarOverlay = ({ transitionDuration, top, transparent, zIndex = 799, onClick }) => (React.createElement(AnimatedBox, { position: "fixed", top: top, bottom: "0", left: "0", right: "0", zIndex: zIndex, bg: !transparent && "rgba(18, 43, 71, 0.5)", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: transitionDuration }, "data-testid": "sidebar-overlay", onMouseDown: onClick }));
40
- function Sidebar(_a) {
41
- var _b;
42
- var { p = "x2", width = "xs", children, onClose, title, isOpen, footer, closeButtonTestId = "sidebar-close-button", closeButtonAriaLabel, offset = "0px", triggerRef, duration = 0.25, top, closeOnOutsideClick = true, overlay = "show", disableScroll = true, hideCloseButton = false, zIndex = "sidebar", helpText, renderHelpText } = _a, props = __rest(_a, ["p", "width", "children", "onClose", "title", "isOpen", "footer", "closeButtonTestId", "closeButtonAriaLabel", "offset", "triggerRef", "duration", "top", "closeOnOutsideClick", "overlay", "disableScroll", "hideCloseButton", "zIndex", "helpText", "renderHelpText"]);
29
+ function Sidebar({ p = "x2", width = "xs", children, onClose, title, isOpen, footer, closeButtonTestId = "sidebar-close-button", closeButtonAriaLabel, offset = "0px", triggerRef, duration = 0.25, top, closeOnOutsideClick = true, overlay = "show", disableScroll = true, hideCloseButton = false, zIndex = "sidebar", helpText, renderHelpText, ...props }) {
43
30
  const closeButton = useRef(null);
44
31
  const [shouldUpdateFocus, setShouldUpdateFocus] = useState(false);
45
32
  const { t } = useTranslation();
46
33
  const sideBarRef = useRef(null);
47
34
  const contentRef = useRef(null);
48
- const selectedWidth = (_b = sidebarWidths[width]) !== null && _b !== void 0 ? _b : width;
35
+ const selectedWidth = sidebarWidths[width] ?? width;
49
36
  const { navigationV3 } = useFeatureFlags();
50
37
  const theme = useTheme();
51
38
  top || (top = navigationV3 ? theme.space[NAVIGATION_MENU_HEIGHT_STYLED_UNITS] : NAVBAR_HEIGHT);
@@ -53,7 +40,6 @@ function Sidebar(_a) {
53
40
  autoLock: overlay && disableScroll && isOpen,
54
41
  });
55
42
  useEffect(() => {
56
- var _a;
57
43
  if (closeButton.current && isOpen) {
58
44
  if (closeButton && closeButton.current) {
59
45
  closeButton.current.focus();
@@ -63,7 +49,7 @@ function Sidebar(_a) {
63
49
  }
64
50
  else if (shouldUpdateFocus) {
65
51
  if (triggerRef) {
66
- (_a = triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
52
+ triggerRef?.current?.focus();
67
53
  }
68
54
  else {
69
55
  focusFirstElement();
@@ -105,7 +91,7 @@ function Sidebar(_a) {
105
91
  };
106
92
  return (React.createElement(React.Fragment, null,
107
93
  closeOnOutsideClick && (React.createElement(AnimatePresence, null, isOpen && overlay !== "hide" && (React.createElement(SidebarOverlay, { top: top, transparent: overlay === "transparent" || overlay === false, transitionDuration: duration, zIndex: zIndex, onClick: closeOnOutsideClick && isOpen && onClose })))),
108
- React.createElement(AnimatedBox, Object.assign({ role: "dialog", paddingX: "x1", bg: "white", display: "flex", flexDirection: "column", height: `calc(100% - ${navigationV3 ? theme.space[NAVIGATION_MENU_HEIGHT_STYLED_UNITS] : NAVBAR_HEIGHT})`, borderLeftWidth: "1px", borderLeftStyle: "solid", borderLeftColor: "lightGrey", animate: isOpen ? "open" : "closed", variants: variants, initial: isOpen ? "open" : "closed", position: "fixed", top: top, right: offset, width: typeof selectedWidth === "string" ? { default: "100%", small: selectedWidth } : selectedWidth, zIndex: zIndex, ref: sideBarRef }, props),
94
+ React.createElement(AnimatedBox, { role: "dialog", paddingX: "x1", bg: "white", display: "flex", flexDirection: "column", height: `calc(100% - ${navigationV3 ? theme.space[NAVIGATION_MENU_HEIGHT_STYLED_UNITS] : NAVBAR_HEIGHT})`, borderLeftWidth: "1px", borderLeftStyle: "solid", borderLeftColor: "lightGrey", animate: isOpen ? "open" : "closed", variants: variants, initial: isOpen ? "open" : "closed", position: "fixed", top: top, right: offset, width: typeof selectedWidth === "string" ? { default: "100%", small: selectedWidth } : selectedWidth, zIndex: zIndex, ref: sideBarRef, ...props },
109
95
  React.createElement(Flex, { flexDirection: "column", p: "x2", borderBottomWidth: "1px", borderBottomStyle: "solid", borderBottomColor: "lightGrey" },
110
96
  React.createElement(Flex, { flexDirection: "column", gap: "x1" },
111
97
  React.createElement(Flex, { justifyContent: "space-between", alignItems: "flex-start" },
@@ -1,4 +1,6 @@
1
+ import type { StoryObj } from "@storybook/react";
1
2
  import React from "react";
3
+ import { Sidebar } from "..";
2
4
  declare const _default: {
3
5
  title: string;
4
6
  parameters: {
@@ -9,10 +11,11 @@ declare const _default: {
9
11
  };
10
12
  };
11
13
  export default _default;
14
+ type Story = StoryObj<typeof Sidebar>;
12
15
  export declare const _Sidebar: () => React.JSX.Element;
13
16
  export declare const WithoutOverlay: () => React.JSX.Element;
14
17
  export declare const OpenByDefault: () => React.JSX.Element;
15
- export declare const WithCustomOffset: () => React.JSX.Element;
18
+ export declare const WithCustomOffset: Story;
16
19
  export declare const DontCloseOnOutsideClick: () => React.JSX.Element;
17
20
  export declare const WithoutCloseButton: () => React.JSX.Element;
18
21
  export declare const WithALongTitle: () => React.JSX.Element;