From 39e669fdd53eb32234121d2084b88a08a40228a5 Mon Sep 17 00:00:00 2001 From: Florian Laabs Date: Sat, 28 Nov 2026 03:12:09 +0100 Subject: [PATCH 1/8] fix(recipes): focus rings were invisible next to outline-none With Tailwind v4 outline-none also sets --tw-outline-style: none, and focus-visible:outline-2 only sets the width and takes the style from that variable - the focus ring was active but invisible (WCAG 2.4.7). Found on the SidebarNav link; 22 parts had the combination. outline-hidden would not help, it sets the same variable. - Drop the redundant outline-none where a part draws its own focus ring (the browser outline only shows at :focus-visible, which they style) - Test over all recipes: no focus outline width next to outline-none without an outline style Signed-off-by: Florian Laabs --- .changeset/focus-ring-outline-style.md | 10 ++++++++++ packages/parity/src/recipes.test.ts | 23 +++++++++++++++++++++++ packages/recipes/src/chat.ts | 2 +- packages/recipes/src/editor.ts | 6 +++--- packages/recipes/src/field.ts | 2 +- packages/recipes/src/gantt.ts | 4 +--- packages/recipes/src/inputs.ts | 6 +++--- packages/recipes/src/navigation.ts | 6 +++--- packages/recipes/src/overlay.ts | 4 ++-- packages/recipes/src/pdf.ts | 2 +- packages/recipes/src/surfaces.ts | 4 ++-- packages/recipes/src/widgets.ts | 10 +++++----- 12 files changed, 55 insertions(+), 24 deletions(-) create mode 100644 .changeset/focus-ring-outline-style.md diff --git a/.changeset/focus-ring-outline-style.md b/.changeset/focus-ring-outline-style.md new file mode 100644 index 00000000..5d587e0f --- /dev/null +++ b/.changeset/focus-ring-outline-style.md @@ -0,0 +1,10 @@ +--- +'@wirecore/wirelayer-recipes': patch +'@wirecore/wirelayer-css': patch +--- + +Focus ring visible again in 22 parts: with Tailwind v4, `outline-none` sets `--tw-outline-style: none`, and the +`focus-visible:outline-2` ring took that style – active but invisible (WCAG 2.4.7). The redundant `outline-none` is gone +where a part draws its own focus ring: SidebarNav links, Stepper, Menubar, menu search, Gantt rows, CodeTabs, +CodeHighlight, Editor source, ScrollPanel, LogViewer, JsonViewer, ChatMessages, PdfViewer, FloatingPanel, ImageCropper, +AngleSlider, Knob, ColorPicker, SpeedDial and the form error summary. A test keeps it so. diff --git a/packages/parity/src/recipes.test.ts b/packages/parity/src/recipes.test.ts index 2314f596..4e0789b9 100644 --- a/packages/parity/src/recipes.test.ts +++ b/packages/parity/src/recipes.test.ts @@ -382,3 +382,26 @@ describe('clear buttons of the text controls', () => { expect(tree().search().split(' ')).toContain('[&::-webkit-search-cancel-button]:cursor-pointer'); }); }); + +describe('focus rings', () => { + // Tailwind v4: outline-none sets --tw-outline-style: none, a focus outline- takes that style – invisible + it('no focus outline width next to outline-none without an outline style', async () => { + const recipes = await import('@wirecore/wirelayer-recipes'); + const hidden: string[] = []; + for (const [name, recipe] of Object.entries(recipes)) { + if (typeof recipe !== 'function' || !('variants' in recipe)) continue; + const result = (recipe as () => unknown)(); + const slots = typeof result === 'string' ? { base: () => result } : (result as Record); + for (const [slot, part] of Object.entries(slots)) { + if (typeof part !== 'function') continue; + const classes = String((part as () => string)()).split(/\s+/); + if (!classes.includes('outline-none')) continue; + for (const ring of classes.filter((item) => /:outline-\d+$/.test(item))) { + const variant = ring.slice(0, ring.lastIndexOf(':') + 1); + if (!classes.includes(`${variant}outline-solid`)) hidden.push(`${name}.${slot}: ${ring}`); + } + } + } + expect(hidden.join('\n')).toBe(''); + }); +}); diff --git a/packages/recipes/src/chat.ts b/packages/recipes/src/chat.ts index 71d6577f..0719e21b 100644 --- a/packages/recipes/src/chat.ts +++ b/packages/recipes/src/chat.ts @@ -12,7 +12,7 @@ export const chatMessages = tv({ slots: { base: 'relative flex min-h-0 flex-col', viewport: [ - 'flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto p-4 outline-none', + 'flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto p-4', 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', ], separator: [ diff --git a/packages/recipes/src/editor.ts b/packages/recipes/src/editor.ts index 96ae384a..0fb594e8 100644 --- a/packages/recipes/src/editor.ts +++ b/packages/recipes/src/editor.ts @@ -84,7 +84,7 @@ export const editor = tv({ uploading: 'pointer-events-none opacity-50 motion-safe:animate-pulse', /** HTML source mode */ source: [ - 'block min-h-40 w-full resize-y border-0 bg-bg px-3.5 py-3 font-mono text-[13px] leading-relaxed text-fg outline-none', + 'block min-h-40 w-full resize-y border-0 bg-bg px-3.5 py-3 font-mono text-[13px] leading-relaxed text-fg', 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', ], /** Bubble menu (text selected) and floating menu (empty line) */ @@ -145,7 +145,7 @@ export const codeHighlight = tv({ language: 'ms-auto font-mono text-[10px] tracking-label text-muted uppercase', // Scrollable code: one tab stop so keyboard users can scroll it pre: [ - 'm-0 overflow-auto py-3 font-mono text-[13px] leading-relaxed outline-none', + 'm-0 overflow-auto py-3 font-mono text-[13px] leading-relaxed', 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', ], code: 'grid min-w-max', @@ -203,7 +203,7 @@ export const codeTabs = tv({ ], tabIcon: 'size-3.5 shrink-0', actions: 'flex shrink-0 items-center self-center', - panel: 'outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', + panel: 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', /** The code block inside a tab has no frame of its own */ panelCode: 'rounded-none border-0', }, diff --git a/packages/recipes/src/field.ts b/packages/recipes/src/field.ts index 014a5206..00eb210b 100644 --- a/packages/recipes/src/field.ts +++ b/packages/recipes/src/field.ts @@ -154,7 +154,7 @@ export const textareaParts = tv({ export const formErrorSummary = tv({ slots: { base: [ - 'flex flex-col gap-2 rounded-xl border-2 border-danger bg-card p-4 text-fg outline-none', + 'flex flex-col gap-2 rounded-xl border-2 border-danger bg-card p-4 text-fg', 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fg', ], title: 'flex items-center gap-2 text-sm font-semibold', diff --git a/packages/recipes/src/gantt.ts b/packages/recipes/src/gantt.ts index 78126072..6ad27d90 100644 --- a/packages/recipes/src/gantt.ts +++ b/packages/recipes/src/gantt.ts @@ -392,9 +392,7 @@ export const gantt = tv({ 'sticky top-0 z-[1] h-16 border-b border-line bg-card px-3 pb-2 text-start align-bottom whitespace-nowrap', 'font-mono text-[10px] font-normal tracking-label text-muted uppercase', ], - row: [ - 'h-10 outline-none hover:bg-bg-2 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', - ], + row: ['h-10 hover:bg-bg-2 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg'], cell: 'border-b border-line px-3 whitespace-nowrap text-muted tabular-nums', nameCell: 'max-w-72 border-b border-line pe-3 font-medium text-fg', name: 'flex min-w-0 items-center gap-1', diff --git a/packages/recipes/src/inputs.ts b/packages/recipes/src/inputs.ts index 2e0a7241..f7f8f79c 100644 --- a/packages/recipes/src/inputs.ts +++ b/packages/recipes/src/inputs.ts @@ -648,7 +648,7 @@ export const knob = tv({ label: 'text-[13px] font-medium text-fg', // The dial itself is the slider (role="slider") – focus ring around it control: [ - 'relative size-28 cursor-grab touch-none rounded-full outline-none select-none', + 'relative size-28 cursor-grab touch-none rounded-full select-none', 'data-dragging:cursor-grabbing data-disabled:cursor-not-allowed data-disabled:opacity-40', 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-fg', ], @@ -684,7 +684,7 @@ export const colorPicker = tv({ base: 'relative flex w-full flex-col', control: [...box, 'h-[var(--wc-control-h-md,2.5rem)]'], trigger: [ - 'flex min-w-0 flex-1 cursor-pointer items-center gap-2.5 px-3 text-start text-[length:var(--wc-control-text-md,15px)] text-fg outline-none', + 'flex min-w-0 flex-1 cursor-pointer items-center gap-2.5 px-3 text-start text-[length:var(--wc-control-text-md,15px)] text-fg', 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', ], swatch: 'size-5 shrink-0 rounded-md shadow-[inset_0_0_0_1px_rgba(0,0,0,.15)]', @@ -743,7 +743,7 @@ export const colorPicker = tv({ ], /** ColorInput: the swatch button before the text field */ inputTrigger: [ - 'flex w-10 shrink-0 cursor-pointer items-center justify-center border-e border-line-strong outline-none', + 'flex w-10 shrink-0 cursor-pointer items-center justify-center border-e border-line-strong', 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', 'data-disabled:cursor-not-allowed', ], diff --git a/packages/recipes/src/navigation.ts b/packages/recipes/src/navigation.ts index 53ed4e51..caeee159 100644 --- a/packages/recipes/src/navigation.ts +++ b/packages/recipes/src/navigation.ts @@ -355,7 +355,7 @@ export const sidebarNav = tv({ link: [ 'flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-md pe-2.5 ps-[calc(var(--depth)*16px+10px)] text-start text-sm text-fg no-underline hover:bg-line', 'aria-[current=page]:bg-line aria-[current=page]:font-semibold', - 'outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', + 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', 'forced-colors:aria-[current=page]:border forced-colors:aria-[current=page]:border-[Highlight]', ], icon: 'size-4 shrink-0 text-muted', @@ -411,7 +411,7 @@ export const stepper = tv({ item: 'flex flex-1 items-center gap-2 last:flex-none', trigger: [ 'flex cursor-pointer items-center gap-2.5 rounded-md p-1 text-start', - 'outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fg disabled:cursor-not-allowed', + 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fg disabled:cursor-not-allowed', ], indicator: [ 'flex size-7 shrink-0 items-center justify-center rounded-full border border-line-strong font-mono text-xs text-muted', @@ -424,7 +424,7 @@ export const stepper = tv({ label: 'text-[13px] font-medium whitespace-nowrap text-fg', description: 'text-xs whitespace-nowrap text-muted', separator: 'h-px min-w-6 flex-1 bg-line-strong data-complete:bg-primary', - content: 'outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fg', + content: 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fg', actions: 'flex items-center justify-between gap-2', /** A step that is still loading (StepperItem `loading`) */ spinner: 'size-3.5 motion-safe:animate-spin', diff --git a/packages/recipes/src/overlay.ts b/packages/recipes/src/overlay.ts index 82c42d94..83175232 100644 --- a/packages/recipes/src/overlay.ts +++ b/packages/recipes/src/overlay.ts @@ -35,7 +35,7 @@ export const menu = tv({ /** Filter field at the top of long menus (searchable) */ search: 'mb-1 flex shrink-0 border-b border-line p-1 pb-2', searchInput: [ - 'h-8 w-full min-w-0 rounded-md border border-line-strong bg-bg px-2.5 text-sm text-fg outline-none placeholder:text-muted', + 'h-8 w-full min-w-0 rounded-md border border-line-strong bg-bg px-2.5 text-sm text-fg placeholder:text-muted', 'focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-fg', ], empty: 'px-2.5 py-2 text-sm text-muted', @@ -348,7 +348,7 @@ export const menubar = tv({ base: 'flex flex-wrap items-center gap-0.5 rounded-lg border border-line bg-card p-1', item: [ 'flex h-8 cursor-pointer items-center rounded-md px-3 text-sm font-medium text-fg hover:bg-line', - 'data-[state=open]:bg-line outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', + 'data-[state=open]:bg-line focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', ], /** Around the bar when there is content before/after it or a menu button for small screens */ root: 'flex items-center gap-2', diff --git a/packages/recipes/src/pdf.ts b/packages/recipes/src/pdf.ts index 499661cc..732d968d 100644 --- a/packages/recipes/src/pdf.ts +++ b/packages/recipes/src/pdf.ts @@ -58,7 +58,7 @@ export const pdfViewer = tv({ /** Positioned frame for the scrolling page area (pdf.js needs an absolutely positioned container) */ viewport: 'relative min-w-0 flex-1 bg-bg-2', container: [ - 'absolute inset-0 overflow-auto outline-none', + 'absolute inset-0 overflow-auto', 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', ], /** Loading, password and error state over the page area */ diff --git a/packages/recipes/src/surfaces.ts b/packages/recipes/src/surfaces.ts index 2fa7807b..79cdd65b 100644 --- a/packages/recipes/src/surfaces.ts +++ b/packages/recipes/src/surfaces.ts @@ -32,7 +32,7 @@ export const splitter = tv({ export const scrollPanel = tv({ slots: { base: 'relative overflow-hidden rounded-lg', - viewport: ['size-full rounded-[inherit] outline-none', focusRing], + viewport: ['size-full rounded-[inherit]', focusRing], content: 'min-w-full', scrollbar: [ 'flex touch-none p-0.5 select-none motion-safe:transition-opacity', @@ -134,7 +134,7 @@ export const speedDial = tv({ trigger: [ 'flex size-14 cursor-pointer items-center justify-center rounded-full bg-primary text-on-primary', 'shadow-[0_10px_24px_-10px_rgba(0,0,0,.55)] hover:opacity-90', - 'outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fg', + 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fg', ], triggerIcon: 'size-6 motion-safe:transition-transform data-[state=open]:rotate-45', content: 'z-50 flex flex-col items-end gap-2 outline-none motion-safe:data-[state=open]:animate-pop-in', diff --git a/packages/recipes/src/widgets.ts b/packages/recipes/src/widgets.ts index 6a1b961c..616c1eee 100644 --- a/packages/recipes/src/widgets.ts +++ b/packages/recipes/src/widgets.ts @@ -59,7 +59,7 @@ export const imageCropper = tv({ viewport: 'flex h-72 w-full items-center justify-center overflow-hidden rounded-lg bg-bg-2', image: 'max-h-full max-w-full', selection: [ - 'border-2 border-white shadow-[0_0_0_9999px_rgba(0,0,0,.55)] outline-none data-[shape=circle]:rounded-full', + 'border-2 border-white shadow-[0_0_0_9999px_rgba(0,0,0,.55)] data-[shape=circle]:rounded-full', 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary', 'forced-colors:border-[Highlight]', ], @@ -80,7 +80,7 @@ export const floatingPanel = tv({ slots: { positioner: 'z-50', content: [ - 'flex flex-col overflow-hidden rounded-popup border border-line-2 bg-card text-fg outline-none', + 'flex flex-col overflow-hidden rounded-popup border border-line-2 bg-card text-fg', popupShadow, 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fg', 'data-maximized:rounded-none data-minimized:h-auto!', @@ -109,7 +109,7 @@ export const jsonViewer = tv({ branch: 'm-0 list-none p-0', group: 'ms-[11px] border-s border-line ps-2', row: [ - 'group/row flex min-h-7 cursor-default items-center gap-1 rounded-sm px-1 outline-none hover:bg-line', + 'group/row flex min-h-7 cursor-default items-center gap-1 rounded-sm px-1 hover:bg-line', 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg data-selected:bg-line', 'forced-colors:data-selected:outline forced-colors:data-selected:outline-[Highlight]', ], @@ -200,7 +200,7 @@ export const angleSlider = tv({ 'data-disabled:cursor-not-allowed data-disabled:opacity-40 data-invalid:border-danger', ], thumb: [ - 'absolute inset-0 rounded-full outline-none', + 'absolute inset-0 rounded-full', 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-fg', 'before:absolute before:start-[calc(50%-1.5px)] before:top-3 before:h-[calc(50%-12px)] before:w-[3px] before:rounded-full before:bg-primary', 'after:absolute after:start-[calc(50%-8px)] after:top-0.5 after:size-4 after:rounded-full after:border-2 after:border-bg after:bg-primary', @@ -414,7 +414,7 @@ export const logViewer = tv({ search: 'min-w-40 flex-1', body: 'relative', viewport: [ - 'h-80 overflow-auto font-mono text-xs leading-5 outline-none', + 'h-80 overflow-auto font-mono text-xs leading-5', 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg', ], list: 'm-0 min-w-max list-none p-0', From 4c3f25334979fd2bc5c98097addba514e9ba71ed Mon Sep 17 00:00:00 2001 From: Florian Laabs Date: Sat, 28 Nov 2026 03:12:10 +0100 Subject: [PATCH 2/8] fix(dialog): data-autofocus on a component root when the dialog opens On opening, the dialog resolved only data-autoselect itself; data-autofocus went to Ark, which skips a wrapper that cannot take the focus - the close button got it. focusFirst() and the docs promise the wrapper works. - autoselectElement resolves data-autoselect, data-autofocus and autofocus like focusFirst (a wrapper gives its first tabbable element); the text is selected only with data-autoselect - Story "Initial focus on a component" (Listbox with filter) and a browser test; unit test for the wrapper (jsdom cannot open-focus Ark) Signed-off-by: Florian Laabs --- .changeset/dialog-autofocus-wrapper.md | 10 ++++++++++ packages/parity/e2e/overlays.spec.ts | 9 +++++++++ packages/parity/src/app-extensions.test.ts | 10 ++++++++++ .../src/components/Dialog/Dialog.stories.tsx | 16 ++++++++++++++++ packages/react/src/components/Dialog/Dialog.tsx | 4 ++-- packages/recipes/src/a11y.ts | 10 ++++++---- .../vue/src/components/Dialog/Dialog.stories.ts | 17 +++++++++++++++++ packages/vue/src/components/Dialog/Dialog.vue | 4 ++-- 8 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 .changeset/dialog-autofocus-wrapper.md diff --git a/.changeset/dialog-autofocus-wrapper.md b/.changeset/dialog-autofocus-wrapper.md new file mode 100644 index 00000000..701e2ba1 --- /dev/null +++ b/.changeset/dialog-autofocus-wrapper.md @@ -0,0 +1,10 @@ +--- +'@wirecore/wirelayer-recipes': patch +'@wirecore/wirelayer-vue': patch +'@wirecore/wirelayer-react': patch +--- + +Dialog: when it opens, `data-autofocus` and `autofocus` are resolved like `data-autoselect` and `focusFirst()` – also on +a wrapper such as a component's root, which then gives the focus to its first field (e.g. `` focuses its search field). Ark skipped such a wrapper and focused the close button. Story _Initial +focus on a component_. diff --git a/packages/parity/e2e/overlays.spec.ts b/packages/parity/e2e/overlays.spec.ts index 8fbe43ff..68ffb733 100644 --- a/packages/parity/e2e/overlays.spec.ts +++ b/packages/parity/e2e/overlays.spec.ts @@ -60,6 +60,15 @@ test.describe('Dialog', () => { await expect(page.getByRole('textbox', { name: 'Name' })).toBeFocused(); }); + test('data-autofocus on a component root: its first field gets the focus when the dialog opens', async ({ + page, + }) => { + await openStory(page, 'overlays-dialog--initial-focus-on-component'); + await page.getByRole('button', { name: 'Add member' }).click(); + await expect(page.getByRole('dialog', { name: 'Add member' })).toBeVisible(); + await expect(page.getByLabel('Filter options')).toBeFocused(); + }); + test('traps focus while open and returns it to the trigger on Escape', async ({ page }) => { await openStory(page, 'overlays-dialog--playground'); const trigger = page.getByRole('button', { name: 'Delete server' }); diff --git a/packages/parity/src/app-extensions.test.ts b/packages/parity/src/app-extensions.test.ts index edda79db..d00129ef 100644 --- a/packages/parity/src/app-extensions.test.ts +++ b/packages/parity/src/app-extensions.test.ts @@ -360,6 +360,16 @@ describe('focusFirst and autoselectElement', () => { expect([(b as HTMLInputElement).selectionStart, (b as HTMLInputElement).selectionEnd]).toEqual([0, 3]); expect(autoselectElement(mount('
'))).toBeUndefined(); }); + + it('autoselectElement: data-autofocus also on a wrapper, without selecting', () => { + const box = mount( + '
' + ); + const search = autoselectElement(box)! as HTMLInputElement; + expect(search).toBe(box.querySelector('[aria-label=Search]')); + search.focus(); + expect(search.selectionStart).toBe(search.selectionEnd); + }); }); describe('resolveTokens and watchTokens', () => { diff --git a/packages/react/src/components/Dialog/Dialog.stories.tsx b/packages/react/src/components/Dialog/Dialog.stories.tsx index aea07b6f..cec62ea4 100644 --- a/packages/react/src/components/Dialog/Dialog.stories.tsx +++ b/packages/react/src/components/Dialog/Dialog.stories.tsx @@ -6,6 +6,7 @@ import { Button } from '../Button/Button.js'; import { Checkbox } from '../Checkbox/Checkbox.js'; import { Field } from '../Field/Field.js'; import { Input } from '../Input/Input.js'; +import { Listbox } from '../Listbox/Listbox.js'; import { Dialog, DialogClose, DialogContent, DialogTrigger } from './Dialog.js'; const meta = { @@ -312,6 +313,21 @@ export const InitialFocus: Story = { ), }; +/** The mark may sit on a component root (here a Listbox with a search field): its first field gets the focus */ +export const InitialFocusOnComponent: Story = { + name: 'Initial focus on a component', + render: () => ( + + + + + + + + + ), +}; + /** `data-autoselect`: the field gets the focus with its text selected – typing replaces the prefilled name */ export const SelectedOnOpen: Story = { name: 'Selected on open', diff --git a/packages/react/src/components/Dialog/Dialog.tsx b/packages/react/src/components/Dialog/Dialog.tsx index 6fec75f5..ffefdea3 100644 --- a/packages/react/src/components/Dialog/Dialog.tsx +++ b/packages/react/src/components/Dialog/Dialog.tsx @@ -70,8 +70,8 @@ export function Dialog({ }: DialogProps) { const contentRef = useRef(null); const defaults = useRecipeDefaults('dialog', dialogRecipe); - // A field marked data-autoselect gets the focus with its text selected; otherwise Ark's own choice (an - // alertdialog's close button, data-autofocus, the first tabbable element) + // The element marked data-autoselect (text selected), data-autofocus or autofocus – also on a wrapper; else an + // alertdialog's close button, else Ark's first tabbable element const initialFocus = () => autoselectElement(contentRef.current) ?? (role === 'alertdialog' ? contentRef.current?.querySelector('[data-part=close-trigger]') : null) ?? diff --git a/packages/recipes/src/a11y.ts b/packages/recipes/src/a11y.ts index 1f843acd..10571350 100644 --- a/packages/recipes/src/a11y.ts +++ b/packages/recipes/src/a11y.ts @@ -253,13 +253,15 @@ export function focusFirst(container: ParentNode | null | undefined): HTMLElemen } /** - * For a dialog's initial focus: the element marked `data-autoselect` in `content` – its text gets selected when it - * gets the focus. Undefined without one (Ark then takes `data-autofocus` or the first tabbable element). Browser only. + * For a dialog's initial focus: the first element marked `data-autoselect` (its text gets selected when it gets the + * focus), `data-autofocus` or `autofocus` in `content`, also on a wrapper (then its first tabbable element) – like + * `focusFirst`. Undefined without one (Ark then takes the first tabbable element). Browser only. */ export function autoselectElement(content: ParentNode | null | undefined): HTMLElement | undefined { - const marked = content?.querySelector('[data-autoselect]'); + const marked = content?.querySelector('[data-autoselect], [data-autofocus], [autofocus]'); const target = marked ? markedTarget(marked, tabbableElements(content!)) : undefined; - target?.addEventListener('focus', () => selectText(target), { once: true }); + if (marked?.hasAttribute('data-autoselect')) + target?.addEventListener('focus', () => selectText(target), { once: true }); return target; } diff --git a/packages/vue/src/components/Dialog/Dialog.stories.ts b/packages/vue/src/components/Dialog/Dialog.stories.ts index c0c36271..3992da7c 100644 --- a/packages/vue/src/components/Dialog/Dialog.stories.ts +++ b/packages/vue/src/components/Dialog/Dialog.stories.ts @@ -5,6 +5,7 @@ import Button from '../Button/Button.vue'; import Checkbox from '../Checkbox/Checkbox.vue'; import Field from '../Field/Field.vue'; import Input from '../Input/Input.vue'; +import Listbox from '../Listbox/Listbox.vue'; import Dialog from './Dialog.vue'; import DialogClose from './DialogClose.vue'; import DialogContent from './DialogContent.vue'; @@ -242,6 +243,22 @@ export const InitialFocus: Story = { }), }; +/** The mark may sit on a component root (here a Listbox with a search field): its first field gets the focus */ +export const InitialFocusOnComponent: Story = { + name: 'Initial focus on a component', + render: () => ({ + components: { Button, Dialog, DialogContent, DialogTrigger, Listbox }, + setup: () => ({ people: ['Anna Muster', 'Jonas Becker', 'Lea Albrecht'] }), + template: ` + + + + + + `, + }), +}; + /** `data-autoselect`: the field gets the focus with its text selected – typing replaces the prefilled name */ export const SelectedOnOpen: Story = { name: 'Selected on open', diff --git a/packages/vue/src/components/Dialog/Dialog.vue b/packages/vue/src/components/Dialog/Dialog.vue index 2edc8a4b..0f8ff937 100644 --- a/packages/vue/src/components/Dialog/Dialog.vue +++ b/packages/vue/src/components/Dialog/Dialog.vue @@ -41,8 +41,8 @@ provide( dialogRootKey, computed(() => ({ modal: props.modal })) ); -// A field marked data-autoselect gets the focus with its text selected; otherwise Ark's own choice (an alertdialog's -// close button, data-autofocus, the first tabbable element) +// The element marked data-autoselect (text selected), data-autofocus or autofocus – also on a wrapper; else an +// alertdialog's close button, else Ark's first tabbable element const content = shallowRef(null); provide(dialogContentKey, content); const initialFocus = () => From 2e79b81b3559212845b3833e760654c888e41ae9 Mon Sep 17 00:00:00 2001 From: Florian Laabs Date: Sat, 28 Nov 2026 03:14:34 +0100 Subject: [PATCH 3/8] feat(segmented-control): icon-only segments with a label SegmentedControlItem always rendered its item text next to the icon; a name for screen readers only (an sr-only span in the slot) left the text part a flex item, and the item's gap pushed the icon off centre. - label: the text of the segment without a slot; with icon and label but no slot only the icon shows, centred, the label names it (sr-only) - Recipe variant iconOnly (no gap) and slot itemText; segments with text keep their DOM - Behaviour test (name, sr-only, gap), parity case, story "Icon only" Signed-off-by: Florian Laabs --- .changeset/segmented-control-icon-only.md | 10 ++++++++++ packages/parity/src/behavior.test.ts | 20 +++++++++++++++++++ packages/parity/src/cases.ts | 9 +++++++++ .../SegmentedControl.stories.tsx | 11 ++++++++++ .../SegmentedControl/SegmentedControlItem.tsx | 9 +++++++-- packages/recipes/src/selection.ts | 5 +++++ .../SegmentedControl.stories.ts | 14 +++++++++++++ .../SegmentedControl/SegmentedControlItem.vue | 13 +++++++++--- 8 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 .changeset/segmented-control-icon-only.md diff --git a/.changeset/segmented-control-icon-only.md b/.changeset/segmented-control-icon-only.md new file mode 100644 index 00000000..08a933f0 --- /dev/null +++ b/.changeset/segmented-control-icon-only.md @@ -0,0 +1,10 @@ +--- +'@wirecore/wirelayer-recipes': patch +'@wirecore/wirelayer-css': patch +'@wirecore/wirelayer-vue': patch +'@wirecore/wirelayer-react': patch +--- + +SegmentedControlItem: `label` – the text of a segment without a default slot (children). With `icon` and `label` but no +slot the segment shows only the icon, centred (no gap), and the label names it for screen readers – e.g. a List/Tiles +switch. Segments with text are unchanged. Recipe variant `iconOnly`, slot `itemText`; story _Icon only_. diff --git a/packages/parity/src/behavior.test.ts b/packages/parity/src/behavior.test.ts index dcfd190b..d52d7188 100644 --- a/packages/parity/src/behavior.test.ts +++ b/packages/parity/src/behavior.test.ts @@ -443,6 +443,26 @@ describe.each(frameworks)('%s', (framework) => { expect(screen.getByRole('radio', { name: 'Grid' })).toBeChecked(); expect(onChange).toHaveBeenLastCalledWith('grid'); }); + + it('icon only: the label names the segment, its text is for screen readers, no gap', async () => { + await render( + framework, + el( + 'SegmentedControl', + { label: 'View', defaultValue: 'list' }, + el('SegmentedControlItem', { value: 'list', icon: icon('Check'), label: 'List' }), + el('SegmentedControlItem', { value: 'grid', icon: icon('Check') }, 'Grid') + ) + ); + const list = screen.getByRole('radio', { name: 'List' }); + const item = list.closest('[data-part="item"]')!; + expect(item.querySelector('[data-part="item-text"]')).toHaveClass('sr-only'); + expect(item).toHaveClass('gap-0'); + // With text: unchanged + const grid = screen.getByRole('radio', { name: 'Grid' }).closest('[data-part="item"]')!; + expect(grid.querySelector('[data-part="item-text"]')).not.toHaveClass('sr-only'); + expect(grid).toHaveClass('gap-1.5'); + }); }); describe('Button', () => { diff --git a/packages/parity/src/cases.ts b/packages/parity/src/cases.ts index f63781be..4f818c09 100644 --- a/packages/parity/src/cases.ts +++ b/packages/parity/src/cases.ts @@ -520,6 +520,15 @@ export const cases: [string, El][] = [ el('SegmentedControlItem', { value: 'grid' }, 'Grid') ), ], + [ + 'SegmentedControl icon only', + el( + 'SegmentedControl', + { label: 'View', defaultValue: 'list' }, + el('SegmentedControlItem', { value: 'list', icon: icon('Check'), label: 'List' }), + el('SegmentedControlItem', { value: 'grid', icon: icon('Mail'), label: 'Tiles' }) + ), + ], [ 'SegmentedControl sm', el( diff --git a/packages/react/src/components/SegmentedControl/SegmentedControl.stories.tsx b/packages/react/src/components/SegmentedControl/SegmentedControl.stories.tsx index 13235b53..49173bd7 100644 --- a/packages/react/src/components/SegmentedControl/SegmentedControl.stories.tsx +++ b/packages/react/src/components/SegmentedControl/SegmentedControl.stories.tsx @@ -36,3 +36,14 @@ export const Language: Story = { ), }; + +/** Only icons: `label` names each segment for screen readers, the icon sits in the middle */ +export const IconOnly: Story = { + name: 'Icon only', + render: () => ( + + + + + ), +}; diff --git a/packages/react/src/components/SegmentedControl/SegmentedControlItem.tsx b/packages/react/src/components/SegmentedControl/SegmentedControlItem.tsx index 49ab80f2..e1c68ea9 100644 --- a/packages/react/src/components/SegmentedControl/SegmentedControlItem.tsx +++ b/packages/react/src/components/SegmentedControl/SegmentedControlItem.tsx @@ -9,6 +9,8 @@ export interface SegmentedControlItemProps extends ComponentProps<'label'> { value: string; /** Icon component before the label */ icon?: IconComponent; + /** Text of the segment without children; with `icon` (and no children) only the icon shows, this names it */ + label?: string; disabled?: boolean; /** Extra classes per part of the component, e.g. { base: "…" } (see the recipe) */ classes?: RecipeClasses; @@ -19,6 +21,7 @@ export function SegmentedControlItem({ classes, value, icon: Icon, + label, disabled, className, children, @@ -26,12 +29,14 @@ export function SegmentedControlItem({ }: SegmentedControlItemProps) { const segmentedControl = useRecipe('segmentedControl', segmentedControlRecipe, classes); const size = useContext(SegmentedControlContext); - const styles = segmentedControl({ size: size ?? undefined }); + const styles = segmentedControl({ size: size ?? undefined, iconOnly: !!Icon && !!label && children == null }); return ( {Icon && ); diff --git a/packages/recipes/src/selection.ts b/packages/recipes/src/selection.ts index a3591145..6cde7c92 100644 --- a/packages/recipes/src/selection.ts +++ b/packages/recipes/src/selection.ts @@ -123,12 +123,17 @@ export const segmentedControl = tv({ focusRing, ], icon: 'shrink-0', + itemText: '', }, variants: { size: { sm: { item: 'h-[26px] px-2.5 font-mono text-[11px]', icon: 'size-3' }, md: { item: 'h-8 px-3 text-[13px] font-semibold', icon: 'size-[15px]' }, }, + /** Only the icon, centred; the `label` names the segment for screen readers */ + iconOnly: { + true: { item: 'gap-0', itemText: 'sr-only' }, + }, }, defaultVariants: { size: 'md', diff --git a/packages/vue/src/components/SegmentedControl/SegmentedControl.stories.ts b/packages/vue/src/components/SegmentedControl/SegmentedControl.stories.ts index 184fac2a..3690012a 100644 --- a/packages/vue/src/components/SegmentedControl/SegmentedControl.stories.ts +++ b/packages/vue/src/components/SegmentedControl/SegmentedControl.stories.ts @@ -39,3 +39,17 @@ export const Language: Story = { `, }), }; + +/** Only icons: `label` names each segment for screen readers, the icon sits in the middle */ +export const IconOnly: Story = { + name: 'Icon only', + render: () => ({ + components: { SegmentedControl, SegmentedControlItem }, + setup: () => ({ LayoutGrid, List }), + template: ` + + + + `, + }), +}; diff --git a/packages/vue/src/components/SegmentedControl/SegmentedControlItem.vue b/packages/vue/src/components/SegmentedControl/SegmentedControlItem.vue index c868abd5..41b0be3c 100644 --- a/packages/vue/src/components/SegmentedControl/SegmentedControlItem.vue +++ b/packages/vue/src/components/SegmentedControl/SegmentedControlItem.vue @@ -1,7 +1,7 @@ From eab2b96ea5774895f0664367bfb7c35fdb27f89d Mon Sep 17 00:00:00 2001 From: Florian Laabs Date: Sat, 28 Nov 2026 03:16:28 +0100 Subject: [PATCH 4/8] fix(fields): a clearer keyboard focus - 2px ring inside the border Focused fields showed the focus only as a 1 px primary border: WCAG 2.4.7, but in the DMJ UX test hardly different from the resting state, and short of 2.4.13 (2 px, 3:1 between focused and unfocused). - Every focus:/focus-within:/focus-visible:border-primary of the field recipes gets a 2 px primary outline at -outline-offset-3: right inside the border, so nothing cuts it off, on the field surface (primary on the surfaces is checked by the theme test) - outline-solid where the slot has outline-none (the focus ring test keeps that so) Signed-off-by: Florian Laabs --- .changeset/field-focus-ring.md | 10 ++++++++++ packages/recipes/src/app.ts | 2 +- packages/recipes/src/chat.ts | 2 +- packages/recipes/src/collections.ts | 2 +- packages/recipes/src/controls.ts | 4 ++-- packages/recipes/src/editor.ts | 2 +- packages/recipes/src/extras.ts | 2 +- packages/recipes/src/field.ts | 4 ++-- packages/recipes/src/hierarchy.ts | 8 ++++---- packages/recipes/src/inputs.ts | 12 ++++++------ packages/recipes/src/navigation.ts | 4 ++-- packages/recipes/src/widgets.ts | 2 +- 12 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 .changeset/field-focus-ring.md diff --git a/.changeset/field-focus-ring.md b/.changeset/field-focus-ring.md new file mode 100644 index 00000000..77fd015b --- /dev/null +++ b/.changeset/field-focus-ring.md @@ -0,0 +1,10 @@ +--- +'@wirecore/wirelayer-recipes': patch +'@wirecore/wirelayer-css': patch +--- + +Text fields and other form controls (Input, Textarea, Select, DatePicker, NumberInput, PasswordInput, Combobox, +TreeSelect, MultiSelect, editors, search fields …) show the keyboard focus more clearly: besides the primary border a +2 px primary ring right inside it, so the focused field differs from the resting one by a 3 px band (WCAG 2.4.13). It +sits inside the field, so neighbours and `overflow-hidden` do not cut it off; it covers the field's own surface, whose +contrast to primary the theme test already checks. diff --git a/packages/recipes/src/app.ts b/packages/recipes/src/app.ts index 278fa6bc..17f46942 100644 --- a/packages/recipes/src/app.ts +++ b/packages/recipes/src/app.ts @@ -139,7 +139,7 @@ export const tagsInput = tv({ base: 'relative flex w-full flex-col', control: [ 'flex min-h-[var(--wc-control-h-md,2.5rem)] w-full flex-wrap items-center gap-1.5 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg px-2 py-1.5 text-fg', - 'transition-colors focus-within:border-primary motion-reduce:transition-none', + 'transition-colors focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary motion-reduce:transition-none', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2', ], item: 'inline-flex', diff --git a/packages/recipes/src/chat.ts b/packages/recipes/src/chat.ts index 0719e21b..fc598b54 100644 --- a/packages/recipes/src/chat.ts +++ b/packages/recipes/src/chat.ts @@ -88,7 +88,7 @@ export const chatPrompt = tv({ slots: { base: [ 'flex w-full flex-col gap-2 rounded-xl border border-line-strong bg-bg p-2 transition-colors motion-reduce:transition-none', - 'focus-within:border-primary data-disabled:bg-bg-2', + 'focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary data-disabled:bg-bg-2', ], textarea: [ 'block max-h-[var(--wc-prompt-max)] min-h-10 w-full resize-none overflow-y-auto bg-transparent px-2 py-2 text-[15px] leading-6 text-fg outline-none', diff --git a/packages/recipes/src/collections.ts b/packages/recipes/src/collections.ts index 41897e71..f70f9447 100644 --- a/packages/recipes/src/collections.ts +++ b/packages/recipes/src/collections.ts @@ -253,7 +253,7 @@ export type MeterColor = 'primary' | 'info' | 'success' | 'warn' | 'danger' | 'm /** Long list that renders only the visible rows (TanStack Virtual) */ export const virtualListBox = tv({ slots: { - base: 'overflow-y-auto rounded-lg border border-line outline-none focus-visible:border-primary', + base: 'overflow-y-auto rounded-lg border border-line outline-none focus-visible:border-primary focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-3 focus-visible:outline-primary', spacer: 'relative w-full', item: 'absolute top-0 inset-s-0 w-full', /** Group heading; the heading of the group in view sticks to the top */ diff --git a/packages/recipes/src/controls.ts b/packages/recipes/src/controls.ts index ad2ef220..ee747108 100644 --- a/packages/recipes/src/controls.ts +++ b/packages/recipes/src/controls.ts @@ -12,7 +12,7 @@ export const listbox = tv({ label: 'text-[13px] font-medium text-fg', content: [ 'flex max-h-72 flex-col overflow-y-auto rounded-lg border border-line-strong bg-bg p-1 text-fg outline-none', - 'focus-visible:border-primary data-disabled:opacity-60', + 'focus-visible:border-primary focus-visible:outline-2 focus-visible:-outline-offset-3 focus-visible:outline-primary data-disabled:opacity-60', ], item: listboxOption, icon: 'size-4 shrink-0 text-muted', @@ -21,7 +21,7 @@ export const listbox = tv({ /** Search field above the list (filter) */ search: [ 'h-8 w-full min-w-0 rounded-md border border-line-strong bg-bg px-2.5 text-sm text-fg outline-none', - 'placeholder:text-muted focus:border-primary disabled:cursor-not-allowed disabled:opacity-60', + 'placeholder:text-muted focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary disabled:cursor-not-allowed disabled:opacity-60', ], /** Check box before the label (`checkboxes`) */ check: [ diff --git a/packages/recipes/src/editor.ts b/packages/recipes/src/editor.ts index 0fb594e8..772f30ea 100644 --- a/packages/recipes/src/editor.ts +++ b/packages/recipes/src/editor.ts @@ -51,7 +51,7 @@ export const editor = tv({ slots: { base: [ 'flex w-full flex-col overflow-hidden rounded-lg border border-line-strong bg-bg transition-colors motion-reduce:transition-none', - 'focus-within:border-primary data-invalid:border-danger data-disabled:bg-bg-2', + 'focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary data-invalid:border-danger data-disabled:bg-bg-2', ], toolbar: 'flex flex-wrap items-center gap-0.5 border-b border-line p-1', // 32 × 32 px targets; aria-pressed shows the formatting at the cursor diff --git a/packages/recipes/src/extras.ts b/packages/recipes/src/extras.ts index c71cd4c0..b62ae1ff 100644 --- a/packages/recipes/src/extras.ts +++ b/packages/recipes/src/extras.ts @@ -111,7 +111,7 @@ export const nativeSelect = tv({ base: 'relative flex w-full', select: [ 'h-[var(--wc-control-h-md,2.5rem)] w-full cursor-pointer appearance-none rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg pe-9 ps-3 text-[length:var(--wc-control-text-md,15px)] text-fg outline-none', - 'transition-colors focus:border-primary motion-reduce:transition-none', + 'transition-colors focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary motion-reduce:transition-none', 'aria-[invalid=true]:border-danger disabled:cursor-not-allowed disabled:border-line disabled:bg-bg-2 disabled:text-muted', ], icon: 'pointer-events-none absolute top-1/2 inset-e-3 size-4 -translate-y-1/2 text-muted', diff --git a/packages/recipes/src/field.ts b/packages/recipes/src/field.ts index 00eb210b..896abcab 100644 --- a/packages/recipes/src/field.ts +++ b/packages/recipes/src/field.ts @@ -33,7 +33,7 @@ export const inputStatusParts = { export const input = tv({ slots: { - base: 'flex w-full items-stretch overflow-hidden border border-line-strong bg-bg text-fg transition-colors focus-within:border-primary motion-reduce:transition-none', + base: 'flex w-full items-stretch overflow-hidden border border-line-strong bg-bg text-fg transition-colors focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary motion-reduce:transition-none', control: [ 'min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted disabled:cursor-not-allowed', // The browser's own clear button of type="search" (DataTable search …) is a button, too @@ -101,7 +101,7 @@ export const input = tv({ export const textarea = tv({ base: [ 'block w-full resize-y rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg px-3 py-[9px] text-[length:var(--wc-control-text-md,15px)] leading-normal text-fg', - 'outline-none transition-colors placeholder:text-muted focus:border-primary motion-reduce:transition-none', + 'outline-none transition-colors placeholder:text-muted focus:border-primary focus:outline-2 focus:outline-solid focus:-outline-offset-3 focus:outline-primary motion-reduce:transition-none', ], variants: { size: { diff --git a/packages/recipes/src/hierarchy.ts b/packages/recipes/src/hierarchy.ts index 284261f7..3ecefb8a 100644 --- a/packages/recipes/src/hierarchy.ts +++ b/packages/recipes/src/hierarchy.ts @@ -8,7 +8,7 @@ const focusRing = 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus /** Select-like trigger shared by TreeSelect and CascadeSelect */ const trigger = [ 'flex h-10 w-full cursor-pointer items-center justify-between gap-2.5 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg pe-2.5 ps-3 text-start text-[15px] text-fg', - 'outline-none transition-colors motion-reduce:transition-none focus-visible:border-primary data-[state=open]:border-primary', + 'outline-none transition-colors motion-reduce:transition-none focus-visible:border-primary focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-3 focus-visible:outline-primary data-[state=open]:border-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ]; @@ -53,7 +53,7 @@ export const tree = tv({ toolbar: 'flex flex-wrap items-center gap-1.5', search: [ 'h-8 min-w-0 flex-1 rounded-md border border-line-strong bg-bg px-2.5 text-sm text-fg outline-none', - 'placeholder:text-muted focus:border-primary [&::-webkit-search-cancel-button]:cursor-pointer', + 'placeholder:text-muted focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary [&::-webkit-search-cancel-button]:cursor-pointer', ], /** Row below a branch while its children load (indented like its children) */ loadingRow: 'flex h-8 items-center gap-2 pe-2 ps-[calc(var(--depth)*20px+32px)] text-sm text-muted', @@ -185,7 +185,7 @@ export function treeDropMove( const chipParts = { chipsControl: [ 'relative flex min-h-10 w-full flex-wrap items-center gap-1 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg py-[5px] pe-2.5 ps-1.5 text-fg', - 'transition-colors motion-reduce:transition-none focus-within:border-primary data-[state=open]:border-primary', + 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary data-[state=open]:border-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ], chipsTrigger: [ @@ -341,7 +341,7 @@ export const cascadeSelect = tv({ /** Search field (filter): the field itself, the levels button at its end */ searchControl: [ 'flex h-10 w-full items-center gap-1 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg pe-1 ps-3 text-[15px] text-fg', - 'transition-colors motion-reduce:transition-none focus-within:border-primary', + 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ], searchInput: diff --git a/packages/recipes/src/inputs.ts b/packages/recipes/src/inputs.ts index f7f8f79c..29b2902c 100644 --- a/packages/recipes/src/inputs.ts +++ b/packages/recipes/src/inputs.ts @@ -8,7 +8,7 @@ import { tv } from './tv.js'; /** The bordered box around a text control – like Input */ const box = [ 'flex w-full items-stretch overflow-hidden rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg text-fg', - 'transition-colors motion-reduce:transition-none focus-within:border-primary', + 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ]; const boxInput = @@ -179,7 +179,7 @@ export const multiSelect = tv({ base: 'relative flex w-full flex-col', trigger: [ 'flex h-[var(--wc-control-h-md,2.5rem)] w-full cursor-pointer items-center justify-between gap-2.5 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg pe-2.5 ps-3 text-start text-[length:var(--wc-control-text-md,15px)] text-fg', - 'outline-none transition-colors motion-reduce:transition-none focus-visible:border-primary data-[state=open]:border-primary', + 'outline-none transition-colors motion-reduce:transition-none focus-visible:border-primary focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-3 focus-visible:outline-primary data-[state=open]:border-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ], value: 'min-w-0 truncate data-[placeholder-shown]:text-muted', @@ -204,7 +204,7 @@ export const multiSelect = tv({ control: 'relative flex', chipsControl: [ 'relative flex min-h-[var(--wc-control-h-md,2.5rem)] w-full flex-wrap items-center gap-1 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg py-[5px] pe-2.5 ps-1.5 text-fg', - 'transition-colors motion-reduce:transition-none focus-within:border-primary data-[state=open]:border-primary', + 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary data-[state=open]:border-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ], /** The trigger next to the chips: fills the rest of the row, no border of its own */ @@ -608,7 +608,7 @@ export const pinInput = tv({ control: 'flex gap-2', input: [ 'size-11 rounded-lg border border-line-strong bg-bg text-center font-mono text-lg text-fg outline-none', - 'transition-colors motion-reduce:transition-none focus:border-primary placeholder:text-muted', + 'transition-colors motion-reduce:transition-none focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary placeholder:text-muted', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ], }, @@ -711,7 +711,7 @@ export const colorPicker = tv({ row: 'flex items-center gap-2', input: [ 'h-8 min-w-0 flex-1 rounded-md border border-line-strong bg-bg px-2 font-mono text-[13px] text-fg uppercase outline-none', - 'focus:border-primary', + 'focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary', ], swatches: 'flex flex-wrap gap-1.5', swatchFill: 'size-full rounded-md', @@ -739,7 +739,7 @@ export const colorPicker = tv({ channelLabel: 'font-mono text-[10px] text-muted uppercase', channelInput: [ 'h-8 w-full min-w-0 rounded-md border border-line-strong bg-bg px-1.5 text-center font-mono text-[13px] text-fg tabular-nums outline-none', - 'focus:border-primary', + 'focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary', ], /** ColorInput: the swatch button before the text field */ inputTrigger: [ diff --git a/packages/recipes/src/navigation.ts b/packages/recipes/src/navigation.ts index caeee159..897a8eb4 100644 --- a/packages/recipes/src/navigation.ts +++ b/packages/recipes/src/navigation.ts @@ -47,7 +47,7 @@ export const listboxPanel = { header: 'sticky top-0 z-[1] -mx-1 -mt-1 mb-1 flex flex-col gap-1 border-b border-line bg-card p-1', search: [ 'h-8 w-full min-w-0 shrink-0 rounded-md border border-line-strong bg-bg px-2.5 text-sm text-fg outline-none', - 'placeholder:text-muted focus:border-primary', + 'placeholder:text-muted focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary', ], list: 'flex flex-col outline-none', }; @@ -68,7 +68,7 @@ export const select = tv({ base: 'relative flex w-full flex-col', trigger: [ 'flex h-[var(--wc-control-h-md,2.5rem)] w-full cursor-pointer items-center justify-between gap-2.5 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg pe-2.5 ps-3 text-start text-[length:var(--wc-control-text-md,15px)] text-fg', - 'outline-none transition-colors motion-reduce:transition-none focus-visible:border-primary data-[state=open]:border-primary', + 'outline-none transition-colors motion-reduce:transition-none focus-visible:border-primary focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-3 focus-visible:outline-primary data-[state=open]:border-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ], value: 'flex min-w-0 items-center gap-2 truncate', diff --git a/packages/recipes/src/widgets.ts b/packages/recipes/src/widgets.ts index 616c1eee..a7ebaee1 100644 --- a/packages/recipes/src/widgets.ts +++ b/packages/recipes/src/widgets.ts @@ -221,7 +221,7 @@ export const mentions = tv({ base: 'relative flex w-full flex-col', control: [ 'relative w-full rounded-lg border border-line-strong bg-bg transition-colors motion-reduce:transition-none', - 'focus-within:border-primary data-invalid:border-danger', + 'focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary data-invalid:border-danger', 'data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2', ], highlighter: [ From aed98083e43944f582eced4f3d0b15c5561bc66a Mon Sep 17 00:00:00 2001 From: Florian Laabs Date: Sat, 28 Nov 2026 03:18:47 +0100 Subject: [PATCH 5/8] feat(data-table): exportRows="leaves" for the export of a TreeTable The CSV, Excel and print of a TreeTable always had every row of the tree. When parents only sum up their children ("Person - 2 licences" above the licences), the export had those rows twice; the page could not leave them out without rebuilding the table's search, filters and sorting. - Prop exportRows: 'all' (default) | 'leaves'; option rows of generateCsv/exportCsv, generateXlsx/exportXlsx and print, which wins - A leaf has no children in the data (getSubRows), not just no matching ones; filtered and sorted like the table; selectionOnly unaffected - Tests for CSV, Excel and print with and without a filter (lenient), story "Tree export", docs in the export section Signed-off-by: Florian Laabs --- .changeset/data-table-export-leaves.md | 10 +++ apps/storybook/src/Introduction.mdx | 5 ++ packages/parity/src/data-table.test.ts | 70 +++++++++++++++++++ .../src/data-table/DataTable.stories.tsx | 51 ++++++++++++++ packages/react/src/data-table/DataTable.tsx | 25 +++++-- packages/react/src/data-table/types.ts | 6 ++ .../vue/src/data-table/DataTable.stories.ts | 62 ++++++++++++++++ packages/vue/src/data-table/DataTable.vue | 23 ++++-- packages/vue/src/data-table/types.ts | 6 ++ 9 files changed, 248 insertions(+), 10 deletions(-) create mode 100644 .changeset/data-table-export-leaves.md diff --git a/.changeset/data-table-export-leaves.md b/.changeset/data-table-export-leaves.md new file mode 100644 index 00000000..758ff9ed --- /dev/null +++ b/.changeset/data-table-export-leaves.md @@ -0,0 +1,10 @@ +--- +'@wirecore/wirelayer-vue': minor +'@wirecore/wirelayer-react': minor +--- + +DataTable: `exportRows="leaves"` – the CSV, Excel and print of a TreeTable (`getSubRows`) only have the rows without +children, e.g. when a parent only sums up its children ("Person – 2 licences" above the licences); still filtered and +sorted like the table (with `treeFilterMode="lenient"` only the leaves that match themselves). The methods take it as +option `rows` (`generateCsv({ rows: 'leaves' })`, also `generateXlsx`, `exportCsv`, `exportXlsx`, `print`), which wins +over the prop; `selectionOnly` is not affected. Default `all`, as before. Story _Tree export_. diff --git a/apps/storybook/src/Introduction.mdx b/apps/storybook/src/Introduction.mdx index 450cc7a3..3f240fd9 100644 --- a/apps/storybook/src/Introduction.mdx +++ b/apps/storybook/src/Introduction.mdx @@ -359,6 +359,11 @@ const columns: DataTableColumn[] = [ `exportColumns` takes precedence over `exportHeader` and `exportValue`. In Excel the aggregate and the footer of a split column go to its first part. The React Native DataTable exports the same way. +A TreeTable (`getSubRows`) exports all its rows by default. With `exportRows="leaves"` the CSV, Excel and print only +have the rows without children – for parents that just sum up their children ("Doe, Jane – 2 licences"); still +filtered and sorted like the table (with `treeFilterMode="lenient"` only the leaves that match themselves). The methods +take it as option: `generateCsv({ rows: 'leaves' })`. The selection (`selectionOnly`) is exported as it is. + ## DataTable: hidden columns and saved state A column with `hidden: true` starts hidden; the column menu (`columnToggle`) shows it. Hidden columns are neither diff --git a/packages/parity/src/data-table.test.ts b/packages/parity/src/data-table.test.ts index 4b6e7275..9f5963ac 100644 --- a/packages/parity/src/data-table.test.ts +++ b/packages/parity/src/data-table.test.ts @@ -2580,6 +2580,76 @@ describe.each(frameworks)('%s DataTable spreadsheet, server and layout', (framew await waitFor(() => expect(toggle).toHaveFocus()); }); + describe('exportRows="leaves"', () => { + // A parent only sums up its children ("Anna – 2 licences" above the licences) + const licences = [ + { + id: 'anna', + name: 'Anna – 2 licences', + children: [ + { id: 'a1', name: 'Anna: Junior' }, + { id: 'a2', name: 'Anna: Senior' }, + ], + }, + { id: 'jonas', name: 'Jonas – 1 licence', children: [{ id: 'j1', name: 'Jonas: Junior' }] }, + ]; + type TreeHandle = Handle & { generateCsv: (options?: object) => string }; + const treeTable = (props: Record) => + el('DataTable', { + data: licences, + caption: 'Licences', + getRowId, + columns: [{ id: 'name', header: 'Name' }], + getSubRows: (row: { children?: object[] }) => row.children, + exportRows: 'leaves', + ...props, + }); + const printed = (handle: TreeHandle) => { + handle.print(); + const frame = document.querySelector('iframe[aria-hidden="true"]')!; + const page = new DOMParser().parseFromString(frame.srcdoc, 'text/html'); + frame.remove(); + return [...page.querySelectorAll('tbody tr')].map((row) => row.querySelector('td')?.textContent?.trim()); + }; + + it('CSV, Excel and print only with the rows without children; the option rows wins', async () => { + let handle: TreeHandle | undefined; + await render(framework, treeTable({ ref: (value: TreeHandle | null) => (handle = value ?? handle) })); + const csv = (options = {}) => handle!.generateCsv({ bom: false, ...options }).split('\r\n'); + expect(csv()).toEqual(['Name', 'Anna: Junior', 'Anna: Senior', 'Jonas: Junior']); + expect(csv({ rows: 'all' })).toEqual([ + 'Name', + 'Anna – 2 licences', + 'Anna: Junior', + 'Anna: Senior', + 'Jonas – 1 licence', + 'Jonas: Junior', + ]); + const sheet = sheetXml(handle!.generateXlsx()); + expect([...sheet.querySelectorAll('row')].map((row) => row.querySelector('c')?.textContent)).toEqual([ + 'Name', + 'Anna: Junior', + 'Anna: Senior', + 'Jonas: Junior', + ]); + expect(printed(handle!)).toEqual(['Anna: Junior', 'Anna: Senior', 'Jonas: Junior']); + }); + + it('filtered like the table: with treeFilterMode="lenient" only the leaves that match themselves', async () => { + let handle: TreeHandle | undefined; + await render( + framework, + treeTable({ + ref: (value: TreeHandle | null) => (handle = value ?? handle), + globalFilter: 'senior', + treeFilterMode: 'lenient', + }) + ); + expect(handle!.generateCsv({ bom: false }).split('\r\n')).toEqual(['Name', 'Anna: Senior']); + expect(printed(handle!)).toEqual(['Anna: Senior']); + }); + }); + it('prints all filtered rows as plain text with the header on every page', async () => { let handle: Handle | undefined; await render( diff --git a/packages/react/src/data-table/DataTable.stories.tsx b/packages/react/src/data-table/DataTable.stories.tsx index 9aaa7c53..7862db0e 100644 --- a/packages/react/src/data-table/DataTable.stories.tsx +++ b/packages/react/src/data-table/DataTable.stories.tsx @@ -1926,3 +1926,54 @@ export const OptionalColumns: Story = { /> ), }; + +interface LicenceRow { + id: string; + name: string; + valid?: string; + children?: LicenceRow[]; +} +const licenceRows: LicenceRow[] = [ + { + id: 'anna', + name: 'Anna Muster – 2 licences', + children: [ + { id: 'a1', name: 'Junior', valid: '2027-03-31' }, + { id: 'a2', name: 'Referee', valid: '2026-12-31' }, + ], + }, + { id: 'jonas', name: 'Jonas Becker – 1 licence', children: [{ id: 'j1', name: 'Junior', valid: '2027-06-30' }] }, +]; + +function TreeExportDemo() { + const [csv, setCsv] = useState(''); + const [expanded, setExpanded] = useState(['anna', 'jonas']); + return ( +
+ + ref={(handle: DataTableHandle | null) => { + if (handle && !csv) setCsv(handle.generateCsv({ bom: false, separator: ';' })); + }} + features={features} + data={licenceRows} + columns={[ + { id: 'name', header: 'Licence' }, + { id: 'valid', header: 'Valid until' }, + ]} + caption="Licences" + getRowId={(row) => row.id} + getSubRows={(row) => row.children} + expanded={expanded} + onExpandedChange={setExpanded} + exportFilename="licences" + exportRows="leaves" + className={card} + /> +

CSV export

+
{csv}
+
+ ); +} + +/** `exportRows="leaves"`: the export of a TreeTable without the parent rows that only sum up their children */ +export const TreeExport: Story = { name: 'Tree export', render: () => }; diff --git a/packages/react/src/data-table/DataTable.tsx b/packages/react/src/data-table/DataTable.tsx index 46fc52ac..e5aa9946 100644 --- a/packages/react/src/data-table/DataTable.tsx +++ b/packages/react/src/data-table/DataTable.tsx @@ -411,6 +411,12 @@ export interface DataTableProps extends Omit< onPinnedColumnsChange?: (pinned: { start: string[]; end: string[] }) => void; /** Shows an export button; the CSV has the filtered and sorted rows of all pages (or the selection) */ exportFilename?: string; + /** + * Rows of the CSV, Excel and print: `all` (default) or `leaves` – a TreeTable without the rows that have children + * (`getSubRows`), e.g. when a parent only sums up its children; still filtered and sorted like the table. The + * methods take it as option `rows`; `selectionOnly` is not affected + */ + exportRows?: 'all' | 'leaves'; /** Separator of the CSV export, also of the export button – default: from the locale (";" where numbers have a * decimal comma, e.g. de-DE, as a spreadsheet there expects it; "," otherwise) */ csvSeparator?: string; @@ -689,6 +695,7 @@ export function DataTable({ pinnedColumns, onPinnedColumnsChange, exportFilename, + exportRows: exportRowsProp, csvSeparator: csvSeparatorProp, exportFormats, groupBy, @@ -2615,9 +2622,10 @@ export function DataTable({ .map((column) => columnById.get(column.id)!) .filter((column) => column.exportable !== false); const parts = tableExportColumns>(visible); + const leaves = !options.selectionOnly && leavesOnly(options.rows); const rows = ( options.selectionOnly ? table.getSelectedRowModel().flatRows : table.getSortedRowModel().flatRows - ).filter((row) => !row.getIsGrouped()); + ).filter((row) => !row.getIsGrouped() && (!leaves || isLeaf(row))); const records = rows.map((row) => parts.map(({ column, value }) => value ? value(row.original) : display(column, row.getValue(column.id), row.original) @@ -2636,14 +2644,21 @@ export function DataTable({ { row, group: row.getIsGrouped(), depth: row.depth }, ...(row.subRows as TableRow[]).flatMap(walkRows), ]; + /** `exportRows="leaves"` (or the option `rows`) for an export */ + const leavesOnly = (rows?: 'all' | 'leaves') => (rows ?? exportRowsProp) === 'leaves'; + /** A row without children of its own in the data (TreeTable) – not just without matching ones */ + const isLeaf = (row: TableRow) => !getSubRows?.(row.original)?.length; /** Rows of an export or print: the selection, or the sorted rows with their group rows (tree of groups) */ - const exportRows = (selectionOnly = false) => + const exportRows = (selectionOnly = false, leaves = false) => selectionOnly ? table .getSelectedRowModel() .flatRows.filter((row) => !row.getIsGrouped()) .map((row) => ({ row, group: false, depth: 0 })) - : table.getSortedRowModel().rows.flatMap(walkRows); + : table + .getSortedRowModel() + .rows.flatMap(walkRows) + .filter((entry) => !leaves || entry.group || isLeaf(entry.row)); /** Label of a group row: "Location: Frankfurt (3)" */ const groupLabel = (row: TableRow) => { const column = columnById.get(row.groupingColumnId!); @@ -2672,7 +2687,7 @@ export function DataTable({ .map((column) => columnById.get(column.id)!) .filter((column) => column.exportable !== false); const parts = tableExportColumns>(visible); - const rows: XlsxRow[] = exportRows(options.selectionOnly) + const rows: XlsxRow[] = exportRows(options.selectionOnly, leavesOnly(options.rows)) .filter((entry) => !entry.group || options.groups !== false) .map(({ row, group, depth }) => { if (group) { @@ -2744,7 +2759,7 @@ export function DataTable({ align: cell.group ? undefined : columnById.get(cell.header.column.id)?.align, })) ); - const body = exportRows(options.selectionOnly).map(({ row, group }) => + const body = exportRows(options.selectionOnly, leavesOnly(options.rows)).map(({ row, group }) => group ? { kind: 'group' as const, cells: [{ text: groupLabel(row), colSpan: visible.length }] } : { diff --git a/packages/react/src/data-table/types.ts b/packages/react/src/data-table/types.ts index 1c4cc58f..d2a9fec1 100644 --- a/packages/react/src/data-table/types.ts +++ b/packages/react/src/data-table/types.ts @@ -269,6 +269,8 @@ export interface DataTableAllSelection { export interface DataTableCsvOptions { /** Only the selected rows (default: the filtered and sorted rows of all pages) */ selectionOnly?: boolean; + /** `leaves`: a TreeTable only with the rows without children (default: the table's `exportRows`) */ + rows?: 'all' | 'leaves'; /** Separator – default: `csvSeparator` of the table, else from the locale (";" with a decimal comma, "," otherwise) */ separator?: string; /** Byte order mark at the start, so Excel reads UTF-8 – default true */ @@ -281,6 +283,8 @@ export interface DataTableCsvOptions { export interface DataTableXlsxOptions { /** Only the selected rows (default: the filtered and sorted rows of all pages) */ selectionOnly?: boolean; + /** `leaves`: a TreeTable only with the rows without children (default: the table's `exportRows`) */ + rows?: 'all' | 'leaves'; /** File name without ".xlsx" (exportXlsx, default: `exportFilename`) */ filename?: string; /** Name of the worksheet (default: the caption) */ @@ -297,6 +301,8 @@ export interface DataTablePrintOptions { title?: string; /** Only the selected rows */ selectionOnly?: boolean; + /** `leaves`: a TreeTable only with the rows without children (default: the table's `exportRows`) */ + rows?: 'all' | 'leaves'; } /** The selected range of cells (`cellSelection`) */ diff --git a/packages/vue/src/data-table/DataTable.stories.ts b/packages/vue/src/data-table/DataTable.stories.ts index 7a124218..3fb040f1 100644 --- a/packages/vue/src/data-table/DataTable.stories.ts +++ b/packages/vue/src/data-table/DataTable.stories.ts @@ -2292,3 +2292,65 @@ export const OptionalColumns: Story = { />`, }), }; + +interface LicenceRow { + id: string; + name: string; + valid?: string; + children?: LicenceRow[]; +} +const licenceRows: LicenceRow[] = [ + { + id: 'anna', + name: 'Anna Muster – 2 licences', + children: [ + { id: 'a1', name: 'Junior', valid: '2027-03-31' }, + { id: 'a2', name: 'Referee', valid: '2026-12-31' }, + ], + }, + { id: 'jonas', name: 'Jonas Becker – 1 licence', children: [{ id: 'j1', name: 'Junior', valid: '2027-06-30' }] }, +]; + +/** `exportRows="leaves"`: the export of a TreeTable without the parent rows that only sum up their children */ +export const TreeExport: Story = { + name: 'Tree export', + render: () => ({ + components: { DataTable: DataTable as ConcreteComponent }, + setup: () => { + const table = ref<{ generateCsv: (options?: object) => string }>(); + const csv = computed(() => table.value?.generateCsv({ bom: false, separator: ';' }) ?? ''); + return { + features, + rows: licenceRows, + card, + table, + csv, + expanded: ref(['anna', 'jonas']), + getRowId: (row: LicenceRow) => row.id, + getSubRows: (row: LicenceRow) => row.children, + columns: [ + { id: 'name', header: 'Licence' }, + { id: 'valid', header: 'Valid until' }, + ], + }; + }, + template: ` +
+ +

CSV export

+
{{ csv }}
+
`, + }), +}; diff --git a/packages/vue/src/data-table/DataTable.vue b/packages/vue/src/data-table/DataTable.vue index e7b5b703..4ca5efbd 100644 --- a/packages/vue/src/data-table/DataTable.vue +++ b/packages/vue/src/data-table/DataTable.vue @@ -353,6 +353,12 @@ export interface DataTableProps { pinnedColumns?: { start: string[]; end: string[] }; /** Shows an export button; the CSV has the filtered and sorted rows of all pages (or the selection) */ exportFilename?: string; + /** + * Rows of the CSV, Excel and print: `all` (default) or `leaves` – a TreeTable without the rows that have children + * (`getSubRows`), e.g. when a parent only sums up its children; still filtered and sorted like the table. The + * methods take it as option `rows`; `selectionOnly` is not affected + */ + exportRows?: 'all' | 'leaves'; /** Separator of the CSV export, also of the export button – default: from the locale (";" where numbers have a * decimal comma, e.g. de-DE, as a spreadsheet there expects it; "," otherwise) */ csvSeparator?: string; @@ -2614,9 +2620,10 @@ function generateCsv(options: DataTableCsvOptions = {}) { .map((column) => columnById.value.get(column.id)!) .filter((column) => column.exportable !== false); const parts = tableExportColumns>(visible); + const leaves = !options.selectionOnly && leavesOnly(options.rows); const rows = ( options.selectionOnly ? table.getSelectedRowModel().flatRows : table.getSortedRowModel().flatRows - ).filter((row) => !row.getIsGrouped()); + ).filter((row) => !row.getIsGrouped() && (!leaves || isLeaf(row))); const records = rows.map((row) => parts.map(({ column, value }) => value ? value(row.original) : display(column, row.getValue(column.id), row.original) @@ -2632,7 +2639,11 @@ function exportCsv(options: boolean | DataTableCsvOptions = false) { downloadText(`${settings.filename ?? props.exportFilename ?? 'export'}.csv`, generateCsv(settings)); } /** Rows of an export or print: the selection, or the sorted rows with their group rows (tree of groups) */ -function exportRows(selectionOnly = false): { row: TableRow; group: boolean; depth: number }[] { +/** `exportRows="leaves"` (or the option `rows`) for an export */ +const leavesOnly = (rows?: 'all' | 'leaves') => (rows ?? props.exportRows) === 'leaves'; +/** A row without children of its own in the data (TreeTable) – not just without matching ones */ +const isLeaf = (row: TableRow) => !props.getSubRows?.(row.original)?.length; +function exportedRows(selectionOnly = false, leaves = false): { row: TableRow; group: boolean; depth: number }[] { if (selectionOnly) return table .getSelectedRowModel() @@ -2642,7 +2653,9 @@ function exportRows(selectionOnly = false): { row: TableRow; group: boolean; dep { row, group: row.getIsGrouped(), depth: row.depth }, ...(row.subRows as TableRow[]).flatMap(walk), ]; - return (table.getSortedRowModel().rows as TableRow[]).flatMap(walk); + return (table.getSortedRowModel().rows as TableRow[]) + .flatMap(walk) + .filter((entry) => !leaves || entry.group || isLeaf(entry.row)); } /** Label of a group row: "Location: Frankfurt (3)" */ function groupLabel(row: TableRow) { @@ -2673,7 +2686,7 @@ function generateXlsx(options: DataTableXlsxOptions = {}) { .map((column) => columnById.value.get(column.id)!) .filter((column) => column.exportable !== false); const parts = tableExportColumns>(visible); - const rows: XlsxRow[] = exportRows(options.selectionOnly) + const rows: XlsxRow[] = exportedRows(options.selectionOnly, leavesOnly(options.rows)) .filter((entry) => !entry.group || options.groups !== false) .map(({ row, group, depth }): XlsxRow => { if (group) { @@ -2748,7 +2761,7 @@ function print(options: DataTablePrintOptions = {}) { align: cell.group ? undefined : columnById.value.get(cell.header.column.id)?.align, })) ); - const body = exportRows(options.selectionOnly).map(({ row, group }) => + const body = exportedRows(options.selectionOnly, leavesOnly(options.rows)).map(({ row, group }) => group ? { kind: 'group' as const, cells: [{ text: groupLabel(row), colSpan: visible.length }] } : { cells: visible.map((column) => ({ text: cellText(row, column.id), align: column.align })) } diff --git a/packages/vue/src/data-table/types.ts b/packages/vue/src/data-table/types.ts index 9c31c6bf..ca110ec1 100644 --- a/packages/vue/src/data-table/types.ts +++ b/packages/vue/src/data-table/types.ts @@ -259,6 +259,8 @@ export interface DataTableAllSelection { export interface DataTableCsvOptions { /** Only the selected rows (default: the filtered and sorted rows of all pages) */ selectionOnly?: boolean; + /** `leaves`: a TreeTable only with the rows without children (default: the table's `exportRows`) */ + rows?: 'all' | 'leaves'; /** Separator – default: `csvSeparator` of the table, else from the locale (";" with a decimal comma, "," otherwise) */ separator?: string; /** Byte order mark at the start, so Excel reads UTF-8 – default true */ @@ -271,6 +273,8 @@ export interface DataTableCsvOptions { export interface DataTableXlsxOptions { /** Only the selected rows (default: the filtered and sorted rows of all pages) */ selectionOnly?: boolean; + /** `leaves`: a TreeTable only with the rows without children (default: the table's `exportRows`) */ + rows?: 'all' | 'leaves'; /** File name without ".xlsx" (exportXlsx, default: `exportFilename`) */ filename?: string; /** Name of the worksheet (default: the caption) */ @@ -287,6 +291,8 @@ export interface DataTablePrintOptions { title?: string; /** Only the selected rows */ selectionOnly?: boolean; + /** `leaves`: a TreeTable only with the rows without children (default: the table's `exportRows`) */ + rows?: 'all' | 'leaves'; } /** The selected range of cells (`cellSelection`) */ From cde024ddc9bacfee795753f4b64a73a49c96057d Mon Sep 17 00:00:00 2001 From: Florian Laabs Date: Sat, 28 Nov 2026 03:22:58 +0100 Subject: [PATCH 6/8] feat(form): useUnsavedChanges - one question before leaving unsaved input There was no building block that asks before a page with unsaved form input is left (route change, reload, closing the tab). Apps built it from a router guard, beforeunload and confirm(); several forms on a page then easily asked several times. - useUnsavedChanges(isDirty, { message? }) in the Vue and React form subpaths; all forms share one list: one confirm() however many changed, beforeunload only while one is changed, unregistered on unmount - Router independent: unsavedChangesGuard(to, from) (Vue Router: router.beforeEach), only the query or hash changing does not ask; confirmLeave() for own links - Text unsavedChanges.leave in every language; docs with TanStack Form (!state.isDefaultValue, form.reset(values) after saving) - Tests: two changed forms ask once, cancel stays, query change, no changes, beforeunload, unmount Signed-off-by: Florian Laabs --- .changeset/unsaved-changes.md | 12 +++++ apps/storybook/src/Introduction.mdx | 19 +++++++ packages/mcp/data/components.json | 61 ++++++++++++++++++++- packages/parity/src/form-patterns.test.ts | 65 +++++++++++++++++++++++ packages/react/src/form/index.ts | 3 ++ packages/react/src/form/unsaved.ts | 30 +++++++++++ packages/recipes/src/i18n.ts | 2 + packages/recipes/src/index.ts | 1 + packages/recipes/src/locales/ar.ts | 1 + packages/recipes/src/locales/cs.ts | 1 + packages/recipes/src/locales/de.ts | 2 + packages/recipes/src/locales/es.ts | 1 + packages/recipes/src/locales/fr.ts | 1 + packages/recipes/src/locales/hu.ts | 1 + packages/recipes/src/locales/it.ts | 1 + packages/recipes/src/locales/lv.ts | 1 + packages/recipes/src/locales/nl.ts | 1 + packages/recipes/src/locales/pl.ts | 1 + packages/recipes/src/locales/pt-BR.ts | 1 + packages/recipes/src/locales/pt.ts | 1 + packages/recipes/src/locales/tr.ts | 1 + packages/recipes/src/unsaved.ts | 50 +++++++++++++++++ packages/vue/src/form/index.ts | 3 ++ packages/vue/src/form/unsaved.ts | 22 ++++++++ 24 files changed, 281 insertions(+), 1 deletion(-) create mode 100644 .changeset/unsaved-changes.md create mode 100644 packages/react/src/form/unsaved.ts create mode 100644 packages/recipes/src/unsaved.ts create mode 100644 packages/vue/src/form/unsaved.ts diff --git a/.changeset/unsaved-changes.md b/.changeset/unsaved-changes.md new file mode 100644 index 00000000..73b48fa1 --- /dev/null +++ b/.changeset/unsaved-changes.md @@ -0,0 +1,12 @@ +--- +'@wirecore/wirelayer-recipes': minor +'@wirecore/wirelayer-vue': minor +'@wirecore/wirelayer-react': minor +--- + +Forms: `useUnsavedChanges(isDirty, { message? })` in `@wirecore/wirelayer-vue/form` and `@wirecore/wirelayer-react/form` +asks before the page is left with unsaved input. All registered forms share one list – leaving asks once with +`confirm()` however many forms changed; `beforeunload` only while one is changed; unmounting unregisters. Router +independent: `unsavedChangesGuard(to, from)` goes into the router (Vue Router: `router.beforeEach(unsavedChangesGuard)`), +only the query or hash changing does not ask; `confirmLeave()` for own links. New text `unsavedChanges.leave` in every +language. diff --git a/apps/storybook/src/Introduction.mdx b/apps/storybook/src/Introduction.mdx index 3f240fd9..96684e26 100644 --- a/apps/storybook/src/Introduction.mdx +++ b/apps/storybook/src/Introduction.mdx @@ -386,6 +386,25 @@ const columns: DataTableColumn[] = [ The React Native DataTable has no column menu: a column with `hidden` is not shown there. +## Forms: unsaved changes + +`useUnsavedChanges(isDirty)` from `@wirecore/wirelayer-vue/form` (React: the hook of the same name from +`@wirecore/wirelayer-react/form`) asks before the page is left with unsaved input. Reload, closing the tab or another +address get the browser's own question; route changes ask once with `confirm()` – put `unsavedChangesGuard` into the +router. All forms of the page share one list, so two changed forms still ask once; a form unregisters when it unmounts. +Only the query or the hash changing does not ask. The text comes from the WireLayer translations (`unsavedChanges.leave`), +`{ message }` overrides it; `confirmLeave()` asks the same for own links and buttons. + +```ts +// Each settings form (TanStack Form): changed while the values differ from the defaults +useUnsavedChanges(() => !form.state.isDefaultValue); +// After a successful save: the saved values become the defaults again +form.reset(values); + +// Once, where the router is created (Vue Router; React Router: useBlocker with the same guard) +router.beforeEach(unsavedChangesGuard); +``` + ## AI assistants (MCP, llms.txt) So that Claude, Cursor and others use the components correctly, the API is available as text and as an MCP server: diff --git a/packages/mcp/data/components.json b/packages/mcp/data/components.json index c0e1d3a6..00290deb 100644 --- a/packages/mcp/data/components.json +++ b/packages/mcp/data/components.json @@ -9563,6 +9563,12 @@ "optional": true, "description": "Shows an export button; the CSV has the filtered and sorted rows of all pages (or the selection)" }, + { + "name": "exportRows", + "type": "'all' | 'leaves'", + "optional": true, + "description": "Rows of the CSV, Excel and print: `all` (default) or `leaves` – a TreeTable without the rows that have children (`getSubRows`), e.g. when a parent only sums up its children; still filtered and sorted like the table. The methods take it as option `rows`; `selectionOnly` is not affected" + }, { "name": "csvSeparator", "type": "string", @@ -10280,6 +10286,12 @@ "optional": true, "description": "Shows an export button; the CSV has the filtered and sorted rows of all pages (or the selection)" }, + { + "name": "exportRows", + "type": "'all' | 'leaves'", + "optional": true, + "description": "Rows of the CSV, Excel and print: `all` (default) or `leaves` – a TreeTable without the rows that have children (`getSubRows`), e.g. when a parent only sums up its children; still filtered and sorted like the table. The methods take it as option `rows`; `selectionOnly` is not affected" + }, { "name": "csvSeparator", "type": "string", @@ -28749,6 +28761,12 @@ "optional": true, "description": "Icon component before the label" }, + { + "name": "label", + "type": "string", + "optional": true, + "description": "Text of the segment without children; with `icon` (and no children) only the icon shows, this names it" + }, { "name": "disabled", "type": "boolean", @@ -28776,6 +28794,12 @@ "optional": true, "description": "Icon component before the label" }, + { + "name": "label", + "type": "string", + "optional": true, + "description": "Text of the segment without the default slot; with `icon` (and no slot) only the icon shows, this names it" + }, { "name": "disabled", "type": "boolean", @@ -37584,6 +37608,11 @@ "subpath": "", "description": "Asks for confirmation in the app-wide . Resolves with true (confirmed) or false (cancelled, Escape, a newer confirm())." }, + { + "name": "confirmLeave", + "subpath": "/form", + "description": "" + }, { "name": "createDataController", "subpath": "/data-table", @@ -37849,6 +37878,11 @@ "subpath": "", "description": "" }, + { + "name": "unsavedChangesGuard", + "subpath": "/form", + "description": "" + }, { "name": "useClipboard", "subpath": "", @@ -38054,6 +38088,11 @@ "subpath": "", "description": "Texts of the nearest LocaleProvider" }, + { + "name": "useUnsavedChanges", + "subpath": "/form", + "description": "Asks before the page is left while `isDirty()` – reload, closing the tab (the browser's question) and, with `unsavedChangesGuard` in the router, route changes. All forms of the page share one question. With TanStack Form: `useUnsavedChanges(() => !form.state.isDefaultValue)`, and `form.reset(values)` after a successful save." + }, { "name": "useValidators", "subpath": "/form", @@ -38149,13 +38188,18 @@ { "id": "introduction-datatable-export-csv-excel", "title": "DataTable export (CSV, Excel)", - "text": "`exportFilename` shows the export button, `exportFormats` picks CSV, Excel (.xlsx) or both; `generateCsv()` and\n`generateXlsx()` return the file instead of downloading it. The export has the filtered and sorted rows of all pages (or\nthe selection) and the visible columns in their current order. Per column: `exportable: false` leaves it out,\n`exportHeader` and `exportValue` replace the name and the value, and `exportColumns` splits it into several columns at\nits position – the table keeps showing one column, and printing too:\n\n```ts\nconst columns: DataTableColumn[] = [\n {\n id: 'name',\n header: 'Name',\n accessor: (row) => `${row.lastName}, ${row.firstName}`, // shown: \"Doe, Jane\"\n exportColumns: [\n { header: 'First name', value: (row) => row.firstName },\n { header: 'Last name', value: (row) => row.lastName },\n ],\n },\n { id: 'club', header: 'Club' },\n];\n// CSV: First name;Last name;Club\n```\n\n`exportColumns` takes precedence over `exportHeader` and `exportValue`. In Excel the aggregate and the footer of a split\ncolumn go to its first part. The React Native DataTable exports the same way." + "text": "`exportFilename` shows the export button, `exportFormats` picks CSV, Excel (.xlsx) or both; `generateCsv()` and\n`generateXlsx()` return the file instead of downloading it. The export has the filtered and sorted rows of all pages (or\nthe selection) and the visible columns in their current order. Per column: `exportable: false` leaves it out,\n`exportHeader` and `exportValue` replace the name and the value, and `exportColumns` splits it into several columns at\nits position – the table keeps showing one column, and printing too:\n\n```ts\nconst columns: DataTableColumn[] = [\n {\n id: 'name',\n header: 'Name',\n accessor: (row) => `${row.lastName}, ${row.firstName}`, // shown: \"Doe, Jane\"\n exportColumns: [\n { header: 'First name', value: (row) => row.firstName },\n { header: 'Last name', value: (row) => row.lastName },\n ],\n },\n { id: 'club', header: 'Club' },\n];\n// CSV: First name;Last name;Club\n```\n\n`exportColumns` takes precedence over `exportHeader` and `exportValue`. In Excel the aggregate and the footer of a split\ncolumn go to its first part. The React Native DataTable exports the same way.\n\nA TreeTable (`getSubRows`) exports all its rows by default. With `exportRows=\"leaves\"` the CSV, Excel and print only\nhave the rows without children – for parents that just sum up their children (\"Doe, Jane – 2 licences\"); still\nfiltered and sorted like the table (with `treeFilterMode=\"lenient\"` only the leaves that match themselves). The methods\ntake it as option: `generateCsv({ rows: 'leaves' })`. The selection (`selectionOnly`) is exported as it is." }, { "id": "introduction-datatable-hidden-columns-and-saved-state", "title": "DataTable: hidden columns and saved state", "text": "A column with `hidden: true` starts hidden; the column menu (`columnToggle`) shows it. Hidden columns are neither\nexported nor printed. `hiddenColumns` (v-model) sets the hidden columns of the whole table – while it is set, its value\ndecides alone and `hidden` is not used. `hideable: false` wins over `hidden` (with a warning in development).\n\n`stateKey` saves sorting, filters, widths, order and the hidden columns in the browser (`stateStorage`: session or\nlocal) and restores them on the next visit; `stateExclude` leaves parts out. The saved state also lists the columns it\nknows (`knownColumns`): for those the user's choice stays, a column added later starts with its `hidden` value – an\noptional column does not suddenly appear for users with a saved state. A state saved before (without `knownColumns`)\ntreats every column with `hidden` as new.\n\n```ts\nconst columns: DataTableColumn[] = [\n { id: 'name', header: 'Name', accessor: (row) => `${row.lastName}, ${row.firstName}` },\n { id: 'firstName', header: 'First name', sortable: true, hidden: true, exportable: false },\n { id: 'lastName', header: 'Last name', sortable: true, hidden: true, exportable: false },\n];\n```\n\nThe React Native DataTable has no column menu: a column with `hidden` is not shown there." }, + { + "id": "introduction-forms-unsaved-changes", + "title": "Forms: unsaved changes", + "text": "`useUnsavedChanges(isDirty)` from `@wirecore/wirelayer-vue/form` (React: the hook of the same name from\n`@wirecore/wirelayer-react/form`) asks before the page is left with unsaved input. Reload, closing the tab or another\naddress get the browser's own question; route changes ask once with `confirm()` – put `unsavedChangesGuard` into the\nrouter. All forms of the page share one list, so two changed forms still ask once; a form unregisters when it unmounts.\nOnly the query or the hash changing does not ask. The text comes from the WireLayer translations (`unsavedChanges.leave`),\n`{ message }` overrides it; `confirmLeave()` asks the same for own links and buttons.\n\n```ts\n// Each settings form (TanStack Form): changed while the values differ from the defaults\nuseUnsavedChanges(() => !form.state.isDefaultValue);\n// After a successful save: the saved values become the defaults again\nform.reset(values);\n\n// Once, where the router is created (Vue Router; React Router: useBlocker with the same guard)\nrouter.beforeEach(unsavedChangesGuard);\n```" + }, { "id": "introduction-ai-assistants-mcp-llms-txt", "title": "AI assistants (MCP, llms.txt)", @@ -52223,6 +52267,11 @@ "subpath": "", "description": "Asks for confirmation in the app-wide . Resolves with true (confirmed) or false (cancelled, Escape, a newer confirm())." }, + { + "name": "confirmLeave", + "subpath": "/form", + "description": "" + }, { "name": "createDataController", "subpath": "/data-table", @@ -52493,6 +52542,11 @@ "subpath": "", "description": "" }, + { + "name": "unsavedChangesGuard", + "subpath": "/form", + "description": "" + }, { "name": "useClipboard", "subpath": "", @@ -52698,6 +52752,11 @@ "subpath": "", "description": "Texts of the nearest LocaleProvider; `const t = translations.dataTable` stays current, too" }, + { + "name": "useUnsavedChanges", + "subpath": "/form", + "description": "Asks before the page is left while `isDirty()` – reload, closing the tab (the browser's question) and, with `unsavedChangesGuard` in the router, route changes. All forms of the page share one question. With TanStack Form: `useUnsavedChanges(() => !form.state.isDefaultValue)`, and `form.reset(values)` after a successful save." + }, { "name": "useValidators", "subpath": "/form", diff --git a/packages/parity/src/form-patterns.test.ts b/packages/parity/src/form-patterns.test.ts index d5ffd05e..517de432 100644 --- a/packages/parity/src/form-patterns.test.ts +++ b/packages/parity/src/form-patterns.test.ts @@ -368,3 +368,68 @@ describe.each(frameworks)('%s', (framework) => { await waitFor(() => expect(onComplete).toHaveBeenCalled()); }); }); + +describe.each(frameworks)('%s useUnsavedChanges', (framework) => { + const forms = framework === 'vue' ? VueForm : ReactForm; + /** Forms side by side, each changed or not */ + const mountForms = (dirty: boolean[]) => { + if (framework === 'vue') { + const Form = defineComponent({ + props: { dirty: Boolean }, + setup(props) { + VueForm.useUnsavedChanges(() => props.dirty); + return () => h('form'); + }, + }); + return renderVue( + defineComponent({ + setup: () => () => + h( + 'div', + dirty.map((value) => h(Form, { dirty: value })) + ), + }) + ); + } + function Form({ dirty: value }: { dirty: boolean }) { + ReactForm.useUnsavedChanges(() => value); + return createElement('form'); + } + return renderReact( + createElement('div', {}, ...dirty.map((value, index) => createElement(Form, { key: index, dirty: value }))) + ); + }; + const unloadPrevented = () => { + const event = new Event('beforeunload', { cancelable: true }); + window.dispatchEvent(event); + return event.defaultPrevented; + }; + + it('two changed forms ask once; cancel keeps the page; only the query changing does not ask', () => { + const confirm = vi.spyOn(window, 'confirm').mockReturnValue(false); + mountForms([true, true]); + expect(forms.unsavedChangesGuard({ path: '/settings' }, { path: '/profile' })).toBe(false); + expect(confirm).toHaveBeenCalledTimes(1); + expect(confirm).toHaveBeenCalledWith('You have unsaved changes. Leave this page anyway?'); + // Same path, other query (Vue Router's path has no query) + expect(forms.unsavedChangesGuard({ path: '/profile' }, { path: '/profile' })).toBe(true); + expect(confirm).toHaveBeenCalledTimes(1); + confirm.mockReturnValue(true); + expect(forms.unsavedChangesGuard({ pathname: '/settings' }, { pathname: '/profile' })).toBe(true); + confirm.mockRestore(); + }); + + it('without changes nothing asks; beforeunload only while a form is changed; unmounting unregisters', () => { + const confirm = vi.spyOn(window, 'confirm'); + const clean = mountForms([false]); + expect(forms.unsavedChangesGuard({ path: '/a' }, { path: '/b' })).toBe(true); + expect(confirm).not.toHaveBeenCalled(); + expect(unloadPrevented()).toBe(false); + clean.unmount(); + const changed = mountForms([true]); + expect(unloadPrevented()).toBe(true); + changed.unmount(); + expect(unloadPrevented()).toBe(false); + confirm.mockRestore(); + }); +}); diff --git a/packages/react/src/form/index.ts b/packages/react/src/form/index.ts index a557656c..04eeddb7 100644 --- a/packages/react/src/form/index.ts +++ b/packages/react/src/form/index.ts @@ -6,6 +6,9 @@ export { FormField, type FormFieldProps } from './FormField.js'; export { FormList, FormList as FieldArray, type FormListItemProps, type FormListProps } from './FormList.js'; export { KeyValueEditor, type KeyValueEditorProps, type KeyValuePair } from './KeyValueEditor.js'; export { useValidators, validateFields } from './validators.js'; +export { useUnsavedChanges, type UnsavedChangesOptions } from './unsaved.js'; +/** One question before leaving a page with unsaved input – the guard goes into the router */ +export { confirmLeave, unsavedChangesGuard, type UnsavedChangesRoute } from '@wirecore/wirelayer-recipes'; /** Validators with translated messages – also Standard Schemas, so TanStack Form takes them directly */ export { combineValidators, diff --git a/packages/react/src/form/unsaved.ts b/packages/react/src/form/unsaved.ts new file mode 100644 index 00000000..0573e131 --- /dev/null +++ b/packages/react/src/form/unsaved.ts @@ -0,0 +1,30 @@ +import { registerUnsavedChanges } from '@wirecore/wirelayer-recipes'; +import { useEffect, useRef } from 'react'; +import { useTranslations } from '../components/LocaleProvider/LocaleProvider.js'; + +export interface UnsavedChangesOptions { + /** Question before leaving (default: the WireLayer text of the language) */ + message?: string; +} + +/** + * Asks before the page is left while `isDirty()` – reload, closing the tab (the browser's question) and, with + * `unsavedChangesGuard` in the router, route changes. All forms of the page share one question. With TanStack Form: + * `useUnsavedChanges(() => !form.state.isDefaultValue)`, and `form.reset(values)` after a successful save. + */ +export function useUnsavedChanges(isDirty: () => boolean, options: UnsavedChangesOptions = {}) { + const translations = useTranslations(); + const message = options.message ?? translations.unsavedChanges.leave; + const latest = useRef({ isDirty, message }); + useEffect(() => { + latest.current = { isDirty, message }; + }); + useEffect( + () => + registerUnsavedChanges( + () => latest.current.isDirty(), + () => latest.current.message + ), + [] + ); +} diff --git a/packages/recipes/src/i18n.ts b/packages/recipes/src/i18n.ts index e45dcc3d..2c27dc69 100644 --- a/packages/recipes/src/i18n.ts +++ b/packages/recipes/src/i18n.ts @@ -157,6 +157,8 @@ const en: Translations = { }, splitButton: { more: 'More actions' }, confirmPopup: { confirm: 'Yes', cancel: 'Cancel' }, + /** Asked before leaving a page with unsaved form input (useUnsavedChanges) */ + unsavedChanges: { leave: 'You have unsaved changes. Leave this page anyway?' }, passwordStrength: { levels: ['Too short', 'Weak', 'Fair', 'Good', 'Strong'], label: (level) => `Password strength: ${level}`, diff --git a/packages/recipes/src/index.ts b/packages/recipes/src/index.ts index a5704d1b..63367fec 100644 --- a/packages/recipes/src/index.ts +++ b/packages/recipes/src/index.ts @@ -1172,3 +1172,4 @@ export { ganttBarPercent, ganttExtent, stepProgress } from './gantt.js'; export { commandGroups, filterCommands, type CommandSearchItem } from './utils.js'; export { FLIP_KEY_ATTRIBUTE, flipRelease, flipSync } from './flip.js'; export { SUBMENU_GUTTER } from './navigation.js'; +export { confirmLeave, registerUnsavedChanges, unsavedChangesGuard, type UnsavedChangesRoute } from './unsaved.js'; diff --git a/packages/recipes/src/locales/ar.ts b/packages/recipes/src/locales/ar.ts index e295565b..f84a3402 100644 --- a/packages/recipes/src/locales/ar.ts +++ b/packages/recipes/src/locales/ar.ts @@ -255,6 +255,7 @@ export const ar: Translations = { }, splitButton: { more: 'مزيد من الإجراءات' }, confirmPopup: { confirm: 'نعم', cancel: 'إلغاء' }, + unsavedChanges: { leave: 'لديك تغييرات غير محفوظة. هل تريد مغادرة الصفحة على أي حال؟' }, passwordStrength: { levels: ['قصيرة جدًا', 'ضعيفة', 'متوسطة', 'جيدة', 'قوية'], label: (level) => `قوة كلمة المرور: ${level}`, diff --git a/packages/recipes/src/locales/cs.ts b/packages/recipes/src/locales/cs.ts index 8fe12b3b..0a43c80a 100644 --- a/packages/recipes/src/locales/cs.ts +++ b/packages/recipes/src/locales/cs.ts @@ -185,6 +185,7 @@ export const cs: Translations = { }, splitButton: { more: 'Další akce' }, confirmPopup: { confirm: 'Ano', cancel: 'Zrušit' }, + unsavedChanges: { leave: 'Máte neuložené změny. Opravdu chcete stránku opustit?' }, passwordStrength: { levels: ['Příliš krátké', 'Slabé', 'Průměrné', 'Dobré', 'Silné'], label: (level) => `Síla hesla: ${level}`, diff --git a/packages/recipes/src/locales/de.ts b/packages/recipes/src/locales/de.ts index 88a9070d..b111b78f 100644 --- a/packages/recipes/src/locales/de.ts +++ b/packages/recipes/src/locales/de.ts @@ -148,6 +148,8 @@ export const de = { }, splitButton: { more: 'Weitere Aktionen' }, confirmPopup: { confirm: 'Ja', cancel: 'Abbrechen' }, + /** Asked before leaving a page with unsaved form input (useUnsavedChanges) */ + unsavedChanges: { leave: 'Es gibt ungespeicherte Änderungen. Seite trotzdem verlassen?' }, passwordStrength: { levels: ['Zu kurz', 'Schwach', 'Mittel', 'Gut', 'Stark'], label: (level: string) => `Passwortstärke: ${level}`, diff --git a/packages/recipes/src/locales/es.ts b/packages/recipes/src/locales/es.ts index 5053e334..110be376 100644 --- a/packages/recipes/src/locales/es.ts +++ b/packages/recipes/src/locales/es.ts @@ -151,6 +151,7 @@ export const es: Translations = { }, splitButton: { more: 'Más acciones' }, confirmPopup: { confirm: 'Sí', cancel: 'Cancelar' }, + unsavedChanges: { leave: 'Hay cambios sin guardar. ¿Salir de la página de todos modos?' }, passwordStrength: { levels: ['Demasiado corta', 'Débil', 'Aceptable', 'Buena', 'Segura'], label: (level) => `Seguridad de la contraseña: ${level}`, diff --git a/packages/recipes/src/locales/fr.ts b/packages/recipes/src/locales/fr.ts index 33dafa5c..4750cb51 100644 --- a/packages/recipes/src/locales/fr.ts +++ b/packages/recipes/src/locales/fr.ts @@ -152,6 +152,7 @@ export const fr: Translations = { }, splitButton: { more: "Plus d'actions" }, confirmPopup: { confirm: 'Oui', cancel: 'Annuler' }, + unsavedChanges: { leave: 'Des modifications ne sont pas enregistrées. Quitter la page quand même\u202f?' }, passwordStrength: { levels: ['Trop court', 'Faible', 'Moyen', 'Bon', 'Fort'], label: (level) => `Force du mot de passe\u00a0: ${level}`, diff --git a/packages/recipes/src/locales/hu.ts b/packages/recipes/src/locales/hu.ts index e983d7e8..e281fc2f 100644 --- a/packages/recipes/src/locales/hu.ts +++ b/packages/recipes/src/locales/hu.ts @@ -177,6 +177,7 @@ export const hu: Translations = { }, splitButton: { more: 'További műveletek' }, confirmPopup: { confirm: 'Igen', cancel: 'Mégse' }, + unsavedChanges: { leave: 'Nem mentett módosítások vannak. Mégis elhagyja az oldalt?' }, passwordStrength: { levels: ['Túl rövid', 'Gyenge', 'Közepes', 'Jó', 'Erős'], label: (level) => `Jelszó erőssége: ${level}`, diff --git a/packages/recipes/src/locales/it.ts b/packages/recipes/src/locales/it.ts index 31de3539..2f5f9411 100644 --- a/packages/recipes/src/locales/it.ts +++ b/packages/recipes/src/locales/it.ts @@ -160,6 +160,7 @@ export const it: Translations = { }, splitButton: { more: 'Altre azioni' }, confirmPopup: { confirm: 'Sì', cancel: 'Annulla' }, + unsavedChanges: { leave: 'Ci sono modifiche non salvate. Uscire comunque dalla pagina?' }, passwordStrength: { levels: ['Troppo corta', 'Debole', 'Media', 'Buona', 'Forte'], label: (level) => `Sicurezza della password: ${level}`, diff --git a/packages/recipes/src/locales/lv.ts b/packages/recipes/src/locales/lv.ts index 1e8c6e14..8ac7d491 100644 --- a/packages/recipes/src/locales/lv.ts +++ b/packages/recipes/src/locales/lv.ts @@ -173,6 +173,7 @@ export const lv: Translations = { }, splitButton: { more: 'Citas darbības' }, confirmPopup: { confirm: 'Jā', cancel: 'Atcelt' }, + unsavedChanges: { leave: 'Ir nesaglabātas izmaiņas. Tomēr pamest lapu?' }, passwordStrength: { levels: ['Pārāk īsa', 'Vāja', 'Vidēja', 'Laba', 'Stipra'], label: (level) => `Paroles stiprums: ${level}`, diff --git a/packages/recipes/src/locales/nl.ts b/packages/recipes/src/locales/nl.ts index 8d08d95d..a1befcd7 100644 --- a/packages/recipes/src/locales/nl.ts +++ b/packages/recipes/src/locales/nl.ts @@ -142,6 +142,7 @@ export const nl: Translations = { }, splitButton: { more: 'Meer acties' }, confirmPopup: { confirm: 'Ja', cancel: 'Annuleren' }, + unsavedChanges: { leave: 'Er zijn niet-opgeslagen wijzigingen. Pagina toch verlaten?' }, passwordStrength: { levels: ['Te kort', 'Zwak', 'Redelijk', 'Goed', 'Sterk'], label: (level) => `Wachtwoordsterkte: ${level}`, diff --git a/packages/recipes/src/locales/pl.ts b/packages/recipes/src/locales/pl.ts index 4407c670..d1558852 100644 --- a/packages/recipes/src/locales/pl.ts +++ b/packages/recipes/src/locales/pl.ts @@ -192,6 +192,7 @@ export const pl: Translations = { }, splitButton: { more: 'Więcej akcji' }, confirmPopup: { confirm: 'Tak', cancel: 'Anuluj' }, + unsavedChanges: { leave: 'Masz niezapisane zmiany. Czy mimo to opuścić stronę?' }, passwordStrength: { levels: ['Za krótkie', 'Słabe', 'Średnie', 'Dobre', 'Silne'], label: (level) => `Siła hasła: ${level}`, diff --git a/packages/recipes/src/locales/pt-BR.ts b/packages/recipes/src/locales/pt-BR.ts index 8b8293d7..8b95a286 100644 --- a/packages/recipes/src/locales/pt-BR.ts +++ b/packages/recipes/src/locales/pt-BR.ts @@ -373,6 +373,7 @@ export const ptBR: Translations = { passwordRequired: 'O PDF não pode ser aberto sem senha.', wrappedTop: 'continua a partir do final', }, + unsavedChanges: { leave: 'Há alterações não salvas. Sair da página mesmo assim?' }, }; export default ptBR; diff --git a/packages/recipes/src/locales/pt.ts b/packages/recipes/src/locales/pt.ts index 57214c5b..fa7aaea6 100644 --- a/packages/recipes/src/locales/pt.ts +++ b/packages/recipes/src/locales/pt.ts @@ -148,6 +148,7 @@ export const pt: Translations = { }, splitButton: { more: 'Mais ações' }, confirmPopup: { confirm: 'Sim', cancel: 'Cancelar' }, + unsavedChanges: { leave: 'Há alterações por guardar. Sair da página mesmo assim?' }, passwordStrength: { levels: ['Demasiado curta', 'Fraca', 'Razoável', 'Boa', 'Forte'], label: (level) => `Força da palavra-passe: ${level}`, diff --git a/packages/recipes/src/locales/tr.ts b/packages/recipes/src/locales/tr.ts index f597631d..a7872c40 100644 --- a/packages/recipes/src/locales/tr.ts +++ b/packages/recipes/src/locales/tr.ts @@ -134,6 +134,7 @@ export const tr: Translations = { }, splitButton: { more: 'Diğer işlemler' }, confirmPopup: { confirm: 'Evet', cancel: 'İptal' }, + unsavedChanges: { leave: 'Kaydedilmemiş değişiklikler var. Yine de sayfadan çıkılsın mı?' }, passwordStrength: { levels: ['Çok kısa', 'Zayıf', 'Orta', 'İyi', 'Güçlü'], label: (level) => `Şifre gücü: ${level}`, diff --git a/packages/recipes/src/unsaved.ts b/packages/recipes/src/unsaved.ts new file mode 100644 index 00000000..c492e910 --- /dev/null +++ b/packages/recipes/src/unsaved.ts @@ -0,0 +1,50 @@ +// Unsaved form input: one shared list of the forms on the page, so leaving asks once however many forms changed + +interface UnsavedForm { + isDirty: () => boolean; + message: () => string; +} +const forms = new Set(); +const dirtyForm = () => [...forms].find((form) => form.isDirty()); + +// Reload, closing the tab, typing another address: the browser asks with its own text +const onBeforeUnload = (event: BeforeUnloadEvent) => { + if (!dirtyForm()) return; + event.preventDefault(); + // Older browsers ask only with returnValue set + event.returnValue = ''; +}; + +/** + * Registers a form whose input may be unsaved (`isDirty`); `message` is the question before leaving. Returns the + * function that unregisters it. Used by `useUnsavedChanges`; browser only. + */ +export function registerUnsavedChanges(isDirty: () => boolean, message: () => string): () => void { + const form = { isDirty, message }; + if (!forms.size) window.addEventListener('beforeunload', onBeforeUnload); + forms.add(form); + return () => { + forms.delete(form); + if (!forms.size) window.removeEventListener('beforeunload', onBeforeUnload); + }; +} + +/** Whether to leave: true without unsaved input, else the answer to one `confirm()` – for own links and buttons */ +export function confirmLeave(): boolean { + const form = dirtyForm(); + return !form || window.confirm(form.message()); +} + +/** A route as Vue Router (`path`) or React Router (`pathname`) passes it */ +export interface UnsavedChangesRoute { + path?: string; + pathname?: string; +} + +/** + * Router guard: leaving the page with unsaved input asks once (`confirmLeave`); false keeps the page. Only the query + * or the hash changing does not ask. Vue Router: `router.beforeEach(unsavedChangesGuard)`. + */ +export function unsavedChangesGuard(to: UnsavedChangesRoute, from: UnsavedChangesRoute): boolean { + return (to.path ?? to.pathname) === (from.path ?? from.pathname) || confirmLeave(); +} diff --git a/packages/vue/src/form/index.ts b/packages/vue/src/form/index.ts index 88318524..be397dce 100644 --- a/packages/vue/src/form/index.ts +++ b/packages/vue/src/form/index.ts @@ -6,6 +6,9 @@ export { default as FormField, type FormFieldProps } from './FormField.vue'; export { default as FormList, default as FieldArray, type FormListProps } from './FormList.vue'; export { default as KeyValueEditor, type KeyValueEditorProps, type KeyValuePair } from './KeyValueEditor.vue'; export { useValidators, validateFields } from './validators.js'; +export { useUnsavedChanges, type UnsavedChangesOptions } from './unsaved.js'; +/** One question before leaving a page with unsaved input – the guard goes into the router */ +export { confirmLeave, unsavedChangesGuard, type UnsavedChangesRoute } from '@wirecore/wirelayer-recipes'; /** Validators with translated messages – also Standard Schemas, so TanStack Form takes them directly */ export { combineValidators, diff --git a/packages/vue/src/form/unsaved.ts b/packages/vue/src/form/unsaved.ts new file mode 100644 index 00000000..7dc4befa --- /dev/null +++ b/packages/vue/src/form/unsaved.ts @@ -0,0 +1,22 @@ +import { registerUnsavedChanges } from '@wirecore/wirelayer-recipes'; +import { onBeforeUnmount, onMounted } from 'vue'; +import { useTranslations } from '../locale.js'; + +export interface UnsavedChangesOptions { + /** Question before leaving (default: the WireLayer text of the language) */ + message?: string; +} + +/** + * Asks before the page is left while `isDirty()` – reload, closing the tab (the browser's question) and, with + * `unsavedChangesGuard` in the router, route changes. All forms of the page share one question. With TanStack Form: + * `useUnsavedChanges(() => !form.state.isDefaultValue)`, and `form.reset(values)` after a successful save. + */ +export function useUnsavedChanges(isDirty: () => boolean, options: UnsavedChangesOptions = {}) { + const translations = useTranslations(); + let unregister = () => {}; + onMounted(() => { + unregister = registerUnsavedChanges(isDirty, () => options.message ?? translations.unsavedChanges.leave); + }); + onBeforeUnmount(() => unregister()); +} From 527280e67557145650c5728accd5d9c51aa95cc2 Mon Sep 17 00:00:00 2001 From: Florian Laabs Date: Sat, 28 Nov 2026 03:27:29 +0100 Subject: [PATCH 7/8] fix(fields): outline-solid with every new field focus ring In several field slots outline-none and the focus border sit in different strings of the same slot (Select, MultiSelect, TreeSelect and Tree search, Listbox, NativeSelect, PinInput, ColorPicker inputs), so the new ring kept the style none - the focus ring test in CI caught it. Every new field ring now sets outline-solid with its width. Signed-off-by: Florian Laabs --- packages/recipes/src/app.ts | 2 +- packages/recipes/src/chat.ts | 2 +- packages/recipes/src/controls.ts | 4 ++-- packages/recipes/src/editor.ts | 2 +- packages/recipes/src/extras.ts | 2 +- packages/recipes/src/field.ts | 2 +- packages/recipes/src/hierarchy.ts | 6 +++--- packages/recipes/src/inputs.ts | 10 +++++----- packages/recipes/src/navigation.ts | 2 +- packages/recipes/src/widgets.ts | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/recipes/src/app.ts b/packages/recipes/src/app.ts index 17f46942..4b9b0863 100644 --- a/packages/recipes/src/app.ts +++ b/packages/recipes/src/app.ts @@ -139,7 +139,7 @@ export const tagsInput = tv({ base: 'relative flex w-full flex-col', control: [ 'flex min-h-[var(--wc-control-h-md,2.5rem)] w-full flex-wrap items-center gap-1.5 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg px-2 py-1.5 text-fg', - 'transition-colors focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary motion-reduce:transition-none', + 'transition-colors focus-within:border-primary focus-within:outline-2 focus-within:outline-solid focus-within:-outline-offset-3 focus-within:outline-primary motion-reduce:transition-none', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2', ], item: 'inline-flex', diff --git a/packages/recipes/src/chat.ts b/packages/recipes/src/chat.ts index fc598b54..af76f56f 100644 --- a/packages/recipes/src/chat.ts +++ b/packages/recipes/src/chat.ts @@ -88,7 +88,7 @@ export const chatPrompt = tv({ slots: { base: [ 'flex w-full flex-col gap-2 rounded-xl border border-line-strong bg-bg p-2 transition-colors motion-reduce:transition-none', - 'focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary data-disabled:bg-bg-2', + 'focus-within:border-primary focus-within:outline-2 focus-within:outline-solid focus-within:-outline-offset-3 focus-within:outline-primary data-disabled:bg-bg-2', ], textarea: [ 'block max-h-[var(--wc-prompt-max)] min-h-10 w-full resize-none overflow-y-auto bg-transparent px-2 py-2 text-[15px] leading-6 text-fg outline-none', diff --git a/packages/recipes/src/controls.ts b/packages/recipes/src/controls.ts index ee747108..4d859cc5 100644 --- a/packages/recipes/src/controls.ts +++ b/packages/recipes/src/controls.ts @@ -12,7 +12,7 @@ export const listbox = tv({ label: 'text-[13px] font-medium text-fg', content: [ 'flex max-h-72 flex-col overflow-y-auto rounded-lg border border-line-strong bg-bg p-1 text-fg outline-none', - 'focus-visible:border-primary focus-visible:outline-2 focus-visible:-outline-offset-3 focus-visible:outline-primary data-disabled:opacity-60', + 'focus-visible:border-primary focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-3 focus-visible:outline-primary data-disabled:opacity-60', ], item: listboxOption, icon: 'size-4 shrink-0 text-muted', @@ -21,7 +21,7 @@ export const listbox = tv({ /** Search field above the list (filter) */ search: [ 'h-8 w-full min-w-0 rounded-md border border-line-strong bg-bg px-2.5 text-sm text-fg outline-none', - 'placeholder:text-muted focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary disabled:cursor-not-allowed disabled:opacity-60', + 'placeholder:text-muted focus:border-primary focus:outline-2 focus:outline-solid focus:-outline-offset-3 focus:outline-primary disabled:cursor-not-allowed disabled:opacity-60', ], /** Check box before the label (`checkboxes`) */ check: [ diff --git a/packages/recipes/src/editor.ts b/packages/recipes/src/editor.ts index 772f30ea..e35f8b9b 100644 --- a/packages/recipes/src/editor.ts +++ b/packages/recipes/src/editor.ts @@ -51,7 +51,7 @@ export const editor = tv({ slots: { base: [ 'flex w-full flex-col overflow-hidden rounded-lg border border-line-strong bg-bg transition-colors motion-reduce:transition-none', - 'focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary data-invalid:border-danger data-disabled:bg-bg-2', + 'focus-within:border-primary focus-within:outline-2 focus-within:outline-solid focus-within:-outline-offset-3 focus-within:outline-primary data-invalid:border-danger data-disabled:bg-bg-2', ], toolbar: 'flex flex-wrap items-center gap-0.5 border-b border-line p-1', // 32 × 32 px targets; aria-pressed shows the formatting at the cursor diff --git a/packages/recipes/src/extras.ts b/packages/recipes/src/extras.ts index b62ae1ff..2454d918 100644 --- a/packages/recipes/src/extras.ts +++ b/packages/recipes/src/extras.ts @@ -111,7 +111,7 @@ export const nativeSelect = tv({ base: 'relative flex w-full', select: [ 'h-[var(--wc-control-h-md,2.5rem)] w-full cursor-pointer appearance-none rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg pe-9 ps-3 text-[length:var(--wc-control-text-md,15px)] text-fg outline-none', - 'transition-colors focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary motion-reduce:transition-none', + 'transition-colors focus:border-primary focus:outline-2 focus:outline-solid focus:-outline-offset-3 focus:outline-primary motion-reduce:transition-none', 'aria-[invalid=true]:border-danger disabled:cursor-not-allowed disabled:border-line disabled:bg-bg-2 disabled:text-muted', ], icon: 'pointer-events-none absolute top-1/2 inset-e-3 size-4 -translate-y-1/2 text-muted', diff --git a/packages/recipes/src/field.ts b/packages/recipes/src/field.ts index 896abcab..d6d5fee7 100644 --- a/packages/recipes/src/field.ts +++ b/packages/recipes/src/field.ts @@ -33,7 +33,7 @@ export const inputStatusParts = { export const input = tv({ slots: { - base: 'flex w-full items-stretch overflow-hidden border border-line-strong bg-bg text-fg transition-colors focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary motion-reduce:transition-none', + base: 'flex w-full items-stretch overflow-hidden border border-line-strong bg-bg text-fg transition-colors focus-within:border-primary focus-within:outline-2 focus-within:outline-solid focus-within:-outline-offset-3 focus-within:outline-primary motion-reduce:transition-none', control: [ 'min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted disabled:cursor-not-allowed', // The browser's own clear button of type="search" (DataTable search …) is a button, too diff --git a/packages/recipes/src/hierarchy.ts b/packages/recipes/src/hierarchy.ts index 3ecefb8a..dc6ea6df 100644 --- a/packages/recipes/src/hierarchy.ts +++ b/packages/recipes/src/hierarchy.ts @@ -53,7 +53,7 @@ export const tree = tv({ toolbar: 'flex flex-wrap items-center gap-1.5', search: [ 'h-8 min-w-0 flex-1 rounded-md border border-line-strong bg-bg px-2.5 text-sm text-fg outline-none', - 'placeholder:text-muted focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary [&::-webkit-search-cancel-button]:cursor-pointer', + 'placeholder:text-muted focus:border-primary focus:outline-2 focus:outline-solid focus:-outline-offset-3 focus:outline-primary [&::-webkit-search-cancel-button]:cursor-pointer', ], /** Row below a branch while its children load (indented like its children) */ loadingRow: 'flex h-8 items-center gap-2 pe-2 ps-[calc(var(--depth)*20px+32px)] text-sm text-muted', @@ -185,7 +185,7 @@ export function treeDropMove( const chipParts = { chipsControl: [ 'relative flex min-h-10 w-full flex-wrap items-center gap-1 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg py-[5px] pe-2.5 ps-1.5 text-fg', - 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary data-[state=open]:border-primary', + 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:outline-solid focus-within:-outline-offset-3 focus-within:outline-primary data-[state=open]:border-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ], chipsTrigger: [ @@ -341,7 +341,7 @@ export const cascadeSelect = tv({ /** Search field (filter): the field itself, the levels button at its end */ searchControl: [ 'flex h-10 w-full items-center gap-1 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg pe-1 ps-3 text-[15px] text-fg', - 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary', + 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:outline-solid focus-within:-outline-offset-3 focus-within:outline-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ], searchInput: diff --git a/packages/recipes/src/inputs.ts b/packages/recipes/src/inputs.ts index 29b2902c..d4bc698e 100644 --- a/packages/recipes/src/inputs.ts +++ b/packages/recipes/src/inputs.ts @@ -8,7 +8,7 @@ import { tv } from './tv.js'; /** The bordered box around a text control – like Input */ const box = [ 'flex w-full items-stretch overflow-hidden rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg text-fg', - 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary', + 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:outline-solid focus-within:-outline-offset-3 focus-within:outline-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ]; const boxInput = @@ -204,7 +204,7 @@ export const multiSelect = tv({ control: 'relative flex', chipsControl: [ 'relative flex min-h-[var(--wc-control-h-md,2.5rem)] w-full flex-wrap items-center gap-1 rounded-[var(--wc-control-radius-md,0.5rem)] border border-line-strong bg-bg py-[5px] pe-2.5 ps-1.5 text-fg', - 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary data-[state=open]:border-primary', + 'transition-colors motion-reduce:transition-none focus-within:border-primary focus-within:outline-2 focus-within:outline-solid focus-within:-outline-offset-3 focus-within:outline-primary data-[state=open]:border-primary', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ], /** The trigger next to the chips: fills the rest of the row, no border of its own */ @@ -608,7 +608,7 @@ export const pinInput = tv({ control: 'flex gap-2', input: [ 'size-11 rounded-lg border border-line-strong bg-bg text-center font-mono text-lg text-fg outline-none', - 'transition-colors motion-reduce:transition-none focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary placeholder:text-muted', + 'transition-colors motion-reduce:transition-none focus:border-primary focus:outline-2 focus:outline-solid focus:-outline-offset-3 focus:outline-primary placeholder:text-muted', 'data-invalid:border-danger data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2 data-disabled:text-muted', ], }, @@ -711,7 +711,7 @@ export const colorPicker = tv({ row: 'flex items-center gap-2', input: [ 'h-8 min-w-0 flex-1 rounded-md border border-line-strong bg-bg px-2 font-mono text-[13px] text-fg uppercase outline-none', - 'focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary', + 'focus:border-primary focus:outline-2 focus:outline-solid focus:-outline-offset-3 focus:outline-primary', ], swatches: 'flex flex-wrap gap-1.5', swatchFill: 'size-full rounded-md', @@ -739,7 +739,7 @@ export const colorPicker = tv({ channelLabel: 'font-mono text-[10px] text-muted uppercase', channelInput: [ 'h-8 w-full min-w-0 rounded-md border border-line-strong bg-bg px-1.5 text-center font-mono text-[13px] text-fg tabular-nums outline-none', - 'focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary', + 'focus:border-primary focus:outline-2 focus:outline-solid focus:-outline-offset-3 focus:outline-primary', ], /** ColorInput: the swatch button before the text field */ inputTrigger: [ diff --git a/packages/recipes/src/navigation.ts b/packages/recipes/src/navigation.ts index 897a8eb4..1b1c5be1 100644 --- a/packages/recipes/src/navigation.ts +++ b/packages/recipes/src/navigation.ts @@ -47,7 +47,7 @@ export const listboxPanel = { header: 'sticky top-0 z-[1] -mx-1 -mt-1 mb-1 flex flex-col gap-1 border-b border-line bg-card p-1', search: [ 'h-8 w-full min-w-0 shrink-0 rounded-md border border-line-strong bg-bg px-2.5 text-sm text-fg outline-none', - 'placeholder:text-muted focus:border-primary focus:outline-2 focus:-outline-offset-3 focus:outline-primary', + 'placeholder:text-muted focus:border-primary focus:outline-2 focus:outline-solid focus:-outline-offset-3 focus:outline-primary', ], list: 'flex flex-col outline-none', }; diff --git a/packages/recipes/src/widgets.ts b/packages/recipes/src/widgets.ts index a7ebaee1..a1c3562d 100644 --- a/packages/recipes/src/widgets.ts +++ b/packages/recipes/src/widgets.ts @@ -221,7 +221,7 @@ export const mentions = tv({ base: 'relative flex w-full flex-col', control: [ 'relative w-full rounded-lg border border-line-strong bg-bg transition-colors motion-reduce:transition-none', - 'focus-within:border-primary focus-within:outline-2 focus-within:-outline-offset-3 focus-within:outline-primary data-invalid:border-danger', + 'focus-within:border-primary focus-within:outline-2 focus-within:outline-solid focus-within:-outline-offset-3 focus-within:outline-primary data-invalid:border-danger', 'data-disabled:cursor-not-allowed data-disabled:border-line data-disabled:bg-bg-2', ], highlighter: [ From fda7193b703877529fc8a219dbc398fbb4057c6d Mon Sep 17 00:00:00 2001 From: Florian Laabs Date: Sat, 28 Nov 2026 03:36:44 +0100 Subject: [PATCH 8/8] test(visual): reference images for the Icon only, Tree export and Initial focus on a component stories Signed-off-by: Florian Laabs --- ...eact-buttons-segmentedcontrol--icon-only.png | Bin 0 -> 5813 bytes .../react-data-datatable--tree-export.png | Bin 0 -> 25954 bytes ...rlays-dialog--initial-focus-on-component.png | Bin 0 -> 5942 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/parity/e2e/visual/__screenshots__/react-buttons-segmentedcontrol--icon-only.png create mode 100644 packages/parity/e2e/visual/__screenshots__/react-data-datatable--tree-export.png create mode 100644 packages/parity/e2e/visual/__screenshots__/react-overlays-dialog--initial-focus-on-component.png diff --git a/packages/parity/e2e/visual/__screenshots__/react-buttons-segmentedcontrol--icon-only.png b/packages/parity/e2e/visual/__screenshots__/react-buttons-segmentedcontrol--icon-only.png new file mode 100644 index 0000000000000000000000000000000000000000..40d03ff3ebc1e1717ab68ef8008792a14e590030 GIT binary patch literal 5813 zcmeHL`B#(I7X3mhs0h@yHr5KXbwC86t@s#*!?vH1kb=J9i@3YUk z_s0M~Z;Q=4HUj`);d9LEBmh8P1As}>MiVfiEjLjBz}tY2*H@=V1=GV}{|;V|b<8qL zE_9XI-?7~1iuu}y(74h5+409|4^4K>)V_0VcjNxXs(t$#H*WpO?ja}o_=9K1rawvZ zJ9hITd2{~O*+XOEokyO3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2he&HVSBVJh=Ob^|uGUsQ#jcHSa8B(H*v*roz)SUz=P4fhn$~s$(fz#{^_)SxaS zY8ptU+|lHShz^wyNu?KFb3*EVuC_FWa_hEWgbgjC8&9@gN0mk@rWQZdcPdJjZb9eX z+o#1`#+>42^tYCQ*h>ZD<-0iY?ZdV+_HI)Tb1&ZNq41VX?+jj@p}-eBadVtW`H!#d zb$7o^4R6Lie&Z{!UmzEiNtuETj@9q@859VrvBeilpcY4-37jD3&}P*QE-5BD+`GuS z7&wPhO$#XkpZ!|@>1&cYwTxZ~TT+iuye=Jh=1i>stgrISuB($mT6D?5)3*qOtI)Vr zR9Ssd;$K5XBV^s6F|qcYNaWdd8Da1CcR?pumv}TM^wR=L)8bOLwGfnPnk+UtKa8b0 zMFrB^VXJEbjp4(LS~>lW9vP5kY{92UY36lgkstl}udN0HoH$(-41qAhd{3jh+*Os- zVJ3HObiSGoBz?zyy<$p(=?&1Qdh=Wjv0CxHatzzMUn|I+SDI3gX<{`zA?n|tMfOTA zC2h=`<@3N$y?lBz=yzy&+fP%5fWh((@ricon-x{4h(UW@g_S%ziPpI}>`M3AYK2W? zNczo=!~~ZpirP0mBO1{9Tf>?xessvf2D`nL%ajM5+R4~bKg$3apg6+y^vMtolYjOcpm^dKz`c-yPn^sU{Yi^O4 z_)_l9xga5($s#aRw*LC;YAJG`}G=llGs_ZZJH*Qu;jDF7l3yn!%+KZaj z31dfL(3f)Az23L3XtI6Jf@(9->n%Eva( z2WV(i4*|x`K=o^ajB{=sG5c5eQ*m_`Zw&9)bUR)$pHF^G{68pVI+^@&EYM5Pyc; t|GSXeKLP^h=twpaw+MV;qAzWX3}*G**($b>8Q>R&8_=8AORm{G{5ST?wxs|7 literal 0 HcmV?d00001 diff --git a/packages/parity/e2e/visual/__screenshots__/react-overlays-dialog--initial-focus-on-component.png b/packages/parity/e2e/visual/__screenshots__/react-overlays-dialog--initial-focus-on-component.png new file mode 100644 index 0000000000000000000000000000000000000000..a02e16fbf97ce7bac41f6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