gridsmith-ui 0.31.0 → 0.32.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/CHANGELOG.md +64 -1
- package/dist/charts.d.ts +101 -30
- package/dist/charts.js +181 -106
- package/dist/charts.js.map +1 -1
- package/dist/chat.js +6 -6
- package/dist/{chunk-OWQ7M6R7.js → chunk-2724SJO2.js} +141 -24
- package/dist/chunk-2724SJO2.js.map +1 -0
- package/dist/{chunk-BKYWKMUN.js → chunk-DO6DLTFK.js} +11 -9
- package/dist/chunk-DO6DLTFK.js.map +1 -0
- package/dist/{chunk-GP2COVJC.js → chunk-H732QL56.js} +4 -4
- package/dist/{chunk-GP2COVJC.js.map → chunk-H732QL56.js.map} +1 -1
- package/dist/{chunk-XSQD3UGY.js → chunk-HCEHTJ5E.js} +17 -4
- package/dist/chunk-HCEHTJ5E.js.map +1 -0
- package/dist/{chunk-YFHTREH5.js → chunk-HUVZQOU4.js} +5 -5
- package/dist/{chunk-YFHTREH5.js.map → chunk-HUVZQOU4.js.map} +1 -1
- package/dist/{chunk-EKWXPSTI.js → chunk-JHZ22HQP.js} +75 -24
- package/dist/chunk-JHZ22HQP.js.map +1 -0
- package/dist/{chunk-3J67NISC.js → chunk-NGZJK57C.js} +15 -11
- package/dist/chunk-NGZJK57C.js.map +1 -0
- package/dist/{chunk-U7WBI4AV.js → chunk-OVHM55JF.js} +5 -5
- package/dist/{chunk-U7WBI4AV.js.map → chunk-OVHM55JF.js.map} +1 -1
- package/dist/{chunk-OFACAHRV.js → chunk-QY2RA2HO.js} +5 -5
- package/dist/{chunk-OFACAHRV.js.map → chunk-QY2RA2HO.js.map} +1 -1
- package/dist/{chunk-HUNEJIKV.js → chunk-R2IAK3J3.js} +3 -3
- package/dist/{chunk-HUNEJIKV.js.map → chunk-R2IAK3J3.js.map} +1 -1
- package/dist/{chunk-V73LHNRL.js → chunk-RS624TD5.js} +29 -10
- package/dist/chunk-RS624TD5.js.map +1 -0
- package/dist/{chunk-V2ARGHJN.js → chunk-SIEU4H3H.js} +9 -9
- package/dist/chunk-SIEU4H3H.js.map +1 -0
- package/dist/{chunk-DBHVJ7Z3.js → chunk-SS3C24IJ.js} +3 -2
- package/dist/chunk-SS3C24IJ.js.map +1 -0
- package/dist/{chunk-LE72KHIE.js → chunk-TMPPBXX3.js} +3 -3
- package/dist/{chunk-LE72KHIE.js.map → chunk-TMPPBXX3.js.map} +1 -1
- package/dist/{chunk-GT6M74IZ.js → chunk-WSKPESAX.js} +12 -10
- package/dist/chunk-WSKPESAX.js.map +1 -0
- package/dist/{chunk-2Q4HOGEI.js → chunk-XBVZIN26.js} +15 -5
- package/dist/chunk-XBVZIN26.js.map +1 -0
- package/dist/data-grid.js +10 -10
- package/dist/data-grid.js.map +1 -1
- package/dist/editor-mentions.js +2 -2
- package/dist/editor.js +4 -3
- package/dist/editor.js.map +1 -1
- package/dist/index.d.ts +53 -6
- package/dist/index.js +557 -232
- package/dist/index.js.map +1 -1
- package/dist/kanban.js +10 -9
- package/dist/kanban.js.map +1 -1
- package/dist/resizable.d.ts +11 -2
- package/dist/resizable.js +97 -22
- package/dist/resizable.js.map +1 -1
- package/dist/roots.css +2 -2
- package/dist/tokens.css +6 -6
- package/dist/virtualized.js +10 -9
- package/dist/virtualized.js.map +1 -1
- package/dist-static/tokens.css +6 -6
- package/package.json +1 -1
- package/dist/chunk-2Q4HOGEI.js.map +0 -1
- package/dist/chunk-3J67NISC.js.map +0 -1
- package/dist/chunk-BKYWKMUN.js.map +0 -1
- package/dist/chunk-DBHVJ7Z3.js.map +0 -1
- package/dist/chunk-EKWXPSTI.js.map +0 -1
- package/dist/chunk-GT6M74IZ.js.map +0 -1
- package/dist/chunk-OWQ7M6R7.js.map +0 -1
- package/dist/chunk-V2ARGHJN.js.map +0 -1
- package/dist/chunk-V73LHNRL.js.map +0 -1
- package/dist/chunk-XSQD3UGY.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../showcase/src/components/Skeleton.tsx","../../../showcase/src/components/SegmentedControl.tsx","../../../showcase/src/lib/title-text.ts"],"names":["jsx","jsxs"],"mappings":";;;;;;;;AAUA,SAAS,KAAK,EAAE,SAAA,EAAW,KAAA,EAAO,SAAA,EAAW,QAAO,EAA4E;AAC9H,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,MAAA;AAAA,MACT,SAAA,EAAW,EAAA,CAAG,wEAAA,EAA0E,SAAS,CAAA;AAAA,MACjG;AAAA;AAAA,GACF;AAEJ;AAEO,SAAS,QAAA,CAAS,EAAE,OAAA,GAAU,MAAA,EAAQ,QAAQ,CAAA,EAAG,KAAA,EAAO,MAAA,EAAQ,SAAA,EAAU,EAAkB;AACjG,EAAA,IAAI,YAAY,QAAA,EAAU;AACxB,IAAA,uBAAO,GAAA,CAAC,QAAK,SAAA,EAAQ,UAAA,EAAW,WAAsB,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA,EAAO,EAAG,CAAA;AAAA,EAClF;AAEA,EAAA,IAAI,YAAY,QAAA,EAAU;AACxB,IAAA,uBAAO,GAAA,CAAC,QAAK,SAAA,EAAQ,UAAA,EAAW,WAAW,EAAA,CAAG,2CAAA,EAA6C,SAAS,CAAA,EAAG,CAAA;AAAA,EACzG;AAEA,EAAA,IAAI,YAAY,MAAA,EAAQ;AACtB,IAAA,uBACE,IAAA,CAAC,SAAI,SAAA,EAAQ,UAAA,EAAW,WAAW,EAAA,CAAG,cAAA,EAAgB,SAAS,CAAA,EAC7D,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,WAAU,2CAAA,EAA4C,CAAA;AAAA,sBAC5D,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,WAAA,EAAY,CAAA;AAAA,sBAC5B,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,WAAA,EAAY;AAAA,KAAA,EAC9B,CAAA;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AAC,QAAA;AAAA,UAAA;AAAA,YAEC,IAAA,EAAK,QAAA;AAAA,YACL,IAAA,EAAK,OAAA;AAAA,YACL,cAAA,EAAc,IAAI,KAAA,KAAU,KAAA;AAAA,YAC5B,aAAA,EAAa,IAAI,KAAA,KAAU,KAAA;AAAA,YAC3B,cAAY,GAAA,CAAI,KAAA;AAAA,YAChB,QAAA,EAAU,CAAA,KAAM,OAAA,GAAU,CAAA,GAAI,EAAA;AAAA,YAC9B,UAAU,GAAA,CAAI,QAAA;AAAA,YACd,SAAS,MAAM,CAAC,IAAI,QAAA,IAAY,MAAA,CAAO,IAAI,KAAK,CAAA;AAAA,YAChD,YAAA,EAAc,iBAAiB,CAAC,GAAA,CAAI,WAAW,MAAM,aAAA,CAAc,GAAA,CAAI,KAAK,CAAA,GAAI,MAAA;AAAA,YAChF,YAAA,EAAc,aAAA,GAAgB,MAAM,aAAA,CAAc,IAAI,CAAA,GAAI,MAAA;AAAA,YAC1D,SAAA,EAAW,EAAA;AAAA,cACT,kGAAA;AAAA,cACA,SAAA,IAAa,QAAA;AAAA,cACb,oCAAA;AAAA,cACA,kCAAA;AAAA,cACA,UAAA;AAAA,cACA,MAAM,IAAI,CAAA;AAAA,cACV,GAAA,CAAI,KAAA,KAAU,KAAA,GACV,+BAAA,GACA,mEAAA;AAAA,cACJ,IAAI,QAAA,IAAY;AAAA,aAClB;AAAA,YAEC,QAAA,EAAA,GAAA,CAAI;AAAA,WAAA;AAAA,UAxBA,GAAA,CAAI;AAAA,SA0BZ;AAAA;AAAA;AAAA,GACH;AAEJ;;;AChTO,IAAM,UAAA,GAAa","file":"chunk-U7WBI4AV.js","sourcesContent":["import { cn } from \"../lib/utils\";\n\ninterface SkeletonProps {\n variant?: \"text\" | \"avatar\" | \"card\" | \"table-row\" | \"custom\";\n lines?: number;\n width?: string;\n height?: string;\n className?: string;\n}\n\nfunction Bone({ className, style, \"data-gs\": marker }: { className?: string; style?: React.CSSProperties; \"data-gs\"?: string }) {\n return (\n <div\n data-gs={marker}\n className={cn(\"rounded-[var(--ds-radius-sm)] bg-[var(--ds-bg-emphasis)] animate-pulse\", className)}\n style={style}\n />\n );\n}\n\nexport function Skeleton({ variant = \"text\", lines = 3, width, height, className }: SkeletonProps) {\n if (variant === \"custom\") {\n return <Bone data-gs=\"skeleton\" className={className} style={{ width, height }} />;\n }\n\n if (variant === \"avatar\") {\n return <Bone data-gs=\"skeleton\" className={cn(\"h-10 w-10 rounded-[var(--ds-radius-full)]\", className)} />;\n }\n\n if (variant === \"card\") {\n return (\n <div data-gs=\"skeleton\" className={cn(\"space-y-ds-3\", className)}>\n <Bone className=\"h-32 w-full rounded-[var(--ds-radius-md)]\" />\n <Bone className=\"h-4 w-3/4\" />\n <Bone className=\"h-4 w-1/2\" />\n </div>\n );\n }\n\n if (variant === \"table-row\") {\n return (\n <div data-gs=\"skeleton\" className={cn(\"flex gap-ds-4\", className)}>\n <Bone className=\"h-4 flex-[3]\" />\n <Bone className=\"h-4 flex-[2]\" />\n <Bone className=\"h-4 flex-1\" />\n <Bone className=\"h-4 flex-1\" />\n </div>\n );\n }\n\n // text variant\n const widths = [\"w-3/4\", \"w-1/2\", \"w-5/6\", \"w-2/3\", \"w-4/5\"];\n return (\n <div data-gs=\"skeleton\" className={cn(\"space-y-ds-3\", className)}>\n {Array.from({ length: lines }, (_, i) => (\n <Bone key={i} className={cn(\"h-4\", widths[i % widths.length])} />\n ))}\n </div>\n );\n}\n","import { useRef, useState, useLayoutEffect, useEffect, useCallback, useContext } from \"react\";\nimport { cn, FOCUS_RING } from \"../lib/utils\";\nimport { rovingTabStop } from \"../lib/focus\";\nimport { Dropdown } from \"./Dropdown\";\nimport { ControlSizeContext } from \"./Button\";\nimport { useFieldControl, type FieldControlWiring } from \"./Field\";\nimport { useReportedChange } from \"../lib/form-context\";\n\ninterface SegmentedControlOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ntype SegmentedControlSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\ninterface SegmentedControlProps extends FieldControlWiring {\n value: string;\n onChange: (value: string) => void;\n options: SegmentedControlOption[];\n /** xs is for dense tool chrome (toolbars, inspectors): 24px tall. */\n size?: SegmentedControlSize;\n variant?: \"default\" | \"ghost\";\n /** Stretch to the container and share the width equally between options. */\n fullWidth?: boolean;\n /**\n * Called with an option's value while the pointer is over it and with null\n * when it leaves, so a picker can preview a choice before committing it.\n */\n onHoverChange?: (value: string | null) => void;\n className?: string;\n /**\n * Accessible name for the radiogroup, for when there is no visible label (e.g. in a toolbar). A control with a visible\n * label sits in a Field instead, which names it and stacks the label above: `<Field label=\"Status\"><SegmentedControl …/></Field>`.\n */\n \"aria-label\"?: string;\n /**\n * Above this many options the control renders a Dropdown with the same value, onChange and options — a row of\n * eleven segments runs off the page (bench round 3). Default 6; raise it only where the row is known to fit. A row\n * that does not fit its container (a four-option range on a phone) renders the Dropdown too, and comes back as a\n * row when the container widens (round 10).\n */\n maxOptions?: number;\n}\n\n/** The options as one string, so the fit re-measures when the labels change. */\nfunction optionsKeyForFit(options: SegmentedControlOption[]): string { return options.map((o) => `${o.value}:${o.label}`).join(\"|\"); }\n\n// Option padding is part of the size (tailwind-merge cannot resolve two ds-\n// spacing classes against each other, so it is not appended as an override).\nconst sizes: Record<SegmentedControlSize, string> = {\n xs: \"text-xs px-ds-2\",\n sm: \"text-xs px-ds-3\",\n md: \"text-sm px-ds-3\",\n lg: \"text-base px-ds-3\",\n};\n\n// xs uses a 2px inset so the whole control stays 24px tall.\nconst containerPadding: Record<SegmentedControlSize, string> = {\n xs: \"p-[2px] gap-[2px]\",\n sm: \"p-ds-1 gap-ds-0.5\",\n md: \"p-ds-1 gap-ds-0.5\",\n lg: \"p-ds-1 gap-ds-0.5\",\n};\n\nconst indicatorInset: Record<SegmentedControlSize, string> = {\n xs: \"2px\",\n sm: \"4px\",\n md: \"4px\",\n lg: \"4px\",\n};\n\n/**\n * The segments' corner: the frame's (a field's, --ds-radius-md) less the gap between the two edges, the selected\n * segment's inset and the frame's border when it draws one, so the curves sit evenly inside each other; never sharper\n * than the theme's small radius, so on a theme of small corners the segments stay slightly rounded, not square (a\n * square theme stays square).\n */\nfunction segmentRadius(inset: string, bordered: boolean): string {\n return `max(var(--ds-radius-sm), calc(var(--ds-radius-md) - ${inset}${bordered ? \" - var(--ds-border-width)\" : \"\"}))`;\n}\n\nexport function SegmentedControl({\n value,\n onChange: onChangeProp,\n options,\n size: sizeProp,\n variant = \"default\",\n fullWidth = false,\n onHoverChange,\n className,\n \"aria-label\": ariaLabel,\n maxOptions = 6,\n ...wiring\n}: SegmentedControlProps) {\n // Sprint 25.12 A15: a new value the user gives this control marks the form's overlay; the page's onChange runs as given\n const onChange = useReportedChange(onChangeProp, value);\n const contextSize = useContext(ControlSizeContext);\n // Inside a Field it takes the Field's label (round 27, R27-10): a radio group is named by aria-labelledby, since\n // <label for> cannot name it, and the Field stacks its label above. It takes the Field's id, hint, error and\n // required state too (round 27 review: without them the summary had no link and focus skipped it); a radio group\n // carries aria-invalid and aria-required itself. As a Dropdown, the Dropdown reads the same Field. The name follows the\n // one rule (useFieldControl; the final review of Sprint 25.31, 2): the Field's label on screen leads it, where a\n // page's aria-label won before (\"Calendar view\" over \"View\"), and a page's name beside it is left out, with a warning\n const control = useFieldControl({ ...wiring, \"aria-label\": ariaLabel }, { component: \"SegmentedControl\" });\n // as a Dropdown, only the names the rule left: the page gave them to this control, not to a Dropdown, which would warn\n const { \"aria-labelledby\": _pageLabelledBy, ...dropdownWiring } = wiring;\n const size: SegmentedControlSize = sizeProp ?? (contextSize as SegmentedControlSize | null) ?? \"md\";\n const containerRef = useRef<HTMLDivElement>(null);\n const [indicator, setIndicator] = useState({ left: 0, width: 0 });\n\n // Round 10 (the owner's review of the analytics overview on a phone): a row that does not fit its container renders\n // the Dropdown too, not only a row of too many options. The row's natural width is remembered from the last time\n // it was laid out; the container (the filters row, the toolbar) is observed in both states, so the row comes back\n // when the container widens. 8 px of hysteresis keeps a row sitting on the edge from flapping.\n const parentRef = useRef<HTMLElement | null>(null);\n const neededRef = useRef(0);\n const [overflows, setOverflows] = useState(false);\n const measureFit = useCallback(() => {\n const row = containerRef.current;\n if (row) {\n parentRef.current = row.parentElement;\n if (row.scrollWidth > 0) neededRef.current = row.scrollWidth;\n }\n const parent = parentRef.current;\n const needed = neededRef.current;\n if (!parent || !needed) return;\n const style = getComputedStyle(parent);\n const available = parent.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0);\n if (available <= 0) return;\n setOverflows((prev) => (prev ? needed > available - 8 : needed > available));\n }, []);\n useLayoutEffect(() => {\n measureFit();\n const parent = parentRef.current;\n if (!parent || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measureFit);\n observer.observe(parent);\n return () => observer.disconnect();\n }, [measureFit, optionsKeyForFit(options)]); // eslint-disable-line react-hooks/exhaustive-deps\n const collapsed = options.length > maxOptions || overflows;\n\n const updateIndicator = useCallback(() => {\n if (!containerRef.current) return;\n const active = containerRef.current.querySelector<HTMLElement>(\"[data-active='true']\");\n if (active) {\n setIndicator({\n left: active.offsetLeft,\n width: active.offsetWidth,\n });\n }\n }, []);\n\n // The option set can change under the control (a configurator hiding an\n // option), which moves the active segment without changing `value`: re-measure\n // on that too, and watch every segment, not just the container, so a label\n // that changes width also moves the thumb.\n const optionsKey = options.map((o) => `${o.value}:${o.label}`).join(\"|\");\n useLayoutEffect(() => {\n updateIndicator();\n }, [value, optionsKey, updateIndicator]);\n\n // The web font can land after the first measurement and widen the segments (round 5: the thumb was caught\n // mid-slide on every load). Re-measure when the fonts are ready, and animate only after the user's first change:\n // the initial position and the font re-measure snap into place.\n useEffect(() => {\n const fonts = (document as Document & { fonts?: { ready?: Promise<unknown> } }).fonts;\n if (!fonts?.ready) return;\n let live = true;\n fonts.ready.then(() => { if (live) updateIndicator(); });\n return () => { live = false; };\n }, [updateIndicator]);\n const [animate, setAnimate] = useState(false);\n const select = useCallback((v: string) => { setAnimate(true); onChange(v); }, [onChange]);\n\n useLayoutEffect(() => {\n if (collapsed || !containerRef.current || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(updateIndicator);\n observer.observe(containerRef.current);\n containerRef.current.querySelectorAll<HTMLElement>(\"button\").forEach((b) => observer.observe(b));\n return () => observer.disconnect();\n }, [updateIndicator, optionsKey, collapsed]);\n\n const containerHeight: Record<SegmentedControlSize, string> = {\n xs: \"h-ds-6\",\n sm: \"h-[var(--ds-control-height-sm)]\",\n md: \"h-[var(--ds-control-height-md)]\",\n lg: \"h-[var(--ds-control-height-lg)]\",\n };\n\n // Radio-group keyboard pattern: one tab stop (the checked option, or the\n // first enabled one when nothing is checked), arrows move selection between\n // enabled options, Home/End jump to the ends.\n const tabStop = rovingTabStop(options, (o) => o.value === value, (o) => !!o.disabled);\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n const enabled = options.filter((o) => !o.disabled);\n if (enabled.length === 0) return;\n const idx = Math.max(0, enabled.findIndex((o) => o.value === value));\n let next: number | null = null;\n if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") next = (idx + 1) % enabled.length;\n else if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") next = (idx - 1 + enabled.length) % enabled.length;\n else if (e.key === \"Home\") next = 0;\n else if (e.key === \"End\") next = enabled.length - 1;\n if (next === null) return;\n e.preventDefault();\n select(enabled[next].value);\n const buttons = containerRef.current?.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]');\n buttons?.forEach((b) => { if (b.dataset.value === enabled[next!].value) b.focus(); });\n };\n\n if (collapsed) {\n return (\n <Dropdown\n {...dropdownWiring}\n aria-label={control.shown ? undefined : control.label}\n aria-labelledby={control.shown ? undefined : wiring[\"aria-labelledby\"]}\n size={size === \"md\" || size === \"lg\" ? \"md\" : \"sm\"}\n options={options.filter((o) => !o.disabled).map((o) => ({ id: o.value, label: o.label }))}\n value={value}\n onChange={(v) => onChange(v as string)}\n className={cn(\"inline-block\", fullWidth ? \"w-full\" : \"w-auto\", className)}\n />\n );\n }\n\n return (\n <div\n ref={containerRef}\n role=\"radiogroup\"\n id={control.id}\n aria-label={control.labelId ? undefined : control.label}\n aria-labelledby={control.labelId}\n aria-describedby={control.describedBy}\n aria-invalid={control.invalid || undefined}\n aria-required={control.required || undefined}\n onKeyDown={handleKeyDown}\n className={cn(\n \"relative items-center\",\n // Sprint 25.14 A21: in a Field's column a track that isn't full width keeps its own width; w-fit, not self-start,\n // so a row or a centred column still aligns it (the review of 30 September)\n fullWidth ? \"flex w-full\" : \"inline-flex w-fit\",\n containerPadding[size],\n containerHeight[size],\n \"bg-[var(--ds-bg-muted)]\",\n // The owner's review of 1 October 2026: the frame's corner is a field's, so the two change together with the\n // theme's radius; the segments inside sit concentric with it (SEGMENT_RADIUS)\n \"rounded-[var(--ds-radius-md)]\",\n // The frame's edge is a button's: each segment is a labelled button, so the frame isn't what identifies the\n // control, and WCAG 1.4.11 asks no 3:1 of it\n variant === \"default\" && \"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]\",\n control.invalid && \"border-[length:var(--ds-border-width)] border-[var(--ds-status-error)]\",\n className,\n )}\n style={{ \"--ds-segment-radius\": segmentRadius(indicatorInset[size], variant === \"default\" || !!control.invalid) } as React.CSSProperties}\n >\n <div\n className={cn(\n \"absolute rounded-[var(--ds-segment-radius)]\",\n \"bg-[var(--ds-bg-surface)]\",\n // The selected segment is a kind of button, so it takes a secondary button's surface and edge, as the frame\n // takes a button's edge (the owner, 3 October 2026: the 3:1 strong edge it kept from Sprint 25.14 drew the\n // darker outline 25.19 took off the fields). It shows its state as the raised surface on the muted track, with\n // the default variant's shadow and its label's stronger colour. While its segment has keyboard focus the shadow\n // steps aside, as a button's does, so the segment's outline sits clear (Sprint 30, D7)\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]\",\n variant === \"default\" && \"shadow-[var(--ds-shadow-sm)]\",\n \"[[role=radiogroup]:has([aria-checked=true]:focus-visible)_&]:shadow-none\",\n \"transition-all motion-reduce:transition-none\",\n )}\n data-animate={animate ? \"true\" : \"false\"}\n style={{\n left: indicator.left,\n width: indicator.width,\n top: indicatorInset[size],\n bottom: indicatorInset[size],\n transitionDuration: animate ? \"var(--ds-transition-speed)\" : \"0ms\",\n transitionTimingFunction: \"var(--ds-transition-ease)\",\n }}\n />\n {options.map((opt, i) => (\n <button\n key={opt.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={opt.value === value}\n data-active={opt.value === value}\n data-value={opt.value}\n tabIndex={i === tabStop ? 0 : -1}\n disabled={opt.disabled}\n onClick={() => !opt.disabled && select(opt.value)}\n onMouseEnter={onHoverChange && !opt.disabled ? () => onHoverChange(opt.value) : undefined}\n onMouseLeave={onHoverChange ? () => onHoverChange(null) : undefined}\n className={cn(\n \"relative z-10 inline-flex items-center justify-center self-stretch font-medium whitespace-nowrap\",\n fullWidth && \"flex-1\",\n \"rounded-[var(--ds-segment-radius)]\",\n \"transition-colors cursor-pointer\",\n FOCUS_RING,\n sizes[size],\n opt.value === value\n ? \"text-[var(--ds-text-primary)]\"\n : \"text-[var(--ds-text-muted)] hover:text-[var(--ds-text-secondary)]\",\n opt.disabled && \"opacity-disabled cursor-not-allowed\",\n )}\n >\n {opt.label}\n </button>\n ))}\n </div>\n );\n}\n","/**\n * A title's text classes: CardTitle's, which a titled Table's band and a ChartContainer's title share (Sprint 25.9, A1),\n * one definition so they cannot drift. A word or a name longer than its line breaks at the line's edge (round 27,\n * R27-16: run 70's \"primary-logo-navy.svg\" ran out of its card); break-word, not anywhere, so a title's words still\n * set its minimum and the actions beside it wrap under it before a word is broken (HEADER_LAYOUT.floor).\n */\nexport const TITLE_TEXT = \"font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)] break-words\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../showcase/src/components/Skeleton.tsx","../../../showcase/src/components/SegmentedControl.tsx","../../../showcase/src/lib/title-text.ts"],"names":["jsx","jsxs"],"mappings":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,KAAA,KAAU,KAAA;AAAA,YAC5B,aAAA,EAAa,IAAI,KAAA,KAAU,KAAA;AAAA,YAC3B,cAAY,GAAA,CAAI,KAAA;AAAA,YAChB,QAAA,EAAU,CAAA,KAAM,OAAA,GAAU,CAAA,GAAI,EAAA;AAAA,YAC9B,UAAU,GAAA,CAAI,QAAA;AAAA,YACd,SAAS,MAAM,CAAC,IAAI,QAAA,IAAY,MAAA,CAAO,IAAI,KAAK,CAAA;AAAA,YAChD,YAAA,EAAc,iBAAiB,CAAC,GAAA,CAAI,WAAW,MAAM,aAAA,CAAc,GAAA,CAAI,KAAK,CAAA,GAAI,MAAA;AAAA,YAChF,YAAA,EAAc,aAAA,GAAgB,MAAM,aAAA,CAAc,IAAI,CAAA,GAAI,MAAA;AAAA,YAC1D,SAAA,EAAW,EAAA;AAAA,cACT,kGAAA;AAAA,cACA,SAAA,IAAa,QAAA;AAAA,cACb,oCAAA;AAAA,cACA,kCAAA;AAAA,cACA,UAAA;AAAA,cACA,MAAM,IAAI,CAAA;AAAA,cACV,GAAA,CAAI,KAAA,KAAU,KAAA,GACV,+BAAA,GACA,mEAAA;AAAA,cACJ,IAAI,QAAA,IAAY;AAAA,aAClB;AAAA,YAEC,QAAA,EAAA,GAAA,CAAI;AAAA,WAAA;AAAA,UAxBA,GAAA,CAAI;AAAA,SA0BZ;AAAA;AAAA;AAAA,GACH;AAEJ;;;AChTO,IAAM,UAAA,GAAa","file":"chunk-OVHM55JF.js","sourcesContent":["import { cn } from \"../lib/utils\";\n\ninterface SkeletonProps {\n variant?: \"text\" | \"avatar\" | \"card\" | \"table-row\" | \"custom\";\n lines?: number;\n width?: string;\n height?: string;\n className?: string;\n}\n\nfunction Bone({ className, style, \"data-gs\": marker }: { className?: string; style?: React.CSSProperties; \"data-gs\"?: string }) {\n return (\n <div\n data-gs={marker}\n className={cn(\"rounded-[var(--ds-radius-sm)] bg-[var(--ds-bg-emphasis)] animate-pulse\", className)}\n style={style}\n />\n );\n}\n\nexport function Skeleton({ variant = \"text\", lines = 3, width, height, className }: SkeletonProps) {\n if (variant === \"custom\") {\n return <Bone data-gs=\"skeleton\" className={className} style={{ width, height }} />;\n }\n\n if (variant === \"avatar\") {\n return <Bone data-gs=\"skeleton\" className={cn(\"h-10 w-10 rounded-[var(--ds-radius-full)]\", className)} />;\n }\n\n if (variant === \"card\") {\n return (\n <div data-gs=\"skeleton\" className={cn(\"space-y-ds-3\", className)}>\n <Bone className=\"h-32 w-full rounded-[var(--ds-radius-md)]\" />\n <Bone className=\"h-4 w-3/4\" />\n <Bone className=\"h-4 w-1/2\" />\n </div>\n );\n }\n\n if (variant === \"table-row\") {\n return (\n <div data-gs=\"skeleton\" className={cn(\"flex gap-ds-4\", className)}>\n <Bone className=\"h-4 flex-[3]\" />\n <Bone className=\"h-4 flex-[2]\" />\n <Bone className=\"h-4 flex-1\" />\n <Bone className=\"h-4 flex-1\" />\n </div>\n );\n }\n\n // text variant\n const widths = [\"w-3/4\", \"w-1/2\", \"w-5/6\", \"w-2/3\", \"w-4/5\"];\n return (\n <div data-gs=\"skeleton\" className={cn(\"space-y-ds-3\", className)}>\n {Array.from({ length: lines }, (_, i) => (\n <Bone key={i} className={cn(\"h-4\", widths[i % widths.length])} />\n ))}\n </div>\n );\n}\n","import { useRef, useState, useLayoutEffect, useEffect, useCallback, useContext } from \"react\";\nimport { cn, FOCUS_RING } from \"../lib/utils\";\nimport { rovingTabStop } from \"../lib/focus\";\nimport { Dropdown } from \"./Dropdown\";\nimport { ControlSizeContext } from \"./Button\";\nimport { useFieldControl, type FieldControlWiring } from \"./Field\";\nimport { useReportedChange } from \"../lib/form-context\";\n\ninterface SegmentedControlOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ntype SegmentedControlSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\ninterface SegmentedControlProps extends FieldControlWiring {\n value: string;\n onChange: (value: string) => void;\n options: SegmentedControlOption[];\n /** xs is for dense tool chrome (toolbars, inspectors): 24px tall. */\n size?: SegmentedControlSize;\n variant?: \"default\" | \"ghost\";\n /** Stretch to the container and share the width equally between options. */\n fullWidth?: boolean;\n /**\n * Called with an option's value while the pointer is over it and with null\n * when it leaves, so a picker can preview a choice before committing it.\n */\n onHoverChange?: (value: string | null) => void;\n className?: string;\n /**\n * Accessible name for the radiogroup, for when there is no visible label (e.g. in a toolbar). A control with a visible\n * label sits in a Field instead, which names it and stacks the label above: `<Field label=\"Status\"><SegmentedControl …/></Field>`.\n */\n \"aria-label\"?: string;\n /**\n * Above this many options the control renders a Dropdown with the same value, onChange and options — a row of\n * eleven segments runs off the page (bench round 3). Default 6; raise it only where the row is known to fit. A row\n * that does not fit its container (a four-option range on a phone) renders the Dropdown too, and comes back as a\n * row when the container widens (round 10).\n */\n maxOptions?: number;\n}\n\n/** The options as one string, so the fit re-measures when the labels change. */\nfunction optionsKeyForFit(options: SegmentedControlOption[]): string { return options.map((o) => `${o.value}:${o.label}`).join(\"|\"); }\n\n// Option padding is part of the size (tailwind-merge cannot resolve two ds-\n// spacing classes against each other, so it is not appended as an override).\nconst sizes: Record<SegmentedControlSize, string> = {\n xs: \"text-xs px-ds-2\",\n sm: \"text-xs px-ds-3\",\n md: \"text-sm px-ds-3\",\n lg: \"text-base px-ds-3\",\n};\n\n// xs uses a 2px inset so the whole control stays 24px tall.\nconst containerPadding: Record<SegmentedControlSize, string> = {\n xs: \"p-[2px] gap-[2px]\",\n sm: \"p-ds-1 gap-ds-0.5\",\n md: \"p-ds-1 gap-ds-0.5\",\n lg: \"p-ds-1 gap-ds-0.5\",\n};\n\nconst indicatorInset: Record<SegmentedControlSize, string> = {\n xs: \"2px\",\n sm: \"4px\",\n md: \"4px\",\n lg: \"4px\",\n};\n\n/**\n * The segments' corner: the frame's (a field's, --ds-radius-md) less the gap between the two edges, the selected\n * segment's inset and the frame's border when it draws one, so the curves sit evenly inside each other; never sharper\n * than the theme's small radius, so on a theme of small corners the segments stay slightly rounded, not square (a\n * square theme stays square).\n */\nfunction segmentRadius(inset: string, bordered: boolean): string {\n return `max(var(--ds-radius-sm), calc(var(--ds-radius-md) - ${inset}${bordered ? \" - var(--ds-border-width)\" : \"\"}))`;\n}\n\nexport function SegmentedControl({\n value,\n onChange: onChangeProp,\n options,\n size: sizeProp,\n variant = \"default\",\n fullWidth = false,\n onHoverChange,\n className,\n \"aria-label\": ariaLabel,\n maxOptions = 6,\n ...wiring\n}: SegmentedControlProps) {\n // Sprint 25.12 A15: a new value the user gives this control marks the form's overlay; the page's onChange runs as given\n const onChange = useReportedChange(onChangeProp, value);\n const contextSize = useContext(ControlSizeContext);\n // Inside a Field it takes the Field's label (round 27, R27-10): a radio group is named by aria-labelledby, since\n // <label for> cannot name it, and the Field stacks its label above. It takes the Field's id, hint, error and\n // required state too (round 27 review: without them the summary had no link and focus skipped it); a radio group\n // carries aria-invalid and aria-required itself. As a Dropdown, the Dropdown reads the same Field. The name follows the\n // one rule (useFieldControl; the final review of Sprint 25.31, 2): the Field's label on screen leads it, where a\n // page's aria-label won before (\"Calendar view\" over \"View\"), and a page's name beside it is left out, with a warning\n const control = useFieldControl({ ...wiring, \"aria-label\": ariaLabel }, { component: \"SegmentedControl\" });\n // as a Dropdown, only the names the rule left: the page gave them to this control, not to a Dropdown, which would warn\n const { \"aria-labelledby\": _pageLabelledBy, ...dropdownWiring } = wiring;\n const size: SegmentedControlSize = sizeProp ?? (contextSize as SegmentedControlSize | null) ?? \"md\";\n const containerRef = useRef<HTMLDivElement>(null);\n const [indicator, setIndicator] = useState({ left: 0, width: 0 });\n\n // Round 10 (the owner's review of the analytics overview on a phone): a row that does not fit its container renders\n // the Dropdown too, not only a row of too many options. The row's natural width is remembered from the last time\n // it was laid out; the container (the filters row, the toolbar) is observed in both states, so the row comes back\n // when the container widens. 8 px of hysteresis keeps a row sitting on the edge from flapping.\n const parentRef = useRef<HTMLElement | null>(null);\n const neededRef = useRef(0);\n const [overflows, setOverflows] = useState(false);\n const measureFit = useCallback(() => {\n const row = containerRef.current;\n if (row) {\n parentRef.current = row.parentElement;\n if (row.scrollWidth > 0) neededRef.current = row.scrollWidth;\n }\n const parent = parentRef.current;\n const needed = neededRef.current;\n if (!parent || !needed) return;\n const style = getComputedStyle(parent);\n const available = parent.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0);\n if (available <= 0) return;\n setOverflows((prev) => (prev ? needed > available - 8 : needed > available));\n }, []);\n useLayoutEffect(() => {\n measureFit();\n const parent = parentRef.current;\n if (!parent || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measureFit);\n observer.observe(parent);\n return () => observer.disconnect();\n }, [measureFit, optionsKeyForFit(options)]); // eslint-disable-line react-hooks/exhaustive-deps\n const collapsed = options.length > maxOptions || overflows;\n\n const updateIndicator = useCallback(() => {\n if (!containerRef.current) return;\n const active = containerRef.current.querySelector<HTMLElement>(\"[data-active='true']\");\n if (active) {\n setIndicator({\n left: active.offsetLeft,\n width: active.offsetWidth,\n });\n }\n }, []);\n\n // The option set can change under the control (a configurator hiding an\n // option), which moves the active segment without changing `value`: re-measure\n // on that too, and watch every segment, not just the container, so a label\n // that changes width also moves the thumb.\n const optionsKey = options.map((o) => `${o.value}:${o.label}`).join(\"|\");\n useLayoutEffect(() => {\n updateIndicator();\n }, [value, optionsKey, updateIndicator]);\n\n // The web font can land after the first measurement and widen the segments (round 5: the thumb was caught\n // mid-slide on every load). Re-measure when the fonts are ready, and animate only after the user's first change:\n // the initial position and the font re-measure snap into place.\n useEffect(() => {\n const fonts = (document as Document & { fonts?: { ready?: Promise<unknown> } }).fonts;\n if (!fonts?.ready) return;\n let live = true;\n fonts.ready.then(() => { if (live) updateIndicator(); });\n return () => { live = false; };\n }, [updateIndicator]);\n const [animate, setAnimate] = useState(false);\n const select = useCallback((v: string) => { setAnimate(true); onChange(v); }, [onChange]);\n\n useLayoutEffect(() => {\n if (collapsed || !containerRef.current || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(updateIndicator);\n observer.observe(containerRef.current);\n containerRef.current.querySelectorAll<HTMLElement>(\"button\").forEach((b) => observer.observe(b));\n return () => observer.disconnect();\n }, [updateIndicator, optionsKey, collapsed]);\n\n const containerHeight: Record<SegmentedControlSize, string> = {\n xs: \"h-ds-6\",\n sm: \"h-[var(--ds-control-height-sm)]\",\n md: \"h-[var(--ds-control-height-md)]\",\n lg: \"h-[var(--ds-control-height-lg)]\",\n };\n\n // Radio-group keyboard pattern: one tab stop (the checked option, or the\n // first enabled one when nothing is checked), arrows move selection between\n // enabled options, Home/End jump to the ends.\n const tabStop = rovingTabStop(options, (o) => o.value === value, (o) => !!o.disabled);\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n const enabled = options.filter((o) => !o.disabled);\n if (enabled.length === 0) return;\n const idx = Math.max(0, enabled.findIndex((o) => o.value === value));\n let next: number | null = null;\n if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") next = (idx + 1) % enabled.length;\n else if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") next = (idx - 1 + enabled.length) % enabled.length;\n else if (e.key === \"Home\") next = 0;\n else if (e.key === \"End\") next = enabled.length - 1;\n if (next === null) return;\n e.preventDefault();\n select(enabled[next].value);\n const buttons = containerRef.current?.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]');\n buttons?.forEach((b) => { if (b.dataset.value === enabled[next!].value) b.focus(); });\n };\n\n if (collapsed) {\n return (\n <Dropdown\n {...dropdownWiring}\n aria-label={control.shown ? undefined : control.label}\n aria-labelledby={control.shown ? undefined : wiring[\"aria-labelledby\"]}\n size={size === \"md\" || size === \"lg\" ? \"md\" : \"sm\"}\n options={options.filter((o) => !o.disabled).map((o) => ({ id: o.value, label: o.label }))}\n value={value}\n onChange={(v) => onChange(v as string)}\n className={cn(\"inline-block\", fullWidth ? \"w-full\" : \"w-auto\", className)}\n />\n );\n }\n\n return (\n <div\n ref={containerRef}\n role=\"radiogroup\"\n id={control.id}\n aria-label={control.labelId ? undefined : control.label}\n aria-labelledby={control.labelId}\n aria-describedby={control.describedBy}\n aria-invalid={control.invalid || undefined}\n aria-required={control.required || undefined}\n onKeyDown={handleKeyDown}\n className={cn(\n \"relative items-center\",\n // Sprint 25.14 A21: in a Field's column a track that isn't full width keeps its own width; w-fit, not self-start,\n // so a row or a centred column still aligns it (the review of 30 September)\n fullWidth ? \"flex w-full\" : \"inline-flex w-fit\",\n containerPadding[size],\n containerHeight[size],\n \"bg-[var(--ds-bg-muted)]\",\n // The owner's review of 1 October 2026: the frame's corner is a field's, so the two change together with the\n // theme's radius; the segments inside sit concentric with it (SEGMENT_RADIUS)\n \"rounded-[var(--ds-radius-md)]\",\n // The frame's edge is a button's: each segment is a labelled button, so the frame isn't what identifies the\n // control, and WCAG 1.4.11 asks no 3:1 of it\n variant === \"default\" && \"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]\",\n control.invalid && \"border-[length:var(--ds-border-width)] border-[var(--ds-status-error)]\",\n className,\n )}\n style={{ \"--ds-segment-radius\": segmentRadius(indicatorInset[size], variant === \"default\" || !!control.invalid) } as React.CSSProperties}\n >\n <div\n className={cn(\n \"absolute rounded-[var(--ds-segment-radius)]\",\n \"bg-[var(--ds-bg-surface)]\",\n // The selected segment is a kind of button, so it takes a secondary button's surface and edge, as the frame\n // takes a button's edge (the owner, 3 October 2026: the 3:1 strong edge it kept from Sprint 25.14 drew the\n // darker outline 25.19 took off the fields). It shows its state as the raised surface on the muted track, with\n // the default variant's shadow and its label's stronger colour. While its segment has keyboard focus the shadow\n // steps aside, as a button's does, so the segment's outline sits clear (Sprint 30, D7)\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]\",\n variant === \"default\" && \"shadow-[var(--ds-shadow-sm)]\",\n \"[[role=radiogroup]:has([aria-checked=true]:focus-visible)_&]:shadow-none\",\n \"transition-all motion-reduce:transition-none\",\n )}\n data-animate={animate ? \"true\" : \"false\"}\n style={{\n left: indicator.left,\n width: indicator.width,\n top: indicatorInset[size],\n bottom: indicatorInset[size],\n transitionDuration: animate ? \"var(--ds-transition-speed)\" : \"0ms\",\n transitionTimingFunction: \"var(--ds-transition-ease)\",\n }}\n />\n {options.map((opt, i) => (\n <button\n key={opt.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={opt.value === value}\n data-active={opt.value === value}\n data-value={opt.value}\n tabIndex={i === tabStop ? 0 : -1}\n disabled={opt.disabled}\n onClick={() => !opt.disabled && select(opt.value)}\n onMouseEnter={onHoverChange && !opt.disabled ? () => onHoverChange(opt.value) : undefined}\n onMouseLeave={onHoverChange ? () => onHoverChange(null) : undefined}\n className={cn(\n \"relative z-10 inline-flex items-center justify-center self-stretch font-medium whitespace-nowrap\",\n fullWidth && \"flex-1\",\n \"rounded-[var(--ds-segment-radius)]\",\n \"transition-colors cursor-pointer\",\n FOCUS_RING,\n sizes[size],\n opt.value === value\n ? \"text-[var(--ds-text-primary)]\"\n : \"text-[var(--ds-text-muted)] hover:text-[var(--ds-text-secondary)]\",\n opt.disabled && \"opacity-disabled cursor-not-allowed\",\n )}\n >\n {opt.label}\n </button>\n ))}\n </div>\n );\n}\n","/**\n * A title's text classes: CardTitle's, which a titled Table's band and a ChartContainer's title share (Sprint 25.9, A1),\n * one definition so they cannot drift. A word or a name longer than its line breaks at the line's edge (round 27,\n * R27-16: run 70's \"primary-logo-navy.svg\" ran out of its card); break-word, not anywhere, so a title's words still\n * set its minimum and the actions beside it wrap under it before a word is broken (HEADER_LAYOUT.floor).\n */\nexport const TITLE_TEXT = \"font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)] break-words\";\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Badge } from './chunk-
|
|
3
|
-
import { useKeyboardScroll } from './chunk-
|
|
2
|
+
import { Badge } from './chunk-WSKPESAX.js';
|
|
3
|
+
import { useKeyboardScroll } from './chunk-H732QL56.js';
|
|
4
4
|
import { slotIcon, Icon } from './chunk-53F7GVBQ.js';
|
|
5
|
-
import { cn, FOCUS_RING, FOCUS_INSET } from './chunk-
|
|
5
|
+
import { cn, FOCUS_RING, FOCUS_INSET } from './chunk-2724SJO2.js';
|
|
6
6
|
import { forwardRef, useState, useCallback } from 'react';
|
|
7
7
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
@@ -163,5 +163,5 @@ function Divider({
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
export { CodeBlock, Divider, Link };
|
|
166
|
-
//# sourceMappingURL=chunk-
|
|
167
|
-
//# sourceMappingURL=chunk-
|
|
166
|
+
//# sourceMappingURL=chunk-QY2RA2HO.js.map
|
|
167
|
+
//# sourceMappingURL=chunk-QY2RA2HO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../showcase/src/components/CodeBlock.tsx","../../../showcase/src/components/Link.tsx","../../../showcase/src/components/Divider.tsx"],"names":["Link","jsxs","jsx"],"mappings":";;;;;;;;AAoBO,SAAS,SAAA,CAAU;AAAA,EACxB,IAAA;AAAA,EACA,QAAA;AAAA,EACA,eAAA,GAAkB,KAAA;AAAA,EAClB,IAAA;AAAA,EACA,YAAA,EAAc,SAAA;AAAA,EACd;AACF,CAAA,EAAmB;AACjB,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAS,KAAK,CAAA;AAE1C,EAAA,MAAM,UAAA,GAAa,YAAY,YAAY;AACzC,IAAA,IAAI;AACF,MAAA,MAAM,SAAA,CAAU,SAAA,CAAU,SAAA,CAAU,IAAI,CAAA;AACxC,MAAA,SAAA,CAAU,IAAI,CAAA;AACd,MAAA,UAAA,CAAW,MAAM,SAAA,CAAU,KAAK,CAAA,EAAG,GAAI,CAAA;AAAA,IACzC,CAAA,CAAA,MAAQ;AAAA,IAER;AAAA,EACF,CAAA,EAAG,CAAC,IAAI,CAAC,CAAA;AAET,EAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,KAAA,CAAM,IA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;AAAA,QACA,+BAAA;AAAA,QACA;AAAA;AACF;AAAA,GACF;AAEJ","file":"chunk-OFACAHRV.js","sourcesContent":["import { useState, useCallback } from \"react\";\nimport { cn, FOCUS_INSET, FOCUS_RING } from \"../lib/utils\";\nimport { useKeyboardScroll } from \"../lib/use-keyboard-scroll\";\nimport { Icon } from \"../lib/icons\";\nimport { Badge } from \"./Badge\";\n\ninterface CodeBlockProps {\n code: string;\n language?: string;\n showLineNumbers?: boolean;\n /** Wrap long lines instead of scrolling sideways. Default: on for a single-line snippet (a tracking tag, a command), off for multi-line code. */\n wrap?: boolean;\n /**\n * What the code is (\"app.tsx\"): its name while it scrolls sideways, a Tab stop of its own then, so a page of several\n * reads them apart. Default: its language, \"Code: tsx\", else \"Code\".\n */\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport function CodeBlock({\n code,\n language,\n showLineNumbers = false,\n wrap,\n \"aria-label\": ariaLabel,\n className,\n}: CodeBlockProps) {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = useCallback(async () => {\n try {\n await navigator.clipboard.writeText(code);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch {\n /* clipboard not available */\n }\n }, [code]);\n\n const lines = code.split(\"\\n\");\n const wraps = wrap ?? lines.length === 1;\n // code that scrolls sideways, with nothing in it to Tab to: a Tab stop while it scrolls (Sprint 25.30 item 2), named by\n // the page's aria-label, else its language where it has one, so a page of several reads them apart: \"Code: tsx\"\n // (Sprint 25.31 item 8 and the review of 16 October, 7)\n const [scroller, setScroller] = useState<HTMLDivElement | null>(null);\n useKeyboardScroll(scroller, ariaLabel ?? (language ? `Code: ${language}` : \"Code\"), !wraps, false, \"x\");\n const gutterWidth = showLineNumbers ? `${String(lines.length).length + 1}ch` : undefined;\n\n return (\n <div\n className={cn(\n \"relative group\",\n \"bg-[var(--ds-bg-surface)] text-[var(--ds-text-primary)]\",\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"rounded-[var(--ds-radius-md)]\",\n \"shadow-[var(--ds-shadow-sm)]\",\n \"overflow-hidden\",\n className,\n )}\n >\n <div className=\"flex items-center justify-between px-ds-4 py-ds-2 border-b-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)] bg-[var(--ds-bg-muted)]\">\n <div className=\"flex items-center gap-ds-2\">\n {language && <Badge variant=\"outline\" size=\"sm\">{language}</Badge>}\n </div>\n <button\n type=\"button\"\n onClick={handleCopy}\n className={cn(\n \"inline-flex items-center gap-ds-1.5 px-ds-2 py-ds-1 text-xs font-medium cursor-pointer\",\n \"text-[var(--ds-text-muted)] hover:text-[var(--ds-text-primary)]\",\n \"rounded-[var(--ds-radius-sm)]\",\n \"hover:bg-[var(--ds-bg-surface)]\",\n \"transition-colors\",\n FOCUS_RING,\n )}\n aria-label={copied ? \"Copied\" : \"Copy code\"}\n >\n {/* Sprint 25.8.7 item 12: the copy icon, where a folder stood */}\n <Icon name={copied ? \"check\" : \"copy\"} size={14} />\n {copied ? \"Copied\" : \"Copy\"}\n </button>\n </div>\n\n <div ref={setScroller} className={wraps ? undefined : cn(\"overflow-x-auto\", FOCUS_INSET)} data-wrap={wraps ? \"true\" : undefined}>\n <pre className={cn(\"p-ds-4 text-sm leading-relaxed font-[family-name:var(--ds-font-mono)]\", wraps && \"whitespace-pre-wrap break-words\")}>\n <code>\n {lines.map((line, i) => (\n // with line numbers each line is a two-column row, so a wrapped line continues under its text, not under the gutter\n <span key={i} className={showLineNumbers ? \"grid grid-cols-[max-content_1fr]\" : \"block\"}>\n {showLineNumbers && (\n <span\n className=\"text-right text-[var(--ds-text-muted)] select-none mr-ds-4 opacity-50\"\n style={{ width: gutterWidth }}\n >\n {i + 1}\n </span>\n )}\n <span className=\"min-w-0\">{line || \" \"}</span>\n </span>\n ))}\n </code>\n </pre>\n </div>\n </div>\n );\n}\n","import { forwardRef, type AnchorHTMLAttributes, type ElementType, type ReactNode } from \"react\";\nimport { cn, FOCUS_RING } from \"../lib/utils\";\nimport { slotIcon, type IconSlot } from \"../lib/icons\";\n\ntype LinkUnderline = \"hover\" | \"always\" | \"none\";\ntype LinkTone = \"accent\" | \"muted\" | \"inherit\";\n\nexport interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n href: string;\n children: ReactNode;\n /** When to show the underline. Default \"hover\". */\n underline?: LinkUnderline;\n /** Colour: accent (default), muted for secondary links, inherit to match surrounding text. */\n tone?: LinkTone;\n /** Opens in a new tab with rel=\"noopener noreferrer\". Default false. */\n external?: boolean;\n /**\n * Render through a router link component instead of a plain anchor\n * (e.g. `component={RouterLink}` from react-router or next/link). The\n * component receives the same props; `href` is also passed as `to` for\n * react-router compatibility. Any element type: a router's Link requires\n * its own props (react-router's `to`), which a narrower type refused under\n * strict TypeScript (Sprint 25.16 A19).\n */\n component?: ElementType;\n /** An icon name (\"info\"), drawn as the theme's icon at 14 px, or an element. Not text: use children. */\n iconLeft?: IconSlot;\n /** As iconLeft, after the label. */\n iconRight?: IconSlot;\n}\n\nconst toneStyles: Record<LinkTone, string> = {\n accent: \"text-[var(--ds-accent-ink)] hover:text-[var(--ds-accent-primary-hover)] active:text-[var(--ds-accent-primary-active)]\",\n muted: \"text-[var(--ds-text-secondary)] hover:text-[var(--ds-text-primary)]\",\n inherit: \"text-inherit hover:text-[var(--ds-accent-ink)]\",\n};\n\nconst underlineStyles: Record<LinkUnderline, string> = {\n hover: \"no-underline hover:underline\",\n always: \"underline underline-offset-2\",\n none: \"no-underline\",\n};\n\n/**\n * Navigation link. Renders a real <a> (or a router link via `component`) so\n * middle-click, open-in-new-tab, right-click \"copy link\" and screen readers\n * all behave correctly. Visually identical to Button variant=\"link\".\n *\n * Use Link for NAVIGATION (to a page or URL). Use Button variant=\"link\" for an\n * ACTION that should look like a link (show more, resend code). Never use a\n * ghost Button for inline text — its padding breaks the line.\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { href, children, underline = \"hover\", tone = \"accent\", external = false, component: Component, iconLeft, iconRight, className, target, rel, ...props },\n ref,\n) {\n const classes = cn(\n \"inline-flex items-center gap-ds-1 font-medium cursor-pointer\",\n \"transition-colors duration-[var(--ds-transition-speed)]\",\n FOCUS_RING,\n \"rounded-[var(--ds-radius-sm)]\",\n toneStyles[tone],\n underlineStyles[underline],\n className,\n );\n const resolvedTarget = external ? \"_blank\" : target;\n const resolvedRel = external ? cn(\"noopener noreferrer\", rel) : rel;\n const content = (\n <>\n {slotIcon(iconLeft, 14, \"Link's iconLeft\")}\n {children}\n {slotIcon(iconRight, 14, \"Link's iconRight\")}\n </>\n );\n\n if (Component) {\n return (\n <Component ref={ref} href={href} to={href} className={classes} target={resolvedTarget} rel={resolvedRel} {...props}>\n {content}\n </Component>\n );\n }\n\n return (\n <a ref={ref} href={href} className={classes} target={resolvedTarget} rel={resolvedRel} {...props}>\n {content}\n </a>\n );\n});\n","import { cn } from \"../lib/utils\";\nimport type { ReactNode } from \"react\";\n\ntype Orientation = \"horizontal\" | \"vertical\";\n\ninterface DividerProps {\n orientation?: Orientation;\n label?: ReactNode;\n className?: string;\n}\n\nexport function Divider({\n orientation = \"horizontal\",\n label,\n className,\n}: DividerProps) {\n if (orientation === \"vertical\") {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n className={cn(\n \"inline-block self-stretch min-h-[1em]\",\n \"w-[var(--ds-divider-width)]\",\n \"bg-[var(--ds-border-default)]\",\n className,\n )}\n />\n );\n }\n\n if (label) {\n return (\n <div\n role=\"separator\"\n className={cn(\"flex items-center gap-ds-3\", className)}\n >\n <span className=\"flex-1 h-[var(--ds-divider-width)] bg-[var(--ds-border-default)]\" />\n <span className=\"text-xs font-medium text-[var(--ds-text-muted)] shrink-0\">\n {label}\n </span>\n <span className=\"flex-1 h-[var(--ds-divider-width)] bg-[var(--ds-border-default)]\" />\n </div>\n );\n }\n\n return (\n <hr\n role=\"separator\"\n className={cn(\n \"border-none w-full\",\n \"h-[var(--ds-divider-width)]\",\n \"bg-[var(--ds-border-default)]\",\n className,\n )}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../showcase/src/components/CodeBlock.tsx","../../../showcase/src/components/Link.tsx","../../../showcase/src/components/Divider.tsx"],"names":["Link","jsxs","jsx"],"mappings":";;;;;;;;AAoBO,SAAS,SAAA,CAAU;AAAA,EACxB,IAAA;AAAA,EACA,QAAA;AAAA,EACA,eAAA,GAAkB,KAAA;AAAA,EAClB,IAAA;AAAA,EACA,YAAA,EAAc,SAAA;AAAA,EACd;AACF,CAAA,EAAmB;AACjB,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAS,KAAK,CAAA;AAE1C,EAAA,MAAM,UAAA,GAAa,YAAY,YAAY;AACzC,IAAA,IAAI;AACF,MAAA,MAAM,SAAA,CAAU,SAAA,CAAU,SAAA,CAAU,IAAI,CAAA;AACxC,MAAA,SAAA,CAAU,IAAI,CAAA;AACd,MAAA,UAAA,CAAW,MAAM,SAAA,CAAU,KAAK,CAAA,EAAG,GAAI,CAAA;AAAA,IACzC,CAAA,CAAA,MAAQ;AAAA,IAER;AAAA,EACF,CAAA,EAAG,CAAC,IAAI,CAAC,CAAA;AAET,EAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA;AAC7B,EAAA,MAAM,KAAA,GAAQ,IAAA,IAAQ,KAAA,CAAM,MAAA,KAAW,CAAA;AAIvC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAgC,IAAI,CAAA;AACpE,EAAA,iBAAA,CAAkB,QAAA,EAAU,SAAA,KAAc,QAAA,GAAW,CAAA,MAAA,EAAS,QAAQ,KAAK,MAAA,CAAA,EAAS,CAAC,KAAA,EAAO,KAAA,EAAO,GAAG,CAAA;AACtG,EAAA,MAAM,WAAA,GAAc,kBAAkB,CAAA,EAAG,MAAA,CAAO,MAAM,MAAM,CAAA,CAAE,MAAA,GAAS,CAAC,CAAA,EAAA,CAAA,GAAO,MAAA;AAE/E,EAAA,uBACE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B,UAAA;AAAA,QACjB,SAAA,EAAW,EAAA;AAAA,UACT,uCAAA;AAAA,UACA,6BAAA;AAAA,UACA,+BAAA;AAAA,UACA;AAAA;AACF;AAAA,KACF;AAAA,EAEJ;AAEA,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,uBACED,IAAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAK,WAAA;AAAA,QACL,SAAA,EAAW,EAAA,CAAG,4BAAA,EAA8B,SAAS,CAAA;AAAA,QAErD,QAAA,EAAA;AAAA,0BAAAC,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,kEAAA,EAAmE,CAAA;AAAA,0BACnFA,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,4DACb,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,0BACAA,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,kEAAA,EAAmE;AAAA;AAAA;AAAA,KACrF;AAAA,EAEJ;AAEA,EAAA,uBACEA,GAAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,WAAA;AAAA,MACL,SAAA,EAAW,EAAA;AAAA,QACT,oBAAA;AAAA,QACA,6BAAA;AAAA,QACA,+BAAA;AAAA,QACA;AAAA;AACF;AAAA,GACF;AAEJ","file":"chunk-QY2RA2HO.js","sourcesContent":["import { useState, useCallback } from \"react\";\nimport { cn, FOCUS_INSET, FOCUS_RING } from \"../lib/utils\";\nimport { useKeyboardScroll } from \"../lib/use-keyboard-scroll\";\nimport { Icon } from \"../lib/icons\";\nimport { Badge } from \"./Badge\";\n\ninterface CodeBlockProps {\n code: string;\n language?: string;\n showLineNumbers?: boolean;\n /** Wrap long lines instead of scrolling sideways. Default: on for a single-line snippet (a tracking tag, a command), off for multi-line code. */\n wrap?: boolean;\n /**\n * What the code is (\"app.tsx\"): its name while it scrolls sideways, a Tab stop of its own then, so a page of several\n * reads them apart. Default: its language, \"Code: tsx\", else \"Code\".\n */\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport function CodeBlock({\n code,\n language,\n showLineNumbers = false,\n wrap,\n \"aria-label\": ariaLabel,\n className,\n}: CodeBlockProps) {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = useCallback(async () => {\n try {\n await navigator.clipboard.writeText(code);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch {\n /* clipboard not available */\n }\n }, [code]);\n\n const lines = code.split(\"\\n\");\n const wraps = wrap ?? lines.length === 1;\n // code that scrolls sideways, with nothing in it to Tab to: a Tab stop while it scrolls (Sprint 25.30 item 2), named by\n // the page's aria-label, else its language where it has one, so a page of several reads them apart: \"Code: tsx\"\n // (Sprint 25.31 item 8 and the review of 16 October, 7)\n const [scroller, setScroller] = useState<HTMLDivElement | null>(null);\n useKeyboardScroll(scroller, ariaLabel ?? (language ? `Code: ${language}` : \"Code\"), !wraps, false, \"x\");\n const gutterWidth = showLineNumbers ? `${String(lines.length).length + 1}ch` : undefined;\n\n return (\n <div\n className={cn(\n \"relative group\",\n \"bg-[var(--ds-bg-surface)] text-[var(--ds-text-primary)]\",\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"rounded-[var(--ds-radius-md)]\",\n \"shadow-[var(--ds-shadow-sm)]\",\n \"overflow-hidden\",\n className,\n )}\n >\n <div className=\"flex items-center justify-between px-ds-4 py-ds-2 border-b-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)] bg-[var(--ds-bg-muted)]\">\n <div className=\"flex items-center gap-ds-2\">\n {language && <Badge variant=\"outline\" size=\"sm\">{language}</Badge>}\n </div>\n <button\n type=\"button\"\n onClick={handleCopy}\n className={cn(\n \"inline-flex items-center gap-ds-1.5 px-ds-2 py-ds-1 text-xs font-medium cursor-pointer\",\n \"text-[var(--ds-text-muted)] hover:text-[var(--ds-text-primary)]\",\n \"rounded-[var(--ds-radius-sm)]\",\n \"hover:bg-[var(--ds-bg-surface)]\",\n \"transition-colors\",\n FOCUS_RING,\n )}\n aria-label={copied ? \"Copied\" : \"Copy code\"}\n >\n {/* Sprint 25.8.7 item 12: the copy icon, where a folder stood */}\n <Icon name={copied ? \"check\" : \"copy\"} size={14} />\n {copied ? \"Copied\" : \"Copy\"}\n </button>\n </div>\n\n <div ref={setScroller} className={wraps ? undefined : cn(\"overflow-x-auto\", FOCUS_INSET)} data-wrap={wraps ? \"true\" : undefined}>\n <pre className={cn(\"p-ds-4 text-sm leading-relaxed font-[family-name:var(--ds-font-mono)]\", wraps && \"whitespace-pre-wrap break-words\")}>\n <code>\n {lines.map((line, i) => (\n // with line numbers each line is a two-column row, so a wrapped line continues under its text, not under the gutter\n <span key={i} className={showLineNumbers ? \"grid grid-cols-[max-content_1fr]\" : \"block\"}>\n {showLineNumbers && (\n <span\n className=\"text-right text-[var(--ds-text-muted)] select-none mr-ds-4 opacity-50\"\n style={{ width: gutterWidth }}\n >\n {i + 1}\n </span>\n )}\n <span className=\"min-w-0\">{line || \" \"}</span>\n </span>\n ))}\n </code>\n </pre>\n </div>\n </div>\n );\n}\n","import { forwardRef, type AnchorHTMLAttributes, type ElementType, type ReactNode } from \"react\";\nimport { cn, FOCUS_RING } from \"../lib/utils\";\nimport { slotIcon, type IconSlot } from \"../lib/icons\";\n\ntype LinkUnderline = \"hover\" | \"always\" | \"none\";\ntype LinkTone = \"accent\" | \"muted\" | \"inherit\";\n\nexport interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n href: string;\n children: ReactNode;\n /** When to show the underline. Default \"hover\". */\n underline?: LinkUnderline;\n /** Colour: accent (default), muted for secondary links, inherit to match surrounding text. */\n tone?: LinkTone;\n /** Opens in a new tab with rel=\"noopener noreferrer\". Default false. */\n external?: boolean;\n /**\n * Render through a router link component instead of a plain anchor\n * (e.g. `component={RouterLink}` from react-router or next/link). The\n * component receives the same props; `href` is also passed as `to` for\n * react-router compatibility. Any element type: a router's Link requires\n * its own props (react-router's `to`), which a narrower type refused under\n * strict TypeScript (Sprint 25.16 A19).\n */\n component?: ElementType;\n /** An icon name (\"info\"), drawn as the theme's icon at 14 px, or an element. Not text: use children. */\n iconLeft?: IconSlot;\n /** As iconLeft, after the label. */\n iconRight?: IconSlot;\n}\n\nconst toneStyles: Record<LinkTone, string> = {\n accent: \"text-[var(--ds-accent-ink)] hover:text-[var(--ds-accent-primary-hover)] active:text-[var(--ds-accent-primary-active)]\",\n muted: \"text-[var(--ds-text-secondary)] hover:text-[var(--ds-text-primary)]\",\n inherit: \"text-inherit hover:text-[var(--ds-accent-ink)]\",\n};\n\nconst underlineStyles: Record<LinkUnderline, string> = {\n hover: \"no-underline hover:underline\",\n always: \"underline underline-offset-2\",\n none: \"no-underline\",\n};\n\n/**\n * Navigation link. Renders a real <a> (or a router link via `component`) so\n * middle-click, open-in-new-tab, right-click \"copy link\" and screen readers\n * all behave correctly. Visually identical to Button variant=\"link\".\n *\n * Use Link for NAVIGATION (to a page or URL). Use Button variant=\"link\" for an\n * ACTION that should look like a link (show more, resend code). Never use a\n * ghost Button for inline text — its padding breaks the line.\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { href, children, underline = \"hover\", tone = \"accent\", external = false, component: Component, iconLeft, iconRight, className, target, rel, ...props },\n ref,\n) {\n const classes = cn(\n \"inline-flex items-center gap-ds-1 font-medium cursor-pointer\",\n \"transition-colors duration-[var(--ds-transition-speed)]\",\n FOCUS_RING,\n \"rounded-[var(--ds-radius-sm)]\",\n toneStyles[tone],\n underlineStyles[underline],\n className,\n );\n const resolvedTarget = external ? \"_blank\" : target;\n const resolvedRel = external ? cn(\"noopener noreferrer\", rel) : rel;\n const content = (\n <>\n {slotIcon(iconLeft, 14, \"Link's iconLeft\")}\n {children}\n {slotIcon(iconRight, 14, \"Link's iconRight\")}\n </>\n );\n\n if (Component) {\n return (\n <Component ref={ref} href={href} to={href} className={classes} target={resolvedTarget} rel={resolvedRel} {...props}>\n {content}\n </Component>\n );\n }\n\n return (\n <a ref={ref} href={href} className={classes} target={resolvedTarget} rel={resolvedRel} {...props}>\n {content}\n </a>\n );\n});\n","import { cn } from \"../lib/utils\";\nimport type { ReactNode } from \"react\";\n\ntype Orientation = \"horizontal\" | \"vertical\";\n\ninterface DividerProps {\n orientation?: Orientation;\n label?: ReactNode;\n className?: string;\n}\n\nexport function Divider({\n orientation = \"horizontal\",\n label,\n className,\n}: DividerProps) {\n if (orientation === \"vertical\") {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n className={cn(\n \"inline-block self-stretch min-h-[1em]\",\n \"w-[var(--ds-divider-width)]\",\n \"bg-[var(--ds-border-default)]\",\n className,\n )}\n />\n );\n }\n\n if (label) {\n return (\n <div\n role=\"separator\"\n className={cn(\"flex items-center gap-ds-3\", className)}\n >\n <span className=\"flex-1 h-[var(--ds-divider-width)] bg-[var(--ds-border-default)]\" />\n <span className=\"text-xs font-medium text-[var(--ds-text-muted)] shrink-0\">\n {label}\n </span>\n <span className=\"flex-1 h-[var(--ds-divider-width)] bg-[var(--ds-border-default)]\" />\n </div>\n );\n }\n\n return (\n <hr\n role=\"separator\"\n className={cn(\n \"border-none w-full\",\n \"h-[var(--ds-divider-width)]\",\n \"bg-[var(--ds-border-default)]\",\n className,\n )}\n />\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useLatest } from './chunk-
|
|
2
|
+
import { useLatest } from './chunk-2724SJO2.js';
|
|
3
3
|
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
4
4
|
|
|
5
5
|
var registry = /* @__PURE__ */ new WeakMap();
|
|
@@ -106,5 +106,5 @@ function useTextOverflow(options = {}) {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
export { useTextOverflow };
|
|
109
|
-
//# sourceMappingURL=chunk-
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
109
|
+
//# sourceMappingURL=chunk-R2IAK3J3.js.map
|
|
110
|
+
//# sourceMappingURL=chunk-R2IAK3J3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,CAAU,IAAA,EAAM,cAAc,OAAO,CAAA;AACrC,QAAA,aAAA,CAAc,OAAA,GAAU,IAAA;AAAA,MAC1B;AAEA,MAAA,UAAA,CAAW,OAAA,GAAU,IAAA;AAErB,MAAA,IAAI,IAAA,IAAQ,CAAC,QAAA,EAAU;AAErB,QAAA,MAAM,OAAA,GAA4B,MAAM,QAAA,CAAS,OAAA,IAAU;AAC3D,QAAA,aAAA,CAAc,OAAA,GAAU,OAAA;AACxB,QAAA,OAAA,CAAQ,MAAM,OAAO,CAAA;AAErB,QAAA,MAAM,OAAA,GAAU,aAAA,CAAc,IAAA,EAAM,KAAK,CAAA;AACzC,QAAA,cAAA,CAAe,OAAO,CAAA;AAAA,MACxB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,KAAA,EAAO,QAAA,EAAU,QAAQ;AAAA,GAC5B;AAGA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAO,MAAM;AACX,MAAA,IAAI,UAAA,CAAW,OAAA,IAAW,aAAA,CAAc,OAAA,EAAS;AAC/C,QAAA,SAAA,CAAU,UAAA,CAAW,OAAA,EAAS,aAAA,CAAc,OAAO,CAAA;AAAA,MACrD;AAAA,IACF,CAAA;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,EAAE,KAAK,WAAA,EAAY;AAC5B","file":"chunk-R2IAK3J3.js","sourcesContent":["import { useState, useCallback, useRef, useEffect } from \"react\";\nimport { useLatest } from \"./use-latest\";\n\n// ─── Shared ResizeObserver (singleton per document) ────────────────────────────\n// All useTextOverflow instances share a single ResizeObserver. This avoids the\n// performance cost of 80+ independent observers on pages with many truncated elements.\n\ntype OverflowCallback = () => void;\n\nconst registry = new WeakMap<Element, Set<OverflowCallback>>();\nlet sharedObserver: ResizeObserver | null = null;\nlet rafId: number | null = null;\nconst pendingElements = new Set<Element>();\n\nfunction getSharedObserver(): ResizeObserver {\n if (sharedObserver) return sharedObserver;\n sharedObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n pendingElements.add(entry.target);\n }\n if (rafId === null) {\n rafId = requestAnimationFrame(flush);\n }\n });\n return sharedObserver;\n}\n\nfunction flush() {\n rafId = null;\n for (const el of pendingElements) {\n const callbacks = registry.get(el);\n if (callbacks) {\n for (const cb of callbacks) cb();\n }\n }\n pendingElements.clear();\n}\n\nfunction observe(el: Element, callback: OverflowCallback) {\n let set = registry.get(el);\n if (!set) {\n set = new Set();\n registry.set(el, set);\n }\n set.add(callback);\n if (set.size === 1) {\n getSharedObserver().observe(el);\n }\n}\n\nfunction unobserve(el: Element, callback: OverflowCallback) {\n const set = registry.get(el);\n if (!set) return;\n set.delete(callback);\n if (set.size === 0) {\n registry.delete(el);\n getSharedObserver().unobserve(el);\n }\n}\n\n// ─── Overflow detection ────────────────────────────────────────────────────────\n\nconst TOLERANCE = 1; // px — accounts for integer rounding in scrollWidth/clientWidth\n\nfunction checkOverflow(el: HTMLElement, lines: number): boolean {\n if (lines <= 1) {\n return el.scrollWidth - el.clientWidth > TOLERANCE;\n }\n return el.scrollHeight - el.clientHeight > TOLERANCE;\n}\n\n// ─── Hook ──────────────────────────────────────────────────────────────────────\n\nexport interface UseTextOverflowOptions {\n /** Number of visible lines before truncation. 1 = single-line ellipsis, >1 = line-clamp. */\n lines?: number;\n /** Disable overflow detection (e.g. when component is hidden) */\n disabled?: boolean;\n /** Content key — triggers re-check when this value changes (use for dynamic text content) */\n content?: unknown;\n}\n\nexport interface UseTextOverflowResult {\n /** Callback ref — attach to the element that has truncation CSS applied */\n ref: (node: HTMLElement | null) => void;\n /** True when the element's text is currently overflowing/truncated */\n isTruncated: boolean;\n}\n\n/**\n * Detects whether an element's text content is overflowing (truncated).\n * Uses a single shared ResizeObserver for all instances on the page.\n *\n * @example\n * const { ref, isTruncated } = useTextOverflow({ lines: 1 });\n * return (\n * <Tooltip content={fullText} disabled={!isTruncated}>\n * <span ref={ref} className=\"truncate\">{fullText}</span>\n * </Tooltip>\n * );\n */\nexport function useTextOverflow(options: UseTextOverflowOptions = {}): UseTextOverflowResult {\n const { lines = 1, disabled = false, content } = options;\n const [isTruncated, setIsTruncated] = useState(false);\n const elementRef = useRef<HTMLElement | null>(null);\n // The observer-registered wrapper delegates to the latest check logic via checkRef.\n const registeredRef = useRef<OverflowCallback | null>(null);\n\n const doCheck = useCallback(() => {\n if (!elementRef.current || disabled) {\n setIsTruncated(false);\n return;\n }\n const next = checkOverflow(elementRef.current, lines);\n setIsTruncated((prev) => (prev !== next ? next : prev));\n }, [lines, disabled]);\n\n // Latest check logic, updated in a layout effect so the stable wrapper never runs a stale closure.\n const checkRef = useLatest<OverflowCallback>(doCheck);\n\n // Re-check when content changes (handles dynamic text like Dropdown selection)\n // or when disabled state changes\n // Measures the committed DOM, so it must stay a post-layout effect.\n /* eslint-disable react-hooks/set-state-in-effect -- overflow is a layout measurement */\n useEffect(() => {\n if (disabled) {\n setIsTruncated(false);\n } else if (elementRef.current) {\n const next = checkOverflow(elementRef.current, lines);\n setIsTruncated((prev) => (prev !== next ? next : prev));\n }\n }, [content, lines, disabled]);\n /* eslint-enable react-hooks/set-state-in-effect */\n\n const ref = useCallback(\n (node: HTMLElement | null) => {\n const prev = elementRef.current;\n\n // Unregister previous element using the SAME function we registered with\n if (prev && registeredRef.current) {\n unobserve(prev, registeredRef.current);\n registeredRef.current = null;\n }\n\n elementRef.current = node;\n\n if (node && !disabled) {\n // Stable wrapper that delegates to the latest check logic\n const wrapper: OverflowCallback = () => checkRef.current?.();\n registeredRef.current = wrapper;\n observe(node, wrapper);\n // Initial check on mount\n const initial = checkOverflow(node, lines);\n setIsTruncated(initial);\n }\n },\n [lines, disabled, checkRef],\n );\n\n // Cleanup on unmount — uses the registered wrapper, not the check function\n useEffect(() => {\n return () => {\n if (elementRef.current && registeredRef.current) {\n unobserve(elementRef.current, registeredRef.current);\n }\n };\n }, []);\n\n return { ref, isTruncated };\n}\n"]}
|
|
@@ -5,6 +5,15 @@ import { createContext, createElement, useContext, useLayoutEffect } from 'react
|
|
|
5
5
|
var PageActionsCtx = createContext(null);
|
|
6
6
|
var CardSurfaceCtx = createContext(false);
|
|
7
7
|
var SplitPaneCtx = createContext(false);
|
|
8
|
+
var PanePaddedCtx = createContext(false);
|
|
9
|
+
var PANE_INSET = {
|
|
10
|
+
list: "px-ds-2 py-ds-3",
|
|
11
|
+
detail: "px-[var(--ds-page-gutter)] py-ds-5"
|
|
12
|
+
};
|
|
13
|
+
var PANE_HEADING_CANCEL = {
|
|
14
|
+
list: "-mx-ds-2 first:-mt-ds-3 mb-ds-3",
|
|
15
|
+
detail: "-mx-[var(--ds-page-gutter)] first:-mt-ds-5 mb-ds-5"
|
|
16
|
+
};
|
|
8
17
|
var TableCardCtx = createContext(false);
|
|
9
18
|
var RowsCtx = createContext(false);
|
|
10
19
|
var SplitListFramerCtx = createContext(null);
|
|
@@ -22,7 +31,13 @@ function useFramesItself() {
|
|
|
22
31
|
function useScrollsInside() {
|
|
23
32
|
useReportToList("scrolls");
|
|
24
33
|
}
|
|
25
|
-
function
|
|
34
|
+
function useRunsEdgeToEdge() {
|
|
35
|
+
useReportToList("edge");
|
|
36
|
+
}
|
|
37
|
+
function useWantsInset() {
|
|
38
|
+
useReportToList("inset");
|
|
39
|
+
}
|
|
40
|
+
function SurfaceBoundary({ children, pane = false, framer = null, padded = false }) {
|
|
26
41
|
return createElement(
|
|
27
42
|
CardSurfaceCtx,
|
|
28
43
|
{ value: false },
|
|
@@ -30,15 +45,19 @@ function SurfaceBoundary({ children, pane = false, framer = null }) {
|
|
|
30
45
|
SplitPaneCtx,
|
|
31
46
|
{ value: pane },
|
|
32
47
|
createElement(
|
|
33
|
-
|
|
34
|
-
{ value:
|
|
48
|
+
PanePaddedCtx,
|
|
49
|
+
{ value: padded },
|
|
35
50
|
createElement(
|
|
36
|
-
|
|
51
|
+
TableCardCtx,
|
|
37
52
|
{ value: false },
|
|
38
53
|
createElement(
|
|
39
|
-
|
|
40
|
-
{ value:
|
|
41
|
-
createElement(
|
|
54
|
+
RowsCtx,
|
|
55
|
+
{ value: false },
|
|
56
|
+
createElement(
|
|
57
|
+
PageActionsCtx,
|
|
58
|
+
{ value: null },
|
|
59
|
+
createElement(SplitListFramerCtx, { value: framer }, children)
|
|
60
|
+
)
|
|
42
61
|
)
|
|
43
62
|
)
|
|
44
63
|
)
|
|
@@ -46,6 +65,6 @@ function SurfaceBoundary({ children, pane = false, framer = null }) {
|
|
|
46
65
|
);
|
|
47
66
|
}
|
|
48
67
|
|
|
49
|
-
export { CardSurfaceCtx, PageActionsCtx, RowsCtx, SplitPaneCtx, SurfaceBoundary, TableCardCtx, useFramesItself, useScrollsInside };
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
68
|
+
export { CardSurfaceCtx, PANE_HEADING_CANCEL, PANE_INSET, PageActionsCtx, PanePaddedCtx, RowsCtx, SplitListFramerCtx, SplitPaneCtx, SurfaceBoundary, TableCardCtx, useFramesItself, useRunsEdgeToEdge, useScrollsInside, useWantsInset };
|
|
69
|
+
//# sourceMappingURL=chunk-RS624TD5.js.map
|
|
70
|
+
//# sourceMappingURL=chunk-RS624TD5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../showcase/src/lib/page-actions.ts","../../../showcase/src/lib/surface-context.ts"],"names":["createContext"],"mappings":";;;;AAwBO,IAAM,cAAA,GAAiB,cAAsC,IAAI;AClBjE,IAAM,cAAA,GAAiBA,cAAc,KAAK;AAS1C,IAAM,YAAA,GAAeA,cAA6B,KAAK;AAUvD,IAAM,aAAA,GAAgBA,cAAc,KAAK;AAQzC,IAAM,UAAA,GAAa;AAAA,EACxB,IAAA,EAAM,iBAAA;AAAA,EACN,MAAA,EAAQ;AACV;AAQO,IAAM,mBAAA,GAAsB;AAAA,EACjC,IAAA,EAAM,iCAAA;AAAA,EACN,MAAA,EAAQ;AACV;AAOO,IAAM,YAAA,GAAeA,cAAc,KAAK;AAUxC,IAAM,OAAA,GAAU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1C,cAAc,kBAAA,EAAoB,EAAE,KAAA,EAAO,MAAA,IAAU,QAAQ;AAAA;AAAC;AAAC;AAAC;AAAC;AAAC,GAAC;AACjF","file":"chunk-RS624TD5.js","sourcesContent":["import { createContext } from \"react\";\nimport type { ControlSize } from \"../components/Button\";\n\n/**\n * Sprint 25.16 A4 (R28-7): the slot in a page's own PageHeader for its actions (PageActions). PageContainer provides it,\n * its header draws it while a page asks, and the page's PageActions render into it. The review of 1 October:\n * - content that starts afresh (an overlay's body, a SplitView's pane: SurfaceBoundary) has no slot, so a header there\n * (a message's own header, a drawer's) never takes the page's actions;\n * - the page's header is the first slot in the page, so a second header that comes and goes hands nothing on;\n * - a container with no header of its own (a page that wraps itself in one under an area layout) passes its page's\n * actions to the container around it;\n * - the actions take the header's control size (a minimal or snapping header draws its own actions small).\n */\nexport interface PageActionsSlot {\n /** A page below asks for the slot: a PageActions is drawn. */\n wanted: boolean;\n /** Where the actions go: the slot of the page's header, at the size its controls are drawn. */\n target: { el: HTMLElement; size: ControlSize | null } | null;\n /** A header's slot, while drawn, with its controls' size; returns its release. */\n register: (el: HTMLElement, size: ControlSize | null) => () => void;\n /** A PageActions asks for the slot while drawn; returns its release. */\n add: () => () => void;\n}\n\nexport const PageActionsCtx = createContext<PageActionsSlot | null>(null);\n","import { createContext, createElement, useContext, useLayoutEffect, type ReactNode } from \"react\";\nimport { PageActionsCtx } from \"./page-actions\";\n\n/**\n * True inside a Card's surface. A StackedList reads it to inset its rows to the card's header (px-ds-5).\n */\nexport const CardSurfaceCtx = createContext(false);\n\n/**\n * The SplitView pane content sits in (\"list\", \"detail\", \"aside\"), false outside one. A StackedList reads it to take its\n * inset from the pane (Sprint 25.4 C-5): rows keep their padding so the selection rail sits at the pane's edge and never\n * touches content. A pane header (SectionHeading variant=\"pane\") in the detail insets at the page's gutter, as the item's\n * path above it does, and in the list at its rows' inset (the owner's review of 1 October).\n */\nexport type SplitPaneKind = false | \"list\" | \"detail\" | \"aside\";\nexport const SplitPaneCtx = createContext<SplitPaneKind>(false);\n\n/**\n * Sprint 25.33 C1 (the owner, 19 October: \"there's no one size fits all\"): whether the SplitView pane content sits in\n * pads it. A pane pads what's in it — the list pane at the sidebar's inset, the detail at the page's gutter — unless what\n * it holds runs edge to edge (a list or a board in the list pane; a detail given `detailFlush`), when it is flush. A pane\n * header (SectionHeading variant=\"pane\") cancels the padding, so it is inset once and its rule reaches the pane's edges;\n * a StackedList among a padded pane's text lines up with the text, as on the canvas. False outside a pane: overlays and\n * the view's other panes reset it (SurfaceBoundary).\n */\nexport const PanePaddedCtx = createContext(false);\n\n/**\n * C1: the inset a padded pane gives its content. The list pane takes the sidebar's (SidebarNav: 8 px at the sides, 12 at\n * the top and bottom), so a tree's chevrons, 8 px into its rows, line up with the pane heading's 16 px. The detail takes\n * the page's gutter, with the aside's and the Drawer body's 20 px above and below, so its content sits where the item's\n * path and the aside's content do. The aside pane's own inset is the detail's.\n */\nexport const PANE_INSET = {\n list: \"px-ds-2 py-ds-3\",\n detail: \"px-[var(--ds-page-gutter)] py-ds-5\",\n} as const;\n\n/**\n * C1: what a pane header (SectionHeading variant=\"pane\") adds to cancel its padded pane's inset: the sides, so its rule\n * reaches the pane's edges and its title is inset once (run 97's \"floating\" title was inset twice); the top when it is\n * first in its parent, so it sits at the pane's top; and the same room below it, so what follows starts as far under\n * its rule as it would under the pane's top. Each is PANE_INSET's own length, negated.\n */\nexport const PANE_HEADING_CANCEL = {\n list: \"-mx-ds-2 first:-mt-ds-3 mb-ds-3\",\n detail: \"-mx-[var(--ds-page-gutter)] first:-mt-ds-5 mb-ds-5\",\n} as const;\n\n/**\n * True inside a Table or DataGrid card (the phone layout below mobileBreakpoint). An EntityCell reads it to keep\n * the avatar beside the text and align to the value column (Sprint 25.4, round 7: the stacked cell made the card\n * three lines taller than it needed to be).\n */\nexport const TableCardCtx = createContext(false);\n\n/**\n * True among a collection's rows: a Table's or a DataGrid's rows and their phone cards, a StackedList's rows, a Timeline's\n * items, a NotificationCenter's rows. Something\n * with a Tab stop of its own adds a stop to every row there, which makes the collection hard to cross: a RelativeTime\n * drops its own, its full timestamp in its name and on hover (Sprint 25.17 A29). A DataList is one record's fields, not\n * rows, so it doesn't set it (the second review). Inside a control (a card or a row that is a button, a link) the time\n * finds that for itself, from the page. Overlays reset it: SurfaceBoundary, a Popover, a HoverCard.\n */\nexport const RowsCtx = createContext(false);\n\n/**\n * Sprint 25.14 A44: what a SplitView's list pane holds, as its content reports it while mounted. \"framed\": content that\n * draws its own frame or cards (a KanbanBoard, a CardGrid, a Table, a DataGrid). \"scrolls\": content with no frame of its\n * own that scrolls inside the pane (a StackedList, a Gantt, a VirtualizedList), which the view's hairline frames. The\n * view drops its frame and surface when the pane holds framed content and nothing that scrolls (P32: no frame around\n * what frames itself; a hairline around what scrolls inside). Here, not in SplitView, so a board or a card grid never\n * imports the resizable panels. Null outside a list pane: overlays and the view's other panes reset it (SurfaceBoundary).\n * Sprint 25.33 C1: \"edge\": content whose rows run to the pane's edges as full-width bands (a StackedList, a\n * VirtualizedList) or a plan drawn across the pane (a Gantt). The pane is flush while it holds one of these or framed\n * content (a board, a card grid or a table runs edge to edge too), at any depth, and pads everything else (a tree, a\n * form, text, a timeline). The report travels by context, so a list inside wrappers and its own scroller still counts:\n * a negative margin could not reach through that scroller to the pane's edges (the review of 19 October).\n * The fix pass of 25.33 (S-9): \"inset\", content that wants the pane's padding and says so (a tree), so a page that swaps\n * its list for a tree pads again, while what reports nothing (an empty result, a spinner) leaves the last decision.\n */\nexport type SplitListReport = (kind: \"framed\" | \"scrolls\" | \"edge\" | \"inset\", present: boolean) => void;\nexport const SplitListFramerCtx = createContext<SplitListReport | null>(null);\n\nfunction useReportToList(kind: \"framed\" | \"scrolls\" | \"edge\" | \"inset\") {\n const report = useContext(SplitListFramerCtx);\n useLayoutEffect(() => {\n if (!report) return;\n report(kind, true);\n return () => report(kind, false);\n }, [report, kind]);\n}\n\n/** Tell a SplitView whose list pane this sits in that it draws its own frame or cards (A44). */\nexport function useFramesItself() {\n useReportToList(\"framed\");\n}\n\n/** Tell a SplitView whose list pane this sits in that it scrolls inside the pane with no frame of its own (A44). */\nexport function useScrollsInside() {\n useReportToList(\"scrolls\");\n}\n\n/** Tell a SplitView whose list pane this sits in that it runs to the pane's edges, so the pane drops its padding (Sprint 25.33 C1). */\nexport function useRunsEdgeToEdge() {\n useReportToList(\"edge\");\n}\n\n/** Tell a SplitView whose list pane this sits in that it wants the pane's padding (a tree: the fix pass of 25.33, S-9). */\nexport function useWantsInset() {\n useReportToList(\"inset\");\n}\n\n/**\n * Where content starts afresh: an overlay's body, an opened table row's panel, a SplitView's pane. What a Card, a pane\n * or a table card told the content around it stops here (the review of 30 September: a StackedList in a Drawer opened\n * from a Card took the card's inset, and one in a Dialog declared in a list pane the pane's, so neither lined up with\n * the overlay's gutter), and so does the page's actions slot. A pane passes `pane` (which pane its content is in), the\n * list pane its `framer`, and a pane that pads its content `padded` (Sprint 25.33 C1).\n */\nexport function SurfaceBoundary({ children, pane = false, framer = null, padded = false }: { children: ReactNode; pane?: SplitPaneKind; framer?: SplitListReport | null; padded?: boolean }) {\n // the page's actions belong to the page's own header (Sprint 25.16's review): a header in a pane or an overlay never\n // takes them, and PageActions there renders nothing\n return createElement(CardSurfaceCtx, { value: false },\n createElement(SplitPaneCtx, { value: pane },\n createElement(PanePaddedCtx, { value: padded },\n createElement(TableCardCtx, { value: false },\n createElement(RowsCtx, { value: false },\n createElement(PageActionsCtx, { value: null },\n createElement(SplitListFramerCtx, { value: framer }, children)))))));\n}\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useShellPreferences, PREFERENCE_HOUSE_DEFAULTS } from './chunk-QOMP4D6V.js';
|
|
3
|
-
import { Dropdown } from './chunk-
|
|
4
|
-
import { useInputModality } from './chunk-7RKC5C7G.js';
|
|
3
|
+
import { Dropdown } from './chunk-DO6DLTFK.js';
|
|
5
4
|
import { useReportedChange, FormChangeCtx } from './chunk-72SDAX54.js';
|
|
6
|
-
import { RowsCtx } from './chunk-
|
|
7
|
-
import { ControlSizeContext, triggerType, Button } from './chunk-
|
|
8
|
-
import {
|
|
5
|
+
import { RowsCtx, SplitListFramerCtx } from './chunk-RS624TD5.js';
|
|
6
|
+
import { ControlSizeContext, triggerType, Button } from './chunk-XBVZIN26.js';
|
|
7
|
+
import { useInputModality } from './chunk-7RKC5C7G.js';
|
|
8
|
+
import { Slot, AutoTooltip } from './chunk-HCEHTJ5E.js';
|
|
9
9
|
import { warnOnce, Icon } from './chunk-53F7GVBQ.js';
|
|
10
|
-
import { useLatest, cn, FOCUS_RING, ERROR_FOCUS_WITHIN_RING, FIELD_FOCUS_WITHIN_RING, usePosition, usePressMarks, usePopupFocus, focusInitial, GLASS_DROPDOWN, focusAfterSelfRemoval, tabStops, isTabStop } from './chunk-
|
|
10
|
+
import { useLatest, cn, FOCUS_RING, ERROR_FOCUS_WITHIN_RING, FIELD_FOCUS_WITHIN_RING, usePosition, usePressMarks, usePopupFocus, focusInitial, GLASS_DROPDOWN, focusAfterSelfRemoval, tabStops, isTabStop } from './chunk-2724SJO2.js';
|
|
11
11
|
import { useContext, useRef, useState, useCallback, useEffect } from 'react';
|
|
12
12
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
13
13
|
import { createPortal } from 'react-dom';
|
|
@@ -321,7 +321,7 @@ function Popover({ open, onOpenChange, trigger, children, side = "bottom", align
|
|
|
321
321
|
left: pos.left,
|
|
322
322
|
width: width === "trigger" ? triggerWidth : width === "auto" ? void 0 : width
|
|
323
323
|
},
|
|
324
|
-
children: /* @__PURE__ */ jsx(RowsCtx, { value: false, children })
|
|
324
|
+
children: /* @__PURE__ */ jsx(RowsCtx, { value: false, children: /* @__PURE__ */ jsx(SplitListFramerCtx, { value: null, children }) })
|
|
325
325
|
}
|
|
326
326
|
),
|
|
327
327
|
container ?? document.body
|
|
@@ -751,5 +751,5 @@ function useWholeListCheck(component, length, pager) {
|
|
|
751
751
|
}
|
|
752
752
|
|
|
753
753
|
export { NumberInput, Pagination, Popover, pagerPart, usePagination, useWholeListCheck };
|
|
754
|
-
//# sourceMappingURL=chunk-
|
|
755
|
-
//# sourceMappingURL=chunk-
|
|
754
|
+
//# sourceMappingURL=chunk-SIEU4H3H.js.map
|
|
755
|
+
//# sourceMappingURL=chunk-SIEU4H3H.js.map
|