@jonmilner/ui 0.17.0 → 0.19.0
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/Avatar/Avatar.css +1 -1
- package/dist/Badge/Badge.css +2 -2
- package/dist/Badge/Badge.css.mjs +6 -9
- package/dist/Badge/index.mjs +10 -3
- package/dist/Box/Box.css +1 -1
- package/dist/Button/Button.css +2 -2
- package/dist/Button/Button.css.mjs +1 -1
- package/dist/Button/index.d.mts +2 -1
- package/dist/Button/index.mjs +21 -21
- package/dist/Checkbox/Checkbox.css +1 -1
- package/dist/Chip/Chip.css +2 -2
- package/dist/Chip/Chip.css.mjs +7 -2
- package/dist/Chip/index.d.mts +3 -2
- package/dist/Chip/index.mjs +57 -39
- package/dist/Clickable/Clickable.css +1 -1
- package/dist/ColorField/ColorField.css +2 -2
- package/dist/ColorField/ColorField.css.mjs +28 -2
- package/dist/ColorField/client.d.mts +1 -1
- package/dist/ColorField/client.mjs +40 -35
- package/dist/ColorField/index.d.mts +3 -2
- package/dist/ColorField/index.mjs +39 -28
- package/dist/Combobox/Combobox.css +2 -2
- package/dist/Dialog/Dialog.css +1 -1
- package/dist/Field/Field.css +1 -1
- package/dist/Heading/Heading.css +1 -1
- package/dist/Icon/Icon.css +1 -1
- package/dist/IconButton/IconButton.css +2 -2
- package/dist/IconButton/IconButton.css.mjs +2 -2
- package/dist/IconButton/index.d.mts +1 -1
- package/dist/IconButton/index.mjs +5 -4
- package/dist/Inline/Inline.css +1 -1
- package/dist/Menu/Menu.css +2 -2
- package/dist/Menu/Menu.css.mjs +2 -2
- package/dist/Menu/client.d.mts +1 -0
- package/dist/Menu/client.mjs +45 -54
- package/dist/Menu/index.d.mts +5 -4
- package/dist/Menu/index.mjs +74 -85
- package/dist/Menu/item-row.mjs +52 -0
- package/dist/MultiSelect/MultiSelect.css +2 -2
- package/dist/MultiSelect/client.mjs +5 -4
- package/dist/MultiSelect/index.d.mts +3 -1
- package/dist/MultiSelect/index.mjs +16 -15
- package/dist/NavList/NavList.css +2 -2
- package/dist/NavList/NavList.css.mjs +2 -2
- package/dist/NavList/index.d.mts +3 -1
- package/dist/NavList/index.mjs +67 -63
- package/dist/NumberField/NumberField.css +1 -1
- package/dist/RadioGroup/RadioGroup.css +1 -1
- package/dist/SearchField/SearchField.css +2 -2
- package/dist/SearchField/SearchField.css.mjs +28 -11
- package/dist/SearchField/client.d.mts +1 -1
- package/dist/SearchField/client.mjs +27 -31
- package/dist/SearchField/index.d.mts +3 -2
- package/dist/SearchField/index.mjs +37 -28
- package/dist/Select/Select.css +2 -2
- package/dist/Select/client.mjs +5 -4
- package/dist/Select/index.d.mts +3 -1
- package/dist/Select/index.mjs +15 -14
- package/dist/Sidebar/Sidebar.css +1 -1
- package/dist/Sidebar/index.mjs +1 -2
- package/dist/SidebarLayout/SidebarLayout.css +1 -1
- package/dist/Stack/Stack.css +1 -1
- package/dist/Switch/Switch.css +1 -1
- package/dist/Table/Table.css +1 -1
- package/dist/Table/index.mjs +9 -9
- package/dist/Tabs/Tabs.css +1 -1
- package/dist/Tag/Tag.css +2 -2
- package/dist/Tag/Tag.css.mjs +48 -18
- package/dist/Tag/index.d.mts +2 -1
- package/dist/Tag/index.mjs +59 -46
- package/dist/Text/Text.css +1 -1
- package/dist/TextField/TextField.css +2 -2
- package/dist/TextField/TextField.css.mjs +28 -2
- package/dist/TextField/index.d.mts +3 -2
- package/dist/TextField/index.mjs +45 -33
- package/dist/Textarea/Textarea.css +1 -1
- package/dist/Toast/Toast.css +1 -1
- package/dist/Tooltip/Tooltip.css +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
- package/dist/base.css +1 -1
- package/dist/contrast/contrast.d.mts +1 -1
- package/dist/contrast/contrast.mjs +3 -2
- package/dist/contrast/mixes.mjs +32 -22
- package/dist/docs/AlertDialog.md +1 -0
- package/dist/docs/Badge.md +2 -2
- package/dist/docs/Button.md +10 -8
- package/dist/docs/Chip.md +10 -3
- package/dist/docs/ColorField.md +7 -0
- package/dist/docs/Dialog.md +3 -1
- package/dist/docs/IconButton.md +5 -5
- package/dist/docs/Menu.md +27 -3
- package/dist/docs/MultiSelect.md +6 -0
- package/dist/docs/NavList.md +10 -7
- package/dist/docs/SearchField.md +6 -0
- package/dist/docs/Select.md +6 -0
- package/dist/docs/Sidebar.md +3 -3
- package/dist/docs/Tag.md +12 -3
- package/dist/docs/TextField.md +13 -1
- package/dist/docs/Tooltip.md +2 -1
- package/dist/docs/llms.txt +5 -5
- package/dist/docs/manifest.json +115 -1
- package/dist/docs/migrations/0.18.0.md +65 -0
- package/dist/docs/migrations/0.19.0.md +90 -0
- package/dist/docs/theming.md +1 -1
- package/dist/icon-slot/input-icons.mjs +23 -0
- package/dist/icon-slot/slot.mjs +17 -13
- package/dist/index.mjs +11 -11
- package/dist/popup/client.d.mts +1 -1
- package/dist/popup/client.mjs +6 -5
- package/dist/popup/listbox-base.mjs +3 -2
- package/dist/popup/listbox.mjs +5 -4
- package/dist/styles/atoms.css +1 -1
- package/dist/styles/button-fills.mjs +1 -1
- package/dist/styles/layers.css +1 -1
- package/dist/styles/responsive.css +1 -1
- package/dist/theme/define-theme.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Box as e } from "../Box/base.mjs";
|
|
2
|
+
import { iconGap as t } from "../icon-slot/gap.mjs";
|
|
3
|
+
import { Text as n } from "../Text/index.mjs";
|
|
4
|
+
import { description as r } from "./Menu.css.mjs";
|
|
5
|
+
import { Children as i } from "react";
|
|
6
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
// src/Menu/item-row.tsx
|
|
8
|
+
function c(e, { iconStart: t, iconEnd: r }) {
|
|
9
|
+
return /* @__PURE__ */ s(a, { children: [
|
|
10
|
+
t && /* @__PURE__ */ o(t, {
|
|
11
|
+
className: "_393eil4",
|
|
12
|
+
size: "sm"
|
|
13
|
+
}),
|
|
14
|
+
i.map(e, (e) => typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ o(n, {
|
|
15
|
+
as: "span",
|
|
16
|
+
font: "label",
|
|
17
|
+
size: "sm",
|
|
18
|
+
children: e
|
|
19
|
+
}) : e),
|
|
20
|
+
r && /* @__PURE__ */ o(r, {
|
|
21
|
+
className: "_393eil4",
|
|
22
|
+
size: "sm"
|
|
23
|
+
})
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
var l = (e) => e ? {
|
|
27
|
+
flexDirection: "column",
|
|
28
|
+
alignItems: "stretch",
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
gap: "4",
|
|
31
|
+
paddingBlock: "8"
|
|
32
|
+
} : {
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
gap: t.sm
|
|
35
|
+
};
|
|
36
|
+
function u({ children: i, description: c, id: l }) {
|
|
37
|
+
return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(e, {
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
as: "span",
|
|
40
|
+
display: "flex",
|
|
41
|
+
gap: t.sm,
|
|
42
|
+
children: i
|
|
43
|
+
}), /* @__PURE__ */ o(n, {
|
|
44
|
+
"aria-hidden": !0,
|
|
45
|
+
as: "span",
|
|
46
|
+
className: r,
|
|
47
|
+
id: l,
|
|
48
|
+
size: "xs",
|
|
49
|
+
children: c
|
|
50
|
+
})] });
|
|
51
|
+
}
|
|
52
|
+
export { u as DescribedContent, c as itemChildren, l as itemLayout };
|
|
@@ -1,2 +1,2 @@
|
|
|
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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.
|
|
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{
|
|
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.number-field, 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.nav-list, components.table;
|
|
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{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{flex:auto;min-inline-size:0}._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{--color-fg:CanvasText}._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}}@supports (text-box:trim-both cap alphabetic){._1seauxl4,._1seauxl5{text-box-trim:trim-both}}}
|
|
@@ -7,12 +7,13 @@ import { useMemo as c } from "react";
|
|
|
7
7
|
import { jsx as l } from "react/jsx-runtime";
|
|
8
8
|
import { Select as u } from "@base-ui/react/select";
|
|
9
9
|
// src/MultiSelect/client.tsx
|
|
10
|
-
function d({ options: e, placeholder: d, countLabel: f, disabled: p,
|
|
11
|
-
let
|
|
10
|
+
function d({ options: e, placeholder: d, countLabel: f, disabled: p, iconStart: m, size: h }) {
|
|
11
|
+
let g = c(() => new Map(e.map((e) => [e.value, e.label])), [e]);
|
|
12
12
|
return /* @__PURE__ */ l(n, {
|
|
13
13
|
className: o,
|
|
14
14
|
disabled: p,
|
|
15
|
-
|
|
15
|
+
iconStart: m,
|
|
16
|
+
size: h,
|
|
16
17
|
children: /* @__PURE__ */ l(u.Value, {
|
|
17
18
|
className: s,
|
|
18
19
|
placeholder: d,
|
|
@@ -23,7 +24,7 @@ function d({ options: e, placeholder: d, countLabel: f, disabled: p, size: m })
|
|
|
23
24
|
summary: a
|
|
24
25
|
},
|
|
25
26
|
count: f.replaceAll("{count}", String(e.length)),
|
|
26
|
-
labels: e.map((e) =>
|
|
27
|
+
labels: e.map((e) => g.get(e) ?? e)
|
|
27
28
|
}) : d
|
|
28
29
|
})
|
|
29
30
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StyleProps } from "../Box/base.mjs";
|
|
2
|
+
import { IconSlotProps } from "../icon-slot/slot.mjs";
|
|
2
3
|
import { ListboxOption } from "../popup/listbox-row.mjs";
|
|
3
4
|
import { CSSProperties, ReactNode } from "react";
|
|
4
5
|
export type MultiSelectOption = ListboxOption;
|
|
@@ -10,6 +11,7 @@ export type MultiSelectProps = StyleProps & {
|
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
error?: ReactNode;
|
|
12
13
|
hideLabel?: boolean;
|
|
14
|
+
iconStart?: IconSlotProps["iconStart"];
|
|
13
15
|
label: ReactNode;
|
|
14
16
|
name?: string;
|
|
15
17
|
onValueChange?: (value: string[]) => void;
|
|
@@ -20,4 +22,4 @@ export type MultiSelectProps = StyleProps & {
|
|
|
20
22
|
style?: CSSProperties;
|
|
21
23
|
value?: readonly string[];
|
|
22
24
|
};
|
|
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;
|
|
25
|
+
export declare function MultiSelect({ options, value, defaultValue, onValueChange, label, hideLabel, iconStart, description, error, placeholder, countLabel, disabled, required, size, name, className, style, ...atoms }: MultiSelectProps): import("react").JSX.Element;
|
|
@@ -6,20 +6,20 @@ import { check as s, hiddenLabel as c, item as l, popup as u } from "./MultiSele
|
|
|
6
6
|
import { MultiSelectRoot as d, MultiSelectTrigger as f } from "./client.mjs";
|
|
7
7
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
8
|
// src/MultiSelect/index.tsx
|
|
9
|
-
function h({ options: h, value: g, defaultValue: _, onValueChange: v, label: y, hideLabel: b = !1,
|
|
9
|
+
function h({ options: h, value: g, defaultValue: _, onValueChange: v, label: y, hideLabel: b = !1, iconStart: x, description: S, error: C, placeholder: w = "Select", countLabel: T = "{count} selected", disabled: E = !1, required: D = !1, size: O = "med", name: k, className: A, style: j, ...M }) {
|
|
10
10
|
return /* @__PURE__ */ m(e, {
|
|
11
|
-
...
|
|
12
|
-
className:
|
|
13
|
-
disabled:
|
|
14
|
-
invalid:
|
|
15
|
-
style:
|
|
11
|
+
...M,
|
|
12
|
+
className: A,
|
|
13
|
+
disabled: E,
|
|
14
|
+
invalid: C != null && C !== !1 && C !== "",
|
|
15
|
+
style: j,
|
|
16
16
|
children: [
|
|
17
17
|
/* @__PURE__ */ p(n, { children: /* @__PURE__ */ m(d, {
|
|
18
18
|
defaultValue: _,
|
|
19
|
-
disabled:
|
|
20
|
-
name:
|
|
19
|
+
disabled: E,
|
|
20
|
+
name: k,
|
|
21
21
|
onValueChange: v,
|
|
22
|
-
required:
|
|
22
|
+
required: D,
|
|
23
23
|
value: g,
|
|
24
24
|
children: [
|
|
25
25
|
/* @__PURE__ */ p(t, {
|
|
@@ -27,11 +27,12 @@ function h({ options: h, value: g, defaultValue: _, onValueChange: v, label: y,
|
|
|
27
27
|
children: y
|
|
28
28
|
}),
|
|
29
29
|
/* @__PURE__ */ p(f, {
|
|
30
|
-
countLabel:
|
|
31
|
-
disabled:
|
|
30
|
+
countLabel: T,
|
|
31
|
+
disabled: E,
|
|
32
|
+
iconStart: x,
|
|
32
33
|
options: h,
|
|
33
|
-
placeholder:
|
|
34
|
-
size:
|
|
34
|
+
placeholder: w,
|
|
35
|
+
size: O
|
|
35
36
|
}),
|
|
36
37
|
/* @__PURE__ */ p(i, { children: /* @__PURE__ */ p(a, { children: /* @__PURE__ */ p(r, {
|
|
37
38
|
className: u,
|
|
@@ -43,8 +44,8 @@ function h({ options: h, value: g, defaultValue: _, onValueChange: v, label: y,
|
|
|
43
44
|
}) }) })
|
|
44
45
|
]
|
|
45
46
|
}) }),
|
|
46
|
-
|
|
47
|
-
/* @__PURE__ */ p(e.Error, { children:
|
|
47
|
+
S != null && /* @__PURE__ */ p(e.Description, { children: S }),
|
|
48
|
+
/* @__PURE__ */ p(e.Error, { children: C })
|
|
48
49
|
]
|
|
49
50
|
});
|
|
50
51
|
}
|
package/dist/NavList/NavList.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.
|
|
2
|
-
@layer components.nav-list{._1kvngp01{padding-inline-start:0;list-style:none}._1kvngp02:not(:first-child),:where(._1kvngp02)+._1kvngp03{padding-block-start:var(--space-16)}._1kvngp05{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}._1kvngp05:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1kvngp06{overflow-wrap:anywhere;min-inline-size:0}._1kvngp08{
|
|
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.number-field, 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.nav-list, components.table;
|
|
2
|
+
@layer components.nav-list{._1kvngp01{padding-inline-start:0;list-style:none}._1kvngp02:not(:first-child),:where(._1kvngp02)+._1kvngp03{padding-block-start:var(--space-16)}._1kvngp05{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}._1kvngp05:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1kvngp06{overflow-wrap:anywhere;min-inline-size:0}._1kvngp08{position:relative}._1kvngp09{inline-size:var(--space-6);block-size:var(--space-6);border-radius:var(--radius-full);background-color:var(--color-success);pointer-events:none;box-shadow:0 0 0 calc(var(--space-2) + var(--space-1)) color-mix(in oklch, var(--color-success) 18%, transparent);flex-shrink:0}._1kvngp0a{inline-size:var(--space-6);block-size:var(--space-6);border-radius:var(--radius-full);background-color:var(--color-success);pointer-events:none;box-shadow:0 0 0 var(--space-2) var(--color-bg-panel);flex-shrink:0;display:none;position:absolute;inset-block-start:calc(var(--space-6) / -2);inset-inline-end:calc(var(--space-6) / -2)}@container _1n4s23v1 (inline-size>=0){._1kvngp04{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1kvngp05{--_1kvngp00:1;inline-size:var(--size-med);block-size:var(--size-med);justify-content:center}._1kvngp06,._1kvngp07{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1kvngp09{display:none}._1kvngp0a{display:block}}@media (hover:hover){._1kvngp05:not([aria-current=page]):hover{background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent))}}@media (forced-colors:active){._1kvngp05:not([aria-current=page]):hover{background-image:none}._1kvngp05[aria-current=page]{color:highlighttext;background-color:highlight}._1kvngp09{forced-color-adjust:none;box-shadow:none;background-color:currentColor}._1kvngp0a{forced-color-adjust:none;box-shadow:0 0 0 var(--space-2) Canvas;background-color:currentColor}}}@layer reset{._1kvngp05{color:inherit;text-decoration:none}}
|
|
@@ -5,5 +5,5 @@ import "./NavList.css";
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
// src/NavList/NavList.css.ts
|
|
8
|
-
var e = "var(--_1kvngp00)", t = "_1kvngp01", n = "_1kvngp02", r = "_1kvngp03", i = "_1kvngp04", a = "_1kvngp05", o = "_1kvngp06", s = "_1kvngp07", c = "_1kvngp08";
|
|
9
|
-
export { s as count, r as entry, n as group, i as heading,
|
|
8
|
+
var e = "var(--_1kvngp00)", t = "_1kvngp01", n = "_1kvngp02", r = "_1kvngp03", i = "_1kvngp04", a = "_1kvngp05", o = "_1kvngp06", s = "_1kvngp07", c = "_1kvngp08", l = "_1kvngp09", u = "_1kvngp0a";
|
|
9
|
+
export { u as cornerDot, s as count, r as entry, n as group, i as heading, a as item, o as label, c as lead, t as list, l as liveDot, e as railFlag };
|
package/dist/NavList/index.d.mts
CHANGED
|
@@ -21,6 +21,8 @@ export type NavListItemOwnProps = {
|
|
|
21
21
|
count?: ReactNode;
|
|
22
22
|
current?: boolean;
|
|
23
23
|
icon?: ComponentType<IconProps>;
|
|
24
|
+
live?: boolean;
|
|
25
|
+
liveLabel?: string;
|
|
24
26
|
};
|
|
25
27
|
type NavListItemLeading = {
|
|
26
28
|
avatar?: never;
|
|
@@ -30,7 +32,7 @@ type NavListItemLeading = {
|
|
|
30
32
|
export type NavListItemProps<T extends ElementType = "a"> = PolymorphicProps<T, StyleProps & NavListItemOwnProps, "aria-current"> & NavListItemLeading;
|
|
31
33
|
declare function NavListRoot({ children, ...props }: NavListProps): import("react").JSX.Element;
|
|
32
34
|
declare function NavListGroup({ label, headingLevel, display, flexDirection, gap, className, children, ...props }: NavListGroupProps): import("react").JSX.Element;
|
|
33
|
-
declare function NavListItem<T extends ElementType = "a">({ as, current, icon: ItemIcon, avatar, count, display, alignItems, gap, position, minBlockSize, paddingBlock, paddingInline, borderRadius, backgroundColor, color, className, children, ...props }: NavListItemProps<T>): import("react").JSX.Element;
|
|
35
|
+
declare function NavListItem<T extends ElementType = "a">({ as, current, icon: ItemIcon, avatar, count, live, liveLabel, display, alignItems, gap, position, minBlockSize, paddingBlock, paddingInline, borderRadius, backgroundColor, color, className, children, ...props }: NavListItemProps<T>): import("react").JSX.Element;
|
|
34
36
|
export declare const NavList: typeof NavListRoot & {
|
|
35
37
|
Group: typeof NavListGroup;
|
|
36
38
|
Item: typeof NavListItem;
|
package/dist/NavList/index.mjs
CHANGED
|
@@ -2,124 +2,128 @@ import { join as e } from "../styles/join.mjs";
|
|
|
2
2
|
import { Box as t } from "../Box/base.mjs";
|
|
3
3
|
import { Text as n } from "../Text/index.mjs";
|
|
4
4
|
import { Badge as r } from "../Badge/index.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { VisuallyHidden as i } from "../VisuallyHidden/index.mjs";
|
|
6
|
+
import { cornerDot as a, count as o, entry as s, group as c, heading as l, item as u, label as d, lead as f, list as p, liveDot as m } from "./NavList.css.mjs";
|
|
7
|
+
import { RailTooltip as h } from "./client.mjs";
|
|
8
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
9
|
+
import { Tooltip as y } from "@base-ui/react/tooltip";
|
|
9
10
|
// src/NavList/index.tsx
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
function b({ children: e, ...n }) {
|
|
12
|
+
return /* @__PURE__ */ _(t, {
|
|
12
13
|
...n,
|
|
13
14
|
as: "nav",
|
|
14
|
-
children: /* @__PURE__ */
|
|
15
|
+
children: /* @__PURE__ */ _(y.Provider, { children: /* @__PURE__ */ _(x, { children: e }) })
|
|
15
16
|
});
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
function x({ label: e, children: n }) {
|
|
19
|
+
return /* @__PURE__ */ _(t, {
|
|
19
20
|
"aria-label": e,
|
|
20
21
|
as: "ul",
|
|
21
|
-
className:
|
|
22
|
+
className: p,
|
|
22
23
|
display: "flex",
|
|
23
24
|
flexDirection: "column",
|
|
24
25
|
gap: "4",
|
|
25
26
|
children: n
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
function S({ label: r, headingLevel: i = "h2", display: a = "flex", flexDirection: o = "column", gap: s = "4", className: u, children: d, ...f }) {
|
|
30
|
+
return /* @__PURE__ */ v(t, {
|
|
30
31
|
...f,
|
|
31
32
|
as: "li",
|
|
32
|
-
className: e(
|
|
33
|
+
className: e(c, u),
|
|
33
34
|
display: a,
|
|
34
|
-
flexDirection:
|
|
35
|
-
gap:
|
|
36
|
-
children: [/* @__PURE__ */
|
|
35
|
+
flexDirection: o,
|
|
36
|
+
gap: s,
|
|
37
|
+
children: [/* @__PURE__ */ _(n, {
|
|
37
38
|
as: i,
|
|
38
|
-
className:
|
|
39
|
+
className: l,
|
|
39
40
|
color: "fgMuted",
|
|
40
41
|
paddingBlock: "4",
|
|
41
42
|
paddingInline: "8",
|
|
42
43
|
size: "xs",
|
|
43
44
|
weight: "semibold",
|
|
44
45
|
children: r
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ _(x, {
|
|
46
47
|
label: r,
|
|
47
48
|
children: d
|
|
48
49
|
})]
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
let
|
|
53
|
-
alignItems:
|
|
54
|
-
as:
|
|
55
|
-
backgroundColor:
|
|
56
|
-
borderRadius:
|
|
57
|
-
color:
|
|
58
|
-
display:
|
|
59
|
-
gap:
|
|
60
|
-
minBlockSize:
|
|
61
|
-
paddingBlock:
|
|
62
|
-
paddingInline:
|
|
63
|
-
position:
|
|
64
|
-
...
|
|
65
|
-
"aria-current":
|
|
66
|
-
className: e(
|
|
52
|
+
function C({ as: c, current: l = !1, icon: p, avatar: y, count: b, live: x = !1, liveLabel: S = "live", display: C = "flex", alignItems: w = "center", gap: T = "8", position: E = "relative", minBlockSize: D = "sm", paddingBlock: O = "6", paddingInline: k = "8", borderRadius: A = "xs", backgroundColor: j = l ? "selected" : void 0, color: M = "fg", className: N, children: P, ...F }) {
|
|
53
|
+
let I = /* @__PURE__ */ v(t, {
|
|
54
|
+
alignItems: w,
|
|
55
|
+
as: c ?? "a",
|
|
56
|
+
backgroundColor: j,
|
|
57
|
+
borderRadius: A,
|
|
58
|
+
color: M,
|
|
59
|
+
display: C,
|
|
60
|
+
gap: T,
|
|
61
|
+
minBlockSize: D,
|
|
62
|
+
paddingBlock: O,
|
|
63
|
+
paddingInline: k,
|
|
64
|
+
position: E,
|
|
65
|
+
...F,
|
|
66
|
+
"aria-current": l ? "page" : void 0,
|
|
67
|
+
className: e(u, N),
|
|
67
68
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
"aria-hidden": !0,
|
|
70
|
-
as: "span",
|
|
71
|
-
className: c
|
|
72
|
-
}),
|
|
73
|
-
d ? /* @__PURE__ */ p(d, { size: "sm" }) : null,
|
|
74
|
-
h == null ? null : /* @__PURE__ */ p(t, {
|
|
69
|
+
p != null || y != null ? /* @__PURE__ */ v(t, {
|
|
75
70
|
"aria-hidden": !0,
|
|
76
71
|
as: "span",
|
|
72
|
+
className: f,
|
|
77
73
|
display: "flex",
|
|
78
74
|
flexShrink: 0,
|
|
79
|
-
children:
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
children: [p ? /* @__PURE__ */ _(p, { size: "sm" }) : y, x ? /* @__PURE__ */ _(t, {
|
|
76
|
+
as: "span",
|
|
77
|
+
className: a
|
|
78
|
+
}) : null]
|
|
79
|
+
}) : null,
|
|
80
|
+
/* @__PURE__ */ _(n, {
|
|
82
81
|
as: "span",
|
|
83
|
-
className:
|
|
82
|
+
className: d,
|
|
84
83
|
flexGrow: 1,
|
|
85
84
|
size: "sm",
|
|
86
|
-
weight:
|
|
87
|
-
children:
|
|
85
|
+
weight: l ? "medium" : "regular",
|
|
86
|
+
children: P
|
|
88
87
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
88
|
+
x ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(t, {
|
|
89
|
+
"aria-hidden": !0,
|
|
90
|
+
as: "span",
|
|
91
|
+
className: m
|
|
92
|
+
}), /* @__PURE__ */ _(i, { children: ` ${S}` })] }) : null,
|
|
93
|
+
/* @__PURE__ */ _(r, {
|
|
94
|
+
className: o,
|
|
91
95
|
flexShrink: 0,
|
|
92
96
|
size: "xs",
|
|
93
97
|
subtle: !0,
|
|
94
|
-
children:
|
|
98
|
+
children: b
|
|
95
99
|
})
|
|
96
100
|
]
|
|
97
101
|
});
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
className:
|
|
100
|
-
children: /* @__PURE__ */
|
|
101
|
-
link:
|
|
102
|
-
children: /* @__PURE__ */
|
|
102
|
+
return /* @__PURE__ */ _("li", {
|
|
103
|
+
className: s,
|
|
104
|
+
children: /* @__PURE__ */ _(h, {
|
|
105
|
+
link: I,
|
|
106
|
+
children: /* @__PURE__ */ v(t, {
|
|
103
107
|
alignItems: "center",
|
|
104
108
|
as: "span",
|
|
105
109
|
display: "flex",
|
|
106
110
|
gap: "8",
|
|
107
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ _(n, {
|
|
108
112
|
as: "span",
|
|
109
113
|
size: "sm",
|
|
110
|
-
children:
|
|
111
|
-
}), /* @__PURE__ */
|
|
114
|
+
children: P
|
|
115
|
+
}), /* @__PURE__ */ _(r, {
|
|
112
116
|
flexShrink: 0,
|
|
113
117
|
size: "xs",
|
|
114
118
|
subtle: !0,
|
|
115
|
-
children:
|
|
119
|
+
children: b
|
|
116
120
|
})]
|
|
117
121
|
})
|
|
118
122
|
})
|
|
119
123
|
});
|
|
120
124
|
}
|
|
121
|
-
var
|
|
122
|
-
Group:
|
|
123
|
-
Item:
|
|
125
|
+
var w = Object.assign(b, {
|
|
126
|
+
Group: S,
|
|
127
|
+
Item: C
|
|
124
128
|
});
|
|
125
|
-
export {
|
|
129
|
+
export { w as NavList };
|
|
@@ -1,2 +1,2 @@
|
|
|
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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.
|
|
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.number-field, 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.nav-list, components.table;
|
|
2
2
|
@layer components.number-field{._4ak7w90{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._4ak7w91{grid-template-columns:var(--space-4) auto minmax(0, 1fr) auto var(--space-4)}._4ak7w92{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);text-align:center;grid-area:1/1/auto/-1;padding-block:0}._4ak7w92::placeholder{color:var(--color-fg-muted);opacity:1}._4ak7w92:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._4ak7w92:disabled{background-color:var(--color-bg-muted);color:var(--color-fg-muted);cursor:not-allowed;border-style:dashed}._4ak7w92[aria-invalid=true]{border-color:var(--color-danger)}._4ak7w93{block-size:var(--size-xs);padding-inline:calc(var(--size-xs) + var(--space-4))}._4ak7w94{block-size:var(--size-sm);padding-inline:calc(var(--size-xs) + var(--space-4))}._4ak7w95{block-size:var(--size-med);padding-inline:calc(var(--size-sm) + var(--space-4))}._4ak7w96{background-clip:padding-box;grid-area:1/2}._4ak7w97{background-clip:padding-box;grid-area:1/4}@media (pointer:coarse){._4ak7w92{font-size:var(--font-size-med)}}@media (forced-colors:active){._4ak7w92:disabled{color:graytext;border-color:graytext}._4ak7w96{border-color:#0000}._4ak7w96[aria-disabled=true]{border-color:graytext}._4ak7w97{border-color:#0000}._4ak7w97[aria-disabled=true]{border-color:graytext}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.
|
|
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.number-field, 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.nav-list, components.table;
|
|
2
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}}
|
|
@@ -1,2 +1,2 @@
|
|
|
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.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.
|
|
2
|
-
@layer components.search-field{._1cj8r6g0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}.
|
|
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.number-field, 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.nav-list, components.table;
|
|
2
|
+
@layer components.search-field{._1cj8r6g0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1cj8r6g1{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);grid-area:1/1;padding-block:0}._1cj8r6g1::placeholder{color:var(--color-fg-muted);opacity:1}._1cj8r6g1:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1cj8r6g1:disabled{background-color:var(--color-bg-muted);color:var(--color-fg-muted);cursor:not-allowed;border-style:dashed}._1cj8r6g1[aria-invalid=true]{border-color:var(--color-danger)}._1cj8r6g1::-webkit-search-cancel-button{appearance:none}._1cj8r6g1::-webkit-search-decoration{appearance:none}._1cj8r6g2{block-size:var(--size-xs);padding-inline-start:var(--space-6);padding-inline-end:calc(var(--size-xs) + var(--space-4))}._1cj8r6g3{block-size:var(--size-sm);padding-inline-start:var(--space-8);padding-inline-end:calc(var(--size-xs) + var(--space-4))}._1cj8r6g4{block-size:var(--size-med);padding-inline-start:var(--space-12);padding-inline-end:calc(var(--size-sm) + var(--space-4))}._1cj8r6g5{font-family:var(--font-body);font-size:var(--font-size-xs);line-height:var(--size-xs);color:var(--color-fg-muted);pointer-events:none;grid-area:1/1;justify-self:start;padding-inline-start:var(--space-6)}._1cj8r6g6{font-family:var(--font-body);font-size:var(--font-size-sm);line-height:var(--size-sm);color:var(--color-fg-muted);pointer-events:none;grid-area:1/1;justify-self:start;padding-inline-start:var(--space-8)}._1cj8r6g7{font-family:var(--font-body);font-size:var(--font-size-med);line-height:var(--size-med);color:var(--color-fg-muted);pointer-events:none;grid-area:1/1;justify-self:start;padding-inline-start:var(--space-12)}._1cj8r6g8{font-family:var(--font-body);font-size:var(--font-size-xs);line-height:var(--size-xs);color:var(--color-fg-muted);pointer-events:none;grid-area:1/1;justify-self:end;padding-inline-end:var(--space-6)}._1cj8r6g9{font-family:var(--font-body);font-size:var(--font-size-sm);line-height:var(--size-sm);color:var(--color-fg-muted);pointer-events:none;grid-area:1/1;justify-self:end;padding-inline-end:var(--space-8)}._1cj8r6ga{font-family:var(--font-body);font-size:var(--font-size-med);line-height:var(--size-med);color:var(--color-fg-muted);pointer-events:none;grid-area:1/1;justify-self:end;padding-inline-end:var(--space-12)}._1cj8r6gb{vertical-align:calc((1cap - var(--font-size-xs)) / 2);display:inline-block}._1cj8r6gc{vertical-align:calc((1cap - var(--font-size-sm)) / 2);display:inline-block}._1cj8r6gd{vertical-align:calc((1cap - var(--font-size-med)) / 2);display:inline-block}._1cj8r6ge{padding-inline-start:calc(var(--space-6) + var(--font-size-xs) + var(--space-4))}._1cj8r6gf{padding-inline-start:calc(var(--space-8) + var(--font-size-sm) + var(--space-4))}._1cj8r6gg{padding-inline-start:calc(var(--space-12) + var(--font-size-med) + var(--space-8))}._1cj8r6gh{padding-inline-end:calc(var(--space-6) + var(--font-size-xs) + var(--space-4))}._1cj8r6gi{padding-inline-end:calc(var(--space-8) + var(--font-size-sm) + var(--space-4))}._1cj8r6gj{padding-inline-end:calc(var(--space-12) + var(--font-size-med) + var(--space-8))}._1cj8r6gk{background-clip:padding-box;grid-area:1/1;justify-self:end;position:relative;inset-inline-end:var(--space-4)}@media (pointer:coarse){._1cj8r6g1,._1cj8r6g5,._1cj8r6g6,._1cj8r6g7,._1cj8r6g8,._1cj8r6g9,._1cj8r6ga{font-size:var(--font-size-med)}}@media (forced-colors:active){._1cj8r6g1:disabled{color:graytext;border-color:graytext}._1cj8r6gk{border-color:#0000}}}
|
|
@@ -13,14 +13,31 @@ var t = "_1cj8r6g0", n = e({
|
|
|
13
13
|
} },
|
|
14
14
|
defaultVariants: {},
|
|
15
15
|
compoundVariants: []
|
|
16
|
-
}), r =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
}), r = {
|
|
17
|
+
start: {
|
|
18
|
+
sm: "_1cj8r6g5",
|
|
19
|
+
med: "_1cj8r6g6",
|
|
20
|
+
lg: "_1cj8r6g7"
|
|
21
|
+
},
|
|
22
|
+
end: {
|
|
23
|
+
sm: "_1cj8r6g8",
|
|
24
|
+
med: "_1cj8r6g9",
|
|
25
|
+
lg: "_1cj8r6ga"
|
|
26
|
+
},
|
|
27
|
+
icon: {
|
|
28
|
+
sm: "_1cj8r6gb",
|
|
29
|
+
med: "_1cj8r6gc",
|
|
30
|
+
lg: "_1cj8r6gd"
|
|
31
|
+
},
|
|
32
|
+
roomStart: {
|
|
33
|
+
sm: "_1cj8r6ge",
|
|
34
|
+
med: "_1cj8r6gf",
|
|
35
|
+
lg: "_1cj8r6gg"
|
|
36
|
+
},
|
|
37
|
+
roomEnd: {
|
|
38
|
+
sm: "_1cj8r6gh",
|
|
39
|
+
med: "_1cj8r6gi",
|
|
40
|
+
lg: "_1cj8r6gj"
|
|
41
|
+
}
|
|
42
|
+
}, i = "_1cj8r6gk";
|
|
43
|
+
export { i as clear, t as hiddenLabel, n as input, r as slot };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "./index.mjs";
|
|
2
|
-
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
import { ComponentPropsWithRef, ReactNode } from "react";
|
|
3
3
|
export type SearchFieldInputProps = Pick<ComponentPropsWithRef<"input">, "ref" | "id" | "autoFocus" | "autoComplete" | "spellCheck" | "enterKeyHint" | "maxLength" | "onKeyDown" | "aria-atomic" | "aria-busy" | "aria-controls" | "aria-current" | "aria-details" | "aria-flowto" | "aria-keyshortcuts" | "aria-live" | "aria-owns" | "aria-relevant" | "aria-roledescription" | "aria-activedescendant" | "aria-autocomplete">;
|
|
@@ -1,60 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { join as e } from "../styles/join.mjs";
|
|
3
|
+
import { Box as t } from "../Box/base.mjs";
|
|
4
|
+
import { controlInnerButton as n, controlText as r } from "../styles/control-size.mjs";
|
|
5
|
+
import { Text as i } from "../Text/index.mjs";
|
|
6
|
+
import { IconButton as a } from "../IconButton/index.mjs";
|
|
7
7
|
import { XIcon as o } from "../icons/XIcon.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { useRef as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { Input as
|
|
8
|
+
import { input as s, slot as c } from "./SearchField.css.mjs";
|
|
9
|
+
import { useRef as l, useState as u } from "react";
|
|
10
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
|
+
import { Input as p } from "@base-ui/react/input";
|
|
12
12
|
// src/SearchField/client.tsx
|
|
13
|
-
function
|
|
14
|
-
let D =
|
|
15
|
-
|
|
16
|
-
}, M = A !== "" && (
|
|
13
|
+
function m({ value: m, defaultValue: h, onValueChange: g, placeholder: _, size: v, disabled: y, required: b, name: x, clearLabel: S, icons: C, inputProps: { ref: w, onKeyDown: T, ...E } = {} }) {
|
|
14
|
+
let D = l(null), [O, k] = u(h), A = m ?? O, j = (e) => {
|
|
15
|
+
m === void 0 && k(e), g?.(e);
|
|
16
|
+
}, M = A !== "" && (m === void 0 || g !== void 0), N = (e) => {
|
|
17
17
|
if (T?.(e), e.defaultPrevented) return;
|
|
18
18
|
let t = e.nativeEvent.isComposing || e.keyCode === 229;
|
|
19
19
|
e.key === "Escape" && M && !t && (e.preventDefault(), e.stopPropagation(), j(""));
|
|
20
|
-
}, P =
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
}, P = r[v];
|
|
21
|
+
return /* @__PURE__ */ f(t, {
|
|
22
22
|
alignItems: "center",
|
|
23
|
-
className: l({ size: y }),
|
|
24
23
|
display: "grid",
|
|
25
24
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ d(p, {
|
|
27
26
|
...E,
|
|
28
|
-
name:
|
|
27
|
+
name: x,
|
|
29
28
|
onKeyDown: N,
|
|
30
29
|
onValueChange: j,
|
|
31
|
-
placeholder:
|
|
30
|
+
placeholder: _,
|
|
32
31
|
ref: w,
|
|
33
|
-
render: /* @__PURE__ */
|
|
32
|
+
render: /* @__PURE__ */ d(i, {
|
|
34
33
|
as: "input",
|
|
35
|
-
className:
|
|
34
|
+
className: e(s({ size: v }), c.roomStart[v]),
|
|
36
35
|
ref: D,
|
|
37
36
|
size: P
|
|
38
37
|
}),
|
|
39
|
-
required:
|
|
38
|
+
required: b,
|
|
40
39
|
type: "search",
|
|
41
40
|
value: A
|
|
42
41
|
}),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}),
|
|
47
|
-
A !== "" && !b && /* @__PURE__ */ f(i, {
|
|
48
|
-
className: "_1cj8r6ga",
|
|
42
|
+
C,
|
|
43
|
+
A !== "" && !y && /* @__PURE__ */ d(a, {
|
|
44
|
+
className: "_1cj8r6gk",
|
|
49
45
|
icon: o,
|
|
50
|
-
label:
|
|
46
|
+
label: S,
|
|
51
47
|
onClick: () => {
|
|
52
48
|
j(""), D.current?.focus();
|
|
53
49
|
},
|
|
54
|
-
size:
|
|
50
|
+
size: n[v],
|
|
55
51
|
variant: "ghost"
|
|
56
52
|
})
|
|
57
53
|
]
|
|
58
54
|
});
|
|
59
55
|
}
|
|
60
|
-
export {
|
|
56
|
+
export { m as SearchFieldControl };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { StyleProps } from "../Box/base.mjs";
|
|
2
|
+
import { IconSlotProps } from "../icon-slot/slot.mjs";
|
|
2
3
|
import { SearchFieldInputProps } from "./client.mjs";
|
|
3
4
|
import { CSSProperties, ReactNode } from "react";
|
|
4
|
-
export type SearchFieldProps = StyleProps & {
|
|
5
|
+
export type SearchFieldProps = StyleProps & Pick<IconSlotProps, "iconStart"> & {
|
|
5
6
|
className?: string;
|
|
6
7
|
clearLabel?: string;
|
|
7
8
|
defaultValue?: string;
|
|
@@ -19,5 +20,5 @@ export type SearchFieldProps = StyleProps & {
|
|
|
19
20
|
style?: CSSProperties;
|
|
20
21
|
value?: string;
|
|
21
22
|
};
|
|
22
|
-
export declare function SearchField({ label, hideLabel, value, defaultValue, onValueChange, placeholder, description, error, size, disabled, required, name, clearLabel, inputProps, className, style, ...atoms }: SearchFieldProps): import("react").JSX.Element;
|
|
23
|
+
export declare function SearchField({ label, hideLabel, iconStart, value, defaultValue, onValueChange, placeholder, description, error, size, disabled, required, name, clearLabel, inputProps, className, style, ...atoms }: SearchFieldProps): import("react").JSX.Element;
|
|
23
24
|
export type { SearchFieldInputProps };
|