@coveord/plasma-mantine 56.18.0 → 56.20.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 (218) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/.turbo/turbo-test.log +113 -113
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cjs/components/Checkbox/Checkbox.d.ts.map +1 -1
  5. package/dist/cjs/components/Checkbox/Checkbox.js +1 -0
  6. package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
  7. package/dist/cjs/components/CodeEditor/CodeEditor.d.ts.map +1 -1
  8. package/dist/cjs/components/CodeEditor/CodeEditor.js +2 -1
  9. package/dist/cjs/components/CodeEditor/CodeEditor.js.map +1 -1
  10. package/dist/cjs/components/Collection/Collection.d.ts +75 -12
  11. package/dist/cjs/components/Collection/Collection.d.ts.map +1 -1
  12. package/dist/cjs/components/Collection/Collection.js +94 -38
  13. package/dist/cjs/components/Collection/Collection.js.map +1 -1
  14. package/dist/cjs/components/Collection/Collection.module.css +13 -1
  15. package/dist/cjs/components/Collection/CollectionAddButton.d.ts +25 -0
  16. package/dist/cjs/components/Collection/CollectionAddButton.d.ts.map +1 -0
  17. package/dist/cjs/components/Collection/CollectionAddButton.js +33 -0
  18. package/dist/cjs/components/Collection/CollectionAddButton.js.map +1 -0
  19. package/dist/cjs/components/Collection/CollectionColumn.types.d.ts +72 -0
  20. package/dist/cjs/components/Collection/CollectionColumn.types.d.ts.map +1 -0
  21. package/dist/cjs/components/Collection/CollectionColumn.types.js +6 -0
  22. package/dist/cjs/components/Collection/CollectionColumn.types.js.map +1 -0
  23. package/dist/cjs/components/Collection/CollectionContext.d.ts +5 -0
  24. package/dist/cjs/components/Collection/CollectionContext.d.ts.map +1 -1
  25. package/dist/cjs/components/Collection/CollectionContext.js.map +1 -1
  26. package/dist/cjs/components/Collection/CollectionItem.d.ts +2 -2
  27. package/dist/cjs/components/Collection/CollectionItem.d.ts.map +1 -1
  28. package/dist/cjs/components/Collection/CollectionItem.js +18 -38
  29. package/dist/cjs/components/Collection/CollectionItem.js.map +1 -1
  30. package/dist/cjs/components/Collection/layouts/CollectionLayout.types.d.ts +46 -0
  31. package/dist/cjs/components/Collection/layouts/CollectionLayout.types.d.ts.map +1 -0
  32. package/dist/cjs/components/Collection/layouts/CollectionLayout.types.js +6 -0
  33. package/dist/cjs/components/Collection/layouts/CollectionLayout.types.js.map +1 -0
  34. package/dist/cjs/components/Collection/layouts/CollectionLayouts.d.ts +26 -0
  35. package/dist/cjs/components/Collection/layouts/CollectionLayouts.d.ts.map +1 -0
  36. package/dist/cjs/components/Collection/layouts/CollectionLayouts.js +29 -0
  37. package/dist/cjs/components/Collection/layouts/CollectionLayouts.js.map +1 -0
  38. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayout.d.ts +12 -0
  39. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayout.d.ts.map +1 -0
  40. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayout.js +24 -0
  41. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayout.js.map +1 -0
  42. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayout.module.css +37 -0
  43. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.d.ts +6 -0
  44. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.d.ts.map +1 -0
  45. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.js +78 -0
  46. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.js.map +1 -0
  47. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.d.ts +6 -0
  48. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.d.ts.map +1 -0
  49. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.js +56 -0
  50. package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.js.map +1 -0
  51. package/dist/cjs/components/Collection/layouts/shared/DragHandle.d.ts +12 -0
  52. package/dist/cjs/components/Collection/layouts/shared/DragHandle.d.ts.map +1 -0
  53. package/dist/cjs/components/Collection/layouts/shared/DragHandle.js +28 -0
  54. package/dist/cjs/components/Collection/layouts/shared/DragHandle.js.map +1 -0
  55. package/dist/cjs/components/Collection/layouts/shared/RemoveButton.d.ts +11 -0
  56. package/dist/cjs/components/Collection/layouts/shared/RemoveButton.d.ts.map +1 -0
  57. package/dist/cjs/components/Collection/layouts/shared/RemoveButton.js +39 -0
  58. package/dist/cjs/components/Collection/layouts/shared/RemoveButton.js.map +1 -0
  59. package/dist/cjs/components/Collection/layouts/shared/columnUtils.d.ts +8 -0
  60. package/dist/cjs/components/Collection/layouts/shared/columnUtils.d.ts.map +1 -0
  61. package/dist/cjs/components/Collection/layouts/shared/columnUtils.js +24 -0
  62. package/dist/cjs/components/Collection/layouts/shared/columnUtils.js.map +1 -0
  63. package/dist/cjs/components/Collection/layouts/shared/headerUtils.d.ts +8 -0
  64. package/dist/cjs/components/Collection/layouts/shared/headerUtils.d.ts.map +1 -0
  65. package/dist/cjs/components/Collection/layouts/shared/headerUtils.js +21 -0
  66. package/dist/cjs/components/Collection/layouts/shared/headerUtils.js.map +1 -0
  67. package/dist/cjs/components/Collection/layouts/shared/itemRenderer.d.ts +78 -0
  68. package/dist/cjs/components/Collection/layouts/shared/itemRenderer.d.ts.map +1 -0
  69. package/dist/cjs/components/Collection/layouts/shared/itemRenderer.js +160 -0
  70. package/dist/cjs/components/Collection/layouts/shared/itemRenderer.js.map +1 -0
  71. package/dist/cjs/components/Collection/layouts/shared/layoutConstants.d.ts +38 -0
  72. package/dist/cjs/components/Collection/layouts/shared/layoutConstants.d.ts.map +1 -0
  73. package/dist/cjs/components/Collection/layouts/shared/layoutConstants.js +31 -0
  74. package/dist/cjs/components/Collection/layouts/shared/layoutConstants.js.map +1 -0
  75. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayout.d.ts +12 -0
  76. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayout.d.ts.map +1 -0
  77. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayout.js +24 -0
  78. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayout.js.map +1 -0
  79. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayout.module.css +35 -0
  80. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutBody.d.ts +6 -0
  81. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutBody.d.ts.map +1 -0
  82. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutBody.js +134 -0
  83. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutBody.js.map +1 -0
  84. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutHeader.d.ts +10 -0
  85. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutHeader.d.ts.map +1 -0
  86. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutHeader.js +15 -0
  87. package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutHeader.js.map +1 -0
  88. package/dist/cjs/components/CopyToClipboard/CopyToClipboard.js +1 -0
  89. package/dist/cjs/components/CopyToClipboard/CopyToClipboard.js.map +1 -1
  90. package/dist/cjs/hooks/useParentHeight.d.ts.map +1 -1
  91. package/dist/cjs/hooks/useParentHeight.js +6 -4
  92. package/dist/cjs/hooks/useParentHeight.js.map +1 -1
  93. package/dist/cjs/index.d.ts +2 -0
  94. package/dist/cjs/index.d.ts.map +1 -1
  95. package/dist/cjs/index.js.map +1 -1
  96. package/dist/esm/components/Checkbox/Checkbox.d.ts.map +1 -1
  97. package/dist/esm/components/Checkbox/Checkbox.js +1 -0
  98. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  99. package/dist/esm/components/CodeEditor/CodeEditor.d.ts.map +1 -1
  100. package/dist/esm/components/CodeEditor/CodeEditor.js +2 -1
  101. package/dist/esm/components/CodeEditor/CodeEditor.js.map +1 -1
  102. package/dist/esm/components/Collection/Collection.d.ts +75 -12
  103. package/dist/esm/components/Collection/Collection.d.ts.map +1 -1
  104. package/dist/esm/components/Collection/Collection.js +87 -32
  105. package/dist/esm/components/Collection/Collection.js.map +1 -1
  106. package/dist/esm/components/Collection/Collection.module.css +13 -1
  107. package/dist/esm/components/Collection/CollectionAddButton.d.ts +25 -0
  108. package/dist/esm/components/Collection/CollectionAddButton.d.ts.map +1 -0
  109. package/dist/esm/components/Collection/CollectionAddButton.js +19 -0
  110. package/dist/esm/components/Collection/CollectionAddButton.js.map +1 -0
  111. package/dist/esm/components/Collection/CollectionColumn.types.d.ts +72 -0
  112. package/dist/esm/components/Collection/CollectionColumn.types.d.ts.map +1 -0
  113. package/dist/esm/components/Collection/CollectionColumn.types.js +5 -0
  114. package/dist/esm/components/Collection/CollectionColumn.types.js.map +1 -0
  115. package/dist/esm/components/Collection/CollectionContext.d.ts +5 -0
  116. package/dist/esm/components/Collection/CollectionContext.d.ts.map +1 -1
  117. package/dist/esm/components/Collection/CollectionContext.js.map +1 -1
  118. package/dist/esm/components/Collection/CollectionItem.d.ts +2 -2
  119. package/dist/esm/components/Collection/CollectionItem.d.ts.map +1 -1
  120. package/dist/esm/components/Collection/CollectionItem.js +15 -34
  121. package/dist/esm/components/Collection/CollectionItem.js.map +1 -1
  122. package/dist/esm/components/Collection/layouts/CollectionLayout.types.d.ts +46 -0
  123. package/dist/esm/components/Collection/layouts/CollectionLayout.types.d.ts.map +1 -0
  124. package/dist/esm/components/Collection/layouts/CollectionLayout.types.js +6 -0
  125. package/dist/esm/components/Collection/layouts/CollectionLayout.types.js.map +1 -0
  126. package/dist/esm/components/Collection/layouts/CollectionLayouts.d.ts +26 -0
  127. package/dist/esm/components/Collection/layouts/CollectionLayouts.d.ts.map +1 -0
  128. package/dist/esm/components/Collection/layouts/CollectionLayouts.js +10 -0
  129. package/dist/esm/components/Collection/layouts/CollectionLayouts.js.map +1 -0
  130. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayout.d.ts +12 -0
  131. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayout.d.ts.map +1 -0
  132. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayout.js +11 -0
  133. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayout.js.map +1 -0
  134. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayout.module.css +37 -0
  135. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.d.ts +6 -0
  136. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.d.ts.map +1 -0
  137. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.js +49 -0
  138. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.js.map +1 -0
  139. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.d.ts +6 -0
  140. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.d.ts.map +1 -0
  141. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.js +36 -0
  142. package/dist/esm/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.js.map +1 -0
  143. package/dist/esm/components/Collection/layouts/shared/DragHandle.d.ts +12 -0
  144. package/dist/esm/components/Collection/layouts/shared/DragHandle.d.ts.map +1 -0
  145. package/dist/esm/components/Collection/layouts/shared/DragHandle.js +20 -0
  146. package/dist/esm/components/Collection/layouts/shared/DragHandle.js.map +1 -0
  147. package/dist/esm/components/Collection/layouts/shared/RemoveButton.d.ts +11 -0
  148. package/dist/esm/components/Collection/layouts/shared/RemoveButton.d.ts.map +1 -0
  149. package/dist/esm/components/Collection/layouts/shared/RemoveButton.js +30 -0
  150. package/dist/esm/components/Collection/layouts/shared/RemoveButton.js.map +1 -0
  151. package/dist/esm/components/Collection/layouts/shared/columnUtils.d.ts +8 -0
  152. package/dist/esm/components/Collection/layouts/shared/columnUtils.d.ts.map +1 -0
  153. package/dist/esm/components/Collection/layouts/shared/columnUtils.js +17 -0
  154. package/dist/esm/components/Collection/layouts/shared/columnUtils.js.map +1 -0
  155. package/dist/esm/components/Collection/layouts/shared/headerUtils.d.ts +8 -0
  156. package/dist/esm/components/Collection/layouts/shared/headerUtils.d.ts.map +1 -0
  157. package/dist/esm/components/Collection/layouts/shared/headerUtils.js +14 -0
  158. package/dist/esm/components/Collection/layouts/shared/headerUtils.js.map +1 -0
  159. package/dist/esm/components/Collection/layouts/shared/itemRenderer.d.ts +78 -0
  160. package/dist/esm/components/Collection/layouts/shared/itemRenderer.d.ts.map +1 -0
  161. package/dist/esm/components/Collection/layouts/shared/itemRenderer.js +150 -0
  162. package/dist/esm/components/Collection/layouts/shared/itemRenderer.js.map +1 -0
  163. package/dist/esm/components/Collection/layouts/shared/layoutConstants.d.ts +38 -0
  164. package/dist/esm/components/Collection/layouts/shared/layoutConstants.d.ts.map +1 -0
  165. package/dist/esm/components/Collection/layouts/shared/layoutConstants.js +18 -0
  166. package/dist/esm/components/Collection/layouts/shared/layoutConstants.js.map +1 -0
  167. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayout.d.ts +12 -0
  168. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayout.d.ts.map +1 -0
  169. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayout.js +11 -0
  170. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayout.js.map +1 -0
  171. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayout.module.css +35 -0
  172. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayoutBody.d.ts +6 -0
  173. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayoutBody.d.ts.map +1 -0
  174. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayoutBody.js +103 -0
  175. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayoutBody.js.map +1 -0
  176. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayoutHeader.d.ts +10 -0
  177. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayoutHeader.d.ts.map +1 -0
  178. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayoutHeader.js +6 -0
  179. package/dist/esm/components/Collection/layouts/vertical-layout/VerticalLayoutHeader.js.map +1 -0
  180. package/dist/esm/components/CopyToClipboard/CopyToClipboard.js +1 -0
  181. package/dist/esm/components/CopyToClipboard/CopyToClipboard.js.map +1 -1
  182. package/dist/esm/hooks/useParentHeight.d.ts.map +1 -1
  183. package/dist/esm/hooks/useParentHeight.js +5 -4
  184. package/dist/esm/hooks/useParentHeight.js.map +1 -1
  185. package/dist/esm/index.d.ts +2 -0
  186. package/dist/esm/index.d.ts.map +1 -1
  187. package/dist/esm/index.js.map +1 -1
  188. package/package.json +3 -3
  189. package/src/components/Checkbox/Checkbox.ts +1 -0
  190. package/src/components/CodeEditor/CodeEditor.tsx +2 -8
  191. package/src/components/CodeEditor/__tests__/CodeEditor.spec.tsx +18 -0
  192. package/src/components/Collection/Collection.module.css +13 -1
  193. package/src/components/Collection/Collection.tsx +149 -50
  194. package/src/components/Collection/CollectionAddButton.tsx +42 -0
  195. package/src/components/Collection/CollectionColumn.types.ts +79 -0
  196. package/src/components/Collection/CollectionContext.ts +5 -0
  197. package/src/components/Collection/CollectionItem.tsx +10 -21
  198. package/src/components/Collection/__tests__/CollectionWithColumns.spec.tsx +560 -0
  199. package/src/components/Collection/layouts/CollectionLayout.types.ts +56 -0
  200. package/src/components/Collection/layouts/CollectionLayouts.tsx +15 -0
  201. package/src/components/Collection/layouts/horizontal-layout/HorizontalLayout.module.css +37 -0
  202. package/src/components/Collection/layouts/horizontal-layout/HorizontalLayout.tsx +9 -0
  203. package/src/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.tsx +68 -0
  204. package/src/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.tsx +33 -0
  205. package/src/components/Collection/layouts/shared/DragHandle.tsx +22 -0
  206. package/src/components/Collection/layouts/shared/RemoveButton.tsx +30 -0
  207. package/src/components/Collection/layouts/shared/columnUtils.ts +20 -0
  208. package/src/components/Collection/layouts/shared/headerUtils.ts +14 -0
  209. package/src/components/Collection/layouts/shared/itemRenderer.tsx +242 -0
  210. package/src/components/Collection/layouts/shared/layoutConstants.ts +51 -0
  211. package/src/components/Collection/layouts/vertical-layout/VerticalLayout.module.css +35 -0
  212. package/src/components/Collection/layouts/vertical-layout/VerticalLayout.tsx +9 -0
  213. package/src/components/Collection/layouts/vertical-layout/VerticalLayoutBody.tsx +120 -0
  214. package/src/components/Collection/layouts/vertical-layout/VerticalLayoutHeader.tsx +8 -0
  215. package/src/components/CopyToClipboard/CopyToClipboard.tsx +2 -0
  216. package/src/hooks/__tests__/useParentHeight.spec.tsx +150 -0
  217. package/src/hooks/useParentHeight.ts +6 -3
  218. package/src/index.ts +11 -0
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "CollectionAddButton", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return CollectionAddButton;
9
+ }
10
+ });
11
+ var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
12
+ var _jsxruntime = require("react/jsx-runtime");
13
+ var _plasmareacticons = require("@coveord/plasma-react-icons");
14
+ var _core = require("@mantine/core");
15
+ var _Button = require("../Button/Button.js");
16
+ var _Collectionmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Collection.module.css"));
17
+ var CollectionAddButton = function(param) {
18
+ var addLabel = param.addLabel, addDisabledTooltip = param.addDisabledTooltip, addAllowed = param.addAllowed, onAdd = param.onAdd;
19
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Box, {
20
+ className: _Collectionmodulecss.default.addButtonContainer,
21
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Button.Button.Quaternary, {
22
+ leftSection: /*#__PURE__*/ (0, _jsxruntime.jsx)(_plasmareacticons.IconPlus, {
23
+ size: 16
24
+ }),
25
+ onClick: onAdd,
26
+ disabled: !addAllowed,
27
+ disabledTooltip: addDisabledTooltip,
28
+ children: addLabel
29
+ })
30
+ });
31
+ };
32
+
33
+ //# sourceMappingURL=CollectionAddButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/Collection/CollectionAddButton.tsx"],"sourcesContent":["import {IconPlus} from '@coveord/plasma-react-icons';\nimport {Box} from '@mantine/core';\nimport {ReactNode} from 'react';\n\nimport {Button} from '../Button/Button.js';\nimport classes from './Collection.module.css';\n\nexport interface CollectionAddButtonProps {\n /**\n * The label of the add item button\n *\n * @default \"Add item\"\n */\n addLabel?: ReactNode;\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 * Whether the add button is allowed/enabled\n */\n addAllowed: boolean;\n /**\n * Callback when the add button is clicked\n */\n onAdd: () => void;\n}\n\nexport const CollectionAddButton = ({addLabel, addDisabledTooltip, addAllowed, onAdd}: CollectionAddButtonProps) => (\n <Box className={classes.addButtonContainer}>\n <Button.Quaternary\n leftSection={<IconPlus size={16} />}\n onClick={onAdd}\n disabled={!addAllowed}\n disabledTooltip={addDisabledTooltip}\n >\n {addLabel}\n </Button.Quaternary>\n </Box>\n);\n"],"names":["CollectionAddButton","addLabel","addDisabledTooltip","addAllowed","onAdd","Box","className","classes","addButtonContainer","Button","Quaternary","leftSection","IconPlus","size","onClick","disabled","disabledTooltip"],"mappings":";;;;+BA8BaA;;;eAAAA;;;;;gCA9BU;oBACL;sBAGG;4EACD;AAyBb,IAAMA,sBAAsB;QAAEC,iBAAAA,UAAUC,2BAAAA,oBAAoBC,mBAAAA,YAAYC,cAAAA;yBAC3E,qBAACC,SAAG;QAACC,WAAWC,4BAAO,CAACC,kBAAkB;kBACtC,cAAA,qBAACC,cAAM,CAACC,UAAU;YACdC,2BAAa,qBAACC,0BAAQ;gBAACC,MAAM;;YAC7BC,SAASV;YACTW,UAAU,CAACZ;YACXa,iBAAiBd;sBAEhBD"}
@@ -0,0 +1,72 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Context provided to header render functions
4
+ */
5
+ export interface CollectionHeaderContext {
6
+ /** Column index */
7
+ index: number;
8
+ }
9
+ /**
10
+ * Context provided to cell render functions.
11
+ *
12
+ * Use `context.disabled` and `context.readOnly` to pass the collection's state to your form inputs:
13
+ * @example
14
+ * ```tsx
15
+ * cell: (item, index, context) => (
16
+ * <TextInput
17
+ * {...form.getInputProps(`items.${index}.name`)}
18
+ * disabled={context.disabled}
19
+ * readOnly={context.readOnly}
20
+ * />
21
+ * )
22
+ * ```
23
+ */
24
+ export interface CollectionCellContext<T = unknown> {
25
+ /** Whether the item can be removed */
26
+ removable?: boolean;
27
+ /** Whether the collection is draggable */
28
+ draggable?: boolean;
29
+ /**
30
+ * Whether the collection is disabled.
31
+ * Pass this to your form inputs: `disabled={context.disabled}`
32
+ */
33
+ disabled?: boolean;
34
+ /**
35
+ * Whether the collection is read-only.
36
+ * Pass this to your form inputs: `readOnly={context.readOnly}`
37
+ */
38
+ readOnly?: boolean;
39
+ /** Callback to remove the item */
40
+ onRemove?: () => void;
41
+ }
42
+ /**
43
+ * Column definition for Collection component
44
+ */
45
+ export interface CollectionColumnDef<T = unknown> {
46
+ /**
47
+ * Column header content
48
+ * Can be a ReactNode or a function that receives header context
49
+ */
50
+ header?: ReactNode | ((context: CollectionHeaderContext) => ReactNode);
51
+ /**
52
+ * Cell render function
53
+ * @param item The current item's data
54
+ * @param index The current item's index
55
+ * @param context Additional context for rendering
56
+ */
57
+ cell: (item: T, index: number, context: CollectionCellContext<T>) => ReactNode;
58
+ /**
59
+ * Minimum column size
60
+ */
61
+ minSize?: string | number;
62
+ /**
63
+ * Maximum column size
64
+ */
65
+ maxSize?: string | number;
66
+ /**
67
+ * Unique identifier for the column
68
+ * Auto-generated if not provided
69
+ */
70
+ id?: string;
71
+ }
72
+ //# sourceMappingURL=CollectionColumn.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionColumn.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Collection/CollectionColumn.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAEhC;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,OAAO;IAC9C,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,OAAO;IAC5C;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,uBAAuB,KAAK,SAAS,CAAC,CAAC;IAEvE;;;;;OAKG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;IAE/E;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE1B;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //# sourceMappingURL=CollectionColumn.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/Collection/CollectionColumn.types.ts"],"names":[],"mappings":""}
@@ -1,7 +1,12 @@
1
1
  import { type GetStylesApi } from '@mantine/core';
2
2
  import type { CollectionFactory } from './Collection.js';
3
+ import type { CollectionColumnDef } from './CollectionColumn.types.js';
3
4
  interface CollectionContextType {
4
5
  getStyles: GetStylesApi<CollectionFactory>;
6
+ /**
7
+ * Column definitions for the collection (only present when using column-based layout)
8
+ */
9
+ columns?: Array<CollectionColumnDef<unknown>>;
5
10
  }
6
11
  export declare const CollectionProvider: ({ children, value }: {
7
12
  value: CollectionContextType;
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionContext.d.ts","sourceRoot":"","sources":["../../../../src/components/Collection/CollectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,YAAY,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,UAAU,qBAAqB;IAC3B,SAAS,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;CAC9C;AAED,eAAO,MAAO,kBAAkB;;;kDAAE,oBAAoB,6BAErD,CAAC"}
1
+ {"version":3,"file":"CollectionContext.d.ts","sourceRoot":"","sources":["../../../../src/components/Collection/CollectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,YAAY,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAErE,UAAU,qBAAqB;IAC3B,SAAS,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAC3C;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC;CACjD;AAED,eAAO,MAAO,kBAAkB;;;kDAAE,oBAAoB,6BAErD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Collection/CollectionContext.ts"],"sourcesContent":["import {createSafeContext, type GetStylesApi} from '@mantine/core';\nimport type {CollectionFactory} from './Collection.js';\n\ninterface CollectionContextType {\n getStyles: GetStylesApi<CollectionFactory>;\n}\n\nexport const [CollectionProvider, useCollectionContext] = createSafeContext<CollectionContextType>(\n 'Collection component was not found in tree',\n);\n"],"names":["CollectionProvider","useCollectionContext","createSafeContext"],"mappings":";;;;;;;;;;;QAOcA;eAAAA;;QAAoBC;eAAAA;;;;oBAPiB;IAOOC,wCAAAA,IAAAA,uBAAiB,EACvE;AADG,IAAOF,qBAA4CE,uBAAxBD,uBAAwBC"}
1
+ {"version":3,"sources":["../../../../src/components/Collection/CollectionContext.ts"],"sourcesContent":["import {createSafeContext, type GetStylesApi} from '@mantine/core';\nimport type {CollectionFactory} from './Collection.js';\nimport type {CollectionColumnDef} from './CollectionColumn.types.js';\n\ninterface CollectionContextType {\n getStyles: GetStylesApi<CollectionFactory>;\n /**\n * Column definitions for the collection (only present when using column-based layout)\n */\n columns?: Array<CollectionColumnDef<unknown>>;\n}\n\nexport const [CollectionProvider, useCollectionContext] = createSafeContext<CollectionContextType>(\n 'Collection component was not found in tree',\n);\n"],"names":["CollectionProvider","useCollectionContext","createSafeContext"],"mappings":";;;;;;;;;;;QAYcA;eAAAA;;QAAoBC;eAAAA;;;;oBAZiB;IAYOC,wCAAAA,IAAAA,uBAAiB,EACvE;AADG,IAAOF,qBAA4CE,uBAAxBD,uBAAwBC"}
@@ -1,12 +1,12 @@
1
1
  import { GroupProps } from '@mantine/core';
2
- import { FunctionComponent, PropsWithChildren } from 'react';
2
+ import { FunctionComponent, type MouseEventHandler, PropsWithChildren } from 'react';
3
3
  interface CollectionItemProps extends CollectionItemSharedProps {
4
4
  draggable?: boolean;
5
5
  disabled: boolean;
6
6
  }
7
7
  interface CollectionItemSharedProps extends GroupProps {
8
8
  id: string;
9
- onRemove?: React.MouseEventHandler<HTMLButtonElement>;
9
+ onRemove?: MouseEventHandler<HTMLButtonElement>;
10
10
  removable?: boolean;
11
11
  }
12
12
  export declare const CollectionItem: FunctionComponent<PropsWithChildren<CollectionItemProps>>;
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Collection/CollectionItem.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAQ,UAAU,EAAW,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAK3D,UAAU,mBAAoB,SAAQ,yBAAyB;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,yBAA0B,SAAQ,UAAU;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAoHD,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAYpF,CAAC"}
1
+ {"version":3,"file":"CollectionItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Collection/CollectionItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,UAAU,EAAW,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAMnF,UAAU,mBAAoB,SAAQ,yBAAyB;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,yBAA0B,SAAQ,UAAU;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAyGD,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAYpF,CAAC"}
@@ -12,36 +12,16 @@ var _object_spread = require("@swc/helpers/_/_object_spread");
12
12
  var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
13
13
  var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
14
14
  var _jsxruntime = require("react/jsx-runtime");
15
- var _plasmareacticons = require("@coveord/plasma-react-icons");
16
15
  var _sortable = require("@dnd-kit/sortable");
17
16
  var _utilities = require("@dnd-kit/utilities");
18
17
  var _core = require("@mantine/core");
19
- var _ActionIcon = require("../ActionIcon/ActionIcon.js");
20
18
  var _CollectionContext = require("./CollectionContext.js");
19
+ var _DragHandle = require("./layouts/shared/DragHandle.js");
20
+ var _RemoveButton = require("./layouts/shared/RemoveButton.js");
21
21
  var defaultProps = {
22
22
  removable: true,
23
23
  gap: 'sm'
24
24
  };
25
- var RemoveButton = function(param) {
26
- var onClick = param.onClick;
27
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_ActionIcon.ActionIcon.Quaternary, {
28
- style: {
29
- alignSelf: 'center'
30
- },
31
- onClick: onClick,
32
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_plasmareacticons.IconTrash, {
33
- "aria-label": "Remove",
34
- size: 16
35
- })
36
- });
37
- };
38
- var RemoveButtonPlaceholder = function() {
39
- return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
40
- style: {
41
- width: 28
42
- }
43
- });
44
- };
45
25
  var StaticCollectionItem = function(props) {
46
26
  var _useProps = (0, _core.useProps)('CollectionItem', defaultProps, props), children = _useProps.children, removable = _useProps.removable, onRemove = _useProps.onRemove, id = _useProps.id, // Style props
47
27
  style = _useProps.style, className = _useProps.className, classNames = _useProps.classNames, styles = _useProps.styles, others = _object_without_properties._(_useProps, [
@@ -55,9 +35,6 @@ var StaticCollectionItem = function(props) {
55
35
  "styles"
56
36
  ]);
57
37
  var ctx = (0, _CollectionContext.useCollectionContext)();
58
- var removeButton = removable && onRemove ? /*#__PURE__*/ (0, _jsxruntime.jsx)(RemoveButton, {
59
- onClick: onRemove
60
- }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(RemoveButtonPlaceholder, {});
61
38
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_core.Group, _object_spread_props._(_object_spread._({
62
39
  "data-testid": "item-".concat(id)
63
40
  }, ctx.getStyles('item', {
@@ -68,16 +45,21 @@ var StaticCollectionItem = function(props) {
68
45
  }), others), {
69
46
  children: [
70
47
  children,
71
- removeButton
48
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_RemoveButton.RemoveButton, {
49
+ removable: removable,
50
+ onRemove: onRemove
51
+ })
72
52
  ]
73
53
  }));
74
54
  };
75
55
  var DisabledCollectionItem = function(props) {
76
56
  var ctx = (0, _CollectionContext.useCollectionContext)();
77
- var _useProps = (0, _core.useProps)('CollectionItem', defaultProps, props), children = _useProps.children, id = _useProps.id, // Style props
57
+ var _useProps = (0, _core.useProps)('CollectionItem', defaultProps, props), children = _useProps.children, id = _useProps.id, _removable = _useProps.removable, _onRemove = _useProps.onRemove, // Style props
78
58
  style = _useProps.style, className = _useProps.className, classNames = _useProps.classNames, styles = _useProps.styles, others = _object_without_properties._(_useProps, [
79
59
  "children",
80
60
  "id",
61
+ "removable",
62
+ "onRemove",
81
63
  "style",
82
64
  "className",
83
65
  "classNames",
@@ -106,9 +88,6 @@ var DraggableCollectionItem = function(props) {
106
88
  "classNames",
107
89
  "styles"
108
90
  ]);
109
- var removeButton = removable && onRemove ? /*#__PURE__*/ (0, _jsxruntime.jsx)(RemoveButton, {
110
- onClick: onRemove
111
- }) : null;
112
91
  var _useSortable = (0, _sortable.useSortable)({
113
92
  id: id
114
93
  }), attributes = _useSortable.attributes, listeners = _useSortable.listeners, setNodeRef = _useSortable.setNodeRef, transform = _useSortable.transform, transition = _useSortable.transition, isDragging = _useSortable.isDragging, setActivatorNodeRef = _useSortable.setActivatorNodeRef;
@@ -127,15 +106,16 @@ var DraggableCollectionItem = function(props) {
127
106
  "data-isdragging": isDragging
128
107
  }), others), {
129
108
  children: [
130
- /*#__PURE__*/ (0, _jsxruntime.jsx)("div", _object_spread_props._(_object_spread._({
131
- ref: setActivatorNodeRef
132
- }, listeners, attributes, ctx.getStyles('dragHandle')), {
133
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_plasmareacticons.DragAndDropSize24Px, {
134
- height: 16
135
- })
136
- })),
109
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_DragHandle.DragHandle, {
110
+ setActivatorNodeRef: setActivatorNodeRef,
111
+ listeners: listeners,
112
+ attributes: attributes
113
+ }),
137
114
  children,
138
- removeButton
115
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_RemoveButton.RemoveButton, {
116
+ removable: removable,
117
+ onRemove: onRemove
118
+ })
139
119
  ]
140
120
  }));
141
121
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Collection/CollectionItem.tsx"],"sourcesContent":["import {DragAndDropSize24Px, IconTrash} from '@coveord/plasma-react-icons';\nimport {useSortable} from '@dnd-kit/sortable';\nimport {CSS} from '@dnd-kit/utilities';\nimport {Group, GroupProps, useProps} from '@mantine/core';\nimport {FunctionComponent, PropsWithChildren} from 'react';\n\nimport {ActionIcon} from '../ActionIcon/ActionIcon.js';\nimport {useCollectionContext} from './CollectionContext.js';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends GroupProps {\n id: string;\n onRemove?: React.MouseEventHandler<HTMLButtonElement>;\n removable?: boolean;\n}\n\nconst defaultProps: Partial<CollectionItemSharedProps> = {\n removable: true,\n gap: 'sm',\n};\n\nconst RemoveButton: FunctionComponent<{\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({onClick}) => (\n <ActionIcon.Quaternary style={{alignSelf: 'center'}} onClick={onClick}>\n <IconTrash aria-label=\"Remove\" size={16} />\n </ActionIcon.Quaternary>\n);\n\nconst RemoveButtonPlaceholder = () => <div style={{width: 28}} />;\n\nconst StaticCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = (props) => {\n const {\n children,\n removable,\n onRemove,\n id,\n\n // Style props\n style,\n className,\n classNames,\n styles,\n ...others\n } = useProps('CollectionItem', defaultProps, props);\n const ctx = useCollectionContext();\n const removeButton = removable && onRemove ? <RemoveButton onClick={onRemove} /> : <RemoveButtonPlaceholder />;\n\n return (\n <Group\n data-testid={`item-${id}`}\n {...ctx.getStyles('item', {style, className, classNames, styles})}\n {...others}\n >\n {children}\n {removeButton}\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = (props) => {\n const ctx = useCollectionContext();\n const {\n children,\n id,\n\n // Style props\n style,\n className,\n classNames,\n styles,\n ...others\n } = useProps('CollectionItem', defaultProps, props);\n return (\n <Group\n data-testid={`item-${id}`}\n {...ctx.getStyles('item', {style, className, classNames, styles})}\n {...others}\n >\n {children}\n </Group>\n );\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = (props) => {\n const ctx = useCollectionContext();\n const {\n children,\n removable,\n onRemove,\n id,\n\n // Style props\n className,\n classNames,\n styles,\n ...others\n } = useProps('CollectionItem', defaultProps, props);\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 data-testid={`item-${id}`}\n ref={setNodeRef}\n {...ctx.getStyles('item', {\n style: transform\n ? {\n transform: CSS.Transform.toString(transform),\n transition,\n }\n : undefined,\n className,\n classNames,\n styles,\n })}\n data-isdragging={isDragging}\n {...others}\n >\n <div ref={setActivatorNodeRef} {...listeners} {...attributes} {...ctx.getStyles('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":["CollectionItem","defaultProps","removable","gap","RemoveButton","onClick","ActionIcon","Quaternary","style","alignSelf","IconTrash","aria-label","size","RemoveButtonPlaceholder","div","width","StaticCollectionItem","props","useProps","children","onRemove","id","className","classNames","styles","others","ctx","useCollectionContext","removeButton","Group","data-testid","getStyles","DisabledCollectionItem","DraggableCollectionItem","useSortable","attributes","listeners","setNodeRef","transform","transition","isDragging","setActivatorNodeRef","ref","CSS","Transform","toString","undefined","data-isdragging","DragAndDropSize24Px","height","draggable","disabled","otherProps"],"mappings":"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"}
1
+ {"version":3,"sources":["../../../../src/components/Collection/CollectionItem.tsx"],"sourcesContent":["import {useSortable} from '@dnd-kit/sortable';\nimport {CSS} from '@dnd-kit/utilities';\nimport {Group, GroupProps, useProps} from '@mantine/core';\nimport {FunctionComponent, type MouseEventHandler, PropsWithChildren} from 'react';\n\nimport {useCollectionContext} from './CollectionContext.js';\nimport {DragHandle} from './layouts/shared/DragHandle.js';\nimport {RemoveButton} from './layouts/shared/RemoveButton.js';\n\ninterface CollectionItemProps extends CollectionItemSharedProps {\n draggable?: boolean;\n disabled: boolean;\n}\n\ninterface CollectionItemSharedProps extends GroupProps {\n id: string;\n onRemove?: MouseEventHandler<HTMLButtonElement>;\n removable?: boolean;\n}\n\nconst defaultProps: Partial<CollectionItemSharedProps> = {\n removable: true,\n gap: 'sm',\n};\n\nconst StaticCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = (props) => {\n const {\n children,\n removable,\n onRemove,\n id,\n\n // Style props\n style,\n className,\n classNames,\n styles,\n ...others\n } = useProps('CollectionItem', defaultProps, props);\n const ctx = useCollectionContext();\n\n return (\n <Group\n data-testid={`item-${id}`}\n {...ctx.getStyles('item', {style, className, classNames, styles})}\n {...others}\n >\n {children}\n <RemoveButton removable={removable} onRemove={onRemove} />\n </Group>\n );\n};\n\nconst DisabledCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = (props) => {\n const ctx = useCollectionContext();\n const {\n children,\n id,\n removable: _removable,\n onRemove: _onRemove,\n\n // Style props\n style,\n className,\n classNames,\n styles,\n ...others\n } = useProps('CollectionItem', defaultProps, props);\n return (\n <Group\n data-testid={`item-${id}`}\n {...ctx.getStyles('item', {style, className, classNames, styles})}\n {...others}\n >\n {children}\n </Group>\n );\n};\n\nconst DraggableCollectionItem: FunctionComponent<PropsWithChildren<CollectionItemSharedProps>> = (props) => {\n const ctx = useCollectionContext();\n const {\n children,\n removable,\n onRemove,\n id,\n\n // Style props\n className,\n classNames,\n styles,\n ...others\n } = useProps('CollectionItem', defaultProps, props);\n\n const {attributes, listeners, setNodeRef, transform, transition, isDragging, setActivatorNodeRef} = useSortable({\n id,\n });\n\n return (\n <Group\n data-testid={`item-${id}`}\n ref={setNodeRef}\n {...ctx.getStyles('item', {\n style: transform\n ? {\n transform: CSS.Transform.toString(transform),\n transition,\n }\n : undefined,\n className,\n classNames,\n styles,\n })}\n data-isdragging={isDragging}\n {...others}\n >\n <DragHandle setActivatorNodeRef={setActivatorNodeRef} listeners={listeners} attributes={attributes} />\n {children}\n <RemoveButton removable={removable} onRemove={onRemove} />\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":["CollectionItem","defaultProps","removable","gap","StaticCollectionItem","props","useProps","children","onRemove","id","style","className","classNames","styles","others","ctx","useCollectionContext","Group","data-testid","getStyles","RemoveButton","DisabledCollectionItem","_removable","_onRemove","DraggableCollectionItem","useSortable","attributes","listeners","setNodeRef","transform","transition","isDragging","setActivatorNodeRef","ref","CSS","Transform","toString","undefined","data-isdragging","DragHandle","draggable","disabled","otherProps"],"mappings":"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"}
@@ -0,0 +1,46 @@
1
+ import type { MantineSpacing } from '@mantine/core';
2
+ import { ReactElement, ReactNode } from 'react';
3
+ /**
4
+ * Props passed to layout Header component
5
+ */
6
+ export interface CollectionLayoutHeaderProps {
7
+ /** Whether drag and drop is enabled */
8
+ draggable?: boolean;
9
+ /** Whether items are removable */
10
+ removable?: boolean;
11
+ }
12
+ /**
13
+ * Props passed to layout Body component
14
+ */
15
+ export interface CollectionLayoutBodyProps<T = unknown> {
16
+ /** Items to render */
17
+ items: T[];
18
+ /** Callback to remove an item */
19
+ onRemove?: (index: number) => void;
20
+ /** Whether items are removable */
21
+ removable?: boolean;
22
+ /** Whether drag and drop is enabled */
23
+ draggable?: boolean;
24
+ /** Whether the collection is disabled */
25
+ disabled?: boolean;
26
+ /** Function to get unique ID for each item */
27
+ getItemId?: (item: T, index: number) => string;
28
+ /** Gap between items */
29
+ gap?: MantineSpacing;
30
+ }
31
+ /**
32
+ * Collection Layout interface
33
+ * Follows the same pattern as Table's RowLayout
34
+ */
35
+ export interface CollectionLayout {
36
+ (props: {
37
+ children: ReactNode;
38
+ }): ReactElement;
39
+ /** Layout display name */
40
+ displayName: string;
41
+ /** Header component - renders column headers */
42
+ Header: (props: CollectionLayoutHeaderProps) => ReactElement | null;
43
+ /** Body component - renders rows/items */
44
+ Body: <TData>(props: CollectionLayoutBodyProps<TData>) => ReactElement;
45
+ }
46
+ //# sourceMappingURL=CollectionLayout.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionLayout.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/Collection/layouts/CollectionLayout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,kCAAkC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB,CAAC,CAAC,GAAG,OAAO;IAClD,sBAAsB;IACtB,KAAK,EAAE,CAAC,EAAE,CAAC;IAEX,iCAAiC;IACjC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC,kCAAkC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAE/C,wBAAwB;IACxB,GAAG,CAAC,EAAE,cAAc,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,CAAC,KAAK,EAAE;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAC,GAAG,YAAY,CAAC;IAE7C,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC;IAEpB,gDAAgD;IAChD,MAAM,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,YAAY,GAAG,IAAI,CAAC;IAEpE,0CAA0C;IAC1C,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,yBAAyB,CAAC,KAAK,CAAC,KAAK,YAAY,CAAC;CAC1E"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+
6
+ //# sourceMappingURL=CollectionLayout.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/Collection/layouts/CollectionLayout.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ export declare const CollectionLayouts: {
2
+ readonly Horizontal: {
3
+ ({ children }: import("./shared/layoutConstants.js").LayoutProps): import("react/jsx-runtime.js").JSX.Element;
4
+ Body: <T>(props: import("./shared/layoutConstants.js").LayoutBodyProps<T> & {
5
+ ref?: import("react").ForwardedRef<HTMLDivElement>;
6
+ }) => import("react/jsx-runtime.js").JSX.Element;
7
+ Header: (props: import("./shared/layoutConstants.js").LayoutHeaderProps & {
8
+ ref?: import("react").ForwardedRef<HTMLDivElement>;
9
+ }) => import("react/jsx-runtime.js").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ readonly Vertical: {
13
+ ({ children }: import("./shared/layoutConstants.js").LayoutProps): import("react/jsx-runtime.js").JSX.Element;
14
+ Body: <T>(props: import("./shared/layoutConstants.js").LayoutBodyProps<T> & {
15
+ ref?: import("react").ForwardedRef<HTMLDivElement>;
16
+ }) => import("react/jsx-runtime.js").JSX.Element;
17
+ Header: (_props: import("./shared/layoutConstants.js").LayoutHeaderProps & {
18
+ ref?: import("react").ForwardedRef<HTMLDivElement>;
19
+ }) => null;
20
+ displayName: string;
21
+ };
22
+ };
23
+ export { HorizontalLayout } from './horizontal-layout/HorizontalLayout.js';
24
+ export { VerticalLayout } from './vertical-layout/VerticalLayout.js';
25
+ export type { CollectionLayout, CollectionLayoutBodyProps, CollectionLayoutHeaderProps, } from './CollectionLayout.types.js';
26
+ //# sourceMappingURL=CollectionLayouts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionLayouts.d.ts","sourceRoot":"","sources":["../../../../../src/components/Collection/layouts/CollectionLayouts.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB;;;;eAY2xB,CAAC;;;eAA5xB,CAAC;;;;;;;eAAgyF,CAAC;;;eANh0F,CAAC;;;;CAHS,CAAC;AAEX,OAAO,EAAC,gBAAgB,EAAC,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAC;AACnE,YAAY,EACR,gBAAgB,EAChB,yBAAyB,EACzB,2BAA2B,GAC9B,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
+ });
10
+ }
11
+ _export(exports, {
12
+ get CollectionLayouts () {
13
+ return CollectionLayouts;
14
+ },
15
+ get HorizontalLayout () {
16
+ return _HorizontalLayout.HorizontalLayout;
17
+ },
18
+ get VerticalLayout () {
19
+ return _VerticalLayout.VerticalLayout;
20
+ }
21
+ });
22
+ var _HorizontalLayout = require("./horizontal-layout/HorizontalLayout.js");
23
+ var _VerticalLayout = require("./vertical-layout/VerticalLayout.js");
24
+ var CollectionLayouts = {
25
+ Horizontal: _HorizontalLayout.HorizontalLayout,
26
+ Vertical: _VerticalLayout.VerticalLayout
27
+ };
28
+
29
+ //# sourceMappingURL=CollectionLayouts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/Collection/layouts/CollectionLayouts.tsx"],"sourcesContent":["import {HorizontalLayout} from './horizontal-layout/HorizontalLayout.js';\nimport {VerticalLayout} from './vertical-layout/VerticalLayout.js';\n\nexport const CollectionLayouts = {\n Horizontal: HorizontalLayout,\n Vertical: VerticalLayout,\n} as const;\n\nexport {HorizontalLayout} from './horizontal-layout/HorizontalLayout.js';\nexport {VerticalLayout} from './vertical-layout/VerticalLayout.js';\nexport type {\n CollectionLayout,\n CollectionLayoutBodyProps,\n CollectionLayoutHeaderProps,\n} from './CollectionLayout.types.js';\n"],"names":["CollectionLayouts","HorizontalLayout","VerticalLayout","Horizontal","Vertical"],"mappings":";;;;;;;;;;;QAGaA;eAAAA;;QAKLC;eAAAA,kCAAgB;;QAChBC;eAAAA,8BAAc;;;gCATS;8BACF;AAEtB,IAAMF,oBAAoB;IAC7BG,YAAYF,kCAAgB;IAC5BG,UAAUF,8BAAc;AAC5B"}
@@ -0,0 +1,12 @@
1
+ import { LayoutProps } from '../shared/layoutConstants.js';
2
+ export declare const HorizontalLayout: {
3
+ ({ children }: LayoutProps): import("react/jsx-runtime.js").JSX.Element;
4
+ Body: <T>(props: import("../shared/layoutConstants.js").LayoutBodyProps<T> & {
5
+ ref?: import("react").ForwardedRef<HTMLDivElement>;
6
+ }) => import("react/jsx-runtime.js").JSX.Element;
7
+ Header: (props: import("../shared/layoutConstants.js").LayoutHeaderProps & {
8
+ ref?: import("react").ForwardedRef<HTMLDivElement>;
9
+ }) => import("react/jsx-runtime.js").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ //# sourceMappingURL=HorizontalLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HorizontalLayout.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Collection/layouts/horizontal-layout/HorizontalLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,eAAO,MAAM,gBAAgB;mBAAgB,WAAW;;WAK63B,CAAC;;;WAA5xB,CAAC;;;CAL/E,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "HorizontalLayout", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return HorizontalLayout;
9
+ }
10
+ });
11
+ var _jsxruntime = require("react/jsx-runtime");
12
+ var _HorizontalLayoutBody = require("./HorizontalLayoutBody.js");
13
+ var _HorizontalLayoutHeader = require("./HorizontalLayoutHeader.js");
14
+ var HorizontalLayout = function(param) {
15
+ var children = param.children;
16
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
17
+ children: children
18
+ });
19
+ };
20
+ HorizontalLayout.Body = _HorizontalLayoutBody.HorizontalLayoutBody;
21
+ HorizontalLayout.Header = _HorizontalLayoutHeader.HorizontalLayoutHeader;
22
+ HorizontalLayout.displayName = 'Horizontal';
23
+
24
+ //# sourceMappingURL=HorizontalLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/components/Collection/layouts/horizontal-layout/HorizontalLayout.tsx"],"sourcesContent":["import {LayoutProps} from '../shared/layoutConstants.js';\nimport {HorizontalLayoutBody} from './HorizontalLayoutBody.js';\nimport {HorizontalLayoutHeader} from './HorizontalLayoutHeader.js';\n\nexport const HorizontalLayout = ({children}: LayoutProps) => <>{children}</>;\n\nHorizontalLayout.Body = HorizontalLayoutBody;\nHorizontalLayout.Header = HorizontalLayoutHeader;\nHorizontalLayout.displayName = 'Horizontal';\n"],"names":["HorizontalLayout","children","Body","HorizontalLayoutBody","Header","HorizontalLayoutHeader","displayName"],"mappings":";;;;+BAIaA;;;eAAAA;;;;oCAHsB;sCACE;AAE9B,IAAMA,mBAAmB;QAAEC,iBAAAA;yBAA2B;kBAAGA;;;AAEhED,iBAAiBE,IAAI,GAAGC,0CAAoB;AAC5CH,iBAAiBI,MAAM,GAAGC,8CAAsB;AAChDL,iBAAiBM,WAAW,GAAG"}
@@ -0,0 +1,37 @@
1
+ .headerRow {
2
+ display: flex;
3
+ gap: var(--mantine-spacing-sm);
4
+ padding-bottom: var(--mantine-spacing-xs);
5
+ align-items: center;
6
+ }
7
+
8
+ .headerCell {
9
+ flex: 1;
10
+ font-weight: var(--coveo-fw-bold);
11
+ text-align: left;
12
+ }
13
+
14
+ .dragHandleHeader {
15
+ width: var(--mantine-spacing-sm);
16
+ flex-shrink: 0;
17
+ }
18
+
19
+ .removeButtonHeader {
20
+ width: calc(var(--mantine-spacing-md) + var(--mantine-spacing-sm));
21
+ flex-shrink: 0;
22
+ }
23
+
24
+ .row {
25
+ display: flex;
26
+ gap: var(--mantine-spacing-sm);
27
+ align-items: center;
28
+ background: var(--mantine-color-body);
29
+ }
30
+
31
+ .row[data-isdragging='true'] {
32
+ z-index: 1;
33
+ }
34
+
35
+ .cell {
36
+ flex: 1;
37
+ }
@@ -0,0 +1,6 @@
1
+ import { ForwardedRef } from 'react';
2
+ import { LayoutBodyProps } from '../shared/layoutConstants.js';
3
+ export declare const HorizontalLayoutBody: <T>(props: LayoutBodyProps<T> & {
4
+ ref?: ForwardedRef<HTMLDivElement>;
5
+ }) => import("react/jsx-runtime.js").JSX.Element;
6
+ //# sourceMappingURL=HorizontalLayoutBody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HorizontalLayoutBody.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAU,MAAM,OAAO,CAAC;AAI5C,OAAO,EAA4B,eAAe,EAAC,MAAM,8BAA8B,CAAC;AA8BxF,eAAO,MAAM,oBAAoB,GAAI,CAAC,EAAG,OAAO,eAAe,CAAC,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;CAAC,+CAgCxG,CAAC"}