@viraui/react 1.0.12 → 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 +16 -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 -0
- package/dist/components/badge/badge.d.ts +39 -0
- package/dist/components/badge/badge.guide.json +59 -0
- package/dist/components/badge/badge.js +50 -0
- package/dist/components/badge/badge.module.js +11 -0
- package/dist/components/badge/index.d.ts +2 -0
- 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 +2 -1
- package/dist/components/button/button.css +1 -1
- package/dist/components/button/button.guide.json +27 -7
- package/dist/components/button/button.js +2 -1
- 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 +2 -1
- package/dist/components/clamp-text/clamp-text.css +1 -1
- package/dist/components/clamp-text/clamp-text.guide.json +9 -0
- package/dist/components/clamp-text/clamp-text.js +1 -1
- 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 +2 -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/masonry/masonry.js +1 -1
- 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 +13 -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 +2 -2
|
@@ -27,9 +27,33 @@
|
|
|
27
27
|
"related": ["Surface", "Button", "IconButton", "Stack", "Elevator"],
|
|
28
28
|
"properties": {
|
|
29
29
|
"react": {
|
|
30
|
+
"Sheet.children": {
|
|
31
|
+
"description": "Optional body content rendered below the description."
|
|
32
|
+
},
|
|
33
|
+
"Sheet.description": {
|
|
34
|
+
"description": "Supporting copy announced with the title."
|
|
35
|
+
},
|
|
36
|
+
"Sheet.fitContent": {
|
|
37
|
+
"description": "Centers the sheet horizontally within the viewport."
|
|
38
|
+
},
|
|
39
|
+
"Sheet.headerAlign": {
|
|
40
|
+
"description": "Aligns the header content."
|
|
41
|
+
},
|
|
42
|
+
"Sheet.maxContentWidth": {
|
|
43
|
+
"description": "Optional maximum width of the content area."
|
|
44
|
+
},
|
|
30
45
|
"Sheet.maxHeight": {
|
|
31
46
|
"description": "Maximum block size of the sheet panel.",
|
|
32
47
|
"refCss": "max-block-size"
|
|
48
|
+
},
|
|
49
|
+
"Sheet.showCloseButton": {
|
|
50
|
+
"description": "Whether to show the close button."
|
|
51
|
+
},
|
|
52
|
+
"Sheet.showHandle": {
|
|
53
|
+
"description": "Whether to show the drag handle above the sheet header."
|
|
54
|
+
},
|
|
55
|
+
"Sheet.title": {
|
|
56
|
+
"description": "Accessible dialog title rendered as the modal heading."
|
|
33
57
|
}
|
|
34
58
|
},
|
|
35
59
|
"css": {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
var Backdrop = "viraui__dialog-module__Backdrop_xgFhs";
|
|
3
3
|
var Viewport = "viraui__dialog-module__Viewport_kmZN1";
|
|
4
4
|
var Popup = "viraui__dialog-module__Popup_5qIyj";
|
|
5
|
-
var Handle = "viraui__dialog-module__Handle_nd9SN";
|
|
6
5
|
var HandleShape = "viraui__dialog-module__HandleShape_mEg8R";
|
|
7
6
|
var Header = "viraui__dialog-module__Header_WnBly";
|
|
8
7
|
var Body = "viraui__dialog-module__Body_9-UgN";
|
|
@@ -14,7 +13,6 @@ var dialog_module_default = {
|
|
|
14
13
|
Backdrop,
|
|
15
14
|
Viewport,
|
|
16
15
|
Popup,
|
|
17
|
-
Handle,
|
|
18
16
|
HandleShape,
|
|
19
17
|
Header,
|
|
20
18
|
Body,
|
|
@@ -24,4 +22,4 @@ var dialog_module_default = {
|
|
|
24
22
|
CloseButton
|
|
25
23
|
};
|
|
26
24
|
//#endregion
|
|
27
|
-
export { Backdrop, Body, CloseButton, Content,
|
|
25
|
+
export { Backdrop, Body, CloseButton, Content, HandleShape, Header, Indent, IndentBackground, Popup, Viewport, dialog_module_default as default };
|
|
@@ -20,5 +20,27 @@
|
|
|
20
20
|
"Wrapping invalid or non-element nodes",
|
|
21
21
|
"Overwriting child transition shorthand without composing box-shadow"
|
|
22
22
|
],
|
|
23
|
-
"related": ["Surface"]
|
|
23
|
+
"related": ["Surface"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"react": {
|
|
26
|
+
"children": {
|
|
27
|
+
"description": "Element or elements that receive elevation hooks on their rendered root."
|
|
28
|
+
},
|
|
29
|
+
"direction": {
|
|
30
|
+
"description": "Shadow cast direction mapped to `data-elevation-direction`."
|
|
31
|
+
},
|
|
32
|
+
"extraShadow": {
|
|
33
|
+
"description": "Additional shadow layer mapped to the `--extra-shadow` custom property."
|
|
34
|
+
},
|
|
35
|
+
"hover": {
|
|
36
|
+
"description": "Hover elevation level mapped to `data-elevation-hover`."
|
|
37
|
+
},
|
|
38
|
+
"resting": {
|
|
39
|
+
"description": "Resting elevation level mapped to `data-elevation`."
|
|
40
|
+
},
|
|
41
|
+
"shadowColor": {
|
|
42
|
+
"description": "Shadow color mapped to the `--shadow-color` custom property."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
24
46
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"Choice groups that need a shared legend, group description, or group error — Field.Root > Fieldset render={<RadioGroup<Value> />} or render={<CheckboxGroup />}",
|
|
8
8
|
"Group validation and helper copy that require a Field.Root ancestor plus Fieldset description or error",
|
|
9
9
|
"Type-safe radio unions via RadioGroup<'ssd' | 'hdd'> merged through Fieldset render",
|
|
10
|
-
"
|
|
10
|
+
"Shared legend plus optional group description/error for a form block — border/section chrome belongs on Surface or the consumer"
|
|
11
11
|
],
|
|
12
12
|
"whenNotToUse": [
|
|
13
13
|
"Every RadioGroup or CheckboxGroup by default — Fieldset is optional when options already have labels and no group copy is needed",
|
|
@@ -18,12 +18,25 @@
|
|
|
18
18
|
"accessibility": [
|
|
19
19
|
"Map visible label to Fieldset.Legend so grouped controls share an accessible section name",
|
|
20
20
|
"Keep group invalid state on Field.Root and surface group error copy through Fieldset error",
|
|
21
|
-
"Pass disabled to Fieldset
|
|
21
|
+
"Pass disabled to `<Fieldset disabled>` when the whole section should ignore interaction"
|
|
22
22
|
],
|
|
23
23
|
"antiPatterns": [
|
|
24
24
|
"Wrapping Fieldset.Root in Stack render — breaks Base UI render merge with RadioGroup or CheckboxGroup",
|
|
25
25
|
"Expecting description or error on Fieldset without a Field.Root ancestor",
|
|
26
26
|
"Omitting RadioGroup<Value> generics when option values are a restricted union"
|
|
27
27
|
],
|
|
28
|
-
"related": ["RadioGroup", "CheckboxGroup", "Textfield", "Textarea", "Select", "Stack"]
|
|
28
|
+
"related": ["RadioGroup", "CheckboxGroup", "Textfield", "Textarea", "Select", "Stack"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"react": {
|
|
31
|
+
"description": {
|
|
32
|
+
"description": "Group helper copy rendered below the legend while valid. Requires a `Field.Root` ancestor for `FieldHelperCopy`."
|
|
33
|
+
},
|
|
34
|
+
"error": {
|
|
35
|
+
"description": "Group error copy rendered below the legend when invalid. Requires a `Field.Root` ancestor."
|
|
36
|
+
},
|
|
37
|
+
"label": {
|
|
38
|
+
"description": "Visible legend copy rendered with shared internal `FieldLabel`."
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
29
42
|
}
|
|
@@ -4,20 +4,20 @@ import { Stack } from "../stack/stack.js";
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Fieldset } from "@base-ui/react";
|
|
6
6
|
//#region src/components/fieldset/fieldset.tsx
|
|
7
|
-
var Fieldset$1 = ({ children, className, description, disabled, error, label, ...
|
|
8
|
-
...
|
|
7
|
+
var Fieldset$1 = ({ children, className, description, disabled, error, label, ...otherProps }) => /* @__PURE__ */ jsxs(Fieldset.Root, {
|
|
8
|
+
...otherProps,
|
|
9
9
|
className,
|
|
10
10
|
disabled,
|
|
11
|
-
children: [/* @__PURE__ */ jsxs(Stack, {
|
|
11
|
+
children: [(label || description || error) && /* @__PURE__ */ jsxs(Stack, {
|
|
12
12
|
vPadding: [0, "small"],
|
|
13
13
|
rowGap: "small",
|
|
14
|
-
children: [label
|
|
14
|
+
children: [label && /* @__PURE__ */ jsx(Fieldset.Legend, {
|
|
15
15
|
render: /* @__PURE__ */ jsx(FieldLabel, {}),
|
|
16
16
|
children: label
|
|
17
|
-
})
|
|
17
|
+
}), (description || error) && /* @__PURE__ */ jsx(FieldHelperCopy, {
|
|
18
18
|
description,
|
|
19
19
|
error
|
|
20
|
-
})
|
|
20
|
+
})]
|
|
21
21
|
}), children]
|
|
22
22
|
});
|
|
23
23
|
//#endregion
|
|
@@ -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 };
|
|
@@ -2,6 +2,7 @@ export * from './accordion';
|
|
|
2
2
|
export * from './annotate';
|
|
3
3
|
export * from './avatar';
|
|
4
4
|
export * from './avatar-group';
|
|
5
|
+
export * from './badge';
|
|
5
6
|
export * from './bleed';
|
|
6
7
|
export * from './button';
|
|
7
8
|
export * from './checkbox';
|
|
@@ -14,6 +15,7 @@ export * from './fit-text';
|
|
|
14
15
|
export * from './icon-button';
|
|
15
16
|
export * from './linear-progress';
|
|
16
17
|
export * from './masonry';
|
|
18
|
+
export * from './menu';
|
|
17
19
|
export * from './meter';
|
|
18
20
|
export * from './popover';
|
|
19
21
|
export * from './progressive-blur';
|
|
@@ -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
|
}
|
|
@@ -6,8 +6,8 @@ import { Stack } from "../stack/stack.js";
|
|
|
6
6
|
import masonry_module_default from "./masonry.module.js";
|
|
7
7
|
import { MasonryItem } from "./masonry-item.js";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
10
9
|
import { Children, useEffect, useRef, useState } from "react";
|
|
10
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
11
11
|
//#region src/components/masonry/masonry.tsx
|
|
12
12
|
var DEFAULT_BREAKPOINT_COLS = {
|
|
13
13
|
default: 1,
|
|
@@ -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>;
|