@incognia/cosmik 1.0.11 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Badge/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts.map +1 -1
- package/dist/Toggle/index.d.ts +1 -1
- package/dist/cosmik.css +3 -1
- package/dist/index.cjs +1 -2
- package/dist/index.js +36 -179
- package/dist/index10.cjs +2 -2
- package/dist/index10.cjs.map +1 -1
- package/dist/index10.js +12 -195
- package/dist/index10.js.map +1 -1
- package/dist/index11.cjs +2 -2
- package/dist/index11.cjs.map +1 -1
- package/dist/index11.js +61 -140
- package/dist/index11.js.map +1 -1
- package/dist/index12.cjs +2 -2
- package/dist/index12.cjs.map +1 -1
- package/dist/index12.js +156 -228
- package/dist/index12.js.map +1 -1
- package/dist/index13.cjs +2 -2
- package/dist/index13.cjs.map +1 -1
- package/dist/index13.js +92 -119
- package/dist/index13.js.map +1 -1
- package/dist/index14.cjs +2 -2
- package/dist/index14.cjs.map +1 -1
- package/dist/index14.js +71 -24
- package/dist/index14.js.map +1 -1
- package/dist/index15.cjs +2 -2
- package/dist/index15.cjs.map +1 -1
- package/dist/index15.js +105 -25
- package/dist/index15.js.map +1 -1
- package/dist/index16.cjs +2 -2
- package/dist/index16.cjs.map +1 -1
- package/dist/index16.js +57 -22
- package/dist/index16.js.map +1 -1
- package/dist/index17.cjs +2 -2
- package/dist/index17.cjs.map +1 -1
- package/dist/index17.js +23 -63
- package/dist/index17.js.map +1 -1
- package/dist/index18.cjs +2 -2
- package/dist/index18.cjs.map +1 -1
- package/dist/index18.js +90 -23
- package/dist/index18.js.map +1 -1
- package/dist/index19.cjs +2 -2
- package/dist/index19.cjs.map +1 -1
- package/dist/index19.js +83 -102
- package/dist/index19.js.map +1 -1
- package/dist/index2.cjs +1 -0
- package/dist/index2.js +7 -0
- package/dist/index20.cjs +2 -2
- package/dist/index20.cjs.map +1 -1
- package/dist/index20.js +126 -48
- package/dist/index20.js.map +1 -1
- package/dist/index21.cjs +2 -2
- package/dist/index21.cjs.map +1 -1
- package/dist/index21.js +41 -31
- package/dist/index21.js.map +1 -1
- package/dist/index22.cjs +2 -2
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +76 -46
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +2 -2
- package/dist/index23.cjs.map +1 -1
- package/dist/index23.js +68 -185
- package/dist/index23.js.map +1 -1
- package/dist/index24.cjs +2 -2
- package/dist/index24.cjs.map +1 -1
- package/dist/index24.js +31 -28
- package/dist/index24.js.map +1 -1
- package/dist/index25.cjs +2 -2
- package/dist/index25.cjs.map +1 -1
- package/dist/index25.js +17 -132
- package/dist/index25.js.map +1 -1
- package/dist/index26.cjs +2 -2
- package/dist/index26.cjs.map +1 -1
- package/dist/index26.js +17 -17
- package/dist/index26.js.map +1 -1
- package/dist/index27.cjs +2 -2
- package/dist/index27.cjs.map +1 -1
- package/dist/index27.js +52 -36
- package/dist/index27.js.map +1 -1
- package/dist/index28.cjs +2 -2
- package/dist/index28.cjs.map +1 -1
- package/dist/index28.js +10 -33
- package/dist/index28.js.map +1 -1
- package/dist/index29.cjs +2 -2
- package/dist/index29.cjs.map +1 -1
- package/dist/index29.js +25 -135
- package/dist/index29.js.map +1 -1
- package/dist/index30.cjs +2 -2
- package/dist/index30.cjs.map +1 -1
- package/dist/index30.js +66 -62
- package/dist/index30.js.map +1 -1
- package/dist/index31.cjs +2 -2
- package/dist/index31.cjs.map +1 -1
- package/dist/index31.js +22 -88
- package/dist/index31.js.map +1 -1
- package/dist/index32.cjs +2 -2
- package/dist/index32.cjs.map +1 -1
- package/dist/index32.js +30 -23
- package/dist/index32.js.map +1 -1
- package/dist/index33.cjs +2 -2
- package/dist/index33.cjs.map +1 -1
- package/dist/index33.js +97 -93
- package/dist/index33.js.map +1 -1
- package/dist/index34.cjs +2 -2
- package/dist/index34.cjs.map +1 -1
- package/dist/index34.js +19 -72
- package/dist/index34.js.map +1 -1
- package/dist/index35.cjs +2 -2
- package/dist/index35.cjs.map +1 -1
- package/dist/index35.js +81 -62
- package/dist/index35.js.map +1 -1
- package/dist/index36.cjs +2 -2
- package/dist/index36.cjs.map +1 -1
- package/dist/index36.js +14 -161
- package/dist/index36.js.map +1 -1
- package/dist/index37.cjs +2 -2
- package/dist/index37.cjs.map +1 -1
- package/dist/index37.js +44 -6
- package/dist/index37.js.map +1 -1
- package/dist/index38.cjs +2 -2
- package/dist/index38.cjs.map +1 -1
- package/dist/index38.js +22 -36
- package/dist/index38.js.map +1 -1
- package/dist/index39.cjs +2 -2
- package/dist/index39.cjs.map +1 -1
- package/dist/index39.js +71 -16
- package/dist/index39.js.map +1 -1
- package/dist/index4.cjs +2 -2
- package/dist/index4.cjs.map +1 -1
- package/dist/index4.js +18 -160
- package/dist/index4.js.map +1 -1
- package/dist/index40.cjs +2 -2
- package/dist/index40.cjs.map +1 -1
- package/dist/index40.js +38 -120
- package/dist/index40.js.map +1 -1
- package/dist/index41.cjs +2 -2
- package/dist/index41.cjs.map +1 -1
- package/dist/index41.js +73 -16
- package/dist/index41.js.map +1 -1
- package/dist/index42.cjs +2 -2
- package/dist/index42.cjs.map +1 -1
- package/dist/index42.js +15 -10
- package/dist/index42.js.map +1 -1
- package/dist/index43.cjs +2 -2
- package/dist/index43.cjs.map +1 -1
- package/dist/index43.js +87 -5
- package/dist/index43.js.map +1 -1
- package/dist/index44.cjs +2 -2
- package/dist/index44.cjs.map +1 -1
- package/dist/index44.js +52 -26
- package/dist/index44.js.map +1 -1
- package/dist/index45.cjs +2 -7
- package/dist/index45.cjs.map +1 -1
- package/dist/index45.js +48 -238
- package/dist/index45.js.map +1 -1
- package/dist/index46.cjs +2 -2
- package/dist/index46.cjs.map +1 -1
- package/dist/index46.js +85 -17
- package/dist/index46.js.map +1 -1
- package/dist/index5.cjs +2 -2
- package/dist/index5.cjs.map +1 -1
- package/dist/index5.js +34 -80
- package/dist/index5.js.map +1 -1
- package/dist/index6.cjs +2 -2
- package/dist/index6.cjs.map +1 -1
- package/dist/index6.js +1586 -163
- package/dist/index6.js.map +1 -1
- package/dist/index7.cjs +2 -2
- package/dist/index7.cjs.map +1 -1
- package/dist/index7.js +14 -196
- package/dist/index7.js.map +1 -1
- package/dist/index8.cjs +2 -2
- package/dist/index8.cjs.map +1 -1
- package/dist/index8.js +23 -91
- package/dist/index8.js.map +1 -1
- package/dist/index9.cjs +7 -2
- package/dist/index9.cjs.map +1 -1
- package/dist/index9.js +162 -40
- package/dist/index9.js.map +1 -1
- package/dist/{cosmik-theme.css → src/cosmik-theme.css} +68 -66
- package/package.json +22 -20
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index3.cjs +0 -2
- package/dist/index3.cjs.map +0 -1
- package/dist/index3.js +0 -87
- package/dist/index3.js.map +0 -1
- package/dist/index47.cjs +0 -2
- package/dist/index47.cjs.map +0 -1
- package/dist/index47.js +0 -2732
- package/dist/index47.js.map +0 -1
- package/dist/index48.cjs +0 -2
- package/dist/index48.cjs.map +0 -1
- package/dist/index48.js +0 -5
- package/dist/index48.js.map +0 -1
- package/dist/index49.cjs +0 -2
- package/dist/index49.cjs.map +0 -1
- package/dist/index49.js +0 -5
- package/dist/index49.js.map +0 -1
package/dist/index39.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index39.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index39.js","names":[],"sources":["../src/Table/index.tsx"],"sourcesContent":["import { LucideChevronDown, LucideChevronUp } from 'lucide-react'\nimport * as React from 'react'\nimport { cn } from '../lib/utils'\n\nfunction Table({ className, ...props }: React.ComponentProps<'table'>) {\n return (\n <table\n data-slot=\"table\"\n className={cn('border-separate border-spacing-y-8 h-fit', className)}\n {...props}\n />\n )\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn('bg-gray-200 text-left text-sm', className)}\n {...props}\n />\n )\n}\n\nfunction TableBody({\n className,\n hoverable,\n ...props\n}: React.ComponentProps<'tbody'> & { hoverable?: boolean }) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\n 'bg-white h-full',\n {\n '[&_tr:hover]:bg-gray-100 cursor-pointer': hoverable\n },\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn('bg-gray-100', className)}\n {...props}\n />\n )\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<'tr'>) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n 'transition-colors data-[state=selected]:bg-gray-100',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableHead({\n className,\n children,\n sortDirection,\n ...props\n}: React.ComponentProps<'th'> & { sortDirection?: 'ASC' | 'DESC' }) {\n let SortIcon\n if (sortDirection === 'ASC') {\n SortIcon = LucideChevronUp\n } else if (sortDirection === 'DESC') {\n SortIcon = LucideChevronDown\n }\n\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n 'first:rounded-l first:pl-24',\n 'last:rounded-r last:pr-24',\n 'px-12 py-8 font-normal leading-14',\n 'whitespace-nowrap',\n {\n 'cursor-pointer': !!props?.onClick\n },\n className\n )}\n {...props}\n >\n {children}\n {SortIcon && <SortIcon size={16} className=\"inline-block ml-4\" />}\n </th>\n )\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<'td'>) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n 'first:rounded-l first:pl-24 first:border-l',\n 'last:rounded-r last:pr-24 last:border-r',\n 'border-gray-900/8 border-y px-12 h-[54px]',\n 'whitespace-nowrap',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<'caption'>) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn('mt-16 text-sm text-gray-700', className)}\n {...props}\n />\n )\n}\n\nexport {\n Table,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow\n}\n"],"mappings":";;;;;;AAIA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAwC;CACrE,OACE,iBAAA,GAAA,EAAA,KAAC,SAAD;EACE,aAAU;EACV,WAAW,EAAG,4CAA4C,CAAS;EACnE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAY,EAAE,cAAW,GAAG,KAAwC;CAC3E,OACE,iBAAA,GAAA,EAAA,KAAC,SAAD;EACE,aAAU;EACV,WAAW,EAAG,iCAAiC,CAAS;EACxD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAU,EACjB,cACA,cACA,GAAG,KACuD;CAC1D,OACE,iBAAA,GAAA,EAAA,KAAC,SAAD;EACE,aAAU;EACV,WAAW,EACT,mBACA,EACE,2CAA2C,EAC7C,GACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAY,EAAE,cAAW,GAAG,KAAwC;CAC3E,OACE,iBAAA,GAAA,EAAA,KAAC,SAAD;EACE,aAAU;EACV,WAAW,EAAG,eAAe,CAAS;EACtC,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAS,EAAE,cAAW,GAAG,KAAqC;CACrE,OACE,iBAAA,GAAA,EAAA,KAAC,MAAD;EACE,aAAU;EACV,WAAW,EACT,uDACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAU,EACjB,cACA,aACA,kBACA,GAAG,KAC+D;CAClE,IAAI;CAOJ,OANI,MAAkB,QACpB,IAAW,IACF,MAAkB,WAC3B,IAAW,IAIX,iBAAA,GAAA,EAAA,MAAC,MAAD;EACE,aAAU;EACV,WAAW,EACT,+BACA,6BACA,qCACA,qBACA,EACE,kBAAkB,CAAC,CAAC,GAAO,QAC7B,GACA,CACF;EACA,GAAI;YAZN,CAcG,GACA,KAAY,iBAAA,GAAA,EAAA,KAAC,GAAD;GAAU,MAAM;GAAI,WAAU;EAAqB,CAAA,CAC9D;;AAER;AAEA,SAAS,EAAU,EAAE,cAAW,GAAG,KAAqC;CACtE,OACE,iBAAA,GAAA,EAAA,KAAC,MAAD;EACE,aAAU;EACV,WAAW,EACT,8CACA,2CACA,6CACA,qBACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAa,EACpB,cACA,GAAG,KAC+B;CAClC,OACE,iBAAA,GAAA,EAAA,KAAC,WAAD;EACE,aAAU;EACV,WAAW,EAAG,+BAA+B,CAAS;EACtD,GAAI;CACL,CAAA;AAEL"}
|
package/dist/index4.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index4.cjs.map
|
|
1
|
+
function e(t){var n,r,i=``;if(typeof t==`string`||typeof t==`number`)i+=t;else if(typeof t==`object`)if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=` `),i+=r)}else for(r in t)t[r]&&(i&&(i+=` `),i+=r);return i}function t(){for(var t,n,r=0,i=``,a=arguments.length;r<a;r++)(t=arguments[r])&&(n=e(t))&&(i&&(i+=` `),i+=n);return i}exports.default=t;
|
|
2
|
+
//# sourceMappingURL=index4.cjs.map
|
package/dist/index4.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.cjs","sources":["../
|
|
1
|
+
{"version":3,"file":"index4.cjs","names":[],"sources":["../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"x_google_ignoreList":[0],"mappings":"AAAA,SAAS,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,GAAa,OAAO,GAAjB,UAA8B,OAAO,GAAjB,SAAmB,GAAG,OAAO,GAAa,OAAO,GAAjB,SAAmB,GAAG,MAAM,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,OAAO,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,IAAI,GAAG,KAAK,GAAG,EAAE,MAAM,IAAI,KAAK,EAAE,EAAE,KAAK,IAAI,GAAG,KAAK,GAAG,GAAG,OAAO,CAAC,CAAC,SAAgB,GAAM,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,UAAU,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,MAAM,EAAE,EAAE,CAAC,KAAK,IAAI,GAAG,KAAK,GAAG,GAAG,OAAO,CAAC"}
|
package/dist/index4.js
CHANGED
|
@@ -1,160 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return /* @__PURE__ */ e.jsx(o.Portal, { "data-slot": "alert-dialog-portal", ...t });
|
|
20
|
-
}
|
|
21
|
-
function d({
|
|
22
|
-
className: t,
|
|
23
|
-
...a
|
|
24
|
-
}) {
|
|
25
|
-
return /* @__PURE__ */ e.jsx(
|
|
26
|
-
o.Overlay,
|
|
27
|
-
{
|
|
28
|
-
"data-slot": "alert-dialog-overlay",
|
|
29
|
-
className: l(
|
|
30
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-gray-900/48",
|
|
31
|
-
t
|
|
32
|
-
),
|
|
33
|
-
...a
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
function j({
|
|
38
|
-
className: t,
|
|
39
|
-
...a
|
|
40
|
-
}) {
|
|
41
|
-
return /* @__PURE__ */ e.jsxs(s, { children: [
|
|
42
|
-
/* @__PURE__ */ e.jsx(d, {}),
|
|
43
|
-
/* @__PURE__ */ e.jsx(
|
|
44
|
-
o.Content,
|
|
45
|
-
{
|
|
46
|
-
"data-slot": "alert-dialog-content",
|
|
47
|
-
className: l(
|
|
48
|
-
"bg-white data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] gap-24 border-0 p-24 top-24 shadow-200 duration-200 sm:max-w-lg min-w-[384px]",
|
|
49
|
-
t
|
|
50
|
-
),
|
|
51
|
-
...a
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
] });
|
|
55
|
-
}
|
|
56
|
-
function A({
|
|
57
|
-
className: t,
|
|
58
|
-
...a
|
|
59
|
-
}) {
|
|
60
|
-
return /* @__PURE__ */ e.jsx(
|
|
61
|
-
"div",
|
|
62
|
-
{
|
|
63
|
-
"data-slot": "alert-dialog-header",
|
|
64
|
-
className: l("flex flex-col gap-8 text-left font-display", t),
|
|
65
|
-
...a
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
function D({
|
|
70
|
-
className: t,
|
|
71
|
-
...a
|
|
72
|
-
}) {
|
|
73
|
-
return /* @__PURE__ */ e.jsx(
|
|
74
|
-
"div",
|
|
75
|
-
{
|
|
76
|
-
"data-slot": "alert-dialog-footer",
|
|
77
|
-
className: l("flex gap-8 flex-row justify-end", t),
|
|
78
|
-
...a
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
const g = i("flex items-center text-lg font-semibold", {
|
|
83
|
-
variants: {
|
|
84
|
-
intent: {
|
|
85
|
-
default: "text-gray-800",
|
|
86
|
-
warning: "text-yellow-600",
|
|
87
|
-
danger: "text-magenta-600"
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
defaultVariants: {
|
|
91
|
-
intent: "default"
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
function y({
|
|
95
|
-
className: t,
|
|
96
|
-
intent: a,
|
|
97
|
-
...r
|
|
98
|
-
}) {
|
|
99
|
-
return /* @__PURE__ */ e.jsx(
|
|
100
|
-
o.Title,
|
|
101
|
-
{
|
|
102
|
-
"data-slot": "alert-dialog-title",
|
|
103
|
-
className: l(g({ intent: a }), t),
|
|
104
|
-
...r
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
function w({
|
|
109
|
-
className: t,
|
|
110
|
-
...a
|
|
111
|
-
}) {
|
|
112
|
-
return /* @__PURE__ */ e.jsx(
|
|
113
|
-
o.Description,
|
|
114
|
-
{
|
|
115
|
-
"data-slot": "alert-dialog-description",
|
|
116
|
-
className: l("text-base text-gray-900", t),
|
|
117
|
-
...a
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
function v({
|
|
122
|
-
className: t,
|
|
123
|
-
intent: a,
|
|
124
|
-
...r
|
|
125
|
-
}) {
|
|
126
|
-
return /* @__PURE__ */ e.jsx(
|
|
127
|
-
o.Action,
|
|
128
|
-
{
|
|
129
|
-
className: l(n({ intent: a }), t),
|
|
130
|
-
...r
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
function N({
|
|
135
|
-
className: t,
|
|
136
|
-
...a
|
|
137
|
-
}) {
|
|
138
|
-
return /* @__PURE__ */ e.jsx(
|
|
139
|
-
o.Cancel,
|
|
140
|
-
{
|
|
141
|
-
className: l(n({ intent: "secondary" }), t),
|
|
142
|
-
...a
|
|
143
|
-
}
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
export {
|
|
147
|
-
m as AlertDialog,
|
|
148
|
-
v as AlertDialogAction,
|
|
149
|
-
N as AlertDialogCancel,
|
|
150
|
-
j as AlertDialogContent,
|
|
151
|
-
w as AlertDialogDescription,
|
|
152
|
-
D as AlertDialogFooter,
|
|
153
|
-
A as AlertDialogHeader,
|
|
154
|
-
d as AlertDialogOverlay,
|
|
155
|
-
s as AlertDialogPortal,
|
|
156
|
-
y as AlertDialogTitle,
|
|
157
|
-
p as AlertDialogTrigger,
|
|
158
|
-
g as titleVariants
|
|
159
|
-
};
|
|
160
|
-
//# sourceMappingURL=index4.js.map
|
|
1
|
+
//#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
2
|
+
function e(t) {
|
|
3
|
+
var n, r, i = "";
|
|
4
|
+
if (typeof t == "string" || typeof t == "number") i += t;
|
|
5
|
+
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
6
|
+
var a = t.length;
|
|
7
|
+
for (n = 0; n < a; n++) t[n] && (r = e(t[n])) && (i && (i += " "), i += r);
|
|
8
|
+
} else for (r in t) t[r] && (i && (i += " "), i += r);
|
|
9
|
+
return i;
|
|
10
|
+
}
|
|
11
|
+
function t() {
|
|
12
|
+
for (var t, n, r = 0, i = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (n = e(t)) && (i && (i += " "), i += n);
|
|
13
|
+
return i;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as default };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index4.js.map
|
package/dist/index4.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.js","sources":["../
|
|
1
|
+
{"version":3,"file":"index4.js","names":[],"sources":["../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAS,EAAE,GAAE;CAAC,IAAI,GAAE,GAAE,IAAE;CAAG,IAAa,OAAO,KAAjB,YAA8B,OAAO,KAAjB,UAAmB,KAAG;MAAO,IAAa,OAAO,KAAjB,UAAmB,IAAG,MAAM,QAAQ,CAAC,GAAE;EAAC,IAAI,IAAE,EAAE;EAAO,KAAI,IAAE,GAAE,IAAE,GAAE,KAAI,EAAE,OAAK,IAAE,EAAE,EAAE,EAAE,OAAK,MAAI,KAAG,MAAK,KAAG;CAAE,OAAM,KAAI,KAAK,GAAE,EAAE,OAAK,MAAI,KAAG,MAAK,KAAG;CAAG,OAAO;AAAC;AAAC,SAAgB,IAAM;CAAC,KAAI,IAAI,GAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,KAAI,CAAC,IAAE,UAAU,QAAM,IAAE,EAAE,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;CAAG,OAAO;AAAC"}
|
package/dist/index40.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use
|
|
2
|
-
//# sourceMappingURL=index40.cjs.map
|
|
1
|
+
"use client";const e=require("./index2.cjs"),t=require("./index7.cjs"),n=require("./index10.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("@radix-ui/react-tabs");i=e.__toESM(i,1);var a=n.default;function o({className:e,...t}){return(0,a.jsx)(i.Root,{"data-slot":`tabs`,className:e,...t})}function s({className:e,...n}){return(0,a.jsx)(i.List,{"data-slot":`tabs-list`,className:t.cn(`inline-flex h-48 p-8 gap-8 items-center justify-center rounded-[16px] bg-gray-200 text-md font-normal text-gray-600 [&_svg]:text-gray-600 [&_i]:text-gray-600`,e),...n})}function c({className:e,...n}){return(0,a.jsx)(i.Trigger,{"data-slot":`tabs-trigger`,className:t.cn(`inline-flex h-32 items-center justify-center whitespace-nowrap rounded px-[12px] py-[6px] transition-all`,`focus-visible:outline-none disabled:pointer-events-none disabled:opacity-64`,`hover:bg-gray-900/8 active:bg-gray-900/12`,`data-[state=active]:bg-white data-[state=active]:hover:bg-white data-[state=active]:text-purple-800 hover:data-[state=active]:text-purple-800`,`data-[state=active]:[&_svg]:text-purple-800 [&_i]:data-[state=active]:text-purple-800`,`[&:has(>svg:first-child)]:pl-[10px]`,e),...n})}function l({className:e,...n}){return(0,a.jsx)(i.Content,{"data-slot":`tabs-content`,className:t.cn(`flex-1 outline-none`,e),...n})}exports.Tabs=o,exports.TabsContent=l,exports.TabsList=s,exports.TabsTrigger=c;
|
|
2
|
+
//# sourceMappingURL=index40.cjs.map
|
package/dist/index40.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index40.cjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index40.cjs","names":[],"sources":["../src/Tabs/index.tsx"],"sourcesContent":["'use client'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport * as React from 'react'\nimport { cn } from '../lib/utils'\n\nfunction Tabs({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root data-slot=\"tabs\" className={className} {...props} />\n )\n}\n\nfunction TabsList({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n 'inline-flex h-48 p-8 gap-8 items-center justify-center rounded-[16px] bg-gray-200 text-md font-normal text-gray-600 [&_svg]:text-gray-600 [&_i]:text-gray-600',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TabsTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n 'inline-flex h-32 items-center justify-center whitespace-nowrap rounded px-[12px] py-[6px] transition-all',\n 'focus-visible:outline-none disabled:pointer-events-none disabled:opacity-64',\n 'hover:bg-gray-900/8 active:bg-gray-900/12',\n 'data-[state=active]:bg-white data-[state=active]:hover:bg-white data-[state=active]:text-purple-800 hover:data-[state=active]:text-purple-800',\n 'data-[state=active]:[&_svg]:text-purple-800 [&_i]:data-[state=active]:text-purple-800',\n '[&:has(>svg:first-child)]:pl-[10px]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('flex-1 outline-none', className)}\n {...props}\n />\n )\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger }\n"],"mappings":"iNAMA,SAAS,EAAK,CACZ,YACA,GAAG,GAC+C,CAClD,OACE,EAAA,EAAA,KAAC,EAAc,KAAf,CAAoB,YAAU,OAAkB,YAAW,GAAI,CAAQ,CAAA,CAE3E,CAEA,SAAS,EAAS,CAChB,YACA,GAAG,GAC+C,CAClD,OACE,EAAA,EAAA,KAAC,EAAc,KAAf,CACE,YAAU,YACV,UAAW,EAAA,GACT,gKACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAY,CACnB,YACA,GAAG,GACkD,CACrD,OACE,EAAA,EAAA,KAAC,EAAc,QAAf,CACE,YAAU,eACV,UAAW,EAAA,GACT,2GACA,8EACA,4CACA,gJACA,wFACA,sCACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAY,CACnB,YACA,GAAG,GACkD,CACrD,OACE,EAAA,EAAA,KAAC,EAAc,QAAf,CACE,YAAU,eACV,UAAW,EAAA,GAAG,sBAAuB,CAAS,EAC9C,GAAI,CACL,CAAA,CAEL"}
|
package/dist/index40.js
CHANGED
|
@@ -1,121 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
variant: "gray"
|
|
15
|
-
}
|
|
16
|
-
}), n = c("", {
|
|
17
|
-
variants: {
|
|
18
|
-
variant: {
|
|
19
|
-
white: "bg-white",
|
|
20
|
-
gray: "bg-gray-50"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
defaultVariants: {
|
|
24
|
-
variant: "gray"
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
function S({
|
|
28
|
-
children: f,
|
|
29
|
-
className: d,
|
|
30
|
-
variant: o
|
|
31
|
-
}) {
|
|
32
|
-
const t = l.useRef(null), [u, h] = l.useState(!1), [m, v] = l.useState(!1), a = l.useCallback(() => {
|
|
33
|
-
if (!t.current) return;
|
|
34
|
-
const { scrollLeft: s, scrollWidth: b, clientWidth: g } = t.current;
|
|
35
|
-
h(s > 0), v(s + g < b - 5);
|
|
36
|
-
}, [t]);
|
|
37
|
-
return l.useEffect(() => {
|
|
38
|
-
a();
|
|
39
|
-
const s = p(a, 100);
|
|
40
|
-
return window.addEventListener("resize", s), () => {
|
|
41
|
-
window.removeEventListener("resize", s);
|
|
42
|
-
};
|
|
43
|
-
}, [a]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex overflow-hidden", children: [
|
|
44
|
-
/* @__PURE__ */ e.jsxs(
|
|
45
|
-
"div",
|
|
46
|
-
{
|
|
47
|
-
className: r("absolute left-0 top-0 h-full flex items-center", {
|
|
48
|
-
hidden: !u
|
|
49
|
-
}),
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ e.jsx(
|
|
52
|
-
x,
|
|
53
|
-
{
|
|
54
|
-
size: 16,
|
|
55
|
-
className: r(
|
|
56
|
-
"text-gray-600 h-full cursor-pointer",
|
|
57
|
-
n({ variant: o })
|
|
58
|
-
),
|
|
59
|
-
onClick: () => t.current?.scrollBy({ left: -100, behavior: "smooth" })
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
/* @__PURE__ */ e.jsx(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
className: r(
|
|
66
|
-
"w-[50px] h-full bg-linear-to-l from-transparent",
|
|
67
|
-
i({ variant: o })
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
),
|
|
74
|
-
/* @__PURE__ */ e.jsx(
|
|
75
|
-
"div",
|
|
76
|
-
{
|
|
77
|
-
ref: t,
|
|
78
|
-
onScroll: a,
|
|
79
|
-
className: r("overflow-scroll no-scrollbar", d),
|
|
80
|
-
children: f
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
/* @__PURE__ */ e.jsxs(
|
|
84
|
-
"div",
|
|
85
|
-
{
|
|
86
|
-
className: r(
|
|
87
|
-
"absolute right-0 top-0 h-full w-fit flex items-center justify-end",
|
|
88
|
-
{ hidden: !m }
|
|
89
|
-
),
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ e.jsx(
|
|
92
|
-
"div",
|
|
93
|
-
{
|
|
94
|
-
className: r(
|
|
95
|
-
"w-[50px] h-full bg-linear-to-r from-transparent",
|
|
96
|
-
i({ variant: o })
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
),
|
|
100
|
-
/* @__PURE__ */ e.jsx(
|
|
101
|
-
w,
|
|
102
|
-
{
|
|
103
|
-
size: 16,
|
|
104
|
-
className: r(
|
|
105
|
-
"text-gray-600 h-full cursor-pointer",
|
|
106
|
-
n({ variant: o })
|
|
107
|
-
),
|
|
108
|
-
onClick: () => t.current?.scrollBy({ left: 100, behavior: "smooth" })
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
)
|
|
114
|
-
] });
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "./index7.js";
|
|
3
|
+
import { require_jsx_runtime as t } from "./index10.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import * as n from "@radix-ui/react-tabs";
|
|
6
|
+
//#region src/Tabs/index.tsx
|
|
7
|
+
var r = t();
|
|
8
|
+
function i({ className: e, ...t }) {
|
|
9
|
+
return /* @__PURE__ */ (0, r.jsx)(n.Root, {
|
|
10
|
+
"data-slot": "tabs",
|
|
11
|
+
className: e,
|
|
12
|
+
...t
|
|
13
|
+
});
|
|
115
14
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
15
|
+
function a({ className: t, ...i }) {
|
|
16
|
+
return /* @__PURE__ */ (0, r.jsx)(n.List, {
|
|
17
|
+
"data-slot": "tabs-list",
|
|
18
|
+
className: e("inline-flex h-48 p-8 gap-8 items-center justify-center rounded-[16px] bg-gray-200 text-md font-normal text-gray-600 [&_svg]:text-gray-600 [&_i]:text-gray-600", t),
|
|
19
|
+
...i
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function o({ className: t, ...i }) {
|
|
23
|
+
return /* @__PURE__ */ (0, r.jsx)(n.Trigger, {
|
|
24
|
+
"data-slot": "tabs-trigger",
|
|
25
|
+
className: e("inline-flex h-32 items-center justify-center whitespace-nowrap rounded px-[12px] py-[6px] transition-all", "focus-visible:outline-none disabled:pointer-events-none disabled:opacity-64", "hover:bg-gray-900/8 active:bg-gray-900/12", "data-[state=active]:bg-white data-[state=active]:hover:bg-white data-[state=active]:text-purple-800 hover:data-[state=active]:text-purple-800", "data-[state=active]:[&_svg]:text-purple-800 [&_i]:data-[state=active]:text-purple-800", "[&:has(>svg:first-child)]:pl-[10px]", t),
|
|
26
|
+
...i
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function s({ className: t, ...i }) {
|
|
30
|
+
return /* @__PURE__ */ (0, r.jsx)(n.Content, {
|
|
31
|
+
"data-slot": "tabs-content",
|
|
32
|
+
className: e("flex-1 outline-none", t),
|
|
33
|
+
...i
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { i as Tabs, s as TabsContent, a as TabsList, o as TabsTrigger };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=index40.js.map
|
package/dist/index40.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index40.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index40.js","names":[],"sources":["../src/Tabs/index.tsx"],"sourcesContent":["'use client'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport * as React from 'react'\nimport { cn } from '../lib/utils'\n\nfunction Tabs({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root data-slot=\"tabs\" className={className} {...props} />\n )\n}\n\nfunction TabsList({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n 'inline-flex h-48 p-8 gap-8 items-center justify-center rounded-[16px] bg-gray-200 text-md font-normal text-gray-600 [&_svg]:text-gray-600 [&_i]:text-gray-600',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TabsTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n 'inline-flex h-32 items-center justify-center whitespace-nowrap rounded px-[12px] py-[6px] transition-all',\n 'focus-visible:outline-none disabled:pointer-events-none disabled:opacity-64',\n 'hover:bg-gray-900/8 active:bg-gray-900/12',\n 'data-[state=active]:bg-white data-[state=active]:hover:bg-white data-[state=active]:text-purple-800 hover:data-[state=active]:text-purple-800',\n 'data-[state=active]:[&_svg]:text-purple-800 [&_i]:data-[state=active]:text-purple-800',\n '[&:has(>svg:first-child)]:pl-[10px]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('flex-1 outline-none', className)}\n {...props}\n />\n )\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger }\n"],"mappings":";;;;;;;AAMA,SAAS,EAAK,EACZ,cACA,GAAG,KAC+C;CAClD,OACE,iBAAA,GAAA,EAAA,KAAC,EAAc,MAAf;EAAoB,aAAU;EAAkB;EAAW,GAAI;CAAQ,CAAA;AAE3E;AAEA,SAAS,EAAS,EAChB,cACA,GAAG,KAC+C;CAClD,OACE,iBAAA,GAAA,EAAA,KAAC,EAAc,MAAf;EACE,aAAU;EACV,WAAW,EACT,iKACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAY,EACnB,cACA,GAAG,KACkD;CACrD,OACE,iBAAA,GAAA,EAAA,KAAC,EAAc,SAAf;EACE,aAAU;EACV,WAAW,EACT,4GACA,+EACA,6CACA,iJACA,yFACA,uCACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAY,EACnB,cACA,GAAG,KACkD;CACrD,OACE,iBAAA,GAAA,EAAA,KAAC,EAAc,SAAf;EACE,aAAU;EACV,WAAW,EAAG,uBAAuB,CAAS;EAC9C,GAAI;CACL,CAAA;AAEL"}
|
package/dist/index41.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index41.cjs.map
|
|
1
|
+
const e=require("./index2.cjs"),t=require("./index7.cjs"),n=require("./index10.cjs"),r=require("./index12.cjs"),i=require("./index14.cjs");let a=require("lucide-react"),o=require("react");o=e.__toESM(o,1);var s=n.default;function c({className:e,value:n,placeholder:r,onValueChange:i,...a}){let[c,u]=o.useState(``),d=o.useRef(null);function f(e){let t=e.target.value;if(t.includes(`,`)){let e=t.split(`,`),r=Array.from(new Set(e));i([...n||[],...r.filter(e=>!!e&&!n?.includes(e)).map(e=>e.trim())||[]]),u(``);return}u(t)}function p(e){[`Enter`,`Tab`].includes(e.key)&&c?.trim()&&(e.preventDefault(),n?.includes(c)||m(),u(``)),e.key===`Backspace`&&!c&&i(n?.slice(0,-1)||[])}function m(){c.trim()&&(i([...n||[],c]),u(``))}return(0,s.jsxs)(`div`,{className:t.cn(`flex flex-wrap items-center gap-8 min-h-[36px]`,`border rounded border-gray-900/24 bg-white px-12 py-4`,`hover:cursor-text`,`hover:shadow-field-hover`,`active:shadow-field-active`,`focus-visible:outline-none focus:shadow-field-active`,e),onClick:()=>d.current?.focus(),...a,children:[(0,s.jsx)(l,{value:n,onValueChange:i}),(0,s.jsx)(`input`,{ref:d,className:`h-[26px] outline-none text-sm`,type:`text`,value:c,onChange:f,onKeyDown:p,style:{width:`${c.length+1}ch`},onBlur:()=>m()}),n?.length===0&&!c&&(0,s.jsx)(`div`,{className:`text-gray-400 ml-[-2ch]`,children:r})]})}c.displayName=`TagInput`;function l({value:e,onValueChange:t}){return(0,s.jsx)(s.Fragment,{children:e?.map((n,o)=>(0,s.jsxs)(i.Badge,{className:`px-0 pr-8 pl-0 gap-x-4 overflow-hidden`,children:[(0,s.jsx)(r.Button,{type:`button`,className:`w-[26px] h-[26px] shrink-0`,size:`icon`,intent:`secondary`,onClick:()=>{t(e?.filter((e,t)=>t!==o)||[])},children:(0,s.jsx)(a.LucideX,{className:`w-16`})}),(0,s.jsx)(`div`,{className:`truncate`,children:n})]},o))})}exports.TagInput=c;
|
|
2
|
+
//# sourceMappingURL=index41.cjs.map
|
package/dist/index41.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index41.cjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index41.cjs","names":[],"sources":["../src/TagInput/index.tsx"],"sourcesContent":["import { LucideX } from 'lucide-react'\nimport * as React from 'react'\nimport { Badge } from '../Badge'\nimport { Button } from '../Button'\nimport { cn } from '../lib/utils'\n\nexport type TagInputProps = React.HTMLAttributes<HTMLInputElement> & {\n value?: string[]\n onValueChange: (value: string[]) => void\n placeholder?: string\n}\n\nfunction TagInput({\n className,\n value,\n placeholder,\n onValueChange,\n ...props\n}: TagInputProps) {\n const [inputValue, setInputValue] = React.useState('')\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const currentInputValue = event.target.value\n if (currentInputValue.includes(',')) {\n const currentValues = currentInputValue.split(',')\n //Remove duplicates\n const uniqueValues = Array.from(new Set(currentValues))\n\n onValueChange([\n ...(value || []),\n ...(uniqueValues\n .filter(inputValue => {\n //Remove empty values and already added values\n return Boolean(inputValue) && !value?.includes(inputValue)\n })\n .map(i => i.trim()) || [])\n ])\n setInputValue('')\n return\n }\n setInputValue(currentInputValue)\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n if (['Enter', 'Tab'].includes(event.key)) {\n if (inputValue?.trim()) {\n event.preventDefault()\n if (!value?.includes(inputValue)) {\n addInputValue()\n }\n setInputValue('')\n }\n }\n\n if (event.key === 'Backspace' && !inputValue) {\n onValueChange(value?.slice(0, -1) || [])\n }\n }\n\n function addInputValue() {\n if (!inputValue.trim()) return\n onValueChange([...(value || []), inputValue])\n setInputValue('')\n }\n\n return (\n <div\n className={cn(\n 'flex flex-wrap items-center gap-8 min-h-[36px]',\n 'border rounded border-gray-900/24 bg-white px-12 py-4',\n 'hover:cursor-text',\n 'hover:shadow-field-hover',\n 'active:shadow-field-active',\n 'focus-visible:outline-none focus:shadow-field-active',\n className\n )}\n onClick={() => inputRef.current?.focus()}\n {...props}\n >\n <TagList value={value} onValueChange={onValueChange} />\n <input\n ref={inputRef}\n className=\"h-[26px] outline-none text-sm\"\n type=\"text\"\n value={inputValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n style={{ width: `${inputValue.length + 1}ch` }}\n onBlur={() => addInputValue()}\n />\n {value?.length === 0 && !inputValue && (\n <div className=\"text-gray-400 ml-[-2ch]\">{placeholder}</div>\n )}\n </div>\n )\n}\n\nTagInput.displayName = 'TagInput'\n\ntype TagListProps = React.HTMLAttributes<HTMLDivElement> & {\n value?: string[]\n onValueChange: (value: string[]) => void\n}\n\nfunction TagList({ value, onValueChange }: TagListProps) {\n return (\n <>\n {value?.map((tag, index) => (\n <Badge key={index} className=\"px-0 pr-8 pl-0 gap-x-4 overflow-hidden\">\n <Button\n type=\"button\"\n className=\"w-[26px] h-[26px] shrink-0\"\n size=\"icon\"\n intent=\"secondary\"\n onClick={() => {\n onValueChange(value?.filter((_, i) => i !== index) || [])\n }}\n >\n <LucideX className=\"w-16\" />\n </Button>\n <div className=\"truncate\">{tag}</div>\n </Badge>\n ))}\n </>\n )\n}\n\nexport { TagInput }\n"],"mappings":"6NAYA,SAAS,EAAS,CAChB,YACA,QACA,cACA,gBACA,GAAG,GACa,CAChB,GAAM,CAAC,EAAY,GAAiB,EAAM,SAAS,EAAE,EAC/C,EAAW,EAAM,OAAyB,IAAI,EAEpD,SAAS,EAAa,EAA4C,CAChE,IAAM,EAAoB,EAAM,OAAO,MACvC,GAAI,EAAkB,SAAS,GAAG,EAAG,CACnC,IAAM,EAAgB,EAAkB,MAAM,GAAG,EAE3C,EAAe,MAAM,KAAK,IAAI,IAAI,CAAa,CAAC,EAEtD,EAAc,CACZ,GAAI,GAAS,CAAC,EACd,GAAI,EACD,OAAO,GAEC,EAAQ,GAAe,CAAC,GAAO,SAAS,CAAU,CAC1D,EACA,IAAI,GAAK,EAAE,KAAK,CAAC,GAAK,CAAC,CAC5B,CAAC,EACD,EAAc,EAAE,EAChB,MACF,CACA,EAAc,CAAiB,CACjC,CAEA,SAAS,EAAc,EAA8C,CAC/D,CAAC,QAAS,KAAK,EAAE,SAAS,EAAM,GAAG,GACjC,GAAY,KAAK,IACnB,EAAM,eAAe,EAChB,GAAO,SAAS,CAAU,GAC7B,EAAc,EAEhB,EAAc,EAAE,GAIhB,EAAM,MAAQ,aAAe,CAAC,GAChC,EAAc,GAAO,MAAM,EAAG,EAAE,GAAK,CAAC,CAAC,CAE3C,CAEA,SAAS,GAAgB,CAClB,EAAW,KAAK,IACrB,EAAc,CAAC,GAAI,GAAS,CAAC,EAAI,CAAU,CAAC,EAC5C,EAAc,EAAE,EAClB,CAEA,OACE,EAAA,EAAA,MAAC,MAAD,CACE,UAAW,EAAA,GACT,iDACA,wDACA,oBACA,2BACA,6BACA,uDACA,CACF,EACA,YAAe,EAAS,SAAS,MAAM,EACvC,GAAI,WAXN,EAaE,EAAA,EAAA,KAAC,EAAD,CAAgB,QAAsB,eAAgB,CAAA,GACtD,EAAA,EAAA,KAAC,QAAD,CACE,IAAK,EACL,UAAU,gCACV,KAAK,OACL,MAAO,EACP,SAAU,EACV,UAAW,EACX,MAAO,CAAE,MAAO,GAAG,EAAW,OAAS,EAAE,GAAI,EAC7C,WAAc,EAAc,CAC7B,CAAA,EACA,GAAO,SAAW,GAAK,CAAC,IACvB,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,mCAA2B,CAAiB,CAAA,CAE1D,GAET,CAEA,EAAS,YAAc,WAOvB,SAAS,EAAQ,CAAE,QAAO,iBAA+B,CACvD,OACE,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,GAAO,KAAK,EAAK,KAChB,EAAA,EAAA,MAAC,EAAA,MAAD,CAAmB,UAAU,kDAA7B,EACE,EAAA,EAAA,KAAC,EAAA,OAAD,CACE,KAAK,SACL,UAAU,6BACV,KAAK,OACL,OAAO,YACP,YAAe,CACb,EAAc,GAAO,QAAQ,EAAG,IAAM,IAAM,CAAK,GAAK,CAAC,CAAC,CAC1D,YAEA,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,UAAU,MAAQ,CAAA,CACrB,CAAA,GACR,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,oBAAY,CAAS,CAAA,CAC/B,GAbK,CAaL,CACR,CACD,CAAA,CAEN"}
|