@coveord/plasma-mantine 52.3.1 → 52.4.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 (324) hide show
  1. package/.turbo/turbo-build.log +4 -5
  2. package/.turbo/turbo-test.log +79 -29
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/{definitions → cjs}/components/collection/Collection.d.ts.map +1 -1
  5. package/dist/cjs/components/collection/Collection.js +71 -45
  6. package/dist/cjs/components/collection/Collection.js.map +1 -1
  7. package/dist/{definitions → cjs}/components/collection/Collection.styles.d.ts +1 -0
  8. package/dist/{definitions → cjs}/components/collection/Collection.styles.d.ts.map +1 -1
  9. package/dist/cjs/components/collection/Collection.styles.js +8 -2
  10. package/dist/cjs/components/collection/Collection.styles.js.map +1 -1
  11. package/dist/{definitions → cjs}/components/collection/CollectionItem.d.ts +1 -1
  12. package/dist/{definitions → cjs}/components/collection/CollectionItem.d.ts.map +1 -1
  13. package/dist/cjs/components/collection/CollectionItem.js +26 -26
  14. package/dist/cjs/components/collection/CollectionItem.js.map +1 -1
  15. package/dist/cjs/components/header/__tests__/__snapshots__/Header.spec.tsx.snap +1 -1
  16. package/dist/cjs/package.json +1 -0
  17. package/dist/esm/components/blank-slate/BlankSlate.d.ts +12 -0
  18. package/dist/esm/components/blank-slate/BlankSlate.d.ts.map +1 -0
  19. package/dist/esm/components/blank-slate/index.d.ts +2 -0
  20. package/dist/esm/components/blank-slate/index.d.ts.map +1 -0
  21. package/dist/esm/components/button/Button.d.ts +16 -0
  22. package/dist/esm/components/button/Button.d.ts.map +1 -0
  23. package/dist/esm/components/button/ButtonWithDisabledTooltip.d.ts +29 -0
  24. package/dist/esm/components/button/ButtonWithDisabledTooltip.d.ts.map +1 -0
  25. package/dist/esm/components/button/index.d.ts +3 -0
  26. package/dist/esm/components/button/index.d.ts.map +1 -0
  27. package/dist/esm/components/code-editor/CodeEditor.d.ts +53 -0
  28. package/dist/esm/components/code-editor/CodeEditor.d.ts.map +1 -0
  29. package/dist/esm/components/code-editor/index.d.ts +2 -0
  30. package/dist/esm/components/code-editor/index.d.ts.map +1 -0
  31. package/dist/esm/components/code-editor/languages/xml.d.ts +5 -0
  32. package/dist/esm/components/code-editor/languages/xml.d.ts.map +1 -0
  33. package/dist/esm/components/collection/Collection.d.ts +108 -0
  34. package/dist/esm/components/collection/Collection.d.ts.map +1 -0
  35. package/dist/esm/components/collection/Collection.js +63 -37
  36. package/dist/esm/components/collection/Collection.js.map +1 -1
  37. package/dist/esm/components/collection/Collection.styles.d.ts +14 -0
  38. package/dist/esm/components/collection/Collection.styles.d.ts.map +1 -0
  39. package/dist/esm/components/collection/Collection.styles.js +8 -2
  40. package/dist/esm/components/collection/Collection.styles.js.map +1 -1
  41. package/dist/esm/components/collection/CollectionItem.d.ts +15 -0
  42. package/dist/esm/components/collection/CollectionItem.d.ts.map +1 -0
  43. package/dist/esm/components/collection/CollectionItem.js +27 -27
  44. package/dist/esm/components/collection/CollectionItem.js.map +1 -1
  45. package/dist/esm/components/collection/index.d.ts +2 -0
  46. package/dist/esm/components/collection/index.d.ts.map +1 -0
  47. package/dist/esm/components/copyToClipboard/CopyToClipboard.d.ts +19 -0
  48. package/dist/esm/components/copyToClipboard/CopyToClipboard.d.ts.map +1 -0
  49. package/dist/esm/components/copyToClipboard/index.d.ts +2 -0
  50. package/dist/esm/components/copyToClipboard/index.d.ts.map +1 -0
  51. package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.d.ts +38 -0
  52. package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.d.ts.map +1 -0
  53. package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts +31 -0
  54. package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts.map +1 -0
  55. package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.d.ts +16 -0
  56. package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.d.ts.map +1 -0
  57. package/dist/esm/components/date-range-picker/EditableDateRangePicker.d.ts +19 -0
  58. package/dist/esm/components/date-range-picker/EditableDateRangePicker.d.ts.map +1 -0
  59. package/dist/esm/components/date-range-picker/index.d.ts +4 -0
  60. package/dist/esm/components/date-range-picker/index.d.ts.map +1 -0
  61. package/dist/esm/components/header/Header.d.ts +49 -0
  62. package/dist/esm/components/header/Header.d.ts.map +1 -0
  63. package/dist/esm/components/header/__tests__/__snapshots__/Header.spec.tsx.snap +1 -1
  64. package/dist/esm/components/header/index.d.ts +2 -0
  65. package/dist/esm/components/header/index.d.ts.map +1 -0
  66. package/dist/esm/components/index.d.ts +14 -0
  67. package/dist/esm/components/index.d.ts.map +1 -0
  68. package/dist/esm/components/inline-confirm/InlineConfirm.d.ts +12 -0
  69. package/dist/esm/components/inline-confirm/InlineConfirm.d.ts.map +1 -0
  70. package/dist/esm/components/inline-confirm/InlineConfirmButton.d.ts +8 -0
  71. package/dist/esm/components/inline-confirm/InlineConfirmButton.d.ts.map +1 -0
  72. package/dist/esm/components/inline-confirm/InlineConfirmContext.d.ts +9 -0
  73. package/dist/esm/components/inline-confirm/InlineConfirmContext.d.ts.map +1 -0
  74. package/dist/esm/components/inline-confirm/InlineConfirmMenuItem.d.ts +8 -0
  75. package/dist/esm/components/inline-confirm/InlineConfirmMenuItem.d.ts.map +1 -0
  76. package/dist/esm/components/inline-confirm/InlineConfirmPrompt.d.ts +11 -0
  77. package/dist/esm/components/inline-confirm/InlineConfirmPrompt.d.ts.map +1 -0
  78. package/dist/esm/components/inline-confirm/index.d.ts +4 -0
  79. package/dist/esm/components/inline-confirm/index.d.ts.map +1 -0
  80. package/dist/esm/components/inline-confirm/useInlineConfirm.d.ts +6 -0
  81. package/dist/esm/components/inline-confirm/useInlineConfirm.d.ts.map +1 -0
  82. package/dist/esm/components/menu/Menu.d.ts +16 -0
  83. package/dist/esm/components/menu/Menu.d.ts.map +1 -0
  84. package/dist/esm/components/menu/index.d.ts +2 -0
  85. package/dist/esm/components/menu/index.d.ts.map +1 -0
  86. package/dist/esm/components/modal-wizard/ModalWizard.d.ts +78 -0
  87. package/dist/esm/components/modal-wizard/ModalWizard.d.ts.map +1 -0
  88. package/dist/esm/components/modal-wizard/ModalWizardStep.d.ts +43 -0
  89. package/dist/esm/components/modal-wizard/ModalWizardStep.d.ts.map +1 -0
  90. package/dist/esm/components/modal-wizard/index.d.ts +3 -0
  91. package/dist/esm/components/modal-wizard/index.d.ts.map +1 -0
  92. package/dist/esm/components/prompt/Prompt.d.ts +14 -0
  93. package/dist/esm/components/prompt/Prompt.d.ts.map +1 -0
  94. package/dist/esm/components/prompt/PromptFooter.d.ts +6 -0
  95. package/dist/esm/components/prompt/PromptFooter.d.ts.map +1 -0
  96. package/dist/esm/components/prompt/index.d.ts +2 -0
  97. package/dist/esm/components/prompt/index.d.ts.map +1 -0
  98. package/dist/esm/components/sticky-footer/StickyFooter.d.ts +10 -0
  99. package/dist/esm/components/sticky-footer/StickyFooter.d.ts.map +1 -0
  100. package/dist/esm/components/sticky-footer/index.d.ts +2 -0
  101. package/dist/esm/components/sticky-footer/index.d.ts.map +1 -0
  102. package/dist/esm/components/table/Table.d.ts +3 -0
  103. package/dist/esm/components/table/Table.d.ts.map +1 -0
  104. package/dist/esm/components/table/Table.styles.d.ts +19 -0
  105. package/dist/esm/components/table/Table.styles.d.ts.map +1 -0
  106. package/dist/esm/components/table/Table.types.d.ts +185 -0
  107. package/dist/esm/components/table/Table.types.d.ts.map +1 -0
  108. package/dist/esm/components/table/TableActions.d.ts +26 -0
  109. package/dist/esm/components/table/TableActions.d.ts.map +1 -0
  110. package/dist/esm/components/table/TableCollapsibleColumn.d.ts +10 -0
  111. package/dist/esm/components/table/TableCollapsibleColumn.d.ts.map +1 -0
  112. package/dist/esm/components/table/TableConsumer.d.ts +5 -0
  113. package/dist/esm/components/table/TableConsumer.d.ts.map +1 -0
  114. package/dist/esm/components/table/TableContext.d.ts +5 -0
  115. package/dist/esm/components/table/TableContext.d.ts.map +1 -0
  116. package/dist/esm/components/table/TableDateRangePicker.d.ts +19 -0
  117. package/dist/esm/components/table/TableDateRangePicker.d.ts.map +1 -0
  118. package/dist/esm/components/table/TableFilter.d.ts +22 -0
  119. package/dist/esm/components/table/TableFilter.d.ts.map +1 -0
  120. package/dist/esm/components/table/TableFooter.d.ts +8 -0
  121. package/dist/esm/components/table/TableFooter.d.ts.map +1 -0
  122. package/dist/esm/components/table/TableHeader.d.ts +17 -0
  123. package/dist/esm/components/table/TableHeader.d.ts.map +1 -0
  124. package/dist/esm/components/table/TablePagination.d.ts +10 -0
  125. package/dist/esm/components/table/TablePagination.d.ts.map +1 -0
  126. package/dist/esm/components/table/TablePerPage.d.ts +20 -0
  127. package/dist/esm/components/table/TablePerPage.d.ts.map +1 -0
  128. package/dist/esm/components/table/TablePredicate.d.ts +21 -0
  129. package/dist/esm/components/table/TablePredicate.d.ts.map +1 -0
  130. package/dist/esm/components/table/TableSelectableColumn.d.ts +6 -0
  131. package/dist/esm/components/table/TableSelectableColumn.d.ts.map +1 -0
  132. package/dist/esm/components/table/Th.d.ts +8 -0
  133. package/dist/esm/components/table/Th.d.ts.map +1 -0
  134. package/dist/esm/components/table/index.d.ts +4 -0
  135. package/dist/esm/components/table/index.d.ts.map +1 -0
  136. package/dist/esm/components/table/useRowSelection.d.ts +10 -0
  137. package/dist/esm/components/table/useRowSelection.d.ts.map +1 -0
  138. package/dist/esm/form/FormProvider.d.ts +8 -0
  139. package/dist/esm/form/FormProvider.d.ts.map +1 -0
  140. package/dist/esm/form/index.d.ts +3 -0
  141. package/dist/esm/form/index.d.ts.map +1 -0
  142. package/dist/esm/form/useForm.d.ts +3 -0
  143. package/dist/esm/form/useForm.d.ts.map +1 -0
  144. package/dist/esm/hooks/index.d.ts +3 -0
  145. package/dist/esm/hooks/index.d.ts.map +1 -0
  146. package/dist/esm/hooks/useControlledList.d.ts +25 -0
  147. package/dist/esm/hooks/useControlledList.d.ts.map +1 -0
  148. package/dist/esm/hooks/useParentHeight.d.ts +5 -0
  149. package/dist/esm/hooks/useParentHeight.d.ts.map +1 -0
  150. package/dist/esm/index.d.ts +21 -0
  151. package/dist/esm/index.d.ts.map +1 -0
  152. package/dist/esm/package.json +1 -0
  153. package/dist/esm/theme/PlasmaColors.d.ts +19 -0
  154. package/dist/esm/theme/PlasmaColors.d.ts.map +1 -0
  155. package/dist/esm/theme/Plasmantine.d.ts +3 -0
  156. package/dist/esm/theme/Plasmantine.d.ts.map +1 -0
  157. package/dist/esm/theme/Theme.d.ts +3 -0
  158. package/dist/esm/theme/Theme.d.ts.map +1 -0
  159. package/dist/esm/theme/index.d.ts +2 -0
  160. package/dist/esm/theme/index.d.ts.map +1 -0
  161. package/dist/esm/utils/createPolymorphicComponent.d.ts +3 -0
  162. package/dist/esm/utils/createPolymorphicComponent.d.ts.map +1 -0
  163. package/dist/esm/utils/index.d.ts +3 -0
  164. package/dist/esm/utils/index.d.ts.map +1 -0
  165. package/dist/esm/utils/overrideComponent.d.ts +10 -0
  166. package/dist/esm/utils/overrideComponent.d.ts.map +1 -0
  167. package/package.json +16 -9
  168. package/src/__tests__/VitestSetup.ts +1 -0
  169. package/src/components/collection/Collection.styles.ts +8 -2
  170. package/src/components/collection/Collection.tsx +44 -28
  171. package/src/components/collection/CollectionItem.tsx +26 -19
  172. package/src/components/header/__tests__/__snapshots__/Header.spec.tsx.snap +1 -1
  173. package/tsconfig.build.json +1 -1
  174. package/tsconfig.json +0 -1
  175. package/vitest.config.ts +3 -0
  176. package/dist/cjs/__tests__/Utils.js +0 -38
  177. package/dist/cjs/__tests__/Utils.js.map +0 -1
  178. package/dist/cjs/__tests__/VitestSetup.js +0 -35
  179. package/dist/cjs/__tests__/VitestSetup.js.map +0 -1
  180. package/dist/definitions/__tests__/Utils.d.ts +0 -8
  181. package/dist/definitions/__tests__/Utils.d.ts.map +0 -1
  182. package/dist/definitions/__tests__/VitestSetup.d.ts +0 -8
  183. package/dist/definitions/__tests__/VitestSetup.d.ts.map +0 -1
  184. package/dist/esm/__tests__/Utils.js +0 -21
  185. package/dist/esm/__tests__/Utils.js.map +0 -1
  186. package/dist/esm/__tests__/VitestSetup.js +0 -30
  187. package/dist/esm/__tests__/VitestSetup.js.map +0 -1
  188. /package/dist/{definitions → cjs}/components/blank-slate/BlankSlate.d.ts +0 -0
  189. /package/dist/{definitions → cjs}/components/blank-slate/BlankSlate.d.ts.map +0 -0
  190. /package/dist/{definitions → cjs}/components/blank-slate/index.d.ts +0 -0
  191. /package/dist/{definitions → cjs}/components/blank-slate/index.d.ts.map +0 -0
  192. /package/dist/{definitions → cjs}/components/button/Button.d.ts +0 -0
  193. /package/dist/{definitions → cjs}/components/button/Button.d.ts.map +0 -0
  194. /package/dist/{definitions → cjs}/components/button/ButtonWithDisabledTooltip.d.ts +0 -0
  195. /package/dist/{definitions → cjs}/components/button/ButtonWithDisabledTooltip.d.ts.map +0 -0
  196. /package/dist/{definitions → cjs}/components/button/index.d.ts +0 -0
  197. /package/dist/{definitions → cjs}/components/button/index.d.ts.map +0 -0
  198. /package/dist/{definitions → cjs}/components/code-editor/CodeEditor.d.ts +0 -0
  199. /package/dist/{definitions → cjs}/components/code-editor/CodeEditor.d.ts.map +0 -0
  200. /package/dist/{definitions → cjs}/components/code-editor/index.d.ts +0 -0
  201. /package/dist/{definitions → cjs}/components/code-editor/index.d.ts.map +0 -0
  202. /package/dist/{definitions → cjs}/components/code-editor/languages/xml.d.ts +0 -0
  203. /package/dist/{definitions → cjs}/components/code-editor/languages/xml.d.ts.map +0 -0
  204. /package/dist/{definitions → cjs}/components/collection/Collection.d.ts +0 -0
  205. /package/dist/{definitions → cjs}/components/collection/index.d.ts +0 -0
  206. /package/dist/{definitions → cjs}/components/collection/index.d.ts.map +0 -0
  207. /package/dist/{definitions → cjs}/components/copyToClipboard/CopyToClipboard.d.ts +0 -0
  208. /package/dist/{definitions → cjs}/components/copyToClipboard/CopyToClipboard.d.ts.map +0 -0
  209. /package/dist/{definitions → cjs}/components/copyToClipboard/index.d.ts +0 -0
  210. /package/dist/{definitions → cjs}/components/copyToClipboard/index.d.ts.map +0 -0
  211. /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerInlineCalendar.d.ts +0 -0
  212. /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerInlineCalendar.d.ts.map +0 -0
  213. /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts +0 -0
  214. /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerPopoverCalendar.d.ts.map +0 -0
  215. /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerPresetSelect.d.ts +0 -0
  216. /package/dist/{definitions → cjs}/components/date-range-picker/DateRangePickerPresetSelect.d.ts.map +0 -0
  217. /package/dist/{definitions → cjs}/components/date-range-picker/EditableDateRangePicker.d.ts +0 -0
  218. /package/dist/{definitions → cjs}/components/date-range-picker/EditableDateRangePicker.d.ts.map +0 -0
  219. /package/dist/{definitions → cjs}/components/date-range-picker/index.d.ts +0 -0
  220. /package/dist/{definitions → cjs}/components/date-range-picker/index.d.ts.map +0 -0
  221. /package/dist/{definitions → cjs}/components/header/Header.d.ts +0 -0
  222. /package/dist/{definitions → cjs}/components/header/Header.d.ts.map +0 -0
  223. /package/dist/{definitions → cjs}/components/header/index.d.ts +0 -0
  224. /package/dist/{definitions → cjs}/components/header/index.d.ts.map +0 -0
  225. /package/dist/{definitions → cjs}/components/index.d.ts +0 -0
  226. /package/dist/{definitions → cjs}/components/index.d.ts.map +0 -0
  227. /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirm.d.ts +0 -0
  228. /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirm.d.ts.map +0 -0
  229. /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmButton.d.ts +0 -0
  230. /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmButton.d.ts.map +0 -0
  231. /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmContext.d.ts +0 -0
  232. /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmContext.d.ts.map +0 -0
  233. /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmMenuItem.d.ts +0 -0
  234. /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmMenuItem.d.ts.map +0 -0
  235. /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmPrompt.d.ts +0 -0
  236. /package/dist/{definitions → cjs}/components/inline-confirm/InlineConfirmPrompt.d.ts.map +0 -0
  237. /package/dist/{definitions → cjs}/components/inline-confirm/index.d.ts +0 -0
  238. /package/dist/{definitions → cjs}/components/inline-confirm/index.d.ts.map +0 -0
  239. /package/dist/{definitions → cjs}/components/inline-confirm/useInlineConfirm.d.ts +0 -0
  240. /package/dist/{definitions → cjs}/components/inline-confirm/useInlineConfirm.d.ts.map +0 -0
  241. /package/dist/{definitions → cjs}/components/menu/Menu.d.ts +0 -0
  242. /package/dist/{definitions → cjs}/components/menu/Menu.d.ts.map +0 -0
  243. /package/dist/{definitions → cjs}/components/menu/index.d.ts +0 -0
  244. /package/dist/{definitions → cjs}/components/menu/index.d.ts.map +0 -0
  245. /package/dist/{definitions → cjs}/components/modal-wizard/ModalWizard.d.ts +0 -0
  246. /package/dist/{definitions → cjs}/components/modal-wizard/ModalWizard.d.ts.map +0 -0
  247. /package/dist/{definitions → cjs}/components/modal-wizard/ModalWizardStep.d.ts +0 -0
  248. /package/dist/{definitions → cjs}/components/modal-wizard/ModalWizardStep.d.ts.map +0 -0
  249. /package/dist/{definitions → cjs}/components/modal-wizard/index.d.ts +0 -0
  250. /package/dist/{definitions → cjs}/components/modal-wizard/index.d.ts.map +0 -0
  251. /package/dist/{definitions → cjs}/components/prompt/Prompt.d.ts +0 -0
  252. /package/dist/{definitions → cjs}/components/prompt/Prompt.d.ts.map +0 -0
  253. /package/dist/{definitions → cjs}/components/prompt/PromptFooter.d.ts +0 -0
  254. /package/dist/{definitions → cjs}/components/prompt/PromptFooter.d.ts.map +0 -0
  255. /package/dist/{definitions → cjs}/components/prompt/index.d.ts +0 -0
  256. /package/dist/{definitions → cjs}/components/prompt/index.d.ts.map +0 -0
  257. /package/dist/{definitions → cjs}/components/sticky-footer/StickyFooter.d.ts +0 -0
  258. /package/dist/{definitions → cjs}/components/sticky-footer/StickyFooter.d.ts.map +0 -0
  259. /package/dist/{definitions → cjs}/components/sticky-footer/index.d.ts +0 -0
  260. /package/dist/{definitions → cjs}/components/sticky-footer/index.d.ts.map +0 -0
  261. /package/dist/{definitions → cjs}/components/table/Table.d.ts +0 -0
  262. /package/dist/{definitions → cjs}/components/table/Table.d.ts.map +0 -0
  263. /package/dist/{definitions → cjs}/components/table/Table.styles.d.ts +0 -0
  264. /package/dist/{definitions → cjs}/components/table/Table.styles.d.ts.map +0 -0
  265. /package/dist/{definitions → cjs}/components/table/Table.types.d.ts +0 -0
  266. /package/dist/{definitions → cjs}/components/table/Table.types.d.ts.map +0 -0
  267. /package/dist/{definitions → cjs}/components/table/TableActions.d.ts +0 -0
  268. /package/dist/{definitions → cjs}/components/table/TableActions.d.ts.map +0 -0
  269. /package/dist/{definitions → cjs}/components/table/TableCollapsibleColumn.d.ts +0 -0
  270. /package/dist/{definitions → cjs}/components/table/TableCollapsibleColumn.d.ts.map +0 -0
  271. /package/dist/{definitions → cjs}/components/table/TableConsumer.d.ts +0 -0
  272. /package/dist/{definitions → cjs}/components/table/TableConsumer.d.ts.map +0 -0
  273. /package/dist/{definitions → cjs}/components/table/TableContext.d.ts +0 -0
  274. /package/dist/{definitions → cjs}/components/table/TableContext.d.ts.map +0 -0
  275. /package/dist/{definitions → cjs}/components/table/TableDateRangePicker.d.ts +0 -0
  276. /package/dist/{definitions → cjs}/components/table/TableDateRangePicker.d.ts.map +0 -0
  277. /package/dist/{definitions → cjs}/components/table/TableFilter.d.ts +0 -0
  278. /package/dist/{definitions → cjs}/components/table/TableFilter.d.ts.map +0 -0
  279. /package/dist/{definitions → cjs}/components/table/TableFooter.d.ts +0 -0
  280. /package/dist/{definitions → cjs}/components/table/TableFooter.d.ts.map +0 -0
  281. /package/dist/{definitions → cjs}/components/table/TableHeader.d.ts +0 -0
  282. /package/dist/{definitions → cjs}/components/table/TableHeader.d.ts.map +0 -0
  283. /package/dist/{definitions → cjs}/components/table/TablePagination.d.ts +0 -0
  284. /package/dist/{definitions → cjs}/components/table/TablePagination.d.ts.map +0 -0
  285. /package/dist/{definitions → cjs}/components/table/TablePerPage.d.ts +0 -0
  286. /package/dist/{definitions → cjs}/components/table/TablePerPage.d.ts.map +0 -0
  287. /package/dist/{definitions → cjs}/components/table/TablePredicate.d.ts +0 -0
  288. /package/dist/{definitions → cjs}/components/table/TablePredicate.d.ts.map +0 -0
  289. /package/dist/{definitions → cjs}/components/table/TableSelectableColumn.d.ts +0 -0
  290. /package/dist/{definitions → cjs}/components/table/TableSelectableColumn.d.ts.map +0 -0
  291. /package/dist/{definitions → cjs}/components/table/Th.d.ts +0 -0
  292. /package/dist/{definitions → cjs}/components/table/Th.d.ts.map +0 -0
  293. /package/dist/{definitions → cjs}/components/table/index.d.ts +0 -0
  294. /package/dist/{definitions → cjs}/components/table/index.d.ts.map +0 -0
  295. /package/dist/{definitions → cjs}/components/table/useRowSelection.d.ts +0 -0
  296. /package/dist/{definitions → cjs}/components/table/useRowSelection.d.ts.map +0 -0
  297. /package/dist/{definitions → cjs}/form/FormProvider.d.ts +0 -0
  298. /package/dist/{definitions → cjs}/form/FormProvider.d.ts.map +0 -0
  299. /package/dist/{definitions → cjs}/form/index.d.ts +0 -0
  300. /package/dist/{definitions → cjs}/form/index.d.ts.map +0 -0
  301. /package/dist/{definitions → cjs}/form/useForm.d.ts +0 -0
  302. /package/dist/{definitions → cjs}/form/useForm.d.ts.map +0 -0
  303. /package/dist/{definitions → cjs}/hooks/index.d.ts +0 -0
  304. /package/dist/{definitions → cjs}/hooks/index.d.ts.map +0 -0
  305. /package/dist/{definitions → cjs}/hooks/useControlledList.d.ts +0 -0
  306. /package/dist/{definitions → cjs}/hooks/useControlledList.d.ts.map +0 -0
  307. /package/dist/{definitions → cjs}/hooks/useParentHeight.d.ts +0 -0
  308. /package/dist/{definitions → cjs}/hooks/useParentHeight.d.ts.map +0 -0
  309. /package/dist/{definitions → cjs}/index.d.ts +0 -0
  310. /package/dist/{definitions → cjs}/index.d.ts.map +0 -0
  311. /package/dist/{definitions → cjs}/theme/PlasmaColors.d.ts +0 -0
  312. /package/dist/{definitions → cjs}/theme/PlasmaColors.d.ts.map +0 -0
  313. /package/dist/{definitions → cjs}/theme/Plasmantine.d.ts +0 -0
  314. /package/dist/{definitions → cjs}/theme/Plasmantine.d.ts.map +0 -0
  315. /package/dist/{definitions → cjs}/theme/Theme.d.ts +0 -0
  316. /package/dist/{definitions → cjs}/theme/Theme.d.ts.map +0 -0
  317. /package/dist/{definitions → cjs}/theme/index.d.ts +0 -0
  318. /package/dist/{definitions → cjs}/theme/index.d.ts.map +0 -0
  319. /package/dist/{definitions → cjs}/utils/createPolymorphicComponent.d.ts +0 -0
  320. /package/dist/{definitions → cjs}/utils/createPolymorphicComponent.d.ts.map +0 -0
  321. /package/dist/{definitions → cjs}/utils/index.d.ts +0 -0
  322. /package/dist/{definitions → cjs}/utils/index.d.ts.map +0 -0
  323. /package/dist/{definitions → cjs}/utils/overrideComponent.d.ts +0 -0
  324. /package/dist/{definitions → cjs}/utils/overrideComponent.d.ts.map +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xml.d.ts","sourceRoot":"","sources":["../../../../../src/components/code-editor/languages/xml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AA0C5C,eAAO,MAAM,GAAG;uBAXU,MAAM,KAAG,IAAI;CAWV,CAAC"}
@@ -0,0 +1,108 @@
1
+ import { DefaultProps, InputWrapperBaseProps, MantineNumberSize, Selectors } from '@mantine/core';
2
+ import { ReorderPayload } from '@mantine/form/lib/types';
3
+ import { ReactNode } from 'react';
4
+ import useStyles from './Collection.styles';
5
+ interface CollectionProps<T> extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>, DefaultProps<Selectors<typeof useStyles>> {
6
+ /**
7
+ * The default value each new item should have
8
+ */
9
+ newItem: T;
10
+ /**
11
+ * A render function called for each item passed in the `value` prop.
12
+ *
13
+ * @param item The current item's value
14
+ * @param index The current item's index
15
+ */
16
+ children: (item: T, index: number) => ReactNode;
17
+ /**
18
+ * The list of items to display inside the collection
19
+ *
20
+ * @default []
21
+ */
22
+ value?: T[];
23
+ /**
24
+ * Defines how each item is uniquely identified. It is highly recommended that you specify this prop to an ID that makes sense.
25
+ *
26
+ * This method is required when using this component with ReactHookForm.
27
+ *
28
+ * @see {@link https://react-hook-form.com/api/usefieldarray/} for using a collection with ReactHookForm.
29
+ *
30
+ * @param originalItem The original item
31
+ */
32
+ getItemId?: (originalItem: T) => string;
33
+ /**
34
+ * Unused, has no effect
35
+ */
36
+ onFocus?: () => void;
37
+ /**
38
+ * Function called whenever the value needs to be updated
39
+ *
40
+ * @param value The whole list of items after the change
41
+ */
42
+ onChange?: (value: T[]) => void;
43
+ /**
44
+ * Function called after an item is removed from the collection using the remove button
45
+ *
46
+ * @param itemIndex The index of the item that was removed
47
+ */
48
+ onRemoveItem?: (itemIndex: number) => void;
49
+ /**
50
+ * Function that gets called whenever a collection item needs to be reordered
51
+ *
52
+ * @param payload The origin and destination index of the item to reorder
53
+ */
54
+ onReorderItem?: (payload: ReorderPayload) => void;
55
+ /**
56
+ * Function that gets called when a new item needs to be added to the collection
57
+ *
58
+ * @param value The the value of the item to insert
59
+ * @param index The index of the new item to insert
60
+ */
61
+ onInsertItem?: (value: T, index: number) => void;
62
+ /**
63
+ * Whether the collection should have drag and drop behavior enabled
64
+ *
65
+ * @default false
66
+ */
67
+ draggable?: boolean;
68
+ /**
69
+ * Whether the collection is disabled, or in other words in read only mode
70
+ *
71
+ * @default false
72
+ */
73
+ disabled?: boolean;
74
+ /**
75
+ * Function that determines if the add item button should be enabled given the current items of the collection.
76
+ * The button is always enabled if this props remains undefined
77
+ *
78
+ * @param values The current items of the collection
79
+ */
80
+ allowAdd?: (values: T[]) => boolean;
81
+ /**
82
+ * The label of the add item button
83
+ *
84
+ * @default "Add item"
85
+ */
86
+ addLabel?: string;
87
+ /**
88
+ * The tooltip text displayed when hovering over the disabled add item button
89
+ *
90
+ * @default 'There is already an empty item'
91
+ */
92
+ addDisabledTooltip?: string;
93
+ /**
94
+ * The spacing between the colleciton items
95
+ *
96
+ * @default 'xs'
97
+ */
98
+ spacing?: MantineNumberSize;
99
+ /**
100
+ * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item
101
+ *
102
+ * @default false
103
+ */
104
+ required?: boolean;
105
+ }
106
+ export declare const Collection: <T>(props: CollectionProps<T>) => JSX.Element;
107
+ export {};
108
+ //# sourceMappingURL=Collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Collection.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEH,YAAY,EAGZ,qBAAqB,EACrB,iBAAiB,EACjB,SAAS,EAIZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhC,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAG5C,UAAU,eAAe,CAAC,CAAC,CACvB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,EACvE,YAAY,CAAC,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;IAC7C;;OAEG;IACH,OAAO,EAAE,CAAC,CAAC;IACX;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAChD;;;;OAIG;IACH,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IACZ;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,KAAK,MAAM,CAAC;IACxC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAYD,eAAO,MAAM,UAAU,+CAsItB,CAAC"}
@@ -3,10 +3,11 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
4
4
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
5
5
  import { AddSize16Px } from "@coveord/plasma-react-icons";
6
+ import { DndContext, KeyboardSensor, PointerSensor, useSensor, useSensors } from "@dnd-kit/core";
7
+ import { restrictToParentElement, restrictToVerticalAxis } from "@dnd-kit/modifiers";
8
+ import { SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy } from "@dnd-kit/sortable";
6
9
  import { Box, Group, Input, Stack, Tooltip, useComponentDefaultProps } from "@mantine/core";
7
10
  import { useDidUpdate } from "@mantine/hooks";
8
- import { useId } from "react";
9
- import { DragDropContext, Droppable } from "react-beautiful-dnd";
10
11
  import { Button } from "../button";
11
12
  import useStyles from "./Collection.styles";
12
13
  import { CollectionItem } from "./CollectionItem";
@@ -16,7 +17,11 @@ var defaultProps = {
16
17
  addDisabledTooltip: "There is already an empty item",
17
18
  disabled: false,
18
19
  spacing: "xs",
19
- required: false
20
+ required: false,
21
+ getItemId: function(param) {
22
+ var id = param.id;
23
+ return id;
24
+ }
20
25
  };
21
26
  export var Collection = function(props) {
22
27
  var _useComponentDefaultProps = useComponentDefaultProps("Collection", defaultProps, props), value = _useComponentDefaultProps.value, onChange = _useComponentDefaultProps.onChange, onRemoveItem = _useComponentDefaultProps.onRemoveItem, onReorderItem = _useComponentDefaultProps.onReorderItem, onInsertItem = _useComponentDefaultProps.onInsertItem, disabled = _useComponentDefaultProps.disabled, draggable = _useComponentDefaultProps.draggable, children = _useComponentDefaultProps.children, spacing = _useComponentDefaultProps.spacing, required = _useComponentDefaultProps.required, newItem = _useComponentDefaultProps.newItem, addLabel = _useComponentDefaultProps.addLabel, addDisabledTooltip = _useComponentDefaultProps.addDisabledTooltip, allowAdd = _useComponentDefaultProps.allowAdd, label = _useComponentDefaultProps.label, labelProps = _useComponentDefaultProps.labelProps, withAsterisk = _useComponentDefaultProps.withAsterisk, description = _useComponentDefaultProps.description, descriptionProps = _useComponentDefaultProps.descriptionProps, error = _useComponentDefaultProps.error, errorProps = _useComponentDefaultProps.errorProps, getItemId = _useComponentDefaultProps.getItemId, // Style props
@@ -54,7 +59,9 @@ export var Collection = function(props) {
54
59
  styles: styles,
55
60
  unstyled: unstyled
56
61
  }), classes = _useStyles.classes, cx = _useStyles.cx;
57
- var collectionID = useId();
62
+ var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
63
+ coordinateGetter: sortableKeyboardCoordinates
64
+ }));
58
65
  var hasOnlyOneItem = value.length === 1;
59
66
  /**
60
67
  * Enforcing onChange when the value is modified will make sure the errors are carried through.
@@ -82,18 +89,24 @@ export var Collection = function(props) {
82
89
  ]
83
90
  }) : null;
84
91
  var _getItemId;
85
- var items = value.map(function(item, index) {
92
+ var standardizedItems = value.map(function(item, index) {
93
+ return {
94
+ id: (_getItemId = getItemId === null || getItemId === void 0 ? void 0 : getItemId(item)) !== null && _getItemId !== void 0 ? _getItemId : String(index),
95
+ data: item
96
+ };
97
+ });
98
+ var items = standardizedItems.map(function(item, index) {
86
99
  /*#__PURE__*/ return _jsx(CollectionItem, {
100
+ id: item.id,
87
101
  disabled: disabled,
88
102
  draggable: draggable,
89
- index: index,
90
103
  onRemove: function() {
91
104
  return onRemoveItem === null || onRemoveItem === void 0 ? void 0 : onRemoveItem(index);
92
105
  },
93
106
  styles: styles,
94
107
  removable: !(required && hasOnlyOneItem),
95
- children: children(item, index)
96
- }, (_getItemId = getItemId === null || getItemId === void 0 ? void 0 : getItemId(item)) !== null && _getItemId !== void 0 ? _getItemId : index);
108
+ children: children(item.data, index)
109
+ }, item.id);
97
110
  });
98
111
  var _allowAdd;
99
112
  var addAllowed = (_allowAdd = allowAdd === null || allowAdd === void 0 ? void 0 : allowAdd(value)) !== null && _allowAdd !== void 0 ? _allowAdd : true;
@@ -117,36 +130,49 @@ export var Collection = function(props) {
117
130
  })
118
131
  })
119
132
  });
120
- return /*#__PURE__*/ _jsx(DragDropContext, {
121
- onDragEnd: function(param) {
122
- var destination = param.destination, source = param.source;
123
- return onReorderItem({
124
- from: source.index,
125
- to: (destination === null || destination === void 0 ? void 0 : destination.index) || 0
126
- });
127
- },
128
- children: /*#__PURE__*/ _jsx(Droppable, {
129
- direction: "vertical",
130
- droppableId: collectionID,
131
- children: function(provided) {
132
- return /*#__PURE__*/ _jsxs(Box, _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, provided.droppableProps), {
133
- ref: provided.innerRef,
134
- className: cx(classes.root, className)
135
- }), others), {
136
- children: [
137
- _header,
138
- /*#__PURE__*/ _jsxs(Stack, {
139
- spacing: spacing,
140
- children: [
141
- items,
142
- provided.placeholder,
143
- _addButton,
144
- _error
145
- ]
146
- })
147
- ]
148
- }));
133
+ var getIndex = function(id) {
134
+ return standardizedItems.findIndex(function(item) {
135
+ return item.id === id;
136
+ });
137
+ };
138
+ var handleDragEnd = function(param) {
139
+ var over = param.over, active = param.active;
140
+ if (over) {
141
+ var activeIndex = getIndex(String(active.id));
142
+ var overIndex = getIndex(String(over.id));
143
+ if (activeIndex !== overIndex) {
144
+ onReorderItem === null || onReorderItem === void 0 ? void 0 : onReorderItem({
145
+ from: activeIndex,
146
+ to: overIndex
147
+ });
149
148
  }
149
+ }
150
+ };
151
+ return /*#__PURE__*/ _jsx(DndContext, {
152
+ onDragEnd: handleDragEnd,
153
+ sensors: sensors,
154
+ modifiers: [
155
+ restrictToVerticalAxis,
156
+ restrictToParentElement
157
+ ],
158
+ children: /*#__PURE__*/ _jsx(SortableContext, {
159
+ items: standardizedItems,
160
+ strategy: verticalListSortingStrategy,
161
+ children: /*#__PURE__*/ _jsxs(Box, _object_spread_props(_object_spread({
162
+ className: cx(classes.root, className)
163
+ }, others), {
164
+ children: [
165
+ _header,
166
+ /*#__PURE__*/ _jsxs(Stack, {
167
+ spacing: spacing,
168
+ children: [
169
+ items,
170
+ _addButton,
171
+ _error
172
+ ]
173
+ })
174
+ ]
175
+ }))
150
176
  })
151
177
  });
152
178
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/collection/Collection.tsx"],"sourcesContent":["import {AddSize16Px} from '@coveord/plasma-react-icons';\nimport {\n Box,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n MantineNumberSize,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {ReorderPayload} from '@mantine/form/lib/types';\nimport {useDidUpdate} from '@mantine/hooks';\nimport {ReactNode, useId} from 'react';\nimport {DragDropContext, Droppable} from 'react-beautiful-dnd';\n\nimport {Button} from '../button';\nimport useStyles from './Collection.styles';\nimport {CollectionItem} from './CollectionItem';\n\ninterface CollectionProps<T>\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The default value each new item should have\n */\n newItem: T;\n /**\n * A render function called for each item passed in the `value` prop.\n *\n * @param item The current item's value\n * @param index The current item's index\n */\n children: (item: T, index: number) => ReactNode;\n /**\n * The list of items to display inside the collection\n *\n * @default []\n */\n value?: T[];\n /**\n * Defines how each item is uniquely identified. It is highly recommended that you specify this prop to an ID that makes sense.\n *\n * This method is required when using this component with ReactHookForm.\n *\n * @see {@link https://react-hook-form.com/api/usefieldarray/} for using a collection with ReactHookForm.\n *\n * @param originalItem The original item\n */\n getItemId?: (originalItem: T) => string;\n /**\n * Unused, has no effect\n */\n onFocus?: () => void;\n /**\n * Function called whenever the value needs to be updated\n *\n * @param value The whole list of items after the change\n */\n onChange?: (value: T[]) => void;\n /**\n * Function called after an item is removed from the collection using the remove button\n *\n * @param itemIndex The index of the item that was removed\n */\n onRemoveItem?: (itemIndex: number) => void;\n /**\n * Function that gets called whenever a collection item needs to be reordered\n *\n * @param payload The origin and destination index of the item to reorder\n */\n onReorderItem?: (payload: ReorderPayload) => void;\n /**\n * Function that gets called when a new item needs to be added to the collection\n *\n * @param value The the value of the item to insert\n * @param index The index of the new item to insert\n */\n onInsertItem?: (value: T, index: number) => void;\n /**\n * Whether the collection should have drag and drop behavior enabled\n *\n * @default false\n */\n draggable?: boolean;\n /**\n * Whether the collection is disabled, or in other words in read only mode\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Function that determines if the add item button should be enabled given the current items of the collection.\n * The button is always enabled if this props remains undefined\n *\n * @param values The current items of the collection\n */\n allowAdd?: (values: T[]) => boolean;\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: string;\n /**\n * The tooltip text displayed when hovering over the disabled add item button\n *\n * @default 'There is already an empty item'\n */\n addDisabledTooltip?: string;\n /**\n * The spacing between the colleciton items\n *\n * @default 'xs'\n */\n spacing?: MantineNumberSize;\n /**\n * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item\n *\n * @default false\n */\n required?: boolean;\n}\n\nconst defaultProps: Partial<CollectionProps<unknown>> = {\n draggable: false,\n addLabel: 'Add item',\n addDisabledTooltip: 'There is already an empty item',\n disabled: false,\n spacing: 'xs',\n required: false,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T>) => {\n const {\n value,\n onChange,\n onRemoveItem,\n onReorderItem,\n onInsertItem,\n disabled,\n draggable,\n children,\n spacing,\n required,\n newItem,\n addLabel,\n addDisabledTooltip,\n allowAdd,\n label,\n labelProps,\n withAsterisk,\n description,\n descriptionProps,\n error,\n errorProps,\n getItemId,\n\n // Style props\n classNames,\n className,\n styles,\n unstyled,\n\n ...others\n } = useComponentDefaultProps('Collection', defaultProps as CollectionProps<T>, props);\n const {classes, cx} = useStyles(null, {classNames, name: 'Collection', styles, unstyled});\n const collectionID = useId();\n\n const hasOnlyOneItem = value.length === 1;\n\n /**\n * Enforcing onChange when the value is modified will make sure the errors are carried through.\n */\n useDidUpdate(() => {\n onChange?.(value);\n }, [JSON.stringify(value)]);\n\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const _label = label ? (\n <Input.Label required={isRequired} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : null;\n const _header =\n _label || _description ? (\n <>\n {_label}\n {_description}\n </>\n ) : null;\n\n const items = value.map((item, index) => (\n <CollectionItem\n key={(getItemId?.(item) ?? index) as string}\n disabled={disabled}\n draggable={draggable}\n index={index}\n onRemove={() => onRemoveItem?.(index)}\n styles={styles}\n removable={!(required && hasOnlyOneItem)}\n >\n {children(item, index)}\n </CollectionItem>\n ));\n\n const addAllowed = allowAdd?.(value) ?? true;\n\n const _addButton = disabled ? null : (\n <Group>\n <Tooltip label={addDisabledTooltip} disabled={addAllowed}>\n <Box>\n <Button\n variant=\"subtle\"\n leftIcon={<AddSize16Px height={16} />}\n onClick={() => onInsertItem(newItem, value?.length ?? 0)}\n disabled={!addAllowed}\n >\n {addLabel}\n </Button>\n </Box>\n </Tooltip>\n </Group>\n );\n\n return (\n <DragDropContext\n onDragEnd={({destination, source}) => onReorderItem({from: source.index, to: destination?.index || 0})}\n >\n <Droppable direction=\"vertical\" droppableId={collectionID}>\n {(provided) => (\n <Box\n {...provided.droppableProps}\n ref={provided.innerRef}\n className={cx(classes.root, className)}\n {...others}\n >\n {_header}\n <Stack spacing={spacing}>\n {items}\n {provided.placeholder}\n {_addButton}\n {_error}\n </Stack>\n </Box>\n )}\n </Droppable>\n </DragDropContext>\n );\n};\n"],"names":["AddSize16Px","Box","Group","Input","Stack","Tooltip","useComponentDefaultProps","useDidUpdate","useId","DragDropContext","Droppable","Button","useStyles","CollectionItem","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","spacing","required","Collection","props","value","onChange","onRemoveItem","onReorderItem","onInsertItem","children","newItem","allowAdd","label","labelProps","withAsterisk","description","descriptionProps","error","errorProps","getItemId","classNames","className","styles","unstyled","others","name","classes","cx","collectionID","hasOnlyOneItem","length","JSON","stringify","isRequired","_label","Label","_description","Description","_error","Error","_header","items","map","item","index","onRemove","removable","addAllowed","_addButton","variant","leftIcon","height","onClick","onDragEnd","destination","source","from","to","direction","droppableId","provided","droppableProps","ref","innerRef","root","placeholder"],"mappings":";;;;AAAA,SAAQA,WAAW,QAAO,8BAA8B;AACxD,SACIC,GAAG,EAEHC,KAAK,EACLC,KAAK,EAILC,KAAK,EACLC,OAAO,EACPC,wBAAwB,QACrB,gBAAgB;AAEvB,SAAQC,YAAY,QAAO,iBAAiB;AAC5C,SAAmBC,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AW,IAAI,iBAC9B,KAAChB;kBACG,cAAA,KAACG;YAAQ0B,OAAOd;YAAoBC,UAAUgD;sBAC1C,cAAA,KAACjE;0BACG,cAAA,KAACU;oBACGyD,SAAQ;oBACRC,wBAAU,KAACrE;wBAAYsE,QAAQ;;oBAC/BC,SAAS;wBAAM5C,OAAAA,aAAaE,SAASN,CAAAA,gBAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAO0B,MAAM,cAAb1B,2BAAAA,gBAAiB,CAAC;;oBACvDL,UAAU,CAACgD;8BAEVlD;;;;MAKpB;IAED,qBACI,KAACP;QACG+D,WAAW;gBAAEC,oBAAAA,aAAaC,eAAAA;YAAYhD,OAAAA,cAAc;gBAACiD,MAAMD,OAAOX,KAAK;gBAAEa,IAAIH,CAAAA,wBAAAA,yBAAAA,KAAAA,IAAAA,YAAaV,KAAK,AAAD,KAAK;YAAC;;kBAEpG,cAAA,KAACrD;YAAUmE,WAAU;YAAWC,aAAa/B;sBACxC,SAACgC;qCACE,MAAC9E,iFACO8E,SAASC,cAAc;oBAC3BC,KAAKF,SAASG,QAAQ;oBACtB1C,WAAWM,GAAGD,QAAQsC,IAAI,EAAE3C;oBACxBG;;wBAEHgB;sCACD,MAACvD;4BAAMe,SAASA;;gCACXyC;gCACAmB,SAASK,WAAW;gCACpBjB;gCACAV;;;;;;;;AAO7B,EAAE"}
1
+ {"version":3,"sources":["../../../../src/components/collection/Collection.tsx"],"sourcesContent":["import {AddSize16Px} from '@coveord/plasma-react-icons';\nimport {DndContext, DragEndEvent, KeyboardSensor, PointerSensor, useSensor, useSensors} from '@dnd-kit/core';\nimport {restrictToParentElement, restrictToVerticalAxis} from '@dnd-kit/modifiers';\nimport {SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy} from '@dnd-kit/sortable';\nimport {\n Box,\n DefaultProps,\n Group,\n Input,\n InputWrapperBaseProps,\n MantineNumberSize,\n Selectors,\n Stack,\n Tooltip,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {ReorderPayload} from '@mantine/form/lib/types';\nimport {useDidUpdate} from '@mantine/hooks';\nimport {ReactNode} from 'react';\n\nimport {Button} from '../button';\nimport useStyles from './Collection.styles';\nimport {CollectionItem} from './CollectionItem';\n\ninterface CollectionProps<T>\n extends Omit<InputWrapperBaseProps, 'inputContainer' | 'inputWrapperOrder'>,\n DefaultProps<Selectors<typeof useStyles>> {\n /**\n * The default value each new item should have\n */\n newItem: T;\n /**\n * A render function called for each item passed in the `value` prop.\n *\n * @param item The current item's value\n * @param index The current item's index\n */\n children: (item: T, index: number) => ReactNode;\n /**\n * The list of items to display inside the collection\n *\n * @default []\n */\n value?: T[];\n /**\n * Defines how each item is uniquely identified. It is highly recommended that you specify this prop to an ID that makes sense.\n *\n * This method is required when using this component with ReactHookForm.\n *\n * @see {@link https://react-hook-form.com/api/usefieldarray/} for using a collection with ReactHookForm.\n *\n * @param originalItem The original item\n */\n getItemId?: (originalItem: T) => string;\n /**\n * Unused, has no effect\n */\n onFocus?: () => void;\n /**\n * Function called whenever the value needs to be updated\n *\n * @param value The whole list of items after the change\n */\n onChange?: (value: T[]) => void;\n /**\n * Function called after an item is removed from the collection using the remove button\n *\n * @param itemIndex The index of the item that was removed\n */\n onRemoveItem?: (itemIndex: number) => void;\n /**\n * Function that gets called whenever a collection item needs to be reordered\n *\n * @param payload The origin and destination index of the item to reorder\n */\n onReorderItem?: (payload: ReorderPayload) => void;\n /**\n * Function that gets called when a new item needs to be added to the collection\n *\n * @param value The the value of the item to insert\n * @param index The index of the new item to insert\n */\n onInsertItem?: (value: T, index: number) => void;\n /**\n * Whether the collection should have drag and drop behavior enabled\n *\n * @default false\n */\n draggable?: boolean;\n /**\n * Whether the collection is disabled, or in other words in read only mode\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Function that determines if the add item button should be enabled given the current items of the collection.\n * The button is always enabled if this props remains undefined\n *\n * @param values The current items of the collection\n */\n allowAdd?: (values: T[]) => boolean;\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: string;\n /**\n * The tooltip text displayed when hovering over the disabled add item button\n *\n * @default 'There is already an empty item'\n */\n addDisabledTooltip?: string;\n /**\n * The spacing between the colleciton items\n *\n * @default 'xs'\n */\n spacing?: MantineNumberSize;\n /**\n * Whether the collection is required. When required is true, the collection will hide the remove button if there is only one item\n *\n * @default false\n */\n required?: boolean;\n}\n\nconst defaultProps: Partial<CollectionProps<unknown>> = {\n draggable: false,\n addLabel: 'Add item',\n addDisabledTooltip: 'There is already an empty item',\n disabled: false,\n spacing: 'xs',\n required: false,\n getItemId: ({id}: any) => id,\n};\n\nexport const Collection = <T,>(props: CollectionProps<T>) => {\n const {\n value,\n onChange,\n onRemoveItem,\n onReorderItem,\n onInsertItem,\n disabled,\n draggable,\n children,\n spacing,\n required,\n newItem,\n addLabel,\n addDisabledTooltip,\n allowAdd,\n label,\n labelProps,\n withAsterisk,\n description,\n descriptionProps,\n error,\n errorProps,\n getItemId,\n\n // Style props\n classNames,\n className,\n styles,\n unstyled,\n\n ...others\n } = useComponentDefaultProps('Collection', defaultProps as CollectionProps<T>, props);\n const {classes, cx} = useStyles(null, {classNames, name: 'Collection', styles, unstyled});\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n })\n );\n\n const hasOnlyOneItem = value.length === 1;\n\n /**\n * Enforcing onChange when the value is modified will make sure the errors are carried through.\n */\n useDidUpdate(() => {\n onChange?.(value);\n }, [JSON.stringify(value)]);\n\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const _label = label ? (\n <Input.Label required={isRequired} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : null;\n const _header =\n _label || _description ? (\n <>\n {_label}\n {_description}\n </>\n ) : null;\n\n const standardizedItems = value.map((item, index) => ({id: getItemId?.(item) ?? String(index), data: item}));\n\n const items = standardizedItems.map((item, index) => (\n <CollectionItem\n key={item.id}\n id={item.id}\n disabled={disabled}\n draggable={draggable}\n onRemove={() => onRemoveItem?.(index)}\n styles={styles}\n removable={!(required && hasOnlyOneItem)}\n >\n {children(item.data, index)}\n </CollectionItem>\n ));\n\n const addAllowed = allowAdd?.(value) ?? true;\n\n const _addButton = disabled ? null : (\n <Group>\n <Tooltip label={addDisabledTooltip} disabled={addAllowed}>\n <Box>\n <Button\n variant=\"subtle\"\n leftIcon={<AddSize16Px height={16} />}\n onClick={() => onInsertItem(newItem, value?.length ?? 0)}\n disabled={!addAllowed}\n >\n {addLabel}\n </Button>\n </Box>\n </Tooltip>\n </Group>\n );\n\n const getIndex = (id: string) => standardizedItems.findIndex((item) => item.id === id);\n\n const handleDragEnd = ({over, active}: DragEndEvent): void => {\n if (over) {\n const activeIndex = getIndex(String(active.id));\n const overIndex = getIndex(String(over.id));\n if (activeIndex !== overIndex) {\n onReorderItem?.({from: activeIndex, to: overIndex});\n }\n }\n };\n\n return (\n <DndContext\n onDragEnd={handleDragEnd}\n sensors={sensors}\n modifiers={[restrictToVerticalAxis, restrictToParentElement]}\n >\n <SortableContext items={standardizedItems} strategy={verticalListSortingStrategy}>\n <Box className={cx(classes.root, className)} {...others}>\n {_header}\n <Stack spacing={spacing}>\n {items}\n {_addButton}\n {_error}\n </Stack>\n </Box>\n </SortableContext>\n </DndContext>\n );\n};\n"],"names":["AddSize16Px","DndContext","KeyboardSensor","PointerSensor","useSensor","useSensors","restrictToParentElement","restrictToVerticalAxis","SortableContext","sortableKeyboardCoordinates","verticalListSortingStrategy","Box","Group","Input","Stack","Tooltip","useComponentDefaultProps","useDidUpdate","Button","useStyles","CollectionItem","defaultProps","draggable","addLabel","addDisabledTooltip","disabled","spacing","required","getItemId","id","Collection","props","value","onChange","onRemoveItem","onReorderItem","onInsertItem","children","newItem","allowAdd","label","labelProps","withAsterisk","description","descriptionProps","error","errorProps","classNames","className","styles","unstyled","others","name","classes","cx","sensors","coordinateGetter","hasOnlyOneItem","length","JSON","stringify","isRequired","_label","Label","_description","Description","_error","Error","_header","standardizedItems","map","item","index","String","data","items","onRemove","removable","addAllowed","_addButton","variant","leftIcon","height","onClick","getIndex","findIndex","handleDragEnd","over","active","activeIndex","overIndex","from","to","onDragEnd","modifiers","strategy","root"],"mappings":";;;;AAAA,SAAQA,WAAW,QAAO,8BAA8B;AACxD,SAAQC,UAAU,EAAgBC,cAAc,EAAEC,aAAa,EAAEC,SAAS,EAAEC,UAAU,QAAO,gBAAgB;AAC7G,SAAQC,uBAAuB,EAAEC,sBAAsB,QAAO,qBAAqB;AACnF,SAAQC,eAAe,EAAEC,2BAA2B,EAAEC,2BAA2B,QAAO,oBAAoB;AAC5G,SACIC,GAAG,EAEHC,KAAK,EACLC,KAAK,EAILC,KAAK,EACLC,OAAO,EACPC,wBAAwB,QACrB,gBAAgB;AAEvB,SAAQC,YAAY,QAAO,iBAAiB;AAG5C,SAAQC,MAAM,QAAO,YAAY;AACjC,OAAOC,eAAe,sBAAsB;AAC5C,SAAQC,cAAc,QAAO,mBAAmB;AA0GhD,IAAMC,eAAkD;IACpDC,WAAW,KAAK;IAChBC,UAAU;IACVC,oBAAoB;IACpBC,UAAU,KAAK;IACfC,SAAS;IACTC,UAAU,KAAK;IACfC,WAAW;YAAEC,WAAAA;eAAaA;;AAC9B;AAEA,OAAO,IAAMC,aAAa,SAAKC,OAA8B;IACzD,IA+BIf,4BAAAA,yBAAyB,cAAcK,cAAoCU,QA9B3EC,QA8BAhB,0BA9BAgB,OACAC,WA6BAjB,0BA7BAiB,UACAC,eA4BAlB,0BA5BAkB,cACAC,gBA2BAnB,0BA3BAmB,eACAC,eA0BApB,0BA1BAoB,cACAX,WAyBAT,0BAzBAS,UACAH,YAwBAN,0BAxBAM,WACAe,WAuBArB,0BAvBAqB,UACAX,UAsBAV,0BAtBAU,SACAC,WAqBAX,0BArBAW,UACAW,UAoBAtB,0BApBAs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,EAAE,KAAKA;;;IAEnF,IAAMyD,gBAAgB,gBAAwC;YAAtCC,aAAAA,MAAMC,eAAAA;QAC1B,IAAID,MAAM;YACN,IAAME,cAAcL,SAASX,OAAOe,OAAO3D,EAAE;YAC7C,IAAM6D,YAAYN,SAASX,OAAOc,KAAK1D,EAAE;YACzC,IAAI4D,gBAAgBC,WAAW;gBAC3BvD,0BAAAA,2BAAAA,KAAAA,IAAAA,cAAgB;oBAACwD,MAAMF;oBAAaG,IAAIF;gBAAS;YACrD,CAAC;QACL,CAAC;IACL;IAEA,qBACI,KAACzF;QACG4F,WAAWP;QACX/B,SAASA;QACTuC,WAAW;YAACvF;YAAwBD;SAAwB;kBAE5D,cAAA,KAACE;YAAgBmE,OAAON;YAAmB0B,UAAUrF;sBACjD,cAAA,MAACC;gBAAIqC,WAAWM,GAAGD,QAAQ2C,IAAI,EAAEhD;eAAgBG;;oBAC5CiB;kCACD,MAACtD;wBAAMY,SAASA;;4BACXiD;4BACAI;4BACAb;;;;;;;AAMzB,EAAE"}
@@ -0,0 +1,14 @@
1
+ export interface CollectionStylesParams {
2
+ }
3
+ declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<string>) => {
4
+ classes: {
5
+ root: string;
6
+ item: string;
7
+ itemDragging: string;
8
+ dragHandle: string;
9
+ };
10
+ cx: (...args: any) => string;
11
+ theme: import("@mantine/core").MantineTheme;
12
+ };
13
+ export default _default;
14
+ //# sourceMappingURL=Collection.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collection.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/Collection.styles.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;CAAG;;;;;;;;;;;AAE1C,wBAeI"}
@@ -1,13 +1,19 @@
1
1
  import { createStyles } from "@mantine/core";
2
2
  export default createStyles(function(theme) {
3
3
  return {
4
- root: {},
4
+ root: {
5
+ position: "relative"
6
+ },
5
7
  item: {
6
8
  backgroundColor: theme.colorScheme === "light" ? theme.white : theme.black,
7
9
  alignItems: "baseline"
8
10
  },
9
11
  itemDragging: {
10
- boxShadow: theme.shadows.sm
12
+ boxShadow: theme.shadows.md,
13
+ zIndex: 2
14
+ },
15
+ dragHandle: {
16
+ cursor: "move"
11
17
  }
12
18
  };
13
19
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/collection/Collection.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface CollectionStylesParams {}\n\nexport default createStyles((theme) => ({\n root: {},\n item: {\n backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,\n alignItems: 'baseline',\n },\n itemDragging: {\n boxShadow: theme.shadows.sm,\n },\n}));\n"],"names":["createStyles","theme","root","item","backgroundColor","colorScheme","white","black","alignItems","itemDragging","boxShadow","shadows","sm"],"mappings":"AAAA,SAAQA,YAAY,QAAO,gBAAgB;AAI3C,eAAeA,aAAa,SAACC;WAAW;QACpCC,MAAM,CAAC;QACPC,MAAM;YACFC,iBAAiBH,MAAMI,WAAW,KAAK,UAAUJ,MAAMK,KAAK,GAAGL,MAAMM,KAAK;YAC1EC,YAAY;QAChB;QACAC,cAAc;YACVC,WAAWT,MAAMU,OAAO,CAACC,EAAE;QAC/B;IACJ;GAAI"}
1
+ {"version":3,"sources":["../../../../src/components/collection/Collection.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface CollectionStylesParams {}\n\nexport default createStyles((theme) => ({\n root: {\n position: 'relative',\n },\n item: {\n backgroundColor: theme.colorScheme === 'light' ? theme.white : theme.black,\n alignItems: 'baseline',\n },\n itemDragging: {\n boxShadow: theme.shadows.md,\n zIndex: 2,\n },\n dragHandle: {\n cursor: 'move',\n },\n}));\n"],"names":["createStyles","theme","root","position","item","backgroundColor","colorScheme","white","black","alignItems","itemDragging","boxShadow","shadows","md","zIndex","dragHandle","cursor"],"mappings":"AAAA,SAAQA,YAAY,QAAO,gBAAgB;AAI3C,eAAeA,aAAa,SAACC;WAAW;QACpCC,MAAM;YACFC,UAAU;QACd;QACAC,MAAM;YACFC,iBAAiBJ,MAAMK,WAAW,KAAK,UAAUL,MAAMM,KAAK,GAAGN,MAAMO,KAAK;YAC1EC,YAAY;QAChB;QACAC,cAAc;YACVC,WAAWV,MAAMW,OAAO,CAACC,EAAE;YAC3BC,QAAQ;QACZ;QACAC,YAAY;YACRC,QAAQ;QACZ;IACJ;GAAI"}
@@ -0,0 +1,15 @@
1
+ import { DefaultProps, Selectors } from '@mantine/core';
2
+ import { FunctionComponent, PropsWithChildren } from 'react';
3
+ import useStyles from './Collection.styles';
4
+ interface CollectionItemProps extends CollectionItemSharedProps {
5
+ draggable?: boolean;
6
+ disabled: boolean;
7
+ }
8
+ interface CollectionItemSharedProps extends DefaultProps<Selectors<typeof useStyles>> {
9
+ id: string;
10
+ onRemove?: React.MouseEventHandler<HTMLButtonElement>;
11
+ removable?: boolean;
12
+ }
13
+ export declare const CollectionItem: FunctionComponent<PropsWithChildren<CollectionItemProps>>;
14
+ export {};
15
+ //# sourceMappingURL=CollectionItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionItem.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/CollectionItem.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,YAAY,EAAS,SAAS,EAAC,MAAM,eAAe,CAAC;AACzE,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAE3D,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAE5C,UAAU,mBAAoB,SAAQ,yBAAyB;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,yBAA0B,SAAQ,YAAY,CAAC,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAwED,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAYpF,CAAC"}
@@ -3,9 +3,10 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
3
3
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
4
4
  import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
5
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- import { DragAndDropSize16Px, RemoveSize16Px } from "@coveord/plasma-react-icons";
6
+ import { DragAndDropSize24Px, RemoveSize16Px } from "@coveord/plasma-react-icons";
7
+ import { useSortable } from "@dnd-kit/sortable";
8
+ import { CSS } from "@dnd-kit/utilities";
7
9
  import { ActionIcon, Group } from "@mantine/core";
8
- import { Draggable } from "react-beautiful-dnd";
9
10
  import useStyles from "./Collection.styles";
10
11
  var RemoveButton = function(param) {
11
12
  var onClick = param.onClick;
@@ -57,7 +58,7 @@ var DisabledCollectionItem = function(param) {
57
58
  });
58
59
  };
59
60
  var DraggableCollectionItem = function(param) {
60
- var index = param.index, onRemove = param.onRemove, _param_removable = param.removable, removable = _param_removable === void 0 ? true : _param_removable, styles = param.styles, children = param.children;
61
+ var id = param.id, onRemove = param.onRemove, _param_removable = param.removable, removable = _param_removable === void 0 ? true : _param_removable, styles = param.styles, children = param.children;
61
62
  var _useStyles = useStyles(null, {
62
63
  name: "Collection",
63
64
  styles: styles
@@ -65,30 +66,29 @@ var DraggableCollectionItem = function(param) {
65
66
  var removeButton = removable && onRemove ? /*#__PURE__*/ _jsx(RemoveButton, {
66
67
  onClick: onRemove
67
68
  }) : null;
68
- return /*#__PURE__*/ _jsx(Draggable, {
69
- index: index,
70
- draggableId: index.toString(),
71
- children: function(provided, param) {
72
- var isDragging = param.isDragging;
73
- return /*#__PURE__*/ _jsxs(Group, _object_spread_props(_object_spread({
74
- ref: provided.innerRef
75
- }, provided.draggableProps), {
76
- className: cx(classes.item, _define_property({}, classes.itemDragging, isDragging)),
77
- children: [
78
- /*#__PURE__*/ _jsx("div", _object_spread_props(_object_spread({}, provided.dragHandleProps), {
79
- style: {
80
- alignSelf: "center"
81
- },
82
- children: /*#__PURE__*/ _jsx(DragAndDropSize16Px, {
83
- height: 16
84
- })
85
- })),
86
- children,
87
- removeButton
88
- ]
89
- }));
90
- }
91
- }, index);
69
+ var _useSortable = useSortable({
70
+ id: id
71
+ }), attributes = _useSortable.attributes, listeners = _useSortable.listeners, setNodeRef = _useSortable.setNodeRef, transform = _useSortable.transform, transition = _useSortable.transition, isDragging = _useSortable.isDragging, setActivatorNodeRef = _useSortable.setActivatorNodeRef;
72
+ return /*#__PURE__*/ _jsxs(Group, {
73
+ ref: setNodeRef,
74
+ className: cx(classes.item, _define_property({}, classes.itemDragging, isDragging)),
75
+ sx: transform ? {
76
+ transform: CSS.Transform.toString(transform),
77
+ transition: transition
78
+ } : undefined,
79
+ children: [
80
+ /*#__PURE__*/ _jsx("div", _object_spread_props(_object_spread({
81
+ ref: setActivatorNodeRef
82
+ }, listeners, attributes), {
83
+ className: classes.dragHandle,
84
+ children: /*#__PURE__*/ _jsx(DragAndDropSize24Px, {
85
+ height: 16
86
+ })
87
+ })),
88
+ children,
89
+ removeButton
90
+ ]
91
+ });
92
92
  };
93
93
  export var CollectionItem = function(_param) {
94
94
  var draggable = _param.draggable, disabled = _param.disabled, otherProps = _object_without_properties(_param, [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/collection/CollectionItem.tsx"],"sourcesContent":["import {DragAndDropSize16Px, RemoveSize16Px} from '@coveord/plasma-react-icons';\nimport {ActionIcon, DefaultProps, Group, Selectors} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\nimport {Draggable} from 'react-beautiful-dnd';\n\nimport useStyles from './Collection.styles';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends DefaultProps<Selectors<typeof useStyles>> {\n index: number;\n onRemove?: React.MouseEventHandler<HTMLButtonElement>;\n removable?: boolean;\n}\n\nconst RemoveButton: FunctionComponent<{\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({onClick}) => (\n <ActionIcon sx={{alignSelf: 'center'}} variant=\"subtle\" onClick={onClick} color=\"action\">\n <RemoveSize16Px height={16} />\n </ActionIcon>\n);\n\nconst RemoveButtonPlaceholder = () => <div style={{width: 28}} />;\n\nconst StaticCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : <RemoveButtonPlaceholder />;\n\n return (\n <Group className={cx(classes.item)}>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n children,\n styles,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n return <Group className={cx(classes.item)}>{children}</Group>;\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n index,\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : null;\n\n return (\n <Draggable key={index} index={index} draggableId={index.toString()}>\n {(provided, {isDragging}) => (\n <Group\n ref={provided.innerRef}\n {...provided.draggableProps}\n className={cx(classes.item, {[classes.itemDragging]: isDragging})}\n >\n <div {...provided.dragHandleProps} style={{alignSelf: 'center'}}>\n <DragAndDropSize16Px height={16} />\n </div>\n {children}\n {removeButton}\n </Group>\n )}\n </Draggable>\n );\n};\n\nexport const CollectionItem: FunctionComponent<PropsWithChildren<CollectionItemProps>> = ({\n draggable,\n disabled,\n ...otherProps\n}) => {\n if (disabled) {\n return <DisabledCollectionItem {...otherProps} />;\n }\n if (draggable) {\n return <DraggableCollectionItem {...otherProps} />;\n }\n return <StaticCollectionItem {...otherProps} />;\n};\n"],"names":["DragAndDropSize16Px","RemoveSize16Px","ActionIcon","Group","Draggable","useStyles","RemoveButton","onClick","sx","alignSelf","variant","color","height","RemoveButtonPlaceholder","div","style","width","StaticCollectionItem","onRemove","removable","styles","children","name","classes","cx","removeButton","className","item","DisabledCollectionItem","DraggableCollectionItem","index","draggableId","toString","provided","isDragging","ref","innerRef","draggableProps","itemDragging","dragHandleProps","CollectionItem","draggable","disabled","otherProps"],"mappings":";;;;;AAAA,SAAQA,mBAAmB,EAAEC,cAAc,QAAO,8BAA8B;AAChF,SAAQC,UAAU,EAAgBC,KAAK,QAAkB,gBAAgB;AAEzE,SAAQC,SAAS,QAAO,sBAAsB;AAE9C,OAAOC,eAAe,sBAAsB;AAa5C,IAAMC,eAED;QAAEC,gBAAAA;yBACH,KAACL;QAAWM,IAAI;YAACC,WAAW;QAAQ;QAAGC,SAAQ;QAASH,SAASA;QAASI,OAAM;kBAC5E,cAAA,KAACV;YAAeW,QAAQ;;;;AAIhC,IAAMC,0BAA0B;yBAAM,KAACC;QAAIC,OAAO;YAACC,OAAO;QAAE;;;AAE5D,IAAMC,uBAAwF,gBAKxF;QAJFC,iBAAAA,mCACAC,WAAAA,0CAAY,IAAI,qBAChBC,eAAAA,QACAC,iBAAAA;IAEA,IAAsBhB,aAAAA,UAAU,IAAI,EAAE;QAACiB,MAAM;QAAcF,QAAAA;IAAM,IAA1DG,UAAelB,WAAfkB,SAASC,KAAMnB,WAANmB;IAChB,IAAMC,eAAeN,aAAaD,yBAAW,KAACZ;QAAaC,SAASW;uBAAe,KAACL,4BAA0B;IAE9G,qBACI,MAACV;QAAMuB,WAAWF,GAAGD,QAAQI,IAAI;;YAC5BN;YACAI;;;AAGb;AAEA,IAAMG,yBAA0F,gBAG1F;QAFFP,iBAAAA,UACAD,eAAAA;IAEA,IAAsBf,aAAAA,UAAU,IAAI,EAAE;QAACiB,MAAM;QAAcF,QAAAA;IAAM,IAA1DG,UAAelB,WAAfkB,SAASC,KAAMnB,WAANmB;IAChB,qBAAO,KAACrB;QAAMuB,WAAWF,GAAGD,QAAQI,IAAI;kBAAIN;;AAChD;AAEA,IAAMQ,0BAA2F,gBAM3F;QALFC,cAAAA,OACAZ,iBAAAA,mCACAC,WAAAA,0CAAY,IAAI,qBAChBC,eAAAA,QACAC,iBAAAA;IAEA,IAAsBhB,aAAAA,UAAU,IAAI,EAAE;QAACiB,MAAM;QAAcF,QAAAA;IAAM,IAA1DG,UAAelB,WAAfkB,SAASC,KAAMnB,WAANmB;IAChB,IAAMC,eAAeN,aAAaD,yBAAW,KAACZ;QAAaC,SAASW;SAAe,IAAI;IAEvF,qBACI,KAACd;QAAsB0B,OAAOA;QAAOC,aAAaD,MAAME,QAAQ;kBAC3D,SAACC;gBAAWC,mBAAAA;iCACT,MAAC/B;gBACGgC,KAAKF,SAASG,QAAQ;eAClBH,SAASI,cAAc;gBAC3BX,WAAWF,GAAGD,QAAQI,IAAI,EAAG,qBAACJ,QAAQe,YAAY,EAAGJ;;kCAErD,KAACpB,+CAAQmB,SAASM,eAAe;wBAAExB,OAAO;4BAACN,WAAW;wBAAQ;kCAC1D,cAAA,KAACT;4BAAoBY,QAAQ;;;oBAEhCS;oBACAI;;;;OAXGK;AAgBxB;AAEA,OAAO,IAAMU,iBAA4E,iBAInF;QAHFC,mBAAAA,WACAC,kBAAAA,UACGC;QAFHF;QACAC;;IAGA,IAAIA,UAAU;QACV,qBAAO,KAACd,2CAA2Be;IACvC,CAAC;IACD,IAAIF,WAAW;QACX,qBAAO,KAACZ,4CAA4Bc;IACxC,CAAC;IACD,qBAAO,KAAC1B,yCAAyB0B;AACrC,EAAE"}
1
+ {"version":3,"sources":["../../../../src/components/collection/CollectionItem.tsx"],"sourcesContent":["import {DragAndDropSize24Px, RemoveSize16Px} from '@coveord/plasma-react-icons';\nimport {useSortable} from '@dnd-kit/sortable';\nimport {CSS} from '@dnd-kit/utilities';\nimport {ActionIcon, DefaultProps, Group, Selectors} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nimport useStyles from './Collection.styles';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends DefaultProps<Selectors<typeof useStyles>> {\n id: string;\n onRemove?: React.MouseEventHandler<HTMLButtonElement>;\n removable?: boolean;\n}\n\nconst RemoveButton: FunctionComponent<{\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({onClick}) => (\n <ActionIcon sx={{alignSelf: 'center'}} variant=\"subtle\" onClick={onClick} color=\"action\">\n <RemoveSize16Px height={16} />\n </ActionIcon>\n);\n\nconst RemoveButtonPlaceholder = () => <div style={{width: 28}} />;\n\nconst StaticCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : <RemoveButtonPlaceholder />;\n\n return (\n <Group className={cx(classes.item)}>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n children,\n styles,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n return <Group className={cx(classes.item)}>{children}</Group>;\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = ({\n id,\n onRemove,\n removable = true,\n styles,\n children,\n}) => {\n const {classes, cx} = useStyles(null, {name: 'Collection', styles});\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : null;\n const {attributes, listeners, setNodeRef, transform, transition, isDragging, setActivatorNodeRef} = useSortable({\n id,\n });\n\n return (\n <Group\n ref={setNodeRef}\n className={cx(classes.item, {[classes.itemDragging]: isDragging})}\n sx={\n transform\n ? {\n transform: CSS.Transform.toString(transform),\n transition,\n }\n : undefined\n }\n >\n <div ref={setActivatorNodeRef} {...listeners} {...attributes} className={classes.dragHandle}>\n <DragAndDropSize24Px height={16} />\n </div>\n {children}\n {removeButton}\n </Group>\n );\n};\n\nexport const CollectionItem: FunctionComponent<PropsWithChildren<CollectionItemProps>> = ({\n draggable,\n disabled,\n ...otherProps\n}) => {\n if (disabled) {\n return <DisabledCollectionItem {...otherProps} />;\n }\n if (draggable) {\n return <DraggableCollectionItem {...otherProps} />;\n }\n return <StaticCollectionItem {...otherProps} />;\n};\n"],"names":["DragAndDropSize24Px","RemoveSize16Px","useSortable","CSS","ActionIcon","Group","useStyles","RemoveButton","onClick","sx","alignSelf","variant","color","height","RemoveButtonPlaceholder","div","style","width","StaticCollectionItem","onRemove","removable","styles","children","name","classes","cx","removeButton","className","item","DisabledCollectionItem","DraggableCollectionItem","id","attributes","listeners","setNodeRef","transform","transition","isDragging","setActivatorNodeRef","ref","itemDragging","Transform","toString","undefined","dragHandle","CollectionItem","draggable","disabled","otherProps"],"mappings":";;;;;AAAA,SAAQA,mBAAmB,EAAEC,cAAc,QAAO,8BAA8B;AAChF,SAAQC,WAAW,QAAO,oBAAoB;AAC9C,SAAQC,GAAG,QAAO,qBAAqB;AACvC,SAAQC,UAAU,EAAgBC,KAAK,QAAkB,gBAAgB;AAGzE,OAAOC,eAAe,sBAAsB;AAa5C,IAAMC,eAED;QAAEC,gBAAAA;yBACH,KAACJ;QAAWK,IAAI;YAACC,WAAW;QAAQ;QAAGC,SAAQ;QAASH,SAASA;QAASI,OAAM;kBAC5E,cAAA,KAACX;YAAeY,QAAQ;;;;AAIhC,IAAMC,0BAA0B;yBAAM,KAACC;QAAIC,OAAO;YAACC,OAAO;QAAE;;;AAE5D,IAAMC,uBAAwF,gBAKxF;QAJFC,iBAAAA,mCACAC,WAAAA,0CAAY,IAAI,qBAChBC,eAAAA,QACAC,iBAAAA;IAEA,IAAsBhB,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CC,YAAAA;QACJ,IACAO,SAAS;;0BAGnB,KAAC5B;gBAAIwB,KAAKD;eAAyBL,WAAeD;gBAAYL,WAAWH,QAAQoB,UAAU;0BACvF,cAAA,KAAC5C;oBAAoBa,QAAQ;;;YAEhCS;YACAI;;;AAGb;AAEA,OAAO,IAAMmB,iBAA4E,iBAInF;QAHFC,mBAAAA,WACAC,kBAAAA,UACGC;QAFHF;QACAC;;IAGA,IAAIA,UAAU;QACV,qBAAO,KAAClB,2CAA2BmB;IACvC,CAAC;IACD,IAAIF,WAAW;QACX,qBAAO,KAAChB,4CAA4BkB;IACxC,CAAC;IACD,qBAAO,KAAC9B,yCAAyB8B;AACrC,EAAE"}
@@ -0,0 +1,2 @@
1
+ export * from './Collection';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ export interface CopyToClipboardProps {
3
+ /**
4
+ * The value to be copied to the clipboard.
5
+ */
6
+ value: string;
7
+ /**
8
+ * Whether to display the string to be copied alongside the button.
9
+ *
10
+ * @default false
11
+ */
12
+ withLabel?: boolean;
13
+ /**
14
+ * Called each time the value is copied to the clipboard
15
+ */
16
+ onCopy?: () => void;
17
+ }
18
+ export declare const CopyToClipboard: React.FunctionComponent<CopyToClipboardProps>;
19
+ //# sourceMappingURL=CopyToClipboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyToClipboard.d.ts","sourceRoot":"","sources":["../../../../src/components/copyToClipboard/CopyToClipboard.tsx"],"names":[],"mappings":";AAGA,MAAM,WAAW,oBAAoB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AA0BD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAezE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './CopyToClipboard';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/copyToClipboard/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,38 @@
1
+ /// <reference types="react" />
2
+ import { DatePickerBaseProps } from '@mantine/dates';
3
+ import { DateRangePickerPreset } from './DateRangePickerPresetSelect';
4
+ import { EditableDateRangePickerProps } from './EditableDateRangePicker';
5
+ export type DateRangePickerValue = [Date | null, Date | null];
6
+ export interface DateRangePickerInlineCalendarProps extends Pick<EditableDateRangePickerProps, 'startProps' | 'endProps'> {
7
+ /**
8
+ * Initial selected range
9
+ */
10
+ initialRange: DateRangePickerValue;
11
+ /**
12
+ * Function called when the user applies the new date range
13
+ *
14
+ * @param range the newly selected dates
15
+ */
16
+ onApply: (range: DateRangePickerValue) => void;
17
+ /**
18
+ * Function called when the user click on the cancel button
19
+ */
20
+ onCancel: () => void;
21
+ /**
22
+ * The presets to display
23
+ *
24
+ * @default {}
25
+ * @example
26
+ * {
27
+ * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},
28
+ * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}
29
+ * }
30
+ */
31
+ presets?: Record<string, DateRangePickerPreset>;
32
+ /**
33
+ * Props for RangeCalendar displayed in the popover
34
+ */
35
+ rangeCalendarProps?: Omit<DatePickerBaseProps, 'value' | 'onChange' | 'isDateInRange' | 'isDateFirstInRange' | 'isDateLastInRange'>;
36
+ }
37
+ export declare const DateRangePickerInlineCalendar: ({ initialRange, onApply, onCancel, presets, startProps, endProps, rangeCalendarProps, }: DateRangePickerInlineCalendarProps) => JSX.Element;
38
+ //# sourceMappingURL=DateRangePickerInlineCalendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateRangePickerInlineCalendar.d.ts","sourceRoot":"","sources":["../../../../src/components/date-range-picker/DateRangePickerInlineCalendar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAI/D,OAAO,EAAC,qBAAqB,EAA8B,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAA0B,4BAA4B,EAAC,MAAM,2BAA2B,CAAC;AAEhG,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;AAC9D,MAAM,WAAW,kCACb,SAAQ,IAAI,CAAC,4BAA4B,EAAE,YAAY,GAAG,UAAU,CAAC;IACrE;;OAEG;IACH,YAAY,EAAE,oBAAoB,CAAC;IACnC;;;;OAIG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAChD;;OAEG;IACH,kBAAkB,CAAC,EAAE,IAAI,CACrB,mBAAmB,EACnB,OAAO,GAAG,UAAU,GAAG,eAAe,GAAG,oBAAoB,GAAG,mBAAmB,CACtF,CAAC;CACL;AAED,eAAO,MAAM,6BAA6B,4FAQvC,kCAAkC,gBAkEpC,CAAC"}