gridsmith-ui 0.32.0 → 0.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -1
- package/README.md +4 -2
- package/dist/charts.d.ts +10 -1
- package/dist/charts.js +115 -50
- package/dist/charts.js.map +1 -1
- package/dist/chat.js +6 -6
- package/dist/{chunk-WSKPESAX.js → chunk-4FX6UCSS.js} +5 -5
- package/dist/{chunk-WSKPESAX.js.map → chunk-4FX6UCSS.js.map} +1 -1
- package/dist/{chunk-DO6DLTFK.js → chunk-4TQVFRKK.js} +6 -6
- package/dist/{chunk-DO6DLTFK.js.map → chunk-4TQVFRKK.js.map} +1 -1
- package/dist/{chunk-HCEHTJ5E.js → chunk-77X7AHFB.js} +3 -3
- package/dist/{chunk-HCEHTJ5E.js.map → chunk-77X7AHFB.js.map} +1 -1
- package/dist/{chunk-SIEU4H3H.js → chunk-BL2C35BN.js} +43 -33
- package/dist/chunk-BL2C35BN.js.map +1 -0
- package/dist/chunk-GIA4BMGI.js +18 -0
- package/dist/chunk-GIA4BMGI.js.map +1 -0
- package/dist/{chunk-2724SJO2.js → chunk-HDFTENVW.js} +7 -3
- package/dist/chunk-HDFTENVW.js.map +1 -0
- package/dist/{chunk-OVHM55JF.js → chunk-MPXE2XOP.js} +41 -6
- package/dist/chunk-MPXE2XOP.js.map +1 -0
- package/dist/{chunk-XBVZIN26.js → chunk-MW5CJOJN.js} +10 -8
- package/dist/chunk-MW5CJOJN.js.map +1 -0
- package/dist/{chunk-QY2RA2HO.js → chunk-N6QLEZFH.js} +5 -5
- package/dist/{chunk-QY2RA2HO.js.map → chunk-N6QLEZFH.js.map} +1 -1
- package/dist/{chunk-TMPPBXX3.js → chunk-NFVJEICH.js} +3 -3
- package/dist/{chunk-TMPPBXX3.js.map → chunk-NFVJEICH.js.map} +1 -1
- package/dist/{chunk-JHZ22HQP.js → chunk-NJG6JQGC.js} +61 -222
- package/dist/chunk-NJG6JQGC.js.map +1 -0
- package/dist/chunk-P3NUUIL6.js +9 -0
- package/dist/chunk-P3NUUIL6.js.map +1 -0
- package/dist/{chunk-NGZJK57C.js → chunk-PT4HYHI3.js} +10 -9
- package/dist/chunk-PT4HYHI3.js.map +1 -0
- package/dist/chunk-R7FG4ZQ5.js +16 -0
- package/dist/chunk-R7FG4ZQ5.js.map +1 -0
- package/dist/chunk-T33JK3ZE.js +81 -0
- package/dist/chunk-T33JK3ZE.js.map +1 -0
- package/dist/chunk-UI4BSRCQ.js +213 -0
- package/dist/chunk-UI4BSRCQ.js.map +1 -0
- package/dist/{chunk-HUVZQOU4.js → chunk-XJGFZ5CP.js} +5 -5
- package/dist/{chunk-HUVZQOU4.js.map → chunk-XJGFZ5CP.js.map} +1 -1
- package/dist/{chunk-R2IAK3J3.js → chunk-ZTS6HJAU.js} +3 -3
- package/dist/{chunk-R2IAK3J3.js.map → chunk-ZTS6HJAU.js.map} +1 -1
- package/dist/dashboard.d.ts +207 -0
- package/dist/dashboard.js +1210 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/data-grid.js +10 -9
- package/dist/data-grid.js.map +1 -1
- package/dist/editor-mentions.js +2 -2
- package/dist/editor.js +2 -2
- package/dist/index.d.ts +64 -8
- package/dist/index.js +245 -147
- package/dist/index.js.map +1 -1
- package/dist/kanban.js +8 -8
- package/dist/resizable.js +9 -8
- package/dist/resizable.js.map +1 -1
- package/dist/utils.d.ts +51 -1
- package/dist/utils.js +55 -4
- package/dist/utils.js.map +1 -1
- package/dist/virtualized.js +8 -8
- package/package.json +6 -1
- package/dist/chunk-2724SJO2.js.map +0 -1
- package/dist/chunk-H732QL56.js +0 -71
- package/dist/chunk-H732QL56.js.map +0 -1
- package/dist/chunk-JHZ22HQP.js.map +0 -1
- package/dist/chunk-LJYSVZMI.js +0 -25
- package/dist/chunk-LJYSVZMI.js.map +0 -1
- package/dist/chunk-NGZJK57C.js.map +0 -1
- package/dist/chunk-OVHM55JF.js.map +0 -1
- package/d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data-grid.js","sourcesContent":["import { useState, useCallback, useEffect, useLayoutEffect, useMemo, useRef, type ReactElement, type ReactNode, type SyntheticEvent, type KeyboardEvent as ReactKeyboardEvent } from \"react\";\nimport { useShellPreferences } from \"../lib/preferences\";\nimport {\n useReactTable,\n getCoreRowModel,\n getSortedRowModel,\n flexRender,\n type CellContext,\n type ColumnDef,\n type Header,\n type SortingState,\n} from \"@tanstack/react-table\";\nimport { cn, FOCUS_INSET, FOCUS_RING } from \"../lib/utils\";\nimport { Icon } from \"../lib/icons\";\nimport { CutCell, CutEmail } from \"./TextOverflow\";\nimport { Input } from \"./Input\";\nimport { NumberInput } from \"./NumberInput\";\nimport { DatePicker } from \"./DatePicker\";\nimport { Dropdown } from \"./Dropdown\";\nimport { Checkbox } from \"./Checkbox\";\nimport { Field } from \"./Field\";\nimport { Pagination } from \"./Pagination\";\nimport { useBreakpoint, type BreakpointKey } from \"../lib/use-breakpoint\";\nimport { useRevealFocus } from \"../lib/reveal-focus\";\nimport { inferColumnKinds, type ColumnKind } from \"../lib/table-utils\";\nimport { CardValue } from \"../lib/card-cell\";\nimport { TableCardCtx, RowsCtx, useFramesItself } from \"../lib/surface-context\";\nimport { FormChangeCtx } from \"../lib/form-context\";\nimport { focusInitial, useFocusLeave, useGridKeyboard } from \"../lib/focus\";\nimport { dayKey } from \"../lib/date-grid\";\nimport { SortIndicator } from \"../lib/sort-indicator\";\nimport { warnOnce } from \"../lib/dev-warn\";\nimport { usePagination, pagerPart, useWholeListCheck, type Pager } from \"../lib/use-pagination\";\nimport { CARDS_BELOW, useCardsSwitch } from \"../lib/use-cards-switch\";\n\n/** One of a choice column's options: the value its cells hold, and the words shown for it. */\nexport interface DataGridOption {\n value: string | number;\n label: string;\n}\n\n/** Column meta for opt-in truncation. Set on ColumnDef.meta. */\nexport interface DataGridColumnMeta {\n /** true = single-line, or { lines: N } for multi-line clamp. */\n truncate?: boolean | { lines: number };\n /** CSS max-width for the column. */\n maxWidth?: string;\n /** CSS width for the column — sibling grids that share a column set line up when their columns carry the same widths (round 14). */\n width?: string;\n /** CSS min-width for the column. */\n minWidth?: string;\n /**\n * Explicit column kind. When omitted the DataGrid infers it from data values (a yes or no too; never a choice). In an\n * editable grid it chooses the editor, where the control can hold the cell's value: \"number\" a NumberInput for a\n * number, \"date\" a DatePicker for a Date or an ISO date (\"2026-10-14\"), \"choice\" a Dropdown of `options`, \"boolean\" a\n * Checkbox; any other kind, and a number or a date written as text (\"18 KB\", \"12 Jan 2026\"), a text Input.\n */\n kind?: ColumnKind;\n /** Horizontal alignment of the header and the cells; a block element (a Checkbox, a Button) is laid out with flex so it follows too (round 14). Default: numbers right, everything else left. */\n align?: \"left\" | \"center\" | \"right\";\n /**\n * In an editable grid, whether this column's cells edit (default true); false for a column that shows (a status, a\n * calculated value, actions): its cells show no edit cue, and assistive tech hears them as read-only.\n */\n editable?: boolean;\n /**\n * A choice column's options (with `kind: \"choice\"`): its cells edit with a Dropdown of them, and a save gives the\n * option's `value`. Give the column a `cell` that shows the option's label.\n */\n options?: readonly DataGridOption[];\n /**\n * In an editable grid, the value onCellEdit gets from what was typed in a text cell, or in a number cell as its text\n * (default the text itself, or the number): a price written as text, `(text) => Number(text.replace(/[$,]/g, \"\"))`.\n * A date, a choice and a yes or no are given as their own values.\n */\n parse?: (text: string) => unknown;\n}\n\n/** The control a cell edits with (Sprint 25.8.7 item 19): its column's kind, where that control can hold the cell's value. */\ntype CellEditorKind = \"text\" | \"number\" | \"date\" | \"choice\" | \"boolean\";\n\n/** What an edit starts from: its control, the control's value, and how a saved value goes back in the cell's own form. */\ninterface EditorSetup {\n editor: CellEditorKind;\n value: unknown;\n out: (value: unknown) => unknown;\n}\n\nconst isEmpty = (v: unknown) => v === null || v === undefined || v === \"\";\nconst isDate = (v: unknown): v is Date => v instanceof Date && !Number.isNaN(v.getTime());\n/** An ISO date's text (\"2026-10-14\") as the local day it names, else null; the date grid's day key is the same text. */\nfunction isoDay(v: unknown): Date | null {\n const m = typeof v === \"string\" ? /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(v) : null;\n if (!m) return null;\n const d = new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]));\n return dayKey(d) === v ? d : null;\n}\n/** Two of an editor's values are one: a date by its time, anything else by itself. */\nconst sameValue = (a: unknown, b: unknown) => (isDate(a) && isDate(b) ? a.getTime() === b.getTime() : Object.is(a, b));\n\n/**\n * The editor for a cell. A control edits only a value it can hold: a NumberInput holds no empty cell and no \"18 KB\", a\n * DatePicker gives back no \"12 Jan 2026\", so those keep the text Input. A date goes back in the form it came: a Date,\n * keeping its time of day, or an ISO date's text; an empty cell's, as the column's first date is (a Date when it has\n * none).\n */\nfunction editorFor(kind: ColumnKind | undefined, raw: unknown, meta: DataGridColumnMeta | undefined, firstOfColumn: () => unknown): EditorSetup {\n const parse = meta?.parse;\n if (kind === \"choice\" && meta?.options?.length) return { editor: \"choice\", value: raw ?? null, out: (v) => v };\n if (kind === \"boolean\" && (typeof raw === \"boolean\" || isEmpty(raw))) return { editor: \"boolean\", value: raw === true, out: (v) => v };\n if (kind === \"number\" && typeof raw === \"number\" && Number.isFinite(raw)) return { editor: \"number\", value: raw, out: (v) => (parse ? parse(String(v)) : v) };\n if (kind === \"date\") {\n const was = isEmpty(raw) ? firstOfColumn() : raw;\n if (isDate(raw)) {\n return { editor: \"date\", value: raw, out: (v) => (isDate(v) ? new Date(v.getFullYear(), v.getMonth(), v.getDate(), raw.getHours(), raw.getMinutes(), raw.getSeconds(), raw.getMilliseconds()) : null) };\n }\n if (isoDay(was)) return { editor: \"date\", value: isoDay(raw), out: (v) => (isDate(v) ? dayKey(v) : null) };\n if (isEmpty(was) || isDate(was)) return { editor: \"date\", value: null, out: (v) => (isDate(v) ? v : null) };\n }\n return { editor: \"text\", value: String(raw ?? \"\"), out: (v) => (parse ? parse(v as string) : v) };\n}\n\n/**\n * A cell's editor (Sprint 25.8.7 item 19): the library's control for its column's kind, named for the column by a\n * hidden Field label. What is typed (text, a number, a date's parts) saves with Enter or by leaving the editor; a value\n * picked by a press (an option, a calendar's day, the box) is the edit, and saves at once; Escape, in the field or in\n * its popup, leaves the cell as it was. Leaving is the Field's own check (lib/focus.ts, useFocusLeave): focus moving\n * into the editor's popup, the Dropdown's list or the DatePicker's calendar, is not leaving it.\n */\nfunction CellEditor({ editor, value, name, options, onChange, onEnd }: {\n editor: CellEditorKind;\n value: unknown;\n name: string;\n options?: readonly DataGridOption[];\n onChange: (value: unknown) => void;\n onEnd: (save: boolean, focusBack: boolean, picked?: { value: unknown }) => void;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n // leaving the editor saves it and lets focus go where it went (the review of 30 September: it pulled focus back, and\n // the next keys were lost)\n const leave = useFocusLeave(() => onEnd(true, false));\n // a value chosen in a popup (the calendar's day, by a click or by Enter) is the edit itself. React passes the popup's\n // events up through its portal, so a key or a press from outside this editor's own box came from there. The flag is\n // where the latest one came from, never reset by a timer: Chrome runs a capture handler and the bubbling handler that\n // changes the value as separate listeners, with a microtask checkpoint between them\n const fromPopup = useRef(false);\n const markPopupEvent = (e: SyntheticEvent) => { fromPopup.current = !ref.current?.contains(e.target as Node); };\n const opened = useRef(false);\n useLayoutEffect(() => {\n const root = ref.current;\n if (!root) return;\n focusInitial(root);\n const el = document.activeElement;\n // the value opens selected: typing replaces it, an arrow key keeps it\n if (el instanceof HTMLInputElement && el.type === \"text\") el.select();\n // a choice opens on its list, the edit itself; once, though a development build runs this twice\n if (editor === \"choice\" && !opened.current && el instanceof HTMLButtonElement && root.contains(el)) {\n opened.current = true;\n el.click();\n }\n }, [editor]);\n // a choice and the box change only when picked, and a pick saves at once; what is typed or stepped (text, a number, a\n // date's parts) waits for Enter or for leaving the editor\n const picks = editor === \"choice\" || editor === \"boolean\";\n const change = (v: unknown) => (picks || fromPopup.current ? onEnd(true, true, { value: v }) : onChange(v));\n let control: ReactElement;\n if (editor === \"number\") control = <NumberInput size=\"sm\" value={value as number} allowDecimals onChange={change} />;\n else if (editor === \"date\") control = <DatePicker size=\"sm\" value={value as Date | null} onChange={change} />;\n else if (editor === \"boolean\") control = <Checkbox checked={value === true} onChange={(checked) => change(checked)} />;\n else if (editor === \"choice\" && options) {\n control = (\n <Dropdown\n size=\"sm\"\n options={options.map((o) => ({ id: String(o.value), label: o.label }))}\n value={value === null || value === undefined ? \"\" : String(value)}\n onChange={(id) => change(options.find((o) => String(o.value) === id)?.value ?? id)}\n />\n );\n } else control = <Input size=\"sm\" value={value as string} onChange={(e) => change(e.target.value)} />;\n return (\n <div\n ref={ref}\n data-cell-editor=\"\"\n {...leave}\n onClickCapture={markPopupEvent}\n onKeyDownCapture={markPopupEvent}\n onKeyDown={(e) => {\n // Escape, in the field or its popup, leaves the cell as it was, and goes no further: a Drawer round the grid stays\n if (e.key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n onEnd(false, true);\n return;\n }\n // Enter saves what was typed; on a button (the Dropdown's, the calendar's) it is the button's, which opens its\n // popup, and in the popup it picks\n if (e.key === \"Enter\" && e.currentTarget.contains(e.target as Node) && !(e.target instanceof HTMLButtonElement)) {\n e.preventDefault();\n onEnd(true, true);\n }\n }}\n >\n {/* a grid saves as you go, so its editor never marks a form around it; the cells' own controls still do (the\n review of 30 September: the whole grid opted out, and a Drawer closed on a changed checkbox unasked) */}\n <FormChangeCtx value={null}>\n <Field label={name} hideLabel>{control}</Field>\n </FormChangeCtx>\n </div>\n );\n}\n\n/**\n * Sprint 25.8.7 item 19 (collections-5): an editable cell says so before it is tried, a pencil shown while the cell is\n * hovered or focused (focused too: a touch screen has no hover); a calculated or locked cell shows none. It sits in room\n * an editable column keeps at its cells' end, header too, so a value never moves and a number stays under its header.\n */\nconst EDIT_CUE_ROOM = \"pr-[calc(var(--ds-space-4)+var(--ds-space-1)+12px)]\";\n\n/** How wide an editor sits over its cell: the cell's width inside its padding, and never less than its control needs. */\nconst EDITOR_WIDTH: Record<CellEditorKind, string> = {\n text: \"w-[max(calc(100%-var(--ds-space-4)),12rem)]\",\n number: \"w-[max(calc(100%-var(--ds-space-4)),8rem)]\",\n date: \"w-[max(calc(100%-var(--ds-space-4)),10.5rem)]\",\n choice: \"w-[max(calc(100%-var(--ds-space-4)),9rem)]\",\n boolean: \"w-auto\",\n};\n/**\n * The least an editable column of numbers, dates or choices is wide, at rest too: its editor's room and the cell's\n * padding, so the editor fits in its own cell and never covers the next one (a text column is wide by its words, and\n * a text editor may run over). A page's own width or min-width for the column wins.\n */\nconst EDITABLE_MIN_WIDTH: Partial<Record<CellEditorKind, string>> = { number: \"9rem\", date: \"11.5rem\", choice: \"10rem\" };\nfunction editableMinWidth(kind: ColumnKind | undefined, meta: DataGridColumnMeta | undefined): string | undefined {\n if (meta?.width || meta?.minWidth) return undefined;\n const editor: CellEditorKind | null = kind === \"number\" ? \"number\" : kind === \"date\" ? \"date\" : kind === \"choice\" && meta?.options?.length ? \"choice\" : null;\n return editor ? EDITABLE_MIN_WIDTH[editor] : undefined;\n}\nconst EDIT_CUE = (\n <span\n data-edit-cue=\"\"\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute top-1/2 -translate-y-1/2 right-ds-4 flex\",\n \"text-[var(--ds-text-muted)] opacity-0 transition-opacity duration-[var(--ds-transition-speed)]\",\n \"group-hover/cell:opacity-100 group-focus/cell:opacity-100\",\n )}\n >\n <Icon name=\"edit\" size={12} />\n </span>\n);\n\n\nexport interface DataGridProps<T> {\n data: T[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- public API: columns may carry any value type\n columns: ColumnDef<T, any>[];\n /**\n * Rows a page, over the project's (dataDisplay.itemsPerPage), for a grid the user asked to page differently. Leave it\n * out: the grid pages as the project says, with the project's control (Sprint 25.13 A5; it was 10).\n */\n pageSize?: number;\n /**\n * Cells edit in place, as the APG's grid (Sprint 25.13 A5): the grid is one Tab stop and the arrow keys move between\n * cells; Enter or F2 (or a double-click) opens a cell's editor, Enter or leaving it saves and Escape cancels, and a\n * brief tick, announced as \"Saved\", shows the save. A grid saves as you go, so it never marks a form around it.\n */\n editable?: boolean;\n /**\n * A saved edit: the row's index in `data`, the column's id and the new value (the text typed, or the column's\n * `meta.parse` of it). Called only when the value changed. Return a promise to have the tick and \"Saved\" wait for it:\n * a rejection is announced as \"Not saved\", and the page says why and keeps the old value.\n */\n onCellEdit?: (rowIndex: number, columnId: string, value: unknown) => void | Promise<unknown>;\n /** The screen width below which the grid shows cards: the project's responsive.tableToCardsBreakpoint, else \"md\". */\n mobileBreakpoint?: BreakpointKey;\n /**\n * The grid's own width below which it shows cards when it doesn't fit, in px (Sprint 25.13 A35): about a phone's; 0\n * never switches by width. An editable grid never shows cards: it stays the APG's grid, scrolling sideways.\n */\n cardsBelow?: number;\n /**\n * The list's pager (Sprint 25.13 A3), from `usePagination(data)` over the same rows: pass it when the page also shows\n * the count (TableToolbar). Without it the grid pages itself the same way.\n */\n pager?: Pager<unknown>;\n /** The grid's name for assistive tech. */\n \"aria-label\"?: string;\n className?: string;\n}\n\n/** A cell of an editable grid: its row among those drawn (-1 for the header) and its column. */\ninterface CellAt { r: number; c: number }\nconst cellKey = (p: CellAt) => (p.r < 0 ? `h:${p.c}` : `${p.r}:${p.c}`);\n/** A cell by its row's id (null for the header), which a sort or a save that re-sorts never moves to another row. */\ninterface CellId { row: string | null; c: number }\n/** How long the saved tick shows, in ms (A5). */\nconst SAVED_TICK_MS = 1500;\n\nexport function DataGrid<T>({\n data,\n columns,\n pageSize,\n editable = false,\n onCellEdit,\n mobileBreakpoint: mobileBreakpointProp,\n cardsBelow = CARDS_BELOW,\n pager: pagerProp,\n \"aria-label\": ariaLabel,\n className,\n}: DataGridProps<T>) {\n // Sprint 25.14 A44: a grid draws its own frame, so a SplitView's list pane draws none around it\n useFramesItself();\n // Sprint 25.6 (B9): responsive.tableToCardsBreakpoint reaches the table through the shell; a prop wins; md outside any shell.\n const preferences = useShellPreferences();\n const mobileBreakpoint: BreakpointKey = mobileBreakpointProp ?? preferences.tableToCardsBreakpoint ?? \"md\";\n const narrowScreen = useBreakpoint(mobileBreakpoint);\n // A35: cards only on a narrow screen or where the grid's own width is a phone's. An editable grid stays the APG's grid\n // at every width, scrolling sideways: its cards have no editor (the review of 30 September: in a default Drawer, whose\n // body is 359 px, the grid went to cards and could no longer be edited).\n const { cards: isMobile, rootRef } = useCardsSwitch(editable ? false : narrowScreen, editable ? 0 : cardsBelow);\n const [sorting, setSorting] = useState<SortingState>([]);\n // the scroll area: a header or a cell the keyboard reaches is scrolled in whole, with its outline (Sprint 30, P3)\n const [scrollArea, setScrollArea] = useState<HTMLDivElement | null>(null);\n useRevealFocus(scrollArea);\n // the open editor (Sprint 25.8.7 item 19): its control, its value as the control holds it, and how a save gives it back\n const [editing, setEditing] = useState<(CellId & { editor: CellEditorKind; value: unknown; was: unknown; out: (value: unknown) => unknown }) | null>(null);\n\n /* ── Column kind inference ─────────────────────────────────────────── */\n const columnKeys = useMemo(() => columns.map((c) => c.id ?? (\"accessorKey\" in c ? String(c.accessorKey) : \"\")).filter(Boolean), [columns]);\n const inferredKinds = useMemo(\n () => inferColumnKinds(data as Record<string, unknown>[], columnKeys),\n [data, columnKeys],\n );\n const kindOf = useCallback(\n (colId: string, meta: DataGridColumnMeta | undefined) => meta?.kind ?? inferredKinds.get(colId),\n [inferredKinds],\n );\n\n // TanStack Table returns functions the React Compiler cannot memoise; the\n // compiler would skip this component, which is fine — the project does not\n // use it. The note is informational, not a defect.\n // eslint-disable-next-line react-hooks/incompatible-library -- TanStack Table is not compiler-compatible\n const table = useReactTable({\n data,\n columns,\n state: { sorting },\n onSortingChange: (updater) => { setSorting(updater); pagerProp?.setPage(1); },\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n });\n\n // ── A5 / A3: the project's page size and list style, through the pager, over every row sorted ──\n const sortedRows = table.getRowModel().rows;\n const ownPager = usePagination(sortedRows, { pageSize, resetOn: sorting });\n const pager = pagerProp ?? ownPager;\n useWholeListCheck(\"DataGrid\", data.length, pagerProp);\n const rows = pagerPart(sortedRows, pager);\n const leafColumns = table.getVisibleLeafColumns();\n const headerText = (id: string) => {\n const header = leafColumns.find((c) => c.id === id)?.columnDef.header;\n return typeof header === \"string\" ? header : id;\n };\n // a column's kind chooses its editor: a choice needs its options, and options alone choose nothing (told in development)\n if (editable) {\n for (const column of leafColumns) {\n const meta = column.columnDef.meta as DataGridColumnMeta | undefined;\n if (meta?.kind === \"choice\" && !meta.options?.length) warnOnce(\"DataGrid\", `column \"${column.id}\" is a choice with no options, so it edits as text: give its meta the options its cells take.`);\n else if (meta?.options?.length && meta.kind !== \"choice\") warnOnce(\"DataGrid\", `column \"${column.id}\" has options but not the choice kind, so they go unused: give its meta kind \"choice\" to edit it with a Dropdown.`);\n }\n }\n\n // ── A5: the grid's keyboard (the APG's grid), when editable ──\n // The Tab stop, the editor and the saved tick are kept by the row's id, so a sort, or a save that re-sorts the rows,\n // keeps each on its row (the review of 30 September: the tick and the Tab stop went to the row now in the old place).\n const gridRef = useRef<HTMLTableElement>(null);\n const [activeId, setActiveId] = useState<CellId>({ row: null, c: 0 });\n const lastRow = rows.length - 1;\n const rowAt = (id: string | null) => (id === null ? -1 : rows.findIndex((row) => row.id === id));\n const idAt = (p: CellAt): CellId => ({ row: p.r < 0 ? null : rows[p.r]?.id ?? null, c: p.c });\n const current: CellAt = { r: Math.min(rowAt(activeId.row), lastRow), c: Math.min(activeId.c, Math.max(0, leafColumns.length - 1)) };\n const setActive = (p: CellAt) => setActiveId(idAt(p));\n const move = (p: CellAt, e: ReactKeyboardEvent): CellAt | null => {\n // Alt with an arrow is the browser's (Back, Forward), and Ctrl or ⌘ with one too; Ctrl or ⌘ with Home or End goes to\n // the grid's first or last cell (the APG's grid)\n if (e.altKey) return null;\n const toCorner = e.ctrlKey || e.metaKey;\n switch (e.key) {\n case \"ArrowRight\": return !toCorner && p.c < leafColumns.length - 1 ? { ...p, c: p.c + 1 } : null;\n case \"ArrowLeft\": return !toCorner && p.c > 0 ? { ...p, c: p.c - 1 } : null;\n case \"ArrowDown\": return !toCorner && p.r < lastRow ? { ...p, r: p.r + 1 } : null;\n case \"ArrowUp\": return !toCorner && p.r > -1 ? { ...p, r: p.r - 1 } : null;\n case \"Home\": return toCorner ? { r: -1, c: 0 } : { ...p, c: 0 };\n case \"End\": return toCorner ? { r: lastRow, c: leafColumns.length - 1 } : { ...p, c: leafColumns.length - 1 };\n default: return null;\n }\n };\n // an edit ends once: Enter saves and unmounts the editor, whose blur must not save it again\n const ended = useRef(false);\n const startEdit = (p: CellAt) => {\n const row = rows[p.r];\n const column = leafColumns[p.c];\n if (!row || !column || (column.columnDef.meta as DataGridColumnMeta | undefined)?.editable === false) return;\n // another cell's edit still open (its leave is told a moment after its blur) is left now, and saves\n if (editing && !(editing.row === row.id && editing.c === p.c)) finishEdit(true, false);\n ended.current = false;\n setActive(p);\n const meta = column.columnDef.meta as DataGridColumnMeta | undefined;\n // an empty date cell edits as the column's dates are held: the first of them, read only if it's needed\n const firstOfColumn = () => rows.map((x) => x.getValue(column.id)).find((v) => !isEmpty(v));\n const setup = editorFor(kindOf(column.id, meta), row.getValue(column.id), meta, firstOfColumn);\n setEditing({ row: row.id, c: p.c, editor: setup.editor, value: setup.value, was: setup.value, out: setup.out });\n };\n const grid = useGridKeyboard<CellAt>({\n container: gridRef,\n active: current,\n setActive,\n keyOf: cellKey,\n move,\n onActivate: (p, e) => {\n if (p.r < 0) { if (leafColumns[p.c]?.getCanSort()) leafColumns[p.c].toggleSorting(); }\n else if (e.key === \"Enter\") startEdit(p);\n },\n modifierKeys: true,\n });\n const onGridKeyDown = (e: ReactKeyboardEvent) => {\n // while a cell is edited its keys are its editor's, a button's arrows too: they never move to another cell (the\n // APG's grid, editing within a cell)\n if (e.target instanceof Element && e.target.closest(\"[data-cell-editor]\")) return;\n // F2 opens the cell's editor too (the APG's grid)\n if (e.key === \"F2\" && !editing && current.r >= 0 && e.target instanceof HTMLElement && e.target.getAttribute(\"data-grid-key\") === cellKey(current)) {\n e.preventDefault();\n startEdit(current);\n return;\n }\n grid.onKeyDown(e);\n };\n // the Tab stop follows focus, however it got there: a click, a screen reader's command, a double-click (the hook's\n // contract; the review of 30 September: a clicked cell took no Enter, and ArrowDown went from the header)\n const onGridFocus = (e: React.FocusEvent) => {\n const key = e.target instanceof HTMLElement ? e.target.getAttribute(\"data-grid-key\") : null;\n if (!key) return;\n const [r, c] = key.startsWith(\"h:\") ? [-1, Number(key.slice(2))] : key.split(\":\").map(Number);\n if (Number.isFinite(r) && Number.isFinite(c) && cellKey(current) !== key) setActive({ r, c });\n };\n\n // ── A5: the save, its tick and its announcement ──\n const [saved, setSaved] = useState<{ row: string; c: number; n: number; ok: boolean } | null>(null);\n useEffect(() => {\n if (!saved) return;\n const t = setTimeout(() => setSaved((s) => (s && s.n === saved.n ? null : s)), SAVED_TICK_MS);\n return () => clearTimeout(t);\n }, [saved]);\n const heard = useRef(0);\n // after Enter or Escape focus comes back to the cell, on its row wherever a save that re-sorts puts it: its page first\n const refocus = useRef<CellId | null>(null);\n useLayoutEffect(() => {\n const want = refocus.current;\n if (!want) return;\n const r = rowAt(want.row);\n if (r < 0) {\n const all = sortedRows.findIndex((row) => row.id === want.row);\n if (all >= 0 && pager.style === \"pagination\") { const page = Math.floor(all / pager.pageSize) + 1; if (page !== pager.page) { pager.setPage(page); return; } }\n refocus.current = null;\n return;\n }\n refocus.current = null;\n grid.focus({ r, c: want.c });\n });\n // `picked`: a value chosen by a press (an option, a day, the box), which is the edit itself and saves at once\n const finishEdit = (commit: boolean, focusBack: boolean, picked?: { value: unknown }) => {\n if (!editing || ended.current) return;\n ended.current = true;\n const r = rowAt(editing.row);\n const row = rows[r];\n const column = leafColumns[editing.c];\n const cell = { row: editing.row, c: editing.c };\n setEditing(null);\n // leaving the editor (a click elsewhere, Tab) saves and lets focus go where it went (the review of 30 September:\n // it pulled focus back, and the next keys were lost)\n if (focusBack) { setActiveId(cell); refocus.current = cell; }\n // a save that changes nothing isn't one\n const value = picked ? picked.value : editing.value;\n if (!commit || !row || !column || sameValue(value, editing.was)) return;\n const done = (ok: boolean) => { heard.current += 1; setSaved({ ...cell, row: editing.row!, n: heard.current, ok }); };\n const result = onCellEdit?.(row.index, column.id, editing.out(value));\n if (result && typeof (result as Promise<unknown>).then === \"function\") (result as Promise<unknown>).then(() => done(true), () => done(false));\n else done(true);\n };\n\n // A3: the grid and its control are one element, as in 0.21, which takes the className: in a grid or a flex row they\n // stay one item (the review of 30 September: the control became an item of its own beside the grid)\n const control = data.length > 0 ? <Pagination {...pager.props} /> : null;\n const setRoot = (node: HTMLDivElement | null) => { rootRef.current = node; };\n const withControl = (list: ReactNode) => <div ref={setRoot} data-gs-paged=\"\" className={cn(\"flex flex-col min-w-0\", className)}>{list}{control}</div>;\n\n if (isMobile) {\n return withControl(\n <div data-ds-list=\"\" className=\"space-y-ds-3\">\n <TableCardCtx value={true}><RowsCtx value={true}>\n <div className=\"flex flex-col gap-ds-3\">\n {rows.map((row) => (\n <div\n key={row.id}\n className={cn(\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"rounded-[var(--ds-radius-md)] bg-[var(--ds-bg-surface)]\",\n \"p-ds-4 space-y-ds-3\",\n )}\n >\n {row.getVisibleCells().map((cell) => (\n <div key={cell.id} className=\"flex justify-between gap-ds-2 text-sm\">\n <span className=\"shrink-0 text-[var(--ds-text-secondary)] font-medium text-xs uppercase tracking-wider\">\n {typeof cell.column.columnDef.header === \"string\"\n ? cell.column.columnDef.header\n : cell.column.id}\n </span>\n <CardValue value={flexRender(cell.column.columnDef.cell, cell.getContext())} />\n </div>\n ))}\n </div>\n ))}\n </div>\n </RowsCtx></TableCardCtx>\n </div>\n );\n }\n\n const headerCell = (header: Header<T, unknown>, c: number) => {\n const canSort = header.column.getCanSort();\n const sorted = header.column.getIsSorted();\n const meta = header.column.columnDef.meta as DataGridColumnMeta | undefined;\n const headerKind = kindOf(header.column.id, meta);\n const headerAlign = meta?.align ?? (headerKind === \"number\" ? \"right\" : \"left\");\n const shrink = (headerKind === \"number\" || headerKind === \"date\") && !meta?.maxWidth;\n const at = { r: -1, c };\n const label = flexRender(header.column.columnDef.header, header.getContext());\n // A47: a sortable header holds a button: a Tab stop in a read-only grid, a cell the arrows reach in an editable one\n const inside = canSort ? (\n <button\n type=\"button\"\n onClick={header.column.getToggleSortingHandler()}\n {...(editable ? { \"data-grid-key\": cellKey(at), tabIndex: grid.tabIndexOf(at) } : {})}\n className={cn(\n \"inline-flex items-center gap-ds-1 uppercase tracking-wider cursor-pointer select-none [font:inherit] text-inherit\",\n \"hover:text-[var(--ds-text-primary)] rounded-[var(--ds-radius-sm)]\",\n // in a right-aligned column the indicator goes before the label, so the label ends where the column's values\n // end; the sorted column's label in full colour (the owner's choice at the look check, 14 October)\n headerAlign === \"right\" && \"flex-row-reverse\",\n sorted && \"text-[var(--ds-text-primary)]\",\n FOCUS_RING,\n )}\n >\n {label}\n <SortIndicator sorted={sorted} />\n </button>\n ) : label;\n return (\n <th\n key={header.id}\n role={editable ? \"columnheader\" : undefined}\n aria-sort={sorted === \"asc\" ? \"ascending\" : sorted === \"desc\" ? \"descending\" : undefined}\n {...(editable && !canSort ? { \"data-grid-key\": cellKey(at), tabIndex: grid.tabIndexOf(at) } : {})}\n className={cn(\n \"px-ds-4 py-ds-3 text-xs font-[var(--ds-weight-heading)] uppercase tracking-wider\",\n headerAlign === \"right\" ? \"text-right\" : headerAlign === \"center\" ? \"text-center\" : \"text-left\",\n shrink && \"w-px whitespace-nowrap\",\n \"text-[var(--ds-text-secondary)]\",\n FOCUS_INSET,\n // an editable column's cells keep room for their cue at their end (item 19): its header keeps the same\n editable && meta?.editable !== false && EDIT_CUE_ROOM,\n )}\n style={meta?.maxWidth || meta?.width || meta?.minWidth ? { maxWidth: meta?.maxWidth, width: meta?.width, minWidth: meta?.minWidth } : undefined}\n >\n <span className={cn(\"flex items-center gap-ds-1\", headerAlign === \"right\" && \"justify-end\", headerAlign === \"center\" && \"justify-center\")}>\n {inside}\n </span>\n </th>\n );\n };\n\n return withControl(\n <div data-ds-list=\"\" data-wide-control=\"\" className=\"min-w-0\">\n <div\n ref={setScrollArea}\n // the scroll area the width switch reads (A35), as the Table's\n data-table-scroll=\"\"\n className={cn(\n \"relative w-full overflow-auto scroll-p-[4px] rounded-[var(--ds-radius-md)]\",\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"shadow-[var(--ds-shadow-card)]\",\n \"bg-[var(--ds-bg-surface)]\",\n )}\n >\n <table\n ref={gridRef}\n role={editable ? \"grid\" : undefined}\n aria-label={ariaLabel}\n onKeyDown={editable ? onGridKeyDown : undefined}\n onFocus={editable ? onGridFocus : undefined}\n className=\"w-full text-sm\"\n >\n <thead className=\"bg-[var(--ds-bg-muted)]\">\n {table.getHeaderGroups().map((hg) => (\n <tr key={hg.id} role={editable ? \"row\" : undefined} className=\"border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]\">\n {hg.headers.map((header, c) => headerCell(header, c))}\n </tr>\n ))}\n </thead>\n <tbody><RowsCtx value={true}>\n {rows.map((row, r) => (\n <tr\n key={row.id}\n role={editable ? \"row\" : undefined}\n className={cn(\n \"border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)] last:border-b-0\",\n \"hover:bg-[var(--ds-bg-muted)] transition-colors\",\n )}\n >\n {row.getVisibleCells().map((cell, c) => {\n const meta = cell.column.columnDef.meta as DataGridColumnMeta | undefined;\n const truncLines = meta?.truncate === true ? 1 : meta?.truncate ? meta.truncate.lines : 0;\n const kind = kindOf(cell.column.id, meta);\n const rendered = flexRender(cell.column.columnDef.cell, cell.getContext() as CellContext<T, unknown>);\n const at = { r, c };\n const isEditing = editable && editing?.row === row.id && editing.c === c;\n\n const shrink = (kind === \"number\" || kind === \"date\") && !meta?.maxWidth;\n // Round 14 (50.2): a centred or right-aligned column lays a block element out with flex — text-align moves inline content only.\n const align = meta?.align ?? (kind === \"number\" ? \"right\" : \"left\");\n let inner: ReactNode;\n if (isEditing) {\n // the library's control for the column's kind, named for its column (CellEditor). The cell keeps its\n // size while it is edited: its value holds the room, unseen, and the editor sits over it, from the\n // cell's start (its end, in a right-aligned column), as wide as its control needs. So no column moves\n // and the row keeps its height (the look check's second round: a number's field had no room in its\n // narrow column, and a date's widened every column)\n inner = (\n <>\n <span aria-hidden=\"true\" className=\"invisible\">{rendered}</span>\n <div className={cn(\n \"absolute inset-y-0 z-30 flex items-center\", EDITOR_WIDTH[editing.editor],\n // from the cell's end in a right-aligned column, and in the last column, where an editor wider\n // than its cell would run past the grid's edge; over the cell before, it stays in view\n align === \"right\" || c === row.getVisibleCells().length - 1 ? \"right-ds-2\" : \"left-ds-2\",\n )}>\n <CellEditor\n editor={editing.editor}\n value={editing.value}\n name={headerText(cell.column.id)}\n options={meta?.options}\n onChange={(v) => setEditing({ ...editing, value: v })}\n onEnd={finishEdit}\n />\n </div>\n </>\n );\n } else if (truncLines > 0) {\n inner = <CutCell lines={truncLines}>{rendered}</CutCell>;\n } else if (kind === \"email\") {\n inner = <CutEmail>{rendered}</CutEmail>;\n } else {\n inner = rendered;\n }\n const value = cell.getValue();\n if (!isEditing && align !== \"left\" && typeof value !== \"string\" && typeof value !== \"number\" && value !== null && value !== undefined) {\n inner = <div className={cn(\"flex items-center\", align === \"center\" ? \"justify-center\" : \"justify-end\")}>{inner}</div>;\n }\n const tick = editable && saved?.ok && saved.row === row.id && saved.c === c\n ? <Icon name=\"check\" size={14} className=\"ml-ds-1 inline-block align-middle text-[var(--ds-status-success)]\" />\n : null;\n\n // item 19: an editable cell says so before it is tried; a calculated or locked one is read-only\n const edits = editable && meta?.editable !== false;\n const least = edits ? editableMinWidth(kind, meta) : undefined;\n return (\n <td\n key={cell.id}\n // a double-click in the open editor selects a word, and never reopens it over what was typed\n {...(editable ? { role: \"gridcell\", \"data-grid-key\": cellKey(at), tabIndex: grid.tabIndexOf(at), onDoubleClick: () => { if (!isEditing) startEdit(at); } } : {})}\n aria-readonly={editable && !edits ? true : undefined}\n className={cn(\n \"px-ds-4 py-ds-3 text-[var(--ds-text-primary)]\",\n align === \"right\" && \"text-right\",\n align === \"center\" && \"text-center\",\n shrink && \"w-px whitespace-nowrap\",\n editable && FOCUS_INSET,\n edits && cn(\"group/cell relative\", EDIT_CUE_ROOM),\n )}\n style={meta?.maxWidth || meta?.width || meta?.minWidth || least ? { maxWidth: meta?.maxWidth, width: meta?.width, minWidth: meta?.minWidth ?? least } : undefined}\n >\n {inner}\n {tick}\n {edits && !isEditing && EDIT_CUE}\n </td>\n );\n })}\n </tr>\n ))}\n </RowsCtx></tbody>\n </table>\n </div>\n {/* A5: a save is heard, politely (WCAG 4.1.3); each one is a new line, so two saves are heard twice */}\n {editable && <div role=\"status\" className=\"sr-only\"><span key={saved?.n ?? 0}>{saved ? (saved.ok ? \"Saved\" : \"Not saved\") : \"\"}</span></div>}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../showcase/src/components/DataGrid.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwFA,IAAM,UAAU,CAAC,CAAA,KAAe,MAAM,IAAA,IAAQ,CAAA,KAAM,UAAa,CAAA,KAAM,EAAA;AACvE,IAAM,MAAA,GAAS,CAAC,CAAA,KAA0B,CAAA,YAAa,IAAA,IAAQ,CAAC,MAAA,CAAO,KAAA,CAAM,CAAA,CAAE,OAAA,EAAS,CAAA;AAExF,SAAS,OAAO,CAAA,EAAyB;AACvC,EAAA,MAAM,IAAI,OAAO,CAAA,KAAM,WAAW,2BAAA,CAA4B,IAAA,CAAK,CAAC,CAAA,GAAI,IAAA;AACxE,EAAA,IAAI,CAAC,GAAG,OAAO,IAAA;AACf,EAAA,MAAM,IAAI,IAAI,IAAA,CAAK,OAAO,CAAA,CAAE,CAAC,CAAC,CAAA,EAAG,MAAA,CAAO,CAAA,CAAE,CAAC,CAAC,CAAA,GAAI,CAAA,EAAG,OAAO,CAAA,CAAE,CAAC,CAAC,CAAC,CAAA;AAC/D,EAAA,OAAO,MAAA,CAAO,CAAC,CA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,uBAiBZ;AAAA,oBAEJ,CAAC;AAAA,mBAAA;AAAA,kBApFI,GAAA,CAAI;AAAA,iBAsFZ,GACH,CAAA,EAAU;AAAA;AAAA;AAAA;AACZ;AAAA,OACF;AAAA,MAEC,4BAAY,GAAA,CAAC,KAAA,EAAA,EAAI,MAAK,QAAA,EAAS,SAAA,EAAU,WAAU,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAA0B,QAAA,EAAA,KAAA,GAAS,KAAA,CAAM,KAAK,OAAA,GAAU,WAAA,GAAe,MAA7D,KAAA,EAAO,CAAA,IAAK,CAAoD,CAAA,EAAO;AAAA,KAAA,EACxI;AAAA,GACF;AACF","file":"data-grid.js","sourcesContent":["import { useState, useCallback, useEffect, useLayoutEffect, useMemo, useRef, type ReactElement, type ReactNode, type SyntheticEvent, type KeyboardEvent as ReactKeyboardEvent } from \"react\";\nimport { useShellPreferences } from \"../lib/preferences\";\nimport {\n useReactTable,\n getCoreRowModel,\n getSortedRowModel,\n flexRender,\n type CellContext,\n type ColumnDef,\n type Header,\n type SortingState,\n} from \"@tanstack/react-table\";\nimport { cn, FOCUS_INSET, FOCUS_RING } from \"../lib/utils\";\nimport { Icon } from \"../lib/icons\";\nimport { CutCell, CutEmail } from \"./TextOverflow\";\nimport { Input } from \"./Input\";\nimport { NumberInput } from \"./NumberInput\";\nimport { DatePicker } from \"./DatePicker\";\nimport { Dropdown } from \"./Dropdown\";\nimport { Checkbox } from \"./Checkbox\";\nimport { Field } from \"./Field\";\nimport { Pagination } from \"./Pagination\";\nimport { useBreakpoint, type BreakpointKey } from \"../lib/use-breakpoint\";\nimport { useRevealFocus } from \"../lib/reveal-focus\";\nimport { inferColumnKinds, type ColumnKind } from \"../lib/table-utils\";\nimport { CardValue } from \"../lib/card-cell\";\nimport { TableCardCtx, RowsCtx, useFramesItself } from \"../lib/surface-context\";\nimport { FormChangeCtx } from \"../lib/form-context\";\nimport { focusInitial, useFocusLeave, useGridKeyboard } from \"../lib/focus\";\nimport { dayKey } from \"../lib/date-grid\";\nimport { SortIndicator } from \"../lib/sort-indicator\";\nimport { warnOnce } from \"../lib/dev-warn\";\nimport { usePagination, pagerPart, useWholeListCheck, type Pager } from \"../lib/use-pagination\";\nimport { CARDS_BELOW, useCardsSwitch } from \"../lib/use-cards-switch\";\n\n/** One of a choice column's options: the value its cells hold, and the words shown for it. */\nexport interface DataGridOption {\n value: string | number;\n label: string;\n}\n\n/** Column meta for opt-in truncation. Set on ColumnDef.meta. */\nexport interface DataGridColumnMeta {\n /** true = single-line, or { lines: N } for multi-line clamp. */\n truncate?: boolean | { lines: number };\n /** CSS max-width for the column. */\n maxWidth?: string;\n /** CSS width for the column — sibling grids that share a column set line up when their columns carry the same widths (round 14). */\n width?: string;\n /** CSS min-width for the column. */\n minWidth?: string;\n /**\n * Explicit column kind. When omitted the DataGrid infers it from data values (a yes or no too; never a choice). In an\n * editable grid it chooses the editor, where the control can hold the cell's value: \"number\" a NumberInput for a\n * number, \"date\" a DatePicker for a Date or an ISO date (\"2026-10-14\"), \"choice\" a Dropdown of `options`, \"boolean\" a\n * Checkbox; any other kind, and a number or a date written as text (\"18 KB\", \"12 Jan 2026\"), a text Input.\n */\n kind?: ColumnKind;\n /** Horizontal alignment of the header and the cells; a block element (a Checkbox, a Button) is laid out with flex so it follows too (round 14). Default: numbers right, everything else left. */\n align?: \"left\" | \"center\" | \"right\";\n /**\n * In an editable grid, whether this column's cells edit (default true); false for a column that shows (a status, a\n * calculated value, actions): its cells show no edit cue, and assistive tech hears them as read-only.\n */\n editable?: boolean;\n /**\n * A choice column's options (with `kind: \"choice\"`): its cells edit with a Dropdown of them, and a save gives the\n * option's `value`. Give the column a `cell` that shows the option's label.\n */\n options?: readonly DataGridOption[];\n /**\n * In an editable grid, the value onCellEdit gets from what was typed in a text cell, or in a number cell as its text\n * (default the text itself, or the number): a price written as text, `(text) => Number(text.replace(/[$,]/g, \"\"))`.\n * A date, a choice and a yes or no are given as their own values.\n */\n parse?: (text: string) => unknown;\n}\n\n/** The control a cell edits with (Sprint 25.8.7 item 19): its column's kind, where that control can hold the cell's value. */\ntype CellEditorKind = \"text\" | \"number\" | \"date\" | \"choice\" | \"boolean\";\n\n/** What an edit starts from: its control, the control's value, and how a saved value goes back in the cell's own form. */\ninterface EditorSetup {\n editor: CellEditorKind;\n value: unknown;\n out: (value: unknown) => unknown;\n}\n\nconst isEmpty = (v: unknown) => v === null || v === undefined || v === \"\";\nconst isDate = (v: unknown): v is Date => v instanceof Date && !Number.isNaN(v.getTime());\n/** An ISO date's text (\"2026-10-14\") as the local day it names, else null; the date grid's day key is the same text. */\nfunction isoDay(v: unknown): Date | null {\n const m = typeof v === \"string\" ? /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(v) : null;\n if (!m) return null;\n const d = new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]));\n return dayKey(d) === v ? d : null;\n}\n/** Two of an editor's values are one: a date by its time, anything else by itself. */\nconst sameValue = (a: unknown, b: unknown) => (isDate(a) && isDate(b) ? a.getTime() === b.getTime() : Object.is(a, b));\n\n/**\n * The editor for a cell. A control edits only a value it can hold: a NumberInput holds no empty cell and no \"18 KB\", a\n * DatePicker gives back no \"12 Jan 2026\", so those keep the text Input. A date goes back in the form it came: a Date,\n * keeping its time of day, or an ISO date's text; an empty cell's, as the column's first date is (a Date when it has\n * none).\n */\nfunction editorFor(kind: ColumnKind | undefined, raw: unknown, meta: DataGridColumnMeta | undefined, firstOfColumn: () => unknown): EditorSetup {\n const parse = meta?.parse;\n if (kind === \"choice\" && meta?.options?.length) return { editor: \"choice\", value: raw ?? null, out: (v) => v };\n if (kind === \"boolean\" && (typeof raw === \"boolean\" || isEmpty(raw))) return { editor: \"boolean\", value: raw === true, out: (v) => v };\n if (kind === \"number\" && typeof raw === \"number\" && Number.isFinite(raw)) return { editor: \"number\", value: raw, out: (v) => (parse ? parse(String(v)) : v) };\n if (kind === \"date\") {\n const was = isEmpty(raw) ? firstOfColumn() : raw;\n if (isDate(raw)) {\n return { editor: \"date\", value: raw, out: (v) => (isDate(v) ? new Date(v.getFullYear(), v.getMonth(), v.getDate(), raw.getHours(), raw.getMinutes(), raw.getSeconds(), raw.getMilliseconds()) : null) };\n }\n if (isoDay(was)) return { editor: \"date\", value: isoDay(raw), out: (v) => (isDate(v) ? dayKey(v) : null) };\n if (isEmpty(was) || isDate(was)) return { editor: \"date\", value: null, out: (v) => (isDate(v) ? v : null) };\n }\n return { editor: \"text\", value: String(raw ?? \"\"), out: (v) => (parse ? parse(v as string) : v) };\n}\n\n/**\n * A cell's editor (Sprint 25.8.7 item 19): the library's control for its column's kind, named for the column by a\n * hidden Field label. What is typed (text, a number, a date's parts) saves with Enter or by leaving the editor; a value\n * picked by a press (an option, a calendar's day, the box) is the edit, and saves at once; Escape, in the field or in\n * its popup, leaves the cell as it was. Leaving is the Field's own check (lib/focus.ts, useFocusLeave): focus moving\n * into the editor's popup, the Dropdown's list or the DatePicker's calendar, is not leaving it.\n */\nfunction CellEditor({ editor, value, name, options, onChange, onEnd }: {\n editor: CellEditorKind;\n value: unknown;\n name: string;\n options?: readonly DataGridOption[];\n onChange: (value: unknown) => void;\n onEnd: (save: boolean, focusBack: boolean, picked?: { value: unknown }) => void;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n // leaving the editor saves it and lets focus go where it went (the review of 30 September: it pulled focus back, and\n // the next keys were lost)\n const leave = useFocusLeave(() => onEnd(true, false));\n // a value chosen in a popup (the calendar's day, by a click or by Enter) is the edit itself. React passes the popup's\n // events up through its portal, so a key or a press from outside this editor's own box came from there. The flag is\n // where the latest one came from, never reset by a timer: Chrome runs a capture handler and the bubbling handler that\n // changes the value as separate listeners, with a microtask checkpoint between them\n const fromPopup = useRef(false);\n const markPopupEvent = (e: SyntheticEvent) => { fromPopup.current = !ref.current?.contains(e.target as Node); };\n const opened = useRef(false);\n useLayoutEffect(() => {\n const root = ref.current;\n if (!root) return;\n focusInitial(root);\n const el = document.activeElement;\n // the value opens selected: typing replaces it, an arrow key keeps it\n if (el instanceof HTMLInputElement && el.type === \"text\") el.select();\n // a choice opens on its list, the edit itself; once, though a development build runs this twice\n if (editor === \"choice\" && !opened.current && el instanceof HTMLButtonElement && root.contains(el)) {\n opened.current = true;\n el.click();\n }\n }, [editor]);\n // a choice and the box change only when picked, and a pick saves at once; what is typed or stepped (text, a number, a\n // date's parts) waits for Enter or for leaving the editor\n const picks = editor === \"choice\" || editor === \"boolean\";\n const change = (v: unknown) => (picks || fromPopup.current ? onEnd(true, true, { value: v }) : onChange(v));\n let control: ReactElement;\n if (editor === \"number\") control = <NumberInput size=\"sm\" value={value as number} allowDecimals onChange={change} />;\n else if (editor === \"date\") control = <DatePicker size=\"sm\" value={value as Date | null} onChange={change} />;\n else if (editor === \"boolean\") control = <Checkbox checked={value === true} onChange={(checked) => change(checked)} />;\n else if (editor === \"choice\" && options) {\n control = (\n <Dropdown\n size=\"sm\"\n options={options.map((o) => ({ id: String(o.value), label: o.label }))}\n value={value === null || value === undefined ? \"\" : String(value)}\n onChange={(id) => change(options.find((o) => String(o.value) === id)?.value ?? id)}\n />\n );\n } else control = <Input size=\"sm\" value={value as string} onChange={(e) => change(e.target.value)} />;\n return (\n <div\n ref={ref}\n data-cell-editor=\"\"\n {...leave}\n onClickCapture={markPopupEvent}\n onKeyDownCapture={markPopupEvent}\n onKeyDown={(e) => {\n // Escape, in the field or its popup, leaves the cell as it was, and goes no further: a Drawer round the grid stays\n if (e.key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n onEnd(false, true);\n return;\n }\n // Enter saves what was typed; on a button (the Dropdown's, the calendar's) it is the button's, which opens its\n // popup, and in the popup it picks\n if (e.key === \"Enter\" && e.currentTarget.contains(e.target as Node) && !(e.target instanceof HTMLButtonElement)) {\n e.preventDefault();\n onEnd(true, true);\n }\n }}\n >\n {/* a grid saves as you go, so its editor never marks a form around it; the cells' own controls still do (the\n review of 30 September: the whole grid opted out, and a Drawer closed on a changed checkbox unasked) */}\n <FormChangeCtx value={null}>\n <Field label={name} hideLabel>{control}</Field>\n </FormChangeCtx>\n </div>\n );\n}\n\n/**\n * Sprint 25.8.7 item 19 (collections-5): an editable cell says so before it is tried, a pencil shown while the cell is\n * hovered or focused (focused too: a touch screen has no hover); a calculated or locked cell shows none. It sits in room\n * an editable column keeps at its cells' end, header too, so a value never moves and a number stays under its header.\n */\nconst EDIT_CUE_ROOM = \"pr-[calc(var(--ds-space-4)+var(--ds-space-1)+12px)]\";\n\n/** How wide an editor sits over its cell: the cell's width inside its padding, and never less than its control needs. */\nconst EDITOR_WIDTH: Record<CellEditorKind, string> = {\n text: \"w-[max(calc(100%-var(--ds-space-4)),12rem)]\",\n number: \"w-[max(calc(100%-var(--ds-space-4)),8rem)]\",\n date: \"w-[max(calc(100%-var(--ds-space-4)),10.5rem)]\",\n choice: \"w-[max(calc(100%-var(--ds-space-4)),9rem)]\",\n boolean: \"w-auto\",\n};\n/**\n * The least an editable column of numbers, dates or choices is wide, at rest too: its editor's room and the cell's\n * padding, so the editor fits in its own cell and never covers the next one (a text column is wide by its words, and\n * a text editor may run over). A page's own width or min-width for the column wins.\n */\nconst EDITABLE_MIN_WIDTH: Partial<Record<CellEditorKind, string>> = { number: \"9rem\", date: \"11.5rem\", choice: \"10rem\" };\nfunction editableMinWidth(kind: ColumnKind | undefined, meta: DataGridColumnMeta | undefined): string | undefined {\n if (meta?.width || meta?.minWidth) return undefined;\n const editor: CellEditorKind | null = kind === \"number\" ? \"number\" : kind === \"date\" ? \"date\" : kind === \"choice\" && meta?.options?.length ? \"choice\" : null;\n return editor ? EDITABLE_MIN_WIDTH[editor] : undefined;\n}\nconst EDIT_CUE = (\n <span\n data-edit-cue=\"\"\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute top-1/2 -translate-y-1/2 right-ds-4 flex\",\n \"text-[var(--ds-text-muted)] opacity-0 transition-opacity duration-[var(--ds-transition-speed)]\",\n \"group-hover/cell:opacity-100 group-focus/cell:opacity-100\",\n )}\n >\n <Icon name=\"edit\" size={12} />\n </span>\n);\n\n\nexport interface DataGridProps<T> {\n data: T[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- public API: columns may carry any value type\n columns: ColumnDef<T, any>[];\n /**\n * Rows a page, over the project's (dataDisplay.itemsPerPage), for a grid the user asked to page differently. Leave it\n * out: the grid pages as the project says, with the project's control (Sprint 25.13 A5; it was 10).\n */\n pageSize?: number;\n /**\n * Cells edit in place, as the APG's grid (Sprint 25.13 A5): the grid is one Tab stop and the arrow keys move between\n * cells; Enter or F2 (or a double-click) opens a cell's editor, Enter or leaving it saves and Escape cancels, and a\n * brief tick, announced as \"Saved\", shows the save. A grid saves as you go, so it never marks a form around it.\n */\n editable?: boolean;\n /**\n * A saved edit: the row's index in `data`, the column's id and the new value (the text typed, or the column's\n * `meta.parse` of it). Called only when the value changed. Return a promise to have the tick and \"Saved\" wait for it:\n * a rejection is announced as \"Not saved\", and the page says why and keeps the old value.\n */\n onCellEdit?: (rowIndex: number, columnId: string, value: unknown) => void | Promise<unknown>;\n /** The screen width below which the grid shows cards: the project's responsive.tableToCardsBreakpoint, else \"md\". */\n mobileBreakpoint?: BreakpointKey;\n /**\n * The grid's own width below which it shows cards when it doesn't fit, in px (Sprint 25.13 A35): about a phone's; 0\n * never switches by width. An editable grid never shows cards: it stays the APG's grid, scrolling sideways.\n */\n cardsBelow?: number;\n /**\n * The list's pager (Sprint 25.13 A3), from `usePagination(data)` over the same rows: pass it when the page also shows\n * the count (TableToolbar). Without it the grid pages itself the same way.\n */\n pager?: Pager<unknown>;\n /** The grid's name for assistive tech. */\n \"aria-label\"?: string;\n className?: string;\n}\n\n/** A cell of an editable grid: its row among those drawn (-1 for the header) and its column. */\ninterface CellAt { r: number; c: number }\nconst cellKey = (p: CellAt) => (p.r < 0 ? `h:${p.c}` : `${p.r}:${p.c}`);\n/** A cell by its row's id (null for the header), which a sort or a save that re-sorts never moves to another row. */\ninterface CellId { row: string | null; c: number }\n/** How long the saved tick shows, in ms (A5). */\nconst SAVED_TICK_MS = 1500;\n\nexport function DataGrid<T>({\n data,\n columns,\n pageSize,\n editable = false,\n onCellEdit,\n mobileBreakpoint: mobileBreakpointProp,\n cardsBelow = CARDS_BELOW,\n pager: pagerProp,\n \"aria-label\": ariaLabel,\n className,\n}: DataGridProps<T>) {\n // Sprint 25.14 A44: a grid draws its own frame, so a SplitView's list pane draws none around it\n useFramesItself();\n // Sprint 25.6 (B9): responsive.tableToCardsBreakpoint reaches the table through the shell; a prop wins; md outside any shell.\n const preferences = useShellPreferences();\n const mobileBreakpoint: BreakpointKey = mobileBreakpointProp ?? preferences.tableToCardsBreakpoint ?? \"md\";\n const narrowScreen = useBreakpoint(mobileBreakpoint);\n // A35: cards only on a narrow screen or where the grid's own width is a phone's. An editable grid stays the APG's grid\n // at every width, scrolling sideways: its cards have no editor (the review of 30 September: in a default Drawer, whose\n // body is 359 px, the grid went to cards and could no longer be edited).\n const { cards: isMobile, rootRef } = useCardsSwitch(editable ? false : narrowScreen, editable ? 0 : cardsBelow);\n const [sorting, setSorting] = useState<SortingState>([]);\n // the scroll area: a header or a cell the keyboard reaches is scrolled in whole, with its outline (Sprint 30, P3)\n const [scrollArea, setScrollArea] = useState<HTMLDivElement | null>(null);\n useRevealFocus(scrollArea);\n // the open editor (Sprint 25.8.7 item 19): its control, its value as the control holds it, and how a save gives it back\n const [editing, setEditing] = useState<(CellId & { editor: CellEditorKind; value: unknown; was: unknown; out: (value: unknown) => unknown }) | null>(null);\n\n /* ── Column kind inference ─────────────────────────────────────────── */\n const columnKeys = useMemo(() => columns.map((c) => c.id ?? (\"accessorKey\" in c ? String(c.accessorKey) : \"\")).filter(Boolean), [columns]);\n const inferredKinds = useMemo(\n () => inferColumnKinds(data as Record<string, unknown>[], columnKeys),\n [data, columnKeys],\n );\n const kindOf = useCallback(\n (colId: string, meta: DataGridColumnMeta | undefined) => meta?.kind ?? inferredKinds.get(colId),\n [inferredKinds],\n );\n\n // TanStack Table returns functions the React Compiler cannot memoise; the\n // compiler would skip this component, which is fine — the project does not\n // use it. The note is informational, not a defect.\n // eslint-disable-next-line react-hooks/incompatible-library -- TanStack Table is not compiler-compatible\n const table = useReactTable({\n data,\n columns,\n state: { sorting },\n onSortingChange: (updater) => { setSorting(updater); pagerProp?.setPage(1); },\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n });\n\n // ── A5 / A3: the project's page size and list style, through the pager, over every row sorted ──\n const sortedRows = table.getRowModel().rows;\n const ownPager = usePagination(sortedRows, { pageSize, resetOn: sorting });\n const pager = pagerProp ?? ownPager;\n useWholeListCheck(\"DataGrid\", data.length, pagerProp);\n const rows = pagerPart(sortedRows, pager);\n const leafColumns = table.getVisibleLeafColumns();\n const headerText = (id: string) => {\n const header = leafColumns.find((c) => c.id === id)?.columnDef.header;\n return typeof header === \"string\" ? header : id;\n };\n // a column's kind chooses its editor: a choice needs its options, and options alone choose nothing (told in development)\n if (editable) {\n for (const column of leafColumns) {\n const meta = column.columnDef.meta as DataGridColumnMeta | undefined;\n if (meta?.kind === \"choice\" && !meta.options?.length) warnOnce(\"DataGrid\", `column \"${column.id}\" is a choice with no options, so it edits as text: give its meta the options its cells take.`);\n else if (meta?.options?.length && meta.kind !== \"choice\") warnOnce(\"DataGrid\", `column \"${column.id}\" has options but not the choice kind, so they go unused: give its meta kind \"choice\" to edit it with a Dropdown.`);\n }\n }\n\n // ── A5: the grid's keyboard (the APG's grid), when editable ──\n // The Tab stop, the editor and the saved tick are kept by the row's id, so a sort, or a save that re-sorts the rows,\n // keeps each on its row (the review of 30 September: the tick and the Tab stop went to the row now in the old place).\n const gridRef = useRef<HTMLTableElement>(null);\n const [activeId, setActiveId] = useState<CellId>({ row: null, c: 0 });\n const lastRow = rows.length - 1;\n const rowAt = (id: string | null) => (id === null ? -1 : rows.findIndex((row) => row.id === id));\n const idAt = (p: CellAt): CellId => ({ row: p.r < 0 ? null : rows[p.r]?.id ?? null, c: p.c });\n const current: CellAt = { r: Math.min(rowAt(activeId.row), lastRow), c: Math.min(activeId.c, Math.max(0, leafColumns.length - 1)) };\n const setActive = (p: CellAt) => setActiveId(idAt(p));\n const move = (p: CellAt, e: ReactKeyboardEvent): CellAt | null => {\n // Alt with an arrow is the browser's (Back, Forward), and Ctrl or ⌘ with one too; Ctrl or ⌘ with Home or End goes to\n // the grid's first or last cell (the APG's grid)\n if (e.altKey) return null;\n const toCorner = e.ctrlKey || e.metaKey;\n switch (e.key) {\n case \"ArrowRight\": return !toCorner && p.c < leafColumns.length - 1 ? { ...p, c: p.c + 1 } : null;\n case \"ArrowLeft\": return !toCorner && p.c > 0 ? { ...p, c: p.c - 1 } : null;\n case \"ArrowDown\": return !toCorner && p.r < lastRow ? { ...p, r: p.r + 1 } : null;\n case \"ArrowUp\": return !toCorner && p.r > -1 ? { ...p, r: p.r - 1 } : null;\n case \"Home\": return toCorner ? { r: -1, c: 0 } : { ...p, c: 0 };\n case \"End\": return toCorner ? { r: lastRow, c: leafColumns.length - 1 } : { ...p, c: leafColumns.length - 1 };\n default: return null;\n }\n };\n // an edit ends once: Enter saves and unmounts the editor, whose blur must not save it again\n const ended = useRef(false);\n const startEdit = (p: CellAt) => {\n const row = rows[p.r];\n const column = leafColumns[p.c];\n if (!row || !column || (column.columnDef.meta as DataGridColumnMeta | undefined)?.editable === false) return;\n // another cell's edit still open (its leave is told a moment after its blur) is left now, and saves\n if (editing && !(editing.row === row.id && editing.c === p.c)) finishEdit(true, false);\n ended.current = false;\n setActive(p);\n const meta = column.columnDef.meta as DataGridColumnMeta | undefined;\n // an empty date cell edits as the column's dates are held: the first of them, read only if it's needed\n const firstOfColumn = () => rows.map((x) => x.getValue(column.id)).find((v) => !isEmpty(v));\n const setup = editorFor(kindOf(column.id, meta), row.getValue(column.id), meta, firstOfColumn);\n setEditing({ row: row.id, c: p.c, editor: setup.editor, value: setup.value, was: setup.value, out: setup.out });\n };\n const grid = useGridKeyboard<CellAt>({\n container: gridRef,\n active: current,\n setActive,\n keyOf: cellKey,\n move,\n onActivate: (p, e) => {\n if (p.r < 0) { if (leafColumns[p.c]?.getCanSort()) leafColumns[p.c].toggleSorting(); }\n else if (e.key === \"Enter\") startEdit(p);\n },\n modifierKeys: true,\n });\n const onGridKeyDown = (e: ReactKeyboardEvent) => {\n // while a cell is edited its keys are its editor's, a button's arrows too: they never move to another cell (the\n // APG's grid, editing within a cell)\n if (e.target instanceof Element && e.target.closest(\"[data-cell-editor]\")) return;\n // F2 opens the cell's editor too (the APG's grid)\n if (e.key === \"F2\" && !editing && current.r >= 0 && e.target instanceof HTMLElement && e.target.getAttribute(\"data-grid-key\") === cellKey(current)) {\n e.preventDefault();\n startEdit(current);\n return;\n }\n grid.onKeyDown(e);\n };\n // the Tab stop follows focus, however it got there: a click, a screen reader's command, a double-click (the hook's\n // contract; the review of 30 September: a clicked cell took no Enter, and ArrowDown went from the header)\n const onGridFocus = (e: React.FocusEvent) => {\n const key = e.target instanceof HTMLElement ? e.target.getAttribute(\"data-grid-key\") : null;\n if (!key) return;\n const [r, c] = key.startsWith(\"h:\") ? [-1, Number(key.slice(2))] : key.split(\":\").map(Number);\n if (Number.isFinite(r) && Number.isFinite(c) && cellKey(current) !== key) setActive({ r, c });\n };\n\n // ── A5: the save, its tick and its announcement ──\n const [saved, setSaved] = useState<{ row: string; c: number; n: number; ok: boolean } | null>(null);\n useEffect(() => {\n if (!saved) return;\n const t = setTimeout(() => setSaved((s) => (s && s.n === saved.n ? null : s)), SAVED_TICK_MS);\n return () => clearTimeout(t);\n }, [saved]);\n const heard = useRef(0);\n // after Enter or Escape focus comes back to the cell, on its row wherever a save that re-sorts puts it: its page first\n const refocus = useRef<CellId | null>(null);\n useLayoutEffect(() => {\n const want = refocus.current;\n if (!want) return;\n const r = rowAt(want.row);\n if (r < 0) {\n const all = sortedRows.findIndex((row) => row.id === want.row);\n if (all >= 0 && pager.style === \"pagination\") { const page = Math.floor(all / pager.pageSize) + 1; if (page !== pager.page) { pager.setPage(page); return; } }\n refocus.current = null;\n return;\n }\n refocus.current = null;\n grid.focus({ r, c: want.c });\n });\n // `picked`: a value chosen by a press (an option, a day, the box), which is the edit itself and saves at once\n const finishEdit = (commit: boolean, focusBack: boolean, picked?: { value: unknown }) => {\n if (!editing || ended.current) return;\n ended.current = true;\n const r = rowAt(editing.row);\n const row = rows[r];\n const column = leafColumns[editing.c];\n const cell = { row: editing.row, c: editing.c };\n setEditing(null);\n // leaving the editor (a click elsewhere, Tab) saves and lets focus go where it went (the review of 30 September:\n // it pulled focus back, and the next keys were lost)\n if (focusBack) { setActiveId(cell); refocus.current = cell; }\n // a save that changes nothing isn't one\n const value = picked ? picked.value : editing.value;\n if (!commit || !row || !column || sameValue(value, editing.was)) return;\n const done = (ok: boolean) => { heard.current += 1; setSaved({ ...cell, row: editing.row!, n: heard.current, ok }); };\n const result = onCellEdit?.(row.index, column.id, editing.out(value));\n if (result && typeof (result as Promise<unknown>).then === \"function\") (result as Promise<unknown>).then(() => done(true), () => done(false));\n else done(true);\n };\n\n // A3: the grid and its control are one element, as in 0.21, which takes the className: in a grid or a flex row they\n // stay one item (the review of 30 September: the control became an item of its own beside the grid)\n const control = data.length > 0 ? <Pagination {...pager.props} /> : null;\n const setRoot = (node: HTMLDivElement | null) => { rootRef.current = node; };\n const withControl = (list: ReactNode) => <div ref={setRoot} data-gs-paged=\"\" className={cn(\"flex flex-col min-w-0\", className)}>{list}{control}</div>;\n\n if (isMobile) {\n return withControl(\n <div data-ds-list=\"\" className=\"space-y-ds-3\">\n <TableCardCtx value={true}><RowsCtx value={true}>\n <div className=\"flex flex-col gap-ds-3\">\n {rows.map((row) => (\n <div\n key={row.id}\n className={cn(\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"rounded-[var(--ds-radius-md)] bg-[var(--ds-bg-surface)]\",\n \"p-ds-4 space-y-ds-3\",\n )}\n >\n {row.getVisibleCells().map((cell) => (\n <div key={cell.id} className=\"flex justify-between gap-ds-2 text-sm\">\n <span className=\"shrink-0 text-[var(--ds-text-secondary)] font-medium text-xs uppercase tracking-wider\">\n {typeof cell.column.columnDef.header === \"string\"\n ? cell.column.columnDef.header\n : cell.column.id}\n </span>\n <CardValue value={flexRender(cell.column.columnDef.cell, cell.getContext())} />\n </div>\n ))}\n </div>\n ))}\n </div>\n </RowsCtx></TableCardCtx>\n </div>\n );\n }\n\n const headerCell = (header: Header<T, unknown>, c: number) => {\n const canSort = header.column.getCanSort();\n const sorted = header.column.getIsSorted();\n const meta = header.column.columnDef.meta as DataGridColumnMeta | undefined;\n const headerKind = kindOf(header.column.id, meta);\n const headerAlign = meta?.align ?? (headerKind === \"number\" ? \"right\" : \"left\");\n const shrink = (headerKind === \"number\" || headerKind === \"date\") && !meta?.maxWidth;\n const at = { r: -1, c };\n const label = flexRender(header.column.columnDef.header, header.getContext());\n // A47: a sortable header holds a button: a Tab stop in a read-only grid, a cell the arrows reach in an editable one\n const inside = canSort ? (\n <button\n type=\"button\"\n onClick={header.column.getToggleSortingHandler()}\n {...(editable ? { \"data-grid-key\": cellKey(at), tabIndex: grid.tabIndexOf(at) } : {})}\n className={cn(\n \"inline-flex items-center gap-ds-1 uppercase tracking-wider cursor-pointer select-none [font:inherit] text-inherit\",\n \"hover:text-[var(--ds-text-primary)] rounded-[var(--ds-radius-sm)]\",\n // in a right-aligned column the indicator goes before the label, so the label ends where the column's values\n // end; the sorted column's label in full colour (the owner's choice at the look check, 14 October)\n headerAlign === \"right\" && \"flex-row-reverse\",\n sorted && \"text-[var(--ds-text-primary)]\",\n FOCUS_RING,\n )}\n >\n {label}\n <SortIndicator sorted={sorted} />\n </button>\n ) : label;\n return (\n <th\n key={header.id}\n role={editable ? \"columnheader\" : undefined}\n aria-sort={sorted === \"asc\" ? \"ascending\" : sorted === \"desc\" ? \"descending\" : undefined}\n {...(editable && !canSort ? { \"data-grid-key\": cellKey(at), tabIndex: grid.tabIndexOf(at) } : {})}\n className={cn(\n \"px-ds-4 py-ds-3 text-xs font-[var(--ds-weight-heading)] uppercase tracking-wider\",\n headerAlign === \"right\" ? \"text-right\" : headerAlign === \"center\" ? \"text-center\" : \"text-left\",\n shrink && \"w-px whitespace-nowrap\",\n \"text-[var(--ds-text-secondary)]\",\n FOCUS_INSET,\n // an editable column's cells keep room for their cue at their end (item 19): its header keeps the same\n editable && meta?.editable !== false && EDIT_CUE_ROOM,\n )}\n style={meta?.maxWidth || meta?.width || meta?.minWidth ? { maxWidth: meta?.maxWidth, width: meta?.width, minWidth: meta?.minWidth } : undefined}\n >\n <span className={cn(\"flex items-center gap-ds-1\", headerAlign === \"right\" && \"justify-end\", headerAlign === \"center\" && \"justify-center\")}>\n {inside}\n </span>\n </th>\n );\n };\n\n return withControl(\n <div data-ds-list=\"\" data-wide-control=\"\" className=\"min-w-0\">\n <div\n ref={setScrollArea}\n // the scroll area the width switch reads (A35), as the Table's\n data-table-scroll=\"\"\n className={cn(\n \"relative w-full overflow-auto scroll-p-[4px] rounded-[var(--ds-radius-md)]\",\n \"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]\",\n \"shadow-[var(--ds-shadow-card)]\",\n \"bg-[var(--ds-bg-surface)]\",\n )}\n >\n <table\n ref={gridRef}\n role={editable ? \"grid\" : undefined}\n aria-label={ariaLabel}\n onKeyDown={editable ? onGridKeyDown : undefined}\n onFocus={editable ? onGridFocus : undefined}\n className=\"w-full text-sm\"\n >\n <thead className=\"bg-[var(--ds-bg-muted)]\">\n {table.getHeaderGroups().map((hg) => (\n <tr key={hg.id} role={editable ? \"row\" : undefined} className=\"border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]\">\n {hg.headers.map((header, c) => headerCell(header, c))}\n </tr>\n ))}\n </thead>\n <tbody><RowsCtx value={true}>\n {rows.map((row, r) => (\n <tr\n key={row.id}\n role={editable ? \"row\" : undefined}\n className={cn(\n \"border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)] last:border-b-0\",\n \"hover:bg-[var(--ds-bg-muted)] transition-colors\",\n )}\n >\n {row.getVisibleCells().map((cell, c) => {\n const meta = cell.column.columnDef.meta as DataGridColumnMeta | undefined;\n const truncLines = meta?.truncate === true ? 1 : meta?.truncate ? meta.truncate.lines : 0;\n const kind = kindOf(cell.column.id, meta);\n const rendered = flexRender(cell.column.columnDef.cell, cell.getContext() as CellContext<T, unknown>);\n const at = { r, c };\n const isEditing = editable && editing?.row === row.id && editing.c === c;\n\n const shrink = (kind === \"number\" || kind === \"date\") && !meta?.maxWidth;\n // Round 14 (50.2): a centred or right-aligned column lays a block element out with flex — text-align moves inline content only.\n const align = meta?.align ?? (kind === \"number\" ? \"right\" : \"left\");\n let inner: ReactNode;\n if (isEditing) {\n // the library's control for the column's kind, named for its column (CellEditor). The cell keeps its\n // size while it is edited: its value holds the room, unseen, and the editor sits over it, from the\n // cell's start (its end, in a right-aligned column), as wide as its control needs. So no column moves\n // and the row keeps its height (the look check's second round: a number's field had no room in its\n // narrow column, and a date's widened every column)\n inner = (\n <>\n <span aria-hidden=\"true\" className=\"invisible\">{rendered}</span>\n <div className={cn(\n \"absolute inset-y-0 z-30 flex items-center\", EDITOR_WIDTH[editing.editor],\n // from the cell's end in a right-aligned column, and in the last column, where an editor wider\n // than its cell would run past the grid's edge; over the cell before, it stays in view\n align === \"right\" || c === row.getVisibleCells().length - 1 ? \"right-ds-2\" : \"left-ds-2\",\n )}>\n <CellEditor\n editor={editing.editor}\n value={editing.value}\n name={headerText(cell.column.id)}\n options={meta?.options}\n onChange={(v) => setEditing({ ...editing, value: v })}\n onEnd={finishEdit}\n />\n </div>\n </>\n );\n } else if (truncLines > 0) {\n inner = <CutCell lines={truncLines}>{rendered}</CutCell>;\n } else if (kind === \"email\") {\n inner = <CutEmail>{rendered}</CutEmail>;\n } else {\n inner = rendered;\n }\n const value = cell.getValue();\n if (!isEditing && align !== \"left\" && typeof value !== \"string\" && typeof value !== \"number\" && value !== null && value !== undefined) {\n inner = <div className={cn(\"flex items-center\", align === \"center\" ? \"justify-center\" : \"justify-end\")}>{inner}</div>;\n }\n const tick = editable && saved?.ok && saved.row === row.id && saved.c === c\n ? <Icon name=\"check\" size={14} className=\"ml-ds-1 inline-block align-middle text-[var(--ds-status-success)]\" />\n : null;\n\n // item 19: an editable cell says so before it is tried; a calculated or locked one is read-only\n const edits = editable && meta?.editable !== false;\n const least = edits ? editableMinWidth(kind, meta) : undefined;\n return (\n <td\n key={cell.id}\n // a double-click in the open editor selects a word, and never reopens it over what was typed\n {...(editable ? { role: \"gridcell\", \"data-grid-key\": cellKey(at), tabIndex: grid.tabIndexOf(at), onDoubleClick: () => { if (!isEditing) startEdit(at); } } : {})}\n aria-readonly={editable && !edits ? true : undefined}\n className={cn(\n \"px-ds-4 py-ds-3 text-[var(--ds-text-primary)]\",\n align === \"right\" && \"text-right\",\n align === \"center\" && \"text-center\",\n shrink && \"w-px whitespace-nowrap\",\n editable && FOCUS_INSET,\n edits && cn(\"group/cell relative\", EDIT_CUE_ROOM),\n )}\n style={meta?.maxWidth || meta?.width || meta?.minWidth || least ? { maxWidth: meta?.maxWidth, width: meta?.width, minWidth: meta?.minWidth ?? least } : undefined}\n >\n {inner}\n {tick}\n {edits && !isEditing && EDIT_CUE}\n </td>\n );\n })}\n </tr>\n ))}\n </RowsCtx></tbody>\n </table>\n </div>\n {/* A5: a save is heard, politely (WCAG 4.1.3); each one is a new line, so two saves are heard twice */}\n {editable && <div role=\"status\" className=\"sr-only\"><span key={saved?.n ?? 0}>{saved ? (saved.ok ? \"Saved\" : \"Not saved\") : \"\"}</span></div>}\n </div>\n );\n}\n"]}
|
package/dist/editor-mentions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { matchMentions, shownMentions, mentionOptionId, MentionList } from './chunk-
|
|
3
|
-
import { useLatest, useOverlayLayer } from './chunk-
|
|
2
|
+
import { matchMentions, shownMentions, mentionOptionId, MentionList } from './chunk-NFVJEICH.js';
|
|
3
|
+
import { useLatest, useOverlayLayer } from './chunk-HDFTENVW.js';
|
|
4
4
|
import { useState, useSyncExternalStore, useId, useRef, useEffect } from 'react';
|
|
5
5
|
import Mention from '@tiptap/extension-mention';
|
|
6
6
|
import { exitSuggestion } from '@tiptap/suggestion';
|
package/dist/editor.js
CHANGED
|
@@ -3,9 +3,9 @@ import { useScrollEdges } from './chunk-3BRQRKDO.js';
|
|
|
3
3
|
import { FormChangeCtx } from './chunk-72SDAX54.js';
|
|
4
4
|
import { useBreakpoint } from './chunk-ZHUVLBCC.js';
|
|
5
5
|
import { useInputModality } from './chunk-7RKC5C7G.js';
|
|
6
|
-
import { useRevealFocus, AutoTooltip } from './chunk-
|
|
6
|
+
import { useRevealFocus, AutoTooltip } from './chunk-77X7AHFB.js';
|
|
7
7
|
import { warnOnce, Icon } from './chunk-53F7GVBQ.js';
|
|
8
|
-
import { useLatest, cn, FIELD_FOCUS_WITHIN_RING, useOverlayLayer, useCloseOnFocusOut, FOCUS_RING, FIELD_FOCUS_RING } from './chunk-
|
|
8
|
+
import { useLatest, cn, FIELD_FOCUS_WITHIN_RING, useOverlayLayer, useCloseOnFocusOut, FOCUS_RING, FIELD_FOCUS_RING } from './chunk-HDFTENVW.js';
|
|
9
9
|
import { useState, useCallback, useContext, useRef, useEffect, useImperativeHandle } from 'react';
|
|
10
10
|
import { Extension, Node, mergeAttributes, useEditor, EditorContent, createDocument } from '@tiptap/react';
|
|
11
11
|
import { Plugin } from '@tiptap/pm/state';
|
package/dist/index.d.ts
CHANGED
|
@@ -844,14 +844,26 @@ interface NumberInputProps {
|
|
|
844
844
|
size?: "sm" | "md" | "lg";
|
|
845
845
|
className?: string;
|
|
846
846
|
error?: boolean;
|
|
847
|
-
/**
|
|
847
|
+
/**
|
|
848
|
+
* The decimal places typed and shown, the value always showing them ("12.50"): money is `decimals={2}`, its buttons
|
|
849
|
+
* moving by `step` (1 for whole pounds). Never fewer than the step's or a limit's own. Without it, a fractional step
|
|
850
|
+
* gives its places (0.1: one, shown as the number is, "2" and "2.5"), and a whole step none.
|
|
851
|
+
*/
|
|
852
|
+
decimals?: number;
|
|
853
|
+
/**
|
|
854
|
+
* Decimals of any length on a whole step, as typed (DataGrid's number editor); `decimals` caps them, and `false`
|
|
855
|
+
* allows none. A fractional step needs neither: it gives its own places.
|
|
856
|
+
*/
|
|
848
857
|
allowDecimals?: boolean;
|
|
849
858
|
/** Forwarded to the inner input element so a Label htmlFor can be associated. */
|
|
850
859
|
id?: string;
|
|
851
860
|
/** The field's name where nothing on screen names it ("Seats"); inside a Field, the Field's label names it. */
|
|
852
861
|
"aria-label"?: string;
|
|
862
|
+
/** The hint and the error that describe it: a Field gives them. */
|
|
863
|
+
"aria-describedby"?: string;
|
|
864
|
+
"aria-required"?: boolean;
|
|
853
865
|
}
|
|
854
|
-
declare function NumberInput({ value, onChange: onChangeProp, min, max, step, disabled, placeholder, prefix, suffix, size: sizeProp, className, error, allowDecimals, id, "aria-label": ariaLabel, }: NumberInputProps): react_jsx_runtime.JSX.Element;
|
|
866
|
+
declare function NumberInput({ value, onChange: onChangeProp, min, max, step, disabled, placeholder, prefix, suffix, size: sizeProp, className, error, decimals, allowDecimals, id, "aria-label": ariaLabel, "aria-describedby": describedBy, "aria-required": ariaRequired, }: NumberInputProps): react_jsx_runtime.JSX.Element;
|
|
855
867
|
|
|
856
868
|
interface TagInputProps {
|
|
857
869
|
value: string[];
|
|
@@ -2079,7 +2091,7 @@ type AsidePanelPosition = "flush" | "floating";
|
|
|
2079
2091
|
interface AsidePanelProps {
|
|
2080
2092
|
open: boolean;
|
|
2081
2093
|
onClose: () => void;
|
|
2082
|
-
/** Which side of the content column. Default "right".
|
|
2094
|
+
/** Which side of the content column. Default "right". In AppShell's aside slot, the same value as its asideSide; a page's own panel docks on the side it names. */
|
|
2083
2095
|
side?: AsidePanelSide;
|
|
2084
2096
|
/** Column width while open. Default "420px" — the same as the side panel. */
|
|
2085
2097
|
width?: string;
|
|
@@ -2114,7 +2126,7 @@ interface AsidePanelProps {
|
|
|
2114
2126
|
* returns to the opener, an outside click does nothing, drafts survive closing.
|
|
2115
2127
|
* Below `collapseBelow` it becomes the overlay Drawer; on phones the Sheet.
|
|
2116
2128
|
*/
|
|
2117
|
-
declare function AsidePanel({ open, onClose, side, width, position, navbarFloating: navbarFloatingProp, sidebarFloating: sidebarFloatingProp, collapseBelow, keepMounted, resizable, maxWidth, labelledBy, id, children, className, }: AsidePanelProps): react_jsx_runtime.JSX.Element;
|
|
2129
|
+
declare function AsidePanel({ open, onClose, side, width, position, navbarFloating: navbarFloatingProp, sidebarFloating: sidebarFloatingProp, collapseBelow, keepMounted, resizable, maxWidth, labelledBy, id, children, className, }: AsidePanelProps): react_jsx_runtime.JSX.Element | null;
|
|
2118
2130
|
|
|
2119
2131
|
interface StackedListItem {
|
|
2120
2132
|
id: string | number;
|
|
@@ -3844,16 +3856,35 @@ interface AppShellContextValue {
|
|
|
3844
3856
|
sidebarCollapsed: boolean;
|
|
3845
3857
|
/** Records an explicit user choice. Overrides the auto tier in both directions for the session. */
|
|
3846
3858
|
setSidebarCollapsed: (collapsed: boolean) => void;
|
|
3847
|
-
/** True while a docked AsidePanel
|
|
3859
|
+
/** True while a docked AsidePanel (the aside slot's, or a page's own) is open beside the content. Pages may hide non-essential chrome on it. */
|
|
3848
3860
|
asideOpen: boolean;
|
|
3849
|
-
/**
|
|
3861
|
+
/** For a docked panel of an app's own, not an AsidePanel, which tells the shell itself (`reportAside`); not for pages to call. */
|
|
3850
3862
|
setAsideOpen: (open: boolean) => void;
|
|
3851
3863
|
/** Which side the aside slot is on (AppShell's asideSide). */
|
|
3852
3864
|
asideSide: "right" | "left";
|
|
3853
3865
|
/** True while the docked AsidePanel is floating — a floating PageHeader drops its gutter on that side, as it does beside a floating Sidebar. */
|
|
3854
3866
|
asideFloating: boolean;
|
|
3855
|
-
/**
|
|
3867
|
+
/** As setAsideOpen: for a docked panel of an app's own; not for pages to call. */
|
|
3856
3868
|
setAsideFloating: (floating: boolean) => void;
|
|
3869
|
+
/** The side of the docked AsidePanel that is open and floating, or null: a floating PageHeader drops its gutter on that side. */
|
|
3870
|
+
asideFloatingSide: "right" | "left" | null;
|
|
3871
|
+
/**
|
|
3872
|
+
* How each AsidePanel in the shell tells it where it stands, by its onClose (a ref to the latest), null as it goes. One
|
|
3873
|
+
* AsidePanel is open at a time in a shell, whatever its side or its form (docked, drawer or sheet): the one opened last
|
|
3874
|
+
* wins, and the shell closes the others through their own onClose. Read by AsidePanel; not for pages to call.
|
|
3875
|
+
*/
|
|
3876
|
+
reportAside: (onClose: {
|
|
3877
|
+
readonly current: () => void;
|
|
3878
|
+
}, state: AsidePanelReport | null) => void;
|
|
3879
|
+
/**
|
|
3880
|
+
* Where an AsidePanel a page renders docks (Sprint 32): beside the content column on its side, where the aside slot's
|
|
3881
|
+
* does, so a page's own panel (a dashboard editor's widget library) docks like the app's while it stays in the page's
|
|
3882
|
+
* tree, and the page's context reaches it. Read by AsidePanel; not for pages to read.
|
|
3883
|
+
*/
|
|
3884
|
+
asideHosts: {
|
|
3885
|
+
left: HTMLElement | null;
|
|
3886
|
+
right: HTMLElement | null;
|
|
3887
|
+
};
|
|
3857
3888
|
/**
|
|
3858
3889
|
* The shell's root element, for previews that need to render overlays inside their frame
|
|
3859
3890
|
* (the dashboard builder passes it to Launcher, CornerPanel and Drawer as `container`).
|
|
@@ -3914,6 +3945,20 @@ interface AppShellFocus {
|
|
|
3914
3945
|
/** What the exit control does: save and log out, or return to where the user came from. */
|
|
3915
3946
|
onExit?: () => void;
|
|
3916
3947
|
}
|
|
3948
|
+
/** What an AsidePanel tells the shell it's in (AppShellContextValue's `reportAside`). */
|
|
3949
|
+
interface AsidePanelReport {
|
|
3950
|
+
open: boolean;
|
|
3951
|
+
/** Its `open` has just turned true (an onClose new each render is no opening). */
|
|
3952
|
+
opened: boolean;
|
|
3953
|
+
/** A page's own panel, not the aside slot's: of two opened together, the page's wins. */
|
|
3954
|
+
page: boolean;
|
|
3955
|
+
/** Docked beside the content column at this width, not the Drawer it becomes below its collapse width. */
|
|
3956
|
+
docked: boolean;
|
|
3957
|
+
floating: boolean;
|
|
3958
|
+
side: "right" | "left";
|
|
3959
|
+
/** The id of the heading that names it (its labelledBy), for a development warning. */
|
|
3960
|
+
name: string;
|
|
3961
|
+
}
|
|
3917
3962
|
/**
|
|
3918
3963
|
* The app shell around this component, or null outside one: its layout state — whether it has a sidebar, a mobile menu
|
|
3919
3964
|
* and a mobile nav, whether the sidebar is open or collapsed and the aside open (each with its setter), the viewport tier
|
|
@@ -4376,4 +4421,15 @@ interface UseTextOverflowResult {
|
|
|
4376
4421
|
*/
|
|
4377
4422
|
declare function useTextOverflow(options?: UseTextOverflowOptions): UseTextOverflowResult;
|
|
4378
4423
|
|
|
4379
|
-
|
|
4424
|
+
/**
|
|
4425
|
+
* The theme's colours as hex, for anything that takes colours rather than CSS: a map's style, a canvas, a PDF, a drawing
|
|
4426
|
+
* library. Each named token (`"--ds-bg-canvas"`) is read where `ref`'s element sits, since part of a page can carry the
|
|
4427
|
+
* theme in its other mode, and read again whenever a `data-mode` changes. A value comes back as `#rrggbb`, or as
|
|
4428
|
+
* `#rrggbbaa` when the token is see-through (`--ds-accent-subtle` is a tenth of the accent), so it keeps the look it has
|
|
4429
|
+
* on the page. On the server and in the first render it is null, so the page hydrates as the server drew it. The answer
|
|
4430
|
+
* keeps its identity until a colour changes, so a list written inline causes no loop, and what is built from it can be
|
|
4431
|
+
* memoised on it. A name that isn't a colour of the theme there (not yet, or never) comes back transparent.
|
|
4432
|
+
*/
|
|
4433
|
+
declare function useThemeColors<N extends string>(ref: RefObject<Element | null>, names: readonly N[]): Readonly<Record<N, string>> | null;
|
|
4434
|
+
|
|
4435
|
+
export { Accordion, ActionPanel, ActionPanelGroup, AddAnother, type AddAnotherProps, Alert, type AlertConsent, type AlertConsentChoice, type AlertPlacement, AppShell, type AppShellContextValue, type AppShellFocus, AppShellPreferences, type AppShellTheme, AsidePanel, type AsidePanelProps, type AsidePanelSide, Avatar, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarStatus, Badge, type BadgePaletteColor, type BadgeSeverity, type BadgeSize, type BadgeVariant, BottomNav, type BottomNavItem, BreakpointKey, BulkActionBar, Button, ButtonSizeContext, Calendar, type CalendarColour, type CalendarDay, type CalendarDayClickDetail, type CalendarEvent, type CalendarEventAction, type CalendarEventAttendee, type CalendarProps, type CalendarSize, type CalendarView, Card, CardContent, CardDescription, CardFooter, CardGrid, type CardGridProps, CardHeader, type CardSelectType, CardTitle, type CardVariant, Carousel, type ChatMessage, type ChatMessageAction, type ChatMessageLayout, ChatMessageList, type ChatMessageSender, type ChatMessageSource, type ChatMessageStatus, ChatPanel, type ChatPanelProps, type ChatPanelStatusTone, Checkbox, CheckboxGroup, CheckboxGroupItem, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorPicker, type ColorPickerProps, type ColorSwatch, type Column, Combobox, CommandPalette, ContextMenu, type ControlSize, ControlSizeContext, CornerPanel, type CornerPanelEdge, type CornerPanelProps, DEFAULT_DATE_RANGE_PRESETS, DangerZone, type DangerZoneProps, DataList, type DateInput, DatePicker, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DateRangeWords, type DescriptionItem, DescriptionList, type DescriptionListOrientation, type DescriptionListSize, type DestructiveActionHandle, type DestructiveActionOptions, Dialog, type DisabledDates, Divider, Dock, Drawer, Dropdown, DropdownMenuEntry, EmptyState, EntityCell, type EventCategory, Field, type FieldControlProps, type FieldLabel, type FieldProps, FileUpload, type FileUploadItem, type FileUploadRequestOptions, type FileUploadStatus, type FitLabelsOptions, type FittedLabel, type FlowNavigate, type FlowProgress, FlowSaved, type FlowSavedProps, type FlowStep, type FlowSteps, FormWrapper, Gantt, type GanttGroup, type GanttItem, type GanttProps, type GanttStatus, type GanttTone, type GridKeyboard, type GridKeyboardOptions, HoverCard, INPUT_MODALITY_ATTR, InlineFieldError, Input, type InputModality, Kbd, Label, type LabelBox, Launcher, type LauncherEdge, type LauncherProps, type LauncherVariant, type LauncherWhenOpen, Link, type LinkProps, LocaleProvider, type LocaleProviderProps, MentionInput, type MentionInputProps, MentionSuggestion, MobileHeaderMenu, type MobileHeaderMenuItemData, type MobileHeaderMenuType, NavItem, type NavItemProps, type NavItemType, NavMenu, type NavMenuItem, Navbar, type NavbarSize, type NavbarType, type NavbarVariant, NotificationCenter, NumberInput, type Occurrence, PageActions, PageContainer, type PageContainerWidth, PageHeader, type PageHeaderBehavior, type PageHeaderIntensity, type PageHeaderProps, type PageHeaderVariant, Pager, Pagination, PinInput, Popover, Progress, type PromiseToastMessages, RadioGroup, Rating, type Recurrence, type RecurrenceFrequency, RecurrencePicker, type RecurrencePickerProps, type RecurrencePreset, type RecurrenceScope, RecurrenceScopeDialog, type RecurrenceScopeDialogProps, RelativeTime, type RelativeTimeProps, type RepeatChange, type RepeatingEvent, ScrollArea, SectionHeading, type SectionHeadingProps, SegmentedControl, SettingsLayout, type SettingsLayoutProps, type SettingsSection, Sheet, Sidebar, type SidebarContextValue, type SidebarItem, SidebarNav, type SidebarNavSize, type SidebarPosition, type SidebarSection, type SidebarType, Skeleton, SkipLink, SliderRange, type SortDir, Spinner, StackedList, type StackedListVariant, StatsCard, StatusDot, type StatusDotVariant, Stepper, TIME_ZOOMS, type Tab, Table, type TableDensity, type TableProps, type TableRow, TableToolbar, type TableToolbarActiveFilter, type TableToolbarFilterOption, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TagInput, type TagPaletteColor, type TagVariant, TextOverflow, type TextOverflowProps, Textarea, TimeBar, type TimeBarProps, TimePicker, TimeRow, type TimeRowProps, type TimeScale, TimeScaleHeader, type TimeScaleHeaderProps, type TimeScaleOptions, type TimeTick, type TimeValue, TimeViewport, type TimeViewportHandle, type TimeViewportLayout, type TimeViewportProps, type TimeViewportState, type TimeZoom, Timeline, TimezoneSelect, type TimezoneSelectProps, Toast, type ToastAction, type ToastApi, type ToastOptions, type ToastPosition, ToastProvider, type ToastVariant, Toggle, Tooltip, Tour, TransferList, TreeView, type Trend, type UseFlowStepsOptions, type UseTextOverflowOptions, type UseTextOverflowResult, type WeekOfMonth, type Weekday, browserTimeZone, canonicalTimeZone, countEdited, dateOfDay, dayOf, deleteOccurrence, describeRecurrence, endDayOf, fitLabel, fitLabels, formatDateRange, formatFullTime, formatRelativeTime, inputModality, installInputModality, nthOf, occurrenceOn, occurrences, parseRRule, readFlowProgress, readRecurrence, recurrencePresets, sameRecurrence, saveOccurrence, timeExtent, timeZoneOffset, toRRule, useAppShell, useBrowserTimeZone, useContentWidth, useDestructiveAction, useFittedLabels, useFlowSteps, useFormContext, useFormatLocale, useGridKeyboard, useHydrated, useInputModality, useRelativeTimeFormat, useRevealFocus, useSidebar, useTextMeasure, useTextOverflow, useThemeColors, useTimeScale, useTimeViewport, useTimeViewportLayout, useToast, useToastOptional, useUnsavedChanges };
|