@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
@@ -5,113 +5,121 @@ declare const _default: {
5
5
  title: string;
6
6
  component: React.ForwardRefExoticComponent<Omit<{
7
7
  children?: React.ReactNode | Record<string, unknown>;
8
- value?: string | number | readonly string[];
8
+ value?: string | readonly string[] | number | undefined;
9
9
  ref?: React.Ref<HTMLInputElement>;
10
- form?: string;
11
- slot?: string;
12
- style?: React.CSSProperties;
13
- title?: string;
14
- pattern?: string;
15
- property?: string;
16
- color?: string;
17
- content?: string;
18
- height?: string | number;
19
- translate?: "yes" | "no";
20
- width?: string | number;
21
- hidden?: boolean;
22
- key?: React.Key;
23
- defaultChecked?: boolean;
24
- defaultValue?: string | number | readonly string[];
25
- suppressContentEditableWarning?: boolean;
26
- suppressHydrationWarning?: boolean;
27
- accessKey?: string;
28
- autoFocus?: boolean;
29
- className?: string;
30
- contentEditable?: "inherit" | (boolean | "true" | "false");
31
- contextMenu?: string;
32
- dir?: string;
33
- draggable?: boolean | "true" | "false";
34
- id?: string;
35
- lang?: string;
36
- nonce?: string;
37
- placeholder?: string;
38
- spellCheck?: boolean | "true" | "false";
39
- tabIndex?: number;
40
- radioGroup?: string;
41
- role?: React.AriaRole;
42
- about?: string;
43
- datatype?: string;
10
+ form?: string | undefined;
11
+ slot?: string | undefined;
12
+ style?: React.CSSProperties | undefined;
13
+ title?: string | undefined;
14
+ pattern?: string | undefined;
15
+ property?: string | undefined;
16
+ color?: string | undefined;
17
+ content?: string | undefined;
18
+ height?: number | string | undefined;
19
+ translate?: "yes" | "no" | undefined;
20
+ width?: number | string | undefined;
21
+ hidden?: boolean | undefined;
22
+ key?: React.Key | null | undefined;
23
+ defaultChecked?: boolean | undefined;
24
+ defaultValue?: string | number | readonly string[] | undefined;
25
+ suppressContentEditableWarning?: boolean | undefined;
26
+ suppressHydrationWarning?: boolean | undefined;
27
+ accessKey?: string | undefined;
28
+ autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
29
+ autoFocus?: boolean | undefined;
30
+ className?: string | undefined;
31
+ contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
32
+ contextMenu?: string | undefined;
33
+ dir?: string | undefined;
34
+ draggable?: (boolean | "true" | "false") | undefined;
35
+ enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
36
+ id?: string | undefined;
37
+ lang?: string | undefined;
38
+ nonce?: string | undefined;
39
+ placeholder?: string | undefined;
40
+ spellCheck?: (boolean | "true" | "false") | undefined;
41
+ tabIndex?: number | undefined;
42
+ radioGroup?: string | undefined;
43
+ role?: React.AriaRole | undefined;
44
+ about?: string | undefined;
45
+ datatype?: string | undefined;
44
46
  inlist?: any;
45
- prefix?: string;
46
- rel?: string;
47
- resource?: string;
48
- rev?: string;
49
- typeof?: string;
50
- vocab?: string;
51
- autoCapitalize?: string;
52
- autoCorrect?: string;
53
- autoSave?: string;
54
- itemProp?: string;
55
- itemScope?: boolean;
56
- itemType?: string;
57
- itemID?: string;
58
- itemRef?: string;
59
- results?: number;
60
- security?: string;
61
- unselectable?: "on" | "off";
62
- inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal";
63
- is?: string;
64
- 'aria-activedescendant'?: string;
65
- 'aria-atomic'?: boolean | "true" | "false";
66
- 'aria-autocomplete'?: "none" | "list" | "inline" | "both";
67
- 'aria-busy'?: boolean | "true" | "false";
68
- 'aria-checked'?: boolean | "true" | "false" | "mixed";
69
- 'aria-colcount'?: number;
70
- 'aria-colindex'?: number;
71
- 'aria-colspan'?: number;
72
- 'aria-controls'?: string;
73
- 'aria-current'?: boolean | "time" | "true" | "false" | "step" | "page" | "location" | "date";
74
- 'aria-describedby'?: string;
75
- 'aria-details'?: string;
76
- 'aria-disabled'?: boolean | "true" | "false";
77
- 'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup";
78
- 'aria-errormessage'?: string;
79
- 'aria-expanded'?: boolean | "true" | "false";
80
- 'aria-flowto'?: string;
81
- 'aria-grabbed'?: boolean | "true" | "false";
82
- 'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "true" | "false" | "listbox" | "tree";
83
- 'aria-hidden'?: boolean | "true" | "false";
84
- 'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling";
85
- 'aria-keyshortcuts'?: string;
86
- 'aria-label'?: string;
87
- 'aria-labelledby'?: string;
88
- 'aria-level'?: number;
89
- 'aria-live'?: "off" | "assertive" | "polite";
90
- 'aria-modal'?: boolean | "true" | "false";
91
- 'aria-multiline'?: boolean | "true" | "false";
92
- 'aria-multiselectable'?: boolean | "true" | "false";
93
- 'aria-orientation'?: "horizontal" | "vertical";
94
- 'aria-owns'?: string;
95
- 'aria-placeholder'?: string;
96
- 'aria-posinset'?: number;
97
- 'aria-pressed'?: boolean | "true" | "false" | "mixed";
98
- 'aria-readonly'?: boolean | "true" | "false";
99
- 'aria-relevant'?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals";
100
- 'aria-required'?: boolean | "true" | "false";
101
- 'aria-roledescription'?: string;
102
- 'aria-rowcount'?: number;
103
- 'aria-rowindex'?: number;
104
- 'aria-rowspan'?: number;
105
- 'aria-selected'?: boolean | "true" | "false";
106
- 'aria-setsize'?: number;
107
- 'aria-sort'?: "none" | "ascending" | "descending" | "other";
108
- 'aria-valuemax'?: number;
109
- 'aria-valuemin'?: number;
110
- 'aria-valuenow'?: number;
111
- 'aria-valuetext'?: string;
47
+ prefix?: string | undefined;
48
+ rel?: string | undefined;
49
+ resource?: string | undefined;
50
+ rev?: string | undefined;
51
+ typeof?: string | undefined;
52
+ vocab?: string | undefined;
53
+ autoCorrect?: string | undefined;
54
+ autoSave?: string | undefined;
55
+ itemProp?: string | undefined;
56
+ itemScope?: boolean | undefined;
57
+ itemType?: string | undefined;
58
+ itemID?: string | undefined;
59
+ itemRef?: string | undefined;
60
+ results?: number | undefined;
61
+ security?: string | undefined;
62
+ unselectable?: "on" | "off" | undefined;
63
+ inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
64
+ is?: string | undefined;
65
+ exportparts?: string | undefined;
66
+ part?: string | undefined;
67
+ "aria-activedescendant"?: string | undefined;
68
+ "aria-atomic"?: (boolean | "true" | "false") | undefined;
69
+ "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
70
+ "aria-braillelabel"?: string | undefined;
71
+ "aria-brailleroledescription"?: string | undefined;
72
+ "aria-busy"?: (boolean | "true" | "false") | undefined;
73
+ "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
74
+ "aria-colcount"?: number | undefined;
75
+ "aria-colindex"?: number | undefined;
76
+ "aria-colindextext"?: string | undefined;
77
+ "aria-colspan"?: number | undefined;
78
+ "aria-controls"?: string | undefined;
79
+ "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
80
+ "aria-describedby"?: string | undefined;
81
+ "aria-description"?: string | undefined;
82
+ "aria-details"?: string | undefined;
83
+ "aria-disabled"?: (boolean | "true" | "false") | undefined;
84
+ "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
85
+ "aria-errormessage"?: string | undefined;
86
+ "aria-expanded"?: (boolean | "true" | "false") | undefined;
87
+ "aria-flowto"?: string | undefined;
88
+ "aria-grabbed"?: (boolean | "true" | "false") | undefined;
89
+ "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
90
+ "aria-hidden"?: (boolean | "true" | "false") | undefined;
91
+ "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
92
+ "aria-keyshortcuts"?: string | undefined;
93
+ "aria-label"?: string | undefined;
94
+ "aria-labelledby"?: string | undefined;
95
+ "aria-level"?: number | undefined;
96
+ "aria-live"?: "off" | "assertive" | "polite" | undefined;
97
+ "aria-modal"?: (boolean | "true" | "false") | undefined;
98
+ "aria-multiline"?: (boolean | "true" | "false") | undefined;
99
+ "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
100
+ "aria-orientation"?: "horizontal" | "vertical" | undefined;
101
+ "aria-owns"?: string | undefined;
102
+ "aria-placeholder"?: string | undefined;
103
+ "aria-posinset"?: number | undefined;
104
+ "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
105
+ "aria-readonly"?: (boolean | "true" | "false") | undefined;
106
+ "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
107
+ "aria-required"?: (boolean | "true" | "false") | undefined;
108
+ "aria-roledescription"?: string | undefined;
109
+ "aria-rowcount"?: number | undefined;
110
+ "aria-rowindex"?: number | undefined;
111
+ "aria-rowindextext"?: string | undefined;
112
+ "aria-rowspan"?: number | undefined;
113
+ "aria-selected"?: (boolean | "true" | "false") | undefined;
114
+ "aria-setsize"?: number | undefined;
115
+ "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
116
+ "aria-valuemax"?: number | undefined;
117
+ "aria-valuemin"?: number | undefined;
118
+ "aria-valuenow"?: number | undefined;
119
+ "aria-valuetext"?: string | undefined;
112
120
  dangerouslySetInnerHTML?: {
113
121
  __html: string | TrustedHTML;
114
- };
122
+ } | undefined;
115
123
  onCopy?: React.ClipboardEventHandler<HTMLInputElement>;
116
124
  onCopyCapture?: React.ClipboardEventHandler<HTMLInputElement>;
117
125
  onCut?: React.ClipboardEventHandler<HTMLInputElement>;
@@ -130,7 +138,7 @@ declare const _default: {
130
138
  onBlurCapture?: React.FocusEventHandler<HTMLInputElement>;
131
139
  onChange?: React.ChangeEventHandler<HTMLInputElement>;
132
140
  onChangeCapture?: React.FormEventHandler<HTMLInputElement>;
133
- onBeforeInput?: React.FormEventHandler<HTMLInputElement>;
141
+ onBeforeInput?: React.InputEventHandler<HTMLInputElement>;
134
142
  onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement>;
135
143
  onInput?: React.FormEventHandler<HTMLInputElement>;
136
144
  onInputCapture?: React.FormEventHandler<HTMLInputElement>;
@@ -272,31 +280,29 @@ declare const _default: {
272
280
  onAnimationIterationCapture?: React.AnimationEventHandler<HTMLInputElement>;
273
281
  onTransitionEnd?: React.TransitionEventHandler<HTMLInputElement>;
274
282
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLInputElement>;
275
- list?: string;
276
- name?: string;
277
- type?: React.HTMLInputTypeAttribute;
278
- crossOrigin?: "" | "anonymous" | "use-credentials";
279
- alt?: string;
280
- src?: string;
281
- disabled?: boolean;
282
- formAction?: string;
283
- formEncType?: string;
284
- formMethod?: string;
285
- formNoValidate?: boolean;
286
- formTarget?: string;
287
- autoComplete?: string;
288
- accept?: string;
289
- capture?: boolean | "user" | "environment";
290
- checked?: boolean;
291
- enterKeyHint?: "search" | "next" | "enter" | "done" | "go" | "previous" | "send";
292
- max?: string | number;
293
- maxLength?: number;
294
- min?: string | number;
295
- minLength?: number;
296
- multiple?: boolean;
297
- readOnly?: boolean;
298
- required?: boolean;
299
- step?: string | number;
283
+ list?: string | undefined;
284
+ name?: string | undefined;
285
+ type?: React.HTMLInputTypeAttribute | undefined;
286
+ alt?: string | undefined;
287
+ src?: string | undefined;
288
+ disabled?: boolean | undefined;
289
+ formAction?: string | undefined;
290
+ formEncType?: string | undefined;
291
+ formMethod?: string | undefined;
292
+ formNoValidate?: boolean | undefined;
293
+ formTarget?: string | undefined;
294
+ autoComplete?: string | undefined;
295
+ accept?: string | undefined;
296
+ capture?: boolean | "user" | "environment" | undefined;
297
+ checked?: boolean | undefined;
298
+ max?: number | string | undefined;
299
+ maxLength?: number | undefined;
300
+ min?: number | string | undefined;
301
+ minLength?: number | undefined;
302
+ multiple?: boolean | undefined;
303
+ readOnly?: boolean | undefined;
304
+ required?: boolean | undefined;
305
+ step?: number | string | undefined;
300
306
  } & import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
301
307
  htmlSize?: number;
302
308
  variant?: import("../NDSProvider/ComponentVariantContext").ComponentVariant;
@@ -23,25 +23,25 @@ export const SetToDefaultChecked = {
23
23
  };
24
24
  export const SetToDisabled = {
25
25
  render: (args) => (React.createElement(React.Fragment, null,
26
- React.createElement(Radio, Object.assign({}, args, { id: "radio-1", disabled: true, labelText: "I am disabled" })),
27
- React.createElement(Radio, Object.assign({}, args, { id: "radio-2", checked: true, disabled: true, labelText: "I am disabled" })))),
26
+ React.createElement(Radio, { ...args, id: "radio-1", disabled: true, labelText: "I am disabled" }),
27
+ React.createElement(Radio, { ...args, id: "radio-2", checked: true, disabled: true, labelText: "I am disabled" }))),
28
28
  name: "Set to disabled",
29
29
  };
30
30
  export const SetToError = {
31
31
  render: (args) => (React.createElement(React.Fragment, null,
32
- React.createElement(Radio, Object.assign({}, args, { id: "radio", error: true, labelText: "I am error" })),
33
- React.createElement(Radio, Object.assign({}, args, { id: "radio", defaultChecked: true, error: true, labelText: "I am error" })))),
32
+ React.createElement(Radio, { ...args, id: "radio", error: true, labelText: "I am error" }),
33
+ React.createElement(Radio, { ...args, id: "radio", defaultChecked: true, error: true, labelText: "I am error" }))),
34
34
  name: "Set to error",
35
35
  };
36
36
  export const SetToRequired = {
37
37
  render: (args) => (React.createElement(React.Fragment, null,
38
- React.createElement(Radio, Object.assign({}, args, { id: "radio", labelText: "I am a radio button", required: true })))),
38
+ React.createElement(Radio, { ...args, id: "radio", labelText: "I am a radio button", required: true }))),
39
39
  name: "Set to required",
40
40
  };
41
41
  export const Controlled = {
42
42
  render: (args) => (React.createElement(React.Fragment, null,
43
- React.createElement(Radio, Object.assign({}, args, { id: "radio-1", checked: true, onChange: action("onChange"), labelText: "I am controlled and checked" })),
44
- React.createElement(Radio, Object.assign({}, args, { id: "radio-2", checked: false, onChange: action("onChange"), labelText: "I am controlled and unchecked" })))),
43
+ React.createElement(Radio, { ...args, id: "radio-1", checked: true, onChange: action("onChange"), labelText: "I am controlled and checked" }),
44
+ React.createElement(Radio, { ...args, id: "radio-2", checked: false, onChange: action("onChange"), labelText: "I am controlled and unchecked" }))),
45
45
  };
46
46
  const UsingRefToControlFocusComponent = () => {
47
47
  const ref = useRef(null);
@@ -53,6 +53,6 @@ const UsingRefToControlFocusComponent = () => {
53
53
  React.createElement(Button, { onClick: handleClick, "data-testid": "the-button" }, "Focus the Input")));
54
54
  };
55
55
  export const UsingRefToControlFocus = {
56
- render: (args) => React.createElement(UsingRefToControlFocusComponent, Object.assign({}, args)),
56
+ render: (args) => React.createElement(UsingRefToControlFocusComponent, { ...args }),
57
57
  name: "using ref to control focus",
58
58
  };
@@ -1,23 +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 { useTheme } from "styled-components";
14
3
  import { HelpText, RequirementText } from "../FieldLabel";
15
4
  import { InlineValidation } from "../Validation";
16
5
  import { Fieldset } from "../Form";
17
6
  import Radio from "./Radio";
18
- export default function RadioGroup(_a) {
19
- var { className, id, errorMessage, errorList, labelText, helpText, requirementText } = _a, props = __rest(_a, ["className", "id", "errorMessage", "errorList", "labelText", "helpText", "requirementText"]);
20
- const otherProps = Object.assign(Object.assign({}, props), { errorMessage, errorList });
7
+ export default function RadioGroup({ className, id, errorMessage, errorList, labelText, helpText, requirementText, ...props }) {
8
+ const otherProps = { ...props, errorMessage, errorList };
21
9
  const theme = useTheme();
22
10
  return (React.createElement(Fieldset, { className: className, id: id },
23
11
  React.createElement("legend", { style: { marginBottom: theme.space.x1 } },
@@ -34,8 +22,8 @@ const labelTextStyles = (theme) => ({
34
22
  });
35
23
  const getRadioButtons = (props) => {
36
24
  const radioButtons = React.Children.map(props.children, (radio) => {
37
- const _a = radio.props, { value, disabled, required, onChange } = _a, radioProps = __rest(_a, ["value", "disabled", "required", "onChange"]);
38
- return (React.createElement(Radio, Object.assign({}, radioProps, { value: value, disabled: props.disabled || disabled, error: !!(props.errorMessage || props.errorList), required: props.required || required, name: props.name, defaultChecked: value === props.defaultValue ? true : undefined, checked: props.checkedValue && value === props.checkedValue, onChange: props.onChange || onChange })));
25
+ const { value, disabled, required, onChange, ...radioProps } = radio.props;
26
+ return (React.createElement(Radio, { ...radioProps, value: value, disabled: props.disabled || disabled, error: !!(props.errorMessage || props.errorList), required: props.required || required, name: props.name, defaultChecked: value === props.defaultValue ? true : undefined, checked: props.checkedValue && value === props.checkedValue, onChange: props.onChange || onChange }));
39
27
  });
40
28
  return radioButtons;
41
29
  };
@@ -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 propTypes from "@styled-system/prop-types";
14
3
  import { Text } from "../Type";
@@ -17,12 +6,14 @@ import { FieldLabel } from "../FieldLabel";
17
6
  import { FieldLabelDefaultProps } from "../FieldLabel/FieldLabel.type";
18
7
  import { InlineValidation } from "../Validation";
19
8
  import { getSubset, omitSubset } from "../utils/subset";
20
- const RangeContainer = (_a) => {
21
- var { startComponent, endComponent, errorMessages = [], labelProps = Object.assign(Object.assign({}, FieldLabelDefaultProps), { labelText: "Range" }), variant } = _a, props = __rest(_a, ["startComponent", "endComponent", "errorMessages", "labelProps", "variant"]);
9
+ const RangeContainer = ({ startComponent, endComponent, errorMessages = [], labelProps = {
10
+ ...FieldLabelDefaultProps,
11
+ labelText: "Range",
12
+ }, variant, ...props }) => {
22
13
  const spaceProps = getSubset(props, propTypes.space);
23
14
  const restProps = omitSubset(props, propTypes.space);
24
- return (React.createElement(Flex, Object.assign({}, spaceProps, { flexDirection: "column" }),
25
- React.createElement(FieldLabel, Object.assign({}, labelProps, restProps)),
15
+ return (React.createElement(Flex, { ...spaceProps, flexDirection: "column" },
16
+ React.createElement(FieldLabel, { ...labelProps, ...restProps }),
26
17
  React.createElement(Flex, { flexWrap: "wrap", mt: "x1", mb: errorMessages.length ? "x1" : "x3" },
27
18
  React.createElement(Flex, null, startComponent),
28
19
  React.createElement(Flex, { px: "half", alignItems: "flex-end", alignSelf: "flex-end" },
@@ -18,17 +18,6 @@
18
18
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
19
  SOFTWARE.
20
20
  */
21
- var __rest = (this && this.__rest) || function (s, e) {
22
- var t = {};
23
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24
- t[p] = s[p];
25
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
26
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
27
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
28
- t[p[i]] = s[p[i]];
29
- }
30
- return t;
31
- };
32
21
  import * as React from "react";
33
22
  import { VariableSizeList as List } from "react-window";
34
23
  import { createGetHeight, flattenGroupedChildren, getCurrentIndex } from "./lib";
@@ -63,7 +52,7 @@ function MenuList(props) {
63
52
  const itemCount = children.length;
64
53
  const [measuredHeights, setMeasuredHeights] = React.useState({});
65
54
  // calc menu height
66
- const _a = getStyles("menuList", props), { maxHeight, paddingBottom = 0, paddingTop = 0 } = _a, menuListStyle = __rest(_a, ["maxHeight", "paddingBottom", "paddingTop"]);
55
+ const { maxHeight, paddingBottom = 0, paddingTop = 0, ...menuListStyle } = getStyles("menuList", props);
67
56
  const totalHeight = React.useMemo(() => {
68
57
  return heights.reduce((sum, height, idx) => {
69
58
  if (measuredHeights[idx]) {
@@ -88,7 +77,10 @@ function MenuList(props) {
88
77
  if (measuredHeights[index] !== undefined && measuredHeights[index] === measuredHeight) {
89
78
  return;
90
79
  }
91
- setMeasuredHeights((measuredHeights) => (Object.assign(Object.assign({}, measuredHeights), { [index]: measuredHeight })));
80
+ setMeasuredHeights((measuredHeights) => ({
81
+ ...measuredHeights,
82
+ [index]: measuredHeight,
83
+ }));
92
84
  // this forces the list to rerender items after the item positions resizing
93
85
  if (list.current) {
94
86
  list.current.resetAfterIndex(index);
@@ -104,11 +96,14 @@ function MenuList(props) {
104
96
  }, [currentIndex, children, list]);
105
97
  return (React.createElement(List, { className: classNamePrefix
106
98
  ? `${classNamePrefix}__menu-list${isMulti ? ` ${classNamePrefix}__menu-list--is-multi` : ""}`
107
- : "", style: menuListStyle, ref: list, outerRef: innerRef, estimatedItemSize: estimatedItemSize, innerElementType: React.forwardRef((_a, ref) => {
108
- var { style } = _a, rest = __rest(_a, ["style"]);
109
- return (React.createElement("div", Object.assign({ ref: ref, style: Object.assign(Object.assign({}, style), { height: `${parseFloat(style.height) + paddingBottom + paddingTop}px` }) }, rest)));
110
- }), height: menuHeight, width: "100%", itemCount: itemCount, itemData: children, itemSize: (index) => measuredHeights[index] || heights[index] }, ({ data, index, style }) => {
111
- return (React.createElement("div", { style: Object.assign(Object.assign({}, style), { top: `${parseFloat(style.top.toString()) + paddingTop}px` }) },
99
+ : "", style: menuListStyle, ref: list, outerRef: innerRef, estimatedItemSize: estimatedItemSize, innerElementType: React.forwardRef(({ style, ...rest }, ref) => (React.createElement("div", { ref: ref, style: {
100
+ ...style,
101
+ height: `${parseFloat(style.height) + paddingBottom + paddingTop}px`,
102
+ }, ...rest }))), height: menuHeight, width: "100%", itemCount: itemCount, itemData: children, itemSize: (index) => measuredHeights[index] || heights[index] }, ({ data, index, style }) => {
103
+ return (React.createElement("div", { style: {
104
+ ...style,
105
+ top: `${parseFloat(style.top.toString()) + paddingTop}px`,
106
+ } },
112
107
  React.createElement(MenuItem, { data: data[index], index: index, setMeasuredHeight: setMeasuredHeight })));
113
108
  }));
114
109
  }
@@ -30,5 +30,5 @@ export interface CustomProps<Option extends NDSOption, IsMulti extends boolean,
30
30
  styles?: (selectStyles: StylesConfig<Option, IsMulti, Group>) => StylesConfig<Option, IsMulti, Group>;
31
31
  }
32
32
  export type NDSSelectProps<Option extends NDSOption = NDSOption, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> = Omit<Props<Option, IsMulti, Group>, keyof CustomProps<Option, IsMulti, Group> | "isSearchable" | "isDisabled" | "defaultMenuIsOpen" | "isMulti" | "styles"> & CustomProps<Option, IsMulti, Group>;
33
- declare const NDSSelect: <Option extends NDSOption = NDSOption, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: Omit<Props<Option, IsMulti, Group>, "isMulti" | "isDisabled" | "isSearchable" | "defaultMenuIsOpen" | keyof CustomProps<Option_1, IsMulti_1, Group_1>> & CustomProps<Option, IsMulti, Group> & React.RefAttributes<Select<Option, IsMulti, Group>>) => React.ReactElement;
33
+ declare const NDSSelect: <Option extends NDSOption = NDSOption, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: NDSSelectProps<Option, IsMulti, Group> & React.RefAttributes<Select<Option, IsMulti, Group>>) => React.ReactElement;
34
34
  export default NDSSelect;
@@ -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 ReactSelect from "react-select";
14
3
  import { useTranslation } from "react-i18next";
@@ -25,8 +14,7 @@ import { SelectControl, SelectMultiValue, SelectClearIndicator, SelectContainer,
25
14
  import { SelectOption } from "./SelectOption";
26
15
  import MenuList from "./MenuList";
27
16
  import { calcOptionsLength, checkOptionsAreValid, extractValue, getReactSelectValue } from "./lib";
28
- const NDSSelect = forwardRef((_a, ref) => {
29
- var { value, onChange, defaultValue, disabled, errorMessage, errorList, id, initialIsOpen, multiselect, placeholder, components, options, styles, windowThreshold = 300, autocomplete = true, maxHeight = "248px", required = false, menuPosition = "absolute", menuPlacement = "bottom", classNamePrefix = "ndsSelect", closeMenuOnSelect = true, noOptionsMessage } = _a, props = __rest(_a, ["value", "onChange", "defaultValue", "disabled", "errorMessage", "errorList", "id", "initialIsOpen", "multiselect", "placeholder", "components", "options", "styles", "windowThreshold", "autocomplete", "maxHeight", "required", "menuPosition", "menuPlacement", "classNamePrefix", "closeMenuOnSelect", "noOptionsMessage"]);
17
+ const NDSSelect = forwardRef(({ value, onChange, defaultValue, disabled, errorMessage, errorList, id, initialIsOpen, multiselect, placeholder, components, options, styles, windowThreshold = 300, autocomplete = true, maxHeight = "248px", required = false, menuPosition = "absolute", menuPlacement = "bottom", classNamePrefix = "ndsSelect", closeMenuOnSelect = true, noOptionsMessage, ...props }, ref) => {
30
18
  const { t } = useTranslation();
31
19
  const variant = useComponentVariant();
32
20
  const theme = useTheme();
@@ -49,14 +37,25 @@ const NDSSelect = forwardRef((_a, ref) => {
49
37
  maxHeight,
50
38
  windowed: options.length > windowThreshold,
51
39
  });
52
- return (React.createElement(Field, Object.assign({}, styledProps),
53
- React.createElement(MaybeFieldLabel, Object.assign({}, fieldLabelProps),
54
- React.createElement(ReactSelect, Object.assign({ ref: ref, isSearchable: autocomplete, isDisabled: disabled, defaultMenuIsOpen: initialIsOpen, isMulti: multiselect, defaultValue: getReactSelectValue(options, defaultValue), value: getReactSelectValue(options, value), options: options, onChange: (newValue) => {
40
+ return (React.createElement(Field, { ...styledProps },
41
+ React.createElement(MaybeFieldLabel, { ...fieldLabelProps },
42
+ React.createElement(ReactSelect, { ref: ref, isSearchable: autocomplete, isDisabled: disabled, defaultMenuIsOpen: initialIsOpen, isMulti: multiselect, defaultValue: getReactSelectValue(options, defaultValue), value: getReactSelectValue(options, value), options: options, onChange: (newValue) => {
55
43
  if (!onChange)
56
44
  return;
57
45
  const value = extractValue(newValue, multiselect);
58
46
  onChange(value);
59
- }, placeholder: placeholder || t("select"), "aria-required": required, required: required, "aria-invalid": error, inputId: id, styles: styles ? styles(stylesConfig) : stylesConfig, components: Object.assign(Object.assign({ Option: (props) => React.createElement(SelectOption, Object.assign({}, props), props.children), Control: SelectControl, MultiValue: SelectMultiValue, ClearIndicator: SelectClearIndicator, DropdownIndicator: SelectDropdownIndicator, SelectContainer: SelectContainer, Menu: SelectMenu, Input: SelectInput }, (isWindowed ? { MenuList } : {})), components), closeMenuOnSelect: closeMenuOnSelect, classNamePrefix: classNamePrefix, menuPosition: menuPosition, menuPlacement: menuPlacement, maxMenuHeight: numberFromDimension(maxHeight), noOptionsMessage: noOptionsMessage }, props)),
47
+ }, placeholder: placeholder || t("select"), "aria-required": required, required: required, "aria-invalid": error, inputId: id, styles: styles ? styles(stylesConfig) : stylesConfig, components: {
48
+ Option: (props) => React.createElement(SelectOption, { ...props }, props.children),
49
+ Control: SelectControl,
50
+ MultiValue: SelectMultiValue,
51
+ ClearIndicator: SelectClearIndicator,
52
+ DropdownIndicator: SelectDropdownIndicator,
53
+ SelectContainer: SelectContainer,
54
+ Menu: SelectMenu,
55
+ Input: SelectInput,
56
+ ...(isWindowed ? { MenuList } : {}),
57
+ ...components,
58
+ }, closeMenuOnSelect: closeMenuOnSelect, classNamePrefix: classNamePrefix, menuPosition: menuPosition, menuPlacement: menuPlacement, maxMenuHeight: numberFromDimension(maxHeight), noOptionsMessage: noOptionsMessage, ...props }),
60
59
  React.createElement(InlineValidation, { mt: "x1", errorMessage: errorMessage, errorList: errorList }))));
61
60
  });
62
61
  export default NDSSelect;
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import type { StoryObj } from "@storybook/react";
3
- import Select from "./Select";
3
+ import Select, { NDSSelectProps } from "./Select";
4
4
  declare const _default: {
5
5
  title: string;
6
- component: <Option extends import("./Select").NDSOption = import("./Select").NDSOption, IsMulti extends boolean = false, Group extends import("react-select").GroupBase<Option> = import("react-select").GroupBase<Option>>(props: Omit<import("react-select").Props<Option, IsMulti, Group>, "isMulti" | "isDisabled" | "isSearchable" | "defaultMenuIsOpen" | keyof import("./Select").CustomProps<Option_1, IsMulti_1, Group_1>> & import("./Select").CustomProps<Option, IsMulti, Group> & React.RefAttributes<import("react-select/base").default<Option, IsMulti, Group>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
6
+ component: <Option extends import("./Select").NDSOption = import("./Select").NDSOption, IsMulti extends boolean = false, Group extends import("react-select").GroupBase<Option> = import("react-select").GroupBase<Option>>(props: NDSSelectProps<Option, IsMulti, Group> & React.RefAttributes<import("react-select/base").default<Option, IsMulti, Group>>) => React.ReactElement;
7
7
  };
8
8
  export default _default;
9
9
  type Story = StoryObj<typeof Select>;
@@ -1,23 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __rest = (this && this.__rest) || function (s, e) {
11
- var t = {};
12
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
- t[p] = s[p];
14
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
- t[p[i]] = s[p[i]];
18
- }
19
- return t;
20
- };
21
1
  import React from "react";
22
2
  import styled from "styled-components";
23
3
  import { SelectOption } from "./SelectOption";
@@ -56,15 +36,15 @@ export const PCNList = [
56
36
  { value: "1", label: "PCN1" },
57
37
  { value: "9", label: "PCN9" },
58
38
  ];
59
- export const getPhotos = () => __awaiter(void 0, void 0, void 0, function* () {
39
+ export const getPhotos = async () => {
60
40
  // returns 5000 items
61
- const data = yield fetch("https://jsonplaceholder.typicode.com/photos");
62
- const json = yield data.json();
41
+ const data = await fetch("https://jsonplaceholder.typicode.com/photos");
42
+ const json = await data.json();
63
43
  return json.map(({ title, id }) => ({
64
44
  label: title,
65
45
  value: id,
66
46
  }));
67
- });
47
+ };
68
48
  const Indicator = styled.span(() => ({
69
49
  borderRadius: "25%",
70
50
  background: "green",
@@ -74,16 +54,14 @@ const Indicator = styled.span(() => ({
74
54
  height: "10px",
75
55
  marginRight: "5px",
76
56
  }));
77
- export const CustomOption = (_a) => {
78
- var { children } = _a, props = __rest(_a, ["children"]);
57
+ export const CustomOption = ({ children, ...props }) => {
79
58
  const newChildren = (React.createElement(React.Fragment, null,
80
59
  React.createElement(Indicator, null),
81
60
  children));
82
- return React.createElement(SelectOption, Object.assign({}, props), newChildren);
61
+ return React.createElement(SelectOption, { ...props }, newChildren);
83
62
  };
84
- export const CustomFieldsOption = (_a) => {
85
- var props = __rest(_a, []);
86
- return (React.createElement(SelectOption, Object.assign({}, props),
63
+ export const CustomFieldsOption = ({ ...props }) => {
64
+ return (React.createElement(SelectOption, { ...props },
87
65
  React.createElement("span", null, props.data.label),
88
66
  React.createElement("span", null, props.data.description)));
89
67
  };