gridsmith-ui 0.30.2 → 0.31.1
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 +71 -1
- package/dist/charts.d.ts +114 -1
- package/dist/charts.js +1113 -206
- package/dist/charts.js.map +1 -1
- package/dist/chat.js +20 -12
- package/dist/chat.js.map +1 -1
- package/dist/{chunk-HVGHGBKV.js → chunk-2TCCSKL3.js} +6 -7
- package/dist/chunk-2TCCSKL3.js.map +1 -0
- package/dist/{chunk-L6HWACK7.js → chunk-53F7GVBQ.js} +6 -3
- package/dist/chunk-53F7GVBQ.js.map +1 -0
- package/dist/chunk-BHTAVJIG.js +285 -0
- package/dist/chunk-BHTAVJIG.js.map +1 -0
- package/dist/{chunk-WWN6CQKI.js → chunk-DR6WEI3A.js} +60 -7
- package/dist/chunk-DR6WEI3A.js.map +1 -0
- package/dist/{chunk-4HJDOZ2M.js → chunk-EZ3ZGFGA.js} +203 -34
- package/dist/chunk-EZ3ZGFGA.js.map +1 -0
- package/dist/{chunk-MIUSSYVE.js → chunk-HQFTP7Y5.js} +27 -52
- package/dist/chunk-HQFTP7Y5.js.map +1 -0
- package/dist/{chunk-SIWERRP2.js → chunk-I6JJ7KKP.js} +14 -15
- package/dist/chunk-I6JJ7KKP.js.map +1 -0
- package/dist/chunk-IOHGE4EW.js +755 -0
- package/dist/chunk-IOHGE4EW.js.map +1 -0
- package/dist/{chunk-USHW523V.js → chunk-IZW5XHKA.js} +73 -699
- package/dist/chunk-IZW5XHKA.js.map +1 -0
- package/dist/{chunk-ZASGFL5D.js → chunk-K3NAFQ4S.js} +3 -4
- package/dist/chunk-K3NAFQ4S.js.map +1 -0
- package/dist/{chunk-ACLKDE5W.js → chunk-KSJTMSYA.js} +23 -11
- package/dist/chunk-KSJTMSYA.js.map +1 -0
- package/dist/{chunk-SQHKC4HA.js → chunk-NDL2JGQ7.js} +8 -7
- package/dist/chunk-NDL2JGQ7.js.map +1 -0
- package/dist/{chunk-TYNDXMBV.js → chunk-QOMP4D6V.js} +3 -3
- package/dist/{chunk-TYNDXMBV.js.map → chunk-QOMP4D6V.js.map} +1 -1
- package/dist/{chunk-BZRZENBS.js → chunk-SLGGZ3MU.js} +6 -6
- package/dist/{chunk-BZRZENBS.js.map → chunk-SLGGZ3MU.js.map} +1 -1
- package/dist/{chunk-K6IDOCGE.js → chunk-TH272DIC.js} +10 -10
- package/dist/{chunk-K6IDOCGE.js.map → chunk-TH272DIC.js.map} +1 -1
- package/dist/chunk-V73LHNRL.js +51 -0
- package/dist/chunk-V73LHNRL.js.map +1 -0
- package/dist/{chunk-ZCDA74RQ.js → chunk-W3GY5ROH.js} +3 -3
- package/dist/{chunk-ZCDA74RQ.js.map → chunk-W3GY5ROH.js.map} +1 -1
- package/dist/data-grid.js +11 -12
- package/dist/data-grid.js.map +1 -1
- package/dist/editor-mentions.js +2 -3
- package/dist/editor-mentions.js.map +1 -1
- package/dist/editor.js +4 -6
- package/dist/editor.js.map +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +100 -16
- package/dist/index.js +1177 -660
- package/dist/index.js.map +1 -1
- package/dist/kanban.js +10 -11
- package/dist/kanban.js.map +1 -1
- package/dist/resizable.js +10 -11
- package/dist/resizable.js.map +1 -1
- package/dist/virtualized.js +11 -12
- package/dist/virtualized.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4HJDOZ2M.js.map +0 -1
- package/dist/chunk-6C2IUMY7.js +0 -46
- package/dist/chunk-6C2IUMY7.js.map +0 -1
- package/dist/chunk-7Q46JXSK.js +0 -51
- package/dist/chunk-7Q46JXSK.js.map +0 -1
- package/dist/chunk-ACLKDE5W.js.map +0 -1
- package/dist/chunk-HVGHGBKV.js.map +0 -1
- package/dist/chunk-L6HWACK7.js.map +0 -1
- package/dist/chunk-MIUSSYVE.js.map +0 -1
- package/dist/chunk-NKUCS67T.js +0 -13
- package/dist/chunk-NKUCS67T.js.map +0 -1
- package/dist/chunk-SIWERRP2.js.map +0 -1
- package/dist/chunk-SQHKC4HA.js.map +0 -1
- package/dist/chunk-USHW523V.js.map +0 -1
- package/dist/chunk-WWN6CQKI.js.map +0 -1
- package/dist/chunk-YL5KD5RC.js +0 -49
- package/dist/chunk-YL5KD5RC.js.map +0 -1
- package/dist/chunk-ZASGFL5D.js.map +0 -1
|
@@ -0,0 +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,EAC7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IAAM,UAAA,GAAa","file":"chunk-BHTAVJIG.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,11 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { cn, GLASS_DROPDOWN } from './chunk-YL5KD5RC.js';
|
|
5
|
-
import { createContext, useContext, useState, useRef, useId, useCallback, useEffect, isValidElement, cloneElement } from 'react';
|
|
2
|
+
import { usePosition, useLatest, cn, GLASS_DROPDOWN } from './chunk-EZ3ZGFGA.js';
|
|
3
|
+
import { version, createContext, isValidElement, cloneElement, useContext, useState, useRef, useId, useCallback, useEffect, useLayoutEffect } from 'react';
|
|
6
4
|
import { createPortal } from 'react-dom';
|
|
7
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
6
|
|
|
7
|
+
var REACT_18 = version.startsWith("18.");
|
|
8
|
+
function mergeRefs(...refs) {
|
|
9
|
+
const filtered = refs.filter(Boolean);
|
|
10
|
+
if (filtered.length === 0) return void 0;
|
|
11
|
+
if (filtered.length === 1) return filtered[0];
|
|
12
|
+
return (node) => {
|
|
13
|
+
for (const ref of filtered) {
|
|
14
|
+
if (typeof ref === "function") ref(node);
|
|
15
|
+
else if (ref && typeof ref === "object") ref.current = node;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function Slot({ children, ref, ...slotProps }) {
|
|
20
|
+
if (!isValidElement(children)) {
|
|
21
|
+
console.warn("Slot: expected a single React element child.");
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const childProps = children.props;
|
|
25
|
+
const slotRecord = slotProps;
|
|
26
|
+
const mergedProps = { ...slotProps };
|
|
27
|
+
for (const key of Object.keys(childProps)) {
|
|
28
|
+
if (key === "style") {
|
|
29
|
+
mergedProps.style = { ...slotProps.style ?? {}, ...childProps.style };
|
|
30
|
+
} else if (key === "className") {
|
|
31
|
+
mergedProps.className = [slotProps.className, childProps.className].filter(Boolean).join(" ");
|
|
32
|
+
} else if (key.startsWith("on") && typeof slotRecord[key] === "function") {
|
|
33
|
+
const slotHandler = slotRecord[key];
|
|
34
|
+
const childHandler = childProps[key];
|
|
35
|
+
mergedProps[key] = (...args) => {
|
|
36
|
+
childHandler?.(...args);
|
|
37
|
+
slotHandler?.(...args);
|
|
38
|
+
};
|
|
39
|
+
} else {
|
|
40
|
+
mergedProps[key] = childProps[key] ?? slotRecord[key];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (ref) {
|
|
44
|
+
const childRef = childProps.ref ?? (REACT_18 ? children.ref : void 0);
|
|
45
|
+
mergedProps.ref = mergeRefs(ref, childRef);
|
|
46
|
+
}
|
|
47
|
+
return cloneElement(children, mergedProps);
|
|
48
|
+
}
|
|
9
49
|
var TooltipCtx = createContext(null);
|
|
10
50
|
var NATIVE_TITLE = /* @__PURE__ */ Symbol("native title");
|
|
11
51
|
function Tooltip({ content, children, side = "top", delay = 600, className, container, disabled = false, ref, ...slotProps }) {
|
|
@@ -17,6 +57,7 @@ function AutoTooltip(props) {
|
|
|
17
57
|
function RevealTooltip(props) {
|
|
18
58
|
return /* @__PURE__ */ jsx(TooltipBase, { ...props, auto: true, reveal: true });
|
|
19
59
|
}
|
|
60
|
+
var shownTooltip = null;
|
|
20
61
|
function TooltipBase({ content, children, side = "top", delay = 600, className, container, disabled = false, auto = false, reveal = false, ref: forwardedRef, ...slotProps }) {
|
|
21
62
|
const around = useContext(TooltipCtx);
|
|
22
63
|
const [open, setOpen] = useState(false);
|
|
@@ -90,6 +131,18 @@ function TooltipBase({ content, children, side = "top", delay = 600, className,
|
|
|
90
131
|
};
|
|
91
132
|
}, [open, hide, reveal]);
|
|
92
133
|
useEffect(() => cancel, [cancel]);
|
|
134
|
+
useLayoutEffect(() => {
|
|
135
|
+
if (!open) return;
|
|
136
|
+
const mine = { close: () => {
|
|
137
|
+
cancel();
|
|
138
|
+
setOpen(false);
|
|
139
|
+
} };
|
|
140
|
+
if (shownTooltip && shownTooltip !== mine) shownTooltip.close();
|
|
141
|
+
shownTooltip = mine;
|
|
142
|
+
return () => {
|
|
143
|
+
if (shownTooltip === mine) shownTooltip = null;
|
|
144
|
+
};
|
|
145
|
+
}, [open, cancel]);
|
|
93
146
|
const nativeTitle = isValidElement(children) && (typeof children.type === "string" || NATIVE_TITLE in children.type);
|
|
94
147
|
const trigger = nativeTitle && children.props.title !== void 0 ? cloneElement(children, { title: void 0 }) : children;
|
|
95
148
|
return /* @__PURE__ */ jsxs(TooltipCtx, { value: covers, children: [
|
|
@@ -183,6 +236,6 @@ function useRevealFocus(target, enabled = true) {
|
|
|
183
236
|
}, [target, enabled]);
|
|
184
237
|
}
|
|
185
238
|
|
|
186
|
-
export { AutoTooltip, NATIVE_TITLE, RevealTooltip, Tooltip, useRevealFocus };
|
|
187
|
-
//# sourceMappingURL=chunk-
|
|
188
|
-
//# sourceMappingURL=chunk-
|
|
239
|
+
export { AutoTooltip, NATIVE_TITLE, RevealTooltip, Slot, Tooltip, mergeRefs, useRevealFocus };
|
|
240
|
+
//# sourceMappingURL=chunk-DR6WEI3A.js.map
|
|
241
|
+
//# sourceMappingURL=chunk-DR6WEI3A.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../showcase/src/lib/slot.tsx","../../../showcase/src/components/Tooltip.tsx","../../../showcase/src/lib/reveal-focus.ts"],"names":["jsx","isValidElement","cloneElement","useEffect"],"mappings":";;;;;;AAYA,IAAM,QAAA,GAAW,OAAA,CAAQ,UAAA,CAAW,KAAK,CAAA;AAOlC,SAAS,aAAa,IAAA,EAAsE;AACjG,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,MAAA,CAAO,OAAO,CAAA;AACpC,EAAA,IAAI,QAAA,CAAS,MAAA,KAAW,CAAA,EAAG,OAAO,MAAA;AAClC,EAAA,IAAI,QAAA,CAAS,MAAA,KAAW,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,iBAAiB,EAAE,KAAA,EAAO,SAAA,EAAW,MAAA,EAAQ,WAAW,CAAA;AAAA,IAClE,CAAA;AACA,IAAA,GAAA,CAAI,gBAAA,CAAiB,SAAA,EAAW,KAAA,EAAO,IAAI,CAAA;AAC3C,IAAA,GAAA,CAAI,gBAAA,CAAiB,aAAA,EAAe,SAAA,EAAW,IAAI,CAAA;AACnD,IAAA,GAAA,CAAI,gBAAA,CAAiB,WAAW,SAAS,CAAA;AACzC,IAAA,OAAO,MAAM;AACX,MAAA,GAAA,CAAI,mBAAA,CAAoB,SAAA,EAAW,KAAA,EAAO,IAAI,CAAA;AAC9C,MAAA,GAAA,CAAI,mBAAA,CAAoB,aAAA,EAAe,SAAA,EAAW,IAAI,CAAA;AACtD,MAAA,GAAA,CAAI,mBAAA,CAAoB,WAAW,SAAS,CAAA;AAAA,IAC9C,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,MAAA,EAAQ,OAAO,CAAC,CAAA;AACtB","file":"chunk-DR6WEI3A.js","sourcesContent":["import {\n type ReactNode,\n type ReactElement,\n type HTMLAttributes,\n type Ref,\n isValidElement,\n cloneElement,\n createElement,\n Children,\n version,\n} from \"react\";\n\nconst REACT_18 = version.startsWith(\"18.\");\n\ntype SlotProps = HTMLAttributes<HTMLElement> & {\n children?: ReactNode;\n ref?: Ref<HTMLElement>;\n};\n\nexport function mergeRefs(...refs: (Ref<HTMLElement> | undefined)[]): Ref<HTMLElement> | undefined {\n const filtered = refs.filter(Boolean) as Ref<HTMLElement>[];\n if (filtered.length === 0) return undefined;\n if (filtered.length === 1) return filtered[0];\n return (node: HTMLElement | null) => {\n for (const ref of filtered) {\n if (typeof ref === \"function\") ref(node);\n else if (ref && typeof ref === \"object\") (ref as { current: HTMLElement | null }).current = node;\n }\n };\n}\n\n/**\n * Merges its own props onto its single React element child instead of\n * rendering a wrapper DOM node. Used by trigger-based components\n * (Tooltip, HoverCard, Popover, DropdownMenu) via the `asChild` prop\n * to let consumers control the rendered element.\n *\n * Follows the same contract as Radix UI's Slot / `asChild` pattern.\n */\nexport function Slot({ children, ref, ...slotProps }: SlotProps) {\n if (!isValidElement(children)) {\n console.warn(\"Slot: expected a single React element child.\");\n return null;\n }\n\n const childProps = children.props as Record<string, unknown>;\n const slotRecord = slotProps as Record<string, unknown>;\n\n const mergedProps: Record<string, unknown> = { ...slotProps };\n for (const key of Object.keys(childProps)) {\n if (key === \"style\") {\n mergedProps.style = { ...(slotProps.style ?? {}), ...(childProps.style as object) };\n } else if (key === \"className\") {\n mergedProps.className = [slotProps.className, childProps.className].filter(Boolean).join(\" \");\n } else if (key.startsWith(\"on\") && typeof slotRecord[key] === \"function\") {\n const slotHandler = slotRecord[key] as (...args: unknown[]) => void;\n const childHandler = childProps[key] as (...args: unknown[]) => void;\n mergedProps[key] = (...args: unknown[]) => {\n childHandler?.(...args);\n slotHandler?.(...args);\n };\n } else {\n mergedProps[key] = childProps[key] ?? slotRecord[key];\n }\n }\n\n if (ref) {\n // React 19 passes ref as a prop and warns on element.ref; React 18 keeps it on the element.\n const childRef = (childProps.ref as Ref<HTMLElement> | undefined)\n ?? (REACT_18 ? (children as ReactElement & { ref?: Ref<HTMLElement> }).ref : undefined);\n mergedProps.ref = mergeRefs(ref, childRef);\n }\n\n return cloneElement(children as ReactElement, mergedProps);\n}\n\n/**\n * Renders either a Slot (when `asChild` is true — merging props onto\n * the consumer's child element) or the given `fallback` tag (default\n * behaviour, rendering a wrapper element with the given props).\n */\nexport function Slottable({\n asChild,\n fallback: Tag = \"span\",\n children,\n ref,\n ...rest\n}: {\n asChild?: boolean;\n fallback?: keyof HTMLElementTagNameMap;\n children?: ReactNode;\n ref?: Ref<HTMLElement>;\n} & HTMLAttributes<HTMLElement>) {\n if (asChild) {\n const child = Children.only(children);\n return <Slot ref={ref} {...rest}>{child}</Slot>;\n }\n // `ref` is a forwarded prop being passed on, not a ref object being read.\n // eslint-disable-next-line react-hooks/refs -- forwarding, not dereferencing\n return createElement(Tag, { ref, ...rest } as Record<string, unknown>, children);\n}\n","import { useState, useRef, useCallback, useEffect, useLayoutEffect, useId, useContext, cloneElement, isValidElement, type HTMLAttributes, type ReactElement, type ReactNode, type Ref, createContext } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn, GLASS_DROPDOWN } from \"../lib/utils\";\nimport { Slot, mergeRefs } from \"../lib/slot\";\nimport { usePosition, type Side } from \"../lib/use-position\";\nimport { useLatest } from \"../lib/use-latest\";\n\ninterface TooltipProps extends Omit<HTMLAttributes<HTMLElement>, \"content\"> {\n content: ReactNode;\n children: ReactNode;\n side?: Side;\n delay?: number;\n className?: string;\n container?: Element | DocumentFragment;\n /**\n * Keep the Tooltip in the tree but never show it. Use this instead of rendering\n * the Tooltip only sometimes: adding or removing the wrapper remounts its child,\n * which drops focus from a field inside it (Sprint 25.7, the Combobox).\n */\n disabled?: boolean;\n /**\n * A Tooltip can itself be the child of a Slot — `<DropdownMenu trigger={<Tooltip …><Button/></Tooltip>}>` —\n * so the ref and handlers a parent merges onto it are passed through to its own trigger (14 Sep 2026).\n */\n ref?: Ref<HTMLElement>;\n}\n\n/**\n * Inside a tooltip's trigger: asks for the element that tooltip covers, or null when it can't show (disabled, in which\n * case the one around it answers). A tooltip a component draws on its own (an icon Button's from its aria-label, every\n * AutoTooltip) asks when it would show, and steps aside when the answer holds its own trigger: the outer one shows\n * whenever the pointer is in it, so both would show at once (round 15, 52.7, two tooltips on one button; every\n * component's own tooltip since the review of 21.6 session B). Asked then, not at render: a Tooltip around a component\n * that passes no props on never fires, and the component's own tooltip still shows.\n */\nexport const TooltipCtx = createContext<(() => HTMLElement | null) | null>(null);\n\n/** Marks a component whose `title` prop is the native attribute (the library's Button): a Tooltip drops it, as an element's. */\nexport const NATIVE_TITLE = Symbol(\"native title\");\n\n// 600ms: long enough that passing the pointer over a toolbar, or landing focus\n// on an icon button, does not flash a label; short enough to still feel live.\nexport function Tooltip({ content, children, side = \"top\", delay = 600, className, container, disabled = false, ref, ...slotProps }: TooltipProps) {\n return <TooltipBase content={content} side={side} delay={delay} className={className} container={container} disabled={disabled} ref={ref} {...slotProps}>{children}</TooltipBase>;\n}\n\n/**\n * The tooltip a library component draws on its own: an icon Button's label, cut-off text in full, a relative time's\n * date, an avatar's name, its own controls' labels. Where a tooltip that can show already covers its trigger (a Tooltip\n * the page put around it) it steps aside, so the control shows one (the review of 21.6 session B: a Tooltip around a\n * cut-off Badge showed two). Every component's own tooltip is one of these; `<Tooltip>` is the page's, and never steps aside.\n */\nexport function AutoTooltip(props: TooltipProps) {\n return <TooltipBase {...props} auto />;\n}\n\n/**\n * The AutoTooltip of text cut to fit (Sprint 25.8.7 item 5, lib's CutText): the tooltip is the way to the full text, so a\n * tap shows it at once and a second tap or a press elsewhere hides it, and a press or Enter never dismisses it, there\n * being nothing to activate.\n */\nexport function RevealTooltip(props: TooltipProps) {\n return <TooltipBase {...props} auto reveal />;\n}\n\n/**\n * The drawn tooltip on screen now (Sprint 25.32, round 29's double tooltips; the owner's rule, one tooltip per control,\n * and APG's one at a time): a tooltip that opens closes this one first. A focused control's label (a RelativeTime's full\n * date, shown by keyboard focus) gives way when the pointer rests on another control, so two never show at once.\n */\nlet shownTooltip: { close: () => void } | null = null;\n\nfunction TooltipBase({ content, children, side = \"top\", delay = 600, className, container, disabled = false, auto = false, reveal = false, ref: forwardedRef, ...slotProps }: TooltipProps & { auto?: boolean; reveal?: boolean }) {\n const around = useContext(TooltipCtx);\n const [open, setOpen] = useState(false);\n // Disabling while shown hides it (render-time state adjustment).\n if (disabled && open) setOpen(false);\n const triggerRef = useRef<HTMLElement>(null);\n const floatingRef = useRef<HTMLDivElement>(null);\n const timeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n // Set when the trigger is activated: the label must not reappear (from the\n // focus the click leaves behind, or a still-pending timer) until the pointer\n // leaves and comes back.\n const suppressedRef = useRef(false);\n const id = useId();\n\n const pos = usePosition(triggerRef, floatingRef, open, { side, offset: 6, flip: true });\n\n const cancel = useCallback(() => {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }, []);\n\n // What this tooltip covers, for one inside its trigger to ask: its trigger while it can show, else the answer of the\n // one around it. An automatic tooltip is covered when that answer holds its own trigger.\n const disabledRef = useLatest(disabled);\n const covers = useCallback(() => (disabledRef.current ? around?.() ?? null : triggerRef.current), [around, disabledRef]);\n const covered = useCallback(() => {\n const mine = triggerRef.current;\n const theirs = auto ? around?.() : null;\n return !!(mine && theirs && theirs.contains(mine));\n }, [auto, around]);\n\n // One pending timer at a time: hover and focus both call show(), and the\n // earlier timer used to be orphaned, firing after hide() had run and leaving\n // the tooltip up with nothing left to close it.\n const show = useCallback(() => {\n if (disabled || suppressedRef.current || covered()) return;\n cancel();\n timeoutRef.current = setTimeout(() => setOpen(true), delay);\n }, [delay, cancel, disabled, covered]);\n\n const hide = useCallback(() => {\n cancel();\n setOpen(false);\n }, [cancel]);\n\n // Pointer focus (a click) does not warrant a label; keyboard focus does. The element focused is asked, not the\n // trigger: focus that reaches the trigger from a control inside it (a card title's button) is that control's, and\n // the trigger itself never matched, so the label never showed by keyboard (the review of 30 September).\n const showOnFocus = useCallback((e: React.FocusEvent<HTMLElement>) => {\n let keyboard = true;\n const focused = e.target instanceof Element ? e.target : e.currentTarget;\n try { keyboard = focused.matches(\":focus-visible\"); } catch { /* selector unsupported: assume keyboard */ }\n if (keyboard) show();\n }, [show]);\n\n // Activating the trigger dismisses the label and keeps it away until the\n // pointer has left — what opens next (a menu, a dialog) owns the screen.\n const dismissOnActivate = useCallback(() => {\n suppressedRef.current = true;\n hide();\n }, [hide]);\n\n // Suppression lifts when the pointer leaves or focus moves on — a keyboard\n // user never produces a mouseleave, so blur must reset it too.\n const leave = useCallback(() => {\n suppressedRef.current = false;\n hide();\n }, [hide]);\n\n // Cut text's tooltip (`reveal`): a finger's tap shows it at once, and taps it away; a mouse's press leaves it as the\n // hover has it\n const revealOnPress = (e: React.PointerEvent<HTMLElement>) => {\n if (e.pointerType !== \"touch\" || disabled || covered()) return;\n if (open) { hide(); return; }\n cancel();\n suppressedRef.current = false;\n setOpen(true);\n };\n\n // Escape dismisses an open tooltip (WCAG 1.4.13); it does not stop the key\n // reaching whatever overlay is also listening. Cut text's goes with a press anywhere else too, as a tap showed it.\n useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => { if (e.key === \"Escape\") hide(); };\n const onPress = (e: PointerEvent) => { if (!triggerRef.current?.contains(e.target as Node)) hide(); };\n document.addEventListener(\"keydown\", onKey);\n if (reveal) document.addEventListener(\"pointerdown\", onPress, true);\n return () => {\n document.removeEventListener(\"keydown\", onKey);\n document.removeEventListener(\"pointerdown\", onPress, true);\n };\n }, [open, hide, reveal]);\n\n useEffect(() => cancel, [cancel]);\n\n // one on screen at a time: this one, once it opens, closes the one showing, before either is painted (a passive effect\n // drew both for a frame, the review of 18 October)\n useLayoutEffect(() => {\n if (!open) return;\n const mine = { close: () => { cancel(); setOpen(false); } };\n if (shownTooltip && shownTooltip !== mine) shownTooltip.close();\n shownTooltip = mine;\n return () => { if (shownTooltip === mine) shownTooltip = null; };\n }, [open, cancel]);\n\n // A native title on the trigger would be the browser's second tooltip, a moment after this one (the review of 21.6\n // session B): an element's own title goes, and the library Button's. Another component's title prop is left alone: it\n // often means something else (a Card's heading).\n const nativeTitle = isValidElement(children) && (typeof children.type === \"string\" || NATIVE_TITLE in (children.type as object));\n const trigger = nativeTitle && (children.props as { title?: unknown }).title !== undefined\n ? cloneElement(children as ReactElement<{ title?: string }>, { title: undefined })\n : children;\n\n return (\n <TooltipCtx value={covers}>\n <Slot\n {...slotProps}\n ref={mergeRefs(triggerRef, forwardedRef)}\n onMouseEnter={(e) => { slotProps.onMouseEnter?.(e); show(); }}\n onMouseLeave={(e) => { slotProps.onMouseLeave?.(e); leave(); }}\n onFocus={(e) => { slotProps.onFocus?.(e); showOnFocus(e); }}\n onBlur={(e) => { slotProps.onBlur?.(e); leave(); }}\n onPointerDown={(e) => { slotProps.onPointerDown?.(e); if (reveal) revealOnPress(e); else dismissOnActivate(); }}\n onKeyDown={(e) => { slotProps.onKeyDown?.(e); if (!reveal && (e.key === \"Enter\" || e.key === \" \")) dismissOnActivate(); }}\n aria-describedby={open ? id : undefined}\n >\n {trigger}\n </Slot>\n {open && createPortal(\n <div\n ref={floatingRef}\n id={id}\n role=\"tooltip\"\n className={cn(\n \"fixed z-[var(--ds-z-tooltip)] pointer-events-none\",\n \"px-ds-2.5 py-ds-1.5 text-xs\",\n \"max-w-[280px] break-words\",\n \"bg-[var(--ds-bg-surface-elevated)] text-[var(--ds-text-primary)]\",\n GLASS_DROPDOWN,\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]\",\n \"rounded-[var(--ds-radius-sm)]\",\n className\n )}\n style={{ top: pos.top, left: pos.left }}\n >\n {content}\n </div>,\n container ?? document.body\n )}\n </TooltipCtx>\n );\n}\n\n","import { useEffect, type RefObject } from \"react\";\n\n/**\n * A scroller's focused item, shown whole with its keyboard outline (Sprint 30, P3). A browser scrolls an item into view\n * when focus reaches it only if none of it shows: one partly in view (a list's last option, a card at a board's edge, a\n * row under the fold) stays cut off, its outline with it. When a key moves focus to something inside the scroller (Tab,\n * or a component's arrows), this scrolls it into view, as little as it takes; the scroller's scroll padding\n * (`scroll-p-[4px]`, P3's room) leaves the outline its 4 px. Focus a pointer gave is left where it is, so nothing moves\n * under the mouse. Pass the element itself (a callback ref's), as useKeyboardScroll takes it, or a ref object, read when\n * focus arrives (for an element whose ref is already taken).\n */\nexport function useRevealFocus(target: HTMLElement | null | RefObject<HTMLElement | null>, enabled = true): void {\n useEffect(() => {\n if (!enabled || !target) return;\n const read = () => (\"current\" in target ? target.current : target);\n const first = read();\n const doc = first?.ownerDocument ?? (typeof document !== \"undefined\" ? document : null);\n if (!doc) return;\n // whether a key or a pointer came last: the fields' tracker counts typing as neither, and an arrow from a list's\n // search box moves focus by the keyboard all the same\n let keyed = false;\n const onKey = () => { keyed = true; };\n const onPointer = () => { keyed = false; };\n const onFocusIn = (e: FocusEvent) => {\n const el = read();\n const focused = e.target;\n // a typing surface keeps its own caret in view: scrolled \"into view\" whole, a long one would jump\n if (!keyed || !el || focused === el || !(focused instanceof Element) || !el.contains(focused) || (focused as HTMLElement).isContentEditable) return;\n focused.scrollIntoView?.({ block: \"nearest\", inline: \"nearest\" });\n };\n doc.addEventListener(\"keydown\", onKey, true);\n doc.addEventListener(\"pointerdown\", onPointer, true);\n doc.addEventListener(\"focusin\", onFocusIn);\n return () => {\n doc.removeEventListener(\"keydown\", onKey, true);\n doc.removeEventListener(\"pointerdown\", onPointer, true);\n doc.removeEventListener(\"focusin\", onFocusIn);\n };\n }, [target, enabled]);\n}\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRef, useLayoutEffect, useInsertionEffect, useEffect, useCallback, useState, useMemo } from 'react';
|
|
3
3
|
import { flushSync } from 'react-dom';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
6
|
|
|
5
7
|
// ../../showcase/src/lib/focus.ts
|
|
6
8
|
function useLatest(value) {
|
|
@@ -41,6 +43,10 @@ function isTabStop(el) {
|
|
|
41
43
|
if (el.closest("[inert]")) return false;
|
|
42
44
|
return isRendered(el);
|
|
43
45
|
}
|
|
46
|
+
function hasTabStop(root) {
|
|
47
|
+
for (const el of root.querySelectorAll(FOCUSABLE)) if (isTabStop(el)) return true;
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
44
50
|
function tabStops(root) {
|
|
45
51
|
return Array.from(root.querySelectorAll(FOCUSABLE)).filter(isTabStop).sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
|
|
46
52
|
}
|
|
@@ -96,6 +102,10 @@ function pathAbove(to, from) {
|
|
|
96
102
|
const up = to.replace(/\/+$/, "");
|
|
97
103
|
return from.startsWith(`${up}/`) && from.replace(/\/+$/, "") !== up;
|
|
98
104
|
}
|
|
105
|
+
function pageAddress() {
|
|
106
|
+
const { pathname, hash } = location;
|
|
107
|
+
return /^#!?\//.test(hash) ? pathname + hash.replace(/\?.*$/, "") : pathname;
|
|
108
|
+
}
|
|
99
109
|
var ROW = 'tr, li, [role="row"], [data-card], [data-row]';
|
|
100
110
|
function deletedRow(before, now) {
|
|
101
111
|
const refilled = now.length === before.length;
|
|
@@ -133,6 +143,53 @@ function focusForTheMoment(el) {
|
|
|
133
143
|
}
|
|
134
144
|
var HEADING = 'h1, h2, h3, h4, h5, h6, [role="heading"]';
|
|
135
145
|
var LAST_RESORT_MS = 200;
|
|
146
|
+
function focusLandings() {
|
|
147
|
+
let landed = false;
|
|
148
|
+
const onIn = () => {
|
|
149
|
+
landed = true;
|
|
150
|
+
};
|
|
151
|
+
document.addEventListener("focusin", onIn, true);
|
|
152
|
+
return { get landed() {
|
|
153
|
+
return landed;
|
|
154
|
+
}, stop: () => {
|
|
155
|
+
if (typeof document !== "undefined") document.removeEventListener("focusin", onIn, true);
|
|
156
|
+
} };
|
|
157
|
+
}
|
|
158
|
+
var SCROLL_KEYS = /* @__PURE__ */ new Set(["PageDown", "PageUp", "Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight", " "]);
|
|
159
|
+
var unreachable = (el) => el.matches(":disabled") || !!el.closest("[inert]");
|
|
160
|
+
function onMovingOn(control, done) {
|
|
161
|
+
let live = true;
|
|
162
|
+
const end = () => {
|
|
163
|
+
if (live) done();
|
|
164
|
+
};
|
|
165
|
+
const onFocusIn = (e) => {
|
|
166
|
+
if (e.target !== control) end();
|
|
167
|
+
};
|
|
168
|
+
const onFocusOut = (e) => {
|
|
169
|
+
if (e.target !== control) return;
|
|
170
|
+
queueMicrotask(() => {
|
|
171
|
+
if (typeof document === "undefined") return;
|
|
172
|
+
if (control.isConnected && !unreachable(control) && isRendered(control) && document.activeElement !== control) end();
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
const onKey = (e) => {
|
|
176
|
+
const active = document.activeElement;
|
|
177
|
+
if (SCROLL_KEYS.has(e.key) && (!active || active === document.body || active === control && e.key !== " ")) end();
|
|
178
|
+
};
|
|
179
|
+
const listeners = [
|
|
180
|
+
["focusin", onFocusIn, { capture: true }],
|
|
181
|
+
["focusout", onFocusOut, { capture: true }],
|
|
182
|
+
["pointerdown", end, { capture: true }],
|
|
183
|
+
["wheel", end, { capture: true, passive: true }],
|
|
184
|
+
["touchmove", end, { capture: true, passive: true }],
|
|
185
|
+
["keydown", onKey, { capture: true }]
|
|
186
|
+
];
|
|
187
|
+
for (const [type, fn, opts] of listeners) document.addEventListener(type, fn, opts);
|
|
188
|
+
return () => {
|
|
189
|
+
live = false;
|
|
190
|
+
if (typeof document !== "undefined") for (const [type, fn, opts] of listeners) document.removeEventListener(type, fn, opts);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
136
193
|
function placesOf(el) {
|
|
137
194
|
const places = [];
|
|
138
195
|
for (let c = el, box = el.parentElement; box && box !== document.body && box.parentElement && box.parentElement !== document.body; c = box, box = box.parentElement) {
|
|
@@ -165,6 +222,46 @@ function landLastResort(places, closing) {
|
|
|
165
222
|
}
|
|
166
223
|
return mainCounts && focusForTheMoment(main);
|
|
167
224
|
}
|
|
225
|
+
var DIALOG = 'dialog, [role="dialog"], [role="alertdialog"], [aria-modal="true"]';
|
|
226
|
+
function pointOf(el) {
|
|
227
|
+
const point = document.createRange();
|
|
228
|
+
point.selectNodeContents(el);
|
|
229
|
+
return point;
|
|
230
|
+
}
|
|
231
|
+
function landWhereTabGoes(point, places) {
|
|
232
|
+
const at = point.startContainer;
|
|
233
|
+
const from = at instanceof Element ? at : at.parentElement;
|
|
234
|
+
if (!from?.isConnected) return landLastResort(places);
|
|
235
|
+
const dialog = from.closest(DIALOG);
|
|
236
|
+
let layer = dialog;
|
|
237
|
+
if (!layer) for (let el = from; el && el !== document.body; el = el.parentElement) layer = el;
|
|
238
|
+
if (!layer) return landLastResort(places);
|
|
239
|
+
const stops = tabStops(layer);
|
|
240
|
+
const next = stops.findIndex((s) => point.comparePoint(s, 0) === 1);
|
|
241
|
+
const to = next >= 0 ? stops[next] : stops.at(-1);
|
|
242
|
+
if (to) {
|
|
243
|
+
to.focus();
|
|
244
|
+
if (document.activeElement === to) return true;
|
|
245
|
+
}
|
|
246
|
+
return !dialog && landLastResort(places);
|
|
247
|
+
}
|
|
248
|
+
var OPEN_TO_FOCUS = "ds-open-to-focus";
|
|
249
|
+
function openToFocus(target, step) {
|
|
250
|
+
if (!target.closest("[inert]")) {
|
|
251
|
+
step();
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
target.dispatchEvent(new CustomEvent(OPEN_TO_FOCUS, { bubbles: true, detail: { target, step, done: false, at: performance.now() } }));
|
|
255
|
+
}
|
|
256
|
+
function focusOutOf(el) {
|
|
257
|
+
const root = el.closest(DIALOG) ?? document.body;
|
|
258
|
+
const before = tabStops(root).filter((s) => !el.contains(s) && el.compareDocumentPosition(s) & Node.DOCUMENT_POSITION_PRECEDING).at(-1);
|
|
259
|
+
if (before) {
|
|
260
|
+
before.focus();
|
|
261
|
+
if (document.activeElement === before) return true;
|
|
262
|
+
}
|
|
263
|
+
return landLastResort(placesOf(el), el);
|
|
264
|
+
}
|
|
168
265
|
function rememberFocus(el, { ignoreRoute = false } = {}) {
|
|
169
266
|
const { href, pathname } = location;
|
|
170
267
|
const row = el.closest(ROW);
|
|
@@ -211,10 +308,12 @@ function rememberFocus(el, { ignoreRoute = false } = {}) {
|
|
|
211
308
|
};
|
|
212
309
|
const neighbour = () => inRow(byKey(keyOf(before)) ?? before) || inRow(byKey(keyOf(after)) ?? after) || !!list?.isConnected && land(tabStops(list)[0]);
|
|
213
310
|
const lastResort = () => {
|
|
311
|
+
const landings = focusLandings();
|
|
214
312
|
setTimeout(() => {
|
|
313
|
+
landings.stop();
|
|
215
314
|
if (typeof document === "undefined") return;
|
|
216
315
|
const active = document.activeElement;
|
|
217
|
-
if (active && active !== document.body && active.isConnected || pageChanged()) return;
|
|
316
|
+
if (active && active !== document.body && active.isConnected || landings.landed || pageChanged()) return;
|
|
218
317
|
landLastResort(places);
|
|
219
318
|
}, LAST_RESORT_MS);
|
|
220
319
|
return false;
|
|
@@ -232,20 +331,17 @@ function rememberFocus(el, { ignoreRoute = false } = {}) {
|
|
|
232
331
|
const fromList = changes.some((c) => c.target === list || c.target === list.parentNode);
|
|
233
332
|
if (!(fromList && neighbour())) lastResort();
|
|
234
333
|
});
|
|
235
|
-
const onFocusIn = (e) => {
|
|
236
|
-
if (e.target !== el) stop();
|
|
237
|
-
};
|
|
238
334
|
const timer = setTimeout(() => stop(), 1e4);
|
|
335
|
+
const quit = onMovingOn(el, () => stop());
|
|
239
336
|
function stop() {
|
|
240
337
|
observer.disconnect();
|
|
241
338
|
clearTimeout(timer);
|
|
242
|
-
|
|
339
|
+
quit();
|
|
243
340
|
unwatch = null;
|
|
244
341
|
}
|
|
245
342
|
observer.observe(list, { childList: true });
|
|
246
343
|
if (list.parentNode) observer.observe(list.parentNode, { childList: true });
|
|
247
344
|
for (const { box } of places) observer.observe(box, { childList: true });
|
|
248
|
-
document.addEventListener("focusin", onFocusIn, true);
|
|
249
345
|
unwatch = stop;
|
|
250
346
|
};
|
|
251
347
|
return {
|
|
@@ -309,7 +405,10 @@ function useFocusKeptInList(listRef) {
|
|
|
309
405
|
}, [listRef]);
|
|
310
406
|
}
|
|
311
407
|
var openers = /* @__PURE__ */ new WeakMap();
|
|
408
|
+
var waiting = /* @__PURE__ */ new WeakMap();
|
|
409
|
+
var WATCH_MS = 1e4;
|
|
312
410
|
function rememberOpener(active, root) {
|
|
411
|
+
if (root) waiting.get(root)?.();
|
|
313
412
|
let own = active instanceof HTMLElement && active !== document.body && active.isConnected ? rememberFocus(active) : null;
|
|
314
413
|
const controller = !own && root?.id ? document.querySelector(`[aria-controls~="${CSS.escape(root.id)}"]`) : null;
|
|
315
414
|
if (controller) own = rememberFocus(controller);
|
|
@@ -325,13 +424,28 @@ function rememberOpener(active, root) {
|
|
|
325
424
|
const { pathname } = location;
|
|
326
425
|
return {
|
|
327
426
|
el: null,
|
|
328
|
-
restore() {
|
|
329
|
-
|
|
427
|
+
restore(_fallback, closed = false) {
|
|
428
|
+
const since = performance.now();
|
|
429
|
+
let timer;
|
|
430
|
+
const stop = () => {
|
|
431
|
+
clearTimeout(timer);
|
|
432
|
+
if (waiting.get(root) === stop) waiting.delete(root);
|
|
433
|
+
};
|
|
434
|
+
const look = () => {
|
|
330
435
|
if (typeof document === "undefined") return;
|
|
331
436
|
const now = document.activeElement;
|
|
332
|
-
|
|
437
|
+
const real = !!now && now !== document.body && now.isConnected;
|
|
438
|
+
if (real && !root.contains(now) || location.pathname !== pathname && !pathAbove(location.pathname, pathname)) return stop();
|
|
439
|
+
if (real && !closed && root instanceof HTMLElement && isRendered(root)) {
|
|
440
|
+
if (performance.now() - since < WATCH_MS) timer = setTimeout(look, 50);
|
|
441
|
+
else stop();
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
stop();
|
|
333
445
|
landLastResort(places, root);
|
|
334
|
-
}
|
|
446
|
+
};
|
|
447
|
+
timer = setTimeout(look, LAST_RESORT_MS);
|
|
448
|
+
waiting.set(root, stop);
|
|
335
449
|
return false;
|
|
336
450
|
}
|
|
337
451
|
};
|
|
@@ -358,7 +472,7 @@ function useReturnFocus(open, root) {
|
|
|
358
472
|
if (!r) return;
|
|
359
473
|
const active = document.activeElement;
|
|
360
474
|
const lost = !active || active === document.body || !active.isConnected;
|
|
361
|
-
if (!root || lost || active instanceof Node && !!root.current?.contains(active)) r.restore();
|
|
475
|
+
if (!root || lost || active instanceof Node && !!root.current?.contains(active)) r.restore(void 0, true);
|
|
362
476
|
}, [open, root, before]);
|
|
363
477
|
useEffect(() => () => {
|
|
364
478
|
const r = remembered.current;
|
|
@@ -381,24 +495,27 @@ function mayStop(root) {
|
|
|
381
495
|
const disabled = (el) => (el instanceof HTMLButtonElement || el instanceof HTMLInputElement || el instanceof HTMLSelectElement || el instanceof HTMLTextAreaElement) && el.disabled;
|
|
382
496
|
return Array.from(root.querySelectorAll(`${FOCUSABLE}, button:disabled, input:disabled, select:disabled, textarea:disabled`)).filter((el) => disabled(el) ? !(el instanceof HTMLInputElement && el.type === "hidden") : isTabStop(el)).sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
|
|
383
497
|
}
|
|
384
|
-
|
|
498
|
+
var watched = /* @__PURE__ */ new WeakSet();
|
|
499
|
+
var hasSelfRemovalWatch = (control) => watched.has(control);
|
|
500
|
+
function focusAfterSelfRemoval(control, { item, group, to, samePage, defer, removedOnly, point } = {}) {
|
|
385
501
|
const goes = item ?? control;
|
|
386
502
|
const within = group === void 0 ? goes.parentElement : group;
|
|
387
503
|
const stops = within ? mayStop(within).filter((el) => !goes.contains(el)) : [];
|
|
388
504
|
const before = stops.filter((el) => goes.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING).reverse();
|
|
389
505
|
const after = stops.filter((el) => goes.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
390
506
|
const stopsOf = (el) => [...isTabStop(el) ? [el] : [], ...tabStops(el)];
|
|
391
|
-
const index = stopsOf(goes).indexOf(control);
|
|
392
507
|
const neighbour = (step) => {
|
|
508
|
+
const index = stopsOf(goes).indexOf(control);
|
|
393
509
|
for (let el = goes[step]; el; el = el[step]) {
|
|
394
510
|
const own = stopsOf(el);
|
|
395
511
|
if (own.length) return own[Math.max(0, Math.min(index, own.length - 1))];
|
|
396
512
|
}
|
|
397
513
|
return null;
|
|
398
514
|
};
|
|
399
|
-
const sameBefore = neighbour("previousElementSibling");
|
|
400
|
-
const sameAfter = neighbour("nextElementSibling");
|
|
401
|
-
const
|
|
515
|
+
const sameBefore = within ? neighbour("previousElementSibling") : null;
|
|
516
|
+
const sameAfter = within ? neighbour("nextElementSibling") : null;
|
|
517
|
+
const disabled = () => control.matches(":disabled");
|
|
518
|
+
const gone = () => !control.isConnected || !removedOnly && disabled();
|
|
402
519
|
const lost = () => {
|
|
403
520
|
const active = document.activeElement;
|
|
404
521
|
return !active || active === document.body || !active.isConnected || active === control;
|
|
@@ -408,32 +525,44 @@ function focusAfterSelfRemoval(control, { item, group, to } = {}) {
|
|
|
408
525
|
el.focus();
|
|
409
526
|
return document.activeElement === el;
|
|
410
527
|
};
|
|
411
|
-
const landOnGroup = () =>
|
|
412
|
-
|
|
413
|
-
if (!within.hasAttribute("tabindex") && within.tabIndex < 0) within.setAttribute("tabindex", "-1");
|
|
414
|
-
within.focus();
|
|
415
|
-
return document.activeElement === within;
|
|
416
|
-
};
|
|
528
|
+
const landOnGroup = () => !!within?.isConnected && focusForTheMoment(within);
|
|
529
|
+
const places = within ? [] : placesOf(goes);
|
|
417
530
|
const landTo = (el) => land(el) || !!el && el.isConnected && !isTabStop(el) && isRendered(el) && focusForTheMoment(el);
|
|
418
|
-
const place = () => landTo(typeof to === "function" ? to() : to) || land(sameBefore) || before.some(land) || land(sameAfter) || after.some(land) || landOnGroup();
|
|
531
|
+
const place = () => landTo(typeof to === "function" ? to() : to) || land(sameBefore) || before.some(land) || land(sameAfter) || after.some(land) || (within ? landOnGroup() : point ? landWhereTabGoes(point, places) : landLastResort(places));
|
|
419
532
|
if (typeof MutationObserver === "undefined") return () => {
|
|
420
533
|
};
|
|
421
|
-
const
|
|
534
|
+
const path = samePage && typeof location !== "undefined" ? pageAddress() : null;
|
|
535
|
+
const samePlace = () => path === null || pageAddress() === path;
|
|
536
|
+
let on = true;
|
|
537
|
+
const look = () => {
|
|
422
538
|
if (!gone()) return;
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
539
|
+
if (!defer) {
|
|
540
|
+
stop();
|
|
541
|
+
if (lost() && samePlace()) place();
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
observer.disconnect();
|
|
545
|
+
clearTimeout(timer);
|
|
546
|
+
setTimeout(() => {
|
|
547
|
+
if (typeof document === "undefined") return;
|
|
548
|
+
const act = on && gone() && lost() && samePlace();
|
|
549
|
+
stop();
|
|
550
|
+
if (act) place();
|
|
551
|
+
}, defer);
|
|
428
552
|
};
|
|
553
|
+
const observer = new MutationObserver(look);
|
|
429
554
|
const timer = setTimeout(() => stop(), 1e4);
|
|
555
|
+
const quit = onMovingOn(control, () => stop());
|
|
430
556
|
function stop() {
|
|
557
|
+
on = false;
|
|
431
558
|
observer.disconnect();
|
|
432
559
|
clearTimeout(timer);
|
|
433
|
-
|
|
560
|
+
watched.delete(control);
|
|
561
|
+
quit();
|
|
434
562
|
}
|
|
435
563
|
observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["disabled"] });
|
|
436
|
-
|
|
564
|
+
watched.add(control);
|
|
565
|
+
look();
|
|
437
566
|
return stop;
|
|
438
567
|
}
|
|
439
568
|
var layers = [];
|
|
@@ -776,6 +905,46 @@ function useNonModalDialog(root, active, onClose, isTop = ALWAYS_TOP) {
|
|
|
776
905
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
777
906
|
}, [active, root, isTop, onCloseRef]);
|
|
778
907
|
}
|
|
908
|
+
function cn(...inputs) {
|
|
909
|
+
return twMerge(clsx(inputs));
|
|
910
|
+
}
|
|
911
|
+
var GLASS_BACKDROP = "[backdrop-filter:var(--ds-glass-filter)] [-webkit-backdrop-filter:var(--ds-glass-filter)]";
|
|
912
|
+
var GLASS_SURFACE = `${GLASS_BACKDROP} shadow-[var(--ds-shadow-card),var(--ds-glass-inset)]`;
|
|
913
|
+
var GLASS_OVERLAY = `${GLASS_BACKDROP} shadow-[var(--ds-shadow-modal),var(--ds-glass-inset)]`;
|
|
914
|
+
var OVERLAY_SURFACE = "bg-[var(--ds-bg-surface)] supports-[color:oklch(from_red_l_c_h)]:bg-[oklch(from_var(--ds-bg-surface)_l_c_h_/_max(alpha,min(1,alpha*1000)*0.85))]";
|
|
915
|
+
var GLASS_DROPDOWN = `${GLASS_BACKDROP} shadow-[var(--ds-shadow-dropdown),var(--ds-glass-inset)]`;
|
|
916
|
+
var FOCUS_RING = "focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-[var(--ds-focus)] focus-visible:shadow-none";
|
|
917
|
+
var PEER_FOCUS_RING = "peer-focus-visible:outline-2 peer-focus-visible:outline-solid peer-focus-visible:outline-offset-2 peer-focus-visible:outline-[var(--ds-focus)] peer-focus-visible:shadow-none";
|
|
918
|
+
var GROUP_FOCUS_RING = "group-focus-visible:outline-2 group-focus-visible:outline-solid group-focus-visible:outline-offset-2 group-focus-visible:outline-[var(--ds-focus)] group-focus-visible:shadow-none";
|
|
919
|
+
var FOCUS_INSET = "focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-[var(--ds-focus-inset)] focus-visible:outline-[var(--ds-focus)]";
|
|
920
|
+
var FOCUS_INSET_WHILE_STOP = "data-[scroll-stop]:focus-visible:outline-2 data-[scroll-stop]:focus-visible:outline-solid data-[scroll-stop]:focus-visible:-outline-offset-[var(--ds-focus-inset)] data-[scroll-stop]:focus-visible:outline-[var(--ds-focus)]";
|
|
921
|
+
var FOCUS_ROOM = 4;
|
|
922
|
+
var atLeastFocusRoom = (length) => `max(${length}, ${FOCUS_ROOM}px)`;
|
|
923
|
+
var FIELD_FOCUS_RING = "focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-[var(--ds-focus)] focus-visible:border-[var(--ds-focus)] [[data-input-modality=pointer]_&]:focus-visible:outline-none [[data-input-modality=pointer]_&]:focus-visible:border-[var(--ds-accent-ink)] [[data-input-modality=pointer]_&]:focus-visible:ring-2 [[data-input-modality=pointer]_&]:focus-visible:ring-[var(--ds-ring-active)]";
|
|
924
|
+
var FIELD_FOCUS_WITHIN_RING = "has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:outline-2 has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:outline-solid has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:outline-offset-2 has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:outline-[var(--ds-focus)] has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:border-[var(--ds-focus)] [[data-input-modality=pointer]_&]:has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:outline-none [[data-input-modality=pointer]_&]:has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:border-[var(--ds-accent-ink)] [[data-input-modality=pointer]_&]:has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:ring-2 [[data-input-modality=pointer]_&]:has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:ring-[var(--ds-ring-active)]";
|
|
925
|
+
var FIELD_HAS_FOCUS_RING = "has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:outline-2 has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:outline-solid has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:outline-offset-2 has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:outline-[var(--ds-focus)] has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:border-[var(--ds-focus)] [[data-input-modality=pointer]_&]:has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:outline-none [[data-input-modality=pointer]_&]:has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:border-[var(--ds-accent-ink)] [[data-input-modality=pointer]_&]:has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:ring-2 [[data-input-modality=pointer]_&]:has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:ring-[var(--ds-ring-active)]";
|
|
926
|
+
var ERROR_FOCUS_RING = "focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-[var(--ds-focus)] focus-visible:border-[var(--ds-status-error)] [[data-input-modality=pointer]_&]:focus-visible:outline-none [[data-input-modality=pointer]_&]:focus-visible:ring-2 [[data-input-modality=pointer]_&]:focus-visible:ring-[var(--ds-ring-error)]";
|
|
927
|
+
var ERROR_FOCUS_WITHIN_RING = "has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:outline-2 has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:outline-solid has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:outline-offset-2 has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:outline-[var(--ds-focus)] has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:border-[var(--ds-status-error)] [[data-input-modality=pointer]_&]:has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:outline-none [[data-input-modality=pointer]_&]:has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:ring-2 [[data-input-modality=pointer]_&]:has-[:focus:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus))]:ring-[var(--ds-ring-error)]";
|
|
928
|
+
var ERROR_HAS_FOCUS_RING = "has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:outline-2 has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:outline-solid has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:outline-offset-2 has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:outline-[var(--ds-focus)] has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:border-[var(--ds-status-error)] [[data-input-modality=pointer]_&]:has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:outline-none [[data-input-modality=pointer]_&]:has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:ring-2 [[data-input-modality=pointer]_&]:has-[:focus-visible:not(button,select,a,[role=button],input[type=checkbox],input[type=radio],[role=checkbox],[role=radio],[role=switch])]:[&:not(:has([role=dialog]_:focus-visible))]:ring-[var(--ds-ring-error)]";
|
|
929
|
+
var ACTIVE_RING = "border-[var(--ds-accent-ink)] ring-2 ring-[var(--ds-ring-active)]";
|
|
930
|
+
var ERROR_ACTIVE_RING = "border-[var(--ds-status-error)] ring-2 ring-[var(--ds-ring-error)]";
|
|
931
|
+
var scrollLockCount = 0;
|
|
932
|
+
var scrollLockPreviousOverflow = "";
|
|
933
|
+
function lockBodyScroll() {
|
|
934
|
+
if (scrollLockCount === 0) {
|
|
935
|
+
scrollLockPreviousOverflow = document.body.style.overflow;
|
|
936
|
+
document.body.style.overflow = "hidden";
|
|
937
|
+
}
|
|
938
|
+
scrollLockCount++;
|
|
939
|
+
}
|
|
940
|
+
function unlockBodyScroll() {
|
|
941
|
+
if (scrollLockCount === 0) return;
|
|
942
|
+
scrollLockCount--;
|
|
943
|
+
if (scrollLockCount === 0) {
|
|
944
|
+
document.body.style.overflow = scrollLockPreviousOverflow;
|
|
945
|
+
scrollLockPreviousOverflow = "";
|
|
946
|
+
}
|
|
947
|
+
}
|
|
779
948
|
var VIEWPORT_PADDING = 8;
|
|
780
949
|
function usePosition(triggerRef, floatingRef, open, options = {}) {
|
|
781
950
|
const { side = "bottom", align = "center", offset = 8, flip = true } = options;
|
|
@@ -850,6 +1019,6 @@ function usePosition(triggerRef, floatingRef, open, options = {}) {
|
|
|
850
1019
|
return pos;
|
|
851
1020
|
}
|
|
852
1021
|
|
|
853
|
-
export { CONTROL_ANCESTOR, FIELD, FOCUSABLE, OVERLAY_CLOSE_ATTR, ZOOM_KEYS, focusAfterRemoval, focusAfterSelfRemoval, focusInitial, inertOutside, isTabStop, rememberFocus, rememberOpener, rovingTabStop, tabStops, useCloseOnFocusOut, useFocusBeforeOpen, useFocusKeptInList, useFocusLeave, useFocusTrap, useGridKeyboard, useLatest, useNonModalDialog, useOverlayLayer, usePopupFocus, usePosition, usePressMarks, useReturnFocus };
|
|
854
|
-
//# sourceMappingURL=chunk-
|
|
855
|
-
//# sourceMappingURL=chunk-
|
|
1022
|
+
export { ACTIVE_RING, CONTROL_ANCESTOR, ERROR_ACTIVE_RING, ERROR_FOCUS_RING, ERROR_FOCUS_WITHIN_RING, ERROR_HAS_FOCUS_RING, FIELD, FIELD_FOCUS_RING, FIELD_FOCUS_WITHIN_RING, FIELD_HAS_FOCUS_RING, FOCUSABLE, FOCUS_INSET, FOCUS_INSET_WHILE_STOP, FOCUS_RING, FOCUS_ROOM, GLASS_BACKDROP, GLASS_DROPDOWN, GLASS_OVERLAY, GLASS_SURFACE, GROUP_FOCUS_RING, LAST_RESORT_MS, OPEN_TO_FOCUS, OVERLAY_CLOSE_ATTR, OVERLAY_SURFACE, PEER_FOCUS_RING, ZOOM_KEYS, atLeastFocusRoom, cn, focusAfterRemoval, focusAfterSelfRemoval, focusInitial, focusOutOf, hasSelfRemovalWatch, hasTabStop, inertOutside, isTabStop, lockBodyScroll, openToFocus, pageAddress, pointOf, rememberFocus, rememberOpener, rovingTabStop, tabStops, unlockBodyScroll, useCloseOnFocusOut, useFocusBeforeOpen, useFocusKeptInList, useFocusLeave, useFocusTrap, useGridKeyboard, useLatest, useNonModalDialog, useOverlayLayer, usePopupFocus, usePosition, usePressMarks, useReturnFocus };
|
|
1023
|
+
//# sourceMappingURL=chunk-EZ3ZGFGA.js.map
|
|
1024
|
+
//# sourceMappingURL=chunk-EZ3ZGFGA.js.map
|