@viraui/react 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog.json +44 -2
- package/dist/components/accordion/accordion-item.d.ts +58 -0
- package/dist/components/accordion/accordion-item.js +65 -0
- package/dist/components/accordion/accordion.css +1 -0
- package/dist/components/accordion/accordion.d.ts +26 -0
- package/dist/components/accordion/accordion.guide.json +30 -0
- package/dist/components/accordion/accordion.js +22 -0
- package/dist/components/accordion/accordion.module.js +10 -0
- package/dist/components/accordion/index.d.ts +3 -0
- package/dist/components/avatar/avatar.css +1 -1
- package/dist/components/avatar/avatar.guide.json +25 -1
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/avatar-group/avatar-group.css +7 -1
- package/dist/components/avatar-group/avatar-group.d.ts +0 -7
- package/dist/components/avatar-group/avatar-group.guide.json +27 -1
- package/dist/components/avatar-group/avatar-group.js +3 -10
- package/dist/components/basic-input/basic-input.css +1 -1
- package/dist/components/basic-input/basic-input.js +3 -3
- package/dist/components/basic-input/field-label.css +1 -1
- package/dist/components/bleed/bleed.css +1 -0
- package/dist/components/bleed/bleed.d.ts +26 -0
- package/dist/components/bleed/bleed.guide.json +39 -0
- package/dist/components/bleed/bleed.js +24 -0
- package/dist/components/bleed/bleed.module.js +3 -0
- package/dist/components/bleed/index.d.ts +2 -0
- package/dist/components/button/button.css +1 -1
- package/dist/components/button/button.guide.json +33 -3
- package/dist/components/button/button.js +1 -1
- package/dist/components/checkbox/checkbox-group.js +2 -2
- package/dist/components/checkbox/checkbox.css +1 -1
- package/dist/components/chip/chip.css +1 -1
- package/dist/components/chip/chip.guide.json +26 -1
- package/dist/components/clamp-text/clamp-text.css +1 -1
- package/dist/components/clamp-text/clamp-text.guide.json +15 -1
- package/dist/components/clamp-text/clamp-text.js +1 -1
- package/dist/components/dialog/dialog-close.js +2 -2
- package/dist/components/dialog/dialog-indent-background.js +2 -2
- package/dist/components/dialog/dialog-indent.js +2 -2
- package/dist/components/dialog/dialog-sheet.js +1 -1
- package/dist/components/dialog/dialog-trigger.js +2 -2
- package/dist/components/dialog/dialog.css +1 -1
- package/dist/components/dialog/dialog.d.ts +5 -4
- package/dist/components/dialog/dialog.guide.json +15 -1
- package/dist/components/dialog/dialog.js +4 -3
- package/dist/components/fieldset/fieldset.js +1 -2
- package/dist/components/icon-button/icon-button.js +2 -2
- package/dist/components/index.d.ts +7 -0
- package/dist/components/linear-progress/linear-progress.css +1 -1
- package/dist/components/linear-progress/linear-progress.guide.json +14 -1
- package/dist/components/masonry/masonry.css +1 -1
- package/dist/components/masonry/masonry.guide.json +42 -1
- package/dist/components/masonry/masonry.js +3 -3
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/meter.css +1 -0
- package/dist/components/meter/meter.d.ts +44 -0
- package/dist/components/meter/meter.guide.json +39 -0
- package/dist/components/meter/meter.js +59 -0
- package/dist/components/meter/meter.module.js +7 -0
- package/dist/components/popover/index.d.ts +4 -0
- package/dist/components/popover/popover-sheet.d.ts +65 -0
- package/dist/components/popover/popover-sheet.js +79 -0
- package/dist/components/popover/popover.css +1 -0
- package/dist/components/popover/popover.d.ts +74 -0
- package/dist/components/popover/popover.guide.json +28 -0
- package/dist/components/popover/popover.js +23 -0
- package/dist/components/popover/popover.module.js +8 -0
- package/dist/components/progressive-blur/progressive-blur.css +1 -1
- package/dist/components/progressive-blur/progressive-blur.guide.json +15 -1
- package/dist/components/progressive-blur/progressive-blur.js +1 -1
- package/dist/components/radio/radio-group.d.ts +1 -1
- package/dist/components/radio/radio-group.js +2 -2
- package/dist/components/radio/radio.css +1 -1
- package/dist/components/select/select-option.js +1 -1
- package/dist/components/select/select.css +1 -1
- package/dist/components/select/select.guide.json +26 -1
- package/dist/components/select/select.js +1 -0
- package/dist/components/separator/separator.css +1 -1
- package/dist/components/separator/separator.js +1 -1
- package/dist/components/shimmer/index.d.ts +2 -0
- package/dist/components/shimmer/shimmer.css +1 -0
- package/dist/components/shimmer/shimmer.d.ts +43 -0
- package/dist/components/shimmer/shimmer.guide.json +63 -0
- package/dist/components/shimmer/shimmer.js +25 -0
- package/dist/components/shimmer/shimmer.module.js +6 -0
- package/dist/components/skeleton/skeleton.css +1 -1
- package/dist/components/skeleton/skeleton.guide.json +50 -1
- package/dist/components/skeleton/skeleton.js +5 -5
- package/dist/components/slider/slider.css +1 -1
- package/dist/components/slider/slider.guide.json +20 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/spinner/spinner.css +1 -1
- package/dist/components/spinner/spinner.guide.json +15 -1
- package/dist/components/stack/stack.css +1 -1
- package/dist/components/stack/stack.d.ts +1 -1
- package/dist/components/stack/stack.guide.json +84 -4
- package/dist/components/stack/stack.js +8 -8
- package/dist/components/surface/surface-radius-context.js +6 -6
- package/dist/components/surface/surface.css +1 -1
- package/dist/components/surface/surface.d.ts +1 -1
- package/dist/components/surface/surface.guide.json +90 -4
- package/dist/components/surface/surface.js +8 -8
- package/dist/components/switch/switch.css +1 -1
- package/dist/components/switch/switch.guide.json +32 -1
- package/dist/components/tabs/tabs-indicator.js +2 -2
- package/dist/components/tabs/tabs-list.js +2 -2
- package/dist/components/tabs/tabs-panel.js +2 -2
- package/dist/components/tabs/tabs-tab.js +2 -2
- package/dist/components/tabs/tabs-viewport.js +2 -2
- package/dist/components/tabs/tabs.css +1 -1
- package/dist/components/tabs/tabs.guide.json +8 -1
- package/dist/components/tabs/tabs.js +2 -2
- package/dist/components/text/text.css +1 -1
- package/dist/components/text/text.guide.json +125 -1
- package/dist/components/text/text.js +11 -11
- package/dist/components/textarea/textarea.css +1 -1
- package/dist/components/textarea/textarea.guide.json +14 -1
- package/dist/components/textfield/textfield.css +1 -1
- package/dist/components/textfield/textfield.guide.json +20 -1
- package/dist/components/title/title.css +1 -1
- package/dist/components/title/title.guide.json +123 -1
- package/dist/components/title/title.js +11 -11
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/toast-action.d.ts +9 -0
- package/dist/components/toast/toast-action.js +10 -0
- package/dist/components/toast/toast-banner.d.ts +59 -0
- package/dist/components/toast/toast-banner.js +66 -0
- package/dist/components/toast/toast-viewport.d.ts +17 -0
- package/dist/components/toast/toast-viewport.js +12 -0
- package/dist/components/toast/toast.css +1 -0
- package/dist/components/toast/toast.d.ts +18 -0
- package/dist/components/toast/toast.guide.json +26 -0
- package/dist/components/toast/toast.js +22 -0
- package/dist/components/toast/toast.module.js +7 -0
- package/dist/core/props/intrinsic-vira-props.js +3 -3
- package/dist/index.js +8 -1
- package/dist/preflight-surface.json +17 -4
- package/dist/preflight.css +1 -1
- package/package.json +13 -5
package/dist/catalog.json
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
"version": 1,
|
|
3
3
|
"package": "@viraui/react",
|
|
4
4
|
"components": [
|
|
5
|
+
{
|
|
6
|
+
"id": "accordion",
|
|
7
|
+
"name": "Accordion",
|
|
8
|
+
"summary": "Collapsible sections grouped into open/closed blocks with optional Surface wrapping, shared corner radius, and background on open items.",
|
|
9
|
+
"guidePath": "./components/accordion/accordion.guide.json"
|
|
10
|
+
},
|
|
5
11
|
{
|
|
6
12
|
"id": "avatar",
|
|
7
13
|
"name": "Avatar",
|
|
@@ -14,6 +20,18 @@
|
|
|
14
20
|
"summary": "Overlapping avatar stack with shared sizing, directional layout, and an optional overflow pill.",
|
|
15
21
|
"guidePath": "./components/avatar-group/avatar-group.guide.json"
|
|
16
22
|
},
|
|
23
|
+
{
|
|
24
|
+
"id": "accordion",
|
|
25
|
+
"name": "Accordion",
|
|
26
|
+
"summary": "Collapsible sections grouped into open/closed blocks with optional Surface wrapping, shared corner radius, and background on open items.",
|
|
27
|
+
"guidePath": "./components/accordion/accordion.guide.json"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "bleed",
|
|
31
|
+
"name": "Bleed",
|
|
32
|
+
"summary": "Layout utility that pulls content past inline padding using negative margins or full viewport bleed.",
|
|
33
|
+
"guidePath": "./components/bleed/bleed.guide.json"
|
|
34
|
+
},
|
|
17
35
|
{
|
|
18
36
|
"id": "chip",
|
|
19
37
|
"name": "Chip",
|
|
@@ -56,12 +74,24 @@
|
|
|
56
74
|
"summary": "Shows determinate or indeterminate progress for a task in a compact horizontal track.",
|
|
57
75
|
"guidePath": "./components/linear-progress/linear-progress.guide.json"
|
|
58
76
|
},
|
|
77
|
+
{
|
|
78
|
+
"id": "meter",
|
|
79
|
+
"name": "Meter",
|
|
80
|
+
"summary": "Shows a determinate metric in a compact horizontal track for static capacity, level, or score values.",
|
|
81
|
+
"guidePath": "./components/meter/meter.guide.json"
|
|
82
|
+
},
|
|
59
83
|
{
|
|
60
84
|
"id": "masonry",
|
|
61
85
|
"name": "Masonry",
|
|
62
86
|
"summary": "Multi-column layout primitive for read-only mixed-height content walls.",
|
|
63
87
|
"guidePath": "./components/masonry/masonry.guide.json"
|
|
64
88
|
},
|
|
89
|
+
{
|
|
90
|
+
"id": "popover",
|
|
91
|
+
"name": "Popover",
|
|
92
|
+
"summary": "Compound popover built on Base UI Popover with `Popover.Trigger`, `Popover.Sheet`, `Popover.Close`, `Popover.Title`, `Popover.Description`, and `Popover.createHandle` for detached and multiple triggers; `Sheet` encapsulates Portal + Positioner + Popup + Viewport + Title + Description and animates position, size, and content between triggers; `Sheet` with `unstyled` skips the built-in Surface and header so the consumer composes the popup chrome, including `Popover.Title` and `Popover.Description`.",
|
|
93
|
+
"guidePath": "./components/popover/popover.guide.json"
|
|
94
|
+
},
|
|
65
95
|
{
|
|
66
96
|
"id": "textfield",
|
|
67
97
|
"name": "Textfield",
|
|
@@ -116,6 +146,12 @@
|
|
|
116
146
|
"summary": "Thematic or content divider with horizontal or vertical orientation, token padding, and preset line thickness.",
|
|
117
147
|
"guidePath": "./components/separator/separator.guide.json"
|
|
118
148
|
},
|
|
149
|
+
{
|
|
150
|
+
"id": "shimmer",
|
|
151
|
+
"name": "Shimmer",
|
|
152
|
+
"summary": "Decorative inline text shimmer that inherits typography and color from a parent text primitive.",
|
|
153
|
+
"guidePath": "./components/shimmer/shimmer.guide.json"
|
|
154
|
+
},
|
|
119
155
|
{
|
|
120
156
|
"id": "icon",
|
|
121
157
|
"name": "Icon",
|
|
@@ -131,13 +167,13 @@
|
|
|
131
167
|
{
|
|
132
168
|
"id": "stack",
|
|
133
169
|
"name": "Stack",
|
|
134
|
-
"summary": "Flex layout primitive for arranging children with token spacing, alignment, and padding.",
|
|
170
|
+
"summary": "Flex layout primitive for arranging children with token spacing, alignment, and padding; root is a named CSS container query context (`stack`).",
|
|
135
171
|
"guidePath": "./components/stack/stack.guide.json"
|
|
136
172
|
},
|
|
137
173
|
{
|
|
138
174
|
"id": "surface",
|
|
139
175
|
"name": "Surface",
|
|
140
|
-
"summary": "Presentational container with token background, optional border, radius, and padding; nested surfaces use radius=\"auto\" for concentric corners.",
|
|
176
|
+
"summary": "Presentational container with token background, optional border, radius, and padding; nested surfaces use radius=\"auto\" for concentric corners; root is a named CSS container query context (`surface`).",
|
|
141
177
|
"guidePath": "./components/surface/surface.guide.json"
|
|
142
178
|
},
|
|
143
179
|
{
|
|
@@ -146,6 +182,12 @@
|
|
|
146
182
|
"summary": "Compound segmented tab control with Surface list chrome, moving indicator, and animated panels.",
|
|
147
183
|
"guidePath": "./components/tabs/tabs.guide.json"
|
|
148
184
|
},
|
|
185
|
+
{
|
|
186
|
+
"id": "toast",
|
|
187
|
+
"name": "Toast",
|
|
188
|
+
"summary": "Transient notification surface with stacked or anchored placement, Banner high-level API, and optional action buttons.",
|
|
189
|
+
"guidePath": "./components/toast/toast.guide.json"
|
|
190
|
+
},
|
|
149
191
|
{
|
|
150
192
|
"id": "spinner",
|
|
151
193
|
"name": "Spinner",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AccordionItem } from '@base-ui/react/accordion';
|
|
2
|
+
import { SurfaceProps } from '../surface';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Public Accordion.Item props.
|
|
6
|
+
*
|
|
7
|
+
* Wraps Base UI accordion item parts with optional Surface layout and panel height animation.
|
|
8
|
+
* Island separation between open/closed blocks is controlled by the root `Accordion` `islands` prop for surface items.
|
|
9
|
+
*
|
|
10
|
+
* @default Base UI pass-through props keep upstream defaults.
|
|
11
|
+
*/
|
|
12
|
+
export type AccordionItemProps = AccordionItem.Props & {
|
|
13
|
+
/**
|
|
14
|
+
* Visible trigger label rendered inside the accordion header button.
|
|
15
|
+
*
|
|
16
|
+
* @default No trigger label is rendered.
|
|
17
|
+
*/
|
|
18
|
+
trigger: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Panel content revealed when the item is open.
|
|
21
|
+
*
|
|
22
|
+
* @default No panel content is rendered.
|
|
23
|
+
*/
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* When `true`, wraps the item in `Surface` with border and open-block background.
|
|
27
|
+
* When `false`, renders without `Surface` so consumers can insert `Separator` between items;
|
|
28
|
+
* island styling is skipped for that item.
|
|
29
|
+
*
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
useSurface?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Side of the trigger label where the expand/collapse icon is rendered.
|
|
35
|
+
*
|
|
36
|
+
* @default end
|
|
37
|
+
*/
|
|
38
|
+
iconPosition?: 'start' | 'end';
|
|
39
|
+
/**
|
|
40
|
+
* Decorative icon shown when the item is closed.
|
|
41
|
+
*
|
|
42
|
+
* @default `<Icon name="Plus" size={16} />`
|
|
43
|
+
*/
|
|
44
|
+
iconClosed?: React.ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* Decorative icon shown when the item is open.
|
|
47
|
+
*
|
|
48
|
+
* @default `<Icon name="Minus" size={16} />`
|
|
49
|
+
*/
|
|
50
|
+
iconOpen?: React.ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Resting background for the item card, forwarded to the wrapping `Surface` when `useSurface` is `true`.
|
|
53
|
+
*
|
|
54
|
+
* @default 1
|
|
55
|
+
*/
|
|
56
|
+
color?: SurfaceProps['color'];
|
|
57
|
+
};
|
|
58
|
+
export declare const AccordionItemComponent: React.FC<AccordionItemProps>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { clsx } from "../../core/clsx.js";
|
|
2
|
+
import accordion_module_default from "./accordion.module.js";
|
|
3
|
+
import { Stack } from "../stack/stack.js";
|
|
4
|
+
import { Text } from "../text/text.js";
|
|
5
|
+
import { Icon } from "../icon/icon.js";
|
|
6
|
+
import { Surface } from "../surface/surface.js";
|
|
7
|
+
import { Accordion } from "@base-ui/react/accordion";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/accordion/accordion-item.tsx
|
|
10
|
+
var AccordionItemComponent = ({ children, className, color = 1, iconClosed = /* @__PURE__ */ jsx(Icon, {
|
|
11
|
+
name: "Plus",
|
|
12
|
+
size: 16
|
|
13
|
+
}), iconOpen = /* @__PURE__ */ jsx(Icon, {
|
|
14
|
+
name: "Minus",
|
|
15
|
+
size: 16
|
|
16
|
+
}), iconPosition = "end", trigger, useSurface = true, ...otherProps }) => {
|
|
17
|
+
const iconAtStart = iconPosition === "start";
|
|
18
|
+
const triggerIcon = /* @__PURE__ */ jsxs("span", {
|
|
19
|
+
"aria-hidden": true,
|
|
20
|
+
className: accordion_module_default.IconSlot,
|
|
21
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
22
|
+
className: accordion_module_default.Icon,
|
|
23
|
+
children: iconClosed
|
|
24
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
25
|
+
className: accordion_module_default.Icon,
|
|
26
|
+
children: iconOpen
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ jsxs(Accordion.Item, {
|
|
30
|
+
className: clsx(accordion_module_default.Item, className),
|
|
31
|
+
"data-use-surface": useSurface ? "true" : "false",
|
|
32
|
+
...useSurface && { render: /* @__PURE__ */ jsx(Surface, {
|
|
33
|
+
border: "all",
|
|
34
|
+
color
|
|
35
|
+
}) },
|
|
36
|
+
...otherProps,
|
|
37
|
+
children: [/* @__PURE__ */ jsx(Accordion.Header, { children: /* @__PURE__ */ jsxs(Accordion.Trigger, {
|
|
38
|
+
className: accordion_module_default.Trigger,
|
|
39
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
40
|
+
columnGap: iconAtStart ? "small" : void 0,
|
|
41
|
+
direction: iconAtStart ? "row" : "row-reverse",
|
|
42
|
+
fillChildren: false,
|
|
43
|
+
hAlign: iconPosition === "end" ? "space-between" : "start",
|
|
44
|
+
hPadding: "medium",
|
|
45
|
+
render: /* @__PURE__ */ jsx("button", { type: "button" }),
|
|
46
|
+
vAlign: "center",
|
|
47
|
+
vPadding: "medium"
|
|
48
|
+
}),
|
|
49
|
+
children: [triggerIcon, /* @__PURE__ */ jsx(Text, {
|
|
50
|
+
weight: "semibold",
|
|
51
|
+
children: trigger
|
|
52
|
+
})]
|
|
53
|
+
}) }), /* @__PURE__ */ jsx(Accordion.Panel, {
|
|
54
|
+
className: accordion_module_default.Panel,
|
|
55
|
+
children: /* @__PURE__ */ jsx(Stack, {
|
|
56
|
+
fillChildren: false,
|
|
57
|
+
hPadding: "medium",
|
|
58
|
+
vPadding: ["2x-small", "medium"],
|
|
59
|
+
children
|
|
60
|
+
})
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { AccordionItemComponent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.viraui__accordion-module__Accordion_wFOlN{--vui-accordion-island-gap:var(--space-medium);--trigger-radius:var(--radius-large);inline-size:100%;&:dir(rtl) .viraui__accordion-module__Trigger_4HzIb[data-stack-direction=row-reverse]{direction:ltr;flex-direction:row}}.viraui__accordion-module__Item_66o2x{inline-size:100%;transition:margin var(--duration-fast) var(--easing-standard),background var(--duration-fast) var(--easing-standard),border-radius var(--duration-fast) var(--easing-standard);&[data-use-surface=true]{--vui-surface-border-radius-top-left:0;--vui-surface-border-radius-top-right:0;--vui-surface-border-radius-bottom-right:0;--vui-surface-border-radius-bottom-left:0;&:not([data-open]){--vui-surface-background:#0000}&:not([data-open])+&:not([data-open]),&[data-open]+&[data-open]{border-top-width:0}&:first-child,&:not([data-open])+&[data-open],&[data-open]+&:not([data-open]){--vui-surface-border-radius-top-left:var(--trigger-radius);--vui-surface-border-radius-top-right:var(--trigger-radius)}&:last-child,&:not([data-open]):has(+&[data-open]),&[data-open]:has(+&:not([data-open])){--vui-surface-border-radius-bottom-left:var(--trigger-radius);--vui-surface-border-radius-bottom-right:var(--trigger-radius)}&:not(:last-child):not([data-open]):has(+&[data-open]),&:not(:last-child)[data-open]:has(+&:not([data-open])){margin-block-end:var(--vui-accordion-island-gap)}}.viraui__accordion-module__Accordion_wFOlN[data-islands=false] &[data-use-surface=true]{&:not(:first-child){border-top-width:0}&:not([data-open])+&[data-open],&[data-open]+&:not([data-open]){--vui-surface-border-radius-top-left:0;--vui-surface-border-radius-top-right:0}&:not([data-open]):has(+&[data-open]),&[data-open]:has(+&:not([data-open])){--vui-surface-border-radius-bottom-left:0;--vui-surface-border-radius-bottom-right:0}&:not(:last-child):not([data-open]):has(+&[data-open]),&:not(:last-child)[data-open]:has(+&:not([data-open])){margin-block-end:0}}}.viraui__accordion-module__Trigger_4HzIb{inline-size:100%;border:0;background:#0000;cursor:pointer;text-align:start;color:inherit;&:focus-visible{outline-offset:-4px}&[data-disabled]{cursor:not-allowed;opacity:.5}.viraui__accordion-module__Item_66o2x[data-use-surface=true] &{&:focus-visible{border-radius:var(--radius-large);outline-offset:-4px}}}.viraui__accordion-module__IconSlot_AVQq3{position:relative;flex-shrink:0;inline-size:1rem;block-size:1rem}.viraui__accordion-module__Icon_qdu2v{position:absolute;inset:0;display:grid;place-items:center;transition:opacity var(--duration-fast) var(--easing-standard),rotate var(--duration-fast) var(--easing-standard);&:first-of-type{opacity:1;rotate:0deg}&:last-of-type{opacity:0;rotate:-90deg}.viraui__accordion-module__Trigger_4HzIb[data-panel-open] &:first-of-type{opacity:0;rotate:90deg}.viraui__accordion-module__Trigger_4HzIb[data-panel-open] &:last-of-type{opacity:1;rotate:0deg}@media (prefers-reduced-motion:reduce){transition:none}}.viraui__accordion-module__Panel_U1Ofk{block-size:var(--accordion-panel-height);overflow:hidden;transition:block-size var(--duration-fast) var(--easing-standard);&[data-ending-style],&[data-starting-style]{block-size:0}@media (prefers-reduced-motion:reduce){transition:none}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AccordionRoot } from '@base-ui/react/accordion';
|
|
2
|
+
import { AccordionItemProps } from './accordion-item';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Public Accordion root props.
|
|
6
|
+
*
|
|
7
|
+
* Includes Base UI accordion root props such as `value`, `defaultValue`, `multiple`,
|
|
8
|
+
* and `onValueChange`.
|
|
9
|
+
*
|
|
10
|
+
* @default Base UI pass-through props keep upstream defaults.
|
|
11
|
+
*/
|
|
12
|
+
export type AccordionProps = AccordionRoot.Props & {
|
|
13
|
+
/**
|
|
14
|
+
* When `true`, open/closed blocks render as separated Surface islands with gap between them.
|
|
15
|
+
* When `false`, blocks stay attached with corner radius only on the first and last items.
|
|
16
|
+
* Applies only to items with `useSurface`.
|
|
17
|
+
*
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
islands?: boolean;
|
|
21
|
+
};
|
|
22
|
+
type AccordionComponent = React.FC<AccordionProps> & {
|
|
23
|
+
Item: React.FC<AccordionItemProps>;
|
|
24
|
+
};
|
|
25
|
+
export declare const Accordion: AccordionComponent;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Accordion",
|
|
3
|
+
"summary": "Collapsible sections grouped into open/closed blocks with optional Surface wrapping, shared corner radius, and background on open items.",
|
|
4
|
+
"whenToUse": [
|
|
5
|
+
"Progressive disclosure for related content sections in one surface",
|
|
6
|
+
"FAQ or settings groups where only one section may be open by default",
|
|
7
|
+
"Multiple open sections when `multiple` is enabled"
|
|
8
|
+
],
|
|
9
|
+
"whenNotToUse": [
|
|
10
|
+
"Primary navigation that should use links, tabs, or routes directly",
|
|
11
|
+
"Expecting to compose public Header/Trigger/Panel parts; those are owned by `Accordion.Item`"
|
|
12
|
+
],
|
|
13
|
+
"accessibility": [
|
|
14
|
+
"Provide meaningful `trigger` text so each section has an accessible name",
|
|
15
|
+
"Use `value` when controlling or identifying items programmatically",
|
|
16
|
+
"Disabled items cannot be expanded through pointer or keyboard"
|
|
17
|
+
],
|
|
18
|
+
"antiPatterns": [
|
|
19
|
+
"Trying to compose separate public `Accordion.Header`, `Accordion.Trigger`, or `Accordion.Panel` exports",
|
|
20
|
+
"Rendering an item without trigger text and without an external aria-label strategy"
|
|
21
|
+
],
|
|
22
|
+
"related": ["Surface", "Separator", "Stack", "Text", "Icon"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"css": {
|
|
25
|
+
"island-gap": {
|
|
26
|
+
"description": "Gap between separated Surface islands when islands={true}."
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './accordion.css';
|
|
2
|
+
import { clsx } from "../../core/clsx.js";
|
|
3
|
+
import accordion_module_default from "./accordion.module.js";
|
|
4
|
+
import { AccordionItemComponent } from "./accordion-item.js";
|
|
5
|
+
import { Stack } from "../stack/stack.js";
|
|
6
|
+
import { Accordion } from "@base-ui/react/accordion";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/accordion/accordion.tsx
|
|
9
|
+
var AccordionRootComponent = ({ children, className, islands = true, ...otherProps }) => /* @__PURE__ */ jsx(Accordion.Root, {
|
|
10
|
+
...otherProps,
|
|
11
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
12
|
+
className: clsx(accordion_module_default.Accordion, className),
|
|
13
|
+
"data-islands": islands ? "true" : "false",
|
|
14
|
+
direction: "column",
|
|
15
|
+
fillChildren: false
|
|
16
|
+
}),
|
|
17
|
+
hiddenUntilFound: true,
|
|
18
|
+
children
|
|
19
|
+
});
|
|
20
|
+
var Accordion$1 = Object.assign(AccordionRootComponent, { Item: AccordionItemComponent });
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Accordion$1 as Accordion };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var accordion_module_default = {
|
|
2
|
+
Accordion: "viraui__accordion-module__Accordion_wFOlN",
|
|
3
|
+
Trigger: "viraui__accordion-module__Trigger_4HzIb",
|
|
4
|
+
Item: "viraui__accordion-module__Item_66o2x",
|
|
5
|
+
IconSlot: "viraui__accordion-module__IconSlot_AVQq3",
|
|
6
|
+
Icon: "viraui__accordion-module__Icon_qdu2v",
|
|
7
|
+
Panel: "viraui__accordion-module__Panel_U1Ofk"
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { accordion_module_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.viraui__avatar-module__Avatar_BRuS3{--avatar-size:var(--space-2x-large);--avatar-background:var(--global-contrast);--avatar-foreground:var(--global-foreground);--avatar-radius:var(--radius-
|
|
1
|
+
.viraui__avatar-module__Avatar_BRuS3{--vui-avatar-size:var(--space-2x-large);--vui-avatar-background:var(--global-contrast);--vui-avatar-foreground:var(--global-foreground);--vui-avatar-radius:var(--radius-medium);display:inline-flex;align-items:center;justify-content:center;inline-size:var(--vui-avatar-size);block-size:var(--vui-avatar-size);min-inline-size:var(--vui-avatar-size);min-block-size:var(--vui-avatar-size);overflow:hidden;border-radius:var(--vui-avatar-radius);background:var(--vui-avatar-background);color:var(--vui-avatar-foreground);vertical-align:middle;-webkit-user-select:none;user-select:none;container-name:viraui-avatar;container-type:inline-size;&[data-size=x-small]{--vui-avatar-size:var(--space-large);--vui-avatar-radius:var(--radius-small)}&[data-size=small]{--vui-avatar-size:var(--space-2x-large)}&[data-size=regular]{--vui-avatar-size:var(--space-wide)}&[data-size=big]{--vui-avatar-size:var(--space-2x-wide);--vui-avatar-radius:var(--radius-large)}}.viraui__avatar-module__Image_Q7bHi{inline-size:100%;block-size:100%;display:block;object-fit:cover}.viraui__avatar-module__Label_QASTF{font-size:30cqw}
|
|
@@ -16,5 +16,29 @@
|
|
|
16
16
|
"Relying on Avatar children for layout sizing",
|
|
17
17
|
"Omitting meaningful alt text when the image conveys identity"
|
|
18
18
|
],
|
|
19
|
-
"related": ["Skeleton"]
|
|
19
|
+
"related": ["Skeleton"],
|
|
20
|
+
"properties": {
|
|
21
|
+
"react": {
|
|
22
|
+
"size": {
|
|
23
|
+
"description": "Selects the rendered avatar footprint.",
|
|
24
|
+
"refCss": "size"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"css": {
|
|
28
|
+
"size": {
|
|
29
|
+
"description": "Avatar inline and block size on the root.",
|
|
30
|
+
"refReact": "size"
|
|
31
|
+
},
|
|
32
|
+
"radius": {
|
|
33
|
+
"description": "Corner radius on the root; size presets also adjust this.",
|
|
34
|
+
"refReact": "size"
|
|
35
|
+
},
|
|
36
|
+
"background": {
|
|
37
|
+
"description": "Root background fill behind image or fallback."
|
|
38
|
+
},
|
|
39
|
+
"foreground": {
|
|
40
|
+
"description": "Root foreground color for fallback content."
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
20
44
|
}
|
|
@@ -4,8 +4,8 @@ import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props
|
|
|
4
4
|
import avatar_module_default from "./avatar.module.js";
|
|
5
5
|
import { Text } from "../text/text.js";
|
|
6
6
|
import { Skeleton } from "../skeleton/skeleton.js";
|
|
7
|
-
import { Avatar } from "@base-ui/react/avatar";
|
|
8
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Avatar } from "@base-ui/react/avatar";
|
|
9
9
|
//#region src/components/avatar/avatar.tsx
|
|
10
10
|
var fallbackTextSizeByAvatarSize = {
|
|
11
11
|
"x-small": "x-small",
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
.viraui__avatar-group-module__AvatarGroup_zOrR-{--avatar-size:var(--space-2x-large);--avatar-overlap-distance:var(--space-
|
|
1
|
+
.viraui__avatar-group-module__AvatarGroup_zOrR-{--vui-avatar-group-size:var(--space-2x-large);--vui-avatar-group-overlap-distance:var(--space-small);--vui-avatar-group-gap-size:var(--space-x-small);--vui-avatar-group-item-radius:var(--radius-medium);display:inline-flex;flex-wrap:nowrap;align-items:flex-start;min-inline-size:max-content;vertical-align:middle;&[data-direction=vertical]{flex-direction:column}&[data-size=x-small]{--vui-avatar-group-size:var(--space-large);--vui-avatar-group-overlap-distance:var(--space-x-small);--vui-avatar-group-gap-size:var(--space-2x-small);--vui-avatar-group-item-radius:var(--radius-small)}&[data-size=small]{--vui-avatar-group-size:var(--space-2x-large);--vui-avatar-group-overlap-distance:var(--space-medium);--vui-avatar-group-gap-size:var(--space-x-small)}&[data-size=regular]{--vui-avatar-group-size:var(--space-wide);--vui-avatar-group-overlap-distance:var(--space-medium);--vui-avatar-group-gap-size:var(--space-x-small)}&[data-size=big]{--vui-avatar-group-size:var(--space-2x-wide);--vui-avatar-group-overlap-distance:var(--space-large);--vui-avatar-group-gap-size:var(--space-small);--vui-avatar-group-item-radius:var(--radius-large)}}.viraui__avatar-group-module__AvatarWrapper_0opqY{position:relative;display:inline-flex;flex:0 0 auto;inline-size:var(--vui-avatar-group-size);block-size:var(--vui-avatar-group-size);.viraui__avatar-group-module__AvatarGroup_zOrR-[data-direction=horizontal] &:not(:first-child){margin-inline-start:calc(var(--vui-avatar-group-overlap-distance) * -1)}.viraui__avatar-group-module__AvatarGroup_zOrR-[data-direction=vertical] &:not(:first-child){margin-block-start:calc(var(--vui-avatar-group-overlap-distance) * -1)}--avatar-hole-half:calc((var(--vui-avatar-group-size) / 2) + var(--vui-avatar-group-gap-size));--avatar-hole-r:calc(min(var(--vui-avatar-group-item-radius), var(--vui-avatar-group-size) / 2) + var(--vui-avatar-group-gap-size));.viraui__avatar-group-module__AvatarGroup_zOrR-:dir(ltr)[data-direction=horizontal] &:not(:last-child){--avatar-hole-cx:calc(100% + (var(--vui-avatar-group-size) / 2) - var(--vui-avatar-group-overlap-distance));--avatar-hole-cy:50%}.viraui__avatar-group-module__AvatarGroup_zOrR-:dir(rtl)[data-direction=horizontal] &:not(:last-child){--avatar-hole-cx:calc(var(--vui-avatar-group-overlap-distance) - (var(--vui-avatar-group-size) / 2));--avatar-hole-cy:50%}.viraui__avatar-group-module__AvatarGroup_zOrR-[data-direction=vertical] &:not(:last-child){--avatar-hole-cx:50%;--avatar-hole-cy:calc(100% + (var(--vui-avatar-group-size) / 2) - var(--vui-avatar-group-overlap-distance))}.viraui__avatar-group-module__AvatarGroup_zOrR- &:not(:last-child){--avatar-hole-edge:calc((var(--avatar-hole-half) - var(--avatar-hole-r)) * 2);--avatar-hole-corner-inset:calc(var(--avatar-hole-r) * 0.85);@supports (corner-shape:squircle){@container root not style(--corner-shape-enable: initial){--avatar-hole-corner-tr:curve by var(--avatar-hole-r) var(--avatar-hole-r) with var(--avatar-hole-corner-inset) 0px /var(--avatar-hole-r) calc(var(--avatar-hole-r) * 0.15);--avatar-hole-corner-br:curve by calc(var(--avatar-hole-r) * -1) var(--avatar-hole-r) with 0px var(--avatar-hole-corner-inset) /calc(var(--avatar-hole-r) * -0.15) var(--avatar-hole-r);--avatar-hole-corner-bl:curve by calc(var(--avatar-hole-r) * -1) calc(var(--avatar-hole-r) * -1) with calc(var(--avatar-hole-corner-inset) * -1) 0px /calc(var(--avatar-hole-r) * -1) calc(var(--avatar-hole-r) * -0.15);--avatar-hole-corner-tl:curve by var(--avatar-hole-r) calc(var(--avatar-hole-r) * -1) with 0px calc(var(--avatar-hole-corner-inset) * -1) /calc(var(--avatar-hole-r) * 0.15) calc(var(--avatar-hole-r) * -1)}}clip-path:shape(evenodd from 0 0,line to 100% 0,line to 100% 100%,line to 0 100%,close,move to calc(var(--avatar-hole-cx) - var(--avatar-hole-half) + var(--avatar-hole-r)) calc(var(--avatar-hole-cy) - var(--avatar-hole-half)),line by var(--avatar-hole-edge) 0,var(--avatar-hole-corner-tr,arc by var(--avatar-hole-r) var(--avatar-hole-r) of var(--avatar-hole-r) cw),line by 0 var(--avatar-hole-edge),var(
|
|
2
|
+
--avatar-hole-corner-br,arc by calc(var(--avatar-hole-r) * -1) var(--avatar-hole-r) of var(--avatar-hole-r) cw
|
|
3
|
+
),line by calc(var(--avatar-hole-edge) * -1) 0,var(
|
|
4
|
+
--avatar-hole-corner-bl,arc by calc(var(--avatar-hole-r) * -1) calc(var(--avatar-hole-r) * -1) of var(--avatar-hole-r) cw
|
|
5
|
+
),line by 0 calc(var(--avatar-hole-edge) * -1),var(
|
|
6
|
+
--avatar-hole-corner-tl,arc by var(--avatar-hole-r) calc(var(--avatar-hole-r) * -1) of var(--avatar-hole-r) cw
|
|
7
|
+
),close)}}.viraui__avatar-group-module__OverflowWrapper_bKv6I{inline-size:auto}.viraui__avatar-group-module__AvatarGroupItem_Vvlyh{--vui-avatar-radius:var(--vui-avatar-group-item-radius)}.viraui__avatar-group-module__OverflowPill_nMmTD{display:inline-flex;align-items:center;justify-content:center;min-inline-size:var(--vui-avatar-group-size);block-size:var(--vui-avatar-group-size)}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AvatarProps } from '..';
|
|
2
2
|
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
3
|
-
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
4
3
|
import type * as React from 'react';
|
|
5
4
|
type AvatarGroupAvatarProps = Omit<AvatarProps, 'size' | 'ref'>;
|
|
6
5
|
/**
|
|
@@ -30,12 +29,6 @@ export type AvatarGroupProps = React.ComponentPropsWithRef<'div'> & IntrinsicVir
|
|
|
30
29
|
* @default 'horizontal'
|
|
31
30
|
*/
|
|
32
31
|
direction?: 'horizontal' | 'vertical';
|
|
33
|
-
/**
|
|
34
|
-
* Sets the empty visual separation preserved inside the overlap cutout.
|
|
35
|
-
*
|
|
36
|
-
* @default 'x-small'
|
|
37
|
-
*/
|
|
38
|
-
gap?: Extract<ThemeTypes['space'], '2x-small' | 'x-small' | 'small'>;
|
|
39
32
|
/**
|
|
40
33
|
* Limits how many real avatars render before the optional overflow pill is appended.
|
|
41
34
|
*
|
|
@@ -18,5 +18,31 @@
|
|
|
18
18
|
"Expecting grouped avatars to follow theme radius tokens instead of always rendering as circles",
|
|
19
19
|
"Using non-positive maxVisible values expecting truncation"
|
|
20
20
|
],
|
|
21
|
-
"related": ["Avatar"]
|
|
21
|
+
"related": ["Avatar"],
|
|
22
|
+
"properties": {
|
|
23
|
+
"react": {
|
|
24
|
+
"size": {
|
|
25
|
+
"description": "Shared avatar footprint for every item in the group.",
|
|
26
|
+
"refCss": "size"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"css": {
|
|
30
|
+
"size": {
|
|
31
|
+
"description": "Rendered avatar size used for overlap layout.",
|
|
32
|
+
"refReact": "size"
|
|
33
|
+
},
|
|
34
|
+
"overlap-distance": {
|
|
35
|
+
"description": "Negative margin overlap between adjacent avatars.",
|
|
36
|
+
"refReact": "size"
|
|
37
|
+
},
|
|
38
|
+
"gap-size": {
|
|
39
|
+
"description": "Cutout gap used by overlap clip-path math.",
|
|
40
|
+
"refReact": "size"
|
|
41
|
+
},
|
|
42
|
+
"item-radius": {
|
|
43
|
+
"description": "Corner radius applied to grouped avatar items.",
|
|
44
|
+
"refReact": "size"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
22
48
|
}
|
|
@@ -2,7 +2,6 @@ import './avatar-group.css';
|
|
|
2
2
|
import { clsx } from "../../core/clsx.js";
|
|
3
3
|
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
4
|
import { Avatar } from "../avatar/avatar.js";
|
|
5
|
-
import { resolveThemeValue } from "../../core/theme/resolve-theme-value.js";
|
|
6
5
|
import avatar_group_module_default from "./avatar-group.module.js";
|
|
7
6
|
import { Stack } from "../stack/stack.js";
|
|
8
7
|
import { Text } from "../text/text.js";
|
|
@@ -10,25 +9,19 @@ import { Surface } from "../surface/surface.js";
|
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
//#region src/components/avatar-group/avatar-group.tsx
|
|
12
11
|
var getAvatarKey = (avatar, index) => `${avatar.src ?? "fallback"}-${typeof avatar.fallback === "string" ? avatar.fallback : "node"}-${index}`;
|
|
13
|
-
var AvatarGroup = ({ avatars, className, direction = "horizontal",
|
|
12
|
+
var AvatarGroup = ({ avatars, className, direction = "horizontal", maxVisible, overflowText, ref, size = "small", style, ...otherProps }) => {
|
|
14
13
|
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
15
14
|
const isOverflowing = typeof maxVisible === "number" && maxVisible > 0 && avatars.length > maxVisible;
|
|
16
15
|
const hasOverflow = isOverflowing && overflowText !== void 0 && overflowText !== null;
|
|
17
16
|
const truncatedAvatars = isOverflowing ? avatars.slice(0, maxVisible) : avatars;
|
|
18
|
-
const dynamicStyle = {
|
|
19
|
-
"--avatar-group-gap-size": resolveThemeValue(gap, "space", "var(--space-x-small)"),
|
|
20
|
-
...style
|
|
21
|
-
};
|
|
22
17
|
return /* @__PURE__ */ jsxs("div", {
|
|
23
18
|
...componentProps,
|
|
24
19
|
...intrinsicAttributes,
|
|
25
20
|
ref,
|
|
26
21
|
className: clsx(avatar_group_module_default.AvatarGroup, className),
|
|
27
22
|
"data-direction": direction,
|
|
28
|
-
"data-gap": gap,
|
|
29
|
-
"data-has-overflow": hasOverflow ? "true" : "false",
|
|
30
23
|
"data-size": size,
|
|
31
|
-
style
|
|
24
|
+
style,
|
|
32
25
|
children: [truncatedAvatars.map((avatar, index) => /* @__PURE__ */ jsx("div", {
|
|
33
26
|
className: avatar_group_module_default.AvatarWrapper,
|
|
34
27
|
children: /* @__PURE__ */ jsx(Avatar, {
|
|
@@ -49,7 +42,7 @@ var AvatarGroup = ({ avatars, className, direction = "horizontal", gap = "x-smal
|
|
|
49
42
|
vAlign: "center",
|
|
50
43
|
hPadding: "medium"
|
|
51
44
|
}),
|
|
52
|
-
style: { "--surface-border-radius": "1e5px" },
|
|
45
|
+
style: { "--vui-surface-border-radius": "1e5px" },
|
|
53
46
|
children: /* @__PURE__ */ jsx(Text, {
|
|
54
47
|
whiteSpace: "nowrap",
|
|
55
48
|
children: overflowText
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.viraui__basic-input-module__BasicInput_5uE64{--basic-input-background:var(--base-1);--basic-input-color:var(--global-foreground);--basic-input-placeholder-color:var(--global-disabled-foreground);--basic-input-padding-inline:var(--space-small);--basic-input-font-size:var(--font-scale-body-small);--basic-input-border-radius:var(--radius-medium);box-sizing:border-box;margin:0;inline-size:100%;min-inline-size:0;padding-inline:var(--basic-input-padding-inline);font-family:inherit;font-size:var(--basic-input-font-size);font-variation-settings:"wght" 400;color:var(--basic-input-color);background:var(--basic-input-background);border:none;border-radius:var(--basic-input-border-radius);appearance:none;&::-webkit-contacts-auto-fill-button{background-color:var(--basic-input-color)}&::placeholder{color:var(--basic-input-placeholder-color)}&:disabled{--basic-input-background:var(--global-disabled-background);--basic-input-color:var(--global-disabled-foreground);--basic-input-placeholder-color:var(--global-disabled-foreground);cursor:not-allowed}&[data-invalid]{outline-color:oklab(from var(--highlight-red) l a b/.3)}}
|
|
1
|
+
.viraui__basic-input-module__BasicInput_5uE64{--vui-basic-input-background:var(--base-1);--vui-basic-input-color:var(--global-foreground);--vui-basic-input-placeholder-color:var(--global-disabled-foreground);--vui-basic-input-padding-inline:var(--space-small);--vui-basic-input-font-size:var(--font-scale-body-small);--vui-basic-input-border-radius:var(--radius-medium);box-sizing:border-box;margin:0;inline-size:100%;min-inline-size:0;padding-inline:var(--vui-basic-input-padding-inline);font-family:inherit;font-size:var(--vui-basic-input-font-size);font-variation-settings:"wght" 400;color:var(--vui-basic-input-color);background:var(--vui-basic-input-background);border:none;border-radius:var(--vui-basic-input-border-radius);appearance:none;&::-webkit-contacts-auto-fill-button{background-color:var(--vui-basic-input-color)}&::placeholder{color:var(--vui-basic-input-placeholder-color)}&:disabled{--vui-basic-input-background:var(--global-disabled-background);--vui-basic-input-color:var(--global-disabled-foreground);--vui-basic-input-placeholder-color:var(--global-disabled-foreground);cursor:not-allowed}&[data-invalid]{outline-color:oklab(from var(--highlight-red) l a b/.3)}}
|
|
@@ -9,18 +9,18 @@ import { Input } from "@base-ui/react/input";
|
|
|
9
9
|
function usesInputPrimitiveRender(render) {
|
|
10
10
|
return React.isValidElement(render) && render.type === Input;
|
|
11
11
|
}
|
|
12
|
-
var BasicInput = React.forwardRef(function BasicInput({ className, render, ...
|
|
12
|
+
var BasicInput = React.forwardRef(function BasicInput({ className, render, ...otherProps }, ref) {
|
|
13
13
|
const mergedClassName = clsx(basic_input_module_default.BasicInput, className);
|
|
14
14
|
if (usesInputPrimitiveRender(render)) return /* @__PURE__ */ jsx(Input, {
|
|
15
15
|
ref,
|
|
16
16
|
className: mergedClassName,
|
|
17
|
-
...
|
|
17
|
+
...otherProps
|
|
18
18
|
});
|
|
19
19
|
return /* @__PURE__ */ jsx(Field.Control, {
|
|
20
20
|
ref,
|
|
21
21
|
className: mergedClassName,
|
|
22
22
|
render,
|
|
23
|
-
...
|
|
23
|
+
...otherProps
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
26
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.viraui__field-label-module__FieldLabel_R9SYf{display:inline;flex-direction:column;align-items:stretch;inline-size:100%;padding-inline:var(--field-label-padding-inline,0)}
|
|
1
|
+
.viraui__field-label-module__FieldLabel_R9SYf{display:inline;flex-direction:column;align-items:stretch;inline-size:100%;padding-inline:var(--vui-field-label-padding-inline,0)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.viraui__bleed-module__Bleed_7rnR6{margin:0 calc(var(--vui-bleed-amount, 0) * -1);&[data-bleed-full=true]{width:100vw;margin-left:calc(50% - 50vw)}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
2
|
+
import { ThemeTypes } from '@viraui/foundation/vira/types';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Public Bleed props.
|
|
6
|
+
*
|
|
7
|
+
* Includes standard `div` attributes such as `children`, `id`, `className`, and event handlers,
|
|
8
|
+
* plus Vira-owned inline bleed controls.
|
|
9
|
+
*
|
|
10
|
+
* @default Native div pass-through props keep React defaults.
|
|
11
|
+
*/
|
|
12
|
+
export type BleedProps = React.ComponentPropsWithRef<'div'> & IntrinsicViraProps & {
|
|
13
|
+
/**
|
|
14
|
+
* Sets the inline bleed amount using a Vira space token.
|
|
15
|
+
*
|
|
16
|
+
* @default No bleed is applied.
|
|
17
|
+
*/
|
|
18
|
+
amount?: ThemeTypes['space'];
|
|
19
|
+
/**
|
|
20
|
+
* Bleeds content to the viewport edges and ignores `amount`.
|
|
21
|
+
*
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
full?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const Bleed: React.FC<BleedProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Bleed",
|
|
3
|
+
"summary": "Layout utility that pulls content past inline padding using negative margins or full viewport bleed.",
|
|
4
|
+
"whenToUse": [
|
|
5
|
+
"Edge-to-edge media or dividers inside padded Surface or Stack containers",
|
|
6
|
+
"Hero bands or callouts that should break out of card padding",
|
|
7
|
+
"Full-bleed sections that span the viewport width from a centered layout"
|
|
8
|
+
],
|
|
9
|
+
"whenNotToUse": [
|
|
10
|
+
"Replacing Stack or Surface padding instead of composing with them",
|
|
11
|
+
"Interactive controls that need their own hit target sizing",
|
|
12
|
+
"Cases where overflow clipping on the parent should remain strict"
|
|
13
|
+
],
|
|
14
|
+
"accessibility": [
|
|
15
|
+
"Bleed is a layout wrapper only — child content keeps native semantics",
|
|
16
|
+
"Parent containers should preserve readable line length for text content",
|
|
17
|
+
"Full bleed can introduce horizontal scroll when ancestors use overflow hidden incorrectly"
|
|
18
|
+
],
|
|
19
|
+
"antiPatterns": [
|
|
20
|
+
"Nesting multiple full bleeds without checking ancestor overflow",
|
|
21
|
+
"Using Bleed to compensate for missing Stack padding instead of fixing layout composition",
|
|
22
|
+
"Applying full bleed inside narrow overflow-hidden cards without testing clipping"
|
|
23
|
+
],
|
|
24
|
+
"related": ["Stack", "Surface", "Separator"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"react": {
|
|
27
|
+
"amount": {
|
|
28
|
+
"description": "Sets the inline bleed amount using a Vira space token.",
|
|
29
|
+
"refCss": "amount"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"css": {
|
|
33
|
+
"amount": {
|
|
34
|
+
"description": "Negative inline margin bleed distance on the root.",
|
|
35
|
+
"refReact": "amount"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import './bleed.css';
|
|
2
|
+
import { clsx } from "../../core/clsx.js";
|
|
3
|
+
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
|
+
import bleed_module_default from "./bleed.module.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/bleed/bleed.tsx
|
|
7
|
+
var Bleed = ({ amount, children, className, full = false, ref, style, ...otherProps }) => {
|
|
8
|
+
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
|
|
9
|
+
const dynamicStyle = {
|
|
10
|
+
...amount && !full && { "--vui-bleed-amount": `var(--space-${amount})` },
|
|
11
|
+
...style
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
...componentProps,
|
|
15
|
+
...intrinsicAttributes,
|
|
16
|
+
ref,
|
|
17
|
+
className: clsx(bleed_module_default.Bleed, className),
|
|
18
|
+
"data-bleed-full": full ? "true" : void 0,
|
|
19
|
+
style: dynamicStyle,
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Bleed };
|