@jonmilner/ui 0.13.2 → 0.13.3
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/Combobox/Combobox.css +1 -1
- package/dist/Combobox/Combobox.css.mjs +7 -7
- package/dist/Combobox/index.d.mts +2 -1
- package/dist/Combobox/index.mjs +42 -39
- package/dist/MultiSelect/MultiSelect.css +1 -1
- package/dist/MultiSelect/MultiSelect.css.mjs +2 -2
- package/dist/MultiSelect/index.d.mts +2 -1
- package/dist/MultiSelect/index.mjs +35 -32
- package/dist/RadioGroup/RadioGroup.css +1 -1
- package/dist/RadioGroup/RadioGroup.css.mjs +6 -6
- package/dist/RadioGroup/index.d.mts +2 -1
- package/dist/RadioGroup/index.mjs +57 -56
- package/dist/Select/Select.css +1 -1
- package/dist/Select/Select.css.mjs +2 -2
- package/dist/Select/index.d.mts +2 -1
- package/dist/Select/index.mjs +34 -31
- package/dist/docs/Combobox.md +3 -1
- package/dist/docs/MultiSelect.md +3 -1
- package/dist/docs/RadioGroup.md +2 -1
- package/dist/docs/Select.md +3 -1
- package/dist/docs/manifest.json +21 -1
- package/dist/popup/listbox-base.mjs +2 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
|
-
@layer components.combobox{.y6b2yi0{--_5qoq940:transparent;text-align:start;border-color:var(--color-border-strong);justify-content:stretch}:where(.
|
|
2
|
+
@layer components.combobox{.y6b2yi0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}.y6b2yi1{--_5qoq940:transparent;text-align:start;border-color:var(--color-border-strong);justify-content:stretch}:where(.y6b2yi1) ._1gwwloa0{flex:auto;justify-items:stretch;min-inline-size:0}:where(.y6b2yi1) ._1gwwloa1{min-inline-size:0}:where(.y6b2yi1) ._1gwwloa2{text-transform:none;min-inline-size:0;font-weight:var(--font-weight-medium);flex:auto}.y6b2yi2{min-inline-size:0;display:block}.y6b2yi2[data-placeholder]{color:var(--color-fg-muted)}.y6b2yi3{min-inline-size:0;display:grid}.y6b2yi4{grid-area:1/1}.y6b2yi4[aria-hidden=true]{visibility:hidden}.y6b2yi5{grid-area:1/1}.y6b2yi6{border:var(--space-1) solid var(--color-border);min-inline-size:var(--anchor-width);max-block-size:var(--available-height);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter);gap:var(--space-4);flex-direction:column;display:flex;overflow:hidden}.y6b2yi6:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}.y6b2yi6[data-starting-style],.y6b2yi6[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}.y6b2yi7{appearance:none;border-width:var(--space-1);border-style:solid;border-color:var(--color-border-strong);border-radius:var(--radius-med);background-color:var(--color-bg);inline-size:100%;min-inline-size:0;color:var(--color-fg);padding-block:0}.y6b2yi7::placeholder{color:var(--color-fg-muted);opacity:1}.y6b2yi7:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}.y6b2yi7:disabled{background-color:var(--color-bg-muted);color:var(--color-fg-muted);cursor:not-allowed;border-style:dashed}.y6b2yi7[aria-invalid=true]{border-color:var(--color-danger)}.y6b2yi8{block-size:var(--size-xs);padding-inline:var(--space-6)}.y6b2yi9{block-size:var(--size-sm);padding-inline:var(--space-8)}.y6b2yia{block-size:var(--size-med);padding-inline:var(--space-12)}.y6b2yib:empty{position:absolute}.y6b2yib:not(:empty){padding-block:var(--space-8);padding-inline:var(--space-12)}.y6b2yic{min-block-size:0;overflow-y:auto}.y6b2yid{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.y6b2yid:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:calc(-1 * var(--space-2))}.y6b2yid[data-highlighted]{background-color:light-dark(var(--color-bg-muted),color-mix(in srgb, var(--color-fg) 10%, var(--color-bg-raised)))}.y6b2yid[aria-disabled=true]{color:var(--color-fg-muted);cursor:not-allowed}.y6b2yie{visibility:hidden;flex-shrink:0}.y6b2yid[aria-selected=true] .y6b2yie{visibility:visible}@media (pointer:coarse){.y6b2yi7{font-size:var(--font-size-med)}}@media (forced-colors:active){.y6b2yi1[aria-disabled=true]{border-color:graytext}.y6b2yi7:disabled{color:graytext;border-color:graytext}.y6b2yid[data-highlighted]{forced-color-adjust:none;color:highlighttext;background-color:highlight}.y6b2yid[data-highlighted]:focus-visible{color:canvastext;background-color:canvas}.y6b2yid[aria-disabled=true]{color:graytext}}}
|
|
@@ -4,14 +4,14 @@ import "./Combobox.css";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
6
6
|
// src/Combobox/Combobox.css.ts
|
|
7
|
-
var t = "y6b2yi0", n = "y6b2yi1", r = "y6b2yi2", i = "y6b2yi3", a = "y6b2yi4", o = "y6b2yi5", s = e({
|
|
8
|
-
defaultClassName: "
|
|
7
|
+
var t = "y6b2yi0", n = "y6b2yi1", r = "y6b2yi2", i = "y6b2yi3", a = "y6b2yi4", o = "y6b2yi5", s = "y6b2yi6", c = e({
|
|
8
|
+
defaultClassName: "y6b2yi7",
|
|
9
9
|
variantClassNames: { size: {
|
|
10
|
-
sm: "
|
|
11
|
-
med: "
|
|
12
|
-
lg: "
|
|
10
|
+
sm: "y6b2yi8",
|
|
11
|
+
med: "y6b2yi9",
|
|
12
|
+
lg: "y6b2yia"
|
|
13
13
|
} },
|
|
14
14
|
defaultVariants: {},
|
|
15
15
|
compoundVariants: []
|
|
16
|
-
}),
|
|
17
|
-
export {
|
|
16
|
+
}), l = "y6b2yib", u = "y6b2yic", d = "y6b2yid", f = "y6b2yie";
|
|
17
|
+
export { f as check, o as count, l as empty, t as hiddenLabel, c as input, d as item, a as labels, u as list, s as popup, i as summary, n as trigger, r as value };
|
|
@@ -21,6 +21,7 @@ export type ComboboxProps = StyleProps & ComboboxValueProps & {
|
|
|
21
21
|
emptyLabel?: string;
|
|
22
22
|
error?: ReactNode;
|
|
23
23
|
filterLabel?: string;
|
|
24
|
+
hideLabel?: boolean;
|
|
24
25
|
label: ReactNode;
|
|
25
26
|
name?: string;
|
|
26
27
|
options: readonly ComboboxOption[];
|
|
@@ -29,5 +30,5 @@ export type ComboboxProps = StyleProps & ComboboxValueProps & {
|
|
|
29
30
|
size?: "sm" | "med" | "lg";
|
|
30
31
|
style?: CSSProperties;
|
|
31
32
|
};
|
|
32
|
-
export declare function Combobox({ options, multiple, value, defaultValue, onValueChange, label, description, error, placeholder, filterLabel, emptyLabel, countLabel, disabled, required, size, name, className, style, ...atoms }: ComboboxProps): import("react").JSX.Element;
|
|
33
|
+
export declare function Combobox({ options, multiple, value, defaultValue, onValueChange, label, hideLabel, description, error, placeholder, filterLabel, emptyLabel, countLabel, disabled, required, size, name, className, style, ...atoms }: ComboboxProps): import("react").JSX.Element;
|
|
33
34
|
export {};
|
package/dist/Combobox/index.mjs
CHANGED
|
@@ -2,61 +2,64 @@ import { controlText as e } from "../styles/control-size.mjs";
|
|
|
2
2
|
import { Text as t } from "../Text/index.mjs";
|
|
3
3
|
import { Field as n } from "../Field/index.mjs";
|
|
4
4
|
import { ListboxLabel as r, ListboxScope as i } from "../popup/listbox-base.mjs";
|
|
5
|
-
import { empty as a,
|
|
6
|
-
import { ComboboxList as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { Combobox as
|
|
5
|
+
import { empty as a, hiddenLabel as o, input as s } from "./Combobox.css.mjs";
|
|
6
|
+
import { ComboboxList as c, ComboboxPopup as l, ComboboxPortal as u, ComboboxPositioner as d, ComboboxRoot as f, ComboboxTrigger as p } from "./client.mjs";
|
|
7
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
|
+
import { Combobox as g } from "@base-ui/react/combobox";
|
|
9
9
|
// src/Combobox/index.tsx
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
...
|
|
13
|
-
className:
|
|
14
|
-
disabled:
|
|
15
|
-
invalid:
|
|
16
|
-
style:
|
|
10
|
+
function _({ options: _, multiple: v = !1, value: y, defaultValue: b, onValueChange: x, label: S, hideLabel: C = !1, description: w, error: T, placeholder: E = "Select", filterLabel: D = "Filter", emptyLabel: O = "No matches", countLabel: k = "{count} selected", disabled: A = !1, required: j = !1, size: M = "med", name: N, className: P, style: F, ...I }) {
|
|
11
|
+
return /* @__PURE__ */ h(n, {
|
|
12
|
+
...I,
|
|
13
|
+
className: P,
|
|
14
|
+
disabled: A,
|
|
15
|
+
invalid: T != null && T !== !1 && T !== "",
|
|
16
|
+
style: F,
|
|
17
17
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
defaultValue:
|
|
20
|
-
disabled:
|
|
21
|
-
multiple:
|
|
22
|
-
name:
|
|
23
|
-
onValueChange:
|
|
24
|
-
options:
|
|
25
|
-
required:
|
|
26
|
-
value:
|
|
18
|
+
/* @__PURE__ */ m(i, { children: /* @__PURE__ */ h(f, {
|
|
19
|
+
defaultValue: b,
|
|
20
|
+
disabled: A,
|
|
21
|
+
multiple: v,
|
|
22
|
+
name: N,
|
|
23
|
+
onValueChange: x,
|
|
24
|
+
options: _,
|
|
25
|
+
required: j,
|
|
26
|
+
value: y,
|
|
27
27
|
children: [
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
disabled: O,
|
|
32
|
-
placeholder: w,
|
|
33
|
-
size: A
|
|
28
|
+
/* @__PURE__ */ m(r, {
|
|
29
|
+
className: C ? o : void 0,
|
|
30
|
+
children: S
|
|
34
31
|
}),
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
/* @__PURE__ */ m(p, {
|
|
33
|
+
countLabel: k,
|
|
34
|
+
disabled: A,
|
|
35
|
+
placeholder: E,
|
|
36
|
+
size: M
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ m(u, { children: /* @__PURE__ */ m(d, { children: /* @__PURE__ */ h(l, { children: [
|
|
39
|
+
/* @__PURE__ */ m(g.Input, {
|
|
40
|
+
"aria-label": D,
|
|
38
41
|
"aria-labelledby": void 0,
|
|
39
|
-
render: /* @__PURE__ */
|
|
42
|
+
render: /* @__PURE__ */ m(t, {
|
|
40
43
|
as: "input",
|
|
41
|
-
className:
|
|
42
|
-
size: e[
|
|
44
|
+
className: s({ size: M }),
|
|
45
|
+
size: e[M]
|
|
43
46
|
})
|
|
44
47
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
render: /* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ m(g.Empty, {
|
|
49
|
+
render: /* @__PURE__ */ m(t, {
|
|
47
50
|
className: a,
|
|
48
51
|
color: "fgMuted",
|
|
49
52
|
size: "sm"
|
|
50
53
|
}),
|
|
51
|
-
children:
|
|
54
|
+
children: O
|
|
52
55
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ m(c, {})
|
|
54
57
|
] }) }) })
|
|
55
58
|
]
|
|
56
59
|
}) }),
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */
|
|
60
|
+
w != null && /* @__PURE__ */ m(n.Description, { children: w }),
|
|
61
|
+
/* @__PURE__ */ m(n.Error, { children: T })
|
|
59
62
|
]
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
|
-
export {
|
|
65
|
+
export { _ as Combobox };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
|
-
@layer components.multiselect{._1seauxl0{--_5qoq940:transparent;text-align:start;border-color:var(--color-border-strong);justify-content:stretch}:where(.
|
|
2
|
+
@layer components.multiselect{._1seauxl0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1seauxl1{--_5qoq940:transparent;text-align:start;border-color:var(--color-border-strong);justify-content:stretch}:where(._1seauxl1) ._1gwwloa0{flex:auto;justify-items:stretch;min-inline-size:0}:where(._1seauxl1) ._1gwwloa1{min-inline-size:0}:where(._1seauxl1) ._1gwwloa2{text-transform:none;min-inline-size:0;font-weight:var(--font-weight-medium);flex:auto}._1seauxl2{min-inline-size:0;display:block}._1seauxl2[data-placeholder]{color:var(--color-fg-muted)}._1seauxl3{min-inline-size:0;display:grid}._1seauxl4{grid-area:1/1}._1seauxl4[aria-hidden=true]{visibility:hidden}._1seauxl5{grid-area:1/1}._1seauxl6{border:var(--space-1) solid var(--color-border);min-inline-size:var(--anchor-width);max-block-size:var(--available-height);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter);overflow-y:auto}._1seauxl6:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1seauxl6[data-starting-style],._1seauxl6[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}._1seauxl7{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}._1seauxl7:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:calc(-1 * var(--space-2))}._1seauxl7[data-highlighted]{background-color:light-dark(var(--color-bg-muted),color-mix(in srgb, var(--color-fg) 10%, var(--color-bg-raised)))}._1seauxl7[aria-disabled=true]{color:var(--color-fg-muted);cursor:not-allowed}._1seauxl8{visibility:hidden;flex-shrink:0}._1seauxl7[aria-selected=true] ._1seauxl8{visibility:visible}@media (forced-colors:active){._1seauxl1[aria-disabled=true]{border-color:graytext}._1seauxl7[data-highlighted]{forced-color-adjust:none;color:highlighttext;background-color:highlight}._1seauxl7[data-highlighted]:focus-visible{color:canvastext;background-color:canvas}._1seauxl7[aria-disabled=true]{color:graytext}}}
|
|
@@ -3,5 +3,5 @@ import "./MultiSelect.css";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
// src/MultiSelect/MultiSelect.css.ts
|
|
6
|
-
var e = "_1seauxl0", t = "_1seauxl1", n = "_1seauxl2", r = "_1seauxl3", i = "_1seauxl4", a = "_1seauxl5", o = "_1seauxl6", s = "_1seauxl7";
|
|
7
|
-
export {
|
|
6
|
+
var e = "_1seauxl0", t = "_1seauxl1", n = "_1seauxl2", r = "_1seauxl3", i = "_1seauxl4", a = "_1seauxl5", o = "_1seauxl6", s = "_1seauxl7", c = "_1seauxl8";
|
|
7
|
+
export { c as check, a as count, e as hiddenLabel, s as item, i as labels, o as popup, r as summary, t as trigger, n as value };
|
|
@@ -9,6 +9,7 @@ export type MultiSelectProps = StyleProps & {
|
|
|
9
9
|
description?: ReactNode;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
error?: ReactNode;
|
|
12
|
+
hideLabel?: boolean;
|
|
12
13
|
label: ReactNode;
|
|
13
14
|
name?: string;
|
|
14
15
|
onValueChange?: (value: string[]) => void;
|
|
@@ -19,4 +20,4 @@ export type MultiSelectProps = StyleProps & {
|
|
|
19
20
|
style?: CSSProperties;
|
|
20
21
|
value?: readonly string[];
|
|
21
22
|
};
|
|
22
|
-
export declare function MultiSelect({ options, value, defaultValue, onValueChange, label, description, error, placeholder, countLabel, disabled, required, size, name, className, style, ...atoms }: MultiSelectProps): import("react").JSX.Element;
|
|
23
|
+
export declare function MultiSelect({ options, value, defaultValue, onValueChange, label, hideLabel, description, error, placeholder, countLabel, disabled, required, size, name, className, style, ...atoms }: MultiSelectProps): import("react").JSX.Element;
|
|
@@ -2,47 +2,50 @@ import { Field as e } from "../Field/index.mjs";
|
|
|
2
2
|
import { ListboxLabel as t, ListboxScope as n } from "../popup/listbox-base.mjs";
|
|
3
3
|
import { ListboxPopup as r, ListboxPortal as i, ListboxPositioner as a } from "../popup/listbox.mjs";
|
|
4
4
|
import { ListboxOptions as o } from "../popup/listbox-options.mjs";
|
|
5
|
-
import { check as s,
|
|
6
|
-
import { MultiSelectRoot as
|
|
7
|
-
import { jsx as
|
|
5
|
+
import { check as s, hiddenLabel as c, item as l, popup as u } from "./MultiSelect.css.mjs";
|
|
6
|
+
import { MultiSelectRoot as d, MultiSelectTrigger as f } from "./client.mjs";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
8
|
// src/MultiSelect/index.tsx
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
...
|
|
12
|
-
className:
|
|
13
|
-
disabled:
|
|
14
|
-
invalid:
|
|
15
|
-
style:
|
|
9
|
+
function h({ options: h, value: g, defaultValue: _, onValueChange: v, label: y, hideLabel: b = !1, description: x, error: S, placeholder: C = "Select", countLabel: w = "{count} selected", disabled: T = !1, required: E = !1, size: D = "med", name: O, className: k, style: A, ...j }) {
|
|
10
|
+
return /* @__PURE__ */ m(e, {
|
|
11
|
+
...j,
|
|
12
|
+
className: k,
|
|
13
|
+
disabled: T,
|
|
14
|
+
invalid: S != null && S !== !1 && S !== "",
|
|
15
|
+
style: A,
|
|
16
16
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
defaultValue:
|
|
19
|
-
disabled:
|
|
20
|
-
name:
|
|
21
|
-
onValueChange:
|
|
22
|
-
required:
|
|
23
|
-
value:
|
|
17
|
+
/* @__PURE__ */ p(n, { children: /* @__PURE__ */ m(d, {
|
|
18
|
+
defaultValue: _,
|
|
19
|
+
disabled: T,
|
|
20
|
+
name: O,
|
|
21
|
+
onValueChange: v,
|
|
22
|
+
required: E,
|
|
23
|
+
value: g,
|
|
24
24
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
disabled: C,
|
|
29
|
-
options: m,
|
|
30
|
-
placeholder: x,
|
|
31
|
-
size: T
|
|
25
|
+
/* @__PURE__ */ p(t, {
|
|
26
|
+
className: b ? c : void 0,
|
|
27
|
+
children: y
|
|
32
28
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
/* @__PURE__ */ p(f, {
|
|
30
|
+
countLabel: w,
|
|
31
|
+
disabled: T,
|
|
32
|
+
options: h,
|
|
33
|
+
placeholder: C,
|
|
34
|
+
size: D
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ p(i, { children: /* @__PURE__ */ p(a, { children: /* @__PURE__ */ p(r, {
|
|
37
|
+
className: u,
|
|
38
|
+
children: /* @__PURE__ */ p(o, {
|
|
36
39
|
checkClassName: s,
|
|
37
|
-
itemClassName:
|
|
38
|
-
options:
|
|
40
|
+
itemClassName: l,
|
|
41
|
+
options: h
|
|
39
42
|
})
|
|
40
43
|
}) }) })
|
|
41
44
|
]
|
|
42
45
|
}) }),
|
|
43
|
-
|
|
44
|
-
/* @__PURE__ */
|
|
46
|
+
x != null && /* @__PURE__ */ p(e.Description, { children: x }),
|
|
47
|
+
/* @__PURE__ */ p(e.Error, { children: S })
|
|
45
48
|
]
|
|
46
49
|
});
|
|
47
50
|
}
|
|
48
|
-
export {
|
|
51
|
+
export { h as MultiSelect };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
|
-
@layer components.radio-group{._15rnw5c0[data-disabled]{color:var(--color-fg-muted)}._15rnw5c1{display:flex}.
|
|
2
|
+
@layer components.radio-group{._15rnw5c0[data-disabled]{color:var(--color-fg-muted)}._15rnw5c1{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._15rnw5c2{display:flex}._15rnw5c3{row-gap:var(--space-8);flex-direction:column}._15rnw5c4{column-gap:var(--space-16);row-gap:var(--space-8);flex-flow:wrap}._15rnw5c5{align-items:center;column-gap:var(--space-8);grid-template-columns:auto 1fr;display:grid}._15rnw5c6{grid-column-start:2}._15rnw5c7{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}._15rnw5c7:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._15rnw5c7[aria-disabled=true]{cursor:not-allowed}._15rnw5c8{inline-size:var(--space-16);block-size:var(--space-16);border:var(--space-1) solid var(--color-border-strong);border-radius:var(--radius-full);background-color:var(--color-bg);color:var(--color-accent);forced-color-adjust:none;place-items:center;display:grid}._15rnw5c7:not([aria-checked=true],[aria-invalid=true],[aria-disabled=true]):hover ._15rnw5c8{border-color:var(--color-fg)}._15rnw5c7[aria-checked=true] ._15rnw5c8{border-color:var(--color-accent)}._15rnw5c7[aria-disabled=true] ._15rnw5c8{border-style:dashed;border-color:var(--color-border-strong);background-color:var(--color-bg-muted);color:var(--color-fg-muted)}._15rnw5c7[aria-invalid=true] ._15rnw5c8{border-width:var(--space-2);border-color:var(--color-danger)}._15rnw5c9{inline-size:var(--space-8);block-size:var(--space-8);border-radius:var(--radius-full);opacity:0;scale:calc(1 - var(--scale-lg));transition-property:opacity,scale;transition-duration:var(--duration-fast);transition-timing-function:var(--easing-standard);background-color:currentColor}._15rnw5c7[aria-checked=true] ._15rnw5c9{opacity:1;scale:1}}
|
|
@@ -4,13 +4,13 @@ import "./RadioGroup.css";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
6
6
|
// src/RadioGroup/RadioGroup.css.ts
|
|
7
|
-
var t = "_15rnw5c0", n = e({
|
|
8
|
-
defaultClassName: "
|
|
7
|
+
var t = "_15rnw5c0", n = "_15rnw5c1", r = e({
|
|
8
|
+
defaultClassName: "_15rnw5c2",
|
|
9
9
|
variantClassNames: { orientation: {
|
|
10
|
-
vertical: "
|
|
11
|
-
horizontal: "
|
|
10
|
+
vertical: "_15rnw5c3",
|
|
11
|
+
horizontal: "_15rnw5c4"
|
|
12
12
|
} },
|
|
13
13
|
defaultVariants: {},
|
|
14
14
|
compoundVariants: []
|
|
15
|
-
}),
|
|
16
|
-
export {
|
|
15
|
+
}), i = "_15rnw5c5", a = "_15rnw5c6", o = "_15rnw5c7", s = "_15rnw5c8", c = "_15rnw5c9";
|
|
16
|
+
export { s as circle, c as dot, n as hiddenLabel, i as item, a as label, t as legend, r as options, o as root };
|
|
@@ -12,6 +12,7 @@ export type RadioGroupProps = StyleProps & {
|
|
|
12
12
|
description?: ReactNode;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
error?: ReactNode;
|
|
15
|
+
hideLabel?: boolean;
|
|
15
16
|
label: ReactNode;
|
|
16
17
|
name?: string;
|
|
17
18
|
onValueChange?: (value: string) => void;
|
|
@@ -22,4 +23,4 @@ export type RadioGroupProps = StyleProps & {
|
|
|
22
23
|
style?: CSSProperties;
|
|
23
24
|
value?: string | null;
|
|
24
25
|
};
|
|
25
|
-
export declare function RadioGroup({ options, value, defaultValue, onValueChange, label, description, error, orientation, size, disabled, required, name, className, style, ...atoms }: RadioGroupProps): import("react").JSX.Element;
|
|
26
|
+
export declare function RadioGroup({ options, value, defaultValue, onValueChange, label, hideLabel, description, error, orientation, size, disabled, required, name, className, style, ...atoms }: RadioGroupProps): import("react").JSX.Element;
|
|
@@ -1,95 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { join as e } from "../styles/join.mjs";
|
|
2
|
+
import { Box as t } from "../Box/base.mjs";
|
|
3
|
+
import { controlText as n } from "../styles/control-size.mjs";
|
|
4
|
+
import { Text as r } from "../Text/index.mjs";
|
|
5
|
+
import { Field as i } from "../Field/index.mjs";
|
|
6
|
+
import { circle as a, dot as o, item as s, label as c, legend as l, options as u, root as d } from "./RadioGroup.css.mjs";
|
|
7
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
|
+
import { Field as m } from "@base-ui/react/field";
|
|
9
|
+
import { Fieldset as h } from "@base-ui/react/fieldset";
|
|
10
|
+
import { Radio as g } from "@base-ui/react/radio";
|
|
11
|
+
import { RadioGroup as _ } from "@base-ui/react/radio-group";
|
|
11
12
|
// src/RadioGroup/index.tsx
|
|
12
|
-
var
|
|
13
|
+
var v = {
|
|
13
14
|
sm: "xs",
|
|
14
15
|
med: "xs",
|
|
15
16
|
lg: "sm"
|
|
16
17
|
};
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
...
|
|
20
|
-
className:
|
|
21
|
-
disabled:
|
|
22
|
-
invalid:
|
|
23
|
-
style:
|
|
18
|
+
function y({ options: y, value: b, defaultValue: x, onValueChange: S, label: C, hideLabel: w = !1, description: T, error: E, orientation: D = "vertical", size: O = "med", disabled: k = !1, required: A = !1, name: j, className: M, style: N, ...P }) {
|
|
19
|
+
return /* @__PURE__ */ p(i, {
|
|
20
|
+
...P,
|
|
21
|
+
className: M,
|
|
22
|
+
disabled: k,
|
|
23
|
+
invalid: E != null && E !== !1 && E !== "",
|
|
24
|
+
style: N,
|
|
24
25
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
disabled:
|
|
27
|
-
render: /* @__PURE__ */
|
|
28
|
-
defaultValue:
|
|
29
|
-
name:
|
|
30
|
-
onValueChange:
|
|
31
|
-
render: /* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ p(h.Root, {
|
|
27
|
+
disabled: k,
|
|
28
|
+
render: /* @__PURE__ */ f(_, {
|
|
29
|
+
defaultValue: x,
|
|
30
|
+
name: j,
|
|
31
|
+
onValueChange: S && ((e) => S(e)),
|
|
32
|
+
render: /* @__PURE__ */ f(t, {
|
|
32
33
|
display: "flex",
|
|
33
34
|
flexDirection: "column",
|
|
34
35
|
gap: "8"
|
|
35
36
|
}),
|
|
36
|
-
required:
|
|
37
|
-
value:
|
|
37
|
+
required: A,
|
|
38
|
+
value: b
|
|
38
39
|
}),
|
|
39
|
-
children: [/* @__PURE__ */
|
|
40
|
-
render: /* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ f(h.Legend, {
|
|
41
|
+
render: /* @__PURE__ */ f(r, {
|
|
41
42
|
as: "div",
|
|
42
|
-
className:
|
|
43
|
+
className: e(l, w && "_15rnw5c1"),
|
|
43
44
|
font: "label",
|
|
44
45
|
size: "sm",
|
|
45
46
|
weight: "medium"
|
|
46
47
|
}),
|
|
47
|
-
children:
|
|
48
|
-
}), /* @__PURE__ */
|
|
49
|
-
className:
|
|
50
|
-
children:
|
|
51
|
-
disabled:
|
|
52
|
-
render: /* @__PURE__ */
|
|
48
|
+
children: C
|
|
49
|
+
}), /* @__PURE__ */ f(t, {
|
|
50
|
+
className: u({ orientation: D }),
|
|
51
|
+
children: y.map((e) => /* @__PURE__ */ p(m.Item, {
|
|
52
|
+
disabled: e.disabled,
|
|
53
|
+
render: /* @__PURE__ */ f(t, { className: s }),
|
|
53
54
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
render: /* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ f(g.Root, {
|
|
56
|
+
render: /* @__PURE__ */ f(t, {
|
|
56
57
|
alignItems: "center",
|
|
57
58
|
as: "span",
|
|
58
|
-
className:
|
|
59
|
+
className: d,
|
|
59
60
|
display: "inline-flex",
|
|
60
61
|
flexShrink: 0,
|
|
61
62
|
justifyContent: "center",
|
|
62
63
|
minBlockSize: "xs",
|
|
63
64
|
minInlineSize: "xs"
|
|
64
65
|
}),
|
|
65
|
-
value:
|
|
66
|
-
children: /* @__PURE__ */
|
|
66
|
+
value: e.value,
|
|
67
|
+
children: /* @__PURE__ */ f(t, {
|
|
67
68
|
as: "span",
|
|
68
|
-
className:
|
|
69
|
-
children: /* @__PURE__ */
|
|
69
|
+
className: a,
|
|
70
|
+
children: /* @__PURE__ */ f(t, {
|
|
70
71
|
as: "span",
|
|
71
|
-
className:
|
|
72
|
+
className: o
|
|
72
73
|
})
|
|
73
74
|
})
|
|
74
75
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
className:
|
|
77
|
-
size:
|
|
76
|
+
/* @__PURE__ */ f(i.Label, {
|
|
77
|
+
className: c,
|
|
78
|
+
size: n[O],
|
|
78
79
|
weight: "regular",
|
|
79
|
-
children:
|
|
80
|
+
children: e.label
|
|
80
81
|
}),
|
|
81
|
-
|
|
82
|
-
className: "
|
|
83
|
-
size:
|
|
84
|
-
children:
|
|
82
|
+
e.description != null && /* @__PURE__ */ f(i.Description, {
|
|
83
|
+
className: "_15rnw5c6",
|
|
84
|
+
size: v[O],
|
|
85
|
+
children: e.description
|
|
85
86
|
})
|
|
86
87
|
]
|
|
87
|
-
},
|
|
88
|
+
}, e.value))
|
|
88
89
|
})]
|
|
89
90
|
}),
|
|
90
|
-
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
T != null && /* @__PURE__ */ f(i.Description, { children: T }),
|
|
92
|
+
/* @__PURE__ */ f(i.Error, { children: E })
|
|
92
93
|
]
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
|
-
export {
|
|
96
|
+
export { y as RadioGroup };
|
package/dist/Select/Select.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.nav-list, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.table;
|
|
2
|
-
@layer components.select{.e26gsj0{--_5qoq940:transparent;text-align:start;border-color:var(--color-border-strong);justify-content:stretch}:where(.
|
|
2
|
+
@layer components.select{.e26gsj0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}.e26gsj1{--_5qoq940:transparent;text-align:start;border-color:var(--color-border-strong);justify-content:stretch}:where(.e26gsj1) ._1gwwloa0{flex:auto;justify-items:stretch;min-inline-size:0}:where(.e26gsj1) ._1gwwloa1{min-inline-size:0}:where(.e26gsj1) ._1gwwloa2{text-transform:none;min-inline-size:0;font-weight:var(--font-weight-medium);flex:auto}.e26gsj2{min-inline-size:0;display:block}.e26gsj2[data-placeholder]{color:var(--color-fg-muted)}.e26gsj3{border:var(--space-1) solid var(--color-border);min-inline-size:var(--anchor-width);max-block-size:var(--available-height);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter);overflow-y:auto}.e26gsj3:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}.e26gsj3[data-starting-style],.e26gsj3[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}.e26gsj4{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.e26gsj4:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:calc(-1 * var(--space-2))}.e26gsj4[data-highlighted]{background-color:light-dark(var(--color-bg-muted),color-mix(in srgb, var(--color-fg) 10%, var(--color-bg-raised)))}.e26gsj4[aria-disabled=true]{color:var(--color-fg-muted);cursor:not-allowed}.e26gsj5{visibility:hidden;flex-shrink:0}.e26gsj4[aria-selected=true] .e26gsj5{visibility:visible}@media (forced-colors:active){.e26gsj1[aria-disabled=true]{border-color:graytext}.e26gsj4[data-highlighted]{forced-color-adjust:none;color:highlighttext;background-color:highlight}.e26gsj4[data-highlighted]:focus-visible{color:canvastext;background-color:canvas}.e26gsj4[aria-disabled=true]{color:graytext}}}
|
|
@@ -3,5 +3,5 @@ import "./Select.css";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
// src/Select/Select.css.ts
|
|
6
|
-
var e = "e26gsj0", t = "e26gsj1", n = "e26gsj2", r = "e26gsj3", i = "e26gsj4";
|
|
7
|
-
export {
|
|
6
|
+
var e = "e26gsj0", t = "e26gsj1", n = "e26gsj2", r = "e26gsj3", i = "e26gsj4", a = "e26gsj5";
|
|
7
|
+
export { a as check, e as hiddenLabel, i as item, r as popup, t as trigger, n as value };
|
package/dist/Select/index.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ export type SelectProps = StyleProps & {
|
|
|
8
8
|
description?: ReactNode;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
error?: ReactNode;
|
|
11
|
+
hideLabel?: boolean;
|
|
11
12
|
label: ReactNode;
|
|
12
13
|
name?: string;
|
|
13
14
|
onValueChange?: (value: string | null) => void;
|
|
@@ -18,4 +19,4 @@ export type SelectProps = StyleProps & {
|
|
|
18
19
|
style?: CSSProperties;
|
|
19
20
|
value?: string | null;
|
|
20
21
|
};
|
|
21
|
-
export declare function Select({ options, value, defaultValue, onValueChange, label, description, error, placeholder, disabled, required, size, name, className, style, ...atoms }: SelectProps): import("react").JSX.Element;
|
|
22
|
+
export declare function Select({ options, value, defaultValue, onValueChange, label, hideLabel, description, error, placeholder, disabled, required, size, name, className, style, ...atoms }: SelectProps): import("react").JSX.Element;
|
package/dist/Select/index.mjs
CHANGED
|
@@ -2,46 +2,49 @@ import { Field as e } from "../Field/index.mjs";
|
|
|
2
2
|
import { ListboxLabel as t, ListboxScope as n } from "../popup/listbox-base.mjs";
|
|
3
3
|
import { ListboxPopup as r, ListboxPortal as i, ListboxPositioner as a } from "../popup/listbox.mjs";
|
|
4
4
|
import { ListboxOptions as o } from "../popup/listbox-options.mjs";
|
|
5
|
-
import { check as s,
|
|
6
|
-
import { SelectRoot as
|
|
7
|
-
import { jsx as
|
|
5
|
+
import { check as s, hiddenLabel as c, item as l, popup as u } from "./Select.css.mjs";
|
|
6
|
+
import { SelectRoot as d, SelectTrigger as f } from "./client.mjs";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
8
|
// src/Select/index.tsx
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
...
|
|
12
|
-
className:
|
|
13
|
-
disabled:
|
|
14
|
-
invalid:
|
|
15
|
-
style:
|
|
9
|
+
function h({ options: h, value: g, defaultValue: _, onValueChange: v, label: y, hideLabel: b = !1, description: x, error: S, placeholder: C = "Select", disabled: w = !1, required: T = !1, size: E = "med", name: D, className: O, style: k, ...A }) {
|
|
10
|
+
return /* @__PURE__ */ m(e, {
|
|
11
|
+
...A,
|
|
12
|
+
className: O,
|
|
13
|
+
disabled: w,
|
|
14
|
+
invalid: S != null && S !== !1 && S !== "",
|
|
15
|
+
style: k,
|
|
16
16
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
defaultValue:
|
|
19
|
-
disabled:
|
|
20
|
-
name:
|
|
21
|
-
onValueChange:
|
|
22
|
-
required:
|
|
23
|
-
value:
|
|
17
|
+
/* @__PURE__ */ p(n, { children: /* @__PURE__ */ m(d, {
|
|
18
|
+
defaultValue: _,
|
|
19
|
+
disabled: w,
|
|
20
|
+
name: D,
|
|
21
|
+
onValueChange: v,
|
|
22
|
+
required: T,
|
|
23
|
+
value: g,
|
|
24
24
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
options: m,
|
|
29
|
-
placeholder: x,
|
|
30
|
-
size: w
|
|
25
|
+
/* @__PURE__ */ p(t, {
|
|
26
|
+
className: b ? c : void 0,
|
|
27
|
+
children: y
|
|
31
28
|
}),
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
/* @__PURE__ */ p(f, {
|
|
30
|
+
disabled: w,
|
|
31
|
+
options: h,
|
|
32
|
+
placeholder: C,
|
|
33
|
+
size: E
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ p(i, { children: /* @__PURE__ */ p(a, { children: /* @__PURE__ */ p(r, {
|
|
36
|
+
className: u,
|
|
37
|
+
children: /* @__PURE__ */ p(o, {
|
|
35
38
|
checkClassName: s,
|
|
36
|
-
itemClassName:
|
|
37
|
-
options:
|
|
39
|
+
itemClassName: l,
|
|
40
|
+
options: h
|
|
38
41
|
})
|
|
39
42
|
}) }) })
|
|
40
43
|
]
|
|
41
44
|
}) }),
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */
|
|
45
|
+
x != null && /* @__PURE__ */ p(e.Description, { children: x }),
|
|
46
|
+
/* @__PURE__ */ p(e.Error, { children: S })
|
|
44
47
|
]
|
|
45
48
|
});
|
|
46
49
|
}
|
|
47
|
-
export {
|
|
50
|
+
export { h as Select };
|
package/dist/docs/Combobox.md
CHANGED
|
@@ -20,7 +20,8 @@ A form field for picking one value, or any number with `multiple`, from a list l
|
|
|
20
20
|
|
|
21
21
|
## Rules
|
|
22
22
|
|
|
23
|
-
- `label` is required and names the field
|
|
23
|
+
- `label` is required and names the field, even when the design shows none: pass `hideLabel` to keep it for assistive technology and hide it from sight, taking no room, so in a toolbar the trigger's top lines up with a `hideLabel` SearchField's input. Never pass an empty label, and never let `placeholder` stand in for one.
|
|
24
|
+
- `description` and `error` render below the trigger through `Field`; a non-empty `error` marks the field invalid and joins the trigger's `aria-describedby`.
|
|
24
25
|
- `options` is a list of `{ value, label, disabled? }`. `label` is plain text: it is what the filter matches, and it is shown in the list and in the trigger.
|
|
25
26
|
- `multiple` (default `false`) sets the value's type. Without it, `value` and `defaultValue` are an option value or `null` for none (`""` counts as none too), and `onValueChange` gets the new value. With it, they are arrays of option values, and `onValueChange` gets the new array. `value` with `onValueChange` controls it; `defaultValue` leaves it uncontrolled.
|
|
26
27
|
- The filter matches the query anywhere in the label, ignoring case, accents and punctuation (Base UI's default). It is empty each time the popup opens. With `multiple`, a pick keeps the query, so several matches can be picked in a row.
|
|
@@ -107,6 +108,7 @@ Generated from the TypeScript types.
|
|
|
107
108
|
| `emptyLabel` | `string` | no | |
|
|
108
109
|
| `error` | `ReactNode` | no | |
|
|
109
110
|
| `filterLabel` | `string` | no | |
|
|
111
|
+
| `hideLabel` | `boolean` | no | |
|
|
110
112
|
| `label` | `ReactNode` | yes | |
|
|
111
113
|
| `multiple` | `boolean` | no | |
|
|
112
114
|
| `name` | `string` | no | |
|
package/dist/docs/MultiSelect.md
CHANGED
|
@@ -20,7 +20,8 @@ A form field for picking any number of values from a list too long to show at on
|
|
|
20
20
|
|
|
21
21
|
## Rules
|
|
22
22
|
|
|
23
|
-
- `label` is required and names the field
|
|
23
|
+
- `label` is required and names the field, even when the design shows none: pass `hideLabel` to keep it for assistive technology and hide it from sight, taking no room, so in a toolbar the trigger's top lines up with a `hideLabel` SearchField's input. Never pass an empty label, and never let `placeholder` stand in for one.
|
|
24
|
+
- `description` and `error` render below the trigger through `Field`; a non-empty `error` marks the field invalid and joins the trigger's `aria-describedby`.
|
|
24
25
|
- `options` is a list of `{ value, label, disabled? }`. `label` is plain text: it is shown in the list and in the trigger summary.
|
|
25
26
|
- `value` with `onValueChange` controls it; `defaultValue` leaves it uncontrolled. Both are arrays of option values, and `onValueChange` gets the new array.
|
|
26
27
|
- `name` makes each selected value submit as its own `name=value` pair, as a `<select multiple>` does; read them with `formData.getAll(name)`. Nothing selected submits nothing.
|
|
@@ -110,6 +111,7 @@ Generated from the TypeScript types.
|
|
|
110
111
|
| `description` | `ReactNode` | no | |
|
|
111
112
|
| `disabled` | `boolean` | no | |
|
|
112
113
|
| `error` | `ReactNode` | no | |
|
|
114
|
+
| `hideLabel` | `boolean` | no | |
|
|
113
115
|
| `label` | `ReactNode` | yes | |
|
|
114
116
|
| `name` | `string` | no | |
|
|
115
117
|
| `onValueChange` | `((value: string[]) => void)` | no | |
|
package/dist/docs/RadioGroup.md
CHANGED
|
@@ -19,7 +19,7 @@ One choice among a few options, all shown at once. A form field built on Base UI
|
|
|
19
19
|
|
|
20
20
|
## Rules
|
|
21
21
|
|
|
22
|
-
- Pass `label`: it is the group's legend and its accessible name. `options` is data, not children: each is `{ value, label, description?, disabled? }`.
|
|
22
|
+
- Pass `label`: it is the group's legend and its accessible name, even when the design shows none: pass `hideLabel` to keep it for assistive technology and hide it from sight, taking no room. Never pass an empty label. `options` is data, not children: each is `{ value, label, description?, disabled? }`.
|
|
23
23
|
- `name` submits the checked option as `name=value`; with none checked, nothing is submitted. Put `name` on the RadioGroup.
|
|
24
24
|
- `value` with `onValueChange` controls it; `defaultValue` leaves it uncontrolled. A controlled `value` of `null` checks none, so start or reset a form with `null`, not `undefined`. `onValueChange` receives the value string only.
|
|
25
25
|
- To start with nothing checked, leave `defaultValue` unset. Pair that with `required` and `error` when an answer is mandatory.
|
|
@@ -108,6 +108,7 @@ Generated from the TypeScript types.
|
|
|
108
108
|
| `description` | `ReactNode` | no | |
|
|
109
109
|
| `disabled` | `boolean` | no | |
|
|
110
110
|
| `error` | `ReactNode` | no | |
|
|
111
|
+
| `hideLabel` | `boolean` | no | |
|
|
111
112
|
| `label` | `ReactNode` | yes | |
|
|
112
113
|
| `name` | `string` | no | |
|
|
113
114
|
| `onValueChange` | `((value: string) => void)` | no | |
|
package/dist/docs/Select.md
CHANGED
|
@@ -19,7 +19,8 @@ A form field for picking one value from a list too long to show as radios, with
|
|
|
19
19
|
|
|
20
20
|
## Rules
|
|
21
21
|
|
|
22
|
-
- `label` is required and names the field
|
|
22
|
+
- `label` is required and names the field, even when the design shows none: pass `hideLabel` to keep it for assistive technology and hide it from sight, taking no room, so in a toolbar the trigger's top lines up with a `hideLabel` SearchField's input. Never pass an empty label, and never let `placeholder` stand in for one.
|
|
23
|
+
- `description` and `error` render below the trigger through `Field`; a non-empty `error` marks the field invalid and joins the trigger's `aria-describedby`.
|
|
23
24
|
- `options` is a list of `{ value, label, disabled? }`. `label` is plain text: it is shown in the list and in the trigger.
|
|
24
25
|
- `value` with `onValueChange` controls it; `defaultValue` leaves it uncontrolled. Both are an option value or `null` for none (`""` counts as none too), and `onValueChange` gets the new value.
|
|
25
26
|
- A `value` that no option holds still shows in the trigger, as the raw value, so a stale or unknown value is seen rather than read as empty.
|
|
@@ -107,6 +108,7 @@ Generated from the TypeScript types.
|
|
|
107
108
|
| `description` | `ReactNode` | no | |
|
|
108
109
|
| `disabled` | `boolean` | no | |
|
|
109
110
|
| `error` | `ReactNode` | no | |
|
|
111
|
+
| `hideLabel` | `boolean` | no | |
|
|
110
112
|
| `label` | `ReactNode` | yes | |
|
|
111
113
|
| `name` | `string` | no | |
|
|
112
114
|
| `onValueChange` | `((value: string \| null) => void)` | no | |
|
package/dist/docs/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./manifest.schema.json",
|
|
3
3
|
"package": "@jonmilner/ui",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.3",
|
|
5
5
|
"components": [
|
|
6
6
|
{
|
|
7
7
|
"name": "AlertDialog",
|
|
@@ -583,6 +583,11 @@
|
|
|
583
583
|
"type": "string",
|
|
584
584
|
"required": false
|
|
585
585
|
},
|
|
586
|
+
{
|
|
587
|
+
"name": "hideLabel",
|
|
588
|
+
"type": "boolean",
|
|
589
|
+
"required": false
|
|
590
|
+
},
|
|
586
591
|
{
|
|
587
592
|
"name": "label",
|
|
588
593
|
"type": "ReactNode",
|
|
@@ -1766,6 +1771,11 @@
|
|
|
1766
1771
|
"type": "ReactNode",
|
|
1767
1772
|
"required": false
|
|
1768
1773
|
},
|
|
1774
|
+
{
|
|
1775
|
+
"name": "hideLabel",
|
|
1776
|
+
"type": "boolean",
|
|
1777
|
+
"required": false
|
|
1778
|
+
},
|
|
1769
1779
|
{
|
|
1770
1780
|
"name": "label",
|
|
1771
1781
|
"type": "ReactNode",
|
|
@@ -1926,6 +1936,11 @@
|
|
|
1926
1936
|
"type": "ReactNode",
|
|
1927
1937
|
"required": false
|
|
1928
1938
|
},
|
|
1939
|
+
{
|
|
1940
|
+
"name": "hideLabel",
|
|
1941
|
+
"type": "boolean",
|
|
1942
|
+
"required": false
|
|
1943
|
+
},
|
|
1929
1944
|
{
|
|
1930
1945
|
"name": "label",
|
|
1931
1946
|
"type": "ReactNode",
|
|
@@ -2106,6 +2121,11 @@
|
|
|
2106
2121
|
"type": "ReactNode",
|
|
2107
2122
|
"required": false
|
|
2108
2123
|
},
|
|
2124
|
+
{
|
|
2125
|
+
"name": "hideLabel",
|
|
2126
|
+
"type": "boolean",
|
|
2127
|
+
"required": false
|
|
2128
|
+
},
|
|
2109
2129
|
{
|
|
2110
2130
|
"name": "label",
|
|
2111
2131
|
"type": "ReactNode",
|