fiboui 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -22
- package/dist/{FineGrain-kBxv0WeR.js → FineGrain-6w615KQw.js} +4 -4
- package/dist/builder-KLTu7nAI.js +2476 -0
- package/dist/content.js +3 -3
- package/dist/core.js +49 -29
- package/dist/{index-B1av7e36.js → index-BN2z9MuJ.js} +317 -308
- package/dist/{index-DKFr-sai.js → index-CYnY7jAX.js} +3 -3
- package/dist/{index-Dm4j2mMM.js → index-CbTvwN9K.js} +4 -4
- package/dist/{index-BQGRpkzR.js → index-CdJvNseK.js} +3 -3
- package/dist/{index-yeYkDTAx.js → index-DU2MC5u3.js} +143 -126
- package/dist/index-DhPBYTPt.js +104 -0
- package/dist/{index-RbfIZuAo.js → index-ijbJR6lD.js} +1 -1
- package/dist/index.d.ts +43188 -42071
- package/dist/index.js +462 -420
- package/dist/interactive.js +1 -1
- package/dist/layout.js +2 -2
- package/dist/mount-D5gt_GWO.js +331 -0
- package/dist/structure.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +5 -1
- package/dist/builder-DjLYXkXu.js +0 -1842
- package/dist/index-CTRZRn9S.js +0 -90
- package/dist/mount-sAVX_FBU.js +0 -95
|
@@ -1,74 +1,79 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var r = (
|
|
5
|
-
import t, { useState as
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
const
|
|
2
|
+
var H = Object.defineProperty;
|
|
3
|
+
var O = (c, l, e) => l in c ? H(c, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[l] = e;
|
|
4
|
+
var r = (c, l, e) => O(c, typeof l != "symbol" ? l + "" : l, e);
|
|
5
|
+
import t, { useState as F, useEffect as M, useRef as j } from "react";
|
|
6
|
+
import { v as $, F as D, S as P } from "./builder-KLTu7nAI.js";
|
|
7
|
+
import { t as L } from "./bundle-mjs-wppB-TKB.js";
|
|
8
|
+
const q = t.memo((c) => {
|
|
9
9
|
const {
|
|
10
|
-
text:
|
|
10
|
+
text: l,
|
|
11
11
|
variant: e,
|
|
12
|
-
size:
|
|
12
|
+
size: o,
|
|
13
13
|
onPress: a,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
onHover: s,
|
|
15
|
+
disabled: d,
|
|
16
|
+
icon: h,
|
|
17
|
+
shape: p,
|
|
18
|
+
shadow: k,
|
|
19
|
+
tone: v,
|
|
19
20
|
motion: x,
|
|
20
|
-
expand:
|
|
21
|
-
className:
|
|
22
|
-
style:
|
|
23
|
-
...
|
|
24
|
-
} =
|
|
21
|
+
expand: E,
|
|
22
|
+
className: _,
|
|
23
|
+
style: y,
|
|
24
|
+
...f
|
|
25
|
+
} = c, g = {
|
|
25
26
|
xs: "px-[21px] py-[8px] text-[10px] gap-[6px] h-auto tracking-[0.12em] font-normal",
|
|
26
27
|
sm: "px-[14px] py-[6px] text-[13px] gap-[6px] h-[32px]",
|
|
27
28
|
md: "px-[22px] py-[10px] text-[15px] gap-[8px] h-[44px]",
|
|
28
29
|
lg: "px-[32px] py-[16px] text-[17px] gap-[10px] h-[56px]"
|
|
29
30
|
};
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
let
|
|
34
|
-
e === "ghost" ?
|
|
35
|
-
const
|
|
31
|
+
let S = "rounded-[14px]";
|
|
32
|
+
p === "pill" ? S = "rounded-full" : p === "square" ? S = "rounded-[12px]" : p === "rect" ? S = "rounded-[2px]" : p === "rounded" ? S = "rounded-[8px]" : p === "sharp" && (S = "rounded-none");
|
|
33
|
+
const m = v === "inverse";
|
|
34
|
+
let b = "";
|
|
35
|
+
e === "ghost" ? b = m ? "bg-transparent text-white shadow-none border border-transparent" : "bg-transparent text-gray-600 shadow-none border border-transparent hover:bg-gray-100" : e === "text" ? b = m ? "bg-transparent text-white shadow-none border-none px-2" : "bg-transparent text-gray-600 shadow-none border-none px-2 hover:bg-gray-100" : e === "soft" ? b = "bg-indigo-50 text-indigo-600 shadow-none border-none hover:bg-indigo-100" : e === "outline" || e === "outlined" ? b = m ? "bg-black text-white shadow-none border border-[#3b3b3b]" : "bg-transparent border-[1.5px] border-gray-200 text-gray-700 shadow-none hover:bg-gray-50" : e === "solid" ? b = m ? "bg-[#f2f2f2] text-black shadow-none border border-[#f2f2f2]" : "bg-[var(--fibo-primary)] text-[var(--fibo-on-primary)] shadow-none border-none hover:opacity-90" : e === "filled" || e === "primary" ? b = "bg-[var(--fibo-primary)] text-[var(--fibo-on-primary)] shadow-sm border-none hover:opacity-90 active:opacity-100" : e === "elevated" ? b = "bg-[var(--fibo-surface)] text-[var(--fibo-primary)] shadow-md border-none hover:shadow-lg" : e === "tonal" ? b = "bg-[var(--fibo-secondary-container)] text-[var(--fibo-on-secondary-container)] shadow-sm border-none" : e === "raw" && (b = "bg-transparent border-none shadow-none p-0 h-auto gap-0 text-inherit font-inherit hover:bg-transparent", S = ""), k === "soft" && e !== "raw" && (b += " shadow-[0_8px_20px_-6px_rgba(59,130,246,0.4)]");
|
|
36
|
+
const w = y || {}, I = w.padding !== void 0 || w.paddingTop !== void 0 || w.paddingBottom !== void 0 || w.paddingLeft !== void 0 || w.paddingRight !== void 0 || w.fontSize !== void 0 || w.height !== void 0, C = w.borderRadius !== void 0, z = w.fontWeight !== void 0 || o === "xs" || m, n = e === "raw" || x === "none" || m || o === "xs", u = L(
|
|
36
37
|
"fibo-button",
|
|
37
38
|
"inline-flex items-center justify-center whitespace-nowrap",
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
e === "raw" ||
|
|
42
|
-
e === "raw" ||
|
|
43
|
-
|
|
39
|
+
z ? "" : "font-semibold",
|
|
40
|
+
n ? "" : "active:scale-[0.96] transform transition-all duration-200 ease-out",
|
|
41
|
+
d ? "cursor-not-allowed opacity-60" : "cursor-pointer",
|
|
42
|
+
e === "raw" || I ? "" : g[o],
|
|
43
|
+
e === "raw" || C ? "" : S,
|
|
44
|
+
E ? "flex-1 w-full" : "",
|
|
44
45
|
`fibo-button-${e}`,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
),
|
|
48
|
-
return
|
|
46
|
+
b,
|
|
47
|
+
_
|
|
48
|
+
), A = [];
|
|
49
|
+
return h && A.push(h), l && A.push(l), c.children && (Array.isArray(c.children) ? A.push(...c.children) : A.push(c.children)), t.createElement(
|
|
49
50
|
"button",
|
|
50
51
|
{
|
|
51
|
-
className:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
className: u,
|
|
53
|
+
onMouseEnter: s ? () => {
|
|
54
|
+
d || s();
|
|
55
|
+
} : f.onMouseEnter,
|
|
56
|
+
onClick: (T) => {
|
|
57
|
+
d || (!n && document.documentElement.classList.contains("fibo-theme-material") && e !== "raw" && import("./effects-CnevV566.js").then(({ createRipple: i }) => {
|
|
58
|
+
i(T, T.currentTarget);
|
|
55
59
|
}), a == null || a());
|
|
56
60
|
},
|
|
57
|
-
disabled:
|
|
58
|
-
...
|
|
59
|
-
type:
|
|
60
|
-
style:
|
|
61
|
+
disabled: d,
|
|
62
|
+
...f,
|
|
63
|
+
type: f.type ?? "button",
|
|
64
|
+
style: w
|
|
61
65
|
},
|
|
62
|
-
...
|
|
66
|
+
...A
|
|
63
67
|
);
|
|
64
68
|
});
|
|
65
|
-
class
|
|
69
|
+
class V extends D {
|
|
66
70
|
constructor(e = "") {
|
|
67
71
|
super();
|
|
68
72
|
r(this, "_text", "");
|
|
69
73
|
r(this, "_variant", "elevated");
|
|
70
74
|
r(this, "_size", "md");
|
|
71
75
|
r(this, "_onPress");
|
|
76
|
+
r(this, "_onHover");
|
|
72
77
|
r(this, "_disabled", !1);
|
|
73
78
|
r(this, "_icon");
|
|
74
79
|
r(this, "_shape", "default");
|
|
@@ -93,6 +98,9 @@ class W extends D {
|
|
|
93
98
|
onPress(e) {
|
|
94
99
|
return this._onPress = e, this;
|
|
95
100
|
}
|
|
101
|
+
onHover(e) {
|
|
102
|
+
return this._onHover = e, this;
|
|
103
|
+
}
|
|
96
104
|
disabled(e = !0) {
|
|
97
105
|
return this._disabled = e, this;
|
|
98
106
|
}
|
|
@@ -120,6 +128,7 @@ class W extends D {
|
|
|
120
128
|
variant: this._variant,
|
|
121
129
|
size: this._size,
|
|
122
130
|
onPress: this._onPress,
|
|
131
|
+
onHover: this._onHover,
|
|
123
132
|
disabled: this._disabled,
|
|
124
133
|
icon: this._icon,
|
|
125
134
|
shape: this._shape,
|
|
@@ -132,85 +141,85 @@ class W extends D {
|
|
|
132
141
|
children: this.processChildren(),
|
|
133
142
|
...this._props
|
|
134
143
|
};
|
|
135
|
-
return t.createElement(
|
|
144
|
+
return t.createElement(q, a);
|
|
136
145
|
}
|
|
137
146
|
}
|
|
138
|
-
const de = $(
|
|
147
|
+
const de = $(V), W = (c, l) => {
|
|
139
148
|
let e = 0;
|
|
140
|
-
const
|
|
149
|
+
const o = c.replace(/\D/g, "").split("");
|
|
141
150
|
let a = "";
|
|
142
|
-
for (let s = 0; s <
|
|
143
|
-
|
|
151
|
+
for (let s = 0; s < l.length && !(e >= o.length); s++)
|
|
152
|
+
l[s] === "9" ? a += o[e++] : a += l[s];
|
|
144
153
|
return a;
|
|
145
|
-
}, K = t.memo((
|
|
146
|
-
const
|
|
154
|
+
}, K = t.memo((c) => {
|
|
155
|
+
const l = t.useId(), e = c.id || l, [o, a] = t.useState(!1), {
|
|
147
156
|
containerClass: s,
|
|
148
157
|
containerStyle: d,
|
|
149
|
-
label:
|
|
150
|
-
error:
|
|
151
|
-
mask:
|
|
152
|
-
type:
|
|
153
|
-
value:
|
|
154
|
-
onChange:
|
|
155
|
-
leadingIcon:
|
|
156
|
-
trailingIcon:
|
|
157
|
-
...
|
|
158
|
-
} =
|
|
159
|
-
|
|
160
|
-
if (
|
|
161
|
-
return
|
|
162
|
-
|
|
158
|
+
label: h,
|
|
159
|
+
error: p,
|
|
160
|
+
mask: k,
|
|
161
|
+
type: v,
|
|
162
|
+
value: x,
|
|
163
|
+
onChange: E,
|
|
164
|
+
leadingIcon: _,
|
|
165
|
+
trailingIcon: y,
|
|
166
|
+
...f
|
|
167
|
+
} = c, g = x instanceof P, [S, m] = F(g ? x.value : x);
|
|
168
|
+
M(() => {
|
|
169
|
+
if (g)
|
|
170
|
+
return x.subscribe((u) => {
|
|
171
|
+
m(u);
|
|
163
172
|
});
|
|
164
|
-
|
|
165
|
-
}, [
|
|
166
|
-
const b =
|
|
167
|
-
let
|
|
168
|
-
if (
|
|
169
|
-
|
|
170
|
-
const
|
|
173
|
+
m(x);
|
|
174
|
+
}, [x, g]);
|
|
175
|
+
const b = v === "password", w = b && o ? "text" : v, I = (n) => {
|
|
176
|
+
let u = n.target.value;
|
|
177
|
+
if (k) {
|
|
178
|
+
u = W(u, k);
|
|
179
|
+
const A = {
|
|
171
180
|
...n,
|
|
172
181
|
target: {
|
|
173
182
|
...n.target,
|
|
174
|
-
value:
|
|
183
|
+
value: u
|
|
175
184
|
}
|
|
176
185
|
};
|
|
177
|
-
|
|
186
|
+
g && (x.value = u), E == null || E(A);
|
|
178
187
|
} else
|
|
179
|
-
|
|
180
|
-
},
|
|
188
|
+
g && (x.value = u), E == null || E(n);
|
|
189
|
+
}, C = _ ? "2.75rem" : "1rem", z = y || b ? "2.75rem" : "1rem";
|
|
181
190
|
return t.createElement(
|
|
182
191
|
"div",
|
|
183
192
|
{ className: s, style: d },
|
|
184
193
|
t.createElement("div", { className: "relative w-full h-full flex items-center" }, [
|
|
185
|
-
|
|
194
|
+
_ && t.createElement(
|
|
186
195
|
"div",
|
|
187
196
|
{
|
|
188
197
|
key: "leading-icon",
|
|
189
198
|
className: "absolute left-3 top-1/2 transform -translate-y-1/2 flex items-center justify-center pointer-events-none z-10"
|
|
190
199
|
},
|
|
191
|
-
|
|
200
|
+
_
|
|
192
201
|
),
|
|
193
202
|
t.createElement("input", {
|
|
194
203
|
key: "input",
|
|
195
204
|
id: e,
|
|
196
205
|
className: "fibo-textfield-input w-full h-full bg-transparent outline-none py-2.5 text-sm",
|
|
197
|
-
style: { paddingLeft:
|
|
198
|
-
type:
|
|
199
|
-
onChange:
|
|
200
|
-
value:
|
|
201
|
-
...
|
|
206
|
+
style: { paddingLeft: C, paddingRight: z },
|
|
207
|
+
type: w,
|
|
208
|
+
onChange: I,
|
|
209
|
+
value: S,
|
|
210
|
+
...f
|
|
202
211
|
}),
|
|
203
|
-
|
|
212
|
+
h && t.createElement(
|
|
204
213
|
"label",
|
|
205
214
|
{
|
|
206
215
|
key: "label",
|
|
207
216
|
htmlFor: e,
|
|
208
217
|
className: "fibo-textfield-label",
|
|
209
|
-
style: { left:
|
|
218
|
+
style: { left: _ ? "2.75rem" : "1rem" }
|
|
210
219
|
},
|
|
211
|
-
|
|
220
|
+
h
|
|
212
221
|
),
|
|
213
|
-
(
|
|
222
|
+
(y || b) && t.createElement(
|
|
214
223
|
"div",
|
|
215
224
|
{
|
|
216
225
|
key: "trailing-icon",
|
|
@@ -221,10 +230,10 @@ const de = $(W), H = (o, i) => {
|
|
|
221
230
|
{
|
|
222
231
|
type: "button",
|
|
223
232
|
className: "text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
224
|
-
onClick: () => a(!
|
|
233
|
+
onClick: () => a(!o),
|
|
225
234
|
tabIndex: -1
|
|
226
235
|
},
|
|
227
|
-
|
|
236
|
+
o ? t.createElement(
|
|
228
237
|
"svg",
|
|
229
238
|
{ width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" },
|
|
230
239
|
t.createElement("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
|
|
@@ -235,13 +244,13 @@ const de = $(W), H = (o, i) => {
|
|
|
235
244
|
t.createElement("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
236
245
|
t.createElement("circle", { cx: 12, cy: 12, r: 3 })
|
|
237
246
|
)
|
|
238
|
-
) :
|
|
247
|
+
) : y
|
|
239
248
|
)
|
|
240
249
|
]),
|
|
241
|
-
|
|
250
|
+
p && t.createElement(
|
|
242
251
|
"span",
|
|
243
252
|
{ className: "text-[var(--fibo-error)] text-xs mt-1 ml-1" },
|
|
244
|
-
|
|
253
|
+
p
|
|
245
254
|
)
|
|
246
255
|
);
|
|
247
256
|
});
|
|
@@ -298,7 +307,7 @@ class G extends D {
|
|
|
298
307
|
let e = "fibo-textfield-container w-full h-14 relative";
|
|
299
308
|
this._variant === "outlined" ? e += " border border-[var(--fibo-outline)] rounded-[4px] bg-transparent" : e += " bg-[var(--fibo-surface-variant)] rounded-t-[4px] border-b border-[var(--fibo-outline)]";
|
|
300
309
|
const a = {
|
|
301
|
-
containerClass:
|
|
310
|
+
containerClass: L(e, ...this._classNames),
|
|
302
311
|
containerStyle: this.getStyle(),
|
|
303
312
|
label: this._label,
|
|
304
313
|
error: this._error,
|
|
@@ -318,50 +327,50 @@ class G extends D {
|
|
|
318
327
|
return t.createElement(K, a);
|
|
319
328
|
}
|
|
320
329
|
}
|
|
321
|
-
const he = $(G), U = t.memo((
|
|
330
|
+
const he = $(G), U = t.memo((c) => {
|
|
322
331
|
const {
|
|
323
|
-
checked:
|
|
332
|
+
checked: l,
|
|
324
333
|
onChange: e,
|
|
325
|
-
label:
|
|
334
|
+
label: o,
|
|
326
335
|
disabled: a,
|
|
327
336
|
className: s,
|
|
328
337
|
style: d,
|
|
329
|
-
id:
|
|
330
|
-
} =
|
|
338
|
+
id: h
|
|
339
|
+
} = c, p = L(
|
|
331
340
|
"fibo-switch-track w-[44px] h-[24px] rounded-full relative transition-colors duration-200 ease-in-out",
|
|
332
341
|
a ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
333
|
-
|
|
334
|
-
),
|
|
342
|
+
l ? "bg-[var(--fibo-primary,#3B82F6)]" : "bg-gray-200"
|
|
343
|
+
), k = L(
|
|
335
344
|
"absolute w-5 h-5 rounded-full bg-white top-[2px] left-[2px] transition-transform duration-200 ease-in-out shadow-sm",
|
|
336
|
-
|
|
345
|
+
l ? "translate-x-[20px]" : "translate-x-0"
|
|
337
346
|
);
|
|
338
347
|
return t.createElement(
|
|
339
348
|
"label",
|
|
340
349
|
{
|
|
341
|
-
className:
|
|
350
|
+
className: L("fibo-switch flex items-center gap-3", s)
|
|
342
351
|
},
|
|
343
352
|
t.createElement(
|
|
344
353
|
"div",
|
|
345
354
|
{
|
|
346
|
-
className:
|
|
355
|
+
className: p,
|
|
347
356
|
style: d,
|
|
348
357
|
"aria-hidden": !0
|
|
349
358
|
},
|
|
350
|
-
t.createElement("div", { className:
|
|
359
|
+
t.createElement("div", { className: k })
|
|
351
360
|
),
|
|
352
|
-
|
|
361
|
+
o && t.createElement(
|
|
353
362
|
"span",
|
|
354
363
|
{ className: "text-sm font-medium text-gray-700 select-none" },
|
|
355
|
-
|
|
364
|
+
o
|
|
356
365
|
),
|
|
357
366
|
t.createElement("input", {
|
|
358
|
-
id:
|
|
367
|
+
id: h,
|
|
359
368
|
type: "checkbox",
|
|
360
369
|
role: "switch",
|
|
361
|
-
checked: !!
|
|
370
|
+
checked: !!l,
|
|
362
371
|
disabled: a,
|
|
363
372
|
className: "sr-only",
|
|
364
|
-
onChange: (
|
|
373
|
+
onChange: (v) => !a && (e == null ? void 0 : e(v.target.checked))
|
|
365
374
|
})
|
|
366
375
|
);
|
|
367
376
|
});
|
|
@@ -398,22 +407,22 @@ class J extends D {
|
|
|
398
407
|
return t.createElement(U, e);
|
|
399
408
|
}
|
|
400
409
|
}
|
|
401
|
-
const ue = $(J), Q = t.memo((
|
|
410
|
+
const ue = $(J), Q = t.memo((c) => {
|
|
402
411
|
const {
|
|
403
|
-
checked:
|
|
412
|
+
checked: l,
|
|
404
413
|
onChange: e,
|
|
405
|
-
label:
|
|
414
|
+
label: o,
|
|
406
415
|
disabled: a,
|
|
407
416
|
indeterminate: s,
|
|
408
417
|
className: d,
|
|
409
|
-
style:
|
|
410
|
-
id:
|
|
411
|
-
} =
|
|
412
|
-
|
|
413
|
-
|
|
418
|
+
style: h,
|
|
419
|
+
id: p
|
|
420
|
+
} = c, k = j(null), v = l || s;
|
|
421
|
+
M(() => {
|
|
422
|
+
k.current && (k.current.indeterminate = !!s);
|
|
414
423
|
}, [s]);
|
|
415
|
-
let
|
|
416
|
-
return s ?
|
|
424
|
+
let x = null;
|
|
425
|
+
return s ? x = t.createElement("div", { className: "w-[10px] h-[2px] bg-white rounded-[1px]" }) : l && (x = t.createElement(
|
|
417
426
|
"svg",
|
|
418
427
|
{
|
|
419
428
|
width: "12",
|
|
@@ -433,34 +442,34 @@ const ue = $(J), Q = t.memo((o) => {
|
|
|
433
442
|
)), t.createElement(
|
|
434
443
|
"label",
|
|
435
444
|
{
|
|
436
|
-
className:
|
|
445
|
+
className: L("fibo-checkbox flex items-center gap-2", d)
|
|
437
446
|
},
|
|
438
447
|
t.createElement(
|
|
439
448
|
"div",
|
|
440
449
|
{
|
|
441
|
-
className:
|
|
450
|
+
className: L(
|
|
442
451
|
"fibo-checkbox-box w-5 h-5 rounded-[6px] border-2 flex items-center justify-center transition-all duration-200",
|
|
443
452
|
a ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
444
|
-
|
|
453
|
+
v ? "border-transparent bg-[var(--fibo-primary,#3B82F6)]" : "border-gray-300 bg-transparent"
|
|
445
454
|
),
|
|
446
|
-
style:
|
|
455
|
+
style: h,
|
|
447
456
|
"aria-hidden": !0
|
|
448
457
|
},
|
|
449
|
-
|
|
458
|
+
x
|
|
450
459
|
),
|
|
451
|
-
|
|
460
|
+
o && t.createElement(
|
|
452
461
|
"span",
|
|
453
462
|
{ className: "text-sm text-gray-700 select-none" },
|
|
454
|
-
|
|
463
|
+
o
|
|
455
464
|
),
|
|
456
465
|
t.createElement("input", {
|
|
457
|
-
ref:
|
|
458
|
-
id:
|
|
466
|
+
ref: k,
|
|
467
|
+
id: p,
|
|
459
468
|
type: "checkbox",
|
|
460
|
-
checked: !!
|
|
469
|
+
checked: !!l,
|
|
461
470
|
disabled: a,
|
|
462
471
|
className: "sr-only",
|
|
463
|
-
onChange: (
|
|
472
|
+
onChange: (E) => !a && (e == null ? void 0 : e(E.target.checked))
|
|
464
473
|
})
|
|
465
474
|
);
|
|
466
475
|
});
|
|
@@ -502,54 +511,54 @@ class X extends D {
|
|
|
502
511
|
return t.createElement(Q, e);
|
|
503
512
|
}
|
|
504
513
|
}
|
|
505
|
-
const pe = $(X), Y = t.memo((
|
|
514
|
+
const pe = $(X), Y = t.memo((c) => {
|
|
506
515
|
const {
|
|
507
|
-
value:
|
|
516
|
+
value: l,
|
|
508
517
|
options: e = [],
|
|
509
|
-
onChange:
|
|
518
|
+
onChange: o,
|
|
510
519
|
name: a,
|
|
511
520
|
direction: s,
|
|
512
521
|
className: d,
|
|
513
|
-
style:
|
|
514
|
-
} =
|
|
522
|
+
style: h
|
|
523
|
+
} = c, p = t.useId(), k = a || p;
|
|
515
524
|
return t.createElement(
|
|
516
525
|
"div",
|
|
517
526
|
{
|
|
518
527
|
role: "radiogroup",
|
|
519
|
-
className:
|
|
520
|
-
style:
|
|
528
|
+
className: L(`fibo-radio-group flex ${s === "vertical" ? "flex-col gap-2" : "flex-row gap-4"}`, d),
|
|
529
|
+
style: h
|
|
521
530
|
},
|
|
522
|
-
e.map((
|
|
523
|
-
const
|
|
531
|
+
e.map((v) => {
|
|
532
|
+
const x = l === v.value, E = v.disabled, _ = L(
|
|
524
533
|
"relative flex items-center justify-center w-[18px] h-[18px] rounded-full transition-all duration-200",
|
|
525
|
-
|
|
534
|
+
x ? "border-[5px] border-[var(--fibo-primary,#3B82F6)]" : "border-2 border-gray-300"
|
|
526
535
|
);
|
|
527
536
|
return t.createElement(
|
|
528
537
|
"label",
|
|
529
538
|
{
|
|
530
|
-
key:
|
|
531
|
-
className: `flex items-center gap-2 cursor-pointer ${
|
|
539
|
+
key: v.value,
|
|
540
|
+
className: `flex items-center gap-2 cursor-pointer ${E ? "opacity-50 cursor-not-allowed" : ""}`
|
|
532
541
|
},
|
|
533
542
|
t.createElement(
|
|
534
543
|
"div",
|
|
535
544
|
{
|
|
536
|
-
className:
|
|
545
|
+
className: _,
|
|
537
546
|
"aria-hidden": !0
|
|
538
547
|
},
|
|
539
548
|
t.createElement("input", {
|
|
540
549
|
type: "radio",
|
|
541
|
-
name:
|
|
542
|
-
value:
|
|
543
|
-
checked:
|
|
544
|
-
disabled:
|
|
550
|
+
name: k,
|
|
551
|
+
value: v.value,
|
|
552
|
+
checked: x,
|
|
553
|
+
disabled: E,
|
|
545
554
|
className: "sr-only",
|
|
546
|
-
onChange: () => !
|
|
555
|
+
onChange: () => !E && (o == null ? void 0 : o(v.value))
|
|
547
556
|
})
|
|
548
557
|
),
|
|
549
558
|
t.createElement(
|
|
550
559
|
"span",
|
|
551
560
|
{ className: "text-sm text-gray-700" },
|
|
552
|
-
|
|
561
|
+
v.label
|
|
553
562
|
)
|
|
554
563
|
);
|
|
555
564
|
})
|
|
@@ -592,21 +601,21 @@ class Z extends D {
|
|
|
592
601
|
return t.createElement(Y, e);
|
|
593
602
|
}
|
|
594
603
|
}
|
|
595
|
-
const me = $(Z), ee = t.memo((
|
|
596
|
-
const
|
|
597
|
-
containerClass:
|
|
604
|
+
const me = $(Z), ee = t.memo((c) => {
|
|
605
|
+
const l = t.useId(), e = c.id || l, {
|
|
606
|
+
containerClass: o,
|
|
598
607
|
containerStyle: a,
|
|
599
608
|
label: s,
|
|
600
609
|
error: d,
|
|
601
|
-
...
|
|
602
|
-
} =
|
|
610
|
+
...h
|
|
611
|
+
} = c;
|
|
603
612
|
return t.createElement(
|
|
604
613
|
"div",
|
|
605
|
-
{ className:
|
|
614
|
+
{ className: o, style: a },
|
|
606
615
|
t.createElement("textarea", {
|
|
607
616
|
id: e,
|
|
608
617
|
className: "fibo-textarea-input w-full p-4 text-base bg-transparent outline-none relative z-10",
|
|
609
|
-
...
|
|
618
|
+
...h
|
|
610
619
|
}),
|
|
611
620
|
s && t.createElement(
|
|
612
621
|
"label",
|
|
@@ -660,8 +669,8 @@ class te extends D {
|
|
|
660
669
|
return this._onChange = e, this;
|
|
661
670
|
}
|
|
662
671
|
build() {
|
|
663
|
-
const
|
|
664
|
-
containerClass:
|
|
672
|
+
const o = {
|
|
673
|
+
containerClass: L("fibo-textarea-container w-full", ...this._classNames),
|
|
665
674
|
containerStyle: this.getStyle(),
|
|
666
675
|
label: this._label,
|
|
667
676
|
error: this._error,
|
|
@@ -676,63 +685,63 @@ class te extends D {
|
|
|
676
685
|
},
|
|
677
686
|
...this._props
|
|
678
687
|
};
|
|
679
|
-
return t.createElement(ee,
|
|
688
|
+
return t.createElement(ee, o);
|
|
680
689
|
}
|
|
681
690
|
}
|
|
682
|
-
const be = $(te), re = t.memo((
|
|
683
|
-
const
|
|
684
|
-
containerClass:
|
|
685
|
-
containerStyle:
|
|
686
|
-
label:
|
|
687
|
-
error:
|
|
688
|
-
value:
|
|
689
|
-
options:
|
|
690
|
-
placeholder:
|
|
691
|
-
onChange:
|
|
692
|
-
disabled:
|
|
693
|
-
multiple:
|
|
694
|
-
} =
|
|
695
|
-
|
|
696
|
-
const n = (
|
|
697
|
-
|
|
691
|
+
const be = $(te), re = t.memo((c) => {
|
|
692
|
+
const l = t.useId(), e = c.id || l, o = `${e}-listbox`, [a, s] = F(!1), [d, h] = F(0), p = j(null), {
|
|
693
|
+
containerClass: k,
|
|
694
|
+
containerStyle: v,
|
|
695
|
+
label: x,
|
|
696
|
+
error: E,
|
|
697
|
+
value: _,
|
|
698
|
+
options: y = [],
|
|
699
|
+
placeholder: f,
|
|
700
|
+
onChange: g,
|
|
701
|
+
disabled: S,
|
|
702
|
+
multiple: m
|
|
703
|
+
} = c;
|
|
704
|
+
M(() => {
|
|
705
|
+
const n = (u) => {
|
|
706
|
+
p.current && !p.current.contains(u.target) && s(!1);
|
|
698
707
|
};
|
|
699
708
|
return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
|
|
700
709
|
}, []);
|
|
701
|
-
const b = (n) =>
|
|
702
|
-
let
|
|
703
|
-
if (
|
|
704
|
-
Array.isArray(
|
|
710
|
+
const b = (n) => m ? Array.isArray(_) && _.includes(n) : _ === n;
|
|
711
|
+
let w = "";
|
|
712
|
+
if (m)
|
|
713
|
+
Array.isArray(_) && _.length > 0 && (w = y.filter((n) => _.includes(n.value)).map((n) => n.label).join(", "));
|
|
705
714
|
else {
|
|
706
|
-
const n =
|
|
707
|
-
|
|
708
|
-
}
|
|
709
|
-
const
|
|
710
|
-
if (!
|
|
711
|
-
if (
|
|
712
|
-
const
|
|
713
|
-
|
|
715
|
+
const n = y.find((u) => u.value === _);
|
|
716
|
+
w = n ? n.label : "";
|
|
717
|
+
}
|
|
718
|
+
const I = (n) => {
|
|
719
|
+
if (!S)
|
|
720
|
+
if (m) {
|
|
721
|
+
const u = Array.isArray(_) ? [..._] : [], A = u.indexOf(n);
|
|
722
|
+
A > -1 ? u.splice(A, 1) : u.push(n), g == null || g(u);
|
|
714
723
|
} else
|
|
715
|
-
|
|
716
|
-
},
|
|
717
|
-
|
|
724
|
+
g == null || g(n), s(!1);
|
|
725
|
+
}, C = (n) => {
|
|
726
|
+
y.length !== 0 && h((u) => (u + n + y.length) % y.length);
|
|
718
727
|
}, z = (n) => {
|
|
719
|
-
if (!
|
|
728
|
+
if (!S)
|
|
720
729
|
switch (n.key) {
|
|
721
730
|
case "ArrowDown":
|
|
722
|
-
n.preventDefault(), a ?
|
|
731
|
+
n.preventDefault(), a ? C(1) : s(!0);
|
|
723
732
|
break;
|
|
724
733
|
case "ArrowUp":
|
|
725
|
-
n.preventDefault(), a ?
|
|
734
|
+
n.preventDefault(), a ? C(-1) : s(!0);
|
|
726
735
|
break;
|
|
727
736
|
case "Home":
|
|
728
|
-
n.preventDefault(),
|
|
737
|
+
n.preventDefault(), h(0);
|
|
729
738
|
break;
|
|
730
739
|
case "End":
|
|
731
|
-
n.preventDefault(),
|
|
740
|
+
n.preventDefault(), h(Math.max(0, y.length - 1));
|
|
732
741
|
break;
|
|
733
742
|
case "Enter":
|
|
734
743
|
case " ":
|
|
735
|
-
n.preventDefault(), a ?
|
|
744
|
+
n.preventDefault(), a ? y[d] && I(y[d].value) : s(!0);
|
|
736
745
|
break;
|
|
737
746
|
case "Escape":
|
|
738
747
|
n.preventDefault(), s(!1);
|
|
@@ -742,9 +751,9 @@ const be = $(te), re = t.memo((o) => {
|
|
|
742
751
|
return t.createElement(
|
|
743
752
|
"div",
|
|
744
753
|
{
|
|
745
|
-
ref:
|
|
746
|
-
className:
|
|
747
|
-
style:
|
|
754
|
+
ref: p,
|
|
755
|
+
className: k,
|
|
756
|
+
style: v
|
|
748
757
|
},
|
|
749
758
|
t.createElement("div", { className: "relative w-full h-full" }, [
|
|
750
759
|
t.createElement("button", {
|
|
@@ -754,14 +763,14 @@ const be = $(te), re = t.memo((o) => {
|
|
|
754
763
|
role: "combobox",
|
|
755
764
|
"aria-expanded": a,
|
|
756
765
|
"aria-haspopup": "listbox",
|
|
757
|
-
"aria-controls":
|
|
758
|
-
"aria-activedescendant": a &&
|
|
759
|
-
disabled:
|
|
760
|
-
className: `fibo-textfield-input text-left w-full flex items-center justify-between ${
|
|
761
|
-
onClick: () => !
|
|
766
|
+
"aria-controls": o,
|
|
767
|
+
"aria-activedescendant": a && y[d] ? `${o}-opt-${y[d].value}` : void 0,
|
|
768
|
+
disabled: S,
|
|
769
|
+
className: `fibo-textfield-input text-left w-full flex items-center justify-between ${w ? "" : "text-gray-400"}`,
|
|
770
|
+
onClick: () => !S && s(!a),
|
|
762
771
|
onKeyDown: z
|
|
763
772
|
}, [
|
|
764
|
-
t.createElement("span", { key: "text", className: "truncate" },
|
|
773
|
+
t.createElement("span", { key: "text", className: "truncate" }, w || f || " "),
|
|
765
774
|
t.createElement("svg", {
|
|
766
775
|
key: "icon",
|
|
767
776
|
className: `w-4 h-4 transition-transform ${a ? "rotate-180" : ""}`,
|
|
@@ -771,34 +780,34 @@ const be = $(te), re = t.memo((o) => {
|
|
|
771
780
|
"aria-hidden": !0
|
|
772
781
|
}, t.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }))
|
|
773
782
|
]),
|
|
774
|
-
|
|
783
|
+
x && t.createElement(
|
|
775
784
|
"label",
|
|
776
785
|
{
|
|
777
786
|
key: "label",
|
|
778
787
|
htmlFor: e,
|
|
779
788
|
className: "fibo-textfield-label"
|
|
780
789
|
},
|
|
781
|
-
|
|
790
|
+
x
|
|
782
791
|
),
|
|
783
792
|
a && t.createElement("div", {
|
|
784
793
|
key: "dropdown",
|
|
785
|
-
id:
|
|
794
|
+
id: o,
|
|
786
795
|
role: "listbox",
|
|
787
|
-
"aria-multiselectable":
|
|
796
|
+
"aria-multiselectable": m || void 0,
|
|
788
797
|
className: "absolute z-50 w-full mt-1 bg-[var(--fibo-surface)] border border-[var(--fibo-outline)] rounded-md shadow-lg max-h-60 overflow-auto focus:outline-none"
|
|
789
|
-
},
|
|
790
|
-
const
|
|
798
|
+
}, y.map((n, u) => {
|
|
799
|
+
const A = b(n.value), T = u === d;
|
|
791
800
|
return t.createElement("div", {
|
|
792
801
|
key: n.value,
|
|
793
|
-
id: `${
|
|
802
|
+
id: `${o}-opt-${n.value}`,
|
|
794
803
|
role: "option",
|
|
795
|
-
"aria-selected":
|
|
796
|
-
className: `px-4 py-2 cursor-pointer text-sm hover:bg-[var(--fibo-primary-container)] hover:text-[var(--fibo-on-primary-container)] flex items-center justify-between ${
|
|
797
|
-
onClick: () =>
|
|
798
|
-
onMouseEnter: () => u
|
|
804
|
+
"aria-selected": A,
|
|
805
|
+
className: `px-4 py-2 cursor-pointer text-sm hover:bg-[var(--fibo-primary-container)] hover:text-[var(--fibo-on-primary-container)] flex items-center justify-between ${A || T ? "bg-[var(--fibo-primary-container)] text-[var(--fibo-on-primary-container)] font-medium" : "text-[var(--fibo-on-surface)]"}`,
|
|
806
|
+
onClick: () => I(n.value),
|
|
807
|
+
onMouseEnter: () => h(u)
|
|
799
808
|
}, [
|
|
800
809
|
t.createElement("span", { key: "label" }, n.label),
|
|
801
|
-
|
|
810
|
+
A && t.createElement("svg", {
|
|
802
811
|
key: "check",
|
|
803
812
|
className: "w-4 h-4 text-[var(--fibo-primary)]",
|
|
804
813
|
viewBox: "0 0 20 20",
|
|
@@ -808,10 +817,10 @@ const be = $(te), re = t.memo((o) => {
|
|
|
808
817
|
]);
|
|
809
818
|
}))
|
|
810
819
|
]),
|
|
811
|
-
|
|
820
|
+
E && t.createElement(
|
|
812
821
|
"span",
|
|
813
822
|
{ className: "text-[var(--fibo-error)] text-xs mt-1 ml-1", role: "alert" },
|
|
814
|
-
|
|
823
|
+
E
|
|
815
824
|
)
|
|
816
825
|
);
|
|
817
826
|
});
|
|
@@ -852,8 +861,8 @@ class ae extends D {
|
|
|
852
861
|
return this._onChange = e, this;
|
|
853
862
|
}
|
|
854
863
|
build() {
|
|
855
|
-
const
|
|
856
|
-
containerClass:
|
|
864
|
+
const o = {
|
|
865
|
+
containerClass: L("fibo-textfield-container relative", ...this._classNames),
|
|
857
866
|
containerStyle: this.getStyle(),
|
|
858
867
|
label: this._label,
|
|
859
868
|
error: this._error,
|
|
@@ -865,82 +874,82 @@ class ae extends D {
|
|
|
865
874
|
onChange: this._onChange,
|
|
866
875
|
...this._props
|
|
867
876
|
};
|
|
868
|
-
return t.createElement(re,
|
|
877
|
+
return t.createElement(re, o);
|
|
869
878
|
}
|
|
870
879
|
}
|
|
871
|
-
const fe = $(ae), se = t.memo((
|
|
872
|
-
const
|
|
873
|
-
containerClass:
|
|
874
|
-
containerStyle:
|
|
875
|
-
label:
|
|
876
|
-
error:
|
|
877
|
-
value:
|
|
878
|
-
options:
|
|
879
|
-
placeholder:
|
|
880
|
-
onChange:
|
|
880
|
+
const fe = $(ae), se = t.memo((c) => {
|
|
881
|
+
const l = t.useId(), e = c.id || l, o = `${e}-listbox`, [a, s] = F(!1), [d, h] = F(""), [p, k] = F(0), v = j(null), {
|
|
882
|
+
containerClass: x,
|
|
883
|
+
containerStyle: E,
|
|
884
|
+
label: _,
|
|
885
|
+
error: y,
|
|
886
|
+
value: f,
|
|
887
|
+
options: g = [],
|
|
888
|
+
placeholder: S,
|
|
889
|
+
onChange: m,
|
|
881
890
|
onAdd: b,
|
|
882
|
-
disabled:
|
|
883
|
-
multiple:
|
|
884
|
-
} =
|
|
885
|
-
|
|
886
|
-
if (!
|
|
887
|
-
const
|
|
888
|
-
|
|
891
|
+
disabled: w,
|
|
892
|
+
multiple: I
|
|
893
|
+
} = c;
|
|
894
|
+
M(() => {
|
|
895
|
+
if (!I) {
|
|
896
|
+
const i = g.find((N) => N.value === f);
|
|
897
|
+
i && !a && d !== i.label && h(i.label);
|
|
889
898
|
}
|
|
890
|
-
}, [
|
|
891
|
-
const
|
|
892
|
-
(
|
|
899
|
+
}, [f, g, a, I]);
|
|
900
|
+
const C = g.filter(
|
|
901
|
+
(i) => i.label.toLowerCase().includes(d.toLowerCase())
|
|
893
902
|
);
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
}, [d, a]),
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
if (s(!1),
|
|
900
|
-
|
|
903
|
+
M(() => {
|
|
904
|
+
k(0);
|
|
905
|
+
}, [d, a]), M(() => {
|
|
906
|
+
const i = (N) => {
|
|
907
|
+
if (v.current && !v.current.contains(N.target))
|
|
908
|
+
if (s(!1), I)
|
|
909
|
+
h("");
|
|
901
910
|
else {
|
|
902
|
-
const
|
|
903
|
-
|
|
911
|
+
const B = g.find((R) => R.value === f);
|
|
912
|
+
h(B ? B.label : "");
|
|
904
913
|
}
|
|
905
914
|
};
|
|
906
|
-
return document.addEventListener("mousedown",
|
|
907
|
-
}, [
|
|
908
|
-
const z = (
|
|
909
|
-
if (
|
|
910
|
-
const
|
|
911
|
-
|
|
915
|
+
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
916
|
+
}, [f, g, I]);
|
|
917
|
+
const z = (i) => {
|
|
918
|
+
if (I) {
|
|
919
|
+
const N = Array.isArray(f) ? [...f] : [];
|
|
920
|
+
N.includes(i.value) || (N.push(i.value), m == null || m(N)), h("");
|
|
912
921
|
} else
|
|
913
|
-
|
|
914
|
-
}, n = (
|
|
915
|
-
if (
|
|
916
|
-
const
|
|
917
|
-
|
|
922
|
+
h(i.label), m == null || m(i.value), s(!1);
|
|
923
|
+
}, n = (i) => {
|
|
924
|
+
if (I && Array.isArray(f)) {
|
|
925
|
+
const N = f.filter((B) => B !== i);
|
|
926
|
+
m == null || m(N);
|
|
918
927
|
}
|
|
919
|
-
},
|
|
920
|
-
b == null || b(d),
|
|
921
|
-
},
|
|
922
|
-
if (!
|
|
923
|
-
switch (
|
|
928
|
+
}, u = () => {
|
|
929
|
+
b == null || b(d), I ? h("") : s(!1);
|
|
930
|
+
}, A = (i) => I ? Array.isArray(f) && f.includes(i) : f === i, T = (i) => {
|
|
931
|
+
if (!w)
|
|
932
|
+
switch (i.key) {
|
|
924
933
|
case "ArrowDown":
|
|
925
|
-
|
|
934
|
+
i.preventDefault(), a ? C.length && k((N) => (N + 1) % C.length) : s(!0);
|
|
926
935
|
break;
|
|
927
936
|
case "ArrowUp":
|
|
928
|
-
|
|
937
|
+
i.preventDefault(), a ? C.length && k((N) => (N - 1 + C.length) % C.length) : s(!0);
|
|
929
938
|
break;
|
|
930
939
|
case "Enter":
|
|
931
|
-
|
|
940
|
+
i.preventDefault(), C[p] ? z(C[p]) : d && b && u();
|
|
932
941
|
break;
|
|
933
942
|
case "Escape":
|
|
934
|
-
|
|
943
|
+
i.preventDefault(), s(!1);
|
|
935
944
|
break;
|
|
936
945
|
}
|
|
937
946
|
};
|
|
938
947
|
return t.createElement(
|
|
939
948
|
"div",
|
|
940
949
|
{
|
|
941
|
-
ref:
|
|
942
|
-
className:
|
|
943
|
-
style:
|
|
950
|
+
ref: v,
|
|
951
|
+
className: x,
|
|
952
|
+
style: E
|
|
944
953
|
},
|
|
945
954
|
t.createElement("div", { className: "relative w-full h-full" }, [
|
|
946
955
|
t.createElement("div", {
|
|
@@ -948,19 +957,19 @@ const fe = $(ae), se = t.memo((o) => {
|
|
|
948
957
|
className: `fibo-textfield-input flex flex-wrap items-center gap-1 ${a ? "ring-2 ring-[var(--fibo-primary-container)] border-[var(--fibo-primary)]" : ""}`,
|
|
949
958
|
style: { minHeight: "42px", padding: "4px 8px" }
|
|
950
959
|
}, [
|
|
951
|
-
|
|
952
|
-
const
|
|
960
|
+
I && Array.isArray(f) && f.map((i) => {
|
|
961
|
+
const N = g.find((R) => R.value === i), B = N ? N.label : i;
|
|
953
962
|
return t.createElement("span", {
|
|
954
|
-
key:
|
|
963
|
+
key: i,
|
|
955
964
|
className: "bg-[var(--fibo-primary-container)] text-[var(--fibo-on-primary-container)] text-xs font-medium px-2 py-1 rounded-md flex items-center"
|
|
956
965
|
}, [
|
|
957
|
-
|
|
966
|
+
B,
|
|
958
967
|
t.createElement("button", {
|
|
959
968
|
type: "button",
|
|
960
969
|
className: "ml-1 hover:text-[var(--fibo-primary)] focus:outline-none",
|
|
961
|
-
"aria-label": `Remove ${
|
|
970
|
+
"aria-label": `Remove ${B}`,
|
|
962
971
|
onClick: (R) => {
|
|
963
|
-
R.stopPropagation(), n(
|
|
972
|
+
R.stopPropagation(), n(i);
|
|
964
973
|
}
|
|
965
974
|
}, "×")
|
|
966
975
|
]);
|
|
@@ -970,64 +979,64 @@ const fe = $(ae), se = t.memo((o) => {
|
|
|
970
979
|
id: e,
|
|
971
980
|
role: "combobox",
|
|
972
981
|
"aria-expanded": a,
|
|
973
|
-
"aria-controls":
|
|
982
|
+
"aria-controls": o,
|
|
974
983
|
"aria-autocomplete": "list",
|
|
975
|
-
"aria-activedescendant": a &&
|
|
984
|
+
"aria-activedescendant": a && C[p] ? `${o}-opt-${C[p].value}` : void 0,
|
|
976
985
|
className: "bg-transparent outline-none flex-1 min-w-[60px] text-sm h-8",
|
|
977
986
|
value: d,
|
|
978
|
-
placeholder:
|
|
979
|
-
disabled:
|
|
980
|
-
onChange: (
|
|
981
|
-
|
|
987
|
+
placeholder: I && Array.isArray(f) && f.length > 0 ? "" : S || " ",
|
|
988
|
+
disabled: w,
|
|
989
|
+
onChange: (i) => {
|
|
990
|
+
h(i.target.value), a || s(!0);
|
|
982
991
|
},
|
|
983
992
|
onFocus: () => s(!0),
|
|
984
|
-
onKeyDown:
|
|
993
|
+
onKeyDown: T
|
|
985
994
|
})
|
|
986
995
|
]),
|
|
987
|
-
|
|
996
|
+
_ && t.createElement(
|
|
988
997
|
"label",
|
|
989
998
|
{
|
|
990
999
|
key: "label",
|
|
991
1000
|
htmlFor: e,
|
|
992
1001
|
className: "fibo-textfield-label"
|
|
993
1002
|
},
|
|
994
|
-
|
|
1003
|
+
_
|
|
995
1004
|
),
|
|
996
1005
|
a && t.createElement("div", {
|
|
997
1006
|
key: "dropdown",
|
|
998
|
-
id:
|
|
1007
|
+
id: o,
|
|
999
1008
|
role: "listbox",
|
|
1000
|
-
"aria-multiselectable":
|
|
1009
|
+
"aria-multiselectable": I || void 0,
|
|
1001
1010
|
className: "absolute z-50 w-full mt-1 bg-[var(--fibo-surface)] border border-[var(--fibo-outline)] rounded-md shadow-lg max-h-60 overflow-auto focus:outline-none left-0"
|
|
1002
1011
|
}, [
|
|
1003
|
-
...
|
|
1004
|
-
const
|
|
1012
|
+
...C.length > 0 ? C.map((i, N) => {
|
|
1013
|
+
const B = A(i.value), R = N === p;
|
|
1005
1014
|
return t.createElement("div", {
|
|
1006
|
-
key:
|
|
1007
|
-
id: `${
|
|
1015
|
+
key: i.value,
|
|
1016
|
+
id: `${o}-opt-${i.value}`,
|
|
1008
1017
|
role: "option",
|
|
1009
|
-
"aria-selected":
|
|
1010
|
-
className: `px-4 py-2 cursor-pointer text-sm hover:bg-[var(--fibo-primary-container)] hover:text-[var(--fibo-on-primary-container)] ${
|
|
1011
|
-
onClick: () => !
|
|
1012
|
-
onMouseEnter: () =>
|
|
1013
|
-
},
|
|
1018
|
+
"aria-selected": B,
|
|
1019
|
+
className: `px-4 py-2 cursor-pointer text-sm hover:bg-[var(--fibo-primary-container)] hover:text-[var(--fibo-on-primary-container)] ${B || R ? "bg-[var(--fibo-primary-container)] text-[var(--fibo-on-primary-container)] font-medium" : "text-[var(--fibo-on-surface)]"} ${B ? "opacity-50" : ""}`,
|
|
1020
|
+
onClick: () => !B && z(i),
|
|
1021
|
+
onMouseEnter: () => k(N)
|
|
1022
|
+
}, i.label);
|
|
1014
1023
|
}) : [t.createElement("div", { key: "empty", className: "px-4 py-2 text-sm text-gray-500" }, "No results found.")],
|
|
1015
|
-
d && !
|
|
1024
|
+
d && !C.some((i) => i.label.toLowerCase() === d.toLowerCase()) && b ? t.createElement("div", {
|
|
1016
1025
|
key: "add-new",
|
|
1017
1026
|
role: "option",
|
|
1018
1027
|
"aria-selected": !1,
|
|
1019
1028
|
className: "border-t border-[var(--fibo-outline)] px-4 py-2 cursor-pointer text-sm text-[var(--fibo-primary)] hover:bg-[var(--fibo-primary-container)] font-medium flex items-center",
|
|
1020
|
-
onClick:
|
|
1029
|
+
onClick: u
|
|
1021
1030
|
}, [
|
|
1022
1031
|
t.createElement("span", { key: "plus", className: "mr-1" }, "+"),
|
|
1023
1032
|
`Add "${d}"`
|
|
1024
1033
|
]) : null
|
|
1025
1034
|
])
|
|
1026
1035
|
]),
|
|
1027
|
-
|
|
1036
|
+
y && t.createElement(
|
|
1028
1037
|
"span",
|
|
1029
1038
|
{ className: "text-[var(--fibo-error)] text-xs mt-1 ml-1", role: "alert" },
|
|
1030
|
-
|
|
1039
|
+
y
|
|
1031
1040
|
)
|
|
1032
1041
|
);
|
|
1033
1042
|
});
|
|
@@ -1072,8 +1081,8 @@ class ne extends D {
|
|
|
1072
1081
|
return this._onAdd = e, this;
|
|
1073
1082
|
}
|
|
1074
1083
|
build() {
|
|
1075
|
-
const
|
|
1076
|
-
containerClass:
|
|
1084
|
+
const o = {
|
|
1085
|
+
containerClass: L("fibo-textfield-container relative", ...this._classNames),
|
|
1077
1086
|
containerStyle: this.getStyle(),
|
|
1078
1087
|
label: this._label,
|
|
1079
1088
|
error: this._error,
|
|
@@ -1086,7 +1095,7 @@ class ne extends D {
|
|
|
1086
1095
|
onAdd: this._onAdd,
|
|
1087
1096
|
...this._props
|
|
1088
1097
|
};
|
|
1089
|
-
return t.createElement(se,
|
|
1098
|
+
return t.createElement(se, o);
|
|
1090
1099
|
}
|
|
1091
1100
|
}
|
|
1092
1101
|
const xe = $(ne);
|