@viraui/react 2026.7.0-next.0 → 2026.7.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog.json +13 -1
- package/dist/components/accordion/accordion-item.d.ts +10 -10
- package/dist/components/accordion/accordion.d.ts +2 -2
- package/dist/components/annotate/annotate.d.ts +15 -15
- package/dist/components/autocomplete/autocomplete-item.d.ts +3 -3
- package/dist/components/autocomplete/autocomplete.d.ts +12 -12
- package/dist/components/avatar/avatar.d.ts +6 -6
- package/dist/components/avatar-group/avatar-group.d.ts +6 -6
- package/dist/components/badge/badge.d.ts +5 -5
- package/dist/components/basic-input/basic-input.d.ts +1 -1
- package/dist/components/basic-input/input-control-group.d.ts +2 -2
- package/dist/components/beam/beam.d.ts +12 -12
- package/dist/components/bleed/bleed.d.ts +3 -3
- package/dist/components/button/button-link.d.ts +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/checkbox/checkbox-group.d.ts +1 -1
- package/dist/components/checkbox/checkbox.d.ts +7 -7
- package/dist/components/chip/chip.d.ts +6 -6
- package/dist/components/clamp-text/clamp-text.d.ts +5 -5
- package/dist/components/dialog/dialog-close.d.ts +1 -1
- package/dist/components/dialog/dialog-indent-background.d.ts +1 -1
- package/dist/components/dialog/dialog-indent.d.ts +1 -1
- package/dist/components/dialog/dialog-sheet.d.ts +10 -10
- package/dist/components/dialog/dialog-trigger.d.ts +1 -1
- package/dist/components/dialog/dialog.d.ts +1 -1
- package/dist/components/disclosure/disclosure-panel.d.ts +12 -0
- package/dist/components/disclosure/disclosure-panel.js +13 -0
- package/dist/components/disclosure/disclosure-trigger.d.ts +46 -0
- package/dist/components/disclosure/disclosure-trigger.js +82 -0
- package/dist/components/disclosure/disclosure.css +1 -0
- package/dist/components/disclosure/disclosure.d.ts +25 -0
- package/dist/components/disclosure/disclosure.js +30 -0
- package/dist/components/disclosure/disclosure.module.js +15 -0
- package/dist/components/disclosure/index.d.ts +4 -0
- package/dist/components/elevator/elevator.d.ts +7 -7
- package/dist/components/fieldset/fieldset.d.ts +4 -4
- package/dist/components/fit-text/fit-text.d.ts +2 -2
- package/dist/components/glow/glow.d.ts +12 -12
- package/dist/components/grid/grid-item.d.ts +8 -8
- package/dist/components/grid/grid.d.ts +12 -12
- package/dist/components/icon-button/icon-button-link.d.ts +2 -2
- package/dist/components/icon-button/icon-button.d.ts +2 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/components/linear-progress/linear-progress.d.ts +4 -4
- package/dist/components/masonry/masonry-item.d.ts +3 -3
- package/dist/components/masonry/masonry.d.ts +4 -4
- package/dist/components/menu/menu-checkbox-item.d.ts +4 -4
- package/dist/components/menu/menu-item.d.ts +4 -4
- package/dist/components/menu/menu-link-item.d.ts +4 -4
- package/dist/components/menu/menu-popup.d.ts +2 -2
- package/dist/components/menu/menu-radio-group.d.ts +2 -2
- package/dist/components/menu/menu-radio-item.d.ts +4 -4
- package/dist/components/menu/menu-separator.d.ts +1 -1
- package/dist/components/menu/menu-submenu-trigger.d.ts +3 -3
- package/dist/components/menu/menu.d.ts +3 -3
- package/dist/components/meter/meter.d.ts +5 -5
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/number-field.css +1 -0
- package/dist/components/number-field/number-field.d.ts +78 -0
- package/dist/components/number-field/number-field.js +120 -0
- package/dist/components/number-field/number-field.module.js +21 -0
- package/dist/components/otp-field/index.d.ts +1 -1
- package/dist/components/otp-field/otp-field-input.d.ts +1 -1
- package/dist/components/otp-field/otp-field-separator.d.ts +3 -1
- package/dist/components/otp-field/otp-field-separator.js +5 -1
- package/dist/components/otp-field/otp-field.d.ts +4 -5
- package/dist/components/otp-field/otp-field.js +0 -1
- package/dist/components/popover/popover-sheet.d.ts +6 -6
- package/dist/components/popover/popover.d.ts +5 -5
- package/dist/components/progressive-blur/progressive-blur.d.ts +5 -5
- package/dist/components/prose/prose.css +1 -1
- package/dist/components/prose/prose.d.ts +4 -4
- package/dist/components/radio/radio-group.d.ts +1 -1
- package/dist/components/radio/radio.d.ts +6 -6
- package/dist/components/select/select-indicator-slot.d.ts +1 -1
- package/dist/components/select/select-option.d.ts +4 -4
- package/dist/components/select/select-separator.d.ts +1 -1
- package/dist/components/select/select.d.ts +10 -10
- package/dist/components/separator/separator.d.ts +9 -9
- package/dist/components/shimmer/shimmer.d.ts +6 -6
- package/dist/components/skeleton/skeleton-overlay.d.ts +5 -5
- package/dist/components/skeleton/skeleton.d.ts +9 -9
- package/dist/components/slider/slider.d.ts +7 -7
- package/dist/components/spinner/spinner.d.ts +3 -3
- package/dist/components/stack/stack.d.ts +17 -17
- package/dist/components/static-noise/static-noise.d.ts +5 -5
- package/dist/components/surface/surface.d.ts +12 -12
- package/dist/components/switch/switch.d.ts +7 -7
- package/dist/components/tabs/tabs-list.d.ts +1 -1
- package/dist/components/tabs/tabs-panel.d.ts +1 -1
- package/dist/components/tabs/tabs-tab.d.ts +3 -3
- package/dist/components/tabs/tabs.d.ts +2 -2
- package/dist/components/text/text.d.ts +23 -23
- package/dist/components/textarea/textarea.d.ts +6 -6
- package/dist/components/textfield/textfield.d.ts +1 -1
- package/dist/components/title/title.d.ts +21 -21
- package/dist/components/toast/toast-action.d.ts +1 -1
- package/dist/components/toast/toast-banner.d.ts +7 -7
- package/dist/components/toast/toast-viewport.d.ts +2 -2
- package/dist/components/toggle-button/toggle-button.d.ts +6 -6
- package/dist/components/toggle-group/toggle-group.d.ts +1 -1
- package/dist/components/tooltip/tooltip-content.d.ts +2 -2
- package/dist/components/typewriter/typewriter.d.ts +10 -10
- package/dist/index.js +3 -1
- package/dist/specs/components/accordion/usage.xml +1 -0
- package/dist/specs/components/disclosure/a11y.xml +9 -0
- package/dist/specs/components/disclosure/meta.xml +20 -0
- package/dist/specs/components/disclosure/patterns.xml +55 -0
- package/dist/specs/components/disclosure/props.xml +54 -0
- package/dist/specs/components/disclosure/usage.xml +11 -0
- package/dist/specs/components/number-field/a11y.xml +10 -0
- package/dist/specs/components/number-field/meta.xml +21 -0
- package/dist/specs/components/number-field/patterns.xml +43 -0
- package/dist/specs/components/number-field/props.xml +35 -0
- package/dist/specs/components/number-field/usage.xml +12 -0
- package/dist/specs/components/otp-field/meta.xml +1 -4
- package/dist/specs/components/otp-field/patterns.xml +8 -8
- package/dist/specs/components/otp-field/props.xml +2 -2
- package/dist/specs/components/otp-field/usage.xml +4 -4
- package/dist/specs/index.xml +22 -2
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<meta id="disclosure" title="Disclosure" category="layout" shared_contract="disclosure">
|
|
3
|
+
<summary>Single-section expand/collapse wrapping Base UI Collapsible. Default Trigger is Surface with render → Collapsible Trigger; Panel is a height motion shell with no default content padding. Use Accordion for multi-item lists.</summary>
|
|
4
|
+
<exports>
|
|
5
|
+
<export name="Disclosure" />
|
|
6
|
+
</exports>
|
|
7
|
+
<related>
|
|
8
|
+
<ref id="accordion" />
|
|
9
|
+
<ref id="surface" />
|
|
10
|
+
<ref id="toggle-button" />
|
|
11
|
+
<ref id="stack" />
|
|
12
|
+
</related>
|
|
13
|
+
<units>
|
|
14
|
+
<unit kind="a11y" href="a11y.xml" />
|
|
15
|
+
<unit kind="props" href="props.xml" />
|
|
16
|
+
<unit kind="usage" href="usage.xml" />
|
|
17
|
+
<unit kind="patterns" href="patterns.xml" />
|
|
18
|
+
</units>
|
|
19
|
+
<base_ui href="https://base-ui.com/react/components/collapsible#api-reference" />
|
|
20
|
+
</meta>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<patterns surface="disclosure">
|
|
3
|
+
<example title="Default Surface Trigger + Panel">
|
|
4
|
+
<tsx><![CDATA[
|
|
5
|
+
<Disclosure>
|
|
6
|
+
<Disclosure.Trigger hPadding="m" radius="m" vPadding="m">
|
|
7
|
+
Shipping details
|
|
8
|
+
</Disclosure.Trigger>
|
|
9
|
+
<Disclosure.Panel>
|
|
10
|
+
<Stack hPadding="m" vPadding="m">
|
|
11
|
+
<Text tone="muted">Orders ship within 2 business days.</Text>
|
|
12
|
+
</Stack>
|
|
13
|
+
</Disclosure.Panel>
|
|
14
|
+
</Disclosure>
|
|
15
|
+
]]></tsx>
|
|
16
|
+
<notes>Default Trigger = Surface with render → Collapsible.Trigger; hoverColor defaults to 2. Panel is motion-only — pad children in the story/app.</notes>
|
|
17
|
+
</example>
|
|
18
|
+
|
|
19
|
+
<example title="Custom icons with interpolate">
|
|
20
|
+
<tsx><![CDATA[
|
|
21
|
+
<Disclosure>
|
|
22
|
+
<Disclosure.Trigger
|
|
23
|
+
hPadding="m"
|
|
24
|
+
interpolateIcons
|
|
25
|
+
openIcon={<Xmark size="1rem" />}
|
|
26
|
+
radius="m"
|
|
27
|
+
restingIcon={<Plus size="1rem" />}
|
|
28
|
+
vPadding="m"
|
|
29
|
+
>
|
|
30
|
+
Advanced
|
|
31
|
+
</Disclosure.Trigger>
|
|
32
|
+
<Disclosure.Panel>
|
|
33
|
+
<Stack hPadding="m" vPadding="m">
|
|
34
|
+
{/* advanced controls */}
|
|
35
|
+
</Stack>
|
|
36
|
+
</Disclosure.Panel>
|
|
37
|
+
</Disclosure>
|
|
38
|
+
]]></tsx>
|
|
39
|
+
<notes>ToggleButton-style resting/open icons; interpolate opt-in. For multi-item lists use Accordion instead.</notes>
|
|
40
|
+
</example>
|
|
41
|
+
|
|
42
|
+
<example title="Custom Trigger render">
|
|
43
|
+
<tsx><![CDATA[
|
|
44
|
+
<Disclosure>
|
|
45
|
+
<Disclosure.Trigger render={<Button variant="secondary" />}>
|
|
46
|
+
Show more
|
|
47
|
+
</Disclosure.Trigger>
|
|
48
|
+
<Disclosure.Panel>
|
|
49
|
+
<Text>Extra details</Text>
|
|
50
|
+
</Disclosure.Panel>
|
|
51
|
+
</Disclosure>
|
|
52
|
+
]]></tsx>
|
|
53
|
+
<notes>Consumer render replaces the whole Surface + primitive compose; Surface defaults do not apply.</notes>
|
|
54
|
+
</example>
|
|
55
|
+
</patterns>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<props surface="disclosure">
|
|
3
|
+
<when_to_use>
|
|
4
|
+
<item>Single-section progressive disclosure (show more, optional details, FAQ item alone)</item>
|
|
5
|
+
<item>Expand/collapse one block with Surface chrome Trigger and optional icon pair</item>
|
|
6
|
+
</when_to_use>
|
|
7
|
+
<when_not_to_use>
|
|
8
|
+
<item>Multi-item collapsible lists — use Accordion</item>
|
|
9
|
+
<item>Expecting default Panel content padding — Panel is a motion shell only</item>
|
|
10
|
+
<item>Primary navigation that should use links, Tabs, or routes</item>
|
|
11
|
+
</when_not_to_use>
|
|
12
|
+
<prop name="Trigger.restingIcon" kind="react">
|
|
13
|
+
<description>Decorative icon while the panel is closed. Defaults to ChromeChevronEnd when both icon slots are omitted.</description>
|
|
14
|
+
</prop>
|
|
15
|
+
<prop name="Trigger.openIcon" kind="react">
|
|
16
|
+
<description>Decorative icon while the panel is open. Defaults to ChromeChevronDown when both icon slots are omitted. When only restingIcon is set, that icon shows in both states.</description>
|
|
17
|
+
</prop>
|
|
18
|
+
<prop name="Trigger.interpolateIcons" kind="react">
|
|
19
|
+
<description>When dual icons are present, crossfade and light-rotate between them (`data-interpolate="true"`). When false, swap instantly with no transition.</description>
|
|
20
|
+
</prop>
|
|
21
|
+
<prop name="Trigger.iconPosition" kind="react">
|
|
22
|
+
<description>Logical side of the label where the icon slot sits (`start` | `end`). Default `end`.</description>
|
|
23
|
+
</prop>
|
|
24
|
+
<prop name="Trigger.color" kind="react">
|
|
25
|
+
<description>Surface resting background on the default Trigger host. Omitted on consumer Trigger render.</description>
|
|
26
|
+
</prop>
|
|
27
|
+
<prop name="Trigger.hoverColor" kind="react">
|
|
28
|
+
<description>Surface hover background on the default Trigger host. Defaults to level 2 when omitted. Skipped when consumer supplies Trigger render.</description>
|
|
29
|
+
</prop>
|
|
30
|
+
<prop name="Trigger.border" kind="react">
|
|
31
|
+
<description>Surface contrast border on the default Trigger host.</description>
|
|
32
|
+
</prop>
|
|
33
|
+
<prop name="Trigger.borderStyle" kind="react">
|
|
34
|
+
<description>Surface border style when border is set on the default Trigger host.</description>
|
|
35
|
+
</prop>
|
|
36
|
+
<prop name="Trigger.radius" kind="react">
|
|
37
|
+
<description>Surface corner radius on the default Trigger host.</description>
|
|
38
|
+
</prop>
|
|
39
|
+
<prop name="Trigger.hPadding" kind="react">
|
|
40
|
+
<description>Surface inline padding on the default Trigger host. Defaults to `m` when omitted. Skipped when consumer supplies Trigger render.</description>
|
|
41
|
+
</prop>
|
|
42
|
+
<prop name="Trigger.vPadding" kind="react">
|
|
43
|
+
<description>Surface block padding on the default Trigger host. Defaults to `s` when omitted. Skipped when consumer supplies Trigger render.</description>
|
|
44
|
+
</prop>
|
|
45
|
+
<prop name="Trigger.render" kind="react">
|
|
46
|
+
<description>Replaces the whole default Surface + Collapsible Trigger compose with a custom host.</description>
|
|
47
|
+
</prop>
|
|
48
|
+
<prop name="Panel.hiddenUntilFound" kind="react">
|
|
49
|
+
<description>Allows browser find-in-page to expand the panel; Base UI Collapsible Panel pass-through.</description>
|
|
50
|
+
</prop>
|
|
51
|
+
<prop name="Panel.keepMounted" kind="react">
|
|
52
|
+
<description>Keeps the panel in the DOM while closed; Base UI Collapsible Panel pass-through.</description>
|
|
53
|
+
</prop>
|
|
54
|
+
</props>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<usage surface="disclosure">
|
|
3
|
+
<do>Compose `Disclosure` + `Disclosure.Trigger` + `Disclosure.Panel` for a single expandable section</do>
|
|
4
|
+
<do>Spread Surface chrome on Trigger (`color`, `hoverColor`, `border`, `radius`, padding) when using the default host</do>
|
|
5
|
+
<do>Supply Panel children layout (Stack/padding) yourself — Panel has no default content padding</do>
|
|
6
|
+
<do>Use `restingIcon` / `openIcon` / `interpolateIcons` for ToggleButton-style icon pairs; omit both for chrome chevron End/Down</do>
|
|
7
|
+
<do>Pass Trigger `render` when replacing the Surface compose entirely</do>
|
|
8
|
+
<dont>Using Accordion for a single section — Accordion is multi-item</dont>
|
|
9
|
+
<dont>Expecting Accordion-like default Panel padding from Disclosure.Panel</dont>
|
|
10
|
+
<dont>Relying on icon animation alone for open/closed meaning under reduced motion</dont>
|
|
11
|
+
</usage>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<a11y surface="number-field">
|
|
3
|
+
<rule>Visible `label` on `NumberField` names the numeric input via Field.Label / htmlFor.</rule>
|
|
4
|
+
<rule>Description uses Field description / `aria-describedby` while valid.</rule>
|
|
5
|
+
<rule>Error copy shares the helper slot and replaces description while invalid and dirty (same as Textfield).</rule>
|
|
6
|
+
<rule>Internal steppers are icon-only IconButtons named `Decrement` and `Increment`.</rule>
|
|
7
|
+
<rule>Label scrub is optional chrome (`labelScrub`, default true when label present). Disable with `labelScrub={false}` or omit label.</rule>
|
|
8
|
+
<rule>Focus order follows `stepperPlacement`: split → decrement, input, increment; grouped → input then both. Grouped visual side follows document direction (inline-end).</rule>
|
|
9
|
+
<rule>When `description` is a string, NumberField sets `aria-roledescription` on the numeric input to that string; otherwise Base UI default remains.</rule>
|
|
10
|
+
</a11y>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<meta id="number-field" title="NumberField" category="form" shared_contract="number-field">
|
|
3
|
+
<summary>Single public NumberField with Field chrome, internal IconButton steppers, and optional label scrub. Group / Decrement / Increment / ScrubArea stay internal.</summary>
|
|
4
|
+
<exports>
|
|
5
|
+
<export name="NumberField" />
|
|
6
|
+
</exports>
|
|
7
|
+
<related>
|
|
8
|
+
<ref id="textfield" />
|
|
9
|
+
<ref id="icon-button" />
|
|
10
|
+
<ref id="fieldset" />
|
|
11
|
+
<ref id="text" />
|
|
12
|
+
<ref id="stack" />
|
|
13
|
+
</related>
|
|
14
|
+
<units>
|
|
15
|
+
<unit kind="a11y" href="a11y.xml" />
|
|
16
|
+
<unit kind="props" href="props.xml" />
|
|
17
|
+
<unit kind="usage" href="usage.xml" />
|
|
18
|
+
<unit kind="patterns" href="patterns.xml" />
|
|
19
|
+
</units>
|
|
20
|
+
<base_ui href="https://base-ui.com/react/components/number-field#api-reference" />
|
|
21
|
+
</meta>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<patterns surface="number-field">
|
|
3
|
+
<example title="Labeled amount">
|
|
4
|
+
<tsx><![CDATA[
|
|
5
|
+
<NumberField
|
|
6
|
+
defaultValue={100}
|
|
7
|
+
label="Amount"
|
|
8
|
+
description="Enter the amount in your local currency."
|
|
9
|
+
/>
|
|
10
|
+
]]></tsx>
|
|
11
|
+
<notes>Default split steppers. Label scrub on when label is present.</notes>
|
|
12
|
+
</example>
|
|
13
|
+
|
|
14
|
+
<example title="Form name + bounds">
|
|
15
|
+
<tsx><![CDATA[
|
|
16
|
+
<Form>
|
|
17
|
+
<NumberField name="quantity" defaultValue={1} min={0} max={99} step={1} label="Quantity" />
|
|
18
|
+
</Form>
|
|
19
|
+
]]></tsx>
|
|
20
|
+
<notes>`name` / min / max / step / label on NumberField. `Form` is `@base-ui/react/form`.</notes>
|
|
21
|
+
</example>
|
|
22
|
+
|
|
23
|
+
<example title="Stepper placement grouped">
|
|
24
|
+
<tsx><![CDATA[
|
|
25
|
+
<NumberField defaultValue={5} label="Count" stepperPlacement="grouped" />
|
|
26
|
+
]]></tsx>
|
|
27
|
+
<notes>Both steppers at inline-end (LTR right / RTL left). Steppers are fixed secondary IconButtons.</notes>
|
|
28
|
+
</example>
|
|
29
|
+
|
|
30
|
+
<example title="Full width input grow">
|
|
31
|
+
<tsx><![CDATA[
|
|
32
|
+
<NumberField defaultValue={25} label="Amount" fullWidth />
|
|
33
|
+
]]></tsx>
|
|
34
|
+
<notes>Row fills the column; only the numeric input flex-grows.</notes>
|
|
35
|
+
</example>
|
|
36
|
+
|
|
37
|
+
<example title="Plain label without scrub">
|
|
38
|
+
<tsx><![CDATA[
|
|
39
|
+
<NumberField defaultValue={10} label="Amount" labelScrub={false} />
|
|
40
|
+
]]></tsx>
|
|
41
|
+
<notes>Field label without ScrubArea.</notes>
|
|
42
|
+
</example>
|
|
43
|
+
</patterns>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<props surface="number-field">
|
|
3
|
+
<when_to_use>
|
|
4
|
+
<item>Numeric values with optional increment/decrement and label scrub</item>
|
|
5
|
+
<item>Form fields that submit a number via `name` (min/max/step/format on the same NumberField)</item>
|
|
6
|
+
<item>Textfield-aligned label / description / error with Field validation</item>
|
|
7
|
+
</when_to_use>
|
|
8
|
+
<when_not_to_use>
|
|
9
|
+
<item>Exposing Group / Decrement / Increment / ScrubArea as public parts — they stay internal</item>
|
|
10
|
+
<item>Textfield start/end addon API or custom stepper children in v1</item>
|
|
11
|
+
<item>Exposing a NumberField size or variant prop — steppers stay fixed IconButton `size="s"` / `variant="secondary"`</item>
|
|
12
|
+
<item>Composing a public `NumberField.Input` — chrome and steppers live on NumberField</item>
|
|
13
|
+
</when_not_to_use>
|
|
14
|
+
<prop name="description" kind="react">
|
|
15
|
+
<description>Helper copy rendered with `Field.Description` and `Text` while the field is valid. When a string, also sets `aria-roledescription` on the numeric input.</description>
|
|
16
|
+
</prop>
|
|
17
|
+
<prop name="error" kind="react">
|
|
18
|
+
<description>Error copy rendered with `Field.Error` and `Text` in the same slot as `description`. Replaces description while invalid and dirty.</description>
|
|
19
|
+
</prop>
|
|
20
|
+
<prop name="fitContent" kind="react">
|
|
21
|
+
<description>When `true`, sets `field-sizing: content` on the numeric input only. Steppers stay intrinsic.</description>
|
|
22
|
+
</prop>
|
|
23
|
+
<prop name="fullWidth" kind="react">
|
|
24
|
+
<description>When `true`, field and control row fill the column; only the numeric input flex-grows. Steppers stay intrinsic. Prefer over CSS `width: 100%` on the field.</description>
|
|
25
|
+
</prop>
|
|
26
|
+
<prop name="label" kind="react">
|
|
27
|
+
<description>Visible label rendered with shared internal `FieldLabel`. Hosts scrub when `labelScrub` is true.</description>
|
|
28
|
+
</prop>
|
|
29
|
+
<prop name="labelScrub" kind="react">
|
|
30
|
+
<description>When `true` (default) and `label` is set, wrap the label in Base UI scrub. When `false` or no label, plain field label.</description>
|
|
31
|
+
</prop>
|
|
32
|
+
<prop name="stepperPlacement" kind="react">
|
|
33
|
+
<description>Where steppers sit relative to the input: `split` (default, button|input|button) or `grouped` (both at inline-end; physical right in LTR, left in RTL via document direction).</description>
|
|
34
|
+
</prop>
|
|
35
|
+
</props>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<usage surface="number-field">
|
|
3
|
+
<do>Use a single `NumberField` for value/min/max/step/name plus label/helper/steppers</do>
|
|
4
|
+
<do>Put Field validation props (`invalid`, `dirty`, `touched`, `validate`, …) on NumberField</do>
|
|
5
|
+
<do>Steppers are fixed IconButton `size="s"` / `variant="secondary"` with uniform addon padding — do not expose variant/size</do>
|
|
6
|
+
<do>Use `fullWidth` when the numeric input should grow; steppers stay compact</do>
|
|
7
|
+
<do>Turn off label scrub with `labelScrub={false}` when drag-on-label is unwanted</do>
|
|
8
|
+
<dont>Export or compose public Group / Decrement / Increment / ScrubArea / ScrubAreaCursor</dont>
|
|
9
|
+
<dont>Compose a public `NumberField.Input` — there is no Input part</dont>
|
|
10
|
+
<dont>Add Textfield start/end addon API or custom stepper children in v1</dont>
|
|
11
|
+
<dont>Invent CSS width hacks when `fullWidth` / `fitContent` cover sizing</dont>
|
|
12
|
+
</usage>
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<meta id="otp-field" title="OTPField" category="form" shared_contract="otp-field">
|
|
3
|
-
<summary>Field-wrapped one-time code slots. Default slots compose Textfield controlOnly; one label/helper on
|
|
3
|
+
<summary>Field-wrapped one-time code slots. Default slots compose Textfield controlOnly; one label/helper on OTPField.</summary>
|
|
4
4
|
<exports>
|
|
5
5
|
<export name="OTPField" />
|
|
6
|
-
<export name="OTPField.Root" />
|
|
7
|
-
<export name="OTPField.Input" />
|
|
8
|
-
<export name="OTPField.Separator" />
|
|
9
6
|
</exports>
|
|
10
7
|
<related>
|
|
11
8
|
<ref id="textfield" />
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<patterns surface="otp-field">
|
|
3
3
|
<example title="Labeled six-slot code">
|
|
4
4
|
<tsx><![CDATA[
|
|
5
|
-
<OTPField
|
|
5
|
+
<OTPField
|
|
6
6
|
length={6}
|
|
7
7
|
label="Verification code"
|
|
8
8
|
description="Enter the 6-character code we sent to your device."
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
{Array.from({ length: 6 }, (_, slotIndex) => (
|
|
11
11
|
<OTPField.Input key={`character-${slotIndex + 1}`} />
|
|
12
12
|
))}
|
|
13
|
-
</OTPField
|
|
13
|
+
</OTPField>
|
|
14
14
|
]]></tsx>
|
|
15
15
|
<notes>Explicit Inputs. First slot uses the field label; later slots get generated names.</notes>
|
|
16
16
|
</example>
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
<example title="Form name + autoSubmit">
|
|
19
19
|
<tsx><![CDATA[
|
|
20
20
|
<Form>
|
|
21
|
-
<OTPField
|
|
21
|
+
<OTPField length={6} name="verificationCode" label="Verification code" autoSubmit>
|
|
22
22
|
<OTPField.Input />
|
|
23
23
|
<OTPField.Input />
|
|
24
24
|
<OTPField.Input />
|
|
25
25
|
<OTPField.Input />
|
|
26
26
|
<OTPField.Input />
|
|
27
27
|
<OTPField.Input />
|
|
28
|
-
</OTPField
|
|
28
|
+
</OTPField>
|
|
29
29
|
</Form>
|
|
30
30
|
]]></tsx>
|
|
31
31
|
<notes>One concatenated form value. `autoSubmit` submits when complete. `Form` is `@base-ui/react/form`.</notes>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
<example title="Grouped slots with Separator">
|
|
35
35
|
<tsx><![CDATA[
|
|
36
|
-
<OTPField
|
|
36
|
+
<OTPField length={6} label="Verification code">
|
|
37
37
|
<Stack columnGap="s" direction="row">
|
|
38
38
|
<OTPField.Input />
|
|
39
39
|
<OTPField.Input />
|
|
@@ -45,21 +45,21 @@
|
|
|
45
45
|
<OTPField.Input />
|
|
46
46
|
<OTPField.Input />
|
|
47
47
|
</Stack>
|
|
48
|
-
</OTPField
|
|
48
|
+
</OTPField>
|
|
49
49
|
]]></tsx>
|
|
50
50
|
<notes>Separator is not an input and is not counted in `length`. Stack owns group gaps.</notes>
|
|
51
51
|
</example>
|
|
52
52
|
|
|
53
53
|
<example title="Equal-grow in a form column">
|
|
54
54
|
<tsx><![CDATA[
|
|
55
|
-
<OTPField
|
|
55
|
+
<OTPField length={6} label="Verification code" fullWidth>
|
|
56
56
|
<OTPField.Input />
|
|
57
57
|
<OTPField.Input />
|
|
58
58
|
<OTPField.Input />
|
|
59
59
|
<OTPField.Input />
|
|
60
60
|
<OTPField.Input />
|
|
61
61
|
<OTPField.Input />
|
|
62
|
-
</OTPField
|
|
62
|
+
</OTPField>
|
|
63
63
|
]]></tsx>
|
|
64
64
|
<notes>Default hugs. `fullWidth` fills the column and grows slots equally.</notes>
|
|
65
65
|
</example>
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
</when_to_use>
|
|
8
8
|
<when_not_to_use>
|
|
9
9
|
<item>Auto-generating Inputs from `length` — always list one `OTPField.Input` per slot</item>
|
|
10
|
-
<item>Per-slot label, description, or error — Field chrome is on
|
|
10
|
+
<item>Per-slot label, description, or error — Field chrome is on OTPField only</item>
|
|
11
11
|
<item>Swapping the slot host via `render` — host is always a native `input`; chrome is Textfield `controlOnly`</item>
|
|
12
|
-
<item>Inventing CSS `width: 100%` on slots when
|
|
12
|
+
<item>Inventing CSS `width: 100%` on slots when OTPField `fullWidth` covers equal-grow</item>
|
|
13
13
|
</when_not_to_use>
|
|
14
14
|
<prop name="description" kind="react">
|
|
15
15
|
<description>Helper copy rendered with `Field.Description` and `Text` while the field is valid.</description>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<usage surface="otp-field">
|
|
3
3
|
<do>List exactly `length` `OTPField.Input` children (Array.from or explicit)</do>
|
|
4
|
-
<do>Put `label` / `description` / `error` on `OTPField
|
|
4
|
+
<do>Put `label` / `description` / `error` on `OTPField`</do>
|
|
5
5
|
<do>Let the first slot take the field label; later slots get generated `Character N of {length}` unless you pass `aria-label`</do>
|
|
6
6
|
<do>Group slots with Stack + `OTPField.Separator` when the code is shown as chunks</do>
|
|
7
|
-
<do>Span the form column with
|
|
8
|
-
<do>Keep error copy on
|
|
7
|
+
<do>Span the form column with `OTPField` `fullWidth` so slots grow equally</do>
|
|
8
|
+
<do>Keep error copy on `OTPField` — invalid wiggle is extra chrome, not the only signal</do>
|
|
9
9
|
<dont>Pass `render` on Input — slot is always a native `input`; chrome is Textfield `controlOnly`</dont>
|
|
10
10
|
<dont>Put label/description/error on each slot</dont>
|
|
11
|
-
<dont>Expect
|
|
11
|
+
<dont>Expect `OTPField` to auto-generate Inputs from `length`</dont>
|
|
12
12
|
<dont>Invent a `groups` prop or width CSS on slots when Stack / `fullWidth` cover layout</dont>
|
|
13
13
|
</usage>
|
package/dist/specs/index.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<index package="@viraui/react" version="2026.7.0-next.
|
|
2
|
+
<index package="@viraui/react" version="2026.7.0-next.1" generated="2026-10-07T14:24:21.368Z">
|
|
3
3
|
<categories>
|
|
4
4
|
<category id="layout" />
|
|
5
5
|
<category id="action" />
|
|
@@ -151,6 +151,16 @@
|
|
|
151
151
|
<unit kind="patterns" href="components/dialog/patterns.xml" />
|
|
152
152
|
</units>
|
|
153
153
|
</entry>
|
|
154
|
+
<entry id="disclosure" category="layout" title="Disclosure">
|
|
155
|
+
<summary>Single-section expand/collapse wrapping Base UI Collapsible. Default Trigger is Surface with render → Collapsible Trigger; Panel is a height motion shell with no default content padding. Use Accordio…</summary>
|
|
156
|
+
<units>
|
|
157
|
+
<unit kind="meta" href="components/disclosure/meta.xml" />
|
|
158
|
+
<unit kind="a11y" href="components/disclosure/a11y.xml" />
|
|
159
|
+
<unit kind="props" href="components/disclosure/props.xml" />
|
|
160
|
+
<unit kind="usage" href="components/disclosure/usage.xml" />
|
|
161
|
+
<unit kind="patterns" href="components/disclosure/patterns.xml" />
|
|
162
|
+
</units>
|
|
163
|
+
</entry>
|
|
154
164
|
<entry id="elevator" category="effect" title="Elevator">
|
|
155
165
|
<summary>No-DOM elevation utility that merges shadow hooks onto valid element children.</summary>
|
|
156
166
|
<units>
|
|
@@ -251,8 +261,18 @@
|
|
|
251
261
|
<unit kind="patterns" href="components/meter/patterns.xml" />
|
|
252
262
|
</units>
|
|
253
263
|
</entry>
|
|
264
|
+
<entry id="number-field" category="form" title="NumberField">
|
|
265
|
+
<summary>Single public NumberField with Field chrome, internal IconButton steppers, and optional label scrub. Group / Decrement / Increment / ScrubArea stay internal.</summary>
|
|
266
|
+
<units>
|
|
267
|
+
<unit kind="meta" href="components/number-field/meta.xml" />
|
|
268
|
+
<unit kind="a11y" href="components/number-field/a11y.xml" />
|
|
269
|
+
<unit kind="props" href="components/number-field/props.xml" />
|
|
270
|
+
<unit kind="usage" href="components/number-field/usage.xml" />
|
|
271
|
+
<unit kind="patterns" href="components/number-field/patterns.xml" />
|
|
272
|
+
</units>
|
|
273
|
+
</entry>
|
|
254
274
|
<entry id="otp-field" category="form" title="OTPField">
|
|
255
|
-
<summary>Field-wrapped one-time code slots. Default slots compose Textfield controlOnly; one label/helper on
|
|
275
|
+
<summary>Field-wrapped one-time code slots. Default slots compose Textfield controlOnly; one label/helper on OTPField.</summary>
|
|
256
276
|
<units>
|
|
257
277
|
<unit kind="meta" href="components/otp-field/meta.xml" />
|
|
258
278
|
<unit kind="a11y" href="components/otp-field/a11y.xml" />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viraui/react",
|
|
3
|
-
"version": "2026.7.0-next.
|
|
3
|
+
"version": "2026.7.0-next.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@base-ui/react": ">=1.8.0",
|
|
31
|
-
"@viraui/foundation": "2026.7.0-next.
|
|
31
|
+
"@viraui/foundation": "2026.7.0-next.1",
|
|
32
32
|
"@viraui/icons": "2026.1.0",
|
|
33
33
|
"@viraui/postcss-config": "2026.0.0",
|
|
34
34
|
"@viraui/tsconfig": "2026.0.0",
|