@42-central/ui-react 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-OVT2KZHY.js → chunk-3KARNPW4.js} +3 -3
- package/dist/{chunk-OVT2KZHY.js.map → chunk-3KARNPW4.js.map} +1 -1
- package/dist/chunk-6B2GNPJP.js +43 -0
- package/dist/chunk-6B2GNPJP.js.map +1 -0
- package/dist/{chunk-E52Z2FKU.js → chunk-7BY5I2RB.js} +3 -3
- package/dist/{chunk-E52Z2FKU.js.map → chunk-7BY5I2RB.js.map} +1 -1
- package/dist/{chunk-X3YIHN2U.js → chunk-ASKQ6N5V.js} +3 -3
- package/dist/{chunk-X3YIHN2U.js.map → chunk-ASKQ6N5V.js.map} +1 -1
- package/dist/{chunk-6IRMKF5T.js → chunk-B4GNSSHU.js} +4 -4
- package/dist/{chunk-6IRMKF5T.js.map → chunk-B4GNSSHU.js.map} +1 -1
- package/dist/{chunk-BMEJBY6H.js → chunk-B5YHYI7E.js} +22 -27
- package/dist/chunk-B5YHYI7E.js.map +1 -0
- package/dist/{chunk-7OGZT7U2.js → chunk-G3AD3NJG.js} +3 -3
- package/dist/{chunk-7OGZT7U2.js.map → chunk-G3AD3NJG.js.map} +1 -1
- package/dist/{chunk-MNYY7UU2.js → chunk-GJFCIG34.js} +4 -4
- package/dist/{chunk-MNYY7UU2.js.map → chunk-GJFCIG34.js.map} +1 -1
- package/dist/{chunk-5H5YOPCF.js → chunk-I53TMAV2.js} +5 -5
- package/dist/{chunk-5H5YOPCF.js.map → chunk-I53TMAV2.js.map} +1 -1
- package/dist/{chunk-MCRTAUSZ.js → chunk-K3FZHYJL.js} +3 -3
- package/dist/{chunk-MCRTAUSZ.js.map → chunk-K3FZHYJL.js.map} +1 -1
- package/dist/{chunk-ZVECQBGG.js → chunk-KNGSO7A3.js} +41 -13
- package/dist/chunk-KNGSO7A3.js.map +1 -0
- package/dist/{chunk-4D2V4JE4.js → chunk-KYVXPSNW.js} +3 -3
- package/dist/{chunk-4D2V4JE4.js.map → chunk-KYVXPSNW.js.map} +1 -1
- package/dist/{chunk-L24N5EON.js → chunk-P7SH3XWY.js} +3 -3
- package/dist/{chunk-L24N5EON.js.map → chunk-P7SH3XWY.js.map} +1 -1
- package/dist/{chunk-LKFHUDEW.js → chunk-QVOBLRCM.js} +3 -3
- package/dist/{chunk-LKFHUDEW.js.map → chunk-QVOBLRCM.js.map} +1 -1
- package/dist/{chunk-SCXXJDKQ.js → chunk-SP6LCCTZ.js} +21 -28
- package/dist/chunk-SP6LCCTZ.js.map +1 -0
- package/dist/{chunk-Y2G47ARQ.js → chunk-TGGNSSOJ.js} +3 -3
- package/dist/{chunk-Y2G47ARQ.js.map → chunk-TGGNSSOJ.js.map} +1 -1
- package/dist/{chunk-D2QIPQ74.js → chunk-W3XX7BYT.js} +2 -2
- package/dist/chunk-W3XX7BYT.js.map +1 -0
- package/dist/{chunk-F374BNL4.js → chunk-YVTM2KRR.js} +12 -8
- package/dist/chunk-YVTM2KRR.js.map +1 -0
- package/dist/colors.css +328 -0
- package/dist/components/action-icon/action-icon.d.ts +6 -5
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +3 -2
- package/dist/components/alert/index.js +2 -2
- package/dist/components/app-shell/index.js +5 -4
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/index.js +2 -1
- package/dist/components/button/button.d.ts +11 -9
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +3 -2
- package/dist/components/button-multi-select/index.js +4 -3
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/index.js +4 -3
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/index.js +4 -3
- package/dist/components/camera/index.js +6 -5
- package/dist/components/clipboard/index.js +3 -2
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/data-table/index.js +10 -9
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/index.js +7 -6
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/download-button/index.js +4 -3
- package/dist/components/drawer/index.js +5 -4
- package/dist/components/file-item/index.js +4 -3
- package/dist/components/file-preview/index.js +4 -3
- package/dist/components/file-preview/index.js.map +1 -1
- package/dist/components/file-trigger/index.js +4 -3
- package/dist/components/file-upload/index.js +4 -3
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/image-cropper/index.js +4 -3
- package/dist/components/lightbox/index.js +7 -6
- package/dist/components/lightbox/index.js.map +1 -1
- package/dist/components/modal/index.js +5 -4
- package/dist/components/notification/index.js +3 -3
- package/dist/components/overlays/index.js +7 -6
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/photo-capture/index.js +8 -7
- package/dist/components/photo-capture/index.js.map +1 -1
- package/dist/components/schedule/index.js +4 -3
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spotlight/index.js +5 -4
- package/dist/components/spotlight/index.js.map +1 -1
- package/dist/components/theme-icon/index.js +1 -1
- package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
- package/dist/lib/button-colors.d.ts +25 -0
- package/dist/lib/button-colors.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/colors.css +328 -0
- package/src/components/action-icon/action-icon.test.tsx +22 -0
- package/src/components/action-icon/action-icon.tsx +24 -28
- package/src/components/badge/badge.test.tsx +53 -10
- package/src/components/badge/badge.tsx +64 -11
- package/src/components/button/button.test.tsx +41 -5
- package/src/components/button/button.tsx +28 -33
- package/src/components/spinner/spinner.tsx +3 -3
- package/src/components/theme-icon/theme-icon.test.tsx +7 -0
- package/src/components/theme-icon/theme-icon.tsx +10 -6
- package/src/lib/button-colors.ts +55 -0
- package/dist/chunk-BMEJBY6H.js.map +0 -1
- package/dist/chunk-D2QIPQ74.js.map +0 -1
- package/dist/chunk-F374BNL4.js.map +0 -1
- package/dist/chunk-SCXXJDKQ.js.map +0 -1
- package/dist/chunk-ZVECQBGG.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+FA,IAAM,eAAA,GAAkB,cAAoC,IAAI,CAAA;AAUzD,SAAS,WAAA,GAA6B;AAC3C,EAAA,MAAM,GAAA,GAAM,WAAW,eAAe,CAAA;AACtC,EAAA,IAAI,CAAC,GAAA,EAAK,MAAM,IAAI,MAAM,oDAAoD,CAAA;AAC9E,EAAA,OAAO,GAAA;AACT;AAOA,IAAM,WAAA,GAAc,CAAC,KAAA,EAAmB,MAAA,KAAwC;AAC9E,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,CAAA,IAAK,KAAA,CAAM,OAAA,IAAW,MAAM,OAAA,IAAW,KAAA,CAAM,QAAA,IAAY,KAAA,CAAM,MAAA,EAAQ;AAC1F,IAAA,OAAO,KAAA;AAAA,EACT;AACA,EAAA,MAAM,IAAA,GAAO,MAAM,MAAA,YAAkB,OAAA,GAAU,MAAM,MAAA,CAAO,OAAA,CAAQ,SAAS,CAAA,GAAI,IAAA;AACjF,EAAA,OAAO,IAAA,IAAQ,IAAA,IAAQ,MAAA,EAAQ,QAAA,CAAS,IAAI,CAAA,KAAM,IAAA;AACpD,CAAA;AAqBA,IAAM,eAAe,CAAC;AAAA,EACpB,UAAA,GAAa,GAAA;AAAA,EACb,SAAA,EAAW,aAAA;AAAA,EACX,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,SAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAqB;AACnB,EAAA,MAAM,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AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,QAAA,GAAW,MAAA,CAAO,MAAA,CAAO,YAAA,EAAc;AAAA,EAClD,OAAA,EAAS,eAAA;AAAA,EACT,aAAA,EAAe,qBAAA;AAAA,EACf,WAAA,EAAa,mBAAA;AAAA,EACb,aAAA,EAAe,qBAAA;AAAA,EACf,cAAA,EAAgB,sBAAA;AAAA,EAChB,sBAAA,EAAwB,8BAAA;AAAA,EACxB,MAAA,EAAQ,cAAA;AAAA,EACR,IAAA,EAAM,YAAA;AAAA,EACN,IAAA,EAAM,YAAA;AAAA,EACN,OAAA,EAAS,eAAA;AAAA,EACT,KAAA,EAAO;AACT,CAAC","file":"index.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type Dispatch,\n type MouseEvent,\n type PointerEvent,\n type Ref,\n type RefObject,\n type SetStateAction,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\"\nimport { flushSync } from \"react-dom\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport { SidebarRailContext } from \"../../lib/sidebar-rail\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useContainerQuery } from \"../../lib/use-container-query\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\nimport { type Updater, useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Drawer } from \"../drawer/drawer\"\n\n/**\n * AppShell — header / sidebar / main / aside app frame, laid out with CSS\n * Grid named areas. Sidebar spans the full height on the left; Header\n * spans the rest of the top (above both Main and Aside — Header never\n * spans over Sidebar, but it does span over Aside, unlike Sidebar itself);\n * Aside sits below Header, full height only within the remaining row,\n * beside Main. No Footer — add one only once a real consumer needs it.\n *\n * On desktop, Sidebar is a grid column that can be collapsed — opt in by\n * rendering an `AppShell.SidebarCollapseTrigger` (or driving `collapsed`):\n * the column animates to zero and the sidebar slides off the start edge,\n * coming back as a floating card while the pointer rests on that edge\n * (fumadocs' docs sidebar behaves the same way). Below `breakpoint`, it\n * becomes an overlay `Drawer` instead, toggled by `AppShell.SidebarTrigger`\n * (which renders nothing on desktop — `SidebarCollapseTrigger` is its\n * desktop counterpart, and renders nothing on mobile). Aside works\n * differently: it's always mounted (no JS/container-query gating at all,\n * unlike Sidebar) and purely CSS-driven — hidden below a `@xl` container\n * breakpoint, visible above it — mirroring how fumadocs' own docs layout\n * keeps its table-of-contents rail always in the DOM. There is no\n * `variant`/`color` axis — like `Table`/`Grid`/`Flex`, this is a\n * structural primitive, not a themed surface.\n *\n * `breakpoint` and Aside's `@xl` cutoff are both measured against\n * `AppShell`'s own rendered width, not the browser viewport — so this\n * behaves correctly embedded in a panel, a resizable pane, or anything\n * narrower than the window, not just when it fills the whole page.\n *\n * <AppShell>\n * <AppShell.Sidebar>\n * <AppShell.SidebarHeader>Logo</AppShell.SidebarHeader>\n * <AppShell.SidebarBody>Nav — scrolls</AppShell.SidebarBody>\n * <AppShell.SidebarFooter>User menu</AppShell.SidebarFooter>\n * </AppShell.Sidebar>\n * <AppShell.Header>\n * <AppShell.SidebarTrigger asChild>\n * <ActionIcon variant=\"subtle\" color=\"neutral\"><PanelLeft /></ActionIcon>\n * </AppShell.SidebarTrigger>\n * </AppShell.Header>\n * <AppShell.Main>Page content</AppShell.Main>\n * <AppShell.Aside>On this page…</AppShell.Aside>\n * </AppShell>\n */\n\nexport type AppShellState = {\n /** Whether the mobile drawer is open. Always uncontrolled, never a public prop. */\n mobileOpen: boolean\n /** Opens or closes the mobile drawer — e.g. close it after a programmatic\n * navigation (`router.push`) that no link click inside the sidebar caused. */\n setMobileOpen: Dispatch<SetStateAction<boolean>>\n /** Whether `AppShell` is narrower than its `breakpoint`, so Sidebar is a drawer. */\n isMobile: boolean\n /** Whether the desktop sidebar is collapsed. Has no effect below\n * `breakpoint`, where the sidebar is a drawer either way. */\n collapsed: boolean\n /** Collapses or expands the desktop sidebar — e.g. from a keyboard\n * shortcut. Goes through `onCollapsedChange` when `collapsed` is controlled. */\n setCollapsed: (updater: Updater<boolean>) => void\n /** Id of the sidebar — the drawer's content on mobile, the docked column on\n * desktop — which both triggers' `aria-controls` point at. */\n sidebarId: string\n}\n\nconst AppShellContext = createContext<AppShellState | null>(null)\n\n/**\n * The shell's sidebar state, from any descendant of `<AppShell>`. A link\n * clicked inside the mobile drawer already closes it; reach for this only when\n * something else navigates:\n *\n * const { setMobileOpen } = useAppShell()\n * const onSubmit = async () => { await save(); router.push(\"/done\"); setMobileOpen(false) }\n */\nexport function useAppShell(): AppShellState {\n const ctx = useContext(AppShellContext)\n if (!ctx) throw new Error(\"AppShell parts must be rendered within <AppShell>.\")\n return ctx\n}\n\n/** Whether a click inside the drawer follows a link in this tab: a plain\n * primary-button click on an `<a href>`. A modified click (new tab/window,\n * download) leaves the page — and the drawer — where they are. Whether the\n * link's own handler called `preventDefault` doesn't matter: a client-side\n * router does exactly that to navigate without a page load. */\nconst followsLink = (event: MouseEvent, drawer: HTMLElement | null): boolean => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return false\n }\n const link = event.target instanceof Element ? event.target.closest(\"a[href]\") : null\n return link != null && drawer?.contains(link) === true\n}\n\nexport type AppShellProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** AppShell's own rendered width (px) below which Sidebar renders as an\n * overlay `Drawer` instead of a grid column — measured against the\n * container itself via `ResizeObserver`, not the viewport. @default 768 */\n breakpoint?: number\n /** Whether the desktop sidebar is collapsed (controlled). Ignored below\n * `breakpoint`. */\n collapsed?: boolean\n /** Initial collapsed state (uncontrolled). @default false */\n defaultCollapsed?: boolean\n /** Called when a `SidebarCollapseTrigger` (or `useAppShell().setCollapsed`)\n * collapses or expands the desktop sidebar. */\n onCollapsedChange?: (collapsed: boolean) => void\n /** Lands on the grid root; also used internally to measure `breakpoint`\n * against the container's own width. */\n ref?: Ref<HTMLDivElement>\n }\n\nconst AppShellRoot = ({\n breakpoint = 768,\n collapsed: collapsedProp,\n defaultCollapsed,\n onCollapsedChange,\n className,\n style,\n children,\n ref,\n testId,\n onClick,\n ...rest\n}: AppShellProps) => {\n const rootRef = useRef<HTMLDivElement>(null)\n const [mobileOpen, setMobileOpen] = useState(false)\n const [collapsed, setCollapsed] = useUncontrolled({\n value: collapsedProp,\n defaultValue: defaultCollapsed,\n finalValue: false,\n onChange: onCollapsedChange,\n })\n const isMobile = useContainerQuery(rootRef, breakpoint)\n const sidebarId = `app-shell-sidebar-${useId()}`\n\n const mergedRef = useMergedRefs(ref, rootRef)\n return (\n <AppShellContext.Provider\n value={{ mobileOpen, setMobileOpen, isMobile, collapsed, setCollapsed, sidebarId }}\n >\n <ark.div\n {...props({\n \"data-testid\": testId,\n \"data-sidebar-collapsed\": collapsed && !isMobile,\n })}\n {...rest}\n ref={mergedRef}\n // The drawer is portaled out of this element in the DOM, but React\n // still bubbles its clicks through here. Closing on a followed link\n // is what a page load would have done; a client-side router doesn't\n // reload, so without this the drawer stays open over the new page.\n onClick={(event) => {\n onClick?.(event)\n if (mobileOpen && followsLink(event, document.getElementById(sidebarId))) {\n setMobileOpen(false)\n }\n }}\n style={{ gridTemplateAreas: `\"sidebar header header\" \"sidebar main aside\"`, ...style }}\n className={cn(\n \"@container grid h-dvh grid-cols-[auto_1fr_auto] grid-rows-[auto_1fr] overflow-hidden\",\n className,\n )}\n >\n {children}\n </ark.div>\n </AppShellContext.Provider>\n )\n}\n\nconst SIDEBAR_WIDTH: Record<Size, string> = {\n xs: \"w-56\",\n sm: \"w-64\",\n md: \"w-72\",\n lg: \"w-80\",\n xl: \"w-96\",\n}\n\n/** The icon rail's width: exactly the expanded sidebar's icon column —\n * SidebarBody's 16px padding + NavLink's 10px row padding on each side of a\n * 16px icon, plus the aside's 1px end border. At this width nothing has to re-lay out on a rail: every icon\n * (and the header's trigger, and the footer's avatar) sits where it does\n * when expanded, so opening and closing only animates the width, with\n * nothing jumping as the labels come and go. A NavLink row is then a 36px\n * square by itself. */\nconst RAIL_WIDTH = \"w-[calc(--spacing(17)+1px)]\"\n\n/** How long (ms) the pointer must stay *still* on an icon rail before it\n * peeks open. Any movement past `RAIL_REST_TOLERANCE` restarts the count, so\n * travelling across the icons (and reading their tooltips, 200ms) never opens\n * it — only a deliberate rest does. */\nconst RAIL_PEEK_DELAY = 1200\n/** How far (px) the pointer may drift and still count as resting — a hand on\n * a mouse or trackpad is never perfectly still. */\nconst RAIL_REST_TOLERANCE = 4\n\nexport type AppShellSidebarCollapse = \"hide\" | \"icons\"\n\nexport type AppShellSidebarProps = NoAsChild<HTMLArkProps<\"aside\">> &\n WithTestId & {\n /** Width when expanded, from the kit's Size scale. @default \"md\" */\n size?: Size\n /** What collapsing does on desktop. `\"hide\"` slides the sidebar off the\n * edge, peeking back as a card on hover at the edge. `\"icons\"` shrinks it\n * to a 68px icon rail: labels turn into tooltips, and resting on the rail\n * peeks the full sidebar over the page. @default \"hide\" */\n collapse?: AppShellSidebarCollapse\n }\n\n/**\n * Below `breakpoint`, renders through the kit's own `Drawer` instead of the\n * grid column — same `SidebarHeader`/`SidebarBody`/`SidebarFooter` children\n * either way, mirroring the desktop docked aside's layout: `Drawer`'s own\n * body normally forces every child through one scrolling container, which\n * would otherwise carry Header/Footer along with the scroll instead of\n * pinning them — `classNames.body` turns it into the same flex column\n * (Header/Footer as plain shrink-0 flex items, only SidebarBody's own\n * `overflow-y-auto` scrolls) instead. Full width, opening from the logical\n * end edge (right in LTR). `withCloseButton={false}` — at full width,\n * `Drawer`'s own generic close bar would just stack a second, redundant\n * header above `SidebarHeader`; render a `SidebarTrigger` inside\n * `SidebarHeader` itself instead for one unified bar with a visible close\n * affordance (swipe-to-dismiss on `Drawer`'s content still works too, but\n * isn't the only way out — not discoverable, and risky to rely on alone in\n * a sidebar full of tappable nav rows).\n *\n * Exclusive branch, not always-mounted-and-CSS-hidden like `Aside` — unlike\n * `Aside`, `Sidebar` has two genuinely different structural forms (a plain\n * `<aside>` vs. a portaled dialog with focus-trap/ARIA machinery), so\n * keeping both permanently mounted would mean literally duplicating\n * `children` (and any side effects inside it) into two simultaneous trees.\n * Matches fumadocs' own sidebar, which is JS-conditional for the same\n * reason — only its TOC (this component's `Aside`) goes the always-mounted\n * route. Only `size`/`className`/`children` and the `aria-label` /\n * `aria-labelledby` naming carry over to `Drawer` mode; arbitrary `<aside>`\n * props don't apply to `Drawer`'s own curated prop surface. The drawer has\n * no `title`, so without one of those it is a dialog with no name (and\n * `Drawer` warns in development).\n */\nconst AppShellSidebar = ({\n size = \"md\",\n collapse = \"hide\",\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: AppShellSidebarProps) => {\n const { isMobile, mobileOpen, setMobileOpen, collapsed, sidebarId } = useAppShell()\n const columnRef = useRef<HTMLDivElement>(null)\n const asideRef = useRef<HTMLElement>(null)\n const icons = collapse === \"icons\"\n const { peeking, restPoint, onPointerEnter, onPointerMove, onPointerLeave, onScrollActivity } =\n useSidebarPeek(collapsed, columnRef, asideRef, icons ? RAIL_PEEK_DELAY : 0)\n // Icons only: collapsed to the rail and not peeking.\n const rail = icons && collapsed && !peeking\n useRailAnchor(icons && collapsed && !isMobile, peeking, asideRef, restPoint)\n\n if (isMobile) {\n return (\n <Drawer\n open={mobileOpen}\n onOpenChange={setMobileOpen}\n placement=\"end\"\n withCloseButton={false}\n aria-label={rest[\"aria-label\"]}\n aria-labelledby={rest[\"aria-labelledby\"]}\n ids={{ content: sidebarId }}\n testId={testId}\n classNames={{ body: \"flex flex-col overflow-hidden p-0\" }}\n className={cn(\"w-full max-w-none\", className)}\n >\n {children}\n </Drawer>\n )\n }\n\n // Two layers, as in fumadocs: the column is what the grid track sizes\n // itself to (and what animates to zero), while the aside is positioned\n // inside it at a fixed width — so its content never reflows mid-collapse,\n // and the same element can float back out as a card while collapsed.\n return (\n <div\n ref={columnRef}\n id={sidebarId}\n className={cn(\n \"[grid-area:sidebar] relative z-10\",\n \"transition-[width] duration-250 ease-out motion-reduce:transition-none\",\n collapsed ? (icons ? RAIL_WIDTH : \"w-0\") : SIDEBAR_WIDTH[size],\n )}\n >\n {collapsed && !icons && (\n // The hot strip along the start edge that brings the card back. Before\n // the aside in the DOM so a peeking card paints over it.\n <div\n aria-hidden\n data-sidebar-edge=\"\"\n className=\"absolute inset-y-0 inset-s-0 w-4\"\n onPointerEnter={onPointerEnter}\n onPointerLeave={onPointerLeave}\n />\n )}\n <ark.aside\n {...props({\n \"data-testid\": testId,\n \"data-collapsed\": collapsed,\n \"data-peeking\": peeking,\n \"data-sidebar-rail\": rail,\n })}\n {...rest}\n ref={asideRef}\n // Off-screen links must not take Tab focus, nor be read out. A rail\n // is on screen, so it stays interactive.\n inert={collapsed && !icons && !peeking}\n onPointerEnter={(event) => {\n rest.onPointerEnter?.(event)\n onPointerEnter(event)\n }}\n // Capture: `scroll` doesn't bubble from SidebarBody, and a wheel\n // that can't scroll (at an end) is still the user scrolling.\n onWheelCapture={(event) => {\n rest.onWheelCapture?.(event)\n onScrollActivity()\n }}\n onScrollCapture={(event) => {\n rest.onScrollCapture?.(event)\n onScrollActivity()\n }}\n onPointerMove={(event) => {\n rest.onPointerMove?.(event)\n onPointerMove(event)\n }}\n onPointerLeave={(event) => {\n rest.onPointerLeave?.(event)\n onPointerLeave(event)\n }}\n className={cn(\n \"absolute inset-y-0 inset-s-0 flex flex-col overflow-hidden\",\n TEXT_COLOR_CLASSES.primary,\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"border-e border-brand-900/20 bg-brand-50/90 dark:border-white/15 dark:bg-brand-950/85\",\n \"transition-[width,translate,inset-block,border-radius,box-shadow] duration-250 ease-out motion-reduce:transition-none\",\n rail ? RAIL_WIDTH : SIDEBAR_WIDTH[size],\n // A peeking rail widens in place, over the page.\n icons && peeking && \"shadow-lg backdrop-blur-sm\",\n collapsed &&\n !icons && [\n // Collapsed, it's a floating panel over scrolling content — so it\n // takes Popover's blur, which the docked column doesn't need.\n \"inset-y-2 rounded-xl border backdrop-blur-sm\",\n peeking\n ? \"translate-x-2 shadow-lg rtl:-translate-x-2\"\n : \"-translate-x-full rtl:translate-x-full\",\n ],\n className,\n )}\n >\n <SidebarRailContext.Provider value={icons ? { active: rail } : null}>\n {children}\n </SidebarRailContext.Provider>\n </ark.aside>\n </div>\n )\n}\n\n/** Pointer-leave grace period (ms) when the pointer leaves near the shell's\n * edge — overshooting the window edge shouldn't snap the card shut. */\nconst PEEK_LEAVE_DELAY = 500\n/** How close to the shell's edge (px) a pointer-leave counts as \"near\". */\nconst PEEK_EDGE_DISTANCE = 100\n\n/**\n * Hover-to-peek for a collapsed sidebar, ported from fumadocs'\n * `SidebarContent`. Entering the edge strip (or the card itself) shows the\n * card; leaving hides it — at once when the pointer heads into the page, after\n * a grace period when it leaves near the edge. An icon rail (`enterDelay`)\n * instead waits for the pointer to come to rest: the count restarts whenever\n * it moves more than `RAIL_REST_TOLERANCE`, and leaving cancels it. Touch is\n * ignored (there is no hover to end it), and so is arming while the aside is\n * still animating —\n * otherwise collapsing with the pointer over the sidebar would peek it right\n * back. Leaving is never ignored, so a card can't get stuck open.\n */\nfunction useSidebarPeek(\n collapsed: boolean,\n columnRef: RefObject<HTMLElement | null>,\n asideRef: RefObject<HTMLElement | null>,\n /** How long the pointer must stay before the card shows — 0 at the hide\n * mode's edge strip, a dwell on an icon rail, where hovering an icon\n * should show its tooltip first. */\n enterDelay: number,\n) {\n const [hovered, setHovered] = useState(false)\n const [wasCollapsed, setWasCollapsed] = useState(collapsed)\n const timer = useRef<number | undefined>(undefined)\n /** Where the pointer was when the current rest began; null when not armed. */\n const restOrigin = useRef<{ x: number; y: number } | null>(null)\n /** Where the pointer rested when the rail last peeked open. */\n const restPoint = useRef<{ x: number; y: number } | null>(null)\n\n // Any collapse or expand starts from a hidden card.\n if (wasCollapsed !== collapsed) {\n setWasCollapsed(collapsed)\n setHovered(false)\n }\n useEffect(() => () => window.clearTimeout(timer.current), [])\n\n const ignored = (event: PointerEvent<HTMLElement>) =>\n !collapsed ||\n event.pointerType === \"touch\" ||\n (asideRef.current?.getAnimations?.().length ?? 0) > 0\n\n /** (Re)start the rest count from where the pointer is now. */\n const armRest = (event: PointerEvent<HTMLElement>) => {\n restOrigin.current = { x: event.clientX, y: event.clientY }\n restartRest()\n }\n\n const restartRest = () => {\n window.clearTimeout(timer.current)\n timer.current = window.setTimeout(() => {\n restPoint.current = restOrigin.current\n restOrigin.current = null\n setHovered(true)\n }, enterDelay)\n }\n\n const onPointerEnter = (event: PointerEvent<HTMLElement>) => {\n if (ignored(event)) return\n if (enterDelay > 0) return armRest(event)\n window.clearTimeout(timer.current)\n setHovered(true)\n }\n\n const onPointerMove = (event: PointerEvent<HTMLElement>) => {\n if (enterDelay === 0 || hovered || ignored(event)) return\n const origin = restOrigin.current\n // Also arms a rest the enter couldn't (the pointer was already over the\n // aside when it finished animating).\n if (\n !origin ||\n Math.hypot(event.clientX - origin.x, event.clientY - origin.y) > RAIL_REST_TOLERANCE\n ) {\n armRest(event)\n }\n }\n\n /**\n * Scrolling the rail is not resting on it, even with the pointer parked:\n * the rows are sliding under it, and the one it ends on is the one the user\n * means. So a wheel or scroll restarts the count, and the rail opens only\n * once both the pointer *and* the list have been still — not mid-scroll, on\n * whichever row happened to be passing. Only while a rest is pending (the\n * pointer is over the rail), so the anchoring's own scrolling, which runs\n * while open or after the pointer left, never arms one.\n */\n const onScrollActivity = () => {\n if (enterDelay === 0 || hovered || !restOrigin.current) return\n restartRest()\n }\n\n const onPointerLeave = (event: PointerEvent<HTMLElement>) => {\n if (!collapsed || event.pointerType === \"touch\") return\n restOrigin.current = null\n window.clearTimeout(timer.current)\n // Measured against the shell, not the viewport: AppShell may be embedded.\n const shell = columnRef.current?.parentElement ?? document.documentElement\n const { left, right } = shell.getBoundingClientRect()\n const fromEdge = Math.min(event.clientX - left, right - event.clientX)\n timer.current = window.setTimeout(\n () => setHovered(false),\n fromEdge > PEEK_EDGE_DISTANCE ? 0 : PEEK_LEAVE_DELAY,\n )\n }\n\n return {\n peeking: collapsed && hovered,\n restPoint,\n onPointerEnter,\n onPointerMove,\n onPointerLeave,\n onScrollActivity,\n }\n}\n\n/** The nearest scrolling ancestor of `node` inside `within` — SidebarBody,\n * unless a consumer put the row in a scroller of their own. */\nfunction scrollerOf(node: Element, within: Element): HTMLElement | null {\n for (let el = node.parentElement; el && el !== within; el = el.parentElement) {\n const { overflowY } = getComputedStyle(el)\n if (overflowY === \"auto\" || overflowY === \"scroll\") return el\n }\n return null\n}\n\n/** Longest gap (ms) between wheel events that still counts as one stream —\n * trackpad momentum fires every frame or so; a new, deliberate scroll starts\n * after a pause. */\nconst WHEEL_STREAM_GAP = 150\n\n/** Safety stop (ms) for the anchoring: it normally ends with the transition's\n * own animations (width 250ms, Collapse 300ms). */\nconst ANCHOR_MAX_DURATION = 1000\n\n/**\n * Keeps the row under the pointer where it is while an icon rail peeks open,\n * and while it closes again. Opening unfolds nested rows (NavLink's Collapse)\n * above it, which would otherwise push it down and out from under the pointer;\n * so every time the scroller's content resizes during the transition, the\n * scroller scrolls by exactly the distance it drifted. Self-correcting (it\n * re-measures against the starting position each time), it follows the\n * transition until its animations finish. Meanwhile it owns the list's scroll:\n * wheel events wait the ~300ms out (trackpad momentum would otherwise fight\n * it).\n *\n * The element is picked once, under the pointer at the moment the rail opens,\n * and reused on close: folding everything back above the same element walks\n * the scroll back to where the rail was, so a rail is never left scrolled.\n * Where the list is too short to scroll that far, it stays as close as the\n * scroll allows.\n */\nfunction useRailAnchor(\n enabled: boolean,\n peeking: boolean,\n asideRef: RefObject<HTMLElement | null>,\n restPoint: RefObject<{ x: number; y: number } | null>,\n) {\n const anchor = useRef<Element | null>(null)\n\n // A layout effect: it runs before the first frame of the transition paints,\n // while everything still sits where it did, so the starting position is\n // the true pre-open one.\n useIsomorphicLayoutEffect(() => {\n const aside = asideRef.current\n if (!enabled || !aside) return\n if (peeking) {\n const point = restPoint.current\n const hit = point ? document.elementFromPoint?.(point.x, point.y) : null\n anchor.current = hit && aside.contains(hit) ? hit : null\n }\n const target = anchor.current\n if (!peeking) anchor.current = null\n if (!target?.isConnected) return\n const scroller = scrollerOf(target, aside)\n if (!scroller) return\n\n const top = target.getBoundingClientRect().top\n // No \"a scroll we didn't make means the user took over\" check: the\n // browser makes some itself. Scrolled to the bottom, anything that changes\n // the scroller's height mid-transition (a footer whose text rewraps as the\n // rail widens) clamps the scroll and fires one, and treating that as the\n // user dropped the correction halfway, at random. The wheel is held below,\n // and nothing else scrolls a sidebar in a 300ms window.\n const correct = () => {\n const drift = target.getBoundingClientRect().top - top\n if (drift !== 0) scroller.scrollTop += drift\n }\n // A ResizeObserver, not requestAnimationFrame: its callbacks run after\n // layout and before paint, so each frame is corrected before it's drawn.\n // rAF runs before layout, sees the previous frame, and always lags one —\n // visible as a jolt on Collapse's fast-starting first frame.\n const observer = new ResizeObserver(correct)\n // The scroller too, not just its content: its own height changing (a\n // footer rewrapping) can move the row as well.\n observer.observe(scroller)\n for (const child of scroller.children) observer.observe(child)\n // The browser's own scroll anchoring would adjust the same scroll from its\n // own anchor node; keep it out while this one runs.\n const overflowAnchor = scroller.style.overflowAnchor\n scroller.style.overflowAnchor = \"none\"\n // Wheel scrolling waits out the transition (~300ms), and any wheel stream\n // already running through it. A trackpad keeps sending momentum wheel\n // events for a second or more after a flick: the user has stopped\n // scrolling, but the events still scroll the list (which, corrected, is no\n // longer resting against the edge that absorbed them), and nothing in a\n // WheelEvent tells inertia from intent. Letting them through dragged the\n // row out from under the pointer, at random. Momentum is one unbroken\n // stream, so the first wheel event after a pause is the user's again.\n let stopped = false\n let lastWheel = Number.NEGATIVE_INFINITY\n const holdWheel = (event: WheelEvent) => {\n const continuing = event.timeStamp - lastWheel < WHEEL_STREAM_GAP\n lastWheel = event.timeStamp\n if (!stopped || continuing) event.preventDefault()\n else releaseWheel()\n }\n const releaseWheel = () => scroller.removeEventListener(\"wheel\", holdWheel)\n const stop = () => {\n if (stopped) return\n stopped = true\n observer.disconnect()\n scroller.style.overflowAnchor = overflowAnchor\n }\n scroller.addEventListener(\"wheel\", holdWheel, { passive: false })\n // Done once the transition is: reading the animations here also flushes\n // the style change, so the width and Collapse transitions already exist.\n // Without getAnimations, only the timeout ends it.\n let settle = 0\n if (aside.getAnimations) {\n const running = aside.getAnimations({ subtree: true })\n Promise.allSettled(running.map((animation) => animation.finished)).then(() => {\n // One frame late, on purpose. `finished` resolves at the start of the\n // final frame, before that frame lays out the animations' end values;\n // stopping right away skipped the last few px of the unfold, leaving\n // the row 3px off (more or less, by frame timing). The next frame's\n // rAF runs after that layout and its ResizeObserver correction.\n settle = requestAnimationFrame(stop)\n })\n }\n const timeout = window.setTimeout(stop, ANCHOR_MAX_DURATION)\n return () => {\n stop()\n releaseWheel()\n window.clearTimeout(timeout)\n cancelAnimationFrame(settle)\n }\n }, [enabled, peeking])\n}\n\n// Shared by SidebarHeader and Header so the two sit at the same height and\n// Header's bottom border lines up level with SidebarHeader's own bottom edge\n// — sizing each off its own padding + content independently (the original\n// approach) drifts out of sync as soon as one holds taller content than the\n// other.\nconst HEADER_HEIGHT_CLASS = \"h-14\"\n\nexport type AppShellSidebarHeaderProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n// Plain flex sibling, not routed through the `ark.*` factory — mirrors\n// Drawer.Header/.Body/.Footer, which aren't either.\nconst AppShellSidebarHeader = ({ className, testId, ...rest }: AppShellSidebarHeaderProps) => (\n <div\n className={cn(HEADER_HEIGHT_CLASS, \"flex shrink-0 items-center gap-2 px-4\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarBodyProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/**\n * The scroll region — the only part of Sidebar that scrolls. On an icon rail\n * its scrollbar is hidden (no room for one). The mask fades\n * content at the top/bottom edges instead of clipping it on a hard line\n * (fumadocs' own docs sidebar uses the same static mask on its nav\n * viewport); `overscroll-contain` stops scrolling the list from chaining\n * into scrolling the rest of the page once it hits either end.\n */\nconst AppShellSidebarBody = ({ className, testId, ...rest }: AppShellSidebarBodyProps) => (\n <div\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain p-4\",\n // A classic (non-overlay) scrollbar would take ~15px of a 68px rail and\n // push the icons off-centre. The rail still scrolls by wheel, touch and\n // focus, and the edge mask below still shows there's more.\n \"sidebar-rail:[scrollbar-width:none]\",\n \"[mask-image:linear-gradient(to_bottom,transparent,black_12px,black_calc(100%-12px),transparent)]\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarFooterProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nconst AppShellSidebarFooter = ({ className, testId, ...rest }: AppShellSidebarFooterProps) => (\n <div className={cn(\"shrink-0 p-4\", className)} {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellHeaderProps = HTMLArkProps<\"header\"> & WithTestId\n\nconst AppShellHeader = ({ className, testId, ...rest }: AppShellHeaderProps) => (\n <ark.header\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n HEADER_HEIGHT_CLASS,\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"[grid-area:header] flex shrink-0 items-center gap-3 border-b border-brand-900/20 bg-brand-50/90 px-4 text-brand-950\",\n \"dark:border-white/15 dark:bg-brand-950/85 dark:text-white\",\n className,\n )}\n />\n)\n\nexport type AppShellMainSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\n// A local scale rather than the shared Size one: these are page widths, not\n// control widths, so they read off the kit's own `--width-*` tokens\n// (theme.css) — the vocabulary Modal already uses — instead of inventing a\n// second set. Static class strings so Tailwind's build-time scanner picks them\n// up, in the same lookup-map shape as SIDEBAR_WIDTH/ASIDE_WIDTH above.\nconst MAIN_MEASURE: Record<AppShellMainSize, string> = {\n sm: \"[--app-shell-measure:var(--width-xl)]\", // 48rem / 768px\n md: \"[--app-shell-measure:var(--width-2xl)]\", // 64rem / 1024px\n lg: \"[--app-shell-measure:var(--width-3xl)]\", // 80rem / 1280px\n xl: \"[--app-shell-measure:var(--width-4xl)]\", // 90rem / 1440px\n}\n\nexport type AppShellMainProps = HTMLArkProps<\"main\"> &\n WithTestId & {\n /** Width of the content column, from the kit's `--width-*` tokens:\n * `sm` 48rem · `md` 64rem · `lg` 80rem · `xl` 90rem. @default \"lg\" */\n size?: AppShellMainSize\n /** Drop the content column entirely — children fill Main edge to edge, as\n * they did before the column existed. For pages whose Main *is* one\n * full-canvas component (a Schedule, a DataTable sized to the viewport)\n * rather than a document. @default false */\n fluid?: boolean\n }\n\n/**\n * The page region. By default its children sit in a centered content column,\n * so a page of prose and forms doesn't stretch to whatever width the window\n * happens to be; `AppShell.Full` opts one child out to the full width, and\n * `AppShell.Content` puts arbitrary content back in.\n *\n * The column is three grid tracks — `1fr`, the column, `1fr` — rather than\n * inline padding, which is what lets a child span *past* the gutters without\n * negative margins, `100vw`, or any JS measurement. Percentages in track\n * sizing resolve against Main's own content box, so the column is correct\n * beside a sidebar, inside a resizable pane, or in a bounded docs preview\n * frame, with no media query and no `ResizeObserver` involved. Below\n * `measure + 2 × gutter` the middle track collapses to `100% - 2 × gutter`\n * and the `1fr` tracks land exactly on the gutter, so the column degrades\n * into plain padding continuously, without a breakpoint.\n *\n * `align-content: start` is load-bearing: grid's default (`normal`, i.e.\n * `stretch`) hands leftover vertical space to every auto row, which would\n * space a short page's blocks out down the viewport.\n *\n * <AppShell.Main>\n * <Title>Quarterly sales</Title>\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n * </AppShell.Main>\n */\nconst AppShellMain = ({\n size = \"lg\",\n fluid = false,\n className,\n testId,\n ...rest\n}: AppShellMainProps) => (\n <ark.main\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:main] min-h-0 overflow-y-auto\",\n !fluid && [\n // Gutter doubles as Main's block padding, so content never butts\n // against Header. Overridable per page with\n // `className=\"[--app-shell-gutter:2rem]\"`; both vars inherit, which is\n // what lets `AppShell.Content` re-derive the column at any depth.\n \"[--app-shell-gutter:1.5rem] py-(--app-shell-gutter)\",\n MAIN_MEASURE[size],\n \"grid content-start grid-cols-[1fr_min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))_1fr]\",\n // Both placement rules are authored here, on the same element, so\n // their relative weight is decided by specificity — `.main > [data-full]`\n // (0,2,0) over `.main > *` (0,1,0) — and never by where Tailwind\n // happens to sort two same-weight utilities. `min-w-0` stops a wide\n // child (a DataTable) overflowing the column, and zeroes a spanning\n // child's min-content contribution so it can't inflate the gutters.\n \"[&>*]:col-start-2 [&>*]:min-w-0\",\n \"[&>[data-full]]:col-span-full\",\n ],\n className,\n )}\n />\n)\n\nexport type AppShellFullProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Opts one child of `AppShell.Main` out of the content column, spanning every\n * track so it reaches Main's true edges — for the things a column actively\n * hurts: data tables, carousels, heroes, full-width backgrounds.\n *\n * Carries no layout class of its own; it only marks itself with `data-full`,\n * and Main's own rule does the placement (see `AppShellMain`). `asChild`\n * merges that marker onto the component itself, so nothing extra lands in the\n * DOM:\n *\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n *\n * Only works as a *direct* child of Main — breaking out of a grid means being\n * in it. Wrap content in a `Full` band and use `AppShell.Content` inside it\n * rather than nesting `Full` deeper.\n */\nconst AppShellFull = ({ testId, ...rest }: AppShellFullProps) => (\n <ark.div data-full=\"\" {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellContentProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Puts content back into Main's column — the counterpart to `AppShell.Full`,\n * for a full-width band whose *text* should still line up with the rest of the\n * page:\n *\n * <AppShell.Full asChild>\n * <section className=\"bg-brand-50 py-16\">\n * <AppShell.Content>\n * <Title>Welcome back</Title>\n * </AppShell.Content>\n * </section>\n * </AppShell.Full>\n *\n * The width expression is the same one Main gives its middle track, resolved\n * against this element's own containing block, so the edges line up exactly at\n * both ends of the range — full measure when there's room, gutter-only when\n * there isn't. Reading the inherited custom properties rather than using\n * `subgrid` is deliberate: subgrid would only reach one level down, only from\n * an element spanning every track, and would break on any wrapper in between.\n * This works at any depth, including inside a `fluid` Main.\n */\nconst AppShellContent = ({ className, testId, ...rest }: AppShellContentProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"mx-auto w-[min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))]\",\n className,\n )}\n />\n)\n\nconst ASIDE_WIDTH: Record<Size, string> = {\n xs: \"@xl:w-56\",\n sm: \"@xl:w-64\",\n md: \"@xl:w-72\",\n lg: \"@xl:w-80\",\n xl: \"@xl:w-96\",\n}\n\nexport type AppShellAsideProps = HTMLArkProps<\"aside\"> &\n WithTestId & {\n /** Width when visible, from the kit's Size scale. @default \"md\" */\n size?: Size\n }\n\n/**\n * The right region, below `Header` (unlike `Sidebar`, which spans the full\n * height beside it). Unlike `Sidebar`, always mounted — hidden below a\n * `@xl` *container* breakpoint (1280px of `AppShell`'s own width, via\n * Tailwind's native container queries — `AppShell`'s root carries\n * `@container`) and shown above it, purely via static classes, no\n * `useContainerQuery`/context involved. Matches fumadocs' own docs layout,\n * which keeps its table-of-contents rail always in the DOM rather than\n * conditionally unmounting it — no hydration mismatch is possible when\n * nothing renders differently based on client-only state. Fixed to `@xl`\n * rather than a configurable prop like Sidebar's `breakpoint`: Sidebar's is\n * JS-driven and can take any pixel value at runtime, but a static Tailwind\n * class can't take an arbitrary runtime breakpoint without breaking the\n * build-time class scanner.\n */\nconst AppShellAside = ({ size = \"md\", className, testId, ...rest }: AppShellAsideProps) => (\n <ark.aside\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:aside] hidden flex-col overflow-y-auto\",\n TEXT_COLOR_CLASSES.primary,\n \"@xl:flex\",\n ASIDE_WIDTH[size],\n className,\n )}\n />\n)\n\nexport type AppShellSidebarTriggerProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * Opens/closes the mobile `Drawer`. Renders nothing above `breakpoint`,\n * where the sidebar is a grid column — `SidebarCollapseTrigger` is the\n * desktop counterpart that collapses it.\n * `asChild`-able, like every other kit trigger. Carries `aria-expanded` and\n * `aria-controls` (the drawer's content), like any disclosure button.\n */\nconst AppShellSidebarTrigger = ({ onClick, testId, ...rest }: AppShellSidebarTriggerProps) => {\n const { isMobile, mobileOpen, setMobileOpen, sidebarId } = useAppShell()\n\n if (!isMobile) return null\n\n return (\n <ark.button\n type=\"button\"\n aria-expanded={mobileOpen}\n aria-controls={sidebarId}\n {...props({ \"data-testid\": testId })}\n {...rest}\n onClick={(event) => {\n onClick?.(event)\n setMobileOpen((open) => !open)\n }}\n />\n )\n}\n\nexport type AppShellSidebarCollapseTriggerProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * Collapses/expands the desktop sidebar — `SidebarTrigger`'s desktop\n * counterpart, and its mirror image: renders nothing below `breakpoint`,\n * where the sidebar is a drawer and there's nothing to collapse. Rendering one\n * is what opts a shell into collapsing. `asChild`-able; carries\n * `aria-expanded`, `aria-controls` and `data-collapsed`.\n *\n * Usually rendered twice: in `SidebarHeader` to collapse, and in `Header` to\n * expand again (the one in the sidebar slides away with it) — the Header one\n * often only while `useAppShell().collapsed`. Collapsing from the one inside\n * the sidebar hands focus to a collapse trigger outside it, including one\n * that only just rendered, since the collapsed sidebar is `inert` and would\n * otherwise drop focus on the floor.\n */\nconst AppShellSidebarCollapseTrigger = ({\n onClick,\n testId,\n ...rest\n}: AppShellSidebarCollapseTriggerProps) => {\n const { isMobile, collapsed, setCollapsed, sidebarId } = useAppShell()\n\n if (isMobile) return null\n\n return (\n <ark.button\n type=\"button\"\n aria-expanded={!collapsed}\n aria-controls={sidebarId}\n data-app-shell-collapse-trigger=\"\"\n {...props({ \"data-testid\": testId, \"data-collapsed\": collapsed })}\n {...rest}\n onClick={(event) => {\n onClick?.(event)\n const button = event.currentTarget\n // Commit synchronously, so a trigger that only renders while\n // collapsed (an \"expand\" button in Header) exists to take focus.\n flushSync(() => setCollapsed((value) => !value))\n // Collapsed out of sight (`collapse=\"hide\"`), the sidebar is now\n // inert and this button with it. A rail stays usable, so focus stays.\n const sidebar = document.getElementById(sidebarId)\n if (sidebar && button.closest(\"[inert]\")) {\n const outside = [\n ...(sidebar.parentElement?.querySelectorAll<HTMLElement>(\n \"[data-app-shell-collapse-trigger]\",\n ) ?? []),\n ].find((trigger) => !sidebar.contains(trigger))\n outside?.focus()\n }\n }}\n />\n )\n}\n\nexport const AppShell = Object.assign(AppShellRoot, {\n Sidebar: AppShellSidebar,\n SidebarHeader: AppShellSidebarHeader,\n SidebarBody: AppShellSidebarBody,\n SidebarFooter: AppShellSidebarFooter,\n SidebarTrigger: AppShellSidebarTrigger,\n SidebarCollapseTrigger: AppShellSidebarCollapseTrigger,\n Header: AppShellHeader,\n Main: AppShellMain,\n Full: AppShellFull,\n Content: AppShellContent,\n Aside: AppShellAside,\n})\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+FA,IAAM,eAAA,GAAkB,cAAoC,IAAI,CAAA;AAUzD,SAAS,WAAA,GAA6B;AAC3C,EAAA,MAAM,GAAA,GAAM,WAAW,eAAe,CAAA;AACtC,EAAA,IAAI,CAAC,GAAA,EAAK,MAAM,IAAI,MAAM,oDAAoD,CAAA;AAC9E,EAAA,OAAO,GAAA;AACT;AAOA,IAAM,WAAA,GA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,\n createContext,\n type Dispatch,\n type MouseEvent,\n type PointerEvent,\n type Ref,\n type RefObject,\n type SetStateAction,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\"\nimport { flushSync } from \"react-dom\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport { SidebarRailContext } from \"../../lib/sidebar-rail\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useContainerQuery } from \"../../lib/use-container-query\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\nimport { type Updater, useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Drawer } from \"../drawer/drawer\"\n\n/**\n * AppShell — header / sidebar / main / aside app frame, laid out with CSS\n * Grid named areas. Sidebar spans the full height on the left; Header\n * spans the rest of the top (above both Main and Aside — Header never\n * spans over Sidebar, but it does span over Aside, unlike Sidebar itself);\n * Aside sits below Header, full height only within the remaining row,\n * beside Main. No Footer — add one only once a real consumer needs it.\n *\n * On desktop, Sidebar is a grid column that can be collapsed — opt in by\n * rendering an `AppShell.SidebarCollapseTrigger` (or driving `collapsed`):\n * the column animates to zero and the sidebar slides off the start edge,\n * coming back as a floating card while the pointer rests on that edge\n * (fumadocs' docs sidebar behaves the same way). Below `breakpoint`, it\n * becomes an overlay `Drawer` instead, toggled by `AppShell.SidebarTrigger`\n * (which renders nothing on desktop — `SidebarCollapseTrigger` is its\n * desktop counterpart, and renders nothing on mobile). Aside works\n * differently: it's always mounted (no JS/container-query gating at all,\n * unlike Sidebar) and purely CSS-driven — hidden below a `@xl` container\n * breakpoint, visible above it — mirroring how fumadocs' own docs layout\n * keeps its table-of-contents rail always in the DOM. There is no\n * `variant`/`color` axis — like `Table`/`Grid`/`Flex`, this is a\n * structural primitive, not a themed surface.\n *\n * `breakpoint` and Aside's `@xl` cutoff are both measured against\n * `AppShell`'s own rendered width, not the browser viewport — so this\n * behaves correctly embedded in a panel, a resizable pane, or anything\n * narrower than the window, not just when it fills the whole page.\n *\n * <AppShell>\n * <AppShell.Sidebar>\n * <AppShell.SidebarHeader>Logo</AppShell.SidebarHeader>\n * <AppShell.SidebarBody>Nav — scrolls</AppShell.SidebarBody>\n * <AppShell.SidebarFooter>User menu</AppShell.SidebarFooter>\n * </AppShell.Sidebar>\n * <AppShell.Header>\n * <AppShell.SidebarTrigger asChild>\n * <ActionIcon variant=\"subtle\" color=\"neutral\"><PanelLeft /></ActionIcon>\n * </AppShell.SidebarTrigger>\n * </AppShell.Header>\n * <AppShell.Main>Page content</AppShell.Main>\n * <AppShell.Aside>On this page…</AppShell.Aside>\n * </AppShell>\n */\n\nexport type AppShellState = {\n /** Whether the mobile drawer is open. Always uncontrolled, never a public prop. */\n mobileOpen: boolean\n /** Opens or closes the mobile drawer — e.g. close it after a programmatic\n * navigation (`router.push`) that no link click inside the sidebar caused. */\n setMobileOpen: Dispatch<SetStateAction<boolean>>\n /** Whether `AppShell` is narrower than its `breakpoint`, so Sidebar is a drawer. */\n isMobile: boolean\n /** Whether the desktop sidebar is collapsed. Has no effect below\n * `breakpoint`, where the sidebar is a drawer either way. */\n collapsed: boolean\n /** Collapses or expands the desktop sidebar — e.g. from a keyboard\n * shortcut. Goes through `onCollapsedChange` when `collapsed` is controlled. */\n setCollapsed: (updater: Updater<boolean>) => void\n /** Id of the sidebar — the drawer's content on mobile, the docked column on\n * desktop — which both triggers' `aria-controls` point at. */\n sidebarId: string\n}\n\nconst AppShellContext = createContext<AppShellState | null>(null)\n\n/**\n * The shell's sidebar state, from any descendant of `<AppShell>`. A link\n * clicked inside the mobile drawer already closes it; reach for this only when\n * something else navigates:\n *\n * const { setMobileOpen } = useAppShell()\n * const onSubmit = async () => { await save(); router.push(\"/done\"); setMobileOpen(false) }\n */\nexport function useAppShell(): AppShellState {\n const ctx = useContext(AppShellContext)\n if (!ctx) throw new Error(\"AppShell parts must be rendered within <AppShell>.\")\n return ctx\n}\n\n/** Whether a click inside the drawer follows a link in this tab: a plain\n * primary-button click on an `<a href>`. A modified click (new tab/window,\n * download) leaves the page — and the drawer — where they are. Whether the\n * link's own handler called `preventDefault` doesn't matter: a client-side\n * router does exactly that to navigate without a page load. */\nconst followsLink = (event: MouseEvent, drawer: HTMLElement | null): boolean => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return false\n }\n const link = event.target instanceof Element ? event.target.closest(\"a[href]\") : null\n return link != null && drawer?.contains(link) === true\n}\n\nexport type AppShellProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** AppShell's own rendered width (px) below which Sidebar renders as an\n * overlay `Drawer` instead of a grid column — measured against the\n * container itself via `ResizeObserver`, not the viewport. @default 768 */\n breakpoint?: number\n /** Whether the desktop sidebar is collapsed (controlled). Ignored below\n * `breakpoint`. */\n collapsed?: boolean\n /** Initial collapsed state (uncontrolled). @default false */\n defaultCollapsed?: boolean\n /** Called when a `SidebarCollapseTrigger` (or `useAppShell().setCollapsed`)\n * collapses or expands the desktop sidebar. */\n onCollapsedChange?: (collapsed: boolean) => void\n /** Lands on the grid root; also used internally to measure `breakpoint`\n * against the container's own width. */\n ref?: Ref<HTMLDivElement>\n }\n\nconst AppShellRoot = ({\n breakpoint = 768,\n collapsed: collapsedProp,\n defaultCollapsed,\n onCollapsedChange,\n className,\n style,\n children,\n ref,\n testId,\n onClick,\n ...rest\n}: AppShellProps) => {\n const rootRef = useRef<HTMLDivElement>(null)\n const [mobileOpen, setMobileOpen] = useState(false)\n const [collapsed, setCollapsed] = useUncontrolled({\n value: collapsedProp,\n defaultValue: defaultCollapsed,\n finalValue: false,\n onChange: onCollapsedChange,\n })\n const isMobile = useContainerQuery(rootRef, breakpoint)\n const sidebarId = `app-shell-sidebar-${useId()}`\n\n const mergedRef = useMergedRefs(ref, rootRef)\n return (\n <AppShellContext.Provider\n value={{ mobileOpen, setMobileOpen, isMobile, collapsed, setCollapsed, sidebarId }}\n >\n <ark.div\n {...props({\n \"data-testid\": testId,\n \"data-sidebar-collapsed\": collapsed && !isMobile,\n })}\n {...rest}\n ref={mergedRef}\n // The drawer is portaled out of this element in the DOM, but React\n // still bubbles its clicks through here. Closing on a followed link\n // is what a page load would have done; a client-side router doesn't\n // reload, so without this the drawer stays open over the new page.\n onClick={(event) => {\n onClick?.(event)\n if (mobileOpen && followsLink(event, document.getElementById(sidebarId))) {\n setMobileOpen(false)\n }\n }}\n style={{ gridTemplateAreas: `\"sidebar header header\" \"sidebar main aside\"`, ...style }}\n className={cn(\n \"@container grid h-dvh grid-cols-[auto_1fr_auto] grid-rows-[auto_1fr] overflow-hidden\",\n className,\n )}\n >\n {children}\n </ark.div>\n </AppShellContext.Provider>\n )\n}\n\nconst SIDEBAR_WIDTH: Record<Size, string> = {\n xs: \"w-56\",\n sm: \"w-64\",\n md: \"w-72\",\n lg: \"w-80\",\n xl: \"w-96\",\n}\n\n/** The icon rail's width: exactly the expanded sidebar's icon column —\n * SidebarBody's 16px padding + NavLink's 10px row padding on each side of a\n * 16px icon, plus the aside's 1px end border. At this width nothing has to re-lay out on a rail: every icon\n * (and the header's trigger, and the footer's avatar) sits where it does\n * when expanded, so opening and closing only animates the width, with\n * nothing jumping as the labels come and go. A NavLink row is then a 36px\n * square by itself. */\nconst RAIL_WIDTH = \"w-[calc(--spacing(17)+1px)]\"\n\n/** How long (ms) the pointer must stay *still* on an icon rail before it\n * peeks open. Any movement past `RAIL_REST_TOLERANCE` restarts the count, so\n * travelling across the icons (and reading their tooltips, 200ms) never opens\n * it — only a deliberate rest does. */\nconst RAIL_PEEK_DELAY = 1200\n/** How far (px) the pointer may drift and still count as resting — a hand on\n * a mouse or trackpad is never perfectly still. */\nconst RAIL_REST_TOLERANCE = 4\n\nexport type AppShellSidebarCollapse = \"hide\" | \"icons\"\n\nexport type AppShellSidebarProps = NoAsChild<HTMLArkProps<\"aside\">> &\n WithTestId & {\n /** Width when expanded, from the kit's Size scale. @default \"md\" */\n size?: Size\n /** What collapsing does on desktop. `\"hide\"` slides the sidebar off the\n * edge, peeking back as a card on hover at the edge. `\"icons\"` shrinks it\n * to a 68px icon rail: labels turn into tooltips, and resting on the rail\n * peeks the full sidebar over the page. @default \"hide\" */\n collapse?: AppShellSidebarCollapse\n }\n\n/**\n * Below `breakpoint`, renders through the kit's own `Drawer` instead of the\n * grid column — same `SidebarHeader`/`SidebarBody`/`SidebarFooter` children\n * either way, mirroring the desktop docked aside's layout: `Drawer`'s own\n * body normally forces every child through one scrolling container, which\n * would otherwise carry Header/Footer along with the scroll instead of\n * pinning them — `classNames.body` turns it into the same flex column\n * (Header/Footer as plain shrink-0 flex items, only SidebarBody's own\n * `overflow-y-auto` scrolls) instead. Full width, opening from the logical\n * end edge (right in LTR). `withCloseButton={false}` — at full width,\n * `Drawer`'s own generic close bar would just stack a second, redundant\n * header above `SidebarHeader`; render a `SidebarTrigger` inside\n * `SidebarHeader` itself instead for one unified bar with a visible close\n * affordance (swipe-to-dismiss on `Drawer`'s content still works too, but\n * isn't the only way out — not discoverable, and risky to rely on alone in\n * a sidebar full of tappable nav rows).\n *\n * Exclusive branch, not always-mounted-and-CSS-hidden like `Aside` — unlike\n * `Aside`, `Sidebar` has two genuinely different structural forms (a plain\n * `<aside>` vs. a portaled dialog with focus-trap/ARIA machinery), so\n * keeping both permanently mounted would mean literally duplicating\n * `children` (and any side effects inside it) into two simultaneous trees.\n * Matches fumadocs' own sidebar, which is JS-conditional for the same\n * reason — only its TOC (this component's `Aside`) goes the always-mounted\n * route. Only `size`/`className`/`children` and the `aria-label` /\n * `aria-labelledby` naming carry over to `Drawer` mode; arbitrary `<aside>`\n * props don't apply to `Drawer`'s own curated prop surface. The drawer has\n * no `title`, so without one of those it is a dialog with no name (and\n * `Drawer` warns in development).\n */\nconst AppShellSidebar = ({\n size = \"md\",\n collapse = \"hide\",\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: AppShellSidebarProps) => {\n const { isMobile, mobileOpen, setMobileOpen, collapsed, sidebarId } = useAppShell()\n const columnRef = useRef<HTMLDivElement>(null)\n const asideRef = useRef<HTMLElement>(null)\n const icons = collapse === \"icons\"\n const { peeking, restPoint, onPointerEnter, onPointerMove, onPointerLeave, onScrollActivity } =\n useSidebarPeek(collapsed, columnRef, asideRef, icons ? RAIL_PEEK_DELAY : 0)\n // Icons only: collapsed to the rail and not peeking.\n const rail = icons && collapsed && !peeking\n useRailAnchor(icons && collapsed && !isMobile, peeking, asideRef, restPoint)\n\n if (isMobile) {\n return (\n <Drawer\n open={mobileOpen}\n onOpenChange={setMobileOpen}\n placement=\"end\"\n withCloseButton={false}\n aria-label={rest[\"aria-label\"]}\n aria-labelledby={rest[\"aria-labelledby\"]}\n ids={{ content: sidebarId }}\n testId={testId}\n classNames={{ body: \"flex flex-col overflow-hidden p-0\" }}\n className={cn(\"w-full max-w-none\", className)}\n >\n {children}\n </Drawer>\n )\n }\n\n // Two layers, as in fumadocs: the column is what the grid track sizes\n // itself to (and what animates to zero), while the aside is positioned\n // inside it at a fixed width — so its content never reflows mid-collapse,\n // and the same element can float back out as a card while collapsed.\n return (\n <div\n ref={columnRef}\n id={sidebarId}\n className={cn(\n \"[grid-area:sidebar] relative z-10\",\n \"transition-[width] duration-250 ease-out motion-reduce:transition-none\",\n collapsed ? (icons ? RAIL_WIDTH : \"w-0\") : SIDEBAR_WIDTH[size],\n )}\n >\n {collapsed && !icons && (\n // The hot strip along the start edge that brings the card back. Before\n // the aside in the DOM so a peeking card paints over it.\n <div\n aria-hidden\n data-sidebar-edge=\"\"\n className=\"absolute inset-y-0 inset-s-0 w-4\"\n onPointerEnter={onPointerEnter}\n onPointerLeave={onPointerLeave}\n />\n )}\n <ark.aside\n {...props({\n \"data-testid\": testId,\n \"data-collapsed\": collapsed,\n \"data-peeking\": peeking,\n \"data-sidebar-rail\": rail,\n })}\n {...rest}\n ref={asideRef}\n // Off-screen links must not take Tab focus, nor be read out. A rail\n // is on screen, so it stays interactive.\n inert={collapsed && !icons && !peeking}\n onPointerEnter={(event) => {\n rest.onPointerEnter?.(event)\n onPointerEnter(event)\n }}\n // Capture: `scroll` doesn't bubble from SidebarBody, and a wheel\n // that can't scroll (at an end) is still the user scrolling.\n onWheelCapture={(event) => {\n rest.onWheelCapture?.(event)\n onScrollActivity()\n }}\n onScrollCapture={(event) => {\n rest.onScrollCapture?.(event)\n onScrollActivity()\n }}\n onPointerMove={(event) => {\n rest.onPointerMove?.(event)\n onPointerMove(event)\n }}\n onPointerLeave={(event) => {\n rest.onPointerLeave?.(event)\n onPointerLeave(event)\n }}\n className={cn(\n \"absolute inset-y-0 inset-s-0 flex flex-col overflow-hidden\",\n TEXT_COLOR_CLASSES.primary,\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"border-e border-brand-900/20 bg-brand-50/90 dark:border-white/15 dark:bg-brand-950/85\",\n \"transition-[width,translate,inset-block,border-radius,box-shadow] duration-250 ease-out motion-reduce:transition-none\",\n rail ? RAIL_WIDTH : SIDEBAR_WIDTH[size],\n // A peeking rail widens in place, over the page.\n icons && peeking && \"shadow-lg backdrop-blur-sm\",\n collapsed &&\n !icons && [\n // Collapsed, it's a floating panel over scrolling content — so it\n // takes Popover's blur, which the docked column doesn't need.\n \"inset-y-2 rounded-xl border backdrop-blur-sm\",\n peeking\n ? \"translate-x-2 shadow-lg rtl:-translate-x-2\"\n : \"-translate-x-full rtl:translate-x-full\",\n ],\n className,\n )}\n >\n <SidebarRailContext.Provider value={icons ? { active: rail } : null}>\n {children}\n </SidebarRailContext.Provider>\n </ark.aside>\n </div>\n )\n}\n\n/** Pointer-leave grace period (ms) when the pointer leaves near the shell's\n * edge — overshooting the window edge shouldn't snap the card shut. */\nconst PEEK_LEAVE_DELAY = 500\n/** How close to the shell's edge (px) a pointer-leave counts as \"near\". */\nconst PEEK_EDGE_DISTANCE = 100\n\n/**\n * Hover-to-peek for a collapsed sidebar, ported from fumadocs'\n * `SidebarContent`. Entering the edge strip (or the card itself) shows the\n * card; leaving hides it — at once when the pointer heads into the page, after\n * a grace period when it leaves near the edge. An icon rail (`enterDelay`)\n * instead waits for the pointer to come to rest: the count restarts whenever\n * it moves more than `RAIL_REST_TOLERANCE`, and leaving cancels it. Touch is\n * ignored (there is no hover to end it), and so is arming while the aside is\n * still animating —\n * otherwise collapsing with the pointer over the sidebar would peek it right\n * back. Leaving is never ignored, so a card can't get stuck open.\n */\nfunction useSidebarPeek(\n collapsed: boolean,\n columnRef: RefObject<HTMLElement | null>,\n asideRef: RefObject<HTMLElement | null>,\n /** How long the pointer must stay before the card shows — 0 at the hide\n * mode's edge strip, a dwell on an icon rail, where hovering an icon\n * should show its tooltip first. */\n enterDelay: number,\n) {\n const [hovered, setHovered] = useState(false)\n const [wasCollapsed, setWasCollapsed] = useState(collapsed)\n const timer = useRef<number | undefined>(undefined)\n /** Where the pointer was when the current rest began; null when not armed. */\n const restOrigin = useRef<{ x: number; y: number } | null>(null)\n /** Where the pointer rested when the rail last peeked open. */\n const restPoint = useRef<{ x: number; y: number } | null>(null)\n\n // Any collapse or expand starts from a hidden card.\n if (wasCollapsed !== collapsed) {\n setWasCollapsed(collapsed)\n setHovered(false)\n }\n useEffect(() => () => window.clearTimeout(timer.current), [])\n\n const ignored = (event: PointerEvent<HTMLElement>) =>\n !collapsed ||\n event.pointerType === \"touch\" ||\n (asideRef.current?.getAnimations?.().length ?? 0) > 0\n\n /** (Re)start the rest count from where the pointer is now. */\n const armRest = (event: PointerEvent<HTMLElement>) => {\n restOrigin.current = { x: event.clientX, y: event.clientY }\n restartRest()\n }\n\n const restartRest = () => {\n window.clearTimeout(timer.current)\n timer.current = window.setTimeout(() => {\n restPoint.current = restOrigin.current\n restOrigin.current = null\n setHovered(true)\n }, enterDelay)\n }\n\n const onPointerEnter = (event: PointerEvent<HTMLElement>) => {\n if (ignored(event)) return\n if (enterDelay > 0) return armRest(event)\n window.clearTimeout(timer.current)\n setHovered(true)\n }\n\n const onPointerMove = (event: PointerEvent<HTMLElement>) => {\n if (enterDelay === 0 || hovered || ignored(event)) return\n const origin = restOrigin.current\n // Also arms a rest the enter couldn't (the pointer was already over the\n // aside when it finished animating).\n if (\n !origin ||\n Math.hypot(event.clientX - origin.x, event.clientY - origin.y) > RAIL_REST_TOLERANCE\n ) {\n armRest(event)\n }\n }\n\n /**\n * Scrolling the rail is not resting on it, even with the pointer parked:\n * the rows are sliding under it, and the one it ends on is the one the user\n * means. So a wheel or scroll restarts the count, and the rail opens only\n * once both the pointer *and* the list have been still — not mid-scroll, on\n * whichever row happened to be passing. Only while a rest is pending (the\n * pointer is over the rail), so the anchoring's own scrolling, which runs\n * while open or after the pointer left, never arms one.\n */\n const onScrollActivity = () => {\n if (enterDelay === 0 || hovered || !restOrigin.current) return\n restartRest()\n }\n\n const onPointerLeave = (event: PointerEvent<HTMLElement>) => {\n if (!collapsed || event.pointerType === \"touch\") return\n restOrigin.current = null\n window.clearTimeout(timer.current)\n // Measured against the shell, not the viewport: AppShell may be embedded.\n const shell = columnRef.current?.parentElement ?? document.documentElement\n const { left, right } = shell.getBoundingClientRect()\n const fromEdge = Math.min(event.clientX - left, right - event.clientX)\n timer.current = window.setTimeout(\n () => setHovered(false),\n fromEdge > PEEK_EDGE_DISTANCE ? 0 : PEEK_LEAVE_DELAY,\n )\n }\n\n return {\n peeking: collapsed && hovered,\n restPoint,\n onPointerEnter,\n onPointerMove,\n onPointerLeave,\n onScrollActivity,\n }\n}\n\n/** The nearest scrolling ancestor of `node` inside `within` — SidebarBody,\n * unless a consumer put the row in a scroller of their own. */\nfunction scrollerOf(node: Element, within: Element): HTMLElement | null {\n for (let el = node.parentElement; el && el !== within; el = el.parentElement) {\n const { overflowY } = getComputedStyle(el)\n if (overflowY === \"auto\" || overflowY === \"scroll\") return el\n }\n return null\n}\n\n/** Longest gap (ms) between wheel events that still counts as one stream —\n * trackpad momentum fires every frame or so; a new, deliberate scroll starts\n * after a pause. */\nconst WHEEL_STREAM_GAP = 150\n\n/** Safety stop (ms) for the anchoring: it normally ends with the transition's\n * own animations (width 250ms, Collapse 300ms). */\nconst ANCHOR_MAX_DURATION = 1000\n\n/**\n * Keeps the row under the pointer where it is while an icon rail peeks open,\n * and while it closes again. Opening unfolds nested rows (NavLink's Collapse)\n * above it, which would otherwise push it down and out from under the pointer;\n * so every time the scroller's content resizes during the transition, the\n * scroller scrolls by exactly the distance it drifted. Self-correcting (it\n * re-measures against the starting position each time), it follows the\n * transition until its animations finish. Meanwhile it owns the list's scroll:\n * wheel events wait the ~300ms out (trackpad momentum would otherwise fight\n * it).\n *\n * The element is picked once, under the pointer at the moment the rail opens,\n * and reused on close: folding everything back above the same element walks\n * the scroll back to where the rail was, so a rail is never left scrolled.\n * Where the list is too short to scroll that far, it stays as close as the\n * scroll allows.\n */\nfunction useRailAnchor(\n enabled: boolean,\n peeking: boolean,\n asideRef: RefObject<HTMLElement | null>,\n restPoint: RefObject<{ x: number; y: number } | null>,\n) {\n const anchor = useRef<Element | null>(null)\n\n // A layout effect: it runs before the first frame of the transition paints,\n // while everything still sits where it did, so the starting position is\n // the true pre-open one.\n useIsomorphicLayoutEffect(() => {\n const aside = asideRef.current\n if (!enabled || !aside) return\n if (peeking) {\n const point = restPoint.current\n const hit = point ? document.elementFromPoint?.(point.x, point.y) : null\n anchor.current = hit && aside.contains(hit) ? hit : null\n }\n const target = anchor.current\n if (!peeking) anchor.current = null\n if (!target?.isConnected) return\n const scroller = scrollerOf(target, aside)\n if (!scroller) return\n\n const top = target.getBoundingClientRect().top\n // No \"a scroll we didn't make means the user took over\" check: the\n // browser makes some itself. Scrolled to the bottom, anything that changes\n // the scroller's height mid-transition (a footer whose text rewraps as the\n // rail widens) clamps the scroll and fires one, and treating that as the\n // user dropped the correction halfway, at random. The wheel is held below,\n // and nothing else scrolls a sidebar in a 300ms window.\n const correct = () => {\n const drift = target.getBoundingClientRect().top - top\n if (drift !== 0) scroller.scrollTop += drift\n }\n // A ResizeObserver, not requestAnimationFrame: its callbacks run after\n // layout and before paint, so each frame is corrected before it's drawn.\n // rAF runs before layout, sees the previous frame, and always lags one —\n // visible as a jolt on Collapse's fast-starting first frame.\n const observer = new ResizeObserver(correct)\n // The scroller too, not just its content: its own height changing (a\n // footer rewrapping) can move the row as well.\n observer.observe(scroller)\n for (const child of scroller.children) observer.observe(child)\n // The browser's own scroll anchoring would adjust the same scroll from its\n // own anchor node; keep it out while this one runs.\n const overflowAnchor = scroller.style.overflowAnchor\n scroller.style.overflowAnchor = \"none\"\n // Wheel scrolling waits out the transition (~300ms), and any wheel stream\n // already running through it. A trackpad keeps sending momentum wheel\n // events for a second or more after a flick: the user has stopped\n // scrolling, but the events still scroll the list (which, corrected, is no\n // longer resting against the edge that absorbed them), and nothing in a\n // WheelEvent tells inertia from intent. Letting them through dragged the\n // row out from under the pointer, at random. Momentum is one unbroken\n // stream, so the first wheel event after a pause is the user's again.\n let stopped = false\n let lastWheel = Number.NEGATIVE_INFINITY\n const holdWheel = (event: WheelEvent) => {\n const continuing = event.timeStamp - lastWheel < WHEEL_STREAM_GAP\n lastWheel = event.timeStamp\n if (!stopped || continuing) event.preventDefault()\n else releaseWheel()\n }\n const releaseWheel = () => scroller.removeEventListener(\"wheel\", holdWheel)\n const stop = () => {\n if (stopped) return\n stopped = true\n observer.disconnect()\n scroller.style.overflowAnchor = overflowAnchor\n }\n scroller.addEventListener(\"wheel\", holdWheel, { passive: false })\n // Done once the transition is: reading the animations here also flushes\n // the style change, so the width and Collapse transitions already exist.\n // Without getAnimations, only the timeout ends it.\n let settle = 0\n if (aside.getAnimations) {\n const running = aside.getAnimations({ subtree: true })\n Promise.allSettled(running.map((animation) => animation.finished)).then(() => {\n // One frame late, on purpose. `finished` resolves at the start of the\n // final frame, before that frame lays out the animations' end values;\n // stopping right away skipped the last few px of the unfold, leaving\n // the row 3px off (more or less, by frame timing). The next frame's\n // rAF runs after that layout and its ResizeObserver correction.\n settle = requestAnimationFrame(stop)\n })\n }\n const timeout = window.setTimeout(stop, ANCHOR_MAX_DURATION)\n return () => {\n stop()\n releaseWheel()\n window.clearTimeout(timeout)\n cancelAnimationFrame(settle)\n }\n }, [enabled, peeking])\n}\n\n// Shared by SidebarHeader and Header so the two sit at the same height and\n// Header's bottom border lines up level with SidebarHeader's own bottom edge\n// — sizing each off its own padding + content independently (the original\n// approach) drifts out of sync as soon as one holds taller content than the\n// other.\nconst HEADER_HEIGHT_CLASS = \"h-14\"\n\nexport type AppShellSidebarHeaderProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n// Plain flex sibling, not routed through the `ark.*` factory — mirrors\n// Drawer.Header/.Body/.Footer, which aren't either.\nconst AppShellSidebarHeader = ({ className, testId, ...rest }: AppShellSidebarHeaderProps) => (\n <div\n className={cn(HEADER_HEIGHT_CLASS, \"flex shrink-0 items-center gap-2 px-4\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarBodyProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/**\n * The scroll region — the only part of Sidebar that scrolls. On an icon rail\n * its scrollbar is hidden (no room for one). The mask fades\n * content at the top/bottom edges instead of clipping it on a hard line\n * (fumadocs' own docs sidebar uses the same static mask on its nav\n * viewport); `overscroll-contain` stops scrolling the list from chaining\n * into scrolling the rest of the page once it hits either end.\n */\nconst AppShellSidebarBody = ({ className, testId, ...rest }: AppShellSidebarBodyProps) => (\n <div\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain p-4\",\n // A classic (non-overlay) scrollbar would take ~15px of a 68px rail and\n // push the icons off-centre. The rail still scrolls by wheel, touch and\n // focus, and the edge mask below still shows there's more.\n \"sidebar-rail:[scrollbar-width:none]\",\n \"[mask-image:linear-gradient(to_bottom,transparent,black_12px,black_calc(100%-12px),transparent)]\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type AppShellSidebarFooterProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nconst AppShellSidebarFooter = ({ className, testId, ...rest }: AppShellSidebarFooterProps) => (\n <div className={cn(\"shrink-0 p-4\", className)} {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellHeaderProps = HTMLArkProps<\"header\"> & WithTestId\n\nconst AppShellHeader = ({ className, testId, ...rest }: AppShellHeaderProps) => (\n <ark.header\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n HEADER_HEIGHT_CLASS,\n // Brand-derived border/fill, matching InputBase/Popover/Modal/Drawer/Table's\n // own chrome (border-brand-900/20 dark:border-white/15, bg-brand-50/90\n // dark:bg-brand-950/85) rather than a neutral gray.\n \"[grid-area:header] flex shrink-0 items-center gap-3 border-b border-brand-900/20 bg-brand-50/90 px-4 text-brand-950\",\n \"dark:border-white/15 dark:bg-brand-950/85 dark:text-white\",\n className,\n )}\n />\n)\n\nexport type AppShellMainSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\n// A local scale rather than the shared Size one: these are page widths, not\n// control widths, so they read off the kit's own `--width-*` tokens\n// (theme.css) — the vocabulary Modal already uses — instead of inventing a\n// second set. Static class strings so Tailwind's build-time scanner picks them\n// up, in the same lookup-map shape as SIDEBAR_WIDTH/ASIDE_WIDTH above.\nconst MAIN_MEASURE: Record<AppShellMainSize, string> = {\n sm: \"[--app-shell-measure:var(--width-xl)]\", // 48rem / 768px\n md: \"[--app-shell-measure:var(--width-2xl)]\", // 64rem / 1024px\n lg: \"[--app-shell-measure:var(--width-3xl)]\", // 80rem / 1280px\n xl: \"[--app-shell-measure:var(--width-4xl)]\", // 90rem / 1440px\n}\n\nexport type AppShellMainProps = HTMLArkProps<\"main\"> &\n WithTestId & {\n /** Width of the content column, from the kit's `--width-*` tokens:\n * `sm` 48rem · `md` 64rem · `lg` 80rem · `xl` 90rem. @default \"lg\" */\n size?: AppShellMainSize\n /** Drop the content column entirely — children fill Main edge to edge, as\n * they did before the column existed. For pages whose Main *is* one\n * full-canvas component (a Schedule, a DataTable sized to the viewport)\n * rather than a document. @default false */\n fluid?: boolean\n }\n\n/**\n * The page region. By default its children sit in a centered content column,\n * so a page of prose and forms doesn't stretch to whatever width the window\n * happens to be; `AppShell.Full` opts one child out to the full width, and\n * `AppShell.Content` puts arbitrary content back in.\n *\n * The column is three grid tracks — `1fr`, the column, `1fr` — rather than\n * inline padding, which is what lets a child span *past* the gutters without\n * negative margins, `100vw`, or any JS measurement. Percentages in track\n * sizing resolve against Main's own content box, so the column is correct\n * beside a sidebar, inside a resizable pane, or in a bounded docs preview\n * frame, with no media query and no `ResizeObserver` involved. Below\n * `measure + 2 × gutter` the middle track collapses to `100% - 2 × gutter`\n * and the `1fr` tracks land exactly on the gutter, so the column degrades\n * into plain padding continuously, without a breakpoint.\n *\n * `align-content: start` is load-bearing: grid's default (`normal`, i.e.\n * `stretch`) hands leftover vertical space to every auto row, which would\n * space a short page's blocks out down the viewport.\n *\n * <AppShell.Main>\n * <Title>Quarterly sales</Title>\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n * </AppShell.Main>\n */\nconst AppShellMain = ({\n size = \"lg\",\n fluid = false,\n className,\n testId,\n ...rest\n}: AppShellMainProps) => (\n <ark.main\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:main] min-h-0 overflow-y-auto\",\n !fluid && [\n // Gutter doubles as Main's block padding, so content never butts\n // against Header. Overridable per page with\n // `className=\"[--app-shell-gutter:2rem]\"`; both vars inherit, which is\n // what lets `AppShell.Content` re-derive the column at any depth.\n \"[--app-shell-gutter:1.5rem] py-(--app-shell-gutter)\",\n MAIN_MEASURE[size],\n \"grid content-start grid-cols-[1fr_min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))_1fr]\",\n // Both placement rules are authored here, on the same element, so\n // their relative weight is decided by specificity — `.main > [data-full]`\n // (0,2,0) over `.main > *` (0,1,0) — and never by where Tailwind\n // happens to sort two same-weight utilities. `min-w-0` stops a wide\n // child (a DataTable) overflowing the column, and zeroes a spanning\n // child's min-content contribution so it can't inflate the gutters.\n \"[&>*]:col-start-2 [&>*]:min-w-0\",\n \"[&>[data-full]]:col-span-full\",\n ],\n className,\n )}\n />\n)\n\nexport type AppShellFullProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Opts one child of `AppShell.Main` out of the content column, spanning every\n * track so it reaches Main's true edges — for the things a column actively\n * hurts: data tables, carousels, heroes, full-width backgrounds.\n *\n * Carries no layout class of its own; it only marks itself with `data-full`,\n * and Main's own rule does the placement (see `AppShellMain`). `asChild`\n * merges that marker onto the component itself, so nothing extra lands in the\n * DOM:\n *\n * <AppShell.Full asChild>\n * <DataTable … />\n * </AppShell.Full>\n *\n * Only works as a *direct* child of Main — breaking out of a grid means being\n * in it. Wrap content in a `Full` band and use `AppShell.Content` inside it\n * rather than nesting `Full` deeper.\n */\nconst AppShellFull = ({ testId, ...rest }: AppShellFullProps) => (\n <ark.div data-full=\"\" {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type AppShellContentProps = HTMLArkProps<\"div\"> & WithTestId\n\n/**\n * Puts content back into Main's column — the counterpart to `AppShell.Full`,\n * for a full-width band whose *text* should still line up with the rest of the\n * page:\n *\n * <AppShell.Full asChild>\n * <section className=\"bg-brand-50 py-16\">\n * <AppShell.Content>\n * <Title>Welcome back</Title>\n * </AppShell.Content>\n * </section>\n * </AppShell.Full>\n *\n * The width expression is the same one Main gives its middle track, resolved\n * against this element's own containing block, so the edges line up exactly at\n * both ends of the range — full measure when there's room, gutter-only when\n * there isn't. Reading the inherited custom properties rather than using\n * `subgrid` is deliberate: subgrid would only reach one level down, only from\n * an element spanning every track, and would break on any wrapper in between.\n * This works at any depth, including inside a `fluid` Main.\n */\nconst AppShellContent = ({ className, testId, ...rest }: AppShellContentProps) => (\n <ark.div\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"mx-auto w-[min(100%-2*var(--app-shell-gutter),var(--app-shell-measure))]\",\n className,\n )}\n />\n)\n\nconst ASIDE_WIDTH: Record<Size, string> = {\n xs: \"@xl:w-56\",\n sm: \"@xl:w-64\",\n md: \"@xl:w-72\",\n lg: \"@xl:w-80\",\n xl: \"@xl:w-96\",\n}\n\nexport type AppShellAsideProps = HTMLArkProps<\"aside\"> &\n WithTestId & {\n /** Width when visible, from the kit's Size scale. @default \"md\" */\n size?: Size\n }\n\n/**\n * The right region, below `Header` (unlike `Sidebar`, which spans the full\n * height beside it). Unlike `Sidebar`, always mounted — hidden below a\n * `@xl` *container* breakpoint (1280px of `AppShell`'s own width, via\n * Tailwind's native container queries — `AppShell`'s root carries\n * `@container`) and shown above it, purely via static classes, no\n * `useContainerQuery`/context involved. Matches fumadocs' own docs layout,\n * which keeps its table-of-contents rail always in the DOM rather than\n * conditionally unmounting it — no hydration mismatch is possible when\n * nothing renders differently based on client-only state. Fixed to `@xl`\n * rather than a configurable prop like Sidebar's `breakpoint`: Sidebar's is\n * JS-driven and can take any pixel value at runtime, but a static Tailwind\n * class can't take an arbitrary runtime breakpoint without breaking the\n * build-time class scanner.\n */\nconst AppShellAside = ({ size = \"md\", className, testId, ...rest }: AppShellAsideProps) => (\n <ark.aside\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"[grid-area:aside] hidden flex-col overflow-y-auto\",\n TEXT_COLOR_CLASSES.primary,\n \"@xl:flex\",\n ASIDE_WIDTH[size],\n className,\n )}\n />\n)\n\nexport type AppShellSidebarTriggerProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * Opens/closes the mobile `Drawer`. Renders nothing above `breakpoint`,\n * where the sidebar is a grid column — `SidebarCollapseTrigger` is the\n * desktop counterpart that collapses it.\n * `asChild`-able, like every other kit trigger. Carries `aria-expanded` and\n * `aria-controls` (the drawer's content), like any disclosure button.\n */\nconst AppShellSidebarTrigger = ({ onClick, testId, ...rest }: AppShellSidebarTriggerProps) => {\n const { isMobile, mobileOpen, setMobileOpen, sidebarId } = useAppShell()\n\n if (!isMobile) return null\n\n return (\n <ark.button\n type=\"button\"\n aria-expanded={mobileOpen}\n aria-controls={sidebarId}\n {...props({ \"data-testid\": testId })}\n {...rest}\n onClick={(event) => {\n onClick?.(event)\n setMobileOpen((open) => !open)\n }}\n />\n )\n}\n\nexport type AppShellSidebarCollapseTriggerProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * Collapses/expands the desktop sidebar — `SidebarTrigger`'s desktop\n * counterpart, and its mirror image: renders nothing below `breakpoint`,\n * where the sidebar is a drawer and there's nothing to collapse. Rendering one\n * is what opts a shell into collapsing. `asChild`-able; carries\n * `aria-expanded`, `aria-controls` and `data-collapsed`.\n *\n * Usually rendered twice: in `SidebarHeader` to collapse, and in `Header` to\n * expand again (the one in the sidebar slides away with it) — the Header one\n * often only while `useAppShell().collapsed`. Collapsing from the one inside\n * the sidebar hands focus to a collapse trigger outside it, including one\n * that only just rendered, since the collapsed sidebar is `inert` and would\n * otherwise drop focus on the floor.\n */\nconst AppShellSidebarCollapseTrigger = ({\n onClick,\n testId,\n ...rest\n}: AppShellSidebarCollapseTriggerProps) => {\n const { isMobile, collapsed, setCollapsed, sidebarId } = useAppShell()\n\n if (isMobile) return null\n\n return (\n <ark.button\n type=\"button\"\n aria-expanded={!collapsed}\n aria-controls={sidebarId}\n data-app-shell-collapse-trigger=\"\"\n {...props({ \"data-testid\": testId, \"data-collapsed\": collapsed })}\n {...rest}\n onClick={(event) => {\n onClick?.(event)\n const button = event.currentTarget\n // Commit synchronously, so a trigger that only renders while\n // collapsed (an \"expand\" button in Header) exists to take focus.\n flushSync(() => setCollapsed((value) => !value))\n // Collapsed out of sight (`collapse=\"hide\"`), the sidebar is now\n // inert and this button with it. A rail stays usable, so focus stays.\n const sidebar = document.getElementById(sidebarId)\n if (sidebar && button.closest(\"[inert]\")) {\n const outside = [\n ...(sidebar.parentElement?.querySelectorAll<HTMLElement>(\n \"[data-app-shell-collapse-trigger]\",\n ) ?? []),\n ].find((trigger) => !sidebar.contains(trigger))\n outside?.focus()\n }\n }}\n />\n )\n}\n\nexport const AppShell = Object.assign(AppShellRoot, {\n Sidebar: AppShellSidebar,\n SidebarHeader: AppShellSidebarHeader,\n SidebarBody: AppShellSidebarBody,\n SidebarFooter: AppShellSidebarFooter,\n SidebarTrigger: AppShellSidebarTrigger,\n SidebarCollapseTrigger: AppShellSidebarCollapseTrigger,\n Header: AppShellHeader,\n Main: AppShellMain,\n Full: AppShellFull,\n Content: AppShellContent,\n Aside: AppShellAside,\n})\n"]}
|
|
@@ -44,5 +44,5 @@ export type BadgeProps = Omit<HTMLArkProps<"span">, "color"> & VariantProps<type
|
|
|
44
44
|
*/
|
|
45
45
|
gradient?: GradientProps;
|
|
46
46
|
};
|
|
47
|
-
export declare const Badge: ({ className, variant, size, color, gradient, style, testId, ...rest }: BadgeProps) => import("react").JSX.Element;
|
|
47
|
+
export declare const Badge: ({ className, variant, size, color, gradient, style, testId, asChild, children, ...rest }: BadgeProps) => import("react").JSX.Element;
|
|
48
48
|
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,aAAa;;;8EA+ElB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AACrF,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAE/E,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,CAAA;AAE1C,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,GAC1D,YAAY,CAAC,OAAO,aAAa,CAAC,GAClC,UAAU,GAAG;IACX,kEAAkE;IAClE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAA;CACzB,CAAA;AAuCH,eAAO,MAAM,KAAK,6FAWf,UAAU,gCAmBZ,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { Badge } from '../../chunk-
|
|
1
|
+
export { Badge } from '../../chunk-KNGSO7A3.js';
|
|
2
2
|
import '../../chunk-SKPM2FRX.js';
|
|
3
|
+
import '../../chunk-R5LYFTHA.js';
|
|
3
4
|
import '../../chunk-WYCMIIRR.js';
|
|
4
5
|
import '../../chunk-C6NVU4F7.js';
|
|
5
6
|
import '../../chunk-GIPQUKCN.js';
|
|
@@ -7,13 +7,15 @@ import type { WithTestId } from "../../lib/test-id";
|
|
|
7
7
|
* Button — interactive but stateless primitive.
|
|
8
8
|
*
|
|
9
9
|
* The new (variant × color) model splits visual treatment from accent palette:
|
|
10
|
-
* - `variant` picks the shape (filled / light / outline / subtle)
|
|
11
|
-
* - `color` picks the palette (brand /
|
|
10
|
+
* - `variant` picks the shape (filled / light / outline / subtle / link)
|
|
11
|
+
* - `color` picks the palette (brand / neutral / red / orange / …)
|
|
12
12
|
*
|
|
13
13
|
* Color is delivered through CSS variables: the component writes a
|
|
14
14
|
* `data-color="…"` attribute and the global rules in `colors.css` resolve
|
|
15
|
-
*
|
|
16
|
-
* the cva matrix only enumerates variants, not
|
|
15
|
+
* the button-only `--btn-*` slots (copied from the Figma Button set) for
|
|
16
|
+
* both light and dark mode. So the cva matrix only enumerates variants, not
|
|
17
|
+
* (variant × color) pairs; the per-variant classes live in
|
|
18
|
+
* `lib/button-colors.ts`, shared with ActionIcon.
|
|
17
19
|
* When `color` is omitted, no `data-color` attribute is rendered and the
|
|
18
20
|
* slot vars cascade from `:root` — which mirrors `neutral` — so the
|
|
19
21
|
* zero-config `<Button>` renders `filled` · `neutral`. Consumers retheme the
|
|
@@ -45,10 +47,10 @@ import type { WithTestId } from "../../lib/test-id";
|
|
|
45
47
|
* spinner at all. Under `motion-reduce` the swap is instant; the spinner
|
|
46
48
|
* itself still turns.
|
|
47
49
|
*
|
|
48
|
-
* A loading button keeps full contrast —
|
|
49
|
-
* `disabled`. `disabled` alone
|
|
50
|
-
* `:disabled`
|
|
51
|
-
* `loading` too).
|
|
50
|
+
* A loading button keeps full contrast — muting it would read as
|
|
51
|
+
* `disabled`. `disabled` alone switches to the palette's disabled tints
|
|
52
|
+
* (`not-data-loading:` scopes the `:disabled` colours off, since
|
|
53
|
+
* `resolvedDisabled` sets native `disabled` for `loading` too).
|
|
52
54
|
*
|
|
53
55
|
* `loading` doesn't use `pointer-events-none` to block interaction — that
|
|
54
56
|
* also blocks `:hover`, which would make `cursor-progress` unreachable by a
|
|
@@ -61,7 +63,7 @@ import type { WithTestId } from "../../lib/test-id";
|
|
|
61
63
|
* never matches a non-form element like an `<a>`.
|
|
62
64
|
*/
|
|
63
65
|
declare const buttonVariants: (props?: ({
|
|
64
|
-
variant?: "filled" | "light" | "outline" | "subtle" | null | undefined;
|
|
66
|
+
variant?: "filled" | "light" | "link" | "outline" | "subtle" | null | undefined;
|
|
65
67
|
size?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
|
|
66
68
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
67
69
|
export type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>["variant"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAIlD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,QAAA,MAAM,cAAc;;;8EAqCnB,CAAA;AAyBD,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AACvF,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAEjF,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,GAC7D,YAAY,CAAC,OAAO,cAAc,CAAC,GACnC,UAAU,GAAG;IACX,kEAAkE;IAClE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,CAAA;AA+EH,eAAO,MAAM,MAAM,+IAehB,WAAW,gCAqDb,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import '../../chunk-ORTCK34Y.js';
|
|
3
|
-
export { Button } from '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
3
|
+
export { Button } from '../../chunk-SP6LCCTZ.js';
|
|
4
|
+
import '../../chunk-6B2GNPJP.js';
|
|
5
|
+
import '../../chunk-W3XX7BYT.js';
|
|
5
6
|
import '../../chunk-R5LYFTHA.js';
|
|
6
7
|
import '../../chunk-WYCMIIRR.js';
|
|
7
8
|
import '../../chunk-C6NVU4F7.js';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Context, Item, MultiRoot, ButtonSelectControl } from '../../chunk-
|
|
2
|
+
import { Context, Item, MultiRoot, ButtonSelectControl } from '../../chunk-G3AD3NJG.js';
|
|
3
3
|
import '../../chunk-PBSVX5DB.js';
|
|
4
4
|
import '../../chunk-X6DESK37.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-SP6LCCTZ.js';
|
|
6
|
+
import '../../chunk-6B2GNPJP.js';
|
|
6
7
|
import { useUncontrolled } from '../../chunk-PMUCGFY5.js';
|
|
7
8
|
import '../../chunk-BUIHQJGE.js';
|
|
8
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-W3XX7BYT.js';
|
|
9
10
|
import '../../chunk-R5LYFTHA.js';
|
|
10
11
|
import '../../chunk-WYCMIIRR.js';
|
|
11
12
|
import '../../chunk-C6NVU4F7.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/button-multi-select/button-multi-select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/button-multi-select/button-multi-select.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmCA,IAAM,6BAA6B,CAAyD;AAAA,EAC1F,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAoC;AAClC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,eAAA,CAAwD;AAAA,IACtF,KAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAY,EAAC;AAAA,IACb,UAAU,CAAC,IAAA,KAAS,WAAW,CAAC,GAAG,IAAI,CAAC;AAAA,GACzC,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAQ,IAAA;AAAA,MACR,KAAA,EAAO,QAAA;AAAA,MAGP,aAAA,EAAe,CAAC,IAAA,KAAS,WAAA,CAAY,IAAiC,CAAA;AAAA,MACtE,UAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAA;AAWO,IAAM,iBAAA,GAAoB,MAAA,CAAO,MAAA,CAAO,0BAAA,EAA4B;AAAA,EACzE,IAAA,EAAM,SAAA;AAAA,EACN,IAAA;AAAA,EACA;AACF,CAAC","file":"index.js","sourcesContent":["\"use client\"\n\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Context, Item, MultiRoot } from \"../button-select/button-select\"\nimport {\n type ButtonSelectBaseProps,\n ButtonSelectControl,\n} from \"../button-select/button-select-control\"\nimport type {\n ButtonSelectData,\n ButtonSelectValue,\n RenderButtonSelectItem,\n} from \"../button-select/button-select-items\"\n\n/**\n * ButtonMultiSelect — `ButtonSelect`'s multiple-choice twin: a row of joined\n * `Button`s where each item toggles independently. The selected items take\n * `selectedVariant` (default `filled`), the rest `variant` (default `light`).\n * Text formatting toggles, weekday pickers, filter rows.\n *\n * - Same `data` items as `ButtonSelect`; `value` is an array of the data's\n * literal values, in selection order.\n * - The group is a `role=\"group\"` of toggle buttons carrying `aria-pressed`.\n * - `name` submits one hidden input per selected value.\n */\nexport type ButtonMultiSelectProps<Data extends ButtonSelectData = ButtonSelectData> =\n ButtonSelectBaseProps<Data> & {\n /** Controlled value. */\n value?: ReadonlyArray<ButtonSelectValue<Data>>\n /** Uncontrolled initial value. */\n defaultValue?: ReadonlyArray<ButtonSelectValue<Data>>\n /** Fires with every selected value. */\n onChange?: (value: ButtonSelectValue<Data>[]) => void\n }\n\nconst ButtonMultiSelectComponent = <const Data extends ButtonSelectData = ButtonSelectData>({\n value,\n defaultValue,\n onChange,\n renderItem,\n ...rest\n}: ButtonMultiSelectProps<Data>) => {\n const [selected, setSelected] = useUncontrolled<ReadonlyArray<ButtonSelectValue<Data>>>({\n value,\n defaultValue,\n finalValue: [],\n onChange: (next) => onChange?.([...next]),\n })\n\n return (\n <ButtonSelectControl\n multiple\n value={selected}\n // The machine's values are `string`s that always originate from `data`,\n // so they narrow back to the caller's union.\n onValueChange={(next) => setSelected(next as ButtonSelectValue<Data>[])}\n renderItem={renderItem as RenderButtonSelectItem<ButtonSelectData> | undefined}\n {...rest}\n />\n )\n}\n\n/**\n * The public `ButtonMultiSelect` — the data-driven form, with the composable\n * parts attached:\n *\n * <ButtonMultiSelect.Root aria-label=\"Formatting\" defaultValue={[\"bold\"]}>\n * <ButtonMultiSelect.Item value=\"bold\" aria-label=\"Bold\"><BoldIcon /></ButtonMultiSelect.Item>\n * <ButtonMultiSelect.Item value=\"italic\" aria-label=\"Italic\"><ItalicIcon /></ButtonMultiSelect.Item>\n * </ButtonMultiSelect.Root>\n */\nexport const ButtonMultiSelect = Object.assign(ButtonMultiSelectComponent, {\n Root: MultiRoot,\n Item,\n Context,\n})\n"]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Context, Item, Root, ButtonSelectControl } from '../../chunk-
|
|
2
|
+
import { Context, Item, Root, ButtonSelectControl } from '../../chunk-G3AD3NJG.js';
|
|
3
3
|
import '../../chunk-PBSVX5DB.js';
|
|
4
4
|
import '../../chunk-X6DESK37.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-SP6LCCTZ.js';
|
|
6
|
+
import '../../chunk-6B2GNPJP.js';
|
|
6
7
|
import { useUncontrolled } from '../../chunk-PMUCGFY5.js';
|
|
7
8
|
import '../../chunk-BUIHQJGE.js';
|
|
8
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-W3XX7BYT.js';
|
|
9
10
|
import '../../chunk-R5LYFTHA.js';
|
|
10
11
|
import '../../chunk-WYCMIIRR.js';
|
|
11
12
|
import '../../chunk-C6NVU4F7.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/button-select/button-select-data.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/button-select/button-select-data.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAoDA,IAAM,wBAAwB,CAG5B;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA6C;AAC3C,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,eAAA,CAAgD;AAAA,IAC9E,KAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA,EAAY,IAAA;AAAA;AAAA;AAAA,IAGZ,QAAA,EAAU,CAAC,IAAA,KAAS,QAAA,GAAW,IAA+B;AAAA,GAC/D,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU,KAAA;AAAA,MACV,YAAA,EAAc,QAAQ,YAAY,CAAA;AAAA,MAClC,OAAO,QAAA,IAAY,IAAA,GAAO,EAAC,GAAI,CAAC,QAAQ,CAAA;AAAA,MAGxC,eAAe,CAAC,IAAA,KAAS,YAAa,IAAA,CAAK,CAAC,KAAK,IAAuC,CAAA;AAAA,MACxF,UAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAA;AAWO,IAAM,YAAA,GAAe,OAAO,MAAA,CAAO,qBAAA,EAAuB,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS","file":"index.js","sourcesContent":["\"use client\"\n\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Context, Item, Root } from \"./button-select\"\nimport { type ButtonSelectBaseProps, ButtonSelectControl } from \"./button-select-control\"\nimport type {\n ButtonSelectData,\n ButtonSelectValue,\n RenderButtonSelectItem,\n} from \"./button-select-items\"\n\n/**\n * ButtonSelect — pick one value from a row of joined `Button`s. The selected\n * item flips to `selectedVariant` (default `filled`), the rest stay in `variant`\n * (default `light`). Reach for it over `SegmentGroup` when the options want to\n * look like buttons — icons, per-item colors, toolbar-style rows — and over\n * `Select` when the set is small enough to show all at once.\n *\n * - `data` takes bare strings or `{ value, label?, startSlot?, endSlot?,\n * disabled?, color?, payload? }` objects. The component is generic over it, so\n * `value` / `onChange` narrow to the literal value union and `payload` flows,\n * typed, into `renderItem`.\n * - Radio-like by default: clicking the selected item keeps it. `deselectable`\n * lets it clear, and only then does `onChange` receive `null` — at the type\n * level too.\n * - Label / description / error / required come from the built-in `Field`;\n * `name` submits the value through a hidden input.\n *\n * For several values at once, see `ButtonMultiSelect`.\n */\nexport type ButtonSelectProps<\n Data extends ButtonSelectData = ButtonSelectData,\n Deselectable extends boolean = false,\n> = ButtonSelectBaseProps<Data> & {\n /** Controlled value. `null` clears the selection. */\n value?: ButtonSelectValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: ButtonSelectValue<Data> | null\n /** Clicking the selected item clears the selection. */\n deselectable?: Deselectable\n /**\n * Fires with the selected value. It can only be `null` when `deselectable` is\n * set: `[D] extends [false]` keeps an unresolved `boolean` on the nullable\n * side, the safe direction.\n */\n onChange?: (\n value: [Deselectable] extends [false]\n ? ButtonSelectValue<Data>\n : ButtonSelectValue<Data> | null,\n ) => void\n}\n\nconst ButtonSelectComponent = <\n const Data extends ButtonSelectData = ButtonSelectData,\n Deselectable extends boolean = false,\n>({\n value,\n defaultValue,\n onChange,\n deselectable,\n renderItem,\n ...rest\n}: ButtonSelectProps<Data, Deselectable>) => {\n const [selected, setSelected] = useUncontrolled<ButtonSelectValue<Data> | null>({\n value,\n defaultValue,\n finalValue: null,\n // `null` only ever comes out of the machine when `deselectable` is on, which\n // is exactly when the callback's parameter type admits it.\n onChange: (next) => onChange?.(next as ButtonSelectValue<Data>),\n })\n\n return (\n <ButtonSelectControl\n multiple={false}\n deselectable={Boolean(deselectable)}\n value={selected == null ? [] : [selected]}\n // The machine's values are `string`s that always originate from `data`,\n // so they narrow back to the caller's union.\n onValueChange={(next) => setSelected((next[0] ?? null) as ButtonSelectValue<Data> | null)}\n renderItem={renderItem as RenderButtonSelectItem<ButtonSelectData> | undefined}\n {...rest}\n />\n )\n}\n\n/**\n * The public `ButtonSelect` — callable for the data-driven form, with the\n * composable parts attached (like `Tabs`):\n *\n * <ButtonSelect.Root defaultValue=\"week\" variant=\"subtle\" color=\"brand\">\n * <ButtonSelect.Item value=\"day\">Day</ButtonSelect.Item>\n * <ButtonSelect.Item value=\"week\" startSlot={<CalendarIcon />}>Week</ButtonSelect.Item>\n * </ButtonSelect.Root>\n */\nexport const ButtonSelect = Object.assign(ButtonSelectComponent, { Root, Item, Context })\n"]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Calendar } from '../../chunk-
|
|
2
|
+
export { Calendar } from '../../chunk-7BY5I2RB.js';
|
|
3
3
|
import '../../chunk-ZB5VMGKB.js';
|
|
4
4
|
import '../../chunk-IUK7OJXZ.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-B5YHYI7E.js';
|
|
6
|
+
import '../../chunk-6B2GNPJP.js';
|
|
6
7
|
import '../../chunk-LIZWCWED.js';
|
|
7
8
|
import '../../chunk-BUIHQJGE.js';
|
|
8
9
|
import '../../chunk-6YNLRQ25.js';
|
|
9
10
|
import '../../chunk-XXOR34T4.js';
|
|
10
|
-
import '../../chunk-
|
|
11
|
+
import '../../chunk-W3XX7BYT.js';
|
|
11
12
|
import '../../chunk-R5LYFTHA.js';
|
|
12
13
|
import '../../chunk-WYCMIIRR.js';
|
|
13
14
|
import '../../chunk-C6NVU4F7.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Camera, useCamera, useCameraContext } from '../../chunk-
|
|
2
|
+
export { Camera, useCamera, useCameraContext } from '../../chunk-I53TMAV2.js';
|
|
3
3
|
import '../../chunk-HX3LNK26.js';
|
|
4
4
|
import '../../chunk-K6YASO4L.js';
|
|
5
5
|
import '../../chunk-IA6DCC3N.js';
|
|
@@ -10,9 +10,9 @@ import '../../chunk-QRNQQIQM.js';
|
|
|
10
10
|
import '../../chunk-5FDOOG4J.js';
|
|
11
11
|
import '../../chunk-I4B3N3UX.js';
|
|
12
12
|
import '../../chunk-X6DESK37.js';
|
|
13
|
-
import '../../chunk-
|
|
13
|
+
import '../../chunk-KNGSO7A3.js';
|
|
14
14
|
import '../../chunk-SKPM2FRX.js';
|
|
15
|
-
import '../../chunk-
|
|
15
|
+
import '../../chunk-SP6LCCTZ.js';
|
|
16
16
|
import '../../chunk-WG3BCIU4.js';
|
|
17
17
|
import '../../chunk-CQ4M4BSF.js';
|
|
18
18
|
import '../../chunk-HDYORQZN.js';
|
|
@@ -23,13 +23,14 @@ import '../../chunk-RKCUXOU2.js';
|
|
|
23
23
|
import '../../chunk-HWBFRDX7.js';
|
|
24
24
|
import '../../chunk-V6PY7C6S.js';
|
|
25
25
|
import '../../chunk-SLUOF7XW.js';
|
|
26
|
-
import '../../chunk-
|
|
26
|
+
import '../../chunk-B5YHYI7E.js';
|
|
27
|
+
import '../../chunk-6B2GNPJP.js';
|
|
27
28
|
import '../../chunk-LIZWCWED.js';
|
|
28
29
|
import '../../chunk-PMUCGFY5.js';
|
|
29
30
|
import '../../chunk-BUIHQJGE.js';
|
|
30
31
|
import '../../chunk-6YNLRQ25.js';
|
|
31
32
|
import '../../chunk-XXOR34T4.js';
|
|
32
|
-
import '../../chunk-
|
|
33
|
+
import '../../chunk-W3XX7BYT.js';
|
|
33
34
|
import '../../chunk-R5LYFTHA.js';
|
|
34
35
|
import '../../chunk-WYCMIIRR.js';
|
|
35
36
|
import '../../chunk-C6NVU4F7.js';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { InputBase, inputControlClasses } from '../../chunk-I4B3N3UX.js';
|
|
3
3
|
import '../../chunk-X6DESK37.js';
|
|
4
|
-
import { ActionIcon } from '../../chunk-
|
|
4
|
+
import { ActionIcon } from '../../chunk-B5YHYI7E.js';
|
|
5
|
+
import '../../chunk-6B2GNPJP.js';
|
|
5
6
|
import { mergeIcons, iconStroke } from '../../chunk-XXOR34T4.js';
|
|
6
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-W3XX7BYT.js';
|
|
7
8
|
import { composeChildren } from '../../chunk-R5LYFTHA.js';
|
|
8
9
|
import { props } from '../../chunk-WYCMIIRR.js';
|
|
9
10
|
import '../../chunk-C6NVU4F7.js';
|