asheeui 0.6.8 → 0.6.10
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 +4 -22
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +8 -11
- 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 +24 -3
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +9 -12
- 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 -187
- package/dist/components/multi-select/multi-select-config.d.ts +4 -22
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +11 -14
- 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 +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 +5 -33
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +6 -13
- 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-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/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 +192 -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/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/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,251 @@
|
|
|
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
|
-
|
|
168
|
+
type: "button",
|
|
169
|
+
variant: Se,
|
|
170
|
+
color: ye,
|
|
171
|
+
size: g,
|
|
172
|
+
radius: F,
|
|
173
|
+
isDisabled: c,
|
|
174
|
+
isLoading: M,
|
|
175
|
+
fullWidth: !0,
|
|
182
176
|
animate: !1,
|
|
183
|
-
|
|
184
|
-
isDisabled: u,
|
|
185
|
-
"aria-expanded": x,
|
|
177
|
+
"aria-expanded": b,
|
|
186
178
|
"aria-haspopup": "listbox",
|
|
187
179
|
"aria-invalid": d === "error",
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
180
|
+
"aria-describedby": [w ? `${y}-description` : void 0].filter(Boolean).join(" ") || void 0,
|
|
181
|
+
className: v(
|
|
182
|
+
"font-normal text-left justify-between",
|
|
183
|
+
Ce[d],
|
|
184
|
+
ge,
|
|
185
|
+
Ie,
|
|
186
|
+
Ne,
|
|
187
|
+
oe
|
|
195
188
|
),
|
|
196
|
-
|
|
197
|
-
children: [
|
|
198
|
-
|
|
189
|
+
startContent: ie,
|
|
190
|
+
endContent: /* @__PURE__ */ S(Pe, { children: [
|
|
191
|
+
ce,
|
|
199
192
|
/* @__PURE__ */ l(
|
|
200
|
-
|
|
193
|
+
Ge,
|
|
201
194
|
{
|
|
202
|
-
className:
|
|
203
|
-
"
|
|
204
|
-
|
|
195
|
+
className: v(
|
|
196
|
+
"shrink-0 text-foreground/70 transition-transform duration-200",
|
|
197
|
+
b && "rotate-180"
|
|
205
198
|
)
|
|
206
199
|
}
|
|
207
200
|
)
|
|
208
|
-
]
|
|
201
|
+
] }),
|
|
202
|
+
...Fe,
|
|
203
|
+
children: /* @__PURE__ */ l(
|
|
204
|
+
"span",
|
|
205
|
+
{
|
|
206
|
+
className: v(
|
|
207
|
+
"truncate",
|
|
208
|
+
o.length > 0 ? "text-foreground" : "text-foreground/70"
|
|
209
|
+
),
|
|
210
|
+
children: De
|
|
211
|
+
}
|
|
212
|
+
)
|
|
209
213
|
}
|
|
210
214
|
),
|
|
211
215
|
/* @__PURE__ */ l(
|
|
212
|
-
|
|
216
|
+
Je,
|
|
213
217
|
{
|
|
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
|
|
218
|
+
isOpen: b,
|
|
219
|
+
context: I,
|
|
220
|
+
floatingStyles: Le,
|
|
221
|
+
getFloatingProps: Ee,
|
|
222
|
+
setFloatingRef: K.setFloating,
|
|
223
|
+
options: _,
|
|
224
|
+
selectedValues: Me,
|
|
225
|
+
onSelectMenuOption: ke,
|
|
226
|
+
isSearch: H,
|
|
227
|
+
searchPlaceholder: Q,
|
|
228
|
+
searchInputName: h,
|
|
229
|
+
searchQuery: me,
|
|
230
|
+
onSearchChange: fe,
|
|
231
|
+
belowList: W,
|
|
232
|
+
menuProps: ae,
|
|
233
|
+
menuConfig: e == null ? void 0 : e.menu
|
|
233
234
|
}
|
|
234
235
|
)
|
|
235
236
|
] }),
|
|
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:
|
|
237
|
+
!q && /* @__PURE__ */ S("div", { className: "flex flex-col gap-1.5", children: [
|
|
238
|
+
E && /* @__PURE__ */ l("span", { className: "text-xs font-medium text-foreground/70", children: E }),
|
|
239
|
+
/* @__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
240
|
We,
|
|
240
241
|
{
|
|
241
242
|
variant: "bordered",
|
|
242
|
-
color:
|
|
243
|
-
size:
|
|
244
|
-
isDisabled:
|
|
245
|
-
className:
|
|
243
|
+
color: ve,
|
|
244
|
+
size: xe,
|
|
245
|
+
isDisabled: c,
|
|
246
|
+
className: v(
|
|
246
247
|
"inline-flex items-center gap-1.5 font-medium shadow-xs",
|
|
247
|
-
|
|
248
|
+
_e
|
|
248
249
|
),
|
|
249
250
|
children: [
|
|
250
251
|
/* @__PURE__ */ l("span", { children: r.label }),
|
|
@@ -252,16 +253,16 @@ const tr = Ge(
|
|
|
252
253
|
"button",
|
|
253
254
|
{
|
|
254
255
|
type: "button",
|
|
255
|
-
tabIndex:
|
|
256
|
+
tabIndex: c ? -1 : 0,
|
|
256
257
|
onClick: (t) => {
|
|
257
|
-
t.stopPropagation(),
|
|
258
|
+
t.stopPropagation(), c || P(r.value);
|
|
258
259
|
},
|
|
259
260
|
onKeyDown: (t) => {
|
|
260
|
-
(t.key === "Enter" || t.key === " ") && !
|
|
261
|
+
(t.key === "Enter" || t.key === " ") && !c && (t.stopPropagation(), P(r.value));
|
|
261
262
|
},
|
|
262
263
|
"aria-label": `Remove ${r.label}`,
|
|
263
264
|
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(
|
|
265
|
+
children: /* @__PURE__ */ l(He, { className: "w-3 h-3" })
|
|
265
266
|
}
|
|
266
267
|
)
|
|
267
268
|
]
|
|
@@ -276,7 +277,7 @@ const tr = Ge(
|
|
|
276
277
|
);
|
|
277
278
|
}
|
|
278
279
|
);
|
|
279
|
-
|
|
280
|
+
sr.displayName = "MultiSelect";
|
|
280
281
|
export {
|
|
281
|
-
|
|
282
|
+
sr as MultiSelect
|
|
282
283
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Color, Radius, Size, Variant } from '../../shared';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { InputConfig } from '../input';
|
|
3
|
+
import { MenuConfig } from '../select-menu';
|
|
4
4
|
/**
|
|
5
5
|
* Theme configuration options for the MultiSelect component.
|
|
6
6
|
*
|
|
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.
|
|
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;
|
|
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,26 +1,23 @@
|
|
|
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 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
|
-
|
|
10
|
-
|
|
11
|
-
}, a = {
|
|
12
|
-
...e,
|
|
9
|
+
}
|
|
10
|
+
}, l = {
|
|
11
|
+
...i,
|
|
13
12
|
chip: {
|
|
14
13
|
size: "sm",
|
|
15
14
|
color: "primary",
|
|
16
15
|
radius: "sm",
|
|
17
16
|
variant: "solid"
|
|
18
|
-
}
|
|
19
|
-
portal: !0,
|
|
20
|
-
portalTarget: null
|
|
17
|
+
}
|
|
21
18
|
};
|
|
22
|
-
t("multiSelect",
|
|
19
|
+
t("multiSelect", e);
|
|
23
20
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
l as FALLBACK_MULTI_SELECT_CONFIG,
|
|
22
|
+
e as defaultMultiSelectConfig
|
|
26
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
|
};
|