Commit Graph

1228 Commits

Author SHA1 Message Date
Segun Adebayo cbe4031a70 ci(changesets): version packages 2026-09-14 00:37:45 +00:00
Lope 96bc206b0a docs(components): add examples for various component props (#11001)
* docs(components): add examples for various component props

Add usage examples demonstrating:

- collapsible: activity hide mode
- dialog/drawer: autofocus data attributes
- listbox: keyboard priority
- number-input: keyboard steps
- pagination: custom page text
- pin-input: auto submit and sanitize value
- select: virtualized list
- slider: large step and custom marker labels
- steps: skippable step
- tags-input: allow duplicates and sanitize value

* docs(components): tighten the new prop examples

Keeps the examples that teach something the prop name does not, and adds
Storybook coverage for them.

Removed:

- steps-with-skippable-step. `isStepSkippable` only overrides failed
  validation, and `isStepValid` returned true for the step marked skippable,
  so the prop changed nothing. It was also close to a copy of
  steps-with-validation.
- number-input-with-keyboard-steps and slider-with-large-step, both a numeric
  prop whose effect the surrounding sentence already states.
- tags-input-with-duplicates. A boolean that does what its name says, on a
  page that already carries twenty-two examples.

Reverted:

- dialog and drawer keep `initialFocusEl`. `data-autofocus` is worth
  documenting but not by rewriting a working example, and the
  `data-no-autofocus` in that version was inert: it is only read when nothing
  matches `[data-autofocus]`. The docs now describe the real precedence.
- pagination-with-custom-format, which had switched the sample string to
  Persian for reasons unrelated to demonstrating `format`.

Fixed:

- tags-input-with-sanitized-value put its helper text 825px to the right of
  the field, because `ms="auto"` acts as a flex spacer inside the root.
- listbox copy claimed arrow keys respond to `keyboardPriority`. They are
  gated behind `isGridCollection`, so for this collection only Home and End
  do. Verified in a browser: Home and End move the highlight and leave the
  caret alone, ArrowLeft moves the caret.
- collapsible-with-hide-mode showed `display-none` beside `activity`, but
  `display-none` is the default. One panel is enough, and the docs now note
  that `activity` needs React 19.2 and silently falls back below that.

---------

Co-authored-by: Saleh Ghotbani <saleh313ghotbani@gmail.com>
Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-09-14 01:35:39 +01:00
Segun Adebayo 722f531561 refactor(react): simplify the useBreakpoint breakpoint filter
State the intent directly: an absent list matches every breakpoint. The
`?? true` form was correct but read as though the default were being applied
to the result of `includes` rather than to the missing option.

Also trims the changeset from #10976 to the symptom, since the reasoning
behind the fix belongs in the PR rather than the changelog.
2026-09-14 00:20:42 +01:00
dfedoryshchev 611bab021f fix(react): match all breakpoints when useBreakpoint gets no list (#10976) 2026-09-14 00:08:14 +01:00
Segun Adebayo 837446e5ba test(react): add a react render benchmark
The three existing bench files all measure functions in isolation, which is
misleading here: `cssFn` and `transform` memoize the layer above style
resolution, so work that looks hot on its own barely runs during a render.
Measured on `renderToString`, three separate function-level wins of 34x, 9x
and 2.9x each came out to no change at all.

Adds `pnpm bench` and four benches over real trees, shaped after the cases
that actually regressed: a data table of recipe components (#10878) and a
dialog form (#9698), plus a varied page that misses the style caches.

Validated against the regression it exists to catch: reintroducing
04a1a07f1e, which stripped memo from `cssFn`, `mergeFn` and `transform`,
registers as 0.39x-0.52x here, far outside the +-5% noise floor.

Server rendering only. Mounting into jsdom measured at +-9% to +-13%, wide
enough to hide a 1.5x regression, and it adds coverage of effects and
reconciliation rather than style resolution.
2026-09-14 00:00:06 +01:00
Full-Stack Engineer d4b44201ea fix(react): preserve cva variant keys that collide with CSS shorthands (#10973)
* fix(react): preserve cva variant keys that collide with CSS shorthands

* refactor(react): resolve variant selections without a second normalizer

Keeps the fix, simplifies how it is wired.

`createNormalizePropsFn` was `createNormalizeFn` minus its `getKey` option,
so the two would drift apart the next time normalization changes. What cva
needs for selections is just `normalizeValue`, which `system.ts` already has
in scope, so `normalize.ts` goes back untouched.

`resolve` no longer normalizes selections at all: `getVariantCss` normalizes
its input internally and compound matching compares raw values, so that pass
only ever fed a function that redid the work. Compound variant match rules
are now built per recipe instead of on every resolve.

Verified byte-identical output against main across 1648 recipe resolutions
(every built-in recipe and slot recipe over its variant matrix, plus
responsive array and object selections). Cold render of a 40-field form
measures 23.5ms against 24.7ms for the previous approach and 26.1ms on main.

---------

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-09-13 23:57:47 +01:00
Lope edef23431e chore(deps): update @ark-ui/react to 5.39.2 (#10993)
Keeps the pinned Ark version current. 5.39.2 restores the ./hotkeys and
./interaction entrypoints that were dropped from the published package in
5.39.0/5.39.1, and carries a NavigationMenu SSR fix (a component Chakra does
not ship), so consumers see no behavior change.
2026-09-13 22:56:06 +01:00
dvd233 67abe9fb80 fix(file-upload): style disabled delete triggers (#10979) 2026-09-09 22:05:46 +01:00
Bao Nguyen c455101cfa fix(react): settle overlay promises when an overlay is removed (#10968)
Co-authored-by: Adebesin Tolulope <adebesintolulope80@gmail.com>
2026-09-07 15:34:36 +01:00
Max Freedom Pollard d88c3e9424 fix(react): read the important marker only at the end of a value (#10970)
Co-authored-by: Adebesin Tolulope <adebesintolulope80@gmail.com>
2026-09-07 15:13:15 +01:00
Bao Nguyen fbc174e5e2 fix(react): return zero-valued tokens from system.token (#10971) 2026-09-07 15:02:02 +01:00
dfedoryshchev 1eb59bce11 fix(flex, square): apply the array form of the css prop (#10966)
Co-authored-by: Lope <adebesintolulope80@gmail.com>
2026-09-05 04:55:41 +01:00
Segun Adebayo 51f0eac7ee fix: honor cursor tokens on cards, slider, and disabled states
Checkbox Card, Radio Card, and Slider never read their cursor tokens, so
theme overrides did nothing. Disabled styles hardcoded not-allowed instead
of tokens.cursor.disabled.
2026-09-04 17:37:39 +01:00
Bao Nguyen 0b20b60031 fix(react): honor getWindow option in useBreakpoint (#10961) 2026-09-04 15:27:03 +01:00
Fnine59 de7d48180b fix(react): preserve css property order in memo keys (#10953)
* fix(react): preserve css property order in memo keys

* test(memo): cover cache key order in memo and cva

Add a direct memo unit test for object key order, a cva test for the
variant values it affected, and drop the sentinel assertion message.
Sync memo.bench.ts with the implementation and expand the changeset.

* chore: shorten memo order changeset

* chore: note ssr hydration mismatch in changeset

---------

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-08-28 18:08:56 +01:00
github-actions[bot] 2e7517745c Version Packages (#10913)
Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-08-28 10:54:32 +01:00
Lope 902fabc445 fix(dialog, drawer): drop preventDefault guard on ActionTrigger (#10954) 2026-08-28 10:49:34 +01:00
dfedoryshchev c16188fa0b fix: preserve user onClick on Dialog and Drawer ActionTrigger (#10951)
Co-authored-by: Adebesin Tolulope <adebesintolulope80@gmail.com>
2026-08-28 10:44:48 +01:00
Lope 1f28ce9b28 Update Ark UI to 5.39.0 (#10949) 2026-08-24 18:05:23 +01:00
Segun Adebayo 2da020eb18 docs: add multiple trigger examples for popover, hover card, and dialog 2026-08-22 17:40:39 +02:00
Seyed Mohammad Saleh Ghotbani dd51da4497 docs(date-picker): add Persian (Jalali) calendar example (#10946)
* docs(date-picker): add Persian calendar example

* docs(date-picker): simplify Persian calendar example

* chore: ignore .playwright-mcp artifacts

---------

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-08-22 14:55:34 +02:00
Seyed Mohammad Saleh Ghotbani af8076cd99 docs(spinner): add custom indicator example (#10948)
* docs: add custom spinner indicator example

* docs: simplify custom spinner indicator example

* docs: add custom spinner indicator story

---------

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-08-22 14:41:23 +02:00
water 6948541646 fix(radio-card): preserve outline border-width when disabled (#10938)
* fix(radio-card): prevent bg.muted from covering outline variant's inset box-shadow when disabled

The outline variant uses `boxShadow: "inset 0 0 0 1px var(--shadow-color)"` on the
checked item to simulate a border. When the RadioCard is disabled, the base
`itemControl._disabled: { bg: "bg.muted" }` background covers this inset shadow,
making the border appear to lose its width.

Fix: override `itemControl._disabled: { bg: "unset" }` in the outline variant,
matching the existing pattern in the solid variant.

Ref: chakra-ui/chakra-ui#10930

* chore(changeset): add changeset for radio-card outline disabled fix

Text adapted from #10931, which had the changeset but patched only the
generated panda-preset file.

* chore(changeset): tighten radio-card entry

---------

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-08-18 12:17:08 +02:00
Segun Adebayo 7b027d44d0 chore(deps): update @ark-ui/react to 5.38.2 (#10939)
* chore(deps): update @ark-ui/react to 5.38.1

Bumps @ark-ui/react 5.37.2 -> 5.38.1 in packages/react and apps/www, which
pulls @zag-js/menu and @zag-js/popper 1.41.2 -> 1.43.0.

Fixes the Menu.ContextTrigger positioning bug: the positioner reported a
placement before one had been computed, skipping the off-screen guard that
hides it until the anchor point is known, so the menu flashed at the top-left
on first right-click. Long-press on touch had a second cause, it never
triggered a reposition on open.

Adds two changesets scoped to Chakra-supported components, split by bump type.
Entries for Ark's Field.Textarea autoresize fix and the composeRefs fix are
left out, neither is reachable from Chakra.

Closes #10855

* chore(deps): update @ark-ui/react to 5.38.2

Retargets the bump from 5.38.1 to 5.38.2, which pulls @zag-js 1.43.1.

5.38.1 broke the docs deploy: Ark's new hideMode="activity" imported React's
optional `Activity` export statically, and webpack rejects it as a missing
named export even on React 19.2.6, which exposes it at runtime. 5.38.2 resolves
it via Reflect.get and falls back to display-none. `pnpm next build` in apps/www
now compiles and prerenders every route.

Also folds the rest of 5.38.2 into the fixes changeset, scoped to
Chakra-supported components. Notable: a TagsInput XSS fix (the hidden
width-measuring element set tag values with innerHTML) and Escape being
swallowed right after an overlay opens.

pnpm-workspace.yaml picks up minimumReleaseAgeExclude entries that pnpm 11
writes automatically for same-day releases. Without them CI installs would be
refused by the supply-chain policy.
2026-08-17 20:52:57 +02:00
Kevin Dev 🇷🇼 afc8b48988 feat: add DateInput component (#10877)
* feat: add DateInput component

* fix: date inputs examples

* refactor: drop redundant JSDoc from DateInput.Segments

* docs: add date input documentation

* refactor(date-input): remove unused comments

* chore: cleanup slot recipe

* fix(date-input): address review feedback

Let the control hug its content instead of forcing full width, so the
examples no longer need to rein it back in with maxWidth.

Apply the focus-ring fix to the subtle and flushed variants, which were
still using :focus-visible styles that never match the segment group.

Drop the separate focus-ring changeset; DateInput ships new in this PR.

* fix(www): merge static props over generated types

writeStaticProps overwrote generated output wholesale, so a hand-authored
file shadowed live recipe and Ark data indefinitely. Merge it under the
generated output instead, and only when the run actually extracted the
component -- an existing output file for a component with no source (e.g.
password-input) is just the previous run's copy of the static file.

Ark now publishes date-input types, so its static file is no longer needed.
Declare index explicitly on DateInputSegmentsProps since extractTypes does
not resolve it through Omit.

* docs: date input prop tables and segment composition

Document RootProvider, Segments, Segment and HiddenInput -- the first three
are used by examples on the page but had no prop table. Show the expanded
SegmentGroup form so those anatomy slots are discoverable.

* docs: drop unneeded use client from date input examples

These examples pass only primitives to client components, so they render
fine from a server component. Keep it where a hook, handler, or a
non-serializable value (CalendarDate, DateFormatter, icon component)
crosses the boundary.

Also remove the date input nav entry and clear stale "new" badges.

* docs: show full date input anatomy and move shortcut to its own section

Usage now shows every anatomy part instead of the Segments shortcut, and
the shortcut moves to a Shortcuts section between Usage and Examples to
match the other component docs.

* fix(date-input): fill available width by default

Control and segmentGroup were fit-content, so the input would not flow to
its container and needed manual width overrides. Match DatePicker: full
width root and control, with the segment group flexing to fill.

Constrain the examples with maxW so they read at a sensible size.

* docs: rename date input min-max example

Drop the "with" prefix -- min and max are constraints on the component,
not something composed with it, matching date-picker-min-max and
floating-panel-min-max.

Regenerating the examples registry also picks up the overlay return-value
example, whose entry was stale.

* docs: add date input variants and locale examples

The recipe defines outline, subtle and flushed but no example exercised
any of them. Locale is worth showing on its own since it changes segment
order, placeholder text and separators.

* docs: rework date input changeset

Match the new-component shape used for FloatingPanel: bold header, import
and anatomy fences, then the details worth scanning for.

* revert: restore unrelated mdx files to main

Merge c664d048c reformatted four files it had no reason to touch: the
pre-commit prettier hook runs over everything a merge stages. Restore them
so this branch only carries date input changes.

main is prettier-dirty for these paths and needs a separate formatting
pass, including the leading semicolons prettier adds to JSX snippets in
migration.mdx.

Committed with --no-verify so the same hook does not reapply the diff.

* docs: add date input time and locale examples

Add granularity (date and time), time zone and default value examples,
and give leading-zeros and with-clear-trigger a default value -- neither
showed its own subject while the input was empty.

RTL now wraps LocaleProvider, which derives direction from the locale.
It previously set dir="rtl" with an Arabic label but the default en-US
locale, so the segments stayed mm/dd/yyyy and were merely mirrored.

Import parseDate from @internationalized/date everywhere instead of the
@chakra-ui/react re-export. The two differ: the re-export returns
DateValue and accepts a Date, so controlled examples need an explicit
useState<DateValue[]> and year-picker constructs CalendarDate directly.

Pin @internationalized/date with a workspace override. CalendarDate uses
private fields, so two copies produce mutually incompatible types.

---------

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-08-16 20:01:38 +02:00
Fadhil Amadan c8ef4fb314 docs(compositions): add toggle-tip usage examples (#10917)
* docs(compositions): add toggle-tip usage examples

Adds docs sections and Storybook exports for arrow,
closeOnEscape, closeOnInteractOutside, and size variants.

* docs(compositions): address review feedback on toggle-tip examples

Use neutral placeholder content (matching existing examples) instead of
describing behavior in the tip copy, and regenerate the examples
registry so the four new toggle-tip examples are included.

---------

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-08-10 17:56:38 +02:00
Ivica Batinić 8af2836bf8 feat: improve createOverlay types (#10676)
* chore: improve use-overlay types

* docs: type createOverlay return value in example, add changeset

* fix(overlay): keep open() props required, tighten changeset wording

---------

Co-authored-by: Adebesin Tolulope <adebesintolulope80@gmail.com>
Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-08-10 17:02:43 +02:00
Aditya Jain 76bb1dc9f6 fix: preserve italic styles in preflight (#10919) 2026-08-09 15:55:54 +01:00
Segun Adebayo 065f71ceaf fix(tree-view): make --tree-indentation: 0px fully remove nesting 2026-07-25 20:39:46 +02:00
Hiroki Akahoshi c6516a12ef fix: missing type="button" on Tag, ActionBar, Dialog, Drawer triggers (#10908)
* fix: add missing type=button to Tag, ActionBar, Dialog, and Drawer close/action triggers

* test: add regression coverage for close/action trigger type=button fix
2026-07-25 15:57:16 +02:00
github-actions[bot] f8133940ac Version Packages (#10857)
ci(changesets): version packages

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-07-19 16:30:04 +02:00
dfedoryshchev e503f8d9f4 fix: correct css prop usage in Bleed component (#10885) 2026-07-11 19:15:14 +02:00
Segun Adebayo 0fe305592d perf(react): cache compiled recipes and memoize variant resolution
Recipe components (Button, Badge, Skeleton, etc.) previously recompiled
their recipe and re-resolved variant styles per instance/render, which
dominated render time in large lists and tables.

- Cache compiled recipes per system instance, keyed by recipe key
- Memoize cva/sva variant resolution so results are referentially stable
- Drop the per-instance structuredClone of recipe configs
- Fix recipe merging so it no longer throws or mutates source configs
- Use tsgo (@typescript/native-preview) for faster typecheck
2026-07-06 14:27:33 +02:00
dfedoryshchev e882dc0e71 fix: correct css prop usage in Float component (#10879) 2026-07-04 13:30:29 +02:00
Segun Adebayo ff2067e7ad fix(deps): update non-major dependencies
Applies the non-major bumps from Renovate PR #10525 onto current main,
skipping entries main has already advanced past (@ark-ui/react is
already 5.37.2 > the PR's 5.37.1; @internationalized/date and the pnpm
packageManager pin are also ahead).

Notable: storybook 10.3.3 -> 10.4.2, vite 8.0.2 -> 8.0.16, vitest
4.1.1 -> 4.1.8, rollup 4.57.1 -> 4.61.1, esbuild ^0.27.3 -> ^0.28.0,
next 15.5.18 -> 15.5.19, prettier 3.8.1 -> 3.8.3, plus assorted
patch/minor deps across packages, apps, and sandboxes.

Verified green: typecheck, lint, format:check, build, and the full
vitest suite (978 tests).
2026-06-27 15:02:12 +02:00
dfedoryshchev c4e79c122a fix: forward the rel attribute on LinkOverlay (#10873) 2026-06-27 14:40:53 +02:00
Abdul Wahab Khan Arib f32a160162 feat(overlay): add has() method to createOverlay return (#10868)
* feat(overlay): add has() method to createOverlay return

* docs: changeset

---------

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-06-23 23:36:05 +02:00
Aleksei Kharitonov a1548ba60c fix: correct misspelled "permuations" variable in breakpoints (#10864) 2026-06-21 22:08:42 +01:00
dfedoryshchev b5de5e246b fix: correct className usage in Image component (#10863) 2026-06-20 09:27:12 +02:00
dfedoryshchev 6f102700bd fix: correct css prop usage in Checkmark component (#10859) 2026-06-18 20:07:36 +02:00
dfedoryshchev f53e46a182 fix: correct css prop usage in WrapItem component (#10860) 2026-06-18 20:06:52 +02:00
Segun Adebayo 129c50ff9b fix(checkbox-card, radio-card): prevent clipping of checked ring by using inset shadow 2026-06-11 20:45:22 +02:00
Segun Adebayo 2ed9026862 fix(floating-panel): docs and component 2026-06-11 17:54:01 +02:00
github-actions[bot] 3c000274c5 Version Packages (#10802)
ci(changesets): version packages

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
Co-authored-by: Adebesin Tolulope (Lope) <adebesintolulope80@gmail.com>
2026-06-10 15:14:47 +01:00
Adebesin Tolulope (Lope) 238e20a41a chore(deps): update @ark-ui/react to 5.37.2 (#10847)
* chore(deps): update @ark-ui/react to 5.37.2

Bumps @ark-ui/react 5.36.2 -> 5.37.2 (pulls newer @zag-js internally).
Aligns @internationalized/date to 3.12.2 in the compositions app to match
the version the updated Zag date-utils resolves to. Adds a minor changeset
scoped to the Chakra-supported components affected by the Ark release.

* docs(changeset): tighten ark 5.37.2 changeset per review

Make it concise; drop DateInput-specific entries (Chakra has no DateInput),
Drawer (Chakra's Drawer is built on Ark Dialog, not the Ark Drawer machine),
FloatingPanel type re-exports, and the declaration-path fix.
2026-06-09 20:21:23 +02:00
dfedoryshchev 4384e3f815 docs(react): remove redundant "render" in For children prop (#10842) 2026-06-06 00:03:50 +02:00
Adebesin Tolulope (Lope) b51f7aeeac docs(react): update outdated package readme (#10838)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 22:26:24 +02:00
Segun Adebayo 06b5f022db fix: semantic token lookup 2026-05-22 07:55:06 +01:00
Segun Adebayo 6a3e23cbb5 chore: update examples 2026-05-20 17:18:49 +01:00
Kevin Dev 🇷🇼 1ef580069c feat: float panel component (#10752)
* feat: implementation for float panel component with storybook

* feat: doc floating panel

* fix: minor changes on the ui

* chore: add changeset

* refactor: cleanup code

* refactor: rework examples

* fix: next version

* refactor: cleanup examples

* chore: update

* docs: prep for docs

---------

Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
2026-05-20 16:56:27 +01:00