asheeui 0.6.8 → 0.6.9
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/autocomplete/Autocomplete.d.ts +34 -17
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +86 -102
- package/dist/components/autocomplete/autocomplete-config.d.ts +2 -20
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +9 -13
- package/dist/components/button/Button.d.ts +31 -5
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +68 -64
- package/dist/components/card/Card.d.ts +58 -54
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +152 -158
- package/dist/components/card/card-config.d.ts +66 -33
- package/dist/components/card/card-config.d.ts.map +1 -1
- package/dist/components/card/card-config.js +9 -9
- package/dist/components/date-picker/Calendar.d.ts +57 -0
- package/dist/components/date-picker/Calendar.d.ts.map +1 -0
- package/dist/components/date-picker/Calendar.js +224 -0
- package/dist/components/date-picker/DatePicker.d.ts +68 -155
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +194 -466
- package/dist/components/date-picker/TimeSpinner.d.ts +46 -0
- package/dist/components/date-picker/TimeSpinner.d.ts.map +1 -0
- package/dist/components/date-picker/TimeSpinner.js +84 -0
- package/dist/components/date-picker/date-picker-config.d.ts +21 -1
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +10 -14
- package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-styles.js +4 -11
- package/dist/components/date-picker/date-picker.helpers.d.ts +111 -0
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.helpers.js +110 -0
- package/dist/components/date-picker/index.js +3 -0
- package/dist/components/input/Input.d.ts +13 -7
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +96 -91
- package/dist/components/keyboard/KeyboardContext.d.ts +130 -0
- package/dist/components/keyboard/KeyboardContext.d.ts.map +1 -0
- package/dist/components/keyboard/KeyboardContext.js +13 -0
- package/dist/components/keyboard/KeyboardProvider.d.ts +78 -0
- package/dist/components/keyboard/KeyboardProvider.d.ts.map +1 -0
- package/dist/components/keyboard/KeyboardProvider.js +183 -0
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +65 -43
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +119 -113
- package/dist/components/keyboard/index.d.ts +2 -1
- package/dist/components/keyboard/index.d.ts.map +1 -1
- package/dist/components/keyboard/index.js +2 -1
- package/dist/components/keyboard/keyboard-config.d.ts +40 -36
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-config.js +15 -10
- package/dist/components/keyboard/use-keyboard-field.d.ts +6 -4
- package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
- package/dist/components/keyboard/use-keyboard-field.js +12 -12
- package/dist/components/multi-select/MultiSelect.d.ts +75 -40
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +188 -188
- package/dist/components/multi-select/multi-select-config.d.ts +2 -20
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +10 -14
- package/dist/components/select/Select.d.ts +60 -45
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +147 -159
- package/dist/components/select/select-config.d.ts +3 -29
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +6 -14
- package/dist/components/select/select-styles.js +1 -6
- package/dist/components/select-menu/SelectMenu.d.ts +45 -30
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +125 -124
- package/dist/components/select-menu/select-menu-config.d.ts +25 -2
- package/dist/components/select-menu/select-menu-config.d.ts.map +1 -1
- package/dist/components/select-menu/select-menu-config.js +4 -3
- package/dist/components/switch/Switch.d.ts +9 -33
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +68 -74
- package/dist/components/switch/switch-styles.d.ts +1 -6
- package/dist/components/switch/switch-styles.d.ts.map +1 -1
- package/dist/components/switch/switch-styles.js +6 -12
- package/dist/components/textarea/Textarea.d.ts +19 -1
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +95 -90
- package/dist/components/toast/ToastContext.d.ts +122 -0
- package/dist/components/toast/ToastContext.d.ts.map +1 -0
- package/dist/components/toast/ToastContext.js +28 -0
- package/dist/components/toast/ToastProvider.d.ts +98 -0
- package/dist/components/toast/ToastProvider.d.ts.map +1 -0
- package/dist/components/toast/ToastProvider.js +188 -0
- package/dist/components/toast/index.d.ts +2 -1
- package/dist/components/toast/index.d.ts.map +1 -1
- package/dist/components/toast/index.js +2 -1
- package/dist/components/toast/toast-config.d.ts +36 -0
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/icons/ChevronUpIcon.d.ts +3 -0
- package/dist/icons/ChevronUpIcon.d.ts.map +1 -0
- package/dist/icons/ChevronUpIcon.js +21 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/index.js +62 -59
- package/dist/theme/color.js +2 -2
- package/package.json +1 -1
- package/dist/components/keyboard/keyboard-context.d.ts +0 -118
- package/dist/components/keyboard/keyboard-context.d.ts.map +0 -1
- package/dist/components/keyboard/keyboard-context.js +0 -90
- package/dist/components/toast/toast-context.d.ts +0 -163
- package/dist/components/toast/toast-context.d.ts.map +0 -1
- package/dist/components/toast/toast-context.js +0 -177
|
@@ -1,250 +1,250 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as l, jsxs as S } from "react/jsx-runtime";
|
|
3
|
-
import { useClick as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { ChevronDownIcon as
|
|
6
|
-
import { CloseIcon as
|
|
7
|
-
import { useAsheeConfig as
|
|
8
|
-
import { resolveCascade as
|
|
9
|
-
import { Button as
|
|
2
|
+
import { jsx as l, jsxs as S, Fragment as Pe } from "react/jsx-runtime";
|
|
3
|
+
import { useClick as Re, useDismiss as Ue, useRole as je, useInteractions as Ve } from "@floating-ui/react";
|
|
4
|
+
import { forwardRef as $e, useId as Be, useState as B, useMemo as A, useCallback as z } from "react";
|
|
5
|
+
import { ChevronDownIcon as Ge } from "../../icons/ChevronDownIcon.js";
|
|
6
|
+
import { CloseIcon as He } from "../../icons/CloseIcon.js";
|
|
7
|
+
import { useAsheeConfig as Qe } from "../../libs/context.js";
|
|
8
|
+
import { resolveCascade as m, resolveRadiusKey as G, resolveClassKey as N } from "../../utils/resolve-token.js";
|
|
9
|
+
import { Button as he } from "../button/Button.js";
|
|
10
10
|
import { Chip as We } from "../chip/Chip.js";
|
|
11
|
-
import { FieldShell as
|
|
12
|
-
import { SelectMenu as
|
|
11
|
+
import { FieldShell as qe } from "../field/FieldShell.js";
|
|
12
|
+
import { SelectMenu as Je } 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
|
|
17
|
-
import { cn as
|
|
18
|
-
const
|
|
14
|
+
import { MULTI_SELECT_HEIGHT_CLASS as Xe, MULTI_SELECT_PADDING_CLASS as Ye, MULTI_SELECT_FONT_CLASS as Ze, STATUS_BORDER_CLASS as Ce } from "./multi-select-styles.js";
|
|
15
|
+
import { RADIUS_CLASS as er } from "../../shared/radius.js";
|
|
16
|
+
import { useSelectFloating as rr } from "../select-menu/use-select-floating.js";
|
|
17
|
+
import { cn as v } from "../../utils/cn.js";
|
|
18
|
+
const sr = $e(
|
|
19
19
|
({
|
|
20
|
-
options:
|
|
21
|
-
value:
|
|
22
|
-
onChange:
|
|
23
|
-
InputLabel:
|
|
24
|
-
isSearch:
|
|
25
|
-
searchPlaceholder:
|
|
26
|
-
searchInputName:
|
|
27
|
-
belowList:
|
|
28
|
-
chipOptions:
|
|
29
|
-
handleRemoveChip:
|
|
20
|
+
options: _ = [],
|
|
21
|
+
value: n,
|
|
22
|
+
onChange: u,
|
|
23
|
+
InputLabel: T = "Select Options...",
|
|
24
|
+
isSearch: H = !0,
|
|
25
|
+
searchPlaceholder: Q = "Search...",
|
|
26
|
+
searchInputName: h = "multiselect-search",
|
|
27
|
+
belowList: W,
|
|
28
|
+
chipOptions: L,
|
|
29
|
+
handleRemoveChip: i,
|
|
30
30
|
handleAddChip: f,
|
|
31
|
-
chipLabel:
|
|
32
|
-
disableChipDisplay:
|
|
33
|
-
variant:
|
|
34
|
-
color:
|
|
35
|
-
size:
|
|
36
|
-
radius:
|
|
37
|
-
status:
|
|
38
|
-
label:
|
|
39
|
-
labelAlign:
|
|
40
|
-
description:
|
|
41
|
-
message:
|
|
42
|
-
required:
|
|
43
|
-
isLoading:
|
|
44
|
-
disabled:
|
|
45
|
-
containerClassName:
|
|
46
|
-
dropdownClassName: te,
|
|
31
|
+
chipLabel: E,
|
|
32
|
+
disableChipDisplay: q = !1,
|
|
33
|
+
variant: J,
|
|
34
|
+
color: X,
|
|
35
|
+
size: Y,
|
|
36
|
+
radius: Z,
|
|
37
|
+
status: C,
|
|
38
|
+
label: ee,
|
|
39
|
+
labelAlign: re,
|
|
40
|
+
description: w,
|
|
41
|
+
message: k,
|
|
42
|
+
required: se,
|
|
43
|
+
isLoading: M,
|
|
44
|
+
disabled: c,
|
|
45
|
+
containerClassName: te,
|
|
47
46
|
id: le,
|
|
48
|
-
className:
|
|
49
|
-
menu:
|
|
47
|
+
className: oe,
|
|
48
|
+
menu: ae,
|
|
50
49
|
chip: a,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
J,
|
|
50
|
+
style: ne,
|
|
51
|
+
startContent: ie,
|
|
52
|
+
endContent: ce
|
|
53
|
+
}, x) => {
|
|
54
|
+
var R, U, j, V;
|
|
55
|
+
const p = Qe(), e = (R = p.components) == null ? void 0 : R.multiSelect, ue = Be(), y = le ?? ue, [b, de] = B(!1), [me, fe] = B(""), g = m(
|
|
56
|
+
Y,
|
|
59
57
|
e == null ? void 0 : e.size,
|
|
60
58
|
void 0,
|
|
61
59
|
s.size
|
|
62
|
-
),
|
|
63
|
-
|
|
60
|
+
), Se = m(
|
|
61
|
+
J,
|
|
64
62
|
e == null ? void 0 : e.variant,
|
|
65
|
-
|
|
63
|
+
p.defaultVariant,
|
|
66
64
|
s.variant
|
|
67
|
-
),
|
|
68
|
-
|
|
65
|
+
), D = m(
|
|
66
|
+
X,
|
|
69
67
|
e == null ? void 0 : e.color,
|
|
70
|
-
|
|
68
|
+
p.defaultColor,
|
|
71
69
|
s.color
|
|
72
|
-
),
|
|
73
|
-
|
|
70
|
+
), F = G(
|
|
71
|
+
Z,
|
|
74
72
|
e == null ? void 0 : e.radius,
|
|
75
|
-
|
|
73
|
+
p.defaultRadius,
|
|
76
74
|
s.radius
|
|
77
|
-
),
|
|
75
|
+
), ve = m(
|
|
78
76
|
a == null ? void 0 : a.color,
|
|
79
|
-
(
|
|
80
|
-
|
|
77
|
+
(U = e == null ? void 0 : e.chip) == null ? void 0 : U.color,
|
|
78
|
+
D,
|
|
81
79
|
s.chip.color
|
|
82
|
-
),
|
|
80
|
+
), xe = m(
|
|
83
81
|
a == null ? void 0 : a.size,
|
|
84
|
-
(
|
|
82
|
+
(j = e == null ? void 0 : e.chip) == null ? void 0 : j.size,
|
|
85
83
|
void 0,
|
|
86
84
|
s.chip.size
|
|
87
|
-
),
|
|
85
|
+
), pe = G(
|
|
88
86
|
a == null ? void 0 : a.radius,
|
|
89
|
-
(
|
|
90
|
-
|
|
87
|
+
(V = e == null ? void 0 : e.chip) == null ? void 0 : V.radius,
|
|
88
|
+
F,
|
|
91
89
|
s.chip.radius
|
|
92
|
-
), d =
|
|
93
|
-
|
|
90
|
+
), d = C ?? s.status, ye = d === "error" ? "danger" : d === "success" ? "success" : d === "warning" ? "warning" : D, be = m(
|
|
91
|
+
re,
|
|
94
92
|
e == null ? void 0 : e.labelAlign,
|
|
95
93
|
void 0,
|
|
96
94
|
s.labelAlign
|
|
97
|
-
),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
void 0,
|
|
101
|
-
s.portal
|
|
102
|
-
), Ne = c(
|
|
103
|
-
ie,
|
|
104
|
-
e == null ? void 0 : e.portalTarget,
|
|
105
|
-
void 0,
|
|
106
|
-
s.portalTarget
|
|
107
|
-
), Le = g(
|
|
108
|
-
y,
|
|
109
|
-
Ze,
|
|
95
|
+
), ge = N(
|
|
96
|
+
g,
|
|
97
|
+
Xe,
|
|
110
98
|
s.size
|
|
111
|
-
),
|
|
112
|
-
|
|
113
|
-
|
|
99
|
+
), Ie = N(
|
|
100
|
+
g,
|
|
101
|
+
Ye,
|
|
114
102
|
s.size
|
|
115
|
-
),
|
|
116
|
-
|
|
117
|
-
|
|
103
|
+
), Ne = N(
|
|
104
|
+
g,
|
|
105
|
+
Ze,
|
|
118
106
|
s.size
|
|
119
|
-
),
|
|
120
|
-
|
|
121
|
-
|
|
107
|
+
), _e = N(
|
|
108
|
+
pe,
|
|
109
|
+
er,
|
|
122
110
|
s.chip.radius
|
|
123
|
-
), { refs:
|
|
124
|
-
isOpen:
|
|
125
|
-
onOpenChange:
|
|
126
|
-
disabled:
|
|
127
|
-
}),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
]),
|
|
132
|
-
(r) =>
|
|
133
|
-
[
|
|
134
|
-
),
|
|
111
|
+
), { refs: K, floatingStyles: Le, context: I } = rr({
|
|
112
|
+
isOpen: b,
|
|
113
|
+
onOpenChange: de,
|
|
114
|
+
disabled: c
|
|
115
|
+
}), we = Re(I, { enabled: !c }), Ae = Ue(I), ze = je(I, { role: "listbox" }), { getReferenceProps: Te, getFloatingProps: Ee } = Ve([
|
|
116
|
+
we,
|
|
117
|
+
Ae,
|
|
118
|
+
ze
|
|
119
|
+
]), o = A(() => L !== void 0 ? L : Array.isArray(n) ? _.filter((r) => n.includes(r.value)) : [], [L, n, _]), O = z(
|
|
120
|
+
(r) => o.some((t) => t.value === r),
|
|
121
|
+
[o]
|
|
122
|
+
), ke = z(
|
|
135
123
|
(r) => {
|
|
136
|
-
const t =
|
|
137
|
-
if (f ||
|
|
138
|
-
t ?
|
|
139
|
-
else if (
|
|
140
|
-
const
|
|
141
|
-
|
|
124
|
+
const t = O(r.value);
|
|
125
|
+
if (f || i)
|
|
126
|
+
t ? i == null || i(r.value) : f == null || f(r);
|
|
127
|
+
else if (u) {
|
|
128
|
+
const $ = n ?? [], Ke = t ? $.filter((Oe) => Oe !== r.value) : [...$, r.value];
|
|
129
|
+
u(Ke);
|
|
142
130
|
}
|
|
143
131
|
},
|
|
144
|
-
[
|
|
145
|
-
),
|
|
132
|
+
[O, f, i, u, n]
|
|
133
|
+
), P = z(
|
|
146
134
|
(r) => {
|
|
147
|
-
|
|
135
|
+
i ? i(r) : u && Array.isArray(n) && u(n.filter((t) => t !== r));
|
|
148
136
|
},
|
|
149
|
-
[
|
|
150
|
-
),
|
|
151
|
-
() =>
|
|
152
|
-
[
|
|
153
|
-
);
|
|
137
|
+
[i, u, n]
|
|
138
|
+
), Me = A(
|
|
139
|
+
() => o.map((r) => r.value),
|
|
140
|
+
[o]
|
|
141
|
+
), De = A(() => o.length > 0 ? `${o.length} selected` : T, [o.length, T]), Fe = Te();
|
|
154
142
|
return /* @__PURE__ */ l(
|
|
155
|
-
|
|
143
|
+
qe,
|
|
156
144
|
{
|
|
157
|
-
id:
|
|
158
|
-
label:
|
|
159
|
-
labelAlign:
|
|
160
|
-
description:
|
|
161
|
-
|
|
145
|
+
id: y,
|
|
146
|
+
label: ee,
|
|
147
|
+
labelAlign: be,
|
|
148
|
+
description: w,
|
|
149
|
+
descriptionId: w ? `${y}-description` : void 0,
|
|
150
|
+
message: k,
|
|
151
|
+
messageId: k ? `${y}-message` : void 0,
|
|
162
152
|
status: d,
|
|
163
|
-
required:
|
|
164
|
-
isLoading:
|
|
153
|
+
required: se,
|
|
154
|
+
isLoading: M,
|
|
165
155
|
children: /* @__PURE__ */ S(
|
|
166
156
|
"div",
|
|
167
157
|
{
|
|
168
|
-
className:
|
|
169
|
-
style:
|
|
170
|
-
...ue,
|
|
158
|
+
className: v("w-full flex flex-col gap-3", te),
|
|
159
|
+
style: ne,
|
|
171
160
|
children: [
|
|
172
161
|
/* @__PURE__ */ S("div", { className: "relative w-full", children: [
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
|
|
162
|
+
/* @__PURE__ */ l(
|
|
163
|
+
he,
|
|
175
164
|
{
|
|
176
165
|
ref: (r) => {
|
|
177
|
-
|
|
166
|
+
K.setReference(r), typeof x == "function" ? x(r) : x && (x.current = r);
|
|
178
167
|
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
isDisabled:
|
|
185
|
-
|
|
168
|
+
type: "button",
|
|
169
|
+
variant: Se,
|
|
170
|
+
color: ye,
|
|
171
|
+
size: g,
|
|
172
|
+
radius: F,
|
|
173
|
+
isDisabled: c,
|
|
174
|
+
isLoading: M,
|
|
175
|
+
fullWidth: !0,
|
|
176
|
+
"aria-expanded": b,
|
|
186
177
|
"aria-haspopup": "listbox",
|
|
187
178
|
"aria-invalid": d === "error",
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
179
|
+
"aria-describedby": [w ? `${y}-description` : void 0].filter(Boolean).join(" ") || void 0,
|
|
180
|
+
className: v(
|
|
181
|
+
"font-normal text-left justify-between",
|
|
182
|
+
Ce[d],
|
|
183
|
+
ge,
|
|
184
|
+
Ie,
|
|
185
|
+
Ne,
|
|
186
|
+
oe
|
|
195
187
|
),
|
|
196
|
-
|
|
197
|
-
children: [
|
|
198
|
-
|
|
188
|
+
startContent: ie,
|
|
189
|
+
endContent: /* @__PURE__ */ S(Pe, { children: [
|
|
190
|
+
ce,
|
|
199
191
|
/* @__PURE__ */ l(
|
|
200
|
-
|
|
192
|
+
Ge,
|
|
201
193
|
{
|
|
202
|
-
className:
|
|
203
|
-
"
|
|
204
|
-
|
|
194
|
+
className: v(
|
|
195
|
+
"shrink-0 text-foreground/70 transition-transform duration-200",
|
|
196
|
+
b && "rotate-180"
|
|
205
197
|
)
|
|
206
198
|
}
|
|
207
199
|
)
|
|
208
|
-
]
|
|
200
|
+
] }),
|
|
201
|
+
...Fe,
|
|
202
|
+
children: /* @__PURE__ */ l(
|
|
203
|
+
"span",
|
|
204
|
+
{
|
|
205
|
+
className: v(
|
|
206
|
+
"truncate",
|
|
207
|
+
o.length > 0 ? "text-foreground" : "text-foreground/70"
|
|
208
|
+
),
|
|
209
|
+
children: De
|
|
210
|
+
}
|
|
211
|
+
)
|
|
209
212
|
}
|
|
210
213
|
),
|
|
211
214
|
/* @__PURE__ */ l(
|
|
212
|
-
|
|
215
|
+
Je,
|
|
213
216
|
{
|
|
214
|
-
isOpen:
|
|
215
|
-
context:
|
|
216
|
-
floatingStyles:
|
|
217
|
-
getFloatingProps:
|
|
218
|
-
setFloatingRef:
|
|
219
|
-
options:
|
|
220
|
-
selectedValues:
|
|
221
|
-
onSelectMenuOption:
|
|
222
|
-
isSearch:
|
|
223
|
-
searchPlaceholder:
|
|
224
|
-
searchInputName:
|
|
225
|
-
searchQuery:
|
|
226
|
-
onSearchChange:
|
|
227
|
-
belowList:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
menuConfig: e == null ? void 0 : e.menu,
|
|
231
|
-
portal: Ie,
|
|
232
|
-
portalTarget: Ne
|
|
217
|
+
isOpen: b,
|
|
218
|
+
context: I,
|
|
219
|
+
floatingStyles: Le,
|
|
220
|
+
getFloatingProps: Ee,
|
|
221
|
+
setFloatingRef: K.setFloating,
|
|
222
|
+
options: _,
|
|
223
|
+
selectedValues: Me,
|
|
224
|
+
onSelectMenuOption: ke,
|
|
225
|
+
isSearch: H,
|
|
226
|
+
searchPlaceholder: Q,
|
|
227
|
+
searchInputName: h,
|
|
228
|
+
searchQuery: me,
|
|
229
|
+
onSearchChange: fe,
|
|
230
|
+
belowList: W,
|
|
231
|
+
menuProps: ae,
|
|
232
|
+
menuConfig: e == null ? void 0 : e.menu
|
|
233
233
|
}
|
|
234
234
|
)
|
|
235
235
|
] }),
|
|
236
|
-
!
|
|
237
|
-
|
|
238
|
-
/* @__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:
|
|
236
|
+
!q && /* @__PURE__ */ S("div", { className: "flex flex-col gap-1.5", children: [
|
|
237
|
+
E && /* @__PURE__ */ l("span", { className: "text-xs font-medium text-foreground/70", children: E }),
|
|
238
|
+
/* @__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
239
|
We,
|
|
240
240
|
{
|
|
241
241
|
variant: "bordered",
|
|
242
|
-
color:
|
|
243
|
-
size:
|
|
244
|
-
isDisabled:
|
|
245
|
-
className:
|
|
242
|
+
color: ve,
|
|
243
|
+
size: xe,
|
|
244
|
+
isDisabled: c,
|
|
245
|
+
className: v(
|
|
246
246
|
"inline-flex items-center gap-1.5 font-medium shadow-xs",
|
|
247
|
-
|
|
247
|
+
_e
|
|
248
248
|
),
|
|
249
249
|
children: [
|
|
250
250
|
/* @__PURE__ */ l("span", { children: r.label }),
|
|
@@ -252,16 +252,16 @@ const tr = Ge(
|
|
|
252
252
|
"button",
|
|
253
253
|
{
|
|
254
254
|
type: "button",
|
|
255
|
-
tabIndex:
|
|
255
|
+
tabIndex: c ? -1 : 0,
|
|
256
256
|
onClick: (t) => {
|
|
257
|
-
t.stopPropagation(),
|
|
257
|
+
t.stopPropagation(), c || P(r.value);
|
|
258
258
|
},
|
|
259
259
|
onKeyDown: (t) => {
|
|
260
|
-
(t.key === "Enter" || t.key === " ") && !
|
|
260
|
+
(t.key === "Enter" || t.key === " ") && !c && (t.stopPropagation(), P(r.value));
|
|
261
261
|
},
|
|
262
262
|
"aria-label": `Remove ${r.label}`,
|
|
263
263
|
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(
|
|
264
|
+
children: /* @__PURE__ */ l(He, { className: "w-3 h-3" })
|
|
265
265
|
}
|
|
266
266
|
)
|
|
267
267
|
]
|
|
@@ -276,7 +276,7 @@ const tr = Ge(
|
|
|
276
276
|
);
|
|
277
277
|
}
|
|
278
278
|
);
|
|
279
|
-
|
|
279
|
+
sr.displayName = "MultiSelect";
|
|
280
280
|
export {
|
|
281
|
-
|
|
281
|
+
sr as MultiSelect
|
|
282
282
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Color, Radius, Size, Variant } from '../../shared';
|
|
2
2
|
import { FieldConfig } from '../field/field-config';
|
|
3
|
-
import {
|
|
3
|
+
import { MenuConfig } from '../select-menu';
|
|
4
4
|
/**
|
|
5
5
|
* Theme configuration options for the MultiSelect component.
|
|
6
6
|
*
|
|
@@ -12,7 +12,7 @@ export interface MultiSelectConfig extends FieldConfig {
|
|
|
12
12
|
* Configuration for the dropdown menu.
|
|
13
13
|
* Controls the menu's visual appearance and behavior.
|
|
14
14
|
*/
|
|
15
|
-
menu?:
|
|
15
|
+
menu?: MenuConfig;
|
|
16
16
|
/**
|
|
17
17
|
* Configuration for selected value chips.
|
|
18
18
|
* Controls the appearance of chips in the selected values section.
|
|
@@ -35,22 +35,6 @@ export interface MultiSelectConfig extends FieldConfig {
|
|
|
35
35
|
*/
|
|
36
36
|
size?: Size;
|
|
37
37
|
};
|
|
38
|
-
/**
|
|
39
|
-
* Whether to render the dropdown menu in a React portal.
|
|
40
|
-
* When true, the menu is rendered at the document body level,
|
|
41
|
-
* escaping any parent DOM hierarchy. This prevents CSS containment
|
|
42
|
-
* and stacking context issues. Defaults to true because dropdowns
|
|
43
|
-
* should always appear above other content.
|
|
44
|
-
*
|
|
45
|
-
* @default true
|
|
46
|
-
*/
|
|
47
|
-
portal?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Custom portal target element for the dropdown menu.
|
|
50
|
-
* When portal is enabled, the menu is rendered into this element.
|
|
51
|
-
* Defaults to document.body.
|
|
52
|
-
*/
|
|
53
|
-
portalTarget?: HTMLElement | null;
|
|
54
38
|
}
|
|
55
39
|
/**
|
|
56
40
|
* Default config values registered for the MultiSelect component.
|
|
@@ -69,8 +53,6 @@ export declare const FALLBACK_MULTI_SELECT_CONFIG: {
|
|
|
69
53
|
readonly radius: "sm";
|
|
70
54
|
readonly variant: "solid";
|
|
71
55
|
};
|
|
72
|
-
readonly portal: true;
|
|
73
|
-
readonly portalTarget: null;
|
|
74
56
|
readonly size: import('../field').FieldSizeKey;
|
|
75
57
|
readonly radius: Radius;
|
|
76
58
|
readonly variant: Variant;
|
|
@@ -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;AACjE,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,
|
|
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;AACjE,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAC/B,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,26 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
import { FALLBACK_FIELD_CONFIG as e, defaultFieldConfig as
|
|
4
|
-
const
|
|
5
|
-
...
|
|
2
|
+
import { registerComponentDefaults as i } from "../../libs/registry.js";
|
|
3
|
+
import { FALLBACK_FIELD_CONFIG as e, defaultFieldConfig as t } from "../field/field-config.js";
|
|
4
|
+
const o = {
|
|
5
|
+
...t,
|
|
6
6
|
chip: {
|
|
7
7
|
size: "sm"
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
portalTarget: null
|
|
11
|
-
}, a = {
|
|
8
|
+
}
|
|
9
|
+
}, l = {
|
|
12
10
|
...e,
|
|
13
11
|
chip: {
|
|
14
12
|
size: "sm",
|
|
15
13
|
color: "primary",
|
|
16
14
|
radius: "sm",
|
|
17
15
|
variant: "solid"
|
|
18
|
-
}
|
|
19
|
-
portal: !0,
|
|
20
|
-
portalTarget: null
|
|
16
|
+
}
|
|
21
17
|
};
|
|
22
|
-
|
|
18
|
+
i("multiSelect", o);
|
|
23
19
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
l as FALLBACK_MULTI_SELECT_CONFIG,
|
|
21
|
+
o as defaultMultiSelectConfig
|
|
26
22
|
};
|