@ntbjs/react-components 2.0.14 → 3.0.0-rc.1

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 (343) hide show
  1. package/build/data/Alert/Alert.js +18 -33
  2. package/build/data/Alert/Alert.js.map +1 -1
  3. package/build/data/Alert/Alert.styled.js +9 -47
  4. package/build/data/Alert/Alert.styled.js.map +1 -1
  5. package/build/data/Badge/Badge.js +36 -61
  6. package/build/data/Badge/Badge.js.map +1 -1
  7. package/build/data/Badge/Badge.styled.js +21 -70
  8. package/build/data/Badge/Badge.styled.js.map +1 -1
  9. package/build/data/Popover/Popover.js +125 -71
  10. package/build/data/Popover/Popover.js.map +1 -1
  11. package/build/data/Popover/Popover.styled.js +10 -140
  12. package/build/data/Popover/Popover.styled.js.map +1 -1
  13. package/build/data/SeverityBadge/SeverityBadge.js +13 -22
  14. package/build/data/SeverityBadge/SeverityBadge.js.map +1 -1
  15. package/build/data/SeverityBadge/index.js +2 -0
  16. package/build/data/SeverityBadge/index.js.map +1 -0
  17. package/build/data/Tab/Tab.js +7 -13
  18. package/build/data/Tab/Tab.js.map +1 -1
  19. package/build/data/Tab/Tab.styled.js +4 -7
  20. package/build/data/Tab/Tab.styled.js.map +1 -1
  21. package/build/data/Tabs/Tabs.js +30 -32
  22. package/build/data/Tabs/Tabs.js.map +1 -1
  23. package/build/data/Tabs/Tabs.styled.js +21 -57
  24. package/build/data/Tabs/Tabs.styled.js.map +1 -1
  25. package/build/data/Tooltip/Tooltip.js +102 -33
  26. package/build/data/Tooltip/Tooltip.js.map +1 -1
  27. package/build/data/Tooltip/Tooltip.styled.js +9 -22
  28. package/build/data/Tooltip/Tooltip.styled.js.map +1 -1
  29. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js +16 -23
  30. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js.map +1 -1
  31. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +13 -31
  32. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js.map +1 -1
  33. package/build/data/VerificationStatusIcon/index.js +2 -0
  34. package/build/data/VerificationStatusIcon/index.js.map +1 -0
  35. package/build/data/_shared/FloatingArrow.styled.js +30 -0
  36. package/build/data/_shared/FloatingArrow.styled.js.map +1 -0
  37. package/build/hooks/useEventListner.js.map +1 -1
  38. package/build/hooks/useFloatingPopover.js +187 -0
  39. package/build/hooks/useFloatingPopover.js.map +1 -0
  40. package/build/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  41. package/build/hooks/useOnClickOutside.js.map +1 -1
  42. package/build/hooks/useTooltipAutoShow.js.map +1 -1
  43. package/build/icons/arrow-back.svg.js +3 -3
  44. package/build/icons/arrow-back.svg.js.map +1 -1
  45. package/build/icons/arrow-forward.svg.js +4 -4
  46. package/build/icons/arrow-forward.svg.js.map +1 -1
  47. package/build/icons/check-rectangle-filled.svg.js +3 -3
  48. package/build/icons/check-rectangle-filled.svg.js.map +1 -1
  49. package/build/icons/close.svg.js +3 -3
  50. package/build/icons/close.svg.js.map +1 -1
  51. package/build/icons/edit-note.svg.js +3 -3
  52. package/build/icons/edit-note.svg.js.map +1 -1
  53. package/build/icons/expand-more.svg.js +3 -3
  54. package/build/icons/expand-more.svg.js.map +1 -1
  55. package/build/icons/headset.svg.js +3 -3
  56. package/build/icons/headset.svg.js.map +1 -1
  57. package/build/icons/layers.svg.js +3 -3
  58. package/build/icons/layers.svg.js.map +1 -1
  59. package/build/icons/link.svg.js +3 -3
  60. package/build/icons/link.svg.js.map +1 -1
  61. package/build/icons/play.svg.js +3 -3
  62. package/build/icons/play.svg.js.map +1 -1
  63. package/build/icons/search.svg.js +3 -3
  64. package/build/icons/search.svg.js.map +1 -1
  65. package/build/icons/star-filled.svg.js +3 -3
  66. package/build/icons/star-filled.svg.js.map +1 -1
  67. package/build/icons/star.svg.js +3 -3
  68. package/build/icons/star.svg.js.map +1 -1
  69. package/build/icons/triangle-right.svg.js +3 -3
  70. package/build/icons/triangle-right.svg.js.map +1 -1
  71. package/build/icons/verification.svg.js +3 -3
  72. package/build/icons/verification.svg.js.map +1 -1
  73. package/build/icons/warning-circle.svg.js +3 -3
  74. package/build/icons/warning-circle.svg.js.map +1 -1
  75. package/build/inputs/ActionButton/ActionButton.js +11 -22
  76. package/build/inputs/ActionButton/ActionButton.js.map +1 -1
  77. package/build/inputs/ActionButton/ActionButton.styled.js +5 -54
  78. package/build/inputs/ActionButton/ActionButton.styled.js.map +1 -1
  79. package/build/inputs/Button/Button.js +125 -121
  80. package/build/inputs/Button/Button.js.map +1 -1
  81. package/build/inputs/Button/Button.styled.js +42 -260
  82. package/build/inputs/Button/Button.styled.js.map +1 -1
  83. package/build/inputs/Checkbox/Checkbox.js +45 -61
  84. package/build/inputs/Checkbox/Checkbox.js.map +1 -1
  85. package/build/inputs/Checkbox/Checkbox.styled.js +24 -153
  86. package/build/inputs/Checkbox/Checkbox.styled.js.map +1 -1
  87. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +106 -111
  88. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js.map +1 -1
  89. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js +88 -273
  90. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js.map +1 -1
  91. package/build/inputs/CompactStarRating/CompactStarRating.js +56 -77
  92. package/build/inputs/CompactStarRating/CompactStarRating.js.map +1 -1
  93. package/build/inputs/CompactStarRating/CompactStarRating.styled.js +32 -211
  94. package/build/inputs/CompactStarRating/CompactStarRating.styled.js.map +1 -1
  95. package/build/inputs/CompactTextInput/CompactTextInput.js +86 -105
  96. package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -1
  97. package/build/inputs/CompactTextInput/CompactTextInput.styled.js +55 -258
  98. package/build/inputs/CompactTextInput/CompactTextInput.styled.js.map +1 -1
  99. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js +70 -77
  100. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js.map +1 -1
  101. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +28 -60
  102. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js.map +1 -1
  103. package/build/inputs/MultiLevelCheckbox/types.js +12 -12
  104. package/build/inputs/MultiLevelCheckbox/types.js.map +1 -1
  105. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +69 -73
  106. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js.map +1 -1
  107. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +44 -87
  108. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js.map +1 -1
  109. package/build/inputs/MultiSelect/MultiSelect.js +69 -79
  110. package/build/inputs/MultiSelect/MultiSelect.js.map +1 -1
  111. package/build/inputs/MultiSelect/MultiSelect.styled.js +70 -76
  112. package/build/inputs/MultiSelect/MultiSelect.styled.js.map +1 -1
  113. package/build/inputs/Radio/Radio.js +20 -33
  114. package/build/inputs/Radio/Radio.js.map +1 -1
  115. package/build/inputs/Radio/Radio.styled.js +15 -96
  116. package/build/inputs/Radio/Radio.styled.js.map +1 -1
  117. package/build/inputs/Switch/Switch.js +28 -40
  118. package/build/inputs/Switch/Switch.js.map +1 -1
  119. package/build/inputs/Switch/Switch.styled.js +24 -94
  120. package/build/inputs/Switch/Switch.styled.js.map +1 -1
  121. package/build/inputs/TextArea/TextArea.js +98 -123
  122. package/build/inputs/TextArea/TextArea.js.map +1 -1
  123. package/build/inputs/TextArea/TextArea.styled.js +64 -379
  124. package/build/inputs/TextArea/TextArea.styled.js.map +1 -1
  125. package/build/inputs/TextInput/TextInput.js +59 -79
  126. package/build/inputs/TextInput/TextInput.js.map +1 -1
  127. package/build/inputs/TextInput/TextInput.styled.js +33 -224
  128. package/build/inputs/TextInput/TextInput.styled.js.map +1 -1
  129. package/build/layout/InputGroup/InputGroup.js +6 -9
  130. package/build/layout/InputGroup/InputGroup.js.map +1 -1
  131. package/build/layout/InputGroup/InputGroup.styled.js +4 -3
  132. package/build/layout/InputGroup/InputGroup.styled.js.map +1 -1
  133. package/build/layout/InputGroup/index.js +2 -0
  134. package/build/layout/InputGroup/index.js.map +1 -0
  135. package/build/layout/SectionSeparator/SectionSeparator.js +5 -9
  136. package/build/layout/SectionSeparator/SectionSeparator.js.map +1 -1
  137. package/build/layout/SectionSeparator/SectionSeparator.styled.js +4 -8
  138. package/build/layout/SectionSeparator/SectionSeparator.styled.js.map +1 -1
  139. package/build/styles/utils/colors-export.d.ts +73 -0
  140. package/build/styles/utils/colors-export.js.map +1 -1
  141. package/build/utils/dateTime.js.map +1 -1
  142. package/build/utils/defaultTheme.js +14 -28
  143. package/build/utils/defaultTheme.js.map +1 -1
  144. package/build/utils/getElementRef.js +14 -0
  145. package/build/utils/getElementRef.js.map +1 -0
  146. package/build/utils/parseTrigger.js +16 -0
  147. package/build/utils/parseTrigger.js.map +1 -0
  148. package/build/widgets/AssetAction/AssetAction.js +26 -33
  149. package/build/widgets/AssetAction/AssetAction.js.map +1 -1
  150. package/build/widgets/AssetAction/AssetAction.styled.js +20 -34
  151. package/build/widgets/AssetAction/AssetAction.styled.js.map +1 -1
  152. package/build/widgets/AssetActionsBase/AssetActionsBase.js +8 -13
  153. package/build/widgets/AssetActionsBase/AssetActionsBase.js.map +1 -1
  154. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js +4 -9
  155. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js.map +1 -1
  156. package/build/widgets/AssetGallery/AssetGallery.js +15 -40
  157. package/build/widgets/AssetGallery/AssetGallery.js.map +1 -1
  158. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +55 -70
  159. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js.map +1 -1
  160. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +12 -24
  161. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js.map +1 -1
  162. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +146 -122
  163. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
  164. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +99 -286
  165. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
  166. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +170 -125
  167. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
  168. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +135 -364
  169. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
  170. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +20 -21
  171. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js.map +1 -1
  172. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +20 -71
  173. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js.map +1 -1
  174. package/build/widgets/ContextMenu/ContextMenu.js +12 -11
  175. package/build/widgets/ContextMenu/ContextMenu.js.map +1 -1
  176. package/build/widgets/ContextMenu/ContextMenu.styled.js +4 -4
  177. package/build/widgets/ContextMenu/ContextMenu.styled.js.map +1 -1
  178. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +17 -25
  179. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js.map +1 -1
  180. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +16 -71
  181. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js.map +1 -1
  182. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +7 -11
  183. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js.map +1 -1
  184. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +4 -11
  185. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js.map +1 -1
  186. package/build/widgets/InfoCard/InfoCard.js +26 -21
  187. package/build/widgets/InfoCard/InfoCard.js.map +1 -1
  188. package/build/widgets/InfoCard/InfoCard.styled.js +36 -84
  189. package/build/widgets/InfoCard/InfoCard.styled.js.map +1 -1
  190. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js +28 -34
  191. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js.map +1 -1
  192. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js +21 -57
  193. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js.map +1 -1
  194. package/build/widgets/InstructionSeverityDisplay/index.js +2 -0
  195. package/build/widgets/InstructionSeverityDisplay/index.js.map +1 -0
  196. package/build/widgets/Instructions/Instructions.js +53 -95
  197. package/build/widgets/Instructions/Instructions.js.map +1 -1
  198. package/build/widgets/Instructions/Instructions.styled.js +27 -26
  199. package/build/widgets/Instructions/Instructions.styled.js.map +1 -1
  200. package/build/widgets/ProgressBar/ProgressBar.js +39 -37
  201. package/build/widgets/ProgressBar/ProgressBar.js.map +1 -1
  202. package/build/widgets/ProgressBar/ProgressBar.styled.js +56 -125
  203. package/build/widgets/ProgressBar/ProgressBar.styled.js.map +1 -1
  204. package/build/widgets/SummaryCard/SummaryCard.js +55 -64
  205. package/build/widgets/SummaryCard/SummaryCard.js.map +1 -1
  206. package/build/widgets/SummaryCard/SummaryCard.styled.js +51 -106
  207. package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -1
  208. package/package.json +77 -36
  209. package/styles/utils/colors-export.d.ts +73 -0
  210. package/types/components/data/Alert/Alert.d.ts +76 -0
  211. package/types/components/data/Alert/Alert.styled.d.ts +83 -0
  212. package/types/components/data/Alert/index.d.ts +1 -0
  213. package/types/components/data/Badge/Badge.d.ts +128 -0
  214. package/types/components/data/Badge/Badge.styled.d.ts +132 -0
  215. package/types/components/data/Badge/index.d.ts +1 -0
  216. package/types/components/data/Popover/Popover.d.ts +205 -0
  217. package/types/components/data/Popover/Popover.styled.d.ts +15 -0
  218. package/types/components/data/Popover/index.d.ts +1 -0
  219. package/types/components/data/SeverityBadge/SeverityBadge.d.ts +72 -0
  220. package/types/components/data/SeverityBadge/index.d.ts +1 -0
  221. package/types/components/data/Tab/Tab.d.ts +27 -0
  222. package/types/components/data/Tab/Tab.styled.d.ts +1 -0
  223. package/types/components/data/Tab/index.d.ts +1 -0
  224. package/types/components/data/Tabs/Tabs.d.ts +111 -0
  225. package/types/components/data/Tabs/Tabs.styled.d.ts +42 -0
  226. package/types/components/data/Tabs/index.d.ts +1 -0
  227. package/types/components/data/Tooltip/Tooltip.d.ts +134 -0
  228. package/types/components/data/Tooltip/Tooltip.styled.d.ts +8 -0
  229. package/types/components/data/Tooltip/index.d.ts +1 -0
  230. package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.d.ts +35 -0
  231. package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.d.ts +46 -0
  232. package/types/components/data/VerificationStatusIcon/index.d.ts +1 -0
  233. package/types/components/data/_shared/FloatingArrow.styled.d.ts +129 -0
  234. package/types/components/data/index.d.ts +8 -0
  235. package/types/components/index.d.ts +3 -0
  236. package/types/components/inputs/ActionButton/ActionButton.d.ts +55 -0
  237. package/types/components/inputs/ActionButton/ActionButton.styled.d.ts +34 -0
  238. package/types/components/inputs/ActionButton/index.d.ts +1 -0
  239. package/types/components/inputs/Button/Button.d.ts +82 -0
  240. package/types/components/inputs/Button/Button.styled.d.ts +102 -0
  241. package/types/components/inputs/Button/index.d.ts +1 -0
  242. package/types/components/inputs/Checkbox/Checkbox.d.ts +92 -0
  243. package/types/components/inputs/Checkbox/Checkbox.styled.d.ts +33 -0
  244. package/types/components/inputs/Checkbox/index.d.ts +1 -0
  245. package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.d.ts +242 -0
  246. package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.d.ts +157 -0
  247. package/types/components/inputs/CompactAutocompleteSelect/index.d.ts +1 -0
  248. package/types/components/inputs/CompactStarRating/CompactStarRating.d.ts +96 -0
  249. package/types/components/inputs/CompactStarRating/CompactStarRating.styled.d.ts +86 -0
  250. package/types/components/inputs/CompactStarRating/index.d.ts +1 -0
  251. package/types/components/inputs/CompactTextInput/CompactTextInput.d.ts +116 -0
  252. package/types/components/inputs/CompactTextInput/CompactTextInput.styled.d.ts +70 -0
  253. package/types/components/inputs/CompactTextInput/index.d.ts +1 -0
  254. package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.d.ts +41 -0
  255. package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.d.ts +21 -0
  256. package/types/components/inputs/MultiLevelCheckbox/index.d.ts +2 -0
  257. package/types/components/inputs/MultiLevelCheckbox/types.d.ts +72 -0
  258. package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.d.ts +44 -0
  259. package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.d.ts +11 -0
  260. package/types/components/inputs/MultiLevelCheckboxSelect/index.d.ts +1 -0
  261. package/types/components/inputs/MultiSelect/MultiSelect.d.ts +172 -0
  262. package/types/components/inputs/MultiSelect/MultiSelect.styled.d.ts +99 -0
  263. package/types/components/inputs/MultiSelect/index.d.ts +1 -0
  264. package/types/components/inputs/Radio/Radio.d.ts +65 -0
  265. package/types/components/inputs/Radio/Radio.styled.d.ts +11 -0
  266. package/types/components/inputs/Radio/index.d.ts +1 -0
  267. package/types/components/inputs/Switch/Switch.d.ts +62 -0
  268. package/types/components/inputs/Switch/Switch.styled.d.ts +20 -0
  269. package/types/components/inputs/Switch/index.d.ts +1 -0
  270. package/types/components/inputs/TextArea/TextArea.d.ts +124 -0
  271. package/types/components/inputs/TextArea/TextArea.styled.d.ts +95 -0
  272. package/types/components/inputs/TextArea/index.d.ts +1 -0
  273. package/types/components/inputs/TextInput/TextInput.d.ts +109 -0
  274. package/types/components/inputs/TextInput/TextInput.styled.d.ts +43 -0
  275. package/types/components/inputs/TextInput/index.d.ts +1 -0
  276. package/types/components/inputs/index.d.ts +13 -0
  277. package/types/components/layout/InputGroup/InputGroup.d.ts +31 -0
  278. package/types/components/layout/InputGroup/InputGroup.styled.d.ts +1 -0
  279. package/types/components/layout/InputGroup/index.d.ts +1 -0
  280. package/types/components/layout/SectionSeparator/SectionSeparator.d.ts +28 -0
  281. package/types/components/layout/SectionSeparator/SectionSeparator.styled.d.ts +14 -0
  282. package/types/components/layout/SectionSeparator/index.d.ts +1 -0
  283. package/types/components/layout/index.d.ts +2 -0
  284. package/types/components/widgets/AssetAction/AssetAction.d.ts +16 -0
  285. package/types/components/widgets/AssetAction/AssetAction.styled.d.ts +20 -0
  286. package/types/components/widgets/AssetAction/index.d.ts +1 -0
  287. package/types/components/widgets/AssetActionsBase/AssetActionsBase.d.ts +25 -0
  288. package/types/components/widgets/AssetActionsBase/AssetActionsBase.styled.d.ts +1 -0
  289. package/types/components/widgets/AssetActionsBase/index.d.ts +1 -0
  290. package/types/components/widgets/AssetGallery/AssetGallery.d.ts +170 -0
  291. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.d.ts +88 -0
  292. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.d.ts +3 -0
  293. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.d.ts +3 -0
  294. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.d.ts +100 -0
  295. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.d.ts +2 -0
  296. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.d.ts +85 -0
  297. package/types/components/widgets/AssetGallery/asset.types.d.ts +446 -0
  298. package/types/components/widgets/AssetGallery/index.d.ts +1 -0
  299. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.d.ts +60 -0
  300. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.d.ts +35 -0
  301. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/index.d.ts +1 -0
  302. package/types/components/widgets/ContextMenu/ContextMenu.d.ts +134 -0
  303. package/types/components/widgets/ContextMenu/ContextMenu.styled.d.ts +1 -0
  304. package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.d.ts +45 -0
  305. package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.d.ts +26 -0
  306. package/types/components/widgets/ContextMenu/ContextMenuItem/index.d.ts +1 -0
  307. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.d.ts +41 -0
  308. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.d.ts +1 -0
  309. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/index.d.ts +1 -0
  310. package/types/components/widgets/ContextMenu/index.d.ts +1 -0
  311. package/types/components/widgets/InfoCard/InfoCard.d.ts +33 -0
  312. package/types/components/widgets/InfoCard/InfoCard.styled.d.ts +45 -0
  313. package/types/components/widgets/InfoCard/index.d.ts +1 -0
  314. package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.d.ts +46 -0
  315. package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.d.ts +40 -0
  316. package/types/components/widgets/InstructionSeverityDisplay/index.d.ts +1 -0
  317. package/types/components/widgets/Instructions/Instructions.d.ts +156 -0
  318. package/types/components/widgets/Instructions/Instructions.styled.d.ts +26 -0
  319. package/types/components/widgets/Instructions/index.d.ts +1 -0
  320. package/types/components/widgets/ProgressBar/ProgressBar.d.ts +30 -0
  321. package/types/components/widgets/ProgressBar/ProgressBar.styled.d.ts +78 -0
  322. package/types/components/widgets/ProgressBar/index.d.ts +1 -0
  323. package/types/components/widgets/SummaryCard/SummaryCard.d.ts +83 -0
  324. package/types/components/widgets/SummaryCard/SummaryCard.styled.d.ts +68 -0
  325. package/types/components/widgets/SummaryCard/index.d.ts +1 -0
  326. package/types/components/widgets/index.d.ts +11 -0
  327. package/types/hooks/useElementSize.d.ts +25 -0
  328. package/types/hooks/useEventListner.d.ts +46 -0
  329. package/types/hooks/useFloatingPopover.d.ts +242 -0
  330. package/types/hooks/useIsomorphicLayoutEffect.d.ts +26 -0
  331. package/types/hooks/useOnClickOutside.d.ts +31 -0
  332. package/types/hooks/useTooltipAutoShow.d.ts +80 -0
  333. package/types/icons/index.d.ts +41 -0
  334. package/types/ssr/index.d.ts +1 -0
  335. package/types/styles/utils/colors-export.d.ts +73 -0
  336. package/types/utils/dateTime.d.ts +13 -0
  337. package/types/utils/defaultTheme.d.ts +174 -0
  338. package/types/utils/getElementRef.d.ts +21 -0
  339. package/types/utils/parseTrigger.d.ts +92 -0
  340. package/build/_virtual/_rollupPluginBabelHelpers.js +0 -12
  341. package/build/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  342. package/build/widgets/AssetGallery/asset.propType.js +0 -56
  343. package/build/widgets/AssetGallery/asset.propType.js.map +0 -1
@@ -0,0 +1,72 @@
1
+ import PropTypes from 'prop-types';
2
+ /**
3
+ * The option tree `MultiLevelCheckbox` and `MultiLevelCheckboxSelect` render.
4
+ *
5
+ * TWO THINGS IN HERE, DESPITE THE FILE NAME: the types, and `findChildValues` —
6
+ * a runtime helper both components call. The helper predates the file's name;
7
+ * moving it is a separate commit.
8
+ */
9
+ /**
10
+ * A node's identity.
11
+ *
12
+ * `string | number` RATHER THAN THE `PropTypes.any` IT REPLACES, because three
13
+ * runtime uses constrain it and none of them accepts an arbitrary value: it is
14
+ * the React `key` of every rendered `CheckboxTree`, it is the `value` of the
15
+ * underlying `<input type="checkbox">`, and it is compared with `===` and
16
+ * `Array.prototype.includes` against the `checked` array the consumer owns.
17
+ * An object here already renders as `[object Object]` and breaks reconciliation,
18
+ * so `any` was permission for a bug rather than a description of the API.
19
+ *
20
+ * Every value in the stories is a string.
21
+ */
22
+ export type MultiLevelCheckboxNodeValue = string | number;
23
+ /**
24
+ * One option, with any number of levels of children under it.
25
+ *
26
+ * GENUINELY RECURSIVE, WHICH THE propTypes AT THE BOTTOM ARE NOT — and the
27
+ * recursion is the accurate description, not an improvement invented here:
28
+ *
29
+ * - `NodeType` validates exactly two levels and then gives up (`children:
30
+ * PropTypes.array`), because a self-referential `PropTypes.shape` is not
31
+ * expressible without a lazy indirection. Its own comment says so.
32
+ * - `findChildValues` below, `hasChildrenSelected`, `hasAllChildrenSelected`,
33
+ * `getLabelByValue` and `CheckboxTree` itself all recurse without a depth
34
+ * limit, and the stories ship four-level trees
35
+ * (`sport → idrettsgren → golf → minigolf`).
36
+ *
37
+ * So the propTypes silently accepted anything below level two while the
38
+ * components happily walked it. This interface is what the code has always
39
+ * meant.
40
+ */
41
+ export interface MultiLevelCheckboxNode {
42
+ /** Shown next to the checkbox, and what the `search` prop matches against. */
43
+ label: string;
44
+ value: MultiLevelCheckboxNodeValue;
45
+ /**
46
+ * Child options. A node with a non-empty `children` array gets an expander
47
+ * arrow; checking it checks the whole subtree.
48
+ */
49
+ children?: MultiLevelCheckboxNode[];
50
+ }
51
+ /**
52
+ * Every descendant value under `node`, depth-first, excluding `node` itself.
53
+ *
54
+ * Callers pass `[node.value, ...findChildValues(node)]` when they want the node
55
+ * included, which is why it is excluded here.
56
+ *
57
+ * Guards on `Array.isArray(node.children)`, so a node whose `children` is
58
+ * `undefined` — or something the type says it cannot be — yields `[]` rather
59
+ * than throwing. There is no cycle protection: a node reachable from its own
60
+ * subtree recurses until the stack runs out. That is pre-existing, and the tree
61
+ * comes from the consumer.
62
+ */
63
+ export declare function findChildValues(node: MultiLevelCheckboxNode): MultiLevelCheckboxNodeValue[];
64
+ export declare const NodeType: PropTypes.Requireable<PropTypes.InferProps<{
65
+ label: PropTypes.Validator<string>;
66
+ value: PropTypes.Validator<any>;
67
+ children: PropTypes.Requireable<PropTypes.InferProps<{
68
+ label: PropTypes.Validator<string>;
69
+ value: PropTypes.Validator<any>;
70
+ children: PropTypes.Requireable<any[]>;
71
+ }>[]>;
72
+ }>>;
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import type { MultiLevelCheckboxNode } from '../MultiLevelCheckbox/types';
3
+ type MultiLevelCheckboxSelectOwnProps = {
4
+ /**
5
+ * Label text for the MultiLevelCheckbox
6
+ */
7
+ label?: string;
8
+ /**
9
+ * The placeholder of the input. Text to be displayed on the input element when the component is enabled and not focused – e.g. "Select categories..."
10
+ */
11
+ placeholder?: string;
12
+ options: MultiLevelCheckboxNode[];
13
+ /**
14
+ * Array of checked option values
15
+ */
16
+ checked: any[];
17
+ /**
18
+ * Optional text to display when no results are found while searching.`
19
+ */
20
+ noResultsText?: string;
21
+ /**
22
+ * Callback function for the `onChange` event
23
+ */
24
+ onChange: (...args: any[]) => any;
25
+ /**
26
+ * Callback function for the `onChange` event – returns only the checked parents
27
+ */
28
+ onParentChange?: (...args: any[]) => any;
29
+ };
30
+ /**
31
+ * MultiLevelCheckboxSelect allow the user to select one or more items from a nested set into a MultiSelect-styled input.
32
+ *
33
+ * This component is controlled which means that the consumer will have to keep track of what options are selected. The selected options should be provided to the `checked`-prop. On any selection or deselection onChange will be called with an updated `checked`-list.
34
+ *
35
+ * ### Import
36
+ *
37
+ * ```js
38
+ * import { MultiLevelCheckboxSelect } from '@ntbjs/react-components/inputs'
39
+ * // or
40
+ * import MultiLevelCheckboxSelect from '@ntbjs/react-components/inputs/MultiLevelCheckboxSelect'
41
+ * ```
42
+ */
43
+ declare const MultiLevelCheckboxSelect: React.ForwardRefExoticComponent<Omit<Omit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>, "ref">, keyof MultiLevelCheckboxSelectOwnProps> & MultiLevelCheckboxSelectOwnProps & React.RefAttributes<any>>;
44
+ export default MultiLevelCheckboxSelect;
@@ -0,0 +1,11 @@
1
+ export declare const MultiLevelCheckboxSelect: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
2
+ export declare const MultiLevelCheckboxSelectInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
3
+ export declare const Item: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
4
+ export declare const ItemLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
5
+ export declare const ItemRemoveButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>, never>, never>> & string;
6
+ export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
7
+ export declare const Placeholder: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
8
+ export declare const PopoverContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
9
+ export declare const PopoverHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
10
+ export declare const SearchContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
11
+ export declare const OptionsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
@@ -0,0 +1 @@
1
+ export { default } from './MultiLevelCheckboxSelect';
@@ -0,0 +1,172 @@
1
+ import React from 'react';
2
+ import * as S from './MultiSelect.styled';
3
+ /**
4
+ * MultiSelect's OWN props — the 19 members that were the entirety of this component's
5
+ * declared surface until NMB-3998, unchanged. They stay authoritative: `MultiSelectProps`
6
+ * below `Omit`s these keys out of the base before intersecting, so nothing here is
7
+ * narrowed by a colliding member of react-select's props.
8
+ */
9
+ export type MultiSelectOwnProps = {
10
+ /**
11
+ *
12
+ * The label of the input field – leave `undefined` to hide the label
13
+ */
14
+ label?: string;
15
+ /**
16
+ * `Array` of `objects` containing the default options. This is only needed
17
+ * when asynchronous option fetching with the `loadOptions` prop is not used.
18
+ *
19
+ * **Note:**
20
+ * <br />This will be overridden by the `loadOptions` prop if both props are set.
21
+ */
22
+ availableOptions?: any[];
23
+ /**
24
+ * `Array` of `objects` containing the selected options.
25
+ */
26
+ selectedOptions?: any[];
27
+ /**
28
+ * Function with a `Promise` returning filtered options.
29
+ *
30
+ * See [Asynchronous fetching/filtering with pagination](#asynchronous-fetchingfiltering-with-pagination)
31
+ * for details.
32
+ *
33
+ * **Note:**
34
+ * <br />This will override the `availableOptions` prop if both props are set.
35
+ */
36
+ loadOptions?: (...args: any[]) => any;
37
+ /**
38
+ * Function for custom "Loading..." message while waiting for the first page
39
+ * from `loadOptions` to resolve. Defaults to "Loading..." if no function is provided.
40
+ */
41
+ loadingMessageFunc?: (...args: any[]) => any;
42
+ /**
43
+ * Callback function for sending updates to the backend whenever the selected values are updated.
44
+ * See [Update handling](#update-handling) for details.
45
+ */
46
+ onUpdateCallback?: (...args: any[]) => any;
47
+ /**
48
+ * Text to be displayed on the input element when the component
49
+ * is enabled and not focused – e.g. "Add a keyword..."
50
+ */
51
+ editText: string;
52
+ /**
53
+ * Whether the user can create new options.
54
+ */
55
+ creatable?: boolean;
56
+ /**
57
+ * Callback function for formatting the message displayed in the dropdown when there
58
+ * are no matching options, and the user has permission to create new options.
59
+ * The callback function will be given the current input value as an argument.
60
+ */
61
+ createNewOptionMessageFunc?: (...args: any[]) => any;
62
+ /**
63
+ * If the list of options is empty, or if the current input value doesn't match
64
+ * any of the available options and the user doesn't have permission to add options,
65
+ * this function will be called and passed the current input value as an argument.
66
+ */
67
+ noOptionsMessageFunc?: (...args: any[]) => any;
68
+ /**
69
+ * Optional callback function to be trigger when clicking a selected option's label – e.g. opening
70
+ * a search filtered on the given multi-value's `label`.
71
+ *
72
+ * The callback function will be passed the option `object` as an argument.
73
+ */
74
+ onMultiValueClick?: (...args: any[]) => any;
75
+ /**
76
+ * Display an overlay which the user needs to click in order to
77
+ * show the selected options list in its entirety and edit it.
78
+ */
79
+ showMore?: boolean;
80
+ /**
81
+ * Text displayed on the "Show more" overlay.
82
+ */
83
+ showMoreText?: string;
84
+ /**
85
+ * Whether to display the total number of selected options after the show more text.
86
+ */
87
+ displayTotalOnShowMore?: boolean;
88
+ /**
89
+ * Whether the multi-select should be displayed in read-only mode.
90
+ * The user can still click the selected options to trigger their on-click effect.
91
+ */
92
+ readOnly?: boolean;
93
+ /**
94
+ * Whether the component is hidden or visible.
95
+ */
96
+ hidden?: boolean;
97
+ /**
98
+ * Whether the multi-select should be disabled.
99
+ * The user will not be able to trigger the on-click effect of the selected options.
100
+ */
101
+ disabled?: boolean;
102
+ /**
103
+ * Set to `true` to display a red border indicating an error.
104
+ * Pass in a `string` instead to also show the string underneath the input field.
105
+ *
106
+ * **Note:**
107
+ * <br />This overrides the "Show more" overlay. Errors will be prioritized over warnings.
108
+ */
109
+ error?: boolean | string;
110
+ /**
111
+ * Set to `true` to display an orange border.
112
+ * Pass in a `string` instead to also show the string underneath the input field.
113
+ *
114
+ * **Note:**
115
+ * <br />This overrides the "Show more" overlay. Errors will be prioritized over warnings.
116
+ */
117
+ warning?: boolean | string;
118
+ };
119
+ /**
120
+ * THE PUBLISHED PROPS TYPE. It has a base, and that is playbook §C.2, not a convenience.
121
+ *
122
+ * This component destructures `...rest` (below) and spreads it into react-select —
123
+ * `sharedSelectProps = { ...rest, … }`, handed to `<SelectComponent {...sharedSelectProps} />`.
124
+ * A closed 19-member type therefore REJECTED props that this component forwards and that
125
+ * work at runtime: measured against mb-main-client, `className`, `name`, `onBlur` and
126
+ * `required` are all real react-select props being passed today and all four were a hard
127
+ * TS2322 the moment the library started shipping `.d.ts`. That is the library lying about
128
+ * its own contract, which is the exact class §C.2 exists to prevent — and it is NOT the
129
+ * same finding as the other 22 rejected consumer attributes, which are props no component
130
+ * here spreads anywhere and which stay rejected on purpose.
131
+ *
132
+ * THE BASE IS READ OFF WHAT `rest` IS ACTUALLY SPREAD ONTO, never assumed. That target is
133
+ * one of the four `styled(<react-select …>)` wrappers, chosen at runtime by `loadOptions`
134
+ * and `creatable`. `S.MultiSelect` — `styled(Select)` — is the deliberate choice among the
135
+ * four: `CreatableSelect`/`AsyncPaginate` add props on top of the plain select's surface,
136
+ * so plain `Select` is the set that is valid in ALL FOUR configurations. Basing this on the
137
+ * async-creatable wrapper instead would admit `debounceTimeout` and friends in the default
138
+ * configuration, where they do nothing — the same mistake in the other direction.
139
+ *
140
+ * `Omit<Base, keyof Own> & Own`, NOT `Base & Own`. An intersection intersects a colliding
141
+ * MEMBER rather than replacing it; measured on `TextArea`, `rows?: number | string` met
142
+ * `styled.textarea`'s `rows?: number` and `rows="4"` became an error — half a published
143
+ * prop silently deleted by the pass meant to widen it. Disjoint pairs collapse to `never`.
144
+ *
145
+ * `ComponentPropsWithoutRef`, NOT `…WithRef`. `React.forwardRef` below supplies `ref`
146
+ * itself; `WithRef` was measured to let `<MultiSelect ref={…} />` compile with the ref
147
+ * silently dropped.
148
+ *
149
+ * BOTH ALIASES ARE `export`ed AND THE `const` BELOW IS ANNOTATED, for declaration emit
150
+ * only — same mechanism and same audit as `CompactAutocompleteSelect` (577fc8d, §G.4.1).
151
+ * tsc prints an exported alias from its source text and EXPANDS an unexported one, and the
152
+ * expansion here reaches react-select's `PublicBaseSelectProps` /
153
+ * `StateManagerAdditionalProps`, which `react-select`'s `exports` map does not serve:
154
+ * TS2883, and with `noEmitOnError: false` that means the `.d.ts` is silently not written.
155
+ * The annotation on the `const` is needed for the same reason — `forwardRef` infers
156
+ * `ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<any>>` and tsc computes
157
+ * `PropsWithoutRef<P>` eagerly, which re-expands what the exported alias just avoided.
158
+ *
159
+ * THE SWALLOW THIS PARAGRAPH USED TO RECORD AS OPEN IS FIXED. `sharedSelectProps` still
160
+ * lists 14 keys after `...rest` and they still win — deliberately, and the reasoning is
161
+ * written out at the literal itself — but `onFocus`, `onBlur` and `onChange` are no longer
162
+ * among them: they now run the component's own logic and then call the caller's handler.
163
+ * So `onBlur`, the one a consumer passes today, is both admitted by this type and actually
164
+ * forwarded. Do not narrow this type to "reflect" the remaining 14: they are the runtime
165
+ * form of props this component already declares (`selectedOptions`, `availableOptions`,
166
+ * `disabled`/`readOnly`, `loadOptions`) plus its own rendering and CSS contract, and
167
+ * `Omit`ting them would only stop react-select's own names from being accepted while
168
+ * changing nothing about which value wins.
169
+ */
170
+ export type MultiSelectProps = Omit<React.ComponentPropsWithoutRef<typeof S.MultiSelect>, keyof MultiSelectOwnProps> & MultiSelectOwnProps;
171
+ declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<any>>;
172
+ export default MultiSelect;
@@ -0,0 +1,99 @@
1
+ import type React from 'react';
2
+ import Select from 'react-select';
3
+ import CreatableSelect from 'react-select/creatable';
4
+ import { AsyncPaginate } from 'react-select-async-paginate';
5
+ import type { PartialNtbTheme } from '../../../utils/defaultTheme';
6
+ /**
7
+ * The `theme` prop of the four react-select wrappers below, restated as OUR theme.
8
+ *
9
+ * WHY THIS EXISTS. `theme` is the one prop name that both styled-components and
10
+ * react-select claim. react-select declares it `ThemeConfig = Theme | ((t: Theme) => Theme)`
11
+ * and its `Theme` requires `borderRadius`, which `NtbTheme` does not have — so
12
+ * `.attrs(applyDefaultTheme)`, whose return type is `{ theme: NtbTheme }`, was
13
+ * unassignable to `Attrs<SelectProps>` and each wrapper reported:
14
+ *
15
+ * TS2345 … Types of property 'theme' are incompatible.
16
+ * Type 'NtbTheme' is not assignable to type 'ThemeConfig'.
17
+ * Property 'borderRadius' is missing in type 'NtbTheme' but required in type 'Theme'.
18
+ *
19
+ * `.attrs<{ theme?: PartialNtbTheme }>` fixes it because `attrs`' generic is applied as
20
+ * `Substitute<OuterProps, P> = FastOmit<OuterProps, keyof P> & P` — i.e. declaring
21
+ * `theme` REPLACES react-select's declaration of it rather than intersecting with it.
22
+ *
23
+ * AND THAT IS THE TRUTH ABOUT THIS BOUNDARY, not a workaround. At runtime `.attrs()`
24
+ * hands react-select the merged `NtbTheme`, and react-select's `getTheme()` does
25
+ * `{ ...its defaultTheme, ...this.props.theme }`: our `colors` and `spacing` win — which
26
+ * is why `ThemeColors`/`ThemeSpacing` in `utils/defaultTheme.ts` carry react-select's
27
+ * member names and not design-token names — and `borderRadius` falls through to
28
+ * react-select's own `4`. `NtbTheme` is deliberately a PARTIAL override of react-select's
29
+ * theme, so `ThemeConfig` was never the right type for this prop here.
30
+ *
31
+ * `PartialNtbTheme` and not `NtbTheme` because this is the INPUT side: a caller may pass
32
+ * any subset and `applyDefaultTheme` fills the rest in, exactly as `ThemedProps` states
33
+ * for every other file. Do NOT "fix" this by adding `borderRadius` to `NtbTheme`: that
34
+ * would hand react-select a border radius it does not get today and is a render change.
35
+ */
36
+ interface SelectThemeProp {
37
+ /** A partial override merged over `defaultTheme` by `applyDefaultTheme`. */
38
+ theme?: PartialNtbTheme;
39
+ }
40
+ /**
41
+ * The WRITTEN type of the four `styled(<react-select component>)` exports below, and the
42
+ * reason they are annotated at all when nothing else in this repo is.
43
+ *
44
+ * `styled(Select).attrs<SelectThemeProp>(…)` INFERS a correct type. It is not a
45
+ * WRITEABLE one: `tsc --declaration` has to print it into `MultiSelect.styled.d.ts`, the
46
+ * printed form expands to react-select's `PublicBaseSelectProps` and
47
+ * `StateManagerAdditionalProps`, and neither is re-exported from `react-select`'s public
48
+ * entry — react-select has an `exports` map with no wildcard, so
49
+ * `react-select/dist/declarations/src/Select` does not resolve for a consumer at all.
50
+ * The result was 11 x TS2883 in this file, and the consequence was worse than the
51
+ * message: `noEmitOnError` is false, so the build "succeeded" while this file's `.d.ts`
52
+ * was SILENTLY NOT WRITTEN.
53
+ *
54
+ * A generic alias fixes it because tsc prints an alias APPLICATION by reference —
55
+ * `SelectWrapper<typeof Select>` — instead of expanding it, and `typeof Select` is
56
+ * `typeof import('react-select').default`, which is nameable. Nothing here is widened or
57
+ * narrowed for the sake of the declaration: `Omit<ComponentProps<C>, keyof P> & P` is
58
+ * exactly styled-components' own `Substitute<OuterProps, P>`, which is the rule
59
+ * `SelectThemeProp` above relies on.
60
+ *
61
+ * What IS given up is the styled-components-specific surface of these four bindings —
62
+ * `.withConfig()`, `.attrs()` and re-wrapping with `styled(S.MultiSelect)`. Audited:
63
+ * nothing in this repo does any of the three to them. Adding one means annotating with
64
+ * `IStyledComponent` instead, which puts the same non-portable expansion back.
65
+ */
66
+ type SelectWrapper<C extends React.ComponentType<any>> = React.ComponentType<Omit<React.ComponentProps<C>, keyof SelectThemeProp> & SelectThemeProp>;
67
+ declare const AsyncCreatableSelectPaginate: import("react-select-async-paginate").WithAsyncPaginateType;
68
+ export declare const MultiSelectWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
69
+ export declare const InnerWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
70
+ export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>>, never>, never>> & string;
71
+ export declare const MultiSelect: SelectWrapper<typeof Select>;
72
+ export declare const CreatableMultiSelect: SelectWrapper<typeof CreatableSelect>;
73
+ export declare const AsyncMultiSelect: SelectWrapper<typeof AsyncPaginate>;
74
+ export declare const AsyncCreatableMultiSelect: SelectWrapper<typeof AsyncCreatableSelectPaginate>;
75
+ export declare const MultiValueWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
76
+ export declare const DropdownOptionDeleteIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<React.SVGProps<SVGSVGElement> & {
77
+ title?: string;
78
+ }, React.SVGProps<SVGSVGElement> & {
79
+ title?: string;
80
+ }>, never>, never>> & string & Omit<React.FunctionComponent<React.SVGProps<SVGSVGElement> & {
81
+ title?: string;
82
+ }>, keyof React.Component<any, {}, any>>;
83
+ export declare const ShowMoreWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
84
+ export declare const ShowMoreOverlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
85
+ export declare const ShowMoreText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
86
+ /**
87
+ * `MultiSelect.tsx` renders `<S.ErrorMessage $error={!!error} $warning={!!warning}>`
88
+ * (line 461), so both are `boolean` — the `!!` is in the JSX, not here. Optional per
89
+ * §J.5; the template's own ternary chain already ends in `'inherit'` for the
90
+ * neither-set case.
91
+ */
92
+ interface ErrorMessageStyleProps {
93
+ /** `!!error` — red. Wins over `$warning` when both are set. */
94
+ $error?: boolean;
95
+ /** `!!warning` — orange. */
96
+ $warning?: boolean;
97
+ }
98
+ export declare const ErrorMessage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, ErrorMessageStyleProps>, never>> & string;
99
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './MultiSelect';
@@ -0,0 +1,65 @@
1
+ import React from 'react';
2
+ type RadioOwnProps = {
3
+ /**
4
+ * Text displayed by the radio button
5
+ */
6
+ label?: any;
7
+ /**
8
+ * Name of the radio button (used when sending form data)
9
+ */
10
+ name: string;
11
+ /**
12
+ * Value to be sent when the given radio button is selected
13
+ */
14
+ value: any;
15
+ /**
16
+ * Whether the radio button is checked
17
+ */
18
+ checked?: boolean;
19
+ /**
20
+ * Whether the radio button is checked by default. The most commonly used option should have this set to `true`.
21
+ */
22
+ defaultChecked?: boolean;
23
+ /**
24
+ * Whether the radio button is disabled
25
+ */
26
+ disabled?: boolean;
27
+ /**
28
+ * Display the radio button as read-only
29
+ */
30
+ readOnly?: boolean;
31
+ /**
32
+ * Custom class names for the HTML element
33
+ */
34
+ className?: string;
35
+ /**
36
+ * Custom inline CSS styling
37
+ */
38
+ style?: any;
39
+ /**
40
+ * Optional callback function for the `onChange` event
41
+ */
42
+ onChange?: (...args: any[]) => any;
43
+ /**
44
+ * Optional callback function for the `onBlur` event
45
+ */
46
+ onBlur?: (...args: any[]) => any;
47
+ };
48
+ /**
49
+ * Radio buttons allow the user to select one option from a set.
50
+ *
51
+ * Use radio buttons when the user needs to see all available options. If available options can be
52
+ * collapsed, consider using a dropdown menu because it uses less space.
53
+ *
54
+ * Radio buttons should have the most commonly used option selected by default.
55
+ *
56
+ * ### Import
57
+ *
58
+ * ``` js
59
+ * import { Radio } from '@ntbjs/react-components/inputs'
60
+ * // or
61
+ * import Radio from '@ntbjs/react-components/inputs/Radio'
62
+ * ```
63
+ */
64
+ declare const Radio: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, keyof RadioOwnProps> & RadioOwnProps & React.RefAttributes<any>>;
65
+ export default Radio;
@@ -0,0 +1,11 @@
1
+ export declare const RadioLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
2
+ interface RadioStyleProps {
3
+ /** `checked` — `PropTypes.bool`, passed through as the checked-state affordance. */
4
+ $isChecked?: boolean;
5
+ /** `disabled` — `PropTypes.bool`. Leaks to the DOM; see above. */
6
+ disabled?: boolean;
7
+ /** `readOnly` — `PropTypes.bool`. Leaks to the DOM; see above. */
8
+ readOnly?: boolean;
9
+ }
10
+ export declare const Radio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>>, RadioStyleProps>, never>> & string;
11
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './Radio';
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ children?: any;
4
+ name: string;
5
+ /**
6
+ * Whether the switch is toggled on or off
7
+ */
8
+ checked?: boolean;
9
+ /**
10
+ * Whether the switch is toggled on by default
11
+ */
12
+ defaultChecked?: boolean;
13
+ /**
14
+ * Text displayed next to the switch
15
+ */
16
+ label?: string;
17
+ /**
18
+ * Whether the switch is toggled on
19
+ */
20
+ disabled?: boolean;
21
+ /**
22
+ * Whether the switch is displayed as read-only
23
+ */
24
+ readOnly?: boolean;
25
+ /**
26
+ * Text displayed underneath the switch
27
+ */
28
+ description?: string;
29
+ /**
30
+ * Whether there should be extra `margin` added between the switch and the description
31
+ */
32
+ spaciousDescription?: boolean;
33
+ /**
34
+ * Add extra classes to the HTML element
35
+ */
36
+ className?: string;
37
+ /**
38
+ * Custom CSS styling
39
+ */
40
+ style?: any;
41
+ /**
42
+ * Optional callback function for the `onChange` event
43
+ */
44
+ onChange?: (...args: any[]) => any;
45
+ /**
46
+ * Optional callback function for the `onBlur` event
47
+ */
48
+ onBlur?: (...args: any[]) => any;
49
+ };
50
+ /**
51
+ * The Switch allows the user to toggle an option.
52
+ *
53
+ * ### Import
54
+ *
55
+ * ``` js
56
+ * import { Switch } from '@ntbjs/react-components/inputs'
57
+ * // or
58
+ * import Switch from '@ntbjs/react-components/inputs/Switch'
59
+ * ```
60
+ */
61
+ declare const Switch: React.ForwardRefExoticComponent<Props & React.RefAttributes<any>>;
62
+ export default Switch;
@@ -0,0 +1,20 @@
1
+ interface SwitchStyleProps {
2
+ /** `disabled` — dims and blocks pointer events. Leaks to the DOM; see above. */
3
+ disabled?: boolean;
4
+ /** `readOnly` — dims and blocks pointer events. Leaks to the DOM; see above. */
5
+ readOnly?: boolean;
6
+ }
7
+ export declare const Switch: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, SwitchStyleProps>, never>> & string;
8
+ export declare const SwitchIndicator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
9
+ export declare const SwitchIndicatorButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
10
+ export declare const SwitchIndicatorLabelText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
11
+ export declare const SwitchLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>>, never>, never>> & string;
12
+ export declare const Description: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, {
13
+ /**
14
+ * `spaciousDescription` — `PropTypes.bool`. Lower-case `$spaciousdescription` by
15
+ * existing convention at both ends; renaming it would be a two-file change for no
16
+ * type benefit.
17
+ */
18
+ $spaciousdescription?: boolean;
19
+ }>, never>> & string;
20
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './Switch';