@clasing/ui 2.0.0 → 2.0.2
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/button-BnSM-lrr.cjs +1 -0
- package/dist/{button-DU1x2trm.js → button-C5IBh3Tr.js} +92 -92
- package/dist/components/alert-dialog.cjs.js +1 -1
- package/dist/components/alert-dialog.es.js +1 -1
- package/dist/components/button.cjs.js +1 -1
- package/dist/components/button.es.js +1 -1
- package/dist/components/calendar.cjs.js +1 -1
- package/dist/components/calendar.d.ts +8 -15
- package/dist/components/calendar.es.js +188 -2
- package/dist/components/form.cjs.js +1 -0
- package/dist/components/form.d.ts +24 -0
- package/dist/components/form.es.js +101 -0
- package/dist/components/input.cjs.js +1 -1
- package/dist/components/input.d.ts +3 -15
- package/dist/components/input.es.js +1 -1
- package/dist/components/phone-input.cjs.js +1 -1
- package/dist/components/phone-input.es.js +1 -1
- package/dist/components/textarea.cjs.js +1 -1
- package/dist/components/textarea.d.ts +4 -16
- package/dist/components/textarea.es.js +55 -128
- package/dist/entries/form.d.ts +2 -0
- package/dist/input-Bs18T-Y3.js +97 -0
- package/dist/input-wSGCWBH-.cjs +1 -0
- package/package.json +357 -359
- package/dist/button-dueLddAn.cjs +0 -1
- package/dist/calendar-DA08oJl2.js +0 -117
- package/dist/calendar-gxLdKgjb.cjs +0 -1
- package/dist/components/blocks/date-picker.cjs.js +0 -1
- package/dist/components/blocks/date-picker.d.ts +0 -30
- package/dist/components/blocks/date-picker.es.js +0 -181
- package/dist/components/blocks/date-range-picker.cjs.js +0 -1
- package/dist/components/blocks/date-range-picker.d.ts +0 -29
- package/dist/components/blocks/date-range-picker.es.js +0 -246
- package/dist/entries/blocks/date-picker.d.ts +0 -2
- package/dist/entries/blocks/date-range-picker.d.ts +0 -2
- package/dist/input-BoPcvULq.js +0 -174
- package/dist/input-eri6Lyeo.cjs +0 -1
- package/dist/style-BNIXVvBA.js +0 -1172
- package/dist/style-CA5976Oh.cjs +0 -1
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex w-full min-w-0 resize-none border bg-transparent transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
1
|
+
import { j as e } from "../jsx-runtime-DywqP_6a.js";
|
|
2
|
+
import { c as n } from "../index-CRiPKpXj.js";
|
|
3
|
+
import { c as v } from "../index-BqtVL8d-.js";
|
|
4
|
+
import { I as b } from "../icon-component-CxQsODCa.js";
|
|
5
|
+
const x = v(
|
|
6
|
+
"placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex w-full min-w-0 rounded-md border bg-transparent transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
8
7
|
{
|
|
9
8
|
variants: {
|
|
10
9
|
size: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
rounded: {
|
|
16
|
-
default: "",
|
|
17
|
-
full: "rounded-2xl"
|
|
18
|
-
},
|
|
19
|
-
state: {
|
|
20
|
-
default: "",
|
|
21
|
-
error: "border-destructive ring-destructive/20 dark:ring-destructive/40",
|
|
22
|
-
success: "border-success ring-success/20 dark:ring-success/40"
|
|
10
|
+
xs: "text-label-sm min-h-16 px-2 py-1",
|
|
11
|
+
sm: "text-label-md min-h-20 px-2 py-1",
|
|
12
|
+
md: "text-label-lg min-h-24 px-3 py-2",
|
|
13
|
+
lg: "text-label-xl min-h-32 px-4 py-3"
|
|
23
14
|
},
|
|
24
15
|
resize: {
|
|
25
16
|
none: "resize-none",
|
|
@@ -30,134 +21,70 @@ const I = h(
|
|
|
30
21
|
},
|
|
31
22
|
defaultVariants: {
|
|
32
23
|
size: "md",
|
|
33
|
-
rounded: "default",
|
|
34
|
-
state: "default",
|
|
35
24
|
resize: "vertical"
|
|
36
25
|
}
|
|
37
26
|
}
|
|
38
27
|
);
|
|
39
|
-
function
|
|
40
|
-
className:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
rounded: b,
|
|
48
|
-
state: k,
|
|
49
|
-
resize: g,
|
|
50
|
-
containerClassName: z,
|
|
51
|
-
maxLength: a,
|
|
52
|
-
showCharacterCount: j = !1,
|
|
53
|
-
...e
|
|
28
|
+
function j({
|
|
29
|
+
className: o,
|
|
30
|
+
size: l,
|
|
31
|
+
resize: d,
|
|
32
|
+
iconName: c,
|
|
33
|
+
maxLength: r,
|
|
34
|
+
showCharacterCount: m = !1,
|
|
35
|
+
...t
|
|
54
36
|
}) {
|
|
55
|
-
const
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
37
|
+
const i = c ? ((s) => typeof s == "string" ? { name: s } : s)(c) : void 0, a = t.value ? String(t.value).length : 0, u = m || r;
|
|
38
|
+
return !i && !u ? /* @__PURE__ */ e.jsx(
|
|
39
|
+
"textarea",
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "textarea",
|
|
42
|
+
maxLength: r,
|
|
43
|
+
className: n(
|
|
44
|
+
x({ size: l, resize: d }),
|
|
45
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
46
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
47
|
+
o
|
|
48
|
+
),
|
|
49
|
+
...t
|
|
50
|
+
}
|
|
51
|
+
) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
52
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative w-full", children: [
|
|
53
|
+
/* @__PURE__ */ e.jsx(
|
|
69
54
|
"textarea",
|
|
70
55
|
{
|
|
71
56
|
"data-slot": "textarea",
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
rounded: b,
|
|
80
|
-
resize: g,
|
|
81
|
-
state: n,
|
|
82
|
-
className: l(
|
|
83
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
84
|
-
r ? "pr-10" : "",
|
|
85
|
-
f
|
|
86
|
-
)
|
|
87
|
-
})
|
|
57
|
+
maxLength: r,
|
|
58
|
+
className: n(
|
|
59
|
+
x({ size: l, resize: d }),
|
|
60
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
61
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
62
|
+
i ? "pr-10" : "",
|
|
63
|
+
o
|
|
88
64
|
),
|
|
89
|
-
...
|
|
90
|
-
}
|
|
91
|
-
),
|
|
92
|
-
r && /* @__PURE__ */ t.jsx(
|
|
93
|
-
"span",
|
|
94
|
-
{
|
|
95
|
-
className: l("absolute top-3 right-3", {
|
|
96
|
-
"text-muted-foreground": n === "default",
|
|
97
|
-
"text-destructive": n === "error",
|
|
98
|
-
"text-success-main": n === "success",
|
|
99
|
-
"text-neutral-700": e.disabled
|
|
100
|
-
}),
|
|
101
|
-
children: /* @__PURE__ */ t.jsx(
|
|
102
|
-
u,
|
|
103
|
-
{
|
|
104
|
-
iconName: r.name,
|
|
105
|
-
stroke: r.stroke,
|
|
106
|
-
size: 20
|
|
107
|
-
}
|
|
108
|
-
)
|
|
65
|
+
...t
|
|
109
66
|
}
|
|
110
67
|
),
|
|
111
|
-
|
|
112
|
-
|
|
68
|
+
i && /* @__PURE__ */ e.jsx("span", { className: "absolute top-3 right-3 text-muted-foreground", children: /* @__PURE__ */ e.jsx(
|
|
69
|
+
b,
|
|
113
70
|
{
|
|
114
|
-
iconName:
|
|
115
|
-
|
|
116
|
-
|
|
71
|
+
iconName: i.name,
|
|
72
|
+
stroke: i.stroke,
|
|
73
|
+
size: 20
|
|
117
74
|
}
|
|
118
|
-
)
|
|
119
|
-
!r && i && !s && e.value && /* @__PURE__ */ t.jsx(
|
|
120
|
-
u,
|
|
121
|
-
{
|
|
122
|
-
iconName: "IconCircleCheckFilled",
|
|
123
|
-
size: 20,
|
|
124
|
-
className: "text-success-main absolute top-3 right-3"
|
|
125
|
-
}
|
|
126
|
-
)
|
|
75
|
+
) })
|
|
127
76
|
] }),
|
|
128
|
-
|
|
129
|
-
"span",
|
|
130
|
-
{
|
|
131
|
-
className: l("text-label-sm", {
|
|
132
|
-
"text-muted-foreground": !a || d <= a,
|
|
133
|
-
"text-destructive": a && d > a
|
|
134
|
-
}),
|
|
135
|
-
children: a ? `${d}/${a}` : d
|
|
136
|
-
}
|
|
137
|
-
) }),
|
|
138
|
-
s && i ? /* @__PURE__ */ t.jsx(
|
|
139
|
-
"span",
|
|
140
|
-
{
|
|
141
|
-
id: e.id && `${e.id}-error-text`,
|
|
142
|
-
"aria-invalid": !0,
|
|
143
|
-
className: "text-destructive text-label-md",
|
|
144
|
-
children: s
|
|
145
|
-
}
|
|
146
|
-
) : c ? /* @__PURE__ */ t.jsx(
|
|
77
|
+
u && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
|
|
147
78
|
"span",
|
|
148
79
|
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
"text-muted-foreground": !s && !i,
|
|
152
|
-
"text-destructive": s && i,
|
|
153
|
-
"text-success-main": i && !s && e.value !== void 0,
|
|
154
|
-
"text-neutral-700": e.disabled
|
|
80
|
+
className: n("text-xs text-muted-foreground", {
|
|
81
|
+
"text-destructive": r && a > r
|
|
155
82
|
}),
|
|
156
|
-
children:
|
|
83
|
+
children: r ? `${a}/${r}` : a
|
|
157
84
|
}
|
|
158
|
-
)
|
|
85
|
+
) })
|
|
159
86
|
] });
|
|
160
87
|
}
|
|
161
88
|
export {
|
|
162
|
-
|
|
89
|
+
j as Textarea
|
|
163
90
|
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { j as r } from "./jsx-runtime-DywqP_6a.js";
|
|
2
|
+
import { c as u } from "./index-CRiPKpXj.js";
|
|
3
|
+
import { c as x } from "./index-BqtVL8d-.js";
|
|
4
|
+
import * as b from "react";
|
|
5
|
+
import { B as g } from "./button-C5IBh3Tr.js";
|
|
6
|
+
import { I as m } from "./icon-component-CxQsODCa.js";
|
|
7
|
+
const p = x(
|
|
8
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex w-full min-w-0 rounded-md border bg-transparent transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
xs: "text-label-sm h-7 px-2 py-1",
|
|
13
|
+
sm: "text-label-md h-8 px-2 py-1",
|
|
14
|
+
md: "text-label-lg h-12 px-3 py-1",
|
|
15
|
+
lg: "text-label-xl h-16 px-4 py-2"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: "md"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
function k({
|
|
24
|
+
className: n,
|
|
25
|
+
type: s,
|
|
26
|
+
size: t,
|
|
27
|
+
iconName: l,
|
|
28
|
+
iconPosition: a = "left",
|
|
29
|
+
...d
|
|
30
|
+
}) {
|
|
31
|
+
const [i, c] = b.useState(!1), e = l ? ((o) => typeof o == "string" ? { name: o } : o)(l) : void 0, f = () => {
|
|
32
|
+
c(!i);
|
|
33
|
+
};
|
|
34
|
+
return !e && s !== "password" ? /* @__PURE__ */ r.jsx(
|
|
35
|
+
"input",
|
|
36
|
+
{
|
|
37
|
+
type: s,
|
|
38
|
+
"data-slot": "input",
|
|
39
|
+
className: u(
|
|
40
|
+
p({ size: t }),
|
|
41
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
42
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
43
|
+
n
|
|
44
|
+
),
|
|
45
|
+
...d
|
|
46
|
+
}
|
|
47
|
+
) : /* @__PURE__ */ r.jsxs("div", { className: "relative w-full", children: [
|
|
48
|
+
e && a === "left" && /* @__PURE__ */ r.jsx("span", { className: "text-muted-foreground absolute top-1/2 left-3 -translate-y-1/2", children: /* @__PURE__ */ r.jsx(
|
|
49
|
+
m,
|
|
50
|
+
{
|
|
51
|
+
iconName: e.name,
|
|
52
|
+
stroke: e.stroke,
|
|
53
|
+
size: 20
|
|
54
|
+
}
|
|
55
|
+
) }),
|
|
56
|
+
/* @__PURE__ */ r.jsx(
|
|
57
|
+
"input",
|
|
58
|
+
{
|
|
59
|
+
type: s === "password" ? i ? "text" : "password" : s,
|
|
60
|
+
"data-slot": "input",
|
|
61
|
+
className: u(
|
|
62
|
+
p({ size: t }),
|
|
63
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
64
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
65
|
+
e && a === "left" ? "pl-10" : "",
|
|
66
|
+
e && a === "right" || s === "password" ? "pr-10" : "",
|
|
67
|
+
n
|
|
68
|
+
),
|
|
69
|
+
...d
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
s === "password" && /* @__PURE__ */ r.jsx(
|
|
73
|
+
g,
|
|
74
|
+
{
|
|
75
|
+
variant: "inverse",
|
|
76
|
+
type: "button",
|
|
77
|
+
size: t === "xs" || t === "sm" ? "xs" : "md",
|
|
78
|
+
tabIndex: -1,
|
|
79
|
+
"aria-label": i ? "Hide password" : "Show password",
|
|
80
|
+
className: "absolute top-1/2 right-3 -translate-y-1/2",
|
|
81
|
+
onClick: f,
|
|
82
|
+
iconName: i ? "IconEyeOff" : "IconEye"
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
e && a === "right" && s !== "password" && /* @__PURE__ */ r.jsx("span", { className: "text-muted-foreground absolute top-1/2 right-3 -translate-y-1/2", children: /* @__PURE__ */ r.jsx(
|
|
86
|
+
m,
|
|
87
|
+
{
|
|
88
|
+
iconName: e.name,
|
|
89
|
+
stroke: e.stroke,
|
|
90
|
+
size: 20
|
|
91
|
+
}
|
|
92
|
+
) })
|
|
93
|
+
] });
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
k as I
|
|
97
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-BuHQgaKs.cjs"),u=require("./index-DoxiiusW.cjs"),f=require("./index-C8P6Mn4U.cjs"),b=require("react"),g=require("./button-BnSM-lrr.cjs"),c=require("./icon-component-D5YssRbR.cjs");function v(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const j=v(b),p=f.cva("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex w-full min-w-0 rounded-md border bg-transparent transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{xs:"text-label-sm h-7 px-2 py-1",sm:"text-label-md h-8 px-2 py-1",md:"text-label-lg h-12 px-3 py-1",lg:"text-label-xl h-16 px-4 py-2"}},defaultVariants:{size:"md"}});function w({className:s,type:e,size:t,iconName:i,iconPosition:a="left",...d}){const[o,x]=j.useState(!1),r=i?(l=>typeof l=="string"?{name:l}:l)(i):void 0,m=()=>{x(!o)};return!r&&e!=="password"?n.jsxRuntimeExports.jsx("input",{type:e,"data-slot":"input",className:u.cn(p({size:t}),"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",s),...d}):n.jsxRuntimeExports.jsxs("div",{className:"relative w-full",children:[r&&a==="left"&&n.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground absolute top-1/2 left-3 -translate-y-1/2",children:n.jsxRuntimeExports.jsx(c.IconComponent,{iconName:r.name,stroke:r.stroke,size:20})}),n.jsxRuntimeExports.jsx("input",{type:e==="password"?o?"text":"password":e,"data-slot":"input",className:u.cn(p({size:t}),"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",r&&a==="left"?"pl-10":"",r&&a==="right"||e==="password"?"pr-10":"",s),...d}),e==="password"&&n.jsxRuntimeExports.jsx(g.Button,{variant:"inverse",type:"button",size:t==="xs"||t==="sm"?"xs":"md",tabIndex:-1,"aria-label":o?"Hide password":"Show password",className:"absolute top-1/2 right-3 -translate-y-1/2",onClick:m,iconName:o?"IconEyeOff":"IconEye"}),r&&a==="right"&&e!=="password"&&n.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground absolute top-1/2 right-3 -translate-y-1/2",children:n.jsxRuntimeExports.jsx(c.IconComponent,{iconName:r.name,stroke:r.stroke,size:20})})]})}exports.Input=w;
|