@telegraph/combobox 0.0.8 → 0.0.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/CHANGELOG.md +19 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +69 -61
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/esm/index.mjs
CHANGED
|
@@ -4,12 +4,12 @@ import * as be from "@radix-ui/react-visually-hidden";
|
|
|
4
4
|
import { Icon as K, Lucide as j } from "@telegraph/icon";
|
|
5
5
|
import * as he from "react";
|
|
6
6
|
import p from "react";
|
|
7
|
-
import { Text as
|
|
8
|
-
import { useComposedRefs as
|
|
7
|
+
import { Text as D } from "@telegraph/typography";
|
|
8
|
+
import { useComposedRefs as M } from "@telegraph/compose-refs";
|
|
9
9
|
import { RefToTgphRef as ye } from "@telegraph/helpers";
|
|
10
10
|
import { Input as fe } from "@telegraph/input";
|
|
11
|
-
import { Menu as
|
|
12
|
-
import { Tag as
|
|
11
|
+
import { Menu as B } from "@telegraph/menu";
|
|
12
|
+
import { Tag as N } from "@telegraph/tag";
|
|
13
13
|
import { motion as E, AnimatePresence as F } from "framer-motion";
|
|
14
14
|
function re(o) {
|
|
15
15
|
var t, e, a = "";
|
|
@@ -20,7 +20,7 @@ function re(o) {
|
|
|
20
20
|
} else for (e in o) o[e] && (a && (a += " "), a += e);
|
|
21
21
|
return a;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function I() {
|
|
24
24
|
for (var o, t, e = 0, a = "", i = arguments.length; e < i; e++) (o = arguments[e]) && (t = re(o)) && (a && (a += " "), a += t);
|
|
25
25
|
return a;
|
|
26
26
|
}
|
|
@@ -66,7 +66,7 @@ const O = ["sm", "md", "lg", "xl", "2xl"], we = (o) => {
|
|
|
66
66
|
return o.toString();
|
|
67
67
|
const e = t.type === "color" ? "" : `-${t.type}`;
|
|
68
68
|
return o === !0 ? `var(--tgph${e}-${t.default})` : `var(--tgph${e}-${o})`;
|
|
69
|
-
},
|
|
69
|
+
}, $ = {
|
|
70
70
|
top: 0,
|
|
71
71
|
right: 1,
|
|
72
72
|
bottom: 2,
|
|
@@ -115,19 +115,19 @@ const O = ["sm", "md", "lg", "xl", "2xl"], we = (o) => {
|
|
|
115
115
|
})), (a === "topLeft" || a === "topRight" || a === "bottomRight" || a === "bottomLeft") && (n[k[a]] = f({
|
|
116
116
|
value: t,
|
|
117
117
|
prop: e
|
|
118
|
-
}))) : (a === "x" && (n[
|
|
118
|
+
}))) : (a === "x" && (n[$.left] = f({
|
|
119
119
|
value: t,
|
|
120
120
|
prop: e
|
|
121
|
-
}), n[
|
|
121
|
+
}), n[$.right] = f({
|
|
122
122
|
value: t,
|
|
123
123
|
prop: e
|
|
124
|
-
})), a === "y" && (n[
|
|
124
|
+
})), a === "y" && (n[$.top] = f({
|
|
125
125
|
value: t,
|
|
126
126
|
prop: e
|
|
127
|
-
}), n[
|
|
127
|
+
}), n[$.bottom] = f({
|
|
128
128
|
value: t,
|
|
129
129
|
prop: e
|
|
130
|
-
})), (a === "top" || a === "bottom" || a === "left" || a === "right") && (n[
|
|
130
|
+
})), (a === "top" || a === "bottom" || a === "left" || a === "right") && (n[$[a]] = f({
|
|
131
131
|
value: t,
|
|
132
132
|
prop: e
|
|
133
133
|
}))), n.join(" "));
|
|
@@ -370,6 +370,10 @@ const O = ["sm", "md", "lg", "xl", "2xl"], we = (o) => {
|
|
|
370
370
|
shadow: {
|
|
371
371
|
rule: "box-shadow",
|
|
372
372
|
type: "shadow"
|
|
373
|
+
},
|
|
374
|
+
zIndex: {
|
|
375
|
+
rule: "z-index",
|
|
376
|
+
type: "zIndex"
|
|
373
377
|
}
|
|
374
378
|
}, ke = ({
|
|
375
379
|
as: o,
|
|
@@ -393,7 +397,7 @@ const O = ["sm", "md", "lg", "xl", "2xl"], we = (o) => {
|
|
|
393
397
|
}, [l.box]), /* @__PURE__ */ u(
|
|
394
398
|
i,
|
|
395
399
|
{
|
|
396
|
-
className:
|
|
400
|
+
className: I("tgph-box", t),
|
|
397
401
|
ref: n,
|
|
398
402
|
...l.rest
|
|
399
403
|
}
|
|
@@ -450,7 +454,7 @@ const O = ["sm", "md", "lg", "xl", "2xl"], we = (o) => {
|
|
|
450
454
|
}, [r.stack, i]), /* @__PURE__ */ u(
|
|
451
455
|
ke,
|
|
452
456
|
{
|
|
453
|
-
className:
|
|
457
|
+
className: I("tgph-stack", o),
|
|
454
458
|
tgphRef: i,
|
|
455
459
|
...r.rest
|
|
456
460
|
}
|
|
@@ -586,7 +590,7 @@ const O = ["sm", "md", "lg", "xl", "2xl"], we = (o) => {
|
|
|
586
590
|
disabled: "disabled"
|
|
587
591
|
},
|
|
588
592
|
ghost: {
|
|
589
|
-
gray: "
|
|
593
|
+
gray: "default",
|
|
590
594
|
red: "red",
|
|
591
595
|
accent: "accent",
|
|
592
596
|
green: "green",
|
|
@@ -633,7 +637,7 @@ const O = ["sm", "md", "lg", "xl", "2xl"], we = (o) => {
|
|
|
633
637
|
},
|
|
634
638
|
ghost: {
|
|
635
639
|
accent: "accent",
|
|
636
|
-
gray: "
|
|
640
|
+
gray: "gray",
|
|
637
641
|
red: "red",
|
|
638
642
|
green: "green",
|
|
639
643
|
blue: "blue",
|
|
@@ -680,7 +684,7 @@ const O = ["sm", "md", "lg", "xl", "2xl"], we = (o) => {
|
|
|
680
684
|
Ce,
|
|
681
685
|
{
|
|
682
686
|
as: o || "button",
|
|
683
|
-
className:
|
|
687
|
+
className: I(
|
|
684
688
|
"appearance-none border-0 cursor-pointer bg-none box-border [font-family:inherit]",
|
|
685
689
|
"transition-colors no-underline",
|
|
686
690
|
d === "disabled" && "cursor-not-allowed",
|
|
@@ -739,13 +743,13 @@ const O = ["sm", "md", "lg", "xl", "2xl"], we = (o) => {
|
|
|
739
743
|
}) => {
|
|
740
744
|
const n = p.useContext(Y);
|
|
741
745
|
return /* @__PURE__ */ u(
|
|
742
|
-
|
|
746
|
+
D,
|
|
743
747
|
{
|
|
744
748
|
as: o || "span",
|
|
745
749
|
color: t ?? Se[n.variant][n.color],
|
|
746
750
|
size: e ?? Te[n.size],
|
|
747
751
|
weight: a,
|
|
748
|
-
className:
|
|
752
|
+
className: I("no-underline whitespace-nowrap", i),
|
|
749
753
|
internal_optionalAs: !0,
|
|
750
754
|
"data-button-text": !0,
|
|
751
755
|
...r
|
|
@@ -770,7 +774,7 @@ Object.assign(le, {
|
|
|
770
774
|
Icon: H,
|
|
771
775
|
Text: ie
|
|
772
776
|
});
|
|
773
|
-
const
|
|
777
|
+
const z = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
774
778
|
const t = [];
|
|
775
779
|
let e = null;
|
|
776
780
|
for (let a = 0; a < _.length; a++) {
|
|
@@ -794,7 +798,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
794
798
|
}
|
|
795
799
|
}
|
|
796
800
|
return t;
|
|
797
|
-
},
|
|
801
|
+
}, Ie = (o) => typeof o == "object" && (o.sm || o.md || o.lg || o.xl || o["2xl"]), m = ({
|
|
798
802
|
value: o,
|
|
799
803
|
prop: t
|
|
800
804
|
}) => {
|
|
@@ -813,7 +817,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
813
817
|
topRight: 1,
|
|
814
818
|
bottomRight: 2,
|
|
815
819
|
bottomLeft: 3
|
|
816
|
-
},
|
|
820
|
+
}, $e = ({
|
|
817
821
|
cssVariables: o,
|
|
818
822
|
value: t,
|
|
819
823
|
prop: e,
|
|
@@ -872,7 +876,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
872
876
|
prop: o,
|
|
873
877
|
value: t,
|
|
874
878
|
cssVariables: e
|
|
875
|
-
}) => o.direction ?
|
|
879
|
+
}) => o.direction ? $e({
|
|
876
880
|
cssVariables: e,
|
|
877
881
|
prop: o,
|
|
878
882
|
value: t,
|
|
@@ -892,7 +896,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
892
896
|
key: i,
|
|
893
897
|
value: r,
|
|
894
898
|
cssVariables: a
|
|
895
|
-
}) :
|
|
899
|
+
}) : Ie(r) && je(r).forEach((l, c) => {
|
|
896
900
|
l && (a[`--tgph-${n.rule}-${_[c]}`] = Z({
|
|
897
901
|
prop: n,
|
|
898
902
|
key: i,
|
|
@@ -1107,6 +1111,10 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1107
1111
|
shadow: {
|
|
1108
1112
|
rule: "box-shadow",
|
|
1109
1113
|
type: "shadow"
|
|
1114
|
+
},
|
|
1115
|
+
zIndex: {
|
|
1116
|
+
rule: "z-index",
|
|
1117
|
+
type: "zIndex"
|
|
1110
1118
|
}
|
|
1111
1119
|
}, X = ({
|
|
1112
1120
|
as: o,
|
|
@@ -1114,7 +1122,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1114
1122
|
tgphRef: e,
|
|
1115
1123
|
...a
|
|
1116
1124
|
}) => {
|
|
1117
|
-
const i = o || "div", r = p.useRef(null), n =
|
|
1125
|
+
const i = o || "div", r = p.useRef(null), n = M(e, r), l = p.useMemo(() => {
|
|
1118
1126
|
const c = { borderColor: !0, ...a };
|
|
1119
1127
|
return Object.keys(c).reduce(
|
|
1120
1128
|
(d, s) => (Object.keys(ee).some((b) => b === s) ? d.box[s] = c[s] : d.rest[s] = c[s], d),
|
|
@@ -1130,7 +1138,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1130
1138
|
}, [l.box]), /* @__PURE__ */ u(
|
|
1131
1139
|
i,
|
|
1132
1140
|
{
|
|
1133
|
-
className:
|
|
1141
|
+
className: I("tgph-box", t),
|
|
1134
1142
|
ref: n,
|
|
1135
1143
|
...l.rest
|
|
1136
1144
|
}
|
|
@@ -1171,7 +1179,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1171
1179
|
tgphRef: t,
|
|
1172
1180
|
...e
|
|
1173
1181
|
}) => {
|
|
1174
|
-
const a = p.useRef(null), i =
|
|
1182
|
+
const a = p.useRef(null), i = M(t, a), r = p.useMemo(
|
|
1175
1183
|
() => Object.keys(e).reduce(
|
|
1176
1184
|
(n, l) => (Object.keys(te).some((c) => c === l) ? n.stack[l] = e[l] : n.rest[l] = e[l], n),
|
|
1177
1185
|
{ stack: {}, rest: {} }
|
|
@@ -1187,7 +1195,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1187
1195
|
}, [r.stack, i]), /* @__PURE__ */ u(
|
|
1188
1196
|
X,
|
|
1189
1197
|
{
|
|
1190
|
-
className:
|
|
1198
|
+
className: I("tgph-stack", o),
|
|
1191
1199
|
tgphRef: i,
|
|
1192
1200
|
...r.rest
|
|
1193
1201
|
}
|
|
@@ -1215,13 +1223,13 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1215
1223
|
layout: d,
|
|
1216
1224
|
...s
|
|
1217
1225
|
}) => {
|
|
1218
|
-
const b = p.useId(), y = p.useId(), g = p.useRef(null), h = p.useRef(null), v = p.useRef(null), [w, L] = p.useState(""), [R = !1,
|
|
1226
|
+
const b = p.useId(), y = p.useId(), g = p.useRef(null), h = p.useRef(null), v = p.useRef(null), [w, L] = p.useState(""), [R = !1, P] = ge({
|
|
1219
1227
|
prop: e,
|
|
1220
1228
|
defaultProp: i,
|
|
1221
1229
|
onChange: a
|
|
1222
1230
|
}), se = p.useCallback(() => {
|
|
1223
|
-
|
|
1224
|
-
}, [
|
|
1231
|
+
P((de) => !de);
|
|
1232
|
+
}, [P]);
|
|
1225
1233
|
return p.useEffect(() => {
|
|
1226
1234
|
R || L("");
|
|
1227
1235
|
}, [R]), /* @__PURE__ */ u(
|
|
@@ -1234,7 +1242,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1234
1242
|
onValueChange: n,
|
|
1235
1243
|
placeholder: c,
|
|
1236
1244
|
open: R,
|
|
1237
|
-
setOpen:
|
|
1245
|
+
setOpen: P,
|
|
1238
1246
|
onOpenToggle: se,
|
|
1239
1247
|
closeOnSelect: t,
|
|
1240
1248
|
searchQuery: w,
|
|
@@ -1246,20 +1254,20 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1246
1254
|
layout: d
|
|
1247
1255
|
},
|
|
1248
1256
|
children: /* @__PURE__ */ u(
|
|
1249
|
-
|
|
1257
|
+
B.Root,
|
|
1250
1258
|
{
|
|
1251
1259
|
open: R,
|
|
1252
|
-
onOpenChange:
|
|
1260
|
+
onOpenChange: P,
|
|
1253
1261
|
modal: o,
|
|
1254
1262
|
...s
|
|
1255
1263
|
}
|
|
1256
1264
|
)
|
|
1257
1265
|
}
|
|
1258
1266
|
);
|
|
1259
|
-
},
|
|
1267
|
+
}, ze = ({ label: o, value: t, ...e }) => {
|
|
1260
1268
|
const a = p.useContext(x);
|
|
1261
1269
|
return /* @__PURE__ */ S(
|
|
1262
|
-
|
|
1270
|
+
N.Root,
|
|
1263
1271
|
{
|
|
1264
1272
|
size: "1",
|
|
1265
1273
|
as: E.span,
|
|
@@ -1279,9 +1287,9 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1279
1287
|
},
|
|
1280
1288
|
...e,
|
|
1281
1289
|
children: [
|
|
1282
|
-
/* @__PURE__ */ u(
|
|
1290
|
+
/* @__PURE__ */ u(N.Text, { children: o || t }),
|
|
1283
1291
|
/* @__PURE__ */ u(
|
|
1284
|
-
|
|
1292
|
+
N.Button,
|
|
1285
1293
|
{
|
|
1286
1294
|
icon: { icon: j.X, alt: `Remove ${t}` },
|
|
1287
1295
|
onClick: (i) => {
|
|
@@ -1293,14 +1301,14 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1293
1301
|
]
|
|
1294
1302
|
}
|
|
1295
1303
|
);
|
|
1296
|
-
},
|
|
1304
|
+
}, Pe = ({
|
|
1297
1305
|
size: o = "1"
|
|
1298
1306
|
}) => {
|
|
1299
1307
|
var a, i;
|
|
1300
1308
|
const t = p.useContext(x), e = o === "1" ? "6" : o === "2" ? "8" : "10";
|
|
1301
1309
|
if (t.value && Q(t.value)) {
|
|
1302
1310
|
const r = t.value, n = t.layout || "truncate", l = r.length - 2, c = l.toString().split("");
|
|
1303
|
-
return r.length === 0 ? /* @__PURE__ */ u(T, { h: e, align: "center", my: "1", children: /* @__PURE__ */ u(
|
|
1311
|
+
return r.length === 0 ? /* @__PURE__ */ u(T, { h: e, align: "center", my: "1", children: /* @__PURE__ */ u(z.Text, { color: "gray", children: t.placeholder }) }) : /* @__PURE__ */ S(
|
|
1304
1312
|
T,
|
|
1305
1313
|
{
|
|
1306
1314
|
gap: "1",
|
|
@@ -1315,7 +1323,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1315
1323
|
children: [
|
|
1316
1324
|
/* @__PURE__ */ u(F, { initial: !1, mode: "popLayout", children: r.map((d, s) => {
|
|
1317
1325
|
if (n === "truncate" && s <= 1 || n === "wrap")
|
|
1318
|
-
return /* @__PURE__ */ u(ye, { children: /* @__PURE__ */ u(
|
|
1326
|
+
return /* @__PURE__ */ u(ye, { children: /* @__PURE__ */ u(ze, { ...d }) }, d.value);
|
|
1319
1327
|
}) }),
|
|
1320
1328
|
/* @__PURE__ */ u(F, { children: n === "truncate" && r.length > 2 && /* @__PURE__ */ u(
|
|
1321
1329
|
T,
|
|
@@ -1335,7 +1343,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1335
1343
|
right: 0,
|
|
1336
1344
|
backgroundImage: "linear-gradient(to left, var(--tgph-surface-1) 0 60%, transparent 90% 100%)"
|
|
1337
1345
|
},
|
|
1338
|
-
children: /* @__PURE__ */ S(
|
|
1346
|
+
children: /* @__PURE__ */ S(D, { as: "span", size: "1", style: { whiteSpace: "nowrap" }, children: [
|
|
1339
1347
|
"+",
|
|
1340
1348
|
/* @__PURE__ */ u(F, { mode: "wait", initial: !1, children: c.map((d) => /* @__PURE__ */ u(
|
|
1341
1349
|
X,
|
|
@@ -1367,14 +1375,14 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1367
1375
|
}
|
|
1368
1376
|
);
|
|
1369
1377
|
}
|
|
1370
|
-
return /* @__PURE__ */ u(T, { h: e, align: "center", my: "1", children: /* @__PURE__ */ u(
|
|
1371
|
-
},
|
|
1378
|
+
return /* @__PURE__ */ u(T, { h: e, align: "center", my: "1", children: /* @__PURE__ */ u(z.Text, { color: t.value ? "default" : "gray", children: ((a = t == null ? void 0 : t.value) == null ? void 0 : a.label) || ((i = t == null ? void 0 : t.value) == null ? void 0 : i.value) || t.placeholder }) });
|
|
1379
|
+
}, De = ({ size: o = "1", ...t }) => {
|
|
1372
1380
|
const e = p.useContext(x), a = p.useCallback(() => {
|
|
1373
1381
|
var i, r, n;
|
|
1374
1382
|
return e.value ? q(e.value) ? ((i = e.value) == null ? void 0 : i.label) || ((r = e.value) == null ? void 0 : r.value) || e.placeholder : ((n = e.value) == null ? void 0 : n.map((l) => l.label).join(", ")) || e.placeholder : e.placeholder;
|
|
1375
1383
|
}, [e.value, e.placeholder]);
|
|
1376
1384
|
return /* @__PURE__ */ u(
|
|
1377
|
-
|
|
1385
|
+
B.Trigger,
|
|
1378
1386
|
{
|
|
1379
1387
|
...t,
|
|
1380
1388
|
asChild: !0,
|
|
@@ -1398,7 +1406,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1398
1406
|
},
|
|
1399
1407
|
tgphRef: e.triggerRef,
|
|
1400
1408
|
children: /* @__PURE__ */ S(
|
|
1401
|
-
|
|
1409
|
+
z.Root,
|
|
1402
1410
|
{
|
|
1403
1411
|
id: e.triggerId,
|
|
1404
1412
|
bg: "surface-1",
|
|
@@ -1415,9 +1423,9 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1415
1423
|
"data-tgph-combobox-trigger": !0,
|
|
1416
1424
|
"data-tgph-comobox-trigger-open": e.open,
|
|
1417
1425
|
children: [
|
|
1418
|
-
/* @__PURE__ */ u(
|
|
1426
|
+
/* @__PURE__ */ u(Pe, { size: o }),
|
|
1419
1427
|
/* @__PURE__ */ u(
|
|
1420
|
-
|
|
1428
|
+
z.Icon,
|
|
1421
1429
|
{
|
|
1422
1430
|
as: E.div,
|
|
1423
1431
|
icon: j.ChevronDown,
|
|
@@ -1431,13 +1439,13 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1431
1439
|
)
|
|
1432
1440
|
}
|
|
1433
1441
|
);
|
|
1434
|
-
},
|
|
1442
|
+
}, Me = ({
|
|
1435
1443
|
tgphRef: o,
|
|
1436
1444
|
style: t,
|
|
1437
1445
|
children: e,
|
|
1438
1446
|
...a
|
|
1439
1447
|
}) => {
|
|
1440
|
-
const i = p.useContext(x), r = p.useRef(!1), n =
|
|
1448
|
+
const i = p.useContext(x), r = p.useRef(!1), n = M(o, i.contentRef), l = p.useRef(null), [c, d] = p.useState(0), [s, b] = p.useState(!1), y = p.useCallback(
|
|
1441
1449
|
(g) => {
|
|
1442
1450
|
const h = g.getBoundingClientRect();
|
|
1443
1451
|
h && d(h.height), s || b(!0);
|
|
@@ -1455,7 +1463,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1455
1463
|
}, [s, y]), p.useEffect(() => {
|
|
1456
1464
|
s === !0 && i.open === !1 && b(!1);
|
|
1457
1465
|
}, [i.open, s]), /* @__PURE__ */ u(
|
|
1458
|
-
|
|
1466
|
+
B.Content,
|
|
1459
1467
|
{
|
|
1460
1468
|
as: E.div,
|
|
1461
1469
|
mt: "1",
|
|
@@ -1512,7 +1520,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1512
1520
|
children: /* @__PURE__ */ u(T, { direction: "column", gap: "1", tgphRef: l, children: e })
|
|
1513
1521
|
}
|
|
1514
1522
|
);
|
|
1515
|
-
},
|
|
1523
|
+
}, Be = ({ ...o }) => {
|
|
1516
1524
|
const t = p.useContext(x);
|
|
1517
1525
|
return /* @__PURE__ */ u(
|
|
1518
1526
|
T,
|
|
@@ -1554,7 +1562,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1554
1562
|
};
|
|
1555
1563
|
if (d)
|
|
1556
1564
|
return /* @__PURE__ */ u(
|
|
1557
|
-
|
|
1565
|
+
B.Button,
|
|
1558
1566
|
{
|
|
1559
1567
|
type: "button",
|
|
1560
1568
|
onSelect: b,
|
|
@@ -1572,14 +1580,14 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1572
1580
|
children: t || o
|
|
1573
1581
|
}
|
|
1574
1582
|
);
|
|
1575
|
-
},
|
|
1583
|
+
}, Ne = ({
|
|
1576
1584
|
label: o = "Search",
|
|
1577
1585
|
placeholder: t = "Search",
|
|
1578
1586
|
tgphRef: e,
|
|
1579
1587
|
...a
|
|
1580
1588
|
}) => {
|
|
1581
1589
|
var l;
|
|
1582
|
-
const i = p.useId(), r = p.useContext(x), n =
|
|
1590
|
+
const i = p.useId(), r = p.useContext(x), n = M(e, r.searchRef);
|
|
1583
1591
|
return p.useEffect(() => {
|
|
1584
1592
|
var s;
|
|
1585
1593
|
const c = (b) => {
|
|
@@ -1591,7 +1599,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1591
1599
|
d.removeEventListener("keydown", c);
|
|
1592
1600
|
};
|
|
1593
1601
|
}, [r]), /* @__PURE__ */ S(X, { borderBottom: !0, px: "1", pb: "1", children: [
|
|
1594
|
-
/* @__PURE__ */ u(be.Root, { children: /* @__PURE__ */ u(
|
|
1602
|
+
/* @__PURE__ */ u(be.Root, { children: /* @__PURE__ */ u(D, { as: "label", htmlFor: i, children: o }) }),
|
|
1595
1603
|
/* @__PURE__ */ u(
|
|
1596
1604
|
fe,
|
|
1597
1605
|
{
|
|
@@ -1605,7 +1613,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1605
1613
|
},
|
|
1606
1614
|
LeadingComponent: /* @__PURE__ */ u(K, { icon: j.Search, alt: "Search Icon" }),
|
|
1607
1615
|
TrailingComponent: r != null && r.searchQuery && ((l = r == null ? void 0 : r.searchQuery) == null ? void 0 : l.length) > 0 ? /* @__PURE__ */ u(
|
|
1608
|
-
|
|
1616
|
+
z,
|
|
1609
1617
|
{
|
|
1610
1618
|
as: E.button,
|
|
1611
1619
|
initial: { opacity: 0 },
|
|
@@ -1658,7 +1666,7 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1658
1666
|
...a,
|
|
1659
1667
|
children: [
|
|
1660
1668
|
o === null ? /* @__PURE__ */ u(W, {}) : /* @__PURE__ */ u(K, { ...o }),
|
|
1661
|
-
t === null ? /* @__PURE__ */ u(W, {}) : /* @__PURE__ */ u(
|
|
1669
|
+
t === null ? /* @__PURE__ */ u(W, {}) : /* @__PURE__ */ u(D, { as: "span", children: t })
|
|
1662
1670
|
]
|
|
1663
1671
|
}
|
|
1664
1672
|
);
|
|
@@ -1692,11 +1700,11 @@ const D = le, _ = ["sm", "md", "lg", "xl", "2xl"], je = (o) => {
|
|
|
1692
1700
|
}, Ke = {};
|
|
1693
1701
|
Object.assign(Ke, {
|
|
1694
1702
|
Root: Qe,
|
|
1695
|
-
Trigger:
|
|
1696
|
-
Content:
|
|
1697
|
-
Options:
|
|
1703
|
+
Trigger: De,
|
|
1704
|
+
Content: Me,
|
|
1705
|
+
Options: Be,
|
|
1698
1706
|
Option: ue,
|
|
1699
|
-
Search:
|
|
1707
|
+
Search: Ne,
|
|
1700
1708
|
Empty: Fe,
|
|
1701
1709
|
Create: He
|
|
1702
1710
|
});
|