@clasing/ui 2.0.1 → 2.0.3
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/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/phone-input.cjs.js +1 -1
- package/dist/components/phone-input.es.js +3 -4
- 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/package.json +357 -367
- 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/style-BNIXVvBA.js +0 -1172
- package/dist/style-CA5976Oh.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../jsx-runtime-BuHQgaKs.cjs"),y=require("react"),m=require("react-day-picker"),p=require("../button-BnSM-lrr.cjs"),g=require("../icon-component-D5YssRbR.cjs"),e=require("../index-DoxiiusW.cjs");function h(r){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(d,n,s.get?s:{enumerable:!0,get:()=>r[n]})}}return d.default=r,Object.freeze(d)}const f=h(y);function _({className:r,classNames:d,showOutsideDays:n=!0,captionLayout:s="label",buttonVariant:l="inverse",formatters:i,components:x,...b}){const t=m.getDefaultClassNames();return o.jsxRuntimeExports.jsx(m.DayPicker,{showOutsideDays:n,className:e.cn("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,r),captionLayout:s,formatters:{formatMonthDropdown:a=>a.toLocaleString("default",{month:"short"}),...i},classNames:{root:e.cn("w-fit",t.root),months:e.cn("flex gap-4 flex-col md:flex-row relative",t.months),month:e.cn("flex flex-col w-full gap-4",t.month),nav:e.cn("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",t.nav),button_previous:e.cn(p.buttonStyles({variant:l}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",t.button_previous),button_next:e.cn(p.buttonStyles({variant:l}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",t.button_next),month_caption:e.cn("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",t.month_caption),dropdowns:e.cn("w-full flex items-center text-paragraph-sm font-medium justify-center h-(--cell-size) gap-1.5",t.dropdowns),dropdown_root:e.cn("relative has-focus:border-ring border border-input has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",t.dropdown_root),dropdown:e.cn("absolute bg-popover inset-0 opacity-0",t.dropdown),caption_label:e.cn("select-none font-medium",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",t.caption_label),table:"w-full border-collapse",weekdays:e.cn("flex",t.weekdays),weekday:e.cn("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",t.weekday),week:e.cn("flex w-full mt-2",t.week),week_number_header:e.cn("select-none w-(--cell-size)",t.week_number_header),week_number:e.cn("text-[0.8rem] select-none text-muted-foreground",t.week_number),day:e.cn("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",t.day),range_start:e.cn("rounded-l-md bg-accent",t.range_start),range_middle:e.cn("rounded-none",t.range_middle),range_end:e.cn("rounded-r-md bg-accent",t.range_end),today:e.cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",t.today),outside:e.cn("text-muted-foreground aria-selected:text-muted-foreground",t.outside),disabled:e.cn("text-muted-foreground opacity-50",t.disabled),hidden:e.cn("invisible",t.hidden),...d},components:{Root:({className:a,rootRef:c,...u})=>o.jsxRuntimeExports.jsx("div",{"data-slot":"calendar",ref:c,className:e.cn(a),...u}),Chevron:({className:a,orientation:c,...u})=>c==="left"?o.jsxRuntimeExports.jsx(g.IconComponent,{iconName:"IconChevronLeft",className:e.cn("size-4",a),...u}):c==="right"?o.jsxRuntimeExports.jsx(g.IconComponent,{iconName:"IconChevronRight",className:e.cn("size-4",a),...u}):o.jsxRuntimeExports.jsx(g.IconComponent,{iconName:"IconChevronDown",className:e.cn("size-4",a),...u}),DayButton:v,WeekNumber:({children:a,...c})=>o.jsxRuntimeExports.jsx("td",{...c,children:o.jsxRuntimeExports.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:a})}),...x},...b})}function v({className:r,day:d,modifiers:n,...s}){const l=m.getDefaultClassNames(),i=f.useRef(null);return f.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),o.jsxRuntimeExports.jsx(p.Button,{ref:i,variant:"inverse",size:"sm","data-day":d.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:e.cn("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",l.day,r),...s})}exports.Calendar=_;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import 'react
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
minDate?: Date;
|
|
10
|
-
maxDate?: Date;
|
|
11
|
-
value?: string;
|
|
12
|
-
onChange?: (value: string | undefined) => void | undefined;
|
|
13
|
-
className?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const Calendar: React.FC<ICalendarProps>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DayButton, DayPicker } from 'react-day-picker';
|
|
3
|
+
import { Button } from '@/components/button';
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
|
|
5
|
+
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -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
|
};
|
|
@@ -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-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
|
|
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 E(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=E(w),C=E(P),v=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(C.default,{ref:b,className:c.cn("flex",t),flagComponent:R,countrySelectComponent:A,inputComponent:N,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]}));v.displayName="PhoneInput";const N=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,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})});N.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:`+${C.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=v;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-DywqP_6a.js";
|
|
2
|
-
import { C as N, d as v, f as I, b as
|
|
2
|
+
import { C as N, d as v, f as I, b as S, c as w, e as P } from "../command-pED95x7-.js";
|
|
3
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";
|
|
@@ -93,7 +93,6 @@ const y = f.forwardRef(({ className: t, rounded: n = "default", error: l, touche
|
|
|
93
93
|
R,
|
|
94
94
|
{
|
|
95
95
|
size: o,
|
|
96
|
-
containerClassName: "w-full",
|
|
97
96
|
className: m(
|
|
98
97
|
"w-full",
|
|
99
98
|
{
|
|
@@ -190,8 +189,8 @@ const q = ({
|
|
|
190
189
|
}
|
|
191
190
|
),
|
|
192
191
|
/* @__PURE__ */ e.jsx(I, { children: /* @__PURE__ */ e.jsxs(L, { ref: r, className: "h-72", children: [
|
|
193
|
-
/* @__PURE__ */ e.jsx(
|
|
194
|
-
/* @__PURE__ */ e.jsx(
|
|
192
|
+
/* @__PURE__ */ e.jsx(S, { children: "No country found." }),
|
|
193
|
+
/* @__PURE__ */ e.jsx(w, { children: l.map(
|
|
195
194
|
({ value: i, label: g }) => i ? /* @__PURE__ */ e.jsx(
|
|
196
195
|
D,
|
|
197
196
|
{
|
|
@@ -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 };
|
|
@@ -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
|
};
|