@42-central/ui-react 0.25.0 → 0.27.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-NLSJ6T7V.js → chunk-4D2V4JE4.js} +3 -3
- package/dist/{chunk-NLSJ6T7V.js.map → chunk-4D2V4JE4.js.map} +1 -1
- package/dist/{chunk-QZ4N5LYG.js → chunk-5H5YOPCF.js} +3 -3
- package/dist/{chunk-QZ4N5LYG.js.map → chunk-5H5YOPCF.js.map} +1 -1
- package/dist/{chunk-6II2DVYR.js → chunk-7KFUFAVP.js} +4 -4
- package/dist/{chunk-6II2DVYR.js.map → chunk-7KFUFAVP.js.map} +1 -1
- package/dist/{chunk-XUFCI262.js → chunk-7OGZT7U2.js} +12 -4
- package/dist/chunk-7OGZT7U2.js.map +1 -0
- package/dist/{chunk-PI7X5YFJ.js → chunk-BGDVUC3B.js} +5 -5
- package/dist/{chunk-PI7X5YFJ.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-FZSLSUSX.js → chunk-HCHGERDB.js} +3 -3
- package/dist/{chunk-FZSLSUSX.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-HQPU73WV.js → chunk-I4IJOLNA.js} +4 -4
- package/dist/{chunk-HQPU73WV.js.map → chunk-I4IJOLNA.js.map} +1 -1
- package/dist/{chunk-UDCCOUWR.js → chunk-IA6DCC3N.js} +6 -6
- package/dist/{chunk-UDCCOUWR.js.map → chunk-IA6DCC3N.js.map} +1 -1
- package/dist/{chunk-36NWC4GV.js → chunk-ISX3AM32.js} +3 -3
- package/dist/{chunk-36NWC4GV.js.map → chunk-ISX3AM32.js.map} +1 -1
- package/dist/{chunk-LMCUGYHT.js → chunk-L24N5EON.js} +6 -6
- package/dist/chunk-L24N5EON.js.map +1 -0
- package/dist/{chunk-HRNWWL3Y.js → chunk-L5GH7LLD.js} +61 -29
- package/dist/chunk-L5GH7LLD.js.map +1 -0
- package/dist/chunk-LJVIZNPE.js +9 -0
- package/dist/chunk-LJVIZNPE.js.map +1 -0
- package/dist/{chunk-AHKMN3YQ.js → chunk-MCRTAUSZ.js} +6 -6
- package/dist/chunk-MCRTAUSZ.js.map +1 -0
- package/dist/{chunk-LHUWOA2U.js → chunk-MNYY7UU2.js} +6 -6
- package/dist/{chunk-LHUWOA2U.js.map → chunk-MNYY7UU2.js.map} +1 -1
- package/dist/{chunk-7HZBD4YZ.js → chunk-NF2PBGD3.js} +36 -23
- package/dist/chunk-NF2PBGD3.js.map +1 -0
- package/dist/{chunk-54W6VAI3.js → chunk-NNPSBC7O.js} +5 -5
- package/dist/{chunk-54W6VAI3.js.map → chunk-NNPSBC7O.js.map} +1 -1
- package/dist/{chunk-MW42XVPD.js → chunk-PBSVX5DB.js} +15 -5
- package/dist/chunk-PBSVX5DB.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-6UIQJJNJ.js → chunk-QRNQQIQM.js} +5 -5
- package/dist/{chunk-6UIQJJNJ.js.map → chunk-QRNQQIQM.js.map} +1 -1
- package/dist/{chunk-N66NC6QK.js → chunk-RKCUXOU2.js} +4 -4
- package/dist/{chunk-N66NC6QK.js.map → chunk-RKCUXOU2.js.map} +1 -1
- package/dist/{chunk-N5M4PDBK.js → chunk-SBZJGFZ6.js} +3 -3
- package/dist/{chunk-N5M4PDBK.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-SAXWCGWR.js → chunk-SOUDKESO.js} +14 -7
- package/dist/chunk-SOUDKESO.js.map +1 -0
- package/dist/{chunk-T44RW5DW.js → chunk-ULF5LOBS.js} +4 -4
- package/dist/{chunk-T44RW5DW.js.map → chunk-ULF5LOBS.js.map} +1 -1
- package/dist/components/ambient-background/index.js +9 -23
- package/dist/components/ambient-background/index.js.map +1 -1
- package/dist/components/ambient-background/starfield.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +55 -10
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.d.ts +1 -1
- package/dist/components/app-shell/index.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +299 -38
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/autocomplete/index.js +4 -4
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/index.js +10 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/button-group/button-group.d.ts +10 -2
- package/dist/components/button-group/button-group.d.ts.map +1 -1
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/button-multi-select/index.js +2 -2
- package/dist/components/button-select/button-select-control.d.ts +4 -1
- package/dist/components/button-select/button-select-control.d.ts.map +1 -1
- package/dist/components/button-select/button-select.d.ts +4 -1
- package/dist/components/button-select/button-select.d.ts.map +1 -1
- package/dist/components/button-select/index.js +2 -2
- package/dist/components/calendar-heatmap/index.js +2 -2
- package/dist/components/camera/index.js +6 -6
- 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 +878 -230
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/index.js +8 -8
- package/dist/components/drawer/index.js +4 -4
- package/dist/components/geodesic/a11y.d.ts +3 -3
- package/dist/components/geodesic/a11y.d.ts.map +1 -1
- package/dist/components/geodesic/badge-frame.d.ts +13 -1
- package/dist/components/geodesic/badge-frame.d.ts.map +1 -1
- package/dist/components/geodesic/exam-badge.d.ts +4 -1
- package/dist/components/geodesic/exam-badge.d.ts.map +1 -1
- package/dist/components/geodesic/geometry.d.ts +14 -9
- package/dist/components/geodesic/geometry.d.ts.map +1 -1
- package/dist/components/geodesic/index.js +62 -23
- package/dist/components/geodesic/index.js.map +1 -1
- package/dist/components/geodesic/status.d.ts +8 -6
- package/dist/components/geodesic/status.d.ts.map +1 -1
- package/dist/components/geodesic/styles.css +15 -2
- package/dist/components/hover-card/index.js +3 -3
- package/dist/components/indicator/index.js +23 -8
- package/dist/components/indicator/index.js.map +1 -1
- package/dist/components/indicator/indicator.d.ts +15 -6
- package/dist/components/indicator/indicator.d.ts.map +1 -1
- package/dist/components/kbd/index.js +3 -3
- package/dist/components/lightbox/index.js +4 -4
- package/dist/components/menu/index.js +4 -4
- package/dist/components/modal/index.js +4 -4
- 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 +5 -1
- package/dist/components/nav-link/nav-link.d.ts.map +1 -1
- package/dist/components/nav-link/tanstack.js +5 -1
- package/dist/components/nav-link/tanstack.js.map +1 -1
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.js +15 -3
- 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 +5 -5
- package/dist/components/photo-capture/index.js +6 -6
- package/dist/components/popover/index.js +3 -3
- package/dist/components/schedule/index.js +4 -4
- package/dist/components/segment-group/index.js +1 -1
- package/dist/components/segment-group/segment-group.d.ts +6 -1
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.js +5 -5
- package/dist/components/spotlight/index.js +8 -8
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/tabs-data.d.ts +4 -1
- package/dist/components/tabs/tabs-data.d.ts.map +1 -1
- package/dist/components/tabs/tabs.d.ts +4 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +3 -3
- package/dist/components/time-input/index.js +6 -6
- 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/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/lib/sidebar-rail.d.ts +21 -0
- package/dist/lib/sidebar-rail.d.ts.map +1 -0
- package/dist/theme.css +21 -18
- package/package.json +1 -1
- package/src/as-child.contract.test.tsx +6 -0
- package/src/components/ambient-background/starfield.tsx +14 -41
- package/src/components/app-shell/app-shell.test.tsx +430 -5
- package/src/components/app-shell/app-shell.tsx +484 -24
- package/src/components/app-shell/index.ts +2 -0
- package/src/components/avatar/avatar.test.tsx +12 -0
- package/src/components/avatar/avatar.tsx +9 -0
- package/src/components/button-group/button-group.test.tsx +24 -0
- package/src/components/button-group/button-group.tsx +21 -4
- package/src/components/button-multi-select/button-multi-select.test.tsx +15 -0
- package/src/components/button-select/button-select-control.tsx +5 -0
- package/src/components/button-select/button-select.test.tsx +25 -0
- package/src/components/button-select/button-select.tsx +13 -2
- 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/geodesic/badge-frame.tsx +67 -13
- package/src/components/geodesic/exam-badge.tsx +8 -4
- package/src/components/geodesic/geometry.ts +8 -6
- package/src/components/geodesic/status.test.ts +11 -2
- package/src/components/geodesic/status.ts +11 -7
- package/src/components/geodesic/styles.css +15 -2
- package/src/components/indicator/indicator.test.tsx +45 -0
- package/src/components/indicator/indicator.tsx +40 -13
- package/src/components/modal/modal.tsx +1 -1
- package/src/components/nav-link/nav-link.test.tsx +121 -1
- package/src/components/nav-link/nav-link.tsx +78 -29
- 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/segment-group/segment-group.test.tsx +22 -0
- package/src/components/segment-group/segment-group.tsx +35 -19
- package/src/components/tabs/tabs-data.tsx +5 -1
- package/src/components/tabs/tabs.test.tsx +28 -0
- package/src/components/tabs/tabs.tsx +14 -4
- 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/lib/sidebar-rail.ts +24 -0
- package/src/theme.css +21 -18
- package/src/theme.test.ts +14 -11
- package/dist/chunk-7HZBD4YZ.js.map +0 -1
- package/dist/chunk-7P32XCEU.js.map +0 -1
- package/dist/chunk-AHKMN3YQ.js.map +0 -1
- package/dist/chunk-H7WOMZXO.js.map +0 -1
- package/dist/chunk-HRNWWL3Y.js.map +0 -1
- package/dist/chunk-LMCUGYHT.js.map +0 -1
- package/dist/chunk-MW42XVPD.js.map +0 -1
- package/dist/chunk-SAXWCGWR.js.map +0 -1
- package/dist/chunk-XUFCI262.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/nav-link/nav-link.tsx","../src/components/nav-link/navigation.tsx"],"names":["props","jsx"],"mappings":";;;;;;;;;;;;AA6CA,IAAM,UAAA,GAAa,GAAA;AAAA,EACjB;AAAA,IACE,iGAAA;AAAA,IACA,gCAAA;AAAA,IACA,wCAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,uEAAA;AAAA,QACN,OAAO,kBAAA,CAAmB;AAAA;AAC5B,KACF;AAAA,IACA,e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AAAA,IAClB,cAAc,IAAA,CAAK,YAAA;AAAA,IACnB,aAAa,IAAA,CAAK,WAAA;AAAA,IAClB,aAAA;AAAA,IACA,YAAY,IAAA,CAAK,UAAA;AAAA,IACjB,YAAA;AAAA,IACA,QAAQ,IAAA,CAAK,MAAA;AAAA,IAEZ,QAAA,EAAA,IAAA,CAAK,KAAA,IAAS,IAAA,CAAK,KAAA,CAAM,MAAA,GAAS,CAAA;AAAA;AAAA;AAAA,sBAGjCA,IAAC,IAAA,EAAA,EAAG,SAAA,EAAW,GAAG,WAAW,CAAA,YAAA,CAAA,EAC1B,eAAK,KAAA,CAAM,GAAA;AAAA,QAAI,CAAC,KAAA,EAAO,CAAA,KACtB,UAAA,CAAW,KAAA,EAAO,CAAA,EAAG,GAAG,CAAA,CAAA,EAAI,CAAC,CAAA,CAAA,EAAI,aAAA,EAAe,YAAY;AAAA,OAC9D,EACF;AAAA,QACE;AAAA;AACN,CAAA,EAAA,EAzBO,GA0BT,CAAA;AAGF,SAAS,eAAe,EAAE,IAAA,EAAM,aAAA,EAAe,YAAA,EAAc,QAAO,EAAoB;AACtF,EAAA,uBACEA,GAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAW,WAAA,EAAc,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,MAAA,EAAQ,CAAA,EAC5D,eAAK,GAAA,CAAI,CAAC,IAAA,EAAM,CAAA,KAAM,UAAA,CAAW,IAAA,EAAM,CAAA,IAAA,EAAO,CAAC,CAAA,CAAA,EAAI,aAAA,EAAe,YAAY,CAAC,CAAA,EAClF,CAAA;AAEJ;AAIO,SAAS,WAAWD,MAAAA,EAAmC;AAC5D,EAAA,uBAAOC,GAAAA,CAAC,cAAA,EAAA,EAAgB,GAAGD,MAAAA,EAAO,CAAA;AACpC","file":"chunk-HRNWWL3Y.js","sourcesContent":["\"use client\"\n\nimport { cva } from \"class-variance-authority\"\nimport { type ElementType, type ReactNode, useId } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useLinkComponent } from \"../../lib/link-component\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Collapse } from \"../collapse/collapse\"\nimport { ChevronIcon } from \"../popover/icons\"\n\n/**\n * NavLink — a single sidebar/nav row: leading `startSlot`, `label`, trailing\n * `endSlot`, current-page treatment, and self-nesting via `children` for\n * arbitrary-depth sub-navigation (each nested `<NavLink>` renders indented,\n * revealed with `Collapse` when the parent is `open`).\n *\n * Router-agnostic: pass whatever the target link needs as `linkOptions` (a\n * plain `{ href }` for a bare `<a>`, or a framework router's own shape, e.g.\n * TanStack Router's `{ to, params }`) — it's spread verbatim onto whatever\n * renders the link. `linkComponent` picks what that is; if omitted, it falls\n * back to the app-wide `<LinkComponentProvider>` (see `lib/link-component`),\n * then to a plain `<a>`. Generic over `linkOptions`'s shape so a router's own\n * type-safety utilities can validate/autocomplete it — see\n * `nav-link/tanstack.tsx` for a TanStack Router–typed wrapper built this way.\n *\n * A row with no `linkOptions` (a pure category / toggle heading) renders as a\n * `<button>` instead of a link. A row with both `linkOptions` and nested\n * children renders the link and its expand/collapse toggle as two separate\n * controls (a link nested inside a button, or vice versa, isn't valid HTML).\n *\n * A `disabled` link row drops its target: it renders a plain `<a role=\"link\"\n * aria-disabled=\"true\">` with no `href` (and so no tab stop), bypassing\n * `linkComponent` — a router's `Link` would put the `href` straight back.\n *\n * <NavLink label=\"Dashboard\" startSlot={<Home />} linkOptions={{ href: \"/dashboard\" }} />\n * <NavLink label=\"Settings\" startSlot={<Settings />} defaultOpen>\n * <NavLink label=\"Profile\" linkOptions={{ href: \"/settings/profile\" }} />\n * <NavLink label=\"Security\" linkOptions={{ href: \"/settings/security\" }} />\n * </NavLink>\n */\n\nconst navLinkRow = cva(\n [\n \"flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2.5 py-2 text-start text-sm\",\n \"outline-none transition-colors\",\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n focusStyles(),\n \"aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n ],\n {\n variants: {\n current: {\n true: \"bg-black/5 font-medium text-brand-950 dark:bg-white/8 dark:text-white\",\n false: TEXT_COLOR_CLASSES.secondary,\n },\n },\n defaultVariants: { current: false },\n },\n)\n\nconst chevronButton = cn(\n \"flex shrink-0 cursor-pointer items-center justify-center rounded-md p-2 text-black/50 transition-colors\",\n \"hover:bg-black/5 dark:text-white/50 dark:hover:bg-white/8\",\n focusStyles(),\n)\n\nconst chevron = (open: boolean) => (\n <span\n aria-hidden=\"true\"\n data-state={open ? \"open\" : \"closed\"}\n className=\"ms-auto flex shrink-0 transition-transform data-[state=open]:rotate-180 [&_svg]:size-4\"\n >\n <ChevronIcon />\n </span>\n)\n\nexport type NavLinkClassNames = {\n /** The link/button row itself. */\n row?: string\n /** The indented container holding nested `<NavLink>` children. */\n items?: string\n}\n\n/** The expand/collapse chevron's accessible names — the same keys as `Notification`'s. Only\n * rendered for a row that is both a link and has children (a pure toggle row is its own\n * button, named by its label). */\nexport type NavLinkTranslations = {\n /** While the children are revealed. Default `\"Collapse\"`. */\n collapseLabel?: string\n /** While the children are hidden. Default `\"Expand\"`. */\n expandLabel?: string\n}\n\nexport type NavLinkProps<TOptions = unknown> = WithTestId & {\n label: ReactNode\n /** Leading slot (icon, avatar, etc). */\n startSlot?: ReactNode\n /** Trailing slot (e.g. a count or status badge). */\n endSlot?: ReactNode\n /** Marks this as the active/current page. */\n current?: boolean\n /** Not interactive: a link row loses its `href` and tab stop, a toggle row\n * its button behaviour; both keep `aria-disabled` so they're announced. */\n disabled?: boolean\n /** Whether nested `children` are revealed. Uncontrolled by default. */\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** The router's own link options — e.g. `{ href: \"/x\" }` for a plain `<a>`,\n * or `{ to: \"/x\", params: {...} }` for TanStack Router. Omit for a pure\n * category/toggle row with no link of its own. */\n linkOptions?: TOptions\n /** Overrides the `<LinkComponentProvider>` for this row only. */\n linkComponent?: ElementType\n classNames?: NavLinkClassNames\n className?: string\n /** Overrides the expand/collapse chevron's accessible names. A partial override keeps the\n * other default. */\n translations?: NavLinkTranslations\n /** Nested `<NavLink>` elements, revealed when `open`. */\n children?: ReactNode\n}\n\nfunction NavLinkImpl({\n label,\n startSlot,\n endSlot,\n current,\n disabled,\n open,\n defaultOpen,\n onOpenChange,\n linkOptions,\n linkComponent,\n classNames,\n className,\n translations,\n children,\n testId,\n}: NavLinkProps) {\n const [isOpen, setOpen] = useUncontrolled<boolean>({\n value: open,\n defaultValue: defaultOpen,\n finalValue: false,\n onChange: onOpenChange,\n })\n const hasChildren = children != null\n const isLink = linkOptions != null\n const Comp = useLinkComponent(linkComponent) ?? \"a\"\n const itemsId = `nav-link-items-${useId()}`\n\n const content = (\n <>\n {startSlot}\n <span className=\"min-w-0 flex-1 truncate\">{label}</span>\n {endSlot}\n </>\n )\n\n const rowClassName = cn(navLinkRow({ current }), classNames?.row, className)\n const rowState = props({\n \"aria-current\": current && \"page\",\n \"aria-disabled\": disabled,\n \"data-testid\": testId,\n })\n\n return (\n <div>\n <div className=\"flex items-stretch gap-1\">\n {isLink && disabled ? (\n // No `href`, so no tab stop and nothing for Enter to follow; the\n // explicit role keeps it announced as a (disabled) link.\n <a role=\"link\" {...rowState} className={rowClassName}>\n {content}\n </a>\n ) : isLink ? (\n <Comp {...linkOptions} {...rowState} className={rowClassName}>\n {content}\n </Comp>\n ) : (\n <button\n type=\"button\"\n {...rowState}\n aria-expanded={hasChildren ? isOpen : undefined}\n {...props({ \"aria-controls\": hasChildren && itemsId })}\n disabled={disabled}\n onClick={() => hasChildren && setOpen(!isOpen)}\n className={rowClassName}\n >\n {content}\n {hasChildren && chevron(isOpen)}\n </button>\n )}\n {hasChildren && isLink && (\n <button\n type=\"button\"\n aria-expanded={isOpen}\n aria-controls={itemsId}\n aria-label={\n isOpen\n ? (translations?.collapseLabel ?? \"Collapse\")\n : (translations?.expandLabel ?? \"Expand\")\n }\n onClick={() => setOpen(!isOpen)}\n className={chevronButton}\n >\n {chevron(isOpen)}\n </button>\n )}\n </div>\n {hasChildren && (\n <Collapse open={isOpen}>\n <div\n id={itemsId}\n className={cn(\n \"ms-4.5 space-y-0.5 border-s border-brand-900/20 ps-2 pt-0.5 dark:border-white/15\",\n classNames?.items,\n )}\n >\n {children}\n </div>\n </Collapse>\n )}\n </div>\n )\n}\n\n/**\n * `NavLink<TOptions>` — generic so a router's own type-safety utility (e.g.\n * TanStack Router's `ValidateLinkOptions`) can validate `linkOptions` when\n * explicitly parameterized. The implementation itself stays untyped/loose\n * (the generic can't be forwarded through the JSX body); see\n * TanStack Router's own documented pattern for this exact split.\n */\nexport function NavLink<TOptions = unknown>(props: NavLinkProps<TOptions>): ReactNode\nexport function NavLink(props: NavLinkProps): ReactNode {\n return <NavLinkImpl {...props} />\n}\n","\"use client\"\n\nimport type { ElementType, ReactNode } from \"react\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { NavLink, type NavLinkClassNames, type NavLinkTranslations } from \"./nav-link\"\n\n/**\n * `Navigation` — the `data`-driven convenience wrapper over `NavLink` (same\n * relationship as `menu-data.tsx` to `menu.tsx`): pass a `data` array, get a\n * fully wired, arbitrarily-nested nav tree.\n *\n * <Navigation\n * data={[\n * { label: \"Dashboard\", startSlot: <Home />, linkOptions: { href: \"/dashboard\" } },\n * { label: \"Settings\", startSlot: <Settings />, items: [\n * { label: \"Profile\", linkOptions: { href: \"/settings/profile\" } },\n * { label: \"Security\", linkOptions: { href: \"/settings/security\" } },\n * ]},\n * ]}\n * />\n *\n * Generic over the same `TOptions` as `NavLink` — parameterize it (e.g. with\n * `TanStackLinkOptions` from `nav-link/tanstack`) to get a router's own\n * type-safety utilities validating every entry's `linkOptions`.\n *\n * Renders a real list — a `<ul>` of `<li>`, nested `<ul>`s for `items` — so a\n * screen reader announces how many entries each level holds. List styles are\n * reset, so it looks the same as composing `NavLink`s by hand.\n */\nexport type NavigationItem<TOptions = unknown> = {\n label: ReactNode\n startSlot?: ReactNode\n endSlot?: ReactNode\n current?: boolean\n disabled?: boolean\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n linkOptions?: TOptions\n classNames?: NavLinkClassNames\n /** `data-testid` on this entry's row (its link or button). */\n testId?: string\n /** Nested entries — an item with `items` renders its children indented,\n * revealed on expand/collapse. Recursive: nests to any depth. */\n items?: readonly NavigationItem<TOptions>[]\n}\n\nexport type NavigationProps<TOptions = unknown> = WithTestId & {\n /** The nav entries, in order. */\n data: readonly NavigationItem<TOptions>[]\n /** Overrides the app-wide `<LinkComponentProvider>` for every generated row. */\n linkComponent?: ElementType\n /** `NavLink`'s chevron names, forwarded to every generated row. */\n translations?: NavLinkTranslations\n}\n\n/** The `<ul>` reset: no bullets, no indent, so the list is invisible. */\nconst listClasses = \"m-0 list-none p-0\"\n\nconst renderItem = (\n item: NavigationItem,\n key: string,\n linkComponent: ElementType | undefined,\n translations: NavLinkTranslations | undefined,\n): ReactNode => (\n <li key={key}>\n <NavLink\n label={item.label}\n startSlot={item.startSlot}\n endSlot={item.endSlot}\n current={item.current}\n disabled={item.disabled}\n open={item.open}\n defaultOpen={item.defaultOpen}\n onOpenChange={item.onOpenChange}\n linkOptions={item.linkOptions}\n linkComponent={linkComponent}\n classNames={item.classNames}\n translations={translations}\n testId={item.testId}\n >\n {item.items && item.items.length > 0 ? (\n // NavLink spaces its direct children; the list is now that one child,\n // so it carries the same spacing for its own items.\n <ul className={`${listClasses} space-y-0.5`}>\n {item.items.map((child, i) =>\n renderItem(child, `${key}.${i}`, linkComponent, translations),\n )}\n </ul>\n ) : undefined}\n </NavLink>\n </li>\n)\n\nfunction NavigationImpl({ data, linkComponent, translations, testId }: NavigationProps) {\n return (\n <ul className={listClasses} {...props({ \"data-testid\": testId })}>\n {data.map((item, i) => renderItem(item, `nav-${i}`, linkComponent, translations))}\n </ul>\n )\n}\n\n/** Generic for the same reason as `NavLink` — see its doc comment. */\nexport function Navigation<TOptions = unknown>(props: NavigationProps<TOptions>): ReactNode\nexport function Navigation(props: NavigationProps): ReactNode {\n return <NavigationImpl {...props} />\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/drawer/drawer.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAiDA,IAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,MAAA,EAAQ;AACV,CAAA;AAGA,IAAM,sBAAA,GAAyB,cAA+B,KAAK,CAAA;AAEnE,IAAM,iBAAiB,GAAA,CAAI;AAAA,EACzB,8HAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,gBAAA,GAAmB,GAAA;AAAA,EACvB,oFAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,SAAA,EAAW;AAAA,QACT,KAAA,EAAO,6BAAA;AAAA,QACP,GAAA,EAAK,2BAAA;AAAA,QACL,GAAA,EAAK,6BAAA;AAAA,QACL,MAAA,EAAQ;AAAA;AACV,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,SAAA,EAAW,KAAA;AAAM;AAExC,CAAA;AASA,IAAM,mBAAmB,CAAC;AAAA,EACxB,SAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,EAAS,QAAA;AAAA,EACT,GAAG;AACL,CAAA,KAA6B;AAC3B,EAAA,MAAM,SAAA,GAAY,WAAW,sBAAsB,CAAA;AACnD,EAAA,MAAM,UAAA,GAAa,OAAuB,IAAI,CAAA;AAC9C,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAI,UAAA;AAAA,IAAJ;AAAA,MACC,GAAA,EAAK,UAAA;AAAA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"use client\"\n\nimport { Drawer as Ark } from \"@ark-ui/react/drawer\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n useContext,\n useRef,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { OverlayContainerProvider } from \"../../lib/overlay-container\"\nimport { NestedLayer, useLayerGuard } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport {\n createDialogParts,\n DIALOG_PADDING,\n type DialogCloseTriggerProps,\n type DialogIconSlot,\n type DialogIcons,\n DialogRootProviders,\n type DialogSectionProps,\n useDialogNameCheck,\n} from \"../overlays/dialog-parts\"\n\n/**\n * Drawer — edge-anchored panel on top of Ark UI's Drawer state machine. Ark\n * owns swipe-to-dismiss, snap points, focus-trap, scroll-lock and the\n * `data-state=\"open|closed\"` attribute; this wrapper adds an RTL-aware\n * `placement` (Ark has none). It is set once, on `Drawer.Root`, which derives\n * Ark's logical `swipeDirection` from it and shares it with the parts through\n * context; the positioner and content write it as `data-placement`. The slide\n * animation and the docked border are pure CSS keyed on `[data-placement]`\n * (see `theme.css`), so `start`/`end` flip automatically under `dir=\"rtl\"`.\n *\n * Mirrors `Modal`'s dual API: high-level `<Drawer open placement size … >` plus\n * low-level parts (`Drawer.Root`, `Drawer.Content`, …). Padding flows through\n * the `--drawer-px` CSS var.\n */\n\nexport type DrawerPlacement = \"start\" | \"end\" | \"top\" | \"bottom\"\n\n/** placement → Ark logical swipe axis (RTL handled by Ark for start/end). */\nconst PLACEMENT_TO_SWIPE = {\n start: \"start\",\n end: \"end\",\n top: \"up\",\n bottom: \"down\",\n} as const\n\n/** The root's placement, so the parts dock themselves without repeating it. */\nconst DrawerPlacementContext = createContext<DrawerPlacement>(\"end\")\n\nconst drawerBackdrop = cva([\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg pointer-events-auto select-none\",\n \"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out\",\n])\n\nconst drawerPositioner = cva(\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex overflow-clip\",\n {\n variants: {\n placement: {\n start: \"items-stretch justify-start\",\n end: \"items-stretch justify-end\",\n top: \"items-start justify-stretch\",\n bottom: \"items-end justify-stretch\",\n },\n },\n defaultVariants: { placement: \"end\" },\n },\n)\n\nexport type DrawerPositionerProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Positioner>> &\n WithTestId\n\n/** Docks itself to the root's `placement`. Publishes itself as the portal\n * target for any overlay opened inside the drawer, so a Menu/Select/DatePicker\n * in a drawer body stays above the panel instead of behind it. See\n * `lib/overlay-container.tsx`. */\nconst DrawerPositioner = ({\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: DrawerPositionerProps) => {\n const placement = useContext(DrawerPlacementContext)\n const positioner = useRef<HTMLDivElement>(null)\n return (\n <Ark.Positioner\n ref={positioner}\n className={cn(drawerPositioner({ placement }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n >\n <OverlayContainerProvider value={positioner}>{children}</OverlayContainerProvider>\n </Ark.Positioner>\n )\n}\n\nconst drawerContent = cva(\n [\n \"relative flex flex-col overflow-hidden\",\n \"bg-brand-50 text-brand-950 shadow-2xl\",\n \"dark:bg-brand-950 dark:text-white\",\n \"focus:outline-none\",\n // border on the docked edge only — keyed by data-placement in theme.css\n \"data-[placement=start]:border-e data-[placement=end]:border-s\",\n \"data-[placement=top]:border-b data-[placement=bottom]:border-t\",\n \"border-brand-900/20 dark:border-white/15\",\n \"data-[state=open]:animate-drawer-in data-[state=closed]:animate-drawer-out\",\n ],\n {\n variants: {\n // Internal: Content reads it from the root's context.\n placement: {\n start: \"h-full max-w-[90vw]\",\n end: \"h-full max-w-[90vw]\",\n top: \"w-full max-h-[90dvh]\",\n bottom: \"w-full max-h-[90dvh]\",\n },\n // Width for inline placements, height for block ones: see compoundVariants.\n size: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n // Only the two corners away from the docked edge round: see compoundVariants.\n radius: { none: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n },\n compoundVariants: [\n { placement: [\"start\", \"end\"], size: \"xs\", class: \"w-[18rem]\" },\n { placement: [\"start\", \"end\"], size: \"sm\", class: \"w-[22rem]\" },\n { placement: [\"start\", \"end\"], size: \"md\", class: \"w-[28rem]\" },\n { placement: [\"start\", \"end\"], size: \"lg\", class: \"w-[34rem]\" },\n { placement: [\"start\", \"end\"], size: \"xl\", class: \"w-[42rem]\" },\n { placement: [\"top\", \"bottom\"], size: \"xs\", class: \"h-[30dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"sm\", class: \"h-[40dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"md\", class: \"h-[55dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"lg\", class: \"h-[70dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"xl\", class: \"h-[85dvh]\" },\n // Logical corners, so `start`/`end` mirror under RTL with the panel.\n { placement: \"start\", radius: \"sm\", class: \"rounded-e-sm\" },\n { placement: \"start\", radius: \"md\", class: \"rounded-e-md\" },\n { placement: \"start\", radius: \"lg\", class: \"rounded-e-xl\" },\n { placement: \"start\", radius: \"xl\", class: \"rounded-e-2xl\" },\n { placement: \"end\", radius: \"sm\", class: \"rounded-s-sm\" },\n { placement: \"end\", radius: \"md\", class: \"rounded-s-md\" },\n { placement: \"end\", radius: \"lg\", class: \"rounded-s-xl\" },\n { placement: \"end\", radius: \"xl\", class: \"rounded-s-2xl\" },\n { placement: \"top\", radius: \"sm\", class: \"rounded-b-sm\" },\n { placement: \"top\", radius: \"md\", class: \"rounded-b-md\" },\n { placement: \"top\", radius: \"lg\", class: \"rounded-b-xl\" },\n { placement: \"top\", radius: \"xl\", class: \"rounded-b-2xl\" },\n { placement: \"bottom\", radius: \"sm\", class: \"rounded-t-sm\" },\n { placement: \"bottom\", radius: \"md\", class: \"rounded-t-md\" },\n { placement: \"bottom\", radius: \"lg\", class: \"rounded-t-xl\" },\n { placement: \"bottom\", radius: \"xl\", class: \"rounded-t-2xl\" },\n ],\n defaultVariants: { placement: \"end\", size: \"md\", radius: \"none\" },\n },\n)\n\n// ---------------------------------------------------------------------------\n// Low-level parts\n// ---------------------------------------------------------------------------\n\nexport type DrawerIconSlot = DialogIconSlot\nexport type DrawerIcons = DialogIcons\n\nexport type DrawerRootProps = ComponentPropsWithoutRef<typeof Ark.Root> & {\n /** RTL-aware docking edge, shared with `Drawer.Positioner` and `Drawer.Content`. Also\n * sets Ark's `swipeDirection`, unless you pass one. @default \"end\" */\n placement?: DrawerPlacement\n /** Replaces the default icons: `close`. `Drawer.CloseTrigger`'s `children` win over it. */\n icons?: DrawerIcons\n}\n\n/** Ark's root, plus the nested-layer guard: while a picker opened inside the\n * drawer is open, an outside click closes the picker only, not the drawer\n * under it. It is also a layer of its own while open, so a hotkey on the page\n * (or in an enclosing overlay) yields to it. See `lib/overlay-layer.tsx`. */\nconst DrawerRoot = ({\n placement = \"end\",\n swipeDirection,\n onPointerDownOutside,\n icons,\n children,\n ...rest\n}: DrawerRootProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n return (\n <Ark.Root\n swipeDirection={swipeDirection ?? PLACEMENT_TO_SWIPE[placement]}\n onPointerDownOutside={guard.onPointerDownOutside}\n {...rest}\n >\n {/* A layer itself, registered with whatever it opened from (the page,\n or an enclosing overlay), so what's under it knows it's covered. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} />}</Ark.Context>\n <DrawerPlacementContext value={placement}>\n <DialogRootProviders icons={icons} layers={guard.layers}>\n {children}\n </DialogRootProviders>\n </DrawerPlacementContext>\n </Ark.Root>\n )\n}\nconst DrawerTrigger = Ark.Trigger\nconst DrawerContext = Ark.Context\n\nexport type DrawerBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId\n\nconst DrawerBackdrop = ({ className, testId, ...rest }: DrawerBackdropProps) => (\n <Ark.Backdrop\n className={cn(drawerBackdrop(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId\n\nconst DrawerTitle = ({ className, testId, ...rest }: DrawerTitleProps) => (\n <Ark.Title\n className={cn(\"text-xl font-semibold leading-tight\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerDescriptionProps = ComponentPropsWithoutRef<typeof Ark.Description> & WithTestId\n\nconst DrawerDescription = ({ className, testId, ...rest }: DrawerDescriptionProps) => (\n <Ark.Description\n className={cn(\"text-sm\", TEXT_COLOR_CLASSES.muted, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerSize = NonNullable<VariantProps<typeof drawerContent>[\"size\"]>\nexport type DrawerRadius = NonNullable<VariantProps<typeof drawerContent>[\"radius\"]>\n\nexport type DrawerContentProps = ComponentPropsWithoutRef<typeof Ark.Content> &\n WithTestId & {\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n }\n\n/** The panel. It sizes and rounds itself for the root's `placement`, and writes\n * it as `data-placement`, which the slide animation and the docked border key on. */\nconst DrawerContent = ({ className, size, radius, testId, ...rest }: DrawerContentProps) => {\n const placement = useContext(DrawerPlacementContext)\n const nameCheck = useDialogNameCheck(\"Drawer\")\n return (\n <Ark.Content\n ref={nameCheck}\n className={cn(drawerContent({ placement, size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n />\n )\n}\n\nexport type DrawerCloseTriggerProps = DialogCloseTriggerProps\nexport type DrawerHeaderProps = DialogSectionProps\nexport type DrawerBodyProps = DialogSectionProps\nexport type DrawerFooterProps = DialogSectionProps\n\nconst {\n CloseTrigger: DrawerCloseTrigger,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n} = createDialogParts(\"drawer\", Ark.CloseTrigger)\n\nexport type DrawerGrabberProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Grabber>> &\n WithTestId\n\nconst DrawerGrabber = ({ className, testId, asChild: _asChild, ...rest }: DrawerGrabberProps) => (\n <Ark.Grabber\n className={cn(\n \"flex shrink-0 cursor-grab touch-none items-center justify-center py-2\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <Ark.GrabberIndicator className=\"h-1.5 w-20 rounded-full bg-brand-900/10 dark:bg-white/16\" />\n </Ark.Grabber>\n)\n\n// ---------------------------------------------------------------------------\n// High-level props-driven Drawer\n// ---------------------------------------------------------------------------\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type DrawerClassNames = Partial<\n Record<\n | \"backdrop\"\n | \"positioner\"\n | \"content\"\n | \"header\"\n | \"title\"\n | \"description\"\n | \"body\"\n | \"grabber\"\n | \"closeButton\",\n string\n >\n>\n\nexport type DrawerProps = Omit<\n ArkRootProps,\n \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"children\" | \"swipeDirection\" | \"role\"\n> &\n WithTestId & {\n /** Controlled open state. */\n open?: boolean\n /** Uncontrolled initial open state. */\n defaultOpen?: boolean\n /** Fires with the next open state. Flattened from Ark's `{ open }`. */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, backdrop click, swipe, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** RTL-aware docking edge. @default \"end\" */\n placement?: DrawerPlacement\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n /** Header title; also the drawer's accessible name. */\n title?: ReactNode\n description?: ReactNode\n /** Accessible name for a drawer without a `title` (a navigation panel, say). */\n \"aria-label\"?: string\n /** Id of an element inside the drawer that names it, when there is no `title`. */\n \"aria-labelledby\"?: string\n /** Render the default close button in the header. @default true */\n withCloseButton?: boolean\n /** Show the drag grabber handle. @default false */\n withGrabber?: boolean\n /**\n * Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals\n * manager) draws a single shared backdrop for the whole overlay stack.\n * @default true\n */\n withBackdrop?: boolean\n /** Inner padding token; sets `--drawer-px`. @default \"md\" */\n padding?: Size\n closeOnEscape?: boolean\n /** Close on a click outside the drawer. @default true, false for an `alertdialog` */\n closeOnInteractOutside?: boolean\n /** Use `alertdialog` semantics (confirm flows). @default \"dialog\" */\n role?: \"dialog\" | \"alertdialog\"\n /** Fires after the exit animation completes — the manager unmounts on this. */\n onExitComplete?: () => void\n /** Portal target. Defaults to `document.body`. */\n container?: HTMLElement | null\n children?: ReactNode\n className?: string\n classNames?: DrawerClassNames\n /** Overrides the default close button's accessible name (`closeTriggerLabel`, default\n * `\"Close\"`). The compound `DrawerCloseTrigger` part takes a plain `aria-label` instead. */\n translations?: DrawerTranslations\n /** Replaces the default icons: `close`, the header's close button. */\n icons?: DrawerIcons\n }\n\n/** The ready-made drawer's wording — `closeTriggerLabel` follows Ark's naming for the\n * same control. */\nexport type DrawerTranslations = { closeTriggerLabel?: string }\n\nconst DrawerComponent = ({\n open,\n defaultOpen,\n onOpenChange,\n onClose,\n placement = \"end\",\n size,\n radius,\n title,\n description,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n withCloseButton = true,\n withGrabber = false,\n withBackdrop = true,\n padding = \"md\",\n closeOnEscape,\n closeOnInteractOutside,\n role,\n onExitComplete,\n container,\n children,\n className,\n classNames,\n testId,\n translations,\n icons,\n ...rest\n}: DrawerProps) => {\n const hasHeader = title != null || description != null || withCloseButton\n\n return (\n <DrawerRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={({ open: next }) => {\n onOpenChange?.(next)\n if (!next) onClose?.()\n }}\n placement={placement}\n closeOnEscape={closeOnEscape}\n // Spelled out to match Modal, whose Ark dialog derives this default from\n // `modal` (so the overlays manager's `withBackdrop={false}` would stop\n // outside clicks there). Ark's drawer defaults it to `true` for every role\n // instead, so here the one behaviour this changes is the `alertdialog`:\n // it stays sticky, as on Modal, unless the caller opts in explicitly.\n closeOnInteractOutside={closeOnInteractOutside ?? role !== \"alertdialog\"}\n role={role}\n // Unmount the whole content tree (incl. the `fixed inset-0` positioner)\n // on close — otherwise the positioner lingers as a transparent overlay\n // that swallows page clicks. `lazyMount` keeps it out of the DOM until\n // first open.\n lazyMount\n unmountOnExit\n modal={withBackdrop}\n onExitComplete={onExitComplete}\n icons={icons}\n {...rest}\n >\n <Portal container={container ? { current: container } : undefined}>\n {withBackdrop && <DrawerBackdrop className={classNames?.backdrop} />}\n <DrawerPositioner className={classNames?.positioner}>\n <DrawerContent\n size={size}\n radius={radius}\n style={{ [\"--drawer-px\" as string]: DIALOG_PADDING[padding] }}\n className={cn(className, classNames?.content)}\n testId={testId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n {withGrabber && <DrawerGrabber className={classNames?.grabber} />}\n {hasHeader && (\n <DrawerHeader className={classNames?.header}>\n <div className=\"flex flex-col gap-1\">\n {title != null && (\n <DrawerTitle className={classNames?.title}>{title}</DrawerTitle>\n )}\n {description != null && (\n <DrawerDescription className={classNames?.description}>\n {description}\n </DrawerDescription>\n )}\n </div>\n {withCloseButton && (\n <DrawerCloseTrigger\n aria-label={translations?.closeTriggerLabel}\n className={classNames?.closeButton}\n />\n )}\n </DrawerHeader>\n )}\n <DrawerBody\n className={cn(\n !hasHeader && !withGrabber && \"pt-(--drawer-px,1.25rem)\",\n \"pb-(--drawer-px,1.25rem)\",\n classNames?.body,\n )}\n >\n {children}\n </DrawerBody>\n </DrawerContent>\n </DrawerPositioner>\n </Portal>\n </DrawerRoot>\n )\n}\n\nexport const Drawer = Object.assign(DrawerComponent, {\n Root: DrawerRoot,\n Trigger: DrawerTrigger,\n Context: DrawerContext,\n Backdrop: DrawerBackdrop,\n Positioner: DrawerPositioner,\n Content: DrawerContent,\n Title: DrawerTitle,\n Description: DrawerDescription,\n CloseTrigger: DrawerCloseTrigger,\n Grabber: DrawerGrabber,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/button-group/button-group.tsx"],"names":[],"mappings":";;;;;;AA6CO,IAAM,mBAAA,GAAsB,GAAA;AAAA,EACjC;AAAA,IACE,mCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,IACA,kBAAA;AAAA,IACA,kDAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,WAAA,EAAa;AAAA,QACX,UAAA,EAAY;AAAA,UACV,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMA,oBAAA;AAAA,UACA,gIAAA;AAAA,UACA,8EAAA;AAAA,UACA,gCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMA,4FAAA;AAAA,UACA,2FAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKA;AAAA,SACF;AAAA,QACA,QAAA,EAAU;AAAA,UACR,UAAA;AAAA,UACA,8EAAA;AAAA,UACA,gCAAA;AAAA,UACA,4FAAA;AAAA,UACA,2FAAA;AAAA,UACA;AAAA;AACF;AACF,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,WAAA,EAAa,YAAA;AAAa;AAEjD;AAUO,IAAM,WAAA,GAAc,CAAC,EAAE,SAAA,EAAW,aAAa,MAAA,EAAQ,GAAG,MAAK,qBACpE,GAAA;AAAA,EAAC,GAAA,CAAI,GAAA;AAAA,EAAJ;AAAA,IACC,IAAA,EAAK,OAAA;AAAA,IACL,oBAAkB,WAAA,IAAe,YAAA;AAAA,IACjC,WAAW,EAAA,CAAG,mBAAA,CAAoB,EAAE,WAAA,EAAa,GAAG,SAAS,CAAA;AAAA,IAC5D,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN","file":"chunk-MW42XVPD.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * ButtonGroup — joins a row (or column) of `Button` / `ActionIcon` siblings into\n * a single segmented control: the inner corners are flattened and adjacent\n * borders collapse to one hairline, so the children read as one unit (toolbars,\n * split actions, view switchers).\n *\n * Pure layout wrapper — a React Server Component like `Flex`. It deliberately\n * does NOT touch its children's props: give every child the same `size` (and\n * usually the same `variant` / `color`) so their edges align. `asChild` is\n * inherited from the `ark.div` factory.\n *\n * The join is done with arbitrary-variant selectors that target the children by\n * position *from the group itself*, rather than mutating each child's own\n * classes:\n * - They carry higher specificity than the child's own `rounded-*`, so they\n * win regardless of source order — and they sidestep the fact that plain\n * `tailwind-merge` doesn't recognise the custom `rounded-button` /\n * `rounded-action-icon` utilities (the overriding class never lands on the\n * child, so there's nothing to (fail to) merge).\n * - Only the inner corners are flattened; the outer corners keep whatever\n * radius each child already uses, so retheming still flows through.\n *\n * Adjacent borders overlap by 1px (`-ms-px` / `-mt-px`) into a single hairline\n * for the bordered `outline` / `light` / `default` variants. The borderless\n * `filled` / `subtle` variants (which have `border-transparent`, so there's\n * nothing to collapse) instead get an adaptive divider on both shared inner\n * edges: a translucent `currentColor` line, targeted via each child's\n * `data-variant`. Because it follows the text color it reads as a soft light\n * seam on a `filled` fill and a faint neutral one on `subtle`, correct on every\n * palette and in dark mode. It lives on both edges — not one — so both\n * neighbours carry the shared seam and it stays symmetric regardless of which\n * child is on top. `isolate` + a per-child `z-10` lift the hovered / focused\n * child above its neighbours, so its border (all four sides) and focus ring paint\n * over the shared edges rather than being covered by the neighbour that owns them.\n *\n * `orientation=\"horizontal\"` (default) flattens the inline edges — logical\n * `rounded-s` / `rounded-e` + `-ms`, so it flips correctly under RTL — while\n * `\"vertical\"` flattens the block edges.\n */\nexport const buttonGroupVariants = cva(\n [\n \"inline-flex isolate items-stretch\",\n // Overlapped borders stack in DOM order; lift the active child on hover and\n // focus so its own border (all four sides) and its focus ring paint above its\n // neighbours. Without the lift the shared edge stays owned by the neighbour on\n // top, so a hover/focus border change wouldn't show on that side. The\n // double-sided seam keeps the divider symmetric regardless of which is on top.\n \"*:relative\",\n \"[&>*:hover]:z-10\",\n \"[&>*:focus-visible]:z-10 [&>*:focus-within]:z-10\",\n // Border changes are instant inside a group. Button/ActionIcon animate\n // border-color (via `transition-colors-radius`), but `z-index` can't\n // transition — so on hover-out the lifted child snaps back while its border\n // is still mid-fade, flashing the shared seams. Keep the bg/text fade, drop\n // the border(-radius) transition. Targets the children via their data-variant.\n \"*:data-variant:[transition-property:color,background-color]\",\n ],\n {\n variants: {\n orientation: {\n horizontal: [\n \"flex-row\",\n // Equalize row heights to the tallest child. Buttons size themselves with\n // a fixed `h-*` (no vertical padding), which flexbox won't stretch — so\n // drop it (`h-auto`) and restore the size as a `min-height` floor keyed off\n // `data-size`, letting `items-stretch` grow shorter buttons to the tallest.\n // Same-size rows are unchanged; ActionIcon keeps its fixed square height.\n \"*:data-size:h-auto\",\n \"*:data-[size=xs]:min-h-7 *:data-[size=sm]:min-h-8 *:data-[size=md]:min-h-9 *:data-[size=lg]:min-h-10 *:data-[size=xl]:min-h-12\",\n \"[&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none\",\n \"[&>*:not(:first-child)]:-ms-px\",\n // Borderless variants have no border to collapse — draw an adaptive\n // currentColor seam on the shared inner edges instead. It goes on BOTH\n // sides (start of non-first, end of non-last) so whichever child ends\n // up on top after the z-10 hover/focus lift still owns a border on the\n // shared edge; a one-sided seam gets covered by the lifted child's fill.\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:first-child)]:border-s-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:last-child)]:border-e-current/20\",\n // The divider lives on the inline borders; zero the (transparent) block\n // borders so it has nothing to miter against — otherwise the seam's\n // top/bottom ends render as a 1px chamfer. box-sizing:border-box keeps\n // the height, so grouped filled/subtle stay aligned with bordered ones.\n \"[&>:is([data-variant=filled],[data-variant=subtle])]:border-y-0\",\n ],\n vertical: [\n \"flex-col\",\n \"[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none\",\n \"[&>*:not(:first-child)]:-mt-px\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:first-child)]:border-t-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle]):not(:last-child)]:border-b-current/20\",\n \"[&>:is([data-variant=filled],[data-variant=subtle])]:border-x-0\",\n ],\n },\n },\n defaultVariants: { orientation: \"horizontal\" },\n },\n)\n\nexport type ButtonGroupOrientation = NonNullable<\n VariantProps<typeof buttonGroupVariants>[\"orientation\"]\n>\n\nexport type ButtonGroupProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof buttonGroupVariants> &\n WithTestId\n\nexport const ButtonGroup = ({ className, orientation, testId, ...rest }: ButtonGroupProps) => (\n <ark.div\n role=\"group\"\n data-orientation={orientation ?? \"horizontal\"}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/tabs/tabs.tsx","../src/components/tabs/tabs-data.tsx"],"names":["Ark","jsx"],"mappings":";;;;;;;;;;AAuEA,IAAM,QAAA,GAAW,GAAA;AAAA,EACf;AAAA,IACE,eAAA;AAAA,IACA,wCAAA;AAAA,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AAA,QACV,IAAA,CAAK,GAAA,CAAI,CAAC,IAAA,qBACTA,GAAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YAEC,OAAO,IAAA,CAAK,KAAA;AAAA,YACZ,UAAU,IAAA,CAAK,QAAA;AAAA,YACf,OAAO,IAAA,CAAK,KAAA;AAAA,YACZ,MAAA,EAAQ,IAAA,CAAK,MAAA,IAAU,CAAA,IAAA,EAAO,KAAK,KAAK,CAAA,CAAA;AAAA,YAEvC,QAAA,EAAA,IAAA,CAAK;AAAA,WAAA;AAAA,UAND,IAAA,CAAK;AAAA,SAQb;AAAA,OAAA,EACH,CAAA;AAAA,MACC,IAAA,CAAK,GAAA,CAAI,CAAC,IAAA,qBACTA,GAAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UAEC,OAAO,IAAA,CAAK,KAAA;AAAA,UACZ,QAAQ,CAAA,EAAG,IAAA,CAAK,UAAU,CAAA,IAAA,EAAO,IAAA,CAAK,KAAK,CAAA,CAAE,CAAA,MAAA,CAAA;AAAA,UAE5C,QAAA,EAAA,IAAA,CAAK;AAAA,SAAA;AAAA,QAJD,IAAA,CAAK;AAAA,OAMb;AAAA;AAAA;AACH,CAAA;AAQK,IAAM,IAAA,GAAO,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe;AAAA,EAC/C,IAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAC","file":"chunk-SAXWCGWR.js","sourcesContent":["\"use client\"\n\nimport { Tabs as Ark, useTabsContext } from \"@ark-ui/react/tabs\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, useCallback, useContext, useEffect, useMemo, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useDirectionCheck } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * Tabs — a navigation control on Ark UI's Tabs machine: a row (or column) of\n * triggers, each revealing its own content panel, over a hairline baseline\n * that spans the whole list. An indicator slides to the active trigger. Two\n * classic looks:\n *\n * - `underline` (default) — a 2px bar on the baseline under the active label.\n * - `enclosed` — the active tab is a hairline box (top + sides) that opens the\n * baseline beneath it, so the tab reads as attached to its panel.\n *\n * For a segmented pill tray, use `SegmentGroup` instead: Tabs is navigation\n * between content panels, not a single-choice value, and has no `Field`\n * integration (no label/description/error/name).\n *\n * Two ways to use it:\n *\n * // 1. Data-driven — the common case\n * <Tabs\n * color=\"brand\"\n * defaultValue=\"overview\"\n * data={[\n * { value: \"overview\", label: \"Overview\", content: <Overview /> },\n * { value: \"activity\", label: \"Activity\", content: <Activity /> },\n * ]}\n * />\n *\n * // 2. Compound — for anything the data array can't express\n * <Tabs.Root defaultValue=\"overview\">\n * <Tabs.List variant=\"enclosed\" color=\"brand\">\n * <Tabs.Indicator />\n * <Tabs.Trigger value=\"overview\">Overview</Tabs.Trigger>\n * <Tabs.Trigger value=\"activity\">Activity</Tabs.Trigger>\n * </Tabs.List>\n * <Tabs.Content value=\"overview\"><Overview /></Tabs.Content>\n * <Tabs.Content value=\"activity\"><Activity /></Tabs.Content>\n * </Tabs.Root>\n *\n * `variant`, `size` and `color` all live on `List` and apply to the baseline,\n * every trigger, and the indicator — set them once on `List` rather than\n * repeating them on each `Trigger`. `color` is a `data-color` attribute, so it\n * is scoped to the strip: it deliberately does *not* sit on `Root`, which also\n * wraps every `Content` panel and would leak the palette into whatever those\n * panels render — an uncoloured `Button` inside a panel would silently adopt\n * the tab's palette (#140).\n */\n\n/** The list: a full-width row (or column) with a hairline baseline on the\n * block-end edge when horizontal and the inline-end edge when vertical\n * (logical, so it flips under RTL). No tray fill, no inset, no separators.\n *\n * `underline` paints the baseline as the list's own border, in the kit's\n * hairline recipe (`border-brand-900/20 dark:border-white/15`). `enclosed`\n * keeps the same 1px border *transparent* — the geometry is identical, but\n * the line itself is drawn by the indicator (see `tabsIndicator`), which\n * needs the list to clip it at its two ends along the main axis. `clip`\n * rather than `hidden`: it creates no scroll container, and leaves the cross\n * axis visible. */\nconst tabsList = cva(\n [\n \"relative flex\",\n \"data-[orientation=horizontal]:border-b\",\n \"data-[orientation=vertical]:flex-col data-[orientation=vertical]:border-e\",\n ],\n {\n variants: {\n variant: {\n underline: \"border-brand-900/20 dark:border-white/15\",\n enclosed: [\n \"border-transparent\",\n \"data-[orientation=horizontal]:overflow-x-clip data-[orientation=vertical]:overflow-y-clip\",\n ],\n },\n size: {\n xs: \"gap-1\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-3\",\n xl: \"gap-4\",\n },\n },\n defaultVariants: { variant: \"underline\", size: \"md\" },\n },\n)\n\n/**\n * Each trigger. Every label sits on the page surface, never on a colored fill,\n * so there is no `--c-on-solid` branch. An unselected label is Figma's\n * `Text/text-secondary` (`TEXT_COLOR_CLASSES.secondary`), and the selected one\n * is `Text/text-primary`, or `--c-text` when the trigger or its list has a\n * `color`.\n *\n * The hover lift is scoped to unselected triggers: the selected label already\n * has its final color, and an unscoped `hover:` would tie on specificity and\n * win on source order alone, overriding `--c-text` with the neutral text.\n * Mirrors `Button`'s own `not-data-loading:hover:` scoping.\n *\n * Before the indicator is measured: Ark renders the indicator `hidden` with\n * no rect on the server, and shows it only once it has measured the selected\n * trigger on the client. Until then (`tabs-unmeasured:`, theme.css) the\n * selected trigger draws a static copy of the indicator from its own\n * pseudo-elements: the bar for `underline`; the box and the baseline around\n * it for `enclosed`, whose baseline would otherwise not exist at all. The\n * geometry is always there and only the paint is gated, and Ark unhides the\n * indicator in the same render it sets the rect, so the copy and the real\n * thing swap within one frame, in the same place and color. The indicator\n * doesn't slide in from 0,0 either: it comes out of `display: none`, which\n * starts no transition.\n */\nconst tabsTrigger = cva(\n [\n \"relative z-1 cursor-pointer text-center font-medium whitespace-nowrap select-none\",\n \"data-[orientation=vertical]:text-start\",\n TEXT_COLOR_CLASSES.secondary,\n \"not-data-selected:hover:text-brand-950 dark:not-data-selected:hover:text-white\",\n \"transition-colors\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n ],\n {\n variants: {\n variant: {\n // The trigger paints nothing of its own (the bar is the indicator's\n // border), so its radius only shapes the focus ring: the same `xs`\n // the enclosed ring follows.\n underline: [\n focusStyles(),\n \"rounded-xs\",\n // Static bar (see \"Before the indicator is measured\" above): the\n // indicator's 2px border, one pixel past the trigger's edge.\n \"after:pointer-events-none after:absolute\",\n \"data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5\",\n \"data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:-end-px data-[orientation=vertical]:after:w-0.5\",\n ],\n // The enclosed list clips along its main axis, which would cut an\n // outset ring off the first and last triggers, so the ring goes\n // inside, rounded like the indicator box it matches.\n enclosed: [\n focusStyles({ inset: true, offset: false }),\n \"data-[orientation=horizontal]:rounded-t-xs data-[orientation=vertical]:rounded-s-xs\",\n // Static box (`::after`): the indicator's rect, shifted one pixel\n // toward the baseline, open on that side.\n \"after:pointer-events-none after:absolute after:border after:border-transparent\",\n \"data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:top-px data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:border-b-0 data-[orientation=horizontal]:after:rounded-t-xs\",\n \"data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:start-px data-[orientation=vertical]:after:-end-px data-[orientation=vertical]:after:border-e-0 data-[orientation=vertical]:after:rounded-s-xs\",\n \"tabs-unmeasured:data-selected:after:border-(color:--default-border-color)\",\n // Static baseline (`::before`): a strip reaching 100vmax past both\n // ends of the trigger, painted by two backgrounds that each stop at\n // the trigger's edge, so it is open exactly under the box — the\n // indicator's two segments, in one pseudo-element. The list clips\n // it, as it clips the indicator's.\n \"before:pointer-events-none before:absolute before:bg-no-repeat\",\n \"data-[orientation=horizontal]:before:-inset-x-[100vmax] data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:h-px data-[orientation=horizontal]:before:bg-[length:100vmax_1px] data-[orientation=horizontal]:before:bg-[position:left_bottom,right_bottom]\",\n \"data-[orientation=vertical]:before:-inset-y-[100vmax] data-[orientation=vertical]:before:-end-px data-[orientation=vertical]:before:w-px data-[orientation=vertical]:before:bg-[length:1px_100vmax] data-[orientation=vertical]:before:bg-[position:top,bottom]\",\n \"tabs-unmeasured:data-selected:before:bg-[image:linear-gradient(var(--default-border-color),var(--default-border-color)),linear-gradient(var(--default-border-color),var(--default-border-color))]\",\n ],\n },\n colored: {\n true: \"data-selected:text-(--c-text)\",\n false: \"data-selected:text-brand-950 dark:data-selected:text-white\",\n },\n size: {\n xs: \"px-2 py-0.5 text-xs\",\n sm: \"px-2.5 py-1 text-sm\",\n md: \"px-3 py-1.5 text-md\",\n lg: \"px-4 py-2 text-lg\",\n xl: \"px-5 py-2.5 text-xl\",\n },\n },\n // The static bar's color, chosen once per case like the indicator's.\n // Uncolored, `currentColor` is the selected label's `Text/text-primary`,\n // the same pair the indicator's `Border/border-full` bar paints.\n compoundVariants: [\n {\n variant: \"underline\",\n colored: false,\n className: \"tabs-unmeasured:data-selected:after:bg-current\",\n },\n {\n variant: \"underline\",\n colored: true,\n className: \"tabs-unmeasured:data-selected:after:bg-(--c-solid)\",\n },\n ],\n defaultVariants: { variant: \"underline\", colored: false, size: \"md\" },\n },\n)\n\n/**\n * The sliding indicator. It always covers the active trigger's rect, shifted\n * one pixel outward so its edge lands *on* the baseline row rather than beside\n * it (down when horizontal; toward the inline end when vertical, which is the\n * left edge under RTL, hence the `ltr:`/`rtl:` pair — `translate` has no\n * logical form).\n *\n * - `underline`: the 2px bar is the box's own block-end (or inline-end)\n * border, so one rect drives both axes and logical borders handle RTL. It\n * paints `--c-solid` with a `color`, and Figma's `Border/border-full`\n * (the selected label's `Text/text-primary` pair) without one.\n * - `enclosed`: a hairline box open on the baseline side. The baseline is\n * drawn by the box itself, as two 1px segments (`::before` / `::after`)\n * running from its corners out past both ends of the list, which clips them\n * (`tabsList`). So the line is open exactly under the active tab and the gap\n * slides with it, without painting over anything: an opaque patch over a\n * list-drawn baseline would have to guess the surface color, and showed as\n * a dark hole on a translucent `Card` or a colored one. Each segment starts\n * one pixel past the box's side border so the two never overlap (the\n * hairline is translucent, and an overlap would darken the corner pixel).\n * `100vmax` is \"longer than any list\": the clip trims it.\n */\nconst tabsIndicator = cva(\n [\n \"z-0 box-border\",\n // The slide's duration, read by the inline `transition-duration` (see\n // `Indicator`); reduced motion zeroes it, so the bar jumps instead.\n \"[--indicator-duration:var(--duration-normal)] motion-reduce:[--indicator-duration:0s]\",\n // Ark measures with offsetLeft/offsetWidth, which round to whole pixels.\n // On the cross axis every trigger fills the list, so pin it to the list's\n // exact box instead: a vertical list is often a fractional width, and the\n // rounded rect pushed the baseline half a pixel off the list's edge (and\n // off the static copy the SSR HTML draws).\n \"data-[orientation=horizontal]:[--tabs-top:0px] data-[orientation=horizontal]:[--tabs-height:100%]\",\n \"data-[orientation=vertical]:[--tabs-left:0px] data-[orientation=vertical]:[--tabs-width:100%]\",\n \"data-[orientation=horizontal]:translate-y-px\",\n \"data-[orientation=vertical]:ltr:translate-x-px data-[orientation=vertical]:rtl:-translate-x-px\",\n ],\n {\n variants: {\n variant: {\n underline:\n \"data-[orientation=horizontal]:border-b-2 data-[orientation=vertical]:border-e-2\",\n enclosed: [\n \"border border-brand-900/20 dark:border-white/15\",\n \"before:absolute before:bg-brand-900/20 dark:before:bg-white/15\",\n \"after:absolute after:bg-brand-900/20 dark:after:bg-white/15\",\n \"data-[orientation=horizontal]:rounded-t-xs data-[orientation=horizontal]:border-b-0\",\n \"data-[orientation=horizontal]:before:bottom-0 data-[orientation=horizontal]:before:right-[calc(100%+1px)] data-[orientation=horizontal]:before:h-px data-[orientation=horizontal]:before:w-[100vmax]\",\n \"data-[orientation=horizontal]:after:bottom-0 data-[orientation=horizontal]:after:left-[calc(100%+1px)] data-[orientation=horizontal]:after:h-px data-[orientation=horizontal]:after:w-[100vmax]\",\n \"data-[orientation=vertical]:rounded-s-xs data-[orientation=vertical]:border-e-0\",\n \"data-[orientation=vertical]:before:end-0 data-[orientation=vertical]:before:bottom-[calc(100%+1px)] data-[orientation=vertical]:before:w-px data-[orientation=vertical]:before:h-[100vmax]\",\n \"data-[orientation=vertical]:after:end-0 data-[orientation=vertical]:after:top-[calc(100%+1px)] data-[orientation=vertical]:after:w-px data-[orientation=vertical]:after:h-[100vmax]\",\n ],\n },\n colored: { true: \"\", false: \"\" },\n },\n // The bar's color is chosen in exactly one place per case: with both a\n // neutral border color and `border-(--c-solid)` in the list,\n // tailwind-merge can't tell that a bare `border-(--var)` is a color (it\n // could be a width), keeps both, and the stylesheet's order picks one.\n compoundVariants: [\n {\n variant: \"underline\",\n colored: false,\n className: \"border-brand-950 dark:border-white\",\n },\n { variant: \"underline\", colored: true, className: \"border-(--c-solid)\" },\n ],\n defaultVariants: { variant: \"underline\", colored: false },\n },\n)\n\n/** The root. Vertical tabs put the list *beside* the panels, so the baseline\n * on the list's inline-end edge runs between the two; horizontal stays a\n * plain block, list over panel. */\nconst tabsRoot = \"data-[orientation=vertical]:flex\"\n\n/** The content panel, spaced off the baseline: below it when horizontal,\n * after it (and filling the rest of the row) when vertical. Ark makes the\n * active panel focusable (roving from its trigger), so it gets its own focus\n * ring, matching the kit-wide convention. */\nconst tabsContent = cn(\n \"rounded-xs data-[orientation=horizontal]:mt-3\",\n \"data-[orientation=vertical]:ms-4 data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1\",\n focusStyles(),\n)\n\nexport type TabsVariant = NonNullable<VariantProps<typeof tabsList>[\"variant\"]>\n\n/** Shared strip configuration, set once on `List` and read by `Trigger` and\n * `Indicator` so callers don't repeat `variant` / `size` on every trigger.\n *\n * `color` is *this* list's own palette, never an ancestor's: an ancestor's\n * `data-color` (a colored `Card` around the tabs) must not turn the selected\n * label and the bar into that palette, so \"is it colored\" can't be a\n * `[data-color]` selector — it is whether a `color` was passed here or on\n * the trigger.\n *\n * `colors` maps each trigger's value to its own `color`, for the triggers\n * that set one. `Indicator` reads it to paint itself in the selected tab's\n * palette. Triggers write it through `setTriggerColor` from an effect, so\n * the map is empty during SSR and the first client render; that is\n * harmless, because Ark keeps the indicator `hidden` until it has measured\n * the selected trigger, which also happens in an effect, after the\n * triggers' own (children's effects run first). */\ntype TabsStyle = {\n variant: TabsVariant\n size: Size\n color: Color | undefined\n colors: Readonly<Record<string, Color>>\n setTriggerColor: (value: string, color: Color | undefined) => void\n}\n\nconst TabsStyleContext = createContext<TabsStyle>({\n variant: \"underline\",\n size: \"md\",\n color: undefined,\n colors: {},\n setTriggerColor: () => {},\n})\n\n/** `color` is deliberately omitted, not merely absent: React's `HTMLAttributes`\n * carries a legacy `color?: string`, so without the `Omit` a stale\n * `<Tabs.Root color=\"brand\">` would still compile and fall through `...rest`\n * onto the div as the deprecated HTML attribute — silently losing the palette.\n * Omitting it turns every such call site into a compile error pointing at the\n * line to change. Same convention as `Button` / `ActionIcon` (code-style.md). */\nexport type TabsRootProps = Omit<Ark.RootProps, \"color\"> & WithTestId\n\nconst Root = ({ orientation = \"horizontal\", className, testId, ...rest }: TabsRootProps) => {\n const checkDirection = useDirectionCheck()\n return (\n // `key={orientation}` remounts on an axis flip so Ark re-measures the\n // indicator rect for the new layout (it only measures on mount + value\n // change, mirroring the same limitation `SegmentGroup` works around) — at\n // the cost of resetting an *uncontrolled* value on that flip. Pass a\n // controlled `value` if the orientation can change at runtime and the\n // selection must survive it.\n <Ark.Root\n key={orientation}\n orientation={orientation}\n ref={checkDirection}\n className={cn(tabsRoot, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type TabsListProps = Omit<Ark.ListProps, \"color\"> &\n WithTestId & {\n variant?: TabsVariant\n size?: Size\n /** Palette for the underline bar + active-trigger text. Sets `data-color`\n * on the list, so the `--c-*` slots reach the triggers and the indicator\n * without reaching the `Content` panels. */\n color?: Color\n }\n\nconst List = ({\n variant = \"underline\",\n size = \"md\",\n color,\n className,\n testId,\n ...rest\n}: TabsListProps) => {\n const [colors, setColors] = useState<Readonly<Record<string, Color>>>({})\n const setTriggerColor = useCallback((value: string, triggerColor: Color | undefined) => {\n setColors((prev) => {\n if (prev[value] === triggerColor) return prev\n const { [value]: _dropped, ...others } = prev\n return triggerColor === undefined ? others : { ...others, [value]: triggerColor }\n })\n }, [])\n const style = useMemo(\n () => ({ variant, size, color, colors, setTriggerColor }),\n [variant, size, color, colors, setTriggerColor],\n )\n return (\n <TabsStyleContext.Provider value={style}>\n <Ark.List\n className={cn(tabsList({ variant, size }), className)}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n </TabsStyleContext.Provider>\n )\n}\n\n/** `color` is omitted from Ark's props for the same reason as on `Root`\n * (React's legacy HTML `color?: string`) and re-added as the kit's palette. */\nexport type TabsTriggerProps = Omit<Ark.TriggerProps, \"color\"> &\n WithTestId & {\n /** This tab's own palette for its selected label and, while it is\n * selected, the indicator. Beats `List`'s `color`. Sets `data-color` on\n * the trigger only, so it never reaches the panels. */\n color?: Color\n }\n\nconst Trigger = ({ color, className, testId, ...rest }: TabsTriggerProps) => {\n const { variant, size, color: listColor, setTriggerColor } = useContext(TabsStyleContext)\n const { value } = rest\n useEffect(() => {\n setTriggerColor(value, color)\n return () => setTriggerColor(value, undefined)\n }, [value, color, setTriggerColor])\n return (\n <Ark.Trigger\n className={cn(\n tabsTrigger({ variant, size, colored: (color ?? listColor) !== undefined }),\n className,\n )}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type TabsContentProps = Ark.ContentProps & WithTestId\n\nconst Content = ({ className, testId, ...rest }: TabsContentProps) => (\n <Ark.Content\n className={cn(tabsContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type TabsIndicatorProps = Ark.IndicatorProps & WithTestId\n\n/** The sliding indicator. Ark sets `position: absolute` + `--left`/`--top`/\n * `--width`/`--height` (the selected trigger's rect) inline, so it sits\n * behind the labels (`z-0`). Ark only places the main axis (`left` when\n * horizontal, `top` when vertical) and leaves the other at its static\n * position; we pin both, because the box must line up with the trigger's\n * edge on the baseline side, not wherever the flow happens to put it.\n *\n * We drive the slide transition ourselves rather than via Ark's gated\n * `animateIndicator` flag — the same fix `SegmentGroup` uses: Ark sets\n * `transition-property: none` whenever that flag is false, including the\n * instant it receives the `transitionend` of ANY animated property. With\n * several properties of differing end-times (a `left` redirected by an\n * interrupting click vs. a color/width that already settled), that early end\n * would null the transition and snap the indicator mid-slide. Overriding the real\n * `transition-*` props (our `style` wins via Ark's `mergeProps`) keeps the\n * transition always on, so interruptions re-target smoothly.\n *\n * The duration is read from `--indicator-duration` rather than written inline,\n * so the `motion-reduce:` class on `tabsIndicator` can zero it: an inline value\n * would beat any class, and the slide would play under reduced motion. */\nconst Indicator = ({ className, style, testId, ...rest }: TabsIndicatorProps) => {\n const { variant, color: listColor, colors } = useContext(TabsStyleContext)\n const { value } = useTabsContext()\n // The selected tab's own color, else the list's. Set as the indicator's own\n // `data-color` so its `--c-*` slots switch with the selection, and the\n // `border-color` transition below cross-fades the bar as it slides.\n const color = (value ? colors[value] : undefined) ?? listColor\n return (\n <Ark.Indicator\n data-color={color}\n style={{\n left: \"var(--tabs-left, var(--left))\",\n top: \"var(--tabs-top, var(--top))\",\n width: \"var(--tabs-width, var(--width))\",\n height: \"var(--tabs-height, var(--height))\",\n transitionProperty: \"left, top, width, height, background-color, border-color\",\n transitionDuration: \"var(--indicator-duration)\",\n transitionTimingFunction: \"var(--ease-emphasized)\",\n ...style,\n }}\n className={cn(tabsIndicator({ variant, colored: color !== undefined }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport { Content, Indicator, List, Root, Trigger }\nexport const Context = Ark.Context\n","\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport type { Color } from \"../../lib/colors\"\nimport type { Size } from \"../../lib/sizes\"\nimport {\n Content,\n Context,\n Indicator,\n List,\n Root,\n type TabsRootProps,\n type TabsVariant,\n Trigger,\n} from \"./tabs\"\n\n/**\n * Data-driven Tabs — the convenience wrapper over the composable parts, for\n * the common case of a flat list of label + panel pairs:\n *\n * <Tabs\n * data={[\n * { value: \"overview\", label: \"Overview\", content: <Overview /> },\n * { value: \"activity\", label: \"Activity\", content: <Activity /> },\n * ]}\n * />\n *\n * Generic over `const data`, so an item's `value` narrows `onChange`. The\n * first item is selected by default when neither `value` nor `defaultValue`\n * is given — the low-level `Root` part has no `data` to default from, so this\n * only happens here. Drop to `Tabs.Root` / `Tabs.List` / `Tabs.Trigger` /\n * `Tabs.Content` for anything the flat array can't express (custom trigger\n * content, interleaved non-tab elements, …).\n */\n\n/** One tab: a trigger label and its panel content. */\nexport type TabsItem = {\n value: string\n label: ReactNode\n content: ReactNode\n disabled?: boolean\n /** This tab's own palette: its selected label, and the underline bar while\n * it is selected. Beats the `color` prop. */\n color?: Color\n /** `data-testid` on the trigger; the matching content panel gets\n * `` `${testId}-panel` ``. Defaults to `` `tab-${value}` `` / `` `tab-${value}-panel` ``\n * when omitted. Ark's own `data-value={value}` is also always present on the\n * trigger as a complementary, zero-config selector. */\n testId?: string\n}\n\n/** The `data` array `Tabs` is generic over. */\nexport type TabsData = ReadonlyArray<TabsItem>\n\n/** Extract the value-string union from a `TabsData` shape, for a typed `onChange`. */\nexport type TabsValue<Data extends TabsData> = Data[number][\"value\"]\n\nexport type TabsProps<Data extends TabsData = TabsData> = Omit<\n TabsRootProps,\n \"children\" | \"onValueChange\" | \"onChange\" | \"asChild\"\n> &\n ForbidAsChild & {\n /** Tabs, in order. Each needs its own `content`. */\n data: Data\n /** `underline` (default): a bar under the active tab. `enclosed`: the\n * active tab is a box attached to its panel. */\n variant?: TabsVariant\n /** Trigger size. */\n size?: Size\n /** Palette for the underline bar + active-trigger text. Scoped to the\n * strip (it lands on the `List`), so it never tints the panel content. */\n color?: Color\n /** Fires with the selected value (narrowed to the data value union). */\n onChange?: (value: TabsValue<Data>) => void\n }\n\nconst TabsComponent = <const Data extends TabsData>({\n data,\n variant,\n size,\n color,\n value,\n defaultValue,\n onChange,\n asChild: _asChild,\n ...root\n}: TabsProps<Data>) => (\n <Root\n value={value}\n defaultValue={defaultValue ?? data[0]?.value}\n onValueChange={onChange ? (d) => onChange(d.value as TabsValue<Data>) : undefined}\n {...root}\n >\n <List variant={variant} size={size} color={color}>\n <Indicator />\n {data.map((item) => (\n <Trigger\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n color={item.color}\n testId={item.testId ?? `tab-${item.value}`}\n >\n {item.label}\n </Trigger>\n ))}\n </List>\n {data.map((item) => (\n <Content\n key={item.value}\n value={item.value}\n testId={`${item.testId ?? `tab-${item.value}`}-panel`}\n >\n {item.content}\n </Content>\n ))}\n </Root>\n)\n\n/**\n * The public `Tabs` export — callable for the data-driven form, with the\n * composable parts attached (like `Menu`). `<Tabs data={…}>` and\n * `<Tabs.Root>…</Tabs.Root>` both work from one import.\n */\nexport const Tabs = Object.assign(TabsComponent, {\n Root,\n List,\n Trigger,\n Content,\n Indicator,\n Context,\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/button-select/button-select.tsx","../src/components/button-select/button-select-items.ts","../src/components/button-select/button-select-control.tsx"],"names":["Ark","props","jsx"],"mappings":";;;;;;;;;;;AAqDA,IAAM,2BAA2B,aAAA,CAAiC;AAAA,EAChE,OAAA,EAAS,OAAA;AAAA,EACT,eAAA,EAAiB,QAAA;AAAA,EACjB,IAAA,EAAM;AACR,CAAC,CAAA;AAUD,IAAM,WAAA,GACJ,yKAAA;AAsBF,IAAM,aAAa,CAAC,CAAA,EAAsB,CAAA,KACxC,CAAA,C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gBACjB,QAAQ,IAAA,CAAK,MAAA;AAAA,gBACb,WAAW,UAAA,EAAY,IAAA;AAAA,gBAEtB,QAAA,EAAA,UAAA,GACG,WAAW,IAAA,EAAM;AAAA,kBACf,QAAA,EAAU,KAAA,CAAM,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,kBACnC,QAAA,EAAU,OAAA,CAAQ,QAAQ,CAAA,IAAK,IAAA,CAAK;AAAA,iBACrC,IACD,IAAA,CAAK;AAAA,eAAA;AAAA,cAfJ,IAAA,CAAK;AAAA,aAiBb;AAAA;AAAA,SACH;AAAA,wBACAA,GAAAA,CAAC,YAAA,EAAA,EAAa,IAAA,EAAY,OAAc,QAAA,EAAoB;AAAA;AAAA;AAAA,GAC9D;AAEJ","file":"chunk-XUFCI262.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { ToggleGroup as Ark, useToggleGroupContext } from \"@ark-ui/react/toggle-group\"\nimport {\n Children,\n cloneElement,\n createContext,\n type FocusEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n useContext,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from \"../button/button\"\nimport { buttonGroupVariants } from \"../button-group/button-group\"\nimport { fieldA11yProps } from \"../field/field\"\n\n/**\n * ButtonSelect / ButtonMultiSelect — compound parts.\n *\n * A row (or column) of real `Button`s joined like `ButtonGroup`, on Ark UI's\n * ToggleGroup machine. Every item renders through `Button` itself and only its\n * `variant` changes with the selection: unselected items take `variant`, the\n * selected ones `selectedVariant`. So the item styling — every variant × color,\n * sizes, `startSlot`/`endSlot`, hover, focus ring — has exactly one source, and\n * the join (flattened inner corners, collapsed hairlines, the hover/focus z-lift\n * and the filled/subtle seams) comes from `buttonGroupVariants` rather than a copy.\n *\n * Unlike `SegmentGroup` there is no sliding pill: a pill can't follow several\n * selected items at once, and the same parts back both the single and the\n * multiple form. The machine provides the semantics — `radiogroup` / `radio` +\n * `aria-checked` for single, `group` + `aria-pressed` for multiple — plus roving\n * focus with arrow keys and Home/End.\n *\n * `variant`, `selectedVariant` and `size` travel through a small context set once\n * on `Root`, so they aren't repeated on every `Item` (the Tabs pattern). `color`\n * is a plain `data-color` on `Root`, so it cascades to every item as CSS custom\n * properties; an item's own `color` re-stamps it on that one button.\n */\n\ntype StyleContextValue = {\n variant: ButtonVariant\n selectedVariant: ButtonVariant\n size: ButtonSize\n}\n\nconst ButtonSelectStyleContext = createContext<StyleContextValue>({\n variant: \"light\",\n selectedVariant: \"filled\",\n size: \"md\",\n})\n\n/**\n * The invalid cue is a ring on the whole group rather than red item borders: the\n * borderless `filled` / `subtle` items have no border to recolor, and the group\n * seams out-specify a per-item border anyway. A `ring` (box-shadow) is used, not\n * an `outline`, because the machine writes `outline: none` inline on the root.\n * `w-fit` keeps that ring hugging the items: inside `Field`'s flex column the\n * root would otherwise stretch to the field's full width.\n */\nconst invalidRing =\n \"w-fit rounded-button data-invalid:ring-1 data-invalid:ring-red-500 data-invalid:ring-offset-2 data-invalid:ring-offset-brand-50 dark:data-invalid:ring-offset-brand-950\"\n\ntype BaseRootProps = Omit<\n Ark.RootProps,\n \"color\" | \"multiple\" | \"value\" | \"defaultValue\" | \"onValueChange\" | \"deselectable\" | \"onChange\"\n> &\n WithTestId & {\n /** Palette for every item, as a `data-color` on the group. */\n color?: Color\n /** Treatment of the unselected items. */\n variant?: ButtonVariant\n /** Treatment of the selected items. */\n selectedVariant?: ButtonVariant\n size?: ButtonSize\n /** Red invalid ring around the group. */\n invalid?: boolean\n /** Lands on the group root, which forwards focus to its active item. Ark's\n * prop types carry no `ref`, so it is declared here. */\n ref?: Ref<HTMLDivElement>\n children?: ReactNode\n }\n\nconst sameValues = (a: readonly string[], b: readonly string[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * Tab entry for a single-choice group. Every item is `tabindex=-1` while focus is\n * outside, so Tab lands on the root, and zag then forwards focus to the *first*\n * item regardless of the selection. A radio group should land on the checked\n * radio instead, so in single mode the root's own focus is caught in the capture\n * phase and sent to the selected (enabled) item. `stopPropagation` there stops\n * the native event before React's bubble listener runs, which is what keeps\n * zag's `ROOT.FOCUS` (and its deferred focus-first) from firing. With nothing\n * selected, zag's own behaviour stands.\n */\nconst focusSelectedItem = (event: FocusEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return\n const selected = event.currentTarget.querySelector<HTMLElement>(\n ':scope > [data-state=\"on\"]:not([disabled])',\n )\n if (!selected) return\n event.stopPropagation()\n selected.focus({ preventScroll: true })\n}\n\n/**\n * RTL arrow keys. zag's toggle-group reads `event.key` without passing `dir` to\n * `getEventKey` (its other machines do), so in a right-to-left locale ArrowLeft\n * moves focus visually *right*. In a horizontal RTL group the two keys are\n * caught in the capture phase, before zag's handler, and focus moves to the\n * visually adjacent enabled item instead; zag then picks up the new focus\n * through the item's own `onFocus`. `dir` is read off the root, where the\n * machine writes the locale's direction.\n */\nconst mirrorRtlArrows = (loop: boolean) => (event: KeyboardEvent<HTMLDivElement>) => {\n const root = event.currentTarget\n if (root.dir !== \"rtl\" || root.getAttribute(\"data-orientation\") !== \"horizontal\") return\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n const items = Array.from(\n root.querySelectorAll<HTMLElement>(':scope > [data-part=\"item\"]:not([disabled])'),\n )\n const index = items.indexOf(event.target as HTMLElement)\n if (index === -1) return\n event.preventDefault()\n event.stopPropagation()\n // Visually left is the next item in RTL, visually right the previous one.\n const step = event.key === \"ArrowLeft\" ? 1 : -1\n const next = loop\n ? items[(index + step + items.length) % items.length]\n : items[Math.min(Math.max(index + step, 0), items.length - 1)]\n next?.focus()\n}\n\n/** The shared root behind both `ButtonSelect.Root` and `ButtonMultiSelect.Root`. */\nexport const RootBase = ({\n multiple,\n value,\n defaultValue,\n onValueChange,\n deselectable,\n orientation = \"horizontal\",\n color,\n variant = \"light\",\n selectedVariant = \"filled\",\n size = \"md\",\n invalid,\n loopFocus = true,\n className,\n testId,\n children,\n ...rest\n}: BaseRootProps & {\n multiple: boolean\n value?: string[]\n defaultValue?: string[]\n onValueChange?: (value: string[]) => void\n deselectable?: boolean\n}) => {\n const field = useFieldContext()\n // Owned here so a change can be compared with the current value: in a\n // non-deselectable single group the machine re-emits the same value when the\n // selected item is clicked again, and that is not a change.\n const [selected, setSelected] = useUncontrolled<string[]>({\n value,\n defaultValue,\n finalValue: [],\n onChange: onValueChange,\n })\n return (\n <ButtonSelectStyleContext.Provider value={{ variant, selectedVariant, size }}>\n <Ark.Root\n multiple={multiple}\n value={selected}\n onValueChange={(details) => {\n if (!sameValues(details.value, selected)) setSelected(details.value)\n }}\n deselectable={deselectable}\n orientation={orientation}\n loopFocus={loopFocus}\n onFocusCapture={multiple ? undefined : focusSelectedItem}\n onKeyDownCapture={mirrorRtlArrows(loopFocus)}\n data-color={color}\n {...props({ \"aria-invalid\": invalid, \"data-invalid\": invalid, \"data-testid\": testId })}\n {...fieldA11yProps(field)}\n className={cn(buttonGroupVariants({ orientation }), invalidRing, className)}\n {...rest}\n >\n {children}\n </Ark.Root>\n </ButtonSelectStyleContext.Provider>\n )\n}\n\nexport type ButtonSelectRootProps = BaseRootProps & {\n /** Controlled value. `null` clears the selection. */\n value?: string | null\n /** Uncontrolled initial value. */\n defaultValue?: string | null\n /** Fires with the newly selected value — `null` only when `deselectable`. */\n onChange?: (value: string | null) => void\n /** Clicking the selected item clears the selection. Off by default, so the\n * group behaves like a radio group. */\n deselectable?: boolean\n}\n\nconst toArray = (value: string | null | undefined) =>\n value === undefined ? undefined : value === null ? [] : [value]\n\n/** Single-choice root: one selected item at most. */\nexport const Root = ({\n value,\n defaultValue,\n onChange,\n deselectable = false,\n ...rest\n}: ButtonSelectRootProps) => (\n <RootBase\n multiple={false}\n value={toArray(value)}\n defaultValue={toArray(defaultValue)}\n onValueChange={(next) => onChange?.(next[0] ?? null)}\n deselectable={deselectable}\n {...rest}\n />\n)\n\nexport type ButtonMultiSelectRootProps = BaseRootProps & {\n /** Controlled value. */\n value?: string[]\n /** Uncontrolled initial value. */\n defaultValue?: string[]\n /** Fires with every selected value, in selection order. */\n onChange?: (value: string[]) => void\n}\n\n/** Multiple-choice root: each item toggles independently. */\nexport const MultiRoot = ({ onChange, ...rest }: ButtonMultiSelectRootProps) => (\n <RootBase multiple onValueChange={onChange} {...rest} />\n)\n\n/** The props `Item` hands a custom control under `asChild`. */\ntype SelectableControlProps = { variant?: ButtonVariant; size?: ButtonSize }\n\nexport type ButtonSelectItemProps =\n | (Omit<ButtonProps, \"value\" | \"variant\" | \"size\" | \"loading\" | \"asChild\"> & {\n /** The value this item selects. */\n value: string\n asChild?: false\n })\n | {\n /** The value this item selects. */\n value: string\n disabled?: boolean\n /**\n * Render your own variant-aware control instead of a `Button` — e.g. an\n * `ActionIcon` for an icon-only toolbar. The single child receives the\n * selection-driven `variant` and the group `size` (its own `size` wins),\n * plus the machine's item props.\n */\n asChild: true\n children: ReactElement<SelectableControlProps>\n }\n\n/**\n * One option, rendered as a `Button`. Its `variant` follows the selection (from\n * `Root`'s `variant` / `selectedVariant`); every other `Button` prop — `color`,\n * `startSlot`, `endSlot`, `aria-label` for an icon-only item, `testId` — passes\n * through. The machine's item props land on the button via Ark's `asChild`.\n *\n * With `asChild`, the single child is rendered in place of the `Button` and\n * cloned with the same `variant` / `size`, so any control speaking the kit's\n * variant × size vocabulary (`ActionIcon`, a consumer's own) can be an item.\n */\nexport const Item = (props: ButtonSelectItemProps) => {\n const { variant, selectedVariant, size } = useContext(ButtonSelectStyleContext)\n const { value, disabled } = props\n const { pressed } = useToggleGroupContext().getItemState({ value, disabled })\n const resolvedVariant = pressed ? selectedVariant : variant\n if (props.asChild) {\n const child = Children.only(props.children)\n return (\n <Ark.Item value={value} disabled={disabled} asChild>\n {cloneElement(child, { variant: resolvedVariant, size: child.props.size ?? size })}\n </Ark.Item>\n )\n }\n const { value: _value, disabled: _disabled, asChild: _asChild, ...rest } = props\n return (\n <Ark.Item value={value} disabled={disabled} asChild>\n <Button variant={resolvedVariant} size={size} {...rest} />\n </Ark.Item>\n )\n}\n\n/**\n * One hidden input per selected value, so a native `<form>` submit carries the\n * selection under `name`. Rendered *beside* the root, never inside it: the join\n * selectors target the root's children by `:first-child` / `:last-child`, which a\n * trailing input would throw off.\n */\nexport const HiddenInputs = ({\n name,\n value,\n disabled,\n}: {\n name?: string\n value: readonly string[]\n disabled?: boolean\n}) =>\n name == null\n ? null\n : value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} disabled={disabled} />)\n\nexport const Context = Ark.Context\n","import type { ReactNode } from \"react\"\nimport type { Color } from \"../../lib/colors\"\n\n/**\n * One option of a data-driven `ButtonSelect` / `ButtonMultiSelect`: a bare\n * value-as-label string, or a labelled object. `payload` is arbitrary data the\n * machine ignores; it reaches `renderItem` typed off the `data` shape — the same\n * contract as `SegmentGroup` and `Select`.\n */\nexport type ButtonSelectItem<P = unknown> =\n | string\n | {\n value: string\n label?: ReactNode\n /** Content before the label, e.g. an icon (Button's `startSlot`). */\n startSlot?: ReactNode\n /** Content after the label (Button's `endSlot`). */\n endSlot?: ReactNode\n disabled?: boolean\n /** Overrides the group palette for this item. */\n color?: Color\n /** Accessible name — required when `label` is an icon only. */\n \"aria-label\"?: string\n /** Arbitrary extra data, surfaced to `renderItem`. */\n payload?: P\n /** `data-testid` on the rendered button. Defaults to `` `item-${value}` ``. */\n testId?: string\n }\n\n/** The `data` array both components are generic over. */\nexport type ButtonSelectData<P = unknown> = ReadonlyArray<ButtonSelectItem<P>>\n\n/** The value-string union of a `ButtonSelectData` shape; a `const` type\n * parameter narrows it to the literal union. */\nexport type ButtonSelectValue<Data extends ButtonSelectData> = ItemValue<Data[number]>\ntype ItemValue<E> = E extends string ? E : E extends { value: infer V extends string } ? V : never\n\n/** The `payload` type carried by a `ButtonSelectData` shape. */\nexport type ButtonSelectPayload<Data extends ButtonSelectData> = PayloadOf<Data[number]>\ntype PayloadOf<T> = T extends string ? never : T extends { payload?: infer P } ? P : never\n\n/** The item handed to `renderItem`, narrowed to the data's value and payload. */\nexport type RenderableButtonSelectItem<Data extends ButtonSelectData> = {\n value: ButtonSelectValue<Data>\n label: ReactNode\n disabled: boolean\n color: Color | undefined\n payload: ButtonSelectPayload<Data> | undefined\n}\n\n/** Live item state passed alongside the item to `renderItem`. */\nexport type ButtonSelectItemState = {\n selected: boolean\n disabled: boolean\n}\n\n/**\n * Render an item's label yourself. The item keeps its button, sizing, variant\n * and selection wiring; you fill its content. In an RSC tree the function must\n * live in a `\"use client\"` module.\n */\nexport type RenderButtonSelectItem<Data extends ButtonSelectData> = (\n item: RenderableButtonSelectItem<Data>,\n state: ButtonSelectItemState,\n) => ReactNode\n\n/** A fully resolved item — every field present (`label` falls back to `value`). */\nexport type NormalizedButtonSelectItem = {\n value: string\n label: ReactNode\n startSlot: ReactNode\n endSlot: ReactNode\n disabled: boolean\n color: Color | undefined\n ariaLabel: string | undefined\n payload: unknown\n testId: string\n}\n\nexport const normalizeButtonSelectItem = (item: ButtonSelectItem): NormalizedButtonSelectItem =>\n typeof item === \"string\"\n ? {\n value: item,\n label: item,\n startSlot: undefined,\n endSlot: undefined,\n disabled: false,\n color: undefined,\n ariaLabel: undefined,\n payload: undefined,\n testId: `item-${item}`,\n }\n : {\n value: item.value,\n label: item.label ?? item.value,\n startSlot: item.startSlot,\n endSlot: item.endSlot,\n disabled: item.disabled ?? false,\n color: item.color,\n ariaLabel: item[\"aria-label\"],\n payload: item.payload,\n testId: item.testId ?? `item-${item.value}`,\n }\n","\"use client\"\n\nimport type { FocusEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport type { ButtonSize, ButtonVariant } from \"../button/button\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport { HiddenInputs, Item, RootBase } from \"./button-select\"\nimport {\n type ButtonSelectData,\n normalizeButtonSelectItem,\n type RenderButtonSelectItem,\n} from \"./button-select-items\"\n\ntype ButtonSelectClassNames = {\n field?: string\n /** The label element itself — e.g. `\"sr-only\"` to keep the accessible name\n * without showing it. */\n label?: string\n root?: string\n item?: string\n}\n\n/** Props shared by the data-driven `ButtonSelect` and `ButtonMultiSelect`. */\nexport type ButtonSelectBaseProps<Data extends ButtonSelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Items: bare strings (`value === label`) or `{ value, label?, startSlot?, … }`. */\n data: Data\n /** Render each item's content yourself, with its typed `payload`. */\n renderItem?: RenderButtonSelectItem<Data>\n /** Lay the items in a row (default) or a column. */\n orientation?: \"horizontal\" | \"vertical\"\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Dims and blocks every item. */\n disabled?: boolean\n size?: ButtonSize\n /** Treatment of the unselected items. Defaults to `light`. */\n variant?: ButtonVariant\n /** Treatment of the selected items. Defaults to `filled`. */\n selectedVariant?: ButtonVariant\n color?: Color\n /** Renders a hidden input per selected value for native form submission. */\n name?: string\n /** Explicit id for the group root. */\n id?: string\n /** Lands on the group root, which forwards focus to its active item. */\n ref?: Ref<HTMLDivElement>\n /** Forwarded to the root; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n className?: string\n classNames?: ButtonSelectClassNames\n }\n\n/**\n * The rendering both data forms share: the `Field` wrapper, the group root, one\n * `Item` per entry and the hidden inputs. The public components only adapt their\n * value shape (`V | null` or `V[]`) onto the machine's `string[]`.\n */\nexport const ButtonSelectControl = ({\n multiple,\n deselectable,\n value,\n onValueChange,\n data,\n renderItem,\n orientation,\n invalid,\n disabled,\n required,\n size = \"md\",\n variant,\n selectedVariant,\n color,\n name,\n id,\n ref,\n onBlur,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: ButtonSelectBaseProps<ButtonSelectData> & {\n multiple: boolean\n deselectable?: boolean\n value: readonly string[]\n onValueChange: (value: string[]) => void\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 const items = data.map(normalizeButtonSelectItem)\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 classNames={{ label: classNames?.label }}\n >\n <RootBase\n multiple={multiple}\n deselectable={deselectable}\n value={[...value]}\n onValueChange={onValueChange}\n orientation={orientation}\n disabled={disabled}\n invalid={isInvalid}\n size={size}\n variant={variant}\n selectedVariant={selectedVariant}\n color={color}\n id={id}\n ref={ref}\n onBlur={onBlur}\n testId={testId}\n className={cn(className, classNames?.root)}\n >\n {items.map((item) => (\n <Item\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n color={item.color}\n startSlot={item.startSlot}\n endSlot={item.endSlot}\n aria-label={item.ariaLabel}\n testId={item.testId}\n className={classNames?.item}\n >\n {renderItem\n ? renderItem(item, {\n selected: value.includes(item.value),\n disabled: Boolean(disabled) || item.disabled,\n })\n : item.label}\n </Item>\n ))}\n </RootBase>\n <HiddenInputs name={name} value={value} disabled={disabled} />\n </FieldShell>\n )\n}\n"]}
|