@hoardodile/ui 0.1.3 → 0.1.4

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.
@@ -0,0 +1,713 @@
1
+ import { clsx } from 'clsx';
2
+ import { extendTailwindMerge } from 'tailwind-merge';
3
+ import { forwardRef, cloneElement, useId } from 'react';
4
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
5
+
6
+ // src/lib/utils.ts
7
+ var mergeTheme = {
8
+ text: ["tiny", "ui", "doc", "doc-title", "doc-heading", "quote"],
9
+ spacing: ["chip", "control", "nav", "sidebar", "panel"],
10
+ tracking: ["label"],
11
+ shadow: ["card", "dialog"],
12
+ container: ["reading", "medium", "content"],
13
+ font: ["doc", "heading"],
14
+ ease: ["standard"],
15
+ animate: ["skel", "pop"]
16
+ };
17
+ var twMerge = extendTailwindMerge({
18
+ extend: { theme: mergeTheme }
19
+ });
20
+
21
+ // src/lib/utils.ts
22
+ function cn(...inputs) {
23
+ return twMerge(clsx(inputs));
24
+ }
25
+ function GoldSurface({
26
+ id,
27
+ active
28
+ }) {
29
+ const gradientId = `${id}-gold-gradient`;
30
+ return /* @__PURE__ */ jsxs(
31
+ "svg",
32
+ {
33
+ className: cn(
34
+ "size-full",
35
+ !active && "[filter:brightness(1.1)] group-hover:[filter:brightness(1.16)]"
36
+ ),
37
+ width: "100%",
38
+ height: "100%",
39
+ viewBox: "0 0 100 100",
40
+ preserveAspectRatio: "none",
41
+ children: [
42
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
43
+ "linearGradient",
44
+ {
45
+ id: gradientId,
46
+ x1: "0%",
47
+ y1: "0%",
48
+ x2: "100%",
49
+ y2: "0%",
50
+ gradientTransform: "rotate(30, 0.5, 0.5)",
51
+ children: [
52
+ /* @__PURE__ */ jsx("stop", { offset: "10%", stopColor: "#daa520" }),
53
+ /* @__PURE__ */ jsx("stop", { offset: "30%", stopColor: "#ffd700" }),
54
+ /* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: "#f0e68c" }),
55
+ /* @__PURE__ */ jsx("stop", { offset: "70%", stopColor: "#ffd700" }),
56
+ /* @__PURE__ */ jsx("stop", { offset: "90%", stopColor: "#daa520" })
57
+ ]
58
+ }
59
+ ) }),
60
+ /* @__PURE__ */ jsx(
61
+ "rect",
62
+ {
63
+ width: "100",
64
+ height: "100",
65
+ fill: active ? "#8a6d1f" : `url(#${gradientId})`
66
+ }
67
+ ),
68
+ !active && /* @__PURE__ */ jsx(
69
+ "rect",
70
+ {
71
+ x: "0",
72
+ y: "0",
73
+ width: "100",
74
+ height: "8",
75
+ fill: "#ffffff",
76
+ opacity: "0.12"
77
+ }
78
+ )
79
+ ]
80
+ }
81
+ );
82
+ }
83
+ var goldConfig = {
84
+ render: GoldSurface,
85
+ default: {
86
+ style: {
87
+ color: "#725603",
88
+ boxShadow: "inset 0 0 0 1px rgba(114, 86, 3, 0.2)"
89
+ }
90
+ },
91
+ active: {
92
+ style: {
93
+ color: "#ffffff"
94
+ }
95
+ }
96
+ };
97
+ function KintsugiSurface({
98
+ id,
99
+ active
100
+ }) {
101
+ if (active) {
102
+ return /* @__PURE__ */ jsx(
103
+ "svg",
104
+ {
105
+ className: cn(
106
+ "size-full",
107
+ !active && "[filter:brightness(1.02)] group-hover:[filter:brightness(1.06)]"
108
+ ),
109
+ width: "100%",
110
+ height: "100%",
111
+ viewBox: "0 0 100 100",
112
+ preserveAspectRatio: "none",
113
+ children: /* @__PURE__ */ jsx("rect", { width: "100", height: "100", fill: "#9a9a8a" })
114
+ }
115
+ );
116
+ }
117
+ const goldGradientId = `${id}-kintsugi-gold`;
118
+ return /* @__PURE__ */ jsxs(
119
+ "svg",
120
+ {
121
+ className: cn(
122
+ "size-full",
123
+ !active && "[filter:brightness(1.02)] group-hover:[filter:brightness(1.06)]"
124
+ ),
125
+ width: "100%",
126
+ height: "100%",
127
+ viewBox: "0 0 100 100",
128
+ preserveAspectRatio: "none",
129
+ children: [
130
+ /* @__PURE__ */ jsx("style", { children: `
131
+ @keyframes ${id}-gold-shimmer {
132
+ 0% { stroke-dashoffset: 60; }
133
+ 100% { stroke-dashoffset: 0; }
134
+ }
135
+ .${id}-gold-vein {
136
+ stroke-dasharray: 30 30;
137
+ animation: ${id}-gold-shimmer 5s linear infinite;
138
+ }
139
+ @media (prefers-reduced-motion: reduce) {
140
+ .${id}-gold-vein {
141
+ animation: none;
142
+ }
143
+ }
144
+ ` }),
145
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: goldGradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
146
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#b8860b" }),
147
+ /* @__PURE__ */ jsx("stop", { offset: "35%", stopColor: "#ffd700" }),
148
+ /* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: "#fffacd" }),
149
+ /* @__PURE__ */ jsx("stop", { offset: "65%", stopColor: "#ffd700" }),
150
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#b8860b" })
151
+ ] }) }),
152
+ /* @__PURE__ */ jsx("rect", { width: "100", height: "100", fill: "#d8d4c5" }),
153
+ /* @__PURE__ */ jsx("rect", { width: "100", height: "100", fill: "#b8c4b8", opacity: "0.35" }),
154
+ /* @__PURE__ */ jsx("ellipse", { cx: "30", cy: "25", rx: "40", ry: "25", fill: "#ffffff", opacity: "0.08" }),
155
+ /* @__PURE__ */ jsx("ellipse", { cx: "75", cy: "70", rx: "35", ry: "28", fill: "#000000", opacity: "0.04" }),
156
+ /* @__PURE__ */ jsx(
157
+ "path",
158
+ {
159
+ d: "M 5 20 Q 25 22 35 45 T 60 80",
160
+ fill: "none",
161
+ stroke: "#5a5650",
162
+ strokeWidth: "0.7",
163
+ opacity: "0.45"
164
+ }
165
+ ),
166
+ /* @__PURE__ */ jsx(
167
+ "path",
168
+ {
169
+ d: "M 80 10 Q 70 35 85 55 T 55 95",
170
+ fill: "none",
171
+ stroke: "#5a5650",
172
+ strokeWidth: "0.6",
173
+ opacity: "0.40"
174
+ }
175
+ ),
176
+ /* @__PURE__ */ jsx(
177
+ "path",
178
+ {
179
+ d: "M 10 70 Q 30 68 45 55 T 75 45",
180
+ fill: "none",
181
+ stroke: "#5a5650",
182
+ strokeWidth: "0.5",
183
+ opacity: "0.38"
184
+ }
185
+ ),
186
+ /* @__PURE__ */ jsx(
187
+ "path",
188
+ {
189
+ className: `${id}-gold-vein`,
190
+ d: "M 4 18 Q 24 20 34 43 T 58 78",
191
+ fill: "none",
192
+ stroke: `url(#${goldGradientId})`,
193
+ strokeWidth: "1.4",
194
+ strokeLinecap: "round"
195
+ }
196
+ ),
197
+ /* @__PURE__ */ jsx(
198
+ "path",
199
+ {
200
+ className: `${id}-gold-vein`,
201
+ d: "M 82 8 Q 72 33 87 53 T 53 93",
202
+ fill: "none",
203
+ stroke: `url(#${goldGradientId})`,
204
+ strokeWidth: "1.2",
205
+ strokeLinecap: "round"
206
+ }
207
+ ),
208
+ /* @__PURE__ */ jsx(
209
+ "path",
210
+ {
211
+ className: `${id}-gold-vein`,
212
+ d: "M 8 68 Q 28 66 43 53 T 73 43",
213
+ fill: "none",
214
+ stroke: `url(#${goldGradientId})`,
215
+ strokeWidth: "1.0",
216
+ strokeLinecap: "round"
217
+ }
218
+ )
219
+ ]
220
+ }
221
+ );
222
+ }
223
+ var kintsugiConfig = {
224
+ render: KintsugiSurface,
225
+ default: {
226
+ style: {
227
+ color: "#4a4030",
228
+ boxShadow: "inset 0 0 0 1px rgba(74, 64, 48, 0.12)"
229
+ }
230
+ },
231
+ active: {
232
+ style: {
233
+ color: "#ffffff"
234
+ }
235
+ }
236
+ };
237
+ function OilslickSurface({
238
+ id,
239
+ active
240
+ }) {
241
+ if (active) {
242
+ return /* @__PURE__ */ jsx(
243
+ "svg",
244
+ {
245
+ className: cn(
246
+ "size-full",
247
+ !active && "[filter:saturate(1.15)] group-hover:[filter:saturate(1.3)_brightness(1.08)]"
248
+ ),
249
+ width: "100%",
250
+ height: "100%",
251
+ viewBox: "0 0 100 100",
252
+ preserveAspectRatio: "none",
253
+ children: /* @__PURE__ */ jsx("rect", { width: "100", height: "100", fill: "#1a1a2e" })
254
+ }
255
+ );
256
+ }
257
+ const gradientA = `${id}-oilslick-a`;
258
+ const gradientB = `${id}-oilslick-b`;
259
+ const gradientC = `${id}-oilslick-c`;
260
+ return /* @__PURE__ */ jsxs(
261
+ "svg",
262
+ {
263
+ className: cn(
264
+ "size-full",
265
+ !active && "[filter:saturate(1.15)] group-hover:[filter:saturate(1.3)_brightness(1.08)]"
266
+ ),
267
+ width: "100%",
268
+ height: "100%",
269
+ viewBox: "0 0 100 100",
270
+ preserveAspectRatio: "none",
271
+ children: [
272
+ /* @__PURE__ */ jsxs("defs", { children: [
273
+ /* @__PURE__ */ jsxs("radialGradient", { id: gradientA, cx: "30%", cy: "30%", r: "70%", children: [
274
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#8b5cf6", children: /* @__PURE__ */ jsx(
275
+ "animate",
276
+ {
277
+ attributeName: "stop-color",
278
+ values: "#8b5cf6;#06b6d4;#8b5cf6",
279
+ dur: "8s",
280
+ repeatCount: "indefinite"
281
+ }
282
+ ) }),
283
+ /* @__PURE__ */ jsx("stop", { offset: "60%", stopColor: "#1e1b4b", stopOpacity: "0.9" }),
284
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#0f0f1a", stopOpacity: "0" })
285
+ ] }),
286
+ /* @__PURE__ */ jsxs("radialGradient", { id: gradientB, cx: "70%", cy: "60%", r: "60%", children: [
287
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#10b981", children: /* @__PURE__ */ jsx(
288
+ "animate",
289
+ {
290
+ attributeName: "stop-color",
291
+ values: "#10b981;#f59e0b;#ec4899;#10b981",
292
+ dur: "10s",
293
+ repeatCount: "indefinite"
294
+ }
295
+ ) }),
296
+ /* @__PURE__ */ jsx("stop", { offset: "55%", stopColor: "#1e1b4b", stopOpacity: "0.8" }),
297
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#0f0f1a", stopOpacity: "0" })
298
+ ] }),
299
+ /* @__PURE__ */ jsxs("radialGradient", { id: gradientC, cx: "50%", cy: "80%", r: "55%", children: [
300
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#ec4899", children: /* @__PURE__ */ jsx(
301
+ "animate",
302
+ {
303
+ attributeName: "stop-color",
304
+ values: "#ec4899;#8b5cf6;#06b6d4;#ec4899",
305
+ dur: "7s",
306
+ repeatCount: "indefinite"
307
+ }
308
+ ) }),
309
+ /* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: "#1e1b4b", stopOpacity: "0.7" }),
310
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#0f0f1a", stopOpacity: "0" })
311
+ ] })
312
+ ] }),
313
+ /* @__PURE__ */ jsx("rect", { width: "100", height: "100", fill: "#0a0a12" }),
314
+ /* @__PURE__ */ jsx(
315
+ "rect",
316
+ {
317
+ width: "100",
318
+ height: "100",
319
+ fill: `url(#${gradientA})`,
320
+ opacity: "0.85"
321
+ }
322
+ ),
323
+ /* @__PURE__ */ jsx(
324
+ "rect",
325
+ {
326
+ width: "100",
327
+ height: "100",
328
+ fill: `url(#${gradientB})`,
329
+ opacity: "0.75"
330
+ }
331
+ ),
332
+ /* @__PURE__ */ jsx(
333
+ "rect",
334
+ {
335
+ width: "100",
336
+ height: "100",
337
+ fill: `url(#${gradientC})`,
338
+ opacity: "0.70"
339
+ }
340
+ ),
341
+ /* @__PURE__ */ jsx(
342
+ "path",
343
+ {
344
+ d: "M -10 60 Q 25 45 50 60 T 110 55",
345
+ fill: "none",
346
+ stroke: "#ffffff",
347
+ strokeWidth: "0.8",
348
+ opacity: "0.12",
349
+ children: /* @__PURE__ */ jsx(
350
+ "animate",
351
+ {
352
+ attributeName: "d",
353
+ values: "M -10 60 Q 25 45 50 60 T 110 55;M -10 55 Q 30 70 55 50 T 110 65;M -10 60 Q 25 45 50 60 T 110 55",
354
+ dur: "12s",
355
+ repeatCount: "indefinite"
356
+ }
357
+ )
358
+ }
359
+ )
360
+ ]
361
+ }
362
+ );
363
+ }
364
+ var oilslickConfig = {
365
+ render: OilslickSurface,
366
+ default: {
367
+ style: {
368
+ color: "#ffffff",
369
+ boxShadow: "inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 10px rgba(139, 92, 246, 0.20)"
370
+ }
371
+ },
372
+ active: {
373
+ style: {
374
+ color: "#ffffff"
375
+ }
376
+ }
377
+ };
378
+ function RainbowSurface({
379
+ id,
380
+ active
381
+ }) {
382
+ const gradientId = `${id}-rainbow-gradient`;
383
+ return /* @__PURE__ */ jsxs(
384
+ "svg",
385
+ {
386
+ className: cn(
387
+ "size-full",
388
+ !active && "group-hover:[filter:brightness(1.08)]"
389
+ ),
390
+ width: "100%",
391
+ height: "100%",
392
+ viewBox: "0 0 100 100",
393
+ preserveAspectRatio: "none",
394
+ children: [
395
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
396
+ "linearGradient",
397
+ {
398
+ id: gradientId,
399
+ x1: "0%",
400
+ y1: "0%",
401
+ x2: "100%",
402
+ y2: "0%",
403
+ gradientTransform: "rotate(30, 0.5, 0.5)",
404
+ children: [
405
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#fbffca" }),
406
+ /* @__PURE__ */ jsx("stop", { offset: "33%", stopColor: "#baffbf" }),
407
+ /* @__PURE__ */ jsx("stop", { offset: "66%", stopColor: "#a7efff" }),
408
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#ffabff" })
409
+ ]
410
+ }
411
+ ) }),
412
+ /* @__PURE__ */ jsx(
413
+ "rect",
414
+ {
415
+ width: "100",
416
+ height: "100",
417
+ fill: active ? "#005458" : `url(#${gradientId})`
418
+ }
419
+ )
420
+ ]
421
+ }
422
+ );
423
+ }
424
+ var rainbowConfig = {
425
+ render: RainbowSurface,
426
+ default: {
427
+ className: "font-bold dark:[text-shadow:0_0_5px_rgba(0,0,0,0.5)]",
428
+ style: {
429
+ color: "#ffffff",
430
+ textShadow: "0 0 5px rgba(0, 0, 0, 0.2)",
431
+ boxShadow: "inset 0 0 0 1px rgba(0, 247, 255, 0.1)"
432
+ }
433
+ },
434
+ active: {
435
+ style: {
436
+ color: "#ffffff"
437
+ }
438
+ }
439
+ };
440
+ function SilverSurface({
441
+ id,
442
+ active
443
+ }) {
444
+ const gradientId = `${id}-silver-gradient`;
445
+ return /* @__PURE__ */ jsxs(
446
+ "svg",
447
+ {
448
+ className: cn(
449
+ "size-full",
450
+ !active && "[filter:brightness(1.1)] group-hover:[filter:brightness(1.16)]"
451
+ ),
452
+ width: "100%",
453
+ height: "100%",
454
+ viewBox: "0 0 100 100",
455
+ preserveAspectRatio: "none",
456
+ children: [
457
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
458
+ "linearGradient",
459
+ {
460
+ id: gradientId,
461
+ x1: "0%",
462
+ y1: "0%",
463
+ x2: "100%",
464
+ y2: "0%",
465
+ gradientTransform: "rotate(30, 0.5, 0.5)",
466
+ children: [
467
+ /* @__PURE__ */ jsx("stop", { offset: "10%", stopColor: "#afaeae" }),
468
+ /* @__PURE__ */ jsx("stop", { offset: "30%", stopColor: "#d6d6d6" }),
469
+ /* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: "#eeeeee" }),
470
+ /* @__PURE__ */ jsx("stop", { offset: "70%", stopColor: "#d6d6d6" }),
471
+ /* @__PURE__ */ jsx("stop", { offset: "90%", stopColor: "#afaeae" })
472
+ ]
473
+ }
474
+ ) }),
475
+ /* @__PURE__ */ jsx(
476
+ "rect",
477
+ {
478
+ width: "100",
479
+ height: "100",
480
+ fill: active ? "#5a5a5a" : `url(#${gradientId})`
481
+ }
482
+ ),
483
+ !active && /* @__PURE__ */ jsx(
484
+ "rect",
485
+ {
486
+ x: "0",
487
+ y: "0",
488
+ width: "100",
489
+ height: "8",
490
+ fill: "#ffffff",
491
+ opacity: "0.16"
492
+ }
493
+ )
494
+ ]
495
+ }
496
+ );
497
+ }
498
+ var silverConfig = {
499
+ render: SilverSurface,
500
+ default: {
501
+ style: {
502
+ color: "#2a2a2a",
503
+ boxShadow: "inset 0 0 0 1px rgba(0, 0, 0, 0.08)"
504
+ }
505
+ },
506
+ active: {
507
+ style: {
508
+ color: "#ffffff"
509
+ }
510
+ }
511
+ };
512
+ var SPECIAL_TAG_CONFIG = {
513
+ silver: silverConfig,
514
+ gold: goldConfig,
515
+ rainbow: rainbowConfig,
516
+ oilslick: oilslickConfig,
517
+ kintsugi: kintsugiConfig
518
+ };
519
+ function getSpecialTagStyleConfig(style) {
520
+ return SPECIAL_TAG_CONFIG[style];
521
+ }
522
+ function SpecialTagSurface(props) {
523
+ const { style, active, className } = props;
524
+ const config = SPECIAL_TAG_CONFIG[style];
525
+ const Renderer = config.render;
526
+ const reactId = useId();
527
+ const safeId = reactId.replace(/:/g, "-");
528
+ return /* @__PURE__ */ jsx("span", { className: cn(className), "aria-hidden": "true", children: /* @__PURE__ */ jsx(Renderer, { id: safeId, active }) });
529
+ }
530
+
531
+ // src/lib/colors.ts
532
+ var TAG_SPECIAL_STYLES = [
533
+ "silver",
534
+ "gold",
535
+ "rainbow",
536
+ "oilslick",
537
+ "kintsugi"
538
+ ];
539
+ function isSpecialTagStyle(color) {
540
+ return TAG_SPECIAL_STYLES.includes(color);
541
+ }
542
+ var WHITE_COLOR_PATTERN = /^(?:#fff(?:fff)?|white|rgba?\(\s*255\s*,\s*255\s*,\s*255\b)/i;
543
+ var BLACK_COLOR_PATTERN = /^(?:#000(?:000)?|black|rgba?\(\s*0\s*,\s*0\s*,\s*0\b)/i;
544
+ function isWhiteHex(color) {
545
+ if (color === "") return false;
546
+ return WHITE_COLOR_PATTERN.test(color.trim());
547
+ }
548
+ function isBlackHex(color) {
549
+ if (color === "") return false;
550
+ return BLACK_COLOR_PATTERN.test(color.trim());
551
+ }
552
+ function computeTagChipColors(color) {
553
+ if (color === "") {
554
+ return {
555
+ baseBg: "var(--color-muted)",
556
+ hoverBg: "var(--color-accent)",
557
+ fg: "var(--color-foreground)"
558
+ };
559
+ }
560
+ if (isWhiteHex(color)) {
561
+ return {
562
+ baseBg: "#ffffff",
563
+ hoverBg: "#f1f5f9",
564
+ fg: "#0a0a0a"
565
+ };
566
+ }
567
+ if (isBlackHex(color)) {
568
+ return {
569
+ baseBg: "#0a0a0a",
570
+ hoverBg: "#262626",
571
+ fg: "#ffffff"
572
+ };
573
+ }
574
+ return {
575
+ baseBg: `color-mix(in srgb, ${color} 6%, var(--color-card))`,
576
+ hoverBg: `color-mix(in srgb, ${color} 20%, var(--color-card))`,
577
+ fg: color
578
+ };
579
+ }
580
+
581
+ // src/lib/tag-surface.ts
582
+ function resolveTagChipSurface(color, active) {
583
+ if (isSpecialTagStyle(color)) {
584
+ const config = getSpecialTagStyleConfig(color);
585
+ return {
586
+ className: cn(
587
+ "relative isolate group",
588
+ config.default.className,
589
+ active ? config.active?.className : void 0
590
+ ),
591
+ style: {
592
+ ...config.default.style,
593
+ ...active ? config.active?.style : {}
594
+ },
595
+ texture: color
596
+ };
597
+ }
598
+ if (color === "") {
599
+ return active ? {
600
+ className: "bg-primary text-primary-foreground hover:bg-primary/90",
601
+ style: void 0,
602
+ texture: null
603
+ } : {
604
+ className: "bg-muted text-foreground hover:bg-accent",
605
+ style: void 0,
606
+ texture: null
607
+ };
608
+ }
609
+ const chipColors = computeTagChipColors(color);
610
+ return {
611
+ className: "bg-(--chip-bg) hover:bg-(--chip-hover-bg)",
612
+ style: {
613
+ ["--chip-bg"]: active ? chipColors.hoverBg : chipColors.baseBg,
614
+ ["--chip-hover-bg"]: chipColors.hoverBg,
615
+ color: chipColors.fg
616
+ },
617
+ texture: null
618
+ };
619
+ }
620
+ var tagChipLabelClassName = "min-w-0 overflow-x-clip text-ellipsis whitespace-nowrap";
621
+ var TagChip = forwardRef(
622
+ function TagChip2(props, ref) {
623
+ const {
624
+ color,
625
+ size = "sm",
626
+ border,
627
+ active,
628
+ icon,
629
+ roundedRight,
630
+ display,
631
+ render,
632
+ suffix,
633
+ children,
634
+ className,
635
+ style,
636
+ onMouseDown,
637
+ ...rest
638
+ } = props;
639
+ const surface = border !== void 0 ? void 0 : resolveTagChipSurface(color ?? "", active === true);
640
+ const interactiveRoot = display === "button" || render !== void 0;
641
+ const stateClass = border === "dashed" ? active === true ? "border border-transparent bg-accent text-foreground" : "border border-dashed border-border-strong text-muted-foreground hover:text-secondary-foreground" : void 0;
642
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
643
+ surface !== void 0 && surface.texture !== null && /* @__PURE__ */ jsx(
644
+ SpecialTagSurface,
645
+ {
646
+ style: surface.texture,
647
+ active,
648
+ className: "absolute inset-0 -z-10 overflow-hidden rounded-[inherit]"
649
+ }
650
+ ),
651
+ icon !== void 0 && // Flex row: the slot accepts several icons as a fragment
652
+ // (e.g. a kind glyph + the pin), and flex keeps the
653
+ // blockified preflight svgs on one line.
654
+ /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center gap-1 text-muted-foreground", children: icon }),
655
+ /* @__PURE__ */ jsxs("span", { className: tagChipLabelClassName, children: [
656
+ children,
657
+ suffix !== void 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
658
+ /* @__PURE__ */ jsx("span", { className: "font-bold mx-0.5", children: "\xB7" }),
659
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 opacity-70", children: suffix })
660
+ ] }) : null
661
+ ] })
662
+ ] });
663
+ const chipClassName = cn(
664
+ "inline-flex min-w-0 max-w-full items-center justify-center gap-1.5 rounded-sm text-xs font-normal leading-none disabled:pointer-events-none disabled:opacity-50",
665
+ size === "md" ? "px-2 py-1.5" : "px-2 py-1",
666
+ roundedRight === false && "rounded-r-none",
667
+ interactiveRoot && "cursor-pointer",
668
+ surface?.className,
669
+ stateClass,
670
+ className
671
+ );
672
+ const chipStyle = { ...surface?.style, ...style };
673
+ if (render !== void 0) {
674
+ return cloneElement(render, {
675
+ ...rest,
676
+ ref,
677
+ className: chipClassName,
678
+ style: chipStyle,
679
+ onMouseDown,
680
+ children: content
681
+ });
682
+ }
683
+ if (display === "button") {
684
+ return /* @__PURE__ */ jsx(
685
+ "button",
686
+ {
687
+ type: "button",
688
+ ref,
689
+ className: chipClassName,
690
+ style: chipStyle,
691
+ onMouseDown,
692
+ ...rest,
693
+ children: content
694
+ }
695
+ );
696
+ }
697
+ return /* @__PURE__ */ jsx(
698
+ "span",
699
+ {
700
+ ref,
701
+ className: chipClassName,
702
+ style: chipStyle,
703
+ onMouseDown,
704
+ ...rest,
705
+ children: content
706
+ }
707
+ );
708
+ }
709
+ );
710
+
711
+ export { TagChip };
712
+ //# sourceMappingURL=tag-chip.js.map
713
+ //# sourceMappingURL=tag-chip.js.map