@viraui/react 0.0.22 → 0.0.24
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 +26 -2
- package/dist/components/avatar/avatar.css +1 -1
- package/dist/components/avatar/avatar.module.js +3 -3
- package/dist/components/avatar-group/avatar-group.css +1 -1
- package/dist/components/avatar-group/avatar-group.module.js +5 -5
- package/dist/components/basic-input/basic-input.css +1 -1
- package/dist/components/basic-input/basic-input.js +0 -1
- package/dist/components/basic-input/basic-input.module.js +1 -1
- package/dist/components/basic-input/field-helper-copy.d.ts +1 -1
- package/dist/components/basic-input/field-helper-copy.js +0 -1
- package/dist/components/basic-input/field-label.css +1 -1
- package/dist/components/basic-input/field-label.js +0 -1
- package/dist/components/basic-input/field-label.module.js +1 -1
- package/dist/components/basic-input/input-control-group.js +0 -1
- package/dist/components/button/button.css +1 -1
- package/dist/components/button/button.d.ts +13 -7
- package/dist/components/button/button.guide.json +7 -5
- package/dist/components/button/button.js +11 -10
- package/dist/components/button/button.module.js +3 -3
- package/dist/components/checkbox/checkbox-group.d.ts +12 -0
- package/dist/components/checkbox/checkbox-group.js +15 -0
- package/dist/components/checkbox/checkbox.css +1 -1
- package/dist/components/checkbox/checkbox.d.ts +6 -21
- package/dist/components/checkbox/checkbox.guide.json +10 -5
- package/dist/components/checkbox/checkbox.js +45 -59
- package/dist/components/checkbox/checkbox.module.js +7 -6
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/chip/chip.css +1 -1
- package/dist/components/chip/chip.js +0 -2
- package/dist/components/chip/chip.module.js +4 -4
- package/dist/components/clamp-text/clamp-text.css +1 -1
- package/dist/components/clamp-text/clamp-text.module.js +1 -1
- package/dist/components/dialog/dialog-close.d.ts +15 -0
- package/dist/components/dialog/dialog-close.js +9 -0
- package/dist/components/dialog/dialog-indent-background.d.ts +12 -0
- package/dist/components/dialog/dialog-indent-background.js +11 -0
- package/dist/components/dialog/dialog-indent.d.ts +12 -0
- package/dist/components/dialog/dialog-indent.js +11 -0
- package/dist/components/dialog/dialog-sheet.d.ts +66 -0
- package/dist/components/dialog/dialog-sheet.js +80 -0
- package/dist/components/dialog/dialog-trigger.d.ts +13 -0
- package/dist/components/dialog/dialog-trigger.js +9 -0
- package/dist/components/dialog/dialog.css +1 -0
- package/dist/components/dialog/dialog.d.ts +28 -0
- package/dist/components/dialog/dialog.guide.json +27 -0
- package/dist/components/dialog/dialog.js +23 -0
- package/dist/components/dialog/dialog.module.js +15 -0
- package/dist/components/dialog/index.d.ts +12 -0
- package/dist/components/elevator/elevator.js +4 -4
- package/dist/components/fieldset/fieldset.d.ts +35 -0
- package/dist/components/fieldset/fieldset.guide.json +28 -0
- package/dist/components/fieldset/fieldset.js +30 -0
- package/dist/components/fieldset/index.d.ts +2 -0
- package/dist/components/icon/icon.css +1 -1
- package/dist/components/icon/icon.module.js +1 -1
- package/dist/components/icon-button/icon-button.d.ts +1 -1
- package/dist/components/icon-button/icon-button.guide.json +1 -1
- package/dist/components/icon-button/icon-button.js +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/linear-progress/linear-progress.css +1 -1
- package/dist/components/linear-progress/linear-progress.js +0 -1
- package/dist/components/linear-progress/linear-progress.module.js +4 -4
- package/dist/components/masonry/masonry-item.js +0 -1
- package/dist/components/masonry/masonry.css +1 -1
- package/dist/components/masonry/masonry.js +2 -3
- package/dist/components/masonry/masonry.module.js +2 -2
- package/dist/components/progressive-blur/progressive-blur.css +1 -1
- package/dist/components/progressive-blur/progressive-blur.module.js +2 -2
- package/dist/components/radio/radio-group.d.ts +5 -38
- package/dist/components/radio/radio-group.js +12 -50
- package/dist/components/radio/radio.css +1 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.guide.json +12 -8
- package/dist/components/radio/radio.js +31 -29
- package/dist/components/radio/radio.module.js +3 -5
- package/dist/components/select/select-group.js +1 -1
- package/dist/components/select/select-indicator-slot.js +0 -1
- package/dist/components/select/select-option.d.ts +9 -2
- package/dist/components/select/select-option.js +32 -31
- package/dist/components/select/select-separator.js +0 -1
- package/dist/components/select/select.css +1 -1
- package/dist/components/select/select.guide.json +8 -3
- package/dist/components/select/select.js +3 -2
- package/dist/components/select/select.module.js +17 -16
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/separator.css +1 -0
- package/dist/components/separator/separator.d.ts +54 -0
- package/dist/components/separator/separator.guide.json +24 -0
- package/dist/components/separator/separator.js +43 -0
- package/dist/components/separator/separator.module.js +3 -0
- package/dist/components/skeleton/skeleton.css +1 -1
- package/dist/components/skeleton/skeleton.module.js +2 -2
- package/dist/components/slider/slider-control.js +0 -1
- package/dist/components/slider/slider.css +1 -1
- package/dist/components/slider/slider.js +1 -3
- package/dist/components/slider/slider.module.js +9 -8
- package/dist/components/spinner/spinner.css +1 -1
- package/dist/components/spinner/spinner.js +2 -2
- package/dist/components/spinner/spinner.module.js +3 -3
- package/dist/components/stack/stack.css +1 -1
- package/dist/components/stack/stack.d.ts +2 -2
- package/dist/components/stack/stack.js +0 -1
- package/dist/components/stack/stack.module.js +1 -1
- package/dist/components/static-noise/static-noise.css +1 -1
- package/dist/components/static-noise/static-noise.d.ts +1 -1
- package/dist/components/static-noise/static-noise.js +2 -1
- package/dist/components/static-noise/static-noise.module.js +2 -2
- package/dist/components/surface/surface-radius-context.d.ts +9 -1
- package/dist/components/surface/surface-radius-context.js +17 -6
- package/dist/components/surface/surface.css +1 -1
- package/dist/components/surface/surface.d.ts +9 -3
- package/dist/components/surface/surface.guide.json +3 -1
- package/dist/components/surface/surface.js +3 -3
- package/dist/components/surface/surface.module.js +1 -4
- package/dist/components/switch/switch.css +1 -1
- package/dist/components/switch/switch.js +31 -29
- package/dist/components/switch/switch.module.js +4 -3
- package/dist/components/tabs/index.d.ts +6 -0
- package/dist/components/tabs/tabs-indicator.d.ts +9 -0
- package/dist/components/tabs/tabs-indicator.js +16 -0
- package/dist/components/tabs/tabs-list.d.ts +12 -0
- package/dist/components/tabs/tabs-list.js +29 -0
- package/dist/components/tabs/tabs-panel.d.ts +11 -0
- package/dist/components/tabs/tabs-panel.js +13 -0
- package/dist/components/tabs/tabs-tab.d.ts +24 -0
- package/dist/components/tabs/tabs-tab.js +24 -0
- package/dist/components/tabs/tabs-viewport.d.ts +8 -0
- package/dist/components/tabs/tabs-viewport.js +11 -0
- package/dist/components/tabs/tabs.css +1 -0
- package/dist/components/tabs/tabs.d.ts +31 -0
- package/dist/components/tabs/tabs.guide.json +23 -0
- package/dist/components/tabs/tabs.js +30 -0
- package/dist/components/tabs/tabs.module.js +11 -0
- package/dist/components/text/text.css +1 -1
- package/dist/components/text/text.d.ts +2 -2
- package/dist/components/text/text.js +2 -3
- package/dist/components/text/text.module.js +1 -1
- package/dist/components/textarea/textarea.css +1 -1
- package/dist/components/textarea/textarea.guide.json +8 -3
- package/dist/components/textarea/textarea.js +1 -3
- package/dist/components/textarea/textarea.module.js +4 -3
- package/dist/components/textfield/textfield.css +1 -1
- package/dist/components/textfield/textfield.guide.json +9 -3
- package/dist/components/textfield/textfield.js +1 -3
- package/dist/components/textfield/textfield.module.js +6 -5
- package/dist/components/title/title.css +1 -1
- package/dist/components/title/title.js +2 -3
- package/dist/components/title/title.module.js +1 -1
- package/dist/core/elevation/get-elevation-props.js +2 -2
- package/dist/core/props/intrinsic-vira-props.d.ts +3 -3
- package/dist/index.js +11 -1
- package/dist/internal-icons/icon-registry.d.ts +4 -1
- package/dist/internal-icons/icon-registry.js +9 -0
- package/dist/internal-icons/icons/duo/ArrowDown.js +1 -1
- package/dist/internal-icons/icons/duo/ArrowDownLeft.js +1 -1
- package/dist/internal-icons/icons/duo/ArrowDownRight.js +1 -1
- package/dist/internal-icons/icons/duo/ArrowLeft.js +1 -1
- package/dist/internal-icons/icons/duo/ArrowRight.js +1 -1
- package/dist/internal-icons/icons/duo/ArrowUp.js +1 -1
- package/dist/internal-icons/icons/duo/ArrowUpLeft.js +1 -1
- package/dist/internal-icons/icons/duo/ArrowUpRight.js +1 -1
- package/dist/internal-icons/icons/duo/ChevronExpandY.js +2 -2
- package/dist/internal-icons/icons/duo/CircleCheck.d.ts +7 -0
- package/dist/internal-icons/icons/duo/CircleCheck.js +13 -0
- package/dist/internal-icons/icons/duo/Duplicate.d.ts +7 -0
- package/dist/internal-icons/icons/duo/Duplicate.js +13 -0
- package/dist/internal-icons/icons/duo/RefreshAnticlockwise.js +1 -1
- package/dist/internal-icons/icons/duo/ShieldCheck.d.ts +7 -0
- package/dist/internal-icons/icons/duo/ShieldCheck.js +13 -0
- package/dist/internal-icons/icons/duo/index.d.ts +3 -0
- package/dist/internal-icons/icons/duo/index.js +3 -0
- package/dist/preflight-surface.json +15 -1
- package/dist/preflight.css +1 -1
- package/dist/theme-surface.json +0 -5
- package/package.json +4 -4
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
|
+
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
4
|
+
import type * as React from 'react';
|
|
5
|
+
type SeparatorAxisPadding = ThemeTypes['space'] | [ThemeTypes['space'] | 0, ThemeTypes['space'] | 0];
|
|
6
|
+
type SeparatorSize = 'small' | 'medium' | 'large';
|
|
7
|
+
/**
|
|
8
|
+
* Public Separator props.
|
|
9
|
+
*
|
|
10
|
+
* Includes standard `hr` attributes such as `id`, `title`, and event handlers,
|
|
11
|
+
* plus Vira-owned orientation, line thickness, Stack padding, and Base UI `render` support for replacing the line root.
|
|
12
|
+
*
|
|
13
|
+
* @default Native hr pass-through props keep React defaults.
|
|
14
|
+
*/
|
|
15
|
+
export type SeparatorProps = Omit<React.ComponentPropsWithoutRef<'hr'>, 'size'> & IntrinsicViraProps & {
|
|
16
|
+
/**
|
|
17
|
+
* Replaces the default `hr` line root using Base UI render semantics.
|
|
18
|
+
*
|
|
19
|
+
* @default The separator renders an `hr` line root.
|
|
20
|
+
*/
|
|
21
|
+
render?: useRender.RenderProp;
|
|
22
|
+
/**
|
|
23
|
+
* Ref forwarded to the rendered line root element.
|
|
24
|
+
*
|
|
25
|
+
* @default No ref is attached.
|
|
26
|
+
*/
|
|
27
|
+
ref?: React.Ref<HTMLElement>;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the separator line direction.
|
|
30
|
+
*
|
|
31
|
+
* @default 'horizontal'
|
|
32
|
+
*/
|
|
33
|
+
orientation?: 'horizontal' | 'vertical';
|
|
34
|
+
/**
|
|
35
|
+
* Sets inline padding on the Stack wrapper using one token for both sides or a `[start, end]` tuple.
|
|
36
|
+
*
|
|
37
|
+
* @default No inline padding.
|
|
38
|
+
*/
|
|
39
|
+
hPadding?: SeparatorAxisPadding;
|
|
40
|
+
/**
|
|
41
|
+
* Sets block padding on the Stack wrapper using one token for both sides or a `[start, end]` tuple.
|
|
42
|
+
*
|
|
43
|
+
* @default No block padding.
|
|
44
|
+
*/
|
|
45
|
+
vPadding?: SeparatorAxisPadding;
|
|
46
|
+
/**
|
|
47
|
+
* Sets the line thickness preset.
|
|
48
|
+
*
|
|
49
|
+
* @default 'small'
|
|
50
|
+
*/
|
|
51
|
+
size?: SeparatorSize;
|
|
52
|
+
};
|
|
53
|
+
export declare const Separator: React.FC<SeparatorProps>;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Separator",
|
|
3
|
+
"summary": "Thematic or content divider with horizontal or vertical orientation, token padding, and preset line thickness.",
|
|
4
|
+
"whenToUse": [
|
|
5
|
+
"Dividing sections within a page or panel",
|
|
6
|
+
"Vertical dividers in toolbars, menus, or button groups",
|
|
7
|
+
"Separating list items or stacked content blocks"
|
|
8
|
+
],
|
|
9
|
+
"whenNotToUse": [
|
|
10
|
+
"Select dropdown option dividers — use Select.Separator",
|
|
11
|
+
"Surface borders or card outlines — use Surface border props"
|
|
12
|
+
],
|
|
13
|
+
"accessibility": [
|
|
14
|
+
"Default hr provides a native thematic break for horizontal dividers",
|
|
15
|
+
"Vertical separators expose aria-orientation=\"vertical\" on the line root",
|
|
16
|
+
"Use render to swap the line root when a thematic break is not appropriate",
|
|
17
|
+
"Do not force aria-hidden — consumer decides decorative vs structural role"
|
|
18
|
+
],
|
|
19
|
+
"antiPatterns": [
|
|
20
|
+
"Using Select.Separator for general layout dividers",
|
|
21
|
+
"Replacing Surface borders with Separator for container chrome"
|
|
22
|
+
],
|
|
23
|
+
"related": ["Stack", "Surface", "Select"]
|
|
24
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import './separator.css';
|
|
2
|
+
import { clsx } from "../../core/clsx.js";
|
|
3
|
+
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
|
+
import { Stack } from "../stack/stack.js";
|
|
5
|
+
import separator_module_default from "./separator.module.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
//#region src/components/separator/separator.tsx
|
|
9
|
+
var separatorSizeValues = {
|
|
10
|
+
small: 1,
|
|
11
|
+
medium: 2,
|
|
12
|
+
large: 3
|
|
13
|
+
};
|
|
14
|
+
var Separator = ({ className, hPadding, orientation = "horizontal", ref, render, size = "small", style, vPadding, ...otherProps }) => {
|
|
15
|
+
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
16
|
+
const dynamicStyle = {
|
|
17
|
+
"--separator-size": `${separatorSizeValues[size]}px`,
|
|
18
|
+
...style
|
|
19
|
+
};
|
|
20
|
+
const line = useRender({
|
|
21
|
+
defaultTagName: "hr",
|
|
22
|
+
render,
|
|
23
|
+
ref,
|
|
24
|
+
props: {
|
|
25
|
+
...componentProps,
|
|
26
|
+
"data-separator-orientation": orientation,
|
|
27
|
+
"aria-orientation": orientation,
|
|
28
|
+
className: clsx(separator_module_default.Line, className),
|
|
29
|
+
style: dynamicStyle
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ jsx(Stack, {
|
|
33
|
+
direction: orientation === "vertical" ? "row" : "column",
|
|
34
|
+
fillChildren: false,
|
|
35
|
+
hPadding,
|
|
36
|
+
vAlign: orientation === "vertical" ? "stretch" : "initial",
|
|
37
|
+
vPadding,
|
|
38
|
+
...intrinsicAttributes,
|
|
39
|
+
children: line
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Separator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.viraui__skeleton-module__Skeleton_pn7Xk{--skeleton-background:var(--global-contrast);--skeleton-border-radius:var(--radius-small);--skeleton-inline-size:auto;--skeleton-block-size:auto;--skeleton-min-inline-size:var(--space-x-large);--skeleton-min-block-size:var(--space-medium);display:inline-block;box-sizing:border-box;inline-size:var(--skeleton-inline-size);block-size:var(--skeleton-block-size);min-inline-size:var(--skeleton-min-inline-size);min-block-size:var(--skeleton-min-block-size);max-inline-size:100%;background:var(--skeleton-background);border-radius:var(--skeleton-border-radius);vertical-align:middle;animation:viraui__skeleton-module__skeleton-fade_XHkG4 var(--duration-slow) var(--easing-standard) infinite alternate;@media (prefers-reduced-motion:reduce){animation:none}}@keyframes viraui__skeleton-module__skeleton-fade_XHkG4{0%{opacity:.52}to{opacity:1}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var skeleton_module_default = {
|
|
2
|
-
Skeleton: "
|
|
3
|
-
"skeleton-fade": "
|
|
2
|
+
Skeleton: "viraui__skeleton-module__Skeleton_pn7Xk",
|
|
3
|
+
"skeleton-fade": "viraui__skeleton-module__skeleton-fade_XHkG4"
|
|
4
4
|
};
|
|
5
5
|
//#endregion
|
|
6
6
|
export { skeleton_module_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.viraui__slider-module__Slider_vDNlm{--slider-track-size:var(--space-x-small);--slider-thumb-size:var(--space-medium);--slider-track-background:var(--global-contrast);--slider-progress-background:var(--global-primary);--slider-thumb-background:contrast-color(var(--global-primary));inline-size:100%;block-size:100%;min-inline-size:0;min-block-size:0;&:has([required]) .viraui__slider-module__Label_eQQHf:after{content:" *";color:var(--highlight-red)}&[data-invalid]{--slider-progress-background:var(--highlight-red)}&:has(.viraui__slider-module__SliderRoot_4JScw[data-disabled]),&[data-disabled]{--slider-track-background:var(--global-disabled-background);--slider-progress-background:var(--global-disabled-foreground);--slider-thumb-background:var(--global-disabled-foreground);cursor:not-allowed}}.viraui__slider-module__SliderRoot_4JScw{inline-size:100%;block-size:100%;min-inline-size:0;min-block-size:0}.viraui__slider-module__SliderHeader_gOy9k{inline-size:100%;min-inline-size:0}.viraui__slider-module__Value_FaY9i{flex-shrink:0}.viraui__slider-module__SliderControl_FQd5-{position:relative;flex:1 1 auto;user-select:none;touch-action:none;inline-size:100%;block-size:var(--slider-track-size);min-inline-size:0;min-block-size:0;&[data-orientation=vertical]{inline-size:var(--slider-track-size);block-size:100%;>.viraui__slider-module__Track_wvLEH{inline-size:var(--slider-track-size);block-size:100%}}}.viraui__slider-module__Track_wvLEH{position:relative;overflow:visible;inline-size:100%;block-size:var(--slider-track-size);background:var(--slider-track-background);border-radius:var(--radius-infinite)}.viraui__slider-module__Indicator_y3JyJ{background:var(--slider-progress-background);border-radius:inherit}.viraui__slider-module__Thumb_S-uLF{box-sizing:border-box;inline-size:var(--slider-thumb-size);block-size:calc(var(--slider-thumb-size) - 2px);background:var(--slider-thumb-background);border:2px solid var(--slider-progress-background);border-radius:var(--radius-x-small);appearance:none;transition:scale var(--easing-elastic) var(--duration-slow);&:not(:disabled,[data-disabled]){cursor:grab}&:not(:disabled,[data-disabled]):active,&:not(:disabled,[data-disabled]):has(>input:active),&:not(:disabled,[data-disabled])[data-dragging]:has(>input:focus){cursor:grabbing;scale:1.2}&:has(>input:focus-visible){outline:var(--outline);outline-offset:var(--outline-offset)}>input:focus-visible{outline:none}}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import './slider.css';
|
|
3
2
|
import { clsx } from "../../core/clsx.js";
|
|
4
3
|
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
@@ -53,12 +52,11 @@ var Slider$1 = ({ className, defaultValue, description, dirty, disabled, error,
|
|
|
53
52
|
children: [(label || showValue) && /* @__PURE__ */ jsxs(Stack, {
|
|
54
53
|
className: slider_module_default.SliderHeader,
|
|
55
54
|
direction: isVertical ? "column" : "row",
|
|
56
|
-
fillChildren: false,
|
|
57
55
|
columnGap: "small",
|
|
58
56
|
vAlign: "end",
|
|
59
57
|
hAlign: isVertical ? "center" : "space-between",
|
|
60
58
|
children: [label && /* @__PURE__ */ jsx(Field.Label, {
|
|
61
|
-
|
|
59
|
+
className: slider_module_default.Label,
|
|
62
60
|
children: /* @__PURE__ */ jsx(FieldLabel, { children: label })
|
|
63
61
|
}), showValue && /* @__PURE__ */ jsx(Text, {
|
|
64
62
|
className: slider_module_default.Value,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
var slider_module_default = {
|
|
2
|
-
Slider: "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
Slider: "viraui__slider-module__Slider_vDNlm",
|
|
3
|
+
Label: "viraui__slider-module__Label_eQQHf",
|
|
4
|
+
SliderRoot: "viraui__slider-module__SliderRoot_4JScw",
|
|
5
|
+
SliderHeader: "viraui__slider-module__SliderHeader_gOy9k",
|
|
6
|
+
Value: "viraui__slider-module__Value_FaY9i",
|
|
7
|
+
SliderControl: "viraui__slider-module__SliderControl_FQd5-",
|
|
8
|
+
Track: "viraui__slider-module__Track_wvLEH",
|
|
9
|
+
Indicator: "viraui__slider-module__Indicator_y3JyJ",
|
|
10
|
+
Thumb: "viraui__slider-module__Thumb_S-uLF"
|
|
10
11
|
};
|
|
11
12
|
//#endregion
|
|
12
13
|
export { slider_module_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.viraui__spinner-module__Spinner_qCQzj{--spinner-size:var(--space-x-large);display:inline-block;inline-size:var(--spinner-size);block-size:var(--spinner-size);flex:none;vertical-align:middle;color:currentColor;&[data-dimension=small]{--spinner-size:var(--space-medium)}&[data-dimension=regular]{--spinner-size:var(--space-large)}}.viraui__spinner-module__Glyph_OV-cy>path{transform-origin:8px 8px;animation:viraui__spinner-module__spinner-bars_jDmaB var(--duration-slowest) infinite}.viraui__spinner-module__Glyph_OV-cy>path:first-child,.viraui__spinner-module__Glyph_OV-cy>path:nth-child(3){opacity:.3;transform:scaleY(.5);animation-delay:calc(var(--duration-slowest) / -2)}@keyframes viraui__spinner-module__spinner-bars_jDmaB{0%,to{opacity:1;transform:scaleY(1)}50%{opacity:.3;transform:scaleY(.5)}}
|
|
@@ -14,8 +14,8 @@ var Spinner = ({ className, color, size = "big", ref, style, ...otherProps }) =>
|
|
|
14
14
|
"data-dimension": size,
|
|
15
15
|
viewBox: "0 0 16 16",
|
|
16
16
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
color,
|
|
18
|
+
style,
|
|
19
19
|
children: /* @__PURE__ */ jsxs("g", {
|
|
20
20
|
className: spinner_module_default.Glyph,
|
|
21
21
|
fill: "currentColor",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var spinner_module_default = {
|
|
2
|
-
Spinner: "
|
|
3
|
-
Glyph: "
|
|
4
|
-
"spinner-bars": "
|
|
2
|
+
Spinner: "viraui__spinner-module__Spinner_qCQzj",
|
|
3
|
+
Glyph: "viraui__spinner-module__Glyph_OV-cy",
|
|
4
|
+
"spinner-bars": "viraui__spinner-module__spinner-bars_jDmaB"
|
|
5
5
|
};
|
|
6
6
|
//#endregion
|
|
7
7
|
export { spinner_module_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.viraui__stack-module__Stack_NR-Ey{--stack-row-gap:0;--stack-column-gap:0;--stack-h-align:initial;--stack-v-align:initial;--stack-padding-inline-start:0;--stack-padding-inline-end:0;--stack-padding-block-start:0;--stack-padding-block-end:0;display:flex;gap:var(--stack-row-gap) var(--stack-column-gap);flex-direction:column;align-items:var(--stack-h-align);justify-content:var(--stack-v-align);max-inline-size:var(--stack-max-width,none);min-inline-size:var(--stack-min-width,none);&[data-stack-direction=column-reverse]{flex-direction:column-reverse}&[data-stack-direction=row-reverse],&[data-stack-direction=row]{align-items:var(--stack-v-align);justify-content:var(--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(--stack-padding-block-start) var(--stack-padding-inline-end) var(--stack-padding-block-end) var(--stack-padding-inline-start)}:where(&[data-stack-fill-children=true]>*){flex-grow:var(--vira-flex-grow,1)}}
|
|
@@ -53,13 +53,13 @@ export type StackProps = React.ComponentPropsWithoutRef<'div'> & IntrinsicViraPr
|
|
|
53
53
|
/**
|
|
54
54
|
* Sets the gap between flex rows using the Vira space token scale.
|
|
55
55
|
*
|
|
56
|
-
* @default
|
|
56
|
+
* @default No row gap.
|
|
57
57
|
*/
|
|
58
58
|
rowGap?: StackSpace;
|
|
59
59
|
/**
|
|
60
60
|
* Sets the gap between flex columns using the Vira space token scale.
|
|
61
61
|
*
|
|
62
|
-
* @default
|
|
62
|
+
* @default No column gap.
|
|
63
63
|
*/
|
|
64
64
|
columnGap?: StackSpace;
|
|
65
65
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.viraui__static-noise-module__StaticNoise_ZhNxO{pointer-events:none;margin:0}.viraui__static-noise-module__FilterSvg_0CP2y{display:block}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import './static-noise.css';
|
|
2
3
|
import { clsx } from "../../core/clsx.js";
|
|
3
4
|
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
@@ -6,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
6
7
|
import { useId } from "react";
|
|
7
8
|
//#region src/components/static-noise/static-noise.tsx
|
|
8
9
|
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";
|
|
9
|
-
var StaticNoise = ({ animate = false, baseFrequency = .5, className, mixBlendMode = "
|
|
10
|
+
var StaticNoise = ({ animate = false, baseFrequency = .5, className, mixBlendMode = "difference", opacity = .2, ref, style, ...otherProps }) => {
|
|
10
11
|
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
11
12
|
const reactId = useId();
|
|
12
13
|
const dynamicStyle = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var static_noise_module_default = {
|
|
2
|
-
StaticNoise: "
|
|
3
|
-
FilterSvg: "
|
|
2
|
+
StaticNoise: "viraui__static-noise-module__StaticNoise_ZhNxO",
|
|
3
|
+
FilterSvg: "viraui__static-noise-module__FilterSvg_0CP2y"
|
|
4
4
|
};
|
|
5
5
|
//#endregion
|
|
6
6
|
export { static_noise_module_default as default };
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
export type SurfaceRadius = ThemeTypes['radius'] | 'auto';
|
|
4
|
+
export type SurfaceRadiusCornerInput = ThemeTypes['radius'] | 0;
|
|
5
|
+
export type SurfaceRadiusCornersInput = [
|
|
6
|
+
SurfaceRadiusCornerInput,
|
|
7
|
+
SurfaceRadiusCornerInput,
|
|
8
|
+
SurfaceRadiusCornerInput,
|
|
9
|
+
SurfaceRadiusCornerInput
|
|
10
|
+
];
|
|
11
|
+
export type SurfaceRadiusInput = SurfaceRadius | SurfaceRadiusCornersInput;
|
|
4
12
|
export type SurfacePadding = ThemeTypes['space'] | [ThemeTypes['space'] | 0, ThemeTypes['space'] | 0];
|
|
5
13
|
export type SurfaceRadiusCorners = {
|
|
6
14
|
topLeft: string;
|
|
@@ -20,7 +28,7 @@ export type SurfaceRadiusContextValue = {
|
|
|
20
28
|
};
|
|
21
29
|
export type SurfaceRadiusDefaults = {
|
|
22
30
|
hPadding?: SurfacePadding | undefined;
|
|
23
|
-
radius?:
|
|
31
|
+
radius?: SurfaceRadiusInput | undefined;
|
|
24
32
|
style?: React.CSSProperties | undefined;
|
|
25
33
|
vPadding?: SurfacePadding | undefined;
|
|
26
34
|
};
|
|
@@ -23,6 +23,14 @@ var resolveTokenRadiusCorners = (radius) => ({
|
|
|
23
23
|
bottomRight: radius,
|
|
24
24
|
bottomLeft: radius
|
|
25
25
|
});
|
|
26
|
+
var isPerCornerRadius = (value) => Array.isArray(value);
|
|
27
|
+
var resolveRadiusToken = (value) => toCssLength(resolveThemeValue(value, "radius", 0));
|
|
28
|
+
var resolvePerCornerRadiusInput = (corners) => ({
|
|
29
|
+
topLeft: resolveRadiusToken(corners[0]),
|
|
30
|
+
topRight: resolveRadiusToken(corners[1]),
|
|
31
|
+
bottomRight: resolveRadiusToken(corners[2]),
|
|
32
|
+
bottomLeft: resolveRadiusToken(corners[3])
|
|
33
|
+
});
|
|
26
34
|
var getSurfaceStyleRadius = (style) => style?.["--surface-border-radius"];
|
|
27
35
|
var getSurfaceRadiusStyle = (radius) => ({
|
|
28
36
|
"--surface-border-radius-top-left": radius.topLeft,
|
|
@@ -31,11 +39,11 @@ var getSurfaceRadiusStyle = (radius) => ({
|
|
|
31
39
|
"--surface-border-radius-bottom-left": radius.bottomLeft
|
|
32
40
|
});
|
|
33
41
|
var resolveDefaultContext = ({ hPadding, radius, style, vPadding }) => {
|
|
34
|
-
const resolvedRadius = toCssLength(resolveThemeValue(radius, "radius", 0));
|
|
35
42
|
const [paddingInlineStart, paddingInlineEnd] = resolveAxisPaddingValues(hPadding);
|
|
36
43
|
const [paddingBlockStart, paddingBlockEnd] = resolveAxisPaddingValues(vPadding);
|
|
44
|
+
const styleRadius = getSurfaceStyleRadius(style);
|
|
37
45
|
return {
|
|
38
|
-
radius: resolveTokenRadiusCorners(toCssLength(
|
|
46
|
+
radius: isPerCornerRadius(radius) ? resolvePerCornerRadiusInput(radius) : resolveTokenRadiusCorners(toCssLength(styleRadius ?? resolveRadiusToken(radius === "auto" ? void 0 : radius))),
|
|
39
47
|
padding: {
|
|
40
48
|
inlineStart: paddingInlineStart,
|
|
41
49
|
inlineEnd: paddingInlineEnd,
|
|
@@ -47,9 +55,12 @@ var resolveDefaultContext = ({ hPadding, radius, style, vPadding }) => {
|
|
|
47
55
|
var useSurfaceRadius = ({ defaults, hPadding, radius, style, vPadding }) => {
|
|
48
56
|
const parentContext = useSurfaceRadiusContext() ?? resolveDefaultContext(defaults);
|
|
49
57
|
const hasAutoRadius = radius === "auto";
|
|
50
|
-
const
|
|
51
|
-
const tokenRadius = toCssLength(getSurfaceStyleRadius(style) ??
|
|
52
|
-
|
|
58
|
+
const hasPerCornerRadius = isPerCornerRadius(radius);
|
|
59
|
+
const tokenRadius = toCssLength(getSurfaceStyleRadius(style) ?? (hasAutoRadius || hasPerCornerRadius ? void 0 : resolveRadiusToken(radius)));
|
|
60
|
+
let ownRadius;
|
|
61
|
+
if (hasAutoRadius) ownRadius = resolveAutoRadiusCorners(parentContext);
|
|
62
|
+
else if (hasPerCornerRadius) ownRadius = resolvePerCornerRadiusInput(radius);
|
|
63
|
+
else ownRadius = resolveTokenRadiusCorners(tokenRadius);
|
|
53
64
|
const [paddingInlineStart, paddingInlineEnd] = resolveAxisPaddingValues(hPadding);
|
|
54
65
|
const [paddingBlockStart, paddingBlockEnd] = resolveAxisPaddingValues(vPadding);
|
|
55
66
|
return {
|
|
@@ -63,7 +74,7 @@ var useSurfaceRadius = ({ defaults, hPadding, radius, style, vPadding }) => {
|
|
|
63
74
|
}
|
|
64
75
|
},
|
|
65
76
|
hasAutoRadius,
|
|
66
|
-
radiusStyle: hasAutoRadius ? getSurfaceRadiusStyle(ownRadius) : { "--surface-border-radius": tokenRadius }
|
|
77
|
+
radiusStyle: hasAutoRadius || hasPerCornerRadius ? getSurfaceRadiusStyle(ownRadius) : { "--surface-border-radius": tokenRadius }
|
|
67
78
|
};
|
|
68
79
|
};
|
|
69
80
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.viraui__surface-module__Surface_slEYq{--surface-border-radius:0;--surface-border-radius-top-left:var(--surface-border-radius);--surface-border-radius-top-right:var(--surface-border-radius);--surface-border-radius-bottom-right:var(--surface-border-radius);--surface-border-radius-bottom-left:var(--surface-border-radius);--surface-padding-inline-start:0;--surface-padding-inline-end:0;--surface-padding-block-start:0;--surface-padding-block-end:0;--surface-background-hover:var(--surface-background);--surface-overflow:visible;--surface-vibrancy-background:var(--is-vibrancy-active) oklab(from var(--surface-background) l a b/80%);position:relative;overflow:var(--surface-overflow);box-sizing:border-box;background:var(--surface-vibrancy-background,var(--surface-background,transparent));border-radius:var(--surface-border-radius-top-left) var(--surface-border-radius-top-right) var(--surface-border-radius-bottom-right) var(--surface-border-radius-bottom-left);border:0;&[data-surface-radius=auto]{--surface-border-radius-top-left:0;--surface-border-radius-top-right:0;--surface-border-radius-bottom-right:0;--surface-border-radius-bottom-left:0}&[data-surface-has-padding=true]{padding:var(--surface-padding-block-start) var(--surface-padding-inline-end) var(--surface-padding-block-end) var(--surface-padding-inline-start)}&[data-surface-border]{border-style:var(--surface-border-style,solid);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(--surface-background-hover)}}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
2
|
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
|
-
import { SurfacePadding,
|
|
3
|
+
import { SurfacePadding, SurfaceRadiusInput } from './surface-radius-context';
|
|
4
4
|
import type * as React from 'react';
|
|
5
5
|
/** Base ramp layer for nested surfaces; clamped to 1–3 at runtime. */
|
|
6
6
|
type SurfaceBaseLevel = 1 | 2 | 3;
|
|
@@ -51,11 +51,11 @@ export type SurfaceProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'color'>
|
|
|
51
51
|
*/
|
|
52
52
|
borderStyle?: 'solid' | 'dashed' | 'dotted' | 'double';
|
|
53
53
|
/**
|
|
54
|
-
* Sets
|
|
54
|
+
* Sets corner radius from the Vira radius token scale, a per-corner `[top-left, top-right, bottom-right, bottom-left]` tuple (`0` for square corners), or `auto` for concentric radii from the nearest ancestor Surface.
|
|
55
55
|
*
|
|
56
56
|
* @default No radius.
|
|
57
57
|
*/
|
|
58
|
-
radius?:
|
|
58
|
+
radius?: SurfaceRadiusInput;
|
|
59
59
|
/**
|
|
60
60
|
* Sets inline padding using one token for both sides or a `[start, end]` tuple.
|
|
61
61
|
*
|
|
@@ -68,6 +68,12 @@ export type SurfaceProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'color'>
|
|
|
68
68
|
* @default No block padding.
|
|
69
69
|
*/
|
|
70
70
|
vPadding?: SurfacePadding;
|
|
71
|
+
/**
|
|
72
|
+
* Sets root overflow through the `--surface-overflow` custom property.
|
|
73
|
+
*
|
|
74
|
+
* @default visible
|
|
75
|
+
*/
|
|
76
|
+
overflow?: React.CSSProperties['overflow'];
|
|
71
77
|
};
|
|
72
78
|
export declare const Surface: React.FC<SurfaceProps>;
|
|
73
79
|
export {};
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
"Popup or card chrome with optional hover background",
|
|
7
7
|
"Compose with Elevator for animated elevation transitions",
|
|
8
8
|
"Set radius to a token on the outermost Surface that needs rounded corners",
|
|
9
|
+
"Set radius to a four-value tuple [top-left, top-right, bottom-right, bottom-left] when corners need different token radii",
|
|
9
10
|
"Set radius=\"auto\" on a nested Surface when its parent Surface has a radius so each corner subtracts the nearest ancestor padding and stays concentric",
|
|
10
|
-
"Stack nested auto-radius Surfaces recursively; context still resolves through wrapper layout such as Stack"
|
|
11
|
+
"Stack nested auto-radius Surfaces recursively; context still resolves through wrapper layout such as Stack",
|
|
12
|
+
"Set overflow=\"hidden\" (or scroll/auto) when Surface must clip or scroll inner content with radius or padding"
|
|
11
13
|
],
|
|
12
14
|
"whenNotToUse": [
|
|
13
15
|
"Interactive control semantics without an appropriate render root",
|
|
@@ -20,8 +20,7 @@ var surfaceDefaultRadiusProps = {
|
|
|
20
20
|
style: void 0,
|
|
21
21
|
vPadding: void 0
|
|
22
22
|
};
|
|
23
|
-
var Surface = ({ border, borderStyle = "solid", className, color, hPadding, hoverColor, radius, ref, render, style, vPadding, ...otherProps }) => {
|
|
24
|
-
const hasColor = color !== void 0;
|
|
23
|
+
var Surface = ({ border, borderStyle = "solid", className, color, hPadding, hoverColor, overflow, radius, ref, render, style, vPadding, ...otherProps }) => {
|
|
25
24
|
const hasPadding = Boolean(hPadding || vPadding);
|
|
26
25
|
const hasHoverColor = hoverColor !== void 0;
|
|
27
26
|
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
@@ -33,9 +32,10 @@ var Surface = ({ border, borderStyle = "solid", className, color, hPadding, hove
|
|
|
33
32
|
vPadding
|
|
34
33
|
});
|
|
35
34
|
const dynamicStyle = {
|
|
36
|
-
|
|
35
|
+
"--surface-background": toSurfaceColor(color ?? "none"),
|
|
37
36
|
...hasHoverColor ? { "--surface-background-hover": toSurfaceColor(hoverColor) } : {},
|
|
38
37
|
...border ? { "--surface-border-style": borderStyle } : {},
|
|
38
|
+
"--surface-overflow": overflow,
|
|
39
39
|
...radiusStyle,
|
|
40
40
|
...resolveAxisPadding(hPadding, "--surface-padding-inline-start", "--surface-padding-inline-end"),
|
|
41
41
|
...resolveAxisPadding(vPadding, "--surface-padding-block-start", "--surface-padding-block-end"),
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var surface_module_default = {
|
|
2
|
-
Surface: "surface-module_Surface_slEYq",
|
|
3
|
-
"surface-background-hover": "surface-module_surface-background-hover_HwH9-"
|
|
4
|
-
};
|
|
1
|
+
var surface_module_default = { Surface: "viraui__surface-module__Surface_slEYq" };
|
|
5
2
|
//#endregion
|
|
6
3
|
export { surface_module_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.viraui__switch-module__Switch_L86y7{--switch-track-block-size:var(--space-large);--switch-track-radius:var(--radius-small);--switch-track-background:var(--global-contrast);--switch-thumb-background:var(--base-7);--switch-thumb-size:calc(var(--space-large) - var(--space-x-small));--switch-thumb-inset:var(--space-2x-small);&:has([required]) .viraui__switch-module__Label_9R-rv:after{content:" *";color:var(--highlight-red)}}.viraui__switch-module__SwitchRoot_Zv9An{position:relative;appearance:none;border:0;box-shadow:none;inline-size:calc((var(--switch-thumb-size) * 2) + var(--switch-thumb-inset) * 2);block-size:var(--switch-track-block-size);background:var(--switch-track-background);border-radius:var(--switch-track-radius);&[data-size=small]{--switch-track-radius:var(--radius-x-small);--switch-track-block-size:var(--space-medium);--switch-thumb-size:calc(var(--space-medium) - var(--space-x-small))}&[data-checked]:not([data-disabled]):not([data-invalid]){--switch-track-background:var(--global-primary);--switch-thumb-background:contrast-color(var(--global-primary))}&[data-invalid]:not([data-disabled]),.viraui__switch-module__Switch_L86y7[data-invalid]>&:not([data-disabled]){box-shadow:inset 0 0 0 1px var(--highlight-red);outline-color:oklab(from var(--highlight-red) l a b/.5)}&[data-disabled],.viraui__switch-module__Switch_L86y7[data-disabled]>&{--switch-track-background:var(--global-disabled-background);--switch-thumb-background:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}}.viraui__switch-module__Thumb_ldwJw{--switch-thumb-radius:calc(var(--switch-track-radius) - var(--switch-thumb-inset));position:absolute;inset-block:var(--switch-thumb-inset);inset-inline-start:var(--switch-thumb-inset);background:var(--switch-thumb-background);inline-size:var(--switch-thumb-size);block-size:var(--switch-thumb-size);border-radius:var(--switch-thumb-radius);transition:translate var(--easing-entrance) var(--duration-fast);.viraui__switch-module__SwitchRoot_Zv9An[data-checked]>&{translate:100% 0}.viraui__switch-module__SwitchRoot_Zv9An[data-checked]:dir(rtl)>&{translate:-100% 0}}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import './switch.css';
|
|
3
2
|
import { clsx } from "../../core/clsx.js";
|
|
4
3
|
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
@@ -30,35 +29,38 @@ var Switch$1 = ({ className, description, dirty, disabled, error, invalid, label
|
|
|
30
29
|
fillChildren: false,
|
|
31
30
|
vAlign: hasTextDescription ? "start" : "center"
|
|
32
31
|
}),
|
|
33
|
-
children: /* @__PURE__ */ jsx(Field.Label, {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...hPadding !== void 0 ? { hPadding } : {},
|
|
39
|
-
...vPadding !== void 0 ? { vPadding } : {},
|
|
40
|
-
children: [/* @__PURE__ */ jsx(Switch.Root, {
|
|
41
|
-
...componentProps,
|
|
42
|
-
className: clsx(switch_module_default.SwitchRoot, className),
|
|
43
|
-
"data-shrink": "false",
|
|
44
|
-
"data-size": size,
|
|
45
|
-
disabled,
|
|
46
|
-
name,
|
|
47
|
-
ref,
|
|
48
|
-
children: /* @__PURE__ */ jsx(Switch.Thumb, { className: switch_module_default.Thumb })
|
|
49
|
-
}), label || description || error ? /* @__PURE__ */ jsxs(Stack, {
|
|
50
|
-
direction: "column",
|
|
32
|
+
children: /* @__PURE__ */ jsx(Field.Label, {
|
|
33
|
+
className: switch_module_default.Label,
|
|
34
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
35
|
+
direction: "row",
|
|
36
|
+
columnGap: size === "small" ? "small" : "medium",
|
|
51
37
|
fillChildren: false,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
38
|
+
vAlign: hasTextDescription ? "start" : "center",
|
|
39
|
+
hPadding,
|
|
40
|
+
vPadding,
|
|
41
|
+
children: [/* @__PURE__ */ jsx(Switch.Root, {
|
|
42
|
+
...componentProps,
|
|
43
|
+
className: clsx(switch_module_default.SwitchRoot, className),
|
|
44
|
+
"data-shrink": "false",
|
|
45
|
+
"data-size": size,
|
|
46
|
+
disabled,
|
|
47
|
+
name,
|
|
48
|
+
ref,
|
|
49
|
+
children: /* @__PURE__ */ jsx(Switch.Thumb, { className: switch_module_default.Thumb })
|
|
50
|
+
}), label || description || error ? /* @__PURE__ */ jsxs(Stack, {
|
|
51
|
+
direction: "column",
|
|
52
|
+
fillChildren: false,
|
|
53
|
+
rowGap: "small",
|
|
54
|
+
children: [label && /* @__PURE__ */ jsx(FieldLabel, {
|
|
55
|
+
size: size === "small" ? "small" : "medium",
|
|
56
|
+
children: label
|
|
57
|
+
}), /* @__PURE__ */ jsx(FieldHelperCopy, {
|
|
58
|
+
description,
|
|
59
|
+
error
|
|
60
|
+
})]
|
|
61
|
+
}) : null]
|
|
62
|
+
})
|
|
63
|
+
})
|
|
62
64
|
});
|
|
63
65
|
};
|
|
64
66
|
//#endregion
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
var switch_module_default = {
|
|
2
|
-
Switch: "
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
Switch: "viraui__switch-module__Switch_L86y7",
|
|
3
|
+
Label: "viraui__switch-module__Label_9R-rv",
|
|
4
|
+
SwitchRoot: "viraui__switch-module__SwitchRoot_Zv9An",
|
|
5
|
+
Thumb: "viraui__switch-module__Thumb_ldwJw"
|
|
5
6
|
};
|
|
6
7
|
//#endregion
|
|
7
8
|
export { switch_module_default as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Tabs } from './tabs';
|
|
2
|
+
export type { TabsProps } from './tabs';
|
|
3
|
+
export type { TabsTabProps } from './tabs-tab';
|
|
4
|
+
export type { TabsListProps } from './tabs-list';
|
|
5
|
+
export type { TabsPanelProps } from './tabs-panel';
|
|
6
|
+
export type { TabsViewportProps } from './tabs-viewport';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TabsIndicator as TabsIndicatorPrimitive } from '@base-ui/react/tabs';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Internal active tab indicator for `Tabs.List`.
|
|
5
|
+
*
|
|
6
|
+
* Positioned with Base UI `--active-tab-*` CSS variables.
|
|
7
|
+
*/
|
|
8
|
+
export type TabsIndicatorProps = TabsIndicatorPrimitive.Props;
|
|
9
|
+
export declare const TabsIndicator: React.FC<TabsIndicatorProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Surface } from "../surface/surface.js";
|
|
2
|
+
import tabs_module_default from "./tabs.module.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Tabs } from "@base-ui/react/tabs";
|
|
5
|
+
//#region src/components/tabs/tabs-indicator.tsx
|
|
6
|
+
var TabsIndicator = ({ className, ref, ...props }) => /* @__PURE__ */ jsx(Tabs.Indicator, {
|
|
7
|
+
render: /* @__PURE__ */ jsx(Surface, {
|
|
8
|
+
border: "all",
|
|
9
|
+
radius: "auto",
|
|
10
|
+
color: 3
|
|
11
|
+
}),
|
|
12
|
+
className: tabs_module_default.Indicator,
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { TabsIndicator };
|