@axtec/components 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +156 -0
- package/dist/components/PrimaryCard/PrimaryCard.d.ts +24 -0
- package/dist/components/PrimaryCard/index.d.ts +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +101 -0
- package/dist/components/Sidebar/index.d.ts +1 -0
- package/dist/components/Typography/Text.d.ts +2 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/index.css +1 -1
- package/dist/index.js +123 -111
- package/dist/index.js.map +1 -1
- package/dist/index3.js +2 -2
- package/dist/index48.js +44 -56
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +56 -16
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +16 -65
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +62 -51
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +54 -37
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +37 -66
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +63 -19
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +19 -101
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +100 -64
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +206 -224
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +62 -96
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +233 -33
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +98 -14
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +35 -59
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +16 -59
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +57 -72
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +58 -106
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +70 -35
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +101 -40
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +44 -72
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +47 -53
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +70 -62
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +46 -28
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +67 -13
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +35 -2263
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +17 -0
- package/dist/index73.js.map +1 -0
- package/dist/index74.js +2267 -0
- package/dist/index74.js.map +1 -0
- package/package.json +1 -1
package/dist/index68.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=index68.js.map
|
package/dist/index68.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index68.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index68.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/index69.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=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/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,I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IAAA,EAAA,CAEJ;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
package/dist/index70.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=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/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;"}
|
package/dist/index71.js
CHANGED
|
@@ -1,17 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as s, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as n } from "react";
|
|
3
|
+
import { cn as i } from "./index3.js";
|
|
4
|
+
const x = {
|
|
5
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
6
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
7
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
8
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
9
|
+
}, h = {
|
|
10
|
+
top: "top-full left-1/2 -translate-x-1/2 border-t-slate-800 border-x-transparent border-b-transparent",
|
|
11
|
+
bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-slate-800 border-x-transparent border-t-transparent",
|
|
12
|
+
left: "left-full top-1/2 -translate-y-1/2 border-l-slate-800 border-y-transparent border-r-transparent",
|
|
13
|
+
right: "right-full top-1/2 -translate-y-1/2 border-r-slate-800 border-y-transparent border-l-transparent"
|
|
14
|
+
};
|
|
15
|
+
function T({
|
|
16
|
+
content: p,
|
|
17
|
+
children: u,
|
|
18
|
+
position: t = "top",
|
|
19
|
+
delay: b = 200,
|
|
20
|
+
className: d
|
|
21
|
+
}) {
|
|
22
|
+
const [f, e] = n(!1), [r, o] = n(null), l = () => {
|
|
23
|
+
const m = setTimeout(() => e(!0), b);
|
|
24
|
+
o(m);
|
|
25
|
+
}, a = () => {
|
|
26
|
+
r && (clearTimeout(r), o(null)), e(!1);
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ s(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: "relative inline-flex",
|
|
32
|
+
onMouseEnter: l,
|
|
33
|
+
onMouseLeave: a,
|
|
34
|
+
onFocus: l,
|
|
35
|
+
onBlur: a,
|
|
36
|
+
children: [
|
|
37
|
+
u,
|
|
38
|
+
f && /* @__PURE__ */ s(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: i(
|
|
42
|
+
"absolute z-50 px-3 py-1.5",
|
|
43
|
+
"bg-slate-800 text-white text-sm rounded-lg",
|
|
44
|
+
"whitespace-nowrap",
|
|
45
|
+
"animate-in fade-in-0 zoom-in-95 duration-150",
|
|
46
|
+
x[t],
|
|
47
|
+
d
|
|
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
|
+
]
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
13
67
|
}
|
|
14
68
|
export {
|
|
15
|
-
|
|
69
|
+
T as Tooltip
|
|
16
70
|
};
|
|
17
71
|
//# sourceMappingURL=index71.js.map
|
package/dist/index71.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index71.js","sources":["../
|
|
1
|
+
{"version":3,"file":"index71.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { useState, type ReactNode } from 'react'\nimport { cn } from '@/lib/utils'\n\nexport interface TooltipProps {\n content: ReactNode\n children: ReactNode\n position?: 'top' | 'bottom' | 'left' | 'right'\n delay?: number\n className?: string\n}\n\nconst positionStyles = {\n top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',\n bottom: 'top-full left-1/2 -translate-x-1/2 mt-2',\n left: 'right-full top-1/2 -translate-y-1/2 mr-2',\n right: 'left-full top-1/2 -translate-y-1/2 ml-2',\n}\n\nconst arrowStyles = {\n top: 'top-full left-1/2 -translate-x-1/2 border-t-slate-800 border-x-transparent border-b-transparent',\n bottom: 'bottom-full left-1/2 -translate-x-1/2 border-b-slate-800 border-x-transparent border-t-transparent',\n left: 'left-full top-1/2 -translate-y-1/2 border-l-slate-800 border-y-transparent border-r-transparent',\n right: 'right-full top-1/2 -translate-y-1/2 border-r-slate-800 border-y-transparent border-l-transparent',\n}\n\nexport function Tooltip({\n content,\n children,\n position = 'top',\n delay = 200,\n className,\n}: TooltipProps) {\n const [isVisible, setIsVisible] = useState(false)\n const [timeoutId, setTimeoutId] = useState<ReturnType<typeof setTimeout> | null>(null)\n\n const showTooltip = () => {\n const id = setTimeout(() => setIsVisible(true), delay)\n setTimeoutId(id)\n }\n\n const hideTooltip = () => {\n if (timeoutId) {\n clearTimeout(timeoutId)\n setTimeoutId(null)\n }\n setIsVisible(false)\n }\n\n return (\n <div\n className=\"relative inline-flex\"\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n onFocus={showTooltip}\n onBlur={hideTooltip}\n >\n {children}\n {isVisible && (\n <div\n className={cn(\n 'absolute z-50 px-3 py-1.5',\n 'bg-slate-800 text-white text-sm rounded-lg',\n 'whitespace-nowrap',\n 'animate-in fade-in-0 zoom-in-95 duration-150',\n positionStyles[position],\n className\n )}\n role=\"tooltip\"\n >\n {content}\n <span\n className={cn(\n 'absolute w-0 h-0 border-4',\n arrowStyles[position]\n )}\n />\n </div>\n )}\n </div>\n )\n}\n"],"names":["positionStyles","arrowStyles","Tooltip","content","children","position","delay","className","isVisible","setIsVisible","useState","timeoutId","setTimeoutId","showTooltip","id","hideTooltip","jsxs","cn","jsx"],"mappings":";;;AAWA,MAAMA,IAAiB;AAAA,EACrB,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AACT,GAEMC,IAAc;AAAA,EAClB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