@viraui/react 0.0.24 → 0.0.26
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 +44 -2
- package/dist/components/accordion/accordion-item.d.ts +58 -0
- package/dist/components/accordion/accordion-item.js +65 -0
- package/dist/components/accordion/accordion.css +1 -0
- package/dist/components/accordion/accordion.d.ts +26 -0
- package/dist/components/accordion/accordion.guide.json +30 -0
- package/dist/components/accordion/accordion.js +22 -0
- package/dist/components/accordion/accordion.module.js +10 -0
- package/dist/components/accordion/index.d.ts +3 -0
- package/dist/components/avatar/avatar.css +1 -1
- package/dist/components/avatar/avatar.guide.json +25 -1
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/avatar-group/avatar-group.css +7 -1
- package/dist/components/avatar-group/avatar-group.d.ts +0 -7
- package/dist/components/avatar-group/avatar-group.guide.json +27 -1
- package/dist/components/avatar-group/avatar-group.js +3 -10
- package/dist/components/basic-input/basic-input.css +1 -1
- package/dist/components/basic-input/basic-input.js +3 -3
- package/dist/components/basic-input/field-label.css +1 -1
- package/dist/components/bleed/bleed.css +1 -0
- package/dist/components/bleed/bleed.d.ts +26 -0
- package/dist/components/bleed/bleed.guide.json +39 -0
- package/dist/components/bleed/bleed.js +24 -0
- package/dist/components/bleed/bleed.module.js +3 -0
- package/dist/components/bleed/index.d.ts +2 -0
- package/dist/components/button/button.css +1 -1
- package/dist/components/button/button.guide.json +33 -3
- package/dist/components/button/button.js +1 -1
- package/dist/components/checkbox/checkbox-group.js +2 -2
- package/dist/components/checkbox/checkbox.css +1 -1
- package/dist/components/chip/chip.css +1 -1
- package/dist/components/chip/chip.guide.json +26 -1
- package/dist/components/clamp-text/clamp-text.css +1 -1
- package/dist/components/clamp-text/clamp-text.guide.json +15 -1
- package/dist/components/clamp-text/clamp-text.js +1 -1
- package/dist/components/dialog/dialog-close.js +2 -2
- package/dist/components/dialog/dialog-indent-background.js +2 -2
- package/dist/components/dialog/dialog-indent.js +2 -2
- package/dist/components/dialog/dialog-sheet.js +1 -1
- package/dist/components/dialog/dialog-trigger.js +2 -2
- package/dist/components/dialog/dialog.css +1 -1
- package/dist/components/dialog/dialog.d.ts +5 -4
- package/dist/components/dialog/dialog.guide.json +15 -1
- package/dist/components/dialog/dialog.js +4 -3
- package/dist/components/fieldset/fieldset.js +1 -2
- package/dist/components/icon-button/icon-button.js +2 -2
- package/dist/components/index.d.ts +7 -0
- package/dist/components/linear-progress/linear-progress.css +1 -1
- package/dist/components/linear-progress/linear-progress.guide.json +14 -1
- package/dist/components/masonry/masonry.css +1 -1
- package/dist/components/masonry/masonry.guide.json +42 -1
- package/dist/components/masonry/masonry.js +3 -3
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/meter.css +1 -0
- package/dist/components/meter/meter.d.ts +44 -0
- package/dist/components/meter/meter.guide.json +39 -0
- package/dist/components/meter/meter.js +59 -0
- package/dist/components/meter/meter.module.js +7 -0
- package/dist/components/popover/index.d.ts +4 -0
- package/dist/components/popover/popover-sheet.d.ts +65 -0
- package/dist/components/popover/popover-sheet.js +79 -0
- package/dist/components/popover/popover.css +1 -0
- package/dist/components/popover/popover.d.ts +74 -0
- package/dist/components/popover/popover.guide.json +28 -0
- package/dist/components/popover/popover.js +23 -0
- package/dist/components/popover/popover.module.js +8 -0
- package/dist/components/progressive-blur/progressive-blur.css +1 -1
- package/dist/components/progressive-blur/progressive-blur.guide.json +15 -1
- package/dist/components/progressive-blur/progressive-blur.js +1 -1
- package/dist/components/radio/radio-group.d.ts +1 -1
- package/dist/components/radio/radio-group.js +2 -2
- package/dist/components/radio/radio.css +1 -1
- package/dist/components/select/select-option.js +1 -1
- package/dist/components/select/select.css +1 -1
- package/dist/components/select/select.guide.json +26 -1
- package/dist/components/select/select.js +1 -0
- package/dist/components/separator/separator.css +1 -1
- package/dist/components/separator/separator.js +1 -1
- package/dist/components/shimmer/index.d.ts +2 -0
- package/dist/components/shimmer/shimmer.css +1 -0
- package/dist/components/shimmer/shimmer.d.ts +43 -0
- package/dist/components/shimmer/shimmer.guide.json +63 -0
- package/dist/components/shimmer/shimmer.js +25 -0
- package/dist/components/shimmer/shimmer.module.js +6 -0
- package/dist/components/skeleton/skeleton.css +1 -1
- package/dist/components/skeleton/skeleton.guide.json +50 -1
- package/dist/components/skeleton/skeleton.js +5 -5
- package/dist/components/slider/slider.css +1 -1
- package/dist/components/slider/slider.guide.json +20 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/spinner/spinner.css +1 -1
- package/dist/components/spinner/spinner.guide.json +15 -1
- package/dist/components/stack/stack.css +1 -1
- package/dist/components/stack/stack.d.ts +1 -1
- package/dist/components/stack/stack.guide.json +84 -4
- package/dist/components/stack/stack.js +8 -8
- package/dist/components/surface/surface-radius-context.js +6 -6
- package/dist/components/surface/surface.css +1 -1
- package/dist/components/surface/surface.d.ts +1 -1
- package/dist/components/surface/surface.guide.json +90 -4
- package/dist/components/surface/surface.js +8 -8
- package/dist/components/switch/switch.css +1 -1
- package/dist/components/switch/switch.guide.json +32 -1
- package/dist/components/tabs/tabs-indicator.js +2 -2
- package/dist/components/tabs/tabs-list.js +2 -2
- package/dist/components/tabs/tabs-panel.js +2 -2
- package/dist/components/tabs/tabs-tab.js +2 -2
- package/dist/components/tabs/tabs-viewport.js +2 -2
- package/dist/components/tabs/tabs.css +1 -1
- package/dist/components/tabs/tabs.guide.json +8 -1
- package/dist/components/tabs/tabs.js +2 -2
- package/dist/components/text/text.css +1 -1
- package/dist/components/text/text.guide.json +125 -1
- package/dist/components/text/text.js +11 -11
- package/dist/components/textarea/textarea.css +1 -1
- package/dist/components/textarea/textarea.guide.json +14 -1
- package/dist/components/textfield/textfield.css +1 -1
- package/dist/components/textfield/textfield.guide.json +20 -1
- package/dist/components/title/title.css +1 -1
- package/dist/components/title/title.guide.json +123 -1
- package/dist/components/title/title.js +11 -11
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/toast-action.d.ts +9 -0
- package/dist/components/toast/toast-action.js +10 -0
- package/dist/components/toast/toast-banner.d.ts +59 -0
- package/dist/components/toast/toast-banner.js +66 -0
- package/dist/components/toast/toast-viewport.d.ts +17 -0
- package/dist/components/toast/toast-viewport.js +12 -0
- package/dist/components/toast/toast.css +1 -0
- package/dist/components/toast/toast.d.ts +18 -0
- package/dist/components/toast/toast.guide.json +26 -0
- package/dist/components/toast/toast.js +22 -0
- package/dist/components/toast/toast.module.js +7 -0
- package/dist/core/props/intrinsic-vira-props.js +3 -3
- package/dist/index.js +8 -1
- package/dist/preflight-surface.json +17 -4
- package/dist/preflight.css +1 -1
- package/package.json +13 -5
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Shimmer",
|
|
3
|
+
"summary": "Decorative inline text shimmer that inherits typography and color from a parent text primitive.",
|
|
4
|
+
"whenToUse": [
|
|
5
|
+
"Loading placeholder copy inside Text or Title",
|
|
6
|
+
"Animated text shimmer while awaiting async content",
|
|
7
|
+
"Muted loading labels that keep the final text dimensions"
|
|
8
|
+
],
|
|
9
|
+
"whenNotToUse": [
|
|
10
|
+
"Block or fixed-dimension placeholders without text content",
|
|
11
|
+
"Standalone accessible loading status without a surrounding aria-busy region",
|
|
12
|
+
"Replacing Skeleton for non-text layout placeholders"
|
|
13
|
+
],
|
|
14
|
+
"accessibility": [
|
|
15
|
+
"Shimmer renders real text content — do not mark it aria-hidden",
|
|
16
|
+
"Announce loading on the surrounding region with aria-busy or live text",
|
|
17
|
+
"Reduced motion disables the sweep and restores normal text rendering"
|
|
18
|
+
],
|
|
19
|
+
"antiPatterns": [
|
|
20
|
+
"Putting aria-busy on Shimmer instead of the surrounding loading region",
|
|
21
|
+
"Using Shimmer without children text content",
|
|
22
|
+
"Using Shimmer for block placeholders better served by Skeleton"
|
|
23
|
+
],
|
|
24
|
+
"related": ["Text", "Title", "Skeleton"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"react": {
|
|
27
|
+
"duration": {
|
|
28
|
+
"description": "Sets the shimmer sweep duration using any valid CSS time string.",
|
|
29
|
+
"refCss": "duration"
|
|
30
|
+
},
|
|
31
|
+
"spread": {
|
|
32
|
+
"description": "Sets the shimmer highlight spread using any valid CSS length string.",
|
|
33
|
+
"refCss": "spread"
|
|
34
|
+
},
|
|
35
|
+
"angle": {
|
|
36
|
+
"description": "Sets the shimmer gradient angle offset using any valid CSS angle string.",
|
|
37
|
+
"refCss": "angle"
|
|
38
|
+
},
|
|
39
|
+
"highlightColor": {
|
|
40
|
+
"description": "Overrides the shimmer highlight color.",
|
|
41
|
+
"refCss": "highlight"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"css": {
|
|
45
|
+
"duration": {
|
|
46
|
+
"description": "Shimmer animation duration.",
|
|
47
|
+
"refReact": "duration"
|
|
48
|
+
},
|
|
49
|
+
"spread": {
|
|
50
|
+
"description": "Shimmer highlight spread width.",
|
|
51
|
+
"refReact": "spread"
|
|
52
|
+
},
|
|
53
|
+
"angle": {
|
|
54
|
+
"description": "Shimmer gradient angle offset.",
|
|
55
|
+
"refReact": "angle"
|
|
56
|
+
},
|
|
57
|
+
"highlight": {
|
|
58
|
+
"description": "Shimmer highlight color.",
|
|
59
|
+
"refReact": "highlightColor"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import './shimmer.css';
|
|
2
|
+
import { clsx } from "../../core/clsx.js";
|
|
3
|
+
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
|
+
import shimmer_module_default from "./shimmer.module.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/shimmer/shimmer.tsx
|
|
7
|
+
var Shimmer = ({ angle, className, duration, highlightColor, ref, spread, style, ...otherProps }) => {
|
|
8
|
+
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
9
|
+
const dynamicStyle = {
|
|
10
|
+
...duration && { "--vui-shimmer-duration": duration },
|
|
11
|
+
...spread && { "--vui-shimmer-spread": spread },
|
|
12
|
+
...angle && { "--vui-shimmer-angle": angle },
|
|
13
|
+
...highlightColor && { "--vui-shimmer-highlight": highlightColor },
|
|
14
|
+
...style
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ jsx("span", {
|
|
17
|
+
...componentProps,
|
|
18
|
+
...intrinsicAttributes,
|
|
19
|
+
ref,
|
|
20
|
+
className: clsx(shimmer_module_default.Shimmer, className),
|
|
21
|
+
style: dynamicStyle
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Shimmer };
|
|
@@ -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
|
+
.viraui__skeleton-module__Skeleton_pn7Xk{--vui-skeleton-background:var(--global-contrast);--vui-skeleton-border-radius:var(--radius-small);--vui-skeleton-inline-size:auto;--vui-skeleton-block-size:auto;--vui-skeleton-min-inline-size:var(--space-x-large);--vui-skeleton-min-block-size:var(--space-medium);display:inline-block;box-sizing:border-box;inline-size:var(--vui-skeleton-inline-size);block-size:var(--vui-skeleton-block-size);min-inline-size:var(--vui-skeleton-min-inline-size);min-block-size:var(--vui-skeleton-min-block-size);max-inline-size:100%;background:var(--vui-skeleton-background);border-radius:var(--vui-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}}
|
|
@@ -19,5 +19,54 @@
|
|
|
19
19
|
"Using children to derive skeleton dimensions",
|
|
20
20
|
"Putting aria-busy on Skeleton instead of the surrounding loading region"
|
|
21
21
|
],
|
|
22
|
-
"related": ["Avatar"]
|
|
22
|
+
"related": ["Avatar"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"react": {
|
|
25
|
+
"radius": {
|
|
26
|
+
"description": "Sets the corner radius from the Vira radius token scale.",
|
|
27
|
+
"refCss": "border-radius"
|
|
28
|
+
},
|
|
29
|
+
"width": {
|
|
30
|
+
"description": "Sets the skeleton inline size.",
|
|
31
|
+
"refCss": "inline-size"
|
|
32
|
+
},
|
|
33
|
+
"height": {
|
|
34
|
+
"description": "Sets the skeleton block size.",
|
|
35
|
+
"refCss": "block-size"
|
|
36
|
+
},
|
|
37
|
+
"minWidth": {
|
|
38
|
+
"description": "Sets the skeleton minimum inline size.",
|
|
39
|
+
"refCss": "min-inline-size"
|
|
40
|
+
},
|
|
41
|
+
"minHeight": {
|
|
42
|
+
"description": "Sets the skeleton minimum block size.",
|
|
43
|
+
"refCss": "min-block-size"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"css": {
|
|
47
|
+
"border-radius": {
|
|
48
|
+
"description": "Skeleton corner radius.",
|
|
49
|
+
"refReact": "radius"
|
|
50
|
+
},
|
|
51
|
+
"inline-size": {
|
|
52
|
+
"description": "Skeleton inline size.",
|
|
53
|
+
"refReact": "width"
|
|
54
|
+
},
|
|
55
|
+
"block-size": {
|
|
56
|
+
"description": "Skeleton block size.",
|
|
57
|
+
"refReact": "height"
|
|
58
|
+
},
|
|
59
|
+
"min-inline-size": {
|
|
60
|
+
"description": "Skeleton minimum inline size.",
|
|
61
|
+
"refReact": "minWidth"
|
|
62
|
+
},
|
|
63
|
+
"min-block-size": {
|
|
64
|
+
"description": "Skeleton minimum block size.",
|
|
65
|
+
"refReact": "minHeight"
|
|
66
|
+
},
|
|
67
|
+
"background": {
|
|
68
|
+
"description": "Skeleton placeholder background color."
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
23
72
|
}
|
|
@@ -8,11 +8,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
var Skeleton = ({ className, height, minHeight, minWidth, radius, ref, style, width, ...otherProps }) => {
|
|
9
9
|
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
10
10
|
const dynamicStyle = {
|
|
11
|
-
"--skeleton-border-radius": resolveThemeValue(radius, "radius", "var(--radius-small)"),
|
|
12
|
-
...width
|
|
13
|
-
...height
|
|
14
|
-
...minWidth
|
|
15
|
-
...minHeight
|
|
11
|
+
"--vui-skeleton-border-radius": resolveThemeValue(radius, "radius", "var(--radius-small)"),
|
|
12
|
+
...width && { "--vui-skeleton-inline-size": width },
|
|
13
|
+
...height && { "--vui-skeleton-block-size": height },
|
|
14
|
+
...minWidth && { "--vui-skeleton-min-inline-size": minWidth },
|
|
15
|
+
...minHeight && { "--vui-skeleton-min-block-size": minHeight },
|
|
16
16
|
...style
|
|
17
17
|
};
|
|
18
18
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -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:
|
|
1
|
+
.viraui__slider-module__Slider_vDNlm{--vui-slider-track-size:var(--space-x-small);--vui-slider-thumb-size:var(--space-medium);--vui-slider-track-background:var(--global-contrast);--vui-slider-progress-background:var(--global-primary);--vui-slider-thumb-background:var(--base-2);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]{--vui-slider-progress-background:var(--highlight-red)}&:has(.viraui__slider-module__SliderRoot_4JScw[data-disabled]),&[data-disabled]{--vui-slider-track-background:var(--global-disabled-background);--vui-slider-progress-background:var(--global-disabled-foreground);--vui-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;-webkit-user-select:none;user-select:none;touch-action:none;inline-size:100%;block-size:var(--vui-slider-track-size);min-inline-size:0;min-block-size:0;&[data-orientation=vertical]{inline-size:var(--vui-slider-track-size);block-size:100%;>.viraui__slider-module__Track_wvLEH{inline-size:var(--vui-slider-track-size);block-size:100%}}}.viraui__slider-module__Track_wvLEH{position:relative;overflow:visible;inline-size:100%;block-size:var(--vui-slider-track-size);background:var(--vui-slider-track-background);border-radius:var(--radius-infinite)}.viraui__slider-module__Indicator_y3JyJ{background:var(--vui-slider-progress-background);border-radius:inherit}.viraui__slider-module__Thumb_S-uLF{box-sizing:border-box;inline-size:var(--vui-slider-thumb-size);block-size:calc(var(--vui-slider-thumb-size) - 2px);background:var(--vui-slider-thumb-background);border:2px solid var(--vui-slider-progress-background);border-radius:var(--radius-x-small);appearance:none;transition:scale var(--duration-instant) var(--easing-standard);&: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}}
|
|
@@ -19,5 +19,24 @@
|
|
|
19
19
|
"Wrapping Slider.Control and Slider.Value in extra layout inside Slider.Root",
|
|
20
20
|
"Overriding Slider.Indicator position in CSS"
|
|
21
21
|
],
|
|
22
|
-
"related": ["Textfield", "Stack", "Text"]
|
|
22
|
+
"related": ["Textfield", "Stack", "Text"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"css": {
|
|
25
|
+
"track-size": {
|
|
26
|
+
"description": "Slider track thickness."
|
|
27
|
+
},
|
|
28
|
+
"thumb-size": {
|
|
29
|
+
"description": "Slider thumb size."
|
|
30
|
+
},
|
|
31
|
+
"track-background": {
|
|
32
|
+
"description": "Slider track background color."
|
|
33
|
+
},
|
|
34
|
+
"progress-background": {
|
|
35
|
+
"description": "Slider filled progress color."
|
|
36
|
+
},
|
|
37
|
+
"thumb-background": {
|
|
38
|
+
"description": "Slider thumb fill color."
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
23
42
|
}
|
|
@@ -44,7 +44,7 @@ var Slider$1 = ({ className, defaultValue, description, dirty, disabled, error,
|
|
|
44
44
|
render: /* @__PURE__ */ jsx(Stack, {
|
|
45
45
|
direction: "column",
|
|
46
46
|
fillChildren: false,
|
|
47
|
-
rowGap: "
|
|
47
|
+
rowGap: "medium",
|
|
48
48
|
columnGap: "x-small",
|
|
49
49
|
vAlign: isVertical ? "stretch" : "center",
|
|
50
50
|
hAlign: isVertical ? "center" : "initial"
|
|
@@ -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)}}
|
|
1
|
+
.viraui__spinner-module__Spinner_qCQzj{--vui-spinner-size:var(--space-x-large);display:inline-block;inline-size:var(--vui-spinner-size);block-size:var(--vui-spinner-size);flex:none;vertical-align:middle;color:currentColor;&[data-dimension=small]{--vui-spinner-size:var(--space-medium)}&[data-dimension=regular]{--vui-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)}}
|
|
@@ -19,5 +19,19 @@
|
|
|
19
19
|
"Using Spinner alone as the only loading announcement for a page",
|
|
20
20
|
"Embedding animation rules outside the component stylesheet"
|
|
21
21
|
],
|
|
22
|
-
"related": ["Button", "IconButton"]
|
|
22
|
+
"related": ["Button", "IconButton"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"react": {
|
|
25
|
+
"size": {
|
|
26
|
+
"description": "Sets the rendered spinner size.",
|
|
27
|
+
"refCss": "size"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"css": {
|
|
31
|
+
"size": {
|
|
32
|
+
"description": "Spinner glyph size on the root.",
|
|
33
|
+
"refReact": "size"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
23
37
|
}
|
|
@@ -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)}}
|
|
1
|
+
.viraui__stack-module__Stack_NR-Ey{--vui-stack-row-gap:0;--vui-stack-column-gap:0;--vui-stack-h-align:initial;--vui-stack-v-align:initial;--vui-stack-padding-inline-start:0;--vui-stack-padding-inline-end:0;--vui-stack-padding-block-start:0;--vui-stack-padding-block-end:0;container:stack/inline-size block-size;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,none);min-inline-size:var(--vui-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(--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,6 +1,6 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
-
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
3
2
|
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
|
+
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
4
4
|
import type * as React from 'react';
|
|
5
5
|
type StackAlignment = 'start' | 'center' | 'end' | 'stretch' | 'initial' | 'space-between' | 'space-around' | 'space-evenly';
|
|
6
6
|
type StackSpace = ThemeTypes['space'];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Stack",
|
|
3
|
-
"summary": "Flex layout primitive for arranging children with token spacing, alignment, and padding.",
|
|
3
|
+
"summary": "Flex layout primitive for arranging children with token spacing, alignment, and padding; root is a named CSS container query context (`stack`).",
|
|
4
4
|
"whenToUse": [
|
|
5
5
|
"Column or row layouts with token gap and alignment",
|
|
6
6
|
"Composing screens and component internals without custom flex CSS",
|
|
7
|
-
"Custom native root through render while keeping data-stack hooks"
|
|
7
|
+
"Custom native root through render while keeping data-stack hooks",
|
|
8
|
+
"Style descendants with @container stack queries when layout, gap, or typography should respond to the Stack's own inline-size and block-size instead of the viewport"
|
|
8
9
|
],
|
|
9
10
|
"whenNotToUse": [
|
|
10
11
|
"Cases where a single component already owns required flex chrome",
|
|
@@ -15,6 +16,85 @@
|
|
|
15
16
|
"Keep reading order aligned with visual order when using direction and wrap",
|
|
16
17
|
"Do not use Stack alone to imply grouping; use landmarks or headings where needed"
|
|
17
18
|
],
|
|
18
|
-
"antiPatterns": [
|
|
19
|
-
|
|
19
|
+
"antiPatterns": [
|
|
20
|
+
"Re-declaring primitive flex container rules in app CSS when Stack can own the layout",
|
|
21
|
+
"Using viewport media queries when @container stack queries against the rendered Stack size would match the design intent"
|
|
22
|
+
],
|
|
23
|
+
"related": ["Surface", "Text", "Button"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"react": {
|
|
26
|
+
"rowGap": {
|
|
27
|
+
"description": "Sets row gap using a Vira space token.",
|
|
28
|
+
"refCss": "row-gap"
|
|
29
|
+
},
|
|
30
|
+
"columnGap": {
|
|
31
|
+
"description": "Sets column gap using a Vira space token.",
|
|
32
|
+
"refCss": "column-gap"
|
|
33
|
+
},
|
|
34
|
+
"hAlign": {
|
|
35
|
+
"description": "Sets main-axis alignment for column layouts and cross-axis for row layouts.",
|
|
36
|
+
"refCss": "h-align"
|
|
37
|
+
},
|
|
38
|
+
"vAlign": {
|
|
39
|
+
"description": "Sets cross-axis alignment for column layouts and main-axis for row layouts.",
|
|
40
|
+
"refCss": "v-align"
|
|
41
|
+
},
|
|
42
|
+
"hPadding": {
|
|
43
|
+
"description": "Sets inline padding using one token or a [start, end] tuple."
|
|
44
|
+
},
|
|
45
|
+
"vPadding": {
|
|
46
|
+
"description": "Sets block padding using one token or a [start, end] tuple."
|
|
47
|
+
},
|
|
48
|
+
"maxWidth": {
|
|
49
|
+
"description": "Constrains max inline size of the stack root.",
|
|
50
|
+
"refCss": "max-width"
|
|
51
|
+
},
|
|
52
|
+
"minWidth": {
|
|
53
|
+
"description": "Constrains min inline size of the stack root.",
|
|
54
|
+
"refCss": "min-width"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"css": {
|
|
58
|
+
"row-gap": {
|
|
59
|
+
"description": "Flex row gap on the root.",
|
|
60
|
+
"refReact": "rowGap"
|
|
61
|
+
},
|
|
62
|
+
"column-gap": {
|
|
63
|
+
"description": "Flex column gap on the root.",
|
|
64
|
+
"refReact": "columnGap"
|
|
65
|
+
},
|
|
66
|
+
"h-align": {
|
|
67
|
+
"description": "Logical horizontal flex alignment hook.",
|
|
68
|
+
"refReact": "hAlign"
|
|
69
|
+
},
|
|
70
|
+
"v-align": {
|
|
71
|
+
"description": "Logical vertical flex alignment hook.",
|
|
72
|
+
"refReact": "vAlign"
|
|
73
|
+
},
|
|
74
|
+
"padding-inline-start": {
|
|
75
|
+
"description": "Inline-start padding when padding is enabled.",
|
|
76
|
+
"refReact": "hPadding"
|
|
77
|
+
},
|
|
78
|
+
"padding-inline-end": {
|
|
79
|
+
"description": "Inline-end padding when padding is enabled.",
|
|
80
|
+
"refReact": "hPadding"
|
|
81
|
+
},
|
|
82
|
+
"padding-block-start": {
|
|
83
|
+
"description": "Block-start padding when padding is enabled.",
|
|
84
|
+
"refReact": "vPadding"
|
|
85
|
+
},
|
|
86
|
+
"padding-block-end": {
|
|
87
|
+
"description": "Block-end padding when padding is enabled.",
|
|
88
|
+
"refReact": "vPadding"
|
|
89
|
+
},
|
|
90
|
+
"max-width": {
|
|
91
|
+
"description": "Max inline size of the stack root.",
|
|
92
|
+
"refReact": "maxWidth"
|
|
93
|
+
},
|
|
94
|
+
"min-width": {
|
|
95
|
+
"description": "Min inline size of the stack root.",
|
|
96
|
+
"refReact": "minWidth"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
20
100
|
}
|
|
@@ -10,14 +10,14 @@ var Stack = ({ className, direction = "column", fillChildren = true, hAlign = "i
|
|
|
10
10
|
const hasPadding = Boolean(hPadding || vPadding);
|
|
11
11
|
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
12
12
|
const dynamicStyle = {
|
|
13
|
-
"--stack-row-gap": resolveThemeValue(rowGap, "space", 0),
|
|
14
|
-
"--stack-column-gap": resolveThemeValue(columnGap, "space", 0),
|
|
15
|
-
"--stack-h-align": hAlign,
|
|
16
|
-
"--stack-v-align": vAlign,
|
|
17
|
-
...maxWidth
|
|
18
|
-
...minWidth
|
|
19
|
-
...resolveAxisPadding(hPadding, "--stack-padding-inline-start", "--stack-padding-inline-end"),
|
|
20
|
-
...resolveAxisPadding(vPadding, "--stack-padding-block-start", "--stack-padding-block-end"),
|
|
13
|
+
"--vui-stack-row-gap": resolveThemeValue(rowGap, "space", 0),
|
|
14
|
+
"--vui-stack-column-gap": resolveThemeValue(columnGap, "space", 0),
|
|
15
|
+
"--vui-stack-h-align": hAlign,
|
|
16
|
+
"--vui-stack-v-align": vAlign,
|
|
17
|
+
...maxWidth && { "--vui-stack-max-width": maxWidth },
|
|
18
|
+
...minWidth && { "--vui-stack-min-width": minWidth },
|
|
19
|
+
...resolveAxisPadding(hPadding, "--vui-stack-padding-inline-start", "--vui-stack-padding-inline-end"),
|
|
20
|
+
...resolveAxisPadding(vPadding, "--vui-stack-padding-block-start", "--vui-stack-padding-block-end"),
|
|
21
21
|
...style
|
|
22
22
|
};
|
|
23
23
|
return useRender({
|
|
@@ -31,12 +31,12 @@ var resolvePerCornerRadiusInput = (corners) => ({
|
|
|
31
31
|
bottomRight: resolveRadiusToken(corners[2]),
|
|
32
32
|
bottomLeft: resolveRadiusToken(corners[3])
|
|
33
33
|
});
|
|
34
|
-
var getSurfaceStyleRadius = (style) => style?.["--surface-border-radius"];
|
|
34
|
+
var getSurfaceStyleRadius = (style) => style?.["--vui-surface-border-radius"];
|
|
35
35
|
var getSurfaceRadiusStyle = (radius) => ({
|
|
36
|
-
"--surface-border-radius-top-left": radius.topLeft,
|
|
37
|
-
"--surface-border-radius-top-right": radius.topRight,
|
|
38
|
-
"--surface-border-radius-bottom-right": radius.bottomRight,
|
|
39
|
-
"--surface-border-radius-bottom-left": radius.bottomLeft
|
|
36
|
+
"--vui-surface-border-radius-top-left": radius.topLeft,
|
|
37
|
+
"--vui-surface-border-radius-top-right": radius.topRight,
|
|
38
|
+
"--vui-surface-border-radius-bottom-right": radius.bottomRight,
|
|
39
|
+
"--vui-surface-border-radius-bottom-left": radius.bottomLeft
|
|
40
40
|
});
|
|
41
41
|
var resolveDefaultContext = ({ hPadding, radius, style, vPadding }) => {
|
|
42
42
|
const [paddingInlineStart, paddingInlineEnd] = resolveAxisPaddingValues(hPadding);
|
|
@@ -74,7 +74,7 @@ var useSurfaceRadius = ({ defaults, hPadding, radius, style, vPadding }) => {
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
hasAutoRadius,
|
|
77
|
-
radiusStyle: hasAutoRadius || hasPerCornerRadius ? getSurfaceRadiusStyle(ownRadius) : { "--surface-border-radius": tokenRadius }
|
|
77
|
+
radiusStyle: hasAutoRadius || hasPerCornerRadius ? getSurfaceRadiusStyle(ownRadius) : { "--vui-surface-border-radius": tokenRadius }
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
//#endregion
|
|
@@ -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)
|
|
1
|
+
.viraui__surface-module__Surface_slEYq{--vui-surface-border-radius:0;--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-padding-inline-start:0;--vui-surface-padding-inline-end:0;--vui-surface-padding-block-start:0;--vui-surface-padding-block-end:0;--vui-surface-background-hover:var(--vui-surface-background);container:surface/inline-size block-size;position:relative;overflow:var(--vui-surface-overflow,visible);box-sizing:border-box;background:var(--vui-surface-background,#0000);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,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(--vui-surface-background-hover)}}}
|
|
@@ -69,7 +69,7 @@ export type SurfaceProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'color'>
|
|
|
69
69
|
*/
|
|
70
70
|
vPadding?: SurfacePadding;
|
|
71
71
|
/**
|
|
72
|
-
* Sets root overflow through the `--surface-overflow` custom property.
|
|
72
|
+
* Sets root overflow through the `--vui-surface-overflow` custom property.
|
|
73
73
|
*
|
|
74
74
|
* @default visible
|
|
75
75
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Surface",
|
|
3
|
-
"summary": "Presentational container with token background, optional border, radius, and padding; nested surfaces use radius=\"auto\" for concentric corners.",
|
|
3
|
+
"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
4
|
"whenToUse": [
|
|
5
5
|
"Group content with base-level background and contrast border",
|
|
6
6
|
"Popup or card chrome with optional hover background",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"Set radius to a four-value tuple [top-left, top-right, bottom-right, bottom-left] when corners need different token radii",
|
|
10
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",
|
|
11
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"
|
|
12
|
+
"Set overflow=\"hidden\" (or scroll/auto) when Surface must clip or scroll inner content with radius or padding",
|
|
13
|
+
"Style descendants with @container surface queries when layout or typography should respond to the Surface's own inline-size and block-size instead of the viewport"
|
|
13
14
|
],
|
|
14
15
|
"whenNotToUse": [
|
|
15
16
|
"Interactive control semantics without an appropriate render root",
|
|
@@ -25,7 +26,92 @@
|
|
|
25
26
|
"Overwriting transition shorthand without composing box-shadow when data-elevation is present",
|
|
26
27
|
"Assuming hoverColor applies on touch devices",
|
|
27
28
|
"Reusing the parent token radius on nested Surfaces instead of radius=\"auto\" when concentric corners are required",
|
|
28
|
-
"Expecting radius=\"auto\" to inherit a token when the nearest ancestor Surface has no radius set"
|
|
29
|
+
"Expecting radius=\"auto\" to inherit a token when the nearest ancestor Surface has no radius set",
|
|
30
|
+
"Using viewport media queries when @container surface queries against the rendered Surface size would match the design intent"
|
|
29
31
|
],
|
|
30
|
-
"related": ["Elevator", "Stack"]
|
|
32
|
+
"related": ["Elevator", "Stack"],
|
|
33
|
+
"properties": {
|
|
34
|
+
"react": {
|
|
35
|
+
"color": {
|
|
36
|
+
"description": "Sets the resting background using a base ramp layer or literal CSS color.",
|
|
37
|
+
"refCss": "background"
|
|
38
|
+
},
|
|
39
|
+
"hoverColor": {
|
|
40
|
+
"description": "Sets the hover background on hover-capable pointers.",
|
|
41
|
+
"refCss": "background-hover"
|
|
42
|
+
},
|
|
43
|
+
"borderStyle": {
|
|
44
|
+
"description": "Sets the CSS border style when border is set.",
|
|
45
|
+
"refCss": "border-style"
|
|
46
|
+
},
|
|
47
|
+
"overflow": {
|
|
48
|
+
"description": "Sets root overflow through the surface overflow custom property.",
|
|
49
|
+
"refCss": "overflow"
|
|
50
|
+
},
|
|
51
|
+
"radius": {
|
|
52
|
+
"description": "Sets corner radius from tokens, a per-corner tuple, or auto for concentric radii.",
|
|
53
|
+
"refCss": "border-radius"
|
|
54
|
+
},
|
|
55
|
+
"hPadding": {
|
|
56
|
+
"description": "Sets inline padding using one token or a [start, end] tuple."
|
|
57
|
+
},
|
|
58
|
+
"vPadding": {
|
|
59
|
+
"description": "Sets block padding using one token or a [start, end] tuple."
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"css": {
|
|
63
|
+
"background": {
|
|
64
|
+
"description": "Resting surface background on the root.",
|
|
65
|
+
"refReact": "color"
|
|
66
|
+
},
|
|
67
|
+
"background-hover": {
|
|
68
|
+
"description": "Hover surface background on the root.",
|
|
69
|
+
"refReact": "hoverColor"
|
|
70
|
+
},
|
|
71
|
+
"border-style": {
|
|
72
|
+
"description": "Border style when border is enabled.",
|
|
73
|
+
"refReact": "borderStyle"
|
|
74
|
+
},
|
|
75
|
+
"overflow": {
|
|
76
|
+
"description": "Root overflow behavior.",
|
|
77
|
+
"refReact": "overflow"
|
|
78
|
+
},
|
|
79
|
+
"border-radius": {
|
|
80
|
+
"description": "Uniform corner radius when radius is a single token.",
|
|
81
|
+
"refReact": "radius"
|
|
82
|
+
},
|
|
83
|
+
"border-radius-top-left": {
|
|
84
|
+
"description": "Top-left corner radius; radius tuple or auto resolves per corner.",
|
|
85
|
+
"refReact": "radius"
|
|
86
|
+
},
|
|
87
|
+
"border-radius-top-right": {
|
|
88
|
+
"description": "Top-right corner radius; radius tuple or auto resolves per corner.",
|
|
89
|
+
"refReact": "radius"
|
|
90
|
+
},
|
|
91
|
+
"border-radius-bottom-right": {
|
|
92
|
+
"description": "Bottom-right corner radius; radius tuple or auto resolves per corner.",
|
|
93
|
+
"refReact": "radius"
|
|
94
|
+
},
|
|
95
|
+
"border-radius-bottom-left": {
|
|
96
|
+
"description": "Bottom-left corner radius; radius tuple or auto resolves per corner.",
|
|
97
|
+
"refReact": "radius"
|
|
98
|
+
},
|
|
99
|
+
"padding-inline-start": {
|
|
100
|
+
"description": "Inline-start padding when padding is enabled.",
|
|
101
|
+
"refReact": "hPadding"
|
|
102
|
+
},
|
|
103
|
+
"padding-inline-end": {
|
|
104
|
+
"description": "Inline-end padding when padding is enabled.",
|
|
105
|
+
"refReact": "hPadding"
|
|
106
|
+
},
|
|
107
|
+
"padding-block-start": {
|
|
108
|
+
"description": "Block-start padding when padding is enabled.",
|
|
109
|
+
"refReact": "vPadding"
|
|
110
|
+
},
|
|
111
|
+
"padding-block-end": {
|
|
112
|
+
"description": "Block-end padding when padding is enabled.",
|
|
113
|
+
"refReact": "vPadding"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
31
117
|
}
|
|
@@ -32,13 +32,13 @@ var Surface = ({ border, borderStyle = "solid", className, color, hPadding, hove
|
|
|
32
32
|
vPadding
|
|
33
33
|
});
|
|
34
34
|
const dynamicStyle = {
|
|
35
|
-
"--surface-background": toSurfaceColor(color ?? "none"),
|
|
36
|
-
...hasHoverColor
|
|
37
|
-
...border
|
|
38
|
-
"--surface-overflow": overflow,
|
|
35
|
+
"--vui-surface-background": toSurfaceColor(color ?? "none"),
|
|
36
|
+
...hasHoverColor && { "--vui-surface-background-hover": toSurfaceColor(hoverColor) },
|
|
37
|
+
...border && { "--vui-surface-border-style": borderStyle },
|
|
38
|
+
...overflow && { "--vui-surface-overflow": overflow },
|
|
39
39
|
...radiusStyle,
|
|
40
|
-
...resolveAxisPadding(hPadding, "--surface-padding-inline-start", "--surface-padding-inline-end"),
|
|
41
|
-
...resolveAxisPadding(vPadding, "--surface-padding-block-start", "--surface-padding-block-end"),
|
|
40
|
+
...resolveAxisPadding(hPadding, "--vui-surface-padding-inline-start", "--vui-surface-padding-inline-end"),
|
|
41
|
+
...resolveAxisPadding(vPadding, "--vui-surface-padding-block-start", "--vui-surface-padding-block-end"),
|
|
42
42
|
...style
|
|
43
43
|
};
|
|
44
44
|
const surface = useRender({
|
|
@@ -48,8 +48,8 @@ var Surface = ({ border, borderStyle = "solid", className, color, hPadding, hove
|
|
|
48
48
|
props: {
|
|
49
49
|
...componentProps,
|
|
50
50
|
...intrinsicAttributes,
|
|
51
|
-
...border
|
|
52
|
-
...hasAutoRadius
|
|
51
|
+
...border && { "data-surface-border": border },
|
|
52
|
+
...hasAutoRadius && { "data-surface-radius": "auto" },
|
|
53
53
|
"data-surface-has-hover-color": hasHoverColor ? "true" : "false",
|
|
54
54
|
"data-surface-has-padding": hasPadding ? "true" : "false",
|
|
55
55
|
className: clsx(surface_module_default.Surface, className),
|
|
@@ -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-
|
|
1
|
+
.viraui__switch-module__Switch_L86y7{--vui-switch-track-block-size:var(--space-large);--vui-switch-track-radius:var(--radius-small);--vui-switch-track-background:var(--global-contrast);--vui-switch-thumb-background:var(--base-1);--vui-switch-thumb-size:calc(var(--space-large) - var(--space-x-small));--vui-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(--vui-switch-thumb-size) * 2) + var(--vui-switch-thumb-inset) * 2);block-size:var(--vui-switch-track-block-size);background:var(--vui-switch-track-background);border-radius:var(--vui-switch-track-radius);&[data-size=small]{--vui-switch-track-radius:var(--radius-x-small);--vui-switch-track-block-size:var(--space-medium);--vui-switch-thumb-size:calc(var(--space-medium) - var(--space-x-small))}&[data-checked]:not([data-disabled]){--vui-switch-track-background:var(--global-primary);--vui-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]>&{--vui-switch-track-background:var(--global-disabled-background);--vui-switch-thumb-background:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}}.viraui__switch-module__Thumb_ldwJw{--switch-thumb-radius:calc(var(--vui-switch-track-radius) - var(--vui-switch-thumb-inset));position:absolute;inset-block:var(--vui-switch-thumb-inset);inset-inline-start:var(--vui-switch-thumb-inset);background:var(--vui-switch-thumb-background);inline-size:var(--vui-switch-thumb-size);block-size:var(--vui-switch-thumb-size);border-radius:var(--switch-thumb-radius);transition:translate var(--easing-entrance) var(--duration-fast);box-shadow:0 0 1px 1px var(--global-contrast);.viraui__switch-module__SwitchRoot_Zv9An[data-checked]>&{translate:100% 0;box-shadow:none}.viraui__switch-module__SwitchRoot_Zv9An[data-checked]:dir(rtl)>&{translate:-100% 0}}
|