@mrshmllw/smores-react 4.0.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (520) hide show
  1. package/README.md +0 -2
  2. package/dist/.gitkeep +0 -0
  3. package/dist/Accordion/Accordion.js +90 -32
  4. package/dist/ActionDropdown/ActionDropdown.js +65 -25
  5. package/dist/ActionDropdown/List.js +8 -6
  6. package/dist/Banner/BannerContainer.js +40 -31
  7. package/dist/Banner/BannerItem.js +112 -54
  8. package/dist/Banner/hooks.js +7 -5
  9. package/dist/Box/Box.js +7 -5
  10. package/dist/BrandCard/BrandCard.js +61 -24
  11. package/dist/Button/Button.js +110 -40
  12. package/dist/Card/Card.js +86 -34
  13. package/dist/CheckBox/CheckBox.js +41 -20
  14. package/dist/CheckBoxGroup/CheckBoxGroup.js +22 -6
  15. package/dist/Chip/Chip.d.ts +1 -1
  16. package/dist/Chip/Chip.js +60 -26
  17. package/dist/CurrencyInput/CurrencyInput.js +89 -50
  18. package/dist/Datepicker/Datepicker.js +130 -83
  19. package/dist/Datepicker/DatesList.js +42 -26
  20. package/dist/Divider/Divider.js +17 -11
  21. package/dist/Dropdown/Dropdown.js +101 -54
  22. package/dist/Emoji/Emoji.js +27 -6
  23. package/dist/Icon/Icon.js +5522 -851
  24. package/dist/IconStrict/IconStrict.js +67 -38
  25. package/dist/IconWrapper/IconWrapper.js +28 -12
  26. package/dist/LabelledText/LabelledText.js +16 -8
  27. package/dist/Link/Link.js +87 -47
  28. package/dist/Loader/Loader.js +38 -12
  29. package/dist/Logo/Logo.js +154 -44
  30. package/dist/Modal/Modal.js +73 -27
  31. package/dist/Modal/useBodyScrollLock.js +23 -19
  32. package/dist/NumberInput/NumberInput.js +125 -78
  33. package/dist/Pagination/Pagination.js +144 -103
  34. package/dist/RadioGroup/RadioElement.js +33 -18
  35. package/dist/RadioGroup/RadioGroup.js +64 -33
  36. package/dist/RadioGroup/RadioItem.js +79 -47
  37. package/dist/RadioGroup/constants.js +3 -2
  38. package/dist/Row/Row.js +68 -27
  39. package/dist/SearchInput/SearchInput.js +102 -45
  40. package/dist/SearchInput/SearchOptions.js +18 -14
  41. package/dist/Snackbar/SnackbarContainer.js +49 -31
  42. package/dist/Snackbar/SnackbarItem.js +37 -17
  43. package/dist/Snackbar/hooks.js +7 -5
  44. package/dist/SupportMessage/SupportMessage.js +79 -52
  45. package/dist/Table/Table.js +73 -50
  46. package/dist/Table/components/RowActions.js +82 -43
  47. package/dist/Table/components/TableHeader.js +40 -7
  48. package/dist/Table/components/TableRow.js +111 -69
  49. package/dist/Table/components/commonComponents.js +31 -46
  50. package/dist/Table/helpers.js +14 -10
  51. package/dist/Tag/Tag.js +28 -9
  52. package/dist/Text/Text.js +53 -33
  53. package/dist/Text/fontMapping.js +19 -17
  54. package/dist/TextInput/TextInput.js +65 -16
  55. package/dist/Textarea/Textarea.js +50 -16
  56. package/dist/Toggle/Toggle.js +32 -16
  57. package/dist/Tooltip/Tooltip.js +202 -178
  58. package/dist/fields/Field/Field.js +7 -5
  59. package/dist/fields/Fieldset/Fieldset.js +21 -5
  60. package/dist/fields/commonFieldTypes.d.ts +1 -1
  61. package/dist/fields/components/CommonInput.js +17 -21
  62. package/dist/fields/components/InternalField.js +77 -29
  63. package/dist/fontStyle.js +5 -3
  64. package/dist/hooks/useClickOutside/index.js +30 -22
  65. package/dist/hooks/useEventListener/index.js +19 -12
  66. package/dist/hooks/useScript/index.js +16 -11
  67. package/dist/hooks/useTimeout/index.js +13 -11
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.js +49 -43
  70. package/dist/theme.js +87 -57
  71. package/dist/utils/date.js +8 -7
  72. package/dist/utils/debounce.js +13 -18
  73. package/dist/utils/flex.js +47 -30
  74. package/dist/utils/focusOutline.js +8 -4
  75. package/dist/utils/id.js +10 -8
  76. package/dist/utils/isReactElement.js +5 -3
  77. package/dist/utils/measure.js +11 -10
  78. package/dist/utils/responsiveProp.js +16 -17
  79. package/dist/utils/space.js +78 -62
  80. package/dist/utils/useControlledState.js +20 -12
  81. package/dist/utils/visuallyHidden.js +3 -6
  82. package/package.json +17 -16
  83. package/dist/Accordion/Accordion.js.map +0 -1
  84. package/dist/Accordion/Accordion.stories.d.ts +0 -9
  85. package/dist/Accordion/Accordion.stories.js +0 -11
  86. package/dist/Accordion/Accordion.stories.js.map +0 -1
  87. package/dist/Accordion/Collection.d.ts +0 -2
  88. package/dist/Accordion/Collection.js +0 -52
  89. package/dist/Accordion/Collection.js.map +0 -1
  90. package/dist/Accordion/__tests__/Accordion.d.ts +0 -1
  91. package/dist/Accordion/__tests__/Accordion.js +0 -9
  92. package/dist/Accordion/__tests__/Accordion.js.map +0 -1
  93. package/dist/Accordion/index.js +0 -2
  94. package/dist/Accordion/index.js.map +0 -1
  95. package/dist/ActionDropdown/ActionDropdown.js.map +0 -1
  96. package/dist/ActionDropdown/ActionDropdown.stories.d.ts +0 -7
  97. package/dist/ActionDropdown/ActionDropdown.stories.js +0 -13
  98. package/dist/ActionDropdown/ActionDropdown.stories.js.map +0 -1
  99. package/dist/ActionDropdown/Container.d.ts +0 -2
  100. package/dist/ActionDropdown/Container.js +0 -51
  101. package/dist/ActionDropdown/Container.js.map +0 -1
  102. package/dist/ActionDropdown/List.js.map +0 -1
  103. package/dist/ActionDropdown/__tests__/ActionDropdown.d.ts +0 -1
  104. package/dist/ActionDropdown/__tests__/ActionDropdown.js +0 -23
  105. package/dist/ActionDropdown/__tests__/ActionDropdown.js.map +0 -1
  106. package/dist/ActionDropdown/index.js +0 -2
  107. package/dist/ActionDropdown/index.js.map +0 -1
  108. package/dist/Banner/Banner.stories.d.ts +0 -9
  109. package/dist/Banner/Banner.stories.js +0 -86
  110. package/dist/Banner/Banner.stories.js.map +0 -1
  111. package/dist/Banner/BannerContainer.js.map +0 -1
  112. package/dist/Banner/BannerItem.js.map +0 -1
  113. package/dist/Banner/hooks.js.map +0 -1
  114. package/dist/Banner/index.js +0 -3
  115. package/dist/Banner/index.js.map +0 -1
  116. package/dist/Banner/types.js +0 -2
  117. package/dist/Banner/types.js.map +0 -1
  118. package/dist/Box/Box.js.map +0 -1
  119. package/dist/Box/Box.stories.d.ts +0 -7
  120. package/dist/Box/Box.stories.js +0 -38
  121. package/dist/Box/Box.stories.js.map +0 -1
  122. package/dist/Box/__tests__/Box.d.ts +0 -1
  123. package/dist/Box/__tests__/Box.js +0 -9
  124. package/dist/Box/__tests__/Box.js.map +0 -1
  125. package/dist/Box/index.js +0 -2
  126. package/dist/Box/index.js.map +0 -1
  127. package/dist/BrandCard/BrandCard.js.map +0 -1
  128. package/dist/BrandCard/BrandCard.stories.d.ts +0 -11
  129. package/dist/BrandCard/BrandCard.stories.js +0 -54
  130. package/dist/BrandCard/BrandCard.stories.js.map +0 -1
  131. package/dist/BrandCard/__tests__/BrandCard.d.ts +0 -1
  132. package/dist/BrandCard/__tests__/BrandCard.js +0 -9
  133. package/dist/BrandCard/__tests__/BrandCard.js.map +0 -1
  134. package/dist/BrandCard/index.js +0 -2
  135. package/dist/BrandCard/index.js.map +0 -1
  136. package/dist/Button/Button.js.map +0 -1
  137. package/dist/Button/Button.stories.d.ts +0 -16
  138. package/dist/Button/Button.stories.js +0 -28
  139. package/dist/Button/Button.stories.js.map +0 -1
  140. package/dist/Button/Collection.d.ts +0 -4
  141. package/dist/Button/Collection.js +0 -53
  142. package/dist/Button/Collection.js.map +0 -1
  143. package/dist/Button/InteractivePlayground.d.ts +0 -2
  144. package/dist/Button/InteractivePlayground.js +0 -17
  145. package/dist/Button/InteractivePlayground.js.map +0 -1
  146. package/dist/Button/__tests__/Button.d.ts +0 -1
  147. package/dist/Button/__tests__/Button.js +0 -9
  148. package/dist/Button/__tests__/Button.js.map +0 -1
  149. package/dist/Button/index.js +0 -2
  150. package/dist/Button/index.js.map +0 -1
  151. package/dist/Card/Card.js.map +0 -1
  152. package/dist/Card/Card.stories.d.ts +0 -17
  153. package/dist/Card/Card.stories.js +0 -92
  154. package/dist/Card/Card.stories.js.map +0 -1
  155. package/dist/Card/__tests__/Card.d.ts +0 -1
  156. package/dist/Card/__tests__/Card.js +0 -9
  157. package/dist/Card/__tests__/Card.js.map +0 -1
  158. package/dist/Card/index.js +0 -2
  159. package/dist/Card/index.js.map +0 -1
  160. package/dist/CheckBox/CheckBox.js.map +0 -1
  161. package/dist/CheckBox/CheckBox.stories.d.ts +0 -10
  162. package/dist/CheckBox/CheckBox.stories.js +0 -22
  163. package/dist/CheckBox/CheckBox.stories.js.map +0 -1
  164. package/dist/CheckBox/Container.d.ts +0 -2
  165. package/dist/CheckBox/Container.js +0 -7
  166. package/dist/CheckBox/Container.js.map +0 -1
  167. package/dist/CheckBox/__tests__/CheckBox.d.ts +0 -1
  168. package/dist/CheckBox/__tests__/CheckBox.js +0 -8
  169. package/dist/CheckBox/__tests__/CheckBox.js.map +0 -1
  170. package/dist/CheckBox/index.js +0 -2
  171. package/dist/CheckBox/index.js.map +0 -1
  172. package/dist/CheckBoxGroup/CheckBoxGroup.js.map +0 -1
  173. package/dist/CheckBoxGroup/CheckBoxGroup.stories.d.ts +0 -14
  174. package/dist/CheckBoxGroup/CheckBoxGroup.stories.js +0 -40
  175. package/dist/CheckBoxGroup/CheckBoxGroup.stories.js.map +0 -1
  176. package/dist/CheckBoxGroup/index.js +0 -2
  177. package/dist/CheckBoxGroup/index.js.map +0 -1
  178. package/dist/Chip/Chip.js.map +0 -1
  179. package/dist/Chip/Chip.stories.d.ts +0 -16
  180. package/dist/Chip/Chip.stories.js +0 -35
  181. package/dist/Chip/Chip.stories.js.map +0 -1
  182. package/dist/Chip/index.js +0 -2
  183. package/dist/Chip/index.js.map +0 -1
  184. package/dist/CurrencyInput/Collection.d.ts +0 -2
  185. package/dist/CurrencyInput/Collection.js +0 -65
  186. package/dist/CurrencyInput/Collection.js.map +0 -1
  187. package/dist/CurrencyInput/CurrencyInput.js.map +0 -1
  188. package/dist/CurrencyInput/CurrencyInput.stories.d.ts +0 -16
  189. package/dist/CurrencyInput/CurrencyInput.stories.js +0 -33
  190. package/dist/CurrencyInput/CurrencyInput.stories.js.map +0 -1
  191. package/dist/CurrencyInput/Example.d.ts +0 -2
  192. package/dist/CurrencyInput/Example.js +0 -8
  193. package/dist/CurrencyInput/Example.js.map +0 -1
  194. package/dist/CurrencyInput/__tests__/CurrencyInput.d.ts +0 -1
  195. package/dist/CurrencyInput/__tests__/CurrencyInput.js +0 -17
  196. package/dist/CurrencyInput/__tests__/CurrencyInput.js.map +0 -1
  197. package/dist/CurrencyInput/index.js +0 -2
  198. package/dist/CurrencyInput/index.js.map +0 -1
  199. package/dist/Datepicker/Datepicker.js.map +0 -1
  200. package/dist/Datepicker/Datepicker.stories.d.ts +0 -13
  201. package/dist/Datepicker/Datepicker.stories.js +0 -18
  202. package/dist/Datepicker/Datepicker.stories.js.map +0 -1
  203. package/dist/Datepicker/DatesList.js.map +0 -1
  204. package/dist/Datepicker/index.js +0 -2
  205. package/dist/Datepicker/index.js.map +0 -1
  206. package/dist/Datepicker/types.js +0 -2
  207. package/dist/Datepicker/types.js.map +0 -1
  208. package/dist/Divider/Divider.js.map +0 -1
  209. package/dist/Divider/Divier.stories.d.ts +0 -8
  210. package/dist/Divider/Divier.stories.js +0 -10
  211. package/dist/Divider/Divier.stories.js.map +0 -1
  212. package/dist/Divider/index.js +0 -2
  213. package/dist/Divider/index.js.map +0 -1
  214. package/dist/Dropdown/Collection.d.ts +0 -2
  215. package/dist/Dropdown/Collection.js +0 -101
  216. package/dist/Dropdown/Collection.js.map +0 -1
  217. package/dist/Dropdown/Container.d.ts +0 -2
  218. package/dist/Dropdown/Container.js +0 -98
  219. package/dist/Dropdown/Container.js.map +0 -1
  220. package/dist/Dropdown/Dropdown.js.map +0 -1
  221. package/dist/Dropdown/Dropdown.stories.d.ts +0 -15
  222. package/dist/Dropdown/Dropdown.stories.js +0 -54
  223. package/dist/Dropdown/Dropdown.stories.js.map +0 -1
  224. package/dist/Dropdown/index.js +0 -2
  225. package/dist/Dropdown/index.js.map +0 -1
  226. package/dist/Emoji/Emoji.js.map +0 -1
  227. package/dist/Emoji/Emoji.stories.d.ts +0 -8
  228. package/dist/Emoji/Emoji.stories.js +0 -18
  229. package/dist/Emoji/Emoji.stories.js.map +0 -1
  230. package/dist/Emoji/__tests__/Emoji.d.ts +0 -1
  231. package/dist/Emoji/__tests__/Emoji.js +0 -9
  232. package/dist/Emoji/__tests__/Emoji.js.map +0 -1
  233. package/dist/Emoji/index.js +0 -2
  234. package/dist/Emoji/index.js.map +0 -1
  235. package/dist/Icon/Container.d.ts +0 -2
  236. package/dist/Icon/Container.js +0 -638
  237. package/dist/Icon/Container.js.map +0 -1
  238. package/dist/Icon/Icon.js.map +0 -1
  239. package/dist/Icon/Icon.stories.d.ts +0 -9
  240. package/dist/Icon/Icon.stories.js +0 -31
  241. package/dist/Icon/Icon.stories.js.map +0 -1
  242. package/dist/Icon/__tests__/Icon.d.ts +0 -1
  243. package/dist/Icon/__tests__/Icon.js +0 -9
  244. package/dist/Icon/__tests__/Icon.js.map +0 -1
  245. package/dist/Icon/index.js +0 -2
  246. package/dist/Icon/index.js.map +0 -1
  247. package/dist/IconStrict/IconStrict.js.map +0 -1
  248. package/dist/IconStrict/IconStrict.stories.d.ts +0 -11
  249. package/dist/IconStrict/IconStrict.stories.js +0 -33
  250. package/dist/IconStrict/IconStrict.stories.js.map +0 -1
  251. package/dist/IconStrict/__tests__/IconStrict.d.ts +0 -1
  252. package/dist/IconStrict/__tests__/IconStrict.js +0 -9
  253. package/dist/IconStrict/__tests__/IconStrict.js.map +0 -1
  254. package/dist/IconStrict/index.js +0 -2
  255. package/dist/IconStrict/index.js.map +0 -1
  256. package/dist/IconWrapper/IconWrapper.js.map +0 -1
  257. package/dist/IconWrapper/IconWrapper.stories.d.ts +0 -13
  258. package/dist/IconWrapper/IconWrapper.stories.js +0 -45
  259. package/dist/IconWrapper/IconWrapper.stories.js.map +0 -1
  260. package/dist/IconWrapper/__tests__/IconWrapper.d.ts +0 -1
  261. package/dist/IconWrapper/__tests__/IconWrapper.js +0 -19
  262. package/dist/IconWrapper/__tests__/IconWrapper.js.map +0 -1
  263. package/dist/IconWrapper/index.js +0 -2
  264. package/dist/IconWrapper/index.js.map +0 -1
  265. package/dist/LabelledText/LabelledText.js.map +0 -1
  266. package/dist/LabelledText/LabelledText.stories.d.ts +0 -8
  267. package/dist/LabelledText/LabelledText.stories.js +0 -12
  268. package/dist/LabelledText/LabelledText.stories.js.map +0 -1
  269. package/dist/LabelledText/__tests__/LabelledText.d.ts +0 -1
  270. package/dist/LabelledText/__tests__/LabelledText.js +0 -9
  271. package/dist/LabelledText/__tests__/LabelledText.js.map +0 -1
  272. package/dist/LabelledText/index.js +0 -2
  273. package/dist/LabelledText/index.js.map +0 -1
  274. package/dist/Link/Link.js.map +0 -1
  275. package/dist/Link/Link.stories.d.ts +0 -16
  276. package/dist/Link/Link.stories.js +0 -38
  277. package/dist/Link/Link.stories.js.map +0 -1
  278. package/dist/Link/index.js +0 -2
  279. package/dist/Link/index.js.map +0 -1
  280. package/dist/Loader/Loader.js.map +0 -1
  281. package/dist/Loader/Loader.stories.d.ts +0 -9
  282. package/dist/Loader/Loader.stories.js +0 -17
  283. package/dist/Loader/Loader.stories.js.map +0 -1
  284. package/dist/Loader/__tests__/Loader.d.ts +0 -1
  285. package/dist/Loader/__tests__/Loader.js +0 -9
  286. package/dist/Loader/__tests__/Loader.js.map +0 -1
  287. package/dist/Loader/index.js +0 -2
  288. package/dist/Loader/index.js.map +0 -1
  289. package/dist/Logo/Collection.d.ts +0 -4
  290. package/dist/Logo/Collection.js +0 -33
  291. package/dist/Logo/Collection.js.map +0 -1
  292. package/dist/Logo/Logo.js.map +0 -1
  293. package/dist/Logo/Logo.stories.d.ts +0 -13
  294. package/dist/Logo/Logo.stories.js +0 -28
  295. package/dist/Logo/Logo.stories.js.map +0 -1
  296. package/dist/Logo/index.js +0 -2
  297. package/dist/Logo/index.js.map +0 -1
  298. package/dist/Modal/Modal.js.map +0 -1
  299. package/dist/Modal/Modal.stories.d.ts +0 -13
  300. package/dist/Modal/Modal.stories.js +0 -28
  301. package/dist/Modal/Modal.stories.js.map +0 -1
  302. package/dist/Modal/__tests__/Modal.d.ts +0 -1
  303. package/dist/Modal/__tests__/Modal.js +0 -9
  304. package/dist/Modal/__tests__/Modal.js.map +0 -1
  305. package/dist/Modal/index.js +0 -2
  306. package/dist/Modal/index.js.map +0 -1
  307. package/dist/Modal/useBodyScrollLock.js.map +0 -1
  308. package/dist/NumberInput/Collection.d.ts +0 -2
  309. package/dist/NumberInput/Collection.js +0 -97
  310. package/dist/NumberInput/Collection.js.map +0 -1
  311. package/dist/NumberInput/Container.d.ts +0 -2
  312. package/dist/NumberInput/Container.js +0 -10
  313. package/dist/NumberInput/Container.js.map +0 -1
  314. package/dist/NumberInput/NumberInput.js.map +0 -1
  315. package/dist/NumberInput/NumberInput.stories.d.ts +0 -16
  316. package/dist/NumberInput/NumberInput.stories.js +0 -33
  317. package/dist/NumberInput/NumberInput.stories.js.map +0 -1
  318. package/dist/NumberInput/__tests__/NumberInput.d.ts +0 -1
  319. package/dist/NumberInput/__tests__/NumberInput.js +0 -33
  320. package/dist/NumberInput/__tests__/NumberInput.js.map +0 -1
  321. package/dist/NumberInput/index.js +0 -2
  322. package/dist/NumberInput/index.js.map +0 -1
  323. package/dist/Pagination/Pagination.js.map +0 -1
  324. package/dist/Pagination/Pagination.stories.d.ts +0 -14
  325. package/dist/Pagination/Pagination.stories.js +0 -26
  326. package/dist/Pagination/Pagination.stories.js.map +0 -1
  327. package/dist/Pagination/__tests__/Pagination.d.ts +0 -1
  328. package/dist/Pagination/__tests__/Pagination.js +0 -9
  329. package/dist/Pagination/__tests__/Pagination.js.map +0 -1
  330. package/dist/Pagination/index.js +0 -2
  331. package/dist/Pagination/index.js.map +0 -1
  332. package/dist/RadioGroup/RadioElement.js.map +0 -1
  333. package/dist/RadioGroup/RadioGroup.js.map +0 -1
  334. package/dist/RadioGroup/RadioGroup.stories.d.ts +0 -33
  335. package/dist/RadioGroup/RadioGroup.stories.js +0 -76
  336. package/dist/RadioGroup/RadioGroup.stories.js.map +0 -1
  337. package/dist/RadioGroup/RadioItem.js.map +0 -1
  338. package/dist/RadioGroup/constants.js.map +0 -1
  339. package/dist/RadioGroup/index.js +0 -2
  340. package/dist/RadioGroup/index.js.map +0 -1
  341. package/dist/RadioGroup/types.js +0 -2
  342. package/dist/RadioGroup/types.js.map +0 -1
  343. package/dist/Row/Row.js.map +0 -1
  344. package/dist/Row/Row.stories.d.ts +0 -20
  345. package/dist/Row/Row.stories.js +0 -63
  346. package/dist/Row/Row.stories.js.map +0 -1
  347. package/dist/Row/__tests__/Row.d.ts +0 -1
  348. package/dist/Row/__tests__/Row.js +0 -10
  349. package/dist/Row/__tests__/Row.js.map +0 -1
  350. package/dist/Row/index.js +0 -2
  351. package/dist/Row/index.js.map +0 -1
  352. package/dist/SearchInput/Container.d.ts +0 -3
  353. package/dist/SearchInput/Container.js +0 -36
  354. package/dist/SearchInput/Container.js.map +0 -1
  355. package/dist/SearchInput/SearchInput.js.map +0 -1
  356. package/dist/SearchInput/SearchInput.stories.d.ts +0 -9
  357. package/dist/SearchInput/SearchInput.stories.js +0 -16
  358. package/dist/SearchInput/SearchInput.stories.js.map +0 -1
  359. package/dist/SearchInput/SearchOptions.js.map +0 -1
  360. package/dist/SearchInput/index.js +0 -2
  361. package/dist/SearchInput/index.js.map +0 -1
  362. package/dist/Snackbar/Snackbar.stories.d.ts +0 -9
  363. package/dist/Snackbar/Snackbar.stories.js +0 -26
  364. package/dist/Snackbar/Snackbar.stories.js.map +0 -1
  365. package/dist/Snackbar/SnackbarContainer.js.map +0 -1
  366. package/dist/Snackbar/SnackbarItem.js.map +0 -1
  367. package/dist/Snackbar/hooks.js.map +0 -1
  368. package/dist/Snackbar/index.js +0 -3
  369. package/dist/Snackbar/index.js.map +0 -1
  370. package/dist/Snackbar/types.js +0 -2
  371. package/dist/Snackbar/types.js.map +0 -1
  372. package/dist/SupportMessage/Collection.d.ts +0 -2
  373. package/dist/SupportMessage/Collection.js +0 -63
  374. package/dist/SupportMessage/Collection.js.map +0 -1
  375. package/dist/SupportMessage/SupportMessage.js.map +0 -1
  376. package/dist/SupportMessage/SupportMessage.stories.d.ts +0 -11
  377. package/dist/SupportMessage/SupportMessage.stories.js +0 -33
  378. package/dist/SupportMessage/SupportMessage.stories.js.map +0 -1
  379. package/dist/SupportMessage/SupportMessage.test.d.ts +0 -1
  380. package/dist/SupportMessage/SupportMessage.test.js +0 -29
  381. package/dist/SupportMessage/SupportMessage.test.js.map +0 -1
  382. package/dist/SupportMessage/index.js +0 -2
  383. package/dist/SupportMessage/index.js.map +0 -1
  384. package/dist/Table/Table.js.map +0 -1
  385. package/dist/Table/Table.stories.d.ts +0 -21
  386. package/dist/Table/Table.stories.js +0 -173
  387. package/dist/Table/Table.stories.js.map +0 -1
  388. package/dist/Table/components/RowActions.js.map +0 -1
  389. package/dist/Table/components/TableHeader.js.map +0 -1
  390. package/dist/Table/components/TableRow.js.map +0 -1
  391. package/dist/Table/components/commonComponents.js.map +0 -1
  392. package/dist/Table/helpers.js.map +0 -1
  393. package/dist/Table/index.js +0 -3
  394. package/dist/Table/index.js.map +0 -1
  395. package/dist/Table/storyUtils.d.ts +0 -68
  396. package/dist/Table/storyUtils.js +0 -204
  397. package/dist/Table/storyUtils.js.map +0 -1
  398. package/dist/Table/types.js +0 -2
  399. package/dist/Table/types.js.map +0 -1
  400. package/dist/Tag/Collection.d.ts +0 -2
  401. package/dist/Tag/Collection.js +0 -77
  402. package/dist/Tag/Collection.js.map +0 -1
  403. package/dist/Tag/Tag.js.map +0 -1
  404. package/dist/Tag/Tag.stories.d.ts +0 -9
  405. package/dist/Tag/Tag.stories.js +0 -22
  406. package/dist/Tag/Tag.stories.js.map +0 -1
  407. package/dist/Tag/__tests__/Tag.d.ts +0 -1
  408. package/dist/Tag/__tests__/Tag.js +0 -9
  409. package/dist/Tag/__tests__/Tag.js.map +0 -1
  410. package/dist/Tag/index.js +0 -2
  411. package/dist/Tag/index.js.map +0 -1
  412. package/dist/Text/Text.js.map +0 -1
  413. package/dist/Text/Text.stories.d.ts +0 -12
  414. package/dist/Text/Text.stories.js +0 -60
  415. package/dist/Text/Text.stories.js.map +0 -1
  416. package/dist/Text/__tests__/Text.d.ts +0 -1
  417. package/dist/Text/__tests__/Text.js +0 -9
  418. package/dist/Text/__tests__/Text.js.map +0 -1
  419. package/dist/Text/fontMapping.js.map +0 -1
  420. package/dist/Text/index.js +0 -2
  421. package/dist/Text/index.js.map +0 -1
  422. package/dist/TextInput/Collection.d.ts +0 -2
  423. package/dist/TextInput/Collection.js +0 -80
  424. package/dist/TextInput/Collection.js.map +0 -1
  425. package/dist/TextInput/Container.d.ts +0 -2
  426. package/dist/TextInput/Container.js +0 -8
  427. package/dist/TextInput/Container.js.map +0 -1
  428. package/dist/TextInput/TextInput.js.map +0 -1
  429. package/dist/TextInput/TextInput.stories.d.ts +0 -17
  430. package/dist/TextInput/TextInput.stories.js +0 -44
  431. package/dist/TextInput/TextInput.stories.js.map +0 -1
  432. package/dist/TextInput/__tests__/TextInput.d.ts +0 -1
  433. package/dist/TextInput/__tests__/TextInput.js +0 -9
  434. package/dist/TextInput/__tests__/TextInput.js.map +0 -1
  435. package/dist/TextInput/index.js +0 -2
  436. package/dist/TextInput/index.js.map +0 -1
  437. package/dist/Textarea/Container.d.ts +0 -2
  438. package/dist/Textarea/Container.js +0 -8
  439. package/dist/Textarea/Container.js.map +0 -1
  440. package/dist/Textarea/Textarea.js.map +0 -1
  441. package/dist/Textarea/Textarea.stories.d.ts +0 -13
  442. package/dist/Textarea/Textarea.stories.js +0 -66
  443. package/dist/Textarea/Textarea.stories.js.map +0 -1
  444. package/dist/Textarea/index.js +0 -2
  445. package/dist/Textarea/index.js.map +0 -1
  446. package/dist/Toggle/Container.d.ts +0 -2
  447. package/dist/Toggle/Container.js +0 -7
  448. package/dist/Toggle/Container.js.map +0 -1
  449. package/dist/Toggle/Toggle.js.map +0 -1
  450. package/dist/Toggle/Toggle.stories.d.ts +0 -11
  451. package/dist/Toggle/Toggle.stories.js +0 -10
  452. package/dist/Toggle/Toggle.stories.js.map +0 -1
  453. package/dist/Toggle/__tests__/Toggle.d.ts +0 -1
  454. package/dist/Toggle/__tests__/Toggle.js +0 -9
  455. package/dist/Toggle/__tests__/Toggle.js.map +0 -1
  456. package/dist/Toggle/index.js +0 -2
  457. package/dist/Toggle/index.js.map +0 -1
  458. package/dist/Tooltip/Tooltip.js.map +0 -1
  459. package/dist/Tooltip/Tooltip.stories.d.ts +0 -12
  460. package/dist/Tooltip/Tooltip.stories.js +0 -87
  461. package/dist/Tooltip/Tooltip.stories.js.map +0 -1
  462. package/dist/Tooltip/index.js +0 -2
  463. package/dist/Tooltip/index.js.map +0 -1
  464. package/dist/colors.stories.d.ts +0 -7
  465. package/dist/colors.stories.js +0 -100
  466. package/dist/colors.stories.js.map +0 -1
  467. package/dist/fields/Field/Field.js.map +0 -1
  468. package/dist/fields/Field/index.js +0 -2
  469. package/dist/fields/Field/index.js.map +0 -1
  470. package/dist/fields/Fieldset/Fieldset.js.map +0 -1
  471. package/dist/fields/Fieldset/Fieldset.stories.d.ts +0 -11
  472. package/dist/fields/Fieldset/Fieldset.stories.js +0 -34
  473. package/dist/fields/Fieldset/Fieldset.stories.js.map +0 -1
  474. package/dist/fields/Fieldset/index.js +0 -2
  475. package/dist/fields/Fieldset/index.js.map +0 -1
  476. package/dist/fields/commonFieldTypes.js +0 -2
  477. package/dist/fields/commonFieldTypes.js.map +0 -1
  478. package/dist/fields/components/CommonInput.js.map +0 -1
  479. package/dist/fields/components/InternalField.js.map +0 -1
  480. package/dist/fields/components/Placeholder.js +0 -25
  481. package/dist/fields/components/Placeholder.js.map +0 -1
  482. package/dist/fontStyle.js.map +0 -1
  483. package/dist/hooks/index.js +0 -5
  484. package/dist/hooks/index.js.map +0 -1
  485. package/dist/hooks/useClickOutside/index.js.map +0 -1
  486. package/dist/hooks/useClickOutside/useClickOutside.test.js +0 -46
  487. package/dist/hooks/useClickOutside/useClickOutside.test.js.map +0 -1
  488. package/dist/hooks/useEventListener/index.js.map +0 -1
  489. package/dist/hooks/useEventListener/useEventLitener.test.js +0 -36
  490. package/dist/hooks/useEventListener/useEventLitener.test.js.map +0 -1
  491. package/dist/hooks/useScript/index.js.map +0 -1
  492. package/dist/hooks/useScript/useScript.test.js +0 -17
  493. package/dist/hooks/useScript/useScript.test.js.map +0 -1
  494. package/dist/hooks/useTimeout/index.js.map +0 -1
  495. package/dist/index.js.map +0 -1
  496. package/dist/setupTests.d.ts +0 -1
  497. package/dist/setupTests.js +0 -2
  498. package/dist/setupTests.js.map +0 -1
  499. package/dist/theme.js.map +0 -1
  500. package/dist/tokenTest.spec.js +0 -8
  501. package/dist/tokenTest.spec.js.map +0 -1
  502. package/dist/types.js +0 -2
  503. package/dist/types.js.map +0 -1
  504. package/dist/utils/date.js.map +0 -1
  505. package/dist/utils/debounce.js.map +0 -1
  506. package/dist/utils/deprecated.js +0 -30
  507. package/dist/utils/deprecated.js.map +0 -1
  508. package/dist/utils/flex.js.map +0 -1
  509. package/dist/utils/focusOutline.js.map +0 -1
  510. package/dist/utils/id.js.map +0 -1
  511. package/dist/utils/id.test.js +0 -21
  512. package/dist/utils/id.test.js.map +0 -1
  513. package/dist/utils/isReactElement.js.map +0 -1
  514. package/dist/utils/measure.js.map +0 -1
  515. package/dist/utils/noop.js +0 -3
  516. package/dist/utils/noop.js.map +0 -1
  517. package/dist/utils/responsiveProp.js.map +0 -1
  518. package/dist/utils/space.js.map +0 -1
  519. package/dist/utils/useControlledState.js.map +0 -1
  520. package/dist/utils/visuallyHidden.js.map +0 -1
@@ -1,57 +1,82 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import { darken } from 'polished';
2
- import React from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { Box } from '../Box';
5
- import { Icon } from '../Icon';
6
- import { Text } from '../Text';
7
- import { theme } from '../theme';
8
- import { isReactElement } from '../utils/isReactElement';
4
+ import { Box } from '../Box/Box.js';
5
+ import { Icon } from '../Icon/Icon.js';
6
+ import { Text } from '../Text/Text.js';
7
+ import { theme } from '../theme.js';
8
+ import { isReactElement } from '../utils/isReactElement.js';
9
+
9
10
  const styles = {
10
- info: {
11
- iconColor: 'liquorice',
12
- backgroundColor: theme.colors.custard,
13
- hoverBackgroundColor: darken(0.1, theme.colors.custard),
14
- icon: 'info',
15
- },
16
- fallbackStyle: {
17
- iconColor: 'liquorice',
18
- backgroundColor: theme.colors.coconut,
19
- hoverBackgroundColor: darken(0.1, theme.colors.coconut),
20
- icon: 'info',
21
- },
22
- alert: {
23
- iconColor: 'tangerine',
24
- backgroundColor: theme.colors.sherbert,
25
- hoverBackgroundColor: darken(0.1, theme.colors.sherbert),
26
- icon: 'alert',
27
- },
28
- warning: {
29
- iconColor: 'strawberry',
30
- backgroundColor: theme.colors.watermelon,
31
- hoverBackgroundColor: darken(0.1, theme.colors.watermelon),
32
- icon: 'warning',
33
- },
34
- success: {
35
- iconColor: 'apple',
36
- backgroundColor: theme.colors.mint,
37
- hoverBackgroundColor: darken(0.1, theme.colors.mint),
38
- icon: 'included',
39
- },
11
+ info: {
12
+ iconColor: "liquorice",
13
+ backgroundColor: theme.colors.custard,
14
+ hoverBackgroundColor: darken(0.1, theme.colors.custard),
15
+ icon: "info"
16
+ },
17
+ fallbackStyle: {
18
+ iconColor: "liquorice",
19
+ backgroundColor: theme.colors.coconut,
20
+ hoverBackgroundColor: darken(0.1, theme.colors.coconut),
21
+ icon: "info"
22
+ },
23
+ alert: {
24
+ iconColor: "tangerine",
25
+ backgroundColor: theme.colors.sherbert,
26
+ hoverBackgroundColor: darken(0.1, theme.colors.sherbert),
27
+ icon: "alert"
28
+ },
29
+ warning: {
30
+ iconColor: "strawberry",
31
+ backgroundColor: theme.colors.watermelon,
32
+ hoverBackgroundColor: darken(0.1, theme.colors.watermelon),
33
+ icon: "warning"
34
+ },
35
+ success: {
36
+ iconColor: "apple",
37
+ backgroundColor: theme.colors.mint,
38
+ hoverBackgroundColor: darken(0.1, theme.colors.mint),
39
+ icon: "included"
40
+ }
40
41
  };
41
- export const SupportMessage = ({ className, description, onClick, type = 'info', title, ...marginProps }) => {
42
- return (React.createElement(Wrapper, { className: className, type: type, onClick: onClick, ...marginProps },
43
- React.createElement(IconWrapper, null,
44
- React.createElement(Icon, { size: 20, render: styles[type].icon, color: styles[type].iconColor })),
45
- React.createElement(Box, { flex: true, direction: "column", mx: "8px" },
46
- title && React.createElement(Title, null, title),
47
- isReactElement(description) ? (React.createElement(DescriptionBox, null, description)) : (React.createElement(Description, { tag: "p" }, description))),
48
- onClick && (React.createElement(Box, { ml: { custom: 'auto' } },
49
- React.createElement(Icon, { size: 16, render: "caret", color: "marzipan", rotate: 270 })))));
42
+ const SupportMessage = ({
43
+ className,
44
+ description,
45
+ onClick,
46
+ type = "info",
47
+ title,
48
+ ...marginProps
49
+ }) => {
50
+ return /* @__PURE__ */ jsxs(
51
+ Wrapper,
52
+ {
53
+ className,
54
+ type,
55
+ onClick,
56
+ ...marginProps,
57
+ children: [
58
+ /* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(
59
+ Icon,
60
+ {
61
+ size: 20,
62
+ render: styles[type].icon,
63
+ color: styles[type].iconColor
64
+ }
65
+ ) }),
66
+ /* @__PURE__ */ jsxs(Box, { flex: true, direction: "column", mx: "8px", children: [
67
+ title && /* @__PURE__ */ jsx(Title, { children: title }),
68
+ isReactElement(description) ? /* @__PURE__ */ jsx(DescriptionBox, { children: description }) : /* @__PURE__ */ jsx(Description, { tag: "p", children: description })
69
+ ] }),
70
+ onClick && /* @__PURE__ */ jsx(Box, { ml: { custom: "auto" }, children: /* @__PURE__ */ jsx(Icon, { size: 16, render: "caret", color: "marzipan", rotate: 270 }) })
71
+ ]
72
+ }
73
+ );
50
74
  };
51
- const IconWrapper = styled(Box) `
75
+ const IconWrapper = styled(Box)`
52
76
  align-self: flex-start;
53
77
  `;
54
- const Wrapper = styled(Box)(({ type, onClick }) => css `
78
+ const Wrapper = styled(Box)(
79
+ ({ type, onClick }) => css`
55
80
  align-items: center;
56
81
  background-color: ${styles[type].backgroundColor};
57
82
  border-radius: 16px;
@@ -64,22 +89,24 @@ const Wrapper = styled(Box)(({ type, onClick }) => css `
64
89
  &:active {
65
90
  ${onClick && `background-color: ${styles[type].hoverBackgroundColor};`};
66
91
  }
67
- `);
68
- const Title = styled.p `
92
+ `
93
+ );
94
+ const Title = styled.p`
69
95
  font-size: 16px;
70
96
  font-weight: ${theme.font.weight.medium};
71
97
  color: ${theme.colors.liquorice};
72
98
  line-height: 20.8px;
73
99
  margin-bottom: 4px;
74
100
  `;
75
- const DescriptionBox = styled(Box) `
101
+ const DescriptionBox = styled(Box)`
76
102
  color: ${theme.colors.liquorice};
77
103
  font-size: 14px;
78
104
  line-height: 20px;
79
105
  `;
80
- const Description = styled(Text) `
106
+ const Description = styled(Text)`
81
107
  color: ${theme.colors.liquorice};
82
108
  font-size: 14px;
83
109
  line-height: 20px;
84
110
  `;
85
- //# sourceMappingURL=SupportMessage.js.map
111
+
112
+ export { SupportMessage };
@@ -1,51 +1,74 @@
1
- import React from 'react';
2
- import { Text } from '../Text';
3
- import { TableHeader } from './components/TableHeader';
4
- import { TableRow } from './components/TableRow';
5
- import { StyledCell, StyledTable } from './components/commonComponents';
6
- /**
7
- * A table component that displays data with various features such as expandable rows, striped rows, and fixed headers.
8
- *
9
- * Caveats:
10
- * - subRows should always have the same columns as the Parent table.
11
- * - stripedColor wont be applied to subRows or subTables.
12
- * - rowActions will always need an onClick, this will be automatically passed onto the ReactNode you place & will be selectable
13
- * - rows will scale depending on the cell content size
14
- * - using clickableRow with clickable cells, ensure you use e.stopPropagation in your cells onClick
15
- *
16
- * Improvements:
17
- * - It would be nice if we expandable logic inside this component, e.g the presence of certain props would automatically add this
18
- * -
19
- *
20
- * @template T - The type of data the table displays.
21
- * @property {T[]} data - Array of data to be displayed in the table.
22
- * @property {TableColumn<T>[]} columns - Array of columns to display in the table.
23
- * @property {boolean} [fixedHeader=false] - If true, the table header will be fixed/sticky.
24
- * @property {string} [headerHeight] - Sets the height of the header.
25
- * @property {function(T): boolean} [expandable] - A function to determine if a row is expandable.
26
- * @property {Color} [stripedColor] - If present, the table rows will have alternating colors.
27
- * @property {Color} [headerColor='mascarpone'] - The color for the table header.
28
- * @property {Color} [rowColor='custard'] - The default color for each table row.
29
- * @property {Color} [rowBorderColor='oatmeal'] - The default color for each table row border.
30
- * @property {ReactElement} [subTable] - A React element to show when a row is expanded.
31
- * @property {Object} [subRows] - Settings for sub rows.
32
- * @property {function(T): ReactElement} subRows.rows - Function that returns a React element for the sub row.
33
- * @property {boolean} [subRows.showOnExpand=false] - If true, the sub rows will only be shown when the row is expanded.
34
- * @property {RowAction<T>[]} [rowActions] - Array of actions that can be performed on each row.
35
- * @property {function<T>: void} [clickableRow] - Function to apply to a row, to make the entire row clickable, useful for navigation.
36
- * @property {string} [rowPadding] - The Y padding for each row.
37
- * @property {string} [columnPadding] - The X padding for each row.
38
- * @property {string} [noDataContent] - The text to show when there is no available data to map through.
39
- */
40
- export const Table = ({ columns, data, fixedHeader = true, expandable, subTable, subRows, headerHeight, headerColor = 'mascarpone', rowColor = 'custard', stripedColor, rowBorderColor = 'oatmeal', rowActions, clickableRow, rowPadding, columnPadding, noDataContent, }) => {
41
- const showActionsCell = expandable || rowActions;
42
- const expandSubProp = showActionsCell ? columns.length + 1 : columns.length;
43
- return (React.createElement(StyledTable, null,
44
- React.createElement("thead", null,
45
- React.createElement(TableHeader, { columns: columns, fixedHeader: fixedHeader, headerHeight: headerHeight, subTable: subTable, headerColor: headerColor, rowActions: rowActions, columnPadding: columnPadding, expandable: expandable })),
46
- React.createElement("tbody", null,
47
- data.length === 0 && (React.createElement(StyledCell, { colSpan: expandSubProp, rowPadding: rowPadding, columnPadding: columnPadding }, noDataContent ? (noDataContent) : (React.createElement(Text, { align: "center" }, "No available data")))),
48
- data.length !== 0 &&
49
- data.map((row, rowIndex) => (React.createElement(TableRow, { key: rowIndex, rowData: row, rowIndex: rowIndex, columns: columns, rowActions: rowActions, stripedColor: stripedColor, subTable: subTable, subRows: subRows, rowColor: rowColor, rowBorderColor: rowBorderColor, rowPadding: rowPadding, columnPadding: columnPadding, expandable: expandable, clickableRow: clickableRow }))))));
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Text } from '../Text/Text.js';
3
+ import { TableHeader } from './components/TableHeader.js';
4
+ import { TableRow } from './components/TableRow.js';
5
+ import { StyledTable, StyledCell } from './components/commonComponents.js';
6
+
7
+ const Table = ({
8
+ columns,
9
+ data,
10
+ fixedHeader = true,
11
+ expandable,
12
+ subTable,
13
+ subRows,
14
+ headerHeight,
15
+ headerColor = "mascarpone",
16
+ rowColor = "custard",
17
+ stripedColor,
18
+ rowBorderColor = "oatmeal",
19
+ rowActions,
20
+ clickableRow,
21
+ rowPadding,
22
+ columnPadding,
23
+ noDataContent
24
+ }) => {
25
+ const showActionsCell = expandable || rowActions;
26
+ const expandSubProp = showActionsCell ? columns.length + 1 : columns.length;
27
+ return /* @__PURE__ */ jsxs(StyledTable, { children: [
28
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx(
29
+ TableHeader,
30
+ {
31
+ columns,
32
+ fixedHeader,
33
+ headerHeight,
34
+ subTable,
35
+ headerColor,
36
+ rowActions,
37
+ columnPadding,
38
+ expandable
39
+ }
40
+ ) }),
41
+ /* @__PURE__ */ jsxs("tbody", { children: [
42
+ data.length === 0 && /* @__PURE__ */ jsx(
43
+ StyledCell,
44
+ {
45
+ colSpan: expandSubProp,
46
+ rowPadding,
47
+ columnPadding,
48
+ children: noDataContent ? noDataContent : /* @__PURE__ */ jsx(Text, { align: "center", children: "No available data" })
49
+ }
50
+ ),
51
+ data.length !== 0 && data.map((row, rowIndex) => /* @__PURE__ */ jsx(
52
+ TableRow,
53
+ {
54
+ rowData: row,
55
+ rowIndex,
56
+ columns,
57
+ rowActions,
58
+ stripedColor,
59
+ subTable,
60
+ subRows,
61
+ rowColor,
62
+ rowBorderColor,
63
+ rowPadding,
64
+ columnPadding,
65
+ expandable,
66
+ clickableRow
67
+ },
68
+ rowIndex
69
+ ))
70
+ ] })
71
+ ] });
50
72
  };
51
- //# sourceMappingURL=Table.js.map
73
+
74
+ export { Table };
@@ -1,45 +1,81 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
  import styled from 'styled-components';
3
- import { Box } from '../../Box';
4
- import { Button } from '../../Button';
5
- import { IconStrict } from '../../IconStrict';
6
- import { focusOutlineStyle } from '../../utils/focusOutline';
7
- import { isReactElement } from '../../utils/isReactElement';
8
- import { StyledCell } from './commonComponents';
9
- export const RowActions = ({ rowData, rowActions, expandable, isExpanded, toggleExpansion, }) => {
10
- const handleAction = (e, action) => {
11
- e.stopPropagation();
12
- action(rowData);
13
- };
14
- return (React.createElement(StyledCell, { stickyCell: Boolean(rowActions) || Boolean(expandable), rowActionsBgColor: rowActions?.bgColor },
15
- React.createElement(Box, { flex: true, alignItems: "center", justifyContent: "flex-end" },
16
- rowActions &&
17
- rowActions.actions?.map((action, actionIndex) => {
18
- if (!action.showCondition || action.showCondition(rowData)) {
19
- return (React.createElement(Wrapper, { flex: true, key: actionIndex },
20
- isReactElement(action.element) &&
21
- React.cloneElement(action.element, {
22
- onClick: (e) => {
23
- handleAction(e, action.onClick);
24
- },
25
- tabIndex: 0,
26
- className: 'reactElementRowAction',
27
- }),
28
- action.genericButton && !isReactElement(action.element) && (React.createElement(Button, { ...action.genericButton, handleClick: (e) => {
29
- handleAction(e, action.onClick);
30
- } }, action.genericButton.children)),
31
- action.iconButton && (React.createElement(IconStrict, { ...action.iconButton, handleClick: (e) => {
32
- handleAction(e, action.onClick);
33
- } }))));
34
- }
35
- return null;
36
- }),
37
- expandable && expandable(rowData) && (React.createElement(CaretIcon, { render: "caret", handleClick: (e) => {
38
- e.stopPropagation();
39
- toggleExpansion();
40
- }, size: 36, isOpen: isExpanded, backgroundColor: "cream" })))));
4
+ import { Box } from '../../Box/Box.js';
5
+ import { Button } from '../../Button/Button.js';
6
+ import { IconStrict } from '../../IconStrict/IconStrict.js';
7
+ import { focusOutlineStyle } from '../../utils/focusOutline.js';
8
+ import { isReactElement } from '../../utils/isReactElement.js';
9
+ import { StyledCell } from './commonComponents.js';
10
+
11
+ const RowActions = ({
12
+ rowData,
13
+ rowActions,
14
+ expandable,
15
+ isExpanded,
16
+ toggleExpansion
17
+ }) => {
18
+ const handleAction = (e, action) => {
19
+ e.stopPropagation();
20
+ action(rowData);
21
+ };
22
+ return /* @__PURE__ */ jsx(
23
+ StyledCell,
24
+ {
25
+ stickyCell: Boolean(rowActions) || Boolean(expandable),
26
+ rowActionsBgColor: rowActions?.bgColor,
27
+ children: /* @__PURE__ */ jsxs(Box, { flex: true, alignItems: "center", justifyContent: "flex-end", children: [
28
+ rowActions && rowActions.actions?.map((action, actionIndex) => {
29
+ if (!action.showCondition || action.showCondition(rowData)) {
30
+ return /* @__PURE__ */ jsxs(Wrapper, { flex: true, children: [
31
+ isReactElement(action.element) && React.cloneElement(action.element, {
32
+ onClick: (e) => {
33
+ handleAction(e, action.onClick);
34
+ },
35
+ tabIndex: 0,
36
+ className: "reactElementRowAction"
37
+ }),
38
+ action.genericButton && !isReactElement(action.element) && /* @__PURE__ */ jsx(
39
+ Button,
40
+ {
41
+ ...action.genericButton,
42
+ handleClick: (e) => {
43
+ handleAction(e, action.onClick);
44
+ },
45
+ children: action.genericButton.children
46
+ }
47
+ ),
48
+ action.iconButton && /* @__PURE__ */ jsx(
49
+ IconStrict,
50
+ {
51
+ ...action.iconButton,
52
+ handleClick: (e) => {
53
+ handleAction(e, action.onClick);
54
+ }
55
+ }
56
+ )
57
+ ] }, actionIndex);
58
+ }
59
+ return null;
60
+ }),
61
+ expandable && expandable(rowData) && /* @__PURE__ */ jsx(
62
+ CaretIcon,
63
+ {
64
+ render: "caret",
65
+ handleClick: (e) => {
66
+ e.stopPropagation();
67
+ toggleExpansion();
68
+ },
69
+ size: 36,
70
+ isOpen: isExpanded,
71
+ backgroundColor: "cream"
72
+ }
73
+ )
74
+ ] })
75
+ }
76
+ );
41
77
  };
42
- const Wrapper = styled(Box) `
78
+ const Wrapper = styled(Box)`
43
79
  white-space: nowrap;
44
80
  margin-right: 8px;
45
81
 
@@ -52,8 +88,11 @@ const Wrapper = styled(Box) `
52
88
  ${focusOutlineStyle}
53
89
  }
54
90
  `;
55
- const CaretIcon = styled(IconStrict)(({ isOpen }) => `
56
- transform: ${isOpen ? 'rotate(90deg)' : 'rotate(0deg)'};
91
+ const CaretIcon = styled(IconStrict)(
92
+ ({ isOpen }) => `
93
+ transform: ${isOpen ? "rotate(90deg)" : "rotate(0deg)"};
57
94
  transition: transform 0.3s ease;
58
- `);
59
- //# sourceMappingURL=RowActions.js.map
95
+ `
96
+ );
97
+
98
+ export { RowActions };
@@ -1,8 +1,41 @@
1
- import React from 'react';
2
- import { StyledHeaderCell, StyledRow } from './commonComponents';
3
- export const TableHeader = ({ columns, fixedHeader, headerColor, rowActions, headerHeight, columnPadding, expandable, }) => {
4
- return (React.createElement(StyledRow, null,
5
- columns.map((column, columnIndex) => (React.createElement(StyledHeaderCell, { key: columnIndex, fixedHeader: fixedHeader, headerHeight: headerHeight, minWidth: column.minWidth, maxWidth: column.maxWidth, headerColor: headerColor, columnPadding: columnPadding }, column.name))),
6
- (expandable || rowActions) && (React.createElement(StyledHeaderCell, { fixedHeader: fixedHeader, stickyCell: true, minWidth: rowActions?.minWidth, headerColor: headerColor, columnPadding: columnPadding }, "Actions"))));
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { StyledRow, StyledHeaderCell } from './commonComponents.js';
3
+
4
+ const TableHeader = ({
5
+ columns,
6
+ fixedHeader,
7
+ headerColor,
8
+ rowActions,
9
+ headerHeight,
10
+ columnPadding,
11
+ expandable
12
+ }) => {
13
+ return /* @__PURE__ */ jsxs(StyledRow, { children: [
14
+ columns.map((column, columnIndex) => /* @__PURE__ */ jsx(
15
+ StyledHeaderCell,
16
+ {
17
+ fixedHeader,
18
+ headerHeight,
19
+ minWidth: column.minWidth,
20
+ maxWidth: column.maxWidth,
21
+ headerColor,
22
+ columnPadding,
23
+ children: column.name
24
+ },
25
+ columnIndex
26
+ )),
27
+ (expandable || rowActions) && /* @__PURE__ */ jsx(
28
+ StyledHeaderCell,
29
+ {
30
+ fixedHeader,
31
+ stickyCell: true,
32
+ minWidth: rowActions?.minWidth,
33
+ headerColor,
34
+ columnPadding,
35
+ children: "Actions"
36
+ }
37
+ )
38
+ ] });
7
39
  };
8
- //# sourceMappingURL=TableHeader.js.map
40
+
41
+ export { TableHeader };