@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.
- package/dist/{chunk-YZJUPYPO.js → chunk-2W7H43WL.js} +3 -3
- package/dist/{chunk-YZJUPYPO.js.map → chunk-2W7H43WL.js.map} +1 -1
- package/dist/{chunk-OVT2KZHY.js → chunk-3KARNPW4.js} +3 -3
- package/dist/{chunk-OVT2KZHY.js.map → chunk-3KARNPW4.js.map} +1 -1
- package/dist/chunk-6B2GNPJP.js +43 -0
- package/dist/chunk-6B2GNPJP.js.map +1 -0
- package/dist/{chunk-E52Z2FKU.js → chunk-7BY5I2RB.js} +3 -3
- package/dist/{chunk-E52Z2FKU.js.map → chunk-7BY5I2RB.js.map} +1 -1
- package/dist/{chunk-JFB6O7IY.js → chunk-7KFUFAVP.js} +4 -4
- package/dist/{chunk-JFB6O7IY.js.map → chunk-7KFUFAVP.js.map} +1 -1
- package/dist/{chunk-X3YIHN2U.js → chunk-ASKQ6N5V.js} +3 -3
- package/dist/{chunk-X3YIHN2U.js.map → chunk-ASKQ6N5V.js.map} +1 -1
- package/dist/{chunk-6IRMKF5T.js → chunk-B4GNSSHU.js} +4 -4
- package/dist/{chunk-6IRMKF5T.js.map → chunk-B4GNSSHU.js.map} +1 -1
- package/dist/{chunk-BMEJBY6H.js → chunk-B5YHYI7E.js} +22 -27
- package/dist/chunk-B5YHYI7E.js.map +1 -0
- package/dist/{chunk-PT22KEVD.js → chunk-BGDVUC3B.js} +5 -5
- package/dist/{chunk-PT22KEVD.js.map → chunk-BGDVUC3B.js.map} +1 -1
- package/dist/{chunk-7247WBTV.js → chunk-DJ72KP32.js} +3 -3
- package/dist/{chunk-7247WBTV.js.map → chunk-DJ72KP32.js.map} +1 -1
- package/dist/{chunk-7OGZT7U2.js → chunk-G3AD3NJG.js} +3 -3
- package/dist/{chunk-7OGZT7U2.js.map → chunk-G3AD3NJG.js.map} +1 -1
- package/dist/{chunk-276RL7FX.js → chunk-GJFCIG34.js} +8 -8
- package/dist/{chunk-276RL7FX.js.map → chunk-GJFCIG34.js.map} +1 -1
- package/dist/{chunk-JDPVD2YE.js → chunk-HCHGERDB.js} +3 -3
- package/dist/{chunk-JDPVD2YE.js.map → chunk-HCHGERDB.js.map} +1 -1
- package/dist/{chunk-H7WOMZXO.js → chunk-HWBFRDX7.js} +16 -8
- package/dist/chunk-HWBFRDX7.js.map +1 -0
- package/dist/{chunk-LYGOFMXJ.js → chunk-I4IJOLNA.js} +4 -4
- package/dist/{chunk-LYGOFMXJ.js.map → chunk-I4IJOLNA.js.map} +1 -1
- package/dist/{chunk-7B44J3CF.js → chunk-I53TMAV2.js} +6 -6
- package/dist/{chunk-7B44J3CF.js.map → chunk-I53TMAV2.js.map} +1 -1
- package/dist/{chunk-DSZF2TW6.js → chunk-IA6DCC3N.js} +6 -6
- package/dist/{chunk-DSZF2TW6.js.map → chunk-IA6DCC3N.js.map} +1 -1
- package/dist/{chunk-QEAF57ZQ.js → chunk-ISX3AM32.js} +3 -3
- package/dist/{chunk-QEAF57ZQ.js.map → chunk-ISX3AM32.js.map} +1 -1
- package/dist/{chunk-N42EFOML.js → chunk-K3FZHYJL.js} +6 -6
- package/dist/chunk-K3FZHYJL.js.map +1 -0
- package/dist/{chunk-ZVECQBGG.js → chunk-KNGSO7A3.js} +41 -13
- package/dist/chunk-KNGSO7A3.js.map +1 -0
- package/dist/{chunk-NLSJ6T7V.js → chunk-KYVXPSNW.js} +4 -4
- package/dist/{chunk-NLSJ6T7V.js.map → chunk-KYVXPSNW.js.map} +1 -1
- package/dist/{chunk-J2NW7JID.js → chunk-L5GH7LLD.js} +3 -3
- package/dist/{chunk-J2NW7JID.js.map → chunk-L5GH7LLD.js.map} +1 -1
- package/dist/{chunk-THGJLR5S.js → chunk-NNPSBC7O.js} +5 -5
- package/dist/{chunk-THGJLR5S.js.map → chunk-NNPSBC7O.js.map} +1 -1
- package/dist/{chunk-YMVUQ2L7.js → chunk-P7SH3XWY.js} +6 -6
- package/dist/chunk-P7SH3XWY.js.map +1 -0
- package/dist/{chunk-2CL3FKEY.js → chunk-QEMXXQQO.js} +3 -3
- package/dist/{chunk-2CL3FKEY.js.map → chunk-QEMXXQQO.js.map} +1 -1
- package/dist/{chunk-2NTCQIRP.js → chunk-QRNQQIQM.js} +5 -5
- package/dist/{chunk-2NTCQIRP.js.map → chunk-QRNQQIQM.js.map} +1 -1
- package/dist/{chunk-LKFHUDEW.js → chunk-QVOBLRCM.js} +3 -3
- package/dist/{chunk-LKFHUDEW.js.map → chunk-QVOBLRCM.js.map} +1 -1
- package/dist/{chunk-E3XLWMEB.js → chunk-RKCUXOU2.js} +4 -4
- package/dist/{chunk-E3XLWMEB.js.map → chunk-RKCUXOU2.js.map} +1 -1
- package/dist/{chunk-DMI4KS32.js → chunk-SBZJGFZ6.js} +3 -3
- package/dist/{chunk-DMI4KS32.js.map → chunk-SBZJGFZ6.js.map} +1 -1
- package/dist/{chunk-7P32XCEU.js → chunk-SLUOF7XW.js} +2 -2
- package/dist/chunk-SLUOF7XW.js.map +1 -0
- package/dist/{chunk-SCXXJDKQ.js → chunk-SP6LCCTZ.js} +21 -28
- package/dist/chunk-SP6LCCTZ.js.map +1 -0
- package/dist/{chunk-Y2G47ARQ.js → chunk-TGGNSSOJ.js} +3 -3
- package/dist/{chunk-Y2G47ARQ.js.map → chunk-TGGNSSOJ.js.map} +1 -1
- package/dist/{chunk-2TZU4LSX.js → chunk-ULF5LOBS.js} +3 -3
- package/dist/{chunk-2TZU4LSX.js.map → chunk-ULF5LOBS.js.map} +1 -1
- package/dist/{chunk-D2QIPQ74.js → chunk-W3XX7BYT.js} +2 -2
- package/dist/chunk-W3XX7BYT.js.map +1 -0
- package/dist/{chunk-F374BNL4.js → chunk-YVTM2KRR.js} +12 -8
- package/dist/chunk-YVTM2KRR.js.map +1 -0
- package/dist/colors.css +328 -0
- package/dist/components/action-icon/action-icon.d.ts +6 -5
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +3 -2
- package/dist/components/alert/index.js +2 -2
- package/dist/components/app-shell/index.js +7 -6
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/autocomplete/index.js +4 -4
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/index.js +2 -1
- package/dist/components/button/button.d.ts +11 -9
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +3 -2
- package/dist/components/button-multi-select/index.js +4 -3
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/index.js +4 -3
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/index.js +4 -3
- package/dist/components/calendar-heatmap/index.js +2 -2
- package/dist/components/camera/index.js +11 -10
- package/dist/components/clipboard/index.js +3 -2
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code-block/chrome.js +5 -5
- package/dist/components/code-block/index.js +6 -6
- package/dist/components/combobox/index.js +4 -4
- package/dist/components/combobox-list/index.js +6 -6
- package/dist/components/data-table/data-table-features.d.ts +8 -0
- package/dist/components/data-table/data-table-features.d.ts.map +1 -1
- package/dist/components/data-table/data-table-group.d.ts +128 -0
- package/dist/components/data-table/data-table-group.d.ts.map +1 -0
- package/dist/components/data-table/data-table-grouping.d.ts +72 -0
- package/dist/components/data-table/data-table-grouping.d.ts.map +1 -0
- package/dist/components/data-table/data-table-icons.d.ts +4 -2
- package/dist/components/data-table/data-table-icons.d.ts.map +1 -1
- package/dist/components/data-table/data-table-meta.d.ts +9 -0
- package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
- package/dist/components/data-table/data-table-pagination.d.ts +4 -1
- package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
- package/dist/components/data-table/data-table-schema.d.ts +4 -0
- package/dist/components/data-table/data-table-schema.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts +16 -3
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +33 -2
- package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
- package/dist/components/data-table/data-table-translations.d.ts +35 -0
- package/dist/components/data-table/data-table-translations.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts +55 -3
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.d.ts +3 -1
- package/dist/components/data-table/index.d.ts.map +1 -1
- package/dist/components/data-table/index.js +883 -234
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/index.js +12 -11
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/download-button/index.js +4 -3
- package/dist/components/drawer/index.js +7 -6
- package/dist/components/file-item/index.js +4 -3
- package/dist/components/file-preview/index.js +4 -3
- package/dist/components/file-preview/index.js.map +1 -1
- package/dist/components/file-trigger/index.js +4 -3
- package/dist/components/file-upload/index.js +4 -3
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/hover-card/index.js +3 -3
- package/dist/components/image-cropper/index.js +4 -3
- package/dist/components/kbd/index.js +3 -3
- package/dist/components/lightbox/index.js +9 -8
- package/dist/components/lightbox/index.js.map +1 -1
- package/dist/components/menu/index.js +4 -4
- package/dist/components/modal/index.js +7 -6
- package/dist/components/multi-combobox-list/index.js +6 -6
- package/dist/components/multi-select/index.js +4 -4
- package/dist/components/nav-link/index.js +3 -3
- package/dist/components/nav-link/tanstack.js +3 -3
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.js +18 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/types.d.ts +5 -0
- package/dist/components/notification/types.d.ts.map +1 -1
- package/dist/components/number-input/index.js +4 -4
- package/dist/components/overlays/index.js +9 -8
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/photo-capture/index.js +13 -12
- package/dist/components/photo-capture/index.js.map +1 -1
- package/dist/components/popover/index.js +3 -3
- package/dist/components/schedule/index.js +7 -6
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/select/index.js +5 -5
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spotlight/index.js +11 -10
- package/dist/components/spotlight/index.js.map +1 -1
- package/dist/components/tags-input/index.js +3 -3
- package/dist/components/theme-icon/index.js +1 -1
- package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
- package/dist/components/time-input/index.js +5 -5
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/tree-multi-select/index.js +4 -4
- package/dist/components/tree-select/index.js +4 -4
- package/dist/index.js +2 -2
- package/dist/lib/button-colors.d.ts +25 -0
- package/dist/lib/button-colors.d.ts.map +1 -0
- package/dist/lib/overlay-container.d.ts.map +1 -1
- package/dist/lib/overlay-layer.d.ts +10 -3
- package/dist/lib/overlay-layer.d.ts.map +1 -1
- package/dist/theme.css +14 -6
- package/package.json +1 -1
- package/src/colors.css +328 -0
- package/src/components/action-icon/action-icon.test.tsx +22 -0
- package/src/components/action-icon/action-icon.tsx +24 -28
- package/src/components/badge/badge.test.tsx +53 -10
- package/src/components/badge/badge.tsx +64 -11
- package/src/components/button/button.test.tsx +41 -5
- package/src/components/button/button.tsx +28 -33
- package/src/components/data-table/data-table-features.ts +11 -0
- package/src/components/data-table/data-table-group.test.tsx +1007 -0
- package/src/components/data-table/data-table-group.tsx +474 -0
- package/src/components/data-table/data-table-grouping.ts +160 -0
- package/src/components/data-table/data-table-icons.tsx +8 -1
- package/src/components/data-table/data-table-meta.ts +9 -0
- package/src/components/data-table/data-table-pagination.tsx +5 -1
- package/src/components/data-table/data-table-stack.tsx +165 -43
- package/src/components/data-table/data-table-toolbar.tsx +110 -2
- package/src/components/data-table/data-table-translations.ts +44 -0
- package/src/components/data-table/data-table.tsx +420 -150
- package/src/components/data-table/index.ts +4 -0
- package/src/components/drawer/drawer.tsx +1 -1
- package/src/components/modal/modal.tsx +1 -1
- package/src/components/notification/create-notifier.tsx +18 -2
- package/src/components/notification/notify-in-modal.test.tsx +128 -0
- package/src/components/notification/types.ts +5 -0
- package/src/components/spinner/spinner.tsx +3 -3
- package/src/components/theme-icon/theme-icon.test.tsx +7 -0
- package/src/components/theme-icon/theme-icon.tsx +10 -6
- package/src/lib/button-colors.ts +55 -0
- package/src/lib/overlay-container.tsx +2 -1
- package/src/lib/overlay-layer.test.tsx +63 -1
- package/src/lib/overlay-layer.tsx +29 -6
- package/src/theme.css +14 -6
- package/src/theme.test.ts +14 -10
- package/dist/chunk-7P32XCEU.js.map +0 -1
- package/dist/chunk-BMEJBY6H.js.map +0 -1
- package/dist/chunk-D2QIPQ74.js.map +0 -1
- package/dist/chunk-F374BNL4.js.map +0 -1
- package/dist/chunk-H7WOMZXO.js.map +0 -1
- package/dist/chunk-N42EFOML.js.map +0 -1
- package/dist/chunk-SCXXJDKQ.js.map +0 -1
- package/dist/chunk-YMVUQ2L7.js.map +0 -1
- package/dist/chunk-ZVECQBGG.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveLogicalPlacement } from './chunk-V6PY7C6S.js';
|
|
2
|
-
import { useOverlayContainer } from './chunk-
|
|
2
|
+
import { useOverlayContainer } from './chunk-SLUOF7XW.js';
|
|
3
3
|
import { props } from './chunk-WYCMIIRR.js';
|
|
4
4
|
import { focusStyles } from './chunk-C6NVU4F7.js';
|
|
5
5
|
import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
|
|
@@ -128,5 +128,5 @@ var Tooltip = Object.assign(TooltipComponent, {
|
|
|
128
128
|
});
|
|
129
129
|
|
|
130
130
|
export { Tooltip };
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
132
|
-
//# sourceMappingURL=chunk-
|
|
131
|
+
//# sourceMappingURL=chunk-2W7H43WL.js.map
|
|
132
|
+
//# sourceMappingURL=chunk-2W7H43WL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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,CAAA;AAEO,IAAM,OAAA,GAAU,MAAA,CAAO,MAAA,CAAO,gBAAA,EAAkB;AAAA,EACrD,IAAA;AAAA,EACA,SAASA,SAAA,CAAW,OAAA;AAAA,EACpB,OAAA;AAAA,EACA;AACF,CAAC","file":"chunk-YZJUPYPO.js","sourcesContent":["\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { Tooltip as ArkTooltip } from \"@ark-ui/react/tooltip\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, type ReactNode, useContext } from \"react\"\nimport { match } from \"ts-pattern\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { type LogicalPosition, resolveLogicalPlacement } from \"../../lib/placement\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * Tooltip — the kit's hover/focus **hint**, a styled layer over Ark UI's\n * Tooltip. It's the lightweight counterpart to `Popover` (which is a clickable,\n * focus-trapping panel): Ark's Tooltip machine opens on hover *and* keyboard\n * focus, wires `role=\"tooltip\"` + `aria-describedby` automatically, dismisses on\n * `Esc` / scroll / pointer-down, and never traps focus.\n *\n * Two ways to use it — the convenience form drops into running text or wraps any\n * element; the compound parts mirror `Popover.Root` / `Trigger` / `Content`.\n *\n * // 1. Inline — `children` become a focusable inline trigger\n * <Tooltip label=\"A project at 42.\">norm</Tooltip>\n *\n * // 2. Wrap an element — `asChild` makes the child the trigger\n * <Tooltip label=\"Delete\" asChild>\n * <ActionIcon aria-label=\"Delete\"><Trash /></ActionIcon>\n * </Tooltip>\n *\n * // 3. Compound\n * <Tooltip.Root position=\"end\">\n * <Tooltip.Trigger asChild><Button>Hover</Button></Tooltip.Trigger>\n * <Tooltip.Content>\n * <Tooltip.Arrow />\n * Rich <strong>content</strong>\n * </Tooltip.Content>\n * </Tooltip.Root>\n *\n * Visually it reuses the Popover's open/close animation but renders as a small,\n * **inverted** bubble (dark surface in light mode, light in dark) to read as an\n * ephemeral hint rather than a panel. Add `withArrow` (convenience form) or a\n * `Tooltip.Arrow` part (compound) to point the bubble at its trigger.\n */\n\n/** Inverted compact bubble — reuses the shared `popover-in/out` animation tokens\n * (which already honour reduced-motion in `theme.css`) and the placement-origin\n * trick so it grows out of the trigger's edge. */\nconst tooltipContent = cn(\n \"max-w-[16rem] rounded-xs px-2 py-1\",\n \"text-xs leading-snug focus:outline-none\",\n \"bg-brand-950 text-white dark:bg-white dark:text-brand-950\",\n \"data-[state=open]:animate-popover-in data-[state=closed]:animate-popover-out\",\n \"data-[placement^=top]:origin-bottom data-[placement^=bottom]:origin-top\",\n \"data-[placement^=left]:origin-right data-[placement^=right]:origin-left\",\n)\n\n/** The bubble's shadow lives on the *positioner* (this wrapper), not on the\n * content. A `box-shadow` on the content paints as one unit *with* its\n * background, so it lands on top of the behind-arrow (`-z-1`) and smears\n * across the protruding tip. Hosting the shadow here reorders the paint to\n * shadow → arrow → content: the positioner's shadow sits at the back of its\n * stacking context (it's the `isolate` root), the arrow paints above it, and\n * the content background paints last — so the shadow never touches the arrow,\n * the arrow never covers the label, and the bubble keeps its shadow.\n * `rounded-xs` matches the content radius so the shadow's corners line up. */\nconst tooltipPositioner = \"rounded-xs shadow-md\"\n\n/** Inverted arrow matching the bubble surface. The `!` overrides are required\n * because Ark sets the arrow background via an inline style; `-z-1` tucks the\n * square behind the bubble so only the rotated corner pokes out as the tip. */\nconst tooltipArrow = cn(\"-z-1! rounded-xxs\", \"bg-brand-950! dark:bg-white!\")\n\n/** Resets the `<button type=\"button\">` the default trigger renders down to plain\n * inline text, so a Tooltip can sit on a word inside a `<p>` (a `<button>` is\n * phrasing content) while staying a real, keyboard-focusable control rather\n * than a role-less `tabIndex` span. `cursor-help` signals the hint;\n * `[font:inherit]` and `text-start` undo the UA button's font and centring. */\nconst tooltipTrigger = cva(\n [\n \"inline cursor-help appearance-none border-0 bg-transparent p-0\",\n \"[font:inherit] text-inherit text-start\",\n focusStyles(),\n \"rounded-xs\",\n ],\n {\n variants: {\n variant: {\n text: cn(\"underline decoration-dotted underline-offset-2\", TEXT_COLOR_CLASSES.primary),\n inline: \"\",\n },\n },\n defaultVariants: {\n variant: \"inline\",\n },\n },\n)\n\ntype TooltipPlacement = NonNullable<NonNullable<ArkTooltip.RootProps[\"positioning\"]>[\"placement\"]>\n\n/** `position` accepts Ark's physical placements plus the logical, RTL-aware\n * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */\nexport type TooltipPosition = LogicalPosition<TooltipPlacement>\n\ntype TooltipContextValue = {\n withinPortal: boolean\n container?: HTMLElement | null\n}\nconst TooltipContext = createContext<TooltipContextValue>({ withinPortal: true })\n\nexport type TooltipRootProps = Omit<ArkTooltip.RootProps, \"positioning\"> & {\n /** Bubble placement relative to the trigger. Prefer the logical `start` / `end`\n * sides (RTL-aware), or use any Ark placement (`top`, `bottom`, `top-start`, …).\n * Defaults to `\"top\"`. */\n position?: TooltipPosition\n /** Gap in px between the trigger and the bubble. */\n offset?: number\n /** Render the bubble in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Fires on close (any source) — pointer/focus leaving the trigger, Escape, or a controlled `onOpenChange`. */\n onClose?: () => void\n}\n\nconst Root = ({\n position = \"top\",\n offset,\n withinPortal = true,\n container,\n children,\n onOpenChange,\n onClose,\n ...rest\n}: TooltipRootProps) => {\n const { dir } = useLocaleContext()\n return (\n <TooltipContext.Provider value={{ withinPortal, container }}>\n {/* Mount the bubble only while shown (lazyMount + unmountOnExit): closed →\n nothing rendered, so an inline trigger never emits a positioner <div>\n into a host <p> on SSR. Both are overridable via `...rest`. */}\n <ArkTooltip.Root\n lazyMount\n unmountOnExit\n positioning={{ placement: resolveLogicalPlacement(position, dir), gutter: offset }}\n onOpenChange={(details) => {\n onOpenChange?.(details)\n if (!details.open) onClose?.()\n }}\n {...rest}\n >\n {children}\n </ArkTooltip.Root>\n </TooltipContext.Provider>\n )\n}\n\nexport type TooltipContentProps = ArkTooltip.ContentProps & WithTestId\n\nconst Content = ({ className, children, testId, ...rest }: TooltipContentProps) => {\n const { withinPortal, container } = useContext(TooltipContext)\n const portalContainer = useOverlayContainer(container)\n const bubble = (\n <ArkTooltip.Positioner className={tooltipPositioner}>\n <ArkTooltip.Content\n className={cn(tooltipContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </ArkTooltip.Content>\n </ArkTooltip.Positioner>\n )\n if (!withinPortal) return bubble\n return <Portal container={portalContainer}>{bubble}</Portal>\n}\n\nexport type TooltipArrowProps = NoAsChild<ArkTooltip.ArrowProps> & WithTestId\n\n/** The little arrow linking the bubble to its trigger. Compose it inside a\n * `Tooltip.Content` (or let the convenience form's `withArrow` add it for you).\n * The CSS vars size the square (`--arrow-size`) and pull it back under the\n * bubble (`--arrow-offset`) so it reads as a pointer, not a detached diamond. */\nconst Arrow = ({ className, style, testId, asChild: _asChild, ...rest }: TooltipArrowProps) => (\n <ArkTooltip.Arrow\n style={{ [\"--arrow-size\" as string]: \"12px\", [\"--arrow-offset\" as string]: \"-8px\", ...style }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <ArkTooltip.ArrowTip className={cn(tooltipArrow, className)} />\n </ArkTooltip.Arrow>\n)\n\nexport type TooltipProps = TooltipRootProps &\n WithTestId & {\n /** The hint shown on hover and keyboard focus. Named `label` for parity with\n * the rest of the kit; wired as a description via Ark's `aria-describedby`. */\n label: ReactNode\n /** The trigger. By default it's wrapped in a focusable inline trigger (so it\n * drops into running text); with `asChild`, this element *is* the trigger. */\n children: ReactNode\n /** Render `children` as the trigger instead of wrapping them. */\n asChild?: boolean\n /** Add a small arrow pointing at the trigger. For the compound form, compose\n * `<Tooltip.Arrow />` inside `<Tooltip.Content>` instead. */\n withArrow?: boolean\n variant?: VariantProps<typeof tooltipTrigger>[\"variant\"]\n classNames?: { trigger?: string; content?: string; arrow?: string }\n }\n\n/** Convenience form: `Root` + `Trigger` + `Content` wired from `label`/`children`.\n * `testId` lands on `Content` (the rendered bubble) — `Root` has no DOM node\n * of its own. */\nconst TooltipComponent = ({\n label,\n children,\n asChild,\n classNames,\n withArrow,\n variant = \"inline\",\n testId,\n ...root\n}: TooltipProps) => {\n return (\n <Root {...root}>\n {match({ asChild })\n .with({ asChild: true }, () => <ArkTooltip.Trigger asChild>{children}</ArkTooltip.Trigger>)\n .otherwise(() => (\n // Ark wires `aria-describedby` to the bubble itself, while it's shown.\n <ArkTooltip.Trigger\n type=\"button\"\n className={cn(tooltipTrigger({ variant }), classNames?.trigger)}\n >\n {children}\n </ArkTooltip.Trigger>\n ))}\n <Content className={classNames?.content} testId={testId}>\n {withArrow && <Arrow className={classNames?.arrow} />}\n {label}\n </Content>\n </Root>\n )\n}\n\nexport const Tooltip = Object.assign(TooltipComponent, {\n Root,\n Trigger: ArkTooltip.Trigger,\n Content,\n Arrow,\n})\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/tooltip/tooltip.tsx"],"names":["ArkTooltip"],"mappings":";;;;;;;;;;;;;;AAqDA,IAAM,cAAA,GAAiB,EAAA;AAAA,EACrB,oCAAA;AAAA,EACA,yCAAA;AAAA,EACA,2DAAA;AAAA,EACA,8EAAA;AAAA,EACA,yEAAA;AAAA,EACA;AACF,CAAA;AAWA,IAAM,iBAAA,GAAoB,sBAAA;AAK1B,IAAM,YAAA,GAAe,EAAA,CAAG,mBAAA,EAAqB,8BAA8B,CAAA;AAO3E,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB;AAAA,IACE,gEAAA;AAAA,IACA,wCAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ;AAAA,GACF;AAAA,EACA;AAA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A;AAAA,EACA,GAAG;AACL,CAAA,KAAoB;AAClB,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAM,GAAG,IAAA,EACP,QAAA,EAAA;AAAA,IAAA,KAAA,CAAM,EAAE,OAAA,EAAS,EACf,IAAA,CAAK,EAAE,SAAS,IAAA,EAAK,EAAG,sBAAM,GAAA,CAACA,SAAA,CAAW,SAAX,EAAmB,OAAA,EAAO,MAAE,QAAA,EAAS,CAAqB,EACzF,SAAA,CAAU;AAAA;AAAA,sBAET,GAAA;AAAA,QAACA,SAAA,CAAW,OAAA;AAAA,QAAX;AAAA,UACC,IAAA,EAAK,QAAA;AAAA,UACL,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,CAAA,EAAG,YAAY,OAAO,CAAA;AAAA,UAE7D;AAAA;AAAA;AACH,KACD,CAAA;AAAA,oBACH,IAAA,CAAC,OAAA,EAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,SAAS,MAAA,EACtC,QAAA,EAAA;AAAA,MAAA,SAAA,oBAAa,GAAA,CAAC,KAAA,EAAA,EAAM,SAAA,EAAW,UAAA,EAAY,KAAA,EAAO,CAAA;AAAA,MAClD;AAAA,KAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ,CAAA;AAEO,IAAM,OAAA,GAAU,MAAA,CAAO,MAAA,CAAO,gBAAA,EAAkB;AAAA,EACrD,IAAA;AAAA,EACA,SAASA,SAAA,CAAW,OAAA;AAAA,EACpB,OAAA;AAAA,EACA;AACF,CAAC","file":"chunk-2W7H43WL.js","sourcesContent":["\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { Tooltip as ArkTooltip } from \"@ark-ui/react/tooltip\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, type ReactNode, useContext } from \"react\"\nimport { match } from \"ts-pattern\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { type LogicalPosition, resolveLogicalPlacement } from \"../../lib/placement\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * Tooltip — the kit's hover/focus **hint**, a styled layer over Ark UI's\n * Tooltip. It's the lightweight counterpart to `Popover` (which is a clickable,\n * focus-trapping panel): Ark's Tooltip machine opens on hover *and* keyboard\n * focus, wires `role=\"tooltip\"` + `aria-describedby` automatically, dismisses on\n * `Esc` / scroll / pointer-down, and never traps focus.\n *\n * Two ways to use it — the convenience form drops into running text or wraps any\n * element; the compound parts mirror `Popover.Root` / `Trigger` / `Content`.\n *\n * // 1. Inline — `children` become a focusable inline trigger\n * <Tooltip label=\"A project at 42.\">norm</Tooltip>\n *\n * // 2. Wrap an element — `asChild` makes the child the trigger\n * <Tooltip label=\"Delete\" asChild>\n * <ActionIcon aria-label=\"Delete\"><Trash /></ActionIcon>\n * </Tooltip>\n *\n * // 3. Compound\n * <Tooltip.Root position=\"end\">\n * <Tooltip.Trigger asChild><Button>Hover</Button></Tooltip.Trigger>\n * <Tooltip.Content>\n * <Tooltip.Arrow />\n * Rich <strong>content</strong>\n * </Tooltip.Content>\n * </Tooltip.Root>\n *\n * Visually it reuses the Popover's open/close animation but renders as a small,\n * **inverted** bubble (dark surface in light mode, light in dark) to read as an\n * ephemeral hint rather than a panel. Add `withArrow` (convenience form) or a\n * `Tooltip.Arrow` part (compound) to point the bubble at its trigger.\n */\n\n/** Inverted compact bubble — reuses the shared `popover-in/out` animation tokens\n * (which already honour reduced-motion in `theme.css`) and the placement-origin\n * trick so it grows out of the trigger's edge. */\nconst tooltipContent = cn(\n \"max-w-[16rem] rounded-xs px-2 py-1\",\n \"text-xs leading-snug focus:outline-none\",\n \"bg-brand-950 text-white dark:bg-white dark:text-brand-950\",\n \"data-[state=open]:animate-popover-in data-[state=closed]:animate-popover-out\",\n \"data-[placement^=top]:origin-bottom data-[placement^=bottom]:origin-top\",\n \"data-[placement^=left]:origin-right data-[placement^=right]:origin-left\",\n)\n\n/** The bubble's shadow lives on the *positioner* (this wrapper), not on the\n * content. A `box-shadow` on the content paints as one unit *with* its\n * background, so it lands on top of the behind-arrow (`-z-1`) and smears\n * across the protruding tip. Hosting the shadow here reorders the paint to\n * shadow → arrow → content: the positioner's shadow sits at the back of its\n * stacking context (it's the `isolate` root), the arrow paints above it, and\n * the content background paints last — so the shadow never touches the arrow,\n * the arrow never covers the label, and the bubble keeps its shadow.\n * `rounded-xs` matches the content radius so the shadow's corners line up. */\nconst tooltipPositioner = \"rounded-xs shadow-md\"\n\n/** Inverted arrow matching the bubble surface. The `!` overrides are required\n * because Ark sets the arrow background via an inline style; `-z-1` tucks the\n * square behind the bubble so only the rotated corner pokes out as the tip. */\nconst tooltipArrow = cn(\"-z-1! rounded-xxs\", \"bg-brand-950! dark:bg-white!\")\n\n/** Resets the `<button type=\"button\">` the default trigger renders down to plain\n * inline text, so a Tooltip can sit on a word inside a `<p>` (a `<button>` is\n * phrasing content) while staying a real, keyboard-focusable control rather\n * than a role-less `tabIndex` span. `cursor-help` signals the hint;\n * `[font:inherit]` and `text-start` undo the UA button's font and centring. */\nconst tooltipTrigger = cva(\n [\n \"inline cursor-help appearance-none border-0 bg-transparent p-0\",\n \"[font:inherit] text-inherit text-start\",\n focusStyles(),\n \"rounded-xs\",\n ],\n {\n variants: {\n variant: {\n text: cn(\"underline decoration-dotted underline-offset-2\", TEXT_COLOR_CLASSES.primary),\n inline: \"\",\n },\n },\n defaultVariants: {\n variant: \"inline\",\n },\n },\n)\n\ntype TooltipPlacement = NonNullable<NonNullable<ArkTooltip.RootProps[\"positioning\"]>[\"placement\"]>\n\n/** `position` accepts Ark's physical placements plus the logical, RTL-aware\n * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */\nexport type TooltipPosition = LogicalPosition<TooltipPlacement>\n\ntype TooltipContextValue = {\n withinPortal: boolean\n container?: HTMLElement | null\n}\nconst TooltipContext = createContext<TooltipContextValue>({ withinPortal: true })\n\nexport type TooltipRootProps = Omit<ArkTooltip.RootProps, \"positioning\"> & {\n /** Bubble placement relative to the trigger. Prefer the logical `start` / `end`\n * sides (RTL-aware), or use any Ark placement (`top`, `bottom`, `top-start`, …).\n * Defaults to `\"top\"`. */\n position?: TooltipPosition\n /** Gap in px between the trigger and the bubble. */\n offset?: number\n /** Render the bubble in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Fires on close (any source) — pointer/focus leaving the trigger, Escape, or a controlled `onOpenChange`. */\n onClose?: () => void\n}\n\nconst Root = ({\n position = \"top\",\n offset,\n withinPortal = true,\n container,\n children,\n onOpenChange,\n onClose,\n ...rest\n}: TooltipRootProps) => {\n const { dir } = useLocaleContext()\n return (\n <TooltipContext.Provider value={{ withinPortal, container }}>\n {/* Mount the bubble only while shown (lazyMount + unmountOnExit): closed →\n nothing rendered, so an inline trigger never emits a positioner <div>\n into a host <p> on SSR. Both are overridable via `...rest`. */}\n <ArkTooltip.Root\n lazyMount\n unmountOnExit\n positioning={{ placement: resolveLogicalPlacement(position, dir), gutter: offset }}\n onOpenChange={(details) => {\n onOpenChange?.(details)\n if (!details.open) onClose?.()\n }}\n {...rest}\n >\n {children}\n </ArkTooltip.Root>\n </TooltipContext.Provider>\n )\n}\n\nexport type TooltipContentProps = ArkTooltip.ContentProps & WithTestId\n\nconst Content = ({ className, children, testId, ...rest }: TooltipContentProps) => {\n const { withinPortal, container } = useContext(TooltipContext)\n const portalContainer = useOverlayContainer(container)\n const bubble = (\n <ArkTooltip.Positioner className={tooltipPositioner}>\n <ArkTooltip.Content\n className={cn(tooltipContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </ArkTooltip.Content>\n </ArkTooltip.Positioner>\n )\n if (!withinPortal) return bubble\n return <Portal container={portalContainer}>{bubble}</Portal>\n}\n\nexport type TooltipArrowProps = NoAsChild<ArkTooltip.ArrowProps> & WithTestId\n\n/** The little arrow linking the bubble to its trigger. Compose it inside a\n * `Tooltip.Content` (or let the convenience form's `withArrow` add it for you).\n * The CSS vars size the square (`--arrow-size`) and pull it back under the\n * bubble (`--arrow-offset`) so it reads as a pointer, not a detached diamond. */\nconst Arrow = ({ className, style, testId, asChild: _asChild, ...rest }: TooltipArrowProps) => (\n <ArkTooltip.Arrow\n style={{ [\"--arrow-size\" as string]: \"12px\", [\"--arrow-offset\" as string]: \"-8px\", ...style }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <ArkTooltip.ArrowTip className={cn(tooltipArrow, className)} />\n </ArkTooltip.Arrow>\n)\n\nexport type TooltipProps = TooltipRootProps &\n WithTestId & {\n /** The hint shown on hover and keyboard focus. Named `label` for parity with\n * the rest of the kit; wired as a description via Ark's `aria-describedby`. */\n label: ReactNode\n /** The trigger. By default it's wrapped in a focusable inline trigger (so it\n * drops into running text); with `asChild`, this element *is* the trigger. */\n children: ReactNode\n /** Render `children` as the trigger instead of wrapping them. */\n asChild?: boolean\n /** Add a small arrow pointing at the trigger. For the compound form, compose\n * `<Tooltip.Arrow />` inside `<Tooltip.Content>` instead. */\n withArrow?: boolean\n variant?: VariantProps<typeof tooltipTrigger>[\"variant\"]\n classNames?: { trigger?: string; content?: string; arrow?: string }\n }\n\n/** Convenience form: `Root` + `Trigger` + `Content` wired from `label`/`children`.\n * `testId` lands on `Content` (the rendered bubble) — `Root` has no DOM node\n * of its own. */\nconst TooltipComponent = ({\n label,\n children,\n asChild,\n classNames,\n withArrow,\n variant = \"inline\",\n testId,\n ...root\n}: TooltipProps) => {\n return (\n <Root {...root}>\n {match({ asChild })\n .with({ asChild: true }, () => <ArkTooltip.Trigger asChild>{children}</ArkTooltip.Trigger>)\n .otherwise(() => (\n // Ark wires `aria-describedby` to the bubble itself, while it's shown.\n <ArkTooltip.Trigger\n type=\"button\"\n className={cn(tooltipTrigger({ variant }), classNames?.trigger)}\n >\n {children}\n </ArkTooltip.Trigger>\n ))}\n <Content className={classNames?.content} testId={testId}>\n {withArrow && <Arrow className={classNames?.arrow} />}\n {label}\n </Content>\n </Root>\n )\n}\n\nexport const Tooltip = Object.assign(TooltipComponent, {\n Root,\n Trigger: ArkTooltip.Trigger,\n Content,\n Arrow,\n})\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from './chunk-
|
|
1
|
+
import { Button } from './chunk-SP6LCCTZ.js';
|
|
2
2
|
import { props } from './chunk-WYCMIIRR.js';
|
|
3
3
|
import { ark } from '@ark-ui/react';
|
|
4
4
|
import { useRef } from 'react';
|
|
@@ -89,5 +89,5 @@ var FileTrigger = ({
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
export { FileTrigger };
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-3KARNPW4.js.map
|
|
93
|
+
//# sourceMappingURL=chunk-3KARNPW4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/file-trigger/file-trigger.tsx"],"names":[],"mappings":";;;;;;AA8CO,IAAM,cAAc,CAAC;AAAA,EAC1B,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAwB;AACtB,EAAA,MAAM,KAAA,GAAQ,OAAyB,IAAI,CAAA;AAI3C,EAAA,MAAM,IAAA,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AAA,EAAU,MAAA;AAAA,QACV,YAAA,EAAW,cAAA;AAAA,QACX,WAAA,EAAU;AAAA;AAAA;AACZ,GAAA,EACF,CAAA;AAEJ","file":"chunk-3KARNPW4.js","sourcesContent":["\"use client\"\n\nimport { ark } from \"@ark-ui/react\"\nimport { type ChangeEvent, type MouseEvent, useRef } from \"react\"\nimport { props } from \"../../lib/props\"\nimport { Button, type ButtonProps } from \"../button/button\"\n\n/**\n * FileTrigger — a button that opens the OS file picker (or, on a phone, the\n * native camera), backed by a hidden `<input type=\"file\">`. It has no\n * dropzone and no file list: it hands the picked `File[]` to `onSelect` and\n * leaves the rest to you. Reach for `FileUpload` when you want the full\n * field.\n *\n * - Renders a kit `Button` by default, and takes every Button prop. With\n * `asChild`, any element becomes the trigger: an `ActionIcon`, a link\n * styled as a button, a `Menu.Item`. Style the child then; Button's own\n * style props (`variant`, `size`, …) only apply to the default render.\n * - `capture` asks a phone for its camera instead of the library. Desktop\n * browsers ignore it and open the file picker.\n * - The input is cleared after each pick, so choosing the same file twice\n * fires `onSelect` twice. Pass `name` and the input keeps its files\n * instead, so a native `<form>` submits them.\n * - The trigger is the only element a keyboard or a screen reader reaches;\n * the input is `hidden`, out of the tab order and out of the a11y tree.\n *\n * ```tsx\n * <FileTrigger accept=\"image/*\" onSelect={([file]) => setAvatar(file)}>\n * Choose a photo\n * </FileTrigger>\n * ```\n */\n\nexport type FileTriggerProps = Omit<ButtonProps, \"onSelect\" | \"name\" | \"type\"> & {\n /** Accepted types: MIME types, globs or extensions (`\"image/*\"`, `[\".pdf\", \".docx\"]`). */\n accept?: string | string[]\n /** Opens a phone's camera, front (`\"user\"`) or back (`\"environment\"`), instead of the library. */\n capture?: \"user\" | \"environment\"\n /** Allows picking several files at once. */\n multiple?: boolean\n /** Fires with the picked files. */\n onSelect?: (files: File[]) => void\n /** Wires the hidden input into native form submission; the input then keeps its files. */\n name?: string\n}\n\nexport const FileTrigger = ({\n accept,\n capture,\n multiple,\n onSelect,\n name,\n disabled,\n asChild,\n children,\n testId,\n onClick,\n variant,\n size,\n color,\n loading,\n startSlot,\n endSlot,\n ...rest\n}: FileTriggerProps) => {\n const input = useRef<HTMLInputElement>(null)\n\n // `onClick` runs first, so a caller can `preventDefault()` to keep the\n // picker shut (a confirm step, a quota check).\n const open = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n if (!event.defaultPrevented && !disabled) input.current?.click()\n }\n\n const select = (event: ChangeEvent<HTMLInputElement>) => {\n onSelect?.(Array.from(event.currentTarget.files ?? []))\n // A file input only fires `change` when its value changes, so picking the\n // same file again would be silent. A named input is form state, so it\n // keeps what was picked.\n if (name == null) event.currentTarget.value = \"\"\n }\n\n const trigger = {\n \"data-scope\": \"file-trigger\",\n \"data-part\": \"trigger\",\n onClick: open,\n ...props({ \"data-testid\": testId, \"data-disabled\": disabled }),\n ...rest,\n }\n\n return (\n <>\n {asChild ? (\n // Only behaviour is merged onto the child: Button's styling would\n // fight an ActionIcon's or a link's own.\n <ark.button\n asChild\n disabled={disabled}\n {...props({ \"aria-disabled\": disabled })}\n {...trigger}\n >\n {children}\n </ark.button>\n ) : (\n <Button\n variant={variant}\n size={size}\n color={color}\n loading={loading}\n startSlot={startSlot}\n endSlot={endSlot}\n disabled={disabled}\n {...trigger}\n >\n {children}\n </Button>\n )}\n <input\n ref={input}\n type=\"file\"\n hidden\n tabIndex={-1}\n aria-hidden\n accept={Array.isArray(accept) ? accept.join(\",\") : accept}\n capture={capture}\n multiple={multiple}\n name={name}\n disabled={disabled}\n onChange={select}\n data-scope=\"file-trigger\"\n data-part=\"input\"\n />\n </>\n )\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/lib/button-colors.ts
|
|
2
|
+
var buttonColorVariants = {
|
|
3
|
+
filled: [
|
|
4
|
+
"bg-(--btn-solid) text-(--btn-on-solid)",
|
|
5
|
+
"not-data-loading:hover:bg-(--btn-solid-hover)",
|
|
6
|
+
"disabled:not-data-loading:bg-(--btn-disabled-bg) data-disabled:bg-(--btn-disabled-bg)",
|
|
7
|
+
"disabled:not-data-loading:border-(--btn-disabled-border) data-disabled:border-(--btn-disabled-border)",
|
|
8
|
+
"disabled:not-data-loading:text-(--btn-disabled-text) data-disabled:text-(--btn-disabled-text)"
|
|
9
|
+
],
|
|
10
|
+
light: [
|
|
11
|
+
"bg-(--btn-light-bg) border-(--btn-light-border) text-(--btn-light-text)",
|
|
12
|
+
"not-data-loading:hover:bg-(--btn-light-hover-bg)",
|
|
13
|
+
"not-data-loading:hover:border-(--btn-light-hover-border)",
|
|
14
|
+
"not-data-loading:hover:text-(--btn-light-hover-text)",
|
|
15
|
+
"disabled:not-data-loading:bg-(--btn-light-disabled-bg) data-disabled:bg-(--btn-light-disabled-bg)",
|
|
16
|
+
"disabled:not-data-loading:border-(--btn-light-disabled-border) data-disabled:border-(--btn-light-disabled-border)",
|
|
17
|
+
"disabled:not-data-loading:text-(--btn-disabled-text) data-disabled:text-(--btn-disabled-text)"
|
|
18
|
+
],
|
|
19
|
+
outline: [
|
|
20
|
+
"bg-transparent border-(--btn-outline-border) text-(--btn-outline-text)",
|
|
21
|
+
"not-data-loading:hover:bg-(--btn-outline-hover-bg)",
|
|
22
|
+
"not-data-loading:hover:border-(--btn-outline-hover-border)",
|
|
23
|
+
"not-data-loading:hover:text-(--btn-outline-hover-text)",
|
|
24
|
+
"disabled:not-data-loading:bg-(--btn-disabled-bg) data-disabled:bg-(--btn-disabled-bg)",
|
|
25
|
+
"disabled:not-data-loading:border-(--btn-disabled-border) data-disabled:border-(--btn-disabled-border)",
|
|
26
|
+
"disabled:not-data-loading:text-(--btn-disabled-text) data-disabled:text-(--btn-disabled-text)"
|
|
27
|
+
],
|
|
28
|
+
subtle: [
|
|
29
|
+
"bg-transparent text-(--btn-subtle-text)",
|
|
30
|
+
"not-data-loading:hover:bg-(--btn-subtle-hover-bg)",
|
|
31
|
+
"not-data-loading:hover:text-(--btn-subtle-hover-text)",
|
|
32
|
+
"disabled:not-data-loading:text-(--btn-disabled-text) data-disabled:text-(--btn-disabled-text)"
|
|
33
|
+
],
|
|
34
|
+
link: [
|
|
35
|
+
"bg-transparent text-(--btn-link-text) underline underline-offset-2",
|
|
36
|
+
"not-data-loading:hover:text-(--btn-link-hover)",
|
|
37
|
+
"disabled:not-data-loading:text-(--btn-disabled-text) data-disabled:text-(--btn-disabled-text)"
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { buttonColorVariants };
|
|
42
|
+
//# sourceMappingURL=chunk-6B2GNPJP.js.map
|
|
43
|
+
//# sourceMappingURL=chunk-6B2GNPJP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/button-colors.ts"],"names":[],"mappings":";AAiBO,IAAM,mBAAA,GAAsB;AAAA,EACjC,MAAA,EAAQ;AAAA,IACN,wCAAA;AAAA,IACA,+CAAA;AAAA,IACA,uFAAA;AAAA,IACA,uGAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,KAAA,EAAO;AAAA,IACL,yEAAA;AAAA,IACA,kDAAA;AAAA,IACA,0DAAA;AAAA,IACA,sDAAA;AAAA,IACA,mGAAA;AAAA,IACA,mHAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,OAAA,EAAS;AAAA,IACP,wEAAA;AAAA,IACA,oDAAA;AAAA,IACA,4DAAA;AAAA,IACA,wDAAA;AAAA,IACA,uFAAA;AAAA,IACA,uGAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,yCAAA;AAAA,IACA,mDAAA;AAAA,IACA,uDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,oEAAA;AAAA,IACA,gDAAA;AAAA,IACA;AAAA;AAEJ","file":"chunk-6B2GNPJP.js","sourcesContent":["/**\n * Colour classes shared by Button and ActionIcon, one entry per variant.\n *\n * Every value comes from the `--btn-*` slots in `colors.css`, which copy the\n * 42 UI Kit V3 Figma `Buttons/Button` set (Figma's ActionIcon is an instance\n * of it). Shape, size and layout stay in each component's own `cva`.\n *\n * Hovers are gated on `not-data-loading:` so a loading control keeps its\n * resting colours. Disabled colours are keyed twice: `:disabled` for a real\n * `<button>` (scoped off while loading, which also sets native `disabled`)\n * and `data-disabled` for an `asChild` element, where `:disabled` never\n * matches.\n *\n * Every class is written out in full: Tailwind only generates CSS for class\n * names it finds literally in the source, so composing the prefixes with a\n * template string would silently drop every hover and disabled rule.\n */\nexport const buttonColorVariants = {\n filled: [\n \"bg-(--btn-solid) text-(--btn-on-solid)\",\n \"not-data-loading:hover:bg-(--btn-solid-hover)\",\n \"disabled:not-data-loading:bg-(--btn-disabled-bg) data-disabled:bg-(--btn-disabled-bg)\",\n \"disabled:not-data-loading:border-(--btn-disabled-border) data-disabled:border-(--btn-disabled-border)\",\n \"disabled:not-data-loading:text-(--btn-disabled-text) data-disabled:text-(--btn-disabled-text)\",\n ],\n light: [\n \"bg-(--btn-light-bg) border-(--btn-light-border) text-(--btn-light-text)\",\n \"not-data-loading:hover:bg-(--btn-light-hover-bg)\",\n \"not-data-loading:hover:border-(--btn-light-hover-border)\",\n \"not-data-loading:hover:text-(--btn-light-hover-text)\",\n \"disabled:not-data-loading:bg-(--btn-light-disabled-bg) data-disabled:bg-(--btn-light-disabled-bg)\",\n \"disabled:not-data-loading:border-(--btn-light-disabled-border) data-disabled:border-(--btn-light-disabled-border)\",\n \"disabled:not-data-loading:text-(--btn-disabled-text) data-disabled:text-(--btn-disabled-text)\",\n ],\n outline: [\n \"bg-transparent border-(--btn-outline-border) text-(--btn-outline-text)\",\n \"not-data-loading:hover:bg-(--btn-outline-hover-bg)\",\n \"not-data-loading:hover:border-(--btn-outline-hover-border)\",\n \"not-data-loading:hover:text-(--btn-outline-hover-text)\",\n \"disabled:not-data-loading:bg-(--btn-disabled-bg) data-disabled:bg-(--btn-disabled-bg)\",\n \"disabled:not-data-loading:border-(--btn-disabled-border) data-disabled:border-(--btn-disabled-border)\",\n \"disabled:not-data-loading:text-(--btn-disabled-text) data-disabled:text-(--btn-disabled-text)\",\n ],\n subtle: [\n \"bg-transparent text-(--btn-subtle-text)\",\n \"not-data-loading:hover:bg-(--btn-subtle-hover-bg)\",\n \"not-data-loading:hover:text-(--btn-subtle-hover-text)\",\n \"disabled:not-data-loading:text-(--btn-disabled-text) data-disabled:text-(--btn-disabled-text)\",\n ],\n link: [\n \"bg-transparent text-(--btn-link-text) underline underline-offset-2\",\n \"not-data-loading:hover:text-(--btn-link-hover)\",\n \"disabled:not-data-loading:text-(--btn-disabled-text) data-disabled:text-(--btn-disabled-text)\",\n ],\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { calendarValueToDate, dateToArkValue, fromArkValues, toArkValues } from './chunk-ZB5VMGKB.js';
|
|
2
2
|
import { useTimeZone } from './chunk-IUK7OJXZ.js';
|
|
3
|
-
import { ActionIcon } from './chunk-
|
|
3
|
+
import { ActionIcon } from './chunk-B5YHYI7E.js';
|
|
4
4
|
import { warnRenamedProp } from './chunk-LIZWCWED.js';
|
|
5
5
|
import { useIsomorphicLayoutEffect } from './chunk-BUIHQJGE.js';
|
|
6
6
|
import { ChevronRightIcon, ChevronLeftIcon } from './chunk-6YNLRQ25.js';
|
|
@@ -422,5 +422,5 @@ var Calendar = ({
|
|
|
422
422
|
};
|
|
423
423
|
|
|
424
424
|
export { Calendar, CalendarBody, CalendarZoneSync, calendarGridWidth, hashArkValues, resolveCalendarTranslations };
|
|
425
|
-
//# sourceMappingURL=chunk-
|
|
426
|
-
//# sourceMappingURL=chunk-
|
|
425
|
+
//# sourceMappingURL=chunk-7BY5I2RB.js.map
|
|
426
|
+
//# sourceMappingURL=chunk-7BY5I2RB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/calendar/calendar-body.tsx","../src/components/calendar/calendar-zone-sync.tsx","../src/components/calendar/calendar.tsx"],"names":["Ark","useRef","jsxs","jsx"],"mappings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AAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,sBAAA,EAAwB,SAAA,EAAW,YAAY,IAAI,CAAA;AAAA,MAChE,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAanC,QAAA,EAAA;AAAA,wBAAAG,GAAAA;AAAA,UAAC,gBAAA;AAAA,UAAA;AAAA,YACC,QAAA,EAAU,gBAAA;AAAA,YACV,YAAY,KAAA,KAAU,MAAA;AAAA,YACtB,UAAA,EAAY;AAAA;AAAA,SACd;AAAA,wBACAA,GAAAA,CAACH,UAAAA,CAAI,OAAA,EAAJ,EACC,QAAA,kBAAAG,GAAAA;AAAA,UAAC,YAAA;AAAA,UAAA;AAAA,YACC,WAAA;AAAA,YACA,eAAA;AAAA,YACA,SAAA,EAAW,cAAc,CAAC,IAAA,EAAM,QAAQ,SAAA,CAAU,IAAA,EAAM,QAAA,CAAS,GAAG,CAAC,CAAA,CAAA;AAAA,YACrE,IAAA;AAAA,YACA,QAAA,EAAU,gBAAA;AAAA,YACV,UAAA;AAAA,YACA;AAAA;AAAA,SACF,EACF;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-E52Z2FKU.js","sourcesContent":["import { DatePicker as Ark } from \"@ark-ui/react/date-picker\"\nimport { cva } from \"class-variance-authority\"\nimport type { ReactNode } from \"react\"\nimport { match } from \"ts-pattern\"\nimport { cn } from \"../../lib/cn\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { ActionIcon } from \"../action-icon/action-icon\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../popover/icons\"\n\n/**\n * CalendarBody — the shared grid module behind both `Calendar` (inline) and, later,\n * `DatePicker` (popover): the RFC §3 \"one implementation, not two\" module. It renders only the\n * grid anatomy (`View` / `ViewControl` / nav triggers / `Table*` / `MonthSelect` / `YearSelect`)\n * — deliberately **not** `Control` / `Content` / `Positioner` / `Trigger` / `ClearTrigger`, the\n * popover-only chrome that belongs to `DatePicker`, not here.\n *\n * Every part below self-connects to the nearest ancestor `Ark.Root` via Ark's own React\n * context, so this module needs no `api` prop threaded in — both `Calendar` and `DatePicker`\n * just mount it as a plain child inside their own differently-configured `Ark.Root`.\n *\n * Not barrel-exported (no export from `calendar/index.ts`) — `DatePicker` reaches it directly\n * via `import { CalendarBody } from \"../calendar/calendar-body\"`, the established cross-folder\n * pattern for a shared internal part (`multi-select.tsx` → `../combobox/combobox`,\n * `drawer.tsx` → `../action-icon/action-icon`).\n */\n\nexport type CalendarBodyClassNames = {\n /** The prev/label/next navigation row. */\n header?: string\n /** Each rendered `<table>` (one per visible month in the day view). */\n table?: string\n /** Each day cell's clickable trigger. */\n day?: string\n}\n\nexport type CalendarIconSlot = \"prev\" | \"next\"\nexport type CalendarIcons = IconMap<CalendarIconSlot>\n\n/** The default icons. The glyphs are physical; prev sits on the inline-start\n * edge, which is the right one under RTL, so both chevrons mirror there to\n * keep pointing outward. A consumer's icon is drawn as given. */\nexport const DEFAULT_ICONS: Record<CalendarIconSlot, ReactNode> = {\n prev: <ChevronLeftIcon className=\"rtl:-scale-x-100\" />,\n next: <ChevronRightIcon className=\"rtl:-scale-x-100\" />,\n}\n\nexport type CalendarBodyProps = {\n /** Months shown side by side in the day view. */\n numOfMonths?: number\n withWeekNumbers?: boolean\n /** Per-day decoration slot (RFC §9's \"event dot\"). Receives a native `Date` — converted from\n * Ark's `DateValue` at the point of the call, via the same `timeZone` the root was configured\n * with — and the day's live selection state. */\n renderDay?: (date: Date, ctx: { isUnavailable: boolean; isSelected: boolean }) => ReactNode\n size?: Size\n /** The time zone the nearest `Ark.Root` was configured with. Required (not read from Ark's\n * own api, which exposes no public `timeZone` getter) so `renderDay`'s Date conversion uses\n * the exact same boundary `Calendar`/`DatePicker` used to build the root's own value —\n * see `lib/date-value.ts`'s module doc on why this one conversion point matters. */\n timeZone: string\n classNames?: CalendarBodyClassNames\n /** Replaces the prev/next icons. Drawn as given, never restroked or mirrored. */\n icons?: CalendarIcons\n}\n\nconst dayCellTrigger = cva(\n [\n \"relative flex size-full items-center justify-center rounded-xs\",\n \"cursor-pointer select-none tabular-nums transition-colors-radius\",\n \"hover:bg-brand-950/20 dark:hover:bg-white/20\",\n \"focus-visible:z-10\",\n focusStyles({ offset: false }),\n \"data-today:font-semibold data-today:text-brand-500\",\n // `!` (important) on bg/text: a day can be `data-today` *and* `data-selected` at once (e.g.\n // the default `new Date()` value), or a range endpoint is simultaneously `data-selected` *and*\n // `data-in-range` (the closed interval includes its own ends) — without `!`, these rules fight\n // over the same `background-color`/`color` and Tailwind's variant ordering (not this class\n // list's order) can win the wrong one, e.g. leaving the selected cell's text the same color\n // as its own solid-fill background, invisible. `data-selected` — the solid highlight — always\n // wins over both.\n \"data-selected:bg-brand-950! dark:data-selected:bg-white! data-selected:text-(--c-on-solid)! data-selected:font-semibold data-selected:hover:bg-brand-800! dark:data-selected:hover:bg-white/80!\",\n \"data-in-range:rounded-none data-in-range:bg-brand-950/10 dark:data-in-range:bg-white/10\",\n // Pill-cap rounding, split into two independently-true conditions rather than reacting to\n // `data-range-start`/`data-range-end` alone: a lone click (before any second day exists)\n // still carries `data-range-start`, and capping on that alone made the first pick look like\n // an already-established range extending rightward.\n //\n // 1. A genuinely *committed* range exists — `data-range-committed` is set from\n // `api.value.length === 2` in JS, not from the DOM. An earlier version checked whether the\n // *other* endpoint's `data-range-start`/`data-range-end` was present anywhere among the\n // visible months instead — that broke as soon as only one endpoint's month was in view\n // (e.g. the range was set, then the calendar paged away from one end): the other endpoint\n // was never rendered at all, so its attribute could never be found, and the cap silently\n // stopped applying to the *visible* endpoint too, even though the range was still fully\n // committed. `api.value` reflects the committed selection regardless of what's currently\n // paged into view, so this doesn't have that failure mode.\n // 2. A genuine *live hover preview* toward a different day — self-contained on this cell's\n // own attributes, no group lookup needed: `hoveredRangeValue` is `[start, hoveredValue]`\n // sorted chronologically, so the anchor cell gets exactly one of `data-hover-range-start` /\n // `data-hover-range-end` when truly hovering elsewhere (direction decides which), but\n // *both* simultaneously when the pointer is merely resting on the same cell it just\n // clicked (a zero-width hover range) — requiring the other one be *absent* rules out that\n // degenerate, \"changes before you've moved anywhere\" case.\n \"data-range-start:data-range-committed:rounded-s-xs\",\n \"data-range-end:data-range-committed:rounded-e-xs\",\n \"data-hover-range-start:not-data-hover-range-end:rounded-s-xs\",\n \"data-hover-range-end:not-data-hover-range-start:rounded-e-xs\",\n // The degenerate case above (pointer resting on the just-clicked day, `data-hover-range-start`\n // and `data-hover-range-end` both present on this same cell) still falls into `data-in-range`\n // (a zero-width range trivially contains itself), which would otherwise render it\n // `rounded-none` — sharp corners, reading as broken rather than \"just this one day, nothing\n // decided yet.\" Round it fully instead, `!` to beat that `data-in-range:rounded-none`\n // regardless of Tailwind's variant ordering.\n \"data-hover-range-start:data-hover-range-end:rounded-xs!\",\n \"data-outside-range:text-brand-900/40 dark:data-outside-range:text-white/35\",\n \"data-in-range:data-outside-range:text-brand-900/70 dark:data-in-range:data-outside-range:text-white/50\",\n \"data-unavailable:pointer-events-none data-unavailable:text-brand-900/20 data-unavailable:line-through dark:data-unavailable:text-white/16\",\n \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n ],\n {\n variants: {\n size: {\n xs: \"size-7 text-xs\",\n sm: \"size-8 text-xs\",\n md: \"size-9 text-sm\",\n lg: \"size-10 text-base\",\n xl: \"size-11 text-base\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n/** Day-cell pixel size per `size`, matching `dayCellTrigger`'s `size-*` variants (`size-7`..\n * `size-11`) — the day view's own total width. The month/year grids below are plain `<table>`s\n * that would otherwise size to their own (longer) text content instead, so at `numOfMonths ===\n * 1` a month grid comes out *wider* than the day view (overflowing a fixed-width ancestor, e.g.\n * `DatePicker`'s popover column, which is sized off this same geometry via `calendarGridWidth`)\n * and a year grid comes out *narrower* (leaving unfilled space instead of stretching to match).\n * Pinning both to this exact width — `table-fixed` divides it evenly across columns — keeps\n * every view the same footprint. */\nconst DAY_CELL_SIZE: Record<Size, number> = { xs: 28, sm: 32, md: 36, lg: 40, xl: 44 }\n/** Gap between adjacent months in the day view (`gap-6`). */\nconst MONTH_GAP = 24\n\nexport const calendarGridWidth = (size: Size, numOfMonths: number): number =>\n DAY_CELL_SIZE[size] * 7 * numOfMonths + MONTH_GAP * (numOfMonths - 1)\n\nconst gridCellTrigger = cva(\n [\n \"flex w-full items-center justify-center truncate rounded-sm px-2 py-2.5\",\n \"cursor-pointer transition-colors\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n \"data-selected:bg-(--c-solid) data-selected:text-(--c-on-solid) data-selected:hover:bg-(--c-solid-hover)\",\n \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n ],\n {\n variants: {\n size: { xs: \"text-xs\", sm: \"text-xs\", md: \"text-sm\", lg: \"text-base\", xl: \"text-base\" },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst weekdayHeader = cn(\"pb-1 text-center text-xs font-medium\", TEXT_COLOR_CLASSES.muted)\n\nconst weekNumberCell = cn(\n \"p-1 align-top text-center text-xs font-medium h-full\",\n TEXT_COLOR_CLASSES.muted,\n)\n\n/** A prev/next trigger, as the single element Ark's trigger clones under\n * `asChild`. It sizes the icon (through `ActionIcon`) but never strokes or\n * mirrors it. */\nconst navIcon = (icon: ReactNode, size: Size | undefined, className?: string) => (\n <ActionIcon variant=\"subtle\" color=\"neutral\" size={size} className={className}>\n {icon}\n </ActionIcon>\n)\n\n/** `ActionIcon`'s own rendered height per `size` (its `h-7`..`h-12` variants) — the day view's\n * nav row is pinned to this so the prev/next icons and the view-trigger control are the same\n * height, instead of the icons (overlaid on the control, see below) poking out top and bottom of\n * a shorter, text-sized row. */\nconst NAV_ICON_SIZE: Record<Size, number> = { xs: 28, sm: 32, md: 36, lg: 40, xl: 48 }\n\nexport const CalendarBody = ({\n numOfMonths = 1,\n withWeekNumbers,\n renderDay,\n size = \"md\",\n timeZone,\n classNames,\n icons,\n}: CalendarBodyProps) => (\n <Ark.Context>\n {(api) => {\n const { prev, next } = mergeIcons(DEFAULT_ICONS, icons)\n const nav = (\n <Ark.ViewControl\n className={cn(\"mb-2 flex items-stretch justify-between gap-1\", classNames?.header)}\n >\n <Ark.PrevTrigger asChild>{navIcon(prev, size)}</Ark.PrevTrigger>\n <Ark.ViewTrigger\n className={cn(\n \"transition-colors\",\n \"min-w-0 flex-1 cursor-pointer truncate rounded-sm px-2 py-1 text-center text-sm font-medium\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n )}\n >\n {api.visibleRange.end.month === api.visibleRange.start.month\n ? api.visibleRangeText.start\n : api.visibleRangeText.formatted}\n </Ark.ViewTrigger>\n <Ark.NextTrigger asChild>{navIcon(next, size)}</Ark.NextTrigger>\n </Ark.ViewControl>\n )\n\n // A real, two-endpoint committed range — read off the machine's own value, not the DOM, so\n // it stays true regardless of whether either endpoint's month is currently paged into view\n // (see the pill-cap rounding comment in `dayCellTrigger` above).\n const isCommittedRange = api.value.length === 2\n\n return match(api.view)\n .with(\"day\", () => (\n <Ark.View view=\"day\">\n <div\n className=\"grid items-center justify-center\"\n style={{\n gridTemplateColumns: `repeat(${numOfMonths}, auto)`,\n columnGap: MONTH_GAP,\n rowGap: 8,\n }}\n >\n {/* The prev/next icons are overlaid on the control (`absolute`), not given their\n * own grid columns — this row's total width must stay exactly the width of the\n * day tables below (the columns this grid actually has), because `DatePicker`\n * sizes its popover to that exact figure (`calendarGridWidth`, `date-picker.tsx`).\n * Extra icon columns would push this row wider than that budget and force the\n * popover to scroll. */}\n <div\n className={cn(\"relative\", classNames?.header)}\n style={{\n gridColumn: `1 / span ${numOfMonths}`,\n gridRow: 1,\n height: NAV_ICON_SIZE[size],\n }}\n >\n <Ark.PrevTrigger asChild>\n {navIcon(prev, size, \"absolute start-0 top-1/2 z-10 -translate-y-1/2\")}\n </Ark.PrevTrigger>\n {/* One button, not one per month — Ark's month/year view is a single shared grid\n * (confirmed below), so every month's label leads to the exact same destination;\n * splitting it into N `Ark.ViewTrigger`s would only duplicate the same generated\n * `id`/`aria-label` across them. Its own `repeat(numOfMonths, 1fr)` columns land\n * on the exact same boundaries as the day-table columns below (both divide the\n * same total width, with the same gap, into the same number of equal shares —\n * true because every month always renders at the same cell size) — so no width\n * formula is duplicated between this row and the tables, and it degenerates to\n * the `numOfMonths === 1` case for free.\n *\n * The button itself stays full width (so its grid tracks — and hence its click\n * target — line up with the tables below), but its *visible* hover pill is a\n * separate, inset layer (`group-hover`) that stops short of the prev/next icons\n * instead of running the full width underneath them. */}\n <Ark.ViewTrigger\n className={cn(\n \"group relative grid size-full cursor-pointer items-center rounded-sm text-sm font-medium transition-colors\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n )}\n style={{\n gridTemplateColumns: `repeat(${numOfMonths}, 1fr)`,\n columnGap: MONTH_GAP,\n }}\n >\n <span\n aria-hidden\n className=\"pointer-events-none absolute inset-y-0 rounded-sm transition-colors group-hover:bg-brand-900/6 dark:group-hover:bg-white/8\"\n style={{\n insetInlineStart: NAV_ICON_SIZE[size],\n insetInlineEnd: NAV_ICON_SIZE[size],\n }}\n />\n {Array.from({ length: numOfMonths }, (_, monthIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.\n <span key={monthIndex} className=\"relative min-w-0 truncate text-center\">\n {api.getOffset({ months: monthIndex }).visibleRangeText.start}\n </span>\n ))}\n </Ark.ViewTrigger>\n <Ark.NextTrigger asChild>\n {navIcon(next, size, \"absolute end-0 top-1/2 z-10 -translate-y-1/2\")}\n </Ark.NextTrigger>\n </div>\n\n {Array.from({ length: numOfMonths }, (_, monthIndex) => {\n const offset = api.getOffset({ months: monthIndex })\n return (\n <Ark.Table\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.\n key={monthIndex}\n style={{ gridColumn: monthIndex + 1, gridRow: 2 }}\n className={cn(\"border-separate border-spacing-0\", classNames?.table)}\n >\n <Ark.TableHead>\n <Ark.TableRow>\n {withWeekNumbers && <Ark.WeekNumberHeaderCell className={weekdayHeader} />}\n {api.weekDays.map((weekDay) => (\n <Ark.TableHeader key={weekDay.long} className={weekdayHeader}>\n {weekDay.narrow}\n </Ark.TableHeader>\n ))}\n </Ark.TableRow>\n </Ark.TableHead>\n <Ark.TableBody>\n {offset.weeks.map((week, weekIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of consecutive weeks, never reordered.\n <Ark.TableRow key={weekIndex}>\n {withWeekNumbers && (\n <Ark.WeekNumberCell weekIndex={weekIndex} week={week}>\n <span className={weekNumberCell}>{api.getWeekNumber(week)}</span>\n </Ark.WeekNumberCell>\n )}\n {week.map((value) => {\n const cellState = renderDay\n ? api.getDayTableCellState({\n value,\n visibleRange: offset.visibleRange,\n })\n : undefined\n return (\n <Ark.TableCell\n key={value.toString()}\n value={value}\n visibleRange={offset.visibleRange}\n >\n <Ark.TableCellTrigger\n {...props({ \"data-range-committed\": isCommittedRange })}\n className={cn(dayCellTrigger({ size }), classNames?.day)}\n >\n {value.day}\n {cellState &&\n renderDay?.(calendarValueToDate(value, timeZone), {\n isUnavailable: cellState.unavailable,\n isSelected: cellState.selected,\n })}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n )\n })}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n )\n })}\n </div>\n </Ark.View>\n ))\n .with(\"month\", () => (\n <Ark.View view=\"month\">\n {nav}\n <Ark.Table\n className={cn(\"mx-auto table-fixed\", classNames?.table)}\n style={{ width: calendarGridWidth(size, numOfMonths) }}\n >\n <Ark.TableBody>\n {/* \"short\" (e.g. \"Jan\"), not the default \"long\" (\"January\") — the grid's width is\n * pinned to the day view's (see `calendarGridWidth` above), which at a single\n * narrow month can be too tight for full month names across 4 columns. */}\n {api.getMonthsGrid({ columns: 4, format: \"short\" }).map((row, rowIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.\n <Ark.TableRow key={rowIndex}>\n {row.map((month) => (\n <Ark.TableCell key={month.value} value={month.value}>\n <Ark.TableCellTrigger className={gridCellTrigger({ size })}>\n {month.label}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n ))}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n </Ark.View>\n ))\n .with(\"year\", () => (\n <Ark.View view=\"year\">\n {nav}\n <Ark.Table\n columns={5}\n className={cn(\"mx-auto table-fixed\", classNames?.table)}\n style={{ width: calendarGridWidth(size, numOfMonths) }}\n >\n <Ark.TableBody>\n {api.getYearsGrid({ columns: 5 }).map((row, rowIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.\n <Ark.TableRow key={rowIndex}>\n {row.map((year) => (\n <Ark.TableCell key={year.value} value={year.value}>\n <Ark.TableCellTrigger className={gridCellTrigger({ size })}>\n {year.label}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n ))}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n </Ark.View>\n ))\n .exhaustive()\n }}\n </Ark.Context>\n)\n","\"use client\"\n\nimport { type DateValue, useDatePickerContext } from \"@ark-ui/react/date-picker\"\nimport { isSameDay, today } from \"@internationalized/date\"\nimport { type RefObject, useRef } from \"react\"\nimport { calendarValueToDate, dateToArkValue } from \"../../lib/date-value\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\n\n/** A stable fingerprint of Ark's value array, to recognise one specific `setValue` echo. */\nexport const hashArkValues = (values: DateValue[]): string => values.map(String).join(\",\")\n\n/**\n * The value Ark is about to report back from a zone re-seed, or `null`. The root's\n * `onValueChange` swallows the one change whose hash matches it, because re-expressing the\n * selection in a new zone is not a change the user made.\n */\nexport type ZoneReseedRef = RefObject<string | null>\n\n/**\n * Keeps an Ark `date-picker` machine's selection on the same **instant** when its `timeZone`\n * changes, without remounting it. Renders nothing; mount it inside `Ark.Root`.\n *\n * Ark reads `defaultValue` once, at mount, and from then on holds the selection as a wall-calendar\n * `DateValue`. A grid pick is a plain `CalendarDate` with no zone at all, so on its own a zone\n * change would keep the *day* and silently move the instant the app was handed by `onChange`. The\n * one zone change every SSR app sees is `timeZone=\"auto\"` going from the UTC hydration snapshot\n * to the host zone, and there the uncontrolled `defaultValue` would stay on the UTC day.\n *\n * So, in a layout effect after the render that changed the zone:\n *\n * - **Uncontrolled**: each value is read back as an instant in the *old* zone (what `onChange`\n * reported) and handed to Ark again in the new one, through `api.setValue`. That may land on\n * another calendar day near midnight, which is the point. `pendingRef` marks the echo so the\n * root doesn't report it through `onChange`.\n * - **Controlled**: nothing to do. The root re-derives Ark's `value` from the app's `Date`s in\n * the new zone on every render, which is already the same instant.\n * - **Focus**: the machine's focused day (the keyboard's roving cell, and the month on show)\n * follows its anchor, the selection or else today, when it sat on that anchor before the\n * change. A month the user navigated to stays put. `setFocusedValue` never moves DOM focus.\n *\n * A remount would do all of this too, but it also resets everything the user did since mount: a\n * pick goes back to `defaultValue`, typed text is cleared, and DOM focus drops to `<body>`.\n */\nexport const CalendarZoneSync = ({\n timeZone,\n controlled,\n pendingRef,\n}: {\n timeZone: string\n controlled: boolean\n pendingRef: ZoneReseedRef\n}) => {\n const api = useDatePickerContext()\n const previous = useRef({ timeZone, value: api.value })\n\n // No dependency list on purpose: the previous value has to be the one from the last render,\n // which under a controlled `value` is already the new zone's by the time the zone changes.\n useIsomorphicLayoutEffect(() => {\n const { timeZone: from, value: before } = previous.current\n previous.current = { timeZone, value: api.value }\n if (from === timeZone) return\n\n const after = controlled\n ? api.value\n : before.map((value) => dateToArkValue(calendarValueToDate(value, from), timeZone))\n if (!controlled && after.length > 0) {\n pendingRef.current = hashArkValues(after)\n api.setValue(after)\n }\n\n // `setValue` also moves the focused day onto the new value, so this runs either way: it\n // either confirms that move or puts back a month the user had navigated to.\n const anchorBefore = before[0] ?? today(from)\n const focused = api.focusedValue\n api.setFocusedValue(isSameDay(focused, anchorBefore) ? (after[0] ?? today(timeZone)) : focused)\n })\n\n return null\n}\n","\"use client\"\n\nimport { DatePicker as Ark, type DatePickerDateView as DateView } from \"@ark-ui/react/date-picker\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { type ComponentProps, type ReactNode, useRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { DatePredicate } from \"../../lib/date-predicates\"\nimport {\n calendarValueToDate,\n type DateRangeValue,\n dateToArkValue,\n fromArkValues,\n toArkValues,\n} from \"../../lib/date-value\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { useTimeZone } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { CalendarBody, type CalendarBodyClassNames, type CalendarIcons } from \"./calendar-body\"\nimport { CalendarZoneSync, hashArkValues } from \"./calendar-zone-sync\"\n\n/**\n * Calendar — the inline month grid (RFC §9, `docs/rfcs/date-picker.md`): Ark's `date-picker`\n * machine rendered `inline` (no trigger/popover), wrapping the shared `CalendarBody` grid that\n * `DatePicker` will later reuse verbatim inside its own popover.\n *\n * - Value is a native `Date | null` (or `{ start, end }` under `range`) — the machine's\n * `DateValue` array contract never leaks out; `lib/date-value.ts` is the one conversion\n * boundary both directions go through.\n * - Controlled/uncontrolled `value` / `defaultValue` / `onChange` go straight to Ark's own\n * machine, which supports both natively — no `useUncontrolled` needed here.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s and are adapted to Ark's\n * `DateValue`-based signature at this boundary; pair with the `lib/date-predicates.ts`\n * helpers (`disablePast()`, `disableWeekends()`, …).\n * - No `label` / `description` / `error` / `FieldShell` wrap — `Calendar` is a bare widget\n * (like `Table`), not a form field. A `DatePicker` popover is where a field wrapper belongs.\n *\n * <Calendar value={date} onChange={setDate} isDateUnavailable={disableWeekends()} />\n */\n\nexport type CalendarClassNames = CalendarBodyClassNames & {\n /** The outermost `Ark.Root` element. */\n root?: string\n}\n\n/** Ark's own `translations` prop type, derived structurally rather than imported by name —\n * `IntlTranslations` lives in `@zag-js/date-picker`, a transitive dependency of the\n * `@ark-ui/react` peer dep, not one this package declares itself. */\ntype ArkTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\n/** The subset `CalendarBody`'s rendered anatomy actually exercises — `trigger`/`clearTrigger`\n * only apply when composed under `DatePicker` (a bare `Calendar` never renders a trigger/clear\n * button; harmless no-op keys there). Unset keys fall back to Ark's own English text. */\nexport type CalendarTranslations = Pick<\n ArkTranslations,\n | \"dayCell\"\n | \"trigger\"\n | \"viewTrigger\"\n | \"prevTrigger\"\n | \"nextTrigger\"\n | \"clearTrigger\"\n | \"content\"\n | \"weekColumnHeader\"\n | \"weekNumberCell\"\n>\n\n/** Passes a partial override straight through to `Ark.Root`. Ark's `translations` prop is\n * itself all-optional (since @ark-ui/react 5.38.2), so unset keys fall back to Ark's own\n * English defaults and this kit no longer keeps a copy of them to merge over. That copy was\n * load-bearing when the prop demanded every key at once; keeping it now would only let a\n * stale duplicate override Ark's upstream fixes — which is exactly what happened to\n * `viewTrigger`, whose day-view label named the wrong target view until Ark corrected it. */\nexport const resolveCalendarTranslations = (\n overrides?: Partial<CalendarTranslations>,\n): ArkTranslations | undefined => overrides\n\n/** What `renderDay` is told about the day it decorates. */\nexport type CalendarDayState = {\n /** The day can't be picked: `isDateUnavailable`, or outside `min`/`max`. */\n unavailable: boolean\n /** The day is selected, or is one end of the selected range. */\n selected: boolean\n /** @deprecated Renamed `unavailable`. Removed in the next minor. */\n isUnavailable: boolean\n /** @deprecated Renamed `selected`. Removed in the next minor. */\n isSelected: boolean\n}\n\n/** Builds `renderDay`'s state; reading a deprecated `is*` key warns once in development. */\nconst dayState = (day: { isUnavailable: boolean; isSelected: boolean }): CalendarDayState => ({\n unavailable: day.isUnavailable,\n selected: day.isSelected,\n get isUnavailable() {\n warnRenamedProp(\"Calendar renderDay\", \"isUnavailable\", \"unavailable\")\n return day.isUnavailable\n },\n get isSelected() {\n warnRenamedProp(\"Calendar renderDay\", \"isSelected\", \"selected\")\n return day.isSelected\n },\n})\n\nexport type CalendarProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n HTMLDivElement\n> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Months shown side by side. Default 1. */\n numOfMonths?: number\n /** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.\n * Called with this component's own resolved `timeZone` as its second argument, so a predicate\n * reads the candidate day in the same zone the grid renders it in. */\n isDateUnavailable?: DatePredicate\n /** Earliest selectable day; earlier days render unavailable and navigation stops there. */\n min?: Date\n /** Latest selectable day; later days render unavailable and navigation stops there. */\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"` for a month-only\n * picker that never drills into individual days). */\n minView?: DateView\n /** The widest view the header's view switch can climb to (`\"day\"`, `\"month\"` or `\"year\"`). */\n maxView?: DateView\n /** Per-day decoration slot — the \"event dot\" (RFC §9). `ctx` says whether the day is\n * `unavailable` or `selected`. */\n renderDay?: (date: Date, ctx: CalendarDayState) => ReactNode\n /** Always render 6 week rows (padding with adjacent-month days) instead of however many the\n * visible month(s) actually span (4–6) — keeps the grid's height constant while navigating\n * between months. */\n fixedWeeks?: boolean\n /** Adds a leading column with each row's week number. */\n withWeekNumbers?: boolean\n /** Overrides the active locale context. Drives month/day names and first-day-of-week. */\n locale?: string\n /** Overrides the time zone for every `Date ↔ DateValue` conversion. Resolves\n * **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Schedule` — **not** Ark's\n * own machine default (`\"UTC\"`), which is why the resolved zone is forwarded to `Ark.Root`\n * explicitly rather than only used in this component's own conversions (see\n * `lib/date-value.ts`'s module doc). Accepts `\"auto\"` to follow the host zone. */\n timeZone?: string\n /** Overrides Ark's own built-in aria-label/accessible-name strings (day cells, prev/next, the\n * view-cycling header, week numbers) — English by default. Unlike `locale`, nothing here\n * auto-derives; supply your own translated strings. Partial — unset keys keep Ark's default. */\n translations?: Partial<CalendarTranslations>\n /** Replaces the default icons: `prev`, `next`. The kit's chevrons mirror under RTL; an\n * icon passed here is drawn as given. */\n icons?: CalendarIcons\n /** Cell and text size, off the kit's `xs`–`xl` scale. Default `\"md\"`. */\n size?: Size\n className?: string\n classNames?: CalendarClassNames\n }\n\nexport const Calendar = <Range extends boolean = false>({\n range,\n value,\n defaultValue,\n onChange,\n onBlur,\n numOfMonths = 1,\n isDateUnavailable,\n min,\n max,\n minView,\n maxView,\n renderDay,\n fixedWeeks,\n withWeekNumbers,\n locale,\n timeZone,\n translations,\n icons,\n size = \"md\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n className,\n classNames,\n testId,\n}: CalendarProps<Range>) => {\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = useTimeZone(timeZone)\n const isRange = Boolean(range)\n const zoneReseed = useRef<string | null>(null)\n\n return (\n <Ark.Root\n inline\n ref={ref}\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n value={toArkValues(value, resolvedTimeZone)}\n defaultValue={toArkValues(defaultValue, resolvedTimeZone)}\n onValueChange={(details) => {\n // A zone change re-expresses the selection in the new zone; that echo is not a change.\n if (zoneReseed.current === hashArkValues(details.value)) {\n zoneReseed.current = null\n return\n }\n // The machine's value is a plain DateValue[]; `range` is a runtime flag here, so narrow\n // the result back to the caller's declared shape.\n onChange?.(\n fromArkValues(details.value, isRange, resolvedTimeZone) as Range extends true\n ? DateRangeValue\n : Date | null,\n )\n }}\n onBlur={onBlur}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n // Ark's own prop — its name doesn't follow this kit's `withX` convention, so it stays\n // `showWeekNumbers` even though our public prop is `withWeekNumbers`.\n showWeekNumbers={withWeekNumbers}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(calendarValueToDate(dateValue, resolvedTimeZone), resolvedTimeZone)\n : undefined\n }\n min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}\n minView={minView}\n maxView={maxView}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={invalid}\n name={name}\n className={cn(\"inline-flex flex-col\", className, classNames?.root)}\n {...props({ \"data-testid\": testId })}\n >\n {/* The machine looks up the currently-focused cell by querying inside the `Content` part\n * (`getFocusedCell` scopes its DOM query to `getContentEl`) to call `.focus()` on it after\n * every arrow-key/Home/End/PageUp/PageDown press — even though `inline` never opens a real\n * popover, that lookup still runs, and with no `Content` element in the DOM at all it\n * always finds nothing, so keyboard navigation updates the machine's internal focus state\n * (visible via `data-focus`) but never moves real DOM focus. `inline` implies `open` (the\n * machine treats it as permanently open), so `Content`'s `hidden={!open}` never hides this. */}\n {/* Ark reads `defaultValue` once, at mount, so a zone change (`timeZone=\"auto\"` going from\n * the UTC hydration snapshot to the host zone, or the app's provider changing) would leave\n * the selection on the old zone's day. This re-seeds it on the same instant in place;\n * see `calendar-zone-sync.tsx` for why it isn't a remount. */}\n <CalendarZoneSync\n timeZone={resolvedTimeZone}\n controlled={value !== undefined}\n pendingRef={zoneReseed}\n />\n <Ark.Content>\n <CalendarBody\n numOfMonths={numOfMonths}\n withWeekNumbers={withWeekNumbers}\n renderDay={renderDay && ((date, day) => renderDay(date, dayState(day)))}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames}\n icons={icons}\n />\n </Ark.Content>\n </Ark.Root>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/calendar/calendar-body.tsx","../src/components/calendar/calendar-zone-sync.tsx","../src/components/calendar/calendar.tsx"],"names":["Ark","useRef","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;AA8CO,IAAM,aAAA,GAAqD;AAAA,EAChE,IAAA,kBAAM,GAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAU,kBAAA,EAAmB,CAAA;AAAA,EACpD,IAAA,kBAAM,GAAA,CAAC,gBAAA,EAAA,EAAiB,SAAA,EAAU,kBAAA,EAAmB;AACvD,CAAA;AAqBA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB;AAAA,IACE,gEAAA;AAAA,IACA,kEAAA;AAAA,IACA,8CAAA;AAAA,IACA,oBAAA;AAAA,IACA,WAAA,CAAY,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAA;AAAA,IAC7B,oDAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,iMAAA;AAAA,IACA,yFAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAsBA,oDAAA;AAAA,IACA,kDAAA;AAAA,IACA,8DAAA;AAAA,IACA,8DAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,yDAAA;AAAA,IACA,4EAAA;AAAA,IACA,wGAAA;AAAA,IACA,2IAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,gBAAA;AAAA,QACJ,EAAA,EAAI,gBAAA;AAAA,QACJ,EAAA,EAAI,gBAAA;AAAA,QACJ,EA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,GACtF,MAAA;AAAA,MAEN,GAAA,EAAK,GAAA,GAAM,cAAA,CAAe,GAAA,EAAK,gBAAgB,CAAA,GAAI,MAAA;AAAA,MACnD,GAAA,EAAK,GAAA,GAAM,cAAA,CAAe,GAAA,EAAK,gBAAgB,CAAA,GAAI,MAAA;AAAA,MACnD,OAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,sBAAA,EAAwB,SAAA,EAAW,YAAY,IAAI,CAAA;AAAA,MAChE,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAanC,QAAA,EAAA;AAAA,wBAAAG,GAAAA;AAAA,UAAC,gBAAA;AAAA,UAAA;AAAA,YACC,QAAA,EAAU,gBAAA;AAAA,YACV,YAAY,KAAA,KAAU,MAAA;AAAA,YACtB,UAAA,EAAY;AAAA;AAAA,SACd;AAAA,wBACAA,GAAAA,CAACH,UAAAA,CAAI,OAAA,EAAJ,EACC,QAAA,kBAAAG,GAAAA;AAAA,UAAC,YAAA;AAAA,UAAA;AAAA,YACC,WAAA;AAAA,YACA,eAAA;AAAA,YACA,SAAA,EAAW,cAAc,CAAC,IAAA,EAAM,QAAQ,SAAA,CAAU,IAAA,EAAM,QAAA,CAAS,GAAG,CAAC,CAAA,CAAA;AAAA,YACrE,IAAA;AAAA,YACA,QAAA,EAAU,gBAAA;AAAA,YACV,UAAA;AAAA,YACA;AAAA;AAAA,SACF,EACF;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-7BY5I2RB.js","sourcesContent":["import { DatePicker as Ark } from \"@ark-ui/react/date-picker\"\nimport { cva } from \"class-variance-authority\"\nimport type { ReactNode } from \"react\"\nimport { match } from \"ts-pattern\"\nimport { cn } from \"../../lib/cn\"\nimport { calendarValueToDate } from \"../../lib/date-value\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { ActionIcon } from \"../action-icon/action-icon\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../popover/icons\"\n\n/**\n * CalendarBody — the shared grid module behind both `Calendar` (inline) and, later,\n * `DatePicker` (popover): the RFC §3 \"one implementation, not two\" module. It renders only the\n * grid anatomy (`View` / `ViewControl` / nav triggers / `Table*` / `MonthSelect` / `YearSelect`)\n * — deliberately **not** `Control` / `Content` / `Positioner` / `Trigger` / `ClearTrigger`, the\n * popover-only chrome that belongs to `DatePicker`, not here.\n *\n * Every part below self-connects to the nearest ancestor `Ark.Root` via Ark's own React\n * context, so this module needs no `api` prop threaded in — both `Calendar` and `DatePicker`\n * just mount it as a plain child inside their own differently-configured `Ark.Root`.\n *\n * Not barrel-exported (no export from `calendar/index.ts`) — `DatePicker` reaches it directly\n * via `import { CalendarBody } from \"../calendar/calendar-body\"`, the established cross-folder\n * pattern for a shared internal part (`multi-select.tsx` → `../combobox/combobox`,\n * `drawer.tsx` → `../action-icon/action-icon`).\n */\n\nexport type CalendarBodyClassNames = {\n /** The prev/label/next navigation row. */\n header?: string\n /** Each rendered `<table>` (one per visible month in the day view). */\n table?: string\n /** Each day cell's clickable trigger. */\n day?: string\n}\n\nexport type CalendarIconSlot = \"prev\" | \"next\"\nexport type CalendarIcons = IconMap<CalendarIconSlot>\n\n/** The default icons. The glyphs are physical; prev sits on the inline-start\n * edge, which is the right one under RTL, so both chevrons mirror there to\n * keep pointing outward. A consumer's icon is drawn as given. */\nexport const DEFAULT_ICONS: Record<CalendarIconSlot, ReactNode> = {\n prev: <ChevronLeftIcon className=\"rtl:-scale-x-100\" />,\n next: <ChevronRightIcon className=\"rtl:-scale-x-100\" />,\n}\n\nexport type CalendarBodyProps = {\n /** Months shown side by side in the day view. */\n numOfMonths?: number\n withWeekNumbers?: boolean\n /** Per-day decoration slot (RFC §9's \"event dot\"). Receives a native `Date` — converted from\n * Ark's `DateValue` at the point of the call, via the same `timeZone` the root was configured\n * with — and the day's live selection state. */\n renderDay?: (date: Date, ctx: { isUnavailable: boolean; isSelected: boolean }) => ReactNode\n size?: Size\n /** The time zone the nearest `Ark.Root` was configured with. Required (not read from Ark's\n * own api, which exposes no public `timeZone` getter) so `renderDay`'s Date conversion uses\n * the exact same boundary `Calendar`/`DatePicker` used to build the root's own value —\n * see `lib/date-value.ts`'s module doc on why this one conversion point matters. */\n timeZone: string\n classNames?: CalendarBodyClassNames\n /** Replaces the prev/next icons. Drawn as given, never restroked or mirrored. */\n icons?: CalendarIcons\n}\n\nconst dayCellTrigger = cva(\n [\n \"relative flex size-full items-center justify-center rounded-xs\",\n \"cursor-pointer select-none tabular-nums transition-colors-radius\",\n \"hover:bg-brand-950/20 dark:hover:bg-white/20\",\n \"focus-visible:z-10\",\n focusStyles({ offset: false }),\n \"data-today:font-semibold data-today:text-brand-500\",\n // `!` (important) on bg/text: a day can be `data-today` *and* `data-selected` at once (e.g.\n // the default `new Date()` value), or a range endpoint is simultaneously `data-selected` *and*\n // `data-in-range` (the closed interval includes its own ends) — without `!`, these rules fight\n // over the same `background-color`/`color` and Tailwind's variant ordering (not this class\n // list's order) can win the wrong one, e.g. leaving the selected cell's text the same color\n // as its own solid-fill background, invisible. `data-selected` — the solid highlight — always\n // wins over both.\n \"data-selected:bg-brand-950! dark:data-selected:bg-white! data-selected:text-(--c-on-solid)! data-selected:font-semibold data-selected:hover:bg-brand-800! dark:data-selected:hover:bg-white/80!\",\n \"data-in-range:rounded-none data-in-range:bg-brand-950/10 dark:data-in-range:bg-white/10\",\n // Pill-cap rounding, split into two independently-true conditions rather than reacting to\n // `data-range-start`/`data-range-end` alone: a lone click (before any second day exists)\n // still carries `data-range-start`, and capping on that alone made the first pick look like\n // an already-established range extending rightward.\n //\n // 1. A genuinely *committed* range exists — `data-range-committed` is set from\n // `api.value.length === 2` in JS, not from the DOM. An earlier version checked whether the\n // *other* endpoint's `data-range-start`/`data-range-end` was present anywhere among the\n // visible months instead — that broke as soon as only one endpoint's month was in view\n // (e.g. the range was set, then the calendar paged away from one end): the other endpoint\n // was never rendered at all, so its attribute could never be found, and the cap silently\n // stopped applying to the *visible* endpoint too, even though the range was still fully\n // committed. `api.value` reflects the committed selection regardless of what's currently\n // paged into view, so this doesn't have that failure mode.\n // 2. A genuine *live hover preview* toward a different day — self-contained on this cell's\n // own attributes, no group lookup needed: `hoveredRangeValue` is `[start, hoveredValue]`\n // sorted chronologically, so the anchor cell gets exactly one of `data-hover-range-start` /\n // `data-hover-range-end` when truly hovering elsewhere (direction decides which), but\n // *both* simultaneously when the pointer is merely resting on the same cell it just\n // clicked (a zero-width hover range) — requiring the other one be *absent* rules out that\n // degenerate, \"changes before you've moved anywhere\" case.\n \"data-range-start:data-range-committed:rounded-s-xs\",\n \"data-range-end:data-range-committed:rounded-e-xs\",\n \"data-hover-range-start:not-data-hover-range-end:rounded-s-xs\",\n \"data-hover-range-end:not-data-hover-range-start:rounded-e-xs\",\n // The degenerate case above (pointer resting on the just-clicked day, `data-hover-range-start`\n // and `data-hover-range-end` both present on this same cell) still falls into `data-in-range`\n // (a zero-width range trivially contains itself), which would otherwise render it\n // `rounded-none` — sharp corners, reading as broken rather than \"just this one day, nothing\n // decided yet.\" Round it fully instead, `!` to beat that `data-in-range:rounded-none`\n // regardless of Tailwind's variant ordering.\n \"data-hover-range-start:data-hover-range-end:rounded-xs!\",\n \"data-outside-range:text-brand-900/40 dark:data-outside-range:text-white/35\",\n \"data-in-range:data-outside-range:text-brand-900/70 dark:data-in-range:data-outside-range:text-white/50\",\n \"data-unavailable:pointer-events-none data-unavailable:text-brand-900/20 data-unavailable:line-through dark:data-unavailable:text-white/16\",\n \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n ],\n {\n variants: {\n size: {\n xs: \"size-7 text-xs\",\n sm: \"size-8 text-xs\",\n md: \"size-9 text-sm\",\n lg: \"size-10 text-base\",\n xl: \"size-11 text-base\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n/** Day-cell pixel size per `size`, matching `dayCellTrigger`'s `size-*` variants (`size-7`..\n * `size-11`) — the day view's own total width. The month/year grids below are plain `<table>`s\n * that would otherwise size to their own (longer) text content instead, so at `numOfMonths ===\n * 1` a month grid comes out *wider* than the day view (overflowing a fixed-width ancestor, e.g.\n * `DatePicker`'s popover column, which is sized off this same geometry via `calendarGridWidth`)\n * and a year grid comes out *narrower* (leaving unfilled space instead of stretching to match).\n * Pinning both to this exact width — `table-fixed` divides it evenly across columns — keeps\n * every view the same footprint. */\nconst DAY_CELL_SIZE: Record<Size, number> = { xs: 28, sm: 32, md: 36, lg: 40, xl: 44 }\n/** Gap between adjacent months in the day view (`gap-6`). */\nconst MONTH_GAP = 24\n\nexport const calendarGridWidth = (size: Size, numOfMonths: number): number =>\n DAY_CELL_SIZE[size] * 7 * numOfMonths + MONTH_GAP * (numOfMonths - 1)\n\nconst gridCellTrigger = cva(\n [\n \"flex w-full items-center justify-center truncate rounded-sm px-2 py-2.5\",\n \"cursor-pointer transition-colors\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n \"data-selected:bg-(--c-solid) data-selected:text-(--c-on-solid) data-selected:hover:bg-(--c-solid-hover)\",\n \"data-disabled:pointer-events-none data-disabled:opacity-40\",\n ],\n {\n variants: {\n size: { xs: \"text-xs\", sm: \"text-xs\", md: \"text-sm\", lg: \"text-base\", xl: \"text-base\" },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nconst weekdayHeader = cn(\"pb-1 text-center text-xs font-medium\", TEXT_COLOR_CLASSES.muted)\n\nconst weekNumberCell = cn(\n \"p-1 align-top text-center text-xs font-medium h-full\",\n TEXT_COLOR_CLASSES.muted,\n)\n\n/** A prev/next trigger, as the single element Ark's trigger clones under\n * `asChild`. It sizes the icon (through `ActionIcon`) but never strokes or\n * mirrors it. */\nconst navIcon = (icon: ReactNode, size: Size | undefined, className?: string) => (\n <ActionIcon variant=\"subtle\" color=\"neutral\" size={size} className={className}>\n {icon}\n </ActionIcon>\n)\n\n/** `ActionIcon`'s own rendered height per `size` (its `h-7`..`h-12` variants) — the day view's\n * nav row is pinned to this so the prev/next icons and the view-trigger control are the same\n * height, instead of the icons (overlaid on the control, see below) poking out top and bottom of\n * a shorter, text-sized row. */\nconst NAV_ICON_SIZE: Record<Size, number> = { xs: 28, sm: 32, md: 36, lg: 40, xl: 48 }\n\nexport const CalendarBody = ({\n numOfMonths = 1,\n withWeekNumbers,\n renderDay,\n size = \"md\",\n timeZone,\n classNames,\n icons,\n}: CalendarBodyProps) => (\n <Ark.Context>\n {(api) => {\n const { prev, next } = mergeIcons(DEFAULT_ICONS, icons)\n const nav = (\n <Ark.ViewControl\n className={cn(\"mb-2 flex items-stretch justify-between gap-1\", classNames?.header)}\n >\n <Ark.PrevTrigger asChild>{navIcon(prev, size)}</Ark.PrevTrigger>\n <Ark.ViewTrigger\n className={cn(\n \"transition-colors\",\n \"min-w-0 flex-1 cursor-pointer truncate rounded-sm px-2 py-1 text-center text-sm font-medium\",\n \"hover:bg-brand-900/6 dark:hover:bg-white/8\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n )}\n >\n {api.visibleRange.end.month === api.visibleRange.start.month\n ? api.visibleRangeText.start\n : api.visibleRangeText.formatted}\n </Ark.ViewTrigger>\n <Ark.NextTrigger asChild>{navIcon(next, size)}</Ark.NextTrigger>\n </Ark.ViewControl>\n )\n\n // A real, two-endpoint committed range — read off the machine's own value, not the DOM, so\n // it stays true regardless of whether either endpoint's month is currently paged into view\n // (see the pill-cap rounding comment in `dayCellTrigger` above).\n const isCommittedRange = api.value.length === 2\n\n return match(api.view)\n .with(\"day\", () => (\n <Ark.View view=\"day\">\n <div\n className=\"grid items-center justify-center\"\n style={{\n gridTemplateColumns: `repeat(${numOfMonths}, auto)`,\n columnGap: MONTH_GAP,\n rowGap: 8,\n }}\n >\n {/* The prev/next icons are overlaid on the control (`absolute`), not given their\n * own grid columns — this row's total width must stay exactly the width of the\n * day tables below (the columns this grid actually has), because `DatePicker`\n * sizes its popover to that exact figure (`calendarGridWidth`, `date-picker.tsx`).\n * Extra icon columns would push this row wider than that budget and force the\n * popover to scroll. */}\n <div\n className={cn(\"relative\", classNames?.header)}\n style={{\n gridColumn: `1 / span ${numOfMonths}`,\n gridRow: 1,\n height: NAV_ICON_SIZE[size],\n }}\n >\n <Ark.PrevTrigger asChild>\n {navIcon(prev, size, \"absolute start-0 top-1/2 z-10 -translate-y-1/2\")}\n </Ark.PrevTrigger>\n {/* One button, not one per month — Ark's month/year view is a single shared grid\n * (confirmed below), so every month's label leads to the exact same destination;\n * splitting it into N `Ark.ViewTrigger`s would only duplicate the same generated\n * `id`/`aria-label` across them. Its own `repeat(numOfMonths, 1fr)` columns land\n * on the exact same boundaries as the day-table columns below (both divide the\n * same total width, with the same gap, into the same number of equal shares —\n * true because every month always renders at the same cell size) — so no width\n * formula is duplicated between this row and the tables, and it degenerates to\n * the `numOfMonths === 1` case for free.\n *\n * The button itself stays full width (so its grid tracks — and hence its click\n * target — line up with the tables below), but its *visible* hover pill is a\n * separate, inset layer (`group-hover`) that stops short of the prev/next icons\n * instead of running the full width underneath them. */}\n <Ark.ViewTrigger\n className={cn(\n \"group relative grid size-full cursor-pointer items-center rounded-sm text-sm font-medium transition-colors\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n )}\n style={{\n gridTemplateColumns: `repeat(${numOfMonths}, 1fr)`,\n columnGap: MONTH_GAP,\n }}\n >\n <span\n aria-hidden\n className=\"pointer-events-none absolute inset-y-0 rounded-sm transition-colors group-hover:bg-brand-900/6 dark:group-hover:bg-white/8\"\n style={{\n insetInlineStart: NAV_ICON_SIZE[size],\n insetInlineEnd: NAV_ICON_SIZE[size],\n }}\n />\n {Array.from({ length: numOfMonths }, (_, monthIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.\n <span key={monthIndex} className=\"relative min-w-0 truncate text-center\">\n {api.getOffset({ months: monthIndex }).visibleRangeText.start}\n </span>\n ))}\n </Ark.ViewTrigger>\n <Ark.NextTrigger asChild>\n {navIcon(next, size, \"absolute end-0 top-1/2 z-10 -translate-y-1/2\")}\n </Ark.NextTrigger>\n </div>\n\n {Array.from({ length: numOfMonths }, (_, monthIndex) => {\n const offset = api.getOffset({ months: monthIndex })\n return (\n <Ark.Table\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of adjacent months, never reordered.\n key={monthIndex}\n style={{ gridColumn: monthIndex + 1, gridRow: 2 }}\n className={cn(\"border-separate border-spacing-0\", classNames?.table)}\n >\n <Ark.TableHead>\n <Ark.TableRow>\n {withWeekNumbers && <Ark.WeekNumberHeaderCell className={weekdayHeader} />}\n {api.weekDays.map((weekDay) => (\n <Ark.TableHeader key={weekDay.long} className={weekdayHeader}>\n {weekDay.narrow}\n </Ark.TableHeader>\n ))}\n </Ark.TableRow>\n </Ark.TableHead>\n <Ark.TableBody>\n {offset.weeks.map((week, weekIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length run of consecutive weeks, never reordered.\n <Ark.TableRow key={weekIndex}>\n {withWeekNumbers && (\n <Ark.WeekNumberCell weekIndex={weekIndex} week={week}>\n <span className={weekNumberCell}>{api.getWeekNumber(week)}</span>\n </Ark.WeekNumberCell>\n )}\n {week.map((value) => {\n const cellState = renderDay\n ? api.getDayTableCellState({\n value,\n visibleRange: offset.visibleRange,\n })\n : undefined\n return (\n <Ark.TableCell\n key={value.toString()}\n value={value}\n visibleRange={offset.visibleRange}\n >\n <Ark.TableCellTrigger\n {...props({ \"data-range-committed\": isCommittedRange })}\n className={cn(dayCellTrigger({ size }), classNames?.day)}\n >\n {value.day}\n {cellState &&\n renderDay?.(calendarValueToDate(value, timeZone), {\n isUnavailable: cellState.unavailable,\n isSelected: cellState.selected,\n })}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n )\n })}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n )\n })}\n </div>\n </Ark.View>\n ))\n .with(\"month\", () => (\n <Ark.View view=\"month\">\n {nav}\n <Ark.Table\n className={cn(\"mx-auto table-fixed\", classNames?.table)}\n style={{ width: calendarGridWidth(size, numOfMonths) }}\n >\n <Ark.TableBody>\n {/* \"short\" (e.g. \"Jan\"), not the default \"long\" (\"January\") — the grid's width is\n * pinned to the day view's (see `calendarGridWidth` above), which at a single\n * narrow month can be too tight for full month names across 4 columns. */}\n {api.getMonthsGrid({ columns: 4, format: \"short\" }).map((row, rowIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.\n <Ark.TableRow key={rowIndex}>\n {row.map((month) => (\n <Ark.TableCell key={month.value} value={month.value}>\n <Ark.TableCellTrigger className={gridCellTrigger({ size })}>\n {month.label}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n ))}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n </Ark.View>\n ))\n .with(\"year\", () => (\n <Ark.View view=\"year\">\n {nav}\n <Ark.Table\n columns={5}\n className={cn(\"mx-auto table-fixed\", classNames?.table)}\n style={{ width: calendarGridWidth(size, numOfMonths) }}\n >\n <Ark.TableBody>\n {api.getYearsGrid({ columns: 5 }).map((row, rowIndex) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a fixed-length grid chunked at render time, never reordered.\n <Ark.TableRow key={rowIndex}>\n {row.map((year) => (\n <Ark.TableCell key={year.value} value={year.value}>\n <Ark.TableCellTrigger className={gridCellTrigger({ size })}>\n {year.label}\n </Ark.TableCellTrigger>\n </Ark.TableCell>\n ))}\n </Ark.TableRow>\n ))}\n </Ark.TableBody>\n </Ark.Table>\n </Ark.View>\n ))\n .exhaustive()\n }}\n </Ark.Context>\n)\n","\"use client\"\n\nimport { type DateValue, useDatePickerContext } from \"@ark-ui/react/date-picker\"\nimport { isSameDay, today } from \"@internationalized/date\"\nimport { type RefObject, useRef } from \"react\"\nimport { calendarValueToDate, dateToArkValue } from \"../../lib/date-value\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\n\n/** A stable fingerprint of Ark's value array, to recognise one specific `setValue` echo. */\nexport const hashArkValues = (values: DateValue[]): string => values.map(String).join(\",\")\n\n/**\n * The value Ark is about to report back from a zone re-seed, or `null`. The root's\n * `onValueChange` swallows the one change whose hash matches it, because re-expressing the\n * selection in a new zone is not a change the user made.\n */\nexport type ZoneReseedRef = RefObject<string | null>\n\n/**\n * Keeps an Ark `date-picker` machine's selection on the same **instant** when its `timeZone`\n * changes, without remounting it. Renders nothing; mount it inside `Ark.Root`.\n *\n * Ark reads `defaultValue` once, at mount, and from then on holds the selection as a wall-calendar\n * `DateValue`. A grid pick is a plain `CalendarDate` with no zone at all, so on its own a zone\n * change would keep the *day* and silently move the instant the app was handed by `onChange`. The\n * one zone change every SSR app sees is `timeZone=\"auto\"` going from the UTC hydration snapshot\n * to the host zone, and there the uncontrolled `defaultValue` would stay on the UTC day.\n *\n * So, in a layout effect after the render that changed the zone:\n *\n * - **Uncontrolled**: each value is read back as an instant in the *old* zone (what `onChange`\n * reported) and handed to Ark again in the new one, through `api.setValue`. That may land on\n * another calendar day near midnight, which is the point. `pendingRef` marks the echo so the\n * root doesn't report it through `onChange`.\n * - **Controlled**: nothing to do. The root re-derives Ark's `value` from the app's `Date`s in\n * the new zone on every render, which is already the same instant.\n * - **Focus**: the machine's focused day (the keyboard's roving cell, and the month on show)\n * follows its anchor, the selection or else today, when it sat on that anchor before the\n * change. A month the user navigated to stays put. `setFocusedValue` never moves DOM focus.\n *\n * A remount would do all of this too, but it also resets everything the user did since mount: a\n * pick goes back to `defaultValue`, typed text is cleared, and DOM focus drops to `<body>`.\n */\nexport const CalendarZoneSync = ({\n timeZone,\n controlled,\n pendingRef,\n}: {\n timeZone: string\n controlled: boolean\n pendingRef: ZoneReseedRef\n}) => {\n const api = useDatePickerContext()\n const previous = useRef({ timeZone, value: api.value })\n\n // No dependency list on purpose: the previous value has to be the one from the last render,\n // which under a controlled `value` is already the new zone's by the time the zone changes.\n useIsomorphicLayoutEffect(() => {\n const { timeZone: from, value: before } = previous.current\n previous.current = { timeZone, value: api.value }\n if (from === timeZone) return\n\n const after = controlled\n ? api.value\n : before.map((value) => dateToArkValue(calendarValueToDate(value, from), timeZone))\n if (!controlled && after.length > 0) {\n pendingRef.current = hashArkValues(after)\n api.setValue(after)\n }\n\n // `setValue` also moves the focused day onto the new value, so this runs either way: it\n // either confirms that move or puts back a month the user had navigated to.\n const anchorBefore = before[0] ?? today(from)\n const focused = api.focusedValue\n api.setFocusedValue(isSameDay(focused, anchorBefore) ? (after[0] ?? today(timeZone)) : focused)\n })\n\n return null\n}\n","\"use client\"\n\nimport { DatePicker as Ark, type DatePickerDateView as DateView } from \"@ark-ui/react/date-picker\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { type ComponentProps, type ReactNode, useRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { DatePredicate } from \"../../lib/date-predicates\"\nimport {\n calendarValueToDate,\n type DateRangeValue,\n dateToArkValue,\n fromArkValues,\n toArkValues,\n} from \"../../lib/date-value\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport type { FormControlProps } from \"../../lib/form-control\"\nimport { useTimeZone } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { CalendarBody, type CalendarBodyClassNames, type CalendarIcons } from \"./calendar-body\"\nimport { CalendarZoneSync, hashArkValues } from \"./calendar-zone-sync\"\n\n/**\n * Calendar — the inline month grid (RFC §9, `docs/rfcs/date-picker.md`): Ark's `date-picker`\n * machine rendered `inline` (no trigger/popover), wrapping the shared `CalendarBody` grid that\n * `DatePicker` will later reuse verbatim inside its own popover.\n *\n * - Value is a native `Date | null` (or `{ start, end }` under `range`) — the machine's\n * `DateValue` array contract never leaks out; `lib/date-value.ts` is the one conversion\n * boundary both directions go through.\n * - Controlled/uncontrolled `value` / `defaultValue` / `onChange` go straight to Ark's own\n * machine, which supports both natively — no `useUncontrolled` needed here.\n * - `isDateUnavailable` / `min` / `max` take native `Date`s and are adapted to Ark's\n * `DateValue`-based signature at this boundary; pair with the `lib/date-predicates.ts`\n * helpers (`disablePast()`, `disableWeekends()`, …).\n * - No `label` / `description` / `error` / `FieldShell` wrap — `Calendar` is a bare widget\n * (like `Table`), not a form field. A `DatePicker` popover is where a field wrapper belongs.\n *\n * <Calendar value={date} onChange={setDate} isDateUnavailable={disableWeekends()} />\n */\n\nexport type CalendarClassNames = CalendarBodyClassNames & {\n /** The outermost `Ark.Root` element. */\n root?: string\n}\n\n/** Ark's own `translations` prop type, derived structurally rather than imported by name —\n * `IntlTranslations` lives in `@zag-js/date-picker`, a transitive dependency of the\n * `@ark-ui/react` peer dep, not one this package declares itself. */\ntype ArkTranslations = NonNullable<ComponentProps<typeof Ark.Root>[\"translations\"]>\n\n/** The subset `CalendarBody`'s rendered anatomy actually exercises — `trigger`/`clearTrigger`\n * only apply when composed under `DatePicker` (a bare `Calendar` never renders a trigger/clear\n * button; harmless no-op keys there). Unset keys fall back to Ark's own English text. */\nexport type CalendarTranslations = Pick<\n ArkTranslations,\n | \"dayCell\"\n | \"trigger\"\n | \"viewTrigger\"\n | \"prevTrigger\"\n | \"nextTrigger\"\n | \"clearTrigger\"\n | \"content\"\n | \"weekColumnHeader\"\n | \"weekNumberCell\"\n>\n\n/** Passes a partial override straight through to `Ark.Root`. Ark's `translations` prop is\n * itself all-optional (since @ark-ui/react 5.38.2), so unset keys fall back to Ark's own\n * English defaults and this kit no longer keeps a copy of them to merge over. That copy was\n * load-bearing when the prop demanded every key at once; keeping it now would only let a\n * stale duplicate override Ark's upstream fixes — which is exactly what happened to\n * `viewTrigger`, whose day-view label named the wrong target view until Ark corrected it. */\nexport const resolveCalendarTranslations = (\n overrides?: Partial<CalendarTranslations>,\n): ArkTranslations | undefined => overrides\n\n/** What `renderDay` is told about the day it decorates. */\nexport type CalendarDayState = {\n /** The day can't be picked: `isDateUnavailable`, or outside `min`/`max`. */\n unavailable: boolean\n /** The day is selected, or is one end of the selected range. */\n selected: boolean\n /** @deprecated Renamed `unavailable`. Removed in the next minor. */\n isUnavailable: boolean\n /** @deprecated Renamed `selected`. Removed in the next minor. */\n isSelected: boolean\n}\n\n/** Builds `renderDay`'s state; reading a deprecated `is*` key warns once in development. */\nconst dayState = (day: { isUnavailable: boolean; isSelected: boolean }): CalendarDayState => ({\n unavailable: day.isUnavailable,\n selected: day.isSelected,\n get isUnavailable() {\n warnRenamedProp(\"Calendar renderDay\", \"isUnavailable\", \"unavailable\")\n return day.isUnavailable\n },\n get isSelected() {\n warnRenamedProp(\"Calendar renderDay\", \"isSelected\", \"selected\")\n return day.isSelected\n },\n})\n\nexport type CalendarProps<Range extends boolean = false> = FormControlProps<\n Range extends true ? DateRangeValue : Date | null,\n HTMLDivElement\n> &\n WithTestId & {\n /** Select a `{ start, end }` range instead of a single date. */\n range?: Range\n /** Months shown side by side. Default 1. */\n numOfMonths?: number\n /** Restriction predicate over a native `Date`. Compose with `lib/date-predicates.ts`'s helpers.\n * Called with this component's own resolved `timeZone` as its second argument, so a predicate\n * reads the candidate day in the same zone the grid renders it in. */\n isDateUnavailable?: DatePredicate\n /** Earliest selectable day; earlier days render unavailable and navigation stops there. */\n min?: Date\n /** Latest selectable day; later days render unavailable and navigation stops there. */\n max?: Date\n /** Bounds the view levels reachable via navigation (e.g. `minView=\"month\"` for a month-only\n * picker that never drills into individual days). */\n minView?: DateView\n /** The widest view the header's view switch can climb to (`\"day\"`, `\"month\"` or `\"year\"`). */\n maxView?: DateView\n /** Per-day decoration slot — the \"event dot\" (RFC §9). `ctx` says whether the day is\n * `unavailable` or `selected`. */\n renderDay?: (date: Date, ctx: CalendarDayState) => ReactNode\n /** Always render 6 week rows (padding with adjacent-month days) instead of however many the\n * visible month(s) actually span (4–6) — keeps the grid's height constant while navigating\n * between months. */\n fixedWeeks?: boolean\n /** Adds a leading column with each row's week number. */\n withWeekNumbers?: boolean\n /** Overrides the active locale context. Drives month/day names and first-day-of-week. */\n locale?: string\n /** Overrides the time zone for every `Date ↔ DateValue` conversion. Resolves\n * **prop → `IntlProvider` → host zone**, through `useTimeZone` like `Schedule` — **not** Ark's\n * own machine default (`\"UTC\"`), which is why the resolved zone is forwarded to `Ark.Root`\n * explicitly rather than only used in this component's own conversions (see\n * `lib/date-value.ts`'s module doc). Accepts `\"auto\"` to follow the host zone. */\n timeZone?: string\n /** Overrides Ark's own built-in aria-label/accessible-name strings (day cells, prev/next, the\n * view-cycling header, week numbers) — English by default. Unlike `locale`, nothing here\n * auto-derives; supply your own translated strings. Partial — unset keys keep Ark's default. */\n translations?: Partial<CalendarTranslations>\n /** Replaces the default icons: `prev`, `next`. The kit's chevrons mirror under RTL; an\n * icon passed here is drawn as given. */\n icons?: CalendarIcons\n /** Cell and text size, off the kit's `xs`–`xl` scale. Default `\"md\"`. */\n size?: Size\n className?: string\n classNames?: CalendarClassNames\n }\n\nexport const Calendar = <Range extends boolean = false>({\n range,\n value,\n defaultValue,\n onChange,\n onBlur,\n numOfMonths = 1,\n isDateUnavailable,\n min,\n max,\n minView,\n maxView,\n renderDay,\n fixedWeeks,\n withWeekNumbers,\n locale,\n timeZone,\n translations,\n icons,\n size = \"md\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n id,\n ref,\n className,\n classNames,\n testId,\n}: CalendarProps<Range>) => {\n const { locale: contextLocale } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const resolvedTimeZone = useTimeZone(timeZone)\n const isRange = Boolean(range)\n const zoneReseed = useRef<string | null>(null)\n\n return (\n <Ark.Root\n inline\n ref={ref}\n id={id}\n selectionMode={isRange ? \"range\" : \"single\"}\n locale={resolvedLocale}\n timeZone={resolvedTimeZone}\n translations={resolveCalendarTranslations(translations)}\n value={toArkValues(value, resolvedTimeZone)}\n defaultValue={toArkValues(defaultValue, resolvedTimeZone)}\n onValueChange={(details) => {\n // A zone change re-expresses the selection in the new zone; that echo is not a change.\n if (zoneReseed.current === hashArkValues(details.value)) {\n zoneReseed.current = null\n return\n }\n // The machine's value is a plain DateValue[]; `range` is a runtime flag here, so narrow\n // the result back to the caller's declared shape.\n onChange?.(\n fromArkValues(details.value, isRange, resolvedTimeZone) as Range extends true\n ? DateRangeValue\n : Date | null,\n )\n }}\n onBlur={onBlur}\n numOfMonths={numOfMonths}\n fixedWeeks={fixedWeeks}\n // Ark's own prop — its name doesn't follow this kit's `withX` convention, so it stays\n // `showWeekNumbers` even though our public prop is `withWeekNumbers`.\n showWeekNumbers={withWeekNumbers}\n isDateUnavailable={\n isDateUnavailable\n ? (dateValue) =>\n isDateUnavailable(calendarValueToDate(dateValue, resolvedTimeZone), resolvedTimeZone)\n : undefined\n }\n min={min ? dateToArkValue(min, resolvedTimeZone) : undefined}\n max={max ? dateToArkValue(max, resolvedTimeZone) : undefined}\n minView={minView}\n maxView={maxView}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n invalid={invalid}\n name={name}\n className={cn(\"inline-flex flex-col\", className, classNames?.root)}\n {...props({ \"data-testid\": testId })}\n >\n {/* The machine looks up the currently-focused cell by querying inside the `Content` part\n * (`getFocusedCell` scopes its DOM query to `getContentEl`) to call `.focus()` on it after\n * every arrow-key/Home/End/PageUp/PageDown press — even though `inline` never opens a real\n * popover, that lookup still runs, and with no `Content` element in the DOM at all it\n * always finds nothing, so keyboard navigation updates the machine's internal focus state\n * (visible via `data-focus`) but never moves real DOM focus. `inline` implies `open` (the\n * machine treats it as permanently open), so `Content`'s `hidden={!open}` never hides this. */}\n {/* Ark reads `defaultValue` once, at mount, so a zone change (`timeZone=\"auto\"` going from\n * the UTC hydration snapshot to the host zone, or the app's provider changing) would leave\n * the selection on the old zone's day. This re-seeds it on the same instant in place;\n * see `calendar-zone-sync.tsx` for why it isn't a remount. */}\n <CalendarZoneSync\n timeZone={resolvedTimeZone}\n controlled={value !== undefined}\n pendingRef={zoneReseed}\n />\n <Ark.Content>\n <CalendarBody\n numOfMonths={numOfMonths}\n withWeekNumbers={withWeekNumbers}\n renderDay={renderDay && ((date, day) => renderDay(date, dayState(day)))}\n size={size}\n timeZone={resolvedTimeZone}\n classNames={classNames}\n icons={icons}\n />\n </Ark.Content>\n </Ark.Root>\n )\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComboboxSearchRow } from './chunk-
|
|
1
|
+
import { ComboboxSearchRow } from './chunk-ISX3AM32.js';
|
|
2
2
|
import { controlIndicator } from './chunk-NLOBBJAA.js';
|
|
3
3
|
import { normalizeSelectData, useLabelSearch, filterSelectData } from './chunk-7TDHT3QD.js';
|
|
4
|
-
import { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox } from './chunk-
|
|
4
|
+
import { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox } from './chunk-QRNQQIQM.js';
|
|
5
5
|
import { FieldShell } from './chunk-X6DESK37.js';
|
|
6
6
|
import { useUncontrolled } from './chunk-PMUCGFY5.js';
|
|
7
7
|
import { CheckIcon, CloseIcon } from './chunk-6YNLRQ25.js';
|
|
@@ -160,5 +160,5 @@ var MultiComboboxList = ({
|
|
|
160
160
|
};
|
|
161
161
|
|
|
162
162
|
export { MultiComboboxList };
|
|
163
|
-
//# sourceMappingURL=chunk-
|
|
164
|
-
//# sourceMappingURL=chunk-
|
|
163
|
+
//# sourceMappingURL=chunk-7KFUFAVP.js.map
|
|
164
|
+
//# sourceMappingURL=chunk-7KFUFAVP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/multi-combobox-list/multi-combobox-list.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;;AAiEO,IAAM,aAAA,GAA8D;AAAA,EACzE,MAAA,kBAAQ,GAA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WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-JFB6O7IY.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { SearchIcon } from \"lucide-react\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport {\n filterSelectData,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n useLabelSearch,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { controlIndicator } from \"../checkbox/control\"\nimport {\n COMBOBOX_DEFAULT_TRANSLATIONS,\n Combobox,\n type ComboboxTranslations,\n} from \"../combobox/combobox\"\nimport { ComboboxSearchRow } from \"../combobox-list/combobox-search-row\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport type { InputSize, InputVariant } from \"../input/input\"\nimport { CheckIcon, CloseIcon } from \"../popover/icons\"\n\n/**\n * MultiComboboxList — a searchable, multi-value option list with no trigger of\n * its own. Same idea as [`ComboboxList`](/docs/combobox-list) but for several\n * values at once: every option shows a checkbox instead of a single check\n * mark, and picking one doesn't close the list. It renders permanently open —\n * embed it inline inside a container you already control the visibility of\n * (a `Popover`, a `Drawer`, a custom panel).\n *\n * - `data` / `value` / `onChange` match [`MultiSelect`](/docs/multi-select)\n * exactly (`SelectValue<Data>[]`) — but options render as a checkbox list\n * rather than pills in the input, which is lighter in a compact popover.\n * - Type to filter; `clearable` clears every value at once; `maxValues` caps\n * the selection; `hidePickedOptions` drops chosen options from the list.\n * - Label / description / error come from the built-in `Field`, same as the\n * rest of the family — omit them when embedding inside your own popover.\n */\n\ntype MultiComboboxListClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The search row (also targeted by `className`). */\n search?: string\n /** The search `<input>`. */\n input?: string\n /** A single option row. */\n option?: string\n /** The checkbox indicator inside an option row. */\n checkbox?: string\n /** The scrollable option list. */\n list?: string\n}\n\nexport type MultiComboboxListIconSlot = \"search\" | \"clear\" | \"check\"\nexport type MultiComboboxListIcons = IconMap<MultiComboboxListIconSlot>\n\n/** The default icons: the search row's magnifier and clear ×, and the selected option's checkbox mark. */\nexport const DEFAULT_ICONS: Record<MultiComboboxListIconSlot, ReactNode> = {\n search: <SearchIcon className={iconStroke} />,\n clear: <CloseIcon />,\n check: <CheckIcon />,\n}\n\nexport type MultiComboboxListProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled selected values. */\n value?: SelectValue<Data>[]\n /** Uncontrolled initial selection. */\n defaultValue?: SelectValue<Data>[]\n /** Fires with the full selection on every add / remove. */\n onChange?: (value: SelectValue<Data>[]) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including the\n * checkbox affordance. Omit it to render the checkbox + label.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder for the search field. */\n placeholder?: string\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n /** Show a button that clears every value at once. */\n clearable?: boolean\n /** Cap the number of selected values. */\n maxValues?: number\n /** Hide options that are already selected. */\n hidePickedOptions?: boolean\n size?: InputSize\n /**\n * Search row treatment. Defaults to `\"unstyled\"` (no border/background) since\n * this is normally embedded inside a container that already draws its own\n * chrome; pass `\"default\"` / `\"filled\"` when using it standalone.\n */\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for native form submission (one hidden input per value). */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: MultiComboboxListClassNames\n /** Overrides the clear button's accessible name (`clearTriggerLabel`, default\n * `\"Clear value\"`) — the same key as the rest of the combobox family. */\n translations?: MultiComboboxListTranslations\n /** Replaces the default icons: `search`, `clear`, `check`. A missing key keeps its\n * default; `search: null` drops the magnifier. `renderItem` draws its own rows. */\n icons?: MultiComboboxListIcons\n }\n\n/** The combobox family's `clearTriggerLabel` — the only family key this always-open list\n * renders (it has no chevron). */\nexport type MultiComboboxListTranslations = Pick<ComboboxTranslations, \"clearTriggerLabel\">\n\nexport const MultiComboboxList = <const Data extends SelectData = SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Search…\",\n empty = \"Nothing found\",\n clearable,\n maxValues,\n hidePickedOptions,\n size = \"md\",\n variant = \"unstyled\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: MultiComboboxListProps<Data>) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const clearLabel =\n translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel\n type Item = SelectValue<Data>\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [value, setSelected] = useUncontrolled<Item[]>({\n value: valueProp,\n defaultValue: defaultValue ?? [],\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n const setValues = (next: Item[]) => {\n // Adding past the cap is rejected; removals always pass.\n if (maxValues != null && next.length > value.length && next.length > maxValues) {\n return\n }\n setSelected(next)\n }\n\n // Normalize once per `data`; only the filter re-runs as the query/selection changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const labelSearch = useLabelSearch()\n const { collection, items, groups } = useMemo(() => {\n const picked = new Set<string>(value)\n return filterSelectData(\n normalized,\n (item) =>\n (!hidePickedOptions || !picked.has(item.value)) && labelSearch.matches(item.label, search),\n )\n }, [normalized, search, hidePickedOptions, value, labelSearch])\n\n // `canClear` reserves the clear button's box (and the shell's end-slot\n // padding) for the whole time the field is clearable, not just while it\n // has a value — otherwise the button mounting/unmounting shifts the\n // search input's width. `showClear` only toggles visibility/interactivity.\n const canClear = Boolean(clearable) && !disabled && !readOnly\n const showClear = canClear && ((value != null && value.length > 0) || search.length > 0)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={cn(\"group/item\", classNames?.option)}\n >\n {(state) =>\n renderItem ? (\n renderItem(item, state)\n ) : (\n <>\n {/* Presentational: the option row owns the selection semantics.\n It borrows Checkbox's own box, driven by `data-state` the way\n Ark drives the real one, so the two never drift apart. */}\n <span\n aria-hidden\n data-state={state.selected ? \"checked\" : \"unchecked\"}\n className={cn(controlIndicator({ size, variant: \"filled\" }), classNames?.checkbox)}\n >\n <ArkCombobox.ItemIndicator>{icons.check}</ArkCombobox.ItemIndicator>\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{item.label}</span>\n </>\n )\n }\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItemOf<Data>>\n multiple\n collection={collection}\n value={value}\n // Ark types the values as `string[]`; they always originate from `data`,\n // so narrow them back to the caller's value union.\n onValueChange={(details) => setValues(details.value as Item[])}\n inputValue={search}\n onInputValueChange={(details) => setSearch(details.inputValue)}\n selectionBehavior=\"clear\"\n // There's no trigger to open it — the caller (e.g. a `Popover`) already\n // owns whether this mounts at all, so keep the machine permanently open.\n open\n onOpenChange={() => {}}\n // The caller's own container (Popover, Drawer, …) already owns\n // dismiss-on-outside-click; without this the always-open machine\n // registers its own (functionally inert, since `onOpenChange` is a\n // no-op) listbox dismissable layer, which logs a spurious\n // \"[@zag-js/dismissable] node is `null` or `undefined`\" warning.\n disableLayer\n closeOnSelect={false}\n autoFocus\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={className}\n >\n <ComboboxSearchRow\n size={size}\n variant={variant}\n invalid={isInvalid}\n placeholder={placeholder}\n canClear={canClear}\n showClear={showClear}\n clearLabel={clearLabel}\n onClear={() => {\n setValues([])\n setSearch(\"\")\n }}\n onBlur={onBlur}\n ref={ref}\n testId={testId}\n icons={icons}\n classNames={classNames}\n />\n\n <Combobox.Panel className={classNames?.list}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Panel>\n\n {/* Hidden inputs carry the real selection so a native `<form>` submits\n the value array (the search input is unnamed). When controlled by a\n form library the value flows through `onChange` instead, and these\n are just submitted alongside it. */}\n {name != null && value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} />)}\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/multi-combobox-list/multi-combobox-list.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;;AAiEO,IAAM,aAAA,GAA8D;AAAA,EACzE,MAAA,kBAAQ,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAC3C,KAAA,sBAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,EAClB,KAAA,sBAAQ,SAAA,EAAA,EAAU;AACpB,CAAA;AA8DO,IAAM,oBAAoB,CAA6C;AAAA,EAC5E,IAAA;AAAA,EACA,KAAA,EAAO,SAAA;AAAA,EACP,YAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA,GAAc,cAAA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GAAA;AAAA,YACA,MAAA;AAAA,YACA,KAAA;AAAA,YACA;AAAA;AAAA,SACF;AAAA,6BAEC,QAAA,CAAS,KAAA,EAAT,EAAe,SAAA,EAAW,YAAY,IAAA,EACpC,QAAA,EAAA;AAAA,UAAA,MAAA,GACG,MAAA,CAAO,IAAI,CAAC,KAAA,yBACT,QAAA,CAAS,KAAA,EAAT,EAAiC,KAAA,EAAO,KAAA,CAAM,KAAA,EAC5C,gBAAM,KAAA,CAAM,GAAA,CAAI,YAAY,CAAA,EAAA,EADV,KAAA,CAAM,KAE3B,CACD,CAAA,GACD,KAAA,CAAM,GAAA,CAAI,YAAY,CAAA;AAAA,UACzB,SAAS,IAAA,oBAAQ,GAAA,CAAC,QAAA,CAAS,KAAA,EAAT,EAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,SAAA,EAC3C,CAAA;AAAA,QAMC,IAAA,IAAQ,IAAA,IAAQ,KAAA,CAAM,GAAA,CAAI,CAAC,CAAA,qBAAM,GAAA,CAAC,OAAA,EAAA,EAAc,IAAA,EAAK,QAAA,EAAS,IAAA,EAAY,KAAA,EAAO,CAAA,EAAA,EAApC,CAAuC,CAAE;AAAA;AAAA;AAAA,GACzF;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-7KFUFAVP.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { SearchIcon } from \"lucide-react\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport {\n filterSelectData,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n useLabelSearch,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { controlIndicator } from \"../checkbox/control\"\nimport {\n COMBOBOX_DEFAULT_TRANSLATIONS,\n Combobox,\n type ComboboxTranslations,\n} from \"../combobox/combobox\"\nimport { ComboboxSearchRow } from \"../combobox-list/combobox-search-row\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport type { InputSize, InputVariant } from \"../input/input\"\nimport { CheckIcon, CloseIcon } from \"../popover/icons\"\n\n/**\n * MultiComboboxList — a searchable, multi-value option list with no trigger of\n * its own. Same idea as [`ComboboxList`](/docs/combobox-list) but for several\n * values at once: every option shows a checkbox instead of a single check\n * mark, and picking one doesn't close the list. It renders permanently open —\n * embed it inline inside a container you already control the visibility of\n * (a `Popover`, a `Drawer`, a custom panel).\n *\n * - `data` / `value` / `onChange` match [`MultiSelect`](/docs/multi-select)\n * exactly (`SelectValue<Data>[]`) — but options render as a checkbox list\n * rather than pills in the input, which is lighter in a compact popover.\n * - Type to filter; `clearable` clears every value at once; `maxValues` caps\n * the selection; `hidePickedOptions` drops chosen options from the list.\n * - Label / description / error come from the built-in `Field`, same as the\n * rest of the family — omit them when embedding inside your own popover.\n */\n\ntype MultiComboboxListClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The search row (also targeted by `className`). */\n search?: string\n /** The search `<input>`. */\n input?: string\n /** A single option row. */\n option?: string\n /** The checkbox indicator inside an option row. */\n checkbox?: string\n /** The scrollable option list. */\n list?: string\n}\n\nexport type MultiComboboxListIconSlot = \"search\" | \"clear\" | \"check\"\nexport type MultiComboboxListIcons = IconMap<MultiComboboxListIconSlot>\n\n/** The default icons: the search row's magnifier and clear ×, and the selected option's checkbox mark. */\nexport const DEFAULT_ICONS: Record<MultiComboboxListIconSlot, ReactNode> = {\n search: <SearchIcon className={iconStroke} />,\n clear: <CloseIcon />,\n check: <CheckIcon />,\n}\n\nexport type MultiComboboxListProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled selected values. */\n value?: SelectValue<Data>[]\n /** Uncontrolled initial selection. */\n defaultValue?: SelectValue<Data>[]\n /** Fires with the full selection on every add / remove. */\n onChange?: (value: SelectValue<Data>[]) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including the\n * checkbox affordance. Omit it to render the checkbox + label.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder for the search field. */\n placeholder?: string\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n /** Show a button that clears every value at once. */\n clearable?: boolean\n /** Cap the number of selected values. */\n maxValues?: number\n /** Hide options that are already selected. */\n hidePickedOptions?: boolean\n size?: InputSize\n /**\n * Search row treatment. Defaults to `\"unstyled\"` (no border/background) since\n * this is normally embedded inside a container that already draws its own\n * chrome; pass `\"default\"` / `\"filled\"` when using it standalone.\n */\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for native form submission (one hidden input per value). */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: MultiComboboxListClassNames\n /** Overrides the clear button's accessible name (`clearTriggerLabel`, default\n * `\"Clear value\"`) — the same key as the rest of the combobox family. */\n translations?: MultiComboboxListTranslations\n /** Replaces the default icons: `search`, `clear`, `check`. A missing key keeps its\n * default; `search: null` drops the magnifier. `renderItem` draws its own rows. */\n icons?: MultiComboboxListIcons\n }\n\n/** The combobox family's `clearTriggerLabel` — the only family key this always-open list\n * renders (it has no chevron). */\nexport type MultiComboboxListTranslations = Pick<ComboboxTranslations, \"clearTriggerLabel\">\n\nexport const MultiComboboxList = <const Data extends SelectData = SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Search…\",\n empty = \"Nothing found\",\n clearable,\n maxValues,\n hidePickedOptions,\n size = \"md\",\n variant = \"unstyled\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: MultiComboboxListProps<Data>) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const clearLabel =\n translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel\n type Item = SelectValue<Data>\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [value, setSelected] = useUncontrolled<Item[]>({\n value: valueProp,\n defaultValue: defaultValue ?? [],\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n const setValues = (next: Item[]) => {\n // Adding past the cap is rejected; removals always pass.\n if (maxValues != null && next.length > value.length && next.length > maxValues) {\n return\n }\n setSelected(next)\n }\n\n // Normalize once per `data`; only the filter re-runs as the query/selection changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const labelSearch = useLabelSearch()\n const { collection, items, groups } = useMemo(() => {\n const picked = new Set<string>(value)\n return filterSelectData(\n normalized,\n (item) =>\n (!hidePickedOptions || !picked.has(item.value)) && labelSearch.matches(item.label, search),\n )\n }, [normalized, search, hidePickedOptions, value, labelSearch])\n\n // `canClear` reserves the clear button's box (and the shell's end-slot\n // padding) for the whole time the field is clearable, not just while it\n // has a value — otherwise the button mounting/unmounting shifts the\n // search input's width. `showClear` only toggles visibility/interactivity.\n const canClear = Boolean(clearable) && !disabled && !readOnly\n const showClear = canClear && ((value != null && value.length > 0) || search.length > 0)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={cn(\"group/item\", classNames?.option)}\n >\n {(state) =>\n renderItem ? (\n renderItem(item, state)\n ) : (\n <>\n {/* Presentational: the option row owns the selection semantics.\n It borrows Checkbox's own box, driven by `data-state` the way\n Ark drives the real one, so the two never drift apart. */}\n <span\n aria-hidden\n data-state={state.selected ? \"checked\" : \"unchecked\"}\n className={cn(controlIndicator({ size, variant: \"filled\" }), classNames?.checkbox)}\n >\n <ArkCombobox.ItemIndicator>{icons.check}</ArkCombobox.ItemIndicator>\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{item.label}</span>\n </>\n )\n }\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItemOf<Data>>\n multiple\n collection={collection}\n value={value}\n // Ark types the values as `string[]`; they always originate from `data`,\n // so narrow them back to the caller's value union.\n onValueChange={(details) => setValues(details.value as Item[])}\n inputValue={search}\n onInputValueChange={(details) => setSearch(details.inputValue)}\n selectionBehavior=\"clear\"\n // There's no trigger to open it — the caller (e.g. a `Popover`) already\n // owns whether this mounts at all, so keep the machine permanently open.\n open\n onOpenChange={() => {}}\n // The caller's own container (Popover, Drawer, …) already owns\n // dismiss-on-outside-click; without this the always-open machine\n // registers its own (functionally inert, since `onOpenChange` is a\n // no-op) listbox dismissable layer, which logs a spurious\n // \"[@zag-js/dismissable] node is `null` or `undefined`\" warning.\n disableLayer\n closeOnSelect={false}\n autoFocus\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={className}\n >\n <ComboboxSearchRow\n size={size}\n variant={variant}\n invalid={isInvalid}\n placeholder={placeholder}\n canClear={canClear}\n showClear={showClear}\n clearLabel={clearLabel}\n onClear={() => {\n setValues([])\n setSearch(\"\")\n }}\n onBlur={onBlur}\n ref={ref}\n testId={testId}\n icons={icons}\n classNames={classNames}\n />\n\n <Combobox.Panel className={classNames?.list}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Panel>\n\n {/* Hidden inputs carry the real selection so a native `<form>` submits\n the value array (the search input is unnamed). When controlled by a\n form library the value flows through `onChange` instead, and these\n are just submitted alongside it. */}\n {name != null && value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} />)}\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Progress } from './chunk-QKSLDQM2.js';
|
|
2
2
|
import { FILE_KIND_ICONS } from './chunk-SDVZFXQ2.js';
|
|
3
3
|
import { Image } from './chunk-Y57NW6G7.js';
|
|
4
|
-
import { Button } from './chunk-
|
|
4
|
+
import { Button } from './chunk-SP6LCCTZ.js';
|
|
5
5
|
import { formatFileSize, useObjectUrl, fileKind } from './chunk-WERJ44ZN.js';
|
|
6
6
|
import { useLocale, useTimeZone } from './chunk-IUK7OJXZ.js';
|
|
7
7
|
import { CloseIcon } from './chunk-6YNLRQ25.js';
|
|
@@ -336,5 +336,5 @@ var FileItem = Object.assign(FileItemComponent, {
|
|
|
336
336
|
});
|
|
337
337
|
|
|
338
338
|
export { FileItem, isInFlight };
|
|
339
|
-
//# sourceMappingURL=chunk-
|
|
340
|
-
//# sourceMappingURL=chunk-
|
|
339
|
+
//# sourceMappingURL=chunk-ASKQ6N5V.js.map
|
|
340
|
+
//# sourceMappingURL=chunk-ASKQ6N5V.js.map
|