asheeui 0.6.9 → 0.6.12
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/components/accordion/Accordion.js +7 -7
- package/dist/components/autocomplete/Autocomplete.d.ts +5 -5
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +41 -40
- package/dist/components/autocomplete/autocomplete-config.d.ts +2 -2
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +7 -6
- package/dist/components/carousel/Carousel.js +43 -43
- package/dist/components/chip/Chip.js +8 -8
- package/dist/components/date-picker/DatePicker.d.ts +6 -5
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +87 -87
- package/dist/components/date-picker/date-picker-config.d.ts +3 -2
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +7 -6
- package/dist/components/marquee/Marquee.js +22 -22
- package/dist/components/multi-select/MultiSelect.d.ts +5 -5
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +45 -43
- package/dist/components/multi-select/multi-select-config.d.ts +2 -2
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +8 -7
- package/dist/components/radio/radio-config.d.ts +3 -2
- package/dist/components/radio/radio-config.d.ts.map +1 -1
- package/dist/components/radio/radio-config.js +9 -8
- package/dist/components/select/Select.d.ts +5 -5
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +53 -52
- package/dist/components/select/select-config.d.ts +3 -5
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +7 -6
- package/dist/components/select-menu/SelectMenu.d.ts +15 -3
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +144 -116
- package/dist/components/select-menu/use-select-floating.d.ts +5 -2
- package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
- package/dist/components/select-menu/use-select-floating.js +14 -7
- package/dist/components/switch/switch-config.d.ts +3 -2
- package/dist/components/switch/switch-config.d.ts.map +1 -1
- package/dist/components/switch/switch-config.js +6 -5
- package/dist/components/toast/ToastItem.js +30 -30
- package/dist/components/toast/ToastProvider.d.ts +5 -5
- package/dist/components/toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/toast/ToastProvider.js +121 -117
- package/dist/components/toast/toast-styles.d.ts +8 -0
- package/dist/components/toast/toast-styles.d.ts.map +1 -1
- package/dist/components/toast/toast-styles.js +11 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +3 -20
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as l, jsxs as S, Fragment as
|
|
3
|
-
import { useClick as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { ChevronDownIcon as
|
|
6
|
-
import { CloseIcon as
|
|
7
|
-
import { useAsheeConfig as
|
|
2
|
+
import { jsx as l, jsxs as S, Fragment as Re } from "react/jsx-runtime";
|
|
3
|
+
import { useClick as Ue, useDismiss as je, useRole as Ve, useInteractions as $e } from "@floating-ui/react";
|
|
4
|
+
import { forwardRef as Be, useId as Ge, useState as B, useMemo as A, useCallback as z } from "react";
|
|
5
|
+
import { ChevronDownIcon as He } from "../../icons/ChevronDownIcon.js";
|
|
6
|
+
import { CloseIcon as Qe } from "../../icons/CloseIcon.js";
|
|
7
|
+
import { useAsheeConfig as he } from "../../libs/context.js";
|
|
8
8
|
import { resolveCascade as m, resolveRadiusKey as G, resolveClassKey as N } from "../../utils/resolve-token.js";
|
|
9
|
-
import { Button as
|
|
10
|
-
import { Chip as
|
|
11
|
-
import { FieldShell as
|
|
12
|
-
import { SelectMenu as
|
|
9
|
+
import { Button as We } from "../button/Button.js";
|
|
10
|
+
import { Chip as qe } from "../chip/Chip.js";
|
|
11
|
+
import { FieldShell as Je } from "../field/FieldShell.js";
|
|
12
|
+
import { SelectMenu as Xe } from "../select-menu/SelectMenu.js";
|
|
13
13
|
import { FALLBACK_MULTI_SELECT_CONFIG as s } from "./multi-select-config.js";
|
|
14
|
-
import { MULTI_SELECT_HEIGHT_CLASS as
|
|
15
|
-
import { RADIUS_CLASS as
|
|
16
|
-
import { useSelectFloating as
|
|
14
|
+
import { MULTI_SELECT_HEIGHT_CLASS as Ye, MULTI_SELECT_PADDING_CLASS as Ze, MULTI_SELECT_FONT_CLASS as Ce, STATUS_BORDER_CLASS as er } from "./multi-select-styles.js";
|
|
15
|
+
import { RADIUS_CLASS as rr } from "../../shared/radius.js";
|
|
16
|
+
import { useSelectFloating as sr } from "../select-menu/use-select-floating.js";
|
|
17
17
|
import { cn as v } from "../../utils/cn.js";
|
|
18
|
-
const
|
|
18
|
+
const tr = Be(
|
|
19
19
|
({
|
|
20
20
|
options: _ = [],
|
|
21
21
|
value: n,
|
|
@@ -52,7 +52,7 @@ const sr = $e(
|
|
|
52
52
|
endContent: ce
|
|
53
53
|
}, x) => {
|
|
54
54
|
var R, U, j, V;
|
|
55
|
-
const p =
|
|
55
|
+
const p = he(), e = (R = p.components) == null ? void 0 : R.multiSelect, ue = Ge(), y = le ?? ue, [b, de] = B(!1), [me, fe] = B(""), g = m(
|
|
56
56
|
Y,
|
|
57
57
|
e == null ? void 0 : e.size,
|
|
58
58
|
void 0,
|
|
@@ -94,39 +94,39 @@ const sr = $e(
|
|
|
94
94
|
s.labelAlign
|
|
95
95
|
), ge = N(
|
|
96
96
|
g,
|
|
97
|
-
|
|
97
|
+
Ye,
|
|
98
98
|
s.size
|
|
99
99
|
), Ie = N(
|
|
100
100
|
g,
|
|
101
|
-
|
|
101
|
+
Ze,
|
|
102
102
|
s.size
|
|
103
103
|
), Ne = N(
|
|
104
104
|
g,
|
|
105
|
-
|
|
105
|
+
Ce,
|
|
106
106
|
s.size
|
|
107
107
|
), _e = N(
|
|
108
108
|
pe,
|
|
109
|
-
|
|
109
|
+
rr,
|
|
110
110
|
s.chip.radius
|
|
111
|
-
), { refs: K, floatingStyles: Le, context: I } =
|
|
111
|
+
), { refs: K, floatingStyles: Le, context: I, isPositioned: we } = sr({
|
|
112
112
|
isOpen: b,
|
|
113
113
|
onOpenChange: de,
|
|
114
114
|
disabled: c
|
|
115
|
-
}),
|
|
116
|
-
we,
|
|
115
|
+
}), Ae = Ue(I, { enabled: !c }), ze = je(I), Te = Ve(I, { role: "listbox" }), { getReferenceProps: Ee, getFloatingProps: ke } = $e([
|
|
117
116
|
Ae,
|
|
118
|
-
ze
|
|
117
|
+
ze,
|
|
118
|
+
Te
|
|
119
119
|
]), o = A(() => L !== void 0 ? L : Array.isArray(n) ? _.filter((r) => n.includes(r.value)) : [], [L, n, _]), O = z(
|
|
120
120
|
(r) => o.some((t) => t.value === r),
|
|
121
121
|
[o]
|
|
122
|
-
),
|
|
122
|
+
), Me = z(
|
|
123
123
|
(r) => {
|
|
124
124
|
const t = O(r.value);
|
|
125
125
|
if (f || i)
|
|
126
126
|
t ? i == null || i(r.value) : f == null || f(r);
|
|
127
127
|
else if (u) {
|
|
128
|
-
const $ = n ?? [],
|
|
129
|
-
u(
|
|
128
|
+
const $ = n ?? [], Oe = t ? $.filter((Pe) => Pe !== r.value) : [...$, r.value];
|
|
129
|
+
u(Oe);
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
132
|
[O, f, i, u, n]
|
|
@@ -135,12 +135,12 @@ const sr = $e(
|
|
|
135
135
|
i ? i(r) : u && Array.isArray(n) && u(n.filter((t) => t !== r));
|
|
136
136
|
},
|
|
137
137
|
[i, u, n]
|
|
138
|
-
),
|
|
138
|
+
), De = A(
|
|
139
139
|
() => o.map((r) => r.value),
|
|
140
140
|
[o]
|
|
141
|
-
),
|
|
141
|
+
), Fe = A(() => o.length > 0 ? `${o.length} selected` : T, [o.length, T]), Ke = Ee();
|
|
142
142
|
return /* @__PURE__ */ l(
|
|
143
|
-
|
|
143
|
+
Je,
|
|
144
144
|
{
|
|
145
145
|
id: y,
|
|
146
146
|
label: ee,
|
|
@@ -160,7 +160,7 @@ const sr = $e(
|
|
|
160
160
|
children: [
|
|
161
161
|
/* @__PURE__ */ S("div", { className: "relative w-full", children: [
|
|
162
162
|
/* @__PURE__ */ l(
|
|
163
|
-
|
|
163
|
+
We,
|
|
164
164
|
{
|
|
165
165
|
ref: (r) => {
|
|
166
166
|
K.setReference(r), typeof x == "function" ? x(r) : x && (x.current = r);
|
|
@@ -173,23 +173,24 @@ const sr = $e(
|
|
|
173
173
|
isDisabled: c,
|
|
174
174
|
isLoading: M,
|
|
175
175
|
fullWidth: !0,
|
|
176
|
+
animate: !1,
|
|
176
177
|
"aria-expanded": b,
|
|
177
178
|
"aria-haspopup": "listbox",
|
|
178
179
|
"aria-invalid": d === "error",
|
|
179
180
|
"aria-describedby": [w ? `${y}-description` : void 0].filter(Boolean).join(" ") || void 0,
|
|
180
181
|
className: v(
|
|
181
182
|
"font-normal text-left justify-between",
|
|
182
|
-
|
|
183
|
+
er[d],
|
|
183
184
|
ge,
|
|
184
185
|
Ie,
|
|
185
186
|
Ne,
|
|
186
187
|
oe
|
|
187
188
|
),
|
|
188
189
|
startContent: ie,
|
|
189
|
-
endContent: /* @__PURE__ */ S(
|
|
190
|
+
endContent: /* @__PURE__ */ S(Re, { children: [
|
|
190
191
|
ce,
|
|
191
192
|
/* @__PURE__ */ l(
|
|
192
|
-
|
|
193
|
+
He,
|
|
193
194
|
{
|
|
194
195
|
className: v(
|
|
195
196
|
"shrink-0 text-foreground/70 transition-transform duration-200",
|
|
@@ -198,7 +199,7 @@ const sr = $e(
|
|
|
198
199
|
}
|
|
199
200
|
)
|
|
200
201
|
] }),
|
|
201
|
-
...
|
|
202
|
+
...Ke,
|
|
202
203
|
children: /* @__PURE__ */ l(
|
|
203
204
|
"span",
|
|
204
205
|
{
|
|
@@ -206,22 +207,23 @@ const sr = $e(
|
|
|
206
207
|
"truncate",
|
|
207
208
|
o.length > 0 ? "text-foreground" : "text-foreground/70"
|
|
208
209
|
),
|
|
209
|
-
children:
|
|
210
|
+
children: Fe
|
|
210
211
|
}
|
|
211
212
|
)
|
|
212
213
|
}
|
|
213
214
|
),
|
|
214
215
|
/* @__PURE__ */ l(
|
|
215
|
-
|
|
216
|
+
Xe,
|
|
216
217
|
{
|
|
217
218
|
isOpen: b,
|
|
218
219
|
context: I,
|
|
219
220
|
floatingStyles: Le,
|
|
220
|
-
getFloatingProps:
|
|
221
|
+
getFloatingProps: ke,
|
|
221
222
|
setFloatingRef: K.setFloating,
|
|
223
|
+
isPositioned: we,
|
|
222
224
|
options: _,
|
|
223
|
-
selectedValues:
|
|
224
|
-
onSelectMenuOption:
|
|
225
|
+
selectedValues: De,
|
|
226
|
+
onSelectMenuOption: Me,
|
|
225
227
|
isSearch: H,
|
|
226
228
|
searchPlaceholder: Q,
|
|
227
229
|
searchInputName: h,
|
|
@@ -236,7 +238,7 @@ const sr = $e(
|
|
|
236
238
|
!q && /* @__PURE__ */ S("div", { className: "flex flex-col gap-1.5", children: [
|
|
237
239
|
E && /* @__PURE__ */ l("span", { className: "text-xs font-medium text-foreground/70", children: E }),
|
|
238
240
|
/* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1.5 p-2 min-h-12 bg-secondary/20 border border-dashed border-border rounded-lg items-center", children: o.length === 0 ? /* @__PURE__ */ l("span", { className: "text-xs text-foreground/70 px-2 py-1", children: "No selections made" }) : o.map((r) => /* @__PURE__ */ S(
|
|
239
|
-
|
|
241
|
+
qe,
|
|
240
242
|
{
|
|
241
243
|
variant: "bordered",
|
|
242
244
|
color: ve,
|
|
@@ -261,7 +263,7 @@ const sr = $e(
|
|
|
261
263
|
},
|
|
262
264
|
"aria-label": `Remove ${r.label}`,
|
|
263
265
|
className: "inline-flex items-center justify-center h-3.5 w-3.5 rounded-full hover:bg-black/20 dark:hover:bg-white/20 transition-colors cursor-pointer shrink-0",
|
|
264
|
-
children: /* @__PURE__ */ l(
|
|
266
|
+
children: /* @__PURE__ */ l(Qe, { className: "w-3 h-3" })
|
|
265
267
|
}
|
|
266
268
|
)
|
|
267
269
|
]
|
|
@@ -276,7 +278,7 @@ const sr = $e(
|
|
|
276
278
|
);
|
|
277
279
|
}
|
|
278
280
|
);
|
|
279
|
-
|
|
281
|
+
tr.displayName = "MultiSelect";
|
|
280
282
|
export {
|
|
281
|
-
|
|
283
|
+
tr as MultiSelect
|
|
282
284
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Color, Radius, Size, Variant } from '../../shared';
|
|
2
|
-
import {
|
|
2
|
+
import { InputConfig } from '../input';
|
|
3
3
|
import { MenuConfig } from '../select-menu';
|
|
4
4
|
/**
|
|
5
5
|
* Theme configuration options for the MultiSelect component.
|
|
@@ -7,7 +7,7 @@ import { MenuConfig } from '../select-menu';
|
|
|
7
7
|
* Set under `components.multiSelect` in the AsheeUI config. Values feed the
|
|
8
8
|
* component-level fallback tier of the theme cascade.
|
|
9
9
|
*/
|
|
10
|
-
export interface MultiSelectConfig extends
|
|
10
|
+
export interface MultiSelectConfig extends InputConfig {
|
|
11
11
|
/**
|
|
12
12
|
* Configuration for the dropdown menu.
|
|
13
13
|
* Controls the menu's visual appearance and behavior.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select-config.d.ts","sourceRoot":"","sources":["../../../src/components/multi-select/multi-select-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"multi-select-config.d.ts","sourceRoot":"","sources":["../../../src/components/multi-select/multi-select-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;OAGG;IACH,IAAI,CAAC,EAAE;QACL;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAElB;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC;QAEd;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,IAAI,CAAC,EAAE,IAAI,CAAC;KACb,CAAC;CACH;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBAKtC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;CAQ/B,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,WAAW,EAAE,iBAAiB,CAAC;KAChC;CACF"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
import { FALLBACK_FIELD_CONFIG as
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { registerComponentDefaults as t } from "../../libs/registry.js";
|
|
3
|
+
import { FALLBACK_FIELD_CONFIG as i } from "../field/field-config.js";
|
|
4
|
+
import { defaultInputConfig as o } from "../input/input-config.js";
|
|
5
|
+
const e = {
|
|
6
|
+
...o,
|
|
6
7
|
chip: {
|
|
7
8
|
size: "sm"
|
|
8
9
|
}
|
|
9
10
|
}, l = {
|
|
10
|
-
...
|
|
11
|
+
...i,
|
|
11
12
|
chip: {
|
|
12
13
|
size: "sm",
|
|
13
14
|
color: "primary",
|
|
@@ -15,8 +16,8 @@ const o = {
|
|
|
15
16
|
variant: "solid"
|
|
16
17
|
}
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
t("multiSelect", e);
|
|
19
20
|
export {
|
|
20
21
|
l as FALLBACK_MULTI_SELECT_CONFIG,
|
|
21
|
-
|
|
22
|
+
e as defaultMultiSelectConfig
|
|
22
23
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldSizeKey } from '../field/field-config';
|
|
2
|
+
import { InputConfig } from '../input';
|
|
2
3
|
/**
|
|
3
4
|
* Size key for radio components.
|
|
4
5
|
* Maps to the FieldSizeKey type: "sm", "md", or "lg".
|
|
@@ -16,7 +17,7 @@ export type RadioVariant = "default" | "card";
|
|
|
16
17
|
* Set under `components.radio` in the AsheeUI config. Values feed the
|
|
17
18
|
* component-level fallback tier of the theme cascade.
|
|
18
19
|
*/
|
|
19
|
-
export interface RadioConfig extends Omit<
|
|
20
|
+
export interface RadioConfig extends Omit<InputConfig, "variant"> {
|
|
20
21
|
/**
|
|
21
22
|
* Visual style variant.
|
|
22
23
|
* Controls whether the radio appears as a standard button or a card.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-config.d.ts","sourceRoot":"","sources":["../../../src/components/radio/radio-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"radio-config.d.ts","sourceRoot":"","sources":["../../../src/components/radio/radio-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;AAExC;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC/D;;;;;OAKG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAIhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;CAIxB,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,KAAK,EAAE,WAAW,CAAC;KACpB;CACF"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { registerComponentDefaults as t } from "../../libs/registry.js";
|
|
3
|
-
import { FALLBACK_FIELD_CONFIG as
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { FALLBACK_FIELD_CONFIG as o } from "../field/field-config.js";
|
|
4
|
+
import { defaultInputConfig as r } from "../input/input-config.js";
|
|
5
|
+
const a = {
|
|
6
|
+
...r,
|
|
6
7
|
radius: "full",
|
|
7
8
|
variant: "default"
|
|
8
|
-
},
|
|
9
|
-
...
|
|
9
|
+
}, u = {
|
|
10
|
+
...o,
|
|
10
11
|
radius: "full",
|
|
11
12
|
variant: "default"
|
|
12
13
|
};
|
|
13
|
-
t("radio",
|
|
14
|
+
t("radio", a);
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
u as FALLBACK_RADIO_CONFIG,
|
|
17
|
+
a as defaultRadioConfig
|
|
17
18
|
};
|
|
@@ -104,11 +104,11 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
|
|
|
104
104
|
* label, description, and message handling, and uses Floating UI for
|
|
105
105
|
* positioning and accessibility.
|
|
106
106
|
*
|
|
107
|
-
* By default, the dropdown menu uses
|
|
108
|
-
* document body level. This ensures the menu escapes CSS containment,
|
|
109
|
-
* clipping, and stacking context issues. The portal can be disabled
|
|
110
|
-
* `menu.portal` prop or `components.select.menu.portal` in the config
|
|
111
|
-
* menu needs to stay within a specific parent container.
|
|
107
|
+
* By default, the dropdown menu uses Floating UI's FloatingPortal to render
|
|
108
|
+
* at the document body level. This ensures the menu escapes CSS containment,
|
|
109
|
+
* overflow clipping, and stacking context issues. The portal can be disabled
|
|
110
|
+
* via the `menu.portal` prop or `components.select.menu.portal` in the config
|
|
111
|
+
* if the menu needs to stay within a specific parent container.
|
|
112
112
|
*
|
|
113
113
|
* @param props - Select configuration options.
|
|
114
114
|
* @param props.options - Available options to select from.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/select/Select.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAK5E;;;GAGG;AACH,KAAK,gBAAgB,GAAG,IAAI,CAC1B,UAAU,EACR,OAAO,GACP,aAAa,GACb,SAAS,GACT,UAAU,GACV,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,IAAI,GACJ,OAAO,CACV,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,WACf,SAAQ,gBAAgB,EACtB,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAE5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAE7D;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAEjD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;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|
-
import { forwardRef as
|
|
5
|
-
import { ChevronDownIcon as
|
|
6
|
-
import { useAsheeConfig as
|
|
7
|
-
import { resolveCascade as p, resolveRadiusKey as
|
|
8
|
-
import { Button as
|
|
9
|
-
import { FieldShell as
|
|
10
|
-
import { SelectMenu as
|
|
2
|
+
import { jsx as l, jsxs as g, Fragment as ve } from "react/jsx-runtime";
|
|
3
|
+
import { useClick as Se, useDismiss as be, useRole as ye, useInteractions as he } from "@floating-ui/react";
|
|
4
|
+
import { forwardRef as xe, useId as Re, useState as k, useMemo as h, useCallback as Ae } from "react";
|
|
5
|
+
import { ChevronDownIcon as Ie } from "../../icons/ChevronDownIcon.js";
|
|
6
|
+
import { useAsheeConfig as Fe } from "../../libs/context.js";
|
|
7
|
+
import { resolveCascade as p, resolveRadiusKey as Ke } from "../../utils/resolve-token.js";
|
|
8
|
+
import { Button as Le } from "../button/Button.js";
|
|
9
|
+
import { FieldShell as Ne } from "../field/FieldShell.js";
|
|
10
|
+
import { SelectMenu as Oe } from "../select-menu/SelectMenu.js";
|
|
11
11
|
import { FALLBACK_SELECT_CONFIG as o } from "./select-config.js";
|
|
12
|
-
import { SELECT_STATUS_BORDER_CLASS as
|
|
13
|
-
import { useSelectFloating as
|
|
12
|
+
import { SELECT_STATUS_BORDER_CLASS as ge } from "./select-styles.js";
|
|
13
|
+
import { useSelectFloating as ke } from "../select-menu/use-select-floating.js";
|
|
14
14
|
import { cn as x } from "../../utils/cn.js";
|
|
15
|
-
const
|
|
15
|
+
const Ee = xe(
|
|
16
16
|
({
|
|
17
17
|
options: v = [],
|
|
18
18
|
value: r,
|
|
19
19
|
onChange: S,
|
|
20
20
|
onValueChange: a,
|
|
21
21
|
size: E,
|
|
22
|
-
radius:
|
|
23
|
-
variant:
|
|
24
|
-
color:
|
|
25
|
-
status:
|
|
26
|
-
label:
|
|
27
|
-
labelAlign:
|
|
22
|
+
radius: P,
|
|
23
|
+
variant: _,
|
|
24
|
+
color: j,
|
|
25
|
+
status: w,
|
|
26
|
+
label: z,
|
|
27
|
+
labelAlign: B,
|
|
28
28
|
description: b,
|
|
29
29
|
message: R,
|
|
30
|
-
required:
|
|
30
|
+
required: D,
|
|
31
31
|
isLoading: A,
|
|
32
32
|
disabled: y,
|
|
33
|
-
isSearch:
|
|
33
|
+
isSearch: M = !1,
|
|
34
34
|
searchPlaceholder: T = "Search options...",
|
|
35
35
|
searchInputName: $ = "select-search",
|
|
36
36
|
initialValue: n,
|
|
@@ -45,73 +45,73 @@ const ke = he(
|
|
|
45
45
|
endContent: J
|
|
46
46
|
}, i) => {
|
|
47
47
|
var O;
|
|
48
|
-
const c =
|
|
48
|
+
const c = Fe(), e = (O = c.components) == null ? void 0 : O.select, X = Re(), d = U ?? X, [u, K] = k(!1), [Y, L] = k(""), Z = p(
|
|
49
49
|
E,
|
|
50
50
|
e == null ? void 0 : e.size,
|
|
51
51
|
void 0,
|
|
52
52
|
o.size
|
|
53
53
|
), C = p(
|
|
54
|
-
|
|
54
|
+
_,
|
|
55
55
|
e == null ? void 0 : e.variant,
|
|
56
56
|
c.defaultVariant,
|
|
57
57
|
o.variant
|
|
58
58
|
), V = p(
|
|
59
|
-
|
|
59
|
+
j,
|
|
60
60
|
e == null ? void 0 : e.color,
|
|
61
61
|
c.defaultColor,
|
|
62
62
|
o.color
|
|
63
|
-
), ee =
|
|
64
|
-
|
|
63
|
+
), ee = Ke(
|
|
64
|
+
P,
|
|
65
65
|
e == null ? void 0 : e.radius,
|
|
66
66
|
c.defaultRadius,
|
|
67
67
|
o.radius
|
|
68
|
-
), m =
|
|
69
|
-
|
|
68
|
+
), m = w ?? o.status, te = p(
|
|
69
|
+
B,
|
|
70
70
|
e == null ? void 0 : e.labelAlign,
|
|
71
71
|
void 0,
|
|
72
72
|
o.labelAlign
|
|
73
|
-
), re = m !== "default" ?
|
|
73
|
+
), re = m !== "default" ? ge[m] : "", s = h(
|
|
74
74
|
() => v.find((t) => t.value === r),
|
|
75
75
|
[v, r]
|
|
76
|
-
), { refs: N, floatingStyles: se, context: f } =
|
|
76
|
+
), { refs: N, floatingStyles: se, context: f, isPositioned: oe } = ke({
|
|
77
77
|
isOpen: u,
|
|
78
78
|
onOpenChange: K,
|
|
79
79
|
disabled: y
|
|
80
|
-
}),
|
|
81
|
-
oe,
|
|
80
|
+
}), le = Se(f, { enabled: !y }), ae = be(f), ne = ye(f, { role: "listbox" }), { getReferenceProps: ie, getFloatingProps: ce } = he([
|
|
82
81
|
le,
|
|
83
|
-
ae
|
|
84
|
-
|
|
82
|
+
ae,
|
|
83
|
+
ne
|
|
84
|
+
]), de = Ae(
|
|
85
85
|
(t) => {
|
|
86
86
|
if (a == null || a(t.value), S) {
|
|
87
|
-
const
|
|
87
|
+
const pe = {
|
|
88
88
|
target: { value: t.value, name: F ?? "" }
|
|
89
89
|
};
|
|
90
|
-
S(
|
|
90
|
+
S(pe);
|
|
91
91
|
}
|
|
92
92
|
K(!1), L("");
|
|
93
93
|
},
|
|
94
94
|
[F, S, a]
|
|
95
|
-
),
|
|
95
|
+
), ue = h(() => s != null && s.label ? s.label : n !== void 0 ? String(n) : I, [s, n, I]), me = h(
|
|
96
96
|
() => r != null ? [r] : [],
|
|
97
97
|
[r]
|
|
98
|
-
),
|
|
98
|
+
), fe = ie();
|
|
99
99
|
return /* @__PURE__ */ l(
|
|
100
|
-
|
|
100
|
+
Ne,
|
|
101
101
|
{
|
|
102
102
|
id: d,
|
|
103
|
-
label:
|
|
103
|
+
label: z,
|
|
104
104
|
labelAlign: te,
|
|
105
105
|
description: b,
|
|
106
106
|
descriptionId: b ? `${d}-description` : void 0,
|
|
107
107
|
message: R,
|
|
108
108
|
messageId: R ? `${d}-message` : void 0,
|
|
109
109
|
status: m,
|
|
110
|
-
required:
|
|
110
|
+
required: D,
|
|
111
111
|
isLoading: A,
|
|
112
112
|
children: /* @__PURE__ */ g("div", { className: "w-full relative inline-block", children: [
|
|
113
113
|
/* @__PURE__ */ l(
|
|
114
|
-
|
|
114
|
+
Le,
|
|
115
115
|
{
|
|
116
116
|
ref: (t) => {
|
|
117
117
|
N.setReference(t), typeof i == "function" ? i(t) : i && (i.current = t);
|
|
@@ -136,10 +136,10 @@ const ke = he(
|
|
|
136
136
|
),
|
|
137
137
|
style: q,
|
|
138
138
|
startContent: H,
|
|
139
|
-
endContent: /* @__PURE__ */ g(
|
|
139
|
+
endContent: /* @__PURE__ */ g(ve, { children: [
|
|
140
140
|
J,
|
|
141
141
|
/* @__PURE__ */ l(
|
|
142
|
-
|
|
142
|
+
Ie,
|
|
143
143
|
{
|
|
144
144
|
className: x(
|
|
145
145
|
"shrink-0 text-foreground/70 transition-transform duration-200",
|
|
@@ -148,7 +148,7 @@ const ke = he(
|
|
|
148
148
|
}
|
|
149
149
|
)
|
|
150
150
|
] }),
|
|
151
|
-
...
|
|
151
|
+
...fe,
|
|
152
152
|
children: /* @__PURE__ */ l(
|
|
153
153
|
"span",
|
|
154
154
|
{
|
|
@@ -156,23 +156,24 @@ const ke = he(
|
|
|
156
156
|
"truncate",
|
|
157
157
|
s || n ? "text-foreground" : "text-foreground/70"
|
|
158
158
|
),
|
|
159
|
-
children:
|
|
159
|
+
children: ue
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
164
|
/* @__PURE__ */ l(
|
|
165
|
-
|
|
165
|
+
Oe,
|
|
166
166
|
{
|
|
167
167
|
isOpen: u,
|
|
168
168
|
context: f,
|
|
169
169
|
floatingStyles: se,
|
|
170
|
-
getFloatingProps:
|
|
170
|
+
getFloatingProps: ce,
|
|
171
171
|
setFloatingRef: N.setFloating,
|
|
172
|
+
isPositioned: oe,
|
|
172
173
|
options: v,
|
|
173
|
-
selectedValues:
|
|
174
|
-
onSelectMenuOption:
|
|
175
|
-
isSearch:
|
|
174
|
+
selectedValues: me,
|
|
175
|
+
onSelectMenuOption: de,
|
|
176
|
+
isSearch: M,
|
|
176
177
|
searchPlaceholder: T,
|
|
177
178
|
searchInputName: $,
|
|
178
179
|
searchQuery: Y,
|
|
@@ -187,7 +188,7 @@ const ke = he(
|
|
|
187
188
|
);
|
|
188
189
|
}
|
|
189
190
|
);
|
|
190
|
-
|
|
191
|
+
Ee.displayName = "Select";
|
|
191
192
|
export {
|
|
192
|
-
|
|
193
|
+
Ee as Select
|
|
193
194
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputConfig } from '../input';
|
|
2
2
|
import { MenuConfig } from '../select-menu';
|
|
3
3
|
/**
|
|
4
4
|
* Theme configuration options for the Select component.
|
|
@@ -7,7 +7,7 @@ import { MenuConfig } from '../select-menu';
|
|
|
7
7
|
* and dropdown-menu overrides. Set under `components.select` in
|
|
8
8
|
* the AsheeUI config.
|
|
9
9
|
*/
|
|
10
|
-
export interface SelectConfig extends
|
|
10
|
+
export interface SelectConfig extends InputConfig {
|
|
11
11
|
/**
|
|
12
12
|
* Configuration for the dropdown menu.
|
|
13
13
|
* Controls the menu's visual appearance and behavior.
|
|
@@ -16,8 +16,6 @@ export interface SelectConfig extends FieldConfig {
|
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Default config values registered for the Select component.
|
|
19
|
-
*
|
|
20
|
-
* Inherits field label defaults from `FALLBACK_FIELD_CONFIG`.
|
|
21
19
|
*/
|
|
22
20
|
export declare const defaultSelectConfig: SelectConfig;
|
|
23
21
|
/**
|
|
@@ -25,7 +23,7 @@ export declare const defaultSelectConfig: SelectConfig;
|
|
|
25
23
|
* These values are used when instance props, component config,
|
|
26
24
|
* and global defaults are all undefined.
|
|
27
25
|
*/
|
|
28
|
-
export declare const FALLBACK_SELECT_CONFIG: Required<FieldConfig>;
|
|
26
|
+
export declare const FALLBACK_SELECT_CONFIG: Required<import('../field').FieldConfig>;
|
|
29
27
|
declare module "../../libs/registry" {
|
|
30
28
|
interface ComponentTypeConfigRegistry {
|
|
31
29
|
select: SelectConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-config.d.ts","sourceRoot":"","sources":["../../../src/components/select/select-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"select-config.d.ts","sourceRoot":"","sources":["../../../src/components/select/select-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAAiC,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,0CAAwB,CAAC;AAE5D,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,MAAM,EAAE,YAAY,CAAC;KACtB;CACF"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
import { FALLBACK_FIELD_CONFIG as
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { registerComponentDefaults as t } from "../../libs/registry.js";
|
|
3
|
+
import { FALLBACK_FIELD_CONFIG as e } from "../field/field-config.js";
|
|
4
|
+
import { defaultInputConfig as o } from "../input/input-config.js";
|
|
5
|
+
const r = o, i = e;
|
|
6
|
+
t("select", r);
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
i as FALLBACK_SELECT_CONFIG,
|
|
9
|
+
r as defaultSelectConfig
|
|
9
10
|
};
|