@viraui/react 2026.7.0-next.0 → 2026.7.0
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.css +1 -1
- 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
|
@@ -6,19 +6,19 @@ import type * as React from 'react';
|
|
|
6
6
|
* Includes standard `div` attributes such as `id`, `role`, `title`, data attributes, and event handlers,
|
|
7
7
|
* plus Base UI `render` support for replacing the default item root.
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
9
|
+
* @defaultValue Native div pass-through props keep React defaults.
|
|
10
10
|
*/
|
|
11
11
|
export type MasonryItemProps = React.ComponentPropsWithRef<'div'> & {
|
|
12
12
|
/**
|
|
13
13
|
* Replaces the default `div` root using Base UI render semantics.
|
|
14
14
|
*
|
|
15
|
-
* @
|
|
15
|
+
* @defaultValue The item renders a `div` root.
|
|
16
16
|
*/
|
|
17
17
|
render?: useRender.RenderProp;
|
|
18
18
|
/**
|
|
19
19
|
* Ref forwarded to the rendered item root element.
|
|
20
20
|
*
|
|
21
|
-
* @
|
|
21
|
+
* @defaultValue No ref is attached.
|
|
22
22
|
*/
|
|
23
23
|
ref?: React.Ref<HTMLElement>;
|
|
24
24
|
};
|
|
@@ -19,19 +19,19 @@ export type MasonryBreakpointCols = {
|
|
|
19
19
|
* Includes standard `div` attributes such as `id`, `role`, `title`, data attributes, and event handlers,
|
|
20
20
|
* plus mobile-first React column distribution controls.
|
|
21
21
|
*
|
|
22
|
-
* @
|
|
22
|
+
* @defaultValue Native div pass-through props keep React defaults.
|
|
23
23
|
*/
|
|
24
24
|
export type MasonryProps = React.ComponentPropsWithRef<'div'> & {
|
|
25
25
|
/**
|
|
26
26
|
* Replaces the default `div` root using Base UI render semantics.
|
|
27
27
|
*
|
|
28
|
-
* @
|
|
28
|
+
* @defaultValue The masonry renders a `div` root.
|
|
29
29
|
*/
|
|
30
30
|
render?: useRender.RenderProp;
|
|
31
31
|
/**
|
|
32
32
|
* Sets the gap between columns (`--vui-masonry-gap`) and the `rowGap` on each column `Stack`.
|
|
33
33
|
*
|
|
34
|
-
* @
|
|
34
|
+
* @defaultValue 'l'
|
|
35
35
|
*/
|
|
36
36
|
gap?: StackProps['columnGap'];
|
|
37
37
|
/**
|
|
@@ -41,7 +41,7 @@ export type MasonryProps = React.ComponentPropsWithRef<'div'> & {
|
|
|
41
41
|
* root's content-box inline size. Keys may be in any order; the largest
|
|
42
42
|
* matching breakpoint wins. Non-finite keys are ignored.
|
|
43
43
|
*
|
|
44
|
-
* @
|
|
44
|
+
* @defaultValue { default: 1, 480: 2, 768: 3, 960: 4, 1280: 5, 2560: 6 }
|
|
45
45
|
*/
|
|
46
46
|
breakpointCols?: MasonryBreakpointCols;
|
|
47
47
|
};
|
|
@@ -3,26 +3,26 @@ import type * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Public Menu.CheckboxItem props.
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @defaultValue `closeOnClick` is `false`.
|
|
7
7
|
*/
|
|
8
8
|
export type MenuCheckboxItemProps = MenuCheckboxItemPrimitive.Props & {
|
|
9
9
|
/**
|
|
10
10
|
* Decorative leading node rendered before the item label.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @defaultValue No addon is rendered.
|
|
13
13
|
*/
|
|
14
14
|
addon?: React.ReactNode;
|
|
15
15
|
/**
|
|
16
16
|
* End-aligned secondary text (e.g. keyboard shortcut) before the check indicator.
|
|
17
17
|
* Rendered muted `xs`.
|
|
18
18
|
*
|
|
19
|
-
* @
|
|
19
|
+
* @defaultValue No note is rendered.
|
|
20
20
|
*/
|
|
21
21
|
note?: React.ReactNode;
|
|
22
22
|
/**
|
|
23
23
|
* Visual sentiment. `destructive` uses highlight-red wash + text.
|
|
24
24
|
*
|
|
25
|
-
* @
|
|
25
|
+
* @defaultValue Neutral item styling.
|
|
26
26
|
*/
|
|
27
27
|
sentiment?: 'destructive';
|
|
28
28
|
};
|
|
@@ -3,25 +3,25 @@ import type * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Public Menu.Item props.
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
7
7
|
*/
|
|
8
8
|
export type MenuItemProps = MenuItemPrimitive.Props & {
|
|
9
9
|
/**
|
|
10
10
|
* Decorative leading node rendered before the item label.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @defaultValue No addon is rendered.
|
|
13
13
|
*/
|
|
14
14
|
addon?: React.ReactNode;
|
|
15
15
|
/**
|
|
16
16
|
* End-aligned secondary text (e.g. keyboard shortcut). Rendered muted `xs`.
|
|
17
17
|
*
|
|
18
|
-
* @
|
|
18
|
+
* @defaultValue No note is rendered.
|
|
19
19
|
*/
|
|
20
20
|
note?: React.ReactNode;
|
|
21
21
|
/**
|
|
22
22
|
* Visual sentiment. `destructive` uses highlight-red wash + text.
|
|
23
23
|
*
|
|
24
|
-
* @
|
|
24
|
+
* @defaultValue Neutral item styling.
|
|
25
25
|
*/
|
|
26
26
|
sentiment?: 'destructive';
|
|
27
27
|
};
|
|
@@ -3,25 +3,25 @@ import type * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Public Menu.LinkItem props.
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
7
7
|
*/
|
|
8
8
|
export type MenuLinkItemProps = MenuLinkItemPrimitive.Props & {
|
|
9
9
|
/**
|
|
10
10
|
* Decorative leading node rendered before the item label.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @defaultValue No addon is rendered.
|
|
13
13
|
*/
|
|
14
14
|
addon?: React.ReactNode;
|
|
15
15
|
/**
|
|
16
16
|
* End-aligned secondary text (e.g. keyboard shortcut). Rendered muted `xs`.
|
|
17
17
|
*
|
|
18
|
-
* @
|
|
18
|
+
* @defaultValue No note is rendered.
|
|
19
19
|
*/
|
|
20
20
|
note?: React.ReactNode;
|
|
21
21
|
/**
|
|
22
22
|
* Visual sentiment. `destructive` uses highlight-red wash + text.
|
|
23
23
|
*
|
|
24
|
-
* @
|
|
24
|
+
* @defaultValue Neutral item styling.
|
|
25
25
|
*/
|
|
26
26
|
sentiment?: 'destructive';
|
|
27
27
|
};
|
|
@@ -9,7 +9,7 @@ type MenuPopupPositionerProps = Omit<MenuPositioner.Props, 'className' | 'style'
|
|
|
9
9
|
* defaults to `2`. RTL placement comes from Base UI `DirectionProvider`;
|
|
10
10
|
* app must also set HTML/`dir` (or `direction`) so portaled CSS inherits RTL.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @defaultValue `sideOffset` is `2`.
|
|
13
13
|
*/
|
|
14
14
|
export type MenuPopupProps = MenuPopupPositionerProps & {
|
|
15
15
|
children?: React.ReactNode;
|
|
@@ -18,7 +18,7 @@ export type MenuPopupProps = MenuPopupPositionerProps & {
|
|
|
18
18
|
* Omit for Base UI default (`document.body` from the module window —
|
|
19
19
|
* iframe hosts must pass the iframe document body explicitly).
|
|
20
20
|
*
|
|
21
|
-
* @
|
|
21
|
+
* @defaultValue Base UI FloatingPortal resolution
|
|
22
22
|
*/
|
|
23
23
|
container?: React.ComponentProps<typeof PrimitiveMenu.Portal>['container'];
|
|
24
24
|
};
|
|
@@ -3,13 +3,13 @@ import type * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Public Menu.RadioGroup props.
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @defaultValue No label is rendered.
|
|
7
7
|
*/
|
|
8
8
|
export type MenuRadioGroupProps = MenuRadioGroupPrimitive.Props & {
|
|
9
9
|
/**
|
|
10
10
|
* Optional accessible group label rendered with `Menu.GroupLabel`.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @defaultValue No label is rendered.
|
|
13
13
|
*/
|
|
14
14
|
label?: React.ReactNode;
|
|
15
15
|
};
|
|
@@ -3,26 +3,26 @@ import type * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Public Menu.RadioItem props.
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @defaultValue `closeOnClick` is `false`.
|
|
7
7
|
*/
|
|
8
8
|
export type MenuRadioItemProps = MenuRadioItemPrimitive.Props & {
|
|
9
9
|
/**
|
|
10
10
|
* Decorative leading node rendered before the item label.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @defaultValue No addon is rendered.
|
|
13
13
|
*/
|
|
14
14
|
addon?: React.ReactNode;
|
|
15
15
|
/**
|
|
16
16
|
* End-aligned secondary text (e.g. keyboard shortcut) before the check indicator.
|
|
17
17
|
* Rendered muted `xs`.
|
|
18
18
|
*
|
|
19
|
-
* @
|
|
19
|
+
* @defaultValue No note is rendered.
|
|
20
20
|
*/
|
|
21
21
|
note?: React.ReactNode;
|
|
22
22
|
/**
|
|
23
23
|
* Visual sentiment. `destructive` uses highlight-red wash + text.
|
|
24
24
|
*
|
|
25
|
-
* @
|
|
25
|
+
* @defaultValue Neutral item styling.
|
|
26
26
|
*/
|
|
27
27
|
sentiment?: 'destructive';
|
|
28
28
|
};
|
|
@@ -3,7 +3,7 @@ import type * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Public Menu.Separator props.
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @defaultValue `orientation` is `'horizontal'`.
|
|
7
7
|
*/
|
|
8
8
|
export type MenuSeparatorProps = React.ComponentProps<typeof PrimitiveMenu.Separator>;
|
|
9
9
|
export declare const MenuSeparator: React.FC<MenuSeparatorProps>;
|
|
@@ -3,19 +3,19 @@ import type * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Public Menu.SubmenuTrigger props.
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @defaultValue Trailing end chevron; RTL mirror via CSS `:dir(rtl)`.
|
|
7
7
|
*/
|
|
8
8
|
export type MenuSubmenuTriggerProps = MenuSubmenuTriggerPrimitive.Props & {
|
|
9
9
|
/**
|
|
10
10
|
* Decorative leading node rendered before the item label.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @defaultValue No addon is rendered.
|
|
13
13
|
*/
|
|
14
14
|
addon?: React.ReactNode;
|
|
15
15
|
/**
|
|
16
16
|
* Visual sentiment. `destructive` uses highlight-red wash + text.
|
|
17
17
|
*
|
|
18
|
-
* @
|
|
18
|
+
* @defaultValue Neutral item styling.
|
|
19
19
|
*/
|
|
20
20
|
sentiment?: 'destructive';
|
|
21
21
|
};
|
|
@@ -17,7 +17,7 @@ import type * as React from 'react';
|
|
|
17
17
|
* triggers. `children` may be a node or a `({ payload }) => ReactNode` render function
|
|
18
18
|
* for per-trigger content.
|
|
19
19
|
*
|
|
20
|
-
* @
|
|
20
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
21
21
|
*/
|
|
22
22
|
export type MenuProps = MenuRoot.Props;
|
|
23
23
|
/**
|
|
@@ -26,7 +26,7 @@ export type MenuProps = MenuRoot.Props;
|
|
|
26
26
|
* Pass-through to Base UI `Menu.Trigger`. Use `render` for the visible control
|
|
27
27
|
* (`Button`, `IconButton`, or another element).
|
|
28
28
|
*
|
|
29
|
-
* @
|
|
29
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
30
30
|
*/
|
|
31
31
|
export type MenuTriggerProps = MenuTriggerNamespace.Props;
|
|
32
32
|
/**
|
|
@@ -35,7 +35,7 @@ export type MenuTriggerProps = MenuTriggerNamespace.Props;
|
|
|
35
35
|
* Pass-through to Base UI `Menu.SubmenuRoot`. Compose `Menu.SubmenuTrigger` and
|
|
36
36
|
* nested `Menu.Popup` as children.
|
|
37
37
|
*
|
|
38
|
-
* @
|
|
38
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
39
39
|
*/
|
|
40
40
|
export type MenuSubmenuProps = React.ComponentProps<typeof PrimitiveMenu.SubmenuRoot>;
|
|
41
41
|
export declare const MenuTrigger: PrimitiveMenu.Trigger;
|
|
@@ -8,19 +8,19 @@ import type * as React from 'react';
|
|
|
8
8
|
* and `getAriaValueText`, plus optional label, description, value display, and
|
|
9
9
|
* highlight `variant` for track/indicator color.
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
11
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
12
12
|
*/
|
|
13
13
|
export type MeterProps = MeterRoot.Props & {
|
|
14
14
|
/**
|
|
15
15
|
* Visible label rendered through `Meter.Label` with shared internal `FieldLabel`.
|
|
16
16
|
*
|
|
17
|
-
* @
|
|
17
|
+
* @defaultValue No label is rendered.
|
|
18
18
|
*/
|
|
19
19
|
label?: React.ReactNode;
|
|
20
20
|
/**
|
|
21
21
|
* Static helper copy rendered with `Text` below the meter track.
|
|
22
22
|
*
|
|
23
|
-
* @
|
|
23
|
+
* @defaultValue No description is rendered.
|
|
24
24
|
*/
|
|
25
25
|
description?: React.ReactNode;
|
|
26
26
|
/**
|
|
@@ -29,7 +29,7 @@ export type MeterProps = MeterRoot.Props & {
|
|
|
29
29
|
* Pass `true` for Base UI default formatting, or a function matching
|
|
30
30
|
* `Meter.Value` `children` to customize the printed label.
|
|
31
31
|
*
|
|
32
|
-
* @
|
|
32
|
+
* @defaultValue Value UI is hidden.
|
|
33
33
|
*/
|
|
34
34
|
renderValue?: boolean | Exclude<React.ComponentProps<typeof PrimitiveMeter.Value>['children'], null | undefined>;
|
|
35
35
|
/**
|
|
@@ -37,7 +37,7 @@ export type MeterProps = MeterRoot.Props & {
|
|
|
37
37
|
* indicator; highlight token names tint both track (wash) and indicator
|
|
38
38
|
* via `--highlight-*`, matching Chip highlight variants.
|
|
39
39
|
*
|
|
40
|
-
* @
|
|
40
|
+
* @defaultValue 'primary'
|
|
41
41
|
*/
|
|
42
42
|
variant?: 'primary' | ThemeTypes['highlight'];
|
|
43
43
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{.viraui__number-field-module__NumberField_l7i9a{display:contents}.viraui__number-field-module__Field_Ud43i{--vui-textfield-input-height:var(--space-2xl);--vui-textfield-control-group-background:var(--base-1);--vui-textfield-control-group-color:var(--global-foreground);--vui-textfield-control-group-border-color:var(--global-contrast);--vui-textfield-control-group-border-radius:var(--radius-m);--vui-field-label-padding-inline:calc(var(--vui-textfield-control-group-border-radius) / 2);max-block-size:min-content;&:has([required]) .viraui__number-field-module__Label_-Sji0:after{content:" *";color:var(--highlight-red)}}.viraui__number-field-module__ControlGroup_CX5th{box-sizing:border-box;block-size:round(to-zero,var(--vui-textfield-input-height),2px);background:var(--vui-textfield-control-group-background);color:var(--vui-textfield-control-group-color);border:1px solid var(--vui-textfield-control-group-border-color);border-radius:var(--vui-textfield-control-group-border-radius);&:has(.viraui__number-field-module__CustomBasicInput_6fmMO:focus),&:has(.viraui__number-field-module__CustomBasicInput_6fmMO:focus-visible),&:has(.viraui__number-field-module__CustomBasicInput_6fmMO[data-focused]){outline:var(--outline);outline-offset:var(--outline-offset)}&:has(.viraui__number-field-module__CustomBasicInput_6fmMO[data-invalid][data-dirty]){--vui-textfield-control-group-border-color:var(--highlight-red);box-shadow:none;outline-color:oklab(from var(--highlight-red) l a b/.5)}&:has(.viraui__number-field-module__CustomBasicInput_6fmMO:disabled),&:has(.viraui__number-field-module__CustomBasicInput_6fmMO[data-disabled]){--vui-textfield-control-group-background:var(--global-disabled-background);--vui-textfield-control-group-border-color:#0000;--vui-textfield-control-group-color:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}}.viraui__number-field-module__Addon_QwT1q{min-inline-size:var(--space-xl)}.viraui__number-field-module__ScrubArea_3Wzje{-webkit-user-select:none;user-select:none;:where(& *){cursor:ew-resize;-webkit-user-select:none;user-select:none}}.viraui__number-field-module__Description_GWcij{padding-inline:calc(var(--vui-textfield-control-group-border-radius) / 2)}}@layer viraui.overrides{.viraui__number-field-module__CustomBasicInput_6fmMO{text-align:center;&:focus,&:focus-visible{outline:none}}}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { FieldRoot } from '@base-ui/react/field';
|
|
2
|
+
import { NumberFieldRoot as PrimitiveNumberFieldRoot } from '@base-ui/react/number-field';
|
|
3
|
+
import { BasicInputProps } from '../basic-input';
|
|
4
|
+
import type * as React from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Public NumberField props.
|
|
7
|
+
*
|
|
8
|
+
* Base UI Number Field Root pass-through (`value`, `min`/`max`/`step`, `format`, `name`,
|
|
9
|
+
* `disabled`, `readOnly`, …) plus Field chrome, IconButton steppers, scrub, and width knobs.
|
|
10
|
+
* String `description` also sets numeric-input `aria-roledescription`. Group / Decrement /
|
|
11
|
+
* Increment / ScrubArea stay internal.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
14
|
+
*/
|
|
15
|
+
export type NumberFieldProps = Omit<PrimitiveNumberFieldRoot.Props, 'render' | 'children' | 'ref' | 'style'> & Omit<FieldRoot.Props, 'ref' | 'render' | 'name' | 'style' | keyof PrimitiveNumberFieldRoot.Props> & {
|
|
16
|
+
/**
|
|
17
|
+
* Ref to the visible numeric input.
|
|
18
|
+
*
|
|
19
|
+
* @defaultValue No ref is attached.
|
|
20
|
+
*/
|
|
21
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
22
|
+
/**
|
|
23
|
+
* Presentation styles on the Field chrome host (not the `display: contents` Root).
|
|
24
|
+
*
|
|
25
|
+
* @defaultValue No inline style is applied.
|
|
26
|
+
*/
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
/**
|
|
29
|
+
* Visible label rendered with shared internal `FieldLabel`. When present and
|
|
30
|
+
* `labelScrub` is true, the label hosts Base UI scrub.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue No label is rendered.
|
|
33
|
+
*/
|
|
34
|
+
label?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Helper copy rendered with `Field.Description` and `Text` while the field is valid.
|
|
37
|
+
* When a string, also sets `aria-roledescription` on the numeric input.
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue No description is rendered.
|
|
40
|
+
*/
|
|
41
|
+
description?: React.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Error copy rendered with `Field.Error` and `Text` in the same slot as `description`.
|
|
44
|
+
* Replaces description while the field is invalid and dirty.
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue No static error copy is rendered.
|
|
47
|
+
*/
|
|
48
|
+
error?: React.ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* Where decrement/increment sit relative to the numeric input.
|
|
51
|
+
* `split` = button | input | button; `grouped` = both steppers at inline-end
|
|
52
|
+
* (physical right in LTR, left in RTL — follows document/`dir` / Base UI direction).
|
|
53
|
+
*
|
|
54
|
+
* @defaultValue 'split'
|
|
55
|
+
*/
|
|
56
|
+
stepperPlacement?: 'split' | 'grouped';
|
|
57
|
+
/**
|
|
58
|
+
* When `true` and `label` is set, wrap the label in Base UI `ScrubArea`.
|
|
59
|
+
* When `false` or no label, render a plain field label.
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue true
|
|
62
|
+
*/
|
|
63
|
+
labelScrub?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* When `true`, field and control row fill the column; only the numeric input flex-grows.
|
|
66
|
+
* Steppers stay intrinsic size (`data-grow="false"`).
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue false
|
|
69
|
+
*/
|
|
70
|
+
fullWidth?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* When `true`, sets `field-sizing: content` on the numeric input only.
|
|
73
|
+
*
|
|
74
|
+
* @defaultValue undefined (browser fixed)
|
|
75
|
+
*/
|
|
76
|
+
fitContent?: BasicInputProps['fitContent'];
|
|
77
|
+
};
|
|
78
|
+
export declare const NumberField: React.FC<NumberFieldProps>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import './number-field.css';
|
|
3
|
+
import { clsx } from "../../core/clsx.js";
|
|
4
|
+
import { ChromeMinus, ChromePlus } from "../../internal/chrome-icons/chrome-icons.js";
|
|
5
|
+
import { BasicInput } from "../basic-input/basic-input.js";
|
|
6
|
+
import { FieldHelperCopy } from "../basic-input/field-helper-copy.js";
|
|
7
|
+
import { FieldLabel } from "../basic-input/field-label.js";
|
|
8
|
+
import { Stack } from "../stack/stack.js";
|
|
9
|
+
import { IconButton } from "../icon-button/icon-button.js";
|
|
10
|
+
import number_field_module_default from "./number-field.module.js";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Field } from "@base-ui/react/field";
|
|
13
|
+
import { NumberField } from "@base-ui/react/number-field";
|
|
14
|
+
//#region src/components/number-field/number-field.tsx
|
|
15
|
+
var renderStepperAddon = (position, children) => /* @__PURE__ */ jsx(Stack, {
|
|
16
|
+
className: number_field_module_default.Addon,
|
|
17
|
+
"data-grow": "false",
|
|
18
|
+
"data-position": position,
|
|
19
|
+
"data-shrink": "false",
|
|
20
|
+
hAlign: "center",
|
|
21
|
+
hPadding: "xs",
|
|
22
|
+
inline: true,
|
|
23
|
+
vAlign: "center",
|
|
24
|
+
vPadding: "xs",
|
|
25
|
+
children
|
|
26
|
+
});
|
|
27
|
+
var NumberField$1 = ({ className, description, dirty, disabled, error, fitContent, fullWidth = false, invalid, label, labelScrub = true, ref, stepperPlacement = "split", style, touched, validate, validationDebounceTime, validationMode, ...rootProps }) => {
|
|
28
|
+
const decrement = /* @__PURE__ */ jsx(NumberField.Decrement, { render: /* @__PURE__ */ jsx(IconButton, {
|
|
29
|
+
"aria-label": "Decrement",
|
|
30
|
+
icon: /* @__PURE__ */ jsx(ChromeMinus, {}),
|
|
31
|
+
size: "s",
|
|
32
|
+
type: "button",
|
|
33
|
+
variant: "secondary"
|
|
34
|
+
}) });
|
|
35
|
+
const increment = /* @__PURE__ */ jsx(NumberField.Increment, { render: /* @__PURE__ */ jsx(IconButton, {
|
|
36
|
+
"aria-label": "Increment",
|
|
37
|
+
icon: /* @__PURE__ */ jsx(ChromePlus, {}),
|
|
38
|
+
size: "s",
|
|
39
|
+
type: "button",
|
|
40
|
+
variant: "secondary"
|
|
41
|
+
}) });
|
|
42
|
+
const stepperPair = /* @__PURE__ */ jsxs(Stack, {
|
|
43
|
+
columnGap: "xs",
|
|
44
|
+
direction: "row",
|
|
45
|
+
vAlign: "center",
|
|
46
|
+
children: [decrement, increment]
|
|
47
|
+
});
|
|
48
|
+
let startAddon;
|
|
49
|
+
let endAddon;
|
|
50
|
+
if (stepperPlacement === "grouped") endAddon = renderStepperAddon("end", stepperPair);
|
|
51
|
+
else {
|
|
52
|
+
startAddon = renderStepperAddon("start", decrement);
|
|
53
|
+
endAddon = renderStepperAddon("end", increment);
|
|
54
|
+
}
|
|
55
|
+
const labelContent = label ? /* @__PURE__ */ jsx(FieldLabel, { children: label }) : null;
|
|
56
|
+
return /* @__PURE__ */ jsx(NumberField.Root, {
|
|
57
|
+
className: number_field_module_default.NumberField,
|
|
58
|
+
disabled,
|
|
59
|
+
...rootProps,
|
|
60
|
+
children: /* @__PURE__ */ jsxs(Field.Root, {
|
|
61
|
+
className: clsx(number_field_module_default.Field, className),
|
|
62
|
+
dirty,
|
|
63
|
+
disabled,
|
|
64
|
+
invalid,
|
|
65
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
66
|
+
expandChildren: true,
|
|
67
|
+
fullWidth,
|
|
68
|
+
rowGap: "s",
|
|
69
|
+
style
|
|
70
|
+
}),
|
|
71
|
+
touched,
|
|
72
|
+
validate,
|
|
73
|
+
validationDebounceTime,
|
|
74
|
+
validationMode,
|
|
75
|
+
children: [
|
|
76
|
+
label && labelScrub && /* @__PURE__ */ jsx(NumberField.ScrubArea, {
|
|
77
|
+
className: number_field_module_default.ScrubArea,
|
|
78
|
+
children: /* @__PURE__ */ jsx(Field.Label, {
|
|
79
|
+
className: number_field_module_default.Label,
|
|
80
|
+
children: labelContent
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
label && !labelScrub && /* @__PURE__ */ jsx(Field.Label, {
|
|
84
|
+
className: number_field_module_default.Label,
|
|
85
|
+
children: labelContent
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ jsxs(NumberField.Group, {
|
|
88
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
89
|
+
className: number_field_module_default.ControlGroup,
|
|
90
|
+
direction: "row",
|
|
91
|
+
expandChildren: true,
|
|
92
|
+
vPadding: "xs",
|
|
93
|
+
fullWidth: true,
|
|
94
|
+
vAlign: "stretch"
|
|
95
|
+
}),
|
|
96
|
+
children: [
|
|
97
|
+
startAddon,
|
|
98
|
+
/* @__PURE__ */ jsx(BasicInput, {
|
|
99
|
+
className: number_field_module_default.CustomBasicInput,
|
|
100
|
+
disabled,
|
|
101
|
+
fitContent,
|
|
102
|
+
render: /* @__PURE__ */ jsx(NumberField.Input, {
|
|
103
|
+
"aria-roledescription": typeof description === "string" ? description : void 0,
|
|
104
|
+
ref
|
|
105
|
+
})
|
|
106
|
+
}),
|
|
107
|
+
endAddon
|
|
108
|
+
]
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsx(FieldHelperCopy, {
|
|
111
|
+
className: number_field_module_default.Description,
|
|
112
|
+
description,
|
|
113
|
+
error
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
})
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
//#endregion
|
|
120
|
+
export { NumberField$1 as NumberField };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/components/number-field/number-field.module.css
|
|
2
|
+
var NumberField = "viraui__number-field-module__NumberField_l7i9a";
|
|
3
|
+
var Field = "viraui__number-field-module__Field_Ud43i";
|
|
4
|
+
var Label = "viraui__number-field-module__Label_-Sji0";
|
|
5
|
+
var ControlGroup = "viraui__number-field-module__ControlGroup_CX5th";
|
|
6
|
+
var CustomBasicInput = "viraui__number-field-module__CustomBasicInput_6fmMO";
|
|
7
|
+
var Addon = "viraui__number-field-module__Addon_QwT1q";
|
|
8
|
+
var ScrubArea = "viraui__number-field-module__ScrubArea_3Wzje";
|
|
9
|
+
var Description = "viraui__number-field-module__Description_GWcij";
|
|
10
|
+
var number_field_module_default = {
|
|
11
|
+
NumberField,
|
|
12
|
+
Field,
|
|
13
|
+
Label,
|
|
14
|
+
ControlGroup,
|
|
15
|
+
CustomBasicInput,
|
|
16
|
+
Addon,
|
|
17
|
+
ScrubArea,
|
|
18
|
+
Description
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Addon, ControlGroup, CustomBasicInput, Description, Field, Label, NumberField, ScrubArea, number_field_module_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { OTPField } from './otp-field';
|
|
2
|
-
export type {
|
|
2
|
+
export type { OTPFieldProps } from './otp-field';
|
|
3
3
|
export type { OTPFieldInputProps } from './otp-field-input';
|
|
4
4
|
export type { OTPFieldSeparatorProps } from './otp-field-separator';
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
* Base UI OTP Input. Chrome is `render={<Textfield controlOnly fitContent size={1} />}`.
|
|
7
7
|
* No per-slot label, description, error, addons, or public `render`.
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
9
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
10
10
|
*/
|
|
11
11
|
export type OTPFieldInputProps = Omit<PrimitiveOTPFieldInput.Props, 'render'>;
|
|
12
12
|
export declare const OTPFieldInput: React.FC<OTPFieldInputProps>;
|
|
@@ -5,7 +5,9 @@ import * as React from 'react';
|
|
|
5
5
|
*
|
|
6
6
|
* Base UI OTP Separator with Vira `Separator` chrome. Not an input.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @defaultValue `orientation` is `'horizontal'`. Default `render` is a short Vira `Separator`
|
|
9
|
+
* with `minWidth` + `maxWidth` `var(--space-m)` so the dash stays visible in the slot row
|
|
10
|
+
* (`data-shrink="false"` alone is not enough — content size stays 0 under flex).
|
|
9
11
|
*/
|
|
10
12
|
export type OTPFieldSeparatorProps = React.ComponentPropsWithRef<typeof PrimitiveOTPField.Separator>;
|
|
11
13
|
export declare const OTPFieldSeparator: React.FC<OTPFieldSeparatorProps>;
|
|
@@ -3,9 +3,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import { OTPField } from "@base-ui/react/otp-field";
|
|
5
5
|
//#region src/components/otp-field/otp-field-separator.tsx
|
|
6
|
+
var otpSeparatorChrome = {
|
|
7
|
+
maxWidth: "var(--space-m)",
|
|
8
|
+
minWidth: "var(--space-m)"
|
|
9
|
+
};
|
|
6
10
|
var OTPFieldSeparator = ({ className, orientation = "horizontal", render, ...separatorProps }) => /* @__PURE__ */ jsx(OTPField.Separator, {
|
|
7
11
|
render: render ?? /* @__PURE__ */ jsx(Separator, {
|
|
8
|
-
|
|
12
|
+
...otpSeparatorChrome,
|
|
9
13
|
orientation
|
|
10
14
|
}),
|
|
11
15
|
...separatorProps,
|
|
@@ -4,15 +4,15 @@ import { OTPFieldInputProps } from './otp-field-input';
|
|
|
4
4
|
import { OTPFieldSeparatorProps } from './otp-field-separator';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
/**
|
|
7
|
-
* Public OTPField
|
|
7
|
+
* Public OTPField props.
|
|
8
8
|
*
|
|
9
9
|
* Field chrome plus Base UI OTP Root. `length` is required and does not spawn Inputs —
|
|
10
10
|
* list exactly that many `OTPField.Input` children. `render` replaces the OTP primitive
|
|
11
11
|
* root (slot cluster), not the Field wrapper.
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
13
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
14
14
|
*/
|
|
15
|
-
export type
|
|
15
|
+
export type OTPFieldProps = PrimitiveOTPFieldRoot.Props & Omit<FieldRoot.Props, 'ref' | 'render'> & {
|
|
16
16
|
/**
|
|
17
17
|
* Visible label rendered with shared internal `FieldLabel`. Names the first slot.
|
|
18
18
|
*
|
|
@@ -40,8 +40,7 @@ export type OTPFieldRootProps = PrimitiveOTPFieldRoot.Props & Omit<FieldRoot.Pro
|
|
|
40
40
|
*/
|
|
41
41
|
fullWidth?: boolean;
|
|
42
42
|
};
|
|
43
|
-
type OTPFieldComponent = React.FC<
|
|
44
|
-
Root: React.FC<OTPFieldRootProps>;
|
|
43
|
+
type OTPFieldComponent = React.FC<OTPFieldProps> & {
|
|
45
44
|
Input: React.FC<OTPFieldInputProps>;
|
|
46
45
|
Separator: React.FC<OTPFieldSeparatorProps>;
|
|
47
46
|
};
|