@loadsmart/loadsmart-ui 7.6.0 → 8.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (531) hide show
  1. package/README.md +13 -1
  2. package/dist/DragDropFile.context-oKnUu6d3.js +33 -0
  3. package/dist/{DragDropFile.context-D-EBrXnw.js.map → DragDropFile.context-oKnUu6d3.js.map} +1 -1
  4. package/dist/components/Banner/Banner.d.ts +2 -2
  5. package/dist/components/Button/Button.d.ts +1 -1
  6. package/dist/components/Calendar/Pickers/PickerButton.d.ts +4 -2
  7. package/dist/components/Card/Card.d.ts +4 -4
  8. package/dist/components/Card/CardTitle.d.ts +2 -2
  9. package/dist/components/DatePicker/DatePicker.d.ts +1 -1
  10. package/dist/components/DatePicker/useDatePicker.d.ts +8 -9
  11. package/dist/components/DatePicker/useDateRangePicker.d.ts +13 -14
  12. package/dist/components/Dialog/Dialog.d.ts +3 -5
  13. package/dist/components/DragDropFile/styles.d.ts +7 -7
  14. package/dist/components/Dropdown/Dropdown.d.ts +3 -3
  15. package/dist/components/Dropdown/DropdownMenu.d.ts +3 -3
  16. package/dist/components/Layout/Stack.d.ts +2 -2
  17. package/dist/components/Loaders/LoadingBar.d.ts +2 -2
  18. package/dist/components/Loaders/index.d.ts +3 -3
  19. package/dist/components/Modal/Modal.d.ts +1 -3
  20. package/dist/components/SideNavigation/Logo/Logo.d.ts +7 -2
  21. package/dist/components/SideNavigation/Menu/Menu.d.ts +7 -2
  22. package/dist/components/SideNavigation/Menu/MenuLink.d.ts +6 -1
  23. package/dist/components/SideNavigation/SideNavigation.d.ts +14 -4
  24. package/dist/components/Steps/StepsStep.d.ts +2 -2
  25. package/dist/components/Table/Table.d.ts +2 -1
  26. package/dist/components/TablePagination/TablePagination.styles.d.ts +5 -4
  27. package/dist/components/TablePagination/TablePaginationActions.d.ts +2 -5
  28. package/dist/components/Text/Text.d.ts +1 -1
  29. package/dist/components/TextField/TextField.d.ts +6 -2
  30. package/dist/components/ToggleGroup/Toggle.d.ts +2 -1
  31. package/dist/components/ToggleGroup/ToggleGroup.d.ts +2 -1
  32. package/dist/components/TopNavigation/Logo/Logo.d.ts +7 -2
  33. package/dist/components/TopNavigation/Menu/Menu.d.ts +2 -2
  34. package/dist/components/TopNavigation/Menu/MenuItemDropdown.d.ts +4 -4
  35. package/dist/components/TopNavigation/OpenSideNavButton/OpenSideNavButton.d.ts +2 -1
  36. package/dist/components/TopNavigation/TopNavigation.d.ts +8 -3
  37. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +1 -1
  38. package/dist/components/VisuallyHidden/VisuallyHidden.stories.d.ts +2 -1
  39. package/dist/index.js +9100 -253
  40. package/dist/index.js.map +1 -1
  41. package/dist/miranda-compatibility.theme-kYNEZ7mW.js +2528 -0
  42. package/dist/{miranda-compatibility.theme-ChPV-BBw.js.map → miranda-compatibility.theme-kYNEZ7mW.js.map} +1 -1
  43. package/dist/prop-K2Z3EsyG.js +81 -0
  44. package/dist/{prop-BwhJNJHO.js.map → prop-K2Z3EsyG.js.map} +1 -1
  45. package/dist/testing/index.js +282 -1
  46. package/dist/testing/index.js.map +1 -1
  47. package/dist/tests/renderer.d.ts +1 -1
  48. package/dist/theming/index.js +22 -1
  49. package/dist/theming/index.js.map +1 -1
  50. package/dist/toArray-Dxb1kUxx.js +14 -0
  51. package/dist/{toArray-BW3gx_gH.js.map → toArray-Dxb1kUxx.js.map} +1 -1
  52. package/dist/tools/index.js +6 -1
  53. package/dist/tools/index.js.map +1 -1
  54. package/dist/utils/toolset/flatten.d.ts +1 -1
  55. package/dist/utils/toolset/get.d.ts +1 -1
  56. package/dist/utils/toolset/isEmpty.d.ts +1 -1
  57. package/dist/utils/toolset/omit.d.ts +1 -1
  58. package/dist/utils/toolset/range.d.ts +1 -1
  59. package/package.json +46 -79
  60. package/dist/DragDropFile.context-D-EBrXnw.js +0 -2
  61. package/dist/DragDropFile.context-jVTIKfj5.mjs +0 -29
  62. package/dist/DragDropFile.context-jVTIKfj5.mjs.map +0 -1
  63. package/dist/index.mjs +0 -8046
  64. package/dist/index.mjs.map +0 -1
  65. package/dist/miranda-compatibility.theme-ChPV-BBw.js +0 -2
  66. package/dist/miranda-compatibility.theme-DQDHkWzC.mjs +0 -2469
  67. package/dist/miranda-compatibility.theme-DQDHkWzC.mjs.map +0 -1
  68. package/dist/prop-5m3D4883.mjs +0 -54
  69. package/dist/prop-5m3D4883.mjs.map +0 -1
  70. package/dist/prop-BwhJNJHO.js +0 -2
  71. package/dist/testing/index.mjs +0 -228
  72. package/dist/testing/index.mjs.map +0 -1
  73. package/dist/theming/index.mjs +0 -20
  74. package/dist/theming/index.mjs.map +0 -1
  75. package/dist/toArray-BW3gx_gH.js +0 -2
  76. package/dist/toArray-DqgeO2ua.mjs +0 -8
  77. package/dist/toArray-DqgeO2ua.mjs.map +0 -1
  78. package/dist/tools/index.mjs +0 -7
  79. package/dist/tools/index.mjs.map +0 -1
  80. package/src/@types/@loadsmart/utilsFunction.d.ts +0 -5
  81. package/src/@types/@loadsmart/utilsObject.d.ts +0 -5
  82. package/src/@types/svg.d.ts +0 -4
  83. package/src/addons/Theme/register.js +0 -590
  84. package/src/common/BackButton/BackButton.tsx +0 -18
  85. package/src/common/BackButton/index.ts +0 -2
  86. package/src/common/CloseButton/CloseButton.tsx +0 -55
  87. package/src/common/CloseButton/index.ts +0 -2
  88. package/src/common/SelectionWrapper.tsx +0 -130
  89. package/src/components/Accordion/Accordion.context.tsx +0 -36
  90. package/src/components/Accordion/Accordion.stories.tsx +0 -186
  91. package/src/components/Accordion/Accordion.test.tsx +0 -209
  92. package/src/components/Accordion/Accordion.tsx +0 -233
  93. package/src/components/Accordion/index.ts +0 -2
  94. package/src/components/Banner/Banner.stories.tsx +0 -213
  95. package/src/components/Banner/Banner.test.tsx +0 -118
  96. package/src/components/Banner/Banner.tsx +0 -418
  97. package/src/components/Banner/index.tsx +0 -2
  98. package/src/components/Breadcrumbs/Breadbrumbs.test.tsx +0 -125
  99. package/src/components/Breadcrumbs/Breadcrumb.tsx +0 -92
  100. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -21
  101. package/src/components/Breadcrumbs/Breadcrumbs.tsx +0 -54
  102. package/src/components/Breadcrumbs/index.ts +0 -4
  103. package/src/components/Button/Button.stories.tsx +0 -174
  104. package/src/components/Button/Button.test.tsx +0 -57
  105. package/src/components/Button/Button.tsx +0 -576
  106. package/src/components/Button/index.tsx +0 -2
  107. package/src/components/Calendar/Calendar.helpers.ts +0 -15
  108. package/src/components/Calendar/Calendar.stories.tsx +0 -168
  109. package/src/components/Calendar/Calendar.test.tsx +0 -316
  110. package/src/components/Calendar/Calendar.tsx +0 -130
  111. package/src/components/Calendar/Calendar.types.ts +0 -68
  112. package/src/components/Calendar/Date.helper.test.ts +0 -847
  113. package/src/components/Calendar/Date.helper.ts +0 -461
  114. package/src/components/Calendar/DateFormat.helper.test.ts +0 -171
  115. package/src/components/Calendar/DateFormat.helper.ts +0 -195
  116. package/src/components/Calendar/Month.helper.test.ts +0 -187
  117. package/src/components/Calendar/Month.helper.ts +0 -172
  118. package/src/components/Calendar/PickerModeToggle.tsx +0 -61
  119. package/src/components/Calendar/Pickers/DayPicker.test.tsx +0 -85
  120. package/src/components/Calendar/Pickers/DayPicker.tsx +0 -127
  121. package/src/components/Calendar/Pickers/MonthPicker.test.tsx +0 -77
  122. package/src/components/Calendar/Pickers/MonthPicker.tsx +0 -51
  123. package/src/components/Calendar/Pickers/PickerButton.tsx +0 -119
  124. package/src/components/Calendar/Pickers/YearPicker.test.tsx +0 -75
  125. package/src/components/Calendar/Pickers/YearPicker.tsx +0 -52
  126. package/src/components/Calendar/index.ts +0 -10
  127. package/src/components/Calendar/useCalendar.ts +0 -190
  128. package/src/components/Calendar/usePickerMode.ts +0 -48
  129. package/src/components/Card/Card.stories.tsx +0 -117
  130. package/src/components/Card/Card.test.tsx +0 -139
  131. package/src/components/Card/Card.tsx +0 -106
  132. package/src/components/Card/CardTitle.tsx +0 -43
  133. package/src/components/Card/index.ts +0 -2
  134. package/src/components/Checkbox/Checkbox.stories.tsx +0 -79
  135. package/src/components/Checkbox/Checkbox.test.tsx +0 -66
  136. package/src/components/Checkbox/Checkbox.tsx +0 -170
  137. package/src/components/Checkbox/index.ts +0 -2
  138. package/src/components/DatePicker/DatePicker.stories.tsx +0 -113
  139. package/src/components/DatePicker/DatePicker.test.tsx +0 -174
  140. package/src/components/DatePicker/DatePicker.tsx +0 -140
  141. package/src/components/DatePicker/DatePicker.types.ts +0 -30
  142. package/src/components/DatePicker/DateRangePicker.stories.tsx +0 -128
  143. package/src/components/DatePicker/DateRangePicker.test.tsx +0 -267
  144. package/src/components/DatePicker/DateRangePicker.tsx +0 -110
  145. package/src/components/DatePicker/index.ts +0 -3
  146. package/src/components/DatePicker/useDatePicker.ts +0 -201
  147. package/src/components/DatePicker/useDateRangePicker.ts +0 -224
  148. package/src/components/Dialog/Dialog.stories.tsx +0 -227
  149. package/src/components/Dialog/Dialog.test.tsx +0 -74
  150. package/src/components/Dialog/Dialog.tsx +0 -139
  151. package/src/components/Dialog/index.tsx +0 -4
  152. package/src/components/Dialog/useDialog.tsx +0 -59
  153. package/src/components/DragDropFile/DragDropFile.context.tsx +0 -39
  154. package/src/components/DragDropFile/DragDropFile.stories.tsx +0 -183
  155. package/src/components/DragDropFile/DragDropFile.tsx +0 -11
  156. package/src/components/DragDropFile/components/DropZone.test.tsx +0 -108
  157. package/src/components/DragDropFile/components/DropZone.tsx +0 -145
  158. package/src/components/DragDropFile/components/FileItem.tsx +0 -117
  159. package/src/components/DragDropFile/components/FileList.test.tsx +0 -119
  160. package/src/components/DragDropFile/components/FileList.tsx +0 -47
  161. package/src/components/DragDropFile/components/Wrapper.tsx +0 -22
  162. package/src/components/DragDropFile/index.ts +0 -9
  163. package/src/components/DragDropFile/mocks.ts +0 -23
  164. package/src/components/DragDropFile/styles.tsx +0 -81
  165. package/src/components/DragDropFile/types.ts +0 -85
  166. package/src/components/Drawer/Drawer.stories.tsx +0 -83
  167. package/src/components/Drawer/Drawer.test.tsx +0 -90
  168. package/src/components/Drawer/Drawer.tsx +0 -225
  169. package/src/components/Drawer/index.ts +0 -4
  170. package/src/components/Dropdown/Dropdown.context.ts +0 -13
  171. package/src/components/Dropdown/Dropdown.fixtures.ts +0 -15
  172. package/src/components/Dropdown/Dropdown.stories.tsx +0 -259
  173. package/src/components/Dropdown/Dropdown.test.tsx +0 -173
  174. package/src/components/Dropdown/Dropdown.tsx +0 -141
  175. package/src/components/Dropdown/Dropdown.types.ts +0 -59
  176. package/src/components/Dropdown/DropdownMenu.tsx +0 -263
  177. package/src/components/Dropdown/DropdownTrigger.tsx +0 -368
  178. package/src/components/Dropdown/index.ts +0 -15
  179. package/src/components/Dropdown/useDropdown.test.ts +0 -96
  180. package/src/components/Dropdown/useDropdown.ts +0 -65
  181. package/src/components/EmptyState/EmptyState.mocks.tsx +0 -60
  182. package/src/components/EmptyState/EmptyState.stories.tsx +0 -239
  183. package/src/components/EmptyState/EmptyState.test.tsx +0 -101
  184. package/src/components/EmptyState/EmptyState.tsx +0 -22
  185. package/src/components/EmptyState/EmptyState.types.ts +0 -59
  186. package/src/components/EmptyState/EmptyStateWithIcon.tsx +0 -42
  187. package/src/components/EmptyState/EmptyStateWithIllustration.tsx +0 -72
  188. package/src/components/EmptyState/Illustration.tsx +0 -29
  189. package/src/components/EmptyState/index.ts +0 -4
  190. package/src/components/ErrorMessage/ErrorMessage.stories.tsx +0 -26
  191. package/src/components/ErrorMessage/ErrorMessage.test.tsx +0 -24
  192. package/src/components/ErrorMessage/ErrorMessage.tsx +0 -19
  193. package/src/components/ErrorMessage/index.ts +0 -2
  194. package/src/components/HighlightMatch/HighlightMatch.stories.tsx +0 -24
  195. package/src/components/HighlightMatch/HighlightMatch.test.tsx +0 -37
  196. package/src/components/HighlightMatch/HighlightMatch.tsx +0 -29
  197. package/src/components/HighlightMatch/index.ts +0 -2
  198. package/src/components/Icon/Icon.tsx +0 -55
  199. package/src/components/Icon/assets/back.svg +0 -4
  200. package/src/components/Icon/assets/burger-menu.svg +0 -3
  201. package/src/components/Icon/assets/calendar.svg +0 -5
  202. package/src/components/Icon/assets/caret-down.svg +0 -4
  203. package/src/components/Icon/assets/caret-left.svg +0 -4
  204. package/src/components/Icon/assets/caret-right-last.svg +0 -4
  205. package/src/components/Icon/assets/caret-right.svg +0 -4
  206. package/src/components/Icon/assets/check.svg +0 -4
  207. package/src/components/Icon/assets/chevron-down.svg +0 -3
  208. package/src/components/Icon/assets/circle.svg +0 -3
  209. package/src/components/Icon/assets/close.svg +0 -4
  210. package/src/components/Icon/assets/dots-horizontal.svg +0 -1
  211. package/src/components/Icon/assets/information.svg +0 -4
  212. package/src/components/Icon/assets/minus.svg +0 -4
  213. package/src/components/Icon/assets/plus.svg +0 -4
  214. package/src/components/Icon/assets/refresh.svg +0 -3
  215. package/src/components/Icon/assets/sort-asc.svg +0 -7
  216. package/src/components/Icon/assets/sort-desc.svg +0 -7
  217. package/src/components/Icon/assets/sort.svg +0 -7
  218. package/src/components/Icon/assets/upload.svg +0 -3
  219. package/src/components/Icon/assets/warning.svg +0 -4
  220. package/src/components/Icon/index.ts +0 -2
  221. package/src/components/IconFactory/IconFactory.fixtures.tsx +0 -31
  222. package/src/components/IconFactory/IconFactory.stories.tsx +0 -120
  223. package/src/components/IconFactory/IconFactory.test.tsx +0 -36
  224. package/src/components/IconFactory/IconFactory.tsx +0 -75
  225. package/src/components/IconFactory/index.ts +0 -2
  226. package/src/components/Label/Label.stories.tsx +0 -47
  227. package/src/components/Label/Label.test.tsx +0 -80
  228. package/src/components/Label/Label.tsx +0 -120
  229. package/src/components/Label/index.ts +0 -2
  230. package/src/components/Layout/Box.tsx +0 -98
  231. package/src/components/Layout/Grid.tsx +0 -42
  232. package/src/components/Layout/Group.tsx +0 -55
  233. package/src/components/Layout/Layout.stories.tsx +0 -412
  234. package/src/components/Layout/Layout.tsx +0 -19
  235. package/src/components/Layout/Layout.types.ts +0 -9
  236. package/src/components/Layout/Layout.utils.ts +0 -20
  237. package/src/components/Layout/Sidebar.tsx +0 -75
  238. package/src/components/Layout/Stack.tsx +0 -63
  239. package/src/components/Layout/Switcher.tsx +0 -48
  240. package/src/components/Layout/index.tsx +0 -8
  241. package/src/components/Link/Link.stories.tsx +0 -22
  242. package/src/components/Link/Link.test.tsx +0 -79
  243. package/src/components/Link/Link.tsx +0 -114
  244. package/src/components/Link/index.ts +0 -3
  245. package/src/components/Link/useSafeLink.ts +0 -49
  246. package/src/components/Loaders/LoadingBar.stories.tsx +0 -36
  247. package/src/components/Loaders/LoadingBar.test.tsx +0 -35
  248. package/src/components/Loaders/LoadingBar.tsx +0 -65
  249. package/src/components/Loaders/LoadingDots.stories.tsx +0 -69
  250. package/src/components/Loaders/LoadingDots.test.tsx +0 -22
  251. package/src/components/Loaders/LoadingDots.tsx +0 -68
  252. package/src/components/Loaders/Spinner.stories.tsx +0 -24
  253. package/src/components/Loaders/Spinner.test.tsx +0 -35
  254. package/src/components/Loaders/Spinner.tsx +0 -68
  255. package/src/components/Loaders/index.tsx +0 -3
  256. package/src/components/Modal/Modal.stories.tsx +0 -121
  257. package/src/components/Modal/Modal.test.tsx +0 -46
  258. package/src/components/Modal/Modal.tsx +0 -163
  259. package/src/components/Modal/index.tsx +0 -2
  260. package/src/components/Pagination/Pagination.constants.ts +0 -7
  261. package/src/components/Pagination/Pagination.helper.ts +0 -88
  262. package/src/components/Pagination/Pagination.stories.tsx +0 -29
  263. package/src/components/Pagination/Pagination.test.tsx +0 -102
  264. package/src/components/Pagination/Pagination.tsx +0 -34
  265. package/src/components/Pagination/Pagination.types.ts +0 -55
  266. package/src/components/Pagination/PaginationItem.tsx +0 -74
  267. package/src/components/Pagination/index.ts +0 -2
  268. package/src/components/Pagination/usePagination.test.ts +0 -188
  269. package/src/components/Pagination/usePagination.ts +0 -87
  270. package/src/components/Popover/Popover.stories.tsx +0 -50
  271. package/src/components/Popover/Popover.test.tsx +0 -22
  272. package/src/components/Popover/Popover.tsx +0 -110
  273. package/src/components/Popover/Popover.types.ts +0 -39
  274. package/src/components/Popover/index.ts +0 -11
  275. package/src/components/ProgressBar/ProgressBar.stories.tsx +0 -47
  276. package/src/components/ProgressBar/ProgressBar.test.tsx +0 -40
  277. package/src/components/ProgressBar/ProgressBar.tsx +0 -89
  278. package/src/components/ProgressBar/index.tsx +0 -2
  279. package/src/components/Radio/Radio.stories.tsx +0 -75
  280. package/src/components/Radio/Radio.test.tsx +0 -66
  281. package/src/components/Radio/Radio.tsx +0 -153
  282. package/src/components/Radio/index.ts +0 -2
  283. package/src/components/Section/Section.test.tsx +0 -35
  284. package/src/components/Section/Section.tsx +0 -66
  285. package/src/components/Section/Sections.stories.tsx +0 -56
  286. package/src/components/Section/index.ts +0 -2
  287. package/src/components/Select/Select.constants.ts +0 -12
  288. package/src/components/Select/Select.context.ts +0 -11
  289. package/src/components/Select/Select.fixtures.ts +0 -167
  290. package/src/components/Select/Select.stories.tsx +0 -780
  291. package/src/components/Select/Select.test.tsx +0 -1109
  292. package/src/components/Select/Select.tsx +0 -271
  293. package/src/components/Select/Select.types.ts +0 -148
  294. package/src/components/Select/SelectCreatableOption.tsx +0 -20
  295. package/src/components/Select/SelectEmpty.test.tsx +0 -15
  296. package/src/components/Select/SelectEmpty.tsx +0 -29
  297. package/src/components/Select/SelectOption.test.tsx +0 -78
  298. package/src/components/Select/SelectOption.tsx +0 -79
  299. package/src/components/Select/SelectTrigger.tsx +0 -83
  300. package/src/components/Select/components.tsx +0 -14
  301. package/src/components/Select/index.ts +0 -12
  302. package/src/components/Select/useSelect.helpers.test.ts +0 -184
  303. package/src/components/Select/useSelect.helpers.ts +0 -63
  304. package/src/components/Select/useSelect.test.ts +0 -207
  305. package/src/components/Select/useSelect.ts +0 -540
  306. package/src/components/Select/useSelectExternal.ts +0 -26
  307. package/src/components/SideNavigation/Logo/Logo.test.tsx +0 -19
  308. package/src/components/SideNavigation/Logo/Logo.tsx +0 -26
  309. package/src/components/SideNavigation/Logo/index.ts +0 -1
  310. package/src/components/SideNavigation/Menu/Menu.test.tsx +0 -65
  311. package/src/components/SideNavigation/Menu/Menu.tsx +0 -53
  312. package/src/components/SideNavigation/Menu/MenuBaseItem.tsx +0 -64
  313. package/src/components/SideNavigation/Menu/MenuExpandable.tsx +0 -107
  314. package/src/components/SideNavigation/Menu/MenuLink.tsx +0 -37
  315. package/src/components/SideNavigation/Menu/index.ts +0 -1
  316. package/src/components/SideNavigation/Separator/Separator.test.tsx +0 -14
  317. package/src/components/SideNavigation/Separator/Separator.tsx +0 -20
  318. package/src/components/SideNavigation/Separator/index.ts +0 -1
  319. package/src/components/SideNavigation/SideNavigation.stories.tsx +0 -69
  320. package/src/components/SideNavigation/SideNavigation.test.tsx +0 -21
  321. package/src/components/SideNavigation/SideNavigation.tsx +0 -47
  322. package/src/components/SideNavigation/index.ts +0 -5
  323. package/src/components/SideNavigation/useSideNavigation.ts +0 -36
  324. package/src/components/Steps/ProgressSteps/ProgressStep.tsx +0 -163
  325. package/src/components/Steps/ProgressSteps/ProgressSteps.tsx +0 -37
  326. package/src/components/Steps/ProgressSteps/index.ts +0 -1
  327. package/src/components/Steps/Steps.fixtures.ts +0 -11
  328. package/src/components/Steps/Steps.helpers.ts +0 -11
  329. package/src/components/Steps/Steps.stories.tsx +0 -65
  330. package/src/components/Steps/Steps.test.tsx +0 -78
  331. package/src/components/Steps/Steps.tsx +0 -53
  332. package/src/components/Steps/Steps.types.ts +0 -5
  333. package/src/components/Steps/StepsContext.ts +0 -5
  334. package/src/components/Steps/StepsStep.tsx +0 -58
  335. package/src/components/Steps/index.ts +0 -6
  336. package/src/components/Steps/useStep.test.tsx +0 -217
  337. package/src/components/Steps/useSteps.ts +0 -131
  338. package/src/components/Switch/Switch.stories.tsx +0 -65
  339. package/src/components/Switch/Switch.test.tsx +0 -60
  340. package/src/components/Switch/Switch.tsx +0 -209
  341. package/src/components/Switch/index.ts +0 -2
  342. package/src/components/Table/Selection.tsx +0 -202
  343. package/src/components/Table/Table.fixtures.ts +0 -101
  344. package/src/components/Table/Table.stories.tsx +0 -568
  345. package/src/components/Table/Table.test.tsx +0 -310
  346. package/src/components/Table/Table.tsx +0 -523
  347. package/src/components/Table/Table.types.ts +0 -93
  348. package/src/components/Table/TableSortHandle.tsx +0 -31
  349. package/src/components/Table/index.tsx +0 -2
  350. package/src/components/Table/useSortBy.test.ts +0 -96
  351. package/src/components/Table/useSortBy.ts +0 -92
  352. package/src/components/Table/useSortBy.types.ts +0 -21
  353. package/src/components/TablePagination/RowsPerPage.tsx +0 -81
  354. package/src/components/TablePagination/TablePagination.stories.tsx +0 -42
  355. package/src/components/TablePagination/TablePagination.styles.ts +0 -13
  356. package/src/components/TablePagination/TablePagination.test.tsx +0 -111
  357. package/src/components/TablePagination/TablePagination.tsx +0 -49
  358. package/src/components/TablePagination/TablePagination.types.ts +0 -69
  359. package/src/components/TablePagination/TablePaginationActions.tsx +0 -144
  360. package/src/components/TablePagination/index.ts +0 -2
  361. package/src/components/Tabs/Tabs.stories.tsx +0 -78
  362. package/src/components/Tabs/Tabs.test.tsx +0 -103
  363. package/src/components/Tabs/Tabs.tsx +0 -287
  364. package/src/components/Tabs/Tabs.types.ts +0 -7
  365. package/src/components/Tabs/TabsContext.ts +0 -10
  366. package/src/components/Tabs/index.ts +0 -2
  367. package/src/components/Tag/Tag.stories.tsx +0 -112
  368. package/src/components/Tag/Tag.test.tsx +0 -19
  369. package/src/components/Tag/Tag.tsx +0 -393
  370. package/src/components/Tag/index.ts +0 -2
  371. package/src/components/Text/Text.stories.tsx +0 -59
  372. package/src/components/Text/Text.test.tsx +0 -48
  373. package/src/components/Text/Text.tsx +0 -14
  374. package/src/components/Text/index.ts +0 -2
  375. package/src/components/TextField/TextField.stories.tsx +0 -90
  376. package/src/components/TextField/TextField.test.tsx +0 -36
  377. package/src/components/TextField/TextField.tsx +0 -244
  378. package/src/components/TextField/index.ts +0 -6
  379. package/src/components/TextField/useTextField.tsx +0 -26
  380. package/src/components/Textarea/Textarea.stories.tsx +0 -101
  381. package/src/components/Textarea/Textarea.test.tsx +0 -14
  382. package/src/components/Textarea/Textarea.tsx +0 -230
  383. package/src/components/Textarea/index.ts +0 -2
  384. package/src/components/Toast/Toast.stories.tsx +0 -50
  385. package/src/components/Toast/Toast.test.tsx +0 -24
  386. package/src/components/Toast/Toast.tsx +0 -141
  387. package/src/components/Toast/icons/close.svg +0 -3
  388. package/src/components/Toast/icons/danger.svg +0 -4
  389. package/src/components/Toast/icons/neutral.svg +0 -4
  390. package/src/components/Toast/icons/success.svg +0 -3
  391. package/src/components/Toast/icons/warning.svg +0 -4
  392. package/src/components/Toast/index.tsx +0 -2
  393. package/src/components/ToggleGroup/Toggle.test.tsx +0 -76
  394. package/src/components/ToggleGroup/Toggle.tsx +0 -158
  395. package/src/components/ToggleGroup/ToggleGroup.constants.ts +0 -16
  396. package/src/components/ToggleGroup/ToggleGroup.stories.tsx +0 -145
  397. package/src/components/ToggleGroup/ToggleGroup.test.tsx +0 -237
  398. package/src/components/ToggleGroup/ToggleGroup.tsx +0 -165
  399. package/src/components/ToggleGroup/ToggleGroup.types.ts +0 -35
  400. package/src/components/ToggleGroup/ToggleGroupContext.ts +0 -13
  401. package/src/components/ToggleGroup/index.ts +0 -3
  402. package/src/components/Tooltip/Tooltip.stories.tsx +0 -82
  403. package/src/components/Tooltip/Tooltip.test.tsx +0 -49
  404. package/src/components/Tooltip/Tooltip.tsx +0 -185
  405. package/src/components/Tooltip/index.ts +0 -2
  406. package/src/components/TopNavigation/Logo/Logo.test.tsx +0 -21
  407. package/src/components/TopNavigation/Logo/Logo.tsx +0 -20
  408. package/src/components/TopNavigation/Logo/index.ts +0 -1
  409. package/src/components/TopNavigation/Menu/Menu.test.tsx +0 -125
  410. package/src/components/TopNavigation/Menu/Menu.tsx +0 -62
  411. package/src/components/TopNavigation/Menu/MenuItemDropdown.tsx +0 -118
  412. package/src/components/TopNavigation/Menu/MenuItemIcon.tsx +0 -50
  413. package/src/components/TopNavigation/Menu/index.ts +0 -1
  414. package/src/components/TopNavigation/OpenSideNavButton/OpenSideNavButton.tsx +0 -28
  415. package/src/components/TopNavigation/OpenSideNavButton/index.ts +0 -1
  416. package/src/components/TopNavigation/TopNavigation.stories.tsx +0 -42
  417. package/src/components/TopNavigation/TopNavigation.tsx +0 -47
  418. package/src/components/TopNavigation/index.ts +0 -2
  419. package/src/components/VisuallyHidden/VisuallyHidden.mdx +0 -26
  420. package/src/components/VisuallyHidden/VisuallyHidden.stories.tsx +0 -32
  421. package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +0 -18
  422. package/src/components/VisuallyHidden/VisuallyHidden.tsx +0 -6
  423. package/src/components/VisuallyHidden/index.ts +0 -1
  424. package/src/docs/tools/DatePickerEvent.stories.mdx +0 -108
  425. package/src/docs/tools/DragDropFileEvent.stories.mdx +0 -75
  426. package/src/docs/tools/conditional.stories.mdx +0 -251
  427. package/src/docs/tools/selectEvent.stories.mdx +0 -121
  428. package/src/hooks/useClickOutside/index.ts +0 -1
  429. package/src/hooks/useClickOutside/useClickOutside.test.tsx +0 -116
  430. package/src/hooks/useClickOutside/useClickOutside.ts +0 -65
  431. package/src/hooks/useDidMount/index.ts +0 -1
  432. package/src/hooks/useDidMount/useDidMount.test.tsx +0 -38
  433. package/src/hooks/useDidMount/useDidMount.ts +0 -20
  434. package/src/hooks/useFingerprint/index.ts +0 -1
  435. package/src/hooks/useFingerprint/useFingerprint.test.ts +0 -76
  436. package/src/hooks/useFingerprint/useFingerprint.ts +0 -94
  437. package/src/hooks/useFocusTrap/index.ts +0 -2
  438. package/src/hooks/useFocusTrap/useFocusTrap.stories.tsx +0 -87
  439. package/src/hooks/useFocusTrap/useFocusTrap.test.tsx +0 -129
  440. package/src/hooks/useFocusTrap/useFocusTrap.ts +0 -187
  441. package/src/hooks/useFocusWithin/index.ts +0 -2
  442. package/src/hooks/useFocusWithin/useFocusWithin.test.tsx +0 -71
  443. package/src/hooks/useFocusWithin/useFocusWithin.ts +0 -62
  444. package/src/hooks/useHeightExpansionToggler/index.ts +0 -2
  445. package/src/hooks/useHeightExpansionToggler/useHeightExpansionToggler.test.tsx +0 -85
  446. package/src/hooks/useHeightExpansionToggler/useHeightExpansionToggler.ts +0 -54
  447. package/src/hooks/useID/index.ts +0 -1
  448. package/src/hooks/useID/useID.ts +0 -18
  449. package/src/hooks/useSelectable/SelectableStrategy.test.ts +0 -424
  450. package/src/hooks/useSelectable/SelectableStrategy.ts +0 -143
  451. package/src/hooks/useSelectable/index.ts +0 -8
  452. package/src/hooks/useSelectable/useSelectable.test.ts +0 -221
  453. package/src/hooks/useSelectable/useSelectable.ts +0 -156
  454. package/src/hooks/useSelectable/useSelectable.types.ts +0 -45
  455. package/src/hooks/useWindowResize/index.ts +0 -1
  456. package/src/hooks/useWindowResize/useWindowResize.ts +0 -27
  457. package/src/index.ts +0 -188
  458. package/src/stories/assets/code-brackets.svg +0 -1
  459. package/src/stories/assets/colors.svg +0 -1
  460. package/src/stories/assets/comments.svg +0 -1
  461. package/src/stories/assets/direction.svg +0 -1
  462. package/src/stories/assets/flow.svg +0 -1
  463. package/src/stories/assets/plugin.svg +0 -1
  464. package/src/stories/assets/repo.svg +0 -1
  465. package/src/stories/assets/stackalt.svg +0 -1
  466. package/src/stories/introduction.stories.mdx +0 -57
  467. package/src/stories/startPage.stories.mdx +0 -95
  468. package/src/styles/activatable.tsx +0 -30
  469. package/src/styles/disableable.tsx +0 -45
  470. package/src/styles/ellipsizable.tsx +0 -14
  471. package/src/styles/focusable.tsx +0 -32
  472. package/src/styles/font.test.ts +0 -31
  473. package/src/styles/font.tsx +0 -40
  474. package/src/styles/hidden.tsx +0 -29
  475. package/src/styles/hoverable.tsx +0 -30
  476. package/src/styles/transition.tsx +0 -25
  477. package/src/styles/typography.test.ts +0 -93
  478. package/src/styles/typography.ts +0 -190
  479. package/src/testing/DatePickerEvent/DatePickerEvent.ts +0 -117
  480. package/src/testing/DatePickerEvent/DateRangePickerEvent.ts +0 -83
  481. package/src/testing/DatePickerEvent/index.ts +0 -2
  482. package/src/testing/DragDropFileEvent/DragDropFileEvent.ts +0 -56
  483. package/src/testing/DragDropFileEvent/index.ts +0 -1
  484. package/src/testing/SelectEvent/SelectEvent.test.tsx +0 -192
  485. package/src/testing/SelectEvent/SelectEvent.ts +0 -264
  486. package/src/testing/SelectEvent/index.ts +0 -1
  487. package/src/testing/getInterpolatedStyles/getInterpolatedStyles.ts +0 -25
  488. package/src/testing/getInterpolatedStyles/index.ts +0 -1
  489. package/src/testing/index.ts +0 -6
  490. package/src/testing/renderWithDragDropFileProvider/index.ts +0 -1
  491. package/src/testing/renderWithDragDropFileProvider/renderWithDragDropFileProvider.tsx +0 -28
  492. package/src/tests/generator.ts +0 -127
  493. package/src/tests/renderer.tsx +0 -39
  494. package/src/theming/index.ts +0 -42
  495. package/src/theming/themes/alice.theme.ts +0 -1022
  496. package/src/theming/themes/index.ts +0 -3
  497. package/src/theming/themes/loadsmart.theme.ts +0 -1019
  498. package/src/theming/themes/miranda-compatibility.theme.ts +0 -972
  499. package/src/theming/theming.helpers.ts +0 -95
  500. package/src/tools/conditional.test.ts +0 -166
  501. package/src/tools/conditional.ts +0 -127
  502. package/src/tools/index.ts +0 -2
  503. package/src/tools/prop.test.ts +0 -52
  504. package/src/tools/prop.ts +0 -36
  505. package/src/utils/toolset/awaitTo.ts +0 -24
  506. package/src/utils/toolset/flatten.ts +0 -3
  507. package/src/utils/toolset/formatBytes.test.ts +0 -45
  508. package/src/utils/toolset/formatBytes.ts +0 -18
  509. package/src/utils/toolset/get.ts +0 -2
  510. package/src/utils/toolset/getID.test.ts +0 -57
  511. package/src/utils/toolset/getID.ts +0 -93
  512. package/src/utils/toolset/getOrdinalSuffix.test.ts +0 -27
  513. package/src/utils/toolset/getOrdinalSuffix.ts +0 -15
  514. package/src/utils/toolset/highlightMatch.test.tsx +0 -32
  515. package/src/utils/toolset/highlightMatch.tsx +0 -32
  516. package/src/utils/toolset/interleave.test.ts +0 -40
  517. package/src/utils/toolset/interleave.ts +0 -23
  518. package/src/utils/toolset/isEmpty.ts +0 -2
  519. package/src/utils/toolset/isThenable.test.ts +0 -40
  520. package/src/utils/toolset/isThenable.ts +0 -14
  521. package/src/utils/toolset/keyboard.ts +0 -50
  522. package/src/utils/toolset/omit.ts +0 -2
  523. package/src/utils/toolset/pluralize.ts +0 -16
  524. package/src/utils/toolset/range.ts +0 -2
  525. package/src/utils/toolset/rem.ts +0 -7
  526. package/src/utils/toolset/styledCompounds.ts +0 -22
  527. package/src/utils/toolset/toArray.ts +0 -16
  528. package/src/utils/types/ColorScheme.ts +0 -3
  529. package/src/utils/types/EventLike.ts +0 -11
  530. package/src/utils/types/InterpolatedStyle.ts +0 -3
  531. package/src/utils/types/Status.ts +0 -8
@@ -1 +0,0 @@
1
- {"version":3,"file":"prop-5m3D4883.mjs","sources":["../src/tools/conditional.ts","../src/tools/prop.ts"],"sourcesContent":["import { isObject } from '@loadsmart/utils-object'\nimport { isFunction } from '@loadsmart/utils-function'\nimport type { F } from 'ts-toolbelt'\n\nimport { getToken } from 'theming'\nimport type { ThemeToken, ThemedProps } from 'theming'\nimport get from 'utils/toolset/get'\nimport toArray from 'utils/toolset/toArray'\n\ntype WhenProps<K> = K | undefined | ((value: K) => boolean | undefined)\n\nexport type When<P> = {\n [Key in keyof P]?: WhenProps<P[Key]> | WhenProps<P[Key]>[] | undefined\n}\n\n/**\n * Utility to generate style/class name conditions based on a components props.\n * Expected prop values can be a single value, an array of values or a function/callback.\n * @example\n * ```jsx\n * whenProps({\n * 'prop-a': true, // checks `props['prop-a']` === true`\n * 'prop-b': [1, 2], // checks `toArray([1, 2]).includes(props['prop-b'])`\n * 'prop-c': (value) => value + 1 // checks `Boolean(callback(props['prop-c']))`\n * 'prop-d': Boolean // checks `Boolean(Boolean(props['prop-d']))`\n * })\n * ```\n * @param {...Object} conditions\n * @returns {(props: Object}) => boolean} Returns function that consumes component props.\n */\nexport function whenProps<P>(conditions: When<F.Narrow<P>> | When<F.Narrow<P>>[]) {\n return function (props: P): boolean {\n const safeConditions = toArray(conditions)\n\n let res = false\n\n for (let i = 0; i < safeConditions.length; i++) {\n const condition = safeConditions[i]\n const keys = Object.keys(condition)\n\n let temp = true\n\n for (let j = 0; j < keys.length && temp; j++) {\n const key = keys[j]\n const propValue = get(props, key) as P[keyof P]\n const conditionValue = condition[key as keyof typeof condition]\n\n if (Array.isArray(conditionValue)) {\n temp = temp && toArray(conditionValue).includes(propValue)\n } else if (isFunction(conditionValue)) {\n temp = temp && Boolean(conditionValue(propValue))\n } else {\n temp = temp && (conditionValue as unknown) === propValue\n }\n }\n\n res = res || temp\n }\n\n return res\n }\n}\n\ntype ConditionObject<P> = Record<\n string,\n string | number | boolean | ((props: P) => boolean) | undefined\n>\n\nfunction handleConditionObject<P>(condition: ConditionObject<P>, props: P): string {\n const keys = Object.keys(condition || {})\n\n const res = keys.reduce((acc, key) => {\n let value = condition[key]\n\n if (isFunction(value)) {\n value = value(props)\n }\n\n if (value) {\n const tokenKey = key as ThemeToken\n const result = (getToken(tokenKey, props as unknown as ThemedProps) ?? key) as string\n return [...acc, result]\n }\n\n return acc\n }, [] as string[])\n\n return res.join(' ')\n}\n\ntype Condition<P> = number | string | ConditionObject<P> | ((props: P) => string)\n\n/**\n * Concatenate style properties or class names conditionally.\n * Conditions can be functions that consume components props,\n * objects, strings, or numbers (that will be coerced to strings).\n * @example\n * ```jsx\n * conditional(1, 'some-class', {\n * 'class-a': true,\n * 'class-b': (props) => props.showClassB,\n * }, (props) => props.className)\n * ```\n * @param conditions\n * @returns {(props: ThemedProps) => string} Returns function that consumes component props.\n */\nfunction conditional<P>(...conditions: Condition<P>[]) {\n return function (props: P): string {\n let classes: string[] = []\n\n for (let i = 0; i < conditions.length; i++) {\n const condition = conditions[i]\n\n if (isFunction(condition)) {\n classes.push(condition(props))\n } else if (isObject(condition)) {\n classes = classes.concat(handleConditionObject<P>(condition, props))\n } else if (condition) {\n classes.push(String(condition))\n }\n }\n\n return classes.join(' ')\n }\n}\n\nexport default conditional\n","function compare(...args: any[]): unknown {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const [value, defaultValue] = args\n\n if (value == null || value === false || Number.isNaN(value)) {\n return defaultValue || value\n }\n\n if (typeof value === 'string' && value.length === 0) {\n return defaultValue || value\n }\n\n return value\n}\n\n/**\n * Retrieve the key value from the props object\n * @example\n * ```jsx\n * -transform: scaleY(${(props) => props.$height || 1});\n * +transform: scaleY(${prop('$height', 1)});\n * ```\n * @param name a valid property name from the object\n * @param defaultValue a fallback value in case the property value is invalid\n * @param comparatorFn a function to be used to decide between value or defaultValue\n * @returns {(props: ThemedProps) => string} Returns function that consumes component props.\n */\nfunction prop<P, K extends keyof P = keyof P>(\n name: K,\n defaultValue?: NonNullable<P[K]>,\n comparatorFn = compare\n) {\n return (props: P): P[K] => comparatorFn(props[name], defaultValue) as P[K]\n}\n\nexport default prop\n"],"names":["whenProps","conditions","props","safeConditions","toArray","res","i","length","condition","keys","Object","temp","j","key","propValue","get","conditionValue","Array","isArray","includes","isFunction","Boolean","handleConditionObject","reduce","acc","value","result","getToken","join","conditional","classes","push","isObject","concat","String","compare","args","defaultValue","Number","isNaN","prop","name","comparatorFn"],"mappings":";;;;;AA8BO,SAASA,EAAaC,GAAqD;AAChF,SAAO,SAAUC,GAAmB;AAC5BC,UAAAA,IAAiBC,EAAQH,CAAU;AAEzC,QAAII,IAAM;AAEV,aAASC,IAAI,GAAGA,IAAIH,EAAeI,QAAQD,KAAK;AACxCE,YAAAA,IAAYL,EAAeG,CAAC,GAC5BG,IAAOC,OAAOD,KAAKD,CAAS;AAElC,UAAIG,IAAO;AAEX,eAASC,IAAI,GAAGA,IAAIH,EAAKF,UAAUI,GAAMC,KAAK;AACtCC,cAAAA,IAAMJ,EAAKG,CAAC,GACZE,IAAYC,EAAIb,GAAOW,CAAG,GAC1BG,IAAiBR,EAAUK,CAA6B;AAE1DI,QAAAA,MAAMC,QAAQF,CAAc,IAC9BL,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C8B,KAAgBZ;AAI3B;AAcA,SAASe,EACPC,GACAJ,GACAK,IAAeP,GACf;AACA,SAAO,CAACjC,MAAmBwC,EAAaxC,EAAMuC,CAAI,GAAGJ,CAAY;AACnE;"}
@@ -1,2 +0,0 @@
1
- "use strict";const g=require("@loadsmart/utils-object"),a=require("@loadsmart/utils-function"),h=require("./theming/index.js"),p=require("lodash/get.js"),y=require("./toArray-BW3gx_gH.js"),j=t=>t&&t.__esModule?t:{default:t},b=j(p);function k(t){return function(e){const n=y.toArray(t);let r=!1;for(let o=0;o<n.length;o++){const u=n[o],s=Object.keys(u);let i=!0;for(let c=0;c<s.length&&i;c++){const d=s[c],f=b.default(e,d),l=u[d];Array.isArray(l)?i=i&&y.toArray(l).includes(f):a.isFunction(l)?i=i&&!!l(f):i=i&&l===f}r=r||i}return r}}function _(t,e){return Object.keys(t||{}).reduce((o,u)=>{let s=t[u];if(a.isFunction(s)&&(s=s(e)),s){const i=u,c=h.getToken(i,e)??u;return[...o,c]}return o},[]).join(" ")}function q(...t){return function(e){let n=[];for(let r=0;r<t.length;r++){const o=t[r];a.isFunction(o)?n.push(o(e)):g.isObject(o)?n=n.concat(_(o,e)):o&&n.push(String(o))}return n.join(" ")}}function A(...t){const[e,n]=t;return(e==null||e===!1||Number.isNaN(e)||typeof e=="string"&&e.length===0)&&n||e}function O(t,e,n=A){return r=>n(r[t],e)}exports.conditional=q;exports.prop=O;exports.whenProps=k;
2
- //# sourceMappingURL=prop-BwhJNJHO.js.map
@@ -1,228 +0,0 @@
1
- import { queries as r, fireEvent as o, act as w, waitFor as l, createEvent as m, within as c, waitForElementToBeRemoved as S, render as T } from "@testing-library/react";
2
- import { t as E } from "../toArray-DqgeO2ua.mjs";
3
- import { isFunction as I } from "@loadsmart/utils-function";
4
- import { a as P } from "../miranda-compatibility.theme-DQDHkWzC.mjs";
5
- import F from "react";
6
- import { D as N } from "../DragDropFile.context-jVTIKfj5.mjs";
7
- function s(e) {
8
- return e.parentNode.parentNode.parentNode.parentNode;
9
- }
10
- async function k(e) {
11
- const t = s(e);
12
- r.queryByRole(t, "menu") || (o.click(e), await l(() => {
13
- expect(r.getByRole(t, "menu")).toBeInTheDocument();
14
- }));
15
- }
16
- async function y(e) {
17
- const t = s(e);
18
- r.queryByRole(t, "menu") && (o.click(r.getByText(t, "Close")), await l(() => {
19
- expect(r.queryByRole(t, "menu")).not.toBeInTheDocument();
20
- }));
21
- }
22
- async function q(e, t) {
23
- const n = s(t);
24
- await k(t), w(() => {
25
- t.focus();
26
- });
27
- const a = r.getByLabelText(n, e);
28
- a && a.getAttribute("aria-checked") == "false" && o.click(a), await y(t);
29
- }
30
- async function A(e) {
31
- const t = s(e), n = r.getByLabelText(t, "Clear selection");
32
- o.click(n), await y(e);
33
- }
34
- async function L(e) {
35
- const t = s(e);
36
- await k(e);
37
- const n = r.queryAllByRole(t, "checkbox", {
38
- checked: !0
39
- });
40
- return await y(e), n;
41
- }
42
- const i = {
43
- getContainer: s,
44
- expand: k,
45
- collapse: y,
46
- pick: q,
47
- clear: A,
48
- getSelectedDates: L
49
- };
50
- async function D(e) {
51
- await i.expand(e);
52
- }
53
- async function h(e) {
54
- await i.collapse(e);
55
- }
56
- async function $(e, t) {
57
- const n = i.getContainer(t);
58
- await D(t);
59
- const [a, f] = e;
60
- if (a != null) {
61
- const p = r.getByTestId(n, "input-date-range-start");
62
- await i.pick(a, p);
63
- }
64
- if (f != null) {
65
- const p = r.getByTestId(n, "input-date-range-end");
66
- await i.pick(f, p);
67
- }
68
- await h(t);
69
- }
70
- async function O(e) {
71
- await i.clear(e);
72
- }
73
- async function j(e) {
74
- return i.getSelectedDates(e);
75
- }
76
- const ne = {
77
- getContainer: i.getContainer,
78
- expand: D,
79
- collapse: h,
80
- pick: $,
81
- clear: O,
82
- getSelectedDates: j
83
- }, x = (e) => e.parentNode, M = (e) => {
84
- const t = x(e), n = m.dragOver(t);
85
- o(t, n);
86
- }, U = (e) => {
87
- const t = x(e), n = m.dragLeave(t);
88
- o(t, n);
89
- }, z = (e, t) => {
90
- const n = x(e), a = m.drop(n);
91
- Object.defineProperty(a, "dataTransfer", {
92
- value: {
93
- files: E(t)
94
- }
95
- }), o(n, a);
96
- }, ae = {
97
- dragOver: M,
98
- dragLeave: U,
99
- dropFiles: z
100
- };
101
- function B(e) {
102
- return e.parentNode.parentNode.parentNode;
103
- }
104
- function d(e) {
105
- return e.parentNode.parentNode.nextSibling;
106
- }
107
- function R(e) {
108
- return e.parentNode.nextSibling.nextSibling;
109
- }
110
- function b(e) {
111
- return e.parentNode;
112
- }
113
- function v(e) {
114
- return B(e).children.length === 3;
115
- }
116
- async function C(e) {
117
- const t = b(e);
118
- c(t).queryByTestId("select-trigger-loading") && await S(() => c(t).queryByTestId("select-trigger-loading"), {
119
- timeout: 2500
120
- });
121
- }
122
- async function u(e) {
123
- if (await C(e), v(e))
124
- return;
125
- const t = R(e);
126
- await l(() => {
127
- expect(t).toBeEnabled();
128
- }), w(() => {
129
- e.dispatchEvent(new MouseEvent("click", {
130
- bubbles: !0
131
- }));
132
- }), await l(() => {
133
- expect(c(B(e)).getByRole("listbox")).toBeInTheDocument();
134
- });
135
- }
136
- async function g(e) {
137
- if (!v(e))
138
- return;
139
- const t = R(e);
140
- o.click(t), await l(() => {
141
- expect(c(B(e)).queryByRole("listbox")).not.toBeInTheDocument();
142
- });
143
- }
144
- async function H(e, t) {
145
- await u(t);
146
- const n = d(t), a = await c(n).findByLabelText(e);
147
- a && a.getAttribute("aria-selected") == "false" && (o.mouseDown(a), w(() => {
148
- a.focus();
149
- }), o.mouseUp(a), o.click(a)), await g(t);
150
- }
151
- async function V(e, t) {
152
- await u(t);
153
- const n = d(t), a = await c(n).findByLabelText(e);
154
- a && a.getAttribute("aria-selected") === "true" && o.click(a), await g(t);
155
- }
156
- async function _(e) {
157
- await C(e);
158
- const t = b(e), n = c(t).getByTestId("select-trigger-clear");
159
- n && o.click(n);
160
- }
161
- async function Q(e, t) {
162
- o.change(t, {
163
- target: {
164
- value: e
165
- }
166
- }), await C(t);
167
- const n = d(t);
168
- await c(n).findAllByRole("option");
169
- }
170
- async function W(e) {
171
- await u(e);
172
- const t = d(e), n = c(t).queryAllByRole("option");
173
- return await g(e), n;
174
- }
175
- async function Z(e) {
176
- await u(e);
177
- const t = d(e);
178
- let n = [];
179
- try {
180
- n = await c(t).findAllByRole("option", {
181
- selected: !0
182
- });
183
- } catch {
184
- n = [];
185
- }
186
- return await g(e), n;
187
- }
188
- const oe = {
189
- select: H,
190
- unselect: V,
191
- clear: _,
192
- search: Q,
193
- expand: u,
194
- collapse: g,
195
- getOptions: W,
196
- getSelectedOptions: Z,
197
- isMenuExpanded: v
198
- };
199
- function re(e) {
200
- return E(e).map((t) => {
201
- for (; I(t); )
202
- t = t({
203
- theme: P
204
- });
205
- return t;
206
- }).join("");
207
- }
208
- const G = {
209
- fileList: [],
210
- onFilesAdded: jest.fn(),
211
- onRetryUpload: jest.fn(),
212
- onRemoveFile: jest.fn()
213
- }, ce = (e, t) => {
214
- const n = {
215
- ...G,
216
- ...t
217
- };
218
- return T(((f) => /* @__PURE__ */ F.createElement(N.Provider, { value: n }, f))(e));
219
- };
220
- export {
221
- i as DatePickerEvent,
222
- ne as DateRangePickerEvent,
223
- ae as DragDropFileEvent,
224
- oe as SelectEvent,
225
- re as getInterpolatedStyles,
226
- ce as renderWithDragDropFileProvider
227
- };
228
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/testing/DatePickerEvent/DatePickerEvent.ts","../../src/testing/DatePickerEvent/DateRangePickerEvent.ts","../../src/testing/DragDropFileEvent/DragDropFileEvent.ts","../../src/testing/SelectEvent/SelectEvent.ts","../../src/testing/getInterpolatedStyles/getInterpolatedStyles.ts","../../src/testing/renderWithDragDropFileProvider/renderWithDragDropFileProvider.tsx"],"sourcesContent":["/* eslint-disable */\nimport { act, queries, fireEvent, waitFor, waitForElementToBeRemoved } from '@testing-library/react'\n// find the date picker container from its input field 🤷\nfunction getContainerFromInput(input: HTMLElement): HTMLElement {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return input.parentNode!.parentNode!.parentNode!.parentNode as HTMLElement\n}\n\n/**\n * Expand the `DatePicker` calendar, if it not already expanded.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `DatePicker`\n * @returns {Promise<void>}\n */\nasync function expand(input: HTMLElement): Promise<void> {\n const datePickerContainer = getContainerFromInput(input)\n\n // if menu is rendered, then the select is already expanded\n if (queries.queryByRole(datePickerContainer, 'menu')) {\n return\n }\n\n fireEvent.click(input)\n\n await waitFor(() => {\n expect(queries.getByRole(datePickerContainer, 'menu')).toBeInTheDocument()\n })\n}\n\n/**\n * Collapse the `DatePicker` calendar, if it not already collapsed.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `DatePicker`\n * @returns {Promise<void>}\n */\nasync function collapse(input: HTMLElement): Promise<void> {\n const datePickerContainer = getContainerFromInput(input)\n\n // if menu is not rendered, then the select is already collapsed\n if (!queries.queryByRole(datePickerContainer, 'menu')) {\n return\n }\n\n fireEvent.click(queries.getByText(datePickerContainer, 'Close'))\n\n await waitFor(() => {\n expect(queries.queryByRole(datePickerContainer, 'menu')).not.toBeInTheDocument()\n })\n}\n\n/**\n * Pick (select) the provided day in the current month/year.\n * Notice that we programatically expand the `DatePicker` calendar before picking the date.\n * @param {string} day - Label for the day to be picked, formatted as mm/dd/yyyy.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `DatePicker`\n * @returns {Promise<void>}\n */\nasync function pick(day: string, input: HTMLElement): Promise<void> {\n const datePickerContainer = getContainerFromInput(input)\n\n await expand(input)\n\n act(() => {\n input.focus()\n })\n\n const dayElement = queries.getByLabelText(datePickerContainer, day)\n\n if (dayElement && dayElement.getAttribute('aria-checked') == 'false') {\n fireEvent.click(dayElement)\n }\n\n await collapse(input)\n}\n\n/**\n * Clear the selection, if there are any options selected.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `DatePicker`\n * @returns {Promise<void>}\n */\nasync function clear(input: HTMLElement): Promise<void> {\n const datePickerContainer = getContainerFromInput(input)\n\n const clearButton = queries.getByLabelText(datePickerContainer, 'Clear selection')\n\n fireEvent.click(clearButton)\n\n await collapse(input)\n}\n\n/**\n * Get options elements currently selected in the `DatePicker` calendar.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `DatePicker`\n * @returns {Promise<HTMLElement[]>}\n */\nasync function getSelectedDates(input: HTMLElement): Promise<HTMLElement[]> {\n const datePickerContainer = getContainerFromInput(input)\n\n await expand(input)\n\n const selectedDays: HTMLElement[] = queries.queryAllByRole(datePickerContainer, 'checkbox', {\n checked: true,\n })\n\n await collapse(input)\n\n return selectedDays\n}\n\nconst datePickerEvent = {\n getContainer: getContainerFromInput,\n expand,\n collapse,\n pick,\n clear,\n getSelectedDates,\n}\n\nexport default datePickerEvent\n","/* eslint-disable */\nimport { queries } from '@testing-library/react'\n\nimport DatePickerEvent from './DatePickerEvent'\n\n/**\n * Expand the `DatePicker` calendar, if it not already expanded.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `DatePicker`\n * @returns {Promise<void>}\n */\nasync function expand(input: HTMLElement): Promise<void> {\n await DatePickerEvent.expand(input)\n}\n\n/**\n * Collapse the `DatePicker` calendar, if it not already collapsed.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `DatePicker`\n * @returns {Promise<void>}\n */\nasync function collapse(input: HTMLElement): Promise<void> {\n await DatePickerEvent.collapse(input)\n}\n\n/**\n * Pick (select) the provided day in the current month/year.\n * Notice that we programatically expand the `DatePicker` calendar before picking the date.\n * @param {string} day - Label for the day to be picked, formatted as mm/dd/yyyy.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `DatePicker`\n * @returns {Promise<void>}\n */\nasync function pick(range: [string | null, string | null], input: HTMLElement): Promise<void> {\n const dateRangePickerContainer = DatePickerEvent.getContainer(input)\n\n await expand(input)\n\n const [rangeStart, rangeEnd] = range\n\n if (rangeStart != null) {\n const dateRangeStartInput = queries.getByTestId(\n dateRangePickerContainer,\n 'input-date-range-start'\n )\n\n await DatePickerEvent.pick(rangeStart, dateRangeStartInput)\n }\n\n if (rangeEnd != null) {\n const dateRangeEndInput = queries.getByTestId(dateRangePickerContainer, 'input-date-range-end')\n\n await DatePickerEvent.pick(rangeEnd, dateRangeEndInput)\n }\n\n await collapse(input)\n}\n\n/**\n * Clear the selection, if there are any options selected.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `DatePicker`\n * @returns {Promise<void>}\n */\nasync function clear(input: HTMLElement): Promise<void> {\n await DatePickerEvent.clear(input)\n}\n\n/**\n * Get options elements currently selected in the `DatePicker` calendar.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `DatePicker`\n * @returns {Promise<HTMLElement[]>}\n */\nasync function getSelectedDates(input: HTMLElement): Promise<HTMLElement[]> {\n return DatePickerEvent.getSelectedDates(input)\n}\n\nexport const dateRangePickerEvent = {\n getContainer: DatePickerEvent.getContainer,\n expand,\n collapse,\n pick,\n clear,\n getSelectedDates,\n}\n\nexport default dateRangePickerEvent\n","import { createEvent, fireEvent } from '@testing-library/react'\n\nimport toArray from 'utils/toolset/toArray'\n\n/**\n * Get the input dropzone, which is the input parent (label).\n * @param {HTMLInputElement} input - You can refer to this element by the aria-label you provide to the DragDropFile component\n */\nconst getDropZoneFromInput = (input: HTMLInputElement): HTMLLabelElement =>\n input.parentNode as HTMLLabelElement\n\n/**\n * Simulates the onDragOver event on the drop zone.\n * @param {HTMLInputElement} input - You can refer to this element by the aria-label you provide to the DragDropFile component\n */\nconst dragOver = (input: HTMLInputElement) => {\n const dropzone = getDropZoneFromInput(input)\n\n const dragOverEvent = createEvent.dragOver(dropzone)\n\n fireEvent(dropzone, dragOverEvent)\n}\n\n/**\n * Simulates the onDragLeave event on the drop zone.\n * @param {HTMLInputElement} input - You can refer to this element by the aria-label you provide to the DragDropFile component\n */\nconst dragLeave = (input: HTMLInputElement) => {\n const dropzone = getDropZoneFromInput(input)\n\n const dragLeaveEvent = createEvent.dragLeave(dropzone)\n\n fireEvent(dropzone, dragLeaveEvent)\n}\n\n/**\n * Simulates the onDrop event on the drop zone. You can provide a list of files or a single file.\n * @param {HTMLInputElement} input - You can refer to this element by the aria-label you provide to the DragDropFile component\n */\nconst dropFiles = (input: HTMLInputElement, files: File | File[]) => {\n const dropzone = getDropZoneFromInput(input)\n\n const fileDropEvent = createEvent.drop(dropzone)\n\n Object.defineProperty(fileDropEvent, 'dataTransfer', { value: { files: toArray(files) } })\n\n fireEvent(dropzone, fileDropEvent)\n}\n\nexport const DragDropFileEvent = {\n dragOver,\n dragLeave,\n dropFiles,\n}\n\nexport default DragDropFileEvent\n","import { act, waitFor, within, waitForElementToBeRemoved, fireEvent } from '@testing-library/react'\n\n// based on https://github.com/romgain/react-select-event/blob/master/src/index.ts\n\n// find the select container from its input field 🤷\nfunction getSelectContainer(input: HTMLElement): HTMLElement {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return input.parentNode!.parentNode!.parentNode as HTMLElement\n}\n\n/**\n * Please, make sure to call expand before trying to get the menu container\n */\nfunction getSelectMenu(input: HTMLElement): HTMLElement {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return input.parentNode!.parentNode!.nextSibling as HTMLElement\n}\n\nfunction getSelectTriggerHandle(input: HTMLElement): HTMLElement {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return input.parentNode!.nextSibling!.nextSibling as HTMLElement\n}\n\nfunction getSelectSearchContainer(input: HTMLElement): HTMLElement {\n return input.parentNode as HTMLElement\n}\n\nfunction isSelectMenuExpanded(input: HTMLElement): boolean {\n const selectContainer = getSelectContainer(input)\n\n /**\n * Once the select is expanded, we have the following structure:\n * +-------------+\n * | Close button (visually hidden)\n * +-------------+\n * | DropdownTrigger\n * +-------------+\n * | Popover\n * +-------------+\n *\n * This, if the container has 3 children, we assume the menu is expanded\n */\n return selectContainer.children.length === 3\n}\n\n/**\n * This is needed because some datasources might be asynchronous.\n * To ensure that the data they retrieve will be available, we wait for the\n * querying phase to finish.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `Select`.\n */\nasync function waitForPendingQuery(input: HTMLElement) {\n const searchContainer = getSelectSearchContainer(input)\n\n if (!within(searchContainer).queryByTestId('select-trigger-loading')) {\n return\n }\n\n await waitForElementToBeRemoved(\n () => within(searchContainer).queryByTestId('select-trigger-loading'),\n { timeout: 2500 }\n )\n}\n\n/**\n * Expand the `Select` menu, if it not already expanded.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `Select`.\n * @returns {Promise<void>}\n */\nasync function expand(input: HTMLElement): Promise<void> {\n await waitForPendingQuery(input)\n\n if (isSelectMenuExpanded(input)) {\n return\n }\n\n const triggerHandle = getSelectTriggerHandle(input)\n\n await waitFor(() => {\n expect(triggerHandle).toBeEnabled()\n })\n\n /**\n * Using act and a manually dispatched event so we can account for the\n * state changes that happen when the search input is clicked.\n * This is mainly related to the `handleEvent` from the `useClickOutside` hook.\n */\n act(() => {\n input.dispatchEvent(new MouseEvent('click', { bubbles: true }))\n })\n\n await waitFor(() => {\n expect(within(getSelectContainer(input)).getByRole('listbox')).toBeInTheDocument()\n })\n}\n\n/**\n * Collapse the `Select` menu, if it not already collapsed.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `Select`.\n * @returns {Promise<void>}\n */\nasync function collapse(input: HTMLElement): Promise<void> {\n if (!isSelectMenuExpanded(input)) {\n return\n }\n\n const triggerHandle = getSelectTriggerHandle(input)\n\n fireEvent.click(triggerHandle)\n\n await waitFor(() => {\n expect(within(getSelectContainer(input)).queryByRole('listbox')).not.toBeInTheDocument()\n })\n}\n\n/**\n * Select the provided option(s), if they are present in the menu.\n * Notice that we programatically expand the `Select` menu before select the item\n * @param {string | RegExp} option - Label for the option to be selected.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `Select`.\n * @returns {Promise<void>}\n */\nasync function select(option: string | RegExp, input: HTMLElement): Promise<void> {\n await expand(input)\n\n const menuContainer = getSelectMenu(input)\n\n const optionElement = await within(menuContainer).findByLabelText(option)\n\n // click the option if exists; Select currently closes when an item is clicked.\n if (optionElement && optionElement.getAttribute('aria-selected') == 'false') {\n /**\n * This is a replacement for the `userEvent.click`.\n * We are adopting this approach to remove the peer dep to @testing-library/user-event for\n * applications using this helper, so they are not tied to the same user-event as this library.\n * It follows the same sequence of event stated in the documentation available at:\n * https://testing-library.com/docs/guide-events/#interactions-vs-events\n */\n fireEvent.mouseDown(optionElement)\n\n act(() => {\n optionElement.focus()\n })\n\n fireEvent.mouseUp(optionElement)\n fireEvent.click(optionElement)\n }\n\n // we collapse in the case the option was not clicked\n await collapse(input)\n}\n\n/**\n * Unselect the provided option(s), if they are present in the menu AND are selected.\n * Notice that we programatically expand the `Select` menu before select the item\n * @param {string} option - Label for the option to be unselected.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `Select`.\n * @returns {Promise<void>}\n */\nasync function unselect(option: string, input: HTMLElement): Promise<void> {\n await expand(input)\n\n const menuContainer = getSelectMenu(input)\n\n const optionElement = await within(menuContainer).findByLabelText(option)\n\n // ensures that the option exists and IS selected\n if (optionElement && optionElement.getAttribute('aria-selected') === 'true') {\n fireEvent.click(optionElement)\n }\n\n // we collapse in the case the option was not clicked\n await collapse(input)\n}\n\n/**\n * Clear the selection, if there are any options selected.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `Select`.\n * @returns {Promise<void>}\n */\nasync function clear(input: HTMLElement): Promise<void> {\n await waitForPendingQuery(input)\n\n const searchContainer = getSelectSearchContainer(input)\n\n const clearButton = within(searchContainer).getByTestId('select-trigger-clear')\n\n if (clearButton) {\n fireEvent.click(clearButton)\n }\n}\n\n/**\n * Perform search based on the given `query`. It will fail if the option is not found.\n * @param {string} query - Search term.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `Select`.\n * @returns {Promise<void>}\n */\nasync function search(query: string, input: HTMLElement): Promise<void> {\n fireEvent.change(input, {\n target: { value: query },\n })\n\n await waitForPendingQuery(input)\n\n const menuContainer = getSelectMenu(input)\n\n await within(menuContainer).findAllByRole('option')\n}\n\n/**\n * Get options elements currently available in the `Select` menu.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `Select`.\n * @returns {Promise<HTMLElement[]>}\n */\nasync function getOptions(input: HTMLElement): Promise<HTMLElement[]> {\n await expand(input)\n\n const menuContainer = getSelectMenu(input)\n\n const options = within(menuContainer).queryAllByRole('option')\n\n await collapse(input)\n\n return options\n}\n\n/**\n * Get options elements currently selected in the `Select` menu.\n * @param {HTMLElement} input - You can refer to this element by the label you applied to the `Select`.\n * @returns {Promise<HTMLElement[]>}\n */\nasync function getSelectedOptions(input: HTMLElement): Promise<HTMLElement[]> {\n await expand(input)\n\n const menuContainer = getSelectMenu(input)\n let selectedOptions: HTMLElement[] = []\n\n try {\n selectedOptions = await within(menuContainer).findAllByRole('option', {\n selected: true,\n })\n } catch (err) {\n selectedOptions = []\n }\n\n await collapse(input)\n\n return selectedOptions\n}\n\nexport const selectEvent = {\n select,\n unselect,\n clear,\n search,\n expand,\n collapse,\n getOptions,\n getSelectedOptions,\n isMenuExpanded: isSelectMenuExpanded,\n}\n\nexport default selectEvent\n","import type { Interpolation, ThemeProps } from 'styled-components'\nimport { isFunction } from '@loadsmart/utils-function'\n\nimport { Alice } from '../../theming/themes'\nimport type { CustomTheme } from '../../theming'\nimport toArray from 'utils/toolset/toArray'\n\ntype ThemedInterpolation = Interpolation<ThemeProps<CustomTheme>>\n\n/**\n * Use this function to simulate the CSS that would be generated by styled-components\n * @param {Interpolation<ThemeProps<CustomTheme>>} styles - A `css` reference with interpolated styles\n * @returns {string} The final CSS\n */\nexport default function getInterpolatedStyles(styles: ThemedInterpolation): string {\n return toArray(styles)\n .map((interpolation) => {\n while (isFunction(interpolation)) {\n interpolation = interpolation({ theme: Alice })\n }\n\n return interpolation\n })\n .join('')\n}\n","import React, { ReactNode } from 'react'\nimport { render } from '@testing-library/react'\nimport type { RenderResult } from '@testing-library/react'\n\nimport type { DragDropFileContextValue } from '../../components/DragDropFile/types'\nimport { DragDropFileContext } from '../../components/DragDropFile/DragDropFile.context'\n\nconst defaultContextValueMock: DragDropFileContextValue = {\n fileList: [],\n onFilesAdded: jest.fn(),\n onRetryUpload: jest.fn(),\n onRemoveFile: jest.fn(),\n}\n\nconst renderWithDragDropFileProvider = (\n ui: ReactNode,\n customContext?: Partial<DragDropFileContextValue>\n): RenderResult => {\n const contextValue = { ...defaultContextValueMock, ...customContext }\n\n const renderedUi = (children: ReactNode) => (\n <DragDropFileContext.Provider value={contextValue}>{children}</DragDropFileContext.Provider>\n )\n\n return render(renderedUi(ui))\n}\n\nexport default renderWithDragDropFileProvider\n"],"names":["getContainerFromInput","input","parentNode","expand","datePickerContainer","queries","queryByRole","fireEvent","click","waitFor","expect","getByRole","toBeInTheDocument","collapse","getByText","not","pick","day","act","focus","dayElement","getByLabelText","getAttribute","clear","clearButton","getSelectedDates","selectedDays","queryAllByRole","checked","datePickerEvent","getContainer","DatePickerEvent","range","dateRangePickerContainer","rangeStart","rangeEnd","dateRangeStartInput","getByTestId","dateRangeEndInput","dateRangePickerEvent","getDropZoneFromInput","dragOver","dropzone","dragOverEvent","createEvent","dragLeave","dragLeaveEvent","dropFiles","files","fileDropEvent","drop","defineProperty","value","toArray","DragDropFileEvent","getSelectContainer","getSelectMenu","nextSibling","getSelectTriggerHandle","getSelectSearchContainer","isSelectMenuExpanded","selectContainer","children","length","waitForPendingQuery","searchContainer","within","queryByTestId","waitForElementToBeRemoved","timeout","triggerHandle","toBeEnabled","dispatchEvent","MouseEvent","bubbles","select","option","menuContainer","optionElement","findByLabelText","mouseDown","mouseUp","unselect","search","query","change","target","findAllByRole","getOptions","options","getSelectedOptions","selectedOptions","selected","selectEvent","isMenuExpanded","getInterpolatedStyles","styles","map","interpolation","isFunction","theme","Alice","join","defaultContextValueMock","fileList","onFilesAdded","jest","fn","onRetryUpload","onRemoveFile","renderWithDragDropFileProvider","ui","customContext","cont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AAA;AAGtB,eAAM9E,EAASZ,CAAK,GAEb0F;AACT;AAEO,MAAME,KAAc;AAAA,EACzBlB,QAAAA;AAAAA,EACAO,UAAAA;AAAAA,EACA3D,OAAAA;AAAAA,EACA4D,QAAAA;AAAAA,EACAhF,QAAAA;AAAAA,EACAU,UAAAA;AAAAA,EACA2E,YAAAA;AAAAA,EACAE,oBAAAA;AAAAA,EACAI,gBAAgBlC;AAClB;ACvPA,SAAwBmC,GAAsBC,GAAqC;AACjF,SAAO3C,EAAQ2C,CAAM,EAClBC,IAAKC,CAAkBA,MAAA;AACfC,WAAAA,EAAWD,CAAa;AAC7BA,MAAAA,IAAgBA,EAAc;AAAA,QAAEE,OAAOC;AAAAA,MAAAA,CAAO;AAGzCH,WAAAA;AAAAA,EAAAA,CACR,EACAI,KAAK,EAAE;AACZ;ACjBA,MAAMC,IAAoD;AAAA,EACxDC,UAAU,CAAE;AAAA,EACZC,cAAcC,KAAKC,GAAG;AAAA,EACtBC,eAAeF,KAAKC,GAAG;AAAA,EACvBE,cAAcH,KAAKC,GAAG;AACxB,GAEMG,KAAiCA,CACrCC,GACAC,MACiB;AACjB,QAAMC,IAAe;AAAA,IAAE,GAAGV;AAAAA,IAAyB,GAAGS;AAAAA,EAAc;AAM7DE,SAAAA,GAJYC,CAACrD,MAClBsD,gBAAAA,EAAA,cAACC,EAAoB,UAApB,EAA6B,OAAOJ,EAAAA,GAAenD,CAAS,GAGtCiD,CAAE,CAAC;AAC9B;"}
@@ -1,20 +0,0 @@
1
- import { isFunction as a } from "@loadsmart/utils-function";
2
- import { a as i, l as n, m } from "../miranda-compatibility.theme-DQDHkWzC.mjs";
3
- const u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4
- __proto__: null,
5
- Alice: i,
6
- Loadsmart: n,
7
- Miranda: m
8
- }, Symbol.toStringTag, { value: "Module" }));
9
- function r(e, t) {
10
- const o = a(e) ? e(t) : e;
11
- return t.theme[o];
12
- }
13
- function d(e, t) {
14
- return t === void 0 ? (o) => r(e, o) : r(e, t);
15
- }
16
- export {
17
- u as Themes,
18
- d as getToken
19
- };
20
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/theming/index.ts"],"sourcesContent":["import { isFunction } from '@loadsmart/utils-function'\n\nimport type { ThemeProps } from 'styled-components'\nimport type ThemeAlice from './themes/alice.theme'\n\nexport type ThemeToken = keyof typeof ThemeAlice\nexport type ThemeTokenValue = string | number\n\nexport type CustomTheme = Record<ThemeToken, ThemeTokenValue>\nexport type ThemedProps = ThemeProps<CustomTheme>\n\ntype TokenLike<P extends ThemedProps = ThemedProps> = ThemeToken | ((props: P) => ThemeToken)\n\nfunction getTokenFromTheme<P extends ThemedProps>(token: TokenLike<P>, props: P): ThemeTokenValue {\n const tokenName = isFunction(token) ? token(props) : token\n return props.theme[tokenName]\n}\n\n/**\n * Return a design token value for the current theme.\n * @param {string} token - Token whose value should be returned.\n * @param {[ThemedStyledProps]} props - Component props.\n * @returns {ThemeTokenValue} Token value or `undefined` if the token was not found for the current theme.\n */\nexport function getToken<TProps extends ThemedProps>(\n token: TokenLike<TProps>\n): (props: TProps) => ThemeTokenValue\n\nexport function getToken<TProps extends ThemedProps>(\n token: TokenLike<TProps>,\n props: TProps\n): ThemeTokenValue\n\nexport function getToken<TProps extends ThemedProps>(token: any, props?: any): any {\n if (props === undefined) {\n return (props: TProps) => getTokenFromTheme(token, props)\n }\n\n return getTokenFromTheme(token, props)\n}\n\nexport * as Themes from './themes'\n"],"names":["getTokenFromTheme","token","props","tokenName","isFunction","theme","getToken","undefined"],"mappings":";;;;;;;;AAaA,SAASA,EAAyCC,GAAqBC,GAA2B;AAChG,QAAMC,IAAYC,EAAWH,CAAK,IAAIA,EAAMC,CAAK,IAAID;AAC9CC,SAAAA,EAAMG,MAAMF,CAAS;AAC9B;AAiBgBG,SAAAA,EAAqCL,GAAYC,GAAkB;AACjF,SAAIA,MAAUK,SACL,CAACL,MAAkBF,EAAkBC,GAAOC,CAAK,IAGnDF,EAAkBC,GAAOC,CAAK;AACvC;"}
@@ -1,2 +0,0 @@
1
- "use strict";const t=require("@loadsmart/utils-object");function i(r){return t.isNil(r)?[]:Array.isArray(r)?r:[r]}exports.toArray=i;
2
- //# sourceMappingURL=toArray-BW3gx_gH.js.map
@@ -1,8 +0,0 @@
1
- import { isNil as t } from "@loadsmart/utils-object";
2
- function n(r) {
3
- return t(r) ? [] : Array.isArray(r) ? r : [r];
4
- }
5
- export {
6
- n as t
7
- };
8
- //# sourceMappingURL=toArray-DqgeO2ua.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toArray-DqgeO2ua.mjs","sources":["../src/utils/toolset/toArray.ts"],"sourcesContent":["import { isNil } from '@loadsmart/utils-object'\n\n// TODO: add this helper to @loadsmart/utils\nfunction toArray<T>(value: T | T[]): T[] {\n if (isNil(value)) {\n return []\n }\n\n if (Array.isArray(value)) {\n return value\n }\n\n return [value]\n}\n\nexport default toArray\n"],"names":["toArray","value","isNil","Array","isArray"],"mappings":";AAGA,SAASA,EAAWC,GAAqB;AACnCC,SAAAA,EAAMD,CAAK,IACN,CAAE,IAGPE,MAAMC,QAAQH,CAAK,IACdA,IAGF,CAACA,CAAK;AACf;"}
@@ -1,7 +0,0 @@
1
- import { c as a, p as r, w as s } from "../prop-5m3D4883.mjs";
2
- export {
3
- a as conditional,
4
- r as prop,
5
- s as whenProps
6
- };
7
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- import * as utils from '@loadsmart/utils-function'
2
-
3
- declare module '@loadsmart/utils-function' {
4
- function isFunction(value?: unknown): value is CallableFunction
5
- }
@@ -1,5 +0,0 @@
1
- import * as utils from '@loadsmart/utils-object'
2
-
3
- declare module '@loadsmart/utils-object' {
4
- function isObject(value?: unknown): value is object
5
- }
@@ -1,4 +0,0 @@
1
- declare module '*.svg' {
2
- const content: any
3
- export default content
4
- }