Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ React and Vue components are imported from the package root, for example `import

### Compatibility and release caveats

The packages use beta versions. A peer range is a declaration, not a guarantee that every version, bundler, SSR setup, or application combination has been tested. See the [current CI configuration](.github/workflows/ci.yml) for the checks run in this repository.
A peer range is a declaration, not a guarantee that every version, bundler, SSR setup, or application combination has been tested. See the [current CI configuration](.github/workflows/ci.yml) for the checks run in this repository.

The React guide records [packaging caveats from the evaluated source revision](packages/react/README.md#evaluated-source-packaging-caveats), including an entry-point mismatch and the compiler target.

Expand Down
4 changes: 2 additions & 2 deletions docs/core-032-react-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
This note records the UI source audit and focused validation on 2026-10-31,
starting from UI main `2c7c0ba` and core `v0.3.2` (`53200b44`). It is not a
release announcement or a claim that all supported environments have passed.
The core catalog minimum and the installed-artifact compatibility gate now
require 0.3.2. Previously published UI artifacts are unchanged.
At that revision, the core catalog minimum and the installed-artifact
compatibility gate required 0.3.2. Previously published UI artifacts are unchanged.

## Contract change

Expand Down
14 changes: 9 additions & 5 deletions docs/core-compatibility-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ policy remains separately tracked in [core #353](https://github.com/destyler/des
## Current installed-artifact gate

`pnpm test:core-compat` builds the current checkout and pins every resolved
`@destyler/*` package to exact core 0.3.2. The 2026-10-21 reproduction below
`@destyler/*` package to exact core 0.3.3. The 2026-10-21 reproduction below
records published beta.17 with core 0.2.13. A passing current gate shows the
workspace Dialog, Popover, and Menu open-state cases, plus Tabs nullable
selection, against core 0.3.2. It does not publish a package or change registry
selection, against core 0.3.3. It does not publish a package or change registry
dist-tags. See the [React 0.3.2 migration audit](core-032-react-contract.md)
for the snapshot contract, focused evidence and remaining verification limits.

Expand All @@ -26,21 +26,25 @@ Explicitly installed `@destyler-ui/*@0.0.1-beta.17` results:
This result does not prove a React controlled-state failure.

Built and packed main artifacts pass all four Dialog state cases in all four
frameworks (16 cases). The checkout still carries the beta.17 version, so these
frameworks (16 cases). That reproduction checkout carried the beta.17 version, so those
local tarballs are **not** evidence that registry beta.17 has been fixed. Source
migration is already present; do not repeat it or overwrite a published version.
See the [consumer instructions](../scripts/fixtures/core-compat/README.md) for
exact commands and coverage limits. The CI/release gate retains lockfiles and
version records. Other controls are covered by existing suites, not by this new
Dialog-specific gate; this is not an assertion that every beta.17 component fails.

## Release closure, requiring release authorization
## Original beta.17 release-closure checklist

This checklist records the beta.17 replacement plan. The current candidate is
UI 0.0.1 with core 0.3.3; its stable version does not change the verification
requirements below or authorize publication by itself.

1. Run the existing lint, framework type checks, test/SSR suites, packed consumer
checks, and three-browser smoke suite on the candidate commit. Also pass
`pnpm test:core-compat` on the supported Node floor. A focused local pass does
not replace these existing release requirements.
2. Select a new unused beta version for all four UI packages. Review the packed
2. Select a new unused version for all four UI packages. Review the packed
manifests, resolved core minimum, exports, Node engines, and tarball contents.
Do not republish beta.17 or weaken Node >=22.22.3.
3. Publish only the four intended public packages through the existing guarded
Expand Down
2 changes: 1 addition & 1 deletion docs/node-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Restoring Node 20 support is not planned for UI or core.
([destyler/destyler#360](https://github.com/destyler/destyler/pull/360)). See the
[core Node support guide](https://github.com/destyler/destyler/blob/main/document/src/content/guide/node-support.mdx)
for consumer requirements and the separate repository-tooling range.
- The current core 0.3.2 dependency update retains that same Node.js 22.22.3
- The current core 0.3.3 dependency update retains that same Node.js 22.22.3
minimum; it does not broaden or narrow the UI Node support policy.
- These migrations do not change previously published UI or core artifacts.

Expand Down
36 changes: 13 additions & 23 deletions docs/release-scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,19 @@ title alone: the changelog generation step currently allows failure without
blocking npm publication. Neither a successful publish guard nor an npm publish
confirms that these migration notes reached users.

#### Pending note: Svelte Tree branch triggers

Include this breaking-change summary in the next release containing
[#60](https://github.com/destyler/ui/pull/60). No release version is assigned here;
this entry does not claim that the change has been published.

- **Breaking default-element and focus change:** Svelte `Tree.BranchTrigger`
now renders a non-tabbable `div` with `role="button"` instead of a native
`button`. Inside `Tree.BranchControl`, the trigger handles pointer expansion;
the branch control owns keyboard navigation and the tree's roving tab stop.
- **Breaking public-type change:** props and event `currentTarget` types now
describe `HTMLDivElement` rather than `HTMLButtonElement`. Consumers relying
on button-only attributes or native button defaults must use explicit
`asChild` composition and adapt the snippet props to their chosen element's
types.
- Follow the existing [Tree branch triggers migration guide](https://github.com/destyler/ui/blob/main/packages/svelte/README.md#tree-branch-triggers).
Caller-added focusable children or `tabindex` can reintroduce extra tab stops
or nested interactive controls; check keyboard and accessibility behavior in
the composed tree.

Once a release containing this change is confirmed, replace this pending note
with a link to that release's migration notes instead of copying it into every
subsequent release.
#### Published migration: Svelte Tree branch triggers

The Svelte Tree branch-trigger migration was published in
[v0.0.1-beta.20](https://github.com/destyler/ui/releases/tag/v0.0.1-beta.20).
Link those migration notes when preparing the first stable release; this is
not a newly introduced change in 0.0.1.

- `Tree.BranchTrigger` renders a non-tabbable `div` with `role="button"`.
`Tree.BranchControl` owns keyboard navigation and the roving tab stop.
- Public props and event `currentTarget` types describe `HTMLDivElement`.
Consumers needing a different element must use explicit `asChild` composition.
- Follow the [Tree branch triggers migration guide](https://github.com/destyler/ui/blob/main/packages/svelte/README.md#tree-branch-triggers).
Check composed keyboard behavior and avoid extra tab stops or nested controls.

### Publish guard

Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/overview/tabs-nullable-migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Vue's public `modelValue`, `defaultValue`, `valueChange` and `update:modelValue`

## Core dependency boundary

The current lockfile resolves `@destyler/tabs@0.3.2`, which includes the [core correction](https://github.com/destyler/destyler/pull/208) that shipped in 0.2.12 and remains in [core 0.3.2](https://github.com/destyler/destyler/releases/tag/v0.3.2): `clearValue()` and deselectable user activation report `{ value: null }`, and `ValueChangeDetails.value` is `string | null`. This includes clicking the selected trigger and pressing Enter on it in manual activation mode. Vue's `valueChange` payload is that core `ValueChangeDetails` type. React, Solid, and Svelte `onValueChange` handlers use the same payload. See [core #353](https://github.com/destyler/destyler/issues/353) and the [Tabs migration guide](https://github.com/destyler/destyler/blob/v0.3.2/packages/components/tabs/docs/tabs.mdx#migration-nullable-value-change-notifications) from [#356](https://github.com/destyler/destyler/pull/356).
The current lockfile resolves `@destyler/tabs@0.3.3`, which includes the [core correction](https://github.com/destyler/destyler/pull/208) that shipped in 0.2.12 and remains in [core 0.3.2](https://github.com/destyler/destyler/releases/tag/v0.3.2): `clearValue()` and deselectable user activation report `{ value: null }`, and `ValueChangeDetails.value` is `string | null`. This includes clicking the selected trigger and pressing Enter on it in manual activation mode. Vue's `valueChange` payload is that core `ValueChangeDetails` type. React, Solid, and Svelte `onValueChange` handlers use the same payload. See [core #353](https://github.com/destyler/destyler/issues/353) and the [Tabs migration guide](https://github.com/destyler/destyler/blob/v0.3.2/packages/components/tabs/docs/tabs.mdx#migration-nullable-value-change-notifications) from [#356](https://github.com/destyler/destyler/pull/356).

A controlled parent still owns the selection. Accept a clear request by writing `null` back, keep the current value to veto it, or apply the requested value later. Repeated clear requests while a non-null value remains controlled notify again; after the parent accepts `null`, another `clearValue()` is a no-op. Parent writes do not echo a value-change notification. Uncontrolled Tabs update their own selection and report the change.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@destyler-ui/monorepo",
"version": "0.0.1-beta.21",
"version": "0.0.1",
"private": true,
"packageManager": "pnpm@10.28.0",
"description": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pnpm add @destyler-ui/react react react-dom

Use the equivalent command for your package manager. The [package manifest](https://github.com/destyler/ui/blob/main/packages/react/package.json) declares `react` and `react-dom` `>=18.0.0`; keep the two framework packages on compatible versions.

The package is beta. The peer range is a declaration, not evidence that every React version or consumer setup has been verified. Examples here describe the checked-in source API. Workspace demos and source type checks do not establish that an installed npm artifact has working runtime entry points and declarations; verify the version you install. Pending compatibility or packaging fixes are not released support.
The peer range is a declaration, not evidence that every React version or consumer setup has been verified. Examples here describe the checked-in source API. Workspace demos and source type checks do not establish that an installed npm artifact has working runtime entry points and declarations; verify the version you install. Pending compatibility or packaging fixes are not released support.

### Evaluated source packaging caveats

Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@destyler-ui/react",
"type": "module",
"version": "0.0.1-beta.21",
"version": "0.0.1",
"packageManager": "pnpm@10.28.0",
"description": "Build scalable design systems with unstyled, accessible UI components.",
"author": "Elone Hoo <hi@elonehoo.me>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ describe('[breadcrumbs] component', () => {
it('preserves destination, current-page, and item-label semantics', async () => {
await render(<Basic />)
const home = page.getByRole('link', { name: 'Home' })
const current = page.getByRole('link', { name: 'Smartphones' })
const current = page.getByText('Smartphones')
await expect.element(home).toHaveAttribute('href', '/')
await expect.element(home).not.toHaveAttribute('aria-current')
await expect.element(page.getByRole('link', { name: 'Products' })).toHaveAttribute('href', '/products')
await expect.element(current).not.toHaveAttribute('href')
await expect.element(current).toHaveAttribute('aria-current', 'page')
await expect.element(current).toHaveAttribute('tabindex', '0')
await expect.element(current).not.toHaveAttribute('role')
await expect.element(current).not.toHaveAttribute('tabindex')
await expect.element(page.getByRole('listitem', { name: 'breadcrumbs:listitem:Home' })).toBeVisible()
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import type { HTMLProps, PolymorphicProps } from '~/factory'
import { mergeProps } from '@destyler/react'
import { forwardRef } from 'react'
import { ui } from '~/factory'
import { createSplitProps } from '~/utils/create-split-props'
import { useTimerContext } from '../hooks/use-timer-context'

export interface TimerActionTriggerBaseProps extends ActionTriggerProps, PolymorphicProps {}
export interface TimerActionTriggerProps extends HTMLProps<'button'>, TimerActionTriggerBaseProps {}

export const TimerActionTrigger = forwardRef<HTMLButtonElement, TimerActionTriggerProps>((props, ref) => {
const [actionTriggerProps, localProps] = createSplitProps<ActionTriggerProps>()(props, ['action'])
const timer = useTimerContext()
const mergedProps = mergeProps(timer.getActionTriggerProps(props), props)
const mergedProps = mergeProps(timer.getActionTriggerProps(actionTriggerProps), localProps)

return <ui.button {...mergedProps} ref={ref} />
})
Expand Down
134 changes: 134 additions & 0 deletions packages/react/src/components/timer/test/action-trigger.unit.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
import type { ReactNode } from 'react'
import type { Root } from 'react-dom/client'
import { act, createRef } from 'react'
import { createRoot } from 'react-dom/client'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { Timer } from '../index'

(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true

let root: Root | undefined

afterEach(() => {
act(() => root?.unmount())
root = undefined
vi.restoreAllMocks()
document.body.replaceChildren()
})

function mount(children: ReactNode) {
const host = document.createElement('div')
document.body.append(host)
root = createRoot(host)
act(() => root!.render(children))
return host
}

function State() {
return <Timer.Context>{api => <output data-running={String(api.running)} data-paused={String(api.paused)} data-time-ms={((api.time.days * 24 + api.time.hours) * 60 + api.time.minutes) * 60000 + api.time.seconds * 1000 + api.time.milliseconds} />}</Timer.Context>
}

async function click(button: HTMLButtonElement) {
await act(async () => button.click())
}

describe('[timer] ActionTrigger DOM props and actions', () => {
it.each([false, true])('consumes action and preserves button props/ref (asChild=%s)', (asChild) => {
const ref = createRef<HTMLButtonElement>()
const host = mount(
<Timer.Root>
<Timer.ActionTrigger action="start" asChild={asChild} ref={ref} className="timer-action" data-testid="trigger" aria-label="Start timer">
{asChild ? <button data-child="true">Start</button> : 'Start'}
</Timer.ActionTrigger>
</Timer.Root>,
)
const button = host.querySelector('button')!
expect(button.hasAttribute('action')).toBe(false)
expect(button.type).toBe('button')
expect(button.className).toContain('timer-action')
expect(button.getAttribute('aria-label')).toBe('Start timer')
expect(button.getAttribute('data-testid')).toBe('trigger')
expect(button.getAttribute('data-child')).toBe(asChild ? 'true' : null)
expect(ref.current).toBe(button)
})

it('preserves repeated start, pause, resume and reset without submitting its form', async () => {
const submit = vi.fn((event: React.SubmitEvent<HTMLFormElement>) => event.preventDefault())
const host = mount(
<form onSubmit={submit}>
<Timer.Root startMs={60000} countdown interval={25}>
<State />
{(['start', 'pause', 'resume', 'reset'] as const).map(action => <Timer.ActionTrigger key={action} action={action} data-action={action}>{action}</Timer.ActionTrigger>)}
</Timer.Root>
</form>,
)
const state = (running: boolean, paused: boolean) => {
expect(host.querySelector('output')?.getAttribute('data-running')).toBe(String(running))
expect(host.querySelector('output')?.getAttribute('data-paused')).toBe(String(paused))
}
const time = () => Number(host.querySelector('output')?.getAttribute('data-time-ms'))
state(false, false)
expect(time()).toBe(60000)
for (let cycle = 0; cycle < 2; cycle++) {
for (const [action, running, paused] of [['start', true, false], ['pause', false, true], ['resume', true, false], ['pause', false, true], ['reset', false, false]] as const) {
const button = host.querySelector<HTMLButtonElement>(`[data-action="${action}"]`)!
expect(button.hasAttribute('action')).toBe(false)
expect(button.type).toBe('button')
expect(button.hidden).toBe(false)
await click(button)
await vi.waitFor(() => state(running, paused))
if (action === 'start')
await vi.waitFor(() => expect(time()).toBeLessThan(60000))
if (action === 'reset')
expect(time()).toBe(60000)
}
}
expect(submit).not.toHaveBeenCalled()
})

it('preserves a consumer preventDefault handler', async () => {
const prevented = vi.fn((event: React.MouseEvent<HTMLButtonElement>) => event.preventDefault())
const host = mount(<Timer.Root startMs={60000} countdown><State /><Timer.ActionTrigger action="start" onClick={prevented}>Start</Timer.ActionTrigger></Timer.Root>)
await click(host.querySelector('button')!)
expect(prevented).toHaveBeenCalledOnce()
expect(host.querySelector('output')?.getAttribute('data-running')).toBe('false')
})

it('uses the latest callback after rerender without suppressing the machine action', async () => {
const prevented = vi.fn((event: React.MouseEvent<HTMLButtonElement>) => event.preventDefault())
const latest = vi.fn()
const view = (action: 'start' | 'pause', onClick: React.MouseEventHandler<HTMLButtonElement>) => (
<Timer.Root startMs={60000} countdown interval={25}><State /><Timer.ActionTrigger action={action} onClick={onClick}>Action</Timer.ActionTrigger></Timer.Root>
)
const host = mount(view('start', prevented))
await click(host.querySelector('button')!)
expect(prevented).toHaveBeenCalledOnce()
expect(host.querySelector('output')?.getAttribute('data-running')).toBe('false')
act(() => root!.render(view('start', latest)))
await click(host.querySelector('button')!)
expect(latest).toHaveBeenCalledOnce()
expect(prevented).toHaveBeenCalledOnce()
await vi.waitFor(() => expect(host.querySelector('output')?.getAttribute('data-running')).toBe('true'))
})

it('uses a changed action prop on an existing trigger independently of callback replacement', async () => {
const onClick = vi.fn()
const view = (action: 'start' | 'pause') => (
<Timer.Root startMs={60000} countdown interval={25} autoStart>
<State />
<Timer.ActionTrigger action={action} onClick={onClick}>Action</Timer.ActionTrigger>
</Timer.Root>
)
const host = mount(view('start'))
const button = host.querySelector('button')!
expect(host.querySelector('output')?.getAttribute('data-running')).toBe('true')
expect(button.hidden).toBe(true)
act(() => root!.render(view('pause')))
expect(host.querySelector('button')).toBe(button)
expect(button.hidden).toBe(false)
expect(button.hasAttribute('action')).toBe(false)
await click(button)
expect(onClick).toHaveBeenCalledOnce()
await vi.waitFor(() => expect(host.querySelector('output')?.getAttribute('data-paused')).toBe('true'))
})
})
Loading
Loading