@viraui/react 0.0.15 → 0.0.17
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 +6 -0
- package/dist/components/avatar/avatar.css +1 -55
- package/dist/components/avatar/avatar.d.ts +1 -2
- package/dist/components/avatar/avatar.js +49 -14
- package/dist/components/avatar/avatar.module.js +7 -0
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/basic-input/basic-input.css +1 -45
- package/dist/components/basic-input/basic-input.d.ts +0 -1
- package/dist/components/basic-input/basic-input.js +24 -13
- package/dist/components/basic-input/basic-input.module.js +3 -0
- package/dist/components/basic-input/field-helper-copy.d.ts +2 -1
- package/dist/components/basic-input/field-helper-copy.js +43 -24
- package/dist/components/basic-input/field-label.css +1 -0
- package/dist/components/basic-input/field-label.d.ts +10 -0
- package/dist/components/basic-input/field-label.js +24 -0
- package/dist/components/basic-input/field-label.module.js +3 -0
- package/dist/components/basic-input/index.d.ts +7 -2
- package/dist/components/basic-input/input-control-group.d.ts +2 -0
- package/dist/components/basic-input/input-control-group.js +40 -7
- package/dist/components/button/button.css +1 -156
- package/dist/components/button/button.d.ts +3 -3
- package/dist/components/button/button.js +104 -14
- package/dist/components/button/button.module.js +7 -0
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/checkbox/checkbox.css +1 -0
- package/dist/components/checkbox/checkbox.d.ts +65 -0
- package/dist/components/checkbox/checkbox.guide.json +22 -0
- package/dist/components/checkbox/checkbox.js +73 -0
- package/dist/components/checkbox/checkbox.module.js +10 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/clamp-text/clamp-text.css +1 -12
- package/dist/components/clamp-text/clamp-text.d.ts +1 -2
- package/dist/components/clamp-text/clamp-text.js +27 -22
- package/dist/components/clamp-text/clamp-text.module.js +3 -0
- package/dist/components/clamp-text/index.d.ts +2 -2
- package/dist/components/elevator/elevator.d.ts +5 -5
- package/dist/components/elevator/elevator.js +27 -27
- package/dist/components/elevator/index.d.ts +2 -2
- package/dist/components/icon/icon.css +1 -7
- package/dist/components/icon/icon.d.ts +2 -3
- package/dist/components/icon/icon.js +18 -9
- package/dist/components/icon/icon.module.js +3 -0
- package/dist/components/icon/index.d.ts +2 -2
- package/dist/components/icon-button/icon-button.d.ts +2 -2
- package/dist/components/icon-button/icon-button.js +10 -3
- package/dist/components/icon-button/index.d.ts +2 -2
- package/dist/components/index.d.ts +18 -17
- package/dist/components/select/index.d.ts +2 -2
- package/dist/components/select/select-group.d.ts +1 -1
- package/dist/components/select/select-group.js +37 -9
- package/dist/components/select/select-indicator-slot.js +33 -10
- package/dist/components/select/select-option.d.ts +1 -1
- package/dist/components/select/select-option.js +40 -10
- package/dist/components/select/select-separator.js +14 -6
- package/dist/components/select/select.css +1 -193
- package/dist/components/select/select.d.ts +10 -11
- package/dist/components/select/select.js +156 -32
- package/dist/components/select/select.module.js +19 -0
- package/dist/components/skeleton/index.d.ts +2 -2
- package/dist/components/skeleton/skeleton.css +1 -36
- package/dist/components/skeleton/skeleton.d.ts +2 -3
- package/dist/components/skeleton/skeleton.js +26 -15
- package/dist/components/skeleton/skeleton.module.js +6 -0
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/slider/slider-control.d.ts +1 -2
- package/dist/components/slider/slider-control.js +43 -19
- package/dist/components/slider/slider-utils.js +6 -3
- package/dist/components/slider/slider.css +1 -64
- package/dist/components/slider/slider.d.ts +5 -8
- package/dist/components/slider/slider.js +83 -17
- package/dist/components/slider/slider.module.js +12 -0
- package/dist/components/spinner/index.d.ts +2 -2
- package/dist/components/spinner/spinner.css +1 -45
- package/dist/components/spinner/spinner.d.ts +1 -2
- package/dist/components/spinner/spinner.js +29 -6
- package/dist/components/spinner/spinner.module.js +7 -0
- package/dist/components/stack/index.d.ts +2 -2
- package/dist/components/stack/stack.css +1 -57
- package/dist/components/stack/stack.d.ts +2 -3
- package/dist/components/stack/stack.js +40 -36
- package/dist/components/stack/stack.module.js +3 -0
- package/dist/components/surface/index.d.ts +2 -2
- package/dist/components/surface/surface.css +1 -70
- package/dist/components/surface/surface.d.ts +10 -6
- package/dist/components/surface/surface.js +43 -40
- package/dist/components/surface/surface.module.js +6 -0
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/switch/switch.css +1 -73
- package/dist/components/switch/switch.d.ts +17 -5
- package/dist/components/switch/switch.js +59 -13
- package/dist/components/switch/switch.module.js +7 -0
- package/dist/components/text/index.d.ts +2 -2
- package/dist/components/text/text.css +1 -140
- package/dist/components/text/text.d.ts +8 -3
- package/dist/components/text/text.js +46 -41
- package/dist/components/text/text.module.js +3 -0
- package/dist/components/textarea/index.d.ts +2 -2
- package/dist/components/textarea/textarea.css +1 -45
- package/dist/components/textarea/textarea.d.ts +3 -4
- package/dist/components/textarea/textarea.js +51 -11
- package/dist/components/textarea/textarea.module.js +7 -0
- package/dist/components/textfield/index.d.ts +2 -2
- package/dist/components/textfield/textfield.css +1 -87
- package/dist/components/textfield/textfield.d.ts +3 -4
- package/dist/components/textfield/textfield.js +58 -12
- package/dist/components/textfield/textfield.module.js +9 -0
- package/dist/components/title/index.d.ts +2 -2
- package/dist/components/title/title.css +1 -127
- package/dist/components/title/title.d.ts +8 -3
- package/dist/components/title/title.js +44 -39
- package/dist/components/title/title.module.js +3 -0
- package/dist/consumption.json +8 -4
- package/dist/core/elevation/elevation-types.js +6 -3
- package/dist/core/elevation/get-elevation-props.d.ts +1 -1
- package/dist/core/elevation/get-elevation-props.js +14 -11
- package/dist/core/props/intrinsic-vira-props.js +12 -9
- package/dist/core/styles/resolve-axis-padding.d.ts +1 -1
- package/dist/core/styles/resolve-axis-padding.js +15 -16
- package/dist/core/theme/resolve-theme-value.d.ts +1 -1
- package/dist/core/theme/resolve-theme-value.js +7 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +21 -1
- package/dist/internal-icons/icon-registry.d.ts +242 -239
- package/dist/internal-icons/icon-registry.js +247 -238
- package/dist/internal-icons/icons/duo/Magnifier.d.ts +7 -0
- package/dist/internal-icons/icons/duo/Magnifier.js +13 -0
- package/dist/internal-icons/icons/duo/Minus.d.ts +7 -0
- package/dist/internal-icons/icons/duo/Minus.js +13 -0
- package/dist/internal-icons/icons/duo/Plus.d.ts +7 -0
- package/dist/internal-icons/icons/duo/Plus.js +13 -0
- package/dist/internal-icons/icons/duo/index.d.ts +241 -238
- package/dist/internal-icons/icons/duo/index.js +241 -238
- package/dist/preflight-surface.json +160 -0
- package/dist/preflight.css +1 -1
- package/package.json +11 -9
- package/dist/components/avatar/index.js +0 -1
- package/dist/components/basic-input/index.js +0 -1
- package/dist/components/button/index.js +0 -1
- package/dist/components/clamp-text/index.js +0 -1
- package/dist/components/elevator/index.js +0 -1
- package/dist/components/icon/index.js +0 -1
- package/dist/components/icon-button/index.js +0 -1
- package/dist/components/index.js +0 -17
- package/dist/components/select/index.js +0 -1
- package/dist/components/skeleton/index.js +0 -1
- package/dist/components/slider/index.js +0 -1
- package/dist/components/slider/slider-control.css +0 -71
- package/dist/components/spinner/index.js +0 -1
- package/dist/components/stack/index.js +0 -1
- package/dist/components/surface/index.js +0 -1
- package/dist/components/switch/index.js +0 -1
- package/dist/components/text/index.js +0 -1
- package/dist/components/textarea/index.js +0 -1
- package/dist/components/textfield/index.js +0 -1
- package/dist/components/title/index.js +0 -1
|
@@ -1,10 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { clsx } from
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { Text } from "../text/text.js";
|
|
3
|
+
import { Stack } from "../stack/stack.js";
|
|
4
|
+
import select_module_default from "./select.module.js";
|
|
5
|
+
import { SelectIndicatorSlot } from "./select-indicator-slot.js";
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Select } from "@base-ui/react/select";
|
|
9
|
+
//#region src/components/select/select-group.tsx
|
|
10
|
+
function SelectGroup({ children, className, label, ...groupProps }) {
|
|
11
|
+
return /* @__PURE__ */ jsxs(Select.Group, {
|
|
12
|
+
...groupProps,
|
|
13
|
+
className: clsx(select_module_default.Group, className),
|
|
14
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
15
|
+
direction: "column",
|
|
16
|
+
fillChildren: false,
|
|
17
|
+
rowGap: "2x-small",
|
|
18
|
+
vPadding: "2x-small"
|
|
19
|
+
}),
|
|
20
|
+
children: [/* @__PURE__ */ jsxs(Select.GroupLabel, {
|
|
21
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
22
|
+
columnGap: "small",
|
|
23
|
+
direction: "row",
|
|
24
|
+
fillChildren: false,
|
|
25
|
+
hPadding: "small",
|
|
26
|
+
vAlign: "center"
|
|
27
|
+
}),
|
|
28
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
29
|
+
size: "x-small",
|
|
30
|
+
tone: "muted",
|
|
31
|
+
weight: "semibold",
|
|
32
|
+
children: label
|
|
33
|
+
}), /* @__PURE__ */ jsx(SelectIndicatorSlot, {})]
|
|
34
|
+
}), children]
|
|
35
|
+
});
|
|
10
36
|
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { SelectGroup };
|
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { Stack } from "../stack/stack.js";
|
|
3
|
+
import select_module_default from "./select.module.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Select } from "@base-ui/react/select";
|
|
6
|
+
//#region src/components/select/select-indicator-slot.tsx
|
|
7
|
+
var indicatorStackRender = /* @__PURE__ */ jsx(Stack, {
|
|
8
|
+
fillChildren: false,
|
|
9
|
+
hAlign: "center",
|
|
10
|
+
inline: true,
|
|
11
|
+
shrink: false,
|
|
12
|
+
vAlign: "center"
|
|
13
|
+
});
|
|
14
|
+
function SelectIndicatorSlot({ children, interactive = false }) {
|
|
15
|
+
if (interactive) return /* @__PURE__ */ jsx(Select.ItemIndicator, {
|
|
16
|
+
className: select_module_default.Indicator,
|
|
17
|
+
"data-grow": "false",
|
|
18
|
+
keepMounted: true,
|
|
19
|
+
render: indicatorStackRender,
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
return /* @__PURE__ */ jsx(Stack, {
|
|
23
|
+
"aria-hidden": true,
|
|
24
|
+
className: select_module_default.Indicator,
|
|
25
|
+
grow: false,
|
|
26
|
+
fillChildren: false,
|
|
27
|
+
hAlign: "center",
|
|
28
|
+
inline: true,
|
|
29
|
+
shrink: false,
|
|
30
|
+
vAlign: "center"
|
|
31
|
+
});
|
|
11
32
|
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { SelectIndicatorSlot };
|
|
@@ -1,11 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { clsx } from
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { Text } from "../text/text.js";
|
|
3
|
+
import { Stack } from "../stack/stack.js";
|
|
4
|
+
import select_module_default from "./select.module.js";
|
|
5
|
+
import { SelectIndicatorSlot } from "./select-indicator-slot.js";
|
|
6
|
+
import { Icon } from "../icon/icon.js";
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Select } from "@base-ui/react/select";
|
|
10
|
+
//#region src/components/select/select-option.tsx
|
|
11
|
+
function SelectOption({ children, className, disabled, indicator, label, value, ...itemProps }) {
|
|
12
|
+
return /* @__PURE__ */ jsxs(Select.Item, {
|
|
13
|
+
...itemProps,
|
|
14
|
+
"aria-label": label,
|
|
15
|
+
label,
|
|
16
|
+
className: clsx(select_module_default.Option, className),
|
|
17
|
+
disabled,
|
|
18
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
19
|
+
columnGap: "small",
|
|
20
|
+
direction: "row",
|
|
21
|
+
hPadding: "small",
|
|
22
|
+
vPadding: "small",
|
|
23
|
+
vAlign: "center"
|
|
24
|
+
}),
|
|
25
|
+
value,
|
|
26
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
27
|
+
lineHeight: "small",
|
|
28
|
+
render: /* @__PURE__ */ jsx(Select.ItemText, {}),
|
|
29
|
+
size: "small",
|
|
30
|
+
children
|
|
31
|
+
}), /* @__PURE__ */ jsx(SelectIndicatorSlot, {
|
|
32
|
+
interactive: true,
|
|
33
|
+
children: indicator ?? /* @__PURE__ */ jsx(Icon, {
|
|
34
|
+
name: "Check",
|
|
35
|
+
size: 16
|
|
36
|
+
})
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
11
39
|
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { SelectOption };
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import select_module_default from "./select.module.js";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Select } from "@base-ui/react/select";
|
|
6
|
+
//#region src/components/select/select-separator.tsx
|
|
7
|
+
function SelectSeparator({ className, orientation = "horizontal", ...separatorProps }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Select.Separator, {
|
|
9
|
+
...separatorProps,
|
|
10
|
+
className: clsx(select_module_default.Separator, className),
|
|
11
|
+
orientation
|
|
12
|
+
});
|
|
7
13
|
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { SelectSeparator };
|
|
@@ -1,193 +1 @@
|
|
|
1
|
-
|
|
2
|
-
:scope {
|
|
3
|
-
--input-height: var(--space-x-large);
|
|
4
|
-
--control-group-background: var(--base-1);
|
|
5
|
-
--control-group-color: var(--global-foreground);
|
|
6
|
-
--control-group-border-color: var(--global-contrast);
|
|
7
|
-
--control-group-border-radius: var(--radius-small);
|
|
8
|
-
--select-trigger-padding-inline-start: var(--space-small);
|
|
9
|
-
--select-trigger-padding-inline-end: var(--space-x-small);
|
|
10
|
-
|
|
11
|
-
> .Trigger {
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
inline-size: 100%;
|
|
14
|
-
min-inline-size: 0;
|
|
15
|
-
block-size: var(--input-height);
|
|
16
|
-
padding-inline: calc(
|
|
17
|
-
var(--select-trigger-padding-inline-start) + ((var(--control-group-border-radius) + 0px) / 4)
|
|
18
|
-
)
|
|
19
|
-
var(--select-trigger-padding-inline-end);
|
|
20
|
-
border: 1px solid var(--control-group-border-color);
|
|
21
|
-
border-radius: var(--control-group-border-radius);
|
|
22
|
-
background: var(--control-group-background);
|
|
23
|
-
color: var(--control-group-color);
|
|
24
|
-
font: inherit;
|
|
25
|
-
text-align: start;
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
|
|
28
|
-
&:focus-visible {
|
|
29
|
-
outline: 2px solid var(--global-foreground);
|
|
30
|
-
outline-offset: 2px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&[data-popup-open] {
|
|
34
|
-
outline: none;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&:disabled,
|
|
38
|
-
&[data-disabled] {
|
|
39
|
-
--control-group-background: var(--global-disabled-background);
|
|
40
|
-
--control-group-border-color: transparent;
|
|
41
|
-
--control-group-color: var(--global-disabled-foreground);
|
|
42
|
-
|
|
43
|
-
box-shadow: none;
|
|
44
|
-
cursor: not-allowed;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
> .Value {
|
|
48
|
-
--text-fluid-factor: 0;
|
|
49
|
-
--text-font-size: var(--font-scale-body-small);
|
|
50
|
-
|
|
51
|
-
overflow: hidden;
|
|
52
|
-
text-overflow: ellipsis;
|
|
53
|
-
|
|
54
|
-
&[data-placeholder] {
|
|
55
|
-
color: var(--global-disabled-foreground);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
> .Icon {
|
|
60
|
-
font-size: var(--font-scale-body-small);
|
|
61
|
-
pointer-events: none;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&[data-invalid] > .Trigger:not(:disabled):not([data-disabled]) {
|
|
66
|
-
--control-group-border-color: var(--highlight-red);
|
|
67
|
-
|
|
68
|
-
box-shadow: none;
|
|
69
|
-
outline-color: oklab(from var(--highlight-red) l a b / 0.5);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&:has([required]) > .Label::after {
|
|
73
|
-
content: ' *';
|
|
74
|
-
color: var(--highlight-red);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
> .Label,
|
|
78
|
-
> .Description {
|
|
79
|
-
padding-inline: calc((var(--control-group-border-radius) + 0px) / 2);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@scope (.SelectPopup) {
|
|
85
|
-
:scope {
|
|
86
|
-
--select-list-border-radius: var(--radius-medium);
|
|
87
|
-
--select-list-padding: var(--space-x-small);
|
|
88
|
-
box-sizing: border-box;
|
|
89
|
-
min-inline-size: var(--anchor-width);
|
|
90
|
-
overflow: visible;
|
|
91
|
-
color: var(--global-foreground);
|
|
92
|
-
outline: none;
|
|
93
|
-
position: relative;
|
|
94
|
-
|
|
95
|
-
> .ScrollArrow {
|
|
96
|
-
position: absolute;
|
|
97
|
-
inset-inline: 0;
|
|
98
|
-
z-index: 1;
|
|
99
|
-
inline-size: 100%;
|
|
100
|
-
block-size: var(--space-large);
|
|
101
|
-
cursor: default;
|
|
102
|
-
background: var(--base-1);
|
|
103
|
-
|
|
104
|
-
> .Button {
|
|
105
|
-
pointer-events: none;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
&.ScrollArrow--up {
|
|
109
|
-
inset-block-start: 0;
|
|
110
|
-
border-block-end: 1px solid var(--global-contrast);
|
|
111
|
-
border-radius: var(--select-list-border-radius) var(--select-list-border-radius) 0 0;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
&.ScrollArrow--down {
|
|
115
|
-
inset-block-end: 0;
|
|
116
|
-
border-block-start: 1px solid var(--global-contrast);
|
|
117
|
-
border-radius: 0 0 var(--select-list-border-radius) var(--select-list-border-radius);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
> .List {
|
|
122
|
-
box-sizing: border-box;
|
|
123
|
-
inline-size: 100%;
|
|
124
|
-
max-block-size: var(--available-height);
|
|
125
|
-
overflow-y: auto;
|
|
126
|
-
scroll-padding-block: var(--select-list-padding);
|
|
127
|
-
list-style: none;
|
|
128
|
-
overscroll-behavior: contain;
|
|
129
|
-
|
|
130
|
-
&:focus,
|
|
131
|
-
&:focus-visible {
|
|
132
|
-
outline: none;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
> .Option,
|
|
136
|
-
> .Group > .Option {
|
|
137
|
-
border-radius: calc((var(--select-list-border-radius) + 0px) - var(--select-list-padding));
|
|
138
|
-
cursor: pointer;
|
|
139
|
-
|
|
140
|
-
&:focus {
|
|
141
|
-
outline: none;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
&:focus-visible {
|
|
145
|
-
outline: 2px solid var(--global-foreground);
|
|
146
|
-
outline-offset: 0;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
&[data-highlighted],
|
|
150
|
-
&:hover {
|
|
151
|
-
background: var(--base-2);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
&[data-disabled] {
|
|
155
|
-
color: var(--global-disabled-foreground);
|
|
156
|
-
cursor: not-allowed;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
> .Indicator {
|
|
160
|
-
inline-size: var(--space-medium);
|
|
161
|
-
color: var(--global-primary);
|
|
162
|
-
opacity: 0;
|
|
163
|
-
transition:
|
|
164
|
-
opacity var(--duration-fast) var(--easing-standard),
|
|
165
|
-
transform var(--duration-fast) var(--easing-standard);
|
|
166
|
-
|
|
167
|
-
&[data-selected] {
|
|
168
|
-
opacity: 1;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
> .Group {
|
|
174
|
-
& + & {
|
|
175
|
-
margin-block-start: var(--space-medium);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
> .GroupLabel {
|
|
179
|
-
> .Indicator {
|
|
180
|
-
inline-size: var(--space-medium);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
> .Separator {
|
|
186
|
-
block-size: 1px;
|
|
187
|
-
margin-block: var(--space-small);
|
|
188
|
-
margin-inline: var(--space-small);
|
|
189
|
-
background: var(--base-3);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
1
|
+
.select-module_Select_eXv4Y{--input-height:var(--space-x-large);--control-group-background:var(--base-1);--control-group-color:var(--global-foreground);--control-group-border-color:var(--global-contrast);--control-group-border-radius:var(--radius-small);--select-trigger-padding-inline-start:var(--space-small);--select-trigger-padding-inline-end:var(--space-x-small);--field-label-padding-inline:calc((var(--control-group-border-radius) + 0px) / 2);&:has([required]) [data-field-label]:after{content:" *";color:var(--highlight-red)}&[data-invalid]>.select-module_Trigger_-wBsg:not(:disabled):not([data-disabled]){--control-group-border-color:var(--highlight-red);box-shadow:none;outline-color:oklab(from var(--highlight-red) l a b/.5)}}.select-module_Trigger_-wBsg{box-sizing:border-box;inline-size:100%;min-inline-size:0;block-size:var(--input-height);padding-inline:calc(var(--select-trigger-padding-inline-start) + ((var(--control-group-border-radius) + 0px) / 4)) var(--select-trigger-padding-inline-end);border:1px solid var(--control-group-border-color);border-radius:var(--control-group-border-radius);background:var(--control-group-background);color:var(--control-group-color);font:inherit;text-align:start;cursor:pointer;&:focus-visible{outline:2px solid var(--global-foreground);outline-offset:2px}&[data-popup-open]{outline:none}&:disabled,&[data-disabled]{--control-group-background:var(--global-disabled-background);--control-group-border-color:transparent;--control-group-color:var(--global-disabled-foreground);box-shadow:none;cursor:not-allowed}}.select-module_Value_uWHPX{--text-fluid-factor:0;--text-font-size:var(--font-scale-body-small);overflow:hidden;text-overflow:ellipsis;&[data-placeholder]{color:var(--global-disabled-foreground)}}.select-module_Icon_EOwki{font-size:var(--font-scale-body-small);pointer-events:none}.select-module_Description_OmwmV{padding-inline:calc((var(--control-group-border-radius) + 0px) / 2)}.select-module_SelectPopup_UzGXL{--select-list-border-radius:var(--radius-medium);--select-list-padding:var(--space-x-small);box-sizing:border-box;min-inline-size:var(--anchor-width);overflow:visible;color:var(--global-foreground);outline:none;position:relative}.select-module_ScrollArrow_kHlEi{position:absolute;inset-inline:0;z-index:1;inline-size:100%;block-size:var(--space-large);cursor:default;background:var(--base-1)}.select-module_ScrollButton_sHBOa{pointer-events:none}.select-module_ScrollArrowUp_DGXS-{inset-block-start:0;border-block-end:1px solid var(--global-contrast);border-radius:var(--select-list-border-radius) var(--select-list-border-radius) 0 0}.select-module_ScrollArrowDown_vhJy0{inset-block-end:0;border-block-start:1px solid var(--global-contrast);border-radius:0 0 var(--select-list-border-radius) var(--select-list-border-radius)}.select-module_List_jdUWx{box-sizing:border-box;inline-size:100%;max-block-size:var(--available-height);overflow-y:auto;scroll-padding-block:var(--select-list-padding);list-style:none;overscroll-behavior:contain;&:focus,&:focus-visible{outline:none}}.select-module_Option_KgYqz{border-radius:calc((var(--select-list-border-radius) + 0px) - var(--select-list-padding));cursor:pointer;&:focus{outline:none}&:focus-visible{outline:2px solid var(--global-foreground);outline-offset:0}&:hover,&[data-highlighted]{background:var(--base-2)}&[data-disabled]{color:var(--global-disabled-foreground);cursor:not-allowed}}.select-module_Indicator_YNUuz{inline-size:var(--space-medium);color:var(--global-primary);opacity:0;transition:opacity var(--duration-fast) var(--easing-standard),transform var(--duration-fast) var(--easing-standard);&[data-selected]{opacity:1}}.select-module_Group_xzkuA+.select-module_Group_xzkuA{margin-block-start:var(--space-medium)}.select-module_Separator_Q-ri9{block-size:1px;margin-block:var(--space-small);margin-inline:var(--space-small);background:var(--base-3)}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { FieldRoot } from '@base-ui/react/field';
|
|
2
|
+
import { SelectRoot } from '@base-ui/react/select';
|
|
3
|
+
import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
|
|
4
|
+
import { SelectGroup } from './select-group';
|
|
5
|
+
import { SelectOption } from './select-option';
|
|
6
|
+
import { SelectSeparator } from './select-separator';
|
|
3
7
|
import type * as React from 'react';
|
|
4
|
-
import type { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
|
|
5
|
-
import { SelectGroup } from './select-group.js';
|
|
6
|
-
import { SelectOption } from './select-option.js';
|
|
7
|
-
import { SelectSeparator } from './select-separator.js';
|
|
8
|
-
import './select.css';
|
|
9
8
|
/**
|
|
10
9
|
* Public Select props.
|
|
11
10
|
*
|
|
@@ -17,7 +16,7 @@ import './select.css';
|
|
|
17
16
|
*/
|
|
18
17
|
export type SelectProps = SelectRoot.Props<string> & Omit<FieldRoot.Props, 'ref'> & IntrinsicViraProps & {
|
|
19
18
|
/**
|
|
20
|
-
* Visible label rendered with
|
|
19
|
+
* Visible label rendered with shared internal `FieldLabel`.
|
|
21
20
|
*
|
|
22
21
|
* @default No label is rendered.
|
|
23
22
|
*/
|
|
@@ -61,6 +60,6 @@ export declare const Select: typeof SelectRootComponent & {
|
|
|
61
60
|
Group: typeof SelectGroup;
|
|
62
61
|
Separator: typeof SelectSeparator;
|
|
63
62
|
};
|
|
64
|
-
export type { SelectGroupProps } from './select-group
|
|
65
|
-
export type { SelectOptionProps } from './select-option
|
|
66
|
-
export type { SelectSeparatorProps } from './select-separator
|
|
63
|
+
export type { SelectGroupProps } from './select-group';
|
|
64
|
+
export type { SelectOptionProps } from './select-option';
|
|
65
|
+
export type { SelectSeparatorProps } from './select-separator';
|
|
@@ -1,35 +1,159 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Field } from '@base-ui/react/field';
|
|
4
|
-
import { Select as PrimitiveSelect } from '@base-ui/react/select';
|
|
5
|
-
import { clsx } from 'clsx';
|
|
6
|
-
import { useId } from 'react';
|
|
7
|
-
import { Elevator, Icon, Stack, Surface, Text } from '../index.js';
|
|
8
|
-
import { extractIntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
|
|
9
|
-
import { FieldHelperCopy } from '../../components/basic-input/field-helper-copy.js';
|
|
10
|
-
import { IconButton } from '../../components/icon-button/index.js';
|
|
11
|
-
import { SelectGroup } from './select-group.js';
|
|
12
|
-
import { SelectOption } from './select-option.js';
|
|
13
|
-
import { SelectSeparator } from './select-separator.js';
|
|
14
1
|
import './select.css';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
|
|
4
|
+
import { Elevator } from "../elevator/elevator.js";
|
|
5
|
+
import { IconButton } from "../icon-button/icon-button.js";
|
|
6
|
+
import { Text } from "../text/text.js";
|
|
7
|
+
import { FieldHelperCopy } from "../basic-input/field-helper-copy.js";
|
|
8
|
+
import { FieldLabel } from "../basic-input/field-label.js";
|
|
9
|
+
import { Stack } from "../stack/stack.js";
|
|
10
|
+
import select_module_default from "./select.module.js";
|
|
11
|
+
import { SelectGroup } from "./select-group.js";
|
|
12
|
+
import { Icon } from "../icon/icon.js";
|
|
13
|
+
import { SelectOption } from "./select-option.js";
|
|
14
|
+
import { SelectSeparator } from "./select-separator.js";
|
|
15
|
+
import { Surface } from "../surface/surface.js";
|
|
16
|
+
import { clsx } from "clsx";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { useId } from "react";
|
|
19
|
+
import { Field } from "@base-ui/react/field";
|
|
20
|
+
import { Select } from "@base-ui/react/select";
|
|
21
|
+
//#region src/components/select/select.tsx
|
|
22
|
+
function SelectRootComponent({ children, className, description, dirty, disabled, error, icon = /* @__PURE__ */ jsx(Icon, {
|
|
23
|
+
name: "ChevronExpandY",
|
|
24
|
+
size: 16
|
|
25
|
+
}), invalid, label, name, placeholder, ref, touched, validate, validationDebounceTime, validationMode, ...selectRootProps }) {
|
|
26
|
+
const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(selectRootProps);
|
|
27
|
+
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...restSelectProps } = componentProps;
|
|
28
|
+
const fieldLabelId = useId();
|
|
29
|
+
const listAccessibleNameProps = {};
|
|
30
|
+
if (ariaLabel !== void 0) listAccessibleNameProps["aria-label"] = ariaLabel;
|
|
31
|
+
else if (ariaLabelledBy !== void 0) listAccessibleNameProps["aria-labelledby"] = ariaLabelledBy;
|
|
32
|
+
else if (label !== void 0) listAccessibleNameProps["aria-labelledby"] = fieldLabelId;
|
|
33
|
+
return /* @__PURE__ */ jsxs(Field.Root, {
|
|
34
|
+
...intrinsicAttributes,
|
|
35
|
+
className: clsx(select_module_default.Select, className),
|
|
36
|
+
dirty,
|
|
37
|
+
disabled,
|
|
38
|
+
invalid,
|
|
39
|
+
name,
|
|
40
|
+
touched,
|
|
41
|
+
validate,
|
|
42
|
+
validationDebounceTime,
|
|
43
|
+
validationMode,
|
|
44
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
45
|
+
direction: "column",
|
|
46
|
+
fillChildren: false,
|
|
47
|
+
rowGap: "small"
|
|
48
|
+
}),
|
|
49
|
+
children: [
|
|
50
|
+
label && /* @__PURE__ */ jsx(Field.Label, {
|
|
51
|
+
"data-field-label": "",
|
|
52
|
+
id: fieldLabelId,
|
|
53
|
+
children: /* @__PURE__ */ jsx(FieldLabel, { children: label })
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ jsxs(Select.Root, {
|
|
56
|
+
...restSelectProps,
|
|
57
|
+
disabled,
|
|
58
|
+
name,
|
|
59
|
+
children: [/* @__PURE__ */ jsxs(Select.Trigger, {
|
|
60
|
+
"aria-label": ariaLabel,
|
|
61
|
+
"aria-labelledby": ariaLabelledBy,
|
|
62
|
+
className: select_module_default.Trigger,
|
|
63
|
+
disabled,
|
|
64
|
+
ref,
|
|
65
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
66
|
+
direction: "row",
|
|
67
|
+
render: /* @__PURE__ */ jsx("button", { type: "button" }),
|
|
68
|
+
vAlign: "center"
|
|
69
|
+
}),
|
|
70
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
71
|
+
className: select_module_default.Value,
|
|
72
|
+
lineHeight: "small",
|
|
73
|
+
render: /* @__PURE__ */ jsx(Select.Value, { placeholder }),
|
|
74
|
+
size: "small",
|
|
75
|
+
whiteSpace: "nowrap"
|
|
76
|
+
}), /* @__PURE__ */ jsx(Select.Icon, {
|
|
77
|
+
className: select_module_default.Icon,
|
|
78
|
+
"data-grow": "false",
|
|
79
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
80
|
+
fillChildren: false,
|
|
81
|
+
hAlign: "center",
|
|
82
|
+
hPadding: "x-small",
|
|
83
|
+
inline: true,
|
|
84
|
+
shrink: false,
|
|
85
|
+
vAlign: "center"
|
|
86
|
+
}),
|
|
87
|
+
children: icon
|
|
88
|
+
})]
|
|
89
|
+
}), /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
|
|
90
|
+
alignItemWithTrigger: true,
|
|
91
|
+
children: /* @__PURE__ */ jsxs(Select.Popup, {
|
|
92
|
+
className: select_module_default.SelectPopup,
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsx(Select.ScrollUpArrow, {
|
|
95
|
+
className: clsx(select_module_default.ScrollArrow, select_module_default.ScrollArrowUp),
|
|
96
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
97
|
+
fillChildren: false,
|
|
98
|
+
hAlign: "center",
|
|
99
|
+
vAlign: "center"
|
|
100
|
+
}),
|
|
101
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
102
|
+
"aria-label": "Scroll list up",
|
|
103
|
+
className: select_module_default.ScrollButton,
|
|
104
|
+
icon: /* @__PURE__ */ jsx(Icon, { name: "ChevronUp" }),
|
|
105
|
+
size: "small",
|
|
106
|
+
tabIndex: -1,
|
|
107
|
+
variant: "flat"
|
|
108
|
+
})
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsx(Elevator, {
|
|
111
|
+
resting: 1,
|
|
112
|
+
children: /* @__PURE__ */ jsx(Select.List, {
|
|
113
|
+
...listAccessibleNameProps,
|
|
114
|
+
className: select_module_default.List,
|
|
115
|
+
render: /* @__PURE__ */ jsx(Surface, {
|
|
116
|
+
border: "all",
|
|
117
|
+
color: 1,
|
|
118
|
+
hPadding: "x-small",
|
|
119
|
+
radius: "medium",
|
|
120
|
+
vPadding: "x-small"
|
|
121
|
+
}),
|
|
122
|
+
children
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ jsx(Select.ScrollDownArrow, {
|
|
126
|
+
className: clsx(select_module_default.ScrollArrow, select_module_default.ScrollArrowDown),
|
|
127
|
+
render: /* @__PURE__ */ jsx(Stack, {
|
|
128
|
+
fillChildren: false,
|
|
129
|
+
hAlign: "center",
|
|
130
|
+
vAlign: "center"
|
|
131
|
+
}),
|
|
132
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
133
|
+
"aria-label": "Scroll list down",
|
|
134
|
+
className: select_module_default.ScrollButton,
|
|
135
|
+
icon: /* @__PURE__ */ jsx(Icon, { name: "ChevronDown" }),
|
|
136
|
+
size: "small",
|
|
137
|
+
tabIndex: -1,
|
|
138
|
+
variant: "flat"
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
})
|
|
143
|
+
}) })]
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ jsx(FieldHelperCopy, {
|
|
146
|
+
className: select_module_default.Description,
|
|
147
|
+
description,
|
|
148
|
+
error
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
});
|
|
30
152
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
153
|
+
var Select$1 = Object.assign(SelectRootComponent, {
|
|
154
|
+
Option: SelectOption,
|
|
155
|
+
Group: SelectGroup,
|
|
156
|
+
Separator: SelectSeparator
|
|
35
157
|
});
|
|
158
|
+
//#endregion
|
|
159
|
+
export { Select$1 as Select };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var select_module_default = {
|
|
2
|
+
Select: "select-module_Select_eXv4Y",
|
|
3
|
+
Trigger: "select-module_Trigger_-wBsg",
|
|
4
|
+
Value: "select-module_Value_uWHPX",
|
|
5
|
+
Icon: "select-module_Icon_EOwki",
|
|
6
|
+
Description: "select-module_Description_OmwmV",
|
|
7
|
+
SelectPopup: "select-module_SelectPopup_UzGXL",
|
|
8
|
+
ScrollArrow: "select-module_ScrollArrow_kHlEi",
|
|
9
|
+
ScrollButton: "select-module_ScrollButton_sHBOa",
|
|
10
|
+
ScrollArrowUp: "select-module_ScrollArrowUp_DGXS-",
|
|
11
|
+
ScrollArrowDown: "select-module_ScrollArrowDown_vhJy0",
|
|
12
|
+
List: "select-module_List_jdUWx",
|
|
13
|
+
Option: "select-module_Option_KgYqz",
|
|
14
|
+
Indicator: "select-module_Indicator_YNUuz",
|
|
15
|
+
Group: "select-module_Group_xzkuA",
|
|
16
|
+
Separator: "select-module_Separator_Q-ri9"
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { select_module_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Skeleton } from './skeleton
|
|
2
|
-
export type { SkeletonProps } from './skeleton
|
|
1
|
+
export { Skeleton } from './skeleton';
|
|
2
|
+
export type { SkeletonProps } from './skeleton';
|