@viraui/react 2026.0.12 → 2026.0.14
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/components/autocomplete/autocomplete.d.ts +9 -1
- package/dist/components/autocomplete/autocomplete.guide.json +5 -1
- package/dist/components/autocomplete/autocomplete.js +43 -40
- package/dist/components/button/button.css +1 -1
- package/dist/components/checkbox/checkbox.css +1 -1
- package/dist/components/dialog/dialog-sheet.d.ts +9 -0
- package/dist/components/dialog/dialog-sheet.js +70 -67
- package/dist/components/dialog/dialog.guide.json +5 -1
- package/dist/components/menu/menu-popup.d.ts +9 -1
- package/dist/components/menu/menu-popup.js +21 -18
- package/dist/components/menu/menu.guide.json +5 -1
- package/dist/components/popover/popover-sheet.d.ts +13 -3
- package/dist/components/popover/popover-sheet.js +65 -62
- package/dist/components/popover/popover.guide.json +5 -1
- package/dist/components/radio/radio.css +1 -1
- package/dist/components/radio/radio.js +31 -28
- package/dist/components/radio/radio.module.js +3 -1
- package/dist/components/select/select.css +1 -1
- package/dist/components/select/select.d.ts +10 -2
- package/dist/components/select/select.guide.json +5 -1
- package/dist/components/select/select.js +60 -57
- package/dist/components/slider/slider.css +1 -1
- package/dist/components/switch/switch.css +1 -1
- package/dist/components/textarea/textarea.css +1 -1
- package/dist/components/textfield/textfield.css +1 -1
- package/dist/components/title/title.css +1 -1
- package/dist/components/toast/toast.guide.json +5 -1
- package/dist/components/tooltip/tooltip-content.d.ts +11 -2
- package/dist/components/tooltip/tooltip-content.js +24 -21
- package/dist/components/tooltip/tooltip.guide.json +7 -1
- package/package.json +2 -2
|
@@ -77,12 +77,20 @@ export type AutocompleteProps = Omit<AutocompleteRoot.Props<any>, 'children'> &
|
|
|
77
77
|
* @default No ref is attached.
|
|
78
78
|
*/
|
|
79
79
|
ref?: React.Ref<HTMLInputElement>;
|
|
80
|
+
/**
|
|
81
|
+
* Portal mount node (iframe body, shadow root, or app overlay root).
|
|
82
|
+
* Omit for Base UI default (`document.body` from the module window —
|
|
83
|
+
* iframe hosts must pass the iframe document body explicitly).
|
|
84
|
+
*
|
|
85
|
+
* @default Base UI FloatingPortal resolution
|
|
86
|
+
*/
|
|
87
|
+
container?: React.ComponentProps<typeof PrimitiveAutocomplete.Portal>['container'];
|
|
80
88
|
/**
|
|
81
89
|
* List content: static nodes (`Item` / `Group` / `Collection`) or a Base UI list render function.
|
|
82
90
|
*/
|
|
83
91
|
children?: React.ReactNode | ((item: any, index: number) => React.ReactNode);
|
|
84
92
|
};
|
|
85
|
-
declare function AutocompleteRootComponent({ children, className, description, dirty, disabled, empty, endAddon, error, fitContent, invalid, label, name, placeholder, ref, startAddon, status, touched, validate, validationDebounceTime, validationMode, ...autocompleteRootProps }: AutocompleteProps): React.JSX.Element;
|
|
93
|
+
declare function AutocompleteRootComponent({ children, className, container, description, dirty, disabled, empty, endAddon, error, fitContent, invalid, label, name, placeholder, ref, startAddon, status, touched, validate, validationDebounceTime, validationMode, ...autocompleteRootProps }: AutocompleteProps): React.JSX.Element;
|
|
86
94
|
declare const AutocompleteCollection: typeof PrimitiveAutocomplete.Collection;
|
|
87
95
|
type AutocompleteComponent = typeof AutocompleteRootComponent & {
|
|
88
96
|
Item: typeof AutocompleteItemPart;
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
"Suggest options while allowing free-form text in the input",
|
|
8
8
|
"Filterable tag, movie, or docs search with optional empty and status copy",
|
|
9
9
|
"Grouped suggestion lists via Autocomplete.Group and Collection",
|
|
10
|
-
"Async or limited result lists that need polite status announcements"
|
|
10
|
+
"Async or limited result lists that need polite status announcements",
|
|
11
|
+
"Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on the portal-owning public part"
|
|
11
12
|
],
|
|
12
13
|
"whenNotToUse": [
|
|
13
14
|
"Remembered selection from a closed list — use Select (or Combobox when available)",
|
|
@@ -27,6 +28,9 @@
|
|
|
27
28
|
"related": ["Textfield", "Select", "Fieldset", "Stack", "Surface", "Spinner"],
|
|
28
29
|
"properties": {
|
|
29
30
|
"react": {
|
|
31
|
+
"container": {
|
|
32
|
+
"description": "Portal mount node (iframe body, shadow root, or app overlay root). Omit for Base UI default (`document.body` from the module window — iframe hosts must pass the iframe document body explicitly)."
|
|
33
|
+
},
|
|
30
34
|
"description": {
|
|
31
35
|
"description": "Helper copy rendered with `Field.Description` and `Text` while the field is valid."
|
|
32
36
|
},
|
|
@@ -18,7 +18,7 @@ import { Autocomplete } from "@base-ui/react/autocomplete";
|
|
|
18
18
|
import { useId } from "react";
|
|
19
19
|
//#region src/components/autocomplete/autocomplete.tsx
|
|
20
20
|
var AutocompletePrimitiveRoot = Autocomplete.Root;
|
|
21
|
-
function AutocompleteRootComponent({ children, className, description, dirty, disabled, empty, endAddon, error, fitContent, invalid, label, name, placeholder, ref, startAddon, status, touched, validate, validationDebounceTime, validationMode, ...autocompleteRootProps }) {
|
|
21
|
+
function AutocompleteRootComponent({ children, className, container, description, dirty, disabled, empty, endAddon, error, fitContent, invalid, label, name, placeholder, ref, startAddon, status, touched, validate, validationDebounceTime, validationMode, ...autocompleteRootProps }) {
|
|
22
22
|
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...restAutocompleteProps } = autocompleteRootProps;
|
|
23
23
|
const fieldLabelId = useId();
|
|
24
24
|
const listAccessibleNameProps = {};
|
|
@@ -63,48 +63,51 @@ function AutocompleteRootComponent({ children, className, description, dirty, di
|
|
|
63
63
|
ref,
|
|
64
64
|
...fitContent && { "data-sizing": "content" }
|
|
65
65
|
})
|
|
66
|
-
}), /* @__PURE__ */ jsx(Autocomplete.Portal, {
|
|
67
|
-
|
|
68
|
-
children: /* @__PURE__ */ jsx(Autocomplete.
|
|
69
|
-
|
|
70
|
-
children: /* @__PURE__ */ jsx(
|
|
71
|
-
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
66
|
+
}), /* @__PURE__ */ jsx(Autocomplete.Portal, {
|
|
67
|
+
container,
|
|
68
|
+
children: /* @__PURE__ */ jsx(Autocomplete.Positioner, {
|
|
69
|
+
sideOffset: 2,
|
|
70
|
+
children: /* @__PURE__ */ jsx(Autocomplete.Popup, {
|
|
71
|
+
className: autocomplete_module_default.AutocompletePopup,
|
|
72
|
+
children: /* @__PURE__ */ jsx(Elevator, {
|
|
73
|
+
resting: 1,
|
|
74
|
+
children: /* @__PURE__ */ jsxs(Surface, {
|
|
75
|
+
border: "all",
|
|
76
|
+
className: autocomplete_module_default.PopupChrome,
|
|
77
|
+
color: 1,
|
|
78
|
+
"data-vibrant": "",
|
|
79
|
+
hPadding: "x-small",
|
|
80
|
+
overflow: "auto",
|
|
81
|
+
radius: "medium",
|
|
82
|
+
vPadding: "x-small",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ jsx(Autocomplete.Status, {
|
|
85
|
+
className: autocomplete_module_default.Status,
|
|
86
|
+
children: typeof status === "string" ? /* @__PURE__ */ jsx(Text, {
|
|
87
|
+
size: "x-small",
|
|
88
|
+
tone: "muted",
|
|
89
|
+
children: status
|
|
90
|
+
}) : status
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ jsx(Autocomplete.Empty, {
|
|
93
|
+
className: autocomplete_module_default.Empty,
|
|
94
|
+
children: typeof empty === "string" ? /* @__PURE__ */ jsx(Text, {
|
|
95
|
+
size: "small",
|
|
96
|
+
tone: "muted",
|
|
97
|
+
children: empty
|
|
98
|
+
}) : empty
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsx(Autocomplete.List, {
|
|
101
|
+
...listAccessibleNameProps,
|
|
102
|
+
className: autocomplete_module_default.List,
|
|
103
|
+
children
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
})
|
|
104
107
|
})
|
|
105
108
|
})
|
|
106
109
|
})
|
|
107
|
-
})
|
|
110
|
+
})]
|
|
108
111
|
}),
|
|
109
112
|
/* @__PURE__ */ jsx(FieldHelperCopy, {
|
|
110
113
|
className: autocomplete_module_default.Description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-button-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-button-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-button-height{syntax:"<length>";inherits:false;initial-value:0}@property --vui-button-padding-inline{syntax:"<length>";inherits:false;initial-value:0}@property --vui-button-padding-block{syntax:"<length>";inherits:false;initial-value:0}@property --vui-button-spinner-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-button-icon-size{syntax:"<length>";inherits:true;initial-value:0}@property --vui-button-radius{syntax:"<length-percentage>";inherits:false;initial-value:0}.viraui__button-module__Button_oPhrP{--vui-button-background:var(--global-primary);--vui-button-color:var(--base-1);--vui-button-height:var(--space-2x-large);--vui-button-padding-inline:calc(var(--space-small) + var(--space-2x-small));--vui-button-padding-block:var(--space-small);--vui-button-icon-size:1.125em;--vui-button-spinner-color:currentColor;--vui-button-radius:var(--radius-medium);-webkit-user-select:none;user-select:none;margin:0;cursor:pointer;font-family:inherit;display:inline-flex;align-items:center;min-inline-size:fit-content;min-block-size:var(--vui-button-height);block-size:var(--vui-button-height);justify-content:center;text-decoration:none;white-space:nowrap;appearance:button;overflow:hidden;position:relative;padding:var(--vui-button-padding-block) var(--vui-button-padding-inline);font-weight:400;font-variation-settings:"wght" 400;gap:var(--space-small);border:1px solid #0000;background:var(--vui-button-background);color:var(--vui-button-color);font-size:var(--font-scale-body-medium);border-radius:var(--vui-button-radius);transition:translate var(--easing-elastic) var(--duration-instant);will-change:translate;&:not(:disabled){background-clip:padding-box}&:not(:disabled,[aria-disabled=true]):active{translate:0 1px}&[data-pill=true]{border-radius:var(--radius-infinite)}&[data-size=big]{--vui-button-height:calc(var(--space-2x-large) + var(--space-x-small));--vui-button-padding-inline:calc(var(--space-medium) + var(--space-2x-small));--vui-button-padding-block:var(--space-small);--vui-button-icon-size:1.125em;--vui-button-radius:var(--radius-medium)}&[data-size=small]{--vui-button-height:var(--space-x-large);--vui-button-padding-inline:var(--space-small);--vui-button-padding-block:var(--space-x-small);--vui-button-icon-size:1em;--vui-button-radius:var(--radius-small);gap:var(--space-x-small);font-size:var(--font-scale-body-small)}&[data-variant=primary]{--vui-button-background:var(--global-primary);--vui-button-color:contrast-color(var(--global-primary));&:hover{--vui-button-background:oklab(from var(--global-primary) calc(l + 0.05) a b)}}&[data-variant=secondary]{--vui-button-background:var(--global-contrast);--vui-button-color:var(--base-6);background-clip:unset;&:hover{--vui-button-background:oklab(from var(--global-contrast) l a b/calc(alpha + 0.03))}@container root style(--is-light-mode: black){--vui-button-background:oklab(from var(--global-contrast) l a b/0.1)}}&[data-variant=flat]{--vui-button-background:#0000;--vui-button-color:var(--base-5);&:hover{--vui-button-background:var(--global-contrast);--vui-button-color:var(--base-7)}}&[data-variant=destructive]{--vui-button-background:oklab(from var(--highlight-red) l a b/12%);--vui-button-color:var(--highlight-red);outline-color:var(--highlight-red);&:hover{--vui-button-background:oklab(from var(--highlight-red) l a b/30%)}}&[data-addon-position=start]{flex-direction:row;padding-inline-end:calc(var(--vui-button-padding-inline) * 1.2)}&[data-addon-position=end]{flex-direction:row-reverse;padding-inline-start:calc(var(--vui-button-padding-inline) * 1.2)}&[data-icon-only=true]{gap:0;padding-block:var(--vui-button-padding-block);padding-inline:var(--vui-button-padding-block);inline-size:var(--vui-button-height);min-inline-size:var(--vui-button-height);max-inline-size:var(--vui-button-height);aspect-ratio:1/1}&:disabled,&:disabled:active,&:disabled:hover,&[aria-disabled=true],&[aria-disabled=true]:active,&[aria-disabled=true]:hover{--vui-button-background:var(--global-disabled-background);--vui-button-color:var(--global-disabled-foreground);cursor:not-allowed;box-shadow:none;translate:0}&[data-loading=true][data-disabled]{pointer-events:none;border:0;box-shadow:none;--vui-button-color:var(--base-7)}}.viraui__button-module__Content_w-pX-{display:inline-grid;place-items:center;&[data-loading=true]{opacity:0}&:first-child>svg{block-size:var(--vui-button-icon-size);inline-size:var(--vui-button-icon-size);flex-shrink:0}}.viraui__button-module__SpinnerOverlay_vKqw1{position:absolute;inset:0;display:grid;place-content:center;pointer-events:none;color:var(--vui-button-spinner-color)}}
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-button-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-button-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-button-height{syntax:"<length>";inherits:false;initial-value:0}@property --vui-button-padding-inline{syntax:"<length>";inherits:false;initial-value:0}@property --vui-button-padding-block{syntax:"<length>";inherits:false;initial-value:0}@property --vui-button-spinner-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-button-icon-size{syntax:"<length>";inherits:true;initial-value:0}@property --vui-button-radius{syntax:"<length-percentage>";inherits:false;initial-value:0}.viraui__button-module__Button_oPhrP{--vui-button-background:var(--global-primary);--vui-button-color:var(--base-1);--vui-button-height:var(--space-2x-large);--vui-button-padding-inline:calc(var(--space-small) + var(--space-2x-small));--vui-button-padding-block:var(--space-small);--vui-button-icon-size:1.125em;--vui-button-spinner-color:currentColor;--vui-button-radius:var(--radius-medium);max-block-size:min-content;-webkit-user-select:none;user-select:none;margin:0;cursor:pointer;font-family:inherit;display:inline-flex;align-items:center;min-inline-size:fit-content;min-block-size:var(--vui-button-height);block-size:var(--vui-button-height);justify-content:center;text-decoration:none;white-space:nowrap;appearance:button;overflow:hidden;position:relative;padding:var(--vui-button-padding-block) var(--vui-button-padding-inline);font-weight:400;font-variation-settings:"wght" 400;gap:var(--space-small);border:1px solid #0000;background:var(--vui-button-background);color:var(--vui-button-color);font-size:var(--font-scale-body-medium);border-radius:var(--vui-button-radius);transition:translate var(--easing-elastic) var(--duration-instant);will-change:translate;&:not(:disabled){background-clip:padding-box}&:not(:disabled,[aria-disabled=true]):active{translate:0 1px}&[data-pill=true]{border-radius:var(--radius-infinite)}&[data-size=big]{--vui-button-height:calc(var(--space-2x-large) + var(--space-x-small));--vui-button-padding-inline:calc(var(--space-medium) + var(--space-2x-small));--vui-button-padding-block:var(--space-small);--vui-button-icon-size:1.125em;--vui-button-radius:var(--radius-medium)}&[data-size=small]{--vui-button-height:var(--space-x-large);--vui-button-padding-inline:var(--space-small);--vui-button-padding-block:var(--space-x-small);--vui-button-icon-size:1em;--vui-button-radius:var(--radius-small);gap:var(--space-x-small);font-size:var(--font-scale-body-small)}&[data-variant=primary]{--vui-button-background:var(--global-primary);--vui-button-color:contrast-color(var(--global-primary));&:hover{--vui-button-background:oklab(from var(--global-primary) calc(l + 0.05) a b)}}&[data-variant=secondary]{--vui-button-background:var(--global-contrast);--vui-button-color:var(--base-6);background-clip:unset;&:hover{--vui-button-background:oklab(from var(--global-contrast) l a b/calc(alpha + 0.03))}@container root style(--is-light-mode: black){--vui-button-background:oklab(from var(--global-contrast) l a b/0.1)}}&[data-variant=flat]{--vui-button-background:#0000;--vui-button-color:var(--base-5);&:hover{--vui-button-background:var(--global-contrast);--vui-button-color:var(--base-7)}}&[data-variant=destructive]{--vui-button-background:oklab(from var(--highlight-red) l a b/12%);--vui-button-color:var(--highlight-red);outline-color:var(--highlight-red);&:hover{--vui-button-background:oklab(from var(--highlight-red) l a b/30%)}}&[data-addon-position=start]{flex-direction:row;padding-inline-end:calc(var(--vui-button-padding-inline) * 1.2)}&[data-addon-position=end]{flex-direction:row-reverse;padding-inline-start:calc(var(--vui-button-padding-inline) * 1.2)}&[data-icon-only=true]{gap:0;padding-block:var(--vui-button-padding-block);padding-inline:var(--vui-button-padding-block);inline-size:var(--vui-button-height);min-inline-size:var(--vui-button-height);max-inline-size:var(--vui-button-height);aspect-ratio:1/1}&:disabled,&:disabled:active,&:disabled:hover,&[aria-disabled=true],&[aria-disabled=true]:active,&[aria-disabled=true]:hover{--vui-button-background:var(--global-disabled-background);--vui-button-color:var(--global-disabled-foreground);cursor:not-allowed;box-shadow:none;translate:0}&[data-loading=true][data-disabled]{pointer-events:none;border:0;box-shadow:none;--vui-button-color:var(--base-7)}}.viraui__button-module__Content_w-pX-{display:inline-grid;place-items:center;&[data-loading=true]{opacity:0}&:first-child>svg{block-size:var(--vui-button-icon-size);inline-size:var(--vui-button-icon-size);flex-shrink:0}}.viraui__button-module__SpinnerOverlay_vKqw1{position:absolute;inset:0;display:grid;place-content:center;pointer-events:none;color:var(--vui-button-spinner-color)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-checkbox-size{syntax:"<length>";inherits:false;initial-value:0}@property --vui-checkbox-radius{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-checkbox-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-checkbox-border-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-checkbox-indicator-color{syntax:"<color>";inherits:true;initial-value:#0000}.viraui__checkbox-module__Checkbox_3oGip{
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-checkbox-size{syntax:"<length>";inherits:false;initial-value:0}@property --vui-checkbox-radius{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --vui-checkbox-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-checkbox-border-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-checkbox-indicator-color{syntax:"<color>";inherits:true;initial-value:#0000}.viraui__checkbox-module__Checkbox_3oGip{max-block-size:min-content;&:has([required]) .viraui__checkbox-module__Label_n9HL7:after{content:" *";color:var(--highlight-red)}}.viraui__checkbox-module__CheckboxRoot_PeyF5{--vui-checkbox-size:var(--space-medium);--vui-checkbox-radius:var(--radius-x-small);--vui-checkbox-background:var(--global-contrast);--vui-checkbox-indicator-color:contrast-color(var(--global-primary));position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;appearance:none;border:0;box-shadow:inset 0 0 0 1px var(--vui-checkbox-border-color);inline-size:var(--vui-checkbox-size);block-size:var(--vui-checkbox-size);background:var(--vui-checkbox-background);border-radius:var(--vui-checkbox-radius);&[data-size=regular]{--vui-checkbox-size:var(--space-large);--vui-checkbox-radius:var(--radius-small)}&[data-checked]:not([data-disabled]):not([data-invalid]){--vui-checkbox-background:var(--global-primary);--vui-checkbox-border-color:var(--global-primary);box-shadow:none}&[data-indeterminate]:not([data-disabled]):not([data-invalid]){--vui-checkbox-indicator-color:var(--global-foreground)}&[data-invalid]:not([data-disabled]),[data-invalid] &:not([data-disabled]){--vui-checkbox-border-color:var(--highlight-red);--vui-checkbox-indicator-color:var(--global-primary);box-shadow:inset 0 0 0 1px var(--vui-checkbox-border-color);outline-color:oklab(from var(--highlight-red) l a b/.5)}&[data-disabled],[data-disabled] &{--vui-checkbox-background:var(--global-disabled-background);--vui-checkbox-border-color:#0000;--vui-checkbox-indicator-color:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}}.viraui__checkbox-module__Indicator_C-k-l{display:inline-flex;align-items:center;justify-content:center;color:var(--vui-checkbox-indicator-color);inline-size:100%;block-size:100%}.viraui__checkbox-module__CheckIcon_XqUcs,.viraui__checkbox-module__MinusIcon_Q57pY{inline-size:75%;block-size:75%;stroke:currentcolor}.viraui__checkbox-module__CheckboxRoot_PeyF5:not([data-indeterminate]) .viraui__checkbox-module__MinusIcon_Q57pY,.viraui__checkbox-module__CheckboxRoot_PeyF5[data-indeterminate] .viraui__checkbox-module__CheckIcon_XqUcs{display:none}.viraui__checkbox-module__CheckboxRoot_PeyF5[data-indeterminate] .viraui__checkbox-module__MinusIcon_Q57pY{display:inline-flex}}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Drawer as PrimitiveDrawer } from '@base-ui/react';
|
|
1
2
|
import { StackProps } from '..';
|
|
2
3
|
import type * as React from 'react';
|
|
3
4
|
/**
|
|
@@ -62,5 +63,13 @@ export type DialogSheetProps = {
|
|
|
62
63
|
* @default `97dvh`
|
|
63
64
|
*/
|
|
64
65
|
maxHeight?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Portal mount node (iframe body, shadow root, or app overlay root).
|
|
68
|
+
* Omit for Base UI default (`document.body` from the module window —
|
|
69
|
+
* iframe hosts must pass the iframe document body explicitly).
|
|
70
|
+
*
|
|
71
|
+
* @default Base UI FloatingPortal resolution
|
|
72
|
+
*/
|
|
73
|
+
container?: React.ComponentProps<typeof PrimitiveDrawer.Portal>['container'];
|
|
65
74
|
};
|
|
66
75
|
export declare const DialogSheet: React.FC<DialogSheetProps>;
|
|
@@ -9,76 +9,79 @@ import { Title } from "../title/title.js";
|
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { Drawer } from "@base-ui/react";
|
|
11
11
|
//#region src/components/dialog/dialog-sheet.tsx
|
|
12
|
-
var DialogSheet = ({ children, description, title, showCloseButton = false, fitContent = false, showHandle = true, headerAlign = "start", maxContentWidth = "50ch", maxHeight = "97dvh" }) => /* @__PURE__ */ jsxs(Drawer.Portal, {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
render: /* @__PURE__ */ jsx(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
className: dialog_module_default.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
children:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
render: /* @__PURE__ */ jsx(
|
|
12
|
+
var DialogSheet = ({ children, description, title, showCloseButton = false, fitContent = false, showHandle = true, headerAlign = "start", maxContentWidth = "50ch", maxHeight = "97dvh", container }) => /* @__PURE__ */ jsxs(Drawer.Portal, {
|
|
13
|
+
container,
|
|
14
|
+
children: [/* @__PURE__ */ jsx(Drawer.Backdrop, { className: dialog_module_default.Backdrop }), /* @__PURE__ */ jsx(Drawer.Viewport, {
|
|
15
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
16
|
+
vAlign: "end",
|
|
17
|
+
hPadding: "small",
|
|
18
|
+
vPadding: "small",
|
|
19
|
+
fillChildren: false,
|
|
20
|
+
hAlign: fitContent ? "center" : void 0
|
|
21
|
+
}),
|
|
22
|
+
className: dialog_module_default.Viewport,
|
|
23
|
+
children: /* @__PURE__ */ jsx(Elevator, {
|
|
24
|
+
resting: 4,
|
|
25
|
+
children: /* @__PURE__ */ jsxs(Drawer.Popup, {
|
|
26
|
+
className: dialog_module_default.Popup,
|
|
27
|
+
style: { "--vui-dialog-max-block-size": maxHeight },
|
|
28
|
+
render: /* @__PURE__ */ jsx(Surface, {
|
|
29
|
+
border: "top",
|
|
30
|
+
render: /* @__PURE__ */ jsx(Stack, { hAlign: "center" }),
|
|
31
|
+
color: 1,
|
|
32
|
+
"data-vibrant": "",
|
|
33
|
+
radius: "large",
|
|
34
|
+
vPadding: ["medium", 0]
|
|
35
|
+
}),
|
|
36
|
+
children: [showHandle && /* @__PURE__ */ jsxs(Stack, {
|
|
37
|
+
inline: true,
|
|
38
|
+
direction: "row",
|
|
39
|
+
vPadding: [0, "medium"],
|
|
40
|
+
columnGap: "small",
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx("div", { className: dialog_module_default.HandleShape }),
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: dialog_module_default.HandleShape }),
|
|
44
|
+
/* @__PURE__ */ jsx("div", { className: dialog_module_default.HandleShape })
|
|
45
|
+
]
|
|
46
|
+
}), /* @__PURE__ */ jsxs(Stack, {
|
|
47
|
+
maxWidth: maxContentWidth,
|
|
48
|
+
rowGap: "large",
|
|
49
|
+
className: dialog_module_default.Body,
|
|
50
|
+
children: [/* @__PURE__ */ jsxs(Stack, {
|
|
51
|
+
className: dialog_module_default.Header,
|
|
52
|
+
"data-shrink": "false",
|
|
53
|
+
hAlign: headerAlign,
|
|
54
|
+
hPadding: "medium",
|
|
55
|
+
fillChildren: false,
|
|
56
|
+
children: [/* @__PURE__ */ jsx(Drawer.Title, {
|
|
57
|
+
render: /* @__PURE__ */ jsx(Title, { size: "4" }),
|
|
58
|
+
children: title
|
|
59
|
+
}), description && /* @__PURE__ */ jsx(Drawer.Description, {
|
|
60
|
+
render: /* @__PURE__ */ jsx(Text, {
|
|
61
|
+
tone: "muted",
|
|
62
|
+
render: /* @__PURE__ */ jsx("p", {})
|
|
63
|
+
}),
|
|
64
|
+
children: description
|
|
65
|
+
})]
|
|
66
|
+
}), /* @__PURE__ */ jsxs(Drawer.Content, {
|
|
67
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
68
|
+
vAlign: "start",
|
|
69
|
+
fillChildren: false,
|
|
70
|
+
className: dialog_module_default.Content
|
|
61
71
|
}),
|
|
62
|
-
children:
|
|
72
|
+
children: [showCloseButton && /* @__PURE__ */ jsx(Drawer.Close, {
|
|
73
|
+
className: dialog_module_default.CloseButton,
|
|
74
|
+
render: /* @__PURE__ */ jsx(IconButton, {
|
|
75
|
+
"aria-label": "Close dialog",
|
|
76
|
+
icon: /* @__PURE__ */ jsx(ChromeXmark, {}),
|
|
77
|
+
variant: "flat"
|
|
78
|
+
})
|
|
79
|
+
}), children]
|
|
63
80
|
})]
|
|
64
|
-
}), /* @__PURE__ */ jsxs(Drawer.Content, {
|
|
65
|
-
render: /* @__PURE__ */ jsx(Stack, {
|
|
66
|
-
vAlign: "start",
|
|
67
|
-
fillChildren: false,
|
|
68
|
-
className: dialog_module_default.Content
|
|
69
|
-
}),
|
|
70
|
-
children: [showCloseButton && /* @__PURE__ */ jsx(Drawer.Close, {
|
|
71
|
-
className: dialog_module_default.CloseButton,
|
|
72
|
-
render: /* @__PURE__ */ jsx(IconButton, {
|
|
73
|
-
"aria-label": "Close dialog",
|
|
74
|
-
icon: /* @__PURE__ */ jsx(ChromeXmark, {}),
|
|
75
|
-
variant: "flat"
|
|
76
|
-
})
|
|
77
|
-
}), children]
|
|
78
81
|
})]
|
|
79
|
-
})
|
|
82
|
+
})
|
|
80
83
|
})
|
|
81
|
-
})
|
|
82
|
-
})
|
|
84
|
+
})]
|
|
85
|
+
});
|
|
83
86
|
//#endregion
|
|
84
87
|
export { DialogSheet };
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"Short forms or read-only content that needs a modal layer above the app",
|
|
9
9
|
"Bottom sheets where swipe dismissal or snap points are useful (pass `snapPoints`, `snapPoint`/`onSnapPointChange`, or `defaultSnapPoint` directly on `Dialog`)",
|
|
10
10
|
"Drill-down sheet flows (for example settings sub-pages) by nesting a `Dialog` inside `Dialog.Sheet` children",
|
|
11
|
-
"App-shell indent effects by wrapping page content in `Dialog.Provider`, `Dialog.IndentBackground`, and `Dialog.Indent`"
|
|
11
|
+
"App-shell indent effects by wrapping page content in `Dialog.Provider`, `Dialog.IndentBackground`, and `Dialog.Indent`",
|
|
12
|
+
"Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on the portal-owning public part"
|
|
12
13
|
],
|
|
13
14
|
"whenNotToUse": [
|
|
14
15
|
"Small anchored hints or quick actions that should use Popover or Menu",
|
|
@@ -31,6 +32,9 @@
|
|
|
31
32
|
"Sheet.children": {
|
|
32
33
|
"description": "Optional body content rendered below the description."
|
|
33
34
|
},
|
|
35
|
+
"Sheet.container": {
|
|
36
|
+
"description": "Portal mount node (iframe body, shadow root, or app overlay root). Omit for Base UI default (`document.body` from the module window — iframe hosts must pass the iframe document body explicitly)."
|
|
37
|
+
},
|
|
34
38
|
"Sheet.description": {
|
|
35
39
|
"description": "Supporting copy announced with the title."
|
|
36
40
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MenuPositioner } from '@base-ui/react/menu';
|
|
1
|
+
import { Menu as PrimitiveMenu, MenuPositioner } from '@base-ui/react/menu';
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
type MenuPopupPositionerProps = Omit<MenuPositioner.Props, 'className' | 'style' | 'render'>;
|
|
4
4
|
/**
|
|
@@ -13,6 +13,14 @@ type MenuPopupPositionerProps = Omit<MenuPositioner.Props, 'className' | 'style'
|
|
|
13
13
|
*/
|
|
14
14
|
export type MenuPopupProps = MenuPopupPositionerProps & {
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Portal mount node (iframe body, shadow root, or app overlay root).
|
|
18
|
+
* Omit for Base UI default (`document.body` from the module window —
|
|
19
|
+
* iframe hosts must pass the iframe document body explicitly).
|
|
20
|
+
*
|
|
21
|
+
* @default Base UI FloatingPortal resolution
|
|
22
|
+
*/
|
|
23
|
+
container?: React.ComponentProps<typeof PrimitiveMenu.Portal>['container'];
|
|
16
24
|
};
|
|
17
25
|
export declare const MenuPopup: React.FC<MenuPopupProps>;
|
|
18
26
|
export {};
|
|
@@ -4,25 +4,28 @@ import menu_module_default from "./menu.module.js";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Menu } from "@base-ui/react/menu";
|
|
6
6
|
//#region src/components/menu/menu-popup.tsx
|
|
7
|
-
var MenuPopup = ({ children, sideOffset = 2, ...positionerProps }) => /* @__PURE__ */ jsx(Menu.Portal, {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
children: /* @__PURE__ */ jsx(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
var MenuPopup = ({ children, sideOffset = 2, container, ...positionerProps }) => /* @__PURE__ */ jsx(Menu.Portal, {
|
|
8
|
+
container,
|
|
9
|
+
children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
10
|
+
sideOffset,
|
|
11
|
+
...positionerProps,
|
|
12
|
+
children: /* @__PURE__ */ jsx(Elevator, {
|
|
13
|
+
resting: 1,
|
|
14
|
+
children: /* @__PURE__ */ jsx(Menu.Popup, {
|
|
15
|
+
className: menu_module_default.MenuPopup,
|
|
16
|
+
render: /* @__PURE__ */ jsx(Surface, {
|
|
17
|
+
border: "all",
|
|
18
|
+
color: 1,
|
|
19
|
+
"data-vibrant": true,
|
|
20
|
+
hPadding: "x-small",
|
|
21
|
+
overflow: "auto",
|
|
22
|
+
radius: "medium",
|
|
23
|
+
vPadding: "x-small"
|
|
24
|
+
}),
|
|
25
|
+
children
|
|
26
|
+
})
|
|
24
27
|
})
|
|
25
28
|
})
|
|
26
|
-
})
|
|
29
|
+
});
|
|
27
30
|
//#endregion
|
|
28
31
|
export { MenuPopup };
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"Nested command lists with checkbox or radio options that stay open on toggle",
|
|
9
9
|
"Link rows mixed with actions in one menu surface",
|
|
10
10
|
"Detached or multi-trigger menus via `Menu.createHandle`",
|
|
11
|
-
"Account / user widgets: `Menu.Trigger` as a Surface chip (avatar + name + email) opening a Popup with a static profile header plus action items"
|
|
11
|
+
"Account / user widgets: `Menu.Trigger` as a Surface chip (avatar + name + email) opening a Popup with a static profile header plus action items",
|
|
12
|
+
"Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on the portal-owning public part"
|
|
12
13
|
],
|
|
13
14
|
"whenNotToUse": [
|
|
14
15
|
"Page-blocking modal flows (use Dialog)",
|
|
@@ -64,6 +65,9 @@
|
|
|
64
65
|
"LinkItem.sentiment": {
|
|
65
66
|
"description": "Visual sentiment. `destructive` uses highlight-red wash + text."
|
|
66
67
|
},
|
|
68
|
+
"Popup.container": {
|
|
69
|
+
"description": "Portal mount node (iframe body, shadow root, or app overlay root). Omit for Base UI default (`document.body` from the module window — iframe hosts must pass the iframe document body explicitly)."
|
|
70
|
+
},
|
|
67
71
|
"RadioGroup.label": {
|
|
68
72
|
"description": "Optional accessible group label rendered with `Menu.GroupLabel`."
|
|
69
73
|
},
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import { PopoverPositioner } from '@base-ui/react/popover';
|
|
1
|
+
import { Popover as PrimitivePopover, PopoverPositioner } from '@base-ui/react/popover';
|
|
2
2
|
import { StackProps } from '..';
|
|
3
3
|
import type * as React from 'react';
|
|
4
4
|
type PopoverSheetPositionerProps = Omit<PopoverPositioner.Props, 'className' | 'style' | 'render'>;
|
|
5
|
-
type
|
|
5
|
+
type PopoverSheetContainerProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Portal mount node (iframe body, shadow root, or app overlay root).
|
|
8
|
+
* Omit for Base UI default (`document.body` from the module window —
|
|
9
|
+
* iframe hosts must pass the iframe document body explicitly).
|
|
10
|
+
*
|
|
11
|
+
* @default Base UI FloatingPortal resolution
|
|
12
|
+
*/
|
|
13
|
+
container?: React.ComponentProps<typeof PrimitivePopover.Portal>['container'];
|
|
14
|
+
};
|
|
15
|
+
type PopoverSheetStyledProps = PopoverSheetPositionerProps & PopoverSheetContainerProps & {
|
|
6
16
|
/**
|
|
7
17
|
* Whether to skip the built-in Surface, header, and close chrome and render
|
|
8
18
|
* only the positioning/animation shell (Portal + Positioner + Popup + Viewport).
|
|
@@ -33,7 +43,7 @@ type PopoverSheetStyledProps = PopoverSheetPositionerProps & {
|
|
|
33
43
|
*/
|
|
34
44
|
headerAlign?: Extract<StackProps['hAlign'], 'start' | 'center' | 'end'>;
|
|
35
45
|
};
|
|
36
|
-
type PopoverSheetUnstyledProps = PopoverSheetPositionerProps & {
|
|
46
|
+
type PopoverSheetUnstyledProps = PopoverSheetPositionerProps & PopoverSheetContainerProps & {
|
|
37
47
|
/**
|
|
38
48
|
* Renders only the positioning/animation shell; compose `Popover.Title`,
|
|
39
49
|
* `Popover.Description`, and any chrome inside `children`.
|
|
@@ -8,72 +8,75 @@ import { Title } from "../title/title.js";
|
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { Popover } from "@base-ui/react/popover";
|
|
10
10
|
//#region src/components/popover/popover-sheet.tsx
|
|
11
|
-
var PopoverSheet = ({ unstyled, title, description, children, showCloseButton = false, headerAlign = "start", sideOffset = 8, ...positionerProps }) => /* @__PURE__ */ jsx(Popover.Portal, {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
children: /* @__PURE__ */ jsx(Popover.
|
|
18
|
-
className: popover_module_default.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
className: popover_module_default.Popup,
|
|
24
|
-
render: /* @__PURE__ */ jsx(Surface, {
|
|
25
|
-
color: 1,
|
|
26
|
-
border: "all",
|
|
27
|
-
radius: "large",
|
|
28
|
-
"data-vibrant": "",
|
|
29
|
-
render: /* @__PURE__ */ jsx(Stack, {
|
|
30
|
-
rowGap: "medium",
|
|
31
|
-
fillChildren: false
|
|
11
|
+
var PopoverSheet = ({ unstyled, title, description, children, showCloseButton = false, headerAlign = "start", sideOffset = 8, container, ...positionerProps }) => /* @__PURE__ */ jsx(Popover.Portal, {
|
|
12
|
+
container,
|
|
13
|
+
children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
14
|
+
className: popover_module_default.Sheet,
|
|
15
|
+
sideOffset,
|
|
16
|
+
...positionerProps,
|
|
17
|
+
children: unstyled ? /* @__PURE__ */ jsx(Popover.Popup, {
|
|
18
|
+
className: popover_module_default.Popup,
|
|
19
|
+
children: /* @__PURE__ */ jsx(Popover.Viewport, {
|
|
20
|
+
className: popover_module_default.Viewport,
|
|
21
|
+
"data-unstyled": "",
|
|
22
|
+
children
|
|
32
23
|
})
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
}) : /* @__PURE__ */ jsx(Popover.Popup, {
|
|
25
|
+
className: popover_module_default.Popup,
|
|
26
|
+
render: /* @__PURE__ */ jsx(Surface, {
|
|
27
|
+
color: 1,
|
|
28
|
+
border: "all",
|
|
29
|
+
radius: "large",
|
|
30
|
+
"data-vibrant": "",
|
|
31
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
32
|
+
rowGap: "medium",
|
|
33
|
+
fillChildren: false
|
|
34
|
+
})
|
|
41
35
|
}),
|
|
42
|
-
children:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
rowGap: "
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
render: /* @__PURE__ */ jsx(Title, {
|
|
50
|
-
align: headerAlign,
|
|
51
|
-
size: "6",
|
|
52
|
-
lineHeight: "x-small"
|
|
53
|
-
}),
|
|
54
|
-
children: title
|
|
55
|
-
}), description && /* @__PURE__ */ jsx(Popover.Description, {
|
|
56
|
-
render: /* @__PURE__ */ jsx(Text, {
|
|
57
|
-
align: headerAlign,
|
|
58
|
-
tone: "muted",
|
|
59
|
-
render: /* @__PURE__ */ jsx("p", {})
|
|
60
|
-
}),
|
|
61
|
-
children: description
|
|
62
|
-
})]
|
|
63
|
-
}),
|
|
64
|
-
showCloseButton && /* @__PURE__ */ jsx(Popover.Close, {
|
|
65
|
-
className: popover_module_default.CloseButton,
|
|
66
|
-
render: /* @__PURE__ */ jsx(IconButton, {
|
|
67
|
-
"aria-label": "Close popover",
|
|
68
|
-
icon: /* @__PURE__ */ jsx(ChromeXmark, {}),
|
|
69
|
-
size: "small",
|
|
70
|
-
variant: "flat"
|
|
71
|
-
})
|
|
36
|
+
children: /* @__PURE__ */ jsxs(Popover.Viewport, {
|
|
37
|
+
className: popover_module_default.Viewport,
|
|
38
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
39
|
+
rowGap: "medium",
|
|
40
|
+
vPadding: "medium",
|
|
41
|
+
hPadding: "medium",
|
|
42
|
+
fillChildren: false
|
|
72
43
|
}),
|
|
73
|
-
children
|
|
74
|
-
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsxs(Stack, {
|
|
46
|
+
hAlign: headerAlign,
|
|
47
|
+
rowGap: "small",
|
|
48
|
+
vAlign: "start",
|
|
49
|
+
vPadding: [0, children ? "medium" : 0],
|
|
50
|
+
children: [/* @__PURE__ */ jsx(Popover.Title, {
|
|
51
|
+
render: /* @__PURE__ */ jsx(Title, {
|
|
52
|
+
align: headerAlign,
|
|
53
|
+
size: "6",
|
|
54
|
+
lineHeight: "x-small"
|
|
55
|
+
}),
|
|
56
|
+
children: title
|
|
57
|
+
}), description && /* @__PURE__ */ jsx(Popover.Description, {
|
|
58
|
+
render: /* @__PURE__ */ jsx(Text, {
|
|
59
|
+
align: headerAlign,
|
|
60
|
+
tone: "muted",
|
|
61
|
+
render: /* @__PURE__ */ jsx("p", {})
|
|
62
|
+
}),
|
|
63
|
+
children: description
|
|
64
|
+
})]
|
|
65
|
+
}),
|
|
66
|
+
showCloseButton && /* @__PURE__ */ jsx(Popover.Close, {
|
|
67
|
+
className: popover_module_default.CloseButton,
|
|
68
|
+
render: /* @__PURE__ */ jsx(IconButton, {
|
|
69
|
+
"aria-label": "Close popover",
|
|
70
|
+
icon: /* @__PURE__ */ jsx(ChromeXmark, {}),
|
|
71
|
+
size: "small",
|
|
72
|
+
variant: "flat"
|
|
73
|
+
})
|
|
74
|
+
}),
|
|
75
|
+
children
|
|
76
|
+
]
|
|
77
|
+
})
|
|
75
78
|
})
|
|
76
79
|
})
|
|
77
|
-
})
|
|
80
|
+
});
|
|
78
81
|
//#endregion
|
|
79
82
|
export { PopoverSheet };
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"Lightweight forms or confirmations that float beside the trigger without blocking the page",
|
|
9
9
|
"Multi-trigger panels that swap content with direction-aware animations using `Popover.createHandle` and trigger `payload`",
|
|
10
10
|
"Hover-revealed hints via `openOnHover` with `delay` and `closeDelay`",
|
|
11
|
-
"Fully custom popup chrome via `Sheet` `unstyled` composed with `Popover.Title` and `Popover.Description`"
|
|
11
|
+
"Fully custom popup chrome via `Sheet` `unstyled` composed with `Popover.Title` and `Popover.Description`",
|
|
12
|
+
"Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on the portal-owning public part"
|
|
12
13
|
],
|
|
13
14
|
"whenNotToUse": [
|
|
14
15
|
"Modal tasks that must block the page and demand focused attention (use Dialog)",
|
|
@@ -29,6 +30,9 @@
|
|
|
29
30
|
"related": ["Surface", "Button", "IconButton", "Stack", "Dialog", "Tabs"],
|
|
30
31
|
"properties": {
|
|
31
32
|
"react": {
|
|
33
|
+
"Sheet.container": {
|
|
34
|
+
"description": "Portal mount node (iframe body, shadow root, or app overlay root). Omit for Base UI default (`document.body` from the module window — iframe hosts must pass the iframe document body explicitly)."
|
|
35
|
+
},
|
|
32
36
|
"Sheet.description": {
|
|
33
37
|
"description": "Supporting copy announced with the title."
|
|
34
38
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-radio-size{syntax:"<length>";inherits:false;initial-value:0}@property --vui-radio-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-radio-border-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-radio-indicator-color{syntax:"<color>";inherits:true;initial-value:#0000}@property --__radio-size{syntax:"<length>";inherits:false;initial-value:0}@property --__radio-disk-size{syntax:"<length>";inherits:true;initial-value:0}.viraui__radio-module__RadioRoot_3uvvn{--vui-radio-size:var(--space-medium);--vui-radio-background:var(--global-contrast);--vui-radio-indicator-color:contrast-color(var(--global-primary));--__radio-size:round(nearest,var(--vui-radio-size),2px);--__radio-disk-size:round(down,calc(var(--__radio-size) / 2),2px);position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;appearance:none;border:0;box-shadow:inset 0 0 0 1px var(--vui-radio-border-color);inline-size:var(--__radio-size);block-size:var(--__radio-size);background:var(--vui-radio-background);border-radius:100000px;corner-shape:unset;&[data-size=regular]{--vui-radio-size:var(--space-large)}&[data-checked]:not([data-disabled]):not([data-invalid]){--vui-radio-background:var(--global-primary);--vui-radio-border-color:var(--global-primary);box-shadow:none}&[data-invalid]:not([data-disabled]),[data-invalid] &:not([data-disabled]){--vui-radio-border-color:var(--highlight-red);--vui-radio-indicator-color:var(--global-primary);box-shadow:inset 0 0 0 1px var(--highlight-red);outline-color:oklab(from var(--highlight-red) l a b/.5)}&[data-disabled],[data-disabled] &{--vui-radio-background:var(--global-disabled-background);--vui-radio-border-color:#0000;--vui-radio-indicator-color:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}}.viraui__radio-module__Indicator_Ecavw{display:inline-flex;align-items:center;justify-content:center;color:var(--vui-radio-indicator-color)}.viraui__radio-module__Disk_pV-Q1{inline-size:var(--__radio-disk-size);block-size:var(--__radio-disk-size);border-radius:100000px;corner-shape:unset;background:currentColor}.viraui__radio-module__RadioRoot_3uvvn:not([data-checked]) .viraui__radio-module__Disk_pV-Q1{display:none}}
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-radio-size{syntax:"<length>";inherits:false;initial-value:0}@property --vui-radio-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-radio-border-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-radio-indicator-color{syntax:"<color>";inherits:true;initial-value:#0000}@property --__radio-size{syntax:"<length>";inherits:false;initial-value:0}@property --__radio-disk-size{syntax:"<length>";inherits:true;initial-value:0}.viraui__radio-module__Radio_54m33{max-block-size:min-content}.viraui__radio-module__RadioRoot_3uvvn{--vui-radio-size:var(--space-medium);--vui-radio-background:var(--global-contrast);--vui-radio-indicator-color:contrast-color(var(--global-primary));--__radio-size:round(nearest,var(--vui-radio-size),2px);--__radio-disk-size:round(down,calc(var(--__radio-size) / 2),2px);position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;appearance:none;border:0;box-shadow:inset 0 0 0 1px var(--vui-radio-border-color);inline-size:var(--__radio-size);block-size:var(--__radio-size);background:var(--vui-radio-background);border-radius:100000px;corner-shape:unset;&[data-size=regular]{--vui-radio-size:var(--space-large)}&[data-checked]:not([data-disabled]):not([data-invalid]){--vui-radio-background:var(--global-primary);--vui-radio-border-color:var(--global-primary);box-shadow:none}&[data-invalid]:not([data-disabled]),[data-invalid] &:not([data-disabled]){--vui-radio-border-color:var(--highlight-red);--vui-radio-indicator-color:var(--global-primary);box-shadow:inset 0 0 0 1px var(--highlight-red);outline-color:oklab(from var(--highlight-red) l a b/.5)}&[data-disabled],[data-disabled] &{--vui-radio-background:var(--global-disabled-background);--vui-radio-border-color:#0000;--vui-radio-indicator-color:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}}.viraui__radio-module__Indicator_Ecavw{display:inline-flex;align-items:center;justify-content:center;color:var(--vui-radio-indicator-color)}.viraui__radio-module__Disk_pV-Q1{inline-size:var(--__radio-disk-size);block-size:var(--__radio-disk-size);border-radius:100000px;corner-shape:unset;background:currentColor}.viraui__radio-module__RadioRoot_3uvvn:not([data-checked]) .viraui__radio-module__Disk_pV-Q1{display:none}}
|
|
@@ -10,35 +10,38 @@ import { Radio } from "@base-ui/react/radio";
|
|
|
10
10
|
//#region src/components/radio/radio.tsx
|
|
11
11
|
var Radio$1 = ({ className, description, disabled, id, label, ref, size = "small", vPadding, hPadding, value, ...radioRootProps }) => {
|
|
12
12
|
const hasTextDescription = Boolean(description);
|
|
13
|
-
return /* @__PURE__ */ jsx(Field.Item, {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
hPadding,
|
|
19
|
-
vPadding,
|
|
20
|
-
children: [/* @__PURE__ */ jsx(Radio.Root, {
|
|
21
|
-
...radioRootProps,
|
|
22
|
-
className: clsx(radio_module_default.RadioRoot, className),
|
|
23
|
-
"data-size": size,
|
|
24
|
-
disabled,
|
|
25
|
-
id,
|
|
26
|
-
ref,
|
|
27
|
-
value,
|
|
28
|
-
children: /* @__PURE__ */ jsx(Radio.Indicator, {
|
|
29
|
-
className: radio_module_default.Indicator,
|
|
30
|
-
children: /* @__PURE__ */ jsx("span", { className: radio_module_default.Disk })
|
|
31
|
-
})
|
|
32
|
-
}), label || description ? /* @__PURE__ */ jsxs(Stack, {
|
|
33
|
-
direction: "column",
|
|
13
|
+
return /* @__PURE__ */ jsx(Field.Item, {
|
|
14
|
+
className: radio_module_default.Radio,
|
|
15
|
+
children: /* @__PURE__ */ jsx(Field.Label, { children: /* @__PURE__ */ jsxs(Stack, {
|
|
16
|
+
direction: "row",
|
|
17
|
+
columnGap: size === "small" ? "small" : "medium",
|
|
34
18
|
fillChildren: false,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
19
|
+
vAlign: hasTextDescription ? "start" : "center",
|
|
20
|
+
hPadding,
|
|
21
|
+
vPadding,
|
|
22
|
+
children: [/* @__PURE__ */ jsx(Radio.Root, {
|
|
23
|
+
...radioRootProps,
|
|
24
|
+
className: clsx(radio_module_default.RadioRoot, className),
|
|
25
|
+
"data-size": size,
|
|
26
|
+
disabled,
|
|
27
|
+
id,
|
|
28
|
+
ref,
|
|
29
|
+
value,
|
|
30
|
+
children: /* @__PURE__ */ jsx(Radio.Indicator, {
|
|
31
|
+
className: radio_module_default.Indicator,
|
|
32
|
+
children: /* @__PURE__ */ jsx("span", { className: radio_module_default.Disk })
|
|
33
|
+
})
|
|
34
|
+
}), label || description ? /* @__PURE__ */ jsxs(Stack, {
|
|
35
|
+
direction: "column",
|
|
36
|
+
fillChildren: false,
|
|
37
|
+
rowGap: "small",
|
|
38
|
+
children: [label && /* @__PURE__ */ jsx(FieldLabel, {
|
|
39
|
+
size: size === "small" ? "small" : "medium",
|
|
40
|
+
children: label
|
|
41
|
+
}), /* @__PURE__ */ jsx(FieldHelperCopy, { description })]
|
|
42
|
+
}) : null]
|
|
43
|
+
}) })
|
|
44
|
+
});
|
|
42
45
|
};
|
|
43
46
|
//#endregion
|
|
44
47
|
export { Radio$1 as Radio };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
//#region src/components/radio/radio.module.css
|
|
2
|
+
var Radio = "viraui__radio-module__Radio_54m33";
|
|
2
3
|
var RadioRoot = "viraui__radio-module__RadioRoot_3uvvn";
|
|
3
4
|
var Indicator = "viraui__radio-module__Indicator_Ecavw";
|
|
4
5
|
var Disk = "viraui__radio-module__Disk_pV-Q1";
|
|
5
6
|
var radio_module_default = {
|
|
7
|
+
Radio,
|
|
6
8
|
RadioRoot,
|
|
7
9
|
Indicator,
|
|
8
10
|
Disk
|
|
9
11
|
};
|
|
10
12
|
//#endregion
|
|
11
|
-
export { Disk, Indicator, RadioRoot, radio_module_default as default };
|
|
13
|
+
export { Disk, Indicator, Radio, RadioRoot, radio_module_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-select-input-height{syntax:"<length>";inherits:true;initial-value:0}@property --vui-select-control-group-background{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-select-control-group-color{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-select-control-group-border-color{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-select-control-group-border-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}@property --vui-select-trigger-padding-inline-start{syntax:"<length>";inherits:true;initial-value:0}@property --vui-select-trigger-padding-inline-end{syntax:"<length>";inherits:true;initial-value:0}@property --vui-select-list-border-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}@property --vui-select-list-padding{syntax:"<length>";inherits:true;initial-value:0}@property --__select-list-appear-offset{syntax:"<length>";inherits:false;initial-value:8px}.viraui__select-module__Select_eXv4Y{--vui-select-input-height:var(--space-2x-large);--vui-select-control-group-background:var(--base-1);--vui-select-control-group-color:var(--global-foreground);--vui-select-control-group-border-color:var(--global-contrast);--vui-select-control-group-border-radius:var(--radius-medium);--vui-select-trigger-padding-inline-start:calc(var(--space-small) + var(--space-x-small));--vui-select-trigger-padding-inline-end:var(--space-x-small);--vui-field-label-padding-inline:calc((var(--vui-select-control-group-border-radius) + 0px) / 2);z-index:0;&:has([required]) .viraui__select-module__Label_-Y1fR{&:after{content:" *";color:var(--highlight-red)}&:dir(rtl){&:after{content:none}&:before{content:"* ";color:var(--highlight-red)}}}&[data-invalid]>.viraui__select-module__Trigger_-wBsg:not(:disabled):not([data-disabled]){--vui-select-control-group-border-color:var(--highlight-red);box-shadow:none;outline-color:oklab(from var(--highlight-red) l a b/.5)}}.viraui__select-module__Trigger_-wBsg{box-sizing:border-box;inline-size:100%;min-inline-size:0;block-size:var(--vui-select-input-height);padding-inline:var(--vui-select-trigger-padding-inline-start) var(--vui-select-trigger-padding-inline-end);border:1px solid var(--vui-select-control-group-border-color);border-radius:var(--vui-select-control-group-border-radius);background:var(--vui-select-control-group-background);color:var(--vui-select-control-group-color);font:inherit;text-align:start;cursor:pointer;&[data-popup-open]{outline:none}&:disabled,&[data-disabled]{--vui-select-control-group-background:var(--global-disabled-background);--vui-select-control-group-border-color:#0000;--vui-select-control-group-color:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}}.viraui__select-module__Icon_EOwki{font-size:var(--font-scale-body-small);pointer-events:none}.viraui__select-module__Description_OmwmV{padding-inline:calc((var(--vui-select-control-group-border-radius) + 0px) / 2)}.viraui__select-module__SelectPopup_UzGXL{--vui-select-list-border-radius:var(--radius-medium);--vui-select-list-padding:var(--space-x-small);box-sizing:border-box;min-inline-size:var(--anchor-width);overflow:visible;color:var(--global-foreground);outline:none;position:relative;transform-origin:var(--transform-origin);transition:opacity var(--duration-instant) var(--easing-entrance),scale var(--duration-instant) var(--easing-entrance),translate var(--duration-instant) var(--easing-entrance);&[data-ending-style],&[data-starting-style]{opacity:0;scale:.96}&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{translate:0 calc(var(--__select-list-appear-offset) * -1)}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{translate:0 var(--__select-list-appear-offset)}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style],&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{translate:var(--__select-list-appear-offset) 0}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style],&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{translate:calc(var(--__select-list-appear-offset) * -1) 0}&[data-side=none]{transition:none;scale:1;translate:0;opacity:1}}.viraui__select-module__ScrollArrow_kHlEi{position:absolute;inset-inline:0;z-index:1;inline-size:100%;block-size:var(--space-large);cursor:default;background:var(--base-1);border:1px solid var(--global-contrast);@container root not style(--effect-vibrancy: initial){background:oklab(from var(--base-1) l a b/80%);backdrop-filter:brightness(var(--vibrancy-brightness)) blur(calc(var(--vibrancy-blur) * 1px))}}.viraui__select-module__ScrollButton_sHBOa{pointer-events:none}.viraui__select-module__ScrollArrowUp_DGXS-{inset-block-start:0;border-radius:var(--vui-select-list-border-radius) var(--vui-select-list-border-radius) 0 0}.viraui__select-module__ScrollArrowDown_vhJy0{inset-block-end:0;border-radius:0 0 var(--vui-select-list-border-radius) var(--vui-select-list-border-radius)}.viraui__select-module__List_jdUWx{box-sizing:border-box;inline-size:100%;max-block-size:var(--available-height);scroll-padding-block:var(--vui-select-list-padding);overscroll-behavior:contain;&:focus,&:focus-visible{outline:none}}.viraui__select-module__Indicator_YNUuz{min-inline-size:var(--space-medium);min-block-size:var(--space-medium);inline-size:fit-content;block-size:fit-content;color:var(--global-primary);opacity:0;transition:opacity var(--duration-fast) var(--easing-standard),transform var(--duration-fast) var(--easing-standard);&[data-selected]{opacity:1}}}@layer viraui.overrides{.viraui__select-module__Value_uWHPX{flex:1 1 auto;min-inline-size:0;overflow:hidden;display:block;text-overflow:ellipsis;&[data-placeholder]{color:var(--global-disabled-foreground)}}.viraui__select-module__Option_KgYqz{cursor:pointer;&:focus{outline:none}&:focus-visible{outline:none;box-shadow:none}&:not([data-disabled]):hover,&:not([data-disabled])[data-highlighted]{background:var(--global-contrast);@container root not style(--effect-vibrancy: initial){background:oklab(from var(--global-contrast) l a b/12%)}}&:not([data-disabled],:hover)[data-selected]{background:light-dark(oklab(from var(--global-contrast) l a b/8%),oklab(from var(--global-contrast) l a b/5%))}&[data-disabled]{color:var(--global-disabled-foreground);cursor:not-allowed}}}
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-select-input-height{syntax:"<length>";inherits:true;initial-value:0}@property --vui-select-control-group-background{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-select-control-group-color{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-select-control-group-border-color{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-select-control-group-border-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}@property --vui-select-trigger-padding-inline-start{syntax:"<length>";inherits:true;initial-value:0}@property --vui-select-trigger-padding-inline-end{syntax:"<length>";inherits:true;initial-value:0}@property --vui-select-list-border-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}@property --vui-select-list-padding{syntax:"<length>";inherits:true;initial-value:0}@property --__select-list-appear-offset{syntax:"<length>";inherits:false;initial-value:8px}.viraui__select-module__Select_eXv4Y{--vui-select-input-height:var(--space-2x-large);--vui-select-control-group-background:var(--base-1);--vui-select-control-group-color:var(--global-foreground);--vui-select-control-group-border-color:var(--global-contrast);--vui-select-control-group-border-radius:var(--radius-medium);--vui-select-trigger-padding-inline-start:calc(var(--space-small) + var(--space-x-small));--vui-select-trigger-padding-inline-end:var(--space-x-small);--vui-field-label-padding-inline:calc((var(--vui-select-control-group-border-radius) + 0px) / 2);max-block-size:min-content;z-index:0;&:has([required]) .viraui__select-module__Label_-Y1fR{&:after{content:" *";color:var(--highlight-red)}&:dir(rtl){&:after{content:none}&:before{content:"* ";color:var(--highlight-red)}}}&[data-invalid]>.viraui__select-module__Trigger_-wBsg:not(:disabled):not([data-disabled]){--vui-select-control-group-border-color:var(--highlight-red);box-shadow:none;outline-color:oklab(from var(--highlight-red) l a b/.5)}}.viraui__select-module__Trigger_-wBsg{box-sizing:border-box;inline-size:100%;min-inline-size:0;block-size:var(--vui-select-input-height);padding-inline:var(--vui-select-trigger-padding-inline-start) var(--vui-select-trigger-padding-inline-end);border:1px solid var(--vui-select-control-group-border-color);border-radius:var(--vui-select-control-group-border-radius);background:var(--vui-select-control-group-background);color:var(--vui-select-control-group-color);font:inherit;text-align:start;cursor:pointer;&[data-popup-open]{outline:none}&:disabled,&[data-disabled]{--vui-select-control-group-background:var(--global-disabled-background);--vui-select-control-group-border-color:#0000;--vui-select-control-group-color:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}}.viraui__select-module__Icon_EOwki{font-size:var(--font-scale-body-small);pointer-events:none}.viraui__select-module__Description_OmwmV{padding-inline:calc((var(--vui-select-control-group-border-radius) + 0px) / 2)}.viraui__select-module__SelectPopup_UzGXL{--vui-select-list-border-radius:var(--radius-medium);--vui-select-list-padding:var(--space-x-small);box-sizing:border-box;min-inline-size:var(--anchor-width);overflow:visible;color:var(--global-foreground);outline:none;position:relative;transform-origin:var(--transform-origin);transition:opacity var(--duration-instant) var(--easing-entrance),scale var(--duration-instant) var(--easing-entrance),translate var(--duration-instant) var(--easing-entrance);&[data-ending-style],&[data-starting-style]{opacity:0;scale:.96}&[data-side=bottom][data-ending-style],&[data-side=bottom][data-starting-style]{translate:0 calc(var(--__select-list-appear-offset) * -1)}&[data-side=top][data-ending-style],&[data-side=top][data-starting-style]{translate:0 var(--__select-list-appear-offset)}&[data-side=inline-start][data-ending-style],&[data-side=inline-start][data-starting-style],&[data-side=left][data-ending-style],&[data-side=left][data-starting-style]{translate:var(--__select-list-appear-offset) 0}&[data-side=inline-end][data-ending-style],&[data-side=inline-end][data-starting-style],&[data-side=right][data-ending-style],&[data-side=right][data-starting-style]{translate:calc(var(--__select-list-appear-offset) * -1) 0}&[data-side=none]{transition:none;scale:1;translate:0;opacity:1}}.viraui__select-module__ScrollArrow_kHlEi{position:absolute;inset-inline:0;z-index:1;inline-size:100%;block-size:var(--space-large);cursor:default;background:var(--base-1);border:1px solid var(--global-contrast);@container root not style(--effect-vibrancy: initial){background:oklab(from var(--base-1) l a b/80%);backdrop-filter:brightness(var(--vibrancy-brightness)) blur(calc(var(--vibrancy-blur) * 1px))}}.viraui__select-module__ScrollButton_sHBOa{pointer-events:none}.viraui__select-module__ScrollArrowUp_DGXS-{inset-block-start:0;border-radius:var(--vui-select-list-border-radius) var(--vui-select-list-border-radius) 0 0}.viraui__select-module__ScrollArrowDown_vhJy0{inset-block-end:0;border-radius:0 0 var(--vui-select-list-border-radius) var(--vui-select-list-border-radius)}.viraui__select-module__List_jdUWx{box-sizing:border-box;inline-size:100%;max-block-size:var(--available-height);scroll-padding-block:var(--vui-select-list-padding);overscroll-behavior:contain;&:focus,&:focus-visible{outline:none}}.viraui__select-module__Indicator_YNUuz{min-inline-size:var(--space-medium);min-block-size:var(--space-medium);inline-size:fit-content;block-size:fit-content;color:var(--global-primary);opacity:0;transition:opacity var(--duration-fast) var(--easing-standard),transform var(--duration-fast) var(--easing-standard);&[data-selected]{opacity:1}}}@layer viraui.overrides{.viraui__select-module__Value_uWHPX{flex:1 1 auto;min-inline-size:0;overflow:hidden;display:block;text-overflow:ellipsis;&[data-placeholder]{color:var(--global-disabled-foreground)}}.viraui__select-module__Option_KgYqz{cursor:pointer;&:focus{outline:none}&:focus-visible{outline:none;box-shadow:none}&:not([data-disabled]):hover,&:not([data-disabled])[data-highlighted]{background:var(--global-contrast);@container root not style(--effect-vibrancy: initial){background:oklab(from var(--global-contrast) l a b/12%)}}&:not([data-disabled],:hover)[data-selected]{background:light-dark(oklab(from var(--global-contrast) l a b/8%),oklab(from var(--global-contrast) l a b/5%))}&[data-disabled]{color:var(--global-disabled-foreground);cursor:not-allowed}}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldRoot } from '@base-ui/react/field';
|
|
2
|
-
import { SelectRoot } from '@base-ui/react/select';
|
|
2
|
+
import { SelectRoot, Select as PrimitiveSelect } from '@base-ui/react/select';
|
|
3
3
|
import { SelectGroup } from './select-group';
|
|
4
4
|
import { SelectOption } from './select-option';
|
|
5
5
|
import { SelectSeparator } from './select-separator';
|
|
@@ -59,8 +59,16 @@ export type SelectProps = SelectRoot.Props<string> & Omit<FieldRoot.Props, 'ref'
|
|
|
59
59
|
* @default true
|
|
60
60
|
*/
|
|
61
61
|
alignListWithTrigger?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Portal mount node (iframe body, shadow root, or app overlay root).
|
|
64
|
+
* Omit for Base UI default (`document.body` from the module window —
|
|
65
|
+
* iframe hosts must pass the iframe document body explicitly).
|
|
66
|
+
*
|
|
67
|
+
* @default Base UI FloatingPortal resolution
|
|
68
|
+
*/
|
|
69
|
+
container?: React.ComponentProps<typeof PrimitiveSelect.Portal>['container'];
|
|
62
70
|
};
|
|
63
|
-
declare function SelectRootComponent({ alignListWithTrigger, children, className, description, dirty, disabled, error, addon, invalid, label, name, placeholder, ref, touched, validate, validationDebounceTime, validationMode, ...selectRootProps }: SelectProps): React.JSX.Element;
|
|
71
|
+
declare function SelectRootComponent({ alignListWithTrigger, children, className, container, description, dirty, disabled, error, addon, invalid, label, name, placeholder, ref, touched, validate, validationDebounceTime, validationMode, ...selectRootProps }: SelectProps): React.JSX.Element;
|
|
64
72
|
export declare const Select: typeof SelectRootComponent & {
|
|
65
73
|
Option: typeof SelectOption;
|
|
66
74
|
Group: typeof SelectGroup;
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"Grouped or separated option lists",
|
|
9
9
|
"Rich option rows with a leading decorative addon and multi-line label content",
|
|
10
10
|
"Trigger chrome aligned with Textfield control shell",
|
|
11
|
-
"Select fields inside Fieldset when they share a section legend with other inputs"
|
|
11
|
+
"Select fields inside Fieldset when they share a section legend with other inputs",
|
|
12
|
+
"Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on the portal-owning public part"
|
|
12
13
|
],
|
|
13
14
|
"whenNotToUse": [
|
|
14
15
|
"Multiple selection",
|
|
@@ -37,6 +38,9 @@
|
|
|
37
38
|
"alignListWithTrigger": {
|
|
38
39
|
"description": "When `true`, aligns the list popup width with the trigger via Base UI `alignItemWithTrigger`. Prefer `false` when options use a leading `addon`."
|
|
39
40
|
},
|
|
41
|
+
"container": {
|
|
42
|
+
"description": "Portal mount node (iframe body, shadow root, or app overlay root). Omit for Base UI default (`document.body` from the module window — iframe hosts must pass the iframe document body explicitly)."
|
|
43
|
+
},
|
|
40
44
|
"description": {
|
|
41
45
|
"description": "Helper copy rendered with `Field.Description` and `Text` while the field is valid."
|
|
42
46
|
},
|
|
@@ -18,7 +18,7 @@ import { Field } from "@base-ui/react/field";
|
|
|
18
18
|
import { useId } from "react";
|
|
19
19
|
import { Select } from "@base-ui/react/select";
|
|
20
20
|
//#region src/components/select/select.tsx
|
|
21
|
-
function SelectRootComponent({ alignListWithTrigger = true, children, className, description, dirty, disabled, error, addon = /* @__PURE__ */ jsx(ChromeChevronExpandY, { size: 16 }), invalid, label, name, placeholder, ref, touched, validate, validationDebounceTime, validationMode, ...selectRootProps }) {
|
|
21
|
+
function SelectRootComponent({ alignListWithTrigger = true, children, className, container, description, dirty, disabled, error, addon = /* @__PURE__ */ jsx(ChromeChevronExpandY, { size: 16 }), invalid, label, name, placeholder, ref, touched, validate, validationDebounceTime, validationMode, ...selectRootProps }) {
|
|
22
22
|
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...restSelectProps } = selectRootProps;
|
|
23
23
|
const fieldLabelId = useId();
|
|
24
24
|
const listAccessibleNameProps = {};
|
|
@@ -80,66 +80,69 @@ function SelectRootComponent({ alignListWithTrigger = true, children, className,
|
|
|
80
80
|
}),
|
|
81
81
|
children: addon
|
|
82
82
|
})]
|
|
83
|
-
}), /* @__PURE__ */ jsx(Select.Portal, {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
children:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"aria-label": "Scroll list up",
|
|
99
|
-
className: select_module_default.ScrollButton,
|
|
100
|
-
icon: /* @__PURE__ */ jsx(ChromeChevronUp, {}),
|
|
101
|
-
size: "small",
|
|
102
|
-
tabIndex: -1,
|
|
103
|
-
variant: "flat"
|
|
104
|
-
})
|
|
105
|
-
}),
|
|
106
|
-
/* @__PURE__ */ jsx(Elevator, {
|
|
107
|
-
resting: 1,
|
|
108
|
-
children: /* @__PURE__ */ jsx(Select.List, {
|
|
109
|
-
...listAccessibleNameProps,
|
|
110
|
-
className: select_module_default.List,
|
|
111
|
-
render: /* @__PURE__ */ jsx(Surface, {
|
|
112
|
-
border: "all",
|
|
113
|
-
color: 1,
|
|
114
|
-
hPadding: "x-small",
|
|
115
|
-
overflow: "auto",
|
|
116
|
-
radius: "medium",
|
|
117
|
-
vPadding: "x-small",
|
|
118
|
-
"data-vibrant": ""
|
|
83
|
+
}), /* @__PURE__ */ jsx(Select.Portal, {
|
|
84
|
+
container,
|
|
85
|
+
children: /* @__PURE__ */ jsx(Select.Positioner, {
|
|
86
|
+
alignItemWithTrigger: alignListWithTrigger,
|
|
87
|
+
sideOffset: 2,
|
|
88
|
+
children: /* @__PURE__ */ jsxs(Select.Popup, {
|
|
89
|
+
className: select_module_default.SelectPopup,
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx(Select.ScrollUpArrow, {
|
|
92
|
+
className: clsx(select_module_default.ScrollArrow, select_module_default.ScrollArrowUp),
|
|
93
|
+
"data-vibrant": "",
|
|
94
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
95
|
+
fillChildren: false,
|
|
96
|
+
hAlign: "center",
|
|
97
|
+
vAlign: "center"
|
|
119
98
|
}),
|
|
120
|
-
children
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
hAlign: "center",
|
|
129
|
-
vAlign: "center"
|
|
99
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
100
|
+
"aria-label": "Scroll list up",
|
|
101
|
+
className: select_module_default.ScrollButton,
|
|
102
|
+
icon: /* @__PURE__ */ jsx(ChromeChevronUp, {}),
|
|
103
|
+
size: "small",
|
|
104
|
+
tabIndex: -1,
|
|
105
|
+
variant: "flat"
|
|
106
|
+
})
|
|
130
107
|
}),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
108
|
+
/* @__PURE__ */ jsx(Elevator, {
|
|
109
|
+
resting: 1,
|
|
110
|
+
children: /* @__PURE__ */ jsx(Select.List, {
|
|
111
|
+
...listAccessibleNameProps,
|
|
112
|
+
className: select_module_default.List,
|
|
113
|
+
render: /* @__PURE__ */ jsx(Surface, {
|
|
114
|
+
border: "all",
|
|
115
|
+
color: 1,
|
|
116
|
+
hPadding: "x-small",
|
|
117
|
+
overflow: "auto",
|
|
118
|
+
radius: "medium",
|
|
119
|
+
vPadding: "x-small",
|
|
120
|
+
"data-vibrant": ""
|
|
121
|
+
}),
|
|
122
|
+
children
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ jsx(Select.ScrollDownArrow, {
|
|
126
|
+
className: clsx(select_module_default.ScrollArrow, select_module_default.ScrollArrowDown),
|
|
127
|
+
"data-vibrant": "",
|
|
128
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
129
|
+
fillChildren: false,
|
|
130
|
+
hAlign: "center",
|
|
131
|
+
vAlign: "center"
|
|
132
|
+
}),
|
|
133
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
134
|
+
"aria-label": "Scroll list down",
|
|
135
|
+
className: select_module_default.ScrollButton,
|
|
136
|
+
icon: /* @__PURE__ */ jsx(ChromeChevronDown, {}),
|
|
137
|
+
size: "small",
|
|
138
|
+
tabIndex: -1,
|
|
139
|
+
variant: "flat"
|
|
140
|
+
})
|
|
138
141
|
})
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
]
|
|
143
|
+
})
|
|
141
144
|
})
|
|
142
|
-
})
|
|
145
|
+
})]
|
|
143
146
|
}),
|
|
144
147
|
/* @__PURE__ */ jsx(FieldHelperCopy, {
|
|
145
148
|
className: select_module_default.Description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-slider-track-size{syntax:"<length>";inherits:true;initial-value:0}@property --vui-slider-thumb-size{syntax:"<length>";inherits:true;initial-value:0}@property --vui-slider-track-background{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-slider-progress-background{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-slider-thumb-background{syntax:"<color>";inherits:true;initial-value:#0000}.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-foreground);--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}}}
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-slider-track-size{syntax:"<length>";inherits:true;initial-value:0}@property --vui-slider-thumb-size{syntax:"<length>";inherits:true;initial-value:0}@property --vui-slider-track-background{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-slider-progress-background{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-slider-thumb-background{syntax:"<color>";inherits:true;initial-value:#0000}.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-foreground);--vui-slider-thumb-background:var(--base-2);inline-size:100%;block-size:100%;max-block-size:min-content;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}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-switch-track-block-size{syntax:"<length>";inherits:false;initial-value:0}@property --vui-switch-track-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}@property --vui-switch-track-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-switch-thumb-background{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-switch-thumb-size{syntax:"<length>";inherits:true;initial-value:0}@property --vui-switch-thumb-inset{syntax:"<length>";inherits:true;initial-value:0}@property --__switch-track-block-size{syntax:"<length>";inherits:false;initial-value:0}@property --__switch-thumb-size{syntax:"<length>";inherits:true;initial-value:0}@property --__switch-thumb-inset{syntax:"<length>";inherits:true;initial-value:0}@property --__switch-thumb-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}.viraui__switch-module__Switch_L86y7{
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-switch-track-block-size{syntax:"<length>";inherits:false;initial-value:0}@property --vui-switch-track-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}@property --vui-switch-track-background{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-switch-thumb-background{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-switch-thumb-size{syntax:"<length>";inherits:true;initial-value:0}@property --vui-switch-thumb-inset{syntax:"<length>";inherits:true;initial-value:0}@property --__switch-track-block-size{syntax:"<length>";inherits:false;initial-value:0}@property --__switch-thumb-size{syntax:"<length>";inherits:true;initial-value:0}@property --__switch-thumb-inset{syntax:"<length>";inherits:true;initial-value:0}@property --__switch-thumb-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}.viraui__switch-module__Switch_L86y7{max-block-size:min-content;&:has([required]) .viraui__switch-module__Label_9R-rv:after{content:" *";color:var(--highlight-red)}}.viraui__switch-module__SwitchRoot_Zv9An{--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);--__switch-thumb-inset:round(nearest,var(--vui-switch-thumb-inset),1px);--__switch-thumb-size:round(nearest,var(--vui-switch-thumb-size),2px);--__switch-track-block-size:calc(var(--__switch-thumb-size) + 2 * var(--__switch-thumb-inset));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(--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]){box-shadow:inset 0 0 0 1px var(--highlight-red);outline-color:oklab(from var(--highlight-red) l a b/.5)}&[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(--__switch-thumb-inset));position:absolute;inset-block:var(--__switch-thumb-inset);inset-inline-start:var(--__switch-thumb-inset);background:var(--vui-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);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}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-textarea-min-block-size{syntax:"<length>";inherits:true;initial-value:0}@property --vui-textarea-padding-block{syntax:"<length>";inherits:true;initial-value:0}@property --vui-textarea-input-border-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}.viraui__textarea-module__Textarea_mtOUG{--vui-textarea-min-block-size:calc(var(--space-x-large) * 2);--vui-textarea-padding-block:var(--space-small);--vui-textarea-input-border-radius:var(--radius-small);--vui-field-label-padding-inline:calc(var(--vui-textarea-input-border-radius) / 2);inline-size:100%;&:has([required]) .viraui__textarea-module__Label_5dOso:after{content:" *";color:var(--highlight-red)}}.viraui__textarea-module__Description_er3zI{padding-inline:var(--vui-field-label-padding-inline)}}@layer viraui.overrides{.viraui__textarea-module__CustomBasicInput_Ce7yA{--vui-basic-input-border-radius:var(--vui-textarea-input-border-radius);border:1px solid var(--global-contrast);min-block-size:var(--vui-textarea-min-block-size);padding-block:var(--vui-textarea-padding-block);line-height:1.4;resize:none;&[data-resize=vertical]{resize:vertical}&[data-resize=horizontal]{resize:horizontal}&[data-resize=both]{resize:both}&[data-resize=block]{resize:block}&[data-resize=inline]{resize:inline}&[data-invalid]{border-color:var(--highlight-red)}&:disabled,&[data-disabled]{border-color:#0000}}}
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-textarea-min-block-size{syntax:"<length>";inherits:true;initial-value:0}@property --vui-textarea-padding-block{syntax:"<length>";inherits:true;initial-value:0}@property --vui-textarea-input-border-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}.viraui__textarea-module__Textarea_mtOUG{--vui-textarea-min-block-size:calc(var(--space-x-large) * 2);--vui-textarea-padding-block:var(--space-small);--vui-textarea-input-border-radius:var(--radius-small);--vui-field-label-padding-inline:calc(var(--vui-textarea-input-border-radius) / 2);inline-size:100%;&:not(:has([data-sizing=content])){max-block-size:min-content}&:has([required]) .viraui__textarea-module__Label_5dOso:after{content:" *";color:var(--highlight-red)}}.viraui__textarea-module__Description_er3zI{padding-inline:var(--vui-field-label-padding-inline)}}@layer viraui.overrides{.viraui__textarea-module__CustomBasicInput_Ce7yA{--vui-basic-input-border-radius:var(--vui-textarea-input-border-radius);border:1px solid var(--global-contrast);min-block-size:var(--vui-textarea-min-block-size);padding-block:var(--vui-textarea-padding-block);line-height:1.4;resize:none;&[data-resize=vertical]{resize:vertical}&[data-resize=horizontal]{resize:horizontal}&[data-resize=both]{resize:both}&[data-resize=block]{resize:block}&[data-resize=inline]{resize:inline}&[data-invalid]{border-color:var(--highlight-red)}&:disabled,&[data-disabled]{border-color:#0000}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-textfield-input-height{syntax:"<length>";inherits:true;initial-value:0}@property --vui-textfield-control-group-background{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-textfield-control-group-color{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-textfield-control-group-border-color{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-textfield-control-group-border-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}.viraui__textfield-module__Textfield_o-70A{--vui-textfield-input-height:var(--space-2x-large);--vui-textfield-control-group-background:var(--base-1);--vui-textfield-control-group-color:var(--global-foreground);--vui-textfield-control-group-border-color:var(--global-contrast);--vui-textfield-control-group-border-radius:var(--radius-medium);--vui-field-label-padding-inline:calc(var(--vui-textfield-control-group-border-radius) / 2);inline-size:100
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-textfield-input-height{syntax:"<length>";inherits:true;initial-value:0}@property --vui-textfield-control-group-background{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-textfield-control-group-color{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-textfield-control-group-border-color{syntax:"<color>";inherits:true;initial-value:#0000}@property --vui-textfield-control-group-border-radius{syntax:"<length-percentage>";inherits:true;initial-value:0}.viraui__textfield-module__Textfield_o-70A{--vui-textfield-input-height:var(--space-2x-large);--vui-textfield-control-group-background:var(--base-1);--vui-textfield-control-group-color:var(--global-foreground);--vui-textfield-control-group-border-color:var(--global-contrast);--vui-textfield-control-group-border-radius:var(--radius-medium);--vui-field-label-padding-inline:calc(var(--vui-textfield-control-group-border-radius) / 2);inline-size:100%;max-block-size:min-content;&:has([required]) .viraui__textfield-module__Label_5rjr0:after{content:" *";color:var(--highlight-red)}}.viraui__textfield-module__ControlGroup_2W-OC{box-sizing:border-box;inline-size:100%;min-inline-size:0;block-size:var(--vui-textfield-input-height);background:var(--vui-textfield-control-group-background);color:var(--vui-textfield-control-group-color);border:1px solid var(--vui-textfield-control-group-border-color);border-radius:var(--vui-textfield-control-group-border-radius);&:has(.viraui__textfield-module__CustomBasicInput_oHgtd:focus-visible),&:has(.viraui__textfield-module__CustomBasicInput_oHgtd[data-focused]){outline:var(--outline);outline-offset:var(--outline-offset)}&:has(.viraui__textfield-module__CustomBasicInput_oHgtd[data-invalid]){--vui-textfield-control-group-border-color:var(--highlight-red);box-shadow:none;outline-color:oklab(from var(--highlight-red) l a b/.5)}&:has(.viraui__textfield-module__CustomBasicInput_oHgtd:disabled),&:has(.viraui__textfield-module__CustomBasicInput_oHgtd[data-disabled]){--vui-textfield-control-group-background:var(--global-disabled-background);--vui-textfield-control-group-border-color:#0000;--vui-textfield-control-group-color:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}&:has(.viraui__textfield-module__Addon_kK1ef[data-position=start])>.viraui__textfield-module__CustomBasicInput_oHgtd{padding-inline-start:var(--space-x-small)}&:has(.viraui__textfield-module__Addon_kK1ef[data-position=end])>.viraui__textfield-module__CustomBasicInput_oHgtd{padding-inline-end:var(--space-x-small)}}.viraui__textfield-module__Addon_kK1ef{min-inline-size:var(--space-x-large)}.viraui__textfield-module__Description_8Qxot{padding-inline:calc(var(--vui-textfield-control-group-border-radius) / 2)}}@layer viraui.overrides{.viraui__textfield-module__CustomBasicInput_oHgtd{flex:1 1 auto;block-size:100%;line-height:1.2;background:#0000;box-shadow:none;border-radius:inherit;&:focus-visible{outline:none}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-title-align{syntax:"*";inherits:false;initial-value:start}@property --vui-title-max-width{syntax:"*";inherits:false;initial-value:none}@property --vui-title-literal-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-title-white-space{syntax:"*";inherits:false;initial-value:normal}@property --vui-title-font-weight{syntax:"<number>";inherits:false;initial-value:500}@property --vui-title-font-width{syntax:"<number>";inherits:false;initial-value:100}@property --vui-title-font-opsz{syntax:"<number>";inherits:false;initial-value:16}@property --vui-title-trim{syntax:"*";inherits:false;initial-value:trim-both}@property --vui-title-trim-type{syntax:"*";inherits:false;initial-value:cap alphabetic}@property --vui-title-padding-inline-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-title-padding-inline-end{syntax:"<length>";inherits:false;initial-value:0}@property --vui-title-padding-block-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-title-padding-block-end{syntax:"<length>";inherits:false;initial-value:0}@property --vui-title-font-size{syntax:"<length>";inherits:false;initial-value:1rem}@property --vui-title-line-height{syntax:"normal | <number> | <length-percentage>";inherits:false;initial-value:normal}@property --vui-title-letter-spacing{syntax:"normal | <length>";inherits:false;initial-value:normal}@property --vui-title-font-family{syntax:"*";inherits:false;initial-value:sans-serif}@property --__title-medium{syntax:"*";inherits:false;initial-value:0}.viraui__title-module__Title_CXMUX{--__title-medium:clamp(var(--font-scale-body-medium),calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 12 + 0.24cqi),calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 3));--vui-title-font-size:clamp(var(--font-scale-
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --vui-title-align{syntax:"*";inherits:false;initial-value:start}@property --vui-title-max-width{syntax:"*";inherits:false;initial-value:none}@property --vui-title-literal-color{syntax:"<color>";inherits:false;initial-value:#0000}@property --vui-title-white-space{syntax:"*";inherits:false;initial-value:normal}@property --vui-title-font-weight{syntax:"<number>";inherits:false;initial-value:500}@property --vui-title-font-width{syntax:"<number>";inherits:false;initial-value:100}@property --vui-title-font-opsz{syntax:"<number>";inherits:false;initial-value:16}@property --vui-title-trim{syntax:"*";inherits:false;initial-value:trim-both}@property --vui-title-trim-type{syntax:"*";inherits:false;initial-value:cap alphabetic}@property --vui-title-padding-inline-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-title-padding-inline-end{syntax:"<length>";inherits:false;initial-value:0}@property --vui-title-padding-block-start{syntax:"<length>";inherits:false;initial-value:0}@property --vui-title-padding-block-end{syntax:"<length>";inherits:false;initial-value:0}@property --vui-title-font-size{syntax:"<length>";inherits:false;initial-value:1rem}@property --vui-title-line-height{syntax:"normal | <number> | <length-percentage>";inherits:false;initial-value:normal}@property --vui-title-letter-spacing{syntax:"normal | <length>";inherits:false;initial-value:normal}@property --vui-title-font-family{syntax:"*";inherits:false;initial-value:sans-serif}@property --__title-medium{syntax:"*";inherits:false;initial-value:0}.viraui__title-module__Title_CXMUX{--__title-medium:clamp(var(--font-scale-body-medium),calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 12 + 0.24cqi),calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 3));--vui-title-font-size:clamp(calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 5)),calc(var(--__title-medium) * pow(var(--font-heading-typescale), 5)),calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 6)));--vui-title-font-family:var(--font-family-heading);--vui-title-line-height:var(--font-leading-standard);--vui-title-letter-spacing:-0.03em;margin:0;max-inline-size:var(--vui-title-max-width);font-family:var(--vui-title-font-family);font-size:var(--vui-title-font-size);line-height:var(--vui-title-line-height);letter-spacing:var(--vui-title-letter-spacing);text-align:var(--vui-title-align);white-space:var(--vui-title-white-space);word-break:break-word;font-weight:var(--vui-title-font-weight);font-stretch:calc(var(--vui-title-font-width) * 1%);font-optical-sizing:auto;font-variation-settings:"wght" var(--vui-title-font-weight),"wdth" var(--vui-title-font-width),"opsz" var(--vui-title-font-opsz);text-box:var(--vui-title-trim) var(--vui-title-trim-type);display:inline-flex;&[data-title-balanced=true]{text-wrap:balance}&[data-title-selection=false]{-webkit-user-select:none;user-select:none}&[data-title-has-padding=true]{padding:var(--vui-title-padding-block-start) var(--vui-title-padding-inline-end) var(--vui-title-padding-block-end) var(--vui-title-padding-inline-start)}&[data-title-size=display]{--vui-title-font-size:clamp(calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 6)),calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 6) + 4.643cqi - 0.9286rem),var(--font-scale-display))}&[data-title-size="2"]{--vui-title-font-size:clamp(calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 4)),calc(var(--__title-medium) * pow(var(--font-heading-typescale), 4)),calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 5)))}&[data-title-size="3"]{--vui-title-font-size:clamp(calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 3)),calc(var(--__title-medium) * pow(var(--font-heading-typescale), 3)),calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 4)))}&[data-title-size="4"]{--vui-title-font-size:clamp(calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 2)),calc(var(--__title-medium) * pow(var(--font-heading-typescale), 2)),calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 3)))}&[data-title-size="5"]{--vui-title-font-size:clamp(calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 1)),calc(var(--__title-medium) * pow(var(--font-heading-typescale), 1)),calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 2)));--vui-title-letter-spacing:-0.02em}&[data-title-size="6"]{--vui-title-font-size:clamp(var(--font-scale-body-medium),var(--__title-medium),calc(var(--font-scale-body-medium) * pow(var(--font-heading-typescale), 1)));--vui-title-letter-spacing:-0.02em}&[data-title-has-literal-color=true]{color:var(--vui-title-literal-color)}&[data-title-line-height=none]{--vui-title-line-height:0}&[data-title-line-height=x-small]{--vui-title-line-height:var(--font-leading-x-small)}&[data-title-line-height=small]{--vui-title-line-height:var(--font-leading-small)}&[data-title-line-height=large]{--vui-title-line-height:var(--font-leading-large)}}}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"whenToUse": [
|
|
7
7
|
"Confirming a completed action such as save or delete",
|
|
8
8
|
"Offering a short undo window after a reversible change",
|
|
9
|
-
"Showing contextual feedback anchored to the control that triggered it"
|
|
9
|
+
"Showing contextual feedback anchored to the control that triggered it",
|
|
10
|
+
"Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on the portal-owning public part"
|
|
10
11
|
],
|
|
11
12
|
"whenNotToUse": [
|
|
12
13
|
"Blocking errors that need immediate correction — use inline field errors or a dialog",
|
|
@@ -51,6 +52,9 @@
|
|
|
51
52
|
"Banner.toast": {
|
|
52
53
|
"description": "Toast instance from `useToastManager().toasts` or `createToastManager()`."
|
|
53
54
|
},
|
|
55
|
+
"Portal.container": {
|
|
56
|
+
"description": "Portal mount node (iframe body, shadow root, or app overlay root). Omit for Base UI default (`document.body` from the module window — iframe hosts must pass the iframe document body explicitly)."
|
|
57
|
+
},
|
|
54
58
|
"Viewport.position": {
|
|
55
59
|
"description": "Controls viewport placement and stacking layout hooks."
|
|
56
60
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TooltipPositioner } from '@base-ui/react/tooltip';
|
|
1
|
+
import { Tooltip as PrimitiveTooltip, TooltipPositioner } from '@base-ui/react/tooltip';
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
type TooltipContentPositionerProps = Omit<TooltipPositioner.Props, 'className' | 'style' | 'render'>;
|
|
4
4
|
/**
|
|
@@ -10,6 +10,15 @@ type TooltipContentPositionerProps = Omit<TooltipPositioner.Props, 'className' |
|
|
|
10
10
|
*
|
|
11
11
|
* @default `sideOffset` is `8`.
|
|
12
12
|
*/
|
|
13
|
-
export type TooltipContentProps = TooltipContentPositionerProps
|
|
13
|
+
export type TooltipContentProps = TooltipContentPositionerProps & {
|
|
14
|
+
/**
|
|
15
|
+
* Portal mount node (iframe body, shadow root, or app overlay root).
|
|
16
|
+
* Omit for Base UI default (`document.body` from the module window —
|
|
17
|
+
* iframe hosts must pass the iframe document body explicitly).
|
|
18
|
+
*
|
|
19
|
+
* @default Base UI FloatingPortal resolution
|
|
20
|
+
*/
|
|
21
|
+
container?: React.ComponentProps<typeof PrimitiveTooltip.Portal>['container'];
|
|
22
|
+
};
|
|
14
23
|
export declare const TooltipContent: React.FC<TooltipContentProps>;
|
|
15
24
|
export {};
|
|
@@ -4,29 +4,32 @@ import tooltip_module_default from "./tooltip.module.js";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Tooltip } from "@base-ui/react/tooltip";
|
|
6
6
|
//#region src/components/tooltip/tooltip-content.tsx
|
|
7
|
-
var TooltipContent = ({ children, sideOffset = 8, ...positionerProps }) => /* @__PURE__ */ jsx(Tooltip.Portal, {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
className: tooltip_module_default.Viewport,
|
|
22
|
-
render: /* @__PURE__ */ jsx(Stack, {
|
|
23
|
-
vPadding: "small",
|
|
24
|
-
hPadding: "small",
|
|
25
|
-
fillChildren: false
|
|
7
|
+
var TooltipContent = ({ children, sideOffset = 8, container, ...positionerProps }) => /* @__PURE__ */ jsx(Tooltip.Portal, {
|
|
8
|
+
container,
|
|
9
|
+
children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
10
|
+
className: tooltip_module_default.Positioner,
|
|
11
|
+
sideOffset,
|
|
12
|
+
...positionerProps,
|
|
13
|
+
children: /* @__PURE__ */ jsx(Tooltip.Popup, {
|
|
14
|
+
className: tooltip_module_default.Popup,
|
|
15
|
+
role: "tooltip",
|
|
16
|
+
render: /* @__PURE__ */ jsx(Surface, {
|
|
17
|
+
color: 1,
|
|
18
|
+
border: "all",
|
|
19
|
+
radius: "medium",
|
|
20
|
+
"data-vibrant": ""
|
|
26
21
|
}),
|
|
27
|
-
children
|
|
22
|
+
children: /* @__PURE__ */ jsx(Tooltip.Viewport, {
|
|
23
|
+
className: tooltip_module_default.Viewport,
|
|
24
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
25
|
+
vPadding: "small",
|
|
26
|
+
hPadding: "small",
|
|
27
|
+
fillChildren: false
|
|
28
|
+
}),
|
|
29
|
+
children
|
|
30
|
+
})
|
|
28
31
|
})
|
|
29
32
|
})
|
|
30
|
-
})
|
|
33
|
+
});
|
|
31
34
|
//#endregion
|
|
32
35
|
export { TooltipContent };
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"whenToUse": [
|
|
7
7
|
"Short hints on hover or focus for toolbar controls and icon buttons",
|
|
8
8
|
"Per-trigger labels on shared tooltip roots using `payload` and Root render-function children",
|
|
9
|
-
"Adjacent controls that benefit from shared open/close delay via `Tooltip.Provider`"
|
|
9
|
+
"Adjacent controls that benefit from shared open/close delay via `Tooltip.Provider`",
|
|
10
|
+
"Custom portal host (iframe preview, shadow root, or app overlay root) via `container` on the portal-owning public part"
|
|
10
11
|
],
|
|
11
12
|
"whenNotToUse": [
|
|
12
13
|
"Rich interactive panels or forms (use Popover or Dialog)",
|
|
@@ -29,6 +30,11 @@
|
|
|
29
30
|
"content-fade-duration": {
|
|
30
31
|
"description": "content fade duration custom property on the component root."
|
|
31
32
|
}
|
|
33
|
+
},
|
|
34
|
+
"react": {
|
|
35
|
+
"Content.container": {
|
|
36
|
+
"description": "Portal mount node (iframe body, shadow root, or app overlay root). Omit for Base UI default (`document.body` from the module window — iframe hosts must pass the iframe document body explicitly)."
|
|
37
|
+
}
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viraui/react",
|
|
3
|
-
"version": "2026.0.
|
|
3
|
+
"version": "2026.0.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"unplugin-dts": "1.0.3",
|
|
36
36
|
"vite": "8.1.4",
|
|
37
37
|
"vite-plugin-static-copy": "4.1.1",
|
|
38
|
-
"@viraui/foundation": "2026.0.
|
|
38
|
+
"@viraui/foundation": "2026.0.14",
|
|
39
39
|
"@viraui/icons": "2026.0.0",
|
|
40
40
|
"@viraui/postcss-config": "2026.0.0",
|
|
41
41
|
"@viraui/tsconfig": "2026.0.0"
|