@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,4 +1,190 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as n } from "../jsx-runtime-DywqP_6a.js";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { getDefaultClassNames as p, DayPicker as y } from "react-day-picker";
|
|
4
|
+
import { c as f, B as h } from "../button-C5IBh3Tr.js";
|
|
5
|
+
import { I as g } from "../icon-component-CxQsODCa.js";
|
|
6
|
+
import { c as e } from "../index-CRiPKpXj.js";
|
|
7
|
+
function k({
|
|
8
|
+
className: c,
|
|
9
|
+
classNames: i,
|
|
10
|
+
showOutsideDays: a = !0,
|
|
11
|
+
captionLayout: s = "label",
|
|
12
|
+
buttonVariant: l = "inverse",
|
|
13
|
+
formatters: u,
|
|
14
|
+
components: x,
|
|
15
|
+
...b
|
|
16
|
+
}) {
|
|
17
|
+
const t = p();
|
|
18
|
+
return /* @__PURE__ */ n.jsx(
|
|
19
|
+
y,
|
|
20
|
+
{
|
|
21
|
+
showOutsideDays: a,
|
|
22
|
+
className: e(
|
|
23
|
+
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
24
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
25
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
26
|
+
c
|
|
27
|
+
),
|
|
28
|
+
captionLayout: s,
|
|
29
|
+
formatters: {
|
|
30
|
+
formatMonthDropdown: (r) => r.toLocaleString("default", { month: "short" }),
|
|
31
|
+
...u
|
|
32
|
+
},
|
|
33
|
+
classNames: {
|
|
34
|
+
root: e("w-fit", t.root),
|
|
35
|
+
months: e(
|
|
36
|
+
"flex gap-4 flex-col md:flex-row relative",
|
|
37
|
+
t.months
|
|
38
|
+
),
|
|
39
|
+
month: e("flex flex-col w-full gap-4", t.month),
|
|
40
|
+
nav: e(
|
|
41
|
+
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
42
|
+
t.nav
|
|
43
|
+
),
|
|
44
|
+
button_previous: e(
|
|
45
|
+
f({ variant: l }),
|
|
46
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
47
|
+
t.button_previous
|
|
48
|
+
),
|
|
49
|
+
button_next: e(
|
|
50
|
+
f({ variant: l }),
|
|
51
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
52
|
+
t.button_next
|
|
53
|
+
),
|
|
54
|
+
month_caption: e(
|
|
55
|
+
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
56
|
+
t.month_caption
|
|
57
|
+
),
|
|
58
|
+
dropdowns: e(
|
|
59
|
+
"w-full flex items-center text-paragraph-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
60
|
+
t.dropdowns
|
|
61
|
+
),
|
|
62
|
+
dropdown_root: e(
|
|
63
|
+
"relative has-focus:border-ring border border-input has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
64
|
+
t.dropdown_root
|
|
65
|
+
),
|
|
66
|
+
dropdown: e(
|
|
67
|
+
"absolute bg-popover inset-0 opacity-0",
|
|
68
|
+
t.dropdown
|
|
69
|
+
),
|
|
70
|
+
caption_label: e(
|
|
71
|
+
"select-none font-medium",
|
|
72
|
+
s === "label" ? "text-paragraph-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-paragraph-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
73
|
+
t.caption_label
|
|
74
|
+
),
|
|
75
|
+
table: "w-full border-collapse",
|
|
76
|
+
weekdays: e("flex", t.weekdays),
|
|
77
|
+
weekday: e(
|
|
78
|
+
"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
|
|
79
|
+
t.weekday
|
|
80
|
+
),
|
|
81
|
+
week: e("flex w-full mt-2", t.week),
|
|
82
|
+
week_number_header: e(
|
|
83
|
+
"select-none w-(--cell-size)",
|
|
84
|
+
t.week_number_header
|
|
85
|
+
),
|
|
86
|
+
week_number: e(
|
|
87
|
+
"text-[0.8rem] select-none text-muted-foreground",
|
|
88
|
+
t.week_number
|
|
89
|
+
),
|
|
90
|
+
day: e(
|
|
91
|
+
"relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
92
|
+
t.day
|
|
93
|
+
),
|
|
94
|
+
range_start: e(
|
|
95
|
+
"rounded-l-md bg-accent",
|
|
96
|
+
t.range_start
|
|
97
|
+
),
|
|
98
|
+
range_middle: e("rounded-none", t.range_middle),
|
|
99
|
+
range_end: e("rounded-r-md bg-accent", t.range_end),
|
|
100
|
+
today: e(
|
|
101
|
+
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
102
|
+
t.today
|
|
103
|
+
),
|
|
104
|
+
outside: e(
|
|
105
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
106
|
+
t.outside
|
|
107
|
+
),
|
|
108
|
+
disabled: e(
|
|
109
|
+
"text-muted-foreground opacity-50",
|
|
110
|
+
t.disabled
|
|
111
|
+
),
|
|
112
|
+
hidden: e("invisible", t.hidden),
|
|
113
|
+
...i
|
|
114
|
+
},
|
|
115
|
+
components: {
|
|
116
|
+
Root: ({
|
|
117
|
+
className: r,
|
|
118
|
+
rootRef: d,
|
|
119
|
+
...o
|
|
120
|
+
}) => /* @__PURE__ */ n.jsx(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
"data-slot": "calendar",
|
|
124
|
+
ref: d,
|
|
125
|
+
className: e(r),
|
|
126
|
+
...o
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
Chevron: ({ className: r, orientation: d, ...o }) => d === "left" ? /* @__PURE__ */ n.jsx(
|
|
130
|
+
g,
|
|
131
|
+
{
|
|
132
|
+
iconName: "IconChevronLeft",
|
|
133
|
+
className: e("size-4", r),
|
|
134
|
+
...o
|
|
135
|
+
}
|
|
136
|
+
) : d === "right" ? /* @__PURE__ */ n.jsx(
|
|
137
|
+
g,
|
|
138
|
+
{
|
|
139
|
+
iconName: "IconChevronRight",
|
|
140
|
+
className: e("size-4", r),
|
|
141
|
+
...o
|
|
142
|
+
}
|
|
143
|
+
) : /* @__PURE__ */ n.jsx(
|
|
144
|
+
g,
|
|
145
|
+
{
|
|
146
|
+
iconName: "IconChevronDown",
|
|
147
|
+
className: e("size-4", r),
|
|
148
|
+
...o
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
DayButton: _,
|
|
152
|
+
WeekNumber: ({ children: r, ...d }) => /* @__PURE__ */ n.jsx("td", { ...d, children: /* @__PURE__ */ n.jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: r }) }),
|
|
153
|
+
...x
|
|
154
|
+
},
|
|
155
|
+
...b
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
function _({
|
|
160
|
+
className: c,
|
|
161
|
+
day: i,
|
|
162
|
+
modifiers: a,
|
|
163
|
+
...s
|
|
164
|
+
}) {
|
|
165
|
+
const l = p(), u = m.useRef(null);
|
|
166
|
+
return m.useEffect(() => {
|
|
167
|
+
a.focused && u.current?.focus();
|
|
168
|
+
}, [a.focused]), /* @__PURE__ */ n.jsx(
|
|
169
|
+
h,
|
|
170
|
+
{
|
|
171
|
+
ref: u,
|
|
172
|
+
variant: "inverse",
|
|
173
|
+
size: "sm",
|
|
174
|
+
"data-day": i.date.toLocaleDateString(),
|
|
175
|
+
"data-selected-single": a.selected && !a.range_start && !a.range_end && !a.range_middle,
|
|
176
|
+
"data-range-start": a.range_start,
|
|
177
|
+
"data-range-end": a.range_end,
|
|
178
|
+
"data-range-middle": a.range_middle,
|
|
179
|
+
className: e(
|
|
180
|
+
"data-[selected-single=true]:bg-secondary data-[selected-single=true]:text-secondary-foreground data-[range-middle=true]:bg-blue-050 data-[range-start=true]:bg-secondary data-[range-start=true]:text-secondary-foreground data-[range-end=true]:bg-secondary data-[range-end=true]:text-secondary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground data-[selected-single=true]:hover:bg-secondary/80 data-[selected-single=true]:hover:text-secondary-foreground data-[range-start=true]:hover:bg-secondary/80 data-[range-end=true]:hover:bg-secondary/80 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 rounded-md p-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-middle=true]:text-blue-800 data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
181
|
+
l.day,
|
|
182
|
+
c
|
|
183
|
+
),
|
|
184
|
+
...s
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
2
188
|
export {
|
|
3
|
-
|
|
189
|
+
k as Calendar
|
|
4
190
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../jsx-runtime-BuHQgaKs.cjs"),x=require("@radix-ui/react-slot"),f=require("react"),c=require("react-hook-form"),F=require("../label-U5GnYvFO.cjs"),d=require("../index-DoxiiusW.cjs");function j(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const i=j(f),p=c.FormProvider,l=i.createContext({}),g=({...e})=>n.jsxRuntimeExports.jsx(l.Provider,{value:{name:e.name},children:n.jsxRuntimeExports.jsx(c.Controller,{...e})}),m=()=>{const e=i.useContext(l),t=i.useContext(u),{getFieldState:r}=c.useFormContext(),o=c.useFormState({name:e.name}),s=r(e.name,o);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...s}},u=i.createContext({});function b({className:e,...t}){const r=i.useId();return n.jsxRuntimeExports.jsx(u.Provider,{value:{id:r},children:n.jsxRuntimeExports.jsx("div",{"data-slot":"form-item",className:d.cn("grid gap-2",e),...t})})}function I({className:e,...t}){const{error:r,formItemId:o}=m();return n.jsxRuntimeExports.jsx(F.Label,{"data-slot":"form-label","data-error":!!r,className:d.cn("data-[error=true]:text-destructive",e),htmlFor:o,...t})}function C({...e}){const{error:t,formItemId:r,formDescriptionId:o,formMessageId:s}=m();return n.jsxRuntimeExports.jsx(x.Slot,{"data-slot":"form-control",id:r,"aria-describedby":t?`${o} ${s}`:`${o}`,"aria-invalid":!!t,...e})}function v({className:e,...t}){const{formDescriptionId:r}=m();return n.jsxRuntimeExports.jsx("p",{"data-slot":"form-description",id:r,className:d.cn("text-muted-foreground! text-label-md",e),...t})}function R({className:e,...t}){const{error:r,formMessageId:o}=m(),s=r?String(r?.message??""):t.children;return s?n.jsxRuntimeExports.jsx("p",{"data-slot":"form-message",id:o,className:d.cn("text-destructive! text-label-md",e),...t,children:s}):null}exports.Form=p;exports.FormControl=C;exports.FormDescription=v;exports.FormField=g;exports.FormItem=b;exports.FormLabel=I;exports.FormMessage=R;exports.useFormField=m;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { type ControllerProps, type FieldPath, type FieldValues } from 'react-hook-form';
|
|
5
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
6
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const useFormField: () => {
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
isDirty: boolean;
|
|
10
|
+
isTouched: boolean;
|
|
11
|
+
isValidating: boolean;
|
|
12
|
+
error?: import("react-hook-form").FieldError;
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
formItemId: string;
|
|
16
|
+
formDescriptionId: string;
|
|
17
|
+
formMessageId: string;
|
|
18
|
+
};
|
|
19
|
+
declare function FormItem({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function FormDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function FormMessage({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField, };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { j as m } from "../jsx-runtime-DywqP_6a.js";
|
|
2
|
+
import { Slot as f } from "@radix-ui/react-slot";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { FormProvider as u, Controller as x, useFormContext as F, useFormState as I } from "react-hook-form";
|
|
5
|
+
import { L as p } from "../label-_kG7WBoJ.js";
|
|
6
|
+
import { c as a } from "../index-CRiPKpXj.js";
|
|
7
|
+
const h = u, c = n.createContext(
|
|
8
|
+
{}
|
|
9
|
+
), S = ({
|
|
10
|
+
...e
|
|
11
|
+
}) => /* @__PURE__ */ m.jsx(c.Provider, { value: { name: e.name }, children: /* @__PURE__ */ m.jsx(x, { ...e }) }), d = () => {
|
|
12
|
+
const e = n.useContext(c), t = n.useContext(l), { getFieldState: r } = F(), o = I({ name: e.name }), s = r(e.name, o);
|
|
13
|
+
if (!e)
|
|
14
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
15
|
+
const { id: i } = t;
|
|
16
|
+
return {
|
|
17
|
+
id: i,
|
|
18
|
+
name: e.name,
|
|
19
|
+
formItemId: `${i}-form-item`,
|
|
20
|
+
formDescriptionId: `${i}-form-item-description`,
|
|
21
|
+
formMessageId: `${i}-form-item-message`,
|
|
22
|
+
...s
|
|
23
|
+
};
|
|
24
|
+
}, l = n.createContext(
|
|
25
|
+
{}
|
|
26
|
+
);
|
|
27
|
+
function $({ className: e, ...t }) {
|
|
28
|
+
const r = n.useId();
|
|
29
|
+
return /* @__PURE__ */ m.jsx(l.Provider, { value: { id: r }, children: /* @__PURE__ */ m.jsx(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
"data-slot": "form-item",
|
|
33
|
+
className: a("grid gap-2", e),
|
|
34
|
+
...t
|
|
35
|
+
}
|
|
36
|
+
) });
|
|
37
|
+
}
|
|
38
|
+
function D({
|
|
39
|
+
className: e,
|
|
40
|
+
...t
|
|
41
|
+
}) {
|
|
42
|
+
const { error: r, formItemId: o } = d();
|
|
43
|
+
return /* @__PURE__ */ m.jsx(
|
|
44
|
+
p,
|
|
45
|
+
{
|
|
46
|
+
"data-slot": "form-label",
|
|
47
|
+
"data-error": !!r,
|
|
48
|
+
className: a("data-[error=true]:text-destructive", e),
|
|
49
|
+
htmlFor: o,
|
|
50
|
+
...t
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function M({ ...e }) {
|
|
55
|
+
const { error: t, formItemId: r, formDescriptionId: o, formMessageId: s } = d();
|
|
56
|
+
return /* @__PURE__ */ m.jsx(
|
|
57
|
+
f,
|
|
58
|
+
{
|
|
59
|
+
"data-slot": "form-control",
|
|
60
|
+
id: r,
|
|
61
|
+
"aria-describedby": t ? `${o} ${s}` : `${o}`,
|
|
62
|
+
"aria-invalid": !!t,
|
|
63
|
+
...e
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
function N({ className: e, ...t }) {
|
|
68
|
+
const { formDescriptionId: r } = d();
|
|
69
|
+
return /* @__PURE__ */ m.jsx(
|
|
70
|
+
"p",
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "form-description",
|
|
73
|
+
id: r,
|
|
74
|
+
className: a("text-muted-foreground! text-label-md", e),
|
|
75
|
+
...t
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function w({ className: e, ...t }) {
|
|
80
|
+
const { error: r, formMessageId: o } = d(), s = r ? String(r?.message ?? "") : t.children;
|
|
81
|
+
return s ? /* @__PURE__ */ m.jsx(
|
|
82
|
+
"p",
|
|
83
|
+
{
|
|
84
|
+
"data-slot": "form-message",
|
|
85
|
+
id: o,
|
|
86
|
+
className: a("text-destructive! text-label-md", e),
|
|
87
|
+
...t,
|
|
88
|
+
children: s
|
|
89
|
+
}
|
|
90
|
+
) : null;
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
h as Form,
|
|
94
|
+
M as FormControl,
|
|
95
|
+
N as FormDescription,
|
|
96
|
+
S as FormField,
|
|
97
|
+
$ as FormItem,
|
|
98
|
+
D as FormLabel,
|
|
99
|
+
w as FormMessage,
|
|
100
|
+
d as useFormField
|
|
101
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../input-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../input-wSGCWBH-.cjs");exports.Input=t.Input;
|
|
@@ -2,19 +2,9 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { TablerIconName } from './icon-component';
|
|
4
4
|
declare const inputStyles: (props?: ({
|
|
5
|
-
size?: "lg" | "md" | "sm" | null | undefined;
|
|
6
|
-
rounded?: "default" | "full" | null | undefined;
|
|
7
|
-
state?: "default" | "error" | "success" | null | undefined;
|
|
5
|
+
size?: "lg" | "md" | "sm" | "xs" | null | undefined;
|
|
8
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
7
|
export interface InputProps extends VariantProps<typeof inputStyles> {
|
|
10
|
-
/** Label text shown above the input */
|
|
11
|
-
label?: string;
|
|
12
|
-
/** Helper text shown below the input */
|
|
13
|
-
helperText?: string;
|
|
14
|
-
/** Error message shown below the input */
|
|
15
|
-
error?: string;
|
|
16
|
-
/** Whether the input has been touched/blurred */
|
|
17
|
-
touched?: boolean;
|
|
18
8
|
/** Icon to display in the input */
|
|
19
9
|
iconName?: TablerIconName | {
|
|
20
10
|
name: TablerIconName;
|
|
@@ -22,8 +12,6 @@ export interface InputProps extends VariantProps<typeof inputStyles> {
|
|
|
22
12
|
};
|
|
23
13
|
/** Position of the icon (left or right) */
|
|
24
14
|
iconPosition?: 'left' | 'right';
|
|
25
|
-
/** Container className for the entire input component including label and helper text */
|
|
26
|
-
containerClassName?: string;
|
|
27
15
|
}
|
|
28
|
-
declare function Input({ className,
|
|
29
|
-
export { Input
|
|
16
|
+
declare function Input({ className, type, size, iconName, iconPosition, ...props }: Omit<React.ComponentProps<'input'>, 'size'> & InputProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export { Input };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jsx-runtime-BuHQgaKs.cjs"),p=require("../command-C4Y6Ixrp.cjs"),S=require("../input-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jsx-runtime-BuHQgaKs.cjs"),p=require("../command-C4Y6Ixrp.cjs"),S=require("../input-wSGCWBH-.cjs"),I=require("../label-U5GnYvFO.cjs"),h=require("../popover-4V87msIT.cjs"),q=require("../scroll-area-hg-bGoRe.cjs"),c=require("../index-DoxiiusW.cjs"),w=require("react"),P=require("react-phone-number-input"),O=require("react-phone-number-input/flags"),_=require("react-phone-number-input/locale/en"),T=require("react-phone-number-input/locale/es"),k=require("react-phone-number-input/locale/fr"),y=require("../icon-component-D5YssRbR.cjs");function C(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(n,s,o.get?o:{enumerable:!0,get:()=>t[s]})}}return n.default=t,Object.freeze(n)}const f=C(w),E=C(P),N=f.forwardRef(({className:t,onChange:n,value:s,size:o="md",rounded:r="default",label:u,helperText:d,locale:x="en",error:l,touched:m,containerClassName:j,...i},b)=>e.jsxRuntimeExports.jsxs("div",{className:c.cn("flex flex-col gap-2",j),children:[u&&e.jsxRuntimeExports.jsx(I.Label,{htmlFor:i.id,className:c.cn("mb-1",{"opacity-50":i.disabled}),children:u}),e.jsxRuntimeExports.jsx(E.default,{ref:b,className:c.cn("flex",t),flagComponent:R,countrySelectComponent:A,inputComponent:v,smartCaret:!1,labels:x==="es"?T:x==="fr"?k:_,value:s||void 0,onChange:a=>n?.(a||""),countrySelectProps:{size:o,rounded:r,error:l,touched:m},numberInputProps:{size:o,rounded:r,error:l,touched:m},...i}),l&&m?e.jsxRuntimeExports.jsx("span",{id:i.id&&`${i.id}-error-text`,"aria-invalid":!0,className:"text-destructive text-label-md -mt-1",children:l}):d?e.jsxRuntimeExports.jsx("span",{id:i.id&&`${i.id}-helper-text`,className:c.cn("text-label-md -mt-1",{"text-muted-foreground":!l&&!m,"text-destructive":l&&m,"text-muted-foreground opacity-50":i.disabled}),children:d}):null]}));N.displayName="PhoneInput";const v=f.forwardRef(({className:t,rounded:n="default",error:s,touched:o,size:r,...u},d)=>{const{"data-country":x,...l}=u;return e.jsxRuntimeExports.jsx(S.Input,{size:r,containerClassName:"w-full",className:c.cn("w-full",{"border-destructive":s&&o,"border-blue-800":o&&!s,"rounded-s-none rounded-e-lg":n!=="full","rounded-s-none rounded-e-full":n==="full","rounded-e-sm":r==="sm","rounded-e-md":r==="md","rounded-e-lg":r==="lg"},t),...l,ref:d})});v.displayName="InputComponent";const A=({disabled:t,value:n,options:s,onChange:o,size:r="md",rounded:u="default",error:d,touched:x})=>{const l=f.useRef(null),[m,j]=f.useState(""),[i,b]=f.useState(!1);return e.jsxRuntimeExports.jsxs(h.Popover,{open:i,modal:!0,onOpenChange:a=>{b(a),a&&j("")},children:[e.jsxRuntimeExports.jsx(h.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:c.cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 flex w-fit min-w-0 items-center justify-center border border-r-0 bg-transparent text-base transition-[color,box-shadow] outline-none file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-semibold focus-visible:z-1 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",u==="default"?"rounded-e-none":"rounded-s-full rounded-e-none",{"outline-destructive":d&&x,"outline-blue-800":x&&!d,"text-label-md h-8 rounded-s-sm px-2 py-1":r==="sm","text-label-lg h-12 rounded-s-md px-3 py-1":r==="md","text-label-xl h-16 rounded-s-lg px-4 py-2":r==="lg"}),disabled:t,children:[e.jsxRuntimeExports.jsx(R,{country:n,countryName:n,disabled:t}),e.jsxRuntimeExports.jsx(y.IconComponent,{iconName:"IconChevronDown",className:c.cn("-mr-2 size-4 opacity-50",t?"hidden":"opacity-100")})]})}),e.jsxRuntimeExports.jsx(h.PopoverContent,{className:"w-[300px] p-0",children:e.jsxRuntimeExports.jsxs(p.Command,{children:[e.jsxRuntimeExports.jsx(p.CommandInput,{value:m,onValueChange:a=>{j(a),setTimeout(()=>{if(l.current){const g=l.current.querySelector("[data-radix-scroll-area-viewport]");g&&(g.scrollTop=0)}},0)},placeholder:"Search country..."}),e.jsxRuntimeExports.jsx(p.CommandList,{children:e.jsxRuntimeExports.jsxs(q.ScrollArea,{ref:l,className:"h-72",children:[e.jsxRuntimeExports.jsx(p.CommandEmpty,{children:"No country found."}),e.jsxRuntimeExports.jsx(p.CommandGroup,{children:s.map(({value:a,label:g})=>a?e.jsxRuntimeExports.jsx(D,{country:a,countryName:g,selectedCountry:n,onChange:o,onSelectComplete:()=>b(!1)},a):null)})]})})]})})]})},D=({country:t,countryName:n,selectedCountry:s,onChange:o,onSelectComplete:r})=>{const u=()=>{o(t),r()};return e.jsxRuntimeExports.jsxs(p.CommandItem,{className:"gap-2",onSelect:u,children:[e.jsxRuntimeExports.jsx(R,{country:t,countryName:n}),e.jsxRuntimeExports.jsx("span",{className:"flex-1 text-sm",children:n}),e.jsxRuntimeExports.jsx("span",{className:"text-foreground/50 text-sm",children:`+${E.getCountryCallingCode(t)}`}),e.jsxRuntimeExports.jsx(y.IconComponent,{iconName:"IconCheck",className:`ml-auto size-4 ${t===s?"opacity-100":"opacity-0"}`})]})},R=({country:t,countryName:n,disabled:s})=>{const o=O[t];return e.jsxRuntimeExports.jsx("span",{className:c.cn("bg-foreground/20 flex h-4 w-6 overflow-hidden rounded-[4px] [&_svg:not([class*='size-'])]:size-full",{"opacity-50":s}),children:o&&e.jsxRuntimeExports.jsx(o,{title:n})})};exports.PhoneInput=N;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-DywqP_6a.js";
|
|
2
2
|
import { C as N, d as v, f as I, b as w, c as S, e as P } from "../command-pED95x7-.js";
|
|
3
|
-
import { I as R } from "../input-
|
|
3
|
+
import { I as R } from "../input-Bs18T-Y3.js";
|
|
4
4
|
import { L as O } from "../label-_kG7WBoJ.js";
|
|
5
5
|
import { P as $, c as E, b as F } from "../popover-CHAUhJda.js";
|
|
6
6
|
import { S as L } from "../scroll-area-DwBiu3Jn.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jsx-runtime-BuHQgaKs.cjs"),a=require("../index-DoxiiusW.cjs"),v=require("../index-C8P6Mn4U.cjs"),p=require("../icon-component-D5YssRbR.cjs"),x=v.cva("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",{variants:{size:{xs:"text-label-sm min-h-16 px-2 py-1",sm:"text-label-md min-h-20 px-2 py-1",md:"text-label-lg min-h-24 px-3 py-2",lg:"text-label-xl min-h-32 px-4 py-3"},resize:{none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"}},defaultVariants:{size:"md",resize:"vertical"}});function b({className:o,size:l,resize:d,iconName:u,maxLength:t,showCharacterCount:m=!1,...i}){const r=u?(n=>typeof n=="string"?{name:n}:n)(u):void 0,s=i.value?String(i.value).length:0,c=m||t;return!r&&!c?e.jsxRuntimeExports.jsx("textarea",{"data-slot":"textarea",maxLength:t,className:a.cn(x({size:l,resize:d}),"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",o),...i}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative w-full",children:[e.jsxRuntimeExports.jsx("textarea",{"data-slot":"textarea",maxLength:t,className:a.cn(x({size:l,resize:d}),"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?"pr-10":"",o),...i}),r&&e.jsxRuntimeExports.jsx("span",{className:"absolute top-3 right-3 text-muted-foreground",children:e.jsxRuntimeExports.jsx(p.IconComponent,{iconName:r.name,stroke:r.stroke,size:20})})]}),c&&e.jsxRuntimeExports.jsx("div",{className:"flex justify-end",children:e.jsxRuntimeExports.jsx("span",{className:a.cn("text-xs text-muted-foreground",{"text-destructive":t&&s>t}),children:t?`${s}/${t}`:s})})]})}exports.Textarea=b;
|
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
import { type VariantProps } from 'class-variance-authority';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { TablerIconName } from './icon-component';
|
|
4
4
|
declare const textareaStyles: (props?: ({
|
|
5
|
-
size?: "lg" | "md" | "sm" | null | undefined;
|
|
6
|
-
rounded?: "default" | "full" | null | undefined;
|
|
7
|
-
state?: "default" | "error" | "success" | null | undefined;
|
|
5
|
+
size?: "lg" | "md" | "sm" | "xs" | null | undefined;
|
|
8
6
|
resize?: "none" | "horizontal" | "vertical" | "both" | null | undefined;
|
|
9
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
8
|
export interface TextareaProps extends VariantProps<typeof textareaStyles> {
|
|
11
|
-
/** Label text shown above the textarea */
|
|
12
|
-
label?: string;
|
|
13
|
-
/** Helper text shown below the textarea */
|
|
14
|
-
helperText?: string;
|
|
15
|
-
/** Error message shown below the textarea */
|
|
16
|
-
error?: string;
|
|
17
|
-
/** Whether the textarea has been touched/blurred */
|
|
18
|
-
touched?: boolean;
|
|
19
9
|
/** Icon to display in the top-right corner of the textarea */
|
|
20
10
|
iconName?: TablerIconName | {
|
|
21
11
|
name: TablerIconName;
|
|
22
12
|
stroke?: string;
|
|
23
13
|
};
|
|
24
|
-
/** Container className for the entire textarea component including label and helper text */
|
|
25
|
-
containerClassName?: string;
|
|
26
14
|
/** Maximum number of characters allowed */
|
|
27
15
|
maxLength?: number;
|
|
28
16
|
/** Show character count */
|
|
29
17
|
showCharacterCount?: boolean;
|
|
30
18
|
}
|
|
31
|
-
declare function Textarea({ className,
|
|
32
|
-
export { Textarea
|
|
19
|
+
declare function Textarea({ className, size, resize, iconName, maxLength, showCharacterCount, ...props }: Omit<React.ComponentProps<'textarea'>, 'size'> & TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export { Textarea };
|