gridsmith-ui 0.31.1 → 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 +46 -1
- package/dist/charts.d.ts +101 -30
- package/dist/charts.js +180 -105
- package/dist/charts.js.map +1 -1
- package/dist/chat.js +6 -6
- package/dist/{chunk-EZ3ZGFGA.js → chunk-2724SJO2.js} +12 -4
- package/dist/chunk-2724SJO2.js.map +1 -0
- package/dist/{chunk-IZW5XHKA.js → chunk-DO6DLTFK.js} +10 -8
- package/dist/chunk-DO6DLTFK.js.map +1 -0
- package/dist/{chunk-KSJTMSYA.js → chunk-H732QL56.js} +4 -4
- package/dist/{chunk-KSJTMSYA.js.map → chunk-H732QL56.js.map} +1 -1
- package/dist/{chunk-DR6WEI3A.js → chunk-HCEHTJ5E.js} +3 -3
- package/dist/{chunk-DR6WEI3A.js.map → chunk-HCEHTJ5E.js.map} +1 -1
- package/dist/{chunk-2TCCSKL3.js → chunk-HUVZQOU4.js} +5 -5
- package/dist/{chunk-2TCCSKL3.js.map → chunk-HUVZQOU4.js.map} +1 -1
- package/dist/{chunk-TH272DIC.js → chunk-JHZ22HQP.js} +75 -24
- package/dist/chunk-JHZ22HQP.js.map +1 -0
- package/dist/{chunk-I6JJ7KKP.js → chunk-NGZJK57C.js} +14 -10
- package/dist/chunk-NGZJK57C.js.map +1 -0
- package/dist/{chunk-BHTAVJIG.js → chunk-OVHM55JF.js} +5 -5
- package/dist/{chunk-BHTAVJIG.js.map → chunk-OVHM55JF.js.map} +1 -1
- package/dist/{chunk-NDL2JGQ7.js → chunk-QY2RA2HO.js} +5 -5
- package/dist/{chunk-NDL2JGQ7.js.map → chunk-QY2RA2HO.js.map} +1 -1
- package/dist/{chunk-W3GY5ROH.js → chunk-R2IAK3J3.js} +3 -3
- package/dist/{chunk-W3GY5ROH.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-IOHGE4EW.js → chunk-SIEU4H3H.js} +8 -8
- 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-K3NAFQ4S.js → chunk-TMPPBXX3.js} +3 -3
- package/dist/{chunk-K3NAFQ4S.js.map → chunk-TMPPBXX3.js.map} +1 -1
- package/dist/{chunk-SLGGZ3MU.js → chunk-WSKPESAX.js} +12 -10
- package/dist/chunk-WSKPESAX.js.map +1 -0
- package/dist/{chunk-HQFTP7Y5.js → chunk-XBVZIN26.js} +4 -4
- package/dist/{chunk-HQFTP7Y5.js.map → chunk-XBVZIN26.js.map} +1 -1
- package/dist/data-grid.js +9 -9
- package/dist/data-grid.js.map +1 -1
- package/dist/editor-mentions.js +2 -2
- package/dist/editor.js +3 -2
- package/dist/editor.js.map +1 -1
- package/dist/index.d.ts +44 -6
- package/dist/index.js +436 -213
- package/dist/index.js.map +1 -1
- package/dist/kanban.js +9 -9
- package/dist/resizable.d.ts +11 -2
- package/dist/resizable.js +96 -22
- package/dist/resizable.js.map +1 -1
- package/dist/roots.css +2 -2
- package/dist/tokens.css +6 -6
- package/dist/virtualized.js +9 -8
- package/dist/virtualized.js.map +1 -1
- package/dist-static/tokens.css +6 -6
- package/package.json +1 -1
- package/dist/chunk-DBHVJ7Z3.js.map +0 -1
- package/dist/chunk-EZ3ZGFGA.js.map +0 -1
- package/dist/chunk-I6JJ7KKP.js.map +0 -1
- package/dist/chunk-IOHGE4EW.js.map +0 -1
- package/dist/chunk-IZW5XHKA.js.map +0 -1
- package/dist/chunk-SLGGZ3MU.js.map +0 -1
- package/dist/chunk-TH272DIC.js.map +0 -1
- package/dist/chunk-V73LHNRL.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../showcase/src/lib/control-looks.ts","../../../showcase/src/lib/filter-row.ts","../../../showcase/src/components/Input.tsx","../../../showcase/src/components/InlineFieldError.tsx","../../../showcase/src/components/Field.tsx","../../../showcase/src/components/Dropdown.tsx"],"names":["jsxs","jsx","createContext","useContext","useEffect","useId","useState","useRef","useCallback","useLayoutEffect"],"mappings":";;;;;;;;;;;;;AAOO,IAAM,UAAA,GAAa;AAGnB,IAAM,eAAA,GAAkB;AAMxB,IAAM,gBAAA,GAAmB;AAMzB,IAAM,cAAA,GAAiB;AAGvB,IAAM,eAAA,GAAkB;AAGxB,IAAM,kBAAA,GAAqB;ACrB3B,IAAM,gBAAA,GAAmB,cAAc,KAAK;AAO5C,IAAM,kBAAA,GAAqB,sBAAA;ACFlC,IAAM,YAAA,0BAAsB,cAAc,CAAA;AAC1C,IAAM,OAAA,GAAU,CAAC,CAAA,KAAsC;AACrD,EAAA,MAAM,IAAI,CAAA,CAAE,MAAA;AACZ,EAAA,IAAI,CAAC,GAAG,OAAO,MAAA;AACf,EAAA,OAAO,CAAA,YAAa,gBAAA,KAAqB,CAAA,CAAE,IAAA,KAAS,UAAA,IAAc,EAAE,IAAA,KAAS,OAAA,CAAA,GAAW,CAAA,CAAE,OAAA,GAAU,CAAA,CAAE,KAAA;AACxG,CAAA;AAOA,IAAM,YAAA,GAA0C;AAAA,EAC9C,EAAA,EAAI,iCAAA;AAAA,EACJ,EAAA,EAAI,iCAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAEA,IAAM,UAAA,GAAwC;AAAA,EAC5C,EAAA,EAAI,yBAAA;AAAA,EACJ,EAAA,EAAI,yBAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAEO,SAAS,KAAA,CAAM,EAAE,SAAA,EAAW,IAAA,EAAM,QAAA,EAAU,KAAA,GAAQ,KAAA,EAAO,MAAA,EAAQ,MAAA,EAAQ,GAAG,KAAA,EAAM,EAAmJ;AAE5O,EAAA,gBAAA,EAAiB;AACjB,EAAA,MAAM,WAA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,QAAA;AAAA,MACL,kBAAgB,GAAA,CAAI,EAAA;AAAA,MACpB,eAAA,EAAe,UAAA;AAAA,MACf,QAAA,EAAU,UAAU,CAAA,GAAI,EAAA;AAAA,MACxB,OAAA,EAAS,MAAM,QAAA,CAAS,GAAA,CAAI,EAAE,CAAA;AAAA,MAC9B,SAAA,EAAW,EAAA;AAAA,QACT,+DAAA;AAAA,QACA,8CAAA;AAAA;AAAA,QAEA,UAAA;AAAA,QACA,IAAA,KAAS,OAAO,yBAAA,GAA4B,2BAAA;AAAA,QAC5C,UAAA,IAAc,CAAC,QAAA,GACX,gEAAA,GACA;AAAA,OACN;AAAA,MAEC,QAAA,EAAA;AAAA,QAAA,QAAA,oBACCC,GAAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAW,EAAA;AAAA,cACT,sKAAA;AAAA,cACA,aACI,iEAAA,GACA;AAAA,aACN;AAAA,YAEC,QAAA,EAAA,UAAA,oBAAcA,GAAAA,CAAC,IAAA,EAAA,EAAK,MAAK,OAAA,EAAQ,IAAA,EAAM,EAAA,EAAI,SAAA,EAAU,kCAAA,EAAmC;AAAA;AAAA,SAC3F;AAAA,wBAEFA,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAU,cAAI,KAAA,EAAM,CAAA;AAAA,QACnC,UAAA,IAAc,CAAC,QAAA,oBAAYA,GAAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,OAAA,EAAQ,IAAA,EAAM,IAAA,KAAS,IAAA,GAAO,EAAA,GAAK,EAAA,EAAI;AAAA;AAAA;AAAA,GAChF;AAEJ","file":"chunk-DO6DLTFK.js","sourcesContent":["/**\n * Sprint 25.14 A20: the checked and switched looks, shared by the controls (Checkbox, RadioGroup, Toggle) and the Card's\n * selection indicators, so the two never drift apart (the review of 30 September: the Card kept the old switch, the\n * accent's gradient and the accent dot after the controls moved).\n */\n\n/** A checked box's fill and a selected radio's dot: the check colour, with the theme's check gradient (by default the accent's) over it. */\nexport const CHECK_FILL = \"bg-[var(--ds-check-bg)] [background-image:var(--ds-check-gradient,var(--ds-gradient))]\";\n\n/** A switch's track when on: the check colour, as a checked box's. */\nexport const SWITCH_TRACK_ON = \"bg-[var(--ds-check-bg)] border-transparent\";\n\n/**\n * A switch's track when off: from tokens only a regenerated stylesheet has (the theme writers emit them), falling back\n * to the switch as it was, so an app that hasn't regenerated never gets an outline in its old, fainter edge colour.\n */\nexport const SWITCH_TRACK_OFF = \"bg-[var(--ds-switch-off-fill,var(--ds-bg-muted))] border-[var(--ds-switch-off-edge,var(--ds-border-default))]\";\n\n/**\n * A switch's knob when on: the surface made opaque (a glass theme's half-white surface would show the track through it),\n * as pinned table cells are (D31); a surface that is wholly transparent stays so.\n */\nexport const SWITCH_KNOB_ON = \"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)))]\";\n\n/** A switch's knob when off: the edge colour, beside the outline (the same fallback as the track). */\nexport const SWITCH_KNOB_OFF = \"bg-[var(--ds-switch-off-knob,var(--ds-bg-surface))]\";\n\n/** The knob moves and changes colour together with its track, so it never shows before the track does. */\nexport const SWITCH_KNOB_MOTION = \"transition-[transform,background-color] duration-[var(--ds-transition-speed)]\";\n","import { createContext } from \"react\";\n\n/**\n * A row of filters (PageHeader's filters slot) tells the controls in it that they are in one, so a text field takes a\n * search field's width, the table toolbar's (280 px), instead of a line of its own (the owner's\n * look at a bold header with content overlap, 30 September 2026: the search box filled a whole line).\n */\nexport const FilterRowContext = createContext(false);\n\n/**\n * A text field's width in a filter row: the toolbar search's 280 px, never wider than the row. A set width, not a flex\n * basis: a row that hugs its controls (the strip on a bold band) sizes itself from their widths, and a basis it doesn't\n * count pushed the field onto a line of its own.\n */\nexport const FILTER_FIELD_WIDTH = \"w-[280px] max-w-full\";\n","import { useCallback, useContext, useEffect, useRef, type Ref } from \"react\";\nimport { cn, FIELD_FOCUS_RING, FIELD_HAS_FOCUS_RING, ERROR_FOCUS_RING, ERROR_HAS_FOCUS_RING, FOCUS_RING } from \"../lib/utils\";\nimport { useInputModality } from \"../lib/input-modality\";\nimport type { ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, LabelHTMLAttributes } from \"react\";\nimport { ControlSizeContext } from \"./Button\";\nimport { useReportedChange } from \"../lib/form-context\";\nimport { warnNameLeftOut } from \"../lib/dev-warn\";\nimport { SWITCH_KNOB_MOTION, SWITCH_KNOB_OFF, SWITCH_KNOB_ON, SWITCH_TRACK_OFF, SWITCH_TRACK_ON } from \"../lib/control-looks\";\nimport { FILTER_FIELD_WIDTH, FilterRowContext } from \"../lib/filter-row\";\n\n/** A native field's new value from its change event: `checked` for a box, `value` for the rest (Sprint 25.12 A15). */\n/** An uncontrolled field's value, which no edit equals: the field holds its value itself. */\nconst UNCONTROLLED = Symbol(\"uncontrolled\");\nconst valueOf = (e: { target: EventTarget | null }) => {\n const t = e.target as HTMLInputElement | HTMLTextAreaElement | null;\n if (!t) return undefined;\n return t instanceof HTMLInputElement && (t.type === \"checkbox\" || t.type === \"radio\") ? t.checked : t.value;\n};\n\ntype InputSize = \"sm\" | \"md\" | \"lg\";\n\n// \"prefix\" must be omitted from the inherited attributes: React's HTMLAttributes\n// declares the RDFa attribute `prefix?: string`, and intersecting it with\n// `prefix?: ReactNode` collapses the prop to string-only at use sites.\nconst INPUT_HEIGHT: Record<InputSize, string> = {\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\nconst INPUT_TEXT: Record<InputSize, string> = {\n sm: \"px-ds-2 py-ds-1 text-xs\",\n md: \"px-ds-3 py-ds-2 text-sm\",\n lg: \"px-ds-4 py-ds-3 text-base\",\n};\n\nexport function Input({ className, size: sizeProp, error = false, prefix, suffix, ...props }: Omit<InputHTMLAttributes<HTMLInputElement>, \"size\" | \"prefix\"> & { size?: InputSize; error?: boolean; prefix?: ReactNode; suffix?: ReactNode }) {\n // a field: clicked into, the active look; reached with Tab, the outline (Sprint 30, lib/input-modality.ts)\n useInputModality();\n const contextSize = useContext(ControlSizeContext);\n const size = sizeProp ?? contextSize ?? \"md\";\n // in a row of filters, a search field's width rather than a line of its own (the owner, 30 September)\n const width = useContext(FilterRowContext) ? FILTER_FIELD_WIDTH : \"w-full\";\n // Sprint 25.12 A15: the user's typing marks the form's overlay (only a new value); the page's onChange runs as given.\n // Uncontrolled (defaultValue), every edit is new: clearing a prefilled field compared \"\" with no value (0.21.0).\n const onChange = useReportedChange(props.onChange, props.value === undefined ? UNCONTROLLED : props.value, valueOf);\n const borderColor = error ? \"border-[var(--ds-status-error)]\" : \"border-[var(--ds-input-border)]\";\n const hoverBorder = !error && !props.disabled && !props.readOnly ? \"hover:border-[var(--ds-input-border-hover)]\" : \"\";\n\n if (prefix || suffix) {\n return (\n <div\n className={cn(\n \"flex items-center\", width,\n INPUT_HEIGHT[size],\n \"bg-[var(--ds-input-bg)]\",\n \"border-[length:var(--ds-border-width)]\", borderColor,\n \"rounded-[var(--ds-radius-md)]\",\n \"shadow-[var(--ds-input-shadow)]\",\n hoverBorder,\n error ? ERROR_HAS_FOCUS_RING : FIELD_HAS_FOCUS_RING,\n \"transition-colors duration-[var(--ds-transition-speed)]\",\n props.disabled && \"cursor-not-allowed opacity-disabled\",\n props.readOnly && \"bg-[var(--ds-bg-muted)] cursor-default\",\n className\n )}\n >\n {prefix && <span className=\"shrink-0 pl-ds-3 text-[var(--ds-text-muted)] flex items-center\">{prefix}</span>}\n <input\n aria-invalid={error || undefined}\n className={cn(\n \"flex-1 min-w-0 bg-transparent outline-none\",\n INPUT_TEXT[size],\n \"text-[var(--ds-text-primary)]\",\n \"placeholder:text-[var(--ds-text-muted)]\",\n \"disabled:cursor-not-allowed\",\n \"read-only:text-[var(--ds-text-secondary)] read-only:cursor-default\",\n )}\n {...props}\n onChange={props.onChange || props.value === undefined ? onChange : undefined}\n />\n {suffix && <span className=\"shrink-0 pr-ds-3 text-[var(--ds-text-muted)] flex items-center\">{suffix}</span>}\n </div>\n );\n }\n\n return (\n <input\n aria-invalid={error || undefined}\n className={cn(\n \"flex\", width,\n INPUT_TEXT[size], INPUT_HEIGHT[size],\n \"bg-[var(--ds-input-bg)] text-[var(--ds-text-primary)]\",\n \"border-[length:var(--ds-border-width)]\", borderColor,\n \"rounded-[var(--ds-radius-md)]\",\n \"shadow-[var(--ds-input-shadow)]\",\n \"placeholder:text-[var(--ds-text-muted)]\",\n hoverBorder,\n error ? ERROR_FOCUS_RING : FIELD_FOCUS_RING,\n \"disabled:cursor-not-allowed disabled:opacity-disabled\",\n \"read-only:bg-[var(--ds-bg-muted)] read-only:text-[var(--ds-text-secondary)] read-only:cursor-default\",\n \"transition-colors duration-[var(--ds-transition-speed)]\",\n className\n )}\n {...props}\n onChange={props.onChange || props.value === undefined ? onChange : undefined}\n />\n );\n}\n\ninterface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n autoResize?: boolean;\n maxRows?: number;\n error?: boolean;\n ref?: Ref<HTMLTextAreaElement>;\n}\n\nexport function Textarea({ className, autoResize, maxRows, error = false, ref, ...props }: TextareaProps) {\n // a field, as Input (Sprint 30)\n useInputModality();\n // Sprint 25.12 A15: as Input\n const onChange = useReportedChange(props.onChange, props.value === undefined ? UNCONTROLLED : props.value, valueOf);\n const internalRef = useRef<HTMLTextAreaElement>(null);\n const textareaRef = (ref ?? internalRef) as React.RefObject<HTMLTextAreaElement>;\n\n const resize = useCallback(() => {\n const el = textareaRef.current;\n if (!el || !autoResize) return;\n el.style.height = \"auto\";\n let target = el.scrollHeight;\n if (maxRows) {\n const lineHeight = parseFloat(getComputedStyle(el).lineHeight) || 20;\n const maxHeight = lineHeight * maxRows + parseFloat(getComputedStyle(el).paddingTop) + parseFloat(getComputedStyle(el).paddingBottom);\n target = Math.min(target, maxHeight);\n }\n el.style.height = `${target}px`;\n }, [autoResize, maxRows, textareaRef]);\n\n useEffect(() => { resize(); }, [resize, props.value, props.defaultValue]);\n\n return (\n <textarea\n ref={textareaRef}\n aria-invalid={error || undefined}\n className={cn(\n \"flex min-h-[var(--ds-control-height-md)] w-full px-ds-3 py-ds-2 text-sm\",\n \"bg-[var(--ds-input-bg)] text-[var(--ds-text-primary)]\",\n \"border-[length:var(--ds-border-width)]\",\n error ? \"border-[var(--ds-status-error)]\" : \"border-[var(--ds-input-border)] hover:border-[var(--ds-input-border-hover)]\",\n \"rounded-[var(--ds-radius-md)]\",\n \"shadow-[var(--ds-input-shadow)]\",\n \"placeholder:text-[var(--ds-text-muted)]\",\n error ? ERROR_FOCUS_RING : FIELD_FOCUS_RING,\n \"disabled:cursor-not-allowed disabled:opacity-disabled disabled:hover:border-[var(--ds-input-border)]\",\n \"read-only:bg-[var(--ds-bg-muted)] read-only:text-[var(--ds-text-secondary)] read-only:cursor-default read-only:hover:border-[var(--ds-input-border)]\",\n \"transition-colors duration-[var(--ds-transition-speed)]\",\n autoResize && \"resize-none overflow-hidden\",\n className\n )}\n onInput={autoResize ? resize : undefined}\n {...props}\n onChange={props.onChange || props.value === undefined ? onChange : undefined}\n />\n );\n}\n\nexport function Label({ className, children, ...props }: LabelHTMLAttributes<HTMLLabelElement>) {\n return (\n <label\n className={cn(\n \"text-sm font-medium leading-none text-[var(--ds-text-secondary)]\",\n \"peer-disabled:cursor-not-allowed peer-disabled:opacity-disabled\",\n className\n )}\n {...props}\n >\n {children}\n </label>\n );\n}\n\nexport type ToggleLayout = \"full\" | \"compact\";\nexport type ToggleSize = \"sm\" | \"md\";\n\n// Track width/height and thumb diameter; the thumb sits 1px inside the border.\nconst TOGGLE_SIZES: Record<ToggleSize, { w: number; h: number; thumb: number }> = {\n sm: { w: 32, h: 18, thumb: 12 },\n md: { w: 44, h: 24, thumb: 16 },\n};\n\nexport function Toggle({ checked, onChange, label, disabled, error = false, layout = \"full\", size = \"md\", \"aria-label\": pageLabel, \"aria-labelledby\": pageLabelledBy, ...rest }: { checked: boolean; onChange: (v: boolean) => void; label?: string; disabled?: boolean; error?: boolean; layout?: ToggleLayout; size?: ToggleSize; \"aria-labelledby\"?: string } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"onChange\">) {\n // its own label on screen leads its name, which a page's aria-label or aria-labelledby beside it would replace (the final\n // review of 0.31.0, 1; WCAG 2.5.3); a Field's label leaves them out before they reach here\n useEffect(() => {\n if (!label) return;\n if (pageLabel) warnNameLeftOut(\"Toggle\", \"aria-label\", pageLabel, \"its own label\");\n if (pageLabelledBy) warnNameLeftOut(\"Toggle\", \"aria-labelledby\", pageLabelledBy, \"its own label\");\n }, [label, pageLabel, pageLabelledBy]);\n const ariaLabel = label ? undefined : pageLabel;\n const ariaLabelledBy = label ? undefined : pageLabelledBy;\n // Sprint 25.12 A15: a flip is a change, reported to the form's overlay\n const change = useReportedChange(onChange, checked);\n const dims = TOGGLE_SIZES[size];\n const travel = dims.w - dims.thumb - 3;\n const switchButton = (\n <button type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n // \"Toggle\" only where nothing names it: an id is for a label (a Field's <label for>), as TagInput's\n aria-label={ariaLabel ?? (!label && !ariaLabelledBy && !rest.id ? \"Toggle\" : undefined)}\n aria-labelledby={ariaLabelledBy}\n aria-invalid={error || undefined}\n disabled={disabled}\n onClick={() => !disabled && change(!checked)}\n {...rest}\n className={cn(\n \"relative inline-flex shrink-0 items-center overflow-hidden\",\n \"border-[length:var(--ds-border-width)]\",\n \"rounded-[var(--ds-radius-full)]\",\n \"transition-colors duration-[var(--ds-transition-speed)]\",\n FOCUS_RING,\n disabled ? \"cursor-not-allowed\" : \"cursor-pointer\",\n // Sprint 25.14 A20: on, the checked colour, as a checkbox's; off, the outline in the edge colour (lib/control-looks.ts)\n checked ? SWITCH_TRACK_ON : SWITCH_TRACK_OFF,\n error && \"border-[var(--ds-status-error)]\"\n )}\n style={{ width: dims.w, height: dims.h }}\n >\n <span\n className={cn(\n \"pointer-events-none inline-block shrink-0\",\n // on: the surface made opaque; off: the edge colour, beside the outline\n checked ? SWITCH_KNOB_ON : SWITCH_KNOB_OFF,\n \"border-[length:var(--ds-border-width)] border-transparent\",\n \"rounded-[var(--ds-radius-full)]\",\n SWITCH_KNOB_MOTION\n )}\n style={{\n width: dims.thumb,\n height: dims.thumb,\n transform: checked\n ? `translateX(calc(${travel}px - var(--ds-border-width)))`\n : \"translateX(calc(1px + var(--ds-border-width)))\",\n }}\n />\n </button>\n );\n\n if (!label) {\n return <div className={cn(disabled && \"opacity-disabled\")}>{switchButton}</div>;\n }\n\n return (\n <label\n className={cn(\n layout === \"full\"\n ? \"flex items-center justify-between gap-ds-4\"\n : \"inline-flex items-center gap-ds-3\",\n disabled ? \"cursor-not-allowed opacity-disabled\" : \"cursor-pointer\",\n )}\n >\n <span className=\"text-sm font-medium text-[var(--ds-text-primary)]\">{label}</span>\n {switchButton}\n </label>\n );\n}\n","import { cn } from \"../lib/utils\";\nimport { Icon } from \"../lib/icons\";\n\ninterface InlineFieldErrorProps {\n message: string;\n id: string;\n className?: string;\n}\n\nexport function InlineFieldError({ message, id, className }: InlineFieldErrorProps) {\n return (\n <p\n id={id}\n role=\"alert\"\n className={cn(\n \"flex items-center gap-ds-1.5 text-xs text-[var(--ds-status-error-text)]\",\n \"mt-ds-1.5\",\n className\n )}\n >\n {/* the words take the status's words colour (Sprint 30, P10); the icon, a mark, keeps the status colour */}\n <Icon name=\"error\" size={14} className=\"shrink-0 text-[var(--ds-status-error)]\" />\n <span>{message}</span>\n </p>\n );\n}\n","import { Children, cloneElement, createContext, isValidElement, useContext, useEffect, useId, useLayoutEffect, useMemo, useState, type ReactElement, type ReactNode } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { useLatest } from \"../lib/use-latest\";\nimport { useFocusLeave } from \"../lib/focus\";\nimport { useOptionalFormContext } from \"../lib/form-context\";\nimport { Label } from \"./Input\";\nimport { InlineFieldError } from \"./InlineFieldError\";\nimport { warnNameLeftOut } from \"../lib/dev-warn\";\n\nexport interface FieldControlProps {\n id: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: true;\n \"aria-required\"?: true;\n required?: boolean;\n /** Set on Gridsmith form components (Input, Textarea, Dropdown, DatePicker, …). */\n error?: boolean;\n}\n\n/**\n * What a control inside a Field knows about it (Sprint 25.7, C5): the label's id, for a control that `<label for>`\n * cannot name (a slider is a div with role=\"slider\") to take it with aria-labelledby, and the hint and error ids.\n */\nexport interface FieldContextValue {\n controlId: string;\n labelId: string;\n describedBy?: string;\n /** The Field shows an error. */\n invalid?: boolean;\n required?: boolean;\n /** Its label is read but not shown (`hideLabel`): no words on screen for the control's name to start with. */\n labelHidden?: boolean;\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null);\n\n/** The Field a control sits in, or null. */\nexport function useField(): FieldContextValue | null {\n return useContext(FieldContext);\n}\n\n/**\n * The parts of a control that has several (Sprint 25.19 R2: RecurrencePicker's custom repeat), each with a label of its\n * own: inside, no control takes the Field's id, label, description or error, which name the control's main part only.\n */\nexport function OutsideField({ children }: { children: ReactNode }) {\n return <FieldContext.Provider value={null}>{children}</FieldContext.Provider>;\n}\n\n/** The wiring a control may be given as props: by a Field's clone, or by a page that labels it itself. */\nexport interface FieldControlWiring {\n id?: string;\n /**\n * A name the page gives the control where nothing on screen names it (a row's checkbox, a filter's dropdown). It\n * names the control's focusable element, or its group (Sprint 25.8.7 item 22: TSX checks no hyphenated attribute,\n * so a control that didn't declare it dropped it silently).\n */\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: boolean | \"true\" | \"false\";\n \"aria-required\"?: boolean | \"true\" | \"false\";\n required?: boolean;\n error?: boolean;\n}\n\n/**\n * What a Gridsmith control that is not a native input takes from the Field it sits in, merged with its own props, which\n * win (round 27 review: Dropdown, DatePicker and SegmentedControl dropped the Field's id and description, so the error\n * summary read \"A field: Needs attention\" with no link, and a screen reader heard the placeholder as the name):\n * - `id`, for the Field's `<label for>`, the summary's link and the focus after a submit;\n * - `labelId`, the label that names it by aria-labelledby, which reaches a button, a group or a radiogroup alike;\n * - `describedBy`, the hint and the error, each id once;\n * - `invalid` and `required`. A role that cannot carry aria-required (a button, a group) says it in its description\n * instead: `requiredNote` is the hidden text, already in `describedBy`, for the control to render.\n * Outside a Field a control gets its own props back.\n *\n * The name, one rule for every such control (the final review of Sprint 25.31, 2): a label on screen, the control's own\n * (`ownLabel`) or its Field's, always leads it, since a name must start with the words on screen (WCAG 2.5.3). A page's\n * `aria-label` or `aria-labelledby` beside one is left out of the name, and a development warning names `component`.\n * With none on screen, ARIA's own order: the page's `aria-labelledby`, else its `aria-label`, else a Field label that\n * isn't shown. A Field applies the same rule to a control that takes no part in it (an Input, a Toggle): see Field.\n */\nexport function useFieldControl(own: FieldControlWiring, options: {\n requiredInDescription?: boolean;\n /** The control, as a page writes it, for the warning: \"Dropdown\". */\n component?: string;\n /** The control's own label on screen: its element's id, or true where it names the control natively (a <label>). */\n ownLabel?: string | true;\n} = {}): {\n id?: string;\n /** The page's aria-label, where no label on screen names the control: the control puts it on what it names. */\n label?: string;\n /**\n * What names it by aria-labelledby: the label on screen (its own, else its Field's; none where its own names it\n * natively), else the page's aria-labelledby, else, where the page gave no aria-label, a Field label that isn't shown.\n */\n labelId?: string;\n /** A label on screen names it, its own or its Field's: the page's names are left out. */\n shown: boolean;\n describedBy?: string;\n invalid: boolean;\n required: boolean;\n requiredNote: ReactNode;\n} {\n const field = useField();\n const id = own.id ?? field?.controlId;\n const invalid = !!own.error || own[\"aria-invalid\"] === true || own[\"aria-invalid\"] === \"true\" || !!field?.invalid;\n const required = !!own.required || own[\"aria-required\"] === true || own[\"aria-required\"] === \"true\" || !!field?.required;\n const noteId = options.requiredInDescription && required && id ? `${id}-required` : undefined;\n const ids = [own[\"aria-describedby\"], field?.describedBy, noteId].filter(Boolean).join(\" \").split(/\\s+/).filter(Boolean);\n const { ownLabel, component } = options;\n const fieldShown = !!field && !field.labelHidden;\n const shown = !!ownLabel || fieldShown;\n const pageLabel = own[\"aria-label\"], pageLabelledBy = own[\"aria-labelledby\"];\n useEffect(() => {\n if (!shown) return;\n const whose = ownLabel ? \"its own label\" : \"its Field's label\";\n for (const [attr, value] of [[\"aria-label\", pageLabel], [\"aria-labelledby\", pageLabelledBy]] as const) {\n if (value) warnNameLeftOut(component ?? \"A Field's control\", attr, value, whose);\n }\n }, [shown, ownLabel, component, pageLabel, pageLabelledBy]);\n return {\n id,\n label: shown ? undefined : pageLabel,\n // with none on screen, ARIA's own order: the page's aria-labelledby, its aria-label, then a Field label that isn't shown\n // (the final review of 0.31.0, 3: a hidden \"Select\" had named every row's box, over the page's \"Select Alice\")\n labelId: shown ? (typeof ownLabel === \"string\" ? ownLabel : ownLabel ? undefined : field?.labelId) : pageLabelledBy ?? (pageLabel ? undefined : field?.labelId),\n shown,\n describedBy: [...new Set(ids)].join(\" \") || undefined,\n invalid,\n required,\n requiredNote: noteId ? <span id={noteId} hidden>Required</span> : null,\n };\n}\n\n/**\n * A field's label: any text or element, never nothing. Sprint 25.12 A31 (R28-59): run 75 labelled only the first of its\n * repeated rows (`label={index === 0 ? … : undefined}`), and every other row's fields had no name. A label that\n * shouldn't show takes `hideLabel`; repeated rows use AddAnother, which shows each label once.\n */\nexport type FieldLabel = Exclude<ReactNode, null | undefined | boolean>;\n\n/** Set by AddAnother around each row: a hidden label shows again when the group is too narrow for its headings. */\nexport const AddAnotherRowCtx = createContext(false);\n\nexport interface FieldProps {\n label: FieldLabel;\n /**\n * The label is read out but not shown (Sprint 25.12 A31): for a field whose purpose the page shows another way, such\n * as a column heading above repeated rows. In an AddAnother group it shows again when the group stacks its rows.\n */\n hideLabel?: boolean;\n /** The single form control. Receives id, aria-describedby, aria-invalid/error and required automatically. */\n children: ReactElement | ((props: FieldControlProps) => ReactNode);\n /** Persistent help text (format requirements, why a field is disabled). Shown below the control, above any error. */\n hint?: ReactNode;\n /** Current validation error. Rendered as InlineFieldError (role=\"alert\") and linked via aria-describedby. Wins over `validate`. */\n error?: string | null | false;\n /**\n * The field's check: the message for what is wrong with its value, or nothing (`validate={(v) => v ? undefined :\n * \"Enter a title\"}`). It gets the control's `value` (or `checked`); a closure over your own state works as well.\n * Inside a FormWrapper it runs at the project's validation timing (forms.validationTiming, through the form):\n * - `onBlur`: when the field is left;\n * - `onChange`: as the value changes, once the field has been left;\n * - `onSubmit`: on submit only.\n *\n * Whatever the timing, it runs on every submit, and FormWrapper's `onSubmit` gets its message under this Field's\n * `id`, or no key at all when the value passes, so an empty `errors` means the form is valid. A message that shows is\n * checked again as the value changes, so it goes as soon as the value is right. Focus\n * moving into the control's own popup (a Dropdown's list, a DatePicker's calendar) is not leaving the field. Outside\n * a FormWrapper it runs when the field is left (round 26, R26-2).\n */\n validate?: (value: unknown) => string | undefined | null | false;\n required?: boolean;\n /** Slot to the right of the label, e.g. a \"Forgot password?\" Link. */\n labelAction?: ReactNode;\n /** Explicit id for the control; generated when omitted. */\n id?: string;\n className?: string;\n}\n\n/**\n * Label + control + hint + error, wired together. Guarantees the label is\n * associated (htmlFor/id), that hint and error are announced\n * (aria-describedby), that the control is marked invalid, and that the error\n * sits directly below the field (forms-002/006/009/010). Use one Field per\n * control; do not add a separate <Label> or a label prop on the child.\n *\n * In a SettingsLayout panel a Field keeps the narrow page's reading width however wide the page is (the panel's\n * --ds-form-max, Sprint 25.9); a `max-w-*` class of your own wins.\n */\nexport function Field({ label, children, hint, error, required, labelAction, hideLabel = false, id: idProp, validate, className }: FieldProps) {\n const inGroupRow = useContext(AddAnotherRowCtx);\n const generated = useId();\n const id = idProp ?? `field-${generated}`;\n const hintId = `${id}-hint`;\n const errorId = `${id}-error`;\n\n // ── The field's own check (round 26, R26-2) ──\n const form = useOptionalFormContext();\n // outside a form, the only moment a field can check itself is when it is left\n const mode = form?.validationMode ?? \"onBlur\";\n const [localError, setLocalError] = useState<string | undefined>(undefined);\n const [left, setLeft] = useState(false);\n const checkError = validate ? (form ? form.errors[id] : localError) : undefined;\n const child = typeof children === \"function\" ? null : Children.only(children);\n const childProps = child && isValidElement(child) ? (child.props as Record<string, unknown>) : null;\n const latest = useLatest({ validate, childProps, id, mode, left, showing: !!checkError, form });\n // the check and its message read what is current through `latest`, so they need no memo of their own\n const check = (): string | undefined => {\n const { validate: fn, childProps: props, id: controlId } = latest.current;\n if (!fn) return undefined;\n const value = props && \"value\" in props ? props.value : props && \"checked\" in props ? props.checked : (document.getElementById(controlId) as HTMLInputElement | null)?.value;\n const message = fn(value);\n return typeof message === \"string\" && message.length > 0 ? message : undefined;\n };\n const show = (message: string | undefined) => {\n const { form: f, id: controlId } = latest.current;\n if (f) f.setError(controlId, message);\n else setLocalError(message);\n };\n // every submit runs the check, whatever the timing: the form holds one check, which runs the field's latest\n const register = form?.register;\n const checks = !!validate;\n const checkNow = useLatest(check);\n useEffect(() => (register && checks ? register(id, () => checkNow.current()) : undefined), [register, checks, id, checkNow]);\n // Left: focus goes out of the field's React tree and doesn't come back straight away. React carries focus events\n // through portals, so moving into the control's own popup comes back in, and cancels the check (lib/focus.ts).\n const leave = useFocusLeave(() => {\n setLeft(true);\n if (latest.current.mode !== \"onSubmit\" || latest.current.showing) show(check());\n });\n // Changed: checked again once the page has the new value, if the timing is onChange and the field has been left,\n // or if its message shows, so it goes as soon as the value is right\n const recheck = () => {\n if (!validate) return;\n setTimeout(() => {\n const { mode: m, left: wasLeft, showing } = latest.current;\n if ((m === \"onChange\" && wasLeft) || showing) show(check());\n }, 0);\n };\n\n const shownError = typeof error === \"string\" && error.length > 0 ? error : checkError;\n const hasError = typeof shownError === \"string\" && shownError.length > 0;\n const describedBy = [hint ? hintId : null, hasError ? errorId : null].filter(Boolean).join(\" \") || undefined;\n const labelId = `${id}-label`;\n // whether the label is on screen: not with hideLabel, unless an AddAnother row shows it again as the group stacks its\n // rows (a container query), which only the page can say (the final review of 0.31.0, 4)\n const [rowShowsLabel, setRowShowsLabel] = useState(false);\n useLayoutEffect(() => {\n const el = document.getElementById(labelId);\n if (!hideLabel || !inGroupRow || !el || typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver(() => {\n const box = el.getBoundingClientRect();\n setRowShowsLabel(box.width > 1 && box.height > 1);\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, [hideLabel, inGroupRow, labelId]);\n const labelShown = !hideLabel || (inGroupRow && rowShowsLabel);\n const fieldContext = useMemo<FieldContextValue>(() => ({ controlId: id, labelId, describedBy, invalid: hasError, required: !!required, labelHidden: !labelShown }), [id, labelId, describedBy, hasError, required, labelShown]);\n // The naming rule for any control (the final review of 0.31.0, 1): with the label on screen, it leads the name, so a\n // page's aria-label or aria-labelledby on the control is left out, with a development warning naming the control. A\n // native input took it over the Field's <label for>. A control on useFieldControl hears the same from it, deeper in.\n const childType = child && isValidElement(child) ? child.type : null;\n const childName = typeof childType === \"string\" ? childType : childType ? ((childType as { displayName?: string }).displayName ?? (childType as { name?: string }).name ?? \"A Field's control\") : \"A Field's control\";\n const pageLabel = labelShown ? (childProps?.[\"aria-label\"] as string | undefined) : undefined;\n const pageLabelledBy = labelShown ? (childProps?.[\"aria-labelledby\"] as string | undefined) : undefined;\n useEffect(() => {\n if (pageLabel) warnNameLeftOut(childName, \"aria-label\", pageLabel, \"its Field's label\");\n if (pageLabelledBy) warnNameLeftOut(childName, \"aria-labelledby\", pageLabelledBy, \"its Field's label\");\n }, [childName, pageLabel, pageLabelledBy]);\n // a control's own description kept beside the hint and the error (the final review of 0.31.0, 9: the Field's replaced it)\n const ownDescribedBy = childProps?.[\"aria-describedby\"] as string | undefined;\n const allDescribedBy = [...new Set([ownDescribedBy, describedBy].filter(Boolean).join(\" \").split(/\\s+/).filter(Boolean))].join(\" \") || undefined;\n\n const controlProps: FieldControlProps = {\n id,\n \"aria-describedby\": allDescribedBy,\n ...(hasError ? { \"aria-invalid\": true as const, error: true } : {}),\n ...(required ? { \"aria-required\": true as const, required: true } : {}),\n };\n\n let control: ReactNode;\n if (typeof children === \"function\") {\n control = children(controlProps);\n } else {\n if (!child || !isValidElement(child)) throw new Error(\"Field expects a single form control as its child\");\n const isNative = typeof child.type === \"string\";\n const { error: errorFlag, ...ariaOnly } = controlProps;\n // with a check, the control's own onChange is kept and the check follows it (a Gridsmith control calls onChange\n // with its value; a native one's input event reaches the wrapper too)\n const ownOnChange = childProps?.onChange as ((...args: unknown[]) => void) | undefined;\n const onChange = validate && !isNative ? { onChange: (...args: unknown[]) => { ownOnChange?.(...args); recheck(); } } : {};\n // Native elements get ARIA only (an unknown `error` attribute would warn);\n // Gridsmith components get `error` so they render their error styling.\n const names = labelShown ? { \"aria-label\": undefined, \"aria-labelledby\": undefined } : {};\n control = cloneElement(child as ReactElement<Record<string, unknown>>, isNative ? { ...ariaOnly, ...names } : { ...ariaOnly, ...names, ...(errorFlag ? { error: true } : {}), ...onChange });\n }\n\n const labelNode = (\n <Label id={labelId} htmlFor={id} className={cn(hideLabel && \"sr-only\", hideLabel && inGroupRow && \"@max-[30rem]:not-sr-only\")}>\n {label}\n {required && <span aria-hidden=\"true\" className=\"ml-ds-0.5 text-[var(--ds-status-error)]\">*</span>}\n </Label>\n );\n\n return (\n // In a settings panel a field keeps the narrow reading width however wide the page is (--ds-form-max, Sprint 25.9 A4),\n // and in a FormWrapper the form's (--gs-form-default) at any depth, a row of fields round a drop zone included; one\n // holding a wide control fills its row (the fix pass of 25.33), and a max-w-* of the page's own wins\n <div\n className={cn(\"flex flex-col gap-ds-1.5 max-w-[var(--gs-field-cap,var(--ds-form-max,var(--gs-form-default,none)))] has-[[data-wide-control]]:[--gs-field-cap:none]\", className)}\n {...(validate ? { ...leave, onInputCapture: recheck } : {})}\n >\n {/* A hidden label with no action beside it takes no row of its own, so the field keeps its height (A31); in an\n AddAnother row it shows again once the group stacks its rows and hides its headings. */}\n {hideLabel && !labelAction ? labelNode : (\n <div className=\"flex items-center justify-between gap-ds-2\">\n {labelNode}\n {labelAction}\n </div>\n )}\n <FieldContext.Provider value={fieldContext}>{control}</FieldContext.Provider>\n {hint && (\n <p id={hintId} className=\"text-xs text-[var(--ds-text-muted)]\">{hint}</p>\n )}\n {hasError && <InlineFieldError id={errorId} message={shownError} className=\"mt-0\" />}\n </div>\n );\n}\n","import { cn, ACTIVE_RING, FIELD_FOCUS_RING, ERROR_ACTIVE_RING, ERROR_FOCUS_RING, FOCUS_RING } from \"../lib/utils\";\nimport { Icon } from \"../lib/icons\";\nimport { focusAfterRemoval, usePopupFocus } from \"../lib/focus\";\nimport { useInputModality } from \"../lib/input-modality\";\nimport { useRevealFocus } from \"../lib/reveal-focus\";\nimport { AutoTooltip } from \"./Tooltip\";\nimport { useTextOverflow } from \"../lib/use-text-overflow\";\nimport { useState, useRef, useEffect, useLayoutEffect, useCallback, useContext, useId, type Ref } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { ControlSizeContext } from \"./Button\";\nimport { useFieldControl, type FieldControlWiring } from \"./Field\";\nimport { useReportedChange } from \"../lib/form-context\";\n\ninterface Option {\n id: string;\n label: string;\n group?: string;\n}\n\ntype DropdownSize = \"sm\" | \"md\" | \"lg\";\n\nconst DROPDOWN_HEIGHT: Record<DropdownSize, string> = {\n sm: \"px-ds-2 py-ds-1 text-xs h-[var(--ds-control-height-sm)]\",\n md: \"px-ds-3 py-ds-2 text-sm h-[var(--ds-control-height-md)]\",\n lg: \"px-ds-4 py-ds-3 text-base h-[var(--ds-control-height-lg)]\",\n};\n\ninterface DropdownProps extends FieldControlWiring {\n options: Option[];\n value: string | string[];\n onChange: (value: string | string[]) => void;\n label?: string;\n disabled?: boolean;\n placeholder?: string;\n multiple?: boolean;\n searchable?: boolean;\n size?: DropdownSize;\n className?: string;\n ref?: Ref<HTMLDivElement>;\n container?: Element | DocumentFragment;\n error?: boolean;\n /** When multiple, show removable chips below the trigger. Defaults to true. Set false in toolbar contexts where chips are shown elsewhere. */\n showChips?: boolean;\n /**\n * Accessible name for the trigger, for when there is no visible `label` (e.g. in a toolbar). The trigger reads it, then\n * what it shows, \"Status, Open\", so the words on screen are in its name; the open list is named by it alone. Beside a\n * visible label (`label`, or a Field's) it's left out: the label leads the name, and a development warning says so.\n */\n \"aria-label\"?: string;\n}\n\nexport function Dropdown({\n options,\n value,\n onChange: onChangeProp,\n label,\n disabled,\n placeholder = \"Select...\",\n multiple,\n searchable,\n size: sizeProp,\n className,\n ref,\n container,\n error = false,\n showChips = true,\n \"aria-label\": ariaLabel,\n ...wiring\n}: DropdownProps) {\n // Sprint 25.12 A15: a choice the user makes marks the form's overlay; the list's search box doesn't (its own state)\n const onChange = useReportedChange(onChangeProp, value);\n // A field (Sprint 30, P13): from the keyboard the trigger and the list's search box show the outline; after a pointer\n // press the search box shows the active look, and while the list is open the trigger keeps it (ACTIVE_RING)\n useInputModality();\n const contextSize = useContext(ControlSizeContext);\n // Inside a Field the trigger takes the Field's id, label, hint, error and required state (round 27 review): the label\n // and then the trigger's own text name it, the list-box button pattern's \"Plan, Starter\" (APG collapsible listbox).\n const generatedId = useId();\n // its own label's id, apart from the trigger's, which inside a Field is the Field's (whose label is `${id}-label`)\n const labelSpanId = `${generatedId}-label`;\n const nameSpanId = `${generatedId}-name`;\n // the name, by the one rule for a Field's controls (useFieldControl; the final review of Sprint 25.31, 2): a label on\n // screen, its own or its Field's, leads it, and a page's aria-label or aria-labelledby beside one is left out, with a\n // development warning\n const control = useFieldControl({ ...wiring, \"aria-label\": ariaLabel, error: error || undefined }, { requiredInDescription: true, component: \"Dropdown\", ownLabel: label ? labelSpanId : undefined });\n const triggerId = control.id ?? generatedId;\n // the open list is named by the field's label alone (Sprint 25.29 item 11): the trigger's text is the choice, not the list\n const listLabelledBy = control.labelId;\n const invalid = control.invalid;\n const size = sizeProp ?? contextSize ?? \"md\";\n const [open, setOpen] = useState(false);\n const [search, setSearch] = useState(\"\");\n const [positioned, setPositioned] = useState(false);\n const triggerRef = useRef<HTMLButtonElement>(null);\n // the arrows' option comes into view whole, with its outline (Sprint 30, P3): the list shows part of one at its foot\n const [listbox, setListbox] = useState<HTMLDivElement | null>(null);\n useRevealFocus(listbox);\n const menuRef = useRef<HTMLDivElement>(null);\n const searchRef = useRef<HTMLInputElement>(null);\n const [pos, setPos] = useState({ top: 0, left: 0, width: 0 });\n\n const selectedValues = Array.isArray(value) ? value : [value].filter(Boolean);\n\n const updatePos = useCallback(() => {\n if (!triggerRef.current) return;\n const rect = triggerRef.current.getBoundingClientRect();\n let top = rect.bottom + 4;\n let left = rect.left;\n const width = rect.width;\n\n if (menuRef.current) {\n const menuRect = menuRef.current.getBoundingClientRect();\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n if (left + menuRect.width > vw) left = Math.max(0, vw - menuRect.width - 8);\n if (top + menuRect.height > vh) {\n const above = rect.top - 4 - menuRect.height;\n if (above >= 0) top = above;\n else top = Math.max(0, vh - menuRect.height - 8);\n }\n }\n\n setPos({ top, left, width });\n }, []);\n\n // Opening clears the search; closing forgets the last position (render-time\n // state adjustment, so the menu never paints with stale values).\n const [prevOpen, setPrevOpen] = useState(open);\n if (open !== prevOpen) {\n setPrevOpen(open);\n if (open) setSearch(\"\");\n else setPositioned(false);\n }\n\n useEffect(() => {\n if (!open) return;\n updatePos();\n const raf = requestAnimationFrame(() => {\n updatePos();\n setPositioned(true);\n });\n const onScroll = () => updatePos();\n window.addEventListener(\"scroll\", onScroll, true);\n window.addEventListener(\"resize\", updatePos);\n return () => {\n cancelAnimationFrame(raf);\n window.removeEventListener(\"scroll\", onScroll, true);\n window.removeEventListener(\"resize\", updatePos);\n };\n }, [open, updatePos]);\n\n // Sprint 25.7: the user moved to an option since the list opened (arrows, Home/End, type-ahead). Tab then picks it (D14(a)).\n const moved = useRef(false);\n\n // Focus moves in once the panel is visible: it opens with visibility hidden until positioned, and a hidden element\n // cannot take focus (focusing it in the same frame used to leave focus on the trigger in real browsers).\n useLayoutEffect(() => {\n if (!open || !positioned) return;\n moved.current = false;\n if (searchRef.current) {\n searchRef.current.focus();\n return;\n }\n const els = Array.from(menuRef.current?.querySelectorAll<HTMLButtonElement>('[role=\"option\"]') ?? []);\n (els.find((el) => el.getAttribute(\"aria-selected\") === \"true\") ?? els[0])?.focus();\n }, [open, positioned]);\n\n useEffect(() => {\n if (!open) return;\n const handler = (e: MouseEvent) => {\n const target = e.target as Node;\n if (triggerRef.current?.contains(target) || menuRef.current?.contains(target)) return;\n setOpen(false);\n };\n document.addEventListener(\"mousedown\", handler);\n return () => document.removeEventListener(\"mousedown\", handler);\n }, [open]);\n\n // Tab while open (D14(a)): a single-select list picks the option the user moved to; opened and left, nothing changes.\n const commitMoved = () => {\n if (multiple || !moved.current) return;\n const el = document.activeElement;\n const id = el instanceof HTMLElement && menuRef.current?.contains(el) ? el.getAttribute(\"data-option-id\") : null;\n if (id) onChange(id);\n };\n // Sprint 25.7: focus hands back on close, and Tab out carries on from the trigger (lib/focus usePopupFocus).\n const { isTop: isTopLayer, returnFocus } = usePopupFocus(open, { trigger: triggerRef, panel: menuRef, close: () => setOpen(false), tabExits: \"any\", onTabOut: commitMoved });\n\n // Keyboard while open: Escape closes (focus returns to the trigger); arrows,\n // Home/End move focus through the options; typing jumps to the first option\n // starting with those letters (when there is no search box); Enter/Space\n // activate the focused option natively.\n const typeahead = useRef({ buffer: \"\", at: 0 });\n useEffect(() => {\n if (!open) return;\n const optionButtons = () => Array.from(menuRef.current?.querySelectorAll<HTMLButtonElement>('[role=\"option\"]') ?? []);\n const focusOption = (idx: number) => {\n const els = optionButtons();\n if (els.length === 0) return;\n els[((idx % els.length) + els.length) % els.length].focus();\n moved.current = true;\n };\n const onKey = (e: KeyboardEvent) => {\n const inMenu = menuRef.current?.contains(document.activeElement) || triggerRef.current === document.activeElement;\n if (!inMenu) return;\n const els = optionButtons();\n const current = els.findIndex((el) => el === document.activeElement);\n if (e.key === \"Escape\") { if (e.defaultPrevented || !isTopLayer()) return; e.preventDefault(); returnFocus(); setOpen(false); return; }\n if (e.key === \"ArrowDown\") { e.preventDefault(); focusOption(current < 0 ? 0 : current + 1); return; }\n if (e.key === \"ArrowUp\") { e.preventDefault(); focusOption(current < 0 ? els.length - 1 : current - 1); return; }\n const inSearch = document.activeElement === searchRef.current;\n if (e.key === \"Home\" && !inSearch) { e.preventDefault(); focusOption(0); return; }\n if (e.key === \"End\" && !inSearch) { e.preventDefault(); focusOption(els.length - 1); return; }\n if (!searchable && e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) {\n const now = Date.now();\n typeahead.current.buffer = now - typeahead.current.at > 700 ? e.key : typeahead.current.buffer + e.key;\n typeahead.current.at = now;\n const q = typeahead.current.buffer.toLowerCase();\n const hit = els.findIndex((el) => (el.textContent ?? \"\").trim().toLowerCase().startsWith(q));\n if (hit >= 0) { e.preventDefault(); focusOption(hit); }\n }\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, [open, searchable, isTopLayer, returnFocus]);\n\n const filtered = searchable && search\n ? options.filter((o) => o.label.toLowerCase().includes(search.toLowerCase()))\n : options;\n\n const groups = new Map<string, Option[]>();\n for (const opt of filtered) {\n const g = opt.group ?? \"\";\n if (!groups.has(g)) groups.set(g, []);\n groups.get(g)!.push(opt);\n }\n const hasGroups = Array.from(groups.keys()).some((k) => k !== \"\");\n // the list's one Tab stop: the chosen option, else the first, in the order the list draws them\n const drawn = hasGroups ? Array.from(groups.values()).flat() : filtered;\n const stopId = (drawn.find((o) => selectedValues.includes(o.id)) ?? drawn[0])?.id;\n\n const handleSelect = (id: string) => {\n if (multiple) {\n const arr = selectedValues.includes(id)\n ? selectedValues.filter((v) => v !== id)\n : [...selectedValues, id];\n onChange(arr);\n } else {\n // Focus back on the trigger before the consumer runs, so a dialog it opens records the trigger (Sprint 25.7).\n returnFocus();\n onChange(id);\n setOpen(false);\n }\n };\n\n // Removing a chip moves focus to the chip before it, else the one after, else the trigger (D14(c)), once the value\n // no longer holds it. The next render drops the request either way, so a removal the consumer refused never moves\n // focus later.\n const chipsRef = useRef<HTMLDivElement>(null);\n const pendingChipFocus = useRef<{ index: number; value: string } | null>(null);\n useLayoutEffect(() => {\n const pending = pendingChipFocus.current;\n if (pending === null) return;\n pendingChipFocus.current = null;\n if (selectedValues.includes(pending.value)) return;\n const chips = Array.from(chipsRef.current?.querySelectorAll<HTMLElement>(\"[data-chip-remove]\") ?? []);\n focusAfterRemoval(chips, pending.index, triggerRef.current);\n });\n\n const displayLabel = multiple\n ? selectedValues.length > 0\n ? `${selectedValues.length} selected`\n : placeholder\n : options.find((o) => o.id === selectedValues[0])?.label ?? placeholder;\n\n const { ref: overflowRef, isTruncated } = useTextOverflow({ lines: 1, content: displayLabel });\n\n // named by the page's aria-label alone, the trigger is that name and then its own text, as a visible label names it: a\n // phone's Tabs reads \"Contents, Security\", never \"Contents\" alone over a trigger that shows \"Security\" (Sprint 25.31\n // item 1; WCAG 2.5.3, 4.1.2). The name waits in a hidden span, with a comma before what the trigger shows, unless it\n // ends in punctuation or the trigger shows nothing. A trigger that shows the name itself, or starts with it (\"Status\"\n // as its placeholder), reads its own words alone (the final review of Sprint 25.31, 3: \"Status, Status\"): the name as a\n // word, so \"View\" over \"Viewer\" still reads both (the final review of 0.31.0, 5). Its words through String(): an option\n // labelled by a number, as untyped data can be, is drawn as before (item 6)\n const shows = String(displayLabel).trim();\n const name = control.label?.trim() ?? \"\";\n const repeats = !!name && new RegExp(`^${name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}(?!\\\\p{L})`, \"iu\").test(shows);\n const nameSpan = !control.labelId && !!control.label && !repeats;\n const labelledBy = control.labelId ? `${control.labelId} ${triggerId}` : nameSpan ? `${nameSpanId} ${triggerId}` : undefined;\n\n return (\n <div ref={ref} className={cn(\"relative\", className)}>\n {label && (\n <span id={labelSpanId} className=\"block mb-ds-1.5 text-sm font-medium text-[var(--ds-text-secondary)]\">{label}</span>\n )}\n {control.requiredNote}\n {nameSpan && <span id={nameSpanId} hidden>{shows && !/[,.:;!?]$/.test(control.label!.trim()) ? `${control.label},` : control.label}</span>}\n <button\n ref={triggerRef}\n id={triggerId}\n type=\"button\"\n onClick={() => !disabled && setOpen(!open)}\n onKeyDown={(e) => {\n if (disabled || open) return;\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") { e.preventDefault(); setOpen(true); }\n }}\n disabled={disabled}\n aria-invalid={invalid || undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-labelledby={labelledBy}\n aria-describedby={control.describedBy}\n className={cn(\n \"w-full flex items-center justify-between gap-ds-2\",\n DROPDOWN_HEIGHT[size],\n \"bg-[var(--ds-input-bg)] text-[var(--ds-text-primary)]\",\n \"border-[length:var(--ds-border-width)]\",\n invalid ? \"border-[var(--ds-status-error)]\" : \"border-[var(--ds-input-border)]\",\n \"rounded-[var(--ds-radius-md)]\",\n \"shadow-[var(--ds-input-shadow)]\",\n \"transition-colors\",\n !invalid && !disabled && !open && \"hover:border-[var(--ds-input-border-hover)]\",\n open && (invalid ? ERROR_ACTIVE_RING : ACTIVE_RING),\n invalid ? ERROR_FOCUS_RING : FIELD_FOCUS_RING,\n \"cursor-pointer disabled:cursor-not-allowed disabled:opacity-disabled\",\n !selectedValues.length && \"text-[var(--ds-text-muted)]\"\n )}\n >\n {isTruncated ? (\n <AutoTooltip content={displayLabel}><span ref={overflowRef} className=\"truncate\">{displayLabel}</span></AutoTooltip>\n ) : (\n <span ref={overflowRef} className=\"truncate\">{displayLabel}</span>\n )}\n <span className={cn(\"transition-transform\", open && \"rotate-180\")}>\n <Icon name=\"chevron-right\" size={14} className=\"rotate-90\" />\n </span>\n </button>\n\n {open && createPortal(\n <div\n ref={menuRef}\n // Safari focuses no button on a mousedown and drops focus to the body; a panel that can take focus keeps it\n // inside the control's React tree, so a Field's leave check never fires mid-choice (round 27 review)\n tabIndex={-1}\n // A choice is the list's own: its click must not also reach a clickable row or card around the Dropdown.\n onClick={(e) => e.stopPropagation()}\n className={cn(\n \"fixed z-[var(--ds-z-popover)] outline-none\",\n \"bg-[var(--ds-bg-surface-elevated)]\",\n \"[backdrop-filter:var(--ds-glass-filter)] [-webkit-backdrop-filter:var(--ds-glass-filter)]\",\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]\",\n \"rounded-[var(--ds-radius-md)] overflow-hidden\",\n \"shadow-[var(--ds-shadow-dropdown),var(--ds-glass-inset)]\",\n )}\n style={{ top: pos.top, left: pos.left, minWidth: pos.width, width: \"max-content\", maxWidth: \"calc(100vw - 16px)\", visibility: positioned ? \"visible\" : \"hidden\" }}\n >\n {searchable && (\n <div className=\"border-b-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\" style={{ padding: \"var(--ds-space-2)\" }}>\n <input\n ref={searchRef}\n type=\"text\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder=\"Search…\"\n // the list's own search field, its first row: no look of its own (Sprint 30, the owner's decision B)\n data-popup-search=\"\"\n className={cn(\"w-full bg-transparent text-[var(--ds-text-primary)] placeholder:text-[var(--ds-text-muted)] outline-none\", size === \"sm\" ? \"text-xs\" : \"text-sm\")}\n />\n </div>\n )}\n {/* its padding is room for the options' outline, never under its 4 px reach (Sprint 30, P3) */}\n {/* one Tab stop, the Authoring Practices' roving one: the chosen option, else the first (Sprint 25.29 item 11) */}\n <div ref={setListbox} role=\"listbox\" aria-labelledby={listLabelledBy} aria-label={listLabelledBy ? undefined : control.label} aria-multiselectable={multiple || undefined} className=\"overflow-y-auto scroll-p-[4px]\" style={{ padding: \"max(var(--ds-space-1), 4px)\", maxHeight: \"var(--ds-dropdown-max-height)\" }}>\n {filtered.length === 0 ? (\n <p className={cn(\"text-[var(--ds-text-muted)] text-center py-ds-4\", size === \"sm\" ? \"text-xs\" : \"text-sm\")}>No options found</p>\n ) : hasGroups ? (\n Array.from(groups.entries()).map(([group, opts]) => (\n <div key={group}>\n {group && (\n <p className=\"text-2xs font-medium uppercase tracking-wider text-[var(--ds-text-muted)] px-ds-2 pt-ds-2 pb-ds-1\">\n {group}\n </p>\n )}\n {opts.map((opt) => (\n <OptionButton\n key={opt.id}\n opt={opt}\n tabStop={opt.id === stopId}\n isSelected={selectedValues.includes(opt.id)}\n multiple={multiple}\n onSelect={handleSelect}\n size={size}\n />\n ))}\n </div>\n ))\n ) : (\n filtered.map((opt) => (\n <OptionButton\n key={opt.id}\n opt={opt}\n tabStop={opt.id === stopId}\n isSelected={selectedValues.includes(opt.id)}\n multiple={multiple}\n onSelect={handleSelect}\n size={size}\n />\n ))\n )}\n </div>\n </div>,\n container ?? document.body\n )}\n\n {multiple && showChips && selectedValues.length > 0 && (\n <div ref={chipsRef} className=\"flex flex-wrap gap-ds-1 mt-ds-1.5\">\n {selectedValues.map((v, i) => {\n const opt = options.find((o) => o.id === v);\n return opt ? (\n <span\n key={v}\n className=\"inline-flex items-center gap-ds-1 text-xs rounded-[var(--ds-radius-sm)] bg-[var(--ds-bg-muted)] text-[var(--ds-text-secondary)] px-ds-1.5 py-ds-0.5\"\n >\n {opt.label}\n <AutoTooltip content={`Remove ${opt.label}`}>\n <button type=\"button\"\n data-chip-remove=\"\"\n onClick={() => { pendingChipFocus.current = { index: i, value: v }; handleSelect(v); }}\n className={cn(\"hover:text-[var(--ds-text-primary)] cursor-pointer\", FOCUS_RING)}\n aria-label={`Remove ${opt.label}`}\n >\n <Icon name=\"close\" size={10} />\n </button>\n </AutoTooltip>\n </span>\n ) : null;\n })}\n </div>\n )}\n </div>\n );\n}\n\nfunction OptionButton({\n opt,\n tabStop,\n isSelected,\n multiple,\n onSelect,\n size = \"md\",\n}: {\n opt: Option;\n tabStop: boolean;\n isSelected: boolean;\n multiple?: boolean;\n onSelect: (id: string) => void;\n size?: DropdownSize;\n}) {\n return (\n <button\n type=\"button\"\n role=\"option\"\n data-option-id={opt.id}\n aria-selected={isSelected}\n tabIndex={tabStop ? 0 : -1}\n onClick={() => onSelect(opt.id)}\n className={cn(\n \"w-full text-left cursor-pointer rounded-[var(--ds-radius-sm)]\",\n \"transition-colors flex items-center gap-ds-2\",\n // the arrows move DOM focus here, so the option draws the outline; outside it, clear of the chosen one's fill\n FOCUS_RING,\n size === \"sm\" ? \"px-ds-2 py-ds-1 text-xs\" : \"px-ds-2 py-ds-1.5 text-sm\",\n isSelected && !multiple\n ? \"bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]\"\n : \"text-[var(--ds-text-primary)] hover:bg-[var(--ds-bg-emphasis)]\"\n )}\n >\n {multiple && (\n <span\n className={cn(\n \"w-[var(--ds-icon-size-sm)] h-[var(--ds-icon-size-sm)] rounded-[var(--ds-radius-sm)] border-[length:var(--ds-border-width)] shrink-0 flex items-center justify-center\",\n isSelected\n ? \"bg-[var(--ds-accent-primary)] border-[var(--ds-accent-primary)]\"\n : \"border-[var(--ds-border-default)]\"\n )}\n >\n {isSelected && <Icon name=\"check\" size={10} className=\"text-[var(--ds-text-on-primary)]\" />}\n </span>\n )}\n <span className=\"flex-1\">{opt.label}</span>\n {isSelected && !multiple && <Icon name=\"check\" size={size === \"sm\" ? 12 : 14} />}\n </button>\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRevealFocus } from './chunk-
|
|
3
|
-
import { hasTabStop } from './chunk-
|
|
2
|
+
import { useRevealFocus } from './chunk-HCEHTJ5E.js';
|
|
3
|
+
import { hasTabStop } from './chunk-2724SJO2.js';
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
5
|
|
|
6
6
|
function useKeyboardScroll(el, label, enabled = true, nameFromHeading = false, axis = "y") {
|
|
@@ -67,5 +67,5 @@ function useKeyboardScroll(el, label, enabled = true, nameFromHeading = false, a
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export { useKeyboardScroll };
|
|
70
|
-
//# sourceMappingURL=chunk-
|
|
71
|
-
//# sourceMappingURL=chunk-
|
|
70
|
+
//# sourceMappingURL=chunk-H732QL56.js.map
|
|
71
|
+
//# sourceMappingURL=chunk-H732QL56.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../showcase/src/lib/use-keyboard-scroll.ts"],"names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,aAAA,EAAe,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,iBAAiB,CAAC,OAAA,EAAS,YAAY,QAAA,EAAU,UAAU,GAAG,CAAA;AAEvJ,IAAA,MAAM,MAAA,GAAS,OAAO,gBAAA,KAAqB,WAAA,GAAc,OAAO,IAAI,gBAAA,CAAiB,CAAC,OAAA,KAAY;AAChG,MAAA,IAAI,QAAQ,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,EAAA,IAAM,CAAA,CAAE,MAAA,YAAkB,OAAA,IAAW,EAAE,MAAA,CAAO,QAAA,CAAS,EAAE,CAAC,GAAG,MAAA,EAAO;AAAA,IAC3G,CAAC,CAAA;AACD,IAAA,MAAA,EAAQ,OAAA,CAAQ,EAAA,CAAG,aAAA,CAAc,eAAA,EAAiB,EAAE,OAAA,EAAS,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,eAAA,EAAiB,CAAC,OAAO,GAAG,CAAA;AAEjH,IAAA,MAAM,UAAA,GAAa,CAAC,CAAA,KAAkB;AAAE,MAAA,IAAI,CAAA,CAAE,MAAA,KAAW,EAAA,EAAI,MAAA,EAAO;AAAA,IAAG,CAAA;AACvE,IAAA,EAAA,CAAG,gBAAA,CAAiB,YAAY,UAAU,CAAA;AAC1C,IAAA,OAAO,MAAM;AACX,MAAA,EAAA,CAAG,UAAA,EAAW;AACd,MAAA,EAAA,EAAI,UAAA,EAAW;AACf,MAAA,MAAA,EAAQ,UAAA,EAAW;AACnB,MAAA,EAAA,CAAG,mBAAA,CAAoB,YAAY,UAAU,CAAA;AAC7C,MAAA,GAAA,CAAI,KAAK,CAAA;AAAA,IACX,CAAA;AAAA,EACF,GAAG,CAAC,EAAA,EAAI,OAAO,OAAA,EAAS,eAAA,EAAiB,IAAI,CAAC,CAAA;AAChD","file":"chunk-H732QL56.js","sourcesContent":["import { useEffect } from \"react\";\nimport { hasTabStop } from \"./focus\";\nimport { useRevealFocus } from \"./reveal-focus\";\n\n/**\n * WCAG 2.1.1: a region that scrolls, with nothing inside it to Tab to, is a Tab stop of its own, named, so a keyboard\n * can scroll it (Chrome makes such a scroller focusable by itself; Safari doesn't). Sprint 25.16 A42: what fills the\n * page scrolls inside itself, so a board's column or a split view's pane can be such a region. It stops being one when\n * it no longer scrolls or something inside it takes focus — but while it has focus it stays one, until focus leaves it,\n * so a resize that makes it fit never drops the focus to the page (as Table's scroll region does; the review of\n * 1 October). Give the element a visible focus style (FOCUS_INSET). Pass the element itself (a callback ref's), so a\n * pane drawn later (a detail that opens) is read when it appears. With `nameFromHeading`, the region takes its first\n * heading's words as its name (an item's view: its title), and `label` only when it has none. What the keyboard focuses\n * inside it is scrolled into view whole (useRevealFocus, Sprint 30): give the region `scroll-p-[4px]` for the outline.\n * `axis` \"x\" for a strip that scrolls sideways (the Calendar's week of days on a phone, Sprint 25.29 item 10), \"both\"\n * for an area that scrolls either way (ScrollArea's, Sprint 25.30 item 2).\n */\nexport function useKeyboardScroll(el: HTMLElement | null, label: string, enabled = true, nameFromHeading = false, axis: \"y\" | \"x\" | \"both\" = \"y\"): void {\n useRevealFocus(el, enabled);\n useEffect(() => {\n if (!enabled || !el || typeof ResizeObserver === \"undefined\") return;\n const name = () => {\n const heading = nameFromHeading ? el.querySelector(\"h1, h2, h3, h4, h5, h6\")?.textContent?.trim() : \"\";\n return heading || label;\n };\n // what the element has of its own, kept: a landmark's role and name (the shell's <main>), and the skip link's target's\n // tabindex -1, put back when it stops being a stop (Sprint 25.29 item 10)\n const own = { tabindex: el.getAttribute(\"tabindex\"), role: el.getAttribute(\"role\"), label: el.getAttribute(\"aria-label\") };\n const landmark = /^(MAIN|NAV|ASIDE|ARTICLE|SECTION|FORM)$/.test(el.tagName);\n const keepRole = own.role !== null || landmark;\n const keepName = own.label !== null || landmark;\n const restore = (attr: string, value: string | null) => (value === null ? el.removeAttribute(attr) : el.setAttribute(attr, value));\n const set = (on: boolean) => {\n if (on === el.hasAttribute(\"data-scroll-stop\")) {\n if (on && !keepName && el.getAttribute(\"aria-label\") !== name()) el.setAttribute(\"aria-label\", name());\n return;\n }\n if (on) {\n el.setAttribute(\"data-scroll-stop\", \"\");\n el.tabIndex = 0;\n if (!keepRole) el.setAttribute(\"role\", \"region\");\n if (!keepName) el.setAttribute(\"aria-label\", name());\n } else {\n el.removeAttribute(\"data-scroll-stop\");\n restore(\"tabindex\", own.tabindex);\n if (!keepRole) restore(\"role\", own.role);\n if (!keepName) restore(\"aria-label\", own.label);\n }\n };\n const update = () => {\n // inert (the shell's phone menu over <main>), nothing in it is a stop, nor is it: what it is waits until it isn't\n // (Sprint 25.31 item 6: a clock ticking in <main> made it a stop then, and it stayed one once the menu closed)\n if (el.closest(\"[inert]\")) return;\n // a stop with focus stays one until focus leaves it\n if (el.hasAttribute(\"data-scroll-stop\") && document.activeElement === el) return set(true);\n // anything inside to Tab to, and it's no stop, with no need to measure: the first found ends the search (item 7)\n if (hasTabStop(el)) return set(false);\n const wide = el.scrollWidth > el.clientWidth + 1, tall = el.scrollHeight > el.clientHeight + 1;\n set(axis === \"x\" ? wide : axis === \"both\" ? wide || tall : tall);\n };\n update();\n const ro = new ResizeObserver(update);\n ro.observe(el);\n // what's inside changing, and what decides whether it's a stop (item 6): a control enabled, shown, given a tabindex,\n // or made inert. The element's own tabindex is this hook's to write, so its change is no news.\n const itsOwn = (r: MutationRecord) => r.type === \"attributes\" && r.target === el && r.attributeName === \"tabindex\";\n const mo = typeof MutationObserver === \"undefined\" ? null : new MutationObserver((records) => { if (!records.every(itsOwn)) update(); });\n mo?.observe(el, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: [\"inert\", \"disabled\", \"hidden\", \"tabindex\"] });\n // and a box round it made inert, or no longer inert: the page's own, or the phone menu's (item 6)\n const around = typeof MutationObserver === \"undefined\" ? null : new MutationObserver((records) => {\n if (records.some((r) => r.target !== el && r.target instanceof Element && r.target.contains(el))) update();\n });\n around?.observe(el.ownerDocument.documentElement, { subtree: true, attributes: true, attributeFilter: [\"inert\"] });\n // focus leaving a stop that no longer scrolls ends it: focus leaving the element itself, not a control inside it (item 7)\n const onFocusOut = (e: FocusEvent) => { if (e.target === el) update(); };\n el.addEventListener(\"focusout\", onFocusOut);\n return () => {\n ro.disconnect();\n mo?.disconnect();\n around?.disconnect();\n el.removeEventListener(\"focusout\", onFocusOut);\n set(false);\n };\n }, [el, label, enabled, nameFromHeading, axis]);\n}\n\n/** The focus style for such a region: the theme's outline, drawn inside its edge so a neighbour can't hide it (lib/utils.ts since Sprint 30). */\nexport { FOCUS_INSET } from \"./utils\";\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { usePosition, useLatest, cn, GLASS_DROPDOWN } from './chunk-
|
|
2
|
+
import { usePosition, useLatest, cn, GLASS_DROPDOWN } from './chunk-2724SJO2.js';
|
|
3
3
|
import { version, createContext, isValidElement, cloneElement, useContext, useState, useRef, useId, useCallback, useEffect, useLayoutEffect } from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -237,5 +237,5 @@ function useRevealFocus(target, enabled = true) {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
export { AutoTooltip, NATIVE_TITLE, RevealTooltip, Slot, Tooltip, mergeRefs, useRevealFocus };
|
|
240
|
-
//# sourceMappingURL=chunk-
|
|
241
|
-
//# sourceMappingURL=chunk-
|
|
240
|
+
//# sourceMappingURL=chunk-HCEHTJ5E.js.map
|
|
241
|
+
//# sourceMappingURL=chunk-HCEHTJ5E.js.map
|
|
@@ -1 +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,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,KAAA,IAAS,CAAC,EAAA,IAAM,YAAY,EAAA,IAAM,EAAE,OAAA,YAAmB,OAAA,CAAA,IAAY,CAAC,EAAA,CAAG,QAAA,CAAS,OAAO,CAAA,IAAM,QAAwB,iBAAA,EAAmB;AAC7I,MAAA,OAAA,CAAQ,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
|
+
{"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,CAAA,EAAG,OAAO,SAAS,CAAC,CAAA;AAC5C,EAAA,OAAO,CAAC,IAAA,KAA6B;AACnC,IAAA,KAAA,MAAW,OAAO,QAAA,EAAU;AAC1B,MAAA,IAAI,OAAO,GAAA,KAAQ,UAAA,EAAY,GAAA,CAAI,IAAI,CAAA;AAAA,WAAA,IAC9B,OAAO,OAAO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AAI,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-HCEHTJ5E.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,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { triggerType } from './chunk-
|
|
2
|
+
import { triggerType } from './chunk-XBVZIN26.js';
|
|
3
3
|
import { useBreakpoint } from './chunk-ZHUVLBCC.js';
|
|
4
|
-
import { Slot } from './chunk-
|
|
4
|
+
import { Slot } from './chunk-HCEHTJ5E.js';
|
|
5
5
|
import { Icon } from './chunk-53F7GVBQ.js';
|
|
6
|
-
import { cn, GLASS_DROPDOWN, usePosition, usePopupFocus, FOCUS_RING } from './chunk-
|
|
6
|
+
import { cn, GLASS_DROPDOWN, usePosition, usePopupFocus, FOCUS_RING } from './chunk-2724SJO2.js';
|
|
7
7
|
import { useState, useRef, useEffect, useLayoutEffect } from 'react';
|
|
8
8
|
import { createPortal } from 'react-dom';
|
|
9
9
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
@@ -310,5 +310,5 @@ function DropdownMenu({ trigger, items, align = "end", className, container }) {
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
export { DropdownMenu };
|
|
313
|
-
//# sourceMappingURL=chunk-
|
|
314
|
-
//# sourceMappingURL=chunk-
|
|
313
|
+
//# sourceMappingURL=chunk-HUVZQOU4.js.map
|
|
314
|
+
//# sourceMappingURL=chunk-HUVZQOU4.js.map
|