@sarunyu/system-one 1.0.2 → 1.0.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.
- package/dist/index.cjs +427 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +428 -291
- package/dist/index.js.map +1 -1
- package/dist/src/components/chip.d.ts +13 -0
- package/dist/src/components/chip.d.ts.map +1 -0
- package/dist/src/components/date-input.d.ts.map +1 -1
- package/dist/src/components/dropdown-multiple.d.ts.map +1 -1
- package/dist/src/components/dropdown.d.ts.map +1 -1
- package/dist/src/components/input.d.ts.map +1 -1
- package/dist/src/components/option-list.d.ts.map +1 -1
- package/dist/src/components/search-input.d.ts.map +1 -1
- package/dist/src/components/tab.d.ts +5 -0
- package/dist/src/components/tab.d.ts.map +1 -1
- package/dist/src/components/tag.d.ts +21 -0
- package/dist/src/components/tag.d.ts.map +1 -0
- package/dist/src/components/textarea.d.ts.map +1 -1
- package/dist/src/components/time-input.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -4
package/dist/index.js
CHANGED
|
@@ -1,65 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
import React__default, { forwardRef, useState, useCallback, useRef, useEffect, useMemo, useLayoutEffect } from "react";
|
|
4
5
|
import { clsx } from "clsx";
|
|
5
6
|
import { twMerge } from "tailwind-merge";
|
|
6
|
-
import { Lock, CalendarBlank, MapPin, Users, Minus,
|
|
7
|
+
import { Lock, CalendarBlank, MapPin, Users, Minus, CaretLeft, CaretRight, CaretDoubleLeft, CaretDoubleRight, CaretUp, CaretDown, Check, X, MagnifyingGlass, Circle, Clock } from "@phosphor-icons/react";
|
|
7
8
|
import { DayPicker, useNavigation } from "react-day-picker";
|
|
8
9
|
import * as Popover from "@radix-ui/react-popover";
|
|
9
|
-
import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from "lucide-react";
|
|
10
10
|
import { Drawer as Drawer$1 } from "vaul";
|
|
11
11
|
function cn(...inputs) {
|
|
12
12
|
return twMerge(clsx(inputs));
|
|
13
13
|
}
|
|
14
14
|
const labelIconSizeClass = {
|
|
15
|
-
xs: "
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
xs: "h-4 w-4",
|
|
16
|
+
// 16px
|
|
17
|
+
sm: "h-4.5 w-4.5",
|
|
18
|
+
// ~18px
|
|
19
|
+
md: "h-4.5 w-4.5",
|
|
20
|
+
lg: "h-5 w-5",
|
|
21
|
+
// 20px
|
|
22
|
+
xl: "h-5 w-5"
|
|
20
23
|
};
|
|
21
24
|
const gapClass = {
|
|
22
|
-
xs: "gap-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
xs: "gap-0.5",
|
|
26
|
+
// 2px
|
|
27
|
+
sm: "gap-0.5",
|
|
28
|
+
md: "gap-0.5",
|
|
29
|
+
lg: "gap-1",
|
|
30
|
+
// 4px
|
|
31
|
+
xl: "gap-1"
|
|
27
32
|
};
|
|
28
33
|
const textSizeClass = {
|
|
29
|
-
xs: "text-
|
|
30
|
-
sm: "text-
|
|
31
|
-
md: "text-
|
|
32
|
-
lg: "text-
|
|
33
|
-
xl: "text-
|
|
34
|
+
xs: "text-xs leading-4",
|
|
35
|
+
sm: "text-sm leading-5",
|
|
36
|
+
md: "text-sm leading-5",
|
|
37
|
+
lg: "text-sm leading-5",
|
|
38
|
+
xl: "text-sm leading-5"
|
|
34
39
|
};
|
|
35
40
|
const roundedLabelClass = {
|
|
36
|
-
xs: "rounded
|
|
37
|
-
sm: "rounded-
|
|
38
|
-
md: "rounded-
|
|
39
|
-
lg: "rounded-
|
|
40
|
-
xl: "rounded-
|
|
41
|
+
xs: "rounded",
|
|
42
|
+
sm: "rounded-md",
|
|
43
|
+
md: "rounded-md",
|
|
44
|
+
lg: "rounded-lg",
|
|
45
|
+
xl: "rounded-lg"
|
|
41
46
|
};
|
|
42
47
|
function getPaddingClasses(size, hasLeft, hasRight) {
|
|
43
48
|
const pyMap = {
|
|
44
|
-
xs: "py-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
xs: "py-1",
|
|
50
|
+
// 4px
|
|
51
|
+
sm: "py-1",
|
|
52
|
+
// 4px
|
|
53
|
+
md: "py-1.5",
|
|
54
|
+
// 6px
|
|
55
|
+
lg: "py-2",
|
|
56
|
+
// 8px
|
|
57
|
+
xl: "py-2.5"
|
|
58
|
+
// 10px
|
|
49
59
|
};
|
|
50
60
|
const pxMap = {
|
|
51
|
-
xs: { l: "pl-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
xs: { l: "pl-1.5", r: "pr-1.5" },
|
|
62
|
+
// 6px
|
|
63
|
+
sm: { l: "pl-2", r: "pr-2" },
|
|
64
|
+
// 8px
|
|
65
|
+
md: { l: "pl-2.5", r: "pr-2.5" },
|
|
66
|
+
// 10px
|
|
67
|
+
lg: { l: "pl-3.5", r: "pr-3.5" },
|
|
68
|
+
// 14px
|
|
69
|
+
xl: { l: "pl-4", r: "pr-4" }
|
|
70
|
+
// 16px
|
|
56
71
|
};
|
|
57
72
|
const reducedMap = {
|
|
58
|
-
xs: { l: "pl-
|
|
59
|
-
sm: { l: "pl-
|
|
60
|
-
md: { l: "pl-
|
|
61
|
-
lg: { l: "pl-
|
|
62
|
-
xl: { l: "pl-
|
|
73
|
+
xs: { l: "pl-1.5", r: "pr-1.5" },
|
|
74
|
+
sm: { l: "pl-1.5", r: "pr-1.5" },
|
|
75
|
+
md: { l: "pl-2", r: "pr-2" },
|
|
76
|
+
lg: { l: "pl-2.5", r: "pr-2.5" },
|
|
77
|
+
xl: { l: "pl-3", r: "pr-3" }
|
|
63
78
|
};
|
|
64
79
|
return [
|
|
65
80
|
hasLeft ? reducedMap[size].l : pxMap[size].l,
|
|
@@ -68,11 +83,11 @@ function getPaddingClasses(size, hasLeft, hasRight) {
|
|
|
68
83
|
];
|
|
69
84
|
}
|
|
70
85
|
const iconSizeSpec = {
|
|
71
|
-
"icon-xs": { btn: "
|
|
72
|
-
"icon-sm": { btn: "
|
|
73
|
-
"icon-md": { btn: "
|
|
74
|
-
"icon-lg": { btn: "
|
|
75
|
-
"icon-xl": { btn: "
|
|
86
|
+
"icon-xs": { btn: "h-6 w-6", icon: 16, rounded: "rounded" },
|
|
87
|
+
"icon-sm": { btn: "h-7 w-7", icon: 18, rounded: "rounded-md" },
|
|
88
|
+
"icon-md": { btn: "h-8 w-8", icon: 18, rounded: "rounded-md" },
|
|
89
|
+
"icon-lg": { btn: "h-9 w-9", icon: 20, rounded: "rounded-lg" },
|
|
90
|
+
"icon-xl": { btn: "h-10 w-10", icon: 20, rounded: "rounded-lg" }
|
|
76
91
|
};
|
|
77
92
|
function getVariantClasses(variant, isDisabled) {
|
|
78
93
|
if (isDisabled) {
|
|
@@ -81,14 +96,14 @@ function getVariantClasses(variant, isDisabled) {
|
|
|
81
96
|
return "bg-disabled-bg text-disabled cursor-not-allowed";
|
|
82
97
|
}
|
|
83
98
|
if (variant === "outline")
|
|
84
|
-
return "bg-
|
|
99
|
+
return "bg-background text-primary-action border border-border hover:bg-hover-bg active:bg-disabled-bg";
|
|
85
100
|
if (variant === "plain")
|
|
86
101
|
return "bg-transparent text-primary-action hover:bg-hover-bg active:bg-disabled-bg";
|
|
87
102
|
if (variant === "outline-black")
|
|
88
|
-
return "bg-
|
|
103
|
+
return "bg-background text-foreground border border-border hover:bg-hover-bg";
|
|
89
104
|
if (variant === "plain-black")
|
|
90
105
|
return "bg-transparent text-foreground hover:bg-hover-bg";
|
|
91
|
-
return "bg-primary-action text-
|
|
106
|
+
return "bg-primary-action text-on-primary-action hover:bg-primary-action-hover active:bg-primary-action-active";
|
|
92
107
|
}
|
|
93
108
|
const Button = forwardRef(function Button2({
|
|
94
109
|
size = "md",
|
|
@@ -124,7 +139,7 @@ const Button = forwardRef(function Button2({
|
|
|
124
139
|
} : onPointerLeave;
|
|
125
140
|
const variantClasses = getVariantClasses(variant, isDisabled);
|
|
126
141
|
const cursorClass = isDisabled ? "cursor-not-allowed" : "cursor-pointer";
|
|
127
|
-
const baseClasses = "inline-flex items-center justify-center font-
|
|
142
|
+
const baseClasses = "inline-flex items-center justify-center font-medium whitespace-nowrap transition-colors duration-150 select-none";
|
|
128
143
|
if (isIconOnly) {
|
|
129
144
|
const spec = iconSizeSpec[size];
|
|
130
145
|
return /* @__PURE__ */ jsx(
|
|
@@ -258,8 +273,8 @@ const Card = forwardRef(function Card2({
|
|
|
258
273
|
className
|
|
259
274
|
}, ref) {
|
|
260
275
|
const widthClass = variant === "desktop" ? "w-[308px]" : variant === "tablet" ? "w-[224px]" : "w-[163px]";
|
|
261
|
-
const padding = variant === "desktop" ? "p-
|
|
262
|
-
const titleGap = variant === "desktop" ? "gap-
|
|
276
|
+
const padding = variant === "desktop" ? "p-4" : variant === "tablet" ? "p-3" : "p-2.5";
|
|
277
|
+
const titleGap = variant === "desktop" ? "gap-1.5" : "gap-1";
|
|
263
278
|
const bannerClass = variant === "desktop" ? "h-[173px]" : "aspect-video w-full";
|
|
264
279
|
const tag = tagConfig[tagStatus];
|
|
265
280
|
const bannerSrc = image ?? imgBanner;
|
|
@@ -269,7 +284,7 @@ const Card = forwardRef(function Card2({
|
|
|
269
284
|
ref,
|
|
270
285
|
className: cn(
|
|
271
286
|
"flex min-h-[120px] flex-col items-start overflow-clip rounded-[8px]",
|
|
272
|
-
"shadow-
|
|
287
|
+
"shadow-card",
|
|
273
288
|
widthClass,
|
|
274
289
|
className
|
|
275
290
|
),
|
|
@@ -303,49 +318,49 @@ const Card = forwardRef(function Card2({
|
|
|
303
318
|
}
|
|
304
319
|
)
|
|
305
320
|
] }),
|
|
306
|
-
/* @__PURE__ */ jsx("div", { className: cn("w-full shrink-0 bg-
|
|
307
|
-
/* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col items-start gap-
|
|
321
|
+
/* @__PURE__ */ jsx("div", { className: cn("w-full shrink-0 bg-card", padding), children: /* @__PURE__ */ jsxs("div", { className: cn("flex w-full flex-col items-start", titleGap), children: [
|
|
322
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col items-start gap-1", children: [
|
|
308
323
|
/* @__PURE__ */ jsx(
|
|
309
324
|
"p",
|
|
310
325
|
{
|
|
311
326
|
className: cn(
|
|
312
|
-
"line-clamp-2 w-full overflow-hidden text-ellipsis text-
|
|
327
|
+
"line-clamp-2 w-full overflow-hidden text-ellipsis text-sm leading-5 text-foreground"
|
|
313
328
|
),
|
|
314
329
|
children: title
|
|
315
330
|
}
|
|
316
331
|
),
|
|
317
|
-
/* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-
|
|
318
|
-
/* @__PURE__ */ jsxs("div", { className: "flex h-[22px] shrink-0 items-center gap-
|
|
332
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-2", children: [
|
|
333
|
+
/* @__PURE__ */ jsxs("div", { className: "flex h-[22px] shrink-0 items-center gap-1", children: [
|
|
319
334
|
/* @__PURE__ */ jsx(CalendarIcon, {}),
|
|
320
|
-
/* @__PURE__ */ jsx("p", { className: "whitespace-nowrap text-
|
|
335
|
+
/* @__PURE__ */ jsx("p", { className: "whitespace-nowrap text-xs leading-4 text-accent-orange", children: date })
|
|
321
336
|
] }),
|
|
322
337
|
/* @__PURE__ */ jsx("div", { className: "h-[14px] w-px shrink-0 bg-border" }),
|
|
323
338
|
/* @__PURE__ */ jsx(
|
|
324
339
|
"p",
|
|
325
340
|
{
|
|
326
341
|
className: cn(
|
|
327
|
-
"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-
|
|
342
|
+
"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-xs leading-4 text-subtle-text"
|
|
328
343
|
),
|
|
329
344
|
children: time
|
|
330
345
|
}
|
|
331
346
|
)
|
|
332
347
|
] }),
|
|
333
|
-
showLocation && /* @__PURE__ */ jsxs("div", { className: "flex h-[22px] w-full items-center gap-
|
|
348
|
+
showLocation && /* @__PURE__ */ jsxs("div", { className: "flex h-[22px] w-full items-center gap-1", children: [
|
|
334
349
|
/* @__PURE__ */ jsx(LocationIcon, {}),
|
|
335
350
|
/* @__PURE__ */ jsx(
|
|
336
351
|
"p",
|
|
337
352
|
{
|
|
338
353
|
className: cn(
|
|
339
|
-
"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-
|
|
354
|
+
"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-xs leading-4 text-subtle-text"
|
|
340
355
|
),
|
|
341
356
|
children: location
|
|
342
357
|
}
|
|
343
358
|
)
|
|
344
359
|
] }),
|
|
345
|
-
showAudience && /* @__PURE__ */ jsxs("div", { className: "flex h-[22px] w-full items-center gap-
|
|
360
|
+
showAudience && /* @__PURE__ */ jsxs("div", { className: "flex h-[22px] w-full items-center gap-1", children: [
|
|
346
361
|
/* @__PURE__ */ jsx(AudienceIcon, {}),
|
|
347
|
-
/* @__PURE__ */ jsx("p", { className: "shrink-0 whitespace-nowrap text-
|
|
348
|
-
/* @__PURE__ */ jsx("p", { className: "shrink-0 whitespace-nowrap text-
|
|
362
|
+
/* @__PURE__ */ jsx("p", { className: "shrink-0 whitespace-nowrap text-xs leading-4 text-subtle-text", children: "ผู้เข้าร่วม" }),
|
|
363
|
+
/* @__PURE__ */ jsx("p", { className: "shrink-0 whitespace-nowrap text-xs leading-4 text-primary-action", children: count })
|
|
349
364
|
] })
|
|
350
365
|
] }),
|
|
351
366
|
/* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-start", children: /* @__PURE__ */ jsx(
|
|
@@ -562,7 +577,7 @@ function CustomCaption({
|
|
|
562
577
|
type: "button",
|
|
563
578
|
className: NAV_BTN_CLASS,
|
|
564
579
|
onClick: () => setYearRangeStart((s) => s - 12),
|
|
565
|
-
children: /* @__PURE__ */ jsx(
|
|
580
|
+
children: /* @__PURE__ */ jsx(CaretLeft, { size: 16, className: "text-primary-action" })
|
|
566
581
|
}
|
|
567
582
|
);
|
|
568
583
|
rightNav = /* @__PURE__ */ jsx(
|
|
@@ -571,7 +586,7 @@ function CustomCaption({
|
|
|
571
586
|
type: "button",
|
|
572
587
|
className: NAV_BTN_CLASS,
|
|
573
588
|
onClick: () => setYearRangeStart((s) => s + 12),
|
|
574
|
-
children: /* @__PURE__ */ jsx(
|
|
589
|
+
children: /* @__PURE__ */ jsx(CaretRight, { size: 16, className: "text-primary-action" })
|
|
575
590
|
}
|
|
576
591
|
);
|
|
577
592
|
} else if (view === "months") {
|
|
@@ -581,7 +596,7 @@ function CustomCaption({
|
|
|
581
596
|
type: "button",
|
|
582
597
|
className: NAV_BTN_CLASS,
|
|
583
598
|
onClick: () => setPickerYear((y) => y - 1),
|
|
584
|
-
children: /* @__PURE__ */ jsx(
|
|
599
|
+
children: /* @__PURE__ */ jsx(CaretLeft, { size: 16, className: "text-primary-action" })
|
|
585
600
|
}
|
|
586
601
|
);
|
|
587
602
|
rightNav = /* @__PURE__ */ jsx(
|
|
@@ -590,7 +605,7 @@ function CustomCaption({
|
|
|
590
605
|
type: "button",
|
|
591
606
|
className: NAV_BTN_CLASS,
|
|
592
607
|
onClick: () => setPickerYear((y) => y + 1),
|
|
593
|
-
children: /* @__PURE__ */ jsx(
|
|
608
|
+
children: /* @__PURE__ */ jsx(CaretRight, { size: 16, className: "text-primary-action" })
|
|
594
609
|
}
|
|
595
610
|
);
|
|
596
611
|
} else if (isDrawerRange) {
|
|
@@ -601,7 +616,7 @@ function CustomCaption({
|
|
|
601
616
|
type: "button",
|
|
602
617
|
className: NAV_BTN_CLASS,
|
|
603
618
|
onClick: handlePrevYear,
|
|
604
|
-
children: /* @__PURE__ */ jsx(
|
|
619
|
+
children: /* @__PURE__ */ jsx(CaretDoubleLeft, { size: 16, className: "text-primary-action" })
|
|
605
620
|
}
|
|
606
621
|
),
|
|
607
622
|
/* @__PURE__ */ jsx(
|
|
@@ -610,7 +625,7 @@ function CustomCaption({
|
|
|
610
625
|
type: "button",
|
|
611
626
|
className: NAV_BTN_CLASS,
|
|
612
627
|
onClick: () => previousMonth && goToMonth(previousMonth),
|
|
613
|
-
children: /* @__PURE__ */ jsx(
|
|
628
|
+
children: /* @__PURE__ */ jsx(CaretLeft, { size: 16, className: "text-primary-action" })
|
|
614
629
|
}
|
|
615
630
|
)
|
|
616
631
|
] });
|
|
@@ -621,7 +636,7 @@ function CustomCaption({
|
|
|
621
636
|
type: "button",
|
|
622
637
|
className: NAV_BTN_CLASS,
|
|
623
638
|
onClick: () => nextMonth && goToMonth(nextMonth),
|
|
624
|
-
children: /* @__PURE__ */ jsx(
|
|
639
|
+
children: /* @__PURE__ */ jsx(CaretRight, { size: 16, className: "text-primary-action" })
|
|
625
640
|
}
|
|
626
641
|
),
|
|
627
642
|
/* @__PURE__ */ jsx(
|
|
@@ -630,7 +645,7 @@ function CustomCaption({
|
|
|
630
645
|
type: "button",
|
|
631
646
|
className: NAV_BTN_CLASS,
|
|
632
647
|
onClick: handleNextYear,
|
|
633
|
-
children: /* @__PURE__ */ jsx(
|
|
648
|
+
children: /* @__PURE__ */ jsx(CaretDoubleRight, { size: 16, className: "text-primary-action" })
|
|
634
649
|
}
|
|
635
650
|
)
|
|
636
651
|
] });
|
|
@@ -644,7 +659,7 @@ function CustomCaption({
|
|
|
644
659
|
className: NAV_BTN_CLASS,
|
|
645
660
|
onClick: handlePrevYear,
|
|
646
661
|
children: /* @__PURE__ */ jsx(
|
|
647
|
-
|
|
662
|
+
CaretDoubleLeft,
|
|
648
663
|
{
|
|
649
664
|
size: 16,
|
|
650
665
|
className: "text-primary-action"
|
|
@@ -658,7 +673,7 @@ function CustomCaption({
|
|
|
658
673
|
type: "button",
|
|
659
674
|
className: NAV_BTN_CLASS,
|
|
660
675
|
onClick: () => previousMonth && goToMonth(previousMonth),
|
|
661
|
-
children: /* @__PURE__ */ jsx(
|
|
676
|
+
children: /* @__PURE__ */ jsx(CaretLeft, { size: 16, className: "text-primary-action" })
|
|
662
677
|
}
|
|
663
678
|
)
|
|
664
679
|
] });
|
|
@@ -672,7 +687,7 @@ function CustomCaption({
|
|
|
672
687
|
className: NAV_BTN_CLASS,
|
|
673
688
|
onClick: () => nextMonth && goToMonth(nextMonth),
|
|
674
689
|
children: /* @__PURE__ */ jsx(
|
|
675
|
-
|
|
690
|
+
CaretRight,
|
|
676
691
|
{
|
|
677
692
|
size: 16,
|
|
678
693
|
className: "text-primary-action"
|
|
@@ -687,7 +702,7 @@ function CustomCaption({
|
|
|
687
702
|
className: NAV_BTN_CLASS,
|
|
688
703
|
onClick: handleNextYear,
|
|
689
704
|
children: /* @__PURE__ */ jsx(
|
|
690
|
-
|
|
705
|
+
CaretDoubleRight,
|
|
691
706
|
{
|
|
692
707
|
size: 16,
|
|
693
708
|
className: "text-primary-action"
|
|
@@ -701,7 +716,7 @@ function CustomCaption({
|
|
|
701
716
|
const now = /* @__PURE__ */ new Date();
|
|
702
717
|
const gridBtnClass = (active, isToday, isItemDisabled = false) => cn(
|
|
703
718
|
"py-[10px] text-[13px] rounded-[6px] border-0 outline-none transition-colors",
|
|
704
|
-
isItemDisabled ? "bg-disabled-bg text-disabled cursor-not-allowed" : active ? "bg-primary-action text-
|
|
719
|
+
isItemDisabled ? "bg-disabled-bg text-disabled cursor-not-allowed" : active ? "bg-primary-action text-on-primary-action cursor-pointer" : isToday ? "bg-primary-action-muted text-primary-action cursor-pointer" : "bg-transparent text-foreground hover:bg-disabled-bg cursor-pointer"
|
|
705
720
|
);
|
|
706
721
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
707
722
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pt-1 mb-2", children: [
|
|
@@ -720,7 +735,7 @@ function CustomCaption({
|
|
|
720
735
|
view === "months" && /* @__PURE__ */ jsx(
|
|
721
736
|
"div",
|
|
722
737
|
{
|
|
723
|
-
className: "absolute left-0 right-0 z-10 bg-
|
|
738
|
+
className: "absolute left-0 right-0 z-10 bg-background grid grid-cols-3 gap-1 p-2 content-center",
|
|
724
739
|
style: { top: "42px", bottom: "0" },
|
|
725
740
|
children: THAI_MONTHS_SHORT.map((name, i) => {
|
|
726
741
|
const isCurrent = pickerYear === displayMonth.getFullYear() && i === displayMonth.getMonth();
|
|
@@ -744,7 +759,7 @@ function CustomCaption({
|
|
|
744
759
|
view === "years" && /* @__PURE__ */ jsx(
|
|
745
760
|
"div",
|
|
746
761
|
{
|
|
747
|
-
className: "absolute left-0 right-0 z-10 bg-
|
|
762
|
+
className: "absolute left-0 right-0 z-10 bg-background grid grid-cols-3 gap-1 p-2 content-center",
|
|
748
763
|
style: { top: "42px", bottom: "0" },
|
|
749
764
|
children: Array.from({ length: 12 }, (_, i) => {
|
|
750
765
|
const year = yearRangeStart + i;
|
|
@@ -809,9 +824,9 @@ const DAY_PICKER_CLASSES = {
|
|
|
809
824
|
"hover:bg-disabled-bg transition-colors duration-100",
|
|
810
825
|
"outline-none aria-selected:opacity-100 p-0"
|
|
811
826
|
),
|
|
812
|
-
day_range_start: "day-range-start !bg-primary-action !text-
|
|
813
|
-
day_range_end: "day-range-end !bg-primary-action !text-
|
|
814
|
-
day_selected: "!bg-primary-action text-
|
|
827
|
+
day_range_start: "day-range-start !bg-primary-action !text-on-primary-action !rounded-l-[6px] !rounded-r-none",
|
|
828
|
+
day_range_end: "day-range-end !bg-primary-action !text-on-primary-action !rounded-r-[6px] !rounded-l-none",
|
|
829
|
+
day_selected: "!bg-primary-action text-on-primary-action hover:!bg-primary-action focus:!bg-primary-action rounded-[6px]",
|
|
815
830
|
day_today: "[&:not([aria-selected=true])]:!bg-primary-action-light [&:not([aria-selected=true])]:text-foreground rounded-[6px]",
|
|
816
831
|
day_outside: "day-outside text-disabled opacity-50 aria-selected:bg-transparent aria-selected:opacity-30",
|
|
817
832
|
day_disabled: "text-disabled opacity-50 cursor-not-allowed",
|
|
@@ -1112,7 +1127,7 @@ const DateInput = forwardRef(
|
|
|
1112
1127
|
const isError = state === "error";
|
|
1113
1128
|
const isFocus = state === "focus";
|
|
1114
1129
|
const isFilled = mode === "single" ? Boolean(currentDate) : Boolean(currentRange == null ? void 0 : currentRange.from);
|
|
1115
|
-
const bgClass = isDisabled ? "bg-disabled-bg" : "bg-
|
|
1130
|
+
const bgClass = isDisabled ? "bg-disabled-bg" : "bg-background";
|
|
1116
1131
|
const labelColor = isDisabled ? "var(--disabled)" : "var(--muted-foreground)";
|
|
1117
1132
|
const valueColor = isDisabled ? "var(--disabled)" : "var(--foreground)";
|
|
1118
1133
|
const iconColor = isDisabled ? "var(--disabled)" : "var(--muted-foreground)";
|
|
@@ -1176,30 +1191,37 @@ const DateInput = forwardRef(
|
|
|
1176
1191
|
const valueRow = mode === "single" && currentDate ? /* @__PURE__ */ jsx(
|
|
1177
1192
|
"p",
|
|
1178
1193
|
{
|
|
1179
|
-
className: "leading-[20px] not-italic relative
|
|
1194
|
+
className: "leading-[20px] not-italic relative text-[16px] w-full min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
1180
1195
|
style: { color: valueColor },
|
|
1181
1196
|
children: formatThaiDate(currentDate)
|
|
1182
1197
|
}
|
|
1183
|
-
) : mode === "range" && (currentRange == null ? void 0 : currentRange.from) ? /* @__PURE__ */ jsxs("div", { className: "flex gap-[8px] items-center relative
|
|
1198
|
+
) : mode === "range" && (currentRange == null ? void 0 : currentRange.from) ? /* @__PURE__ */ jsxs("div", { className: "flex gap-[8px] items-center relative w-full min-w-0", children: [
|
|
1184
1199
|
/* @__PURE__ */ jsx(
|
|
1185
1200
|
"p",
|
|
1186
1201
|
{
|
|
1187
|
-
className: "leading-[20px] not-italic relative
|
|
1202
|
+
className: "leading-[20px] not-italic relative text-[16px] min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
1188
1203
|
style: { color: valueColor },
|
|
1189
1204
|
children: formatThaiDate(currentRange.from)
|
|
1190
1205
|
}
|
|
1191
1206
|
),
|
|
1192
|
-
/* @__PURE__ */ jsx(
|
|
1207
|
+
/* @__PURE__ */ jsx(
|
|
1208
|
+
Minus,
|
|
1209
|
+
{
|
|
1210
|
+
size: 20,
|
|
1211
|
+
color: minusColor,
|
|
1212
|
+
className: "shrink-0"
|
|
1213
|
+
}
|
|
1214
|
+
),
|
|
1193
1215
|
/* @__PURE__ */ jsx(
|
|
1194
1216
|
"p",
|
|
1195
1217
|
{
|
|
1196
|
-
className: "leading-[20px] not-italic relative
|
|
1218
|
+
className: "leading-[20px] not-italic relative text-[16px] min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
1197
1219
|
style: { color: valueColor },
|
|
1198
1220
|
children: currentRange.to ? formatThaiDate(currentRange.to) : "..."
|
|
1199
1221
|
}
|
|
1200
1222
|
)
|
|
1201
1223
|
] }) : null;
|
|
1202
|
-
return /* @__PURE__ */ jsxs("div", { className: "content-stretch flex flex-1 flex-col items-center justify-center min-h-px min-w-
|
|
1224
|
+
return /* @__PURE__ */ jsxs("div", { className: "content-stretch flex flex-1 flex-col items-center justify-center min-h-px min-w-0 overflow-hidden relative w-full", children: [
|
|
1203
1225
|
floatingLabel,
|
|
1204
1226
|
valueRow
|
|
1205
1227
|
] });
|
|
@@ -1259,13 +1281,13 @@ const DateInput = forwardRef(
|
|
|
1259
1281
|
)
|
|
1260
1282
|
] });
|
|
1261
1283
|
const triggerBaseClasses = cn(
|
|
1262
|
-
"relative flex gap-
|
|
1284
|
+
"relative flex gap-2 items-center rounded-lg min-w-0",
|
|
1263
1285
|
bgClass,
|
|
1264
|
-
"px-
|
|
1265
|
-
isFilled ? "py-
|
|
1286
|
+
"px-3.5",
|
|
1287
|
+
isFilled ? "py-1.5" : "py-3",
|
|
1266
1288
|
"w-full"
|
|
1267
1289
|
);
|
|
1268
|
-
const belowMessage = showBelow && /* @__PURE__ */ jsx("div", { className: "flex items-start px-
|
|
1290
|
+
const belowMessage = showBelow && /* @__PURE__ */ jsx("div", { className: "flex items-start px-1 text-xs leading-4", children: /* @__PURE__ */ jsx(
|
|
1269
1291
|
"span",
|
|
1270
1292
|
{
|
|
1271
1293
|
className: "flex-1 min-w-0",
|
|
@@ -1350,7 +1372,10 @@ const DateInput = forwardRef(
|
|
|
1350
1372
|
{
|
|
1351
1373
|
type: "button",
|
|
1352
1374
|
disabled: isDisabled,
|
|
1353
|
-
className: cn(
|
|
1375
|
+
className: cn(
|
|
1376
|
+
triggerBaseClasses,
|
|
1377
|
+
"text-left cursor-pointer disabled:cursor-default"
|
|
1378
|
+
),
|
|
1354
1379
|
children: triggerInner
|
|
1355
1380
|
}
|
|
1356
1381
|
);
|
|
@@ -1391,9 +1416,9 @@ const DateInput = forwardRef(
|
|
|
1391
1416
|
{
|
|
1392
1417
|
align: "start",
|
|
1393
1418
|
sideOffset: 4,
|
|
1394
|
-
className: "z-50 rounded-[8px] bg-
|
|
1419
|
+
className: "z-50 rounded-[8px] bg-popover p-3 outline-none text-popover-foreground",
|
|
1395
1420
|
style: {
|
|
1396
|
-
boxShadow: "
|
|
1421
|
+
boxShadow: "var(--elevation-popover)",
|
|
1397
1422
|
border: "1px solid var(--border)"
|
|
1398
1423
|
},
|
|
1399
1424
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
@@ -1413,12 +1438,6 @@ const DateInput = forwardRef(
|
|
|
1413
1438
|
}
|
|
1414
1439
|
);
|
|
1415
1440
|
DateInput.displayName = "DateInput";
|
|
1416
|
-
function ChevronDownIcon$1({ className }) {
|
|
1417
|
-
return /* @__PURE__ */ jsx("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", className, children: /* @__PURE__ */ jsx("path", { d: "M7 9L11 13L15 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1418
|
-
}
|
|
1419
|
-
function ChevronUpIcon$1({ className }) {
|
|
1420
|
-
return /* @__PURE__ */ jsx("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", className, children: /* @__PURE__ */ jsx("path", { d: "M7 13L11 9L15 13", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1421
|
-
}
|
|
1422
1441
|
const Dropdown = forwardRef(
|
|
1423
1442
|
({
|
|
1424
1443
|
placeholder = "Text label",
|
|
@@ -1446,7 +1465,7 @@ const Dropdown = forwardRef(
|
|
|
1446
1465
|
const state = forceState ?? (open ? "focus" : "default");
|
|
1447
1466
|
const isError = state === "error";
|
|
1448
1467
|
const isFocus = state === "focus";
|
|
1449
|
-
const bg = isDisabled ? "bg-disabled-bg" : "bg-
|
|
1468
|
+
const bg = isDisabled ? "bg-disabled-bg" : "bg-background";
|
|
1450
1469
|
const labelColor = isDisabled ? "var(--disabled)" : "var(--muted-foreground)";
|
|
1451
1470
|
const filledColor = isDisabled ? "var(--disabled)" : "var(--foreground)";
|
|
1452
1471
|
const caretClassName = isDisabled ? "text-disabled" : "text-muted-foreground";
|
|
@@ -1507,17 +1526,17 @@ const Dropdown = forwardRef(
|
|
|
1507
1526
|
if (typeof ref === "function") ref(node);
|
|
1508
1527
|
else if (ref) ref.current = node;
|
|
1509
1528
|
},
|
|
1510
|
-
className: cn("flex flex-col gap-
|
|
1529
|
+
className: cn("flex flex-col gap-1 w-full", className),
|
|
1511
1530
|
children: [
|
|
1512
|
-
label && /* @__PURE__ */ jsx("div", { className: "relative shrink-0 w-full", children: /* @__PURE__ */ jsx("div", { className: "flex items-start px-
|
|
1531
|
+
label && /* @__PURE__ */ jsx("div", { className: "relative shrink-0 w-full", children: /* @__PURE__ */ jsx("div", { className: "flex items-start px-1 w-full", children: /* @__PURE__ */ jsx("p", { className: "leading-5 not-italic relative shrink-0 text-foreground text-sm font-bold whitespace-nowrap", children: label }) }) }),
|
|
1513
1532
|
/* @__PURE__ */ jsxs(
|
|
1514
1533
|
"div",
|
|
1515
1534
|
{
|
|
1516
1535
|
onClick: handleToggle,
|
|
1517
1536
|
className: cn(
|
|
1518
|
-
"relative flex gap-
|
|
1537
|
+
"relative flex gap-2 items-center rounded-lg px-3.5",
|
|
1519
1538
|
bg,
|
|
1520
|
-
hasExternalLabel ? "h-[38px]" : isFilled && !open ? "py-
|
|
1539
|
+
hasExternalLabel ? "h-[38px]" : isFilled && !open ? "py-1.5" : "p-3.5",
|
|
1521
1540
|
!isDisabled && !forceState && "cursor-pointer"
|
|
1522
1541
|
),
|
|
1523
1542
|
children: [
|
|
@@ -1542,7 +1561,7 @@ const Dropdown = forwardRef(
|
|
|
1542
1561
|
onChange: (e) => setSearch(e.target.value),
|
|
1543
1562
|
onKeyDown: handleInputKeyDown,
|
|
1544
1563
|
placeholder: isFilled ? selectedLabel : placeholder + (required ? " *" : ""),
|
|
1545
|
-
className: "flex-1 min-w-0 min-h-[1px] text-
|
|
1564
|
+
className: "flex-1 min-w-0 min-h-[1px] text-sm leading-5 not-italic bg-transparent outline-none border-none p-0 m-0 placeholder:text-disabled",
|
|
1546
1565
|
style: {
|
|
1547
1566
|
color: filledColor,
|
|
1548
1567
|
caretColor: "var(--caret-color)"
|
|
@@ -1593,7 +1612,7 @@ const Dropdown = forwardRef(
|
|
|
1593
1612
|
onChange: (e) => setSearch(e.target.value),
|
|
1594
1613
|
onKeyDown: handleInputKeyDown,
|
|
1595
1614
|
placeholder: placeholder + (required ? " *" : ""),
|
|
1596
|
-
className: "flex-1 min-w-0 min-h-[1px] text-
|
|
1615
|
+
className: "flex-1 min-w-0 min-h-[1px] text-base leading-5 not-italic bg-transparent outline-none border-none p-0 m-0 placeholder:text-muted-foreground",
|
|
1597
1616
|
style: {
|
|
1598
1617
|
color: "var(--foreground)",
|
|
1599
1618
|
caretColor: "var(--caret-color)"
|
|
@@ -1609,7 +1628,7 @@ const Dropdown = forwardRef(
|
|
|
1609
1628
|
/* @__PURE__ */ jsxs(
|
|
1610
1629
|
"p",
|
|
1611
1630
|
{
|
|
1612
|
-
className: "flex-1 min-w-0 min-h-[1px] leading-
|
|
1631
|
+
className: "flex-1 min-w-0 min-h-[1px] leading-5 not-italic text-sm overflow-hidden text-ellipsis whitespace-nowrap",
|
|
1613
1632
|
style: { color: filledColor },
|
|
1614
1633
|
children: [
|
|
1615
1634
|
selectedLabel,
|
|
@@ -1623,7 +1642,7 @@ const Dropdown = forwardRef(
|
|
|
1623
1642
|
/* @__PURE__ */ jsxs(
|
|
1624
1643
|
"p",
|
|
1625
1644
|
{
|
|
1626
|
-
className: "shrink-0 w-full leading-
|
|
1645
|
+
className: "shrink-0 w-full leading-4 not-italic text-xs",
|
|
1627
1646
|
style: { color: labelColor },
|
|
1628
1647
|
children: [
|
|
1629
1648
|
placeholder,
|
|
@@ -1634,7 +1653,7 @@ const Dropdown = forwardRef(
|
|
|
1634
1653
|
/* @__PURE__ */ jsx(
|
|
1635
1654
|
"p",
|
|
1636
1655
|
{
|
|
1637
|
-
className: "w-full leading-
|
|
1656
|
+
className: "w-full leading-5 not-italic text-sm min-w-0 min-h-[1px]",
|
|
1638
1657
|
style: { color: filledColor },
|
|
1639
1658
|
children: selectedLabel
|
|
1640
1659
|
}
|
|
@@ -1647,7 +1666,7 @@ const Dropdown = forwardRef(
|
|
|
1647
1666
|
/* @__PURE__ */ jsx(
|
|
1648
1667
|
"p",
|
|
1649
1668
|
{
|
|
1650
|
-
className: "leading-
|
|
1669
|
+
className: "leading-5 not-italic text-base whitespace-nowrap",
|
|
1651
1670
|
style: { color: labelColor },
|
|
1652
1671
|
children: placeholder
|
|
1653
1672
|
}
|
|
@@ -1655,7 +1674,7 @@ const Dropdown = forwardRef(
|
|
|
1655
1674
|
/* @__PURE__ */ jsx(
|
|
1656
1675
|
"p",
|
|
1657
1676
|
{
|
|
1658
|
-
className: "leading-
|
|
1677
|
+
className: "leading-4 not-italic text-xs w-[7px]",
|
|
1659
1678
|
style: { color: isDisabled ? "var(--disabled)" : "var(--error-dark)" },
|
|
1660
1679
|
children: "*"
|
|
1661
1680
|
}
|
|
@@ -1663,13 +1682,13 @@ const Dropdown = forwardRef(
|
|
|
1663
1682
|
] }) : /* @__PURE__ */ jsx(
|
|
1664
1683
|
"p",
|
|
1665
1684
|
{
|
|
1666
|
-
className: "flex-1 min-w-0 min-h-[1px] text-
|
|
1685
|
+
className: "flex-1 min-w-0 min-h-[1px] text-base leading-5 not-italic overflow-hidden text-ellipsis whitespace-nowrap",
|
|
1667
1686
|
style: { color: labelColor },
|
|
1668
1687
|
children: placeholder
|
|
1669
1688
|
}
|
|
1670
1689
|
)
|
|
1671
1690
|
),
|
|
1672
|
-
isFocus ? /* @__PURE__ */ jsx(
|
|
1691
|
+
isFocus ? /* @__PURE__ */ jsx(CaretUp, { size: 22, className: cn("shrink-0", caretClassName) }) : /* @__PURE__ */ jsx(CaretDown, { size: 22, className: cn("shrink-0", caretClassName) })
|
|
1673
1692
|
]
|
|
1674
1693
|
}
|
|
1675
1694
|
),
|
|
@@ -1677,11 +1696,11 @@ const Dropdown = forwardRef(
|
|
|
1677
1696
|
"div",
|
|
1678
1697
|
{
|
|
1679
1698
|
className: cn(
|
|
1680
|
-
"relative bg-
|
|
1699
|
+
"relative bg-popover rounded-lg overflow-clip p-2 z-20 flex flex-col items-start text-popover-foreground",
|
|
1681
1700
|
filteredOptions.length > 10 && "overflow-y-auto"
|
|
1682
1701
|
),
|
|
1683
1702
|
style: {
|
|
1684
|
-
boxShadow: "
|
|
1703
|
+
boxShadow: "var(--elevation-popover)",
|
|
1685
1704
|
...filteredOptions.length > 10 ? { maxHeight: 10 * 48 + 16 } : {}
|
|
1686
1705
|
},
|
|
1687
1706
|
children: filteredOptions.length > 0 ? filteredOptions.map((opt) => /* @__PURE__ */ jsx(
|
|
@@ -1690,13 +1709,13 @@ const Dropdown = forwardRef(
|
|
|
1690
1709
|
onClick: () => handleSelect(opt.value),
|
|
1691
1710
|
className: cn(
|
|
1692
1711
|
"w-full shrink-0 rounded-[4px] cursor-pointer transition-colors duration-100",
|
|
1693
|
-
opt.value === currentValue ? "bg-primary-action-light" : "bg-
|
|
1712
|
+
opt.value === currentValue ? "bg-primary-action-light" : "bg-popover hover:bg-disabled-bg"
|
|
1694
1713
|
),
|
|
1695
|
-
children: /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsx("div", { className: "flex items-center p-
|
|
1714
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsx("div", { className: "flex items-center p-3.5 relative w-full", children: /* @__PURE__ */ jsx(
|
|
1696
1715
|
"p",
|
|
1697
1716
|
{
|
|
1698
1717
|
className: cn(
|
|
1699
|
-
"flex-1 min-w-0 min-h-[1px] leading-
|
|
1718
|
+
"flex-1 min-w-0 min-h-[1px] leading-5 not-italic overflow-hidden text-sm text-ellipsis whitespace-nowrap",
|
|
1700
1719
|
opt.value === currentValue ? "text-primary-action" : "text-foreground"
|
|
1701
1720
|
),
|
|
1702
1721
|
children: opt.label
|
|
@@ -1704,7 +1723,7 @@ const Dropdown = forwardRef(
|
|
|
1704
1723
|
) }) })
|
|
1705
1724
|
},
|
|
1706
1725
|
opt.value
|
|
1707
|
-
)) : /* @__PURE__ */ jsx("div", { className: "w-full shrink-0 bg-
|
|
1726
|
+
)) : /* @__PURE__ */ jsx("div", { className: "w-full shrink-0 bg-popover", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsx("div", { className: "flex items-center p-[14px] relative w-full", children: /* @__PURE__ */ jsx("p", { className: "flex-1 min-w-0 min-h-[1px] leading-[20px] not-italic text-[14px] text-disabled", children: "No results found" }) }) }) })
|
|
1708
1727
|
}
|
|
1709
1728
|
),
|
|
1710
1729
|
showBelow && /* @__PURE__ */ jsx("div", { className: "flex items-start px-[4px] text-[12px] leading-[16px]", children: /* @__PURE__ */ jsx("span", { className: "flex-1 min-w-0", style: { color: leftColor }, children: leftText }) })
|
|
@@ -1716,34 +1735,6 @@ const Dropdown = forwardRef(
|
|
|
1716
1735
|
Dropdown.displayName = "Dropdown";
|
|
1717
1736
|
const TAG_GAP = 4;
|
|
1718
1737
|
const MAX_COMPONENT_WIDTH = 343;
|
|
1719
|
-
function ChevronDownIcon({ className }) {
|
|
1720
|
-
return /* @__PURE__ */ jsx("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", className, children: /* @__PURE__ */ jsx("path", { d: "M7 9L11 13L15 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1721
|
-
}
|
|
1722
|
-
function ChevronUpIcon({ className }) {
|
|
1723
|
-
return /* @__PURE__ */ jsx("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", className, children: /* @__PURE__ */ jsx("path", { d: "M7 13L11 9L15 13", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1724
|
-
}
|
|
1725
|
-
function XIcon({ color = "var(--muted-foreground)" }) {
|
|
1726
|
-
return /* @__PURE__ */ jsx(
|
|
1727
|
-
"svg",
|
|
1728
|
-
{
|
|
1729
|
-
width: "12",
|
|
1730
|
-
height: "12",
|
|
1731
|
-
viewBox: "0 0 12 12",
|
|
1732
|
-
fill: "none",
|
|
1733
|
-
className: "shrink-0",
|
|
1734
|
-
children: /* @__PURE__ */ jsx(
|
|
1735
|
-
"path",
|
|
1736
|
-
{
|
|
1737
|
-
d: "M9 3L3 9M3 3L9 9",
|
|
1738
|
-
stroke: color,
|
|
1739
|
-
strokeWidth: "1.5",
|
|
1740
|
-
strokeLinecap: "round",
|
|
1741
|
-
strokeLinejoin: "round"
|
|
1742
|
-
}
|
|
1743
|
-
)
|
|
1744
|
-
}
|
|
1745
|
-
);
|
|
1746
|
-
}
|
|
1747
1738
|
function RemovableTag({
|
|
1748
1739
|
label,
|
|
1749
1740
|
disabled,
|
|
@@ -1777,8 +1768,16 @@ function RemovableTag({
|
|
|
1777
1768
|
e.stopPropagation();
|
|
1778
1769
|
onRemove();
|
|
1779
1770
|
},
|
|
1780
|
-
className: "absolute right-[4px] top-1/2 -translate-y-1/2 flex items-center justify-center rounded-[2px] p-[1px] cursor-pointer opacity-0 group-hover:opacity-100 transition-all duration-150 bg-
|
|
1781
|
-
children: /* @__PURE__ */ jsx(
|
|
1771
|
+
className: "absolute right-[4px] top-1/2 -translate-y-1/2 flex items-center justify-center rounded-[2px] p-[1px] cursor-pointer opacity-0 group-hover:opacity-100 transition-all duration-150 bg-surface-clear-hover",
|
|
1772
|
+
children: /* @__PURE__ */ jsx(
|
|
1773
|
+
X,
|
|
1774
|
+
{
|
|
1775
|
+
size: 12,
|
|
1776
|
+
weight: "bold",
|
|
1777
|
+
color: iconColor,
|
|
1778
|
+
className: "shrink-0"
|
|
1779
|
+
}
|
|
1780
|
+
)
|
|
1782
1781
|
}
|
|
1783
1782
|
)
|
|
1784
1783
|
]
|
|
@@ -1811,7 +1810,7 @@ function OverflowBadge({
|
|
|
1811
1810
|
count,
|
|
1812
1811
|
disabled
|
|
1813
1812
|
}) {
|
|
1814
|
-
const bg = disabled ? "bg-
|
|
1813
|
+
const bg = disabled ? "bg-surface-chip-disabled" : "bg-selected-bg";
|
|
1815
1814
|
const textColor = disabled ? "var(--disabled)" : "var(--primary-action)";
|
|
1816
1815
|
return /* @__PURE__ */ jsx(
|
|
1817
1816
|
"div",
|
|
@@ -1834,28 +1833,6 @@ function OverflowBadge({
|
|
|
1834
1833
|
}
|
|
1835
1834
|
);
|
|
1836
1835
|
}
|
|
1837
|
-
function CheckIcon$1(props) {
|
|
1838
|
-
return /* @__PURE__ */ jsx(
|
|
1839
|
-
"svg",
|
|
1840
|
-
{
|
|
1841
|
-
width: "10",
|
|
1842
|
-
height: "8",
|
|
1843
|
-
viewBox: "0 0 10 8",
|
|
1844
|
-
fill: "none",
|
|
1845
|
-
...props,
|
|
1846
|
-
children: /* @__PURE__ */ jsx(
|
|
1847
|
-
"path",
|
|
1848
|
-
{
|
|
1849
|
-
d: "M1 4L3.5 6.5L9 1",
|
|
1850
|
-
stroke: "currentColor",
|
|
1851
|
-
strokeWidth: "1.5",
|
|
1852
|
-
strokeLinecap: "round",
|
|
1853
|
-
strokeLinejoin: "round"
|
|
1854
|
-
}
|
|
1855
|
-
)
|
|
1856
|
-
}
|
|
1857
|
-
);
|
|
1858
|
-
}
|
|
1859
1836
|
function useChipLayout(selectedOptions, measureRef, containerRef) {
|
|
1860
1837
|
const [layout, setLayout] = useState({
|
|
1861
1838
|
visibleCount: selectedOptions.length,
|
|
@@ -1944,7 +1921,7 @@ const DropdownMultiple = forwardRef(
|
|
|
1944
1921
|
const state = forceState ?? (open ? "focus" : "default");
|
|
1945
1922
|
const isError = state === "error";
|
|
1946
1923
|
const isFocus = state === "focus";
|
|
1947
|
-
const bg = isDisabled ? "bg-disabled-bg" : "bg-
|
|
1924
|
+
const bg = isDisabled ? "bg-disabled-bg" : "bg-background";
|
|
1948
1925
|
const labelColor = isDisabled ? "var(--disabled)" : "var(--muted-foreground)";
|
|
1949
1926
|
const caretColor = isDisabled ? "var(--disabled)" : "var(--muted-foreground)";
|
|
1950
1927
|
const borderInset = isFocus || isError ? "-1px" : "0px";
|
|
@@ -2026,7 +2003,7 @@ const DropdownMultiple = forwardRef(
|
|
|
2026
2003
|
/* @__PURE__ */ jsx(
|
|
2027
2004
|
"p",
|
|
2028
2005
|
{
|
|
2029
|
-
className: "shrink-0 leading-
|
|
2006
|
+
className: "shrink-0 leading-4 not-italic text-xs",
|
|
2030
2007
|
style: { color: labelColor },
|
|
2031
2008
|
children: placeholder
|
|
2032
2009
|
}
|
|
@@ -2044,7 +2021,7 @@ const DropdownMultiple = forwardRef(
|
|
|
2044
2021
|
] }) : /* @__PURE__ */ jsx(
|
|
2045
2022
|
"p",
|
|
2046
2023
|
{
|
|
2047
|
-
className: "shrink-0 w-full leading-
|
|
2024
|
+
className: "shrink-0 w-full leading-4 not-italic text-xs",
|
|
2048
2025
|
style: { color: labelColor },
|
|
2049
2026
|
children: placeholder
|
|
2050
2027
|
}
|
|
@@ -2053,7 +2030,7 @@ const DropdownMultiple = forwardRef(
|
|
|
2053
2030
|
/* @__PURE__ */ jsx(
|
|
2054
2031
|
"p",
|
|
2055
2032
|
{
|
|
2056
|
-
className: "leading-
|
|
2033
|
+
className: "leading-5 not-italic text-base whitespace-nowrap",
|
|
2057
2034
|
style: { color: labelColor },
|
|
2058
2035
|
children: placeholder
|
|
2059
2036
|
}
|
|
@@ -2061,7 +2038,7 @@ const DropdownMultiple = forwardRef(
|
|
|
2061
2038
|
/* @__PURE__ */ jsx(
|
|
2062
2039
|
"p",
|
|
2063
2040
|
{
|
|
2064
|
-
className: "leading-
|
|
2041
|
+
className: "leading-4 not-italic text-xs w-[7px]",
|
|
2065
2042
|
style: { color: isDisabled ? "var(--disabled)" : "var(--error-dark)" },
|
|
2066
2043
|
children: "*"
|
|
2067
2044
|
}
|
|
@@ -2069,7 +2046,7 @@ const DropdownMultiple = forwardRef(
|
|
|
2069
2046
|
] }) : /* @__PURE__ */ jsx(
|
|
2070
2047
|
"p",
|
|
2071
2048
|
{
|
|
2072
|
-
className: "flex-1 min-w-0 min-h-[1px] text-
|
|
2049
|
+
className: "flex-1 min-w-0 min-h-[1px] text-base leading-5 not-italic overflow-hidden text-ellipsis whitespace-nowrap py-[7px]",
|
|
2073
2050
|
style: { color: labelColor },
|
|
2074
2051
|
children: placeholder
|
|
2075
2052
|
}
|
|
@@ -2079,7 +2056,7 @@ const DropdownMultiple = forwardRef(
|
|
|
2079
2056
|
{
|
|
2080
2057
|
ref: measureRef,
|
|
2081
2058
|
"aria-hidden": true,
|
|
2082
|
-
className: "absolute flex gap-
|
|
2059
|
+
className: "absolute flex gap-1 items-center pointer-events-none",
|
|
2083
2060
|
style: {
|
|
2084
2061
|
visibility: "hidden",
|
|
2085
2062
|
top: 0,
|
|
@@ -2222,8 +2199,8 @@ const DropdownMultiple = forwardRef(
|
|
|
2222
2199
|
className: cn(
|
|
2223
2200
|
"relative flex gap-[8px] items-center rounded-[8px]",
|
|
2224
2201
|
bg,
|
|
2225
|
-
"px-
|
|
2226
|
-
hasExternalLabel ? "h-
|
|
2202
|
+
"px-3.5",
|
|
2203
|
+
hasExternalLabel ? "h-10" : "py-1 min-h-12",
|
|
2227
2204
|
!isDisabled && !isStatic && "cursor-pointer"
|
|
2228
2205
|
),
|
|
2229
2206
|
children: [
|
|
@@ -2253,16 +2230,16 @@ const DropdownMultiple = forwardRef(
|
|
|
2253
2230
|
)
|
|
2254
2231
|
}
|
|
2255
2232
|
),
|
|
2256
|
-
/* @__PURE__ */ jsx("span", { className: "shrink-0", style: { color: caretColor }, children: isFocus ? /* @__PURE__ */ jsx(
|
|
2233
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0", style: { color: caretColor }, children: isFocus ? /* @__PURE__ */ jsx(CaretUp, { size: 22 }) : /* @__PURE__ */ jsx(CaretDown, { size: 22 }) })
|
|
2257
2234
|
]
|
|
2258
2235
|
}
|
|
2259
2236
|
),
|
|
2260
2237
|
open && !isStatic && options.length > 0 && /* @__PURE__ */ jsx(
|
|
2261
2238
|
"div",
|
|
2262
2239
|
{
|
|
2263
|
-
className: "relative bg-
|
|
2240
|
+
className: "relative bg-popover rounded-[8px] overflow-clip p-[8px] z-20 flex flex-col items-start text-popover-foreground",
|
|
2264
2241
|
style: {
|
|
2265
|
-
boxShadow: "
|
|
2242
|
+
boxShadow: "var(--elevation-popover)"
|
|
2266
2243
|
},
|
|
2267
2244
|
children: /* @__PURE__ */ jsx(
|
|
2268
2245
|
"div",
|
|
@@ -2285,7 +2262,7 @@ const DropdownMultiple = forwardRef(
|
|
|
2285
2262
|
},
|
|
2286
2263
|
className: cn(
|
|
2287
2264
|
"w-full shrink-0 rounded-[4px] cursor-pointer transition-colors duration-100",
|
|
2288
|
-
isSelected ? "bg-primary-action-light" : "bg-
|
|
2265
|
+
isSelected ? "bg-primary-action-light" : "bg-popover hover:bg-disabled-bg"
|
|
2289
2266
|
),
|
|
2290
2267
|
children: /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-[8px] p-[14px] relative w-full", children: [
|
|
2291
2268
|
/* @__PURE__ */ jsx(
|
|
@@ -2305,14 +2282,21 @@ const DropdownMultiple = forwardRef(
|
|
|
2305
2282
|
"shrink-0 w-[16px] h-[16px] rounded-[3px] flex items-center justify-center transition-colors duration-100",
|
|
2306
2283
|
"bg-transparent"
|
|
2307
2284
|
),
|
|
2308
|
-
children: isSelected && /* @__PURE__ */ jsx(
|
|
2285
|
+
children: isSelected && /* @__PURE__ */ jsx(
|
|
2286
|
+
Check,
|
|
2287
|
+
{
|
|
2288
|
+
size: 12,
|
|
2289
|
+
weight: "bold",
|
|
2290
|
+
className: "text-primary-action"
|
|
2291
|
+
}
|
|
2292
|
+
)
|
|
2309
2293
|
}
|
|
2310
2294
|
)
|
|
2311
2295
|
] }) })
|
|
2312
2296
|
},
|
|
2313
2297
|
opt.value
|
|
2314
2298
|
);
|
|
2315
|
-
}) : /* @__PURE__ */ jsx("div", { className: "w-full shrink-0 bg-
|
|
2299
|
+
}) : /* @__PURE__ */ jsx("div", { className: "w-full shrink-0 bg-popover", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsx("div", { className: "flex items-center p-[14px] relative w-full", children: /* @__PURE__ */ jsx("p", { className: "flex-1 min-w-0 min-h-[1px] leading-[20px] not-italic text-[14px] text-disabled", children: "No results found" }) }) }) })
|
|
2316
2300
|
}
|
|
2317
2301
|
)
|
|
2318
2302
|
}
|
|
@@ -2349,6 +2333,7 @@ const Input = forwardRef(function Input2({
|
|
|
2349
2333
|
onFocus: onFocusProp,
|
|
2350
2334
|
onBlur: onBlurProp,
|
|
2351
2335
|
disabled: _disabledProp,
|
|
2336
|
+
maxLength: maxLengthProp,
|
|
2352
2337
|
...inputRest
|
|
2353
2338
|
}, ref) {
|
|
2354
2339
|
const [focused, setFocused] = useState(false);
|
|
@@ -2360,7 +2345,7 @@ const Input = forwardRef(function Input2({
|
|
|
2360
2345
|
const isError = state === "error";
|
|
2361
2346
|
const isFocus = state === "focus";
|
|
2362
2347
|
const isFilled = currentValue.length > 0;
|
|
2363
|
-
const bg = isDisabled ? "bg-disabled-bg" : "bg-
|
|
2348
|
+
const bg = isDisabled ? "bg-disabled-bg" : "bg-background";
|
|
2364
2349
|
const floatLabel = isDisabled ? "var(--disabled)" : "var(--muted-foreground)";
|
|
2365
2350
|
const filledValue = isDisabled ? "var(--disabled)" : "var(--foreground)";
|
|
2366
2351
|
const unitColor = isDisabled ? "var(--disabled)" : "var(--muted-foreground)";
|
|
@@ -2368,14 +2353,19 @@ const Input = forwardRef(function Input2({
|
|
|
2368
2353
|
const borderRad = isFocus || isError ? "9px" : "8px";
|
|
2369
2354
|
const borderColor = isDisabled ? "var(--border-disabled)" : isError ? "var(--destructive)" : isFocus ? "var(--primary-action)" : "var(--border)";
|
|
2370
2355
|
const hasRight = Boolean(rightIcon) || Boolean(unit);
|
|
2371
|
-
const padding = isFilled ? "px-[14px] py-[6px]" : hasRight ? "px-[14px] py-[
|
|
2356
|
+
const padding = isFilled ? "px-[14px] py-[6px]" : hasRight ? "px-[14px] py-[14px]" : "p-[14px]";
|
|
2372
2357
|
const charCount = currentValue.length;
|
|
2373
2358
|
const showBelow = isError || Boolean(helperText) || showCount;
|
|
2374
2359
|
const leftText = isError ? errorMessage : helperText ?? "";
|
|
2375
2360
|
const leftColor = isError ? "var(--destructive)" : "var(--muted-foreground)";
|
|
2376
2361
|
const handleChange = (e) => {
|
|
2377
|
-
if (
|
|
2378
|
-
|
|
2362
|
+
if (isDisabled) return;
|
|
2363
|
+
let next = e.target.value;
|
|
2364
|
+
if (showCount && maxCount >= 0 && next.length > maxCount) {
|
|
2365
|
+
next = next.slice(0, maxCount);
|
|
2366
|
+
}
|
|
2367
|
+
if (!controlled) setInternalValue(next);
|
|
2368
|
+
onChange == null ? void 0 : onChange(next);
|
|
2379
2369
|
};
|
|
2380
2370
|
const handleFocus = (e) => {
|
|
2381
2371
|
onFocusProp == null ? void 0 : onFocusProp(e);
|
|
@@ -2389,12 +2379,12 @@ const Input = forwardRef(function Input2({
|
|
|
2389
2379
|
const inputCaretStyle = {
|
|
2390
2380
|
caretColor: "var(--caret-color)"
|
|
2391
2381
|
};
|
|
2392
|
-
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-
|
|
2382
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-1 w-full", className), children: [
|
|
2393
2383
|
/* @__PURE__ */ jsxs(
|
|
2394
2384
|
"div",
|
|
2395
2385
|
{
|
|
2396
2386
|
className: cn(
|
|
2397
|
-
"relative rounded-
|
|
2387
|
+
"relative rounded-lg",
|
|
2398
2388
|
padding,
|
|
2399
2389
|
bg,
|
|
2400
2390
|
containerFlex
|
|
@@ -2425,14 +2415,15 @@ const Input = forwardRef(function Input2({
|
|
|
2425
2415
|
{
|
|
2426
2416
|
className: cn(
|
|
2427
2417
|
"shrink-0 w-full not-italic",
|
|
2428
|
-
isFilled ? "leading-
|
|
2418
|
+
isFilled ? "leading-4 text-xs" : "text-base leading-5 pointer-events-none"
|
|
2429
2419
|
),
|
|
2430
2420
|
style: { color: floatLabel },
|
|
2431
2421
|
children: [
|
|
2432
2422
|
placeholder,
|
|
2433
|
-
required &&
|
|
2423
|
+
required && /* @__PURE__ */ jsx(
|
|
2434
2424
|
"span",
|
|
2435
2425
|
{
|
|
2426
|
+
className: "text-xs leading-4",
|
|
2436
2427
|
style: {
|
|
2437
2428
|
color: isDisabled ? "var(--disabled)" : "var(--error-dark)"
|
|
2438
2429
|
},
|
|
@@ -2442,7 +2433,7 @@ const Input = forwardRef(function Input2({
|
|
|
2442
2433
|
]
|
|
2443
2434
|
}
|
|
2444
2435
|
),
|
|
2445
|
-
|
|
2436
|
+
/* @__PURE__ */ jsx(
|
|
2446
2437
|
"input",
|
|
2447
2438
|
{
|
|
2448
2439
|
...inputRest,
|
|
@@ -2452,10 +2443,14 @@ const Input = forwardRef(function Input2({
|
|
|
2452
2443
|
onFocus: handleFocus,
|
|
2453
2444
|
onBlur: handleBlur,
|
|
2454
2445
|
disabled: isDisabled,
|
|
2446
|
+
maxLength: showCount ? maxCount : maxLengthProp,
|
|
2455
2447
|
"aria-label": placeholder,
|
|
2456
2448
|
className: cn(
|
|
2457
2449
|
"w-full bg-transparent outline-none border-none min-w-0",
|
|
2458
|
-
isFilled ? "leading-
|
|
2450
|
+
isFilled ? "leading-5 not-italic text-sm p-0 m-0" : cn(
|
|
2451
|
+
"absolute inset-0 h-full text-base",
|
|
2452
|
+
isDisabled ? "cursor-not-allowed" : "cursor-text"
|
|
2453
|
+
)
|
|
2459
2454
|
),
|
|
2460
2455
|
style: isFilled ? { ...inputStyleProp, color: filledValue, ...inputCaretStyle } : {
|
|
2461
2456
|
...inputStyleProp,
|
|
@@ -2483,7 +2478,7 @@ const Input = forwardRef(function Input2({
|
|
|
2483
2478
|
"p",
|
|
2484
2479
|
{
|
|
2485
2480
|
className: cn(
|
|
2486
|
-
"shrink-0 whitespace-nowrap text-[16px]",
|
|
2481
|
+
"shrink-0 whitespace-nowrap text-[16px] leading-[20px]",
|
|
2487
2482
|
!isFilled && "relative"
|
|
2488
2483
|
),
|
|
2489
2484
|
style: {
|
|
@@ -2497,7 +2492,7 @@ const Input = forwardRef(function Input2({
|
|
|
2497
2492
|
]
|
|
2498
2493
|
}
|
|
2499
2494
|
),
|
|
2500
|
-
showBelow && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-
|
|
2495
|
+
showBelow && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 px-1 text-xs leading-4", children: [
|
|
2501
2496
|
leftText ? /* @__PURE__ */ jsx("span", { className: "flex-1 min-w-0", style: { color: leftColor }, children: leftText }) : showCount && /* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
2502
2497
|
showCount && /* @__PURE__ */ jsxs(
|
|
2503
2498
|
"span",
|
|
@@ -2515,28 +2510,6 @@ const Input = forwardRef(function Input2({
|
|
|
2515
2510
|
] });
|
|
2516
2511
|
});
|
|
2517
2512
|
Input.displayName = "Input";
|
|
2518
|
-
function CheckIcon(props) {
|
|
2519
|
-
return /* @__PURE__ */ jsx(
|
|
2520
|
-
"svg",
|
|
2521
|
-
{
|
|
2522
|
-
width: "16",
|
|
2523
|
-
height: "11",
|
|
2524
|
-
viewBox: "0 0 16 11",
|
|
2525
|
-
fill: "none",
|
|
2526
|
-
...props,
|
|
2527
|
-
children: /* @__PURE__ */ jsx(
|
|
2528
|
-
"path",
|
|
2529
|
-
{
|
|
2530
|
-
d: "M1 5.5L5.5 10L15 1",
|
|
2531
|
-
stroke: "currentColor",
|
|
2532
|
-
strokeWidth: "1.5",
|
|
2533
|
-
strokeLinecap: "round",
|
|
2534
|
-
strokeLinejoin: "round"
|
|
2535
|
-
}
|
|
2536
|
-
)
|
|
2537
|
-
}
|
|
2538
|
-
);
|
|
2539
|
-
}
|
|
2540
2513
|
const OptionList = forwardRef(
|
|
2541
2514
|
function OptionList2({
|
|
2542
2515
|
options,
|
|
@@ -2565,17 +2538,17 @@ const OptionList = forwardRef(
|
|
|
2565
2538
|
{
|
|
2566
2539
|
ref,
|
|
2567
2540
|
className: cn(
|
|
2568
|
-
"flex flex-col items-start overflow-clip rounded-
|
|
2541
|
+
"flex flex-col items-start overflow-clip rounded-lg bg-popover px-2 py-2 text-popover-foreground",
|
|
2569
2542
|
className
|
|
2570
2543
|
),
|
|
2571
2544
|
style: {
|
|
2572
|
-
boxShadow: "
|
|
2545
|
+
boxShadow: "var(--elevation-popover)",
|
|
2573
2546
|
...isScrollable ? { maxHeight, overflowY: "auto" } : {}
|
|
2574
2547
|
},
|
|
2575
2548
|
children: options.length > 0 ? options.map((opt) => {
|
|
2576
2549
|
const selected = isSelected(opt.value);
|
|
2577
2550
|
const disabled = opt.disabled === true;
|
|
2578
|
-
const rowBg = disabled ? "bg-disabled-bg" : selected ? "bg-selected-bg" : "bg-
|
|
2551
|
+
const rowBg = disabled ? "bg-disabled-bg" : selected ? "bg-selected-bg" : "bg-popover hover:bg-selected-bg";
|
|
2579
2552
|
return /* @__PURE__ */ jsx(
|
|
2580
2553
|
"div",
|
|
2581
2554
|
{
|
|
@@ -2585,11 +2558,11 @@ const OptionList = forwardRef(
|
|
|
2585
2558
|
rowBg,
|
|
2586
2559
|
disabled ? "cursor-default" : "cursor-pointer"
|
|
2587
2560
|
),
|
|
2588
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-
|
|
2561
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-2 p-3.5", children: [
|
|
2589
2562
|
opt.icon && /* @__PURE__ */ jsx(
|
|
2590
2563
|
"span",
|
|
2591
2564
|
{
|
|
2592
|
-
className: "flex
|
|
2565
|
+
className: "flex h-5 w-5 shrink-0 items-center justify-center overflow-clip",
|
|
2593
2566
|
style: {
|
|
2594
2567
|
color: disabled ? "var(--disabled)" : "var(--muted-foreground)"
|
|
2595
2568
|
},
|
|
@@ -2599,19 +2572,26 @@ const OptionList = forwardRef(
|
|
|
2599
2572
|
/* @__PURE__ */ jsx(
|
|
2600
2573
|
"p",
|
|
2601
2574
|
{
|
|
2602
|
-
className: "min-h-[1px] min-w-0 flex-1 overflow-hidden text-
|
|
2575
|
+
className: "min-h-[1px] min-w-0 flex-1 overflow-hidden text-sm leading-5 text-ellipsis whitespace-nowrap not-italic",
|
|
2603
2576
|
style: {
|
|
2604
2577
|
color: disabled ? "var(--disabled)" : "var(--foreground)"
|
|
2605
2578
|
},
|
|
2606
2579
|
children: opt.label
|
|
2607
2580
|
}
|
|
2608
2581
|
),
|
|
2609
|
-
selected && /* @__PURE__ */ jsx("span", { className: "flex
|
|
2582
|
+
selected && /* @__PURE__ */ jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
2583
|
+
Check,
|
|
2584
|
+
{
|
|
2585
|
+
size: 16,
|
|
2586
|
+
weight: "bold",
|
|
2587
|
+
className: "text-primary-action"
|
|
2588
|
+
}
|
|
2589
|
+
) })
|
|
2610
2590
|
] })
|
|
2611
2591
|
},
|
|
2612
2592
|
opt.value
|
|
2613
2593
|
);
|
|
2614
|
-
}) : /* @__PURE__ */ jsx("div", { className: "w-full shrink-0 bg-
|
|
2594
|
+
}) : /* @__PURE__ */ jsx("div", { className: "w-full shrink-0 bg-popover", children: /* @__PURE__ */ jsx("div", { className: "flex w-full items-center p-3.5", children: /* @__PURE__ */ jsx("p", { className: "min-h-[1px] min-w-0 flex-1 text-sm leading-5 not-italic text-disabled", children: emptyText }) }) })
|
|
2615
2595
|
}
|
|
2616
2596
|
);
|
|
2617
2597
|
}
|
|
@@ -2633,8 +2613,8 @@ const SearchInput = forwardRef(
|
|
|
2633
2613
|
const currentValue = controlled ? value : internalValue;
|
|
2634
2614
|
const isFilled = currentValue.length > 0;
|
|
2635
2615
|
const iconSize = size === "lg" ? 24 : 22;
|
|
2636
|
-
const minHeight = size === "sm" ? "
|
|
2637
|
-
const padding = size === "sm" ? "px-
|
|
2616
|
+
const minHeight = size === "sm" ? "h-[38px]" : "";
|
|
2617
|
+
const padding = size === "sm" ? "px-3.5 py-2" : "px-3.5 py-3";
|
|
2638
2618
|
const borderInset = focused ? "-1px" : "0px";
|
|
2639
2619
|
const borderRad = focused ? "9px" : "8px";
|
|
2640
2620
|
const borderColor = focused ? "var(--primary-action)" : "var(--border)";
|
|
@@ -2654,7 +2634,7 @@ const SearchInput = forwardRef(
|
|
|
2654
2634
|
{
|
|
2655
2635
|
ref,
|
|
2656
2636
|
className: cn(
|
|
2657
|
-
"relative flex cursor-text items-center gap-
|
|
2637
|
+
"relative flex cursor-text items-center gap-2 rounded-lg bg-background",
|
|
2658
2638
|
padding,
|
|
2659
2639
|
minHeight,
|
|
2660
2640
|
className
|
|
@@ -2680,7 +2660,7 @@ const SearchInput = forwardRef(
|
|
|
2680
2660
|
MagnifyingGlass,
|
|
2681
2661
|
{
|
|
2682
2662
|
size: iconSize,
|
|
2683
|
-
color: "var(--muted-foreground)",
|
|
2663
|
+
color: focused ? "var(--subtle-text)" : "var(--muted-foreground)",
|
|
2684
2664
|
weight: "regular"
|
|
2685
2665
|
}
|
|
2686
2666
|
) }),
|
|
@@ -2688,7 +2668,7 @@ const SearchInput = forwardRef(
|
|
|
2688
2668
|
!isFilled && /* @__PURE__ */ jsx(
|
|
2689
2669
|
"p",
|
|
2690
2670
|
{
|
|
2691
|
-
className: "pointer-events-none absolute inset-0 flex items-center text-
|
|
2671
|
+
className: "pointer-events-none absolute inset-0 flex items-center text-base leading-5 not-italic",
|
|
2692
2672
|
style: { color: "var(--muted-foreground)" },
|
|
2693
2673
|
children: placeholder
|
|
2694
2674
|
}
|
|
@@ -2703,7 +2683,7 @@ const SearchInput = forwardRef(
|
|
|
2703
2683
|
onChange: (e) => handleChange(e.target.value),
|
|
2704
2684
|
onFocus: () => setFocused(true),
|
|
2705
2685
|
onBlur: () => setFocused(false),
|
|
2706
|
-
className: "m-0 w-full border-none bg-transparent p-0 text-
|
|
2686
|
+
className: "m-0 w-full border-none bg-transparent p-0 text-base leading-5 outline-none",
|
|
2707
2687
|
style: {
|
|
2708
2688
|
color: isFilled ? "var(--foreground)" : "transparent",
|
|
2709
2689
|
caretColor: "var(--caret-color)"
|
|
@@ -2737,33 +2717,50 @@ const SearchInput = forwardRef(
|
|
|
2737
2717
|
SearchInput.displayName = "SearchInput";
|
|
2738
2718
|
const sizeClasses = {
|
|
2739
2719
|
lg: {
|
|
2740
|
-
pad: "px-
|
|
2741
|
-
text: "text-
|
|
2742
|
-
leading: "leading-
|
|
2743
|
-
font: "font-bold"
|
|
2720
|
+
pad: "px-3 py-2.5",
|
|
2721
|
+
text: "text-sm",
|
|
2722
|
+
leading: "leading-5",
|
|
2723
|
+
font: "font-bold",
|
|
2724
|
+
gap: "gap-1.5",
|
|
2725
|
+
iconSize: "h-5 w-5",
|
|
2726
|
+
badgeClass: "min-w-[18px] px-[5.5px] text-[length:var(--text-xs)] leading-[var(--leading-4)]"
|
|
2744
2727
|
},
|
|
2745
2728
|
md: {
|
|
2746
|
-
pad: "px-
|
|
2747
|
-
text: "text-
|
|
2748
|
-
leading: "leading-
|
|
2749
|
-
font: "font-bold"
|
|
2729
|
+
pad: "px-2.5 py-2",
|
|
2730
|
+
text: "text-sm",
|
|
2731
|
+
leading: "leading-5",
|
|
2732
|
+
font: "font-bold",
|
|
2733
|
+
gap: "gap-1.5",
|
|
2734
|
+
iconSize: "h-[18px] w-[18px]",
|
|
2735
|
+
badgeClass: "min-w-[18px] px-[5.5px] text-[length:var(--text-xs)] leading-[var(--leading-4)]"
|
|
2750
2736
|
},
|
|
2751
2737
|
sm: {
|
|
2752
|
-
pad: "px-
|
|
2753
|
-
text: "text-
|
|
2754
|
-
leading: "leading-
|
|
2755
|
-
font: "font-semibold"
|
|
2738
|
+
pad: "px-2 py-1.5",
|
|
2739
|
+
text: "text-xs",
|
|
2740
|
+
leading: "leading-4",
|
|
2741
|
+
font: "font-semibold",
|
|
2742
|
+
gap: "gap-1",
|
|
2743
|
+
iconSize: "h-4 w-4",
|
|
2744
|
+
badgeClass: "min-h-[14px] px-1 text-[length:var(--text-xxs)] leading-[var(--leading-3)]"
|
|
2756
2745
|
}
|
|
2757
2746
|
};
|
|
2747
|
+
function DefaultTabIcon({ className }) {
|
|
2748
|
+
return /* @__PURE__ */ jsx(Circle, { "aria-hidden": "true", weight: "regular", className: cn("shrink-0", className) });
|
|
2749
|
+
}
|
|
2758
2750
|
const Tab = forwardRef(function Tab2({
|
|
2759
2751
|
title = "Tab",
|
|
2760
2752
|
size = "md",
|
|
2761
2753
|
active = false,
|
|
2762
2754
|
disabled = false,
|
|
2763
2755
|
onClick,
|
|
2764
|
-
className
|
|
2756
|
+
className,
|
|
2757
|
+
icon,
|
|
2758
|
+
notification
|
|
2765
2759
|
}, ref) {
|
|
2766
2760
|
const s = sizeClasses[size];
|
|
2761
|
+
const hasIcon = Boolean(icon);
|
|
2762
|
+
const hasNotification = notification !== void 0 && notification !== null;
|
|
2763
|
+
const renderedIcon = icon === true ? /* @__PURE__ */ jsx(DefaultTabIcon, { className: s.iconSize }) : icon;
|
|
2767
2764
|
const textColor = disabled ? "text-disabled" : active ? "text-primary-action" : "text-muted-foreground";
|
|
2768
2765
|
const borderColor = active && !disabled ? "border-primary-action" : "border-border";
|
|
2769
2766
|
const cursor = disabled ? "cursor-not-allowed" : "cursor-pointer";
|
|
@@ -2777,8 +2774,9 @@ const Tab = forwardRef(function Tab2({
|
|
|
2777
2774
|
"aria-disabled": disabled,
|
|
2778
2775
|
onClick: !disabled ? onClick : void 0,
|
|
2779
2776
|
className: cn(
|
|
2780
|
-
"relative flex min-w-[80px] select-none items-center justify-center bg-
|
|
2777
|
+
"relative flex min-w-[80px] select-none items-center justify-center bg-background transition-colors duration-150",
|
|
2781
2778
|
s.pad,
|
|
2779
|
+
(hasIcon || hasNotification) && s.gap,
|
|
2782
2780
|
cursor,
|
|
2783
2781
|
hoverBg,
|
|
2784
2782
|
className
|
|
@@ -2794,11 +2792,24 @@ const Tab = forwardRef(function Tab2({
|
|
|
2794
2792
|
)
|
|
2795
2793
|
}
|
|
2796
2794
|
),
|
|
2795
|
+
hasIcon && /* @__PURE__ */ jsx(
|
|
2796
|
+
"span",
|
|
2797
|
+
{
|
|
2798
|
+
"aria-hidden": "true",
|
|
2799
|
+
className: cn(
|
|
2800
|
+
"relative shrink-0",
|
|
2801
|
+
s.iconSize,
|
|
2802
|
+
disabled ? "text-disabled" : active ? "text-primary-action" : "text-muted-foreground"
|
|
2803
|
+
),
|
|
2804
|
+
children: renderedIcon
|
|
2805
|
+
}
|
|
2806
|
+
),
|
|
2797
2807
|
/* @__PURE__ */ jsx(
|
|
2798
2808
|
"span",
|
|
2799
2809
|
{
|
|
2800
2810
|
className: cn(
|
|
2801
2811
|
"relative overflow-hidden text-ellipsis whitespace-nowrap text-center",
|
|
2812
|
+
hasIcon && hasNotification && "flex-1 min-w-px",
|
|
2802
2813
|
s.text,
|
|
2803
2814
|
s.leading,
|
|
2804
2815
|
s.font,
|
|
@@ -2806,6 +2817,16 @@ const Tab = forwardRef(function Tab2({
|
|
|
2806
2817
|
),
|
|
2807
2818
|
children: title
|
|
2808
2819
|
}
|
|
2820
|
+
),
|
|
2821
|
+
hasNotification && /* @__PURE__ */ jsx(
|
|
2822
|
+
"span",
|
|
2823
|
+
{
|
|
2824
|
+
className: cn(
|
|
2825
|
+
"relative flex shrink-0 items-center justify-center rounded-[60px] bg-visual-red-default text-center font-normal text-on-visual-red",
|
|
2826
|
+
s.badgeClass
|
|
2827
|
+
),
|
|
2828
|
+
children: notification
|
|
2829
|
+
}
|
|
2809
2830
|
)
|
|
2810
2831
|
]
|
|
2811
2832
|
}
|
|
@@ -2821,6 +2842,8 @@ const TabGroup = forwardRef(
|
|
|
2821
2842
|
size,
|
|
2822
2843
|
active: item.id === activeId,
|
|
2823
2844
|
disabled: item.disabled,
|
|
2845
|
+
icon: item.icon,
|
|
2846
|
+
notification: item.notification,
|
|
2824
2847
|
onClick: () => onChange == null ? void 0 : onChange(item.id)
|
|
2825
2848
|
},
|
|
2826
2849
|
item.id
|
|
@@ -2828,6 +2851,112 @@ const TabGroup = forwardRef(
|
|
|
2828
2851
|
}
|
|
2829
2852
|
);
|
|
2830
2853
|
TabGroup.displayName = "TabGroup";
|
|
2854
|
+
const sizeStyles = {
|
|
2855
|
+
large: {
|
|
2856
|
+
container: "px-2 py-1",
|
|
2857
|
+
text: "text-xs leading-4",
|
|
2858
|
+
closeIcon: "h-4 w-4",
|
|
2859
|
+
closeButton: "h-4 w-4"
|
|
2860
|
+
},
|
|
2861
|
+
small: {
|
|
2862
|
+
container: "px-1 py-0.5",
|
|
2863
|
+
text: "text-xxs leading-3",
|
|
2864
|
+
closeIcon: "h-3.5 w-3.5",
|
|
2865
|
+
closeButton: "h-3.5 w-3.5"
|
|
2866
|
+
}
|
|
2867
|
+
};
|
|
2868
|
+
const variantStyles = {
|
|
2869
|
+
blue: {
|
|
2870
|
+
bg: "bg-[var(--fill-blue-50)]",
|
|
2871
|
+
text: "text-[var(--fill-blue-700)]"
|
|
2872
|
+
},
|
|
2873
|
+
green: {
|
|
2874
|
+
bg: "bg-[var(--fill-green-100)]",
|
|
2875
|
+
text: "text-[var(--fill-green-600)]"
|
|
2876
|
+
},
|
|
2877
|
+
yellow: {
|
|
2878
|
+
bg: "bg-[var(--fill-yellow-100)]",
|
|
2879
|
+
text: "text-[var(--fill-yellow-600)]"
|
|
2880
|
+
},
|
|
2881
|
+
red: {
|
|
2882
|
+
bg: "bg-[var(--fill-red-100)]",
|
|
2883
|
+
text: "text-[var(--fill-red-600)]"
|
|
2884
|
+
},
|
|
2885
|
+
gray: {
|
|
2886
|
+
bg: "bg-[var(--fill-gray-100)]",
|
|
2887
|
+
text: "text-subtle-text"
|
|
2888
|
+
},
|
|
2889
|
+
lime: {
|
|
2890
|
+
bg: "bg-[var(--fill-lime-100)]",
|
|
2891
|
+
text: "text-[var(--fill-lime-600)]"
|
|
2892
|
+
}
|
|
2893
|
+
};
|
|
2894
|
+
function CircleIcon({ disabled }) {
|
|
2895
|
+
return /* @__PURE__ */ jsx(
|
|
2896
|
+
Circle,
|
|
2897
|
+
{
|
|
2898
|
+
"aria-hidden": "true",
|
|
2899
|
+
weight: "regular",
|
|
2900
|
+
className: "h-3.5 w-3.5 shrink-0",
|
|
2901
|
+
color: disabled ? "var(--disabled)" : "var(--subtle-text)"
|
|
2902
|
+
}
|
|
2903
|
+
);
|
|
2904
|
+
}
|
|
2905
|
+
function CloseIcon({ disabled, className }) {
|
|
2906
|
+
return /* @__PURE__ */ jsx(
|
|
2907
|
+
X,
|
|
2908
|
+
{
|
|
2909
|
+
"aria-hidden": "true",
|
|
2910
|
+
weight: "regular",
|
|
2911
|
+
className: cn("shrink-0", className),
|
|
2912
|
+
color: disabled ? "var(--disabled)" : "var(--subtle-text)"
|
|
2913
|
+
}
|
|
2914
|
+
);
|
|
2915
|
+
}
|
|
2916
|
+
const Tag = forwardRef(function Tag2({
|
|
2917
|
+
text = "Tag",
|
|
2918
|
+
size = "large",
|
|
2919
|
+
state = "default",
|
|
2920
|
+
variant = "gray",
|
|
2921
|
+
icon = false,
|
|
2922
|
+
close = false,
|
|
2923
|
+
className
|
|
2924
|
+
}, ref) {
|
|
2925
|
+
const isDisabled = state === "disabled";
|
|
2926
|
+
const s = sizeStyles[size] ?? sizeStyles.large;
|
|
2927
|
+
const v = variantStyles[variant] ?? variantStyles.gray;
|
|
2928
|
+
const bgClass = state === "disabled" ? "bg-disabled-bg" : state === "hover" ? "bg-hover-bg" : v.bg;
|
|
2929
|
+
const textClass = isDisabled ? "text-disabled" : v.text;
|
|
2930
|
+
return /* @__PURE__ */ jsxs(
|
|
2931
|
+
"div",
|
|
2932
|
+
{
|
|
2933
|
+
ref,
|
|
2934
|
+
className: cn(
|
|
2935
|
+
"inline-flex items-center justify-center rounded-[4px]",
|
|
2936
|
+
(icon || close) && "gap-[2px]",
|
|
2937
|
+
s.container,
|
|
2938
|
+
bgClass,
|
|
2939
|
+
className
|
|
2940
|
+
),
|
|
2941
|
+
children: [
|
|
2942
|
+
icon && /* @__PURE__ */ jsx(CircleIcon, { disabled: isDisabled }),
|
|
2943
|
+
/* @__PURE__ */ jsx("span", { className: cn("whitespace-nowrap font-normal", s.text, textClass), children: text }),
|
|
2944
|
+
close && /* @__PURE__ */ jsx(
|
|
2945
|
+
"span",
|
|
2946
|
+
{
|
|
2947
|
+
className: cn(
|
|
2948
|
+
"inline-flex items-center justify-center rounded-[2px] transition-colors",
|
|
2949
|
+
s.closeButton,
|
|
2950
|
+
!isDisabled && "cursor-pointer hover:bg-black/10"
|
|
2951
|
+
),
|
|
2952
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { disabled: isDisabled, className: s.closeIcon })
|
|
2953
|
+
}
|
|
2954
|
+
)
|
|
2955
|
+
]
|
|
2956
|
+
}
|
|
2957
|
+
);
|
|
2958
|
+
});
|
|
2959
|
+
Tag.displayName = "Tag";
|
|
2831
2960
|
const TextArea = forwardRef(
|
|
2832
2961
|
function TextArea2({
|
|
2833
2962
|
placeholder = "Text label",
|
|
@@ -2870,13 +2999,13 @@ const TextArea = forwardRef(
|
|
|
2870
2999
|
if (!controlled) setInternalValue(newValue);
|
|
2871
3000
|
onChange == null ? void 0 : onChange(newValue);
|
|
2872
3001
|
};
|
|
2873
|
-
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex w-full flex-col gap-
|
|
3002
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex w-full flex-col gap-1", className), children: [
|
|
2874
3003
|
/* @__PURE__ */ jsxs(
|
|
2875
3004
|
"div",
|
|
2876
3005
|
{
|
|
2877
3006
|
className: cn(
|
|
2878
|
-
"relative h-[116px] rounded-
|
|
2879
|
-
isDisabled ? "bg-disabled-bg" : "bg-
|
|
3007
|
+
"relative h-[116px] rounded-lg",
|
|
3008
|
+
isDisabled ? "bg-disabled-bg" : "bg-background"
|
|
2880
3009
|
),
|
|
2881
3010
|
children: [
|
|
2882
3011
|
/* @__PURE__ */ jsx(
|
|
@@ -2887,13 +3016,27 @@ const TextArea = forwardRef(
|
|
|
2887
3016
|
style: { inset: borderInset, borderRadius: borderRad, borderColor }
|
|
2888
3017
|
}
|
|
2889
3018
|
),
|
|
2890
|
-
isFilled ? /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full flex-col
|
|
2891
|
-
/* @__PURE__ */
|
|
3019
|
+
isFilled ? /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full flex-col px-3.5 pt-3.5 pb-1.5", children: [
|
|
3020
|
+
/* @__PURE__ */ jsxs(
|
|
2892
3021
|
"p",
|
|
2893
3022
|
{
|
|
2894
|
-
className: "w-full shrink-0 text-
|
|
3023
|
+
className: "w-full shrink-0 text-xs leading-4 not-italic",
|
|
2895
3024
|
style: { color: floatLabel },
|
|
2896
|
-
children:
|
|
3025
|
+
children: [
|
|
3026
|
+
placeholder,
|
|
3027
|
+
required && /* @__PURE__ */ jsxs(
|
|
3028
|
+
"span",
|
|
3029
|
+
{
|
|
3030
|
+
style: {
|
|
3031
|
+
color: isDisabled ? "var(--disabled)" : "var(--error-dark)"
|
|
3032
|
+
},
|
|
3033
|
+
children: [
|
|
3034
|
+
" ",
|
|
3035
|
+
"*"
|
|
3036
|
+
]
|
|
3037
|
+
}
|
|
3038
|
+
)
|
|
3039
|
+
]
|
|
2897
3040
|
}
|
|
2898
3041
|
),
|
|
2899
3042
|
/* @__PURE__ */ jsx(
|
|
@@ -2916,7 +3059,7 @@ const TextArea = forwardRef(
|
|
|
2916
3059
|
rows,
|
|
2917
3060
|
"aria-label": placeholder,
|
|
2918
3061
|
className: cn(
|
|
2919
|
-
"m-0 min-w-0 flex-1 resize-none border-none bg-transparent p-0 text-
|
|
3062
|
+
"m-0 min-h-0 min-w-0 w-full flex-1 resize-none border-none bg-transparent p-0 text-sm leading-5 not-italic outline-none"
|
|
2920
3063
|
),
|
|
2921
3064
|
style: {
|
|
2922
3065
|
...textareaProps.style,
|
|
@@ -2925,11 +3068,11 @@ const TextArea = forwardRef(
|
|
|
2925
3068
|
}
|
|
2926
3069
|
}
|
|
2927
3070
|
)
|
|
2928
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "relative flex size-full items-start p-
|
|
3071
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "relative flex size-full items-start p-3.5", children: [
|
|
2929
3072
|
/* @__PURE__ */ jsxs(
|
|
2930
3073
|
"p",
|
|
2931
3074
|
{
|
|
2932
|
-
className: "pointer-events-none relative h-full min-h-[1px] min-w-0 flex-1 text-
|
|
3075
|
+
className: "pointer-events-none relative h-full min-h-[1px] min-w-0 flex-1 text-base leading-5 not-italic",
|
|
2933
3076
|
style: { color: floatLabel },
|
|
2934
3077
|
children: [
|
|
2935
3078
|
placeholder,
|
|
@@ -2966,7 +3109,7 @@ const TextArea = forwardRef(
|
|
|
2966
3109
|
},
|
|
2967
3110
|
rows,
|
|
2968
3111
|
className: cn(
|
|
2969
|
-
"absolute inset-0 h-full w-full cursor-text resize-none border-none bg-transparent text-
|
|
3112
|
+
"absolute inset-0 h-full w-full cursor-text resize-none border-none bg-transparent text-base outline-none"
|
|
2970
3113
|
),
|
|
2971
3114
|
style: {
|
|
2972
3115
|
...textareaProps.style,
|
|
@@ -2981,27 +3124,21 @@ const TextArea = forwardRef(
|
|
|
2981
3124
|
]
|
|
2982
3125
|
}
|
|
2983
3126
|
),
|
|
2984
|
-
showBelow && /* @__PURE__ */ jsxs(
|
|
2985
|
-
"
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
]
|
|
3000
|
-
}
|
|
3001
|
-
)
|
|
3002
|
-
]
|
|
3003
|
-
}
|
|
3004
|
-
)
|
|
3127
|
+
showBelow && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 px-1 text-xs leading-4", children: [
|
|
3128
|
+
leftText ? /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1", style: { color: leftColor }, children: leftText }) : showCount && /* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
3129
|
+
showCount && /* @__PURE__ */ jsxs(
|
|
3130
|
+
"span",
|
|
3131
|
+
{
|
|
3132
|
+
className: "shrink-0 whitespace-nowrap text-right",
|
|
3133
|
+
style: { color: countColor },
|
|
3134
|
+
children: [
|
|
3135
|
+
charCount,
|
|
3136
|
+
"/",
|
|
3137
|
+
maxCount
|
|
3138
|
+
]
|
|
3139
|
+
}
|
|
3140
|
+
)
|
|
3141
|
+
] })
|
|
3005
3142
|
] });
|
|
3006
3143
|
}
|
|
3007
3144
|
);
|
|
@@ -3181,7 +3318,7 @@ function RangeSlotPicker({
|
|
|
3181
3318
|
className: "leading-[22px] relative shrink-0 text-[14px] text-center whitespace-nowrap",
|
|
3182
3319
|
style: {
|
|
3183
3320
|
fontVariationSettings: "'wdth' 100",
|
|
3184
|
-
color: isSelected ? "
|
|
3321
|
+
color: isSelected ? "var(--on-primary-action)" : "var(--foreground)"
|
|
3185
3322
|
},
|
|
3186
3323
|
children: slot.label
|
|
3187
3324
|
}
|
|
@@ -3325,7 +3462,7 @@ const TimeInput = forwardRef(
|
|
|
3325
3462
|
const isError = state === "error";
|
|
3326
3463
|
const isFocus = state === "focus";
|
|
3327
3464
|
const isFilled = mode === "single" ? Boolean(currentValue) : true;
|
|
3328
|
-
const bgClass = isDisabled ? "bg-disabled-bg" : "bg-
|
|
3465
|
+
const bgClass = isDisabled ? "bg-disabled-bg" : "bg-background";
|
|
3329
3466
|
const labelColor = isDisabled ? "var(--disabled)" : "var(--muted-foreground)";
|
|
3330
3467
|
const valueColor = isDisabled ? "var(--disabled)" : "var(--foreground)";
|
|
3331
3468
|
const iconColor = isDisabled ? "var(--disabled)" : "var(--muted-foreground)";
|
|
@@ -3406,8 +3543,7 @@ const TimeInput = forwardRef(
|
|
|
3406
3543
|
Minus,
|
|
3407
3544
|
{
|
|
3408
3545
|
size: 20,
|
|
3409
|
-
color: minusColor
|
|
3410
|
-
weight: "bold"
|
|
3546
|
+
color: minusColor
|
|
3411
3547
|
}
|
|
3412
3548
|
),
|
|
3413
3549
|
/* @__PURE__ */ jsx(
|
|
@@ -3454,9 +3590,9 @@ const TimeInput = forwardRef(
|
|
|
3454
3590
|
);
|
|
3455
3591
|
};
|
|
3456
3592
|
const isTriggerFilled = isFilled && (mode === "range" || currentValue);
|
|
3457
|
-
const triggerPadding = isTriggerFilled ? "py-
|
|
3593
|
+
const triggerPadding = isTriggerFilled ? "py-1.5" : "py-3";
|
|
3458
3594
|
const triggerBase = cn(
|
|
3459
|
-
"relative flex gap-
|
|
3595
|
+
"relative flex gap-2 items-center rounded-lg px-3.5 w-full",
|
|
3460
3596
|
bgClass,
|
|
3461
3597
|
triggerPadding
|
|
3462
3598
|
);
|
|
@@ -3492,7 +3628,7 @@ const TimeInput = forwardRef(
|
|
|
3492
3628
|
}
|
|
3493
3629
|
)
|
|
3494
3630
|
] });
|
|
3495
|
-
const belowMsg = showBelow && /* @__PURE__ */ jsx("div", { className: "flex items-start px-
|
|
3631
|
+
const belowMsg = showBelow && /* @__PURE__ */ jsx("div", { className: "flex items-start px-1 text-xs leading-4", children: /* @__PURE__ */ jsx(
|
|
3496
3632
|
"span",
|
|
3497
3633
|
{
|
|
3498
3634
|
className: "flex-1 min-w-0",
|
|
@@ -3614,10 +3750,10 @@ const TimeInput = forwardRef(
|
|
|
3614
3750
|
{
|
|
3615
3751
|
align: "start",
|
|
3616
3752
|
sideOffset: 4,
|
|
3617
|
-
className: "z-50 rounded-[8px] bg-
|
|
3753
|
+
className: "z-50 rounded-[8px] bg-popover p-3 outline-none max-w-[340px] text-popover-foreground",
|
|
3618
3754
|
style: {
|
|
3619
|
-
boxShadow: "
|
|
3620
|
-
border: "1px solid
|
|
3755
|
+
boxShadow: "var(--elevation-popover)",
|
|
3756
|
+
border: "1px solid var(--border)",
|
|
3621
3757
|
minWidth: mode === "single" ? 327 : void 0
|
|
3622
3758
|
},
|
|
3623
3759
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
@@ -3648,6 +3784,7 @@ export {
|
|
|
3648
3784
|
SearchInput,
|
|
3649
3785
|
Tab,
|
|
3650
3786
|
TabGroup,
|
|
3787
|
+
Tag,
|
|
3651
3788
|
TextArea,
|
|
3652
3789
|
TimeInput,
|
|
3653
3790
|
cn
|