@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
@@ -6,284 +6,66 @@ const shouldForwardProp = prop => {
6
6
  };
7
7
  const Button = styled.button.withConfig({
8
8
  shouldForwardProp
9
- }).attrs(applyDefaultTheme)`
10
- position: relative;
11
- border-radius: 3px;
12
- font-family: inherit;
13
- font-size: 0.875rem;
14
- font-weight: 400;
15
- padding: 12px 16px;
16
- cursor: pointer;
17
- background: ${props => props.theme.getColor('emerald-500')};
18
- border: ${props => props.$border}px solid ${props => props.theme.getColor('emerald-500')};
19
- transition:
20
- all 250ms,
21
- opacity 200ms;
22
-
23
- &:hover,
24
- &.dropdown-is-active {
25
- background: #296c58;
26
- border-color: #296c58;
27
- }
28
-
29
- ${props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('white'))}
30
-
31
- && {
32
- ${props => props.$secondary && css`
33
- background: ${props => props.theme.getColor('gray-200')};
34
- border-color: ${props => props.theme.getColor('gray-200')};
35
-
36
- ${props.theme.themeProp('color', props.theme.getColor('gray-700'), props.theme.getColor('gray-700'))}
37
-
38
- &:hover,
39
- &.dropdown-is-active {
40
- background: ${props => props.theme.getColor('gray-300')};
41
- border-color: ${props => props.theme.getColor('gray-300')};
42
- }
43
- `};
44
- }
45
-
46
- && {
47
- ${props => props.$outlined && css`
48
- background: transparent;
49
- transition: none;
50
-
51
- ${props.theme.themeProp('border-color', props.theme.getColor('emerald-400'), props.theme.getColor('emerald-500'))}
52
-
53
- ${props.theme.themeProp('color', props.theme.getColor('emerald-400'), props.theme.getColor('emerald-500'))}
54
-
55
- &:hover,
56
- &.dropdown-is-active {
57
- background-color: #296c58;
58
-
59
- ${props.theme.themeProp('border-color', props.theme.getColor('emerald-600'), props.theme.getColor('emerald-600'))}
60
-
61
- ${props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-200'))}
62
- }
63
- `};
64
- }
65
-
66
- && {
67
- ${props => props.$outlined && props.$secondary && css`
68
- ${props.theme.themeProp('border-color', props.theme.getColor('gray-400'), props.theme.getColor('gray-700'))}
69
-
70
- ${props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-700'))}
71
-
72
- &:hover,
73
- &.dropdown-is-active {
74
- background: ${props.theme.getColor('gray-300')};
75
-
76
- ${props.theme.themeProp('border-color', props.theme.getColor('gray-300'), props.theme.getColor('gray-300'))}
77
-
78
- ${props.theme.themeProp('color', props.theme.getColor('gray-700'), props.theme.getColor('gray-700'))}
79
- }
80
- `};
81
- }
82
-
83
- && {
84
- ${props => props.$outlined && props.$secondary && props.$dropdownItems && css`
85
- &:hover,
86
- &.dropdown-is-active {
87
- ${props.theme.themeProp('border-color', props.theme.getColor('gray-300'), props.theme.getColor('gray-300'))}
88
- }
89
- `};
90
- }
91
-
92
- ${props => props.$block && css`
93
- width: 100%;
94
- `};
95
-
96
- ${props => props.disabled && css`
97
- opacity: 0.5;
98
- cursor: not-allowed;
99
- pointer-events: none;
100
- `};
101
-
102
- ${props => props.size === 'x-small' && css`
103
- padding: 1px 16px;
104
- height: 24px;
105
- `};
106
-
107
- ${props => props.size === 'small' && css`
108
- padding: 6px 16px;
109
- `};
110
-
111
- ${props => props.size === 'large' && css`
112
- padding: 16px 16px;
113
- `};
114
-
115
- ${props => props.$singleaction && css`
116
- display: flex;
117
- align-items: center;
118
- gap: ${props.$singleactiongap}px;
119
- border-radius: 3px !important;
120
- transition:
121
- all 250ms,
122
- opacity 200ms;
123
- `};
124
-
125
- ${props => props.$width && css`
126
- min-width: ${props.$width}px;
127
- justify-content: center;
128
- `};
129
- `;
9
+ }).attrs(applyDefaultTheme).withConfig({
10
+ displayName: "Buttonstyled__Button",
11
+ componentId: "sc-1w003g-0"
12
+ })(["position:relative;border-radius:3px;font-family:inherit;font-size:0.875rem;font-weight:400;padding:12px 16px;cursor:pointer;background:", ";border:", "px solid ", ";transition:all 250ms,opacity 200ms;&:hover,&.dropdown-is-active{background:#296c58;border-color:#296c58;}", " &&{", ";}&&{", ";}&&{", ";}&&{", ";}", ";", ";", ";", ";", ";", ";", ";"], props => props.theme.getColor('emerald-500'), props => props.$border, props => props.theme.getColor('emerald-500'), props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('white')), props => props.$secondary && css(["background:", ";border-color:", ";", " &:hover,&.dropdown-is-active{background:", ";border-color:", ";}"], props => props.theme.getColor('gray-200'), props => props.theme.getColor('gray-200'), props.theme.themeProp('color', props.theme.getColor('gray-700'), props.theme.getColor('gray-700')), props => props.theme.getColor('gray-300'), props => props.theme.getColor('gray-300')), props => props.$outlined && css(["background:transparent;transition:none;", " ", " &:hover,&.dropdown-is-active{background-color:#296c58;", " ", "}"], props.theme.themeProp('border-color', props.theme.getColor('emerald-400'), props.theme.getColor('emerald-500')), props.theme.themeProp('color', props.theme.getColor('emerald-400'), props.theme.getColor('emerald-500')), props.theme.themeProp('border-color', props.theme.getColor('emerald-600'), props.theme.getColor('emerald-600')), props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-200'))), props => props.$outlined && props.$secondary && css(["", " ", " &:hover,&.dropdown-is-active{background:", ";", " ", "}"], props.theme.themeProp('border-color', props.theme.getColor('gray-400'), props.theme.getColor('gray-700')), props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-700')), props.theme.getColor('gray-300'), props.theme.themeProp('border-color', props.theme.getColor('gray-300'), props.theme.getColor('gray-300')), props.theme.themeProp('color', props.theme.getColor('gray-700'), props.theme.getColor('gray-700'))), props => props.$outlined && props.$secondary && props.$dropdownItems && css(["&:hover,&.dropdown-is-active{", "}"], props.theme.themeProp('border-color', props.theme.getColor('gray-300'), props.theme.getColor('gray-300'))), props => props.$block && css(["width:100%;"]), props => props.disabled && css(["opacity:0.5;cursor:not-allowed;pointer-events:none;"]), props => props.size === 'x-small' && css(["padding:1px 16px;height:24px;"]), props => props.size === 'small' && css(["padding:6px 16px;"]), props => props.size === 'large' && css(["padding:16px 16px;"]), props => props.$singleaction && css(["display:flex;align-items:center;gap:", "px;border-radius:3px !important;transition:all 250ms,opacity 200ms;"], props.$singleactiongap), props => props.$width && css(["min-width:", "px;justify-content:center;"], props.$width));
130
13
  const ButtonContent = styled.div.withConfig({
131
14
  shouldForwardProp
132
- }).attrs(applyDefaultTheme)`
133
- display: flex;
134
- justify-content: center;
135
- align-items: center;
136
- transform: scale(1);
137
- opacity: 1;
138
- transition: all 200ms;
139
-
140
- > svg {
141
- width: 100%;
142
- max-width: 16px;
143
- max-height: 16px;
144
- margin-right: 8px;
145
-
146
- ${props => props.size === 'small' && css`
147
- max-width: 13px;
148
- max-height: 13px;
149
- `};
150
-
151
- ${props => props.size === 'x-small' && css`
152
- max-width: 11px;
153
- max-height: 11px;
154
- `};
155
- }
156
-
157
- ${props => props.$loading && css`
158
- transform: scale(0.95);
159
- opacity: 0;
160
- `}
161
-
162
- ${props => props.$singleaction && css`
163
- svg {
164
- width: 100% !important;
165
- height: 100% !important;
166
- margin-right: 24px;
167
- }
168
- `};
169
- `;
15
+ }).attrs(applyDefaultTheme).withConfig({
16
+ displayName: "Buttonstyled__ButtonContent",
17
+ componentId: "sc-1w003g-1"
18
+ })(["display:flex;justify-content:center;align-items:center;transform:scale(1);opacity:1;transition:all 200ms;> svg{width:100%;max-width:16px;max-height:16px;margin-right:8px;", ";", ";}", " ", ";"], props => props.size === 'small' && css(["max-width:13px;max-height:13px;"]), props => props.size === 'x-small' && css(["max-width:11px;max-height:11px;"]), props => props.$loading && css(["transform:scale(0.95);opacity:0;"]), props => props.$singleaction && css(["svg{width:100% !important;height:100% !important;margin-right:24px;}"]));
170
19
  const LoadingIndicator = styled.div.withConfig({
171
20
  shouldForwardProp
172
- }).attrs(applyDefaultTheme)`
173
- position: absolute;
174
- height: 100%;
175
- width: 100%;
176
- top: 0;
177
- left: 0;
178
- padding: 4px;
179
- background: inherit;
180
- opacity: 0;
181
- transition: opacity 200ms;
182
- box-sizing: border-box;
183
-
184
- ${props => props.$loading && css`
185
- opacity: 1;
186
- `}
187
- `;
21
+ }).attrs(applyDefaultTheme).withConfig({
22
+ displayName: "Buttonstyled__LoadingIndicator",
23
+ componentId: "sc-1w003g-2"
24
+ })(["position:absolute;height:100%;width:100%;top:0;left:0;padding:4px;background:inherit;opacity:0;transition:opacity 200ms;box-sizing:border-box;", ""], props => props.$loading && css(["opacity:1;"]));
188
25
  const LoadingIndicatorSvg = styled.svg.withConfig({
189
26
  shouldForwardProp
190
- }).attrs(applyDefaultTheme)`
191
- height: 100%;
192
- color: inherit;
193
- transform: rotate(-88deg);
194
- `;
27
+ }).attrs(applyDefaultTheme).withConfig({
28
+ displayName: "Buttonstyled__LoadingIndicatorSvg",
29
+ componentId: "sc-1w003g-3"
30
+ })(["height:100%;color:inherit;transform:rotate(-88deg);"]);
195
31
  const LoadingIndicatorSvgCircle = styled.circle.withConfig({
196
32
  shouldForwardProp
197
- }).attrs(applyDefaultTheme)`
198
- transition: stroke-dashoffset 300ms linear;
199
- stroke-dasharray: 113;
200
- `;
33
+ }).attrs(applyDefaultTheme).withConfig({
34
+ displayName: "Buttonstyled__LoadingIndicatorSvgCircle",
35
+ componentId: "sc-1w003g-4"
36
+ })(["transition:stroke-dashoffset 300ms linear;stroke-dasharray:113;"]);
201
37
  const ButtonWrapper = styled.span.withConfig({
202
38
  shouldForwardProp
203
- }).attrs(applyDefaultTheme)`
204
- white-space: nowrap;
205
- display: flex;
206
- ${props => props.$block && css`
207
- width: 100%;
208
- `}
209
- `;
39
+ }).attrs(applyDefaultTheme).withConfig({
40
+ displayName: "Buttonstyled__ButtonWrapper",
41
+ componentId: "sc-1w003g-5"
42
+ })(["white-space:nowrap;display:flex;", ""], props => props.$block && css(["width:100%;"]));
210
43
  const MainButtonWrapper = styled.div.withConfig({
211
44
  shouldForwardProp
212
- }).attrs(applyDefaultTheme)`
213
- border-radius: 3px;
214
- ${props => props.$block && css`
215
- width: 100%;
216
- display: flex;
217
- `}
218
-
219
- ${props => {
220
- return (props.$activeDropdown || props.$dropdownItems) && !props.$outlined && css`
221
- background: ${props.$secondary ? props.theme.getColor('gray-200') : props.theme.getColor('emerald-500')};
222
- `;
223
- }};
224
- `;
45
+ }).attrs(applyDefaultTheme).withConfig({
46
+ displayName: "Buttonstyled__MainButtonWrapper",
47
+ componentId: "sc-1w003g-6"
48
+ })(["border-radius:3px;", " ", ";"], props => props.$block && css(["width:100%;display:flex;"]), props => {
49
+ return (props.$activeDropdown || props.$dropdownItems) && !props.$outlined && css(["background:", ";"], props.$secondary ? props.theme.getColor('gray-200') : props.theme.getColor('emerald-500'));
50
+ });
225
51
  const MainButtonContainer = styled.div.withConfig({
226
52
  shouldForwardProp
227
- }).attrs(applyDefaultTheme)`
228
- display: inline-block;
229
-
230
- ${props => props.$block && css`
231
- flex: 1;
232
- width: 100%;
233
- `}
234
-
235
- button {
236
- ${props => (props.$activeDropdown || props.$dropdownItems) && css`
237
- border-bottom-right-radius: 0;
238
- border-top-right-radius: 0;
239
- `};
240
-
241
- ${props => (props.$activeDropdown || props.$dropdownItems) && props.outlined && css`
242
- border-right: none;
243
- `};
244
- }
245
- `;
53
+ }).attrs(applyDefaultTheme).withConfig({
54
+ displayName: "Buttonstyled__MainButtonContainer",
55
+ componentId: "sc-1w003g-7"
56
+ })(["display:inline-block;", " button{", ";", ";}"], props => props.$block && css(["flex:1;width:100%;"]), props => (props.$activeDropdown || props.$dropdownItems) && css(["border-bottom-right-radius:0;border-top-right-radius:0;"]), props => (props.$activeDropdown || props.$dropdownItems) && props.outlined && css(["border-right:none;"]));
246
57
  const MainButtonContainerSingle = styled.div.withConfig({
247
58
  shouldForwardProp
248
- }).attrs(applyDefaultTheme)`
249
- display: inline-block;
250
- width: 100%;
251
- ${props => props.$singleaction && css`
252
- display: flex;
253
- align-items: center;
254
- border-radius: 3px !important;
255
- transition:
256
- all 250ms,
257
- opacity 200ms;
258
- `};
259
-
260
- button {
261
- ${props => (props.$activeDropdown || props.$dropdownItems) && css`
262
- border-bottom-right-radius: 0;
263
- border-top-right-radius: 0;
264
- `};
265
- }
266
- `;
59
+ }).attrs(applyDefaultTheme).withConfig({
60
+ displayName: "Buttonstyled__MainButtonContainerSingle",
61
+ componentId: "sc-1w003g-8"
62
+ })(["display:inline-block;width:100%;", ";button{", ";}"], props => props.$singleaction && css(["display:flex;align-items:center;border-radius:3px !important;transition:all 250ms,opacity 200ms;"]), props => (props.$activeDropdown || props.$dropdownItems) && css(["border-bottom-right-radius:0;border-top-right-radius:0;"]));
267
63
  const DropdownButtonContainer = styled.div.withConfig({
268
64
  shouldForwardProp
269
- }).attrs(applyDefaultTheme)`
270
- display: inline-block;
271
-
272
- button {
273
- border-bottom-left-radius: 0;
274
- border-top-left-radius: 0;
275
-
276
- ${props => !props.$singleaction && 'border-left: none'};
277
- }
278
-
279
- svg {
280
- color: inherit;
281
- height: 7px;
282
- width: 12px;
283
-
284
- ${props => !props.$singleaction && 'margin-bottom: 1px'};
285
- }
286
- `;
65
+ }).attrs(applyDefaultTheme).withConfig({
66
+ displayName: "Buttonstyled__DropdownButtonContainer",
67
+ componentId: "sc-1w003g-9"
68
+ })(["display:inline-block;button{border-bottom-left-radius:0;border-top-left-radius:0;", ";}svg{color:inherit;height:7px;width:12px;", ";}"], props => !props.$singleaction && 'border-left: none', props => !props.$singleaction && 'margin-bottom: 1px');
287
69
 
288
70
  export { Button, ButtonContent, ButtonWrapper, DropdownButtonContainer, LoadingIndicator, LoadingIndicatorSvg, LoadingIndicatorSvgCircle, MainButtonContainer, MainButtonContainerSingle, MainButtonWrapper };
289
71
  //# sourceMappingURL=Button.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.styled.js","sources":["../../../src/components/inputs/Button/Button.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const Button = styled.button\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n border-radius: 3px;\n font-family: inherit;\n font-size: 0.875rem;\n font-weight: 400;\n padding: 12px 16px;\n cursor: pointer;\n background: ${props => props.theme.getColor('emerald-500')};\n border: ${props => props.$border}px solid ${props => props.theme.getColor('emerald-500')};\n transition:\n all 250ms,\n opacity 200ms;\n\n &:hover,\n &.dropdown-is-active {\n background: #296c58;\n border-color: #296c58;\n }\n\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('white'))}\n\n && {\n ${props =>\n props.$secondary &&\n css`\n background: ${props => props.theme.getColor('gray-200')};\n border-color: ${props => props.theme.getColor('gray-200')};\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-700')\n )}\n\n &:hover,\n &.dropdown-is-active {\n background: ${props => props.theme.getColor('gray-300')};\n border-color: ${props => props.theme.getColor('gray-300')};\n }\n `};\n }\n\n && {\n ${props =>\n props.$outlined &&\n css`\n background: transparent;\n transition: none;\n\n ${props.theme.themeProp(\n 'border-color',\n props.theme.getColor('emerald-400'),\n props.theme.getColor('emerald-500')\n )}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('emerald-400'),\n props.theme.getColor('emerald-500')\n )}\n\n &:hover,\n &.dropdown-is-active {\n background-color: #296c58;\n\n ${props.theme.themeProp(\n 'border-color',\n props.theme.getColor('emerald-600'),\n props.theme.getColor('emerald-600')\n )}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-200')\n )}\n }\n `};\n }\n\n && {\n ${props =>\n props.$outlined &&\n props.$secondary &&\n css`\n ${props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-700')\n )}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n\n &:hover,\n &.dropdown-is-active {\n background: ${props.theme.getColor('gray-300')};\n\n ${props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-300')\n )}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-700')\n )}\n }\n `};\n }\n\n && {\n ${props =>\n props.$outlined &&\n props.$secondary &&\n props.$dropdownItems &&\n css`\n &:hover,\n &.dropdown-is-active {\n ${props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-300')\n )}\n }\n `};\n }\n\n ${props =>\n props.$block &&\n css`\n width: 100%;\n `};\n\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n `};\n\n ${props =>\n props.size === 'x-small' &&\n css`\n padding: 1px 16px;\n height: 24px;\n `};\n\n ${props =>\n props.size === 'small' &&\n css`\n padding: 6px 16px;\n `};\n\n ${props =>\n props.size === 'large' &&\n css`\n padding: 16px 16px;\n `};\n\n ${props =>\n props.$singleaction &&\n css`\n display: flex;\n align-items: center;\n gap: ${props.$singleactiongap}px;\n border-radius: 3px !important;\n transition:\n all 250ms,\n opacity 200ms;\n `};\n\n ${props =>\n props.$width &&\n css`\n min-width: ${props.$width}px;\n justify-content: center;\n `};\n`;\n\nexport const ButtonContent = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n justify-content: center;\n align-items: center;\n transform: scale(1);\n opacity: 1;\n transition: all 200ms;\n\n > svg {\n width: 100%;\n max-width: 16px;\n max-height: 16px;\n margin-right: 8px;\n\n ${props =>\n props.size === 'small' &&\n css`\n max-width: 13px;\n max-height: 13px;\n `};\n\n ${props =>\n props.size === 'x-small' &&\n css`\n max-width: 11px;\n max-height: 11px;\n `};\n }\n\n ${props =>\n props.$loading &&\n css`\n transform: scale(0.95);\n opacity: 0;\n `}\n\n ${props =>\n props.$singleaction &&\n css`\n svg {\n width: 100% !important;\n height: 100% !important;\n margin-right: 24px;\n }\n `};\n`;\n\nexport const LoadingIndicator = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n padding: 4px;\n background: inherit;\n opacity: 0;\n transition: opacity 200ms;\n box-sizing: border-box;\n\n ${props =>\n props.$loading &&\n css`\n opacity: 1;\n `}\n`;\n\nexport const LoadingIndicatorSvg = styled.svg\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n height: 100%;\n color: inherit;\n transform: rotate(-88deg);\n`;\n\nexport const LoadingIndicatorSvgCircle = styled.circle\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n transition: stroke-dashoffset 300ms linear;\n stroke-dasharray: 113;\n`;\n\nexport const ButtonWrapper = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n white-space: nowrap;\n display: flex;\n ${props =>\n props.$block &&\n css`\n width: 100%;\n `}\n`;\n\nexport const MainButtonWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n border-radius: 3px;\n ${props =>\n props.$block &&\n css`\n width: 100%;\n display: flex;\n `}\n\n ${props => {\n return (\n (props.$activeDropdown || props.$dropdownItems) &&\n !props.$outlined &&\n css`\n background: ${props.$secondary\n ? props.theme.getColor('gray-200')\n : props.theme.getColor('emerald-500')};\n `\n );\n }};\n`;\n\nexport const MainButtonContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: inline-block;\n\n ${props =>\n props.$block &&\n css`\n flex: 1;\n width: 100%;\n `}\n\n button {\n ${props =>\n (props.$activeDropdown || props.$dropdownItems) &&\n css`\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n `};\n\n ${props =>\n (props.$activeDropdown || props.$dropdownItems) &&\n props.outlined &&\n css`\n border-right: none;\n `};\n }\n`;\n\nexport const MainButtonContainerSingle = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: inline-block;\n width: 100%;\n ${props =>\n props.$singleaction &&\n css`\n display: flex;\n align-items: center;\n border-radius: 3px !important;\n transition:\n all 250ms,\n opacity 200ms;\n `};\n\n button {\n ${props =>\n (props.$activeDropdown || props.$dropdownItems) &&\n css`\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n `};\n }\n`;\n\nexport const DropdownButtonContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: inline-block;\n\n button {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n\n ${props => !props.$singleaction && 'border-left: none'};\n }\n\n svg {\n color: inherit;\n height: 7px;\n width: 12px;\n\n ${props => !props.$singleaction && 'margin-bottom: 1px'};\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Button","styled","button","withConfig","attrs","applyDefaultTheme","props","theme","getColor","$border","themeProp","$secondary","css","$outlined","$dropdownItems","$block","disabled","size","$singleaction","$singleactiongap","$width","ButtonContent","div","$loading","LoadingIndicator","LoadingIndicatorSvg","svg","LoadingIndicatorSvgCircle","circle","ButtonWrapper","span","MainButtonWrapper","$activeDropdown","MainButtonContainer","outlined","MainButtonContainerSingle","DropdownButtonContainer"],"mappings":";;;AAGA,MAAMA,iBAAiB,GAAGC,IAAI,IAAI;EAChC,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,CAAA;AAClD,CAAC,CAAA;AAEM,MAAMC,MAAM,GAAGC,MAAM,CAACC,MAAM,CAChCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAgBC,EAAAA,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,QAAQ,CAAC,aAAa,CAAC,CAAA;AAC5D,UAAA,EAAYF,KAAK,IAAIA,KAAK,CAACG,OAAO,CAAYH,SAAAA,EAAAA,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,QAAQ,CAAC,aAAa,CAAC,CAAA;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAIF,EAAAA,KAAK,IACLA,KAAK,CAACC,KAAK,CAACG,SAAS,CAAC,OAAO,EAAEJ,KAAK,CAACC,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EAAEF,KAAK,CAACC,KAAK,CAACC,QAAQ,CAAC,OAAO,CAA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K,IAAI,CAACA,KAAK,CAACY,aAAa,IAAI,oBAAoB,CAAA;AAC3D;AACA;;;;"}
1
+ {"version":3,"file":"Button.styled.js","sources":["../../../src/components/inputs/Button/Button.styled.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport type { ReactNode } from 'react';\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`\n * and the two majors disagree on the second parameter. Rules in\n * `layout/SectionSeparator/SectionSeparator.styled.ts`, derivation in\n * `scripts/TS-MIGRATION-PLAYBOOK.md` §J.4. `prop` needs the annotation because\n * `withConfig` takes this by reference, so it gets no contextual typing.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\n/**\n * `size` — `PropTypes.oneOf(['x-small', 'small', 'normal', 'large'])`, component default\n * `'normal'`. Closed on purpose (§J.6): `Button` and `ButtonContent` compare against\n * three of the four members, so a mistyped size is TS2367 rather than a dead branch.\n *\n * IT HAS NO `$`, AND THAT IS A DEFECT. `size` is not a member of\n * `ButtonHTMLAttributes` (it is an `<input>`/`<select>` attribute), which is why the\n * five reads of it were TS2339, and `shouldForwardProp` forwards every non-`$` prop —\n * so `size=\"normal\"` is on every rendered `<button>` and every `ButtonContent`\n * `<div>` today, and both are in the recorded render baseline. Fix = rename `$size` at\n * both ends; removes a DOM attribute → C10 with its re-record. §E.4 third case.\n */\ntype ButtonSize = 'x-small' | 'small' | 'normal' | 'large';\n\n/**\n * `dropdownItems` — `PropTypes.node`, an array of `ContextMenuItem`s.\n *\n * `ReactNode` and not `boolean`: the templates only ever test it for truthiness, but\n * what is passed is the node itself, and recording what the code does is the rule\n * (§J.6). It is transient, so it never reaches the DOM.\n */\ntype DropdownItems = ReactNode;\n\n/**\n * `Button`'s props — nine of them, which is why they are a named interface here rather\n * than inline. All optional per §J.5, and here that is load-bearing twice over:\n * `Button.tsx` spreads `{...props}` onto this root, and it renders `S.Button` at three\n * sites that pass different subsets (only the two dropdown sites pass\n * `$singleactiongap`).\n *\n * `disabled` is deliberately ABSENT: on a `styled.button` it is a genuine\n * `ButtonHTMLAttributes` member, so the read at `props.disabled &&` already typechecks\n * and the attribute belongs on the element (§J.9, first row).\n */\nexport interface ButtonStyleProps {\n /** `border` — `PropTypes.number`, default `2`. Interpolated as `${…}px`, so a string\n * here would already render `border: 2pxpx solid`. */\n $border?: number;\n /** `secondary` — `PropTypes.bool`. */\n $secondary?: boolean;\n /** `outlined` — `PropTypes.bool`. */\n $outlined?: boolean;\n /** `dropdownItems` — see `DropdownItems`. */\n $dropdownItems?: DropdownItems;\n /** `block` — `PropTypes.bool`, default `false`. Full-width. */\n $block?: boolean;\n /** `size` — see `ButtonSize`. Leaks to the DOM; see there. */\n size?: ButtonSize;\n /** `singleAction` — `PropTypes.bool`, default `false`. */\n $singleaction?: boolean;\n /** `singleActionGap` — `PropTypes.number`, default `34`. Interpolated as `${…}px`.\n * Passed only at the two dropdown `S.Button` sites, which is one of the reasons\n * every member here is optional. */\n $singleactiongap?: number;\n /** `width` — `PropTypes.number`, the custom `min-width`, interpolated as `${…}px`. */\n $width?: number;\n}\n\nexport const Button = styled.button\n .withConfig({\n shouldForwardProp\n })\n .attrs<ButtonStyleProps>(applyDefaultTheme)`\n position: relative;\n border-radius: 3px;\n font-family: inherit;\n font-size: 0.875rem;\n font-weight: 400;\n padding: 12px 16px;\n cursor: pointer;\n background: ${props => props.theme.getColor('emerald-500')};\n border: ${props => props.$border}px solid ${props => props.theme.getColor('emerald-500')};\n transition:\n all 250ms,\n opacity 200ms;\n\n &:hover,\n &.dropdown-is-active {\n background: #296c58;\n border-color: #296c58;\n }\n\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('white'))}\n\n && {\n ${props =>\n props.$secondary &&\n css`\n background: ${props => props.theme.getColor('gray-200')};\n border-color: ${props => props.theme.getColor('gray-200')};\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-700')\n )}\n\n &:hover,\n &.dropdown-is-active {\n background: ${props => props.theme.getColor('gray-300')};\n border-color: ${props => props.theme.getColor('gray-300')};\n }\n `};\n }\n\n && {\n ${props =>\n props.$outlined &&\n css`\n background: transparent;\n transition: none;\n\n ${props.theme.themeProp(\n 'border-color',\n props.theme.getColor('emerald-400'),\n props.theme.getColor('emerald-500')\n )}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('emerald-400'),\n props.theme.getColor('emerald-500')\n )}\n\n &:hover,\n &.dropdown-is-active {\n background-color: #296c58;\n\n ${props.theme.themeProp(\n 'border-color',\n props.theme.getColor('emerald-600'),\n props.theme.getColor('emerald-600')\n )}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-200')\n )}\n }\n `};\n }\n\n && {\n ${props =>\n props.$outlined &&\n props.$secondary &&\n css`\n ${props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-700')\n )}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-200'),\n props.theme.getColor('gray-700')\n )}\n\n &:hover,\n &.dropdown-is-active {\n background: ${props.theme.getColor('gray-300')};\n\n ${props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-300')\n )}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('gray-700')\n )}\n }\n `};\n }\n\n && {\n ${props =>\n props.$outlined &&\n props.$secondary &&\n props.$dropdownItems &&\n css`\n &:hover,\n &.dropdown-is-active {\n ${props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-300')\n )}\n }\n `};\n }\n\n ${props =>\n props.$block &&\n css`\n width: 100%;\n `};\n\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n `};\n\n ${props =>\n props.size === 'x-small' &&\n css`\n padding: 1px 16px;\n height: 24px;\n `};\n\n ${props =>\n props.size === 'small' &&\n css`\n padding: 6px 16px;\n `};\n\n ${props =>\n props.size === 'large' &&\n css`\n padding: 16px 16px;\n `};\n\n ${props =>\n props.$singleaction &&\n css`\n display: flex;\n align-items: center;\n gap: ${props.$singleactiongap}px;\n border-radius: 3px !important;\n transition:\n all 250ms,\n opacity 200ms;\n `};\n\n ${props =>\n props.$width &&\n css`\n min-width: ${props.$width}px;\n justify-content: center;\n `};\n`;\n\nexport const ButtonContent = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{\n /** `size` — see `ButtonSize`. Leaks onto this `<div>` too; see there. */\n size?: ButtonSize;\n /** `loadingState` — the component's own state, so `boolean`. */\n $loading?: boolean;\n /** `singleAction` — passed only at the single-action site. */\n $singleaction?: boolean;\n }>(applyDefaultTheme)`\n display: flex;\n justify-content: center;\n align-items: center;\n transform: scale(1);\n opacity: 1;\n transition: all 200ms;\n\n > svg {\n width: 100%;\n max-width: 16px;\n max-height: 16px;\n margin-right: 8px;\n\n ${props =>\n props.size === 'small' &&\n css`\n max-width: 13px;\n max-height: 13px;\n `};\n\n ${props =>\n props.size === 'x-small' &&\n css`\n max-width: 11px;\n max-height: 11px;\n `};\n }\n\n ${props =>\n props.$loading &&\n css`\n transform: scale(0.95);\n opacity: 0;\n `}\n\n ${props =>\n props.$singleaction &&\n css`\n svg {\n width: 100% !important;\n height: 100% !important;\n margin-right: 24px;\n }\n `};\n`;\n\nexport const LoadingIndicator = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $loading?: boolean }>(applyDefaultTheme)`\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n padding: 4px;\n background: inherit;\n opacity: 0;\n transition: opacity 200ms;\n box-sizing: border-box;\n\n ${props =>\n props.$loading &&\n css`\n opacity: 1;\n `}\n`;\n\nexport const LoadingIndicatorSvg = styled.svg\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n height: 100%;\n color: inherit;\n transform: rotate(-88deg);\n`;\n\nexport const LoadingIndicatorSvgCircle = styled.circle\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n transition: stroke-dashoffset 300ms linear;\n stroke-dasharray: 113;\n`;\n\n/*\n * `$block` IS READ HERE AND PASSED NOWHERE — declared so the read typechecks, and\n * recorded as a defect. `Button.tsx` renders `<S.ButtonWrapper>` with NO props at all\n * (it is the outermost element, and the `block` handling is done by `MainButtonWrapper`\n * / `MainButtonContainer` / `S.Button` instead), so `props.$block` is always `undefined`\n * and this `width: 100%` has never applied. Passing it, or deleting the block, changes\n * rendered CSS → C9/C10 with the baseline re-record, not a type-only commit.\n */\nexport const ButtonWrapper = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $block?: boolean }>(applyDefaultTheme)`\n white-space: nowrap;\n display: flex;\n ${props =>\n props.$block &&\n css`\n width: 100%;\n `}\n`;\n\n/** The dropdown-state props the three container `<div>`s share. */\ninterface DropdownContainerStyleProps {\n /** `activeDropdown` — `PropTypes.bool`, default `false`. */\n $activeDropdown?: boolean;\n /** `dropdownItems` — see `DropdownItems`. */\n $dropdownItems?: DropdownItems;\n}\n\nexport const MainButtonWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<\n DropdownContainerStyleProps & {\n /** `block` — full-width. */\n $block?: boolean;\n /** `outlined` — suppresses the wrapper background. */\n $outlined?: boolean;\n /** `secondary` — picks the grey background over the emerald one. */\n $secondary?: boolean;\n }\n >(applyDefaultTheme)`\n border-radius: 3px;\n ${props =>\n props.$block &&\n css`\n width: 100%;\n display: flex;\n `}\n\n ${props => {\n return (\n (props.$activeDropdown || props.$dropdownItems) &&\n !props.$outlined &&\n css`\n background: ${props.$secondary\n ? props.theme.getColor('gray-200')\n : props.theme.getColor('emerald-500')};\n `\n );\n }};\n`;\n\n/*\n * TWO DEAD READS HERE, BOTH DECLARED AND NEITHER FIXED.\n *\n * 1. `props.outlined` (in the second `button {}` block) HAS NO `$` while `Button.tsx`\n * passes `$outlined` — so this is the §E.3 dead-branch class, exactly\n * `Badge.styled`'s `props.elevated` vs `$elevated`. `props.outlined` is always\n * `undefined`, so `border-right: none` HAS NEVER APPLIED to a dropdown-adjacent\n * outlined button. Repointing it to `$outlined` ACTIVATES A BRANCH THAT HAS NEVER\n * FIRED, which changes rendered CSS, so it belongs to C9/C10 with the baseline\n * re-record. Declared here (as the non-`$` name it actually reads) so the file\n * typechecks without blessing it — and note nothing passes `outlined`, so unlike\n * `size` it does not currently leak to the DOM either.\n * 2. `$activeDropdown` is read and NOT passed to this component (`Button.tsx` gives it\n * `$dropdownItems`, `$secondary`, `$outlined`, `$block` only). Both reads are\n * `(props.$activeDropdown || props.$dropdownItems)`, so the `||` still works via the\n * second operand and the visible behaviour is \"dropdownItems only\". Declared, not\n * wired up.\n */\nexport const MainButtonContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<\n DropdownContainerStyleProps & {\n /** `block` — full-width. */\n $block?: boolean;\n /** DEAD READ, see above. Nothing passes it; `$outlined` is what arrives. */\n outlined?: boolean;\n }\n >(applyDefaultTheme)`\n display: inline-block;\n\n ${props =>\n props.$block &&\n css`\n flex: 1;\n width: 100%;\n `}\n\n button {\n ${props =>\n (props.$activeDropdown || props.$dropdownItems) &&\n css`\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n `};\n\n ${props =>\n (props.$activeDropdown || props.$dropdownItems) &&\n props.outlined &&\n css`\n border-right: none;\n `};\n }\n`;\n\n/*\n * TWO MORE READ-BUT-NEVER-PASSED PROPS, declared and recorded, not fixed.\n * `Button.tsx` renders `<S.MainButtonContainerSingle $dropdownItems $secondary\n * $outlined className>`, so:\n * - `$singleaction` is always `undefined` — and this is the SINGLE-ACTION branch of\n * the component, so the `display: flex` block below has never applied even though\n * it is the only reason this component exists separately from\n * `MainButtonContainer`. (`$secondary` / `$outlined` are passed but never read\n * here, which is the harmless mirror image of the same mistake.)\n * - `$activeDropdown` is always `undefined`; the `||` falls through to\n * `$dropdownItems`, as in `MainButtonContainer`.\n * Passing either changes rendered CSS → C9/C10 with the re-record.\n */\nexport const MainButtonContainerSingle = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<\n DropdownContainerStyleProps & {\n /** DEAD READ, see above: the single-action layout never applies. */\n $singleaction?: boolean;\n }\n >(applyDefaultTheme)`\n display: inline-block;\n width: 100%;\n ${props =>\n props.$singleaction &&\n css`\n display: flex;\n align-items: center;\n border-radius: 3px !important;\n transition:\n all 250ms,\n opacity 200ms;\n `};\n\n button {\n ${props =>\n (props.$activeDropdown || props.$dropdownItems) &&\n css`\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n `};\n }\n`;\n\n/*\n * The one component whose `$singleaction` reads are BOTH live: `Button.tsx` renders this\n * with `$singleaction={singleAction}` in the single-action branch and without it in the\n * other, and `!props.$singleaction` is written for exactly that absence — which is also\n * why the prop stays optional (§J.5).\n */\nexport const DropdownButtonContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<{ $singleaction?: boolean }>(applyDefaultTheme)`\n display: inline-block;\n\n button {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n\n ${props => !props.$singleaction && 'border-left: none'};\n }\n\n svg {\n color: inherit;\n height: 7px;\n width: 12px;\n\n ${props => !props.$singleaction && 'margin-bottom: 1px'};\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Button","styled","button","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","getColor","$border","themeProp","$secondary","css","$outlined","$dropdownItems","$block","disabled","size","$singleaction","$singleactiongap","$width","ButtonContent","div","$loading","LoadingIndicator","LoadingIndicatorSvg","svg","LoadingIndicatorSvgCircle","circle","ButtonWrapper","span","MainButtonWrapper","$activeDropdown","MainButtonContainer","outlined","MainButtonContainerSingle","DropdownButtonContainer"],"mappings":";;;AAYA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO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IACLA,KAAK,CAACY,aAAa,IACnBN,GAAG,CAAA,CAAA,kGAAA,CAAA,CAOF,EAGCN,KAAK,IACL,CAACA,KAAK,CAAC0B,eAAe,IAAI1B,KAAK,CAACQ,cAAc,KAC9CF,GAAG,CAAA,CAAA,yDAAA,CAAA,CAGF;AAUA,MAAMwB,uBAAuB,GAAGrC,MAAM,CAACuB,GAAG,CAC9CrB,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAA8BC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,uCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,mFAAA,EAAA,4CAAA,EAAA,IAAA,CAAA,EAOlDC,KAAK,IAAI,CAACA,KAAK,CAACY,aAAa,IAAI,mBAAmB,EAQpDZ,KAAK,IAAI,CAACA,KAAK,CAACY,aAAa,IAAI,oBAAoB;;;;"}
@@ -1,30 +1,30 @@
1
1
  import React__default, { useState, useMemo } from 'react';
2
2
  import { nanoid } from 'nanoid';
3
- import PropTypes from 'prop-types';
4
- import { isBoolean, isEmpty } from 'lodash';
3
+ import { isEmpty } from 'lodash';
5
4
  import { Checkbox as Checkbox$1, CheckboxLabel, IndeterminateCheckIcon, CheckIcon, CheckboxVisualLabel, Description } from './Checkbox.styled.js';
5
+ import { jsxs, jsx } from 'react/jsx-runtime';
6
6
 
7
7
  const Checkbox = React__default.forwardRef(function Checkbox({
8
8
  checked,
9
9
  defaultChecked,
10
- disabled,
11
- readOnly,
10
+ disabled = false,
11
+ readOnly = false,
12
12
  name,
13
13
  value,
14
14
  description,
15
15
  error,
16
- indeterminate,
16
+ indeterminate = false,
17
17
  muted,
18
18
  label,
19
19
  onChange,
20
20
  onBlur,
21
21
  className,
22
22
  style,
23
- variant
23
+ variant = 'green'
24
24
  }, forwardedRef) {
25
25
  const [uniqueId] = useState(nanoid());
26
26
  const hasError = useMemo(() => {
27
- if (isBoolean(error)) {
27
+ if (typeof error === 'boolean') {
28
28
  return error;
29
29
  }
30
30
  return !isEmpty(error);
@@ -38,65 +38,49 @@ const Checkbox = React__default.forwardRef(function Checkbox({
38
38
  }
39
39
  return null;
40
40
  }, [description, error]);
41
- return React__default.createElement(Checkbox$1, {
41
+ return jsxs(Checkbox$1, {
42
42
  className: className,
43
43
  disabled: disabled,
44
44
  readOnly: readOnly,
45
45
  style: style,
46
- $variant: variant
47
- }, React__default.createElement(CheckboxLabel, {
48
- disabled: disabled,
49
- muted: muted,
50
- readOnly: readOnly,
51
- htmlFor: uniqueId,
52
- $variant: variant
53
- }, React__default.createElement("input", {
54
- ref: forwardedRef,
55
- id: uniqueId,
56
- checked: checked,
57
- defaultChecked: defaultChecked,
58
- disabled: disabled,
59
- readOnly: readOnly,
60
- value: value,
61
- name: name,
62
- type: "checkbox",
63
- onChange: onChange,
64
- onBlur: onBlur,
65
- "data-indeterminate": indeterminate
66
- }), React__default.createElement(IndeterminateCheckIcon, null), React__default.createElement(CheckIcon, null, React__default.createElement("svg", {
67
- xmlns: "http://www.w3.org/2000/svg",
68
- viewBox: "0 0 10.9 8.45"
69
- }, React__default.createElement("path", {
70
- d: "m3.68,8.45L0,4.75l1.21-1.21,2.47,2.45L9.7,0l1.21,1.23-7.22,7.22Z",
71
- fill: "currentColor"
72
- }))), (typeof label === 'string' && label.length > 0 || typeof label === 'object') && React__default.createElement(CheckboxVisualLabel, null, label)), typeof descriptionText === 'string' && descriptionText.length > 0 && React__default.createElement(Description, {
73
- $error: hasError
74
- }, descriptionText));
46
+ $variant: variant,
47
+ children: [jsxs(CheckboxLabel, {
48
+ disabled: disabled,
49
+ muted: muted,
50
+ readOnly: readOnly,
51
+ htmlFor: uniqueId,
52
+ $variant: variant,
53
+ children: [jsx("input", {
54
+ ref: forwardedRef,
55
+ id: uniqueId,
56
+ checked: checked,
57
+ defaultChecked: defaultChecked,
58
+ disabled: disabled,
59
+ readOnly: readOnly,
60
+ value: value,
61
+ name: name,
62
+ type: "checkbox",
63
+ onChange: onChange,
64
+ onBlur: onBlur,
65
+ "data-indeterminate": indeterminate
66
+ }), jsx(IndeterminateCheckIcon, {}), jsx(CheckIcon, {
67
+ children: jsx("svg", {
68
+ xmlns: "http://www.w3.org/2000/svg",
69
+ viewBox: "0 0 10.9 8.45",
70
+ children: jsx("path", {
71
+ d: "m3.68,8.45L0,4.75l1.21-1.21,2.47,2.45L9.7,0l1.21,1.23-7.22,7.22Z",
72
+ fill: "currentColor"
73
+ })
74
+ })
75
+ }), (typeof label === 'string' && label.length > 0 || typeof label === 'object') && jsx(CheckboxVisualLabel, {
76
+ children: label
77
+ })]
78
+ }), typeof descriptionText === 'string' && descriptionText.length > 0 && jsx(Description, {
79
+ $error: hasError,
80
+ children: descriptionText
81
+ })]
82
+ });
75
83
  });
76
- Checkbox.propTypes = process.env.NODE_ENV !== "production" ? {
77
- checked: PropTypes.bool,
78
- defaultChecked: PropTypes.bool,
79
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
80
- disabled: PropTypes.bool,
81
- readOnly: PropTypes.bool,
82
- name: PropTypes.string,
83
- value: PropTypes.string,
84
- description: PropTypes.string,
85
- error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
86
- indeterminate: PropTypes.bool,
87
- muted: PropTypes.bool,
88
- onChange: PropTypes.func,
89
- onBlur: PropTypes.func,
90
- className: PropTypes.string,
91
- style: PropTypes.object,
92
- variant: PropTypes.oneOf(['green', 'black'])
93
- } : {};
94
- Checkbox.defaultProps = {
95
- disabled: false,
96
- readOnly: false,
97
- indeterminate: false,
98
- variant: 'green'
99
- };
100
84
 
101
85
  export { Checkbox as default };
102
86
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../src/components/inputs/Checkbox/Checkbox.js"],"sourcesContent":["import React, { useMemo, useState } from 'react';\n\nimport { nanoid } from 'nanoid';\nimport PropTypes from 'prop-types';\n\nimport { isBoolean, isEmpty } from 'lodash';\nimport * as S from './Checkbox.styled';\n\n/**\n * Checkboxes allow the user to select one or more items from a set.\n *\n * If you have a single option, avoid using a checkbox and use an on/off switch (`Switch` component) instead.\n *\n *\n * ### Import\n *\n * ``` js\n * import { Checkbox } from '@ntbjs/react-components/inputs'\n * // or\n * import Checkbox from '@ntbjs/react-components/inputs/Checkbox'\n * ```\n */\nconst Checkbox = React.forwardRef(function Checkbox(\n {\n checked,\n defaultChecked,\n disabled,\n readOnly,\n name,\n value,\n description,\n error,\n indeterminate,\n muted,\n label,\n onChange,\n onBlur,\n className,\n style,\n variant\n },\n forwardedRef\n) {\n const [uniqueId] = useState(nanoid());\n\n const hasError = useMemo(() => {\n if (isBoolean(error)) {\n return error;\n }\n\n return !isEmpty(error);\n }, [error]);\n\n const descriptionText = useMemo(() => {\n if (!isEmpty(error)) {\n return error;\n }\n\n if (!isEmpty(description)) {\n return description;\n }\n\n return null;\n }, [description, error]);\n\n return (\n <S.Checkbox\n className={className}\n disabled={disabled}\n readOnly={readOnly}\n style={style}\n $variant={variant}\n >\n <S.CheckboxLabel\n disabled={disabled}\n muted={muted}\n readOnly={readOnly}\n htmlFor={uniqueId}\n $variant={variant}\n >\n <input\n ref={forwardedRef}\n id={uniqueId}\n checked={checked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n readOnly={readOnly}\n value={value}\n name={name}\n type=\"checkbox\"\n onChange={onChange}\n onBlur={onBlur}\n data-indeterminate={indeterminate}\n />\n\n <S.IndeterminateCheckIcon />\n <S.CheckIcon>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10.9 8.45\">\n <path\n d=\"m3.68,8.45L0,4.75l1.21-1.21,2.47,2.45L9.7,0l1.21,1.23-7.22,7.22Z\"\n fill=\"currentColor\"\n />\n </svg>\n </S.CheckIcon>\n {((typeof label === 'string' && label.length > 0) || typeof label === 'object') && (\n <S.CheckboxVisualLabel>{label}</S.CheckboxVisualLabel>\n )}\n </S.CheckboxLabel>\n {typeof descriptionText === 'string' && descriptionText.length > 0 && (\n <S.Description $error={hasError}>{descriptionText}</S.Description>\n )}\n </S.Checkbox>\n );\n});\n\nCheckbox.propTypes = {\n /**\n * Whether the checkbox is checked\n */\n checked: PropTypes.bool,\n\n /**\n * Whether the checkbox should be checked or unchecked by default\n */\n defaultChecked: PropTypes.bool,\n\n /**\n * The checkbox' label\n */\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n\n /**\n * Whether the checkbox is disabled\n */\n disabled: PropTypes.bool,\n\n /**\n * Whether the checkbox is read-only\n */\n readOnly: PropTypes.bool,\n\n /**\n * The checkbox' name\n */\n name: PropTypes.string,\n\n /**\n * The checkbox' value\n */\n value: PropTypes.string,\n\n /**\n * Description of the checkbox\n */\n description: PropTypes.string,\n\n /**\n * Whether there's an error. Error message can be passed as a `string` to be displayed below the checkbox.\n */\n error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n\n /**\n * Whether the checkbox is indeterminate. This will display a dash in the checkbox instead of the default checkmark.\n */\n indeterminate: PropTypes.bool,\n\n /**\n * Mutes the color of the visual checkbox – Does not mute the label or other parts of the Checkbox\n */\n muted: PropTypes.bool,\n\n /**\n * On-change effect\n */\n onChange: PropTypes.func,\n\n /**\n * On-blur effect\n */\n onBlur: PropTypes.func,\n\n /**\n * Optional class name for the HTML element\n */\n className: PropTypes.string,\n\n /**\n * Optional in-line styling for the HTML element\n */\n style: PropTypes.object,\n\n /**\n * Visual variant. `green` (default) uses emerald fill. `black` uses themed black/white square (24px, rounded), inverted check.\n */\n variant: PropTypes.oneOf(['green', 'black'])\n};\n\nCheckbox.defaultProps = {\n disabled: false,\n readOnly: false,\n indeterminate: false,\n variant: 'green'\n};\n\nexport default Checkbox;\n"],"names":["Checkbox","React","forwardRef","checked","defaultChecked","disabled","readOnly","name","value","description","error","indeterminate","muted","label","onChange","onBlur","className","style","variant","forwardedRef","uniqueId","useState","nanoid","hasError","useMemo","isBoolean","isEmpty","descriptionText","createElement","S","$variant","htmlFor","ref","id","type","xmlns","viewBox","d","fill","length","$error","propTypes","process","env","NODE_ENV","PropTypes","bool","oneOfType","string","element","func","object","oneOf","defaultProps"],"mappings":";;;;;;AAsBMA,MAAAA,QAAQ,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,QAAQA,CACjD;EACEG,OAAO;EACPC,cAAc;EACdC,QAAQ;EACRC,QAAQ;EACRC,IAAI;EACJC,KAAK;EACLC,WAAW;EACXC,KAAK;EACLC,aAAa;EACbC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNC,SAAS;EACTC,KAAK;AACLC,EAAAA,OAAAA;AACF,CAAC,EACDC,YAAY,EACZ;EACA,MAAM,CAACC,QAAQ,CAAC,GAAGC,QAAQ,CAACC,MAAM,EAAE,CAAC,CAAA;AAErC,EAAA,MAAMC,QAAQ,GAAGC,OAAO,CAAC,MAAM;AAC7B,IAAA,IAAIC,SAAS,CAACf,KAAK,CAAC,EAAE;AACpB,MAAA,OAAOA,KAAK,CAAA;AACd,KAAA;AAEA,IAAA,OAAO,CAACgB,OAAO,CAAChB,KAAK,CAAC,CAAA;AACxB,GAAC,EAAE,CAACA,KAAK,CAAC,CAAC,CAAA;AAEX,EAAA,MAAMiB,eAAe,GAAGH,OAAO,CAAC,MAAM;AACpC,IAAA,IAAI,CAACE,OAAO,CAAChB,KAAK,CAAC,EAAE;AACnB,MAAA,OAAOA,KAAK,CAAA;AACd,KAAA;AAEA,IAAA,IAAI,CAACgB,OAAO,CAACjB,WAAW,CAAC,EAAE;AACzB,MAAA,OAAOA,WAAW,CAAA;AACpB,KAAA;AAEA,IAAA,OAAO,IAAI,CAAA;AACb,GAAC,EAAE,CAACA,WAAW,EAAEC,KAAK,CAAC,CAAC,CAAA;AAExB,EAAA,OACET,cAAA,CAAA2B,aAAA,CAACC,UAAU,EAAA;AACTb,IAAAA,SAAS,EAAEA,SAAU;AACrBX,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,QAAQ,EAAEA,QAAS;AAC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E,OAAO,CAAC,CAAA;AAC7C,CAAC,GAAA,EAAA,CAAA;AAEDpD,QAAQ,CAACqD,YAAY,GAAG;AACtBhD,EAAAA,QAAQ,EAAE,KAAK;AACfC,EAAAA,QAAQ,EAAE,KAAK;AACfK,EAAAA,aAAa,EAAE,KAAK;AACpBO,EAAAA,OAAO,EAAE,OAAA;AACX,CAAC;;;;"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../src/components/inputs/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\n\nimport { nanoid } from 'nanoid';\n\nimport { isEmpty } from 'lodash';\nimport * as S from './Checkbox.styled';\n\ntype Props = {\n /**\n * Whether the checkbox is checked\n */\n checked?: boolean;\n /**\n * Whether the checkbox should be checked or unchecked by default\n */\n defaultChecked?: boolean;\n /**\n * The checkbox' label\n */\n label?: string | React.ReactElement<any>;\n /**\n * Whether the checkbox is disabled\n */\n disabled?: boolean;\n /**\n * Whether the checkbox is read-only\n */\n readOnly?: boolean;\n /**\n * The checkbox' name\n */\n name?: string;\n /**\n * The checkbox' value\n *\n * `string | number`, not the `PropTypes.string` this replaces. `MultiLevelCheckbox`\n * renders `<Checkbox value={node.value} …>` and a node's value is\n * `MultiLevelCheckboxNodeValue = string | number`, so a numeric value reaches this\n * prop through a public API today and `oneOf`-style validation never noticed because\n * the two components' propTypes were never compared. The value is forwarded\n * unchanged onto `<input type=\"checkbox\">`, whose own React type is\n * `string | number | readonly string[]`, so this widening records reality and emits\n * identical markup.\n */\n value?: string | number;\n /**\n * Description of the checkbox\n */\n description?: string;\n /**\n * Whether there's an error. Error message can be passed as a `string` to be displayed below the checkbox.\n */\n error?: boolean | string;\n /**\n * Whether the checkbox is indeterminate. This will display a dash in the checkbox instead of the default checkmark.\n */\n indeterminate?: boolean;\n /**\n * Mutes the color of the visual checkbox – Does not mute the label or other parts of the Checkbox\n */\n muted?: boolean;\n /**\n * On-change effect\n */\n onChange?: (...args: any[]) => any;\n /**\n * On-blur effect\n */\n onBlur?: (...args: any[]) => any;\n /**\n * Optional class name for the HTML element\n */\n className?: string;\n /**\n * Optional in-line styling for the HTML element\n */\n style?: any;\n /**\n * Visual variant. `green` (default) uses emerald fill. `black` uses themed black/white square (24px, rounded), inverted check.\n */\n variant?: 'green' | 'black';\n};\n\n/**\n * Checkboxes allow the user to select one or more items from a set.\n *\n * If you have a single option, avoid using a checkbox and use an on/off switch (`Switch` component) instead.\n *\n *\n * ### Import\n *\n * ``` js\n * import { Checkbox } from '@ntbjs/react-components/inputs'\n * // or\n * import Checkbox from '@ntbjs/react-components/inputs/Checkbox'\n * ```\n */\nconst Checkbox = React.forwardRef<any, Props>(function Checkbox(\n {\n checked,\n defaultChecked,\n disabled = false,\n readOnly = false,\n name,\n value,\n description,\n error,\n indeterminate = false,\n muted,\n label,\n onChange,\n onBlur,\n className,\n style,\n variant = 'green'\n },\n forwardedRef\n) {\n const [uniqueId] = useState(nanoid());\n\n /*\n * NMB-3998: `typeof` instead of lodash `isBoolean`, the same failure documented at\n * length in TextInput.tsx. `@types/lodash` is not installed and lodash 4 ships no\n * types, so `isBoolean` is `any` and narrows nothing; `hasError` widened to\n * `string | boolean` and `S.Description`'s `$error?: boolean` rejected it (TS2769).\n * The value is already a boolean at runtime either way, so this records behaviour\n * rather than widening the styled generic to a `string` it can never receive.\n */\n const hasError = useMemo(() => {\n if (typeof error === 'boolean') {\n return error;\n }\n\n return !isEmpty(error);\n }, [error]);\n\n const descriptionText = useMemo(() => {\n if (!isEmpty(error)) {\n return error;\n }\n\n if (!isEmpty(description)) {\n return description;\n }\n\n return null;\n }, [description, error]);\n\n return (\n <S.Checkbox\n className={className}\n disabled={disabled}\n readOnly={readOnly}\n style={style}\n $variant={variant}\n >\n <S.CheckboxLabel\n disabled={disabled}\n muted={muted}\n readOnly={readOnly}\n htmlFor={uniqueId}\n $variant={variant}\n >\n <input\n ref={forwardedRef}\n id={uniqueId}\n checked={checked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n readOnly={readOnly}\n value={value}\n name={name}\n type=\"checkbox\"\n onChange={onChange}\n onBlur={onBlur}\n data-indeterminate={indeterminate}\n />\n\n <S.IndeterminateCheckIcon />\n <S.CheckIcon>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10.9 8.45\">\n <path\n d=\"m3.68,8.45L0,4.75l1.21-1.21,2.47,2.45L9.7,0l1.21,1.23-7.22,7.22Z\"\n fill=\"currentColor\"\n />\n </svg>\n </S.CheckIcon>\n {((typeof label === 'string' && label.length > 0) || typeof label === 'object') && (\n <S.CheckboxVisualLabel>{label}</S.CheckboxVisualLabel>\n )}\n </S.CheckboxLabel>\n {typeof descriptionText === 'string' && descriptionText.length > 0 && (\n <S.Description $error={hasError}>{descriptionText}</S.Description>\n )}\n </S.Checkbox>\n );\n});\n\nexport default Checkbox;\n"],"names":["Checkbox","React","forwardRef","checked","defaultChecked","disabled","readOnly","name","value","description","error","indeterminate","muted","label","onChange","onBlur","className","style","variant","forwardedRef","uniqueId","useState","nanoid","hasError","useMemo","isEmpty","descriptionText","_jsxs","S","$variant","children","htmlFor","_jsx","ref","id","type","xmlns","viewBox","d","fill","length","$error"],"mappings":";;;;;;AAiGA,MAAMA,QAAQ,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,QAAQA,CAC7D;EACEG,OAAO;EACPC,cAAc;AACdC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,QAAQ,GAAG,KAAK;EAChBC,IAAI;EACJC,KAAK;EACLC,WAAW;EACXC,KAAK;AACLC,EAAAA,aAAa,GAAG,KAAK;EACrBC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNC,SAAS;EACTC,KAAK;AACLC,EAAAA,OAAO,GAAG;AACZ,CAAC,EACDC,YAAY,EACZ;EACA,MAAM,CAACC,QAAQ,CAAC,GAAGC,QAAQ,CAACC,MAAM,EAAE,CAAC;AAUrC,EAAA,MAAMC,QAAQ,GAAGC,OAAO,CAAC,MAAM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