@viraui/react 2026.6.5 → 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 +24 -0
- 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/autocomplete/autocomplete.js +1 -1
- 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 +3 -2
- package/dist/components/basic-input/basic-input.js +7 -0
- package/dist/components/basic-input/input-control-group.d.ts +2 -2
- package/dist/components/beam/beam-pulse-driver.d.ts +1 -0
- package/dist/components/beam/beam-pulse-driver.js +2 -2
- package/dist/components/beam/beam.css +1 -1
- package/dist/components/beam/beam.d.ts +17 -14
- package/dist/components/beam/beam.js +31 -26
- 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-sheet.js +1 -1
- 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 +4 -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-popup.js +1 -1
- 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.css +1 -1
- package/dist/components/meter/meter.d.ts +15 -5
- package/dist/components/meter/meter.js +2 -1
- 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 +4 -0
- package/dist/components/otp-field/otp-field-input.d.ts +12 -0
- package/dist/components/otp-field/otp-field-input.js +29 -0
- package/dist/components/otp-field/otp-field-separator.d.ts +13 -0
- package/dist/components/otp-field/otp-field-separator.js +20 -0
- package/dist/components/otp-field/otp-field.css +1 -0
- package/dist/components/otp-field/otp-field.d.ts +48 -0
- package/dist/components/otp-field/otp-field.js +78 -0
- package/dist/components/otp-field/otp-field.module.js +23 -0
- 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/index.d.ts +2 -0
- package/dist/components/prose/prose.css +1 -0
- package/dist/components/prose/prose.d.ts +40 -0
- package/dist/components/prose/prose.js +27 -0
- package/dist/components/prose/prose.module.js +5 -0
- 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/select/select.js +1 -1
- package/dist/components/separator/separator.d.ts +15 -8
- package/dist/components/separator/separator.js +2 -1
- 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.css +1 -1
- package/dist/components/text/text.d.ts +24 -23
- package/dist/components/text/text.js +4 -2
- package/dist/components/textarea/textarea.d.ts +6 -6
- package/dist/components/textfield/textfield.css +1 -1
- package/dist/components/textfield/textfield.d.ts +19 -11
- package/dist/components/textfield/textfield.js +43 -39
- package/dist/components/textfield/textfield.module.js +3 -1
- package/dist/components/title/title.css +1 -1
- package/dist/components/title/title.d.ts +22 -21
- package/dist/components/title/title.js +4 -2
- 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-banner.js +1 -1
- 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 +7 -3
- package/dist/specs/components/accordion/usage.xml +1 -0
- package/dist/specs/components/beam/a11y.xml +3 -3
- package/dist/specs/components/beam/props.xml +22 -1
- package/dist/specs/components/beam/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/meter/patterns.xml +12 -0
- package/dist/specs/components/meter/props.xml +7 -0
- package/dist/specs/components/meter/usage.xml +2 -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/a11y.xml +10 -0
- package/dist/specs/components/otp-field/meta.xml +20 -0
- package/dist/specs/components/otp-field/patterns.xml +66 -0
- package/dist/specs/components/otp-field/props.xml +29 -0
- package/dist/specs/components/otp-field/usage.xml +13 -0
- package/dist/specs/components/prose/a11y.xml +7 -0
- package/dist/specs/components/prose/meta.xml +18 -0
- package/dist/specs/components/prose/patterns.xml +59 -0
- package/dist/specs/components/prose/props.xml +37 -0
- package/dist/specs/components/prose/usage.xml +12 -0
- package/dist/specs/components/separator/props.xml +3 -0
- package/dist/specs/components/separator/usage.xml +1 -0
- package/dist/specs/components/text/props.xml +2 -2
- package/dist/specs/components/text/usage.xml +1 -0
- package/dist/specs/components/textfield/meta.xml +1 -0
- package/dist/specs/components/textfield/props.xml +6 -1
- package/dist/specs/components/textfield/usage.xml +2 -1
- package/dist/specs/components/title/props.xml +2 -2
- package/dist/specs/components/title/usage.xml +1 -0
- package/dist/specs/index.xml +41 -1
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ import type * as React from 'react';
|
|
|
6
6
|
* Pass-through to Base UI `Drawer.IndentBackground` with Vira-owned root class applied.
|
|
7
7
|
* Place before `Dialog.Indent` inside `Dialog.Provider` for the indent background layer.
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
9
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
10
10
|
*/
|
|
11
11
|
export type DialogIndentBackgroundProps = DrawerIndentBackground.Props;
|
|
12
12
|
export declare const DialogIndentBackground: React.FC<DialogIndentBackgroundProps>;
|
|
@@ -6,7 +6,7 @@ import type * as React from 'react';
|
|
|
6
6
|
* Pass-through to Base UI `Drawer.Indent` with Vira-owned root class applied.
|
|
7
7
|
* Wrap app shell content inside `Dialog.Provider` to receive `data-active` when a sheet opens.
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
9
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
10
10
|
*/
|
|
11
11
|
export type DialogIndentProps = DrawerIndent.Props;
|
|
12
12
|
export declare const DialogIndent: React.FC<DialogIndentProps>;
|
|
@@ -8,7 +8,7 @@ import type * as React from 'react';
|
|
|
8
8
|
* and optional body content. Compose `Dialog.Close` inside `children` when a
|
|
9
9
|
* close control is needed.
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
11
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
12
12
|
*/
|
|
13
13
|
export type DialogSheetProps = {
|
|
14
14
|
/**
|
|
@@ -18,49 +18,49 @@ export type DialogSheetProps = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Supporting copy announced with the title.
|
|
20
20
|
*
|
|
21
|
-
* @
|
|
21
|
+
* @defaultValue No description is rendered.
|
|
22
22
|
*/
|
|
23
23
|
description?: React.ReactNode;
|
|
24
24
|
/**
|
|
25
25
|
* Optional body content rendered below the description.
|
|
26
26
|
*
|
|
27
|
-
* @
|
|
27
|
+
* @defaultValue No extra body content is rendered.
|
|
28
28
|
*/
|
|
29
29
|
children?: React.ReactNode;
|
|
30
30
|
/**
|
|
31
31
|
* Optional maximum width of the content area.
|
|
32
32
|
*
|
|
33
|
-
* @
|
|
33
|
+
* @defaultValue `50ch`
|
|
34
34
|
*/
|
|
35
35
|
maxContentWidth?: StackProps['maxWidth'];
|
|
36
36
|
/**
|
|
37
37
|
* Aligns the header stack and title/description text (`start` | `center` | `end`).
|
|
38
38
|
*
|
|
39
|
-
* @
|
|
39
|
+
* @defaultValue `start`
|
|
40
40
|
*/
|
|
41
41
|
headerAlign?: Extract<StackProps['hAlign'], 'start' | 'center' | 'end'>;
|
|
42
42
|
/**
|
|
43
43
|
* Whether to show the close button.
|
|
44
44
|
*
|
|
45
|
-
* @
|
|
45
|
+
* @defaultValue false
|
|
46
46
|
*/
|
|
47
47
|
showCloseButton?: boolean;
|
|
48
48
|
/**
|
|
49
49
|
* Centers the sheet horizontally within the viewport.
|
|
50
50
|
*
|
|
51
|
-
* @
|
|
51
|
+
* @defaultValue false
|
|
52
52
|
*/
|
|
53
53
|
fitContent?: boolean;
|
|
54
54
|
/**
|
|
55
55
|
* Whether to show the drag handle above the sheet header.
|
|
56
56
|
*
|
|
57
|
-
* @
|
|
57
|
+
* @defaultValue true
|
|
58
58
|
*/
|
|
59
59
|
showHandle?: boolean;
|
|
60
60
|
/**
|
|
61
61
|
* Maximum block size of the sheet panel.
|
|
62
62
|
*
|
|
63
|
-
* @
|
|
63
|
+
* @defaultValue `97dvh`
|
|
64
64
|
*/
|
|
65
65
|
maxHeight?: string;
|
|
66
66
|
/**
|
|
@@ -68,7 +68,7 @@ export type DialogSheetProps = {
|
|
|
68
68
|
* Omit for Base UI default (`document.body` from the module window —
|
|
69
69
|
* iframe hosts must pass the iframe document body explicitly).
|
|
70
70
|
*
|
|
71
|
-
* @
|
|
71
|
+
* @defaultValue Base UI FloatingPortal resolution
|
|
72
72
|
*/
|
|
73
73
|
container?: React.ComponentProps<typeof PrimitiveDrawer.Portal>['container'];
|
|
74
74
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ChromeXmark } from "../../internal/chrome-icons/chrome-icons.js";
|
|
2
2
|
import { Text } from "../text/text.js";
|
|
3
3
|
import { Stack } from "../stack/stack.js";
|
|
4
|
+
import { Surface } from "../surface/surface.js";
|
|
4
5
|
import dialog_module_default from "./dialog.module.js";
|
|
5
6
|
import { useDialogModal } from "./dialog-modal-context.js";
|
|
6
7
|
import { Elevator } from "../elevator/elevator.js";
|
|
7
|
-
import { Surface } from "../surface/surface.js";
|
|
8
8
|
import { IconButton } from "../icon-button/icon-button.js";
|
|
9
9
|
import { Title } from "../title/title.js";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -7,7 +7,7 @@ import type * as React from 'react';
|
|
|
7
7
|
* (`Button`, `IconButton`, or another element) and set `nativeButton` when the
|
|
8
8
|
* rendered root is not a native `<button>`.
|
|
9
9
|
*
|
|
10
|
-
* @
|
|
10
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
11
11
|
*/
|
|
12
12
|
export type DialogTriggerProps = DrawerTrigger.Props;
|
|
13
13
|
export declare const DialogTrigger: React.FC<DialogTriggerProps>;
|
|
@@ -13,7 +13,7 @@ import type * as React from 'react';
|
|
|
13
13
|
* Portal, backdrop, viewport, popup, title, description, and content parts are
|
|
14
14
|
* internal to `Dialog.Sheet` and are not exposed on `Dialog`.
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
16
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
17
17
|
*/
|
|
18
18
|
export type DialogProps = DrawerRoot.Props;
|
|
19
19
|
export type DialogSnapPoint = DrawerRoot.SnapPoint;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CollapsiblePanel } from '@base-ui/react/collapsible';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Public Disclosure.Panel props.
|
|
5
|
+
*
|
|
6
|
+
* Base UI Collapsible Panel pass-through (`hiddenUntilFound`, `keepMounted`, `render`, …)
|
|
7
|
+
* plus the animated height shell. No default content padding — builders own children layout.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
10
|
+
*/
|
|
11
|
+
export type DisclosurePanelProps = CollapsiblePanel.Props;
|
|
12
|
+
export declare const DisclosurePanel: React.FC<DisclosurePanelProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { clsx } from "../../core/clsx.js";
|
|
3
|
+
import disclosure_module_default from "./disclosure.module.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
6
|
+
//#region src/components/disclosure/disclosure-panel.tsx
|
|
7
|
+
var DisclosurePanel = ({ children, className, ...otherProps }) => /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
8
|
+
className: clsx(disclosure_module_default.Panel, className),
|
|
9
|
+
...otherProps,
|
|
10
|
+
children
|
|
11
|
+
});
|
|
12
|
+
//#endregion
|
|
13
|
+
export { DisclosurePanel };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CollapsibleTrigger } from '@base-ui/react/collapsible';
|
|
2
|
+
import { SurfaceProps } from '../surface';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
/** Surface chrome on default Trigger path. Host/`render` stay on Trigger. */
|
|
5
|
+
type DisclosureTriggerSurfaceProps = Omit<SurfaceProps, 'ref'>;
|
|
6
|
+
/**
|
|
7
|
+
* Public Disclosure.Trigger props.
|
|
8
|
+
*
|
|
9
|
+
* Default host = `Surface` with `render` → Base UI Collapsible Trigger (Textfield/NumberField
|
|
10
|
+
* family). Icon pair follows ToggleButton naming (`restingIcon` / `openIcon` / `interpolateIcons`).
|
|
11
|
+
* Consumer `render` replaces the whole Surface + primitive compose.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue Base UI pass-through props keep upstream defaults. On the default Surface path,
|
|
14
|
+
* `hoverColor` defaults to `2`, `hPadding` defaults to `'m'`, `vPadding` defaults to `'s'`.
|
|
15
|
+
* `interpolateIcons` defaults to `false`. `iconPosition` defaults to `'end'`.
|
|
16
|
+
*/
|
|
17
|
+
export type DisclosureTriggerProps = CollapsibleTrigger.Props & DisclosureTriggerSurfaceProps & {
|
|
18
|
+
/**
|
|
19
|
+
* Decorative icon while the panel is closed.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue `ChromeChevronEnd` when both icon slots are omitted.
|
|
22
|
+
*/
|
|
23
|
+
restingIcon?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Decorative icon while the panel is open.
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue `ChromeChevronDown` when both icon slots are omitted. When only `restingIcon`
|
|
28
|
+
* is set, that icon shows in both states.
|
|
29
|
+
*/
|
|
30
|
+
openIcon?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* When dual icons are present, crossfade and light-rotate between them
|
|
33
|
+
* (`data-interpolate="true"`). When `false`, swap instantly with no transition.
|
|
34
|
+
*
|
|
35
|
+
* @defaultValue false
|
|
36
|
+
*/
|
|
37
|
+
interpolateIcons?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Logical side of the label where the icon slot sits.
|
|
40
|
+
*
|
|
41
|
+
* @defaultValue 'end'
|
|
42
|
+
*/
|
|
43
|
+
iconPosition?: 'start' | 'end';
|
|
44
|
+
};
|
|
45
|
+
export declare const DisclosureTrigger: React.FC<DisclosureTriggerProps>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { clsx } from "../../core/clsx.js";
|
|
3
|
+
import { ChromeChevronDown, ChromeChevronEnd } from "../../internal/chrome-icons/chrome-icons.js";
|
|
4
|
+
import { Stack } from "../stack/stack.js";
|
|
5
|
+
import { Surface } from "../surface/surface.js";
|
|
6
|
+
import disclosure_module_default from "./disclosure.module.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
9
|
+
//#region src/components/disclosure/disclosure-trigger.tsx
|
|
10
|
+
var resolveIconPair = (restingIcon, openIcon) => {
|
|
11
|
+
if (restingIcon === void 0 && openIcon === void 0) return {
|
|
12
|
+
resting: /* @__PURE__ */ jsx(ChromeChevronEnd, { size: "1rem" }),
|
|
13
|
+
open: /* @__PURE__ */ jsx(ChromeChevronDown, { size: "1rem" })
|
|
14
|
+
};
|
|
15
|
+
if (restingIcon !== void 0 && openIcon === void 0) return {
|
|
16
|
+
resting: restingIcon,
|
|
17
|
+
open: null
|
|
18
|
+
};
|
|
19
|
+
if (restingIcon === void 0 && openIcon !== void 0) return {
|
|
20
|
+
resting: /* @__PURE__ */ jsx(ChromeChevronEnd, { size: "1rem" }),
|
|
21
|
+
open: openIcon
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
resting: restingIcon,
|
|
25
|
+
open: openIcon ?? null
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
var DisclosureTrigger = ({ border, borderStyle, children, className, color, enableContainer, hPadding = "m", vPadding = "s", hoverColor, iconPosition = "end", interpolateIcons = false, nativeButton, openIcon, overflow, radius, render, restingIcon, style, ...otherProps }) => {
|
|
29
|
+
if (render != null) return /* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
30
|
+
className: clsx(disclosure_module_default.Trigger, className),
|
|
31
|
+
nativeButton,
|
|
32
|
+
render,
|
|
33
|
+
style,
|
|
34
|
+
...otherProps,
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
const { resting, open } = resolveIconPair(restingIcon, openIcon);
|
|
38
|
+
const iconAtStart = iconPosition === "start";
|
|
39
|
+
return /* @__PURE__ */ jsx(Surface, {
|
|
40
|
+
border,
|
|
41
|
+
borderStyle,
|
|
42
|
+
className: clsx(disclosure_module_default.Trigger, className),
|
|
43
|
+
color,
|
|
44
|
+
enableContainer,
|
|
45
|
+
hoverColor: hoverColor ?? 2,
|
|
46
|
+
hPadding,
|
|
47
|
+
vPadding,
|
|
48
|
+
overflow,
|
|
49
|
+
radius,
|
|
50
|
+
render: /* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
51
|
+
nativeButton,
|
|
52
|
+
...otherProps
|
|
53
|
+
}),
|
|
54
|
+
style,
|
|
55
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
56
|
+
columnGap: iconAtStart ? "s" : void 0,
|
|
57
|
+
direction: iconAtStart ? "row" : "row-reverse",
|
|
58
|
+
fullWidth: true,
|
|
59
|
+
hAlign: iconPosition === "end" ? "space-between" : "start",
|
|
60
|
+
vAlign: "center",
|
|
61
|
+
children: [open ? /* @__PURE__ */ jsxs("span", {
|
|
62
|
+
"aria-hidden": true,
|
|
63
|
+
className: disclosure_module_default.IconSlot,
|
|
64
|
+
"data-interpolate": interpolateIcons ? "true" : "false",
|
|
65
|
+
"data-shrink": "false",
|
|
66
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
67
|
+
className: disclosure_module_default.Icon,
|
|
68
|
+
children: resting
|
|
69
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
70
|
+
className: disclosure_module_default.Icon,
|
|
71
|
+
children: open
|
|
72
|
+
})]
|
|
73
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
74
|
+
"aria-hidden": true,
|
|
75
|
+
"data-shrink": "false",
|
|
76
|
+
children: resting
|
|
77
|
+
}), children]
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
export { DisclosureTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{.viraui__disclosure-module__Trigger_hTIkR{inline-size:100%;cursor:pointer;text-align:start;color:inherit;&:focus-visible{outline-offset:-4px}&[data-disabled]{cursor:not-allowed;opacity:.5}}.viraui__disclosure-module__IconSlot_8gEr5{position:relative;inline-size:1rem;block-size:1rem;.viraui__disclosure-module__Trigger_hTIkR[data-panel-open] &{.viraui__disclosure-module__Icon_w8tYN:first-of-type{opacity:0;rotate:30deg}.viraui__disclosure-module__Icon_w8tYN:last-of-type{opacity:1;rotate:0deg}}&[data-interpolate=true] .viraui__disclosure-module__Icon_w8tYN{transition:opacity var(--duration-fast) var(--easing-standard),rotate var(--duration-fast) var(--easing-standard)}@media (prefers-reduced-motion:reduce){&[data-interpolate=true] .viraui__disclosure-module__Icon_w8tYN{transition:none}}}.viraui__disclosure-module__Icon_w8tYN{position:absolute;inset:0;display:grid;place-items:center;&>svg{block-size:1rem;inline-size:1rem}&:first-of-type{opacity:1;rotate:0deg}&:last-of-type{opacity:0;rotate:-30deg}}.viraui__disclosure-module__Panel_U6Kba{block-size:var(--collapsible-panel-height);overflow:hidden;transition:block-size var(--duration-fast) var(--easing-standard);&[data-ending-style],&[data-starting-style]{block-size:0}@media (prefers-reduced-motion:reduce){transition:none}}}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CollapsibleRoot } from '@base-ui/react/collapsible';
|
|
2
|
+
import { DisclosurePanelProps } from './disclosure-panel';
|
|
3
|
+
import { DisclosureTriggerProps } from './disclosure-trigger';
|
|
4
|
+
import type * as React from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Public Disclosure root props.
|
|
7
|
+
*
|
|
8
|
+
* Base UI Collapsible Root pass-through (`open`, `defaultOpen`, `onOpenChange`, `disabled`, …).
|
|
9
|
+
* Compose with `Disclosure.Trigger` and `Disclosure.Panel`.
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
12
|
+
*/
|
|
13
|
+
export type DisclosureProps = CollapsibleRoot.Props;
|
|
14
|
+
type DisclosureComponent = React.FC<DisclosureProps> & {
|
|
15
|
+
Trigger: React.FC<DisclosureTriggerProps>;
|
|
16
|
+
Panel: React.FC<DisclosurePanelProps>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Single-section expand/collapse compound wrapping Base UI Collapsible.
|
|
20
|
+
*
|
|
21
|
+
* Use Accordion for multi-item lists. Default Trigger is Surface with
|
|
22
|
+
* `render` → Collapsible Trigger; Panel is a height motion shell without padding.
|
|
23
|
+
*/
|
|
24
|
+
export declare const Disclosure: DisclosureComponent;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import './disclosure.css';
|
|
3
|
+
import { clsx } from "../../core/clsx.js";
|
|
4
|
+
import { Stack } from "../stack/stack.js";
|
|
5
|
+
import disclosure_module_default from "./disclosure.module.js";
|
|
6
|
+
import { DisclosurePanel } from "./disclosure-panel.js";
|
|
7
|
+
import { DisclosureTrigger } from "./disclosure-trigger.js";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
10
|
+
//#region src/components/disclosure/disclosure.tsx
|
|
11
|
+
var DisclosureRoot = ({ children, className, ...otherProps }) => /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
12
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
13
|
+
fullWidth: true,
|
|
14
|
+
className: clsx(disclosure_module_default.Disclosure, className)
|
|
15
|
+
}),
|
|
16
|
+
...otherProps,
|
|
17
|
+
children
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Single-section expand/collapse compound wrapping Base UI Collapsible.
|
|
21
|
+
*
|
|
22
|
+
* Use Accordion for multi-item lists. Default Trigger is Surface with
|
|
23
|
+
* `render` → Collapsible Trigger; Panel is a height motion shell without padding.
|
|
24
|
+
*/
|
|
25
|
+
var Disclosure = Object.assign(DisclosureRoot, {
|
|
26
|
+
Trigger: DisclosureTrigger,
|
|
27
|
+
Panel: DisclosurePanel
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Disclosure };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/components/disclosure/disclosure.module.css
|
|
2
|
+
var Disclosure = "viraui__disclosure-module__Disclosure_C0zl-";
|
|
3
|
+
var Trigger = "viraui__disclosure-module__Trigger_hTIkR";
|
|
4
|
+
var IconSlot = "viraui__disclosure-module__IconSlot_8gEr5";
|
|
5
|
+
var Icon = "viraui__disclosure-module__Icon_w8tYN";
|
|
6
|
+
var Panel = "viraui__disclosure-module__Panel_U6Kba";
|
|
7
|
+
var disclosure_module_default = {
|
|
8
|
+
Disclosure,
|
|
9
|
+
Trigger,
|
|
10
|
+
IconSlot,
|
|
11
|
+
Icon,
|
|
12
|
+
Panel
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Disclosure, Icon, IconSlot, Panel, Trigger, disclosure_module_default as default };
|
|
@@ -8,43 +8,43 @@ export { getElevationProps } from '../../core/elevation/get-elevation-props';
|
|
|
8
8
|
*
|
|
9
9
|
* Applies preflight elevation hooks to each valid element child. Invalid nodes pass through unchanged.
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
11
|
+
* @defaultValue Native child pass-through props are preserved and merged with elevation hooks.
|
|
12
12
|
*/
|
|
13
13
|
export type ElevatorProps = {
|
|
14
14
|
/**
|
|
15
15
|
* Element or elements that receive elevation hooks on their rendered root.
|
|
16
16
|
*
|
|
17
|
-
* @
|
|
17
|
+
* @defaultValue No default. Consumers must provide at least one child.
|
|
18
18
|
*/
|
|
19
19
|
children: React.ReactNode;
|
|
20
20
|
/**
|
|
21
21
|
* Resting elevation level mapped to `data-elevation`.
|
|
22
22
|
*
|
|
23
|
-
* @
|
|
23
|
+
* @defaultValue No default. Consumers must provide a resting level.
|
|
24
24
|
*/
|
|
25
25
|
resting: ElevationLevel;
|
|
26
26
|
/**
|
|
27
27
|
* Hover elevation level mapped to `data-elevation-hover`.
|
|
28
28
|
*
|
|
29
|
-
* @
|
|
29
|
+
* @defaultValue No hover elevation override.
|
|
30
30
|
*/
|
|
31
31
|
hover?: ElevationLevel;
|
|
32
32
|
/**
|
|
33
33
|
* Shadow cast direction mapped to `data-elevation-direction`.
|
|
34
34
|
*
|
|
35
|
-
* @
|
|
35
|
+
* @defaultValue 'bottom'
|
|
36
36
|
*/
|
|
37
37
|
direction?: ElevationDirection;
|
|
38
38
|
/**
|
|
39
39
|
* Shadow color mapped to the `--shadow-color` custom property.
|
|
40
40
|
*
|
|
41
|
-
* @
|
|
41
|
+
* @defaultValue 'oklch(0% 0 0)'
|
|
42
42
|
*/
|
|
43
43
|
shadowColor?: ElevationShadowColor;
|
|
44
44
|
/**
|
|
45
45
|
* Additional shadow layer mapped to the `--extra-shadow` custom property.
|
|
46
46
|
*
|
|
47
|
-
* @
|
|
47
|
+
* @defaultValue Preflight transparent hairline from `elevations.css`.
|
|
48
48
|
*/
|
|
49
49
|
extraShadow?: string;
|
|
50
50
|
};
|
|
@@ -7,27 +7,27 @@ import type * as React from 'react';
|
|
|
7
7
|
* legend typography and optional group helper copy. Pass `render` to merge the fieldset
|
|
8
8
|
* root with `RadioGroup`, `CheckboxGroup`, or another compatible root.
|
|
9
9
|
*
|
|
10
|
-
* @
|
|
10
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
11
11
|
*/
|
|
12
12
|
export type FieldsetProps = FieldsetRoot.Props & {
|
|
13
13
|
/**
|
|
14
14
|
* Visible legend copy rendered with shared internal `FieldLabel`.
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
16
|
+
* @defaultValue No legend is rendered.
|
|
17
17
|
*/
|
|
18
18
|
label?: React.ReactNode;
|
|
19
19
|
/**
|
|
20
20
|
* Group helper copy rendered below the legend while valid.
|
|
21
21
|
* Requires a `Field.Root` ancestor for `FieldHelperCopy`.
|
|
22
22
|
*
|
|
23
|
-
* @
|
|
23
|
+
* @defaultValue No description is rendered.
|
|
24
24
|
*/
|
|
25
25
|
description?: React.ReactNode;
|
|
26
26
|
/**
|
|
27
27
|
* Group error copy rendered below the legend when invalid.
|
|
28
28
|
* Requires a `Field.Root` ancestor.
|
|
29
29
|
*
|
|
30
|
-
* @
|
|
30
|
+
* @defaultValue No static error copy is rendered.
|
|
31
31
|
*/
|
|
32
32
|
error?: React.ReactNode;
|
|
33
33
|
};
|
|
@@ -5,13 +5,13 @@ import type * as React from 'react';
|
|
|
5
5
|
* Includes standard `div` attributes such as `children`, `id`, `className`, and event handlers,
|
|
6
6
|
* plus an optional fitted font-size cap.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @defaultValue Native div pass-through props keep React defaults.
|
|
9
9
|
*/
|
|
10
10
|
export type FitTextProps = React.ComponentPropsWithRef<'div'> & {
|
|
11
11
|
/**
|
|
12
12
|
* Caps the fitted font size using any valid CSS length string.
|
|
13
13
|
*
|
|
14
|
-
* @
|
|
14
|
+
* @defaultValue No maximum — fitted size may grow without an upper bound.
|
|
15
15
|
*/
|
|
16
16
|
maxFontSize?: string;
|
|
17
17
|
};
|
|
@@ -6,69 +6,69 @@ import type * as React from 'react';
|
|
|
6
6
|
* Glow root is a transparent Surface shell that exposes only `radius` (token, per-corner
|
|
7
7
|
* tuple, or `auto`). Put the visual card as children (typically `Surface` with `radius="auto"`).
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
9
|
+
* @defaultValue Glow-owned props use the defaults below; `radius` keeps Surface defaults when omitted.
|
|
10
10
|
*/
|
|
11
11
|
export type GlowProps = React.ComponentProps<'div'> & Pick<SurfaceProps, 'radius'> & {
|
|
12
12
|
/**
|
|
13
13
|
* Distance from the surface edge where the glow becomes fully active.
|
|
14
14
|
*
|
|
15
|
-
* @
|
|
15
|
+
* @defaultValue 170
|
|
16
16
|
*/
|
|
17
17
|
proximity?: number;
|
|
18
18
|
/**
|
|
19
19
|
* Angular width of the highlighted arc (degrees, used as a unitless CSS number).
|
|
20
20
|
*
|
|
21
|
-
* @
|
|
21
|
+
* @defaultValue 250
|
|
22
22
|
*/
|
|
23
23
|
spread?: number;
|
|
24
24
|
/**
|
|
25
25
|
* Resting opacity of the glow when the pointer is outside proximity.
|
|
26
26
|
*
|
|
27
|
-
* @
|
|
27
|
+
* @defaultValue 0
|
|
28
28
|
*/
|
|
29
29
|
opacity?: number;
|
|
30
30
|
/**
|
|
31
31
|
* Shrinks the root to fit its content (`max-width: fit-content`).
|
|
32
32
|
*
|
|
33
|
-
* @
|
|
33
|
+
* @defaultValue false
|
|
34
34
|
*/
|
|
35
35
|
fitContent?: boolean;
|
|
36
36
|
/**
|
|
37
37
|
* Width of the masked glow border ring.
|
|
38
38
|
*
|
|
39
|
-
* @
|
|
39
|
+
* @defaultValue 2
|
|
40
40
|
*/
|
|
41
41
|
borderWidth?: number;
|
|
42
42
|
/**
|
|
43
43
|
* Color of the masked border ring under the highlight.
|
|
44
44
|
*
|
|
45
|
-
* @
|
|
45
|
+
* @defaultValue var(--global-contrast)
|
|
46
46
|
*/
|
|
47
47
|
borderColor?: string;
|
|
48
48
|
/**
|
|
49
49
|
* Offset of the glow ring from the surface edge. Negative values place the ring outside.
|
|
50
50
|
*
|
|
51
|
-
* @
|
|
51
|
+
* @defaultValue 5
|
|
52
52
|
*/
|
|
53
53
|
borderOffset?: number;
|
|
54
54
|
/**
|
|
55
55
|
* Overrides the glow gradient with a solid color or custom background value.
|
|
56
56
|
* Ignored when `rainbowColors` is true.
|
|
57
57
|
*
|
|
58
|
-
* @
|
|
58
|
+
* @defaultValue Theme highlight conic gradient
|
|
59
59
|
*/
|
|
60
60
|
glowColor?: string;
|
|
61
61
|
/**
|
|
62
62
|
* Shares the highlight gradient across cards via `background-attachment: fixed`.
|
|
63
63
|
* Forced off when `rainbowColors` is true.
|
|
64
64
|
*
|
|
65
|
-
* @
|
|
65
|
+
* @defaultValue true
|
|
66
66
|
*/
|
|
67
67
|
globalHighlight?: boolean;
|
|
68
68
|
/**
|
|
69
69
|
* Uses the multi-stop rainbow highlight gradient and disables global highlight attachment.
|
|
70
70
|
*
|
|
71
|
-
* @
|
|
71
|
+
* @defaultValue false
|
|
72
72
|
*/
|
|
73
73
|
rainbowColors?: boolean;
|
|
74
74
|
/**
|
|
@@ -76,7 +76,7 @@ export type GlowProps = React.ComponentProps<'div'> & Pick<SurfaceProps, 'radius
|
|
|
76
76
|
* set `0` for instant snap. Tracker writes an unwrapped continuous angle so the
|
|
77
77
|
* transition does not take the long way across the 0° seam.
|
|
78
78
|
*
|
|
79
|
-
* @
|
|
79
|
+
* @defaultValue 80
|
|
80
80
|
*/
|
|
81
81
|
angleLag?: number;
|
|
82
82
|
};
|
|
@@ -7,45 +7,45 @@ type GridItemSubgrid = boolean | 'column' | 'row';
|
|
|
7
7
|
* Includes standard `div` attributes such as `id`, `role`, `title`, and event handlers,
|
|
8
8
|
* plus placement controls and Base UI `render` support for replacing the item root.
|
|
9
9
|
*
|
|
10
|
-
* @
|
|
10
|
+
* @defaultValue Base UI pass-through props keep upstream defaults.
|
|
11
11
|
*/
|
|
12
12
|
export type GridItemProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
13
13
|
/**
|
|
14
14
|
* Replaces the default `div` root using Base UI render semantics.
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
16
|
+
* @defaultValue The item renders a `div` root.
|
|
17
17
|
*/
|
|
18
18
|
render?: useRender.RenderProp;
|
|
19
19
|
/**
|
|
20
20
|
* Ref forwarded to the rendered item root element.
|
|
21
21
|
*
|
|
22
|
-
* @
|
|
22
|
+
* @defaultValue No ref is attached.
|
|
23
23
|
*/
|
|
24
24
|
ref?: React.Ref<HTMLElement>;
|
|
25
25
|
/**
|
|
26
26
|
* Spans the item across every column track (`grid-column: 1 / -1`).
|
|
27
27
|
* Wins over `column` when both are set.
|
|
28
28
|
*
|
|
29
|
-
* @
|
|
29
|
+
* @defaultValue false
|
|
30
30
|
*/
|
|
31
31
|
fullWidth?: boolean;
|
|
32
32
|
/**
|
|
33
33
|
* Spans the item across every row track (`grid-row: 1 / -1`).
|
|
34
34
|
* Wins over `row` when both are set.
|
|
35
35
|
*
|
|
36
|
-
* @
|
|
36
|
+
* @defaultValue false
|
|
37
37
|
*/
|
|
38
38
|
fullHeight?: boolean;
|
|
39
39
|
/**
|
|
40
40
|
* Sets explicit `grid-column` placement via `--vui-grid-item-column`.
|
|
41
41
|
*
|
|
42
|
-
* @
|
|
42
|
+
* @defaultValue No explicit column placement.
|
|
43
43
|
*/
|
|
44
44
|
column?: React.CSSProperties['gridColumn'];
|
|
45
45
|
/**
|
|
46
46
|
* Sets explicit `grid-row` placement via `--vui-grid-item-row`.
|
|
47
47
|
*
|
|
48
|
-
* @
|
|
48
|
+
* @defaultValue No explicit row placement.
|
|
49
49
|
*/
|
|
50
50
|
row?: React.CSSProperties['gridRow'];
|
|
51
51
|
/**
|
|
@@ -54,7 +54,7 @@ export type GridItemProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
|
54
54
|
* Pass `true` for both axes, or `'column'` / `'row'` for one axis.
|
|
55
55
|
* Pair with `fullWidth` / `fullHeight` or a `column` / `row` span so the item covers the tracks to inherit.
|
|
56
56
|
*
|
|
57
|
-
* @
|
|
57
|
+
* @defaultValue false
|
|
58
58
|
*/
|
|
59
59
|
subgrid?: GridItemSubgrid;
|
|
60
60
|
};
|