@viraui/react 1.0.13 → 1.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/catalog.json +10 -4
- package/dist/components/accordion/accordion.css +1 -1
- package/dist/components/accordion/accordion.guide.json +26 -0
- package/dist/components/annotate/annotate.css +1 -1
- package/dist/components/annotate/annotate.guide.json +46 -57
- package/dist/components/avatar/avatar.css +1 -1
- package/dist/components/avatar/avatar.guide.json +22 -10
- package/dist/components/avatar/avatar.js +0 -2
- package/dist/components/avatar-group/avatar-group.css +1 -7
- package/dist/components/avatar-group/avatar-group.guide.json +23 -16
- package/dist/components/badge/badge.css +1 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.guide.json +17 -13
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/basic-input/basic-input.css +1 -1
- package/dist/components/basic-input/field-label.css +1 -1
- package/dist/components/basic-input/field-label.js +2 -0
- package/dist/components/bleed/bleed.guide.json +9 -6
- package/dist/components/button/button-chrome.d.ts +3 -1
- package/dist/components/button/button-chrome.js +3 -2
- package/dist/components/button/button-link.guide.json +55 -1
- package/dist/components/button/button-link.js +1 -0
- package/dist/components/button/button.css +1 -1
- package/dist/components/button/button.guide.json +27 -7
- package/dist/components/button/button.js +1 -0
- package/dist/components/checkbox/checkbox.css +1 -1
- package/dist/components/checkbox/checkbox.guide.json +40 -1
- package/dist/components/checkbox/checkbox.js +2 -2
- package/dist/components/checkbox/checkbox.module.js +1 -3
- package/dist/components/chip/chip.css +1 -1
- package/dist/components/chip/chip.guide.json +23 -6
- package/dist/components/chip/chip.js +1 -0
- package/dist/components/clamp-text/clamp-text.css +1 -1
- package/dist/components/clamp-text/clamp-text.guide.json +9 -0
- package/dist/components/dialog/dialog-sheet.js +1 -1
- package/dist/components/dialog/dialog.css +1 -1
- package/dist/components/dialog/dialog.guide.json +24 -0
- package/dist/components/dialog/dialog.module.js +1 -3
- package/dist/components/elevator/elevator.guide.json +23 -1
- package/dist/components/fieldset/fieldset.guide.json +16 -3
- package/dist/components/fieldset/fieldset.js +6 -6
- package/dist/components/fit-text/fit-text.css +1 -1
- package/dist/components/fit-text/fit-text.guide.json +2 -4
- package/dist/components/icon-button/icon-button-link.guide.json +52 -1
- package/dist/components/icon-button/icon-button-link.js +2 -2
- package/dist/components/icon-button/icon-button.d.ts +1 -1
- package/dist/components/icon-button/icon-button.guide.json +48 -3
- package/dist/components/icon-button/icon-button.js +2 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/linear-progress/linear-progress.guide.json +16 -5
- package/dist/components/linear-progress/linear-progress.js +0 -1
- package/dist/components/masonry/masonry.d.ts +1 -1
- package/dist/components/masonry/masonry.guide.json +11 -9
- package/dist/components/menu/index.d.ts +11 -0
- package/dist/components/menu/menu-checkbox-item.d.ts +42 -0
- package/dist/components/menu/menu-checkbox-item.js +28 -0
- package/dist/components/menu/menu-group.d.ts +12 -0
- package/dist/components/menu/menu-group.js +36 -0
- package/dist/components/menu/menu-indicator-slot.d.ts +15 -0
- package/dist/components/menu/menu-indicator-slot.js +52 -0
- package/dist/components/menu/menu-item-row.d.ts +18 -0
- package/dist/components/menu/menu-item-row.js +47 -0
- package/dist/components/menu/menu-item.d.ts +36 -0
- package/dist/components/menu/menu-item.js +23 -0
- package/dist/components/menu/menu-link-item.d.ts +36 -0
- package/dist/components/menu/menu-link-item.js +26 -0
- package/dist/components/menu/menu-popup.d.ts +17 -0
- package/dist/components/menu/menu-popup.js +28 -0
- package/dist/components/menu/menu-radio-group.d.ts +16 -0
- package/dist/components/menu/menu-radio-group.js +36 -0
- package/dist/components/menu/menu-radio-item.d.ts +42 -0
- package/dist/components/menu/menu-radio-item.js +28 -0
- package/dist/components/menu/menu-separator.d.ts +9 -0
- package/dist/components/menu/menu-separator.js +15 -0
- package/dist/components/menu/menu-submenu-trigger.d.ts +29 -0
- package/dist/components/menu/menu-submenu-trigger.js +26 -0
- package/dist/components/menu/menu.css +1 -0
- package/dist/components/menu/menu.d.ts +58 -0
- package/dist/components/menu/menu.guide.json +101 -0
- package/dist/components/menu/menu.js +36 -0
- package/dist/components/menu/menu.module.js +13 -0
- package/dist/components/meter/meter.guide.json +15 -4
- package/dist/components/meter/meter.js +0 -1
- package/dist/components/popover/popover-sheet.js +1 -1
- package/dist/components/popover/popover.guide.json +25 -1
- package/dist/components/progressive-blur/progressive-blur.css +1 -1
- package/dist/components/progressive-blur/progressive-blur.guide.json +14 -4
- package/dist/components/progressive-blur/progressive-blur.js +2 -2
- package/dist/components/radio/radio.css +1 -1
- package/dist/components/radio/radio.guide.json +34 -1
- package/dist/components/radio/radio.js +28 -31
- package/dist/components/select/select-group.js +1 -1
- package/dist/components/select/select-option.d.ts +1 -1
- package/dist/components/select/select-option.js +2 -5
- package/dist/components/select/select-separator.js +7 -4
- package/dist/components/select/select.css +1 -1
- package/dist/components/select/select.guide.json +49 -8
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/select.module.js +1 -5
- package/dist/components/separator/separator.guide.json +28 -1
- package/dist/components/shimmer/shimmer.css +1 -1
- package/dist/components/shimmer/shimmer.guide.json +19 -16
- package/dist/components/skeleton/skeleton.guide.json +24 -31
- package/dist/components/slider/slider.guide.json +27 -7
- package/dist/components/spinner/spinner.guide.json +5 -4
- package/dist/components/stack/stack.guide.json +49 -47
- package/dist/components/static-noise/static-noise.guide.json +18 -2
- package/dist/components/surface/surface.css +1 -1
- package/dist/components/surface/surface.guide.json +41 -48
- package/dist/components/switch/switch.css +1 -1
- package/dist/components/switch/switch.guide.json +25 -10
- package/dist/components/tabs/tabs.guide.json +11 -0
- package/dist/components/text/text.css +1 -1
- package/dist/components/text/text.guide.json +67 -76
- package/dist/components/textarea/textarea.css +1 -1
- package/dist/components/textarea/textarea.d.ts +4 -3
- package/dist/components/textarea/textarea.guide.json +19 -7
- package/dist/components/textfield/textfield.css +1 -1
- package/dist/components/textfield/textfield.guide.json +22 -7
- package/dist/components/title/title.css +1 -1
- package/dist/components/title/title.guide.json +62 -72
- package/dist/components/title/title.js +0 -1
- package/dist/components/toast/toast.css +1 -1
- package/dist/components/toast/toast.guide.json +32 -1
- package/dist/components/toggle-button/toggle-button.css +1 -0
- package/dist/components/toggle-button/toggle-button.d.ts +7 -0
- package/dist/components/toggle-button/toggle-button.guide.json +29 -2
- package/dist/components/toggle-button/toggle-button.js +18 -3
- package/dist/components/toggle-button/toggle-button.module.js +9 -0
- package/dist/components/toggle-group/toggle-group.d.ts +2 -1
- package/dist/components/toggle-group/toggle-group.guide.json +2 -3
- package/dist/components/tooltip/tooltip.guide.json +8 -1
- package/dist/components/typewriter/typewriter.css +1 -1
- package/dist/components/typewriter/typewriter.guide.json +27 -5
- package/dist/index.js +12 -2
- package/dist/internal/chrome-icons/chrome-icons.d.ts +2 -0
- package/dist/internal/chrome-icons/chrome-icons.js +7 -1
- package/dist/preflight-surface.json +1 -1
- package/dist/preflight.css +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --
|
|
1
|
+
@layer viraui.preflight, viraui.components, viraui.overrides;@layer viraui.components{@property --__fit-text-captured-length{syntax:"<length>";inherits:true;initial-value:0}@property --vui-fit-text-max-font-size{syntax:"<length>";inherits:true;initial-value:calc(infinity * 1px)}@property --__fit-text-available-space{syntax:"<length>";inherits:true;initial-value:0}@property --__fit-text-ratio{syntax:"<number>";inherits:false;initial-value:1}.viraui__fit-text-module__FitText_CdAvq{--__fit-text-captured-length:initial;display:flex;container-type:inline-size;.viraui__fit-text-module__Container_bawpR{--__fit-text-captured-length:100cqi;--__fit-text-available-space:var(--__fit-text-captured-length);flex-grow:1;container-type:inline-size}.viraui__fit-text-module__Display_Hraif{--__fit-text-captured-length:100cqi;--__fit-text-ratio:tan(atan2(var(--__fit-text-available-space),var(--__fit-text-available-space) - var(--__fit-text-captured-length)));inline-size:var(--__fit-text-available-space);font-size:clamp(0px,1em * var(--__fit-text-ratio),var(--vui-fit-text-max-font-size));>*{font-size:1em;max-inline-size:none}}.viraui__fit-text-module__Reference_6wCx7{visibility:hidden;>*{font-size:inherit;max-inline-size:none}}}}
|
|
@@ -26,14 +26,12 @@
|
|
|
26
26
|
"properties": {
|
|
27
27
|
"react": {
|
|
28
28
|
"maxFontSize": {
|
|
29
|
-
"description": "Caps the fitted font size using any valid CSS length string."
|
|
30
|
-
"refCss": "max-font-size"
|
|
29
|
+
"description": "Caps the fitted font size using any valid CSS length string."
|
|
31
30
|
}
|
|
32
31
|
},
|
|
33
32
|
"css": {
|
|
34
33
|
"max-font-size": {
|
|
35
|
-
"description": "Upper bound for the fitted font size on the display slot."
|
|
36
|
-
"refReact": "maxFontSize"
|
|
34
|
+
"description": "Upper bound for the fitted font size on the display slot."
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
37
|
}
|
|
@@ -21,5 +21,56 @@
|
|
|
21
21
|
"Passing children, addon, or addonPosition — not part of the public API",
|
|
22
22
|
"Using IconButton with render={<a />} instead of IconButtonLink"
|
|
23
23
|
],
|
|
24
|
-
"related": ["IconButton", "ButtonLink", "Button", "Icon", "Spinner"]
|
|
24
|
+
"related": ["IconButton", "ButtonLink", "Button", "Icon", "Spinner"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"react": {
|
|
27
|
+
"disabled": {
|
|
28
|
+
"description": "Marks the link inert via `aria-disabled` and prevents activation."
|
|
29
|
+
},
|
|
30
|
+
"icon": {
|
|
31
|
+
"description": "Icon rendered as the sole visible control content."
|
|
32
|
+
},
|
|
33
|
+
"loading": {
|
|
34
|
+
"description": "Shows a centered spinner overlay while preserving the original content width."
|
|
35
|
+
},
|
|
36
|
+
"pill": {
|
|
37
|
+
"description": "Applies a fully rounded pill shape."
|
|
38
|
+
},
|
|
39
|
+
"render": {
|
|
40
|
+
"description": "Replaces the default `a` root using Base UI render semantics (e.g. Next.js `Link`)."
|
|
41
|
+
},
|
|
42
|
+
"size": {
|
|
43
|
+
"description": "Controls the visual button size."
|
|
44
|
+
},
|
|
45
|
+
"variant": {
|
|
46
|
+
"description": "Selects the visual treatment matching Button."
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"css": {
|
|
50
|
+
"background": {
|
|
51
|
+
"description": "Button fill; variant and state selectors preset this."
|
|
52
|
+
},
|
|
53
|
+
"color": {
|
|
54
|
+
"description": "Button label and icon color."
|
|
55
|
+
},
|
|
56
|
+
"height": {
|
|
57
|
+
"description": "Button block size; size prop presets via data attributes."
|
|
58
|
+
},
|
|
59
|
+
"icon-size": {
|
|
60
|
+
"description": "Addon icon size inside the button."
|
|
61
|
+
},
|
|
62
|
+
"padding-block": {
|
|
63
|
+
"description": "Vertical padding inside the button."
|
|
64
|
+
},
|
|
65
|
+
"padding-inline": {
|
|
66
|
+
"description": "Horizontal padding inside the button."
|
|
67
|
+
},
|
|
68
|
+
"radius": {
|
|
69
|
+
"description": "Corner radius; pill sets infinite radius via data-pill."
|
|
70
|
+
},
|
|
71
|
+
"spinner-color": {
|
|
72
|
+
"description": "Loading spinner color on the root."
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
25
76
|
}
|
|
@@ -3,9 +3,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import "react";
|
|
4
4
|
//#region src/components/icon-button/icon-button-link.tsx
|
|
5
5
|
var IconButtonLink = ({ icon, size = "medium", ...otherProps }) => /* @__PURE__ */ jsx(ButtonLink, {
|
|
6
|
-
addon: icon,
|
|
7
6
|
size,
|
|
8
|
-
...otherProps
|
|
7
|
+
...otherProps,
|
|
8
|
+
addon: icon
|
|
9
9
|
});
|
|
10
10
|
//#endregion
|
|
11
11
|
export { IconButtonLink };
|
|
@@ -13,7 +13,7 @@ type AccessibleNameProps = {
|
|
|
13
13
|
* Typed wrapper over `Button` for icon-only actions. Requires an accessible name
|
|
14
14
|
* via `aria-label` or `aria-labelledby`.
|
|
15
15
|
*/
|
|
16
|
-
export type IconButtonProps = Omit<ButtonProps, 'children' | 'addonPosition' | 'size'> & AccessibleNameProps & {
|
|
16
|
+
export type IconButtonProps = Omit<ButtonProps, 'children' | 'addon' | 'addonPosition' | 'size'> & AccessibleNameProps & {
|
|
17
17
|
/**
|
|
18
18
|
* Controls the visual button size.
|
|
19
19
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "IconButton",
|
|
3
3
|
"structure": "<IconButton icon={<Plus />} aria-label=\"Add\" />",
|
|
4
|
-
"summary": "Icon-only button that requires an accessible name through aria-label or aria-labelledby.",
|
|
4
|
+
"summary": "Icon-only button that shares Button visual chrome (--vui-button-* CSS) and requires an accessible name through aria-label or aria-labelledby.",
|
|
5
5
|
"whenToUse": [
|
|
6
6
|
"Compact toolbar or chrome actions identified only by icon",
|
|
7
7
|
"Same size, variant, and loading model as Button without visible label",
|
|
@@ -18,9 +18,54 @@
|
|
|
18
18
|
"Keep the accessible name stable when loading state changes"
|
|
19
19
|
],
|
|
20
20
|
"antiPatterns": [
|
|
21
|
-
"Passing children or addonPosition — not part of the public API",
|
|
21
|
+
"Passing children, addon, or addonPosition — not part of the public API",
|
|
22
22
|
"Using icon-only Button instead of IconButton",
|
|
23
23
|
"Using IconButton with render={<a />} for links — use IconButtonLink"
|
|
24
24
|
],
|
|
25
|
-
"related": ["Button", "ButtonLink", "IconButtonLink", "Icon", "Spinner"]
|
|
25
|
+
"related": ["Button", "ButtonLink", "IconButtonLink", "Icon", "Spinner"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"react": {
|
|
28
|
+
"icon": {
|
|
29
|
+
"description": "Icon rendered as the sole visible control content."
|
|
30
|
+
},
|
|
31
|
+
"loading": {
|
|
32
|
+
"description": "Shows a centered spinner overlay while preserving the original content width."
|
|
33
|
+
},
|
|
34
|
+
"pill": {
|
|
35
|
+
"description": "Applies a fully rounded pill shape to the button."
|
|
36
|
+
},
|
|
37
|
+
"size": {
|
|
38
|
+
"description": "Controls the visual button size."
|
|
39
|
+
},
|
|
40
|
+
"variant": {
|
|
41
|
+
"description": "Selects the visual treatment for the button."
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"css": {
|
|
45
|
+
"background": {
|
|
46
|
+
"description": "Button fill; variant and state selectors preset this."
|
|
47
|
+
},
|
|
48
|
+
"color": {
|
|
49
|
+
"description": "Button label and icon color."
|
|
50
|
+
},
|
|
51
|
+
"height": {
|
|
52
|
+
"description": "Button block size; size prop presets via data attributes."
|
|
53
|
+
},
|
|
54
|
+
"icon-size": {
|
|
55
|
+
"description": "Addon icon size inside the button."
|
|
56
|
+
},
|
|
57
|
+
"padding-block": {
|
|
58
|
+
"description": "Vertical padding inside the button."
|
|
59
|
+
},
|
|
60
|
+
"padding-inline": {
|
|
61
|
+
"description": "Horizontal padding inside the button."
|
|
62
|
+
},
|
|
63
|
+
"radius": {
|
|
64
|
+
"description": "Corner radius; pill sets infinite radius via data-pill."
|
|
65
|
+
},
|
|
66
|
+
"spinner-color": {
|
|
67
|
+
"description": "Loading spinner color on the root."
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
26
71
|
}
|
|
@@ -2,9 +2,9 @@ import { Button } from "../button/button.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/icon-button/icon-button.tsx
|
|
4
4
|
var IconButton = ({ icon, size = "medium", ...otherProps }) => /* @__PURE__ */ jsx(Button, {
|
|
5
|
-
addon: icon,
|
|
6
5
|
size,
|
|
7
|
-
...otherProps
|
|
6
|
+
...otherProps,
|
|
7
|
+
addon: icon
|
|
8
8
|
});
|
|
9
9
|
//#endregion
|
|
10
10
|
export { IconButton };
|
|
@@ -24,17 +24,28 @@
|
|
|
24
24
|
"Do not model disabled progress; Base UI Progress does not expose a disabled state.",
|
|
25
25
|
"Do not hide the task label when multiple progress indicators are visible."
|
|
26
26
|
],
|
|
27
|
-
"related": ["Slider", "Spinner", "Skeleton", "Text"],
|
|
27
|
+
"related": ["Slider", "Spinner", "Skeleton", "Text", "Meter"],
|
|
28
28
|
"properties": {
|
|
29
|
+
"react": {
|
|
30
|
+
"description": {
|
|
31
|
+
"description": "Static helper copy rendered with `Text` below the progress track."
|
|
32
|
+
},
|
|
33
|
+
"label": {
|
|
34
|
+
"description": "Visible label rendered through `Progress.Label` with shared internal `FieldLabel`."
|
|
35
|
+
},
|
|
36
|
+
"showValue": {
|
|
37
|
+
"description": "Renders the formatted current value via `Progress.Value` and `Text`."
|
|
38
|
+
}
|
|
39
|
+
},
|
|
29
40
|
"css": {
|
|
30
|
-
"
|
|
31
|
-
"description": "Progress
|
|
41
|
+
"indicator-color": {
|
|
42
|
+
"description": "Progress indicator color for determinate fill and indeterminate sweep."
|
|
32
43
|
},
|
|
33
44
|
"track-background": {
|
|
34
45
|
"description": "Progress track background color."
|
|
35
46
|
},
|
|
36
|
-
"
|
|
37
|
-
"description": "
|
|
47
|
+
"track-size": {
|
|
48
|
+
"description": "Progress track thickness on the root."
|
|
38
49
|
}
|
|
39
50
|
}
|
|
40
51
|
}
|
|
@@ -44,7 +44,6 @@ var LinearProgress = ({ className, description, label, showValue = false, value,
|
|
|
44
44
|
children: /* @__PURE__ */ jsx(Progress.Indicator, { className: linear_progress_module_default.Indicator })
|
|
45
45
|
}),
|
|
46
46
|
description && /* @__PURE__ */ jsx(Text, {
|
|
47
|
-
className: linear_progress_module_default.Description,
|
|
48
47
|
size: "small",
|
|
49
48
|
tone: "muted",
|
|
50
49
|
children: description
|
|
@@ -29,7 +29,7 @@ export type MasonryProps = React.ComponentPropsWithRef<'div'> & {
|
|
|
29
29
|
*/
|
|
30
30
|
render?: useRender.RenderProp;
|
|
31
31
|
/**
|
|
32
|
-
* Sets the gap between columns and the
|
|
32
|
+
* Sets the gap between columns (`--vui-masonry-gap`) and the `rowGap` on each column `Stack`.
|
|
33
33
|
*
|
|
34
34
|
* @default 'large'
|
|
35
35
|
*/
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Masonry",
|
|
3
3
|
"structure": "<Masonry>\n <Masonry.Item>…</Masonry.Item>\n</Masonry>",
|
|
4
|
-
"summary": "Responsive React-column layout primitive for read-only mixed-height content walls.",
|
|
4
|
+
"summary": "Responsive React-column layout primitive for read-only mixed-height content walls; root is a named CSS container query context (`masonry` / inline-size).",
|
|
5
5
|
"whenToUse": [
|
|
6
6
|
"Card walls, gallery-like collections, and editorial layouts with uneven item heights",
|
|
7
7
|
"Presentational walls where responsive column count matters more than source-order reading",
|
|
8
|
-
"Read-only collections composed from Surface, Stack, Text, and similar content primitives"
|
|
8
|
+
"Read-only collections composed from Surface, Stack, Text, and similar content primitives",
|
|
9
|
+
"Style descendants with @container masonry queries when layout should respond to the Masonry root's inline-size (peer Surface/Stack named containers)"
|
|
9
10
|
],
|
|
10
11
|
"whenNotToUse": [
|
|
11
12
|
"Interactive collections where keyboard tab order must match source order",
|
|
@@ -19,23 +20,24 @@
|
|
|
19
20
|
],
|
|
20
21
|
"antiPatterns": [
|
|
21
22
|
"Treating React columns as a true interactive grid with predictable source-order keyboard traversal",
|
|
22
|
-
"Using arbitrary child margins instead of the
|
|
23
|
+
"Using arbitrary child margins instead of the gap contract (column flex gap + Stack rowGap)"
|
|
23
24
|
],
|
|
24
25
|
"related": ["Stack", "Surface", "Text"],
|
|
25
26
|
"properties": {
|
|
26
27
|
"react": {
|
|
28
|
+
"breakpointCols": {
|
|
29
|
+
"description": "Sets the mobile-first column count at each CSS px container breakpoint. Each non-`default` key is a unitless `min-width` in px against the Masonry root's content-box inline size. Keys may be in any order; the largest matching breakpoint wins. Non-finite keys are ignored."
|
|
30
|
+
},
|
|
27
31
|
"gap": {
|
|
28
|
-
"description": "
|
|
29
|
-
"refCss": "gap"
|
|
32
|
+
"description": "Sets the gap between columns (`--vui-masonry-gap`) and the `rowGap` on each column `Stack`."
|
|
30
33
|
},
|
|
31
|
-
"
|
|
32
|
-
"description": "
|
|
34
|
+
"render": {
|
|
35
|
+
"description": "Replaces the default `div` root using Base UI render semantics."
|
|
33
36
|
}
|
|
34
37
|
},
|
|
35
38
|
"css": {
|
|
36
39
|
"gap": {
|
|
37
|
-
"description": "
|
|
38
|
-
"refReact": "gap"
|
|
40
|
+
"description": "Column gap only (`--vui-masonry-gap` on the flex root). Within-column item spacing uses Stack `rowGap`, not this custom property."
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Menu, MenuCheckboxItem, MenuGroup, MenuItem, MenuLinkItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSubmenu, MenuSubmenuTrigger, MenuTrigger, } from './menu';
|
|
2
|
+
export type { MenuProps, MenuSubmenuProps, MenuTriggerProps } from './menu';
|
|
3
|
+
export type { MenuCheckboxItemProps } from './menu-checkbox-item';
|
|
4
|
+
export type { MenuGroupProps } from './menu-group';
|
|
5
|
+
export type { MenuItemProps } from './menu-item';
|
|
6
|
+
export type { MenuLinkItemProps } from './menu-link-item';
|
|
7
|
+
export type { MenuPopupProps } from './menu-popup';
|
|
8
|
+
export type { MenuRadioGroupProps } from './menu-radio-group';
|
|
9
|
+
export type { MenuRadioItemProps } from './menu-radio-item';
|
|
10
|
+
export type { MenuSeparatorProps } from './menu-separator';
|
|
11
|
+
export type { MenuSubmenuTriggerProps } from './menu-submenu-trigger';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MenuCheckboxItem as MenuCheckboxItemPrimitive } from '@base-ui/react/menu';
|
|
2
|
+
import { StackProps } from '../stack';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Public Menu.CheckboxItem props.
|
|
6
|
+
*
|
|
7
|
+
* @default `closeOnClick` is `false`.
|
|
8
|
+
*/
|
|
9
|
+
export type MenuCheckboxItemProps = MenuCheckboxItemPrimitive.Props & {
|
|
10
|
+
/**
|
|
11
|
+
* Decorative leading node rendered before the item label.
|
|
12
|
+
*
|
|
13
|
+
* @default No addon is rendered.
|
|
14
|
+
*/
|
|
15
|
+
addon?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Vertical alignment of the addon relative to the label row.
|
|
18
|
+
*
|
|
19
|
+
* @default 'center'
|
|
20
|
+
*/
|
|
21
|
+
addonAlign?: StackProps['vAlign'];
|
|
22
|
+
/**
|
|
23
|
+
* Custom indicator node when checked.
|
|
24
|
+
*
|
|
25
|
+
* @default Built-in Check chrome SVG at size 16
|
|
26
|
+
*/
|
|
27
|
+
indicator?: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* End-aligned secondary text (e.g. keyboard shortcut) before the check indicator.
|
|
30
|
+
* Rendered muted `x-small`.
|
|
31
|
+
*
|
|
32
|
+
* @default No note is rendered.
|
|
33
|
+
*/
|
|
34
|
+
note?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Visual sentiment. `destructive` uses highlight-red wash + text.
|
|
37
|
+
*
|
|
38
|
+
* @default Neutral item styling.
|
|
39
|
+
*/
|
|
40
|
+
sentiment?: 'destructive';
|
|
41
|
+
};
|
|
42
|
+
export declare const MenuCheckboxItem: React.FC<MenuCheckboxItemProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { clsx } from "../../core/clsx.js";
|
|
2
|
+
import { ChromeCheck } from "../../internal/chrome-icons/chrome-icons.js";
|
|
3
|
+
import { Surface } from "../surface/surface.js";
|
|
4
|
+
import menu_module_default from "./menu.module.js";
|
|
5
|
+
import { MenuIndicatorSlot } from "./menu-indicator-slot.js";
|
|
6
|
+
import { MenuItemRow } from "./menu-item-row.js";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { Menu } from "@base-ui/react/menu";
|
|
9
|
+
//#region src/components/menu/menu-checkbox-item.tsx
|
|
10
|
+
var MenuCheckboxItem = ({ addon, addonAlign = "center", children, className, closeOnClick = false, indicator, note, sentiment, ...otherProps }) => /* @__PURE__ */ jsx(Menu.CheckboxItem, {
|
|
11
|
+
...otherProps,
|
|
12
|
+
className: clsx(menu_module_default.Item, className),
|
|
13
|
+
closeOnClick,
|
|
14
|
+
...sentiment && { "data-sentiment": sentiment },
|
|
15
|
+
render: /* @__PURE__ */ jsx(Surface, { radius: "auto" }),
|
|
16
|
+
children: /* @__PURE__ */ jsx(MenuItemRow, {
|
|
17
|
+
addon,
|
|
18
|
+
addonAlign,
|
|
19
|
+
note,
|
|
20
|
+
trailing: /* @__PURE__ */ jsx(MenuIndicatorSlot, {
|
|
21
|
+
kind: "checkbox",
|
|
22
|
+
children: indicator ?? /* @__PURE__ */ jsx(ChromeCheck, { size: 16 })
|
|
23
|
+
}),
|
|
24
|
+
children
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { MenuCheckboxItem };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MenuGroup as MenuGroupPrimitive } from '@base-ui/react/menu';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Public Menu.Group props.
|
|
5
|
+
*/
|
|
6
|
+
export type MenuGroupProps = MenuGroupPrimitive.Props & {
|
|
7
|
+
/**
|
|
8
|
+
* Accessible group label rendered with `Menu.GroupLabel`.
|
|
9
|
+
*/
|
|
10
|
+
label: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare const MenuGroup: React.FC<MenuGroupProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { clsx } from "../../core/clsx.js";
|
|
2
|
+
import { Text } from "../text/text.js";
|
|
3
|
+
import { Stack } from "../stack/stack.js";
|
|
4
|
+
import menu_module_default from "./menu.module.js";
|
|
5
|
+
import { MenuIndicatorSlot } from "./menu-indicator-slot.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Menu } from "@base-ui/react/menu";
|
|
8
|
+
//#region src/components/menu/menu-group.tsx
|
|
9
|
+
var MenuGroup = ({ children, className, label, ...otherProps }) => /* @__PURE__ */ jsxs(Menu.Group, {
|
|
10
|
+
...otherProps,
|
|
11
|
+
className: clsx(menu_module_default.Group, className),
|
|
12
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
13
|
+
direction: "column",
|
|
14
|
+
fillChildren: false,
|
|
15
|
+
rowGap: "2x-small",
|
|
16
|
+
vPadding: "2x-small"
|
|
17
|
+
}),
|
|
18
|
+
children: [/* @__PURE__ */ jsxs(Menu.GroupLabel, {
|
|
19
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
20
|
+
columnGap: "small",
|
|
21
|
+
direction: "row",
|
|
22
|
+
fillChildren: false,
|
|
23
|
+
hPadding: "small",
|
|
24
|
+
vAlign: "center",
|
|
25
|
+
vPadding: ["small", "x-small"]
|
|
26
|
+
}),
|
|
27
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
28
|
+
size: "x-small",
|
|
29
|
+
tone: "muted",
|
|
30
|
+
weight: "semibold",
|
|
31
|
+
children: label
|
|
32
|
+
}), /* @__PURE__ */ jsx(MenuIndicatorSlot, {})]
|
|
33
|
+
}), children]
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { MenuGroup };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export type MenuIndicatorSlotKind = 'spacer' | 'checkbox' | 'radio' | 'chevron';
|
|
3
|
+
export type MenuIndicatorSlotProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Trailing footprint kind.
|
|
7
|
+
* - `spacer`: empty matching footprint (Item / LinkItem)
|
|
8
|
+
* - `checkbox` / `radio`: Base UI indicator with `keepMounted`
|
|
9
|
+
* - `chevron`: always-visible submenu end chevron
|
|
10
|
+
*
|
|
11
|
+
* @default 'spacer'
|
|
12
|
+
*/
|
|
13
|
+
kind?: MenuIndicatorSlotKind;
|
|
14
|
+
};
|
|
15
|
+
export declare const MenuIndicatorSlot: React.FC<MenuIndicatorSlotProps>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Stack } from "../stack/stack.js";
|
|
2
|
+
import menu_module_default from "./menu.module.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Menu } from "@base-ui/react/menu";
|
|
5
|
+
//#region src/components/menu/menu-indicator-slot.tsx
|
|
6
|
+
var indicatorStackRender = /* @__PURE__ */ jsx(Stack, {
|
|
7
|
+
"data-shrink": "false",
|
|
8
|
+
fillChildren: false,
|
|
9
|
+
hAlign: "center",
|
|
10
|
+
inline: true,
|
|
11
|
+
vAlign: "center"
|
|
12
|
+
});
|
|
13
|
+
var MenuIndicatorSlot = ({ children, kind = "spacer" }) => {
|
|
14
|
+
if (kind === "checkbox") return /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, {
|
|
15
|
+
className: menu_module_default.Indicator,
|
|
16
|
+
"data-grow": "false",
|
|
17
|
+
keepMounted: true,
|
|
18
|
+
render: indicatorStackRender,
|
|
19
|
+
children
|
|
20
|
+
});
|
|
21
|
+
if (kind === "radio") return /* @__PURE__ */ jsx(Menu.RadioItemIndicator, {
|
|
22
|
+
className: menu_module_default.Indicator,
|
|
23
|
+
"data-grow": "false",
|
|
24
|
+
keepMounted: true,
|
|
25
|
+
render: indicatorStackRender,
|
|
26
|
+
children
|
|
27
|
+
});
|
|
28
|
+
if (kind === "chevron") return /* @__PURE__ */ jsx(Stack, {
|
|
29
|
+
"aria-hidden": true,
|
|
30
|
+
className: menu_module_default.Indicator,
|
|
31
|
+
"data-grow": "false",
|
|
32
|
+
"data-kind": "chevron",
|
|
33
|
+
"data-shrink": "false",
|
|
34
|
+
fillChildren: false,
|
|
35
|
+
hAlign: "center",
|
|
36
|
+
inline: true,
|
|
37
|
+
vAlign: "center",
|
|
38
|
+
children
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ jsx(Stack, {
|
|
41
|
+
"aria-hidden": true,
|
|
42
|
+
className: menu_module_default.Indicator,
|
|
43
|
+
"data-grow": "false",
|
|
44
|
+
"data-shrink": "false",
|
|
45
|
+
fillChildren: false,
|
|
46
|
+
hAlign: "center",
|
|
47
|
+
inline: true,
|
|
48
|
+
vAlign: "center"
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { MenuIndicatorSlot };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StackProps } from '../stack';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
export type MenuItemRowProps = {
|
|
4
|
+
addon?: React.ReactNode;
|
|
5
|
+
addonAlign?: StackProps['vAlign'];
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Optional muted note (shortcut / secondary label) at the end of the content row,
|
|
9
|
+
* immediately before any trailing indicator.
|
|
10
|
+
*/
|
|
11
|
+
note?: React.ReactNode;
|
|
12
|
+
trailing?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Shared internal row layout for all Menu item kinds (addon + label + optional note + trailing).
|
|
16
|
+
* Not a public export.
|
|
17
|
+
*/
|
|
18
|
+
export declare const MenuItemRow: React.FC<MenuItemRowProps>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Text } from "../text/text.js";
|
|
2
|
+
import { Stack } from "../stack/stack.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/menu/menu-item-row.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Shared internal row layout for all Menu item kinds (addon + label + optional note + trailing).
|
|
7
|
+
* Not a public export.
|
|
8
|
+
*/
|
|
9
|
+
var MenuItemRow = ({ addon, addonAlign = "center", children, note, trailing }) => /* @__PURE__ */ jsxs(Stack, {
|
|
10
|
+
columnGap: "medium",
|
|
11
|
+
direction: "row",
|
|
12
|
+
fillChildren: false,
|
|
13
|
+
hPadding: "small",
|
|
14
|
+
vPadding: "small",
|
|
15
|
+
vAlign: "center",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsxs(Stack, {
|
|
18
|
+
columnGap: "small",
|
|
19
|
+
"data-grow": "true",
|
|
20
|
+
"data-shrink": "true",
|
|
21
|
+
direction: "row",
|
|
22
|
+
fillChildren: false,
|
|
23
|
+
vAlign: addonAlign,
|
|
24
|
+
children: [addon && /* @__PURE__ */ jsx(Stack, {
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
"data-grow": "false",
|
|
27
|
+
"data-shrink": "false",
|
|
28
|
+
children: addon
|
|
29
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
30
|
+
lineHeight: "small",
|
|
31
|
+
size: "small",
|
|
32
|
+
children
|
|
33
|
+
})]
|
|
34
|
+
}),
|
|
35
|
+
note && /* @__PURE__ */ jsx(Text, {
|
|
36
|
+
whiteSpace: "nowrap",
|
|
37
|
+
"data-shrink": "false",
|
|
38
|
+
lineHeight: "small",
|
|
39
|
+
size: "x-small",
|
|
40
|
+
tone: "muted",
|
|
41
|
+
children: note
|
|
42
|
+
}),
|
|
43
|
+
trailing
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { MenuItemRow };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MenuItem as MenuItemPrimitive } from '@base-ui/react/menu';
|
|
2
|
+
import { StackProps } from '../stack';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Public Menu.Item props.
|
|
6
|
+
*
|
|
7
|
+
* @default Base UI pass-through props keep upstream defaults.
|
|
8
|
+
*/
|
|
9
|
+
export type MenuItemProps = MenuItemPrimitive.Props & {
|
|
10
|
+
/**
|
|
11
|
+
* Decorative leading node rendered before the item label.
|
|
12
|
+
*
|
|
13
|
+
* @default No addon is rendered.
|
|
14
|
+
*/
|
|
15
|
+
addon?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Vertical alignment of the addon relative to the label row.
|
|
18
|
+
*
|
|
19
|
+
* @default 'center'
|
|
20
|
+
*/
|
|
21
|
+
addonAlign?: StackProps['vAlign'];
|
|
22
|
+
/**
|
|
23
|
+
* End-aligned secondary text (e.g. keyboard shortcut). Rendered muted `x-small`
|
|
24
|
+
* at the end of the row (replaces the empty indicator spacer when set).
|
|
25
|
+
*
|
|
26
|
+
* @default No note is rendered.
|
|
27
|
+
*/
|
|
28
|
+
note?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Visual sentiment. `destructive` uses highlight-red wash + text.
|
|
31
|
+
*
|
|
32
|
+
* @default Neutral item styling.
|
|
33
|
+
*/
|
|
34
|
+
sentiment?: 'destructive';
|
|
35
|
+
};
|
|
36
|
+
export declare const MenuItem: React.FC<MenuItemProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { clsx } from "../../core/clsx.js";
|
|
2
|
+
import { Surface } from "../surface/surface.js";
|
|
3
|
+
import menu_module_default from "./menu.module.js";
|
|
4
|
+
import { MenuIndicatorSlot } from "./menu-indicator-slot.js";
|
|
5
|
+
import { MenuItemRow } from "./menu-item-row.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { Menu } from "@base-ui/react/menu";
|
|
8
|
+
//#region src/components/menu/menu-item.tsx
|
|
9
|
+
var MenuItem = ({ addon, addonAlign = "center", children, className, note, sentiment, ...otherProps }) => /* @__PURE__ */ jsx(Menu.Item, {
|
|
10
|
+
...otherProps,
|
|
11
|
+
className: clsx(menu_module_default.Item, className),
|
|
12
|
+
...sentiment && { "data-sentiment": sentiment },
|
|
13
|
+
render: /* @__PURE__ */ jsx(Surface, { radius: "auto" }),
|
|
14
|
+
children: /* @__PURE__ */ jsx(MenuItemRow, {
|
|
15
|
+
addon,
|
|
16
|
+
addonAlign,
|
|
17
|
+
note,
|
|
18
|
+
...!note && { trailing: /* @__PURE__ */ jsx(MenuIndicatorSlot, {}) },
|
|
19
|
+
children
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { MenuItem };
|