@nulogy/components 15.2.2 → 15.3.0

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 (257) hide show
  1. package/dist/main.js +53137 -54186
  2. package/dist/main.module.js +5928 -6978
  3. package/dist/src/Alert/Alert.js +2 -14
  4. package/dist/src/AppTag/components/LogoWrapper.d.ts +0 -1
  5. package/dist/src/AppTag/components/NulogyLogo.js +2 -14
  6. package/dist/src/AsyncSelect/AsyncSelect.graphql.story.js +4 -13
  7. package/dist/src/AsyncSelect/AsyncSelect.js +14 -16
  8. package/dist/src/AsyncSelect/AsyncSelectComponents.js +9 -21
  9. package/dist/src/AsyncSelect/fixtures.js +4 -13
  10. package/dist/src/Banner/Banner.js +1 -15
  11. package/dist/src/BottomSheet/BottomSheet.js +2 -15
  12. package/dist/src/BottomSheet/BottomSheet.parts.d.ts +2 -2
  13. package/dist/src/BottomSheet/BottomSheet.parts.js +8 -22
  14. package/dist/src/BottomSheet/BottomSheet.styled.d.ts +4 -5
  15. package/dist/src/Box/Box.d.ts +12 -4
  16. package/dist/src/BrandedNavBar/DesktopMenu.js +22 -36
  17. package/dist/src/BrandedNavBar/MenuTrigger.js +4 -16
  18. package/dist/src/BrandedNavBar/MenuTriggerButton.js +8 -22
  19. package/dist/src/BrandedNavBar/MobileMenu.js +28 -35
  20. package/dist/src/BrandedNavBar/NavBar.js +7 -21
  21. package/dist/src/BrandedNavBar/NavBar.story.js +1 -1
  22. package/dist/src/BrandedNavBar/NavBarBackground.d.ts +0 -1
  23. package/dist/src/BrandedNavBar/NavBarDropdownMenu.js +14 -8
  24. package/dist/src/BrandedNavBar/SmallNavBar.js +4 -16
  25. package/dist/src/BrandedNavBar/SmallNavBar.story.js +1 -1
  26. package/dist/src/BrandedNavBar/SubMenuTrigger.js +4 -16
  27. package/dist/src/BrandedNavBar/SubMenuTriggerButton.js +2 -14
  28. package/dist/src/BrandedNavBar/renderSubMenuItems.js +7 -17
  29. package/dist/src/Branding/Branding.js +2 -14
  30. package/dist/src/Branding/BrandingText.d.ts +0 -1
  31. package/dist/src/Branding/LettermarkLogo.js +2 -14
  32. package/dist/src/Branding/WordmarkLogo.js +2 -14
  33. package/dist/src/Breadcrumbs/Breadcrumbs.js +2 -14
  34. package/dist/src/Breadcrumbs/BreadcrumbsList.d.ts +0 -1
  35. package/dist/src/Breadcrumbs/BreadcrumbsListItem.d.ts +0 -1
  36. package/dist/src/Button/Button.js +2 -14
  37. package/dist/src/Button/CloseButton.js +1 -1
  38. package/dist/src/Button/ControlIcon.js +2 -16
  39. package/dist/src/Button/DangerButton.d.ts +0 -1
  40. package/dist/src/Button/IconicButton.js +55 -73
  41. package/dist/src/Button/PrimaryButton.d.ts +0 -1
  42. package/dist/src/Button/QuietButton.d.ts +0 -1
  43. package/dist/src/ButtonGroup/ButtonGroup.d.ts +0 -1
  44. package/dist/src/ButtonGroup/ButtonGroup.js +8 -2
  45. package/dist/src/Card/Card.js +2 -14
  46. package/dist/src/Card/Card.story.js +1 -1
  47. package/dist/src/Card/CardSet.d.ts +0 -1
  48. package/dist/src/Checkbox/Checkbox.js +20 -6
  49. package/dist/src/Checkbox/Checkbox.story.js +4 -1
  50. package/dist/src/Checkbox/CheckboxGroup.js +4 -16
  51. package/dist/src/DatePickers/DatePicker.js +2 -14
  52. package/dist/src/DatePickers/MonthPicker.js +2 -14
  53. package/dist/src/DatePickers/WeekPicker.js +10 -17
  54. package/dist/src/DatePickers/custom/weekPickerStyles.d.ts +0 -1
  55. package/dist/src/DatePickers/shared/components/BasePicker.js +9 -15
  56. package/dist/src/DatePickers/shared/components/DatePickerInput.js +2 -13
  57. package/dist/src/DatePickers/shared/styles.d.ts +0 -1
  58. package/dist/src/DatePickers/shared/types.d.ts +0 -1
  59. package/dist/src/DatePickers/stories/WeekPicker.story.js +1 -1
  60. package/dist/src/DateRange/DateRange.js +36 -22
  61. package/dist/src/DateRange/DateRangeStyles.d.ts +0 -1
  62. package/dist/src/DateRange/EndTime.d.ts +3 -4
  63. package/dist/src/DateRange/StartTime.d.ts +3 -4
  64. package/dist/src/Decorations/index.js +1 -1
  65. package/dist/src/DescriptionList/DescriptionList.js +1 -13
  66. package/dist/src/DescriptionList/DescriptionList.parts.d.ts +0 -1
  67. package/dist/src/DescriptionList/DescriptionList.parts.js +156 -77
  68. package/dist/src/DescriptionList/DescriptionListContext.js +1 -15
  69. package/dist/src/DescriptionList/stories/DescriptionList.playground.story.js +8 -5
  70. package/dist/src/DescriptionList/stories/fixtures.d.ts +2 -2
  71. package/dist/src/Divider/Divider.d.ts +0 -1
  72. package/dist/src/DropdownMenu/DropdownItem.d.ts +0 -1
  73. package/dist/src/DropdownMenu/DropdownMenu.js +13 -17
  74. package/dist/src/DropdownMenu/DropdownMenu.story.js +2 -2
  75. package/dist/src/DropdownMenu/DropdownMenuContainer.d.ts +0 -1
  76. package/dist/src/DropdownMenu/DropdownMenuContainer.js +10 -1
  77. package/dist/src/DropdownMenu/DropdownText.d.ts +1 -2
  78. package/dist/src/FieldLabel/FieldLabel.js +2 -14
  79. package/dist/src/FieldLabel/HelpText.d.ts +1 -2
  80. package/dist/src/FieldLabel/LabelText.d.ts +0 -1
  81. package/dist/src/FieldLabel/MaybeFieldLabel.js +1 -15
  82. package/dist/src/FieldLabel/RequirementText.js +1 -1
  83. package/dist/src/Flex/Flex.d.ts +0 -1
  84. package/dist/src/Flex/Flex.story.js +3 -17
  85. package/dist/src/Form/Field.d.ts +0 -1
  86. package/dist/src/Form/Fieldset.d.ts +0 -1
  87. package/dist/src/Form/Form.js +3 -17
  88. package/dist/src/Form/FormSection.js +3 -17
  89. package/dist/src/Icon/Icon.js +9 -24
  90. package/dist/src/Icon/LoadingIcon.js +2 -14
  91. package/dist/src/Input/Input.js +3 -15
  92. package/dist/src/Input/InputField.js +4 -16
  93. package/dist/src/Input/Prefix.js +2 -16
  94. package/dist/src/Input/Suffix.js +2 -14
  95. package/dist/src/Layout/ApplicationFrame.js +2 -14
  96. package/dist/src/Layout/Header.js +4 -17
  97. package/dist/src/Layout/Page.applicationFrame.story.d.ts +8 -3
  98. package/dist/src/Layout/Page.applicationFrame.story.js +26 -12
  99. package/dist/src/Layout/Page.d.ts +2 -2
  100. package/dist/src/Layout/Page.js +5 -19
  101. package/dist/src/Layout/Page.story.d.ts +10 -5
  102. package/dist/src/Layout/Page.story.js +54 -20
  103. package/dist/src/Layout/Sidebar.js +4 -18
  104. package/dist/src/Layout/Sidebar.story.js +16 -30
  105. package/dist/src/Link/Link.js +13 -21
  106. package/dist/src/List/List.d.ts +0 -1
  107. package/dist/src/MaybeTooltip/MaybeTooltip.d.ts +14 -0
  108. package/dist/src/{TruncatedText/components → MaybeTooltip}/MaybeTooltip.js +4 -1
  109. package/dist/src/MaybeTooltip/MaybeTooltip.story.d.ts +12 -0
  110. package/dist/src/MaybeTooltip/MaybeTooltip.story.js +23 -0
  111. package/dist/src/Modal/Modal.story.js +1 -1
  112. package/dist/src/Modal/ModalCloseButton.d.ts +0 -1
  113. package/dist/src/Modal/ModalFooter.d.ts +0 -1
  114. package/dist/src/Modal/ModalHeader.d.ts +0 -1
  115. package/dist/src/NDSProvider/ComponentVariantContext.js +1 -1
  116. package/dist/src/NDSProvider/GlobalStyles.d.ts +0 -1
  117. package/dist/src/NDSProvider/ModalStyleOverride.d.ts +0 -1
  118. package/dist/src/NDSProvider/Reset.d.ts +0 -1
  119. package/dist/src/NDSProvider/renderWithNDSProvider.spec-utils.d.ts +2 -1
  120. package/dist/src/NDSProvider/renderWithNDSProvider.spec-utils.js +3 -1
  121. package/dist/src/NavBarSearch/NavBarSearch.js +2 -14
  122. package/dist/src/Navigation/Navigation.js +3 -16
  123. package/dist/src/Navigation/components/AppSwitcher/NulogyAppSwitcher.js +6 -3
  124. package/dist/src/Navigation/components/AppSwitcher/parts/Item.js +1 -15
  125. package/dist/src/Navigation/components/AppSwitcher/parts/Link.js +2 -16
  126. package/dist/src/Navigation/components/AppSwitcher/parts/index.d.ts +4 -5
  127. package/dist/src/Navigation/components/DesktopNav/DesktopNav.js +2 -2
  128. package/dist/src/Navigation/components/MenuSubItem/MenuSubItem.js +4 -5
  129. package/dist/src/Navigation/components/MenuSubItem/parts/styled.d.ts +0 -1
  130. package/dist/src/Navigation/components/MenuSubItem/parts/styled.js +49 -7
  131. package/dist/src/Navigation/components/MobileNav/MobileNav.js +2 -2
  132. package/dist/src/Navigation/components/MobileNav/parts/MobileMenuItem.js +12 -21
  133. package/dist/src/Navigation/components/MobileNav/parts/styled.d.ts +1 -2
  134. package/dist/src/Navigation/components/MobileNav/parts/styled.js +35 -4
  135. package/dist/src/Navigation/components/NulogyLogo/SvgNulogyLogo.js +1 -1
  136. package/dist/src/Navigation/components/UserMenu/UserMenu.d.ts +0 -1
  137. package/dist/src/Navigation/components/UserMenu/parts/Header.js +1 -1
  138. package/dist/src/Navigation/components/UserMenu/parts/Item.js +7 -16
  139. package/dist/src/Navigation/components/UserMenu/parts/MobileItem.js +7 -16
  140. package/dist/src/Navigation/components/UserMenu/parts/styled.d.ts +0 -1
  141. package/dist/src/Navigation/components/UserMenu/parts/styled.js +43 -18
  142. package/dist/src/Navigation/components/shared/NavigationLogo.js +4 -16
  143. package/dist/src/Navigation/components/shared/NavigationLogoLink.js +2 -14
  144. package/dist/src/Navigation/components/shared/NavigationMenuContent.d.ts +0 -1
  145. package/dist/src/Navigation/components/shared/NavigationMenuItem.js +10 -24
  146. package/dist/src/Navigation/components/shared/components.d.ts +0 -1
  147. package/dist/src/Navigation/components/shared/components.js +29 -5
  148. package/dist/src/Navigation/hooks/useResponsiveMenu.d.ts +0 -1
  149. package/dist/src/Navigation/stories/Navigation.mobileVisibility.story.js +21 -9
  150. package/dist/src/Navigation/stories/fixtures/logos/CustomLogo2.js +1 -1
  151. package/dist/src/Navigation/stories/fixtures/logos/CustomLogo3.js +1 -1
  152. package/dist/src/Navigation/stories/fixtures/logos/Customlogo1.js +1 -1
  153. package/dist/src/Overlay/Overlay.d.ts +0 -1
  154. package/dist/src/Pagination/PageNumber.d.ts +0 -1
  155. package/dist/src/Pagination/Pagination.js +3 -16
  156. package/dist/src/Pagination/PaginationButton.d.ts +0 -1
  157. package/dist/src/Popper/Popper.js +29 -6
  158. package/dist/src/Primitives/index.d.ts +0 -1
  159. package/dist/src/Radio/Radio.js +11 -18
  160. package/dist/src/Radio/Radio.story.d.ts +135 -129
  161. package/dist/src/Radio/Radio.story.js +8 -8
  162. package/dist/src/Radio/RadioGroup.js +4 -16
  163. package/dist/src/RangeContainer/RangeContainer.js +6 -15
  164. package/dist/src/Select/MenuList.js +13 -18
  165. package/dist/src/Select/Select.d.ts +1 -1
  166. package/dist/src/Select/Select.js +16 -17
  167. package/dist/src/Select/Select.story.d.ts +2 -2
  168. package/dist/src/Select/Select.story.fixture.js +8 -30
  169. package/dist/src/Select/Select.story.js +14 -29
  170. package/dist/src/Select/SelectComponents.js +7 -7
  171. package/dist/src/Select/SelectOption.js +1 -1
  172. package/dist/src/Select/customReactSelectStyles.js +152 -44
  173. package/dist/src/Select/lib.js +1 -2
  174. package/dist/src/SortingTable/SortingTable.js +6 -15
  175. package/dist/src/StatusIndicator/StatusIndicator.d.ts +0 -1
  176. package/dist/src/StatusIndicator/StatusIndicator.js +16 -1
  177. package/dist/src/Summary/Summary.js +2 -14
  178. package/dist/src/Summary/SummaryDivider.js +1 -1
  179. package/dist/src/Summary/SummaryItem.js +2 -14
  180. package/dist/src/Switcher/Switch.js +23 -19
  181. package/dist/src/Switcher/Switcher.js +4 -16
  182. package/dist/src/Table/BaseTable.js +2 -14
  183. package/dist/src/Table/StatefulTable.d.ts +1 -1
  184. package/dist/src/Table/StatefulTable.js +17 -9
  185. package/dist/src/Table/StyledTh.d.ts +0 -1
  186. package/dist/src/Table/StyledTh.js +11 -2
  187. package/dist/src/Table/Table.js +2 -14
  188. package/dist/src/Table/Table.types.d.ts +0 -1
  189. package/dist/src/Table/TableBody.js +11 -11
  190. package/dist/src/Table/TableFoot.js +5 -8
  191. package/dist/src/Table/TableHead.js +1 -4
  192. package/dist/src/Table/addExpandableControl.js +5 -2
  193. package/dist/src/Table/addSelectableControl.js +5 -2
  194. package/dist/src/Table/stories/TableWithCustomSorting.story.js +4 -1
  195. package/dist/src/Table/stories/TableWithFiltering.story.js +8 -2
  196. package/dist/src/Table/stories/TableWithServerSidePagination.story.js +4 -15
  197. package/dist/src/Tabs/Tab.js +11 -18
  198. package/dist/src/Tabs/TabContainer.d.ts +0 -1
  199. package/dist/src/Tabs/TabScrollIndicator.js +2 -14
  200. package/dist/src/Tabs/Tabs.js +5 -7
  201. package/dist/src/Textarea/Textarea.js +3 -15
  202. package/dist/src/TimePicker/TimePicker.js +2 -14
  203. package/dist/src/TimePicker/TimePickerDropdown.d.ts +0 -1
  204. package/dist/src/TimePicker/TimePickerInput.d.ts +0 -1
  205. package/dist/src/TimePicker/TimePickerInput.js +6 -4
  206. package/dist/src/TimeRange/TimeRange.js +20 -20
  207. package/dist/src/Toast/Toast.js +4 -16
  208. package/dist/src/ToastContainer/ToastContainer.js +4 -16
  209. package/dist/src/ToastContainer/ToastContainer.story.js +1 -1
  210. package/dist/src/ToastContainer/ToastFunction.js +7 -19
  211. package/dist/src/Toggle/Toggle.js +4 -17
  212. package/dist/src/Toggle/ToggleButton.js +2 -14
  213. package/dist/src/Tooltip/Tooltip.d.ts +2 -2
  214. package/dist/src/Tooltip/Tooltip.story.js +7 -7
  215. package/dist/src/Tooltip/TooltipContainer.d.ts +0 -1
  216. package/dist/src/Tooltip/TooltipContainer.js +16 -1
  217. package/dist/src/Tooltip/components/TooltipComponents.js +9 -24
  218. package/dist/src/TopBar/TopBar.styled.d.ts +14 -7
  219. package/dist/src/TopBar/components/BackLink.js +2 -14
  220. package/dist/src/TopBar/components/Menu.js +2 -15
  221. package/dist/src/TopBar/components/MenuItemLink.js +2 -14
  222. package/dist/src/TopBar/components/PageTitle.js +2 -14
  223. package/dist/src/TopBar/stories/TopBar.backButton.story.js +3 -3
  224. package/dist/src/TopBar/stories/TopBar.menu.story.js +9 -20
  225. package/dist/src/TopBar/stories/TopBar.story.js +3 -3
  226. package/dist/src/TruncatedText/TruncatedText.js +8 -16
  227. package/dist/src/TruncatedText/components/TruncatedTextFillWidth.js +4 -16
  228. package/dist/src/TruncatedText/components/TruncatedTextMaxCharacters.js +5 -17
  229. package/dist/src/TruncatedText/types.d.ts +1 -1
  230. package/dist/src/Type/Headings.d.ts +4 -5
  231. package/dist/src/Type/Text.d.ts +0 -1
  232. package/dist/src/Validation/InlineValidation.js +2 -14
  233. package/dist/src/VerticalDivider/VerticalDivider.d.ts +0 -1
  234. package/dist/src/VisualTests/WithSpace.story.js +18 -18
  235. package/dist/src/hooks/useMediaQuery/useMediaQuery.js +1 -2
  236. package/dist/src/i18n.js +1 -1
  237. package/dist/src/index.d.ts +1 -0
  238. package/dist/src/index.js +1 -0
  239. package/dist/src/locale.story.js +1 -1
  240. package/dist/src/theme/mergeThemes.util.js +7 -1
  241. package/dist/src/theme/useNDSTheme.js +9 -3
  242. package/dist/src/utils/ClickInputLabel.d.ts +0 -1
  243. package/dist/src/utils/PopperArrow.js +5 -1
  244. package/dist/src/utils/story/code.d.ts +0 -1
  245. package/dist/src/utils/story/dashed.d.ts +2 -2
  246. package/dist/src/utils/story/placeholder.js +1 -1
  247. package/dist/src/utils/story/resizable.d.ts +2 -2
  248. package/dist/src/utils/story/resizable.js +1 -1
  249. package/dist/src/utils/story/simulatedAPIRequests.js +8 -19
  250. package/dist/src/utils/subPx.js +1 -1
  251. package/dist/src/utils/testing/useConditionalAutoClick.js +3 -3
  252. package/dist/src/utils/testing/useUrlProps.js +1 -1
  253. package/dist/src/utils/ts/FocusManager.js +1 -1
  254. package/dist/src/utils/useWindowDimension.story.d.ts +1 -1
  255. package/dist/src/utils/withMenuState.js +1 -1
  256. package/package.json +43 -43
  257. package/dist/src/TruncatedText/components/MaybeTooltip.d.ts +0 -24
@@ -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, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from "react";
13
2
  import { isBefore, isSameDay } from "date-fns";
14
3
  import { useTranslation } from "react-i18next";
@@ -21,8 +10,10 @@ import EndTime from "./EndTime";
21
10
  import StartTime from "./StartTime";
22
11
  import { useComponentVariant } from "../NDSProvider/ComponentVariantContext";
23
12
  const DEFAULT_LABEL = "Date Range";
24
- const DateRange = forwardRef((_a, ref) => {
25
- var { dateFormat, onRangeChange, onStartDateChange, onEndDateChange, errorMessage, startDateErrorMessage, endDateErrorMessage, defaultStartDate = null, defaultEndDate = null, endDateInputProps, startDateInputProps, disableRangeValidation, labelProps = Object.assign(Object.assign({}, FieldLabelDefaultProps), { labelText: DEFAULT_LABEL }), minDate, maxDate, showTimes, minTime, maxTime, defaultStartTime, defaultEndTime, onStartTimeChange, onEndTimeChange, timeFormat, interval, disableFlipping = false, locale, endTimeProps, startTimeProps, variant } = _a, props = __rest(_a, ["dateFormat", "onRangeChange", "onStartDateChange", "onEndDateChange", "errorMessage", "startDateErrorMessage", "endDateErrorMessage", "defaultStartDate", "defaultEndDate", "endDateInputProps", "startDateInputProps", "disableRangeValidation", "labelProps", "minDate", "maxDate", "showTimes", "minTime", "maxTime", "defaultStartTime", "defaultEndTime", "onStartTimeChange", "onEndTimeChange", "timeFormat", "interval", "disableFlipping", "locale", "endTimeProps", "startTimeProps", "variant"]);
13
+ const DateRange = forwardRef(({ dateFormat, onRangeChange, onStartDateChange, onEndDateChange, errorMessage, startDateErrorMessage, endDateErrorMessage, defaultStartDate = null, defaultEndDate = null, endDateInputProps, startDateInputProps, disableRangeValidation, labelProps = {
14
+ ...FieldLabelDefaultProps,
15
+ labelText: DEFAULT_LABEL,
16
+ }, minDate, maxDate, showTimes, minTime, maxTime, defaultStartTime, defaultEndTime, onStartTimeChange, onEndTimeChange, timeFormat, interval, disableFlipping = false, locale, endTimeProps, startTimeProps, variant, ...props }, ref) => {
26
17
  const dateRef1 = useRef(null);
27
18
  const dateRef2 = useRef(null);
28
19
  const timeRef1 = useRef(null);
@@ -35,10 +26,22 @@ const DateRange = forwardRef((_a, ref) => {
35
26
  const { t } = useTranslation();
36
27
  const componentVariant = useComponentVariant(variant);
37
28
  useImperativeHandle(ref, () => ({
38
- dateRef1: Object.assign(Object.assign({}, dateRef1), { focus: () => { var _a; return (_a = dateRef1.current) === null || _a === void 0 ? void 0 : _a.setFocus(); } }),
39
- dateRef2: Object.assign(Object.assign({}, dateRef2), { focus: () => { var _a; return (_a = dateRef2.current) === null || _a === void 0 ? void 0 : _a.setFocus(); } }),
40
- timeRef1: Object.assign(Object.assign({}, timeRef1), { focus: () => { var _a; return (_a = timeRef1.current) === null || _a === void 0 ? void 0 : _a.focus(); } }),
41
- timeRef2: Object.assign(Object.assign({}, timeRef2), { focus: () => { var _a; return (_a = timeRef2.current) === null || _a === void 0 ? void 0 : _a.focus(); } }),
29
+ dateRef1: {
30
+ ...dateRef1,
31
+ focus: () => dateRef1.current?.setFocus(),
32
+ },
33
+ dateRef2: {
34
+ ...dateRef2,
35
+ focus: () => dateRef2.current?.setFocus(),
36
+ },
37
+ timeRef1: {
38
+ ...timeRef1,
39
+ focus: () => timeRef1.current?.focus(),
40
+ },
41
+ timeRef2: {
42
+ ...timeRef2,
43
+ focus: () => timeRef2.current?.focus(),
44
+ },
42
45
  }));
43
46
  useEffect(() => {
44
47
  validateDateRange();
@@ -91,15 +94,26 @@ const DateRange = forwardRef((_a, ref) => {
91
94
  });
92
95
  }
93
96
  };
94
- const startInputProps = Object.assign({ "aria-label": t("select a start date"), error: rangeError }, startDateInputProps);
97
+ const startInputProps = {
98
+ "aria-label": t("select a start date"),
99
+ error: rangeError,
100
+ ...startDateInputProps,
101
+ };
95
102
  const startDateInput = (React.createElement(React.Fragment, null,
96
103
  React.createElement(DatePicker, { dateFormat: dateFormat, selected: startDate, onChange: changeStartDateHandler, inputProps: startInputProps, errorMessage: startDateErrorMessage, minDate: minDate, maxDate: maxDate, highlightDates: highlightDates(startDate, endDate), locale: locale, disableFlipping: disableFlipping, ref: dateRef1 }),
97
- showTimes && (React.createElement(StartTime, Object.assign({ variant: componentVariant, selected: startTime, defaultValue: defaultStartTime, "aria-label": t("select a start time"), minTime: minTime, maxTime: maxTime, timeFormat: timeFormat, interval: interval, onChange: changeStartTimeHandler, locale: locale, "data-testid": "daterange-start-time", ref: timeRef1, error: !!rangeError }, startTimeProps)))));
104
+ showTimes && (React.createElement(StartTime, { variant: componentVariant, selected: startTime, defaultValue: defaultStartTime, "aria-label": t("select a start time"), minTime: minTime, maxTime: maxTime, timeFormat: timeFormat, interval: interval, onChange: changeStartTimeHandler, locale: locale, "data-testid": "daterange-start-time", ref: timeRef1, error: !!rangeError, ...startTimeProps }))));
98
105
  const endDateInput = (React.createElement(React.Fragment, null,
99
- showTimes && (React.createElement(EndTime, Object.assign({ variant: componentVariant, selected: endTime, defaultValue: defaultEndTime, minTime: minTime, maxTime: maxTime, timeFormat: timeFormat, interval: interval, onChange: changeEndTimeHandler, locale: locale, "aria-label": t("select an end time"), "data-testid": "daterange-end-time", ref: timeRef2, error: !!rangeError }, endTimeProps))),
100
- React.createElement(DatePicker, { dateFormat: dateFormat, selected: endDate, onChange: changeEndDateHandler, inputProps: Object.assign({ "aria-label": t("select an end date"), error: rangeError }, endDateInputProps), errorMessage: endDateErrorMessage, minDate: minDate, maxDate: maxDate, highlightDates: highlightDates(startDate, endDate), locale: locale, disableFlipping: disableFlipping, ref: dateRef2 })));
106
+ showTimes && (React.createElement(EndTime, { variant: componentVariant, selected: endTime, defaultValue: defaultEndTime, minTime: minTime, maxTime: maxTime, timeFormat: timeFormat, interval: interval, onChange: changeEndTimeHandler, locale: locale, "aria-label": t("select an end time"), "data-testid": "daterange-end-time", ref: timeRef2, error: !!rangeError, ...endTimeProps })),
107
+ React.createElement(DatePicker, { dateFormat: dateFormat, selected: endDate, onChange: changeEndDateHandler, inputProps: {
108
+ "aria-label": t("select an end date"),
109
+ error: rangeError,
110
+ ...endDateInputProps,
111
+ }, errorMessage: endDateErrorMessage, minDate: minDate, maxDate: maxDate, highlightDates: highlightDates(startDate, endDate), locale: locale, disableFlipping: disableFlipping, ref: dateRef2 })));
101
112
  return (React.createElement(React.Fragment, null,
102
113
  React.createElement(DateRangeStyles, null),
103
- React.createElement(RangeContainer, Object.assign({ variant: componentVariant, labelProps: Object.assign(Object.assign({}, labelProps), { labelText: labelProps.labelText === DEFAULT_LABEL ? t("date range") : labelProps.labelText }), startComponent: startDateInput, endComponent: endDateInput, errorMessages: !disableRangeValidation ? [t(rangeError), errorMessage] : [errorMessage] }, props))));
114
+ React.createElement(RangeContainer, { variant: componentVariant, labelProps: {
115
+ ...labelProps,
116
+ labelText: labelProps.labelText === DEFAULT_LABEL ? t("date range") : labelProps.labelText,
117
+ }, startComponent: startDateInput, endComponent: endDateInput, errorMessages: !disableRangeValidation ? [t(rangeError), errorMessage] : [errorMessage], ...props })));
104
118
  });
105
119
  export default DateRange;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const highlightDates: (startDate: Date, endDate: Date) => ({
3
2
  "nds-datepicker-day--start-date": Date[];
4
3
  "nds-datepicker-day--end-date"?: undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const EndTime: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
3
2
  variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
4
3
  disabled?: boolean;
@@ -14,14 +13,14 @@ declare const EndTime: import("styled-components/dist/types").IStyledComponentBa
14
13
  defaultValue?: string;
15
14
  "aria-label"?: string;
16
15
  errorMessage?: string;
17
- errorList?: import("react").ReactNode;
16
+ errorList?: React.ReactNode;
18
17
  labelText?: string;
19
18
  ref?: any;
20
19
  onBlur?: (...args: any[]) => any;
21
20
  onFocus?: (...args: any[]) => any;
22
21
  onClick?: (...args: any[]) => any;
23
22
  } & {
24
- children?: import("react").ReactNode;
23
+ children?: import("react").ReactNode | undefined;
25
24
  }, "ref"> & {
26
25
  ref?: any;
27
26
  }, never>> & string & Omit<import("react").FC<import("react").PropsWithChildren<import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
@@ -39,7 +38,7 @@ declare const EndTime: import("styled-components/dist/types").IStyledComponentBa
39
38
  defaultValue?: string;
40
39
  "aria-label"?: string;
41
40
  errorMessage?: string;
42
- errorList?: import("react").ReactNode;
41
+ errorList?: React.ReactNode;
43
42
  labelText?: string;
44
43
  ref?: any;
45
44
  onBlur?: (...args: any[]) => any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const StartTime: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
3
2
  variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
4
3
  disabled?: boolean;
@@ -14,14 +13,14 @@ declare const StartTime: import("styled-components/dist/types").IStyledComponent
14
13
  defaultValue?: string;
15
14
  "aria-label"?: string;
16
15
  errorMessage?: string;
17
- errorList?: import("react").ReactNode;
16
+ errorList?: React.ReactNode;
18
17
  labelText?: string;
19
18
  ref?: any;
20
19
  onBlur?: (...args: any[]) => any;
21
20
  onFocus?: (...args: any[]) => any;
22
21
  onClick?: (...args: any[]) => any;
23
22
  } & {
24
- children?: import("react").ReactNode;
23
+ children?: import("react").ReactNode | undefined;
25
24
  }, "ref"> & {
26
25
  ref?: any;
27
26
  }, never>> & string & Omit<import("react").FC<import("react").PropsWithChildren<import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
@@ -39,7 +38,7 @@ declare const StartTime: import("styled-components/dist/types").IStyledComponent
39
38
  defaultValue?: string;
40
39
  "aria-label"?: string;
41
40
  errorMessage?: string;
42
- errorList?: import("react").ReactNode;
41
+ errorList?: React.ReactNode;
43
42
  labelText?: string;
44
43
  ref?: any;
45
44
  onBlur?: (...args: any[]) => any;
@@ -11,7 +11,7 @@ const RightAngleTriangle = styled(Box) `
11
11
  `;
12
12
  export default function BackgroundTriangles(props) {
13
13
  const theme = useTheme();
14
- return (React.createElement(Box, Object.assign({ "aria-hidden": "true", transition: "max-width 0.3s cubic-bezier(0.455, 0.03, 0.515, 0.955)", position: "absolute", bottom: 0, right: 0, height: "100%", maxWidth: { extraSmall: "320px", small: "768px", medium: "1024px", large: "1280px" }, width: "90%" }, props),
14
+ return (React.createElement(Box, { "aria-hidden": "true", transition: "max-width 0.3s cubic-bezier(0.455, 0.03, 0.515, 0.955)", position: "absolute", bottom: 0, right: 0, height: "100%", maxWidth: { extraSmall: "320px", small: "768px", medium: "1024px", large: "1280px" }, width: "90%", ...props },
15
15
  React.createElement(RightAngleTriangle, { "aria-hidden": "true", height: "44.85%", opacity: "0.5", background: "linear-gradient(178.25deg, rgba(192, 200, 209, 0.5) 62.98%, rgba(225, 235, 250, 0.25) 98.52%)" }),
16
16
  React.createElement(RightAngleTriangle, { "aria-hidden": "true", height: "19.85%", opacity: "0.25", background: `linear-gradient(196.88deg, ${theme.colors.grey} 11.92%, rgba(0, 67, 143, 0) 88.36%)` })));
17
17
  }
@@ -1,20 +1,8 @@
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 { DescriptionListProvider } from "./DescriptionListContext";
14
3
  import { validateAndExtractGridProps } from "./lib/utils";
15
4
  import { DescriptionList as Dl, DescriptionListContainer } from "./DescriptionList.parts";
16
- export default function DescriptionList(_a) {
17
- var { descriptionTermMaxWidth = "320px", layout = "stacked", autoLayoutBreakpoint = "640px", showDivider = false, density = "medium", fontSize = "medium", lineHeight = "base", children } = _a, props = __rest(_a, ["descriptionTermMaxWidth", "layout", "autoLayoutBreakpoint", "showDivider", "density", "fontSize", "lineHeight", "children"]);
5
+ export default function DescriptionList({ descriptionTermMaxWidth = "320px", layout = "stacked", autoLayoutBreakpoint = "640px", showDivider = false, density = "medium", fontSize = "medium", lineHeight = "base", children, ...props }) {
18
6
  const { columns, groupMinWidth } = validateAndExtractGridProps(props);
19
7
  return (React.createElement(DescriptionListProvider, { descriptionTermMaxWidth: descriptionTermMaxWidth, layout: layout, autoLayoutBreakpoint: autoLayoutBreakpoint, showDivider: showDivider, density: density, fontSize: fontSize, lineHeight: lineHeight, columns: columns, groupMinWidth: groupMinWidth },
20
8
  React.createElement(DescriptionListContainer, null,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BaseDescriptionListProps, Columns, GroupMinWidth } from "./lib/types";
3
2
  export type DescriptionListPartsProps = BaseDescriptionListProps & {
4
3
  columns?: Columns;
@@ -10,100 +10,179 @@ export const DescriptionListContainer = styled.div({
10
10
  width: "100%",
11
11
  });
12
12
  export const DescriptionList = styled.dl(({ theme }) => {
13
- var _a, _b;
14
13
  const { fontSize, lineHeight, density, columns, groupMinWidth } = useDescriptionListContext();
15
- return Object.assign(Object.assign(Object.assign(Object.assign({ containerType: "inline-size", width: "100%", margin: 0, display: "grid", columnGap: theme.space[gapConfig[density]], fontSize: (_a = theme.fontSizes[fontSize]) !== null && _a !== void 0 ? _a : theme.fontSizes.medium, lineHeight: (_b = theme.lineHeights[lineHeight]) !== null && _b !== void 0 ? _b : theme.lineHeights.base }, (typeof columns === "number" && {
16
- gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
17
- })), { "a, p": {
14
+ return {
15
+ containerType: "inline-size",
16
+ width: "100%",
17
+ margin: 0,
18
+ display: "grid",
19
+ columnGap: theme.space[gapConfig[density]],
20
+ fontSize: theme.fontSizes[fontSize] ?? theme.fontSizes.medium,
21
+ lineHeight: theme.lineHeights[lineHeight] ?? theme.lineHeights.base,
22
+ ...(typeof columns === "number" && {
23
+ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
24
+ }),
25
+ "a, p": {
18
26
  fontSize: "inherit",
19
27
  lineHeight: "inherit",
20
- } }), (groupMinWidth && {
21
- gridTemplateColumns: `repeat(auto-fit, minmax(${groupMinWidth}, 1fr))`,
22
- })), (typeof columns === "object" && Object.assign({}, Object.fromEntries(Object.entries(columns).map(([key, value]) => [
23
- `@container (min-width: ${theme.breakpoints[key]})`,
24
- { gridTemplateColumns: `repeat(${value}, minmax(0, 1fr))` },
25
- ])))));
28
+ },
29
+ ...(groupMinWidth && {
30
+ gridTemplateColumns: `repeat(auto-fit, minmax(${groupMinWidth}, 1fr))`,
31
+ }),
32
+ ...(typeof columns === "object" && {
33
+ ...Object.fromEntries(Object.entries(columns).map(([key, value]) => [
34
+ `@container (min-width: ${theme.breakpoints[key]})`,
35
+ { gridTemplateColumns: `repeat(${value}, minmax(0, 1fr))` },
36
+ ])),
37
+ }),
38
+ };
26
39
  });
27
40
  export const DescriptionGroup = styled.div(({ theme, rowSpan, columnSpan }) => {
28
41
  const { descriptionTermMaxWidth, layout, showDivider, autoLayoutBreakpoint } = useDescriptionListContext();
29
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ display: "grid", gridTemplateRows: "auto 1fr" }, (showDivider && {
30
- borderBottom: `1px solid ${theme.colors.lightGrey}`,
31
- })), (layout === "inline" && {
32
- gridTemplateColumns: `minmax(0, ${descriptionTermMaxWidth}) 1fr`,
33
- })), ((layout === "stacked" || layout === "auto") && {
34
- gridTemplateColumns: "1fr",
35
- })), (columnSpan && {
36
- gridColumn: `span ${columnSpan} / span ${columnSpan}`,
37
- })), (rowSpan && {
38
- gridRow: `span ${rowSpan} / span ${rowSpan}`,
39
- })), { [`@container (min-width: ${autoLayoutBreakpoint})`]: Object.assign({}, (layout === "auto" && {
40
- gridTemplateColumns: `minmax(0, min(50%, ${descriptionTermMaxWidth})) 1fr`,
41
- })) });
42
+ return {
43
+ display: "grid",
44
+ gridTemplateRows: "auto 1fr",
45
+ ...(showDivider && {
46
+ borderBottom: `1px solid ${theme.colors.lightGrey}`,
47
+ }),
48
+ ...(layout === "inline" && {
49
+ gridTemplateColumns: `minmax(0, ${descriptionTermMaxWidth}) 1fr`,
50
+ }),
51
+ ...((layout === "stacked" || layout === "auto") && {
52
+ gridTemplateColumns: "1fr",
53
+ }),
54
+ ...(columnSpan && {
55
+ gridColumn: `span ${columnSpan} / span ${columnSpan}`,
56
+ }),
57
+ ...(rowSpan && {
58
+ gridRow: `span ${rowSpan} / span ${rowSpan}`,
59
+ }),
60
+ [`@container (min-width: ${autoLayoutBreakpoint})`]: {
61
+ ...(layout === "auto" && {
62
+ gridTemplateColumns: `minmax(0, min(50%, ${descriptionTermMaxWidth})) 1fr`,
63
+ }),
64
+ },
65
+ };
42
66
  });
43
67
  export const DescriptionTerm = styled.dt(({ theme }) => {
44
68
  const { showDivider, layout, density, autoLayoutBreakpoint } = useDescriptionListContext();
45
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ gridColumnStart: 1, color: theme.colors.midGrey, paddingLeft: theme.space.none, paddingRight: theme.space.none }, (layout !== "inline" && {
46
- paddingBottom: theme.space.none,
47
- })), (density === "compact" && Object.assign({ paddingTop: theme.space.x0_25 }, (layout === "inline" && {
48
- paddingBottom: theme.space.x0_25,
49
- })))), (density === "medium" && Object.assign({ paddingTop: theme.space.x0_75 }, (layout === "inline" && {
50
- paddingBottom: theme.space.x0_75,
51
- })))), (density === "relaxed" && Object.assign({ paddingTop: theme.space.x1_5, paddingBottom: theme.space.x0_25 }, (layout === "inline" && {
52
- paddingBottom: theme.space.x1_5,
53
- })))), (showDivider && {
54
- borderTopWidth: "1px",
55
- borderTopStyle: "solid",
56
- borderTopColor: theme.colors.lightGrey,
57
- })), { "&:first-child": {
58
- border: "none",
59
- }, [`@container (min-width: ${autoLayoutBreakpoint})`]: Object.assign(Object.assign(Object.assign(Object.assign({}, (showDivider &&
60
- layout !== "stacked" && {
69
+ return {
70
+ gridColumnStart: 1,
71
+ color: theme.colors.midGrey,
72
+ paddingLeft: theme.space.none,
73
+ paddingRight: theme.space.none,
74
+ ...(layout !== "inline" && {
75
+ paddingBottom: theme.space.none,
76
+ }),
77
+ ...(density === "compact" && {
78
+ paddingTop: theme.space.x0_25,
79
+ ...(layout === "inline" && {
80
+ paddingBottom: theme.space.x0_25,
81
+ }),
82
+ }),
83
+ ...(density === "medium" && {
84
+ paddingTop: theme.space.x0_75,
85
+ ...(layout === "inline" && {
86
+ paddingBottom: theme.space.x0_75,
87
+ }),
88
+ }),
89
+ ...(density === "relaxed" && {
90
+ paddingTop: theme.space.x1_5,
91
+ paddingBottom: theme.space.x0_25,
92
+ ...(layout === "inline" && {
93
+ paddingBottom: theme.space.x1_5,
94
+ }),
95
+ }),
96
+ ...(showDivider && {
61
97
  borderTopWidth: "1px",
62
98
  borderTopStyle: "solid",
63
99
  borderTopColor: theme.colors.lightGrey,
64
- })), (density === "compact" &&
65
- layout !== "stacked" && {
66
- paddingBottom: theme.space.x0_25,
67
- })), (density === "medium" &&
68
- layout !== "stacked" && {
69
- paddingBottom: theme.space.x0_75,
70
- })), (density === "relaxed" &&
71
- layout !== "stacked" && {
72
- paddingBottom: theme.space.x1_5,
73
- })) });
100
+ }),
101
+ "&:first-child": {
102
+ border: "none",
103
+ },
104
+ [`@container (min-width: ${autoLayoutBreakpoint})`]: {
105
+ // wide auto layout
106
+ ...(showDivider &&
107
+ layout !== "stacked" && {
108
+ borderTopWidth: "1px",
109
+ borderTopStyle: "solid",
110
+ borderTopColor: theme.colors.lightGrey,
111
+ }),
112
+ ...(density === "compact" &&
113
+ layout !== "stacked" && {
114
+ paddingBottom: theme.space.x0_25,
115
+ }),
116
+ ...(density === "medium" &&
117
+ layout !== "stacked" && {
118
+ paddingBottom: theme.space.x0_75,
119
+ }),
120
+ ...(density === "relaxed" &&
121
+ layout !== "stacked" && {
122
+ paddingBottom: theme.space.x1_5,
123
+ }),
124
+ },
125
+ };
74
126
  });
75
127
  export const DescriptionDetails = styled.dd(({ theme }) => {
76
128
  const { autoLayoutBreakpoint, showDivider, density, layout } = useDescriptionListContext();
77
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
129
+ return {
78
130
  // narrow stuff + non-auto layout
79
- margin: 0, color: theme.colors.black, paddingLeft: theme.space.none, paddingRight: theme.space.none }, (layout !== "inline" && {
80
- paddingTop: theme.space.none,
81
- })), (density === "compact" && Object.assign({ paddingBottom: theme.space.x0_25 }, (layout === "inline" && {
82
- paddingTop: theme.space.x0_25,
83
- })))), (density === "medium" && Object.assign({ paddingBottom: theme.space.x0_75 }, (layout === "inline" && {
84
- paddingTop: theme.space.x0_75,
85
- })))), (density === "relaxed" && Object.assign({ paddingBottom: theme.space.x1_5, paddingTop: theme.space.x0_25 }, (layout === "inline" && {
86
- paddingTop: theme.space.x1_5,
87
- })))), (showDivider &&
88
- layout === "inline" && {
89
- borderTopWidth: "1px",
90
- borderTopStyle: "solid",
91
- borderTopColor: theme.colors.lightGrey,
92
- })), { "&:nth-child(2)": {
93
- border: "none",
94
- }, [`@container (min-width: ${autoLayoutBreakpoint})`]: Object.assign(Object.assign(Object.assign(Object.assign({}, (showDivider &&
95
- layout !== "stacked" && {
131
+ margin: 0,
132
+ color: theme.colors.black,
133
+ paddingLeft: theme.space.none,
134
+ paddingRight: theme.space.none,
135
+ ...(layout !== "inline" && {
136
+ paddingTop: theme.space.none,
137
+ }),
138
+ ...(density === "compact" && {
139
+ paddingBottom: theme.space.x0_25,
140
+ ...(layout === "inline" && {
141
+ paddingTop: theme.space.x0_25,
142
+ }),
143
+ }),
144
+ ...(density === "medium" && {
145
+ paddingBottom: theme.space.x0_75,
146
+ ...(layout === "inline" && {
147
+ paddingTop: theme.space.x0_75,
148
+ }),
149
+ }),
150
+ ...(density === "relaxed" && {
151
+ paddingBottom: theme.space.x1_5,
152
+ paddingTop: theme.space.x0_25,
153
+ ...(layout === "inline" && {
154
+ paddingTop: theme.space.x1_5,
155
+ }),
156
+ }),
157
+ ...(showDivider &&
158
+ layout === "inline" && {
96
159
  borderTopWidth: "1px",
97
160
  borderTopStyle: "solid",
98
161
  borderTopColor: theme.colors.lightGrey,
99
- })), (density === "compact" &&
100
- layout !== "stacked" && {
101
- paddingTop: theme.space.x0_25,
102
- })), (density === "medium" &&
103
- layout !== "stacked" && {
104
- paddingTop: theme.space.x0_75,
105
- })), (density === "relaxed" &&
106
- layout !== "stacked" && {
107
- paddingTop: theme.space.x1_5,
108
- })) });
162
+ }),
163
+ "&:nth-child(2)": {
164
+ border: "none",
165
+ },
166
+ [`@container (min-width: ${autoLayoutBreakpoint})`]: {
167
+ // wide auto layout
168
+ ...(showDivider &&
169
+ layout !== "stacked" && {
170
+ borderTopWidth: "1px",
171
+ borderTopStyle: "solid",
172
+ borderTopColor: theme.colors.lightGrey,
173
+ }),
174
+ ...(density === "compact" &&
175
+ layout !== "stacked" && {
176
+ paddingTop: theme.space.x0_25,
177
+ }),
178
+ ...(density === "medium" &&
179
+ layout !== "stacked" && {
180
+ paddingTop: theme.space.x0_75,
181
+ }),
182
+ ...(density === "relaxed" &&
183
+ layout !== "stacked" && {
184
+ paddingTop: theme.space.x1_5,
185
+ }),
186
+ },
187
+ };
109
188
  });
@@ -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, { createContext, useContext } from "react";
13
2
  const DescriptionListContext = createContext(undefined);
14
- export const DescriptionListProvider = (_a) => {
15
- var { children } = _a, contextProps = __rest(_a, ["children"]);
16
- return (React.createElement(DescriptionListContext.Provider, { value: contextProps }, children));
17
- };
3
+ export const DescriptionListProvider = ({ children, ...contextProps }) => (React.createElement(DescriptionListContext.Provider, { value: contextProps }, children));
18
4
  export const useDescriptionListContext = () => {
19
5
  const context = useContext(DescriptionListContext);
20
6
  if (!context) {
@@ -45,7 +45,7 @@ export const Playground = {
45
45
  const updateGroup = (index, updates) => {
46
46
  setAdditionalGroups((groups) => groups.map((group, i) => {
47
47
  if (i === index) {
48
- return Object.assign(Object.assign({}, group), updates);
48
+ return { ...group, ...updates };
49
49
  }
50
50
  return group;
51
51
  }));
@@ -66,7 +66,7 @@ export const Playground = {
66
66
  ]);
67
67
  };
68
68
  const toggleGroupExpansion = (index) => {
69
- setAdditionalGroups((groups) => groups.map((group, i) => (i === index ? Object.assign(Object.assign({}, group), { isExpanded: !group.isExpanded }) : group)));
69
+ setAdditionalGroups((groups) => groups.map((group, i) => (i === index ? { ...group, isExpanded: !group.isExpanded } : group)));
70
70
  };
71
71
  const DescriptionListElement = (
72
72
  // @ts-expect-error - This is not a valid use of the component, since we're passing both columns and groupMinWidth,
@@ -144,7 +144,7 @@ export const Playground = {
144
144
  React.createElement(Flex, { flexDirection: "column", gap: "x2" }, breakpointColumns.map((breakpointColumn, index) => (React.createElement(Flex, { key: index, gap: "x2", alignItems: "flex-end" },
145
145
  breakpointColumns.length > 1 && (React.createElement(Select, { minWidth: "240px", value: breakpointColumn.breakpoint, onChange: (value) => {
146
146
  const newBreakpointColumns = [...breakpointColumns];
147
- newBreakpointColumns[index] = Object.assign(Object.assign({}, breakpointColumn), { breakpoint: value });
147
+ newBreakpointColumns[index] = { ...breakpointColumn, breakpoint: value };
148
148
  setBreakpointColumns(newBreakpointColumns);
149
149
  setColumns(Object.fromEntries(newBreakpointColumns.map(({ breakpoint, columns }) => [breakpoint, columns])));
150
150
  }, options: Object.keys(theme.breakpoints)
@@ -157,7 +157,10 @@ export const Playground = {
157
157
  React.createElement(Input, { inputWidth: breakpointColumns.length === 1 ? undefined : "95px", type: "number", value: breakpointColumn.columns, onChange: (e) => {
158
158
  const newValue = Math.max(1, Number(e.target.value));
159
159
  const newBreakpointColumns = [...breakpointColumns];
160
- newBreakpointColumns[index] = Object.assign(Object.assign({}, breakpointColumn), { columns: newValue });
160
+ newBreakpointColumns[index] = {
161
+ ...breakpointColumn,
162
+ columns: newValue,
163
+ };
161
164
  setBreakpointColumns(newBreakpointColumns);
162
165
  if (breakpointColumns.length === 1) {
163
166
  setColumns(newValue);
@@ -178,7 +181,7 @@ export const Playground = {
178
181
  setColumns(Object.fromEntries(newBreakpointColumns.map(({ breakpoint, columns }) => [breakpoint, columns])));
179
182
  }
180
183
  } }))))))),
181
- React.createElement(Input, { value: groupMinWidth !== null && groupMinWidth !== void 0 ? groupMinWidth : "", onChange: (e) => {
184
+ React.createElement(Input, { value: groupMinWidth ?? "", onChange: (e) => {
182
185
  const value = e.target.value || undefined;
183
186
  setGroupMinWidth(value);
184
187
  if (value)
@@ -12,6 +12,6 @@ export declare const OutlinedDd: import("styled-components/dist/types").IStyledC
12
12
  $highlighted?: boolean;
13
13
  }>> & string;
14
14
  export declare const DashedBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(Record<string, unknown> & {
15
- children?: React.ReactNode;
16
- }) | (Omit<Record<string, unknown>, "ref"> & React.RefAttributes<React.Component<Record<string, unknown>, any, any>>), import("styled-components/dist/types").BaseObject>> & string & (Omit<React.ComponentClass<Record<string, unknown>, any>, keyof React.Component<any, {}, any>> | Omit<React.FunctionComponent<Record<string, unknown>>, keyof React.Component<any, {}, any>>);
15
+ children?: React.ReactNode | undefined;
16
+ }) | (Omit<Record<string, unknown>, "ref"> & React.RefAttributes<React.Component<Record<string, unknown>, any, any>>), import("styled-components/dist/types").BaseObject>> & (string & (Omit<React.ComponentClass<Record<string, unknown>, any>, keyof React.Component<any, {}, any>> | Omit<React.FunctionComponent<Record<string, unknown>>, keyof React.Component<any, {}, any>>));
17
17
  export declare const SampleContent: () => React.JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { StyledProps } from "../StyledProps";
3
2
  export interface DividerProps extends StyledProps, React.HTMLAttributes<HTMLHRElement> {
4
3
  secondary?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  color?: string;
4
3
  hoverColor?: 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, { useMemo } from "react";
13
2
  import propTypes from "@styled-system/prop-types";
14
3
  import { IconicButton } from "../Button";
@@ -19,21 +8,28 @@ import DropdownMenuContainer from "./DropdownMenuContainer";
19
8
  const DEFAULT_POPPER_MODIFIERS = {
20
9
  preventOverflow: { enabled: true, padding: 8, boundariesElement: "viewport" },
21
10
  };
22
- const transformPropsToModifiers = ({ boundariesElement }) => (Object.assign(Object.assign({}, DEFAULT_POPPER_MODIFIERS), { boundariesElement }));
23
- const DropdownMenu = React.forwardRef((_a, ref) => {
24
- var { trigger = () => React.createElement(IconicButton, { icon: "more" }), children, showArrow = true, variant, disabled, defaultOpen, backgroundColor = "white", placement = "bottom-start", className, id, boundariesElement = "viewport", showDelay = "100", hideDelay = "200", openAriaLabel, closeAriaLabel, openOnHover = false } = _a, props = __rest(_a, ["trigger", "children", "showArrow", "variant", "disabled", "defaultOpen", "backgroundColor", "placement", "className", "id", "boundariesElement", "showDelay", "hideDelay", "openAriaLabel", "closeAriaLabel", "openOnHover"]);
11
+ const transformPropsToModifiers = ({ boundariesElement }) => ({
12
+ ...DEFAULT_POPPER_MODIFIERS,
13
+ boundariesElement,
14
+ });
15
+ const DropdownMenu = React.forwardRef(({ trigger = () => React.createElement(IconicButton, { icon: "more" }), children, showArrow = true, variant, disabled, defaultOpen, backgroundColor = "white", placement = "bottom-start", className, id, boundariesElement = "viewport", showDelay = "100", hideDelay = "200", openAriaLabel, closeAriaLabel, openOnHover = false, ...props }, ref) => {
25
16
  const spaceProps = getSubset(props, propTypes.space);
26
17
  const restProps = omitSubset(props, propTypes.space);
27
18
  const modifiers = useMemo(() => {
28
19
  return transformPropsToModifiers({ boundariesElement });
29
20
  }, [boundariesElement]);
30
21
  const componentVariant = useComponentVariant(variant);
31
- return (React.createElement(Popper, { trigger: React.cloneElement(trigger(), Object.assign({ type: "button", disabled: disabled ? true : null, "aria-haspopup": true }, spaceProps)), showDelay: showDelay, hideDelay: hideDelay, popperPlacement: placement, defaultOpen: defaultOpen, showArrow: showArrow, openOnClick: !openOnHover, ref: ref, openOnHover: openOnHover, modifiers: modifiers, backgroundColor: backgroundColor, borderColor: backgroundColor, openAriaLabel: openAriaLabel, closeAriaLabel: closeAriaLabel },
32
- React.createElement(DropdownMenuContainer, Object.assign({ className: className, id: id, backgroundColor: backgroundColor, showArrow: showArrow }, restProps), typeof children === "function"
22
+ return (React.createElement(Popper, { trigger: React.cloneElement(trigger(), {
23
+ type: "button",
24
+ disabled: disabled ? true : null,
25
+ "aria-haspopup": true,
26
+ ...spaceProps,
27
+ }), showDelay: showDelay, hideDelay: hideDelay, popperPlacement: placement, defaultOpen: defaultOpen, showArrow: showArrow, openOnClick: !openOnHover, ref: ref, openOnHover: openOnHover, modifiers: modifiers, backgroundColor: backgroundColor, borderColor: backgroundColor, openAriaLabel: openAriaLabel, closeAriaLabel: closeAriaLabel },
28
+ React.createElement(DropdownMenuContainer, { className: className, id: id, backgroundColor: backgroundColor, showArrow: showArrow, ...restProps }, typeof children === "function"
33
29
  ? children
34
30
  : React.Children.map(children, (child) => {
35
31
  if (React.isValidElement(child)) {
36
- return React.cloneElement(child, Object.assign({ size: componentVariant }, child.props), child.props.children);
32
+ return React.cloneElement(child, { size: componentVariant, ...child.props }, child.props.children);
37
33
  }
38
34
  }))));
39
35
  });
@@ -24,8 +24,8 @@ WithCustomTrigger.story = {
24
24
  name: "with custom trigger",
25
25
  };
26
26
  export const WithCustomColors = () => (React.createElement(DropdownMenu, { defaultOpen: true, backgroundColor: "blackBlue", openAriaLabel: "open dropdown", closeAriaLabel: "close dropdown" },
27
- React.createElement(DropdownLink, Object.assign({ href: "/never_been" }, customColors), "Dropdown Link"),
28
- React.createElement(DropdownButton, Object.assign({ onClick: () => { } }, customColors), "Dropdown Button")));
27
+ React.createElement(DropdownLink, { href: "/never_been", ...customColors }, "Dropdown Link"),
28
+ React.createElement(DropdownButton, { onClick: () => { }, ...customColors }, "Dropdown Button")));
29
29
  WithCustomColors.story = {
30
30
  name: "with custom colors",
31
31
  };