@ntbjs/react-components 2.0.13 → 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 -120
  163. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
  164. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +99 -285
  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,34 @@
1
+ /**
2
+ * Props of the one styled component in this file. Value types from
3
+ * `ActionButton.tsx`'s propTypes; all optional per §J.5 — and here that is not
4
+ * theoretical, `ActionButton.tsx` spreads `{...props}` onto this root, which is the
5
+ * measured TS2769 case.
6
+ *
7
+ * `disabled` is deliberately ABSENT: it is a real `ButtonHTMLAttributes` member, the
8
+ * component passes it, and the template only uses the `&:disabled` CSS pseudo-class
9
+ * rather than reading the prop. Nothing to declare. §J.9, first row.
10
+ */
11
+ export interface ActionButtonStyleProps {
12
+ /**
13
+ * `actionWidthHeight` — `PropTypes.array`, `[width, height]` in px, defaulted to
14
+ * `[40, 40]` BY THE COMPONENT (which is not a default here, so still optional).
15
+ * `number[]` rather than `[number, number]`: the propTypes accept any array and the
16
+ * template only ever indexes `[0]` and `[1]`.
17
+ *
18
+ * NOTE FOR THE `strictNullChecks` FLIP: these seven reads are UNGUARDED
19
+ * (`props.$actionWidthHeight[0]`, not `props.$actionWidthHeight?.[0]`), unlike every
20
+ * other transient prop in the converted files. They compile today because
21
+ * `strictNullChecks` is off; when it is turned on at the end of the migration this
22
+ * is the site that needs either `?.` plus a fallback or a required prop, and either
23
+ * is a behaviour question rather than a typing one — so it is recorded, not changed
24
+ * here. (`$backgroundColors` below is already read with `?.`.)
25
+ */
26
+ $actionWidthHeight?: number[];
27
+ /** `backgroundColors` — `PropTypes.arrayOf(PropTypes.string)`, `[dark, light]`. */
28
+ $backgroundColors?: string[];
29
+ /** `active` — `PropTypes.bool`. Locks the hover state. */
30
+ $active?: boolean;
31
+ /** `useShadow` — `PropTypes.bool`. Component defaults it to `false`. */
32
+ $useShadow?: boolean;
33
+ }
34
+ export declare const ActionButton: 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").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>, ActionButtonStyleProps>, never>> & string;
@@ -0,0 +1 @@
1
+ export { default } from './ActionButton';
@@ -0,0 +1,82 @@
1
+ import React from 'react';
2
+ import * as S from './Button.styled';
3
+ type ButtonOwnProps = {
4
+ /**
5
+ * On-click effect for the main button
6
+ */
7
+ onClickEffect?: (...args: any[]) => any;
8
+ /**
9
+ * Whether the button is a "single action button". For single action buttons,
10
+ * the entire button opens the dropdown menu, not just the arrow.
11
+ */
12
+ singleAction?: boolean;
13
+ /**
14
+ * Whether the button must have an active dropdown menu.
15
+ */
16
+ activeDropdown?: boolean;
17
+ /**
18
+ * An array containing nodes of the `ContextMenuItem` component
19
+ */
20
+ dropdownItems?: React.ReactNode;
21
+ /**
22
+ * Whether the button should be styled as a secondary button
23
+ */
24
+ secondary?: boolean;
25
+ /**
26
+ * Whether the button should be styled with borders
27
+ */
28
+ outlined?: boolean;
29
+ /**
30
+ * Whether the button should customize the border width
31
+ */
32
+ border?: number;
33
+ /**
34
+ * Whether the button should be of 100% width
35
+ */
36
+ block?: boolean;
37
+ /**
38
+ * Optional icon to be displayed on the left side of the button
39
+ */
40
+ icon?: React.ReactElement<any>;
41
+ /**
42
+ * Which size variation should be used
43
+ */
44
+ size?: 'x-small' | 'small' | 'normal' | 'large';
45
+ /**
46
+ * Whether the button should be disabled
47
+ */
48
+ disabled?: boolean;
49
+ /**
50
+ * Whether the button should be initiated in a loading state
51
+ */
52
+ loading?: boolean;
53
+ /**
54
+ * Optional custom classnames for the HTML element
55
+ */
56
+ className?: string;
57
+ /**
58
+ * Main content of the button
59
+ */
60
+ children: any;
61
+ /**
62
+ * Gap between arrow and text in single action button
63
+ */
64
+ singleActionGap?: number;
65
+ /**
66
+ * Custom min-width
67
+ */
68
+ width?: number;
69
+ };
70
+ /**
71
+ * Buttons communicate actions that users can take.
72
+ *
73
+ * ### Import
74
+ *
75
+ * ``` js
76
+ * import { Button } from '@ntbjs/react-components/inputs'
77
+ * // or
78
+ * import Button from '@ntbjs/react-components/inputs/Button'
79
+ * ```
80
+ */
81
+ declare const Button: React.ForwardRefExoticComponent<Omit<Omit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>, S.ButtonStyleProps>, never>, "ref">, keyof ButtonOwnProps> & ButtonOwnProps & React.RefAttributes<any>>;
82
+ export default Button;
@@ -0,0 +1,102 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * `size` — `PropTypes.oneOf(['x-small', 'small', 'normal', 'large'])`, component default
4
+ * `'normal'`. Closed on purpose (§J.6): `Button` and `ButtonContent` compare against
5
+ * three of the four members, so a mistyped size is TS2367 rather than a dead branch.
6
+ *
7
+ * IT HAS NO `$`, AND THAT IS A DEFECT. `size` is not a member of
8
+ * `ButtonHTMLAttributes` (it is an `<input>`/`<select>` attribute), which is why the
9
+ * five reads of it were TS2339, and `shouldForwardProp` forwards every non-`$` prop —
10
+ * so `size="normal"` is on every rendered `<button>` and every `ButtonContent`
11
+ * `<div>` today, and both are in the recorded render baseline. Fix = rename `$size` at
12
+ * both ends; removes a DOM attribute → C10 with its re-record. §E.4 third case.
13
+ */
14
+ type ButtonSize = 'x-small' | 'small' | 'normal' | 'large';
15
+ /**
16
+ * `dropdownItems` — `PropTypes.node`, an array of `ContextMenuItem`s.
17
+ *
18
+ * `ReactNode` and not `boolean`: the templates only ever test it for truthiness, but
19
+ * what is passed is the node itself, and recording what the code does is the rule
20
+ * (§J.6). It is transient, so it never reaches the DOM.
21
+ */
22
+ type DropdownItems = ReactNode;
23
+ /**
24
+ * `Button`'s props — nine of them, which is why they are a named interface here rather
25
+ * than inline. All optional per §J.5, and here that is load-bearing twice over:
26
+ * `Button.tsx` spreads `{...props}` onto this root, and it renders `S.Button` at three
27
+ * sites that pass different subsets (only the two dropdown sites pass
28
+ * `$singleactiongap`).
29
+ *
30
+ * `disabled` is deliberately ABSENT: on a `styled.button` it is a genuine
31
+ * `ButtonHTMLAttributes` member, so the read at `props.disabled &&` already typechecks
32
+ * and the attribute belongs on the element (§J.9, first row).
33
+ */
34
+ export interface ButtonStyleProps {
35
+ /** `border` — `PropTypes.number`, default `2`. Interpolated as `${…}px`, so a string
36
+ * here would already render `border: 2pxpx solid`. */
37
+ $border?: number;
38
+ /** `secondary` — `PropTypes.bool`. */
39
+ $secondary?: boolean;
40
+ /** `outlined` — `PropTypes.bool`. */
41
+ $outlined?: boolean;
42
+ /** `dropdownItems` — see `DropdownItems`. */
43
+ $dropdownItems?: DropdownItems;
44
+ /** `block` — `PropTypes.bool`, default `false`. Full-width. */
45
+ $block?: boolean;
46
+ /** `size` — see `ButtonSize`. Leaks to the DOM; see there. */
47
+ size?: ButtonSize;
48
+ /** `singleAction` — `PropTypes.bool`, default `false`. */
49
+ $singleaction?: boolean;
50
+ /** `singleActionGap` — `PropTypes.number`, default `34`. Interpolated as `${…}px`.
51
+ * Passed only at the two dropdown `S.Button` sites, which is one of the reasons
52
+ * every member here is optional. */
53
+ $singleactiongap?: number;
54
+ /** `width` — `PropTypes.number`, the custom `min-width`, interpolated as `${…}px`. */
55
+ $width?: number;
56
+ }
57
+ export declare const Button: 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").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>, ButtonStyleProps>, never>> & string;
58
+ export declare const ButtonContent: 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>>, {
59
+ /** `size` — see `ButtonSize`. Leaks onto this `<div>` too; see there. */
60
+ size?: ButtonSize;
61
+ /** `loadingState` — the component's own state, so `boolean`. */
62
+ $loading?: boolean;
63
+ /** `singleAction` — passed only at the single-action site. */
64
+ $singleaction?: boolean;
65
+ }>, never>> & string;
66
+ export declare const LoadingIndicator: 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>>, {
67
+ $loading?: boolean;
68
+ }>, never>> & string;
69
+ export declare const LoadingIndicatorSvg: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").SVGProps<SVGSVGElement>, import("react").SVGProps<SVGSVGElement>>, never>, never>> & string;
70
+ export declare const LoadingIndicatorSvgCircle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").SVGProps<SVGCircleElement>, import("react").SVGProps<SVGCircleElement>>, never>, never>> & string;
71
+ export declare const ButtonWrapper: 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<HTMLSpanElement>, HTMLSpanElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, {
72
+ $block?: boolean;
73
+ }>, never>> & string;
74
+ /** The dropdown-state props the three container `<div>`s share. */
75
+ interface DropdownContainerStyleProps {
76
+ /** `activeDropdown` — `PropTypes.bool`, default `false`. */
77
+ $activeDropdown?: boolean;
78
+ /** `dropdownItems` — see `DropdownItems`. */
79
+ $dropdownItems?: DropdownItems;
80
+ }
81
+ export declare const MainButtonWrapper: 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>>, DropdownContainerStyleProps & {
82
+ /** `block` — full-width. */
83
+ $block?: boolean;
84
+ /** `outlined` — suppresses the wrapper background. */
85
+ $outlined?: boolean;
86
+ /** `secondary` — picks the grey background over the emerald one. */
87
+ $secondary?: boolean;
88
+ }>, never>> & string;
89
+ export declare const MainButtonContainer: 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>>, DropdownContainerStyleProps & {
90
+ /** `block` — full-width. */
91
+ $block?: boolean;
92
+ /** DEAD READ, see above. Nothing passes it; `$outlined` is what arrives. */
93
+ outlined?: boolean;
94
+ }>, never>> & string;
95
+ export declare const MainButtonContainerSingle: 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>>, DropdownContainerStyleProps & {
96
+ /** DEAD READ, see above: the single-action layout never applies. */
97
+ $singleaction?: boolean;
98
+ }>, never>> & string;
99
+ export declare const DropdownButtonContainer: 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>>, {
100
+ $singleaction?: boolean;
101
+ }>, never>> & string;
102
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './Button';
@@ -0,0 +1,92 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ /**
4
+ * Whether the checkbox is checked
5
+ */
6
+ checked?: boolean;
7
+ /**
8
+ * Whether the checkbox should be checked or unchecked by default
9
+ */
10
+ defaultChecked?: boolean;
11
+ /**
12
+ * The checkbox' label
13
+ */
14
+ label?: string | React.ReactElement<any>;
15
+ /**
16
+ * Whether the checkbox is disabled
17
+ */
18
+ disabled?: boolean;
19
+ /**
20
+ * Whether the checkbox is read-only
21
+ */
22
+ readOnly?: boolean;
23
+ /**
24
+ * The checkbox' name
25
+ */
26
+ name?: string;
27
+ /**
28
+ * The checkbox' value
29
+ *
30
+ * `string | number`, not the `PropTypes.string` this replaces. `MultiLevelCheckbox`
31
+ * renders `<Checkbox value={node.value} …>` and a node's value is
32
+ * `MultiLevelCheckboxNodeValue = string | number`, so a numeric value reaches this
33
+ * prop through a public API today and `oneOf`-style validation never noticed because
34
+ * the two components' propTypes were never compared. The value is forwarded
35
+ * unchanged onto `<input type="checkbox">`, whose own React type is
36
+ * `string | number | readonly string[]`, so this widening records reality and emits
37
+ * identical markup.
38
+ */
39
+ value?: string | number;
40
+ /**
41
+ * Description of the checkbox
42
+ */
43
+ description?: string;
44
+ /**
45
+ * Whether there's an error. Error message can be passed as a `string` to be displayed below the checkbox.
46
+ */
47
+ error?: boolean | string;
48
+ /**
49
+ * Whether the checkbox is indeterminate. This will display a dash in the checkbox instead of the default checkmark.
50
+ */
51
+ indeterminate?: boolean;
52
+ /**
53
+ * Mutes the color of the visual checkbox – Does not mute the label or other parts of the Checkbox
54
+ */
55
+ muted?: boolean;
56
+ /**
57
+ * On-change effect
58
+ */
59
+ onChange?: (...args: any[]) => any;
60
+ /**
61
+ * On-blur effect
62
+ */
63
+ onBlur?: (...args: any[]) => any;
64
+ /**
65
+ * Optional class name for the HTML element
66
+ */
67
+ className?: string;
68
+ /**
69
+ * Optional in-line styling for the HTML element
70
+ */
71
+ style?: any;
72
+ /**
73
+ * Visual variant. `green` (default) uses emerald fill. `black` uses themed black/white square (24px, rounded), inverted check.
74
+ */
75
+ variant?: 'green' | 'black';
76
+ };
77
+ /**
78
+ * Checkboxes allow the user to select one or more items from a set.
79
+ *
80
+ * If you have a single option, avoid using a checkbox and use an on/off switch (`Switch` component) instead.
81
+ *
82
+ *
83
+ * ### Import
84
+ *
85
+ * ``` js
86
+ * import { Checkbox } from '@ntbjs/react-components/inputs'
87
+ * // or
88
+ * import Checkbox from '@ntbjs/react-components/inputs/Checkbox'
89
+ * ```
90
+ */
91
+ declare const Checkbox: React.ForwardRefExoticComponent<Props & React.RefAttributes<any>>;
92
+ export default Checkbox;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * `variant` — `PropTypes.oneOf(['green', 'black'])`, carried as `$variant` by both
3
+ * `Checkbox` and `CheckboxLabel`. Closed on purpose (§J.6): both templates compare
4
+ * `=== 'black'`, and with a closed union a mistyped variant name is TS2367 rather
5
+ * than a branch that silently never fires.
6
+ */
7
+ type CheckboxVariant = 'green' | 'black';
8
+ export declare const Checkbox: 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>>, {
9
+ $variant?: CheckboxVariant;
10
+ }>, never>> & string;
11
+ export declare const CheckIcon: 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;
12
+ export declare const IndeterminateCheckIcon: 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;
13
+ interface CheckboxLabelStyleProps {
14
+ /** `muted` — `PropTypes.bool`. Fades the `&::before` box only. Leaks to the DOM. */
15
+ muted?: boolean;
16
+ /** `readOnly` — `PropTypes.bool`. Leaks to the DOM. */
17
+ readOnly?: boolean;
18
+ /** `disabled` — `PropTypes.bool`. Leaks to the DOM. */
19
+ disabled?: boolean;
20
+ /** `variant` — see `CheckboxVariant`. Properly transient. */
21
+ $variant?: CheckboxVariant;
22
+ }
23
+ export declare const CheckboxLabel: 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>>, CheckboxLabelStyleProps>, never>> & string;
24
+ export declare const CheckboxVisualLabel: 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;
25
+ 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<HTMLParagraphElement>, HTMLParagraphElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>>, {
26
+ /**
27
+ * `error` — the component derives `hasError` (`isBoolean(error) ? error :
28
+ * !isEmpty(error)`) and passes that, so `boolean` and not the
29
+ * `bool | string` that `error`'s own propTypes allow.
30
+ */
31
+ $error?: boolean;
32
+ }>, never>> & string;
33
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './Checkbox';
@@ -0,0 +1,242 @@
1
+ import React from 'react';
2
+ import * as S from './CompactAutocompleteSelect.styled';
3
+ export type CompactAutocompleteSelectOwnProps = {
4
+ /**
5
+ * The label of the input field – leave `undefined` to hide the label
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. "Search categories..."
10
+ */
11
+ placeholder?: string;
12
+ /**
13
+ * `Array` of `objects` that populate the select menu. This is only needed
14
+ * when asynchronous option fetching with the `loadOptions` prop is not used.
15
+ *
16
+ * **Note:**
17
+ * <br />This will be overridden by the `loadOptions` prop if both props are set.
18
+ */
19
+ availableOptions?: any[];
20
+ /**
21
+ * `Array` of `objects` containing the selected options.
22
+ */
23
+ selectedOption?: any;
24
+ /**
25
+ * Function with a `Promise` returning filtered options.
26
+ *
27
+ * See [Asynchronous fetching/filtering with pagination](#asynchronous-fetchingfiltering-with-pagination)
28
+ * for details.
29
+ *
30
+ * **Note:**
31
+ * <br />This will override the `availableOptions` prop if both props are set.
32
+ */
33
+ loadOptions?: (...args: any[]) => any;
34
+ /**
35
+ * Function for custom "Loading..." message while waiting for the first page
36
+ * from `loadOptions` to resolve. Defaults to "Loading..." if no function is provided.
37
+ */
38
+ loadingMessageFunc?: (...args: any[]) => any;
39
+ /**
40
+ * Callback function for formatting the message displayed in the dropdown when there
41
+ * are no matching options, and the user has permission to create new options.
42
+ * The callback function will be given the current input value as an argument.
43
+ */
44
+ createNewOptionMessageFunc?: (...args: any[]) => any;
45
+ /**
46
+ * If the list of options is empty, or if the current input value doesn't match
47
+ * any of the available options and the user doesn't have permission to add options,
48
+ * this function will be called and passed the current input value as an argument.
49
+ */
50
+ noOptionsMessageFunc?: (...args: any[]) => any;
51
+ /**
52
+ * Whether the value is read only
53
+ */
54
+ readOnly?: boolean;
55
+ /**
56
+ * Displays a grey background to show that value is editable
57
+ */
58
+ edit?: boolean;
59
+ /**
60
+ * Whether the component is hidden or visible.
61
+ */
62
+ hidden?: boolean;
63
+ /**
64
+ * There is an error present – 'error be prioritized over warnings if both are set to 'true'.
65
+ */
66
+ error?: boolean | string;
67
+ /**
68
+ * There is a warning present.
69
+ */
70
+ warning?: boolean | string;
71
+ /**
72
+ * Callback function for sending updates to the backend whenever the selected values are updated.
73
+ * See [Update handling](#update-handling) for details.
74
+ */
75
+ onUpdateCallback?: (...args: any[]) => any;
76
+ /**
77
+ * Whether the user have permission to create new options
78
+ */
79
+ creatable?: boolean;
80
+ /**
81
+ * Whether the multi-select should be disabled.
82
+ * The user will not be able to trigger the on-click effect of the selected options.
83
+ */
84
+ disabled?: boolean;
85
+ /**
86
+ * Define the type based on error, warning, loading and success.
87
+ */
88
+ type?: '' | 'error' | 'warning' | 'instructions-warning' | 'loading' | 'success';
89
+ /**
90
+ * Description ToolTip text.
91
+ */
92
+ descriptionToolTip?: string;
93
+ /**
94
+ * Icon element – E.g: `icon={<Spinner />}`
95
+ */
96
+ loadingIcon?: React.ReactElement<any>;
97
+ /**
98
+ * Icon element – E.g: `icon={<Check />}`
99
+ */
100
+ successIcon?: React.ReactElement<any>;
101
+ };
102
+ export type CompactAutocompleteSelectProps = Omit<React.ComponentPropsWithoutRef<typeof S.AsyncCreatableAutocompleteSelect>, keyof CompactAutocompleteSelectOwnProps> & CompactAutocompleteSelectOwnProps;
103
+ /**
104
+ * Select input control with autocomplete, async and creatable support.
105
+ *
106
+ * This control allows users to search through a predefined set of options, asynchronously load additional options,
107
+ * and even create new options on-the-fly. It combines the benefits of autocomplete functionality,
108
+ * asynchronous data fetching, and creatable option support.
109
+ *
110
+ * The component uses [react-select](https://react-select.com/) for the main select functionality,
111
+ * with [react-select-async-paginate](https://www.npmjs.com/package/react-select-async-paginate) for pagination.
112
+ *
113
+ * <br /> ### Import
114
+ *
115
+ * ``` js
116
+ * import { CompactAutocompleteSelect } from '@ntbjs/react-components/inputs'
117
+ * // or
118
+ * import CompactAutocompleteSelect from '@ntbjs/react-components/inputs/CompactAutocompleteSelect'
119
+ * ```
120
+ *
121
+ * <br /> ## Option `object` format
122
+ * Options are represented by an `Array` of `objects` with the following format:
123
+ *
124
+ * ``` js
125
+ * {
126
+ * value: "Example",
127
+ * label: "Example"
128
+ * }
129
+ * ```
130
+ * The `label` is what will visible to the end-user. Whether `value` and `label`
131
+ * should be different will depend on your use-case, but they are not required to.
132
+ *
133
+ * <br /> ## Update handling
134
+ * Changes from the end-user to the selected/available options can be handled with a callback function
135
+ * passed through the `onUpdateCallback` prop, which is triggered any time the selected values change.
136
+ *
137
+ * The callback function will be passed two arguments:
138
+ * * `action: string`
139
+ * * `updatedOption: object`
140
+ *
141
+ * <br />#### `action`
142
+ * A `string` indicating what kind of update was made.
143
+ *
144
+ * The possible values of `action` are:
145
+ * * `create-option`: an option that didn't exist in the original list of available options were added
146
+ * * `select-option`: an option was selected
147
+ * * `deselect-option`: an option was de-selected by clicking the X in the dropdown menu
148
+ * * `remove-value`: an option was de-selected by clicking the X on the option label/box
149
+ * * `pop-value`: an option was de-selected with backspace
150
+ * * `clear`: all options were de-selected by clicking the clear indicator (not currently in use)
151
+ *
152
+ * <br />#### `updatedOption`
153
+ * Option `object`of the updated option:
154
+ *
155
+ * In addition to the default `value` and `label` keys, an `__isNew__` flag will be present if the option was
156
+ * not part of the original list of available options, i.e. created by the user in the current "session".
157
+ * This is the case regardless of whether the list is provided through `availableOptions` or
158
+ * asynchronously through `loadOptions`.
159
+ *
160
+ *
161
+ * <br />## Asynchronous fetching/filtering with pagination
162
+ * The list of available options can be fetched and filtered asynchronously with a `Promise`
163
+ * passed through the `loadOptions` prop.
164
+ *
165
+ * It will be passed two arguments:
166
+ *
167
+ * * `inputValue: string`: current input value/search
168
+ * * `prevOptions: Array`: previously loaded options for the current search
169
+ *
170
+ * The function is triggered and the first page is fetched when the dropdown menu opens.
171
+ * Whenever the user scrolls down to the bottom of the list, `loadOptions` will
172
+ * be triggered again to fetch the next page.
173
+ *
174
+ * The `Promise` should return an `object` with the following keys:
175
+ *
176
+ * ``` js
177
+ * {
178
+ * options: Array,
179
+ * hasMore: boolean
180
+ * }
181
+ * ```
182
+ *
183
+ * `options` should contain the current page of options. It will be concatenated to the previous
184
+ * set of options automatically. The `hasMore` flag indicates whether there is another page to be fetched.
185
+ *
186
+ * **Example:**
187
+ *
188
+ * ``` js
189
+ *
190
+ * const availableOptions = [
191
+ * { value: "Example 1", label: "Example 1" },
192
+ * ...
193
+ * { value: "Example N", label: "Example N" }
194
+ * ];
195
+ *
196
+ * const filterOptions = inputValue => {
197
+ * return availableOptions.filter(option => {
198
+ * return option.label.toLowerCase().includes(inputValue.toLowerCase());
199
+ * });
200
+ * };
201
+ *
202
+ * const loadOptionsFunc = (inputValue, prevOptions) => {
203
+ * const currentLength = prevOptions.length;
204
+ * const pageLength = 10;
205
+ *
206
+ * let filteredOptions;
207
+ *
208
+ * if (inputValue) {
209
+ * filteredOptions = filterOptions(inputValue);
210
+ * } else {
211
+ * filteredOptions = availableOptions;
212
+ * }
213
+ *
214
+ * const hasMore = filteredOptions.length > currentLength + pageLength;
215
+ * const slicedOptions = filteredOptions.slice(currentLength, currentLength + pageLength);
216
+ *
217
+ * return {
218
+ * options: slicedOptions,
219
+ * hasMore
220
+ * };
221
+ * };
222
+ *
223
+ * const loadOptions = (inputValue, prevOptions) => {
224
+ * return new Promise(resolve => {
225
+ * resolve(loadOptionsFunc(inputValue, prevOptions));
226
+ * });
227
+ * };
228
+ * ```
229
+ *
230
+ * While waiting for the `Promise` to resolve, the component will be in a loading state.
231
+ * The loading state is showcased in the "Primary With Fetching Timeout" Story.
232
+ *
233
+ * <br />#### Without asynchronous fetching/filtering
234
+ * If you wish to not use asynchronous fetching/filtering, leave the `loadOptions` prop undefined
235
+ * and pass the `Array` of all available options to the `availableOptions` prop instead.
236
+ * The component will use the built-in filtering on `label` from `react-select`, and the options
237
+ * will not be paginated.
238
+ *
239
+ * <br />
240
+ */
241
+ declare const CompactAutocompleteSelect: React.ForwardRefExoticComponent<CompactAutocompleteSelectProps & React.RefAttributes<any>>;
242
+ export default CompactAutocompleteSelect;