@agentero/design-system 0.32.0 → 0.32.2
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/mcp/manifests/components.html +108 -54
- package/mcp/manifests/components.json +51 -13
- package/package.json +1 -1
- package/src/accordion/accordion.js +1 -1
- package/src/avatar/avatar.js +46 -41
- package/src/button/button.js +1 -1
- package/src/checkbox/checkbox.js +1 -1
- package/src/combobox/combobox.d.ts +91 -28
- package/src/combobox/combobox.js +96 -65
- package/src/combobox/icons.d.ts +16 -0
- package/src/combobox/icons.js +19 -1
- package/src/combobox/index.d.ts +6 -2
- package/src/data-table/data-table.js +1 -1
- package/src/dropdown-menu/dropdown-menu.js +16 -22
- package/src/hover-card/hover-card.js +2 -2
- package/src/progress/progress.js +1 -1
- package/src/switch/switch.js +1 -1
- package/src/table/table.js +1 -1
- package/src/tabs/tabs.js +2 -2
- package/src/tooltip/tooltip.js +4 -4
- package/theme/base.css +24 -18
|
@@ -2,8 +2,13 @@ import { ComponentPropsWithRef } from 'react';
|
|
|
2
2
|
import { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';
|
|
3
3
|
import { InputSize } from '../input';
|
|
4
4
|
/**
|
|
5
|
-
* Style recipe for Combobox.
|
|
6
|
-
*
|
|
5
|
+
* Style recipe for Combobox. Slots: `action` and `trigger` (the clear and
|
|
6
|
+
* chevron buttons inside the input's frame, which is `InputGroup`'s),
|
|
7
|
+
* `triggerReplaced` (hides the chevron once the clear button has a value to
|
|
8
|
+
* clear), `content`,
|
|
9
|
+
* `list`, `item`, `indicator` and `message`. The surface carries its
|
|
10
|
+
* own chrome — border, background and shadow — because the list it holds is
|
|
11
|
+
* plain content.
|
|
7
12
|
*
|
|
8
13
|
* @summary tailwind-variants recipe backing the Combobox surface and list styles
|
|
9
14
|
*/
|
|
@@ -12,11 +17,12 @@ export declare const comboboxRecipe: import('tailwind-variants').TVReturnType<{
|
|
|
12
17
|
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
13
18
|
content?: import('tailwind-merge').ClassNameValue;
|
|
14
19
|
list?: import('tailwind-merge').ClassNameValue;
|
|
15
|
-
clear?: import('tailwind-merge').ClassNameValue;
|
|
16
20
|
item?: import('tailwind-merge').ClassNameValue;
|
|
17
21
|
indicator?: import('tailwind-merge').ClassNameValue;
|
|
18
22
|
message?: import('tailwind-merge').ClassNameValue;
|
|
19
|
-
|
|
23
|
+
action?: import('tailwind-merge').ClassNameValue;
|
|
24
|
+
trigger?: import('tailwind-merge').ClassNameValue;
|
|
25
|
+
triggerReplaced?: import('tailwind-merge').ClassNameValue;
|
|
20
26
|
};
|
|
21
27
|
};
|
|
22
28
|
} | {
|
|
@@ -24,16 +30,18 @@ export declare const comboboxRecipe: import('tailwind-variants').TVReturnType<{
|
|
|
24
30
|
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
25
31
|
content?: import('tailwind-merge').ClassNameValue;
|
|
26
32
|
list?: import('tailwind-merge').ClassNameValue;
|
|
27
|
-
clear?: import('tailwind-merge').ClassNameValue;
|
|
28
33
|
item?: import('tailwind-merge').ClassNameValue;
|
|
29
34
|
indicator?: import('tailwind-merge').ClassNameValue;
|
|
30
35
|
message?: import('tailwind-merge').ClassNameValue;
|
|
31
|
-
|
|
36
|
+
action?: import('tailwind-merge').ClassNameValue;
|
|
37
|
+
trigger?: import('tailwind-merge').ClassNameValue;
|
|
38
|
+
triggerReplaced?: import('tailwind-merge').ClassNameValue;
|
|
32
39
|
};
|
|
33
40
|
};
|
|
34
41
|
} | {}, {
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
action: string[];
|
|
43
|
+
trigger: string;
|
|
44
|
+
triggerReplaced: string;
|
|
37
45
|
content: string[];
|
|
38
46
|
list: string[];
|
|
39
47
|
item: string[];
|
|
@@ -44,39 +52,60 @@ export declare const comboboxRecipe: import('tailwind-variants').TVReturnType<{
|
|
|
44
52
|
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
45
53
|
content?: import('tailwind-merge').ClassNameValue;
|
|
46
54
|
list?: import('tailwind-merge').ClassNameValue;
|
|
47
|
-
clear?: import('tailwind-merge').ClassNameValue;
|
|
48
55
|
item?: import('tailwind-merge').ClassNameValue;
|
|
49
56
|
indicator?: import('tailwind-merge').ClassNameValue;
|
|
50
57
|
message?: import('tailwind-merge').ClassNameValue;
|
|
51
|
-
|
|
58
|
+
action?: import('tailwind-merge').ClassNameValue;
|
|
59
|
+
trigger?: import('tailwind-merge').ClassNameValue;
|
|
60
|
+
triggerReplaced?: import('tailwind-merge').ClassNameValue;
|
|
52
61
|
};
|
|
53
62
|
};
|
|
54
63
|
} | {}, {
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
action: string[];
|
|
65
|
+
trigger: string;
|
|
66
|
+
triggerReplaced: string;
|
|
57
67
|
content: string[];
|
|
58
68
|
list: string[];
|
|
59
69
|
item: string[];
|
|
60
70
|
indicator: string[];
|
|
61
71
|
message: string[];
|
|
62
72
|
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
action: string[];
|
|
74
|
+
trigger: string;
|
|
75
|
+
triggerReplaced: string;
|
|
65
76
|
content: string[];
|
|
66
77
|
list: string[];
|
|
67
78
|
item: string[];
|
|
68
79
|
indicator: string[];
|
|
69
80
|
message: string[];
|
|
70
81
|
}, undefined, unknown, unknown, undefined>>;
|
|
82
|
+
export type ComboboxRootProps<Value, Multiple extends boolean | undefined, Item> = ComboboxPrimitive.Root.Props<Value, Multiple, Item> & {
|
|
83
|
+
/**
|
|
84
|
+
* Characters the query needs, spaces aside, before the list opens. Below it
|
|
85
|
+
* focusing, clicking or pressing the chevron leaves the list shut, and
|
|
86
|
+
* deleting back under it closes the list. Defaults to `0`: the list opens on
|
|
87
|
+
* focus.
|
|
88
|
+
*/
|
|
89
|
+
minInputLength?: number;
|
|
90
|
+
};
|
|
71
91
|
/**
|
|
72
92
|
* Root of a combobox: a text input that filters a list of options and writes the
|
|
73
|
-
* chosen one back into itself.
|
|
74
|
-
*
|
|
93
|
+
* chosen one back into itself. The list opens on focus, on the first keystroke
|
|
94
|
+
* or from the chevron of `Input`'s `select` variant.
|
|
95
|
+
*
|
|
96
|
+
* For a search against an API, set `minInputLength` so the list stays shut until
|
|
97
|
+
* the query is worth sending: a field that opens an empty list on focus reads as
|
|
98
|
+
* broken. For a pick from a short fixed list with no typing at all, prefer a
|
|
99
|
+
* select.
|
|
75
100
|
*
|
|
76
101
|
* Pass the options as `items`. For a list that comes from the server, set
|
|
77
102
|
* `filter={null}`, hand the already-filtered rows to `filteredItems`, and request
|
|
78
103
|
* them from `onInputValueChange`; `Status` then announces the wait.
|
|
79
104
|
*
|
|
105
|
+
* Every Base UI root prop is accepted and forwarded — `items`, `filter`,
|
|
106
|
+
* `value`, `onValueChange` and so on. `open` stays the consumer's to control;
|
|
107
|
+
* `minInputLength` only refuses to open below the minimum.
|
|
108
|
+
*
|
|
80
109
|
* With `multiple`, the value is an array and picking a row toggles it. The list
|
|
81
110
|
* stays open and keeps the typed query between picks, so several rows can be
|
|
82
111
|
* ticked from one search; closing the list (Escape, a click outside) still resets
|
|
@@ -102,20 +131,37 @@ export declare const comboboxRecipe: import('tailwind-variants').TVReturnType<{
|
|
|
102
131
|
* ```
|
|
103
132
|
*/
|
|
104
133
|
export declare const Root: {
|
|
105
|
-
<Value, Multiple extends boolean | undefined = false, Item = Value>({ onOpenChange, ...props }:
|
|
134
|
+
<Value, Multiple extends boolean | undefined = false, Item = Value>({ minInputLength, open: openProp, defaultOpen, onOpenChange, onOpenChangeComplete, onInputValueChange, ...props }: ComboboxRootProps<Value, Multiple, Item>): import("react/jsx-runtime").JSX.Element;
|
|
106
135
|
displayName: string;
|
|
107
136
|
};
|
|
108
137
|
type InputProps = Omit<ComponentPropsWithRef<typeof ComboboxPrimitive.Input>, 'size'> & {
|
|
109
138
|
/** Control height, matching `Input`. Defaults to `'md'`. */
|
|
110
139
|
size?: InputSize;
|
|
140
|
+
/**
|
|
141
|
+
* What surrounds the input. Defaults to `'search'`.
|
|
142
|
+
* - `search` — magnifier in front, clear button after: a lookup the user types
|
|
143
|
+
* - `plain` — the input alone
|
|
144
|
+
* - `select` — a chevron that toggles the list: a short list to browse
|
|
145
|
+
*/
|
|
146
|
+
variant?: 'search' | 'plain' | 'select';
|
|
147
|
+
/**
|
|
148
|
+
* Whether a clear button follows the input once an option is picked.
|
|
149
|
+
* Defaults to `true` for `search` and `false` for `plain` and `select`; pass
|
|
150
|
+
* it to override the variant. On a `select` it replaces the chevron while
|
|
151
|
+
* there is a value. Ignored under a `multiple` root, which never
|
|
152
|
+
* shows one.
|
|
153
|
+
*/
|
|
154
|
+
showClear?: boolean;
|
|
111
155
|
/**
|
|
112
156
|
* Accessible name for the clear button. Defaults to `'Clear'`; name it after
|
|
113
157
|
* the field when a page carries several comboboxes.
|
|
114
158
|
*/
|
|
115
159
|
clearLabel?: string;
|
|
160
|
+
/** Accessible name for the chevron of the `select` variant. Defaults to `'Show options'`. */
|
|
161
|
+
triggerLabel?: string;
|
|
116
162
|
};
|
|
117
163
|
/**
|
|
118
|
-
* The
|
|
164
|
+
* The text field, which doubles as the trigger: focusing or typing opens the
|
|
119
165
|
* list. It wears the same styling as `Input` and takes the same wiring from
|
|
120
166
|
* `InputContext`, so inside a `FieldText` the label, the hint and the error point
|
|
121
167
|
* at it with nothing passed by hand. Its own props win over the context.
|
|
@@ -127,21 +173,38 @@ type InputProps = Omit<ComponentPropsWithRef<typeof ComboboxPrimitive.Input>, 's
|
|
|
127
173
|
* reference keeps the name. Outside a field, give it `aria-label` or an
|
|
128
174
|
* `aria-labelledby` of your own.
|
|
129
175
|
*
|
|
130
|
-
* It
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* the
|
|
176
|
+
* It is drawn as an `InputGroup` frame, and the list anchors to that whole
|
|
177
|
+
* frame, so it is as wide as the field and starts at its left edge whatever
|
|
178
|
+
* sits beside the input. `variant` picks what does:
|
|
179
|
+
*
|
|
180
|
+
* - `search` (default): a magnifier in front and a clear button. For any field
|
|
181
|
+
* where the user types to look something up.
|
|
182
|
+
* - `plain`: the input alone, with no icon and no button. When the field needs
|
|
183
|
+
* no affordance at all.
|
|
184
|
+
* - `select`: a chevron that opens and closes the list. For a short known list
|
|
185
|
+
* the user may want to browse before typing.
|
|
186
|
+
*
|
|
187
|
+
* Only `search` carries a clear button by default; `showClear` adds it to the
|
|
188
|
+
* other two or drops it from `search`. On a `select`, the clear button takes the
|
|
189
|
+
* chevron's place once an option is picked; the list still opens from the input. Base UI mounts it only once there is
|
|
190
|
+
* something to clear — a picked option — so an untouched field shows nothing. Name it with
|
|
191
|
+
* `clearLabel`, and the chevron with `triggerLabel`, when a page has more than
|
|
192
|
+
* one combobox.
|
|
193
|
+
*
|
|
194
|
+
* Under a `multiple` root there is neither: the list stays open between picks,
|
|
195
|
+
* so a chevron has nothing to toggle, and Base UI's clear button would drop the
|
|
196
|
+
* whole selection while a cross inside a search field reads as "clear what I
|
|
197
|
+
* typed". The selection is rendered outside the field, with its own way to
|
|
198
|
+
* remove each entry.
|
|
136
199
|
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
200
|
+
* Every native input attribute is accepted and forwarded to the `<input>` —
|
|
201
|
+
* `placeholder`, `disabled`, `autoComplete` — and so is `className`.
|
|
139
202
|
*
|
|
140
|
-
* @summary Search field that opens
|
|
203
|
+
* @summary Search, plain or select field that opens and filters the list
|
|
141
204
|
* @dataAttribute {string} data-slot - Always set to "combobox-input"
|
|
142
205
|
*/
|
|
143
206
|
export declare const Input: {
|
|
144
|
-
({ clearLabel, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
207
|
+
({ variant, showClear, clearLabel, triggerLabel, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
145
208
|
displayName: string;
|
|
146
209
|
};
|
|
147
210
|
type ContentProps = ComponentPropsWithRef<typeof ComboboxPrimitive.Popup> & Pick<ComponentPropsWithRef<typeof ComboboxPrimitive.Positioner>, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor' | 'collisionPadding'>;
|
package/src/combobox/combobox.js
CHANGED
|
@@ -4,20 +4,22 @@ import { useMergeProps as t } from "../../lib/merge-props.js";
|
|
|
4
4
|
import { useFieldContext as n } from "../field/context.js";
|
|
5
5
|
import { InputContext as r } from "../input/context.js";
|
|
6
6
|
import { inputRecipe as i } from "../input/input.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { InputGroup as a } from "../input-group/index.js";
|
|
8
|
+
import { IconCancel as o, IconCheck as s, IconKeyboardArrowDown as c, IconSearch as l } from "./icons.js";
|
|
9
|
+
import { tv as u } from "tailwind-variants";
|
|
10
|
+
import { createContext as d, use as f, useRef as p, useState as m } from "react";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { Combobox as _ } from "@base-ui/react/combobox";
|
|
12
13
|
//#region src/combobox/combobox.tsx
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"hover:[&>svg>path]:fill-icon-default-base-primary",
|
|
14
|
+
var v = u({ slots: {
|
|
15
|
+
action: [
|
|
16
|
+
"flex size-6 shrink-0 cursor-pointer items-center justify-center self-center rounded-sm",
|
|
17
|
+
"[&>svg>path]:fill-icon-input-default hover:[&>svg>path]:fill-icon-default-base-primary",
|
|
18
|
+
"focus-visible:outline-2 focus-visible:outline-border-input-focus",
|
|
19
19
|
"disabled:cursor-default disabled:[&>svg>path]:fill-icon-input-disable"
|
|
20
20
|
],
|
|
21
|
+
trigger: "transition-[rotate] duration-100 data-popup-open:rotate-180 motion-reduce:transition-none",
|
|
22
|
+
triggerReplaced: "[[data-slot=combobox-field]:not([data-placeholder])_&]:hidden",
|
|
21
23
|
content: [
|
|
22
24
|
"w-(--anchor-width) max-h-(--available-height) overflow-hidden rounded-md",
|
|
23
25
|
"border border-border-default-base-primary bg-bg-default-base-primary shadow-lg",
|
|
@@ -27,7 +29,7 @@ var p = s({ slots: {
|
|
|
27
29
|
"data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
|
|
28
30
|
"motion-reduce:transition-none"
|
|
29
31
|
],
|
|
30
|
-
list: ["max-h-[min(10.25rem,var(--available-height))] overflow-y-auto scroll-py-2 py-2 outline-none", "
|
|
32
|
+
list: ["max-h-[min(10.25rem,var(--available-height))] overflow-y-auto scroll-py-2 py-2 outline-none", "empty:py-0"],
|
|
31
33
|
item: [
|
|
32
34
|
"group/item mx-2 my-px flex cursor-pointer items-center rounded-[calc(var(--radius-md)-2px)]",
|
|
33
35
|
"px-3 py-2 text-sm text-text-default-base-primary select-none",
|
|
@@ -37,7 +39,7 @@ var p = s({ slots: {
|
|
|
37
39
|
indicator: [
|
|
38
40
|
"mr-2 flex size-4 shrink-0 items-center justify-center rounded-sm",
|
|
39
41
|
"border border-border-input-default bg-bg-input-normal",
|
|
40
|
-
"text-text-default-base-inverse-primary transition-colors duration-
|
|
42
|
+
"text-text-default-base-inverse-primary transition-colors duration-150",
|
|
41
43
|
"data-selected:border-bg-checkbox-selected data-selected:bg-bg-checkbox-selected",
|
|
42
44
|
"[&>svg]:hidden data-selected:[&>svg]:block",
|
|
43
45
|
"group-data-disabled/item:border-border-checkbox-disabled",
|
|
@@ -45,49 +47,78 @@ var p = s({ slots: {
|
|
|
45
47
|
"group-data-disabled/item:data-selected:bg-bg-checkbox-disabled"
|
|
46
48
|
],
|
|
47
49
|
message: ["mx-2 my-px px-3 py-2 text-sm text-text-default-base-tertiary", "empty:m-0 empty:p-0"]
|
|
48
|
-
} }),
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
} }), y = v(), b = d(!1), x = ({ minInputLength: e = 0, open: t, defaultOpen: n = !1, onOpenChange: r, onOpenChangeComplete: i, onInputValueChange: a, ...o }) => {
|
|
51
|
+
let s = !!o.multiple, [c, l] = m(n), u = p(String(o.inputValue ?? o.defaultInputValue ?? ""));
|
|
52
|
+
o.inputValue !== void 0 && (u.current = String(o.inputValue));
|
|
53
|
+
let d = (t) => t.trim().length < e, f = p(!1), g = p(!1), v = (e, t) => {
|
|
54
|
+
if (e && d(u.current)) {
|
|
55
|
+
t.cancel();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
f.current = !1, r?.(e, t), s && !e && t.reason === "item-press" && t.cancel(), t.isCanceled || l(e);
|
|
59
|
+
}, y = (e) => {
|
|
60
|
+
i?.(e), !e && f.current && (f.current = !1, g.current = !0, queueMicrotask(() => g.current = !1));
|
|
61
|
+
}, x = (e, n) => {
|
|
62
|
+
if (g.current) {
|
|
63
|
+
g.current = !1, n.cancel();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
u.current = e, a?.(e, n), d(e) && t === void 0 && c && (f.current = !0, l(!1));
|
|
67
|
+
}, S = t ?? (e > 0 ? c : void 0);
|
|
68
|
+
return /* @__PURE__ */ h(b, {
|
|
69
|
+
value: s,
|
|
70
|
+
children: /* @__PURE__ */ h(_.Root, {
|
|
71
|
+
open: S,
|
|
72
|
+
defaultOpen: n,
|
|
73
|
+
onOpenChange: v,
|
|
74
|
+
onOpenChangeComplete: y,
|
|
75
|
+
onInputValueChange: x,
|
|
76
|
+
...o
|
|
57
77
|
})
|
|
58
78
|
});
|
|
59
79
|
};
|
|
60
|
-
|
|
61
|
-
var
|
|
80
|
+
x.displayName = "Combobox.Root";
|
|
81
|
+
var S = /* @__PURE__ */ new Set([
|
|
62
82
|
"value",
|
|
63
83
|
"defaultValue",
|
|
64
84
|
"onChange"
|
|
65
|
-
]),
|
|
66
|
-
let i =
|
|
85
|
+
]), C = (e) => {
|
|
86
|
+
let i = f(r), a = n(), o = i ? Object.fromEntries(Object.entries(i).filter(([e]) => !S.has(e))) : null, s = !("aria-label" in e || "aria-labelledby" in e) && a ? { "aria-labelledby": a.labelId } : null;
|
|
67
87
|
return t({
|
|
68
88
|
...o,
|
|
69
89
|
...s
|
|
70
90
|
}, e);
|
|
71
|
-
},
|
|
72
|
-
let { className:
|
|
73
|
-
return /* @__PURE__ */
|
|
91
|
+
}, w = ({ variant: t = "search", showClear: n = t === "search", clearLabel: r = "Clear", triggerLabel: s = "Show options", ...u }) => {
|
|
92
|
+
let { className: d, size: p = "md", ...m } = C(u), v = f(b);
|
|
93
|
+
return /* @__PURE__ */ g(_.InputGroup, {
|
|
94
|
+
render: /* @__PURE__ */ h(a.Root, {}),
|
|
74
95
|
"data-slot": "combobox-field",
|
|
75
|
-
className:
|
|
76
|
-
children: [
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
className: t === "plain" ? "px-4" : void 0,
|
|
97
|
+
children: [
|
|
98
|
+
t === "search" && /* @__PURE__ */ h(a.Addon, { children: /* @__PURE__ */ h(l, {}) }),
|
|
99
|
+
/* @__PURE__ */ h(_.Input, {
|
|
100
|
+
"data-slot": "combobox-input",
|
|
101
|
+
"data-size": p,
|
|
102
|
+
className: e(i({ size: p }), d),
|
|
103
|
+
...m
|
|
104
|
+
}),
|
|
105
|
+
n && !v && /* @__PURE__ */ h(_.Clear, {
|
|
106
|
+
"data-slot": "combobox-clear",
|
|
107
|
+
"aria-label": r,
|
|
108
|
+
className: y.action(),
|
|
109
|
+
children: /* @__PURE__ */ h(o, {})
|
|
110
|
+
}),
|
|
111
|
+
t === "select" && !v && /* @__PURE__ */ h(_.Trigger, {
|
|
112
|
+
"data-slot": "combobox-trigger",
|
|
113
|
+
"aria-label": s,
|
|
114
|
+
className: e(y.action(), y.trigger(), n && y.triggerReplaced()),
|
|
115
|
+
children: /* @__PURE__ */ h(c, {})
|
|
116
|
+
})
|
|
117
|
+
]
|
|
87
118
|
});
|
|
88
119
|
};
|
|
89
|
-
|
|
90
|
-
var
|
|
120
|
+
w.displayName = "Combobox.Input";
|
|
121
|
+
var T = ({ className: t, side: n = "bottom", align: r = "start", sideOffset: i = 12, alignOffset: a, anchor: o, collisionPadding: s = 8, ...c }) => /* @__PURE__ */ h(_.Portal, { children: /* @__PURE__ */ h(_.Positioner, {
|
|
91
122
|
side: n,
|
|
92
123
|
align: r,
|
|
93
124
|
sideOffset: i,
|
|
@@ -95,49 +126,49 @@ var b = ({ className: t, side: n = "bottom", align: r = "start", sideOffset: i =
|
|
|
95
126
|
anchor: o,
|
|
96
127
|
collisionPadding: s,
|
|
97
128
|
className: "isolate z-(--z-index-top-layer) pointer-events-auto",
|
|
98
|
-
children: /* @__PURE__ */
|
|
129
|
+
children: /* @__PURE__ */ h(_.Popup, {
|
|
99
130
|
"data-slot": "combobox-content",
|
|
100
|
-
className: e(
|
|
131
|
+
className: e(y.content(), t),
|
|
101
132
|
...c
|
|
102
133
|
})
|
|
103
134
|
}) });
|
|
104
|
-
|
|
105
|
-
var
|
|
135
|
+
T.displayName = "Combobox.Content";
|
|
136
|
+
var E = ({ className: t, ...n }) => {
|
|
106
137
|
let r = "aria-label" in n || "aria-labelledby" in n;
|
|
107
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ h(_.List, {
|
|
108
139
|
"data-slot": "combobox-list",
|
|
109
140
|
"aria-label": r ? void 0 : "Suggestions",
|
|
110
|
-
className: e(
|
|
141
|
+
className: e(y.list(), t),
|
|
111
142
|
...n
|
|
112
143
|
});
|
|
113
144
|
};
|
|
114
|
-
|
|
115
|
-
var
|
|
116
|
-
let i =
|
|
117
|
-
return /* @__PURE__ */
|
|
145
|
+
E.displayName = "Combobox.List";
|
|
146
|
+
var D = ({ className: t, children: n, ...r }) => {
|
|
147
|
+
let i = f(b);
|
|
148
|
+
return /* @__PURE__ */ g(_.Item, {
|
|
118
149
|
"data-slot": "combobox-item",
|
|
119
|
-
className: e(
|
|
150
|
+
className: e(y.item(), t),
|
|
120
151
|
...r,
|
|
121
|
-
children: [i && /* @__PURE__ */
|
|
152
|
+
children: [i && /* @__PURE__ */ h(_.ItemIndicator, {
|
|
122
153
|
keepMounted: !0,
|
|
123
154
|
"data-slot": "combobox-item-indicator",
|
|
124
|
-
className:
|
|
125
|
-
children: /* @__PURE__ */
|
|
155
|
+
className: y.indicator(),
|
|
156
|
+
children: /* @__PURE__ */ h(s, { className: "size-3.5" })
|
|
126
157
|
}), n]
|
|
127
158
|
});
|
|
128
159
|
};
|
|
129
|
-
|
|
130
|
-
var
|
|
160
|
+
D.displayName = "Combobox.Item";
|
|
161
|
+
var O = ({ className: t, ...n }) => /* @__PURE__ */ h(_.Empty, {
|
|
131
162
|
"data-slot": "combobox-empty",
|
|
132
|
-
className: e(
|
|
163
|
+
className: e(y.message(), t),
|
|
133
164
|
...n
|
|
134
165
|
});
|
|
135
|
-
|
|
136
|
-
var
|
|
166
|
+
O.displayName = "Combobox.Empty";
|
|
167
|
+
var k = ({ className: t, ...n }) => /* @__PURE__ */ h(_.Status, {
|
|
137
168
|
"data-slot": "combobox-status",
|
|
138
|
-
className: e(
|
|
169
|
+
className: e(y.message(), t),
|
|
139
170
|
...n
|
|
140
171
|
});
|
|
141
|
-
|
|
172
|
+
k.displayName = "Combobox.Status";
|
|
142
173
|
//#endregion
|
|
143
|
-
export {
|
|
174
|
+
export { T as Content, O as Empty, w as Input, D as Item, E as List, x as Root, k as Status, v as comboboxRecipe };
|
package/src/combobox/icons.d.ts
CHANGED
|
@@ -16,3 +16,19 @@ export declare const IconCancel: (props: SVGProps<SVGSVGElement>) => import("rea
|
|
|
16
16
|
* @summary 24px check used by the Combobox selection indicator
|
|
17
17
|
*/
|
|
18
18
|
export declare const IconCheck: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* Magnifier leading the `search` variant of `Combobox.Input`, the same glyph
|
|
21
|
+
* `Command` uses. Fill color comes from the input group addon, so it follows
|
|
22
|
+
* the field's disabled state.
|
|
23
|
+
*
|
|
24
|
+
* @summary 24px search icon leading the Combobox search field
|
|
25
|
+
*/
|
|
26
|
+
export declare const IconSearch: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* Downward chevron inside the `chevron` variant's trigger, the same glyph
|
|
29
|
+
* `Accordion` uses. Fill color is supplied by the trigger's class so it
|
|
30
|
+
* follows the button's state.
|
|
31
|
+
*
|
|
32
|
+
* @summary 24px chevron-down icon used as the Combobox list trigger
|
|
33
|
+
*/
|
|
34
|
+
export declare const IconKeyboardArrowDown: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
package/src/combobox/icons.js
CHANGED
|
@@ -18,6 +18,24 @@ var t = (t) => /* @__PURE__ */ e("svg", {
|
|
|
18
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19
19
|
...t,
|
|
20
20
|
children: /* @__PURE__ */ e("path", { d: "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" })
|
|
21
|
+
}), r = (t) => /* @__PURE__ */ e("svg", {
|
|
22
|
+
width: "24",
|
|
23
|
+
height: "24",
|
|
24
|
+
viewBox: "0 0 24 24",
|
|
25
|
+
fill: "none",
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
...t,
|
|
29
|
+
children: /* @__PURE__ */ e("path", { d: "M9.52 15.615q-2.562 0-4.34-1.777Q3.405 12.062 3.405 9.5T5.18 5.162q1.776-1.777 4.338-1.777t4.339 1.777q1.777 1.776 1.777 4.338 0 1.071-.36 2.046a5.7 5.7 0 0 1-.96 1.696l5.754 5.754q.209.209.213.522a.7.7 0 0 1-.213.532.72.72 0 0 1-.527.217.72.72 0 0 1-.527-.217l-5.753-5.754q-.75.62-1.725.97t-2.018.35m0-1.5q1.933 0 3.273-1.341 1.342-1.34 1.342-3.274 0-1.932-1.342-3.274-1.34-1.341-3.274-1.341-1.932 0-3.274 1.34Q4.904 7.569 4.904 9.5q0 1.933 1.341 3.274 1.342 1.341 3.274 1.341" })
|
|
30
|
+
}), i = (t) => /* @__PURE__ */ e("svg", {
|
|
31
|
+
width: "24",
|
|
32
|
+
height: "24",
|
|
33
|
+
viewBox: "0 0 24 24",
|
|
34
|
+
fill: "none",
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37
|
+
...t,
|
|
38
|
+
children: /* @__PURE__ */ e("path", { d: "M12 14.677a.83.83 0 0 1-.633-.256L6.873 9.927a.73.73 0 0 1-.212-.522.7.7 0 0 1 .212-.532.72.72 0 0 1 .527-.217q.31 0 .527.217L12 12.946l4.073-4.073a.73.73 0 0 1 .522-.212.7.7 0 0 1 .532.212q.217.217.217.527a.72.72 0 0 1-.217.527l-4.494 4.494a.83.83 0 0 1-.633.256" })
|
|
21
39
|
});
|
|
22
40
|
//#endregion
|
|
23
|
-
export { t as IconCancel, n as IconCheck };
|
|
41
|
+
export { t as IconCancel, n as IconCheck, i as IconKeyboardArrowDown, r as IconSearch };
|
package/src/combobox/index.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
export { comboboxRecipe } from './combobox';
|
|
2
|
+
export type { ComboboxRootProps } from './combobox';
|
|
2
3
|
export declare const Combobox: {
|
|
3
4
|
Root: {
|
|
4
|
-
<Value, Multiple extends boolean | undefined = false, Item = Value>({ onOpenChange, ...props }: import(
|
|
5
|
+
<Value, Multiple extends boolean | undefined = false, Item = Value>({ minInputLength, open: openProp, defaultOpen, onOpenChange, onOpenChangeComplete, onInputValueChange, ...props }: import('./combobox').ComboboxRootProps<Value, Multiple, Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
displayName: string;
|
|
6
7
|
};
|
|
7
8
|
Input: {
|
|
8
|
-
({ clearLabel, ...props }: Omit<Omit<import('@base-ui/react/combobox').ComboboxInputProps, "ref"> & import('react').RefAttributes<HTMLInputElement>, "size"> & {
|
|
9
|
+
({ variant, showClear, clearLabel, triggerLabel, ...props }: Omit<Omit<import('@base-ui/react/combobox').ComboboxInputProps, "ref"> & import('react').RefAttributes<HTMLInputElement>, "size"> & {
|
|
9
10
|
size?: import('../input').InputSize;
|
|
11
|
+
variant?: "search" | "plain" | "select";
|
|
12
|
+
showClear?: boolean;
|
|
10
13
|
clearLabel?: string;
|
|
14
|
+
triggerLabel?: string;
|
|
11
15
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
16
|
displayName: string;
|
|
13
17
|
};
|
|
@@ -42,7 +42,7 @@ var y = ({ children: e }) => /* @__PURE__ */ d("div", {
|
|
|
42
42
|
});
|
|
43
43
|
y.displayName = "DataTable.ToolBar";
|
|
44
44
|
var b = a({
|
|
45
|
-
base: "size-4 transition-transform duration-200",
|
|
45
|
+
base: "size-4 transition-transform duration-200 motion-reduce:transition-none",
|
|
46
46
|
variants: { direction: {
|
|
47
47
|
asc: "",
|
|
48
48
|
desc: "rotate-180",
|
|
@@ -20,16 +20,13 @@ var c = a.Portal, l = n({
|
|
|
20
20
|
"z-(--z-index-top-layer) flex flex-col rounded-lg bg-bg-default-base-primary p-1 shadow-xl",
|
|
21
21
|
"border border-border-default-base-primary",
|
|
22
22
|
"will-change-[transform,opacity]",
|
|
23
|
-
"
|
|
24
|
-
"data-[state=
|
|
25
|
-
"data-[side=
|
|
26
|
-
"data-[side=
|
|
27
|
-
"data-[side=
|
|
28
|
-
"data-[
|
|
29
|
-
"
|
|
30
|
-
"data-[side=left]:animate-[dropdownSlideInFromRight_200ms_ease-out]",
|
|
31
|
-
"data-[side=right]:animate-[dropdownSlideInFromLeft_200ms_ease-out]",
|
|
32
|
-
"data-[side=top]:animate-[dropdownSlideInFromBottom_200ms_ease-out]"
|
|
23
|
+
"origin-(--radix-dropdown-menu-content-transform-origin)",
|
|
24
|
+
"data-[state=open]:data-[side=bottom]:animate-dropdown-slide-in-from-top",
|
|
25
|
+
"data-[state=open]:data-[side=left]:animate-dropdown-slide-in-from-right",
|
|
26
|
+
"data-[state=open]:data-[side=right]:animate-dropdown-slide-in-from-left",
|
|
27
|
+
"data-[state=open]:data-[side=top]:animate-dropdown-slide-in-from-bottom",
|
|
28
|
+
"data-[state=closed]:animate-dropdown-slide-out",
|
|
29
|
+
"motion-reduce:animate-none!"
|
|
33
30
|
],
|
|
34
31
|
variants: { hasTriggerWidth: { true: "w-[var(--radix-dropdown-menu-trigger-width)]" } }
|
|
35
32
|
}), u = ({ className: e, hasTriggerWidth: t = !1, sideOffset: n = 8, ...i }) => /* @__PURE__ */ r(a.Content, {
|
|
@@ -44,7 +41,7 @@ var c = a.Portal, l = n({
|
|
|
44
41
|
u.displayName = "DropdownMenu.Content";
|
|
45
42
|
var d = ({ className: t, ...n }) => /* @__PURE__ */ r(a.Item, {
|
|
46
43
|
"data-slot": "dropdown-menu-item",
|
|
47
|
-
className: e("flex items-center gap-2 bg-bg-default-base-primary px-3 py-1.75 text-sm text-text-default-base-primary", "cursor-pointer rounded-md no-underline
|
|
44
|
+
className: e("flex items-center gap-2 bg-bg-default-base-primary px-3 py-1.75 text-sm text-text-default-base-primary", "cursor-pointer rounded-md no-underline outline-none", "min-w-40", "data-highlighted:bg-bg-default-base-primary-hover", "data-disabled:pointer-events-none data-disabled:cursor-not-allowed", "data-disabled:text-text-default-disable-primary", "data-disabled:active:bg-bg-default-base-primary", "[&>svg]:h-6", "[&_path]:fill-icon-default-base-tertiary", t),
|
|
48
45
|
...n
|
|
49
46
|
});
|
|
50
47
|
d.displayName = "DropdownMenu.Item";
|
|
@@ -67,7 +64,7 @@ var m = (e) => /* @__PURE__ */ r(a.Sub, {
|
|
|
67
64
|
m.displayName = "DropdownMenu.Sub";
|
|
68
65
|
var h = ({ className: n, children: o, ...s }) => /* @__PURE__ */ i(a.SubTrigger, {
|
|
69
66
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
70
|
-
className: e("flex items-center gap-2 bg-bg-default-base-primary px-3 py-1.75 text-sm text-text-default-base-primary", "cursor-pointer rounded-md no-underline
|
|
67
|
+
className: e("flex items-center gap-2 bg-bg-default-base-primary px-3 py-1.75 text-sm text-text-default-base-primary", "cursor-pointer rounded-md no-underline outline-none", "min-w-40", "data-highlighted:bg-bg-default-base-primary-hover", "data-[state=open]:bg-bg-default-base-primary-hover", "data-disabled:pointer-events-none data-disabled:cursor-not-allowed", "data-disabled:text-text-default-disable-primary", "[&>svg]:h-6", "[&_path]:fill-icon-default-base-tertiary", n),
|
|
71
68
|
...s,
|
|
72
69
|
children: [o, /* @__PURE__ */ r(t, { className: "ml-auto h-4 w-4 [&>path]:fill-icon-default-base-tertiary" })]
|
|
73
70
|
});
|
|
@@ -76,16 +73,13 @@ var g = n({ base: [
|
|
|
76
73
|
"z-(--z-index-top-layer) flex flex-col rounded-lg bg-bg-default-base-primary p-1 shadow-xl",
|
|
77
74
|
"border border-border-default-base-primary",
|
|
78
75
|
"will-change-[transform,opacity]",
|
|
79
|
-
"
|
|
80
|
-
"data-[state=
|
|
81
|
-
"data-[side=
|
|
82
|
-
"data-[side=
|
|
83
|
-
"data-[side=
|
|
84
|
-
"data-[
|
|
85
|
-
"
|
|
86
|
-
"data-[side=left]:animate-[dropdownSlideInFromRight_200ms_ease-out]",
|
|
87
|
-
"data-[side=right]:animate-[dropdownSlideInFromLeft_200ms_ease-out]",
|
|
88
|
-
"data-[side=top]:animate-[dropdownSlideInFromBottom_200ms_ease-out]"
|
|
76
|
+
"origin-(--radix-dropdown-menu-content-transform-origin)",
|
|
77
|
+
"data-[state=open]:data-[side=bottom]:animate-dropdown-slide-in-from-top",
|
|
78
|
+
"data-[state=open]:data-[side=left]:animate-dropdown-slide-in-from-right",
|
|
79
|
+
"data-[state=open]:data-[side=right]:animate-dropdown-slide-in-from-left",
|
|
80
|
+
"data-[state=open]:data-[side=top]:animate-dropdown-slide-in-from-bottom",
|
|
81
|
+
"data-[state=closed]:animate-dropdown-slide-out",
|
|
82
|
+
"motion-reduce:animate-none!"
|
|
89
83
|
] }), _ = ({ className: e, sideOffset: t = 2, alignOffset: n = -5, ...i }) => /* @__PURE__ */ r(a.SubContent, {
|
|
90
84
|
"data-slot": "dropdown-menu-sub-content",
|
|
91
85
|
sideOffset: t,
|
|
@@ -20,10 +20,10 @@ var s = i.Portal, c = t({ base: [
|
|
|
20
20
|
"will-change-[transform,opacity]",
|
|
21
21
|
"data-[side=bottom]:origin-top data-[side=left]:origin-right",
|
|
22
22
|
"data-[side=right]:origin-left data-[side=top]:origin-bottom",
|
|
23
|
-
"transition-[opacity,transform] duration-200 ease-out",
|
|
23
|
+
"transition-[opacity,transform] duration-200 ease-out-quint",
|
|
24
24
|
"starting:opacity-0 starting:[transform:scale(0.9)]",
|
|
25
25
|
"data-[state=closed]:opacity-0 data-[state=closed]:[transform:scale(0.9)]",
|
|
26
|
-
"data-[state=closed]:duration-150
|
|
26
|
+
"data-[state=closed]:duration-150",
|
|
27
27
|
"data-[state=closed]:animate-presence-hold",
|
|
28
28
|
"motion-reduce:transition-none motion-reduce:animate-none!"
|
|
29
29
|
] }), l = ({ className: e, sideOffset: t = 8, collisionPadding: r = 8, ...a }) => /* @__PURE__ */ n(i.Content, {
|
package/src/progress/progress.js
CHANGED
|
@@ -7,7 +7,7 @@ import * as i from "@radix-ui/react-progress";
|
|
|
7
7
|
var a = e({ slots: {
|
|
8
8
|
root: "flex flex-col gap-2",
|
|
9
9
|
track: "relative h-2 w-full overflow-hidden rounded-sm bg-neutrals-200 text-neutrals-900",
|
|
10
|
-
indicator: "size-full bg-current transition-transform duration-
|
|
10
|
+
indicator: "size-full bg-current transition-transform duration-300 ease-in-out motion-reduce:transition-none",
|
|
11
11
|
labelRow: "flex items-center justify-between gap-2",
|
|
12
12
|
label: "text-sm text-text-default-base-primary",
|
|
13
13
|
value: "text-base text-text-default-base-primary"
|
package/src/switch/switch.js
CHANGED
|
@@ -15,7 +15,7 @@ var o = t({
|
|
|
15
15
|
"focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring-button-primary",
|
|
16
16
|
"disabled:cursor-not-allowed disabled:bg-slate-100"
|
|
17
17
|
],
|
|
18
|
-
thumb: "block translate-x-0 rounded-full bg-bg-default-base-primary shadow-sm transition-transform",
|
|
18
|
+
thumb: "block translate-x-0 rounded-full bg-bg-default-base-primary shadow-sm transition-transform motion-reduce:transition-none",
|
|
19
19
|
label: ["cursor-pointer text-sm text-text-default-base-primary select-none", "peer-disabled:cursor-not-allowed peer-disabled:opacity-50"]
|
|
20
20
|
},
|
|
21
21
|
variants: {
|