@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,6 +1,5 @@
|
|
|
1
1
|
import './slider.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 { FieldHelperCopy } from "../basic-input/field-helper-copy.js";
|
|
6
5
|
import { FieldLabel } from "../basic-input/field-label.js";
|
|
@@ -15,9 +14,7 @@ import { Slider } from "@base-ui/react/slider";
|
|
|
15
14
|
var Slider$1 = ({ className, defaultValue, description, dirty, disabled, error, invalid, label, name, orientation = "horizontal", showValue = false, thumbAriaLabel, touched, validate, validationDebounceTime, validationMode, value, ref, ...sliderRootProps }) => {
|
|
16
15
|
const isRange = isRangeSlider(value, defaultValue);
|
|
17
16
|
const isVertical = orientation === "vertical";
|
|
18
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(sliderRootProps);
|
|
19
17
|
return /* @__PURE__ */ jsxs(Field.Root, {
|
|
20
|
-
...intrinsicAttributes,
|
|
21
18
|
className: slider_module_default.Slider,
|
|
22
19
|
dirty,
|
|
23
20
|
disabled,
|
|
@@ -33,7 +30,7 @@ var Slider$1 = ({ className, defaultValue, description, dirty, disabled, error,
|
|
|
33
30
|
rowGap: "small"
|
|
34
31
|
}),
|
|
35
32
|
children: [/* @__PURE__ */ jsxs(Slider.Root, {
|
|
36
|
-
...
|
|
33
|
+
...sliderRootProps,
|
|
37
34
|
ref,
|
|
38
35
|
className: clsx(slider_module_default.SliderRoot, className),
|
|
39
36
|
defaultValue,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type SpinnerProps = Omit<React.ComponentProps<'svg'>, 'color'> & IntrinsicViraProps & {
|
|
1
|
+
export type SpinnerProps = Omit<React.ComponentProps<'svg'>, 'color'> & {
|
|
3
2
|
/**
|
|
4
3
|
* Sets the rendered spinner size.
|
|
5
4
|
*
|
|
@@ -1,31 +1,26 @@
|
|
|
1
1
|
import './spinner.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import spinner_module_default from "./spinner.module.js";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
//#region src/components/spinner/spinner.tsx
|
|
7
|
-
var Spinner = ({ className, color, size = "big", ref, style, ...otherProps }) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
]
|
|
27
|
-
})
|
|
28
|
-
});
|
|
29
|
-
};
|
|
6
|
+
var Spinner = ({ className, color, size = "big", ref, style, ...otherProps }) => /* @__PURE__ */ jsx("svg", {
|
|
7
|
+
...otherProps,
|
|
8
|
+
ref,
|
|
9
|
+
className: clsx(spinner_module_default.Spinner, className),
|
|
10
|
+
"data-dimension": size,
|
|
11
|
+
viewBox: "0 0 16 16",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
color,
|
|
14
|
+
style,
|
|
15
|
+
children: /* @__PURE__ */ jsxs("g", {
|
|
16
|
+
className: spinner_module_default.Glyph,
|
|
17
|
+
fill: "currentColor",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx("path", { d: "M0 2h2v12H0z" }),
|
|
20
|
+
/* @__PURE__ */ jsx("path", { d: "M7 2h2v12H7z" }),
|
|
21
|
+
/* @__PURE__ */ jsx("path", { d: "M14 2h2v12h-2z" })
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
});
|
|
30
25
|
//#endregion
|
|
31
26
|
export { Spinner };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-stack-row-gap{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-column-gap{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-h-align{syntax:"*";inherits:false;initial-value:initial}@property --vui-stack-v-align{syntax:"*";inherits:false;initial-value:initial}@property --vui-stack-padding-inline-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-padding-inline-end{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-padding-block-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-padding-block-end{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-max-width{syntax:"*";inherits:false;initial-value:none}@property --vui-stack-min-width{syntax:"*";inherits:false;initial-value:none}.viraui__stack-module__Stack_NR-Ey{
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-stack-row-gap{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-column-gap{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-h-align{syntax:"*";inherits:false;initial-value:initial}@property --vui-stack-v-align{syntax:"*";inherits:false;initial-value:initial}@property --vui-stack-padding-inline-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-padding-inline-end{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-padding-block-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-padding-block-end{syntax:"<length>";inherits:false;initial-value:0}@property --vui-stack-max-width{syntax:"*";inherits:false;initial-value:none}@property --vui-stack-min-width{syntax:"*";inherits:false;initial-value:none}.viraui__stack-module__Stack_NR-Ey{display:flex;gap:var(--vui-stack-row-gap) var(--vui-stack-column-gap);flex-direction:column;align-items:var(--vui-stack-h-align);justify-content:var(--vui-stack-v-align);max-inline-size:var(--vui-stack-max-width);min-inline-size:var(--vui-stack-min-width);&[data-stack-direction=column-reverse]{flex-direction:column-reverse}&[data-stack-direction=row-reverse],&[data-stack-direction=row]{align-items:var(--vui-stack-v-align);justify-content:var(--vui-stack-h-align)}&[data-stack-direction=row]{flex-direction:row}&[data-stack-direction=row-reverse]{flex-direction:row-reverse}&[data-stack-inline=true]{display:inline-flex;flex-grow:0}:where(&[data-stack-wrap=true]){flex-wrap:wrap}:where(&[data-stack-has-padding=true]){padding:var(--vui-stack-padding-block-start) var(--vui-stack-padding-inline-end) var(--vui-stack-padding-block-end) var(--vui-stack-padding-inline-start)}:where(&[data-stack-fill-children=true]>*){flex-grow:var(--vira-flex-grow,1)}}}
|
|
@@ -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 StackAlignment = 'start' | 'center' | 'end' | 'stretch' | 'initial' | 'space-between' | 'space-around' | 'space-evenly';
|
|
@@ -13,7 +12,7 @@ type StackAxisPadding = StackSpace | [StackSpace | 0, StackSpace | 0];
|
|
|
13
12
|
*
|
|
14
13
|
* @default Base UI pass-through props keep upstream defaults.
|
|
15
14
|
*/
|
|
16
|
-
export type StackProps = React.ComponentPropsWithoutRef<'div'> &
|
|
15
|
+
export type StackProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
17
16
|
/**
|
|
18
17
|
* Replaces the default `div` root using Base UI render semantics.
|
|
19
18
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Stack",
|
|
3
|
+
"structure": "<Stack>…</Stack>",
|
|
3
4
|
"summary": "Flex layout primitive for arranging children with token spacing, alignment, and padding; root is a named CSS container query context (`stack`).",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Column or row layouts with token gap and alignment",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './stack.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 { resolveAxisPadding } from "../../core/styles/resolve-axis-padding.js";
|
|
6
5
|
import stack_module_default from "./stack.module.js";
|
|
@@ -8,7 +7,6 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
8
7
|
//#region src/components/stack/stack.tsx
|
|
9
8
|
var Stack = ({ className, direction = "column", fillChildren = true, hAlign = "initial", hPadding, inline = false, maxWidth, minWidth, ref, render, rowGap, columnGap, style, vAlign = "initial", vPadding, wrap = false, ...otherProps }) => {
|
|
10
9
|
const hasPadding = Boolean(hPadding || vPadding);
|
|
11
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
12
10
|
const dynamicStyle = {
|
|
13
11
|
"--vui-stack-row-gap": resolveThemeValue(rowGap, "space", 0),
|
|
14
12
|
"--vui-stack-column-gap": resolveThemeValue(columnGap, "space", 0),
|
|
@@ -25,8 +23,7 @@ var Stack = ({ className, direction = "column", fillChildren = true, hAlign = "i
|
|
|
25
23
|
render,
|
|
26
24
|
ref,
|
|
27
25
|
props: {
|
|
28
|
-
...
|
|
29
|
-
...intrinsicAttributes,
|
|
26
|
+
...otherProps,
|
|
30
27
|
"data-stack-direction": direction,
|
|
31
28
|
"data-stack-inline": inline ? "true" : "false",
|
|
32
29
|
"data-stack-wrap": wrap ? "true" : "false",
|
|
@@ -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 StaticNoise props.
|
|
@@ -8,7 +7,7 @@ import type * as React from 'react';
|
|
|
8
7
|
*
|
|
9
8
|
* @default Native figure pass-through props keep React defaults.
|
|
10
9
|
*/
|
|
11
|
-
export type StaticNoiseProps = React.ComponentPropsWithRef<'figure'> &
|
|
10
|
+
export type StaticNoiseProps = React.ComponentPropsWithRef<'figure'> & {
|
|
12
11
|
/**
|
|
13
12
|
* Sets the SVG turbulence `baseFrequency` for the internal noise filter.
|
|
14
13
|
*
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './static-noise.css';
|
|
3
3
|
import { clsx } from "../../core/clsx.js";
|
|
4
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
5
4
|
import static_noise_module_default from "./static-noise.module.js";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
7
6
|
import { useId } from "react";
|
|
8
7
|
//#region src/components/static-noise/static-noise.tsx
|
|
9
8
|
var STATIC_NOISE_SEED_FRAMES = "1;5;2;9;3;7;4;11;6;13;8;15;10;17;12;19;14;16;18;20;3;8;1;13";
|
|
10
9
|
var StaticNoise = ({ animate = false, baseFrequency = .5, className, mixBlendMode = "difference", opacity = .2, ref, style, ...otherProps }) => {
|
|
11
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
12
10
|
const reactId = useId();
|
|
13
11
|
const dynamicStyle = {
|
|
14
12
|
filter: `url(#${reactId}) grayscale(100%)`,
|
|
@@ -17,8 +15,7 @@ var StaticNoise = ({ animate = false, baseFrequency = .5, className, mixBlendMod
|
|
|
17
15
|
...style
|
|
18
16
|
};
|
|
19
17
|
return /* @__PURE__ */ jsx("figure", {
|
|
20
|
-
...
|
|
21
|
-
...intrinsicAttributes,
|
|
18
|
+
...otherProps,
|
|
22
19
|
ref,
|
|
23
20
|
"aria-hidden": "true",
|
|
24
21
|
className: clsx(static_noise_module_default.StaticNoise, className),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-surface-background{syntax:"*";inherits:false;initial-value:none}@property --vui-surface-background-hover{syntax:"*";inherits:false;initial-value:none}@property --vui-surface-border-style{syntax:"<custom-ident>";inherits:false;initial-value:solid}@property --vui-surface-overflow{syntax:"<custom-ident>";inherits:false;initial-value:visible}@property --vui-surface-border-radius{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-surface-border-radius-top-left{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-surface-border-radius-top-right{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-surface-border-radius-bottom-right{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-surface-border-radius-bottom-left{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-surface-padding-inline-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-surface-padding-inline-end{syntax:"<length>";inherits:false;initial-value:0}@property --vui-surface-padding-block-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-surface-padding-block-end{syntax:"<length>";inherits:false;initial-value:0}.viraui__surface-module__Surface_slEYq{--vui-surface-border-radius-top-left:var(--vui-surface-border-radius);--vui-surface-border-radius-top-right:var(--vui-surface-border-radius);--vui-surface-border-radius-bottom-right:var(--vui-surface-border-radius);--vui-surface-border-radius-bottom-left:var(--vui-surface-border-radius);--vui-surface-background-hover:var(--vui-surface-background);
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-surface-background{syntax:"*";inherits:false;initial-value:none}@property --vui-surface-background-hover{syntax:"*";inherits:false;initial-value:none}@property --vui-surface-border-style{syntax:"<custom-ident>";inherits:false;initial-value:solid}@property --vui-surface-overflow{syntax:"<custom-ident>";inherits:false;initial-value:visible}@property --vui-surface-border-radius{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-surface-border-radius-top-left{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-surface-border-radius-top-right{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-surface-border-radius-bottom-right{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-surface-border-radius-bottom-left{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-surface-padding-inline-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-surface-padding-inline-end{syntax:"<length>";inherits:false;initial-value:0}@property --vui-surface-padding-block-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-surface-padding-block-end{syntax:"<length>";inherits:false;initial-value:0}.viraui__surface-module__Surface_slEYq{--vui-surface-border-radius-top-left:var(--vui-surface-border-radius);--vui-surface-border-radius-top-right:var(--vui-surface-border-radius);--vui-surface-border-radius-bottom-right:var(--vui-surface-border-radius);--vui-surface-border-radius-bottom-left:var(--vui-surface-border-radius);--vui-surface-background-hover:var(--vui-surface-background);position:relative;overflow:var(--vui-surface-overflow);box-sizing:border-box;background:var(--vui-surface-background);border-radius:var(--vui-surface-border-radius-top-left) var(--vui-surface-border-radius-top-right) var(--vui-surface-border-radius-bottom-right) var(--vui-surface-border-radius-bottom-left);border:0;@container root not style(--vibrancy-enable: initial){&[data-vibrant]{background:oklab(from var(--vui-surface-background) l a b/80%)}}&[data-surface-radius=auto]{--vui-surface-border-radius-top-left:0;--vui-surface-border-radius-top-right:0;--vui-surface-border-radius-bottom-right:0;--vui-surface-border-radius-bottom-left:0}&[data-surface-has-padding=true]{padding:var(--vui-surface-padding-block-start) var(--vui-surface-padding-inline-end) var(--vui-surface-padding-block-end) var(--vui-surface-padding-inline-start)}&[data-surface-border]{border-style:var(--vui-surface-border-style);border-color:var(--global-contrast)}&[data-surface-border=all]{border-width:1px}&[data-surface-border=top]{border-width:1px 0 0}&[data-surface-border=right]{border-width:0 1px 0 0}&[data-surface-border=bottom]{border-width:0 0 1px}&[data-surface-border=left]{border-width:0 0 0 1px}&[data-surface-border=x]{border-width:0 1px}&[data-surface-border=y]{border-width:1px 0}@media (hover:hover) and (pointer:fine){&[data-surface-has-hover-color=true]:hover{background:var(--vui-surface-background-hover)}}}}
|
|
@@ -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 { SurfacePadding, SurfaceRadiusInput } from './surface-radius-context';
|
|
4
3
|
import type * as React from 'react';
|
|
5
4
|
/** Base ramp layer for nested surfaces; clamped to 1–3 at runtime. */
|
|
@@ -13,7 +12,7 @@ type SurfaceColor = string | SurfaceBaseLevel;
|
|
|
13
12
|
*
|
|
14
13
|
* @default Base UI pass-through props keep upstream defaults.
|
|
15
14
|
*/
|
|
16
|
-
export type SurfaceProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> &
|
|
15
|
+
export type SurfaceProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> & {
|
|
17
16
|
/**
|
|
18
17
|
* Replaces the default `div` root using Base UI render semantics.
|
|
19
18
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Surface",
|
|
3
|
+
"structure": "<Surface>…</Surface>",
|
|
3
4
|
"summary": "Presentational container with token background, optional border, radius, and padding; nested surfaces use radius=\"auto\" for concentric corners; root is a named CSS container query context (`surface`).",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Group content with base-level background and contrast border",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './surface.css';
|
|
3
3
|
import { clsx } from "../../core/clsx.js";
|
|
4
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
5
4
|
import { resolveAxisPadding } from "../../core/styles/resolve-axis-padding.js";
|
|
6
5
|
import { SurfaceRadiusContext, useSurfaceRadius } from "./surface-radius-context.js";
|
|
7
6
|
import surface_module_default from "./surface.module.js";
|
|
@@ -23,7 +22,6 @@ var surfaceDefaultRadiusProps = {
|
|
|
23
22
|
var Surface = ({ border, borderStyle = "solid", className, color, hPadding, hoverColor, overflow, radius, ref, render, style, vPadding, ...otherProps }) => {
|
|
24
23
|
const hasPadding = Boolean(hPadding || vPadding);
|
|
25
24
|
const hasHoverColor = hoverColor !== void 0;
|
|
26
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
27
25
|
const { contextValue, hasAutoRadius, radiusStyle } = useSurfaceRadius({
|
|
28
26
|
defaults: surfaceDefaultRadiusProps,
|
|
29
27
|
hPadding,
|
|
@@ -46,8 +44,7 @@ var Surface = ({ border, borderStyle = "solid", className, color, hPadding, hove
|
|
|
46
44
|
render,
|
|
47
45
|
ref,
|
|
48
46
|
props: {
|
|
49
|
-
...
|
|
50
|
-
...intrinsicAttributes,
|
|
47
|
+
...otherProps,
|
|
51
48
|
...border && { "data-surface-border": border },
|
|
52
49
|
...hasAutoRadius && { "data-surface-radius": "auto" },
|
|
53
50
|
"data-surface-has-hover-color": hasHoverColor ? "true" : "false",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FieldRoot } from '@base-ui/react/field';
|
|
2
2
|
import { SwitchRoot } from '@base-ui/react/switch';
|
|
3
3
|
import { StackProps } from '..';
|
|
4
|
-
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
5
4
|
import type * as React from 'react';
|
|
6
5
|
/**
|
|
7
6
|
* Public Switch props.
|
|
@@ -13,18 +12,6 @@ import type * as React from 'react';
|
|
|
13
12
|
* @default Base UI pass-through props keep upstream defaults.
|
|
14
13
|
*/
|
|
15
14
|
export type SwitchProps = SwitchRoot.Props & Omit<FieldRoot.Props, 'ref'> & {
|
|
16
|
-
/**
|
|
17
|
-
* Adds `data-grow="false"` to the field root when false.
|
|
18
|
-
*
|
|
19
|
-
* @default The field root does not render a grow attribute.
|
|
20
|
-
*/
|
|
21
|
-
grow?: IntrinsicViraProps['grow'];
|
|
22
|
-
/**
|
|
23
|
-
* Adds `data-shrink="false"` to the field root when false.
|
|
24
|
-
*
|
|
25
|
-
* @default The field root does not render a shrink attribute.
|
|
26
|
-
*/
|
|
27
|
-
shrink?: IntrinsicViraProps['shrink'];
|
|
28
15
|
/**
|
|
29
16
|
* Visible label rendered with shared internal `FieldLabel`.
|
|
30
17
|
*
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './switch.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import { FieldHelperCopy } from "../basic-input/field-helper-copy.js";
|
|
5
4
|
import { FieldLabel } from "../basic-input/field-label.js";
|
|
6
5
|
import { Stack } from "../stack/stack.js";
|
|
@@ -11,9 +10,7 @@ import { Switch } from "@base-ui/react/switch";
|
|
|
11
10
|
//#region src/components/switch/switch.tsx
|
|
12
11
|
var Switch$1 = ({ className, description, dirty, disabled, error, invalid, label, name, ref, size = "small", vPadding, hPadding, touched, validate, validationDebounceTime, validationMode, ...switchRootProps }) => {
|
|
13
12
|
const hasTextDescription = Boolean(description || error);
|
|
14
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(switchRootProps);
|
|
15
13
|
return /* @__PURE__ */ jsx(Field.Root, {
|
|
16
|
-
...intrinsicAttributes,
|
|
17
14
|
className: switch_module_default.Switch,
|
|
18
15
|
dirty,
|
|
19
16
|
disabled,
|
|
@@ -39,7 +36,7 @@ var Switch$1 = ({ className, description, dirty, disabled, error, invalid, label
|
|
|
39
36
|
hPadding,
|
|
40
37
|
vPadding,
|
|
41
38
|
children: [/* @__PURE__ */ jsx(Switch.Root, {
|
|
42
|
-
...
|
|
39
|
+
...switchRootProps,
|
|
43
40
|
className: clsx(switch_module_default.SwitchRoot, className),
|
|
44
41
|
"data-shrink": "false",
|
|
45
42
|
"data-size": size,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Tabs",
|
|
3
|
+
"structure": "<Tabs>\n <Tabs.List>\n <Tabs.Tab value=\"a\">…</Tabs.Tab>\n </Tabs.List>\n <Tabs.Viewport>\n <Tabs.Panel value=\"a\">…</Tabs.Panel>\n </Tabs.Viewport>\n</Tabs>",
|
|
3
4
|
"summary": "Compound segmented tab control with Surface list chrome, moving indicator, and animated panels.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Switching between related views in the same surface",
|
|
@@ -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 TextSpace = ThemeTypes['space'];
|
|
@@ -12,7 +11,7 @@ type TextAxisPadding = TextSpace | [TextSpace | 0, TextSpace | 0];
|
|
|
12
11
|
*
|
|
13
12
|
* @default Base HTML pass-through props keep upstream defaults.
|
|
14
13
|
*/
|
|
15
|
-
export type TextProps = React.ComponentPropsWithoutRef<'span'> &
|
|
14
|
+
export type TextProps = React.ComponentPropsWithoutRef<'span'> & {
|
|
16
15
|
/**
|
|
17
16
|
* Replaces the default `span` root using Base UI render semantics.
|
|
18
17
|
*
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import './text.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import { resolveAxisPadding } from "../../core/styles/resolve-axis-padding.js";
|
|
5
4
|
import text_module_default from "./text.module.js";
|
|
6
5
|
import { useRender } from "@base-ui/react/use-render";
|
|
7
6
|
//#region src/components/text/text.tsx
|
|
8
7
|
var Text = ({ align = "start", balanced = false, selection = true, className, color, family = "body", fontWidth, hPadding, lineHeight = "standard", maxWidth, opticalSize, ref, render, size = "medium", style, tone, trim = "both", trimType = "cap alphabetic", vPadding, weight = "regular", whiteSpace = "normal", ...otherProps }) => {
|
|
9
8
|
const hasPadding = Boolean(hPadding || vPadding);
|
|
10
|
-
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
11
9
|
const dynamicStyle = {
|
|
12
10
|
"--vui-text-align": align,
|
|
13
11
|
"--vui-text-max-width": maxWidth ?? "none",
|
|
@@ -27,8 +25,7 @@ var Text = ({ align = "start", balanced = false, selection = true, className, co
|
|
|
27
25
|
render,
|
|
28
26
|
ref,
|
|
29
27
|
props: {
|
|
30
|
-
...
|
|
31
|
-
...intrinsicAttributes,
|
|
28
|
+
...otherProps,
|
|
32
29
|
"data-text-size": size,
|
|
33
30
|
"data-text-family": family,
|
|
34
31
|
"data-text-weight": typeof weight === "string" ? weight : "custom",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldRoot } from '@base-ui/react/field';
|
|
2
|
-
import {
|
|
2
|
+
import { BasicInputProps } from '../basic-input';
|
|
3
3
|
import type * as React from 'react';
|
|
4
4
|
/**
|
|
5
5
|
* Public Textarea props.
|
|
@@ -10,20 +10,7 @@ import type * as React from 'react';
|
|
|
10
10
|
*
|
|
11
11
|
* @default Base UI `Field.Root` pass-through props keep upstream defaults.
|
|
12
12
|
*/
|
|
13
|
-
export type TextareaProps = React.
|
|
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
|
-
ref?: React.Ref<HTMLTextAreaElement>;
|
|
13
|
+
export type TextareaProps = React.ComponentPropsWithRef<'textarea'> & Omit<FieldRoot.Props, 'ref'> & {
|
|
27
14
|
/**
|
|
28
15
|
* Visible label rendered with shared internal `FieldLabel`.
|
|
29
16
|
*
|
|
@@ -51,5 +38,12 @@ export type TextareaProps = React.ComponentPropsWithoutRef<'textarea'> & Omit<Fi
|
|
|
51
38
|
* @default undefined (no resize)
|
|
52
39
|
*/
|
|
53
40
|
resize?: 'vertical' | 'both';
|
|
41
|
+
/**
|
|
42
|
+
* When `true`, sets `field-sizing: content` so the control grows with its value.
|
|
43
|
+
* Still respects `min-block-size` and `resize`. Omitted / `false` keeps the browser fixed default.
|
|
44
|
+
*
|
|
45
|
+
* @default undefined (browser fixed)
|
|
46
|
+
*/
|
|
47
|
+
fitContent?: BasicInputProps['fitContent'];
|
|
54
48
|
};
|
|
55
49
|
export declare const Textarea: React.FC<TextareaProps>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Textarea",
|
|
3
|
-
"
|
|
3
|
+
"structure": "<Textarea />",
|
|
4
|
+
"summary": "Multi-line field control with shared field copy, optional resize, and optional content sizing.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Multi-line text entry with label, description, and error",
|
|
6
7
|
"Controlled vertical or bidirectional resize",
|
|
8
|
+
"Content-sized growth via fitContent",
|
|
7
9
|
"Native textarea attributes through the field control",
|
|
8
10
|
"One or more Textareas inside Fieldset when they belong to a labeled form section with other fields"
|
|
9
11
|
],
|
|
@@ -20,6 +22,11 @@
|
|
|
20
22
|
"antiPatterns": ["Using Textarea for single-line values", "Expecting unsupported size or variant props"],
|
|
21
23
|
"related": ["Fieldset", "Textfield", "Text"],
|
|
22
24
|
"properties": {
|
|
25
|
+
"react": {
|
|
26
|
+
"fitContent": {
|
|
27
|
+
"description": "When true, sets field-sizing: content so the control grows with its value while still respecting min-block-size and resize. Omitted or false keeps the browser fixed default."
|
|
28
|
+
}
|
|
29
|
+
},
|
|
23
30
|
"css": {
|
|
24
31
|
"min-block-size": {
|
|
25
32
|
"description": "Minimum block size of the textarea field root."
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './textarea.css';
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
|
-
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
3
|
import { BasicInput } from "../basic-input/basic-input.js";
|
|
5
4
|
import { FieldHelperCopy } from "../basic-input/field-helper-copy.js";
|
|
6
5
|
import { FieldLabel } from "../basic-input/field-label.js";
|
|
@@ -9,43 +8,40 @@ import textarea_module_default from "./textarea.module.js";
|
|
|
9
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import { Field } from "@base-ui/react/field";
|
|
11
10
|
//#region src/components/textarea/textarea.tsx
|
|
12
|
-
var Textarea = ({ className, description, dirty, disabled, error, invalid, label, name, ref, resize, touched, validate, validationDebounceTime, validationMode, ...textareaProps }) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
var Textarea = ({ className, description, dirty, disabled, error, fitContent, invalid, label, name, ref, resize, touched, validate, validationDebounceTime, validationMode, ...textareaProps }) => /* @__PURE__ */ jsxs(Field.Root, {
|
|
12
|
+
className: textarea_module_default.Textarea,
|
|
13
|
+
dirty,
|
|
14
|
+
disabled,
|
|
15
|
+
invalid,
|
|
16
|
+
name,
|
|
17
|
+
touched,
|
|
18
|
+
validate,
|
|
19
|
+
validationDebounceTime,
|
|
20
|
+
validationMode,
|
|
21
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
22
|
+
direction: "column",
|
|
23
|
+
rowGap: "small"
|
|
24
|
+
}),
|
|
25
|
+
children: [
|
|
26
|
+
label && /* @__PURE__ */ jsx(Field.Label, {
|
|
27
|
+
className: textarea_module_default.Label,
|
|
28
|
+
children: /* @__PURE__ */ jsx(FieldLabel, { children: label })
|
|
28
29
|
}),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
error
|
|
46
|
-
})
|
|
47
|
-
]
|
|
48
|
-
});
|
|
49
|
-
};
|
|
30
|
+
/* @__PURE__ */ jsx(BasicInput, {
|
|
31
|
+
...textareaProps,
|
|
32
|
+
ref,
|
|
33
|
+
className: clsx(textarea_module_default.CustomBasicInput, className),
|
|
34
|
+
"data-resize": resize,
|
|
35
|
+
disabled,
|
|
36
|
+
fitContent,
|
|
37
|
+
render: /* @__PURE__ */ jsx("textarea", {})
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx(FieldHelperCopy, {
|
|
40
|
+
className: textarea_module_default.Description,
|
|
41
|
+
description,
|
|
42
|
+
error
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
50
46
|
//#endregion
|
|
51
47
|
export { Textarea };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FieldRoot } from '@base-ui/react/field';
|
|
2
2
|
import { Input as PrimitiveInput } from '@base-ui/react/input';
|
|
3
|
-
import {
|
|
3
|
+
import { BasicInputProps } from '../basic-input';
|
|
4
4
|
import type * as React from 'react';
|
|
5
5
|
/**
|
|
6
6
|
* Public Textfield props.
|
|
@@ -11,7 +11,7 @@ import type * as React from 'react';
|
|
|
11
11
|
*
|
|
12
12
|
* @default Base UI pass-through props keep upstream defaults.
|
|
13
13
|
*/
|
|
14
|
-
export type TextfieldProps = PrimitiveInput.Props & FieldRoot.Props &
|
|
14
|
+
export type TextfieldProps = PrimitiveInput.Props & FieldRoot.Props & {
|
|
15
15
|
/**
|
|
16
16
|
* Visible label rendered with shared internal `FieldLabel`.
|
|
17
17
|
*
|
|
@@ -44,5 +44,12 @@ export type TextfieldProps = PrimitiveInput.Props & FieldRoot.Props & IntrinsicV
|
|
|
44
44
|
* @default No end addon is rendered.
|
|
45
45
|
*/
|
|
46
46
|
endAddon?: React.ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* When `true`, sets `field-sizing: content` so the control grows inline with its value.
|
|
49
|
+
* Block chrome stays `var(--vui-textfield-input-height)`. Omitted / `false` keeps the browser fixed default.
|
|
50
|
+
*
|
|
51
|
+
* @default undefined (browser fixed)
|
|
52
|
+
*/
|
|
53
|
+
fitContent?: BasicInputProps['fitContent'];
|
|
47
54
|
};
|
|
48
55
|
export declare const Textfield: React.FC<TextfieldProps>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Textfield",
|
|
3
|
+
"structure": "<Textfield />",
|
|
3
4
|
"summary": "Single-line field input with control-group chrome and optional addons.",
|
|
4
5
|
"whenToUse": [
|
|
5
6
|
"Single-line text, email, password, or similar native input types",
|
|
@@ -24,6 +25,11 @@
|
|
|
24
25
|
],
|
|
25
26
|
"related": ["Fieldset", "Textarea", "Select", "Text"],
|
|
26
27
|
"properties": {
|
|
28
|
+
"react": {
|
|
29
|
+
"fitContent": {
|
|
30
|
+
"description": "When true, sets field-sizing: content so the control grows inline with its value; block chrome stays the fixed textfield input height. Omitted or false keeps the browser fixed default."
|
|
31
|
+
}
|
|
32
|
+
},
|
|
27
33
|
"css": {
|
|
28
34
|
"input-height": {
|
|
29
35
|
"description": "Textfield control group block size."
|