@viraui/react 1.0.10 → 1.0.12
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.guide.json +1 -0
- package/dist/components/annotate/annotate.css +1 -0
- package/dist/components/annotate/annotate.d.ts +101 -0
- package/dist/components/annotate/annotate.guide.json +121 -0
- package/dist/components/annotate/annotate.js +39 -0
- package/dist/components/annotate/annotate.module.js +11 -0
- package/dist/components/annotate/index.d.ts +2 -0
- package/dist/components/avatar/avatar.d.ts +1 -2
- package/dist/components/avatar/avatar.guide.json +1 -0
- package/dist/components/avatar/avatar.js +3 -6
- package/dist/components/avatar-group/avatar-group.d.ts +1 -2
- package/dist/components/avatar-group/avatar-group.guide.json +1 -0
- package/dist/components/avatar-group/avatar-group.js +1 -4
- package/dist/components/basic-input/basic-input.css +1 -1
- package/dist/components/basic-input/basic-input.d.ts +7 -0
- package/dist/components/basic-input/basic-input.js +4 -1
- package/dist/components/basic-input/input-control-group.js +2 -2
- package/dist/components/bleed/bleed.d.ts +1 -2
- package/dist/components/bleed/bleed.guide.json +1 -0
- package/dist/components/bleed/bleed.js +1 -4
- package/dist/components/button/button-link.d.ts +1 -2
- package/dist/components/button/button-link.guide.json +1 -0
- package/dist/components/button/button-link.js +1 -4
- package/dist/components/button/button.d.ts +1 -2
- package/dist/components/button/button.guide.json +1 -0
- package/dist/components/button/button.js +2 -6
- package/dist/components/checkbox/checkbox.css +1 -1
- package/dist/components/checkbox/checkbox.guide.json +1 -0
- package/dist/components/chip/chip.d.ts +1 -2
- package/dist/components/chip/chip.guide.json +1 -0
- package/dist/components/chip/chip.js +3 -6
- package/dist/components/clamp-text/clamp-text.d.ts +1 -2
- package/dist/components/clamp-text/clamp-text.guide.json +1 -0
- package/dist/components/clamp-text/clamp-text.js +1 -4
- package/dist/components/dialog/dialog-sheet.js +2 -2
- package/dist/components/dialog/dialog.guide.json +1 -0
- package/dist/components/elevator/elevator.d.ts +1 -2
- package/dist/components/elevator/elevator.guide.json +1 -0
- package/dist/components/elevator/elevator.js +1 -4
- package/dist/components/fieldset/fieldset.d.ts +1 -2
- package/dist/components/fieldset/fieldset.guide.json +1 -0
- package/dist/components/fieldset/fieldset.js +16 -21
- package/dist/components/fit-text/fit-text.css +1 -0
- package/dist/components/fit-text/fit-text.d.ts +18 -0
- package/dist/components/fit-text/fit-text.guide.json +40 -0
- package/dist/components/fit-text/fit-text.js +31 -0
- package/dist/components/fit-text/fit-text.module.js +13 -0
- package/dist/components/fit-text/index.d.ts +2 -0
- package/dist/components/icon-button/icon-button-link.guide.json +1 -0
- package/dist/components/icon-button/icon-button.guide.json +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/linear-progress/linear-progress.d.ts +0 -13
- package/dist/components/linear-progress/linear-progress.guide.json +1 -0
- package/dist/components/linear-progress/linear-progress.js +41 -46
- package/dist/components/masonry/index.d.ts +1 -1
- package/dist/components/masonry/masonry-item.d.ts +1 -2
- package/dist/components/masonry/masonry-item.js +10 -15
- package/dist/components/masonry/masonry.d.ts +10 -11
- package/dist/components/masonry/masonry.guide.json +2 -1
- package/dist/components/masonry/masonry.js +9 -18
- package/dist/components/meter/meter.d.ts +0 -13
- package/dist/components/meter/meter.guide.json +1 -0
- package/dist/components/meter/meter.js +40 -45
- package/dist/components/popover/popover-sheet.js +2 -2
- package/dist/components/popover/popover.guide.json +1 -0
- package/dist/components/progressive-blur/progressive-blur.d.ts +1 -2
- package/dist/components/progressive-blur/progressive-blur.guide.json +1 -0
- package/dist/components/progressive-blur/progressive-blur.js +1 -4
- package/dist/components/progressive-blur/progressive-blur.utils.js +4 -7
- package/dist/components/radio/radio.guide.json +1 -0
- package/dist/components/select/select-indicator-slot.js +3 -3
- package/dist/components/select/select-option.js +2 -2
- package/dist/components/select/select.d.ts +1 -2
- package/dist/components/select/select.guide.json +1 -0
- package/dist/components/select/select.js +3 -6
- package/dist/components/separator/separator.d.ts +1 -2
- package/dist/components/separator/separator.guide.json +1 -0
- package/dist/components/separator/separator.js +1 -4
- package/dist/components/shimmer/shimmer.d.ts +1 -2
- package/dist/components/shimmer/shimmer.guide.json +1 -0
- package/dist/components/shimmer/shimmer.js +1 -4
- package/dist/components/skeleton/skeleton.d.ts +1 -2
- package/dist/components/skeleton/skeleton.guide.json +1 -0
- package/dist/components/skeleton/skeleton.js +1 -4
- package/dist/components/slider/slider.d.ts +0 -13
- package/dist/components/slider/slider.guide.json +1 -0
- package/dist/components/slider/slider.js +1 -4
- package/dist/components/spinner/spinner.d.ts +1 -2
- package/dist/components/spinner/spinner.guide.json +1 -0
- package/dist/components/spinner/spinner.js +19 -24
- package/dist/components/stack/stack.css +1 -1
- package/dist/components/stack/stack.d.ts +1 -2
- package/dist/components/stack/stack.guide.json +1 -0
- package/dist/components/stack/stack.js +1 -4
- package/dist/components/static-noise/static-noise.d.ts +1 -2
- package/dist/components/static-noise/static-noise.guide.json +1 -0
- package/dist/components/static-noise/static-noise.js +1 -4
- package/dist/components/surface/surface.css +1 -1
- package/dist/components/surface/surface.d.ts +1 -2
- package/dist/components/surface/surface.guide.json +1 -0
- package/dist/components/surface/surface.js +1 -4
- package/dist/components/switch/switch.d.ts +0 -13
- package/dist/components/switch/switch.guide.json +1 -0
- package/dist/components/switch/switch.js +1 -4
- package/dist/components/tabs/tabs.guide.json +1 -0
- package/dist/components/text/text.d.ts +1 -2
- package/dist/components/text/text.guide.json +1 -0
- package/dist/components/text/text.js +1 -4
- package/dist/components/textarea/textarea.d.ts +9 -15
- package/dist/components/textarea/textarea.guide.json +8 -1
- package/dist/components/textarea/textarea.js +34 -38
- package/dist/components/textfield/textfield.d.ts +9 -2
- package/dist/components/textfield/textfield.guide.json +6 -0
- package/dist/components/textfield/textfield.js +38 -42
- package/dist/components/title/title.css +1 -1
- package/dist/components/title/title.d.ts +5 -6
- package/dist/components/title/title.guide.json +13 -12
- package/dist/components/title/title.js +3 -6
- package/dist/components/toast/toast-banner.js +1 -1
- package/dist/components/toast/toast.guide.json +1 -0
- package/dist/components/toggle-button/toggle-button.guide.json +1 -0
- package/dist/components/toggle-group/toggle-group.guide.json +1 -0
- package/dist/components/tooltip/tooltip-content.js +1 -1
- package/dist/components/tooltip/tooltip.guide.json +1 -0
- package/dist/components/typewriter/typewriter.d.ts +1 -2
- package/dist/components/typewriter/typewriter.guide.json +1 -0
- package/dist/components/typewriter/typewriter.js +1 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.js +3 -1
- package/dist/preflight-surface.json +19 -20
- package/dist/preflight.css +1 -1
- package/package.json +4 -4
- package/dist/core/props/intrinsic-vira-props.d.ts +0 -30
- package/dist/core/props/intrinsic-vira-props.js +0 -14
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
2
|
import { StackProps } from '..';
|
|
3
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
4
3
|
import { MasonryItemProps } from './masonry-item';
|
|
5
4
|
import type * as React from 'react';
|
|
6
5
|
/**
|
|
7
|
-
* Mobile-first Masonry column counts keyed by
|
|
6
|
+
* Mobile-first Masonry column counts keyed by CSS px lengths (unitless numbers).
|
|
8
7
|
*
|
|
9
8
|
* `default` applies before a breakpoint matches. Other keys are `min-width`
|
|
10
|
-
* values against the Masonry root's content-box inline size. Keys may be
|
|
11
|
-
* order; the largest matching breakpoint wins.
|
|
9
|
+
* values in px against the Masonry root's content-box inline size. Keys may be
|
|
10
|
+
* in any order; the largest matching breakpoint wins. Non-finite keys are ignored.
|
|
12
11
|
*/
|
|
13
12
|
export type MasonryBreakpointCols = {
|
|
14
13
|
default: number;
|
|
15
|
-
[
|
|
14
|
+
[minWidthPx: number]: number;
|
|
16
15
|
};
|
|
17
16
|
/**
|
|
18
17
|
* Public Masonry props.
|
|
@@ -22,7 +21,7 @@ export type MasonryBreakpointCols = {
|
|
|
22
21
|
*
|
|
23
22
|
* @default Native div pass-through props keep React defaults.
|
|
24
23
|
*/
|
|
25
|
-
export type MasonryProps = React.ComponentPropsWithRef<'div'> &
|
|
24
|
+
export type MasonryProps = React.ComponentPropsWithRef<'div'> & {
|
|
26
25
|
/**
|
|
27
26
|
* Replaces the default `div` root using Base UI render semantics.
|
|
28
27
|
*
|
|
@@ -36,13 +35,13 @@ export type MasonryProps = React.ComponentPropsWithRef<'div'> & IntrinsicViraPro
|
|
|
36
35
|
*/
|
|
37
36
|
gap?: StackProps['columnGap'];
|
|
38
37
|
/**
|
|
39
|
-
* Sets the mobile-first column count at each
|
|
38
|
+
* Sets the mobile-first column count at each CSS px container breakpoint.
|
|
40
39
|
*
|
|
41
|
-
* Each non-`default` key is a `min-width` in
|
|
42
|
-
* content-box inline size. Keys may be in any order; the largest
|
|
43
|
-
* breakpoint wins. Non
|
|
40
|
+
* Each non-`default` key is a unitless `min-width` in px against the Masonry
|
|
41
|
+
* root's content-box inline size. Keys may be in any order; the largest
|
|
42
|
+
* matching breakpoint wins. Non-finite keys are ignored.
|
|
44
43
|
*
|
|
45
|
-
* @default { default: 1,
|
|
44
|
+
* @default { default: 1, 480: 2, 768: 3, 960: 4, 1280: 5, 2560: 6 }
|
|
46
45
|
*/
|
|
47
46
|
breakpointCols?: MasonryBreakpointCols;
|
|
48
47
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Masonry",
|
|
3
|
+
"structure": "<Masonry>\n <Masonry.Item>…</Masonry.Item>\n</Masonry>",
|
|
3
4
|
"summary": "Responsive React-column layout primitive for read-only mixed-height content walls.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Card walls, gallery-like collections, and editorial layouts with uneven item heights",
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"refCss": "gap"
|
|
29
30
|
},
|
|
30
31
|
"breakpointCols": {
|
|
31
|
-
"description": "Mobile-first column counts keyed by px min-width breakpoints against the Masonry root content-box inline size; keys may be in any order, the largest matching breakpoint wins, and non-
|
|
32
|
+
"description": "Mobile-first column counts keyed by unitless CSS px min-width breakpoints against the Masonry root content-box inline size; keys may be in any order, the largest matching breakpoint wins, and non-finite keys are ignored."
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
35
|
"css": {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './masonry.css';
|
|
3
3
|
import { clsx } from "../../core/clsx.js";
|
|
4
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
5
4
|
import { resolveThemeValue } from "../../core/theme/resolve-theme-value.js";
|
|
6
5
|
import { Stack } from "../stack/stack.js";
|
|
7
6
|
import masonry_module_default from "./masonry.module.js";
|
|
@@ -12,27 +11,20 @@ import { Children, useEffect, useRef, useState } from "react";
|
|
|
12
11
|
//#region src/components/masonry/masonry.tsx
|
|
13
12
|
var DEFAULT_BREAKPOINT_COLS = {
|
|
14
13
|
default: 1,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
var parseBreakpointPx = (value) => {
|
|
22
|
-
const trimmed = value.trim();
|
|
23
|
-
if (!trimmed.endsWith("px")) return null;
|
|
24
|
-
const px = Number.parseFloat(trimmed);
|
|
25
|
-
return Number.isFinite(px) ? px : null;
|
|
14
|
+
480: 2,
|
|
15
|
+
768: 3,
|
|
16
|
+
960: 4,
|
|
17
|
+
1280: 5,
|
|
18
|
+
2560: 6
|
|
26
19
|
};
|
|
27
20
|
var resolveColumnCount = (widthPx, breakpointCols) => Object.entries(breakpointCols).filter(([breakpoint]) => breakpoint !== "default").flatMap(([breakpoint, nextColumnCount]) => {
|
|
28
|
-
const minWidthPx =
|
|
29
|
-
return minWidthPx
|
|
21
|
+
const minWidthPx = Number(breakpoint);
|
|
22
|
+
return Number.isFinite(minWidthPx) ? [{
|
|
30
23
|
minWidthPx,
|
|
31
24
|
nextColumnCount
|
|
32
|
-
}];
|
|
25
|
+
}] : [];
|
|
33
26
|
}).sort((left, right) => left.minWidthPx - right.minWidthPx).reduce((columnCount, { minWidthPx, nextColumnCount }) => widthPx >= minWidthPx ? nextColumnCount : columnCount, breakpointCols.default);
|
|
34
27
|
var MasonryRoot = ({ children, className, breakpointCols = DEFAULT_BREAKPOINT_COLS, gap = "large", ref, render, style, ...otherProps }) => {
|
|
35
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
36
28
|
const rootRef = useRef(null);
|
|
37
29
|
const consumerRef = ref;
|
|
38
30
|
const [columnCount, setColumnCount] = useState(breakpointCols.default);
|
|
@@ -73,8 +65,7 @@ var MasonryRoot = ({ children, className, breakpointCols = DEFAULT_BREAKPOINT_CO
|
|
|
73
65
|
render,
|
|
74
66
|
ref: setRootRef,
|
|
75
67
|
props: {
|
|
76
|
-
...
|
|
77
|
-
...intrinsicAttributes,
|
|
68
|
+
...otherProps,
|
|
78
69
|
className: clsx(masonry_module_default.Masonry, className),
|
|
79
70
|
style: dynamicStyle,
|
|
80
71
|
children: columns.map((column) => /* @__PURE__ */ jsx(Stack, {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MeterRoot } from '@base-ui/react';
|
|
2
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
2
|
import type * as React from 'react';
|
|
4
3
|
/**
|
|
5
4
|
* Public Meter props.
|
|
@@ -10,18 +9,6 @@ import type * as React from 'react';
|
|
|
10
9
|
* @default Base UI pass-through props keep upstream defaults.
|
|
11
10
|
*/
|
|
12
11
|
export type MeterProps = MeterRoot.Props & {
|
|
13
|
-
/**
|
|
14
|
-
* Adds `data-grow="false"` to the meter root when false.
|
|
15
|
-
*
|
|
16
|
-
* @default The meter root does not render a grow attribute.
|
|
17
|
-
*/
|
|
18
|
-
grow?: IntrinsicViraProps['grow'];
|
|
19
|
-
/**
|
|
20
|
-
* Adds `data-shrink="false"` to the meter root when false.
|
|
21
|
-
*
|
|
22
|
-
* @default The meter root does not render a shrink attribute.
|
|
23
|
-
*/
|
|
24
|
-
shrink?: IntrinsicViraProps['shrink'];
|
|
25
12
|
/**
|
|
26
13
|
* Visible label rendered through `Meter.Label` with shared internal `FieldLabel`.
|
|
27
14
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Meter",
|
|
3
|
+
"structure": "<Meter value={40} />",
|
|
3
4
|
"summary": "Shows a determinate metric in a compact horizontal track for static capacity, level, or score values.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Use for storage usage, battery level, capacity, or score within a known range.",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './meter.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import { Text } from "../text/text.js";
|
|
5
4
|
import { FieldLabel } from "../basic-input/field-label.js";
|
|
6
5
|
import { Stack } from "../stack/stack.js";
|
|
@@ -8,52 +7,48 @@ import meter_module_default from "./meter.module.js";
|
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { Meter } from "@base-ui/react";
|
|
10
9
|
//#region src/components/meter/meter.tsx
|
|
11
|
-
var Meter$1 = ({ className, description, label, showValue = false, value, ...otherProps }) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
var Meter$1 = ({ className, description, label, showValue = false, value, ...otherProps }) => /* @__PURE__ */ jsxs(Meter.Root, {
|
|
11
|
+
...otherProps,
|
|
12
|
+
className: clsx(meter_module_default.Meter, className),
|
|
13
|
+
value,
|
|
14
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
15
|
+
direction: "column",
|
|
16
|
+
fillChildren: false,
|
|
17
|
+
rowGap: "small",
|
|
18
|
+
columnGap: "x-small"
|
|
19
|
+
}),
|
|
20
|
+
children: [
|
|
21
|
+
(label || showValue) && /* @__PURE__ */ jsxs(Stack, {
|
|
22
|
+
direction: "row",
|
|
20
23
|
fillChildren: false,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
columnGap: "small",
|
|
29
|
-
vAlign: "center",
|
|
30
|
-
hAlign: "space-between",
|
|
31
|
-
children: [label && /* @__PURE__ */ jsx(Meter.Label, {
|
|
32
|
-
render: /* @__PURE__ */ jsx(FieldLabel, {}),
|
|
33
|
-
children: label
|
|
34
|
-
}), showValue && /* @__PURE__ */ jsx(Text, {
|
|
35
|
-
size: "small",
|
|
36
|
-
tone: "muted",
|
|
37
|
-
family: "mono",
|
|
38
|
-
whiteSpace: "nowrap",
|
|
39
|
-
selection: false,
|
|
40
|
-
align: "end",
|
|
41
|
-
shrink: false,
|
|
42
|
-
render: /* @__PURE__ */ jsx(Meter.Value, { render: /* @__PURE__ */ jsx("output", {}) })
|
|
43
|
-
})]
|
|
44
|
-
}),
|
|
45
|
-
/* @__PURE__ */ jsx(Meter.Track, {
|
|
46
|
-
className: meter_module_default.Track,
|
|
47
|
-
children: /* @__PURE__ */ jsx(Meter.Indicator, { className: meter_module_default.Indicator })
|
|
48
|
-
}),
|
|
49
|
-
description && /* @__PURE__ */ jsx(Text, {
|
|
50
|
-
className: meter_module_default.Description,
|
|
24
|
+
columnGap: "small",
|
|
25
|
+
vAlign: "center",
|
|
26
|
+
hAlign: "space-between",
|
|
27
|
+
children: [label && /* @__PURE__ */ jsx(Meter.Label, {
|
|
28
|
+
render: /* @__PURE__ */ jsx(FieldLabel, {}),
|
|
29
|
+
children: label
|
|
30
|
+
}), showValue && /* @__PURE__ */ jsx(Text, {
|
|
51
31
|
size: "small",
|
|
52
32
|
tone: "muted",
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
33
|
+
family: "mono",
|
|
34
|
+
whiteSpace: "nowrap",
|
|
35
|
+
selection: false,
|
|
36
|
+
align: "end",
|
|
37
|
+
"data-shrink": "false",
|
|
38
|
+
render: /* @__PURE__ */ jsx(Meter.Value, { render: /* @__PURE__ */ jsx("output", {}) })
|
|
39
|
+
})]
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ jsx(Meter.Track, {
|
|
42
|
+
className: meter_module_default.Track,
|
|
43
|
+
children: /* @__PURE__ */ jsx(Meter.Indicator, { className: meter_module_default.Indicator })
|
|
44
|
+
}),
|
|
45
|
+
description && /* @__PURE__ */ jsx(Text, {
|
|
46
|
+
className: meter_module_default.Description,
|
|
47
|
+
size: "small",
|
|
48
|
+
tone: "muted",
|
|
49
|
+
children: description
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
58
53
|
//#endregion
|
|
59
54
|
export { Meter$1 as Meter };
|
|
@@ -25,7 +25,7 @@ var PopoverSheet = ({ unstyled, title, description, children, showCloseButton =
|
|
|
25
25
|
color: 1,
|
|
26
26
|
border: "all",
|
|
27
27
|
radius: "large",
|
|
28
|
-
vibrant:
|
|
28
|
+
"data-vibrant": "",
|
|
29
29
|
render: /* @__PURE__ */ jsx(Stack, {
|
|
30
30
|
rowGap: "medium",
|
|
31
31
|
fillChildren: false
|
|
@@ -48,7 +48,7 @@ var PopoverSheet = ({ unstyled, title, description, children, showCloseButton =
|
|
|
48
48
|
children: [/* @__PURE__ */ jsx(Popover.Title, {
|
|
49
49
|
render: /* @__PURE__ */ jsx(Title, {
|
|
50
50
|
align: headerAlign,
|
|
51
|
-
|
|
51
|
+
size: "6",
|
|
52
52
|
lineHeight: "x-small"
|
|
53
53
|
}),
|
|
54
54
|
children: title
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Popover",
|
|
3
|
+
"structure": "<Popover>\n <Popover.Trigger />\n <Popover.Sheet title=\"…\">…</Popover.Sheet>\n</Popover>",
|
|
3
4
|
"summary": "Compound popover built on Base UI Popover with `Popover.Trigger`, `Popover.Sheet`, `Popover.Close`, `Popover.Title`, `Popover.Description`, and `Popover.createHandle` for detached and multiple triggers; `Sheet` encapsulates Portal + Positioner + Popup + Viewport + Title + Description and animates position, size, and content between triggers; `Sheet` with `unstyled` skips the built-in Surface and header so the consumer composes the popup chrome, including `Popover.Title` and `Popover.Description`.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Anchored quick actions or contextual hints next to a triggering control",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
2
1
|
import { ProgressiveBlurDirection, ProgressiveBlurEasing } from './progressive-blur.utils';
|
|
3
2
|
import type * as React from 'react';
|
|
4
3
|
/**
|
|
@@ -9,7 +8,7 @@ import type * as React from 'react';
|
|
|
9
8
|
*
|
|
10
9
|
* @default Native div pass-through props keep React defaults.
|
|
11
10
|
*/
|
|
12
|
-
export type ProgressiveBlurProps = React.ComponentPropsWithRef<'div'> &
|
|
11
|
+
export type ProgressiveBlurProps = React.ComponentPropsWithRef<'div'> & {
|
|
13
12
|
/**
|
|
14
13
|
* Sets the maximum blur radius applied to the first layer at the selected edge.
|
|
15
14
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ProgressiveBlur",
|
|
3
|
+
"structure": "<ProgressiveBlur />",
|
|
3
4
|
"summary": "Decorative stacked backdrop-filter overlay that ramps blur from one edge toward the opposite edge.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Edge scrims on cards, sheets, heroes, or scroll regions where content should fade into blur",
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import './progressive-blur.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import progressive_blur_module_default from "./progressive-blur.module.js";
|
|
5
4
|
import { formatProgressiveBlurMaskGradient, getProgressiveBlurFactor, getProgressiveBlurMaskStops, resolveProgressiveBlurSteps } from "./progressive-blur.utils.js";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/progressive-blur/progressive-blur.tsx
|
|
8
7
|
var ProgressiveBlur = ({ blur = "16px", className, direction = "bottom", easing = "exponential", ref, steps, style, ...otherProps }) => {
|
|
9
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
10
8
|
const resolvedSteps = resolveProgressiveBlurSteps(steps, easing);
|
|
11
9
|
const dynamicStyle = {
|
|
12
10
|
"--vui-progressive-blur-amount": blur,
|
|
@@ -25,8 +23,7 @@ var ProgressiveBlur = ({ blur = "16px", className, direction = "bottom", easing
|
|
|
25
23
|
}, layerIndex);
|
|
26
24
|
});
|
|
27
25
|
return /* @__PURE__ */ jsx("div", {
|
|
28
|
-
...
|
|
29
|
-
...intrinsicAttributes,
|
|
26
|
+
...otherProps,
|
|
30
27
|
ref,
|
|
31
28
|
"aria-hidden": "true",
|
|
32
29
|
className: clsx(progressive_blur_module_default.ProgressiveBlur, className),
|
|
@@ -12,13 +12,10 @@ var resolveProgressiveBlurSteps = (steps, easing) => {
|
|
|
12
12
|
var getProgressiveBlurFactor = (easing, layerIndex, totalSteps) => {
|
|
13
13
|
if (easing === "exponential") return .5 ** layerIndex;
|
|
14
14
|
const progress = layerIndex / (totalSteps - 1);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
case "ease-in-out": return 1 - (progress < .5 ? 2 * progress * progress : 1 - (-2 * progress + 2) ** 2 / 2);
|
|
20
|
-
default: return 1 - progress;
|
|
21
|
-
}
|
|
15
|
+
if (easing === "linear") return 1 - progress;
|
|
16
|
+
if (easing === "ease-in") return 1 - progress * progress;
|
|
17
|
+
if (easing === "ease-out") return 1 - (1 - (1 - progress) ** 2);
|
|
18
|
+
return 1 - (progress < .5 ? 2 * progress * progress : 1 - (-2 * progress + 2) ** 2 / 2);
|
|
22
19
|
};
|
|
23
20
|
var getProgressiveBlurMaskStops = (layerIndex, totalSteps) => {
|
|
24
21
|
const increment = 100 / totalSteps;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Radio",
|
|
3
|
+
"structure": "<RadioGroup>\n <Radio value=\"…\" label=\"…\" />\n</RadioGroup>",
|
|
3
4
|
"summary": "Mutually exclusive choice within a RadioGroup, with optional per-option label and helper text.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Single selection from a small set of related options inside RadioGroup",
|
|
@@ -7,7 +7,7 @@ var indicatorStackRender = /* @__PURE__ */ jsx(Stack, {
|
|
|
7
7
|
fillChildren: false,
|
|
8
8
|
hAlign: "center",
|
|
9
9
|
inline: true,
|
|
10
|
-
shrink: false,
|
|
10
|
+
"data-shrink": "false",
|
|
11
11
|
vAlign: "center"
|
|
12
12
|
});
|
|
13
13
|
function SelectIndicatorSlot({ children, interactive = false }) {
|
|
@@ -21,11 +21,11 @@ function SelectIndicatorSlot({ children, interactive = false }) {
|
|
|
21
21
|
return /* @__PURE__ */ jsx(Stack, {
|
|
22
22
|
"aria-hidden": true,
|
|
23
23
|
className: select_module_default.Indicator,
|
|
24
|
-
grow: false,
|
|
24
|
+
"data-grow": "false",
|
|
25
25
|
fillChildren: false,
|
|
26
26
|
hAlign: "center",
|
|
27
27
|
inline: true,
|
|
28
|
-
shrink: false,
|
|
28
|
+
"data-shrink": "false",
|
|
29
29
|
vAlign: "center"
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -31,8 +31,8 @@ function SelectOption({ addon, addonAlign = "center", children, className, disab
|
|
|
31
31
|
children: [addon && /* @__PURE__ */ jsx(Stack, {
|
|
32
32
|
vPadding: "2x-small",
|
|
33
33
|
"aria-hidden": "true",
|
|
34
|
-
grow: false,
|
|
35
|
-
shrink: false,
|
|
34
|
+
"data-grow": "false",
|
|
35
|
+
"data-shrink": "false",
|
|
36
36
|
children: addon
|
|
37
37
|
}), /* @__PURE__ */ jsx(Text, {
|
|
38
38
|
lineHeight: "small",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FieldRoot } from '@base-ui/react/field';
|
|
2
2
|
import { SelectRoot } from '@base-ui/react/select';
|
|
3
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
4
3
|
import { SelectGroup } from './select-group';
|
|
5
4
|
import { SelectOption } from './select-option';
|
|
6
5
|
import { SelectSeparator } from './select-separator';
|
|
@@ -14,7 +13,7 @@ import type * as React from 'react';
|
|
|
14
13
|
*
|
|
15
14
|
* @default Base UI pass-through props keep upstream defaults.
|
|
16
15
|
*/
|
|
17
|
-
export type SelectProps = SelectRoot.Props<string> & Omit<FieldRoot.Props, 'ref'> &
|
|
16
|
+
export type SelectProps = SelectRoot.Props<string> & Omit<FieldRoot.Props, 'ref'> & {
|
|
18
17
|
/**
|
|
19
18
|
* Visible label rendered with shared internal `FieldLabel`.
|
|
20
19
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Select",
|
|
3
|
+
"structure": "<Select>\n <Select.Option value=\"…\">…</Select.Option>\n <Select.Group label=\"…\">\n <Select.Option value=\"…\">…</Select.Option>\n </Select.Group>\n <Select.Separator />\n</Select>",
|
|
3
4
|
"summary": "Field-wrapped single-select dropdown with grouped options and field copy.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Choose one value from a predefined list with label and helper copy",
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import './select.css';
|
|
3
3
|
import { clsx } from "../../core/clsx.js";
|
|
4
4
|
import { ChromeChevronDown, ChromeChevronExpandY, ChromeChevronUp } from "../../internal/chrome-icons/chrome-icons.js";
|
|
5
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
6
5
|
import { Text } from "../text/text.js";
|
|
7
6
|
import { FieldHelperCopy } from "../basic-input/field-helper-copy.js";
|
|
8
7
|
import { FieldLabel } from "../basic-input/field-label.js";
|
|
@@ -20,15 +19,13 @@ import { Field } from "@base-ui/react/field";
|
|
|
20
19
|
import { Select } from "@base-ui/react/select";
|
|
21
20
|
//#region src/components/select/select.tsx
|
|
22
21
|
function SelectRootComponent({ alignListWithTrigger = true, children, className, description, dirty, disabled, error, addon = /* @__PURE__ */ jsx(ChromeChevronExpandY, { size: 16 }), invalid, label, name, placeholder, ref, touched, validate, validationDebounceTime, validationMode, ...selectRootProps }) {
|
|
23
|
-
const {
|
|
24
|
-
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...restSelectProps } = componentProps;
|
|
22
|
+
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...restSelectProps } = selectRootProps;
|
|
25
23
|
const fieldLabelId = useId();
|
|
26
24
|
const listAccessibleNameProps = {};
|
|
27
25
|
if (ariaLabel !== void 0) listAccessibleNameProps["aria-label"] = ariaLabel;
|
|
28
26
|
else if (ariaLabelledBy !== void 0) listAccessibleNameProps["aria-labelledby"] = ariaLabelledBy;
|
|
29
27
|
else if (label !== void 0) listAccessibleNameProps["aria-labelledby"] = fieldLabelId;
|
|
30
28
|
return /* @__PURE__ */ jsxs(Field.Root, {
|
|
31
|
-
...intrinsicAttributes,
|
|
32
29
|
className: clsx(select_module_default.Select, className),
|
|
33
30
|
dirty,
|
|
34
31
|
disabled,
|
|
@@ -78,7 +75,7 @@ function SelectRootComponent({ alignListWithTrigger = true, children, className,
|
|
|
78
75
|
hAlign: "center",
|
|
79
76
|
hPadding: "x-small",
|
|
80
77
|
inline: true,
|
|
81
|
-
shrink: false,
|
|
78
|
+
"data-shrink": "false",
|
|
82
79
|
vAlign: "center"
|
|
83
80
|
}),
|
|
84
81
|
children: addon
|
|
@@ -118,7 +115,7 @@ function SelectRootComponent({ alignListWithTrigger = true, children, className,
|
|
|
118
115
|
overflow: "auto",
|
|
119
116
|
radius: "medium",
|
|
120
117
|
vPadding: "x-small",
|
|
121
|
-
vibrant:
|
|
118
|
+
"data-vibrant": ""
|
|
122
119
|
}),
|
|
123
120
|
children
|
|
124
121
|
})
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
2
|
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
4
3
|
import type * as React from 'react';
|
|
5
4
|
type SeparatorAxisPadding = ThemeTypes['space'] | [ThemeTypes['space'] | 0, ThemeTypes['space'] | 0];
|
|
@@ -12,7 +11,7 @@ type SeparatorSize = 'small' | 'medium' | 'large';
|
|
|
12
11
|
*
|
|
13
12
|
* @default Native hr pass-through props keep React defaults.
|
|
14
13
|
*/
|
|
15
|
-
export type SeparatorProps = Omit<React.ComponentPropsWithoutRef<'hr'>, 'size'> &
|
|
14
|
+
export type SeparatorProps = Omit<React.ComponentPropsWithoutRef<'hr'>, 'size'> & {
|
|
16
15
|
/**
|
|
17
16
|
* Replaces the default `hr` line root using Base UI render semantics.
|
|
18
17
|
*
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './separator.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import { Stack } from "../stack/stack.js";
|
|
5
4
|
import separator_module_default from "./separator.module.js";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -12,7 +11,6 @@ var separatorSizeValues = {
|
|
|
12
11
|
large: 3
|
|
13
12
|
};
|
|
14
13
|
var Separator = ({ className, hPadding, orientation = "horizontal", ref, render, size = "small", style, vPadding, ...otherProps }) => {
|
|
15
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
16
14
|
const dynamicStyle = {
|
|
17
15
|
"--vui-separator-size": `${separatorSizeValues[size]}px`,
|
|
18
16
|
...style
|
|
@@ -22,7 +20,7 @@ var Separator = ({ className, hPadding, orientation = "horizontal", ref, render,
|
|
|
22
20
|
render,
|
|
23
21
|
ref,
|
|
24
22
|
props: {
|
|
25
|
-
...
|
|
23
|
+
...otherProps,
|
|
26
24
|
"data-separator-orientation": orientation,
|
|
27
25
|
"aria-orientation": orientation,
|
|
28
26
|
className: clsx(separator_module_default.Line, className),
|
|
@@ -35,7 +33,6 @@ var Separator = ({ className, hPadding, orientation = "horizontal", ref, render,
|
|
|
35
33
|
hPadding,
|
|
36
34
|
vAlign: orientation === "vertical" ? "stretch" : "initial",
|
|
37
35
|
vPadding,
|
|
38
|
-
...intrinsicAttributes,
|
|
39
36
|
children: line
|
|
40
37
|
});
|
|
41
38
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
2
1
|
import type * as React from 'react';
|
|
3
2
|
/**
|
|
4
3
|
* Public Shimmer props.
|
|
@@ -8,7 +7,7 @@ import type * as React from 'react';
|
|
|
8
7
|
*
|
|
9
8
|
* @default Native span pass-through props keep React defaults.
|
|
10
9
|
*/
|
|
11
|
-
export type ShimmerProps = React.ComponentPropsWithoutRef<'span'> &
|
|
10
|
+
export type ShimmerProps = React.ComponentPropsWithoutRef<'span'> & {
|
|
12
11
|
/**
|
|
13
12
|
* Sets the shimmer sweep duration using any valid CSS time string.
|
|
14
13
|
*
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import './shimmer.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import shimmer_module_default from "./shimmer.module.js";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
6
5
|
//#region src/components/shimmer/shimmer.tsx
|
|
7
6
|
var Shimmer = ({ angle, className, duration, highlightColor, ref, spread, style, ...otherProps }) => {
|
|
8
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
9
7
|
const dynamicStyle = {
|
|
10
8
|
...duration && { "--vui-shimmer-duration": duration },
|
|
11
9
|
...spread && { "--vui-shimmer-spread": spread },
|
|
@@ -14,8 +12,7 @@ var Shimmer = ({ angle, className, duration, highlightColor, ref, spread, style,
|
|
|
14
12
|
...style
|
|
15
13
|
};
|
|
16
14
|
return /* @__PURE__ */ jsx("span", {
|
|
17
|
-
...
|
|
18
|
-
...intrinsicAttributes,
|
|
15
|
+
...otherProps,
|
|
19
16
|
ref,
|
|
20
17
|
className: clsx(shimmer_module_default.Shimmer, className),
|
|
21
18
|
style: dynamicStyle
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
2
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
2
|
import type * as React from 'react';
|
|
4
3
|
/**
|
|
5
4
|
* Public Skeleton props.
|
|
@@ -9,7 +8,7 @@ import type * as React from 'react';
|
|
|
9
8
|
*
|
|
10
9
|
* @default Native span pass-through props keep React defaults.
|
|
11
10
|
*/
|
|
12
|
-
export type SkeletonProps = React.ComponentPropsWithoutRef<'span'> &
|
|
11
|
+
export type SkeletonProps = React.ComponentPropsWithoutRef<'span'> & {
|
|
13
12
|
/**
|
|
14
13
|
* Sets the skeleton inline size using any valid CSS size string.
|
|
15
14
|
*
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import './skeleton.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import { resolveThemeValue } from "../../core/theme/resolve-theme-value.js";
|
|
5
4
|
import skeleton_module_default from "./skeleton.module.js";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/skeleton/skeleton.tsx
|
|
8
7
|
var Skeleton = ({ className, height, minHeight, minWidth, radius, ref, style, width, ...otherProps }) => {
|
|
9
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
10
8
|
const dynamicStyle = {
|
|
11
9
|
...radius != null && { "--vui-skeleton-border-radius": resolveThemeValue(radius, "radius", "var(--radius-small)") },
|
|
12
10
|
...width && { "--vui-skeleton-inline-size": width },
|
|
@@ -16,8 +14,7 @@ var Skeleton = ({ className, height, minHeight, minWidth, radius, ref, style, wi
|
|
|
16
14
|
...style
|
|
17
15
|
};
|
|
18
16
|
return /* @__PURE__ */ jsx("span", {
|
|
19
|
-
...
|
|
20
|
-
...intrinsicAttributes,
|
|
17
|
+
...otherProps,
|
|
21
18
|
ref,
|
|
22
19
|
"aria-hidden": "true",
|
|
23
20
|
className: clsx(skeleton_module_default.Skeleton, className),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FieldRoot } from '@base-ui/react/field';
|
|
2
2
|
import { SliderRoot } from '@base-ui/react/slider';
|
|
3
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
4
3
|
import type * as React from 'react';
|
|
5
4
|
/**
|
|
6
5
|
* Public Slider props.
|
|
@@ -11,18 +10,6 @@ import type * as React from 'react';
|
|
|
11
10
|
* @default Base UI pass-through props keep upstream defaults.
|
|
12
11
|
*/
|
|
13
12
|
export type SliderProps = SliderRoot.Props & FieldRoot.Props & {
|
|
14
|
-
/**
|
|
15
|
-
* Adds `data-grow="false"` to the field root when false.
|
|
16
|
-
*
|
|
17
|
-
* @default The field root does not render a grow attribute.
|
|
18
|
-
*/
|
|
19
|
-
grow?: IntrinsicViraProps['grow'];
|
|
20
|
-
/**
|
|
21
|
-
* Adds `data-shrink="false"` to the field root when false.
|
|
22
|
-
*
|
|
23
|
-
* @default The field root does not render a shrink attribute.
|
|
24
|
-
*/
|
|
25
|
-
shrink?: IntrinsicViraProps['shrink'];
|
|
26
13
|
/**
|
|
27
14
|
* Visible label rendered with shared internal `FieldLabel`.
|
|
28
15
|
*
|