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

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 (344) hide show
  1. package/README.md +34 -0
  2. package/build/data/Alert/Alert.js +18 -33
  3. package/build/data/Alert/Alert.js.map +1 -1
  4. package/build/data/Alert/Alert.styled.js +9 -47
  5. package/build/data/Alert/Alert.styled.js.map +1 -1
  6. package/build/data/Badge/Badge.js +36 -61
  7. package/build/data/Badge/Badge.js.map +1 -1
  8. package/build/data/Badge/Badge.styled.js +21 -70
  9. package/build/data/Badge/Badge.styled.js.map +1 -1
  10. package/build/data/Popover/Popover.js +125 -71
  11. package/build/data/Popover/Popover.js.map +1 -1
  12. package/build/data/Popover/Popover.styled.js +10 -140
  13. package/build/data/Popover/Popover.styled.js.map +1 -1
  14. package/build/data/SeverityBadge/SeverityBadge.js +13 -22
  15. package/build/data/SeverityBadge/SeverityBadge.js.map +1 -1
  16. package/build/data/SeverityBadge/index.js +2 -0
  17. package/build/data/SeverityBadge/index.js.map +1 -0
  18. package/build/data/Tab/Tab.js +7 -13
  19. package/build/data/Tab/Tab.js.map +1 -1
  20. package/build/data/Tab/Tab.styled.js +4 -7
  21. package/build/data/Tab/Tab.styled.js.map +1 -1
  22. package/build/data/Tabs/Tabs.js +30 -32
  23. package/build/data/Tabs/Tabs.js.map +1 -1
  24. package/build/data/Tabs/Tabs.styled.js +21 -57
  25. package/build/data/Tabs/Tabs.styled.js.map +1 -1
  26. package/build/data/Tooltip/Tooltip.js +102 -33
  27. package/build/data/Tooltip/Tooltip.js.map +1 -1
  28. package/build/data/Tooltip/Tooltip.styled.js +9 -22
  29. package/build/data/Tooltip/Tooltip.styled.js.map +1 -1
  30. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js +16 -23
  31. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js.map +1 -1
  32. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +13 -31
  33. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js.map +1 -1
  34. package/build/data/VerificationStatusIcon/index.js +2 -0
  35. package/build/data/VerificationStatusIcon/index.js.map +1 -0
  36. package/build/data/_shared/FloatingArrow.styled.js +30 -0
  37. package/build/data/_shared/FloatingArrow.styled.js.map +1 -0
  38. package/build/hooks/useEventListner.js.map +1 -1
  39. package/build/hooks/useFloatingPopover.js +187 -0
  40. package/build/hooks/useFloatingPopover.js.map +1 -0
  41. package/build/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  42. package/build/hooks/useOnClickOutside.js.map +1 -1
  43. package/build/hooks/useTooltipAutoShow.js.map +1 -1
  44. package/build/icons/arrow-back.svg.js +3 -3
  45. package/build/icons/arrow-back.svg.js.map +1 -1
  46. package/build/icons/arrow-forward.svg.js +4 -4
  47. package/build/icons/arrow-forward.svg.js.map +1 -1
  48. package/build/icons/check-rectangle-filled.svg.js +3 -3
  49. package/build/icons/check-rectangle-filled.svg.js.map +1 -1
  50. package/build/icons/close.svg.js +3 -3
  51. package/build/icons/close.svg.js.map +1 -1
  52. package/build/icons/edit-note.svg.js +3 -3
  53. package/build/icons/edit-note.svg.js.map +1 -1
  54. package/build/icons/expand-more.svg.js +3 -3
  55. package/build/icons/expand-more.svg.js.map +1 -1
  56. package/build/icons/headset.svg.js +3 -3
  57. package/build/icons/headset.svg.js.map +1 -1
  58. package/build/icons/layers.svg.js +3 -3
  59. package/build/icons/layers.svg.js.map +1 -1
  60. package/build/icons/link.svg.js +3 -3
  61. package/build/icons/link.svg.js.map +1 -1
  62. package/build/icons/play.svg.js +3 -3
  63. package/build/icons/play.svg.js.map +1 -1
  64. package/build/icons/search.svg.js +3 -3
  65. package/build/icons/search.svg.js.map +1 -1
  66. package/build/icons/star-filled.svg.js +3 -3
  67. package/build/icons/star-filled.svg.js.map +1 -1
  68. package/build/icons/star.svg.js +3 -3
  69. package/build/icons/star.svg.js.map +1 -1
  70. package/build/icons/triangle-right.svg.js +3 -3
  71. package/build/icons/triangle-right.svg.js.map +1 -1
  72. package/build/icons/verification.svg.js +3 -3
  73. package/build/icons/verification.svg.js.map +1 -1
  74. package/build/icons/warning-circle.svg.js +3 -3
  75. package/build/icons/warning-circle.svg.js.map +1 -1
  76. package/build/inputs/ActionButton/ActionButton.js +11 -22
  77. package/build/inputs/ActionButton/ActionButton.js.map +1 -1
  78. package/build/inputs/ActionButton/ActionButton.styled.js +5 -54
  79. package/build/inputs/ActionButton/ActionButton.styled.js.map +1 -1
  80. package/build/inputs/Button/Button.js +125 -121
  81. package/build/inputs/Button/Button.js.map +1 -1
  82. package/build/inputs/Button/Button.styled.js +42 -260
  83. package/build/inputs/Button/Button.styled.js.map +1 -1
  84. package/build/inputs/Checkbox/Checkbox.js +45 -61
  85. package/build/inputs/Checkbox/Checkbox.js.map +1 -1
  86. package/build/inputs/Checkbox/Checkbox.styled.js +24 -153
  87. package/build/inputs/Checkbox/Checkbox.styled.js.map +1 -1
  88. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +106 -111
  89. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js.map +1 -1
  90. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js +88 -273
  91. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js.map +1 -1
  92. package/build/inputs/CompactStarRating/CompactStarRating.js +56 -77
  93. package/build/inputs/CompactStarRating/CompactStarRating.js.map +1 -1
  94. package/build/inputs/CompactStarRating/CompactStarRating.styled.js +32 -211
  95. package/build/inputs/CompactStarRating/CompactStarRating.styled.js.map +1 -1
  96. package/build/inputs/CompactTextInput/CompactTextInput.js +86 -105
  97. package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -1
  98. package/build/inputs/CompactTextInput/CompactTextInput.styled.js +55 -258
  99. package/build/inputs/CompactTextInput/CompactTextInput.styled.js.map +1 -1
  100. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js +70 -77
  101. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js.map +1 -1
  102. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +28 -60
  103. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js.map +1 -1
  104. package/build/inputs/MultiLevelCheckbox/types.js +12 -12
  105. package/build/inputs/MultiLevelCheckbox/types.js.map +1 -1
  106. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +69 -73
  107. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js.map +1 -1
  108. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +44 -87
  109. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js.map +1 -1
  110. package/build/inputs/MultiSelect/MultiSelect.js +69 -79
  111. package/build/inputs/MultiSelect/MultiSelect.js.map +1 -1
  112. package/build/inputs/MultiSelect/MultiSelect.styled.js +70 -76
  113. package/build/inputs/MultiSelect/MultiSelect.styled.js.map +1 -1
  114. package/build/inputs/Radio/Radio.js +20 -33
  115. package/build/inputs/Radio/Radio.js.map +1 -1
  116. package/build/inputs/Radio/Radio.styled.js +15 -96
  117. package/build/inputs/Radio/Radio.styled.js.map +1 -1
  118. package/build/inputs/Switch/Switch.js +28 -40
  119. package/build/inputs/Switch/Switch.js.map +1 -1
  120. package/build/inputs/Switch/Switch.styled.js +24 -94
  121. package/build/inputs/Switch/Switch.styled.js.map +1 -1
  122. package/build/inputs/TextArea/TextArea.js +98 -123
  123. package/build/inputs/TextArea/TextArea.js.map +1 -1
  124. package/build/inputs/TextArea/TextArea.styled.js +64 -379
  125. package/build/inputs/TextArea/TextArea.styled.js.map +1 -1
  126. package/build/inputs/TextInput/TextInput.js +59 -79
  127. package/build/inputs/TextInput/TextInput.js.map +1 -1
  128. package/build/inputs/TextInput/TextInput.styled.js +33 -224
  129. package/build/inputs/TextInput/TextInput.styled.js.map +1 -1
  130. package/build/layout/InputGroup/InputGroup.js +6 -9
  131. package/build/layout/InputGroup/InputGroup.js.map +1 -1
  132. package/build/layout/InputGroup/InputGroup.styled.js +4 -3
  133. package/build/layout/InputGroup/InputGroup.styled.js.map +1 -1
  134. package/build/layout/InputGroup/index.js +2 -0
  135. package/build/layout/InputGroup/index.js.map +1 -0
  136. package/build/layout/SectionSeparator/SectionSeparator.js +5 -9
  137. package/build/layout/SectionSeparator/SectionSeparator.js.map +1 -1
  138. package/build/layout/SectionSeparator/SectionSeparator.styled.js +4 -8
  139. package/build/layout/SectionSeparator/SectionSeparator.styled.js.map +1 -1
  140. package/build/styles/utils/colors-export.d.ts +54 -0
  141. package/build/styles/utils/colors-export.js.map +1 -1
  142. package/build/utils/dateTime.js.map +1 -1
  143. package/build/utils/defaultTheme.js +14 -28
  144. package/build/utils/defaultTheme.js.map +1 -1
  145. package/build/utils/getElementRef.js +14 -0
  146. package/build/utils/getElementRef.js.map +1 -0
  147. package/build/utils/parseTrigger.js +16 -0
  148. package/build/utils/parseTrigger.js.map +1 -0
  149. package/build/widgets/AssetAction/AssetAction.js +26 -33
  150. package/build/widgets/AssetAction/AssetAction.js.map +1 -1
  151. package/build/widgets/AssetAction/AssetAction.styled.js +20 -34
  152. package/build/widgets/AssetAction/AssetAction.styled.js.map +1 -1
  153. package/build/widgets/AssetActionsBase/AssetActionsBase.js +8 -13
  154. package/build/widgets/AssetActionsBase/AssetActionsBase.js.map +1 -1
  155. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js +4 -9
  156. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js.map +1 -1
  157. package/build/widgets/AssetGallery/AssetGallery.js +15 -40
  158. package/build/widgets/AssetGallery/AssetGallery.js.map +1 -1
  159. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +55 -70
  160. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js.map +1 -1
  161. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +12 -24
  162. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js.map +1 -1
  163. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +146 -122
  164. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
  165. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +99 -286
  166. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
  167. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +170 -125
  168. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
  169. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +135 -364
  170. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
  171. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +20 -21
  172. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js.map +1 -1
  173. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +20 -71
  174. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js.map +1 -1
  175. package/build/widgets/ContextMenu/ContextMenu.js +12 -11
  176. package/build/widgets/ContextMenu/ContextMenu.js.map +1 -1
  177. package/build/widgets/ContextMenu/ContextMenu.styled.js +4 -4
  178. package/build/widgets/ContextMenu/ContextMenu.styled.js.map +1 -1
  179. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +17 -25
  180. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js.map +1 -1
  181. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +16 -71
  182. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js.map +1 -1
  183. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +7 -11
  184. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js.map +1 -1
  185. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +4 -11
  186. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js.map +1 -1
  187. package/build/widgets/InfoCard/InfoCard.js +26 -21
  188. package/build/widgets/InfoCard/InfoCard.js.map +1 -1
  189. package/build/widgets/InfoCard/InfoCard.styled.js +36 -84
  190. package/build/widgets/InfoCard/InfoCard.styled.js.map +1 -1
  191. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js +28 -34
  192. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js.map +1 -1
  193. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js +21 -57
  194. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js.map +1 -1
  195. package/build/widgets/InstructionSeverityDisplay/index.js +2 -0
  196. package/build/widgets/InstructionSeverityDisplay/index.js.map +1 -0
  197. package/build/widgets/Instructions/Instructions.js +53 -95
  198. package/build/widgets/Instructions/Instructions.js.map +1 -1
  199. package/build/widgets/Instructions/Instructions.styled.js +27 -26
  200. package/build/widgets/Instructions/Instructions.styled.js.map +1 -1
  201. package/build/widgets/ProgressBar/ProgressBar.js +39 -37
  202. package/build/widgets/ProgressBar/ProgressBar.js.map +1 -1
  203. package/build/widgets/ProgressBar/ProgressBar.styled.js +56 -125
  204. package/build/widgets/ProgressBar/ProgressBar.styled.js.map +1 -1
  205. package/build/widgets/SummaryCard/SummaryCard.js +55 -64
  206. package/build/widgets/SummaryCard/SummaryCard.js.map +1 -1
  207. package/build/widgets/SummaryCard/SummaryCard.styled.js +51 -106
  208. package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -1
  209. package/package.json +84 -36
  210. package/styles/utils/colors-export.d.ts +54 -0
  211. package/types/components/data/Alert/Alert.d.ts +76 -0
  212. package/types/components/data/Alert/Alert.styled.d.ts +52 -0
  213. package/types/components/data/Alert/index.d.ts +1 -0
  214. package/types/components/data/Badge/Badge.d.ts +120 -0
  215. package/types/components/data/Badge/Badge.styled.d.ts +33 -0
  216. package/types/components/data/Badge/index.d.ts +1 -0
  217. package/types/components/data/Popover/Popover.d.ts +116 -0
  218. package/types/components/data/Popover/Popover.styled.d.ts +15 -0
  219. package/types/components/data/Popover/index.d.ts +1 -0
  220. package/types/components/data/SeverityBadge/SeverityBadge.d.ts +72 -0
  221. package/types/components/data/SeverityBadge/index.d.ts +1 -0
  222. package/types/components/data/Tab/Tab.d.ts +14 -0
  223. package/types/components/data/Tab/Tab.styled.d.ts +1 -0
  224. package/types/components/data/Tab/index.d.ts +1 -0
  225. package/types/components/data/Tabs/Tabs.d.ts +111 -0
  226. package/types/components/data/Tabs/Tabs.styled.d.ts +26 -0
  227. package/types/components/data/Tabs/index.d.ts +1 -0
  228. package/types/components/data/Tooltip/Tooltip.d.ts +88 -0
  229. package/types/components/data/Tooltip/Tooltip.styled.d.ts +8 -0
  230. package/types/components/data/Tooltip/index.d.ts +1 -0
  231. package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.d.ts +35 -0
  232. package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.d.ts +27 -0
  233. package/types/components/data/VerificationStatusIcon/index.d.ts +1 -0
  234. package/types/components/data/_shared/FloatingArrow.styled.d.ts +29 -0
  235. package/types/components/data/index.d.ts +8 -0
  236. package/types/components/index.d.ts +3 -0
  237. package/types/components/inputs/ActionButton/ActionButton.d.ts +55 -0
  238. package/types/components/inputs/ActionButton/ActionButton.styled.d.ts +16 -0
  239. package/types/components/inputs/ActionButton/index.d.ts +1 -0
  240. package/types/components/inputs/Button/Button.d.ts +82 -0
  241. package/types/components/inputs/Button/Button.styled.d.ts +60 -0
  242. package/types/components/inputs/Button/index.d.ts +1 -0
  243. package/types/components/inputs/Checkbox/Checkbox.d.ts +83 -0
  244. package/types/components/inputs/Checkbox/Checkbox.styled.d.ts +29 -0
  245. package/types/components/inputs/Checkbox/index.d.ts +1 -0
  246. package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.d.ts +242 -0
  247. package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.d.ts +104 -0
  248. package/types/components/inputs/CompactAutocompleteSelect/index.d.ts +1 -0
  249. package/types/components/inputs/CompactStarRating/CompactStarRating.d.ts +96 -0
  250. package/types/components/inputs/CompactStarRating/CompactStarRating.styled.d.ts +34 -0
  251. package/types/components/inputs/CompactStarRating/index.d.ts +1 -0
  252. package/types/components/inputs/CompactTextInput/CompactTextInput.d.ts +116 -0
  253. package/types/components/inputs/CompactTextInput/CompactTextInput.styled.d.ts +42 -0
  254. package/types/components/inputs/CompactTextInput/index.d.ts +1 -0
  255. package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.d.ts +41 -0
  256. package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.d.ts +13 -0
  257. package/types/components/inputs/MultiLevelCheckbox/index.d.ts +2 -0
  258. package/types/components/inputs/MultiLevelCheckbox/types.d.ts +29 -0
  259. package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.d.ts +44 -0
  260. package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.d.ts +11 -0
  261. package/types/components/inputs/MultiLevelCheckboxSelect/index.d.ts +1 -0
  262. package/types/components/inputs/MultiSelect/MultiSelect.d.ts +115 -0
  263. package/types/components/inputs/MultiSelect/MultiSelect.styled.d.ts +34 -0
  264. package/types/components/inputs/MultiSelect/index.d.ts +1 -0
  265. package/types/components/inputs/Radio/Radio.d.ts +65 -0
  266. package/types/components/inputs/Radio/Radio.styled.d.ts +11 -0
  267. package/types/components/inputs/Radio/index.d.ts +1 -0
  268. package/types/components/inputs/Switch/Switch.d.ts +62 -0
  269. package/types/components/inputs/Switch/Switch.styled.d.ts +16 -0
  270. package/types/components/inputs/Switch/index.d.ts +1 -0
  271. package/types/components/inputs/TextArea/TextArea.d.ts +120 -0
  272. package/types/components/inputs/TextArea/TextArea.styled.d.ts +93 -0
  273. package/types/components/inputs/TextArea/index.d.ts +1 -0
  274. package/types/components/inputs/TextInput/TextInput.d.ts +109 -0
  275. package/types/components/inputs/TextInput/TextInput.styled.d.ts +43 -0
  276. package/types/components/inputs/TextInput/index.d.ts +1 -0
  277. package/types/components/inputs/index.d.ts +13 -0
  278. package/types/components/layout/InputGroup/InputGroup.d.ts +31 -0
  279. package/types/components/layout/InputGroup/InputGroup.styled.d.ts +1 -0
  280. package/types/components/layout/InputGroup/index.d.ts +1 -0
  281. package/types/components/layout/SectionSeparator/SectionSeparator.d.ts +28 -0
  282. package/types/components/layout/SectionSeparator/SectionSeparator.styled.d.ts +7 -0
  283. package/types/components/layout/SectionSeparator/index.d.ts +1 -0
  284. package/types/components/layout/index.d.ts +2 -0
  285. package/types/components/widgets/AssetAction/AssetAction.d.ts +16 -0
  286. package/types/components/widgets/AssetAction/AssetAction.styled.d.ts +15 -0
  287. package/types/components/widgets/AssetAction/index.d.ts +1 -0
  288. package/types/components/widgets/AssetActionsBase/AssetActionsBase.d.ts +25 -0
  289. package/types/components/widgets/AssetActionsBase/AssetActionsBase.styled.d.ts +1 -0
  290. package/types/components/widgets/AssetActionsBase/index.d.ts +1 -0
  291. package/types/components/widgets/AssetGallery/AssetGallery.d.ts +170 -0
  292. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.d.ts +76 -0
  293. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.d.ts +3 -0
  294. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.d.ts +3 -0
  295. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.d.ts +52 -0
  296. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.d.ts +2 -0
  297. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.d.ts +49 -0
  298. package/types/components/widgets/AssetGallery/asset.types.d.ts +329 -0
  299. package/types/components/widgets/AssetGallery/index.d.ts +1 -0
  300. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.d.ts +60 -0
  301. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.d.ts +21 -0
  302. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/index.d.ts +1 -0
  303. package/types/components/widgets/ContextMenu/ContextMenu.d.ts +118 -0
  304. package/types/components/widgets/ContextMenu/ContextMenu.styled.d.ts +1 -0
  305. package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.d.ts +45 -0
  306. package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.d.ts +18 -0
  307. package/types/components/widgets/ContextMenu/ContextMenuItem/index.d.ts +1 -0
  308. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.d.ts +23 -0
  309. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.d.ts +1 -0
  310. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/index.d.ts +1 -0
  311. package/types/components/widgets/ContextMenu/index.d.ts +1 -0
  312. package/types/components/widgets/InfoCard/InfoCard.d.ts +33 -0
  313. package/types/components/widgets/InfoCard/InfoCard.styled.d.ts +28 -0
  314. package/types/components/widgets/InfoCard/index.d.ts +1 -0
  315. package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.d.ts +46 -0
  316. package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.d.ts +30 -0
  317. package/types/components/widgets/InstructionSeverityDisplay/index.d.ts +1 -0
  318. package/types/components/widgets/Instructions/Instructions.d.ts +156 -0
  319. package/types/components/widgets/Instructions/Instructions.styled.d.ts +14 -0
  320. package/types/components/widgets/Instructions/index.d.ts +1 -0
  321. package/types/components/widgets/ProgressBar/ProgressBar.d.ts +30 -0
  322. package/types/components/widgets/ProgressBar/ProgressBar.styled.d.ts +41 -0
  323. package/types/components/widgets/ProgressBar/index.d.ts +1 -0
  324. package/types/components/widgets/SummaryCard/SummaryCard.d.ts +83 -0
  325. package/types/components/widgets/SummaryCard/SummaryCard.styled.d.ts +29 -0
  326. package/types/components/widgets/SummaryCard/index.d.ts +1 -0
  327. package/types/components/widgets/index.d.ts +11 -0
  328. package/types/hooks/useElementSize.d.ts +14 -0
  329. package/types/hooks/useEventListner.d.ts +14 -0
  330. package/types/hooks/useFloatingPopover.d.ts +161 -0
  331. package/types/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  332. package/types/hooks/useOnClickOutside.d.ts +13 -0
  333. package/types/hooks/useTooltipAutoShow.d.ts +31 -0
  334. package/types/icons/index.d.ts +41 -0
  335. package/types/ssr/index.d.ts +1 -0
  336. package/types/styles/utils/colors-export.d.ts +54 -0
  337. package/types/utils/dateTime.d.ts +8 -0
  338. package/types/utils/defaultTheme.d.ts +95 -0
  339. package/types/utils/getElementRef.d.ts +2 -0
  340. package/types/utils/parseTrigger.d.ts +22 -0
  341. package/build/_virtual/_rollupPluginBabelHelpers.js +0 -12
  342. package/build/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  343. package/build/widgets/AssetGallery/asset.propType.js +0 -56
  344. package/build/widgets/AssetGallery/asset.propType.js.map +0 -1
package/README.md CHANGED
@@ -98,6 +98,40 @@ You can build the library with:
98
98
  npm run build
99
99
  ```
100
100
 
101
+ ### 🛡️ Visual regression gate
102
+
103
+ Every Storybook story is screenshotted in both the light and the dark theme and
104
+ compared pixel for pixel against a set of baseline images. Use it whenever you
105
+ change anything under `src/`, because a styling change that looks harmless in one
106
+ story often moves another.
107
+
108
+ The gate needs a browser binary once per checkout:
109
+
110
+ ```
111
+ npx playwright install chromium chromium-headless-shell
112
+ ```
113
+
114
+ Record the baselines on a clean checkout, before you make any changes:
115
+
116
+ ```
117
+ npm run verify:visual:baseline
118
+ ```
119
+
120
+ Then, after your changes, compare against them:
121
+
122
+ ```
123
+ npm run verify:visual:compare
124
+ ```
125
+
126
+ A report opens on failure showing the before, after and diff of every story that
127
+ moved. Read it and decide whether the change was intended before you re-record.
128
+
129
+ The baselines are **not** committed. There are close to 600 of them, they change
130
+ on any deliberate styling change, and a binary diff tells a reviewer nothing, so
131
+ they stay local and each machine records its own. They are also
132
+ platform-specific: font rasterisation differs between macOS and Linux, so a
133
+ baseline recorded on one cannot be compared against a run on the other.
134
+
101
135
  ### 🧪 Installing the package locally (for testing only)
102
136
 
103
137
  Let's say you have another project (`test-app`) on your machine that you want to try installing the component library
@@ -1,19 +1,18 @@
1
- import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
- import PropTypes from 'prop-types';
4
2
  import { Alert as Alert$1, AlertRender } from './Alert.styled.js';
5
3
  import { isEmpty } from 'lodash';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
5
 
7
6
  const Alert = React__default.forwardRef(function Alert({
8
7
  type,
9
- alertMessage,
10
- align,
8
+ alertMessage = 'Use subject to restrictions. Editorial use only, no commercial use without prior consent from rights holder.',
9
+ align = 'left',
11
10
  icon,
12
11
  fontSize,
13
12
  lineHeight,
14
- lineClamp,
15
- verticalPadding,
16
- horizontalPadding,
13
+ lineClamp = 0,
14
+ verticalPadding = 17,
15
+ horizontalPadding = 30,
17
16
  width,
18
17
  ...props
19
18
  }, forwardedRef) {
@@ -33,7 +32,7 @@ const Alert = React__default.forwardRef(function Alert({
33
32
  isInfo = false;
34
33
  }
35
34
  }
36
- return React__default.createElement(Alert$1, _extends({
35
+ return jsx(Alert$1, {
37
36
  ref: forwardedRef,
38
37
  $alertMessage: alertMessage,
39
38
  $warning: isWarning,
@@ -42,32 +41,18 @@ const Alert = React__default.forwardRef(function Alert({
42
41
  $align: align,
43
42
  $verticalPadding: verticalPadding,
44
43
  $horizontalPadding: horizontalPadding,
45
- width: width
46
- }, props), React__default.createElement(AlertRender, {
47
- fontSize: fontSize,
48
- $lineHeight: lineHeight,
49
- $lineClamp: lineClamp
50
- }, icon, " ", React__default.createElement("span", null, alertMessage)));
44
+ width: width,
45
+ ...props,
46
+ children: jsxs(AlertRender, {
47
+ fontSize: fontSize,
48
+ $lineHeight: lineHeight,
49
+ $lineClamp: lineClamp,
50
+ children: [icon, " ", jsx("span", {
51
+ children: alertMessage
52
+ })]
53
+ })
54
+ });
51
55
  });
52
- Alert.propTypes = process.env.NODE_ENV !== "production" ? {
53
- type: PropTypes.oneOf(['warning', 'error', 'info']),
54
- icon: PropTypes.element,
55
- align: PropTypes.oneOf(['left', 'center']),
56
- alertMessage: PropTypes.string,
57
- fontSize: PropTypes.number,
58
- lineHeight: PropTypes.number,
59
- lineClamp: PropTypes.number,
60
- verticalPadding: PropTypes.number,
61
- horizontalPadding: PropTypes.number,
62
- width: PropTypes.number
63
- } : {};
64
- Alert.defaultProps = {
65
- align: 'left',
66
- alertMessage: 'Use subject to restrictions. Editorial use only, no commercial use without prior consent from rights holder.',
67
- lineClamp: 0,
68
- horizontalPadding: 30,
69
- verticalPadding: 17
70
- };
71
56
 
72
57
  export { Alert as default };
73
58
  //# sourceMappingURL=Alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../../src/components/data/Alert/Alert.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './Alert.styled';\nimport { isEmpty } from 'lodash';\n\n/**\n * Alert display warnings or errors.\n *\n * ### Import\n *\n * ``` js\n * import { Alert } from '@ntbjs/react-components/data'\n * // or\n * import Alert from '@ntbjs/react-components/data/Alert'\n * ```\n * ## Props\n * ```\n * Pass one of `warning`, `error` or `info` to the `type` prop to render the right Alert.\n * Pass `align={left}`or `align={center}` to align content.\n * Pass `icon={<svg></svg>}` to display an icon.\n * Pass `alertMessage={'message'} to display the message\n * Pass `fontSize={number}` to set the font size of the message in pixel\n * Pass `lineHeight={number}` to set the line height of the message in pixel\n * Pass `lineClamp={number}` to set the number of lines before the message will be truncated\n * Pass `verticalPadding={number}` to set the top and bottom padding of the alert in pixel\n * Pass `horizontalPadding={number}` to set the left and right padding of the alert in pixel\n * Pass `width={number}` to set the width of the alert in pixel\n * ```\n * ### Warning / Error / Info\n * ```\n * <Alert type={\"warning\"} />\n * <Alert type={\"error\"} />\n * <Alert type={\"info\"} />\n * ```\n */\n\nconst Alert = React.forwardRef(function Alert(\n {\n type,\n alertMessage,\n align,\n icon,\n fontSize,\n lineHeight,\n lineClamp,\n verticalPadding,\n horizontalPadding,\n width,\n ...props\n },\n forwardedRef\n) {\n let isWarning = false;\n let isError = false;\n let isInfo = true;\n\n if (!isEmpty(type)) {\n if (type === 'warning') {\n isWarning = true;\n } else if (type === 'error') {\n isError = true;\n } else {\n isInfo = true;\n }\n } else {\n if (isWarning || isError) {\n isInfo = false;\n }\n }\n\n return (\n <S.Alert\n ref={forwardedRef}\n $alertMessage={alertMessage}\n $warning={isWarning}\n $error={isError}\n $info={isInfo}\n $align={align}\n $verticalPadding={verticalPadding}\n $horizontalPadding={horizontalPadding}\n width={width}\n {...props}\n >\n <S.AlertRender fontSize={fontSize} $lineHeight={lineHeight} $lineClamp={lineClamp}>\n {icon} <span>{alertMessage}</span>\n </S.AlertRender>\n </S.Alert>\n );\n});\n\nAlert.propTypes = {\n /**\n * Type of alert that will be reflected by the background color of it.\n */\n type: PropTypes.oneOf(['warning', 'error', 'info']),\n /**\n * Icon that will be displayed on the left of the alert message.\n */\n icon: PropTypes.element,\n /**\n * Alignment of the alert message.\n */\n align: PropTypes.oneOf(['left', 'center']),\n /**\n * Message that will be displayed on the alert.\n */\n alertMessage: PropTypes.string,\n /**\n * Font size of the alert message in pixel.\n */\n fontSize: PropTypes.number,\n /**\n * Line height of the alert message in pixel.\n */\n lineHeight: PropTypes.number,\n /**\n * Number of lines that will be displayed before the message will be truncated and replaced with ellipsis.\n */\n lineClamp: PropTypes.number,\n /**\n * The top and bottom padding of the alert in pixel.\n */\n verticalPadding: PropTypes.number,\n /**\n * The left and right padding of the alert in pixel.\n */\n horizontalPadding: PropTypes.number,\n /**\n * Custom width of the alert in pixel.\n */\n width: PropTypes.number\n};\n\nAlert.defaultProps = {\n align: 'left',\n alertMessage:\n 'Use subject to restrictions. Editorial use only, no commercial use without prior consent from rights holder.',\n lineClamp: 0,\n horizontalPadding: 30,\n verticalPadding: 17\n};\n\nexport default Alert;\n"],"names":["Alert","React","forwardRef","type","alertMessage","align","icon","fontSize","lineHeight","lineClamp","verticalPadding","horizontalPadding","width","props","forwardedRef","isWarning","isError","isInfo","isEmpty","createElement","S","_extends","ref","$alertMessage","$warning","$error","$info","$align","$verticalPadding","$horizontalPadding","$lineHeight","$lineClamp","propTypes","process","env","NODE_ENV","PropTypes","oneOf","element","string","number","defaultProps"],"mappings":";;;;;;AAoCMA,MAAAA,KAAK,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,KAAKA,CAC3C;EACEG,IAAI;EACJC,YAAY;EACZC,KAAK;EACLC,IAAI;EACJC,QAAQ;EACRC,UAAU;EACVC,SAAS;EACTC,eAAe;EACfC,iBAAiB;EACjBC,KAAK;EACL,GAAGC,KAAAA;AACL,CAAC,EACDC,YAAY,EACZ;EACA,IAAIC,SAAS,GAAG,KAAK,CAAA;EACrB,IAAIC,OAAO,GAAG,KAAK,CAAA;EACnB,IAAIC,MAAM,GAAG,IAAI,CAAA;AAEjB,EAAA,IAAI,CAACC,OAAO,CAACf,IAAI,CAAC,EAAE;IAClB,IAAIA,IAAI,KAAK,SAAS,EAAE;AACtBY,MAAAA,SAAS,GAAG,IAAI,CAAA;AAClB,KAAC,MAAM,IAAIZ,IAAI,KAAK,OAAO,EAAE;AAC3Ba,MAA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EAAEgC,SAAS,CAACG,MAAM;EAI9BhC,QAAQ,EAAE6B,SAAS,CAACI,MAAM;EAI1BhC,UAAU,EAAE4B,SAAS,CAACI,MAAM;EAI5B/B,SAAS,EAAE2B,SAAS,CAACI,MAAM;EAI3B9B,eAAe,EAAE0B,SAAS,CAACI,MAAM;EAIjC7B,iBAAiB,EAAEyB,SAAS,CAACI,MAAM;EAInC5B,KAAK,EAAEwB,SAAS,CAACI,MAAAA;AACnB,CAAC,GAAA,EAAA,CAAA;AAEDxC,KAAK,CAACyC,YAAY,GAAG;AACnBpC,EAAAA,KAAK,EAAE,MAAM;AACbD,EAAAA,YAAY,EACV,8GAA8G;AAChHK,EAAAA,SAAS,EAAE,CAAC;AACZE,EAAAA,iBAAiB,EAAE,EAAE;AACrBD,EAAAA,eAAe,EAAE,EAAA;AACnB,CAAC;;;;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../../src/components/data/Alert/Alert.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './Alert.styled';\nimport { isEmpty } from 'lodash';\n\ntype AlertOwnProps = {\n /**\n * Type of alert that will be reflected by the background color of it.\n */\n type?: 'warning' | 'error' | 'info';\n /**\n * Icon that will be displayed on the left of the alert message.\n */\n icon?: React.ReactElement<any>;\n /**\n * Alignment of the alert message.\n */\n align?: 'left' | 'center';\n /**\n * Message that will be displayed on the alert.\n */\n alertMessage?: string;\n /**\n * Font size of the alert message in pixel.\n */\n fontSize?: number;\n /**\n * Line height of the alert message in pixel.\n */\n lineHeight?: number;\n /**\n * Number of lines that will be displayed before the message will be truncated and replaced with ellipsis.\n */\n lineClamp?: number;\n /**\n * The top and bottom padding of the alert in pixel.\n */\n verticalPadding?: number;\n /**\n * The left and right padding of the alert in pixel.\n */\n horizontalPadding?: number;\n /**\n * Custom width of the alert in pixel.\n */\n width?: number;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<React.ComponentPropsWithoutRef<typeof S.Alert>, keyof AlertOwnProps> &\n AlertOwnProps;\n\n/**\n * Alert display warnings or errors.\n *\n * ### Import\n *\n * ``` js\n * import { Alert } from '@ntbjs/react-components/data'\n * // or\n * import Alert from '@ntbjs/react-components/data/Alert'\n * ```\n * ## Props\n * ```\n * Pass one of `warning`, `error` or `info` to the `type` prop to render the right Alert.\n * Pass `align={left}`or `align={center}` to align content.\n * Pass `icon={<svg></svg>}` to display an icon.\n * Pass `alertMessage={'message'} to display the message\n * Pass `fontSize={number}` to set the font size of the message in pixel\n * Pass `lineHeight={number}` to set the line height of the message in pixel\n * Pass `lineClamp={number}` to set the number of lines before the message will be truncated\n * Pass `verticalPadding={number}` to set the top and bottom padding of the alert in pixel\n * Pass `horizontalPadding={number}` to set the left and right padding of the alert in pixel\n * Pass `width={number}` to set the width of the alert in pixel\n * ```\n * ### Warning / Error / Info\n * ```\n * <Alert type={\"warning\"} />\n * <Alert type={\"error\"} />\n * <Alert type={\"info\"} />\n * ```\n */\n\nconst Alert = React.forwardRef<any, Props>(function Alert(\n {\n type,\n alertMessage = 'Use subject to restrictions. Editorial use only, no commercial use without prior consent from rights holder.',\n align = 'left',\n icon,\n fontSize,\n lineHeight,\n lineClamp = 0,\n verticalPadding = 17,\n horizontalPadding = 30,\n width,\n ...props\n },\n forwardedRef\n) {\n let isWarning = false;\n let isError = false;\n let isInfo = true;\n\n if (!isEmpty(type)) {\n if (type === 'warning') {\n isWarning = true;\n } else if (type === 'error') {\n isError = true;\n } else {\n isInfo = true;\n }\n } else {\n if (isWarning || isError) {\n isInfo = false;\n }\n }\n\n return (\n <S.Alert\n ref={forwardedRef}\n $alertMessage={alertMessage}\n $warning={isWarning}\n $error={isError}\n $info={isInfo}\n $align={align}\n $verticalPadding={verticalPadding}\n $horizontalPadding={horizontalPadding}\n width={width}\n {...props}\n >\n <S.AlertRender fontSize={fontSize} $lineHeight={lineHeight} $lineClamp={lineClamp}>\n {icon} <span>{alertMessage}</span>\n </S.AlertRender>\n </S.Alert>\n );\n});\n\nexport default Alert;\n"],"names":["Alert","React","forwardRef","type","alertMessage","align","icon","fontSize","lineHeight","lineClamp","verticalPadding","horizontalPadding","width","props","forwardedRef","isWarning","isError","isInfo","isEmpty","_jsx","S","ref","$alertMessage","$warning","$error","$info","$align","$verticalPadding","$horizontalPadding","children","_jsxs","$lineHeight","$lineClamp"],"mappings":";;;;;AAkFA,MAAMA,KAAK,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,KAAKA,CACvD;EACEG,IAAI;AACJC,EAAAA,YAAY,GAAG,8GAA8G;AAC7HC,EAAAA,KAAK,GAAG,MAAM;EACdC,IAAI;EACJC,QAAQ;EACRC,UAAU;AACVC,EAAAA,SAAS,GAAG,CAAC;AACbC,EAAAA,eAAe,GAAG,EAAE;AACpBC,EAAAA,iBAAiB,GAAG,EAAE;EACtBC,KAAK;EACL,GAAGC;AACL,CAAC,EACDC,YAAY,EACZ;EACA,IAAIC,SAAS,GAAG,KAAK;EACrB,IAAIC,OAAO,GAAG,KAAK;EACnB,IAAIC,MAAM,GAAG,IAAI;AAEjB,EAAA,IAAI,CAACC,OAAO,CAACf,IAAI,CAAC,EAAE;IAClB,IAAIA,IAAI,KAAK,SAAS,EAAE;AACtBY,MAAAA,SAAS,GAAG,IAAI;AAClB,IAAA,CAAC,MAAM,IAAIZ,IAAI,KAAK,OAAO,EAAE;AAC3Ba,MAAAA,OAAO,GAAG,IAAI;AAChB,IAAA,CAAC,MAAM;AACLC,MAAAA,MAAM,GAAG,IAAI;AACf,IAAA;AACF,EAAA,CAAC,MAAM;IACL,IAAIF,SAAS,IAAIC,OAAO,EAAE;AACxBC,MAAAA,MAAM,GAAG,KAAK;AAChB,IAAA;AACF,EAAA;AAEA,EAAA,OACEE,GAAA,CAACC,OAAO,EAAA;AACNC,IAAAA,GAAG,EAAEP,YAAa;AAClBQ,IAAAA,aAAa,EAAElB,YAAa;AAC5BmB,IAAAA,QAAQ,EAAER,SAAU;AACpBS,IAAAA,MAAM,EAAER,OAAQ;AAChBS,IAAAA,KAAK,EAAER,MAAO;AACdS,IAAAA,MAAM,EAAErB,KAAM;AACdsB,IAAAA,gBAAgB,EAAEjB,eAAgB;AAClCkB,IAAAA,kBAAkB,EAAEjB,iBAAkB;AACtCC,IAAAA,KAAK,EAAEA,KAAM;AAAA,IAAA,GACTC,KAAK;AAAAgB,IAAAA,QAAA,EAETC,IAAA,CAACV,WAAa,EAAA;AAACb,MAAAA,QAAQ,EAAEA,QAAS;AAACwB,MAAAA,WAAW,EAAEvB,UAAW;AAACwB,MAAAA,UAAU,EAAEvB,SAAU;AAAAoB,MAAAA,QAAA,EAAA,CAC/EvB,IAAI,EAAC,GAAC,EAAAa,GAAA,CAAA,MAAA,EAAA;AAAAU,QAAAA,QAAA,EAAOzB;AAAY,OAAO,CAAC;KACrB;AAAC,GACT,CAAC;AAEd,CAAC;;;;"}
@@ -6,58 +6,20 @@ const shouldForwardProp = prop => {
6
6
  };
7
7
  const Alert = styled.div.withConfig({
8
8
  shouldForwardProp
9
- }).attrs(applyDefaultTheme)`
10
- display: flex;
11
- flex-direction: column;
12
- padding: ${props => {
9
+ }).attrs(applyDefaultTheme).withConfig({
10
+ displayName: "Alertstyled__Alert",
11
+ componentId: "sc-8n1qjj-0"
12
+ })(["display:flex;flex-direction:column;padding:", ";width:", ";box-sizing:border-box;", " ", " ", " text-align:", ";"], props => {
13
13
  const verticalPadding = props.$verticalPadding ?? 17;
14
14
  const horizontalPadding = props.$horizontalPadding ?? 30;
15
15
  return `${verticalPadding}px ${horizontalPadding}px`;
16
- }};
17
- width: ${props => props.width ? `${props.width}px` : '100%'};
18
- box-sizing: border-box;
19
-
20
- ${props => props.$warning && css`
21
- ${props.theme.themeProp('background', '#634E01', props.theme.getColor('signal-yellow-400'))}
22
- `}
23
-
24
- ${props => props.$error && css`
25
- ${props.theme.themeProp('background', '#7F1B1B', props.theme.getColor('red-200'))}
26
- `}
27
-
28
- ${props => props.$info && css`
29
- background: transparent;
30
- `}
31
-
32
- text-align: ${props => props.align === 'center' ? 'center' : 'left'};
33
- `;
16
+ }, props => props.width ? `${props.width}px` : '100%', props => props.$warning && css(["", ""], props.theme.themeProp('background', '#634E01', props.theme.getColor('signal-yellow-400'))), props => props.$error && css(["", ""], props.theme.themeProp('background', '#7F1B1B', props.theme.getColor('red-200'))), props => props.$info && css(["background:transparent;"]), props => props.align === 'center' ? 'center' : 'left');
34
17
  const AlertRender = styled.div.withConfig({
35
18
  shouldForwardProp
36
- }).attrs(applyDefaultTheme)`
37
- display: flex;
38
- align-items: center;
39
- word-break: break-word;
40
- ${props => props.$lineHeight ? `line-height: ${props.$lineHeight}px;` : null}
41
- ${props => props.fontSize ? `font-size: ${props.fontSize}px;` : null}
42
- ${props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))};
43
-
44
- svg {
45
- width: 12px;
46
- height: 12px;
47
- }
48
-
49
- span {
50
- flex: 1;
51
- padding-left: 5px;
52
- ${props => props.$lineClamp ? css`
53
- display: -webkit-box;
54
- -webkit-line-clamp: ${props.$lineClamp};
55
- -webkit-box-orient: vertical;
56
- overflow: hidden;
57
- text-overflow: ellipsis;
58
- ` : null};
59
- }
60
- `;
19
+ }).attrs(applyDefaultTheme).withConfig({
20
+ displayName: "Alertstyled__AlertRender",
21
+ componentId: "sc-8n1qjj-1"
22
+ })(["display:flex;align-items:center;word-break:break-word;", " ", " ", ";svg{width:12px;height:12px;}span{flex:1;padding-left:5px;", ";}"], props => props.$lineHeight ? `line-height: ${props.$lineHeight}px;` : null, props => props.fontSize ? `font-size: ${props.fontSize}px;` : null, props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700')), props => props.$lineClamp ? css(["display:-webkit-box;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;"], props.$lineClamp) : null);
61
23
 
62
24
  export { Alert, AlertRender };
63
25
  //# sourceMappingURL=Alert.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.styled.js","sources":["../../../src/components/data/Alert/Alert.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 Alert = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n flex-direction: column;\n padding: ${props => {\n const verticalPadding = props.$verticalPadding ?? 17;\n const horizontalPadding = props.$horizontalPadding ?? 30;\n return `${verticalPadding}px ${horizontalPadding}px`;\n }};\n width: ${props => (props.width ? `${props.width}px` : '100%')};\n box-sizing: border-box;\n\n ${props =>\n props.$warning &&\n css`\n ${props.theme.themeProp('background', '#634E01', props.theme.getColor('signal-yellow-400'))}\n `}\n\n ${props =>\n props.$error &&\n css`\n ${props.theme.themeProp('background', '#7F1B1B', props.theme.getColor('red-200'))}\n `}\n \n ${props =>\n props.$info &&\n css`\n background: transparent;\n `}\n \n text-align: ${props => (props.align === 'center' ? 'center' : 'left')};\n`;\n\nexport const AlertRender = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n word-break: break-word;\n ${props => (props.$lineHeight ? `line-height: ${props.$lineHeight}px;` : null)}\n ${props => (props.fontSize ? `font-size: ${props.fontSize}px;` : null)}\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n\n svg {\n width: 12px;\n height: 12px;\n }\n\n span {\n flex: 1;\n padding-left: 5px;\n ${props =>\n props.$lineClamp\n ? css`\n display: -webkit-box;\n -webkit-line-clamp: ${props.$lineClamp};\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n `\n : null};\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Alert","styled","div","withConfig","attrs","applyDefaultTheme","props","verticalPadding","$verticalPadding","horizontalPadding","$horizontalPadding","width","$warning","css","theme","themeProp","getColor","$error","$info","align","AlertRender","$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A,EAAA,EAAIV,KAAK,IACLA,KAAK,CAACY,KAAK,IACXL,GAAG,CAAA;AACP;AACA,IAAK,CAAA,CAAA;AACL;AACA,cAAgBP,EAAAA,KAAK,IAAKA,KAAK,CAACa,KAAK,KAAK,QAAQ,GAAG,QAAQ,GAAG,MAAO,CAAA;AACvE,EAAC;AAEM,MAAMC,WAAW,GAAGnB,MAAM,CAACC,GAAG,CAClCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA,EAAA,EAAIC,KAAK,IAAKA,KAAK,CAACe,WAAW,GAAG,CAAgBf,aAAAA,EAAAA,KAAK,CAACe,WAAW,CAAK,GAAA,CAAA,GAAG,IAAK,CAAA;AAChF,EAAA,EAAIf,KAAK,IAAKA,KAAK,CAACgB,QAAQ,GAAG,CAAchB,WAAAA,EAAAA,KAAK,CAACgB,QAAQ,CAAK,GAAA,CAAA,GAAG,IAAK,CAAA;AACxE,EAAIhB,EAAAA,KAAK,IACLA,KAAK,CAACQ,KAAK,CAACC,SAAS,CACnB,OAAO,EACPT,KAAK,CAACQ,KAAK,CAACE,QAAQ,CAAC,OAAO,CAAC,EAC7BV,KAAK,CAACQ,KAAK,CAACE,QAAQ,CAAC,UAAU,CACjC,CAAC,CAAA;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAA,EAAMV,KAAK,IACLA,KAAK,CAACiB,UAAU,GACZV,GAAG,CAAA;AACb;AACA,gCAAkCP,EAAAA,KAAK,CAACiB,UAAU,CAAA;AAClD;AACA;AACA;AACA,UAAA,CAAW,GACD,IAAI,CAAA;AACd;AACA;;;;"}
1
+ {"version":3,"file":"Alert.styled.js","sources":["../../../src/components/data/Alert/Alert.styled.ts"],"sourcesContent":["/*\n * Three deferred defects declared here: width, fontSize leak to DOM; align is read but never passed.\n */\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/**\n * Props of the `Alert` root, i.e. what `Alert.tsx` passes to `S.Alert`. Value types come\n * from that file's propTypes; all optional.\n */\nexport interface AlertStyleProps {\n /** `isWarning` — derived in the component from `type === 'warning'`, so `boolean`. */\n $warning?: boolean;\n /** `isError` — derived from `type === 'error'`. */\n $error?: boolean;\n /** `isInfo` — derived; the component initialises it `true`. */\n $info?: boolean;\n /**\n * `verticalPadding` — `PropTypes.number`, px. `number` and not `number | string`: the\n * template interpolates `${…}px`, so a string would already emit `padding: 17pxpx`.\n */\n $verticalPadding?: number;\n /** `horizontalPadding` — `PropTypes.number`, px, interpolated the same way. */\n $horizontalPadding?: number;\n /**\n * `alertMessage` — `PropTypes.string`. Component passes it; nothing reads it. Harmless; `$` filters it.\n */\n $alertMessage?: string;\n /**\n * `align` — `PropTypes.oneOf(['left', 'center'])`. Defect: component passes `$align`; template reads plain `align` instead. No-op; every Alert is left-aligned.\n */\n $align?: 'left' | 'center';\n /**\n * `width` — `PropTypes.number`, px. Defect: no `$` means it leaks to DOM as invalid `width=\"480\"` attribute.\n */\n width?: number;\n /**\n * `align` in its non-`$` form — read but never passed; comparison always false.\n */\n align?: 'left' | 'center';\n}\n\n/** Props of `AlertRender`, i.e. what `Alert.tsx` passes to `S.AlertRender`. */\ninterface AlertRenderStyleProps {\n /** `lineHeight` — `PropTypes.number`, px, interpolated as `${…}px`. */\n $lineHeight?: number;\n /**\n * `lineClamp` — `PropTypes.number`, the `-webkit-line-clamp` count. The component\n * defaults it to `0`, which is falsy, so the clamp block is opt-in.\n */\n $lineClamp?: number;\n /**\n * `fontSize` — `PropTypes.number`, px. Defect: no `$` means it leaks to DOM as `font-size=\"12\"` attribute.\n */\n fontSize?: number;\n}\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter. `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\nexport const Alert = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<AlertStyleProps>(applyDefaultTheme)`\n display: flex;\n flex-direction: column;\n padding: ${props => {\n const verticalPadding = props.$verticalPadding ?? 17;\n const horizontalPadding = props.$horizontalPadding ?? 30;\n return `${verticalPadding}px ${horizontalPadding}px`;\n }};\n width: ${props => (props.width ? `${props.width}px` : '100%')};\n box-sizing: border-box;\n\n ${props =>\n props.$warning &&\n css`\n ${props.theme.themeProp('background', '#634E01', props.theme.getColor('signal-yellow-400'))}\n `}\n\n ${props =>\n props.$error &&\n css`\n ${props.theme.themeProp('background', '#7F1B1B', props.theme.getColor('red-200'))}\n `}\n \n ${props =>\n props.$info &&\n css`\n background: transparent;\n `}\n \n text-align: ${props => (props.align === 'center' ? 'center' : 'left')};\n`;\n\nexport const AlertRender = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<AlertRenderStyleProps>(applyDefaultTheme)`\n display: flex;\n align-items: center;\n word-break: break-word;\n ${props => (props.$lineHeight ? `line-height: ${props.$lineHeight}px;` : null)}\n ${props => (props.fontSize ? `font-size: ${props.fontSize}px;` : null)}\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n\n svg {\n width: 12px;\n height: 12px;\n }\n\n span {\n flex: 1;\n padding-left: 5px;\n ${props =>\n props.$lineClamp\n ? css`\n display: -webkit-box;\n -webkit-line-clamp: ${props.$lineClamp};\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n `\n : null};\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Alert","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","verticalPadding","$verticalPadding","horizontalPadding","$horizontalPadding","width","$warning","css","theme","themeProp","getColor","$error","$info","align","AlertRender","$lineHeight","fontSize","$lineClamp"],"mappings":";;;AA8DA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,O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AAK,IAAKA,KAAK,CAACa,KAAK,KAAK,QAAQ,GAAG,QAAQ,GAAG,MAAO;AAGhE,MAAMC,WAAW,GAAGrB,MAAM,CAACC,GAAG,CAClCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAAwBC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,0BAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,wDAAA,EAAA,GAAA,EAAA,GAAA,EAAA,4DAAA,EAAA,IAAA,CAAA,EAI9CC,KAAK,IAAKA,KAAK,CAACe,WAAW,GAAG,CAAA,aAAA,EAAgBf,KAAK,CAACe,WAAW,CAAA,GAAA,CAAK,GAAG,IAAK,EAC5Ef,KAAK,IAAKA,KAAK,CAACgB,QAAQ,GAAG,CAAA,WAAA,EAAchB,KAAK,CAACgB,QAAQ,CAAA,GAAA,CAAK,GAAG,IAAK,EACpEhB,KAAK,IACLA,KAAK,CAACQ,KAAK,CAACC,SAAS,CACnB,OAAO,EACPT,KAAK,CAACQ,KAAK,CAACE,QAAQ,CAAC,OAAO,CAAC,EAC7BV,KAAK,CAACQ,KAAK,CAACE,QAAQ,CAAC,UAAU,CACjC,CAAC,EAUCV,KAAK,IACLA,KAAK,CAACiB,UAAU,GACZV,GAAG,sHAEqBP,KAAK,CAACiB,UAAU,CAAA,GAKxC,IAAI;;;;"}
@@ -1,19 +1,18 @@
1
- import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
- import PropTypes from 'prop-types';
3
1
  import React__default from 'react';
4
2
  import { Badge as Badge$1, BadgeChildrenContainer, BadgeLabel, BadgeIcon } from './Badge.styled.js';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
4
 
6
5
  const Badge = React__default.forwardRef(function Badge({
7
6
  badgeContent,
8
- badgeIcon,
7
+ badgeIcon = null,
9
8
  children,
10
- elevated,
9
+ elevated = false,
11
10
  fontSize,
12
- fontWeight,
13
- lineHeight,
14
- active,
15
- error,
16
- warning,
11
+ fontWeight = 'normal',
12
+ lineHeight = 'normal',
13
+ active = false,
14
+ error = false,
15
+ warning = false,
17
16
  backgroundColors,
18
17
  colors,
19
18
  verticalPadding,
@@ -30,61 +29,37 @@ const Badge = React__default.forwardRef(function Badge({
30
29
  notation: 'compact'
31
30
  }).format(badgeContent);
32
31
  }
33
- return React__default.createElement(Badge$1, _extends({
32
+ return jsxs(Badge$1, {
34
33
  ref: forwardedRef,
35
34
  $elevated: elevated,
36
- $hasChildren: Boolean(children)
37
- }, props), children && React__default.createElement(BadgeChildrenContainer, null, children), (badgeIcon || badgeContent) && React__default.createElement(BadgeLabel, {
38
- $backgroundColors: backgroundColors,
39
- $colors: colors,
40
- $elevated: elevated,
41
- fontSize: fontSize,
42
- fontWeight: fontWeight,
43
- $lineHeight: lineHeight,
44
- $active: active,
45
- $error: error,
46
- $warning: warning,
47
- $elevatedverticalPadding: verticalPadding,
48
- $horizontalPadding: horizontalPadding,
49
- height: height,
50
- $minHeight: minHeight,
51
- width: width,
52
- $minWidth: minWidth,
53
- $borderColors: borderColors
54
- }, badgeIcon && React__default.createElement(BadgeIcon, {
55
- $useGutter: !!badgeContent
56
- }, badgeIcon), badgeContent));
35
+ $hasChildren: Boolean(children),
36
+ ...props,
37
+ children: [children && jsx(BadgeChildrenContainer, {
38
+ children: children
39
+ }), (badgeIcon || badgeContent) && jsxs(BadgeLabel, {
40
+ $backgroundColors: backgroundColors,
41
+ $colors: colors,
42
+ $elevated: elevated,
43
+ fontSize: fontSize,
44
+ fontWeight: fontWeight,
45
+ $lineHeight: lineHeight,
46
+ $active: active,
47
+ $error: error,
48
+ $warning: warning,
49
+ $elevatedverticalPadding: verticalPadding,
50
+ $horizontalPadding: horizontalPadding,
51
+ height: height,
52
+ $minHeight: minHeight,
53
+ width: width,
54
+ $minWidth: minWidth,
55
+ $borderColors: borderColors,
56
+ children: [badgeIcon && jsx(BadgeIcon, {
57
+ $useGutter: !!badgeContent,
58
+ children: badgeIcon
59
+ }), badgeContent]
60
+ })]
61
+ });
57
62
  });
58
- Badge.propTypes = process.env.NODE_ENV !== "production" ? {
59
- badgeIcon: PropTypes.node,
60
- badgeContent: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.func, PropTypes.element]),
61
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
62
- elevated: PropTypes.bool,
63
- active: PropTypes.bool,
64
- error: PropTypes.bool,
65
- warning: PropTypes.bool,
66
- fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
67
- fontWeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
68
- lineHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
69
- colors: PropTypes.arrayOf(PropTypes.string),
70
- backgroundColors: PropTypes.arrayOf(PropTypes.string),
71
- verticalPadding: PropTypes.number,
72
- horizontalPadding: PropTypes.number,
73
- height: PropTypes.number,
74
- minHeight: PropTypes.number,
75
- width: PropTypes.number,
76
- minWidth: PropTypes.number,
77
- borderColors: PropTypes.arrayOf(PropTypes.string)
78
- } : {};
79
- Badge.defaultProps = {
80
- elevated: false,
81
- active: false,
82
- error: false,
83
- warning: false,
84
- badgeIcon: null,
85
- fontWeight: 'normal',
86
- lineHeight: 'normal'
87
- };
88
63
 
89
64
  export { Badge as default };
90
65
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../src/components/data/Badge/Badge.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport * as S from './Badge.styled';\n\n/**\n * Badges show a bubble containing a `number` or a `string`. It may be used by itself or with children passed as props\n * (to display a badge on top of an icon, for example, pass the icon as the child).\n *\n * If the badge content is passed as a `float`, it will be rounded up to the nearest `integer`,\n * and if the number is higher than 1 000 or 1 000 000 it will be abbreviated to for example \"1.4K\" or \"1.4M\" respectively.\n * If you need to display a `float` instead of a rounded `integer`, pass it as a `string` instead (e.g. \"1,4\").\n *\n * ### Import\n *\n * ``` js\n * import { Badge } from '@ntbjs/react-components/data'\n * // or\n * import Badge from '@ntbjs/react-components/data/Badge'\n * ```\n * ## Props\n * ```\n * Pass `badgeIcon={<svg></svg>}` to display an icon.\n * Pass a number or string to the badgeContent to display it alongside the icon.\n * Pass `align={\"left\"}`or `align={\"center\"}` to align content.\n * Pass `elevated={true}` to display the badge on top of the children\n * Pass `active={true}` to reflect the active status of the badge\n * Pass `error={true}` to reflect the error status of the badge\n * Pass `warning={true}` to reflect the warning status of the badge\n * Pass `fontSize={15}` to set the font size of the badge in pixel\n * Pass `fontWeight={500}` to set the font weight of the badge\n * Pass `lineHeight={12}` to set the line height of the badge in pixel\n * Pass `colors={[#ffffff, #000000]}` to set the font color of the badge\n * Pass `backgroundColors={[#ffffff, #000000]}` to set the background color of the badge\n * Pass `verticalPadding={15}` to set the bottom and top padding of the badge in pixel\n * Pass `horizontalPadding={20}` to set the left and right padding of the badge in pixel\n * Pass `height={24}` to set the height of the badge in pixel\n * Pass `minHeight={24}` to set the minimum height of the badge in pixel\n * Pass `width={50}` to set the width of the badge in pixel\n * Pass `minWidth={32}` to set the minimum width of the badge in pixel\n * ```\n */\nconst Badge = React.forwardRef(function Badge(\n {\n badgeContent,\n badgeIcon,\n children,\n elevated,\n fontSize,\n fontWeight,\n lineHeight,\n active,\n error,\n warning,\n backgroundColors,\n colors,\n verticalPadding,\n horizontalPadding,\n height,\n minHeight,\n width,\n minWidth,\n borderColors,\n ...props\n },\n forwardedRef\n) {\n if (typeof badgeContent === 'number') {\n badgeContent = Intl.NumberFormat('en', { notation: 'compact' }).format(badgeContent);\n }\n\n return (\n <S.Badge ref={forwardedRef} $elevated={elevated} $hasChildren={Boolean(children)} {...props}>\n {children && <S.BadgeChildrenContainer>{children}</S.BadgeChildrenContainer>}\n {(badgeIcon || badgeContent) && (\n <S.BadgeLabel\n $backgroundColors={backgroundColors}\n $colors={colors}\n $elevated={elevated}\n fontSize={fontSize}\n fontWeight={fontWeight}\n $lineHeight={lineHeight}\n $active={active}\n $error={error}\n $warning={warning}\n $elevatedverticalPadding={verticalPadding}\n $horizontalPadding={horizontalPadding}\n height={height}\n $minHeight={minHeight}\n width={width}\n $minWidth={minWidth}\n $borderColors={borderColors}\n >\n {badgeIcon && <S.BadgeIcon $useGutter={!!badgeContent}>{badgeIcon}</S.BadgeIcon>}\n {badgeContent}\n </S.BadgeLabel>\n )}\n </S.Badge>\n );\n});\n\nBadge.propTypes = {\n /**\n * An Icon to show in the badge alongside with a text\n */\n badgeIcon: PropTypes.node,\n\n /**\n * Content to be showed in the badge – e.g. number of results.\n */\n badgeContent: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n PropTypes.func,\n PropTypes.element\n ]),\n\n /**\n * The element(s) for which the badge will be displayed – e.g. an icon or a text.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),\n\n /**\n * Whether the badge should be displayed in an elevated position on top of the child element(s) or not.\n */\n elevated: PropTypes.bool,\n\n /**\n * Whether the element is active or not (e.g. the currently selected menu item). This changes the color of the badge.\n */\n active: PropTypes.bool,\n\n /**\n * There is an error present – 'error be prioritized over warnings if both are set to `true`.\n */\n error: PropTypes.bool,\n\n /**\n * There is a warning present.\n */\n warning: PropTypes.bool,\n /**\n * Font size for the badge\n */\n fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n /**\n * Font weight for the badge\n */\n fontWeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n /**\n * Line weight for the badge\n */\n lineHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n /**\n * Colors of the font in the manner of [darkThemeColor, lightThemeColor]\n */\n colors: PropTypes.arrayOf(PropTypes.string),\n /**\n * Background colors for the badge in the manner of [darkThemeColor, lightThemeColor]\n */\n backgroundColors: PropTypes.arrayOf(PropTypes.string),\n /**\n * Top and bottom padding for the badge\n */\n verticalPadding: PropTypes.number,\n /**\n * Left and right padding for the badge\n */\n horizontalPadding: PropTypes.number,\n /**\n * Height of the badge\n */\n height: PropTypes.number,\n /**\n * Minimum height of the badge\n */\n minHeight: PropTypes.number,\n /**\n * Width of the badge\n */\n width: PropTypes.number,\n /**\n * Minimum width of the badge\n */\n minWidth: PropTypes.number,\n /**\n * Border colors in the manner of [darkThemeColor, lightThemeColor]. When provided, a 1px solid border is applied.\n */\n borderColors: PropTypes.arrayOf(PropTypes.string)\n};\n\nBadge.defaultProps = {\n elevated: false,\n active: false,\n error: false,\n warning: false,\n badgeIcon: null,\n fontWeight: 'normal',\n lineHeight: 'normal'\n};\n\nexport default Badge;\n"],"names":["Badge","React","forwardRef","badgeContent","badgeIcon","children","elevated","fontSize","fontWeight","lineHeight","active","error","warning","backgroundColors","colors","verticalPadding","horizontalPadding","height","minHeight","width","minWidth","borderColors","props","forwardedRef","Intl","NumberFormat","notation","format","createElement","S","_extends","ref","$elevated","$hasChildren","Boolean","$backgroundColors","$colors","$lineHeight","$active","$error","$warning","$elevatedverticalPadding","$horizontalPadding","$minHeight","$minWidth","$borderColors","$useGutter","propTypes","process","env","NODE_ENV","PropTypes","node","oneOfType","string","number","func","element","bool","arrayOf","defaultProps"],"mappings":";;;;;AAyCMA,MAAAA,KAAK,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,KAAKA,CAC3C;EACEG,YAAY;EACZC,SAAS;EACTC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,UAAU;EACVC,UAAU;EACVC,MAAM;EACNC,KAAK;EACLC,OAAO;EACPC,gBAAgB;EAChBC,MAAM;EACNC,eAAe;EACfC,iBAAiB;EACjBC,MAAM;EACNC,SAAS;EACTC,KAAK;EACLC,QAAQ;EACRC,YAAY;EACZ,GAAGC,KAAAA;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,IAAI,OAAOpB,YAAY,KAAK,QAAQ,EAAE;AACpCA,IAAAA,YAAY,GAAGqB,IAAI,CAACC,YAAY,CAAC,IAAI,EAAE;AAAEC,MAAAA,QAAQ,EAAE,SAA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BpC,KAAK,EAAEgC,SAAS,CAACI,MAAM;EAIvBnC,QAAQ,EAAE+B,SAAS,CAACI,MAAM;AAI1BlC,EAAAA,YAAY,EAAE8B,SAAS,CAACQ,OAAO,CAACR,SAAS,CAACG,MAAM,CAAA;AAClD,CAAC,GAAA,EAAA,CAAA;AAEDtD,KAAK,CAAC4D,YAAY,GAAG;AACnBtD,EAAAA,QAAQ,EAAE,KAAK;AACfI,EAAAA,MAAM,EAAE,KAAK;AACbC,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,OAAO,EAAE,KAAK;AACdR,EAAAA,SAAS,EAAE,IAAI;AACfI,EAAAA,UAAU,EAAE,QAAQ;AACpBC,EAAAA,UAAU,EAAE,QAAA;AACd,CAAC;;;;"}
1
+ {"version":3,"file":"Badge.js","sources":["../../../src/components/data/Badge/Badge.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './Badge.styled';\n\ntype BadgeOwnProps = {\n /**\n * An Icon to show in the badge alongside with a text\n */\n badgeIcon?: React.ReactNode;\n /**\n * Content to be showed in the badge – e.g. number of results.\n * ReactNode, not the union — func is never valid, null was missing.\n */\n badgeContent?: React.ReactNode;\n /**\n * The element(s) for which the badge will be displayed – e.g. an icon or a text.\n */\n children?: React.ReactNode | string;\n /**\n * Whether the badge should be displayed in an elevated position on top of the child element(s) or not.\n */\n elevated?: boolean;\n /**\n * Whether the element is active or not (e.g. the currently selected menu item). This changes the color of the badge.\n */\n active?: boolean;\n /**\n * There is an error present – 'error be prioritized over warnings if both are set to `true`.\n */\n error?: boolean;\n /**\n * There is a warning present.\n */\n warning?: boolean;\n /**\n * Font size for the badge\n */\n fontSize?: number | string;\n /**\n * Font weight for the badge\n */\n fontWeight?: number | string;\n /**\n * Line weight for the badge\n */\n lineHeight?: number | string;\n /**\n * Colors of the font in the manner of [darkThemeColor, lightThemeColor]\n */\n colors?: string[];\n /**\n * Background colors for the badge in the manner of [darkThemeColor, lightThemeColor]\n */\n backgroundColors?: string[];\n /**\n * Top and bottom padding for the badge\n */\n verticalPadding?: number;\n /**\n * Left and right padding for the badge\n */\n horizontalPadding?: number;\n /**\n * Height of the badge\n */\n height?: number;\n /**\n * Minimum height of the badge\n */\n minHeight?: number;\n /**\n * Width of the badge\n */\n width?: number;\n /**\n * Minimum width of the badge\n */\n minWidth?: number;\n /**\n * Border colors in the manner of [darkThemeColor, lightThemeColor]. When provided, a 1px solid border is applied.\n */\n borderColors?: string[];\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<React.ComponentPropsWithoutRef<typeof S.Badge>, keyof BadgeOwnProps> &\n BadgeOwnProps;\n\n/**\n * Badges show a bubble containing a `number` or a `string`. It may be used by itself or with children passed as props\n * (to display a badge on top of an icon, for example, pass the icon as the child).\n *\n * If the badge content is passed as a `float`, it will be rounded up to the nearest `integer`,\n * and if the number is higher than 1 000 or 1 000 000 it will be abbreviated to for example \"1.4K\" or \"1.4M\" respectively.\n * If you need to display a `float` instead of a rounded `integer`, pass it as a `string` instead (e.g. \"1,4\").\n *\n * ### Import\n *\n * ``` js\n * import { Badge } from '@ntbjs/react-components/data'\n * // or\n * import Badge from '@ntbjs/react-components/data/Badge'\n * ```\n * ## Props\n * ```\n * Pass `badgeIcon={<svg></svg>}` to display an icon.\n * Pass a number or string to the badgeContent to display it alongside the icon.\n * Pass `align={\"left\"}`or `align={\"center\"}` to align content.\n * Pass `elevated={true}` to display the badge on top of the children\n * Pass `active={true}` to reflect the active status of the badge\n * Pass `error={true}` to reflect the error status of the badge\n * Pass `warning={true}` to reflect the warning status of the badge\n * Pass `fontSize={15}` to set the font size of the badge in pixel\n * Pass `fontWeight={500}` to set the font weight of the badge\n * Pass `lineHeight={12}` to set the line height of the badge in pixel\n * Pass `colors={[#ffffff, #000000]}` to set the font color of the badge\n * Pass `backgroundColors={[#ffffff, #000000]}` to set the background color of the badge\n * Pass `verticalPadding={15}` to set the bottom and top padding of the badge in pixel\n * Pass `horizontalPadding={20}` to set the left and right padding of the badge in pixel\n * Pass `height={24}` to set the height of the badge in pixel\n * Pass `minHeight={24}` to set the minimum height of the badge in pixel\n * Pass `width={50}` to set the width of the badge in pixel\n * Pass `minWidth={32}` to set the minimum width of the badge in pixel\n * ```\n */\nconst Badge = React.forwardRef<any, Props>(function Badge(\n {\n badgeContent,\n badgeIcon = null,\n children,\n elevated = false,\n fontSize,\n fontWeight = 'normal',\n lineHeight = 'normal',\n active = false,\n error = false,\n warning = false,\n backgroundColors,\n colors,\n verticalPadding,\n horizontalPadding,\n height,\n minHeight,\n width,\n minWidth,\n borderColors,\n ...props\n },\n forwardedRef\n) {\n if (typeof badgeContent === 'number') {\n badgeContent = Intl.NumberFormat('en', { notation: 'compact' }).format(badgeContent);\n }\n\n return (\n <S.Badge ref={forwardedRef} $elevated={elevated} $hasChildren={Boolean(children)} {...props}>\n {children && <S.BadgeChildrenContainer>{children}</S.BadgeChildrenContainer>}\n {(badgeIcon || badgeContent) && (\n <S.BadgeLabel\n $backgroundColors={backgroundColors}\n $colors={colors}\n $elevated={elevated}\n fontSize={fontSize}\n fontWeight={fontWeight}\n $lineHeight={lineHeight}\n $active={active}\n $error={error}\n $warning={warning}\n $elevatedverticalPadding={verticalPadding}\n $horizontalPadding={horizontalPadding}\n height={height}\n $minHeight={minHeight}\n width={width}\n $minWidth={minWidth}\n $borderColors={borderColors}\n >\n {badgeIcon && <S.BadgeIcon $useGutter={!!badgeContent}>{badgeIcon}</S.BadgeIcon>}\n {badgeContent}\n </S.BadgeLabel>\n )}\n </S.Badge>\n );\n});\n\nexport default Badge;\n"],"names":["Badge","React","forwardRef","badgeContent","badgeIcon","children","elevated","fontSize","fontWeight","lineHeight","active","error","warning","backgroundColors","colors","verticalPadding","horizontalPadding","height","minHeight","width","minWidth","borderColors","props","forwardedRef","Intl","NumberFormat","notation","format","_jsxs","S","ref","$elevated","$hasChildren","Boolean","_jsx","$backgroundColors","$colors","$lineHeight","$active","$error","$warning","$elevatedverticalPadding","$horizontalPadding","$minHeight","$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,EAAEA,QAAS;AACnBC,MAAAA,UAAU,EAAEA,UAAW;AACvB6B,MAAAA,WAAW,EAAE5B,UAAW;AACxB6B,MAAAA,OAAO,EAAE5B,MAAO;AAChB6B,MAAAA,MAAM,EAAE5B,KAAM;AACd6B,MAAAA,QAAQ,EAAE5B,OAAQ;AAClB6B,MAAAA,wBAAwB,EAAE1B,eAAgB;AAC1C2B,MAAAA,kBAAkB,EAAE1B,iBAAkB;AACtCC,MAAAA,MAAM,EAAEA,MAAO;AACf0B,MAAAA,UAAU,EAAEzB,SAAU;AACtBC,MAAAA,KAAK,EAAEA,KAAM;AACbyB,MAAAA,SAAS,EAAExB,QAAS;AACpByB,MAAAA,aAAa,EAAExB,YAAa;AAAAhB,MAAAA,QAAA,GAE3BD,SAAS,IAAI8B,GAAA,CAACL,SAAW,EAAA;QAACiB,UAAU,EAAE,CAAC,CAAC3C,YAAa;AAAAE,QAAAA,QAAA,EAAED;OAAuB,CAAC,EAC/ED,YAAY;AAAA,KACD,CACf;AAAA,GACM,CAAC;AAEd,CAAC;;;;"}
@@ -6,69 +6,32 @@ const shouldForwardProp = prop => {
6
6
  };
7
7
  const Badge = styled.span.withConfig({
8
8
  shouldForwardProp
9
- }).attrs(applyDefaultTheme)`
10
- align-content: center;
11
- display: ${props => props.$elevated || !props.$hasChildren ? 'inline-flex' : 'flex'};
12
- font-family: ${props => props.theme.primaryFontFamily};
13
- font-size: 1rem;
14
- font-weight: 500;
15
- min-height: 24px;
16
- position: relative;
17
- width: ${props => props.$elevated ? 'fit-content' : 'initial'};
18
- `;
9
+ }).attrs(applyDefaultTheme).withConfig({
10
+ displayName: "Badgestyled__Badge",
11
+ componentId: "sc-1h3t54-0"
12
+ })(["align-content:center;display:", ";font-family:", ";font-size:1rem;font-weight:500;min-height:24px;position:relative;width:", ";"], props => props.$elevated || !props.$hasChildren ? 'inline-flex' : 'flex', props => props.theme.primaryFontFamily, props => props.$elevated ? 'fit-content' : 'initial');
19
13
  const BadgeChildrenContainer = styled.span.withConfig({
20
14
  shouldForwardProp
21
- }).attrs(applyDefaultTheme)`
22
- align-self: center;
23
- height: fit-content;
24
- margin-right: 8px;
25
- `;
15
+ }).attrs(applyDefaultTheme).withConfig({
16
+ displayName: "Badgestyled__BadgeChildrenContainer",
17
+ componentId: "sc-1h3t54-1"
18
+ })(["align-self:center;height:fit-content;margin-right:8px;"]);
26
19
  const BadgeLabel = styled.span.withConfig({
27
20
  shouldForwardProp
28
- }).attrs(applyDefaultTheme)`
29
- border-radius: ${props => props.$elevated ? '12px' : '14px'};
30
- display: flex;
31
- align-items: center;
32
- justify-content: center;
33
- box-sizing: border-box;
34
-
35
- font-size: ${props => {
21
+ }).attrs(applyDefaultTheme).withConfig({
22
+ displayName: "Badgestyled__BadgeLabel",
23
+ componentId: "sc-1h3t54-2"
24
+ })(["border-radius:", ";display:flex;align-items:center;justify-content:center;box-sizing:border-box;font-size:", ";font-weight:", ";line-height:", ";height:", ";letter-spacing:0.32px;margin-left:", ";position:", ";right:0;transform:", ";", " ", " ", " ", " ", " ", " ", ""], props => props.$elevated ? '12px' : '14px', props => {
36
25
  if (props.fontSize) {
37
26
  return `${props.fontSize}px`;
38
27
  } else {
39
28
  return props.elevated ? '0.625rem' : '0.750rem';
40
29
  }
41
- }};
42
- font-weight: ${props => props.fontWeight ? props.fontWeight : 'normal'};
43
- line-height: ${props => props.$lineHeight ? `${props.$lineHeight}px` : 'normal'};
44
- height: ${props => props.height ? `${props.height}px` : 'fit-content'};
45
- letter-spacing: 0.32px;
46
- margin-left: ${props => props.$elevated ? '15px' : 'auto'};
47
- position: ${props => props.$elevated ? 'absolute' : 'initial'};
48
- right: 0;
49
- transform: ${props => props.$elevated ? 'translate(33%, -8px)' : 'initial'};
50
-
51
- ${props => props.width ? css`
52
- width: ${props.width}px;
53
- ` : null}
54
-
55
- ${props => props.$minWidth ? css`
56
- min-width: ${props.$minWidth}px;
57
- ` : null}
58
-
59
- ${props => props.$minHeight ? css`
60
- min-height: ${props.$minHeight}px;
61
- ` : null}
62
-
63
- ${props => {
30
+ }, props => props.fontWeight ? props.fontWeight : 'normal', props => props.$lineHeight ? `${props.$lineHeight}px` : 'normal', props => props.height ? `${props.height}px` : 'fit-content', props => props.$elevated ? '15px' : 'auto', props => props.$elevated ? 'absolute' : 'initial', props => props.$elevated ? 'translate(33%, -8px)' : 'initial', props => props.width ? css(["width:", "px;"], props.width) : null, props => props.$minWidth ? css(["min-width:", "px;"], props.$minWidth) : null, props => props.$minHeight ? css(["min-height:", "px;"], props.$minHeight) : null, props => {
64
31
  const verticalPadding = props.verticalPadding ? `${props.verticalPadding}px` : props.$elevated ? '4px' : '6px';
65
32
  const horizontalPadding = props.$horizontalPadding ? `${props.$horizontalPadding}px` : props.$elevated ? '7px' : '10px';
66
- return css`
67
- padding: ${verticalPadding} ${horizontalPadding};
68
- `;
69
- }}
70
-
71
- ${props => props.theme.themeProp('background', () => {
33
+ return css(["padding:", " ", ";"], verticalPadding, horizontalPadding);
34
+ }, props => props.theme.themeProp('background', () => {
72
35
  const active = props.$active;
73
36
  const error = props.$error;
74
37
  const warning = props.$warning;
@@ -110,9 +73,7 @@ const BadgeLabel = styled.span.withConfig({
110
73
  default:
111
74
  return props.theme.getColor('gray-200');
112
75
  }
113
- })}
114
-
115
- ${props => props.theme.themeProp('color', () => {
76
+ }), props => props.theme.themeProp('color', () => {
116
77
  const defaultColor = props?.$colors?.[0] ?? props.theme.getColor('white');
117
78
  if (props.$warning && !props.$error || props.error && !props.$active) {
118
79
  return props.theme.getColor('gray-900');
@@ -126,23 +87,13 @@ const BadgeLabel = styled.span.withConfig({
126
87
  } else {
127
88
  return defaultColor;
128
89
  }
129
- })}
130
-
131
- ${props => props.$borderColors && css`
132
- border: 1px solid;
133
- ${props.theme.themeProp('border-color', props.$borderColors[0], props.$borderColors[1])}
134
- `}
135
- `;
90
+ }), props => props.$borderColors && css(["border:1px solid;", ""], props.theme.themeProp('border-color', props.$borderColors[0], props.$borderColors[1])));
136
91
  const BadgeIcon = styled.span.withConfig({
137
92
  shouldForwardProp
138
- }).attrs(applyDefaultTheme)`
139
- display: flex;
140
- align-items: center;
141
- margin-right: ${props => props.$useGutter ? '4px' : 0};
142
- svg {
143
- height: 12px;
144
- }
145
- `;
93
+ }).attrs(applyDefaultTheme).withConfig({
94
+ displayName: "Badgestyled__BadgeIcon",
95
+ componentId: "sc-1h3t54-3"
96
+ })(["display:flex;align-items:center;margin-right:", ";svg{height:12px;}"], props => props.$useGutter ? '4px' : 0);
146
97
 
147
98
  export { Badge, BadgeChildrenContainer, BadgeIcon, BadgeLabel };
148
99
  //# sourceMappingURL=Badge.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.styled.js","sources":["../../../src/components/data/Badge/Badge.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 Badge = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-content: center;\n display: ${props => (props.$elevated || !props.$hasChildren ? 'inline-flex' : 'flex')};\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 500;\n min-height: 24px;\n position: relative;\n width: ${props => (props.$elevated ? 'fit-content' : 'initial')};\n`;\n\nexport const BadgeChildrenContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-self: center;\n height: fit-content;\n margin-right: 8px;\n`;\n\nexport const BadgeLabel = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n border-radius: ${props => (props.$elevated ? '12px' : '14px')};\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n\n font-size: ${props => {\n if (props.fontSize) {\n return `${props.fontSize}px`;\n } else {\n return props.elevated ? '0.625rem' : '0.750rem';\n }\n }};\n font-weight: ${props => (props.fontWeight ? props.fontWeight : 'normal')};\n line-height: ${props => (props.$lineHeight ? `${props.$lineHeight}px` : 'normal')};\n height: ${props => (props.height ? `${props.height}px` : 'fit-content')};\n letter-spacing: 0.32px;\n margin-left: ${props => (props.$elevated ? '15px' : 'auto')};\n position: ${props => (props.$elevated ? 'absolute' : 'initial')};\n right: 0;\n transform: ${props => (props.$elevated ? 'translate(33%, -8px)' : 'initial')};\n\n ${props =>\n props.width\n ? css`\n width: ${props.width}px;\n `\n : null}\n\n ${props =>\n props.$minWidth\n ? css`\n min-width: ${props.$minWidth}px;\n `\n : null}\n\n ${props =>\n props.$minHeight\n ? css`\n min-height: ${props.$minHeight}px;\n `\n : null}\n\n ${props => {\n const verticalPadding = props.verticalPadding\n ? `${props.verticalPadding}px`\n : props.$elevated\n ? '4px'\n : '6px';\n const horizontalPadding = props.$horizontalPadding\n ? `${props.$horizontalPadding}px`\n : props.$elevated\n ? '7px'\n : '10px';\n return css`\n padding: ${verticalPadding} ${horizontalPadding};\n `;\n }}\n\n ${props =>\n props.theme.themeProp(\n 'background',\n () => {\n const active = props.$active;\n const error = props.$error;\n const warning = props.$warning;\n\n const defaultBgColor = props?.$backgroundColors?.[0] ?? props.theme.getColor('gray-600');\n\n switch (true) {\n case !error && !warning && !active:\n return defaultBgColor;\n\n case !error && !warning && active:\n return props.theme.getColor('gray-700');\n\n case error && active:\n return props.theme.getColor('red-500');\n\n case error:\n return props.theme.getColor('red-200');\n\n case warning && active:\n return props.theme.getColor('signal-yellow-500');\n\n case warning:\n return props.theme.getColor('signal-yellow-400');\n\n default:\n return props.theme.getColor('gray-600');\n }\n },\n () => {\n const active = props.$active;\n const error = props.$error;\n const warning = props.$warning;\n\n const defaultBgColor = props?.$backgroundColors?.[1] ?? props.theme.getColor('gray-200');\n\n switch (true) {\n case !error && !warning && !active:\n return defaultBgColor;\n\n case !error && !warning && active:\n return props.theme.getColor('white');\n\n case error && active:\n return props.theme.getColor('red-500');\n\n case error:\n return props.theme.getColor('red-200');\n\n case warning && active:\n return props.theme.getColor('signal-yellow-500');\n\n case warning:\n return props.theme.getColor('signal-yellow-400');\n\n default:\n return props.theme.getColor('gray-200');\n }\n }\n )}\n\n ${props =>\n props.theme.themeProp(\n 'color',\n () => {\n const defaultColor = props?.$colors?.[0] ?? props.theme.getColor('white');\n if ((props.$warning && !props.$error) || (props.error && !props.$active)) {\n return props.theme.getColor('gray-900');\n } else {\n return defaultColor;\n }\n },\n () => {\n const defaultColor = props?.$colors?.[1] ?? props.theme.getColor('gray-900');\n if (props.$error && props.$active) {\n return props.theme.getColor('white');\n } else {\n return defaultColor;\n }\n }\n )}\n\n ${props =>\n props.$borderColors &&\n css`\n border: 1px solid;\n ${props.theme.themeProp('border-color', props.$borderColors[0], props.$borderColors[1])}\n `}\n`;\n\nexport const BadgeIcon = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n margin-right: ${props => (props.$useGutter ? '4px' : 0)};\n svg {\n height: 12px;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Badge","styled","span","withConfig","attrs","applyDefaultTheme","props","$elevated","$hasChildren","theme","primaryFontFamily","BadgeChildrenContainer","BadgeLabel","fontSize","elevated","fontWeight","$lineHeight","height","width","css","$minWidth","$minHeight","verticalPadding","horizontalPadding","$horizontalPadding","themeProp","active","$active","error","$error","warning","$warning","defaultBgColor","$backgroundColors","getColor","defaultColor","$colors","$borderColors","BadgeIcon","$useGutter"],"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,KAAK,GAAGC,MAAM,CAACC,IAAI,CAC7BC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA,WAAA,EAAaC,KAAK,IAAKA,KAAK,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ACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA,gBAAkBC,EAAAA,KAAK,IAAKA,KAAK,CAACiC,UAAU,GAAG,KAAK,GAAG,CAAE,CAAA;AACzD;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"Badge.styled.js","sources":["../../../src/components/data/Badge/Badge.styled.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nexport interface BadgeStyleProps {\n $elevated?: boolean;\n $hasChildren?: boolean;\n}\n\ninterface BadgeLabelStyleProps {\n $elevated?: boolean;\n $active?: boolean;\n $error?: boolean;\n $warning?: boolean;\n $lineHeight?: number | string;\n $horizontalPadding?: number;\n $minHeight?: number;\n $minWidth?: number;\n $backgroundColors?: string[];\n $colors?: string[];\n $borderColors?: string[];\n verticalPadding?: number;\n $elevatedverticalPadding?: number;\n elevated?: boolean;\n error?: boolean;\n fontSize?: number | string;\n fontWeight?: number | string;\n height?: number;\n width?: number;\n}\n\ninterface BadgeIconStyleProps {\n $useGutter?: boolean;\n}\n\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const Badge = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs<BadgeStyleProps>(applyDefaultTheme)`\n align-content: center;\n display: ${props => (props.$elevated || !props.$hasChildren ? 'inline-flex' : 'flex')};\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 500;\n min-height: 24px;\n position: relative;\n width: ${props => (props.$elevated ? 'fit-content' : 'initial')};\n`;\n\nexport const BadgeChildrenContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-self: center;\n height: fit-content;\n margin-right: 8px;\n`;\n\nexport const BadgeLabel = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs<BadgeLabelStyleProps>(applyDefaultTheme)`\n border-radius: ${props => (props.$elevated ? '12px' : '14px')};\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n\n font-size: ${props => {\n if (props.fontSize) {\n return `${props.fontSize}px`;\n } else {\n return props.elevated ? '0.625rem' : '0.750rem';\n }\n }};\n font-weight: ${props => (props.fontWeight ? props.fontWeight : 'normal')};\n line-height: ${props => (props.$lineHeight ? `${props.$lineHeight}px` : 'normal')};\n height: ${props => (props.height ? `${props.height}px` : 'fit-content')};\n letter-spacing: 0.32px;\n margin-left: ${props => (props.$elevated ? '15px' : 'auto')};\n position: ${props => (props.$elevated ? 'absolute' : 'initial')};\n right: 0;\n transform: ${props => (props.$elevated ? 'translate(33%, -8px)' : 'initial')};\n\n ${props =>\n props.width\n ? css`\n width: ${props.width}px;\n `\n : null}\n\n ${props =>\n props.$minWidth\n ? css`\n min-width: ${props.$minWidth}px;\n `\n : null}\n\n ${props =>\n props.$minHeight\n ? css`\n min-height: ${props.$minHeight}px;\n `\n : null}\n\n ${props => {\n const verticalPadding = props.verticalPadding\n ? `${props.verticalPadding}px`\n : props.$elevated\n ? '4px'\n : '6px';\n const horizontalPadding = props.$horizontalPadding\n ? `${props.$horizontalPadding}px`\n : props.$elevated\n ? '7px'\n : '10px';\n return css`\n padding: ${verticalPadding} ${horizontalPadding};\n `;\n }}\n\n ${props =>\n props.theme.themeProp(\n 'background',\n () => {\n const active = props.$active;\n const error = props.$error;\n const warning = props.$warning;\n\n const defaultBgColor = props?.$backgroundColors?.[0] ?? props.theme.getColor('gray-600');\n\n switch (true) {\n case !error && !warning && !active:\n return defaultBgColor;\n\n case !error && !warning && active:\n return props.theme.getColor('gray-700');\n\n case error && active:\n return props.theme.getColor('red-500');\n\n case error:\n return props.theme.getColor('red-200');\n\n case warning && active:\n return props.theme.getColor('signal-yellow-500');\n\n case warning:\n return props.theme.getColor('signal-yellow-400');\n\n default:\n return props.theme.getColor('gray-600');\n }\n },\n () => {\n const active = props.$active;\n const error = props.$error;\n const warning = props.$warning;\n\n const defaultBgColor = props?.$backgroundColors?.[1] ?? props.theme.getColor('gray-200');\n\n switch (true) {\n case !error && !warning && !active:\n return defaultBgColor;\n\n case !error && !warning && active:\n return props.theme.getColor('white');\n\n case error && active:\n return props.theme.getColor('red-500');\n\n case error:\n return props.theme.getColor('red-200');\n\n case warning && active:\n return props.theme.getColor('signal-yellow-500');\n\n case warning:\n return props.theme.getColor('signal-yellow-400');\n\n default:\n return props.theme.getColor('gray-200');\n }\n }\n )}\n\n ${props =>\n props.theme.themeProp(\n 'color',\n () => {\n const defaultColor = props?.$colors?.[0] ?? props.theme.getColor('white');\n if ((props.$warning && !props.$error) || (props.error && !props.$active)) {\n return props.theme.getColor('gray-900');\n } else {\n return defaultColor;\n }\n },\n () => {\n const defaultColor = props?.$colors?.[1] ?? props.theme.getColor('gray-900');\n if (props.$error && props.$active) {\n return props.theme.getColor('white');\n } else {\n return defaultColor;\n }\n }\n )}\n\n ${props =>\n props.$borderColors &&\n css`\n border: 1px solid;\n ${props.theme.themeProp('border-color', props.$borderColors[0], props.$borderColors[1])}\n `}\n`;\n\nexport const BadgeIcon = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs<BadgeIconStyleProps>(applyDefaultTheme)`\n display: flex;\n align-items: center;\n margin-right: ${props => (props.$useGutter ? '4px' : 0)};\n svg {\n height: 12px;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Badge","styled","span","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","$elevated","$hasChildren","theme","primaryFontFamily","BadgeChildrenContainer","BadgeLabel","fontSize","elevated","fontWeight","$lineHeight","height","width","css","$minWidth","$minHeight","verticalPadding","horizontalPadding","$horizontalPadding","themeProp","active","$active","error","$error","warning","$warning","defaultBgColor","$backgroundColors","getColor","defaultColor","$colors","$borderColors","BadgeIcon","$useGutter"],"mappings":";;;AAkCA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,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