@axtec/components 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/components/OptionDivider/OptionDivider.d.ts +5 -0
- package/dist/components/OptionDivider/index.d.ts +1 -0
- package/dist/components/SelectionCard/SelectionCard.d.ts +12 -0
- package/dist/components/SelectionCard/index.d.ts +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.css +1 -1
- package/dist/index.js +106 -102
- package/dist/index.js.map +1 -1
- package/dist/index12.js +1 -1
- package/dist/index3.js +2 -2
- package/dist/index43.js +12 -14
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +11 -87
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +91 -69
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +68 -121
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +118 -36
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +40 -44
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +44 -56
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +56 -16
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +16 -65
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +62 -51
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +54 -37
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +37 -66
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +63 -19
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +19 -101
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +99 -213
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +58 -62
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +206 -224
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +62 -96
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +233 -33
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +98 -14
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +35 -59
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +16 -59
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +57 -72
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +58 -106
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +70 -43
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +101 -40
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +44 -72
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +47 -53
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +70 -62
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +46 -28
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +67 -13
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +35 -2263
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +17 -0
- package/dist/index75.js.map +1 -0
- package/dist/index76.js +2267 -0
- package/dist/index76.js.map +1 -0
- package/package.json +1 -1
package/dist/index69.js
CHANGED
|
@@ -1,79 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
sm:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { cn as r } from "./index3.js";
|
|
3
|
+
const d = {
|
|
4
|
+
body: "text-base",
|
|
5
|
+
"body-sm": "text-sm",
|
|
6
|
+
caption: "text-xs",
|
|
7
|
+
lead: "text-lg",
|
|
8
|
+
h1: "text-5xl font-light tracking-tight",
|
|
9
|
+
h2: "text-2xl font-semibold",
|
|
10
|
+
h3: "text-lg font-semibold"
|
|
11
|
+
}, i = {
|
|
12
|
+
h1: "h1",
|
|
13
|
+
h2: "h2",
|
|
14
|
+
h3: "h3"
|
|
15
|
+
}, x = {
|
|
16
|
+
default: "text-slate-900",
|
|
17
|
+
muted: "text-slate-500",
|
|
18
|
+
primary: "text-primary-600",
|
|
19
|
+
danger: "text-red-600"
|
|
20
|
+
}, f = {
|
|
21
|
+
normal: "font-normal",
|
|
22
|
+
medium: "font-medium",
|
|
23
|
+
semibold: "font-semibold",
|
|
24
|
+
bold: "font-bold"
|
|
20
25
|
};
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
className: u
|
|
26
|
+
function b({
|
|
27
|
+
children: e,
|
|
28
|
+
variant: t = "body",
|
|
29
|
+
color: o = "default",
|
|
30
|
+
weight: l = "normal",
|
|
31
|
+
as: n,
|
|
32
|
+
className: m
|
|
29
33
|
}) {
|
|
30
|
-
const
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"relative inline-flex flex-shrink-0 rounded-full",
|
|
40
|
-
"border-2 border-transparent cursor-pointer",
|
|
41
|
-
"transition-colors duration-200 ease-in-out",
|
|
42
|
-
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",
|
|
43
|
-
s ? "bg-primary-500" : "bg-slate-200",
|
|
44
|
-
o && "opacity-50 cursor-not-allowed",
|
|
45
|
-
l.track
|
|
46
|
-
),
|
|
47
|
-
children: /* @__PURE__ */ t(
|
|
48
|
-
"span",
|
|
49
|
-
{
|
|
50
|
-
className: e(
|
|
51
|
-
"pointer-events-none inline-block rounded-full",
|
|
52
|
-
"bg-white shadow-sm ring-0",
|
|
53
|
-
"transform transition duration-200 ease-in-out",
|
|
54
|
-
s ? l.translate : "translate-x-0",
|
|
55
|
-
l.thumb
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
),
|
|
61
|
-
(a || n) && /* @__PURE__ */ i("div", { className: "flex flex-col", children: [
|
|
62
|
-
a && /* @__PURE__ */ t(
|
|
63
|
-
r.Label,
|
|
64
|
-
{
|
|
65
|
-
className: e(
|
|
66
|
-
"text-sm font-medium text-slate-900",
|
|
67
|
-
o && "opacity-50"
|
|
68
|
-
),
|
|
69
|
-
children: a
|
|
70
|
-
}
|
|
34
|
+
const s = n || i[t] || "p";
|
|
35
|
+
return /* @__PURE__ */ a(
|
|
36
|
+
s,
|
|
37
|
+
{
|
|
38
|
+
className: r(
|
|
39
|
+
d[t],
|
|
40
|
+
x[o],
|
|
41
|
+
f[l],
|
|
42
|
+
m
|
|
71
43
|
),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
44
|
+
children: e
|
|
45
|
+
}
|
|
46
|
+
);
|
|
75
47
|
}
|
|
76
48
|
export {
|
|
77
|
-
|
|
49
|
+
b as Text
|
|
78
50
|
};
|
|
79
51
|
//# sourceMappingURL=index69.js.map
|
package/dist/index69.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index69.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index69.js","sources":["../src/components/Typography/Text.tsx"],"sourcesContent":["import { cn } from '@/lib/utils'\nimport type { ReactNode, ElementType } from 'react'\n\nexport interface TextProps {\n children: ReactNode\n variant?: 'body' | 'body-sm' | 'caption' | 'lead' | 'h1' | 'h2' | 'h3'\n color?: 'default' | 'muted' | 'primary' | 'danger'\n weight?: 'normal' | 'medium' | 'semibold' | 'bold'\n as?: ElementType\n className?: string\n}\n\nconst variantStyles = {\n body: 'text-base',\n 'body-sm': 'text-sm',\n caption: 'text-xs',\n lead: 'text-lg',\n h1: 'text-5xl font-light tracking-tight',\n h2: 'text-2xl font-semibold',\n h3: 'text-lg font-semibold',\n}\n\nconst variantDefaults: Partial<Record<TextProps['variant'] & string, ElementType>> = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n}\n\nconst colorStyles = {\n default: 'text-slate-900',\n muted: 'text-slate-500',\n primary: 'text-primary-600',\n danger: 'text-red-600',\n}\n\nconst weightStyles = {\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n}\n\nexport function Text({\n children,\n variant = 'body',\n color = 'default',\n weight = 'normal',\n as,\n className,\n}: TextProps) {\n const Component = as || variantDefaults[variant!] || 'p'\n return (\n <Component\n className={cn(\n variantStyles[variant],\n colorStyles[color],\n weightStyles[weight],\n className\n )}\n >\n {children}\n </Component>\n )\n}\n"],"names":["variantStyles","variantDefaults","colorStyles","weightStyles","Text","children","variant","color","weight","as","className","Component","jsx","cn"],"mappings":";;AAYA,MAAMA,IAAgB;AAAA,EACpB,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AAAA,EACT,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,IAA+E;AAAA,EACnF,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,IAAc;AAAA,EAClB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AACV,GAEMC,IAAe;AAAA,EACnB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM;AACR;AAEO,SAASC,EAAK;AAAA,EACnB,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,IAAAC;AAAA,EACA,WAAAC;AACF,GAAc;AACZ,QAAMC,IAAYF,KAAMR,EAAgBK,CAAQ,KAAK;AACrD,SACE,gBAAAM;AAAA,IAACD;AAAA,IAAA;AAAA,MACC,WAAWE;AAAA,QACTb,EAAcM,CAAO;AAAA,QACrBJ,EAAYK,CAAK;AAAA,QACjBJ,EAAaK,CAAM;AAAA,QACnBE;AAAA,MAAA;AAAA,MAGD,UAAAL;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
package/dist/index70.js
CHANGED
|
@@ -1,57 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
className: o(
|
|
17
|
-
"flex items-center justify-between gap-4",
|
|
18
|
-
n && "opacity-50",
|
|
19
|
-
i
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
import { cn as a } from "./index3.js";
|
|
4
|
+
const f = l(
|
|
5
|
+
({ className: d, label: e, error: t, helperText: s, id: i, ...c }, m) => {
|
|
6
|
+
const o = i || (e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-"));
|
|
7
|
+
return /* @__PURE__ */ n("div", { className: "w-full", children: [
|
|
8
|
+
e && /* @__PURE__ */ r(
|
|
9
|
+
"label",
|
|
10
|
+
{
|
|
11
|
+
htmlFor: o,
|
|
12
|
+
className: "block text-sm font-medium text-slate-700 mb-1.5",
|
|
13
|
+
children: e
|
|
14
|
+
}
|
|
20
15
|
),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
16
|
+
/* @__PURE__ */ r(
|
|
17
|
+
"textarea",
|
|
18
|
+
{
|
|
19
|
+
ref: m,
|
|
20
|
+
id: o,
|
|
21
|
+
className: a(
|
|
22
|
+
"w-full px-4 py-2.5 text-base min-h-[100px] resize-y",
|
|
23
|
+
"bg-white border rounded-lg",
|
|
24
|
+
"transition-colors duration-200",
|
|
25
|
+
"placeholder:text-slate-400",
|
|
26
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
27
|
+
t ? "border-red-500 focus:border-red-500 focus:ring-red-500" : "border-slate-300 focus:border-primary-500 focus:ring-primary-500",
|
|
28
|
+
"disabled:bg-slate-50 disabled:text-slate-500 disabled:cursor-not-allowed",
|
|
29
|
+
d
|
|
30
|
+
),
|
|
31
|
+
...c
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
(t || s) && /* @__PURE__ */ r(
|
|
35
|
+
"p",
|
|
36
|
+
{
|
|
37
|
+
className: a(
|
|
38
|
+
"mt-1.5 text-sm",
|
|
39
|
+
t ? "text-red-600" : "text-slate-500"
|
|
40
|
+
),
|
|
41
|
+
children: t || s
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
f.displayName = "Textarea";
|
|
54
48
|
export {
|
|
55
|
-
f as
|
|
49
|
+
f as Textarea
|
|
56
50
|
};
|
|
57
51
|
//# sourceMappingURL=index70.js.map
|
package/dist/index70.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index70.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index70.js","sources":["../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import { forwardRef, type TextareaHTMLAttributes } from 'react'\nimport { cn } from '@/lib/utils'\n\nexport interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n label?: string\n error?: string\n helperText?: string\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, label, error, helperText, id, ...props }, ref) => {\n const textareaId = id || label?.toLowerCase().replace(/\\s+/g, '-')\n\n return (\n <div className=\"w-full\">\n {label && (\n <label\n htmlFor={textareaId}\n className=\"block text-sm font-medium text-slate-700 mb-1.5\"\n >\n {label}\n </label>\n )}\n <textarea\n ref={ref}\n id={textareaId}\n className={cn(\n 'w-full px-4 py-2.5 text-base min-h-[100px] resize-y',\n 'bg-white border rounded-lg',\n 'transition-colors duration-200',\n 'placeholder:text-slate-400',\n 'focus:outline-none focus:ring-2 focus:ring-offset-0',\n error\n ? 'border-red-500 focus:border-red-500 focus:ring-red-500'\n : 'border-slate-300 focus:border-primary-500 focus:ring-primary-500',\n 'disabled:bg-slate-50 disabled:text-slate-500 disabled:cursor-not-allowed',\n className\n )}\n {...props}\n />\n {(error || helperText) && (\n <p\n className={cn(\n 'mt-1.5 text-sm',\n error ? 'text-red-600' : 'text-slate-500'\n )}\n >\n {error || helperText}\n </p>\n )}\n </div>\n )\n }\n)\n\nTextarea.displayName = 'Textarea'\n"],"names":["Textarea","forwardRef","className","label","error","helperText","id","props","ref","textareaId","jsxs","jsx","cn"],"mappings":";;;AASO,MAAMA,IAAWC;AAAA,EACtB,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,OAAAC,GAAO,YAAAC,GAAY,IAAAC,GAAI,GAAGC,EAAA,GAASC,MAAQ;AAC9D,UAAMC,IAAaH,MAAMH,KAAA,gBAAAA,EAAO,cAAc,QAAQ,QAAQ;AAE9D,WACE,gBAAAO,EAAC,OAAA,EAAI,WAAU,UACZ,UAAA;AAAA,MAAAP,KACC,gBAAAQ;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAASF;AAAA,UACT,WAAU;AAAA,UAET,UAAAN;AAAA,QAAA;AAAA,MAAA;AAAA,MAGL,gBAAAQ;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,KAAAH;AAAA,UACA,IAAIC;AAAA,UACJ,WAAWG;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACAR,IACI,2DACA;AAAA,YACJ;AAAA,YACAF;AAAA,UAAA;AAAA,UAED,GAAGK;AAAA,QAAA;AAAA,MAAA;AAAA,OAEJH,KAASC,MACT,gBAAAM;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWC;AAAA,YACT;AAAA,YACAR,IAAQ,iBAAiB;AAAA,UAAA;AAAA,UAG1B,UAAAA,KAASC;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ,GAEJ;AAAA,EAEJ;AACF;AAEAL,EAAS,cAAc;"}
|
package/dist/index71.js
CHANGED
|
@@ -1,71 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Switch as r } from "@headlessui/react";
|
|
3
|
+
import { cn as e } from "./index3.js";
|
|
4
|
+
const f = {
|
|
5
|
+
sm: {
|
|
6
|
+
track: "h-5 w-9",
|
|
7
|
+
thumb: "h-4 w-4",
|
|
8
|
+
translate: "translate-x-4"
|
|
9
|
+
},
|
|
10
|
+
md: {
|
|
11
|
+
track: "h-6 w-11",
|
|
12
|
+
thumb: "h-5 w-5",
|
|
13
|
+
translate: "translate-x-5"
|
|
14
|
+
},
|
|
15
|
+
lg: {
|
|
16
|
+
track: "h-7 w-14",
|
|
17
|
+
thumb: "h-6 w-6",
|
|
18
|
+
translate: "translate-x-7"
|
|
19
|
+
}
|
|
14
20
|
};
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
function p({
|
|
22
|
+
checked: s,
|
|
23
|
+
onChange: m,
|
|
24
|
+
label: a,
|
|
25
|
+
description: n,
|
|
26
|
+
disabled: o = !1,
|
|
27
|
+
size: c = "md",
|
|
28
|
+
className: u
|
|
21
29
|
}) {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
const l = f[c];
|
|
31
|
+
return /* @__PURE__ */ t(r.Group, { children: /* @__PURE__ */ i("div", { className: e("flex items-start gap-3", u), children: [
|
|
32
|
+
/* @__PURE__ */ t(
|
|
33
|
+
r,
|
|
34
|
+
{
|
|
35
|
+
checked: s,
|
|
36
|
+
onChange: m,
|
|
37
|
+
disabled: o,
|
|
38
|
+
className: e(
|
|
39
|
+
"relative inline-flex flex-shrink-0 rounded-full",
|
|
40
|
+
"border-2 border-transparent cursor-pointer",
|
|
41
|
+
"transition-colors duration-200 ease-in-out",
|
|
42
|
+
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",
|
|
43
|
+
s ? "bg-primary-500" : "bg-slate-200",
|
|
44
|
+
o && "opacity-50 cursor-not-allowed",
|
|
45
|
+
l.track
|
|
46
|
+
),
|
|
47
|
+
children: /* @__PURE__ */ t(
|
|
48
|
+
"span",
|
|
40
49
|
{
|
|
41
|
-
className:
|
|
42
|
-
"
|
|
43
|
-
"bg-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
),
|
|
49
|
-
role: "tooltip",
|
|
50
|
-
children: [
|
|
51
|
-
p,
|
|
52
|
-
/* @__PURE__ */ c(
|
|
53
|
-
"span",
|
|
54
|
-
{
|
|
55
|
-
className: i(
|
|
56
|
-
"absolute w-0 h-0 border-4",
|
|
57
|
-
h[t]
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
)
|
|
61
|
-
]
|
|
50
|
+
className: e(
|
|
51
|
+
"pointer-events-none inline-block rounded-full",
|
|
52
|
+
"bg-white shadow-sm ring-0",
|
|
53
|
+
"transform transition duration-200 ease-in-out",
|
|
54
|
+
s ? l.translate : "translate-x-0",
|
|
55
|
+
l.thumb
|
|
56
|
+
)
|
|
62
57
|
}
|
|
63
58
|
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
(a || n) && /* @__PURE__ */ i("div", { className: "flex flex-col", children: [
|
|
62
|
+
a && /* @__PURE__ */ t(
|
|
63
|
+
r.Label,
|
|
64
|
+
{
|
|
65
|
+
className: e(
|
|
66
|
+
"text-sm font-medium text-slate-900",
|
|
67
|
+
o && "opacity-50"
|
|
68
|
+
),
|
|
69
|
+
children: a
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
n && /* @__PURE__ */ t(r.Description, { className: "text-sm text-slate-500", children: n })
|
|
73
|
+
] })
|
|
74
|
+
] }) });
|
|
67
75
|
}
|
|
68
76
|
export {
|
|
69
|
-
|
|
77
|
+
p as Toggle
|
|
70
78
|
};
|
|
71
79
|
//# sourceMappingURL=index71.js.map
|
package/dist/index71.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index71.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index71.js","sources":["../src/components/Toggle/Toggle.tsx"],"sourcesContent":["import { Switch } from '@headlessui/react'\nimport { cn } from '@/lib/utils'\n\nexport interface ToggleProps {\n checked: boolean\n onChange: (checked: boolean) => void\n label?: string\n description?: string\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n className?: string\n}\n\nconst sizeStyles = {\n sm: {\n track: 'h-5 w-9',\n thumb: 'h-4 w-4',\n translate: 'translate-x-4',\n },\n md: {\n track: 'h-6 w-11',\n thumb: 'h-5 w-5',\n translate: 'translate-x-5',\n },\n lg: {\n track: 'h-7 w-14',\n thumb: 'h-6 w-6',\n translate: 'translate-x-7',\n },\n}\n\nexport function Toggle({\n checked,\n onChange,\n label,\n description,\n disabled = false,\n size = 'md',\n className,\n}: ToggleProps) {\n const styles = sizeStyles[size]\n\n return (\n <Switch.Group>\n <div className={cn('flex items-start gap-3', className)}>\n <Switch\n checked={checked}\n onChange={onChange}\n disabled={disabled}\n className={cn(\n 'relative inline-flex flex-shrink-0 rounded-full',\n 'border-2 border-transparent cursor-pointer',\n 'transition-colors duration-200 ease-in-out',\n 'focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2',\n checked ? 'bg-primary-500' : 'bg-slate-200',\n disabled && 'opacity-50 cursor-not-allowed',\n styles.track\n )}\n >\n <span\n className={cn(\n 'pointer-events-none inline-block rounded-full',\n 'bg-white shadow-sm ring-0',\n 'transform transition duration-200 ease-in-out',\n checked ? styles.translate : 'translate-x-0',\n styles.thumb\n )}\n />\n </Switch>\n {(label || description) && (\n <div className=\"flex flex-col\">\n {label && (\n <Switch.Label\n className={cn(\n 'text-sm font-medium text-slate-900',\n disabled && 'opacity-50'\n )}\n >\n {label}\n </Switch.Label>\n )}\n {description && (\n <Switch.Description className=\"text-sm text-slate-500\">\n {description}\n </Switch.Description>\n )}\n </div>\n )}\n </div>\n </Switch.Group>\n )\n}\n"],"names":["sizeStyles","Toggle","checked","onChange","label","description","disabled","size","className","styles","jsx","Switch","jsxs","cn"],"mappings":";;;AAaA,MAAMA,IAAa;AAAA,EACjB,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO;AAAA,IACP,WAAW;AAAA,EAAA;AAAA,EAEb,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO;AAAA,IACP,WAAW;AAAA,EAAA;AAAA,EAEb,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO;AAAA,IACP,WAAW;AAAA,EAAA;AAEf;AAEO,SAASC,EAAO;AAAA,EACrB,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,MAAAC,IAAO;AAAA,EACP,WAAAC;AACF,GAAgB;AACd,QAAMC,IAAST,EAAWO,CAAI;AAE9B,SACE,gBAAAG,EAACC,EAAO,OAAP,EACC,UAAA,gBAAAC,EAAC,SAAI,WAAWC,EAAG,0BAA0BL,CAAS,GACpD,UAAA;AAAA,IAAA,gBAAAE;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,SAAAT;AAAA,QACA,UAAAC;AAAA,QACA,UAAAG;AAAA,QACA,WAAWO;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACAX,IAAU,mBAAmB;AAAA,UAC7BI,KAAY;AAAA,UACZG,EAAO;AAAA,QAAA;AAAA,QAGT,UAAA,gBAAAC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWG;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,cACAX,IAAUO,EAAO,YAAY;AAAA,cAC7BA,EAAO;AAAA,YAAA;AAAA,UACT;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,KAEAL,KAASC,MACT,gBAAAO,EAAC,OAAA,EAAI,WAAU,iBACZ,UAAA;AAAA,MAAAR,KACC,gBAAAM;AAAA,QAACC,EAAO;AAAA,QAAP;AAAA,UACC,WAAWE;AAAA,YACT;AAAA,YACAP,KAAY;AAAA,UAAA;AAAA,UAGb,UAAAF;AAAA,QAAA;AAAA,MAAA;AAAA,MAGJC,KACC,gBAAAK,EAACC,EAAO,aAAP,EAAmB,WAAU,0BAC3B,UAAAN,EAAA,CACH;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
package/dist/index72.js
CHANGED
|
@@ -1,39 +1,57 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
up: "text-green-600",
|
|
10
|
-
down: "text-red-500",
|
|
11
|
-
stable: "text-slate-500"
|
|
12
|
-
}, u = ({
|
|
13
|
-
direction: t,
|
|
14
|
-
value: e,
|
|
15
|
-
showIcon: s = !0,
|
|
16
|
-
size: r = "md",
|
|
17
|
-
className: c
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as o } from "./index3.js";
|
|
3
|
+
const f = ({
|
|
4
|
+
label: r,
|
|
5
|
+
checked: t,
|
|
6
|
+
onChange: s,
|
|
7
|
+
disabled: n = !1,
|
|
8
|
+
className: i
|
|
18
9
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
const a = () => {
|
|
11
|
+
n || s(!t);
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ l(
|
|
14
|
+
"div",
|
|
22
15
|
{
|
|
23
|
-
className:
|
|
24
|
-
"
|
|
25
|
-
n
|
|
26
|
-
|
|
27
|
-
c
|
|
16
|
+
className: o(
|
|
17
|
+
"flex items-center justify-between gap-4",
|
|
18
|
+
n && "opacity-50",
|
|
19
|
+
i
|
|
28
20
|
),
|
|
29
21
|
children: [
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-slate-700", children: r }),
|
|
23
|
+
/* @__PURE__ */ e(
|
|
24
|
+
"button",
|
|
25
|
+
{
|
|
26
|
+
type: "button",
|
|
27
|
+
role: "switch",
|
|
28
|
+
"aria-checked": t,
|
|
29
|
+
disabled: n,
|
|
30
|
+
onClick: a,
|
|
31
|
+
className: o(
|
|
32
|
+
"relative inline-flex h-6 w-11 items-center rounded-full",
|
|
33
|
+
"transition-colors duration-200 ease-in-out",
|
|
34
|
+
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",
|
|
35
|
+
t ? "bg-primary-500" : "bg-slate-200",
|
|
36
|
+
n ? "cursor-not-allowed" : "cursor-pointer"
|
|
37
|
+
),
|
|
38
|
+
children: /* @__PURE__ */ e(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
className: o(
|
|
42
|
+
"inline-block h-4 w-4 rounded-full bg-white shadow-sm",
|
|
43
|
+
"transform transition-transform duration-200 ease-in-out",
|
|
44
|
+
t ? "translate-x-6" : "translate-x-1"
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
)
|
|
32
50
|
]
|
|
33
51
|
}
|
|
34
52
|
);
|
|
35
53
|
};
|
|
36
54
|
export {
|
|
37
|
-
|
|
55
|
+
f as ToggleButton
|
|
38
56
|
};
|
|
39
57
|
//# sourceMappingURL=index72.js.map
|
package/dist/index72.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index72.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index72.js","sources":["../src/components/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import { cn } from '@/lib/utils'\n\nexport interface ToggleButtonProps {\n label: string\n checked: boolean\n onChange: (checked: boolean) => void\n disabled?: boolean\n className?: string\n}\n\nexport const ToggleButton = ({\n label,\n checked,\n onChange,\n disabled = false,\n className,\n}: ToggleButtonProps) => {\n const handleClick = () => {\n if (!disabled) {\n onChange(!checked)\n }\n }\n\n return (\n <div\n className={cn(\n 'flex items-center justify-between gap-4',\n disabled && 'opacity-50',\n className\n )}\n >\n <span className=\"text-sm text-slate-700\">\n {label}\n </span>\n\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n disabled={disabled}\n onClick={handleClick}\n className={cn(\n 'relative inline-flex h-6 w-11 items-center rounded-full',\n 'transition-colors duration-200 ease-in-out',\n 'focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2',\n checked ? 'bg-primary-500' : 'bg-slate-200',\n disabled ? 'cursor-not-allowed' : 'cursor-pointer'\n )}\n >\n <span\n className={cn(\n 'inline-block h-4 w-4 rounded-full bg-white shadow-sm',\n 'transform transition-transform duration-200 ease-in-out',\n checked ? 'translate-x-6' : 'translate-x-1'\n )}\n />\n </button>\n </div>\n )\n}\n"],"names":["ToggleButton","label","checked","onChange","disabled","className","handleClick","jsxs","cn","jsx"],"mappings":";;AAUO,MAAMA,IAAe,CAAC;AAAA,EAC3B,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC;AACF,MAAyB;AACvB,QAAMC,IAAc,MAAM;AACxB,IAAKF,KACHD,EAAS,CAACD,CAAO;AAAA,EAErB;AAEA,SACE,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAJ,KAAY;AAAA,QACZC;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAA,gBAAAI,EAAC,QAAA,EAAK,WAAU,0BACb,UAAAR,GACH;AAAA,QAEA,gBAAAQ;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,MAAK;AAAA,YACL,gBAAcP;AAAA,YACd,UAAAE;AAAA,YACA,SAASE;AAAA,YACT,WAAWE;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,cACAN,IAAU,mBAAmB;AAAA,cAC7BE,IAAW,uBAAuB;AAAA,YAAA;AAAA,YAGpC,UAAA,gBAAAK;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAWD;AAAA,kBACT;AAAA,kBACA;AAAA,kBACAN,IAAU,kBAAkB;AAAA,gBAAA;AAAA,cAC9B;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|