@42-central/ui-react 0.26.0 → 0.28.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 (220) hide show
  1. package/dist/{chunk-YZJUPYPO.js → chunk-2W7H43WL.js} +3 -3
  2. package/dist/{chunk-YZJUPYPO.js.map → chunk-2W7H43WL.js.map} +1 -1
  3. package/dist/{chunk-OVT2KZHY.js → chunk-3KARNPW4.js} +3 -3
  4. package/dist/{chunk-OVT2KZHY.js.map → chunk-3KARNPW4.js.map} +1 -1
  5. package/dist/chunk-6B2GNPJP.js +43 -0
  6. package/dist/chunk-6B2GNPJP.js.map +1 -0
  7. package/dist/{chunk-E52Z2FKU.js → chunk-7BY5I2RB.js} +3 -3
  8. package/dist/{chunk-E52Z2FKU.js.map → chunk-7BY5I2RB.js.map} +1 -1
  9. package/dist/{chunk-JFB6O7IY.js → chunk-7KFUFAVP.js} +4 -4
  10. package/dist/{chunk-JFB6O7IY.js.map → chunk-7KFUFAVP.js.map} +1 -1
  11. package/dist/{chunk-X3YIHN2U.js → chunk-ASKQ6N5V.js} +3 -3
  12. package/dist/{chunk-X3YIHN2U.js.map → chunk-ASKQ6N5V.js.map} +1 -1
  13. package/dist/{chunk-6IRMKF5T.js → chunk-B4GNSSHU.js} +4 -4
  14. package/dist/{chunk-6IRMKF5T.js.map → chunk-B4GNSSHU.js.map} +1 -1
  15. package/dist/{chunk-BMEJBY6H.js → chunk-B5YHYI7E.js} +22 -27
  16. package/dist/chunk-B5YHYI7E.js.map +1 -0
  17. package/dist/{chunk-PT22KEVD.js → chunk-BGDVUC3B.js} +5 -5
  18. package/dist/{chunk-PT22KEVD.js.map → chunk-BGDVUC3B.js.map} +1 -1
  19. package/dist/{chunk-7247WBTV.js → chunk-DJ72KP32.js} +3 -3
  20. package/dist/{chunk-7247WBTV.js.map → chunk-DJ72KP32.js.map} +1 -1
  21. package/dist/{chunk-7OGZT7U2.js → chunk-G3AD3NJG.js} +3 -3
  22. package/dist/{chunk-7OGZT7U2.js.map → chunk-G3AD3NJG.js.map} +1 -1
  23. package/dist/{chunk-276RL7FX.js → chunk-GJFCIG34.js} +8 -8
  24. package/dist/{chunk-276RL7FX.js.map → chunk-GJFCIG34.js.map} +1 -1
  25. package/dist/{chunk-JDPVD2YE.js → chunk-HCHGERDB.js} +3 -3
  26. package/dist/{chunk-JDPVD2YE.js.map → chunk-HCHGERDB.js.map} +1 -1
  27. package/dist/{chunk-H7WOMZXO.js → chunk-HWBFRDX7.js} +16 -8
  28. package/dist/chunk-HWBFRDX7.js.map +1 -0
  29. package/dist/{chunk-LYGOFMXJ.js → chunk-I4IJOLNA.js} +4 -4
  30. package/dist/{chunk-LYGOFMXJ.js.map → chunk-I4IJOLNA.js.map} +1 -1
  31. package/dist/{chunk-7B44J3CF.js → chunk-I53TMAV2.js} +6 -6
  32. package/dist/{chunk-7B44J3CF.js.map → chunk-I53TMAV2.js.map} +1 -1
  33. package/dist/{chunk-DSZF2TW6.js → chunk-IA6DCC3N.js} +6 -6
  34. package/dist/{chunk-DSZF2TW6.js.map → chunk-IA6DCC3N.js.map} +1 -1
  35. package/dist/{chunk-QEAF57ZQ.js → chunk-ISX3AM32.js} +3 -3
  36. package/dist/{chunk-QEAF57ZQ.js.map → chunk-ISX3AM32.js.map} +1 -1
  37. package/dist/{chunk-N42EFOML.js → chunk-K3FZHYJL.js} +6 -6
  38. package/dist/chunk-K3FZHYJL.js.map +1 -0
  39. package/dist/{chunk-ZVECQBGG.js → chunk-KNGSO7A3.js} +41 -13
  40. package/dist/chunk-KNGSO7A3.js.map +1 -0
  41. package/dist/{chunk-NLSJ6T7V.js → chunk-KYVXPSNW.js} +4 -4
  42. package/dist/{chunk-NLSJ6T7V.js.map → chunk-KYVXPSNW.js.map} +1 -1
  43. package/dist/{chunk-J2NW7JID.js → chunk-L5GH7LLD.js} +3 -3
  44. package/dist/{chunk-J2NW7JID.js.map → chunk-L5GH7LLD.js.map} +1 -1
  45. package/dist/{chunk-THGJLR5S.js → chunk-NNPSBC7O.js} +5 -5
  46. package/dist/{chunk-THGJLR5S.js.map → chunk-NNPSBC7O.js.map} +1 -1
  47. package/dist/{chunk-YMVUQ2L7.js → chunk-P7SH3XWY.js} +6 -6
  48. package/dist/chunk-P7SH3XWY.js.map +1 -0
  49. package/dist/{chunk-2CL3FKEY.js → chunk-QEMXXQQO.js} +3 -3
  50. package/dist/{chunk-2CL3FKEY.js.map → chunk-QEMXXQQO.js.map} +1 -1
  51. package/dist/{chunk-2NTCQIRP.js → chunk-QRNQQIQM.js} +5 -5
  52. package/dist/{chunk-2NTCQIRP.js.map → chunk-QRNQQIQM.js.map} +1 -1
  53. package/dist/{chunk-LKFHUDEW.js → chunk-QVOBLRCM.js} +3 -3
  54. package/dist/{chunk-LKFHUDEW.js.map → chunk-QVOBLRCM.js.map} +1 -1
  55. package/dist/{chunk-E3XLWMEB.js → chunk-RKCUXOU2.js} +4 -4
  56. package/dist/{chunk-E3XLWMEB.js.map → chunk-RKCUXOU2.js.map} +1 -1
  57. package/dist/{chunk-DMI4KS32.js → chunk-SBZJGFZ6.js} +3 -3
  58. package/dist/{chunk-DMI4KS32.js.map → chunk-SBZJGFZ6.js.map} +1 -1
  59. package/dist/{chunk-7P32XCEU.js → chunk-SLUOF7XW.js} +2 -2
  60. package/dist/chunk-SLUOF7XW.js.map +1 -0
  61. package/dist/{chunk-SCXXJDKQ.js → chunk-SP6LCCTZ.js} +21 -28
  62. package/dist/chunk-SP6LCCTZ.js.map +1 -0
  63. package/dist/{chunk-Y2G47ARQ.js → chunk-TGGNSSOJ.js} +3 -3
  64. package/dist/{chunk-Y2G47ARQ.js.map → chunk-TGGNSSOJ.js.map} +1 -1
  65. package/dist/{chunk-2TZU4LSX.js → chunk-ULF5LOBS.js} +3 -3
  66. package/dist/{chunk-2TZU4LSX.js.map → chunk-ULF5LOBS.js.map} +1 -1
  67. package/dist/{chunk-D2QIPQ74.js → chunk-W3XX7BYT.js} +2 -2
  68. package/dist/chunk-W3XX7BYT.js.map +1 -0
  69. package/dist/{chunk-F374BNL4.js → chunk-YVTM2KRR.js} +12 -8
  70. package/dist/chunk-YVTM2KRR.js.map +1 -0
  71. package/dist/colors.css +328 -0
  72. package/dist/components/action-icon/action-icon.d.ts +6 -5
  73. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  74. package/dist/components/action-icon/index.js +3 -2
  75. package/dist/components/alert/index.js +2 -2
  76. package/dist/components/app-shell/index.js +7 -6
  77. package/dist/components/app-shell/index.js.map +1 -1
  78. package/dist/components/autocomplete/index.js +4 -4
  79. package/dist/components/badge/badge.d.ts +1 -1
  80. package/dist/components/badge/badge.d.ts.map +1 -1
  81. package/dist/components/badge/index.js +2 -1
  82. package/dist/components/button/button.d.ts +11 -9
  83. package/dist/components/button/button.d.ts.map +1 -1
  84. package/dist/components/button/index.js +3 -2
  85. package/dist/components/button-multi-select/index.js +4 -3
  86. package/dist/components/button-multi-select/index.js.map +1 -1
  87. package/dist/components/button-select/index.js +4 -3
  88. package/dist/components/button-select/index.js.map +1 -1
  89. package/dist/components/calendar/index.js +4 -3
  90. package/dist/components/calendar-heatmap/index.js +2 -2
  91. package/dist/components/camera/index.js +11 -10
  92. package/dist/components/clipboard/index.js +3 -2
  93. package/dist/components/clipboard/index.js.map +1 -1
  94. package/dist/components/code-block/chrome.js +5 -5
  95. package/dist/components/code-block/index.js +6 -6
  96. package/dist/components/combobox/index.js +4 -4
  97. package/dist/components/combobox-list/index.js +6 -6
  98. package/dist/components/data-table/data-table-features.d.ts +8 -0
  99. package/dist/components/data-table/data-table-features.d.ts.map +1 -1
  100. package/dist/components/data-table/data-table-group.d.ts +128 -0
  101. package/dist/components/data-table/data-table-group.d.ts.map +1 -0
  102. package/dist/components/data-table/data-table-grouping.d.ts +72 -0
  103. package/dist/components/data-table/data-table-grouping.d.ts.map +1 -0
  104. package/dist/components/data-table/data-table-icons.d.ts +4 -2
  105. package/dist/components/data-table/data-table-icons.d.ts.map +1 -1
  106. package/dist/components/data-table/data-table-meta.d.ts +9 -0
  107. package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
  108. package/dist/components/data-table/data-table-pagination.d.ts +4 -1
  109. package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
  110. package/dist/components/data-table/data-table-schema.d.ts +4 -0
  111. package/dist/components/data-table/data-table-schema.d.ts.map +1 -1
  112. package/dist/components/data-table/data-table-stack.d.ts +16 -3
  113. package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
  114. package/dist/components/data-table/data-table-toolbar.d.ts +33 -2
  115. package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
  116. package/dist/components/data-table/data-table-translations.d.ts +35 -0
  117. package/dist/components/data-table/data-table-translations.d.ts.map +1 -1
  118. package/dist/components/data-table/data-table.d.ts +55 -3
  119. package/dist/components/data-table/data-table.d.ts.map +1 -1
  120. package/dist/components/data-table/index.d.ts +3 -1
  121. package/dist/components/data-table/index.d.ts.map +1 -1
  122. package/dist/components/data-table/index.js +883 -234
  123. package/dist/components/data-table/index.js.map +1 -1
  124. package/dist/components/date-picker/index.js +12 -11
  125. package/dist/components/date-picker/index.js.map +1 -1
  126. package/dist/components/download-button/index.js +4 -3
  127. package/dist/components/drawer/index.js +7 -6
  128. package/dist/components/file-item/index.js +4 -3
  129. package/dist/components/file-preview/index.js +4 -3
  130. package/dist/components/file-preview/index.js.map +1 -1
  131. package/dist/components/file-trigger/index.js +4 -3
  132. package/dist/components/file-upload/index.js +4 -3
  133. package/dist/components/file-upload/index.js.map +1 -1
  134. package/dist/components/hover-card/index.js +3 -3
  135. package/dist/components/image-cropper/index.js +4 -3
  136. package/dist/components/kbd/index.js +3 -3
  137. package/dist/components/lightbox/index.js +9 -8
  138. package/dist/components/lightbox/index.js.map +1 -1
  139. package/dist/components/menu/index.js +4 -4
  140. package/dist/components/modal/index.js +7 -6
  141. package/dist/components/multi-combobox-list/index.js +6 -6
  142. package/dist/components/multi-select/index.js +4 -4
  143. package/dist/components/nav-link/index.js +3 -3
  144. package/dist/components/nav-link/tanstack.js +3 -3
  145. package/dist/components/notification/create-notifier.d.ts.map +1 -1
  146. package/dist/components/notification/index.js +18 -6
  147. package/dist/components/notification/index.js.map +1 -1
  148. package/dist/components/notification/types.d.ts +5 -0
  149. package/dist/components/notification/types.d.ts.map +1 -1
  150. package/dist/components/number-input/index.js +4 -4
  151. package/dist/components/overlays/index.js +9 -8
  152. package/dist/components/overlays/index.js.map +1 -1
  153. package/dist/components/photo-capture/index.js +13 -12
  154. package/dist/components/photo-capture/index.js.map +1 -1
  155. package/dist/components/popover/index.js +3 -3
  156. package/dist/components/schedule/index.js +7 -6
  157. package/dist/components/schedule/index.js.map +1 -1
  158. package/dist/components/select/index.js +5 -5
  159. package/dist/components/spinner/index.js +1 -1
  160. package/dist/components/spinner/spinner.d.ts +1 -1
  161. package/dist/components/spinner/spinner.d.ts.map +1 -1
  162. package/dist/components/spotlight/index.js +11 -10
  163. package/dist/components/spotlight/index.js.map +1 -1
  164. package/dist/components/tags-input/index.js +3 -3
  165. package/dist/components/theme-icon/index.js +1 -1
  166. package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
  167. package/dist/components/time-input/index.js +5 -5
  168. package/dist/components/tooltip/index.js +2 -2
  169. package/dist/components/tree-multi-select/index.js +4 -4
  170. package/dist/components/tree-select/index.js +4 -4
  171. package/dist/index.js +2 -2
  172. package/dist/lib/button-colors.d.ts +25 -0
  173. package/dist/lib/button-colors.d.ts.map +1 -0
  174. package/dist/lib/overlay-container.d.ts.map +1 -1
  175. package/dist/lib/overlay-layer.d.ts +10 -3
  176. package/dist/lib/overlay-layer.d.ts.map +1 -1
  177. package/dist/theme.css +14 -6
  178. package/package.json +1 -1
  179. package/src/colors.css +328 -0
  180. package/src/components/action-icon/action-icon.test.tsx +22 -0
  181. package/src/components/action-icon/action-icon.tsx +24 -28
  182. package/src/components/badge/badge.test.tsx +53 -10
  183. package/src/components/badge/badge.tsx +64 -11
  184. package/src/components/button/button.test.tsx +41 -5
  185. package/src/components/button/button.tsx +28 -33
  186. package/src/components/data-table/data-table-features.ts +11 -0
  187. package/src/components/data-table/data-table-group.test.tsx +1007 -0
  188. package/src/components/data-table/data-table-group.tsx +474 -0
  189. package/src/components/data-table/data-table-grouping.ts +160 -0
  190. package/src/components/data-table/data-table-icons.tsx +8 -1
  191. package/src/components/data-table/data-table-meta.ts +9 -0
  192. package/src/components/data-table/data-table-pagination.tsx +5 -1
  193. package/src/components/data-table/data-table-stack.tsx +165 -43
  194. package/src/components/data-table/data-table-toolbar.tsx +110 -2
  195. package/src/components/data-table/data-table-translations.ts +44 -0
  196. package/src/components/data-table/data-table.tsx +420 -150
  197. package/src/components/data-table/index.ts +4 -0
  198. package/src/components/drawer/drawer.tsx +1 -1
  199. package/src/components/modal/modal.tsx +1 -1
  200. package/src/components/notification/create-notifier.tsx +18 -2
  201. package/src/components/notification/notify-in-modal.test.tsx +128 -0
  202. package/src/components/notification/types.ts +5 -0
  203. package/src/components/spinner/spinner.tsx +3 -3
  204. package/src/components/theme-icon/theme-icon.test.tsx +7 -0
  205. package/src/components/theme-icon/theme-icon.tsx +10 -6
  206. package/src/lib/button-colors.ts +55 -0
  207. package/src/lib/overlay-container.tsx +2 -1
  208. package/src/lib/overlay-layer.test.tsx +63 -1
  209. package/src/lib/overlay-layer.tsx +29 -6
  210. package/src/theme.css +14 -6
  211. package/src/theme.test.ts +14 -10
  212. package/dist/chunk-7P32XCEU.js.map +0 -1
  213. package/dist/chunk-BMEJBY6H.js.map +0 -1
  214. package/dist/chunk-D2QIPQ74.js.map +0 -1
  215. package/dist/chunk-F374BNL4.js.map +0 -1
  216. package/dist/chunk-H7WOMZXO.js.map +0 -1
  217. package/dist/chunk-N42EFOML.js.map +0 -1
  218. package/dist/chunk-SCXXJDKQ.js.map +0 -1
  219. package/dist/chunk-YMVUQ2L7.js.map +0 -1
  220. package/dist/chunk-ZVECQBGG.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/clip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["\"use client\"\n\nimport { Clipboard as Ark, useClipboardContext } from \"@ark-ui/react/clipboard\"\nimport type { ComponentProps, ReactNode } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { InputBase, type InputSize, type InputVariant, inputControlClasses } from \"../input/input\"\n\n/**\n * Clipboard — a styled compound over Ark UI's Clipboard machine, for the\n * \"read-only value + copy button\" field pattern (share links, API keys,\n * invite codes). `Object.assign`-free parts namespace only, no bare-invocation\n * convenience form — matches `Popover`'s shape, since a rich field like this\n * isn't a single-prop drop-in the way `Copy` (this package's simple icon-button\n * preset) is.\n *\n * <Clipboard.Root value={link}>\n * <Clipboard.Label>Share link</Clipboard.Label>\n * <Clipboard.Input>\n * <Clipboard.Trigger asChild>\n * <ActionIcon variant=\"subtle\" aria-label=\"Copy link\">\n * <Clipboard.Indicator copied={<CheckIcon />}>\n * <CopyIcon />\n * </Clipboard.Indicator>\n * </ActionIcon>\n * </Clipboard.Trigger>\n * </Clipboard.Input>\n * </Clipboard.Root>\n *\n * For the common \"just an icon button, no visible value\" case, reach for\n * `Copy` instead — it composes this same machine with `ActionIcon` internally.\n */\n\n/** Ark's own `translations` prop type, derived structurally rather than imported\n * by name — `IntlTranslations` lives in `@zag-js/clipboard`, a transitive\n * dependency of the `@ark-ui/react` peer dep, not one this package declares\n * itself (same derivation `Calendar` uses for its own translations type).\n * Ark's shape is already fully partial (a single optional `triggerLabel`) and\n * its machine merges it over its own English default, so `Root` forwards only\n * the keys the caller set. */\ntype ArkClipboardTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\nexport type ClipboardTranslations = ArkClipboardTranslations & {\n /** Announced through a polite `role=\"status\"` region once the value is copied. Ark's\n * `triggerLabel` swap renames the focused button, which screen readers don't re-read. */\n copied?: string\n}\n\nconst DEFAULT_COPIED = \"Copied\"\n\n/** The live region behind the icon swap: always mounted (a region that appears\n * together with its text isn't announced), filled only while `copied`. */\nconst CopiedStatus = ({ label }: { label: string }) => {\n const { copied } = useClipboardContext()\n return (\n <span role=\"status\" className=\"sr-only\">\n {copied ? label : \"\"}\n </span>\n )\n}\n\nexport type ClipboardRootProps = Omit<\n ComponentProps<typeof Ark.Root>,\n \"onChange\" | \"onValueChange\" | \"onStatusChange\" | \"translations\"\n> &\n WithTestId & {\n /** Flattened from Ark's `onValueChange` — the next clipboard value. */\n onChange?: (value: string) => void\n /** Flattened from Ark's `onStatusChange` — fires `true` once the value is\n * copied. Ark's machine only emits this on copy, not on the automatic\n * revert to idle after `timeout` — read `Clipboard.Indicator` (or its\n * `copied` render prop) for the live state instead. */\n onCopiedChange?: (copied: boolean) => void\n /** Microcopy: Ark's `triggerLabel` (the trigger's name, copied or not) and `copied`\n * (the status announced on copy). English defaults; set only the keys you translate. */\n translations?: ClipboardTranslations\n }\n\n/** Owns open-ended clipboard state (value + copied/idle) and renders the real\n * `<div>` the rest of the compound reads context from, plus the visually\n * hidden status that announces a copy (positioned, so it can't escape a\n * scroller). */\nconst Root = ({\n onChange,\n onCopiedChange,\n testId,\n translations,\n asChild,\n className,\n children,\n ...rest\n}: ClipboardRootProps) => {\n const { copied = DEFAULT_COPIED, ...arkTranslations } = translations ?? {}\n return (\n <Ark.Root\n onValueChange={onChange ? (details) => onChange(details.value) : undefined}\n onStatusChange={onCopiedChange ? (details) => onCopiedChange(details.copied) : undefined}\n translations={arkTranslations}\n asChild={asChild}\n className={cn(\"relative\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {own}\n <CopiedStatus label={copied} />\n </>\n ))}\n </Ark.Root>\n )\n}\n\nexport type ClipboardInputProps = Omit<ComponentProps<typeof Ark.Input>, \"size\" | \"readOnly\"> &\n WithTestId & {\n /** Shell treatment — same scale as `Input`'s. */\n variant?: InputVariant\n /** Height step — same scale as `Input`'s. */\n size?: InputSize\n /** The copy `Trigger`, rendered as a real sibling of the input inside the\n * shell — pass it as `children`, not via a decorative `endSlot` (whose\n * wrapper is `aria-hidden` and would hide an interactive trigger from\n * assistive tech; see `PasswordInput`'s reveal toggle for the same call). */\n children?: ReactNode\n classNames?: { root?: string; input?: string }\n }\n\n/** The clipboard value, in the kit's shared `InputBase` shell — reused\n * directly (like `Input` / `PasswordInput` do), rather than through a\n * separate `Clipboard.Control` shell. `Clipboard.Control` (Ark's raw part,\n * re-exported below) stays available for consumers who want a different\n * layout and just need its `data-copied` attribute.\n *\n * Always read-only: Ark's own machine already sets `readOnly` on the real\n * `<input>` it renders; the `readOnly` given to `InputBase` here just mirrors\n * that onto the shell's own `data-readonly` hook. */\nconst Input = ({\n variant,\n size,\n className,\n classNames,\n children,\n testId,\n asChild,\n ...rest\n}: ClipboardInputProps) => (\n <InputBase variant={variant} size={size} readOnly className={cn(className, classNames?.root)}>\n {/* `children` is the trailing slot (usually the copy trigger), except under\n `asChild`, where the single child is the input element itself. */}\n <Ark.Input\n asChild={asChild}\n className={cn(inputControlClasses, classNames?.input)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {asChild ? children : undefined}\n </Ark.Input>\n {!asChild && children}\n </InputBase>\n)\n\nexport const Clipboard = {\n Root,\n /** Ark's raw `Label` part — a real `<label>`; unstyled by default, size/style\n * it like any other field label (or reuse `Field`'s own `fieldLabel`). */\n Label: Ark.Label,\n /** Ark's raw `Control` part — wraps `Input` (+ `Trigger`) when you want a\n * different shell than `InputBase`; carries `data-copied` for that case. */\n Control: Ark.Control,\n Input,\n /** Ark's raw `Trigger` part — a real `<button>`; `asChild` to swap in\n * `ActionIcon` or any other trigger element. */\n Trigger: Ark.Trigger,\n /** Ark's raw `Indicator` part — pass `copied={<CheckIcon />}` to swap content\n * once the value is copied, reverting once the state returns to idle. */\n Indicator: Ark.Indicator,\n /** Ark's raw `ValueText` part — renders the live value as plain (non-input)\n * text, for a read-only display that isn't a form control. */\n ValueText: Ark.ValueText,\n}\n","\"use client\"\n\nimport { useClipboardContext } from \"@ark-ui/react/clipboard\"\nimport { CheckIcon, CopyIcon } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { ActionIcon, type ActionIconProps } from \"../action-icon/action-icon\"\nimport { Clipboard, type ClipboardTranslations } from \"./clipboard\"\n\nexport type CopyIconSlot = \"copy\" | \"copied\"\nexport type CopyIcons = IconMap<CopyIconSlot>\n\n/** The default icons: the copy glyph, and the check it swaps to once copied. */\nexport const DEFAULT_ICONS: Record<CopyIconSlot, ReactNode> = {\n copy: <CopyIcon className={iconStroke} />,\n copied: <CheckIcon className={iconStroke} />,\n}\n\n/** Reads the live `copied` flag off the enclosing `Clipboard.Root` — context,\n * not the one-shot `onStatusChange` callback, which never fires `false` on the\n * automatic revert to idle — and draws the matching icon. */\nconst CopyIndicator = ({ icons }: { icons: Record<CopyIconSlot, ReactNode> }) => {\n const { copied } = useClipboardContext()\n return copied ? icons.copied : icons.copy\n}\n\nexport type CopyRenderState = {\n /** Whether `value` was just copied to the clipboard — flips back to\n * `false` once `timeout` elapses. */\n copied: boolean\n /** Writes `value` to the clipboard — the exact same action `Clipboard.Trigger`\n * itself calls on click. Wire it to your own trigger's `onClick`; `Copy`\n * doesn't attach it for you. */\n copy: () => void\n}\n\n/** Reads `{ copied, copy }` off the enclosing `Clipboard.Root` context and hands\n * them straight to the render-prop `children` — no markup of its own, so the\n * consumer's returned JSX is the only thing rendered. `copy` is Ark's own\n * `copy()` action (`send({ type: \"COPY\" })`), so calling it behaves\n * identically to clicking the default `Clipboard.Trigger`: it writes `value`\n * to the clipboard, flips `copied`, fires `Root`'s `onCopiedChange`, and\n * reverts after `timeout`. */\nconst CopyRenderProp = ({ children }: { children: (state: CopyRenderState) => ReactNode }) => {\n const { copied, copy } = useClipboardContext()\n return children({ copied, copy })\n}\n\nexport type CopyProps = Pick<\n ActionIconProps,\n \"variant\" | \"size\" | \"radius\" | \"color\" | \"testId\"\n> & {\n /** The value copied to the clipboard on click. */\n value: string\n /** Ms before the copied state reverts to idle. Ark's own default (3000). */\n timeout?: number\n /** Fires `true` once the value is copied — flattened from Ark's\n * `onStatusChange`. Ark's machine only emits this on copy, never on the\n * automatic revert to idle after `timeout` (an upstream characteristic of\n * the machine, not a gap in this wrapper). */\n onCopiedChange?: (copied: boolean) => void\n /** Replaces the default icons: `copy`, and `copied` once the value is copied. A missing key\n * keeps its default; a function `children` renders its own trigger instead. */\n icons?: CopyIcons\n /** Microcopy: the button's `triggerLabel` and the `copied` status announced on copy. English\n * defaults; set only the keys you translate. */\n translations?: ClipboardTranslations\n /** Omit for the default rendering (an icon-button `ActionIcon` whose icon\n * swaps to a checkmark on copy). Pass a function instead to go fully\n * headless: `Copy` renders none of its own markup and instead calls this\n * with `{ copied, copy }`, letting you render whatever trigger you want —\n * your own button, a text link, a custom icon — wiring `copy` to its\n * `onClick` yourself. `copied` and `copy` still ride the same `timeout` /\n * `onCopiedChange` behavior as the default button.\n *\n * <Copy value={value}>\n * {({ copied, copy }) => (\n * <button type=\"button\" onClick={copy}>\n * {copied ? \"Copied!\" : \"Copy\"}\n * </button>\n * )}\n * </Copy>\n */\n children?: (state: CopyRenderState) => ReactNode\n}\n\n/**\n * Copy — a one-line preset: `Clipboard.Root` + `Clipboard.Trigger` wrapping this\n * kit's own `ActionIcon`. No visible input, just an icon button whose icon\n * swaps to a checkmark on copy and reverts to the copy icon after `timeout`.\n * `variant` / `size` / `radius` / `color` forward straight to `ActionIcon` — see\n * its own docs for that model.\n *\n * <Copy value=\"https://example.com/s/abc123\" />\n *\n * The accessible name comes from Ark's own `\"Copy to clipboard\"` /\n * `\"Copied to clipboard\"` translations, and a copy is announced as \"Copied\"\n * through a visually hidden status; both are overridable via `translations`.\n * `Copy` is a closed leaf preset — it owns its `ActionIcon` outright and\n * doesn't accept `asChild` or a custom `aria-label`; compose `Clipboard.Root` /\n * `Clipboard.Trigger` directly (see the `Clipboard` docs) for a different\n * trigger element.\n *\n * For anything else — a text link, a custom icon, your own button styling —\n * pass a function as `children` instead and go headless: `Copy` then renders\n * only the function's own return value, no `ActionIcon`/icon-swap markup of\n * its own, and hands you `{ copied, copy }` to build the trigger yourself.\n *\n * <Copy value=\"https://example.com/s/abc123\">\n * {({ copied, copy }) => (\n * <button type=\"button\" onClick={copy}>{copied ? \"Copied!\" : \"Copy\"}</button>\n * )}\n * </Copy>\n */\nexport const Copy = ({\n value,\n timeout,\n onCopiedChange,\n variant,\n size,\n radius,\n color,\n testId,\n icons,\n translations,\n children,\n}: CopyProps) => (\n <Clipboard.Root\n value={value}\n timeout={timeout}\n onCopiedChange={onCopiedChange}\n translations={translations}\n >\n {typeof children === \"function\" ? (\n <CopyRenderProp>{children}</CopyRenderProp>\n ) : (\n <Clipboard.Trigger asChild>\n <ActionIcon variant={variant} size={size} radius={radius} color={color} testId={testId}>\n <CopyIndicator icons={mergeIcons(DEFAULT_ICONS, icons)} />\n </ActionIcon>\n </Clipboard.Trigger>\n )}\n </Clipboard.Root>\n)\n"]}
1
+ {"version":3,"sources":["../../../src/components/clipboard/clipboard.tsx","../../../src/components/clipboard/copy.tsx"],"names":["Ark","jsx","useClipboardContext"],"mappings":";;;;;;;;;;;;;;;AAkDA,IAAM,cAAA,GAAiB,QAAA;AAIvB,IAAM,YAAA,GAAe,CAAC,EAAE,KAAA,EAAM,KAAyB;AACrD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,mBAAA,EAAoB;AACvC,EAAA,uBACE,GAAA,CAAC,UAAK,IAAA,EAAK,QAAA,EAAS,WAAU,SAAA,EAC3B,QAAA,EAAA,MAAA,GAAS,QAAQ,EAAA,EACpB,CAAA;AAEJ,CAAA;AAuBA,IAAM,OAAO,CAAC;AAAA,EACZ,QAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA0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A,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAA,qBACED,GAAAA;AAAA,EAAC,SAAA,CAAU,IAAA;AAAA,EAAV;AAAA,IACC,KAAA;AAAA,IACA,OAAA;AAAA,IACA,cAAA;AAAA,IACA,YAAA;AAAA,IAEC,QAAA,EAAA,OAAO,QAAA,KAAa,UAAA,mBACnBA,IAAC,cAAA,EAAA,EAAgB,QAAA,EAAS,CAAA,mBAE1BA,GAAAA,CAAC,SAAA,CAAU,OAAA,EAAV,EAAkB,SAAO,IAAA,EACxB,QAAA,kBAAAA,GAAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAkB,IAAA,EAAY,MAAA,EAAgB,KAAA,EAAc,QACtE,QAAA,kBAAAA,GAAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAO,UAAA,CAAW,aAAA,EAAe,KAAK,CAAA,EAAG,GAC1D,CAAA,EACF;AAAA;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Clipboard as Ark, useClipboardContext } from \"@ark-ui/react/clipboard\"\nimport type { ComponentProps, ReactNode } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { InputBase, type InputSize, type InputVariant, inputControlClasses } from \"../input/input\"\n\n/**\n * Clipboard — a styled compound over Ark UI's Clipboard machine, for the\n * \"read-only value + copy button\" field pattern (share links, API keys,\n * invite codes). `Object.assign`-free parts namespace only, no bare-invocation\n * convenience form — matches `Popover`'s shape, since a rich field like this\n * isn't a single-prop drop-in the way `Copy` (this package's simple icon-button\n * preset) is.\n *\n * <Clipboard.Root value={link}>\n * <Clipboard.Label>Share link</Clipboard.Label>\n * <Clipboard.Input>\n * <Clipboard.Trigger asChild>\n * <ActionIcon variant=\"subtle\" aria-label=\"Copy link\">\n * <Clipboard.Indicator copied={<CheckIcon />}>\n * <CopyIcon />\n * </Clipboard.Indicator>\n * </ActionIcon>\n * </Clipboard.Trigger>\n * </Clipboard.Input>\n * </Clipboard.Root>\n *\n * For the common \"just an icon button, no visible value\" case, reach for\n * `Copy` instead — it composes this same machine with `ActionIcon` internally.\n */\n\n/** Ark's own `translations` prop type, derived structurally rather than imported\n * by name — `IntlTranslations` lives in `@zag-js/clipboard`, a transitive\n * dependency of the `@ark-ui/react` peer dep, not one this package declares\n * itself (same derivation `Calendar` uses for its own translations type).\n * Ark's shape is already fully partial (a single optional `triggerLabel`) and\n * its machine merges it over its own English default, so `Root` forwards only\n * the keys the caller set. */\ntype ArkClipboardTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\nexport type ClipboardTranslations = ArkClipboardTranslations & {\n /** Announced through a polite `role=\"status\"` region once the value is copied. Ark's\n * `triggerLabel` swap renames the focused button, which screen readers don't re-read. */\n copied?: string\n}\n\nconst DEFAULT_COPIED = \"Copied\"\n\n/** The live region behind the icon swap: always mounted (a region that appears\n * together with its text isn't announced), filled only while `copied`. */\nconst CopiedStatus = ({ label }: { label: string }) => {\n const { copied } = useClipboardContext()\n return (\n <span role=\"status\" className=\"sr-only\">\n {copied ? label : \"\"}\n </span>\n )\n}\n\nexport type ClipboardRootProps = Omit<\n ComponentProps<typeof Ark.Root>,\n \"onChange\" | \"onValueChange\" | \"onStatusChange\" | \"translations\"\n> &\n WithTestId & {\n /** Flattened from Ark's `onValueChange` — the next clipboard value. */\n onChange?: (value: string) => void\n /** Flattened from Ark's `onStatusChange` — fires `true` once the value is\n * copied. Ark's machine only emits this on copy, not on the automatic\n * revert to idle after `timeout` — read `Clipboard.Indicator` (or its\n * `copied` render prop) for the live state instead. */\n onCopiedChange?: (copied: boolean) => void\n /** Microcopy: Ark's `triggerLabel` (the trigger's name, copied or not) and `copied`\n * (the status announced on copy). English defaults; set only the keys you translate. */\n translations?: ClipboardTranslations\n }\n\n/** Owns open-ended clipboard state (value + copied/idle) and renders the real\n * `<div>` the rest of the compound reads context from, plus the visually\n * hidden status that announces a copy (positioned, so it can't escape a\n * scroller). */\nconst Root = ({\n onChange,\n onCopiedChange,\n testId,\n translations,\n asChild,\n className,\n children,\n ...rest\n}: ClipboardRootProps) => {\n const { copied = DEFAULT_COPIED, ...arkTranslations } = translations ?? {}\n return (\n <Ark.Root\n onValueChange={onChange ? (details) => onChange(details.value) : undefined}\n onStatusChange={onCopiedChange ? (details) => onCopiedChange(details.copied) : undefined}\n translations={arkTranslations}\n asChild={asChild}\n className={cn(\"relative\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {own}\n <CopiedStatus label={copied} />\n </>\n ))}\n </Ark.Root>\n )\n}\n\nexport type ClipboardInputProps = Omit<ComponentProps<typeof Ark.Input>, \"size\" | \"readOnly\"> &\n WithTestId & {\n /** Shell treatment — same scale as `Input`'s. */\n variant?: InputVariant\n /** Height step — same scale as `Input`'s. */\n size?: InputSize\n /** The copy `Trigger`, rendered as a real sibling of the input inside the\n * shell — pass it as `children`, not via a decorative `endSlot` (whose\n * wrapper is `aria-hidden` and would hide an interactive trigger from\n * assistive tech; see `PasswordInput`'s reveal toggle for the same call). */\n children?: ReactNode\n classNames?: { root?: string; input?: string }\n }\n\n/** The clipboard value, in the kit's shared `InputBase` shell — reused\n * directly (like `Input` / `PasswordInput` do), rather than through a\n * separate `Clipboard.Control` shell. `Clipboard.Control` (Ark's raw part,\n * re-exported below) stays available for consumers who want a different\n * layout and just need its `data-copied` attribute.\n *\n * Always read-only: Ark's own machine already sets `readOnly` on the real\n * `<input>` it renders; the `readOnly` given to `InputBase` here just mirrors\n * that onto the shell's own `data-readonly` hook. */\nconst Input = ({\n variant,\n size,\n className,\n classNames,\n children,\n testId,\n asChild,\n ...rest\n}: ClipboardInputProps) => (\n <InputBase variant={variant} size={size} readOnly className={cn(className, classNames?.root)}>\n {/* `children` is the trailing slot (usually the copy trigger), except under\n `asChild`, where the single child is the input element itself. */}\n <Ark.Input\n asChild={asChild}\n className={cn(inputControlClasses, classNames?.input)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {asChild ? children : undefined}\n </Ark.Input>\n {!asChild && children}\n </InputBase>\n)\n\nexport const Clipboard = {\n Root,\n /** Ark's raw `Label` part — a real `<label>`; unstyled by default, size/style\n * it like any other field label (or reuse `Field`'s own `fieldLabel`). */\n Label: Ark.Label,\n /** Ark's raw `Control` part — wraps `Input` (+ `Trigger`) when you want a\n * different shell than `InputBase`; carries `data-copied` for that case. */\n Control: Ark.Control,\n Input,\n /** Ark's raw `Trigger` part — a real `<button>`; `asChild` to swap in\n * `ActionIcon` or any other trigger element. */\n Trigger: Ark.Trigger,\n /** Ark's raw `Indicator` part — pass `copied={<CheckIcon />}` to swap content\n * once the value is copied, reverting once the state returns to idle. */\n Indicator: Ark.Indicator,\n /** Ark's raw `ValueText` part — renders the live value as plain (non-input)\n * text, for a read-only display that isn't a form control. */\n ValueText: Ark.ValueText,\n}\n","\"use client\"\n\nimport { useClipboardContext } from \"@ark-ui/react/clipboard\"\nimport { CheckIcon, CopyIcon } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { ActionIcon, type ActionIconProps } from \"../action-icon/action-icon\"\nimport { Clipboard, type ClipboardTranslations } from \"./clipboard\"\n\nexport type CopyIconSlot = \"copy\" | \"copied\"\nexport type CopyIcons = IconMap<CopyIconSlot>\n\n/** The default icons: the copy glyph, and the check it swaps to once copied. */\nexport const DEFAULT_ICONS: Record<CopyIconSlot, ReactNode> = {\n copy: <CopyIcon className={iconStroke} />,\n copied: <CheckIcon className={iconStroke} />,\n}\n\n/** Reads the live `copied` flag off the enclosing `Clipboard.Root` — context,\n * not the one-shot `onStatusChange` callback, which never fires `false` on the\n * automatic revert to idle — and draws the matching icon. */\nconst CopyIndicator = ({ icons }: { icons: Record<CopyIconSlot, ReactNode> }) => {\n const { copied } = useClipboardContext()\n return copied ? icons.copied : icons.copy\n}\n\nexport type CopyRenderState = {\n /** Whether `value` was just copied to the clipboard — flips back to\n * `false` once `timeout` elapses. */\n copied: boolean\n /** Writes `value` to the clipboard — the exact same action `Clipboard.Trigger`\n * itself calls on click. Wire it to your own trigger's `onClick`; `Copy`\n * doesn't attach it for you. */\n copy: () => void\n}\n\n/** Reads `{ copied, copy }` off the enclosing `Clipboard.Root` context and hands\n * them straight to the render-prop `children` — no markup of its own, so the\n * consumer's returned JSX is the only thing rendered. `copy` is Ark's own\n * `copy()` action (`send({ type: \"COPY\" })`), so calling it behaves\n * identically to clicking the default `Clipboard.Trigger`: it writes `value`\n * to the clipboard, flips `copied`, fires `Root`'s `onCopiedChange`, and\n * reverts after `timeout`. */\nconst CopyRenderProp = ({ children }: { children: (state: CopyRenderState) => ReactNode }) => {\n const { copied, copy } = useClipboardContext()\n return children({ copied, copy })\n}\n\nexport type CopyProps = Pick<\n ActionIconProps,\n \"variant\" | \"size\" | \"radius\" | \"color\" | \"testId\"\n> & {\n /** The value copied to the clipboard on click. */\n value: string\n /** Ms before the copied state reverts to idle. Ark's own default (3000). */\n timeout?: number\n /** Fires `true` once the value is copied — flattened from Ark's\n * `onStatusChange`. Ark's machine only emits this on copy, never on the\n * automatic revert to idle after `timeout` (an upstream characteristic of\n * the machine, not a gap in this wrapper). */\n onCopiedChange?: (copied: boolean) => void\n /** Replaces the default icons: `copy`, and `copied` once the value is copied. A missing key\n * keeps its default; a function `children` renders its own trigger instead. */\n icons?: CopyIcons\n /** Microcopy: the button's `triggerLabel` and the `copied` status announced on copy. English\n * defaults; set only the keys you translate. */\n translations?: ClipboardTranslations\n /** Omit for the default rendering (an icon-button `ActionIcon` whose icon\n * swaps to a checkmark on copy). Pass a function instead to go fully\n * headless: `Copy` renders none of its own markup and instead calls this\n * with `{ copied, copy }`, letting you render whatever trigger you want —\n * your own button, a text link, a custom icon — wiring `copy` to its\n * `onClick` yourself. `copied` and `copy` still ride the same `timeout` /\n * `onCopiedChange` behavior as the default button.\n *\n * <Copy value={value}>\n * {({ copied, copy }) => (\n * <button type=\"button\" onClick={copy}>\n * {copied ? \"Copied!\" : \"Copy\"}\n * </button>\n * )}\n * </Copy>\n */\n children?: (state: CopyRenderState) => ReactNode\n}\n\n/**\n * Copy — a one-line preset: `Clipboard.Root` + `Clipboard.Trigger` wrapping this\n * kit's own `ActionIcon`. No visible input, just an icon button whose icon\n * swaps to a checkmark on copy and reverts to the copy icon after `timeout`.\n * `variant` / `size` / `radius` / `color` forward straight to `ActionIcon` — see\n * its own docs for that model.\n *\n * <Copy value=\"https://example.com/s/abc123\" />\n *\n * The accessible name comes from Ark's own `\"Copy to clipboard\"` /\n * `\"Copied to clipboard\"` translations, and a copy is announced as \"Copied\"\n * through a visually hidden status; both are overridable via `translations`.\n * `Copy` is a closed leaf preset — it owns its `ActionIcon` outright and\n * doesn't accept `asChild` or a custom `aria-label`; compose `Clipboard.Root` /\n * `Clipboard.Trigger` directly (see the `Clipboard` docs) for a different\n * trigger element.\n *\n * For anything else — a text link, a custom icon, your own button styling —\n * pass a function as `children` instead and go headless: `Copy` then renders\n * only the function's own return value, no `ActionIcon`/icon-swap markup of\n * its own, and hands you `{ copied, copy }` to build the trigger yourself.\n *\n * <Copy value=\"https://example.com/s/abc123\">\n * {({ copied, copy }) => (\n * <button type=\"button\" onClick={copy}>{copied ? \"Copied!\" : \"Copy\"}</button>\n * )}\n * </Copy>\n */\nexport const Copy = ({\n value,\n timeout,\n onCopiedChange,\n variant,\n size,\n radius,\n color,\n testId,\n icons,\n translations,\n children,\n}: CopyProps) => (\n <Clipboard.Root\n value={value}\n timeout={timeout}\n onCopiedChange={onCopiedChange}\n translations={translations}\n >\n {typeof children === \"function\" ? (\n <CopyRenderProp>{children}</CopyRenderProp>\n ) : (\n <Clipboard.Trigger asChild>\n <ActionIcon variant={variant} size={size} radius={radius} color={color} testId={testId}>\n <CopyIndicator icons={mergeIcons(DEFAULT_ICONS, icons)} />\n </ActionIcon>\n </Clipboard.Trigger>\n )}\n </Clipboard.Root>\n)\n"]}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- export { CodeBlockButton, CodeBlockChrome, DEFAULT_ICONS } from '../../chunk-LYGOFMXJ.js';
3
- import '../../chunk-E3XLWMEB.js';
4
- import '../../chunk-H7WOMZXO.js';
5
- import '../../chunk-YZJUPYPO.js';
2
+ export { CodeBlockButton, CodeBlockChrome, DEFAULT_ICONS } from '../../chunk-I4IJOLNA.js';
3
+ import '../../chunk-RKCUXOU2.js';
4
+ import '../../chunk-HWBFRDX7.js';
5
+ import '../../chunk-2W7H43WL.js';
6
6
  import '../../chunk-V6PY7C6S.js';
7
- import '../../chunk-7P32XCEU.js';
7
+ import '../../chunk-SLUOF7XW.js';
8
8
  import '../../chunk-PMUCGFY5.js';
9
9
  import '../../chunk-BUIHQJGE.js';
10
10
  import '../../chunk-NKOTA5TM.js';
@@ -1,10 +1,10 @@
1
- import { CodeBlockButton, CodeBlockChrome } from '../../chunk-LYGOFMXJ.js';
2
- export { CodeBlockButton } from '../../chunk-LYGOFMXJ.js';
3
- import '../../chunk-E3XLWMEB.js';
4
- import '../../chunk-H7WOMZXO.js';
5
- import '../../chunk-YZJUPYPO.js';
1
+ import { CodeBlockButton, CodeBlockChrome } from '../../chunk-I4IJOLNA.js';
2
+ export { CodeBlockButton } from '../../chunk-I4IJOLNA.js';
3
+ import '../../chunk-RKCUXOU2.js';
4
+ import '../../chunk-HWBFRDX7.js';
5
+ import '../../chunk-2W7H43WL.js';
6
6
  import '../../chunk-V6PY7C6S.js';
7
- import '../../chunk-7P32XCEU.js';
7
+ import '../../chunk-SLUOF7XW.js';
8
8
  import { devWarnOnce } from '../../chunk-LIZWCWED.js';
9
9
  import '../../chunk-PMUCGFY5.js';
10
10
  import '../../chunk-BUIHQJGE.js';
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- export { Combobox } from '../../chunk-2NTCQIRP.js';
2
+ export { Combobox } from '../../chunk-QRNQQIQM.js';
3
3
  import '../../chunk-I4B3N3UX.js';
4
4
  import '../../chunk-X6DESK37.js';
5
- import '../../chunk-E3XLWMEB.js';
6
- import '../../chunk-H7WOMZXO.js';
5
+ import '../../chunk-RKCUXOU2.js';
6
+ import '../../chunk-HWBFRDX7.js';
7
7
  import '../../chunk-V6PY7C6S.js';
8
- import '../../chunk-7P32XCEU.js';
8
+ import '../../chunk-SLUOF7XW.js';
9
9
  import '../../chunk-PMUCGFY5.js';
10
10
  import '../../chunk-BUIHQJGE.js';
11
11
  import '../../chunk-6YNLRQ25.js';
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- export { ComboboxList } from '../../chunk-THGJLR5S.js';
3
- import '../../chunk-QEAF57ZQ.js';
2
+ export { ComboboxList } from '../../chunk-NNPSBC7O.js';
3
+ import '../../chunk-ISX3AM32.js';
4
4
  import '../../chunk-7TDHT3QD.js';
5
- import '../../chunk-2NTCQIRP.js';
5
+ import '../../chunk-QRNQQIQM.js';
6
6
  import '../../chunk-I4B3N3UX.js';
7
7
  import '../../chunk-X6DESK37.js';
8
- import '../../chunk-E3XLWMEB.js';
9
- import '../../chunk-H7WOMZXO.js';
8
+ import '../../chunk-RKCUXOU2.js';
9
+ import '../../chunk-HWBFRDX7.js';
10
10
  import '../../chunk-V6PY7C6S.js';
11
- import '../../chunk-7P32XCEU.js';
11
+ import '../../chunk-SLUOF7XW.js';
12
12
  import '../../chunk-PMUCGFY5.js';
13
13
  import '../../chunk-BUIHQJGE.js';
14
14
  import '../../chunk-6YNLRQ25.js';
@@ -24,8 +24,12 @@ export declare const dataTableFeatures: {
24
24
  columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
25
25
  columnSizingFeature: import("@tanstack/react-table").TableFeature;
26
26
  columnResizingFeature: import("@tanstack/react-table").TableFeature;
27
+ columnGroupingFeature: import("@tanstack/react-table").TableFeature;
28
+ rowExpandingFeature: import("@tanstack/react-table").TableFeature;
27
29
  filteredRowModel: (table: TanstackTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
30
+ groupedRowModel: (table: TanstackTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
28
31
  sortedRowModel: (table: TanstackTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
32
+ expandedRowModel: (table: TanstackTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
29
33
  paginatedRowModel: (table: TanstackTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
30
34
  sortFns: {
31
35
  alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
@@ -59,8 +63,12 @@ export declare const createColumnHelper: <TEntity extends RowData>() => import("
59
63
  columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
60
64
  columnSizingFeature: import("@tanstack/react-table").TableFeature;
61
65
  columnResizingFeature: import("@tanstack/react-table").TableFeature;
66
+ columnGroupingFeature: import("@tanstack/react-table").TableFeature;
67
+ rowExpandingFeature: import("@tanstack/react-table").TableFeature;
62
68
  filteredRowModel: (table: TanstackTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
69
+ groupedRowModel: (table: TanstackTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
63
70
  sortedRowModel: (table: TanstackTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
71
+ expandedRowModel: (table: TanstackTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
64
72
  paginatedRowModel: (table: TanstackTable<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
65
73
  sortFns: {
66
74
  alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"data-table-features.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-features.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,IAAI,mBAAmB,EAClC,SAAS,IAAI,iBAAiB,EAC9B,aAAa,IAAI,qBAAqB,EACtC,GAAG,IAAI,WAAW,EAClB,KAAK,IAAI,aAAa,EACvB,MAAM,uBAAuB,CAAA;AA2B9B;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;QA6B1B,YAAY;QACZ,IAAI;QACJ,QAAQ;QACR,KAAK;;;QAGL,cAAc;QACd,aAAa;QACb,MAAM;QACN,WAAW;QACX,WAAW;QACX,UAAU;;CAEZ,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAOxD,MAAM,MAAM,SAAS,CAAC,OAAO,SAAS,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,iBAAiB,CAClF,iBAAiB,EACjB,OAAO,EACP,MAAM,CACP,CAAA;AAED,MAAM,MAAM,GAAG,CAAC,OAAO,SAAS,OAAO,IAAI,WAAW,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;AAElF,MAAM,MAAM,WAAW,CAAC,OAAO,SAAS,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,mBAAmB,CACtF,iBAAiB,EACjB,OAAO,EACP,MAAM,CACP,CAAA;AAED,MAAM,MAAM,aAAa,CAAC,OAAO,SAAS,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,qBAAqB,CAC1F,iBAAiB,EACjB,OAAO,EACP,MAAM,CACP,CAAA;AAED,uFAAuF;AACvF,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,OAAO,IAAI,aAAa,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;AAElG,uFAAuF;AACvF,eAAO,MAAM,kBAAkB,GAAI,OAAO,SAAS,OAAO;;;;;;;;;;;;;QA9CtD,YAAY;QACZ,IAAI;QACJ,QAAQ;QACR,KAAK;;;QAGL,cAAc;QACd,aAAa;QACb,MAAM;QACN,WAAW;QACX,WAAW;QACX,UAAU;;WAoC4C,CAAA"}
1
+ {"version":3,"file":"data-table-features.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-features.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d,aAAa;QACb,MAAM;QACN,WAAW;QACX,WAAW;QACX,UAAU;;WAoC4C,CAAA"}
@@ -0,0 +1,128 @@
1
+ import { type Column, type ExpandedState, type RowData, type Updater } from "@tanstack/react-table";
2
+ import { type ReactNode } from "react";
3
+ import { type TableSize } from "../table/table";
4
+ import type { DataTableFeatures, DataTableInstance, Row } from "./data-table-features";
5
+ import { type DataTableGroup, type DataTableGroupNode } from "./data-table-grouping";
6
+ import type { ResolvedDataTableIcons } from "./data-table-icons";
7
+ import type { ResolvedDataTableTranslations } from "./data-table-translations";
8
+ /** What `renderGroupHeader` receives for one group. */
9
+ export type DataTableGroupHeaderContext<TEntity extends RowData> = {
10
+ /** The column the group is made from. */
11
+ column: Column<DataTableFeatures, TEntity, unknown>;
12
+ /** The group's value in that column, as a string. */
13
+ value: string;
14
+ /** Its plain-text label: the matching `select` option's label, else the value. */
15
+ label: string;
16
+ /** The group's rows present in `data`, across its sub-groups. */
17
+ rows: Row<TEntity>[];
18
+ /** Every row the group holds; the server's total under `manualGrouping`. */
19
+ count: number;
20
+ expanded: boolean;
21
+ toggle: () => void;
22
+ };
23
+ /** What a "Show more" click reports under `manualGrouping`. */
24
+ export type DataTableGroupShowMore = {
25
+ columnId: string;
26
+ value: string;
27
+ /** How many of the group's rows are in `data` already. */
28
+ loaded: number;
29
+ };
30
+ /** Everything the two renderings (table body, stacked cards) need to draw groups. */
31
+ export type DataTableGrouping<TEntity extends RowData> = {
32
+ groups: DataTableGroupNode<TEntity>[];
33
+ /** Rows across the drawn groups, by their `count`. */
34
+ rowCount: number;
35
+ label: (node: DataTableGroupNode<TEntity>) => string;
36
+ renderValue: (node: DataTableGroupNode<TEntity>) => ReactNode;
37
+ isExpanded: (node: DataTableGroupNode<TEntity>) => boolean;
38
+ toggle: (node: DataTableGroupNode<TEntity>) => void;
39
+ /** The group's leaf rows up to its current "Show more" limit. */
40
+ visibleRows: (node: DataTableGroupNode<TEntity>) => Row<TEntity>[];
41
+ /** How many rows the next "Show more" adds; `0` draws no button. */
42
+ nextCount: (node: DataTableGroupNode<TEntity>) => number;
43
+ showMore: (node: DataTableGroupNode<TEntity>) => void;
44
+ /** Groups the user opened since mount: their rows fade in. */
45
+ opened: ReadonlySet<string>;
46
+ };
47
+ /**
48
+ * Builds the group tree for the current `grouping` and holds what is local to
49
+ * drawing it: each group's "Show more" limit and which groups were just opened.
50
+ * Returns `null` while the table isn't grouped.
51
+ */
52
+ export declare function useDataTableGrouping<TEntity extends RowData>({ table, grouping, expanded, onExpandedChange, hideEmptyGroups, paginate, groupPageSize, manualGrouping, manualGroups, onGroupShowMore, renderGroupHeader, translations, resetKey, }: {
53
+ table: DataTableInstance<TEntity>;
54
+ grouping: string[];
55
+ expanded: ExpandedState;
56
+ onExpandedChange: (updater: Updater<ExpandedState>) => void;
57
+ hideEmptyGroups: boolean;
58
+ /** `false` shows every row of a group at once (`enablePagination={false}`). */
59
+ paginate: boolean;
60
+ groupPageSize: number;
61
+ manualGrouping: boolean;
62
+ manualGroups?: ReadonlyArray<DataTableGroup>;
63
+ onGroupShowMore?: (group: DataTableGroupShowMore) => void;
64
+ renderGroupHeader?: (context: DataTableGroupHeaderContext<TEntity>) => ReactNode;
65
+ translations: ResolvedDataTableTranslations;
66
+ /** Changes whenever the row set does (grouping, sorting, filters, search): the
67
+ * limits start over, since "the first 25" no longer names the same rows. */
68
+ resetKey: string;
69
+ }): DataTableGrouping<TEntity> | null;
70
+ /**
71
+ * A group's fold control: the chevron and the group's value in one button, then
72
+ * the row count. Shared by the table's group header row and the stacked layout's
73
+ * section heading.
74
+ *
75
+ * The button is named after the group and says whether it is open through
76
+ * `aria-expanded`. The value is drawn inside it for the click target but hidden
77
+ * from assistive technology, which already has the name; a cell renderer used
78
+ * here must not hold a link or a control of its own.
79
+ */
80
+ export declare function DataTableGroupToggle<TEntity extends RowData>({ node, grouping, controls, translations, icons, className, }: {
81
+ node: DataTableGroupNode<TEntity>;
82
+ grouping: DataTableGrouping<TEntity>;
83
+ /** On the fold button: the table indents a sub-group's with it. */
84
+ className?: string;
85
+ /** The id of the element holding the group's rows, for `aria-controls`. */
86
+ controls?: string;
87
+ translations: ResolvedDataTableTranslations;
88
+ icons: ResolvedDataTableIcons;
89
+ }): import("react").JSX.Element;
90
+ /** A group's "Show N more" button, for the table body and the stacked layout alike. */
91
+ export declare function DataTableGroupShowMore<TEntity extends RowData>({ node, grouping, translations, }: {
92
+ node: DataTableGroupNode<TEntity>;
93
+ grouping: DataTableGrouping<TEntity>;
94
+ translations: ResolvedDataTableTranslations;
95
+ }): import("react").JSX.Element;
96
+ /**
97
+ * The grouped table body: one `<tbody>` per first-level group, which makes each
98
+ * a row group. Its first row is the group header, a `<th scope="rowgroup">`
99
+ * across every column holding the group's checkbox (in selection mode), fold
100
+ * button and count. A second grouping level adds sub-group header rows inside
101
+ * the same `<tbody>`, since a `<tbody>` can't nest.
102
+ */
103
+ export declare function DataTableGroupedBody<TEntity extends RowData>({ grouping, table, colSpan, renderRow, selectable, size, translations, icons, className, }: {
104
+ grouping: DataTableGrouping<TEntity>;
105
+ table: DataTableInstance<TEntity>;
106
+ /** The visible column count: every group row spans the table. */
107
+ colSpan: number;
108
+ /** `DataTable`'s own data row, so grouped and flat tables draw rows alike. */
109
+ renderRow: (row: Row<TEntity>, options?: {
110
+ className?: string;
111
+ indent?: boolean;
112
+ }) => ReactNode;
113
+ /** Draws each group's tri-state checkbox. */
114
+ selectable: boolean;
115
+ size: TableSize;
116
+ translations: ResolvedDataTableTranslations;
117
+ icons: ResolvedDataTableIcons;
118
+ className?: string;
119
+ }): import("react").JSX.Element[];
120
+ /** The footer while rows are grouped: the total, in the pagination band's place.
121
+ * Pages across the flattened list would split a group, so each group pages
122
+ * itself ("Show more") and the table-level controls step aside. */
123
+ export declare function DataTableGroupSummary<TEntity extends RowData>({ grouping, translations, className, }: {
124
+ grouping: DataTableGrouping<TEntity>;
125
+ translations: ResolvedDataTableTranslations;
126
+ className?: string;
127
+ }): import("react").JSX.Element;
128
+ //# sourceMappingURL=data-table-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-table-group.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-group.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,aAAa,EAElB,KAAK,OAAO,EACZ,KAAK,OAAO,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,OAAO,CAAA;AAQvD,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AACtF,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EAKxB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAA;AAE9E,uDAAuD;AACvD,MAAM,MAAM,2BAA2B,CAAC,OAAO,SAAS,OAAO,IAAI;IACjE,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC,iBAAiB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IACnD,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAA;IACb,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAA;IACpB,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB,CAAA;AAED,+DAA+D;AAC/D,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAA;CAC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YAAY,EAAE,6BAA6B,CAAA;CAC5C,+BAQA;AAYD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,OAAO,EAAE,EAC5D,QAAQ,EACR,KAAK,EACL,OAAO,EACP,SAAS,EACT,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAA;IACpC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAA;IACjC,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAA;IACf,8EAA8E;IAC9E,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,SAAS,CAAA;IAC/F,6CAA6C;IAC7C,UAAU,EAAE,OAAO,CAAA;IACnB,IAAI,EAAE,SAAS,CAAA;IACf,YAAY,EAAE,6BAA6B,CAAA;IAC3C,KAAK,EAAE,sBAAsB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,iCA8GA;AAED;;oEAEoE;AACpE,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,OAAO,EAAE,EAC7D,QAAQ,EACR,YAAY,EACZ,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAA;IACpC,YAAY,EAAE,6BAA6B,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,+BAsBA"}
@@ -0,0 +1,72 @@
1
+ import type { ExpandedState, RowData } from "@tanstack/react-table";
2
+ import { type NormalizedItem } from "../../lib/select-data";
3
+ import type { DataTableInstance, Row } from "./data-table-features";
4
+ /** A group as the server describes it, for `manualGrouping`: its value in the
5
+ * grouped column and how many rows it holds in total, loaded or not. */
6
+ export type DataTableGroup = {
7
+ value: string;
8
+ count: number;
9
+ };
10
+ /**
11
+ * One group to draw. `groups` holds its sub-groups when a second grouping level
12
+ * follows, `rows` its leaf rows otherwise; exactly one of the two is filled.
13
+ */
14
+ export type DataTableGroupNode<TEntity extends RowData> = {
15
+ /** react-table's group row id: `status:fixed`, nested as `status:fixed>building:b1`. */
16
+ id: string;
17
+ columnId: string;
18
+ /** The group's value, as a string: react-table keys groups by `String(value)`. */
19
+ value: string;
20
+ depth: number;
21
+ /** Every row the group holds: the loaded ones, or the server's total in manual mode. */
22
+ count: number;
23
+ /** The rows of the group present in `data`. */
24
+ loaded: number;
25
+ /** Absent for a group that has no row and was added from the column's options. */
26
+ row?: Row<TEntity>;
27
+ groups: DataTableGroupNode<TEntity>[];
28
+ rows: Row<TEntity>[];
29
+ };
30
+ /** How many grouping levels `DataTable` draws. Manual mode stops at one. */
31
+ export declare const MAX_GROUPING_DEPTH = 2;
32
+ /** A column's `select` filter options, flattened: the source of a group's label,
33
+ * its colour, its default position and the empty groups worth showing. */
34
+ export declare const groupOptions: (column?: {
35
+ columnDef: {
36
+ meta?: {
37
+ filter?: {
38
+ type: string;
39
+ options?: unknown;
40
+ };
41
+ };
42
+ };
43
+ }) => NormalizedItem[];
44
+ /** A group is open unless the state says `false` for it. A plain `expanded` map
45
+ * lists the open rows, so a group that appears after a filter change would start
46
+ * folded; reading only an explicit `false` keeps new groups open and lets
47
+ * `expanded` hold nothing but the folded ones. */
48
+ export declare const isGroupExpanded: (expanded: ExpandedState, id: string) => boolean;
49
+ /** The next `expanded` state once the group `id` is folded or opened. */
50
+ export declare const toggleGroupExpanded: (expanded: ExpandedState, id: string) => ExpandedState;
51
+ /** Every leaf row under a group, across its sub-groups. */
52
+ export declare const groupLeafRows: <TEntity extends RowData>(node: DataTableGroupNode<TEntity>) => Row<TEntity>[];
53
+ /**
54
+ * Turns react-table's grouped rows into the ordered tree `DataTable` draws.
55
+ *
56
+ * react-table builds the groups and sorts the rows inside them. What it leaves
57
+ * out is done here, per level:
58
+ * - the order of the groups: `meta.groupOrder`, else the order of the server's
59
+ * `groups` (manual mode), else the column's `select` options, else ascending;
60
+ * - the groups that have no row, taken from the options or from `groups`, at the
61
+ * first level only: a second level would repeat every option under every parent;
62
+ * - the counts, which in manual mode come from the server.
63
+ */
64
+ export declare function buildGroupTree<TEntity extends RowData>({ table, rows, grouping, hideEmptyGroups, manualGroups, }: {
65
+ table: DataTableInstance<TEntity>;
66
+ /** The sorted row model's top-level rows: group rows while `grouping` is set. */
67
+ rows: Row<TEntity>[];
68
+ grouping: string[];
69
+ hideEmptyGroups: boolean;
70
+ manualGroups?: ReadonlyArray<DataTableGroup>;
71
+ }): DataTableGroupNode<TEntity>[];
72
+ //# sourceMappingURL=data-table-grouping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-table-grouping.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-grouping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,uBAAuB,CAAA;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAEnE;yEACyE;AACzE,MAAM,MAAM,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7D;;;GAGG;AACH,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,OAAO,IAAI;IACxD,wFAAwF;IACxF,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAA;IACd,kFAAkF;IAClF,GAAG,CAAC,EAAE,GAA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/icons";
4
4
  * `DataTable`'s replaceable icons:
5
5
  * - `asc` / `desc` / `unsorted`: a sortable header's state, also in the stacked options drawer.
6
6
  * - `filter`: a column's filter trigger, and the stacked layout's options button.
7
- * - `search` / `columns`: the toolbar's global search and column-visibility menu.
7
+ * - `search` / `columns` / `group`: the toolbar's global search, column-visibility menu and group menu.
8
+ * - `fold`: a group header's chevron. It points to the inline end and the header turns it down
9
+ * while the group is open.
8
10
  * - `prev` / `next`: the pagination footer.
9
11
  * - `empty` / `error`: the placeholder states' badge; `clear` / `retry`: their actions.
10
12
  * - `min` / `max`: a `number` filter's two bounds.
11
13
  */
12
- export type DataTableIconSlot = "asc" | "desc" | "unsorted" | "filter" | "search" | "columns" | "prev" | "next" | "empty" | "error" | "clear" | "retry" | "min" | "max";
14
+ export type DataTableIconSlot = "asc" | "desc" | "unsorted" | "filter" | "search" | "columns" | "prev" | "next" | "empty" | "error" | "clear" | "retry" | "min" | "max" | "group" | "fold";
13
15
  export type DataTableIcons = IconMap<DataTableIconSlot>;
14
16
  export type ResolvedDataTableIcons = Record<DataTableIconSlot, ReactNode>;
15
17
  /** The pagination footer's slice, for `DataTable.Pagination` on its own. */
@@ -1 +1 @@
1
- {"version":3,"file":"data-table-icons.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-icons.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,EAAE,KAAK,OAAO,EAA0B,MAAM,iBAAiB,CAAA;AAEtE;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GACzB,KAAK,GACL,MAAM,GACN,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,KAAK,GACL,KAAK,CAAA;AACT,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AACvD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAA;AAEzE,4EAA4E;AAC5E,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAA;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,sBAe3B,CAAA;AAED,eAAO,MAAM,qBAAqB,WAAY,cAAc,KAAG,sBACL,CAAA;AAE1D,2EAA2E;AAC3E,eAAO,MAAM,QAAQ,WAAY,KAAK,GAAG,KAAK,GAAG,MAAM,KAAG,KAAK,GAAG,MAAM,GAAG,UACrD,CAAA"}
1
+ {"version":3,"file":"data-table-icons.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-icons.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,EAAE,KAAK,OAAO,EAA0B,MAAM,iBAAiB,CAAA;AAEtE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,iBAAiB,GACzB,KAAK,GACL,MAAM,GACN,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,KAAK,GACL,KAAK,GACL,OAAO,GACP,MAAM,CAAA;AACV,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AACvD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAA;AAEzE,4EAA4E;AAC5E,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAA;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,sBAiB3B,CAAA;AAED,eAAO,MAAM,qBAAqB,WAAY,cAAc,KAAG,sBACL,CAAA;AAE1D,2EAA2E;AAC3E,eAAO,MAAM,QAAQ,WAAY,KAAK,GAAG,KAAK,GAAG,MAAM,KAAG,KAAK,GAAG,MAAM,GAAG,UACrD,CAAA"}
@@ -98,6 +98,15 @@ declare module "@tanstack/react-table" {
98
98
  * there's no `TEntity` to hand it, just
99
99
  * `Array.from({ length: skeletonRowCount })` counters. */
100
100
  skeleton?: ReactNode;
101
+ /** Lists the column in the toolbar's "Group" menu and lets `grouping` name it.
102
+ * Grouping is opt-in per column: set this, or `enableGrouping: true` on the
103
+ * column itself. The column needs an accessor, since a group is the set of
104
+ * rows that share its value. */
105
+ groupable?: boolean;
106
+ /** Orders this column's groups, given two group values (always strings).
107
+ * Default: the order of `filter.options` for a `select` filter, then
108
+ * ascending by value. */
109
+ groupOrder?: (a: string, b: string) => number;
101
110
  }
102
111
  }
103
112
  //# sourceMappingURL=data-table-meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-table-meta.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAA;AAExF;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;AAC3D;;;;wEAIwE;GACtE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,UAAU,CAAC;IAAC,QAAQ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AAE,OAAO,CAAA;QACtB;;;;;;;mEAO2D;QAC3D,QAAQ,CAAC,EAAE,SAAS,CAAA;QACpB;;;yCAGiC;QACjC,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB;;kCAE0B;QAC1B,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;KAC9C;CACF"}
@@ -40,6 +40,9 @@ export type DataTablePaginationProps<TEntity extends RowData> = {
40
40
  table: ReactTableInstance<DataTableFeatures, TEntity>;
41
41
  /** Page-size choices for the `Select`. Default `[10, 20, 50]`. */
42
42
  pageSizeOptions?: number[];
43
+ /** How many rows the current page holds, when the row model can't say: a grouped
44
+ * table's row model counts its group rows too. Default: the row model's length. */
45
+ rowsOnPage?: number;
43
46
  /** Best-effort "next" gate when the total row count is unknown (e.g. a
44
47
  * cursor-backed source) — overrides the row-count heuristic below. */
45
48
  hasNextPage?: boolean;
@@ -70,5 +73,5 @@ export type DataTablePaginationProps<TEntity extends RowData> = {
70
73
  * the current page came back short of a full `pageSize` (the best-effort
71
74
  * signal that there's no next page).
72
75
  */
73
- export declare function DataTablePagination<TEntity extends RowData>({ table, pageSizeOptions, hasNextPage, className, translations: translationsProp, paginationMode, icons, }: DataTablePaginationProps<TEntity>): import("react").JSX.Element;
76
+ export declare function DataTablePagination<TEntity extends RowData>({ table, pageSizeOptions, rowsOnPage: rowsOnPageProp, hasNextPage, className, translations: translationsProp, paginationMode, icons, }: DataTablePaginationProps<TEntity>): import("react").JSX.Element;
74
77
  //# sourceMappingURL=data-table-pagination.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-table-pagination.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,IAAI,kBAAkB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CA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A;AAYD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,SAAS,OAAO,EAAE,EAC3D,KAAK,EACL,eAA8B,EAC9B,WAAW,EACX,SAAS,EACT,YAAY,EAAE,gBAAgB,EAC9B,cAAuB,EACvB,KAAK,GACN,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAqHnC"}
1
+ {"version":3,"file":"data-table-pagination.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,IAAI,kBAAkB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAStC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,KAAK,wBAAwB,EAAiB,MAAM,oBAAoB,CAAA;AAEjF,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;;;;;mDAM+C;IAC/C,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE;QACd,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,EAAE,EAAE,MAAM,CAAA;QACV,UAAU,EAAE,OAAO,CAAA;QACnB,SAAS,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE,CAAA;KACtD,KAAK,SAAS,CAAA;IACf;iEAC6D;IAC7D,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;kDAE8C;IAC9C,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/B,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;sDACkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,wBAAwB,CAAC,OAAO,SAAS,OAAO,IAAI;IAC9D,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;IACrD,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B;wFACoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;2EACuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,yEAAyE;IACzE,YAAY,CAAC,EAAE,+BAA+B,CAAA;IAC9C;;;;2BAIuB;IACvB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,4FAA4F;IAC5F,KAAK,CAAC,EAAE,wBAAwB,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAYD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,SAAS,OAAO,EAAE,EAC3D,KAAK,EACL,eAA8B,EAC9B,UAAU,EAAE,cAAc,EAC1B,WAAW,EACX,SAAS,EACT,YAAY,EAAE,gBAAgB,EAC9B,cAAuB,EACvB,KAAK,GACN,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAqHnC"}
@@ -24,8 +24,12 @@ export declare function columnHelperFor<S extends StandardSchemaV1<unknown, RowD
24
24
  columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
25
25
  columnSizingFeature: import("@tanstack/react-table").TableFeature;
26
26
  columnResizingFeature: import("@tanstack/react-table").TableFeature;
27
+ columnGroupingFeature: import("@tanstack/react-table").TableFeature;
28
+ rowExpandingFeature: import("@tanstack/react-table").TableFeature;
27
29
  filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
30
+ groupedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
28
31
  sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
32
+ expandedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
29
33
  paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
30
34
  sortFns: {
31
35
  alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"data-table-schema.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAGpD;qDACqD;AACrD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,gBAAgB,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;AAErF;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEvF"}
1
+ {"version":3,"file":"data-table-schema.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAGpD;qDACqD;AACrD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,gBAAgB,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;AAErF;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEvF"}
@@ -1,5 +1,6 @@
1
- import { type Table as ReactTableInstance, type RowData } from "@tanstack/react-table";
1
+ import { type GroupingState, type Table as ReactTableInstance, type RowData } from "@tanstack/react-table";
2
2
  import type { DataTableFeatures, Row } from "./data-table-features";
3
+ import { type DataTableGrouping } from "./data-table-group";
3
4
  import { type ResolvedDataTableIcons } from "./data-table-icons";
4
5
  import { type DataTablePlaceholder, type DataTableView } from "./data-table-placeholder";
5
6
  import type { ResolvedDataTableTranslations } from "./data-table-translations";
@@ -15,8 +16,11 @@ import type { ResolvedDataTableTranslations } from "./data-table-translations";
15
16
  * fields from `meta.label`, and `"scroll"` (the default) stays the
16
17
  * SR-faithful path.
17
18
  */
18
- export declare function DataTableStackedRows<TEntity extends RowData>({ rows, view, error, refetching, empty, onRowClick, isRowClickIgnored, onRetry, table, className, skeletonRowCount, translations, icons, }: {
19
+ export declare function DataTableStackedRows<TEntity extends RowData>({ rows, grouping, view, error, refetching, empty, onRowClick, isRowClickIgnored, onRetry, table, className, skeletonRowCount, translations, icons, }: {
19
20
  rows: Row<TEntity>[];
21
+ /** Set while the table is grouped: the cards are then drawn per group, under a
22
+ * heading that folds them, and `rows` is unused. */
23
+ grouping?: DataTableGrouping<TEntity> | null;
20
24
  /** Resolved once in `DataTable` (see the `match` there) and passed down so
21
25
  * the `<table>` and stacked-card renderings never disagree on state. */
22
26
  view: DataTableView;
@@ -41,8 +45,17 @@ export declare function DataTableStackedRows<TEntity extends RowData>({ rows, vi
41
45
  * pattern) listing every sortable column, every filterable column, and —
42
46
  * when `enableColumnVisibility` is set — every column's visibility toggle.
43
47
  */
44
- export declare function DataTableStackOptions<TEntity extends RowData>({ table, enableColumnVisibility, translations, icons, className, }: {
48
+ export declare function DataTableStackOptions<TEntity extends RowData>({ table, enableColumnVisibility, grouping, translations, icons, className, }: {
45
49
  table: ReactTableInstance<DataTableFeatures, TEntity>;
50
+ /** The toolbar's "Group" menu, as this drawer's first section: set when
51
+ * `DataTable` shows that menu, with the same state behind it. */
52
+ grouping?: {
53
+ value: GroupingState;
54
+ onChange: (grouping: GroupingState) => void;
55
+ maxDepth: number;
56
+ hideEmptyGroups: boolean;
57
+ onHideEmptyGroupsChange: (value: boolean) => void;
58
+ };
46
59
  /** Mirrors `DataTable`'s own gate for the toolbar's `DataTableColumnVisibilityMenu`
47
60
  * — passed straight through so both surfaces agree on when column
48
61
  * visibility is editable. */
@@ -1 +1 @@
1
- {"version":3,"file":"data-table-stack.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-stack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,KAAK,IAAI,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAclG,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAGnE,OAAO,EAAE,KAAK,sBAAsB,EAAY,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAA;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,OAAO,EAAE,EAC5D,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,UAAU,EACV,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,KAAK,GACN,EAAE;IACD,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAA;IACpB;6EACyE;IACzE,IAAI,EAAE,aAAa,CAAA;IACnB,KAAK,CAAC,EAAE,oBAAoB,CAAA;IAC5B,KAAK,CAAC,EAAE,oBAAoB,CAAA;IAC5B,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAA;IACnC,iBAAiB,EAAE,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,EAAE,GAAG,EAAE,OAAO,KAAK,OAAO,CAAA;IACxE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;IACrD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,YAAY,EAAE,6BAA6B,CAAA;IAC3C,KAAK,EAAE,sBAAsB,CAAA;CAC9B,+BA+HA;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,OAAO,EAAE,EAC7D,KAAK,EACL,sBAAsB,EACtB,YAAY,EACZ,KAAK,EACL,SAAS,GACV,EAAE;IACD,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;IACrD;;kCAE8B;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,YAAY,EAAE,6BAA6B,CAAA;IAC3C,KAAK,EAAE,sBAAsB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,sCAiKA"}
1
+ {"version":3,"file":"data-table-stack.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/data-table-stack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,KAAK,IAAI,kBAAkB,EAChC,KAAK,OAAO,EACb,MAAM,uBAAuB,CAAA;AAe9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAEnE,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAAE,KAAK,sBAAsB,EAAY,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAA;AAE9E;;;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