@customafk/lunas-ui 0.0.2 → 0.0.3-b
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/Atoms/AspectRatio/index.js +2 -0
- package/dist/Atoms/Avatar/index.js +3 -3
- package/dist/Atoms/Badge/index.js +2 -0
- package/dist/Atoms/Breadcrumb/index.js +7 -23
- package/dist/Atoms/Button/index.d.ts +2 -2
- package/dist/Atoms/Button/index.js +2 -0
- package/dist/Atoms/Card/index.js +2 -0
- package/dist/Atoms/Checkbox/index.d.ts +6 -0
- package/dist/Atoms/Checkbox/index.js +276 -0
- package/dist/Atoms/Command/index.d.ts +7 -7
- package/dist/Atoms/Command/index.js +39 -50
- package/dist/Atoms/Dialog/index.js +16 -31
- package/dist/Atoms/DropdownMenu/index.js +2 -0
- package/dist/Atoms/Form/index.js +32 -21
- package/dist/Atoms/Input/index.d.ts +5 -1
- package/dist/Atoms/Input/index.js +45 -543
- package/dist/Atoms/Label/index.js +2 -0
- package/dist/Atoms/MenuItem/index.d.ts +14 -0
- package/dist/Atoms/MenuItem/index.js +287 -0
- package/dist/Atoms/Money/index.js +2 -0
- package/dist/Atoms/Navbar/index.js +2 -0
- package/dist/Atoms/NavigationMenu/index.js +2 -0
- package/dist/Atoms/NumberInput/index.d.ts +7 -0
- package/dist/Atoms/NumberInput/index.js +321 -0
- package/dist/Atoms/Popover/index.d.ts +8 -0
- package/dist/Atoms/Popover/index.js +286 -0
- package/dist/Atoms/Progress/index.js +2 -0
- package/dist/Atoms/QuantityBtn/index.js +2 -0
- package/dist/Atoms/RadioGroup/index.d.ts +7 -0
- package/dist/Atoms/RadioGroup/index.js +285 -0
- package/dist/Atoms/ScrollBar/index.js +4 -2
- package/dist/Atoms/Select/index.js +2 -0
- package/dist/Atoms/Sheet/index.d.ts +29 -0
- package/dist/Atoms/Sheet/index.js +422 -0
- package/dist/Atoms/Slider/index.d.ts +6 -0
- package/dist/Atoms/Slider/index.js +286 -0
- package/dist/Atoms/SmallQuantityBtn/index.d.ts +9 -0
- package/dist/Atoms/SmallQuantityBtn/index.js +110 -0
- package/dist/Atoms/Switch/index.d.ts +6 -0
- package/dist/Atoms/Switch/index.js +293 -0
- package/dist/Atoms/Tabs/index.d.ts +9 -0
- package/dist/Atoms/Tabs/index.js +304 -0
- package/dist/Atoms/Textarea/index.d.ts +5 -0
- package/dist/Atoms/Textarea/index.js +283 -0
- package/dist/Atoms/Tooltip/index.d.ts +10 -0
- package/dist/Atoms/Tooltip/index.js +289 -0
- package/dist/Atoms/UserAvatar/index.d.ts +2 -2
- package/dist/Atoms/UserAvatar/index.js +24 -28
- package/dist/Atoms/XButton/index.d.ts +10 -0
- package/dist/Atoms/XButton/index.js +309 -0
- package/dist/Authentication/SignIn/index.d.ts +1 -1
- package/dist/Authentication/SignIn/index.js +129 -74
- package/dist/Authentication/SignUp/index.d.ts +5 -5
- package/dist/Authentication/SignUp/index.js +181 -110
- package/dist/Authentication/ThankYou/index.js +13 -4
- package/dist/Ecommerce/Categories/index.d.ts +33 -0
- package/dist/Ecommerce/Categories/index.js +1426 -0
- package/dist/Icons/index.d.ts +5 -3
- package/dist/Icons/index.js +126 -97
- package/dist/Molecules/AuthenForm/index.js +30 -21
- package/dist/Molecules/Search/index.js +46 -57
- package/dist/Molecules/UserDropdown/index.js +42 -33
- package/dist/Organisms/Header/index.d.ts +25 -3
- package/dist/Organisms/Header/index.js +585 -324
- package/dist/hooks/index.d.ts +1 -54
- package/dist/hooks/index.js +3 -127
- package/dist/{types-BgHhiNa-.d.ts → types-BlE003QY.d.ts} +1 -1
- package/package.json +85 -41
|
@@ -1,345 +1,5 @@
|
|
|
1
1
|
// packages/Atoms/Input/index.tsx
|
|
2
|
-
import {
|
|
3
|
-
forwardRef as forwardRef2,
|
|
4
|
-
memo as memo2,
|
|
5
|
-
useCallback,
|
|
6
|
-
useEffect,
|
|
7
|
-
useRef,
|
|
8
|
-
useState
|
|
9
|
-
} from "react";
|
|
10
|
-
|
|
11
|
-
// packages/utils/constants.ts
|
|
12
|
-
var DEFAULT_ICON_SIZE = 24;
|
|
13
|
-
|
|
14
|
-
// packages/Icons/Lucide2XIcon.tsx
|
|
15
|
-
import { jsx } from "react/jsx-runtime";
|
|
16
|
-
var Lucide2XIcon = (props) => {
|
|
17
|
-
const { color, size } = props;
|
|
18
|
-
return /* @__PURE__ */ jsx(
|
|
19
|
-
"svg",
|
|
20
|
-
{
|
|
21
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
-
width: size ?? DEFAULT_ICON_SIZE,
|
|
23
|
-
height: size ?? DEFAULT_ICON_SIZE,
|
|
24
|
-
viewBox: "0 0 16 16",
|
|
25
|
-
fill: "none",
|
|
26
|
-
...props,
|
|
27
|
-
children: /* @__PURE__ */ jsx(
|
|
28
|
-
"path",
|
|
29
|
-
{
|
|
30
|
-
d: "M12 4L4 12M4 4L12 12",
|
|
31
|
-
stroke: color ?? "#434349",
|
|
32
|
-
strokeWidth: "1.5",
|
|
33
|
-
strokeLinecap: "round",
|
|
34
|
-
strokeLinejoin: "round"
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
Lucide2XIcon.displayName = "Lucide2XIcon";
|
|
41
|
-
var Lucide2XIcon_default = Lucide2XIcon;
|
|
42
|
-
|
|
43
|
-
// packages/Layout/Flex/index.tsx
|
|
44
|
-
import { forwardRef, memo, useMemo } from "react";
|
|
45
|
-
|
|
46
|
-
// packages/Layout/Flex/flexVariant.ts
|
|
47
|
-
import { cva } from "class-variance-authority";
|
|
48
|
-
var flexVariants = cva("flex flex-row", {
|
|
49
|
-
variants: {
|
|
50
|
-
wrap: {
|
|
51
|
-
nowrap: "flex-nowrap",
|
|
52
|
-
wrap: "flex-wrap",
|
|
53
|
-
"wrap-reverse": "flex-wrap-reverse"
|
|
54
|
-
},
|
|
55
|
-
justify: {
|
|
56
|
-
start: "justify-start",
|
|
57
|
-
end: "justify-end",
|
|
58
|
-
center: "justify-center",
|
|
59
|
-
between: "justify-between",
|
|
60
|
-
around: "justify-around",
|
|
61
|
-
normal: "justify-normal",
|
|
62
|
-
stretch: "justify-stretch",
|
|
63
|
-
evenly: "justify-evenly"
|
|
64
|
-
},
|
|
65
|
-
align: {
|
|
66
|
-
start: "items-start",
|
|
67
|
-
end: "items-end",
|
|
68
|
-
center: "items-center",
|
|
69
|
-
stretch: "items-stretch",
|
|
70
|
-
baseline: "items-baseline"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
defaultVariants: {
|
|
74
|
-
wrap: "nowrap",
|
|
75
|
-
justify: "start",
|
|
76
|
-
align: "stretch"
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
var flexVariant_default = flexVariants;
|
|
80
|
-
|
|
81
|
-
// packages/Layout/commons/index.ts
|
|
82
|
-
import { cva as cva2 } from "class-variance-authority";
|
|
83
|
-
var commonLayout = cva2("", {
|
|
84
|
-
variants: {
|
|
85
|
-
p: {
|
|
86
|
-
"0": "p-0",
|
|
87
|
-
"1": "p-1",
|
|
88
|
-
"2": "p-2",
|
|
89
|
-
"3": "p-3",
|
|
90
|
-
"4": "p-4",
|
|
91
|
-
"5": "p-5",
|
|
92
|
-
"6": "p-6",
|
|
93
|
-
"7": "p-7",
|
|
94
|
-
"8": "p-8",
|
|
95
|
-
"9": "p-9",
|
|
96
|
-
"10": "p-10"
|
|
97
|
-
},
|
|
98
|
-
px: {
|
|
99
|
-
"0": "px-0",
|
|
100
|
-
"1": "px-1",
|
|
101
|
-
"2": "px-2",
|
|
102
|
-
"3": "px-3",
|
|
103
|
-
"4": "px-4",
|
|
104
|
-
"5": "px-5",
|
|
105
|
-
"6": "px-6",
|
|
106
|
-
"7": "px-7",
|
|
107
|
-
"8": "px-8",
|
|
108
|
-
"9": "px-9",
|
|
109
|
-
"10": "px-10"
|
|
110
|
-
},
|
|
111
|
-
py: {
|
|
112
|
-
"0": "py-0",
|
|
113
|
-
"1": "py-1",
|
|
114
|
-
"2": "py-2",
|
|
115
|
-
"3": "py-3",
|
|
116
|
-
"4": "py-4",
|
|
117
|
-
"5": "py-5",
|
|
118
|
-
"6": "py-6",
|
|
119
|
-
"7": "py-7",
|
|
120
|
-
"8": "py-8",
|
|
121
|
-
"9": "py-9",
|
|
122
|
-
"10": "py-10"
|
|
123
|
-
},
|
|
124
|
-
pt: {
|
|
125
|
-
"0": "pt-0",
|
|
126
|
-
"1": "pt-1",
|
|
127
|
-
"2": "pt-2",
|
|
128
|
-
"3": "pt-3",
|
|
129
|
-
"4": "pt-4",
|
|
130
|
-
"5": "pt-5",
|
|
131
|
-
"6": "pt-6",
|
|
132
|
-
"7": "pt-7",
|
|
133
|
-
"8": "pt-8",
|
|
134
|
-
"9": "pt-9",
|
|
135
|
-
"10": "pt-10"
|
|
136
|
-
},
|
|
137
|
-
pr: {
|
|
138
|
-
"0": "pr-0",
|
|
139
|
-
"1": "pr-1",
|
|
140
|
-
"2": "pr-2",
|
|
141
|
-
"3": "pr-3",
|
|
142
|
-
"4": "pr-4",
|
|
143
|
-
"5": "pr-5",
|
|
144
|
-
"6": "pr-6",
|
|
145
|
-
"7": "pr-7",
|
|
146
|
-
"8": "pr-8",
|
|
147
|
-
"9": "pr-9",
|
|
148
|
-
"10": "pr-10"
|
|
149
|
-
},
|
|
150
|
-
pb: {
|
|
151
|
-
"0": "pb-0",
|
|
152
|
-
"1": "pb-1",
|
|
153
|
-
"2": "pb-2",
|
|
154
|
-
"3": "pb-3",
|
|
155
|
-
"4": "pb-4",
|
|
156
|
-
"5": "pb-5",
|
|
157
|
-
"6": "pb-6",
|
|
158
|
-
"7": "pb-7",
|
|
159
|
-
"8": "pb-8",
|
|
160
|
-
"9": "pb-9",
|
|
161
|
-
"10": "pb-10"
|
|
162
|
-
},
|
|
163
|
-
pl: {
|
|
164
|
-
"0": "pl-0",
|
|
165
|
-
"1": "pl-1",
|
|
166
|
-
"2": "pl-2",
|
|
167
|
-
"3": "pl-3",
|
|
168
|
-
"4": "pl-4",
|
|
169
|
-
"5": "pl-5",
|
|
170
|
-
"6": "pl-6",
|
|
171
|
-
"7": "pl-7",
|
|
172
|
-
"8": "pl-8",
|
|
173
|
-
"9": "pl-9",
|
|
174
|
-
"10": "pl-10"
|
|
175
|
-
},
|
|
176
|
-
gap: {
|
|
177
|
-
"0": "gap-0",
|
|
178
|
-
"1": "gap-1",
|
|
179
|
-
"2": "gap-2",
|
|
180
|
-
"3": "gap-3",
|
|
181
|
-
"4": "gap-4",
|
|
182
|
-
"5": "gap-5",
|
|
183
|
-
"6": "gap-6",
|
|
184
|
-
"7": "gap-7",
|
|
185
|
-
"8": "gap-8",
|
|
186
|
-
"9": "gap-9",
|
|
187
|
-
"10": "gap-10"
|
|
188
|
-
},
|
|
189
|
-
gapX: {
|
|
190
|
-
"0": "gap-x-0",
|
|
191
|
-
"1": "gap-x-1",
|
|
192
|
-
"2": "gap-x-2",
|
|
193
|
-
"3": "gap-x-3",
|
|
194
|
-
"4": "gap-x-4",
|
|
195
|
-
"5": "gap-x-5",
|
|
196
|
-
"6": "gap-x-6",
|
|
197
|
-
"7": "gap-x-7",
|
|
198
|
-
"8": "gap-x-8",
|
|
199
|
-
"9": "gap-x-9",
|
|
200
|
-
"10": "gap-x-10"
|
|
201
|
-
},
|
|
202
|
-
gapY: {
|
|
203
|
-
"0": "gap-y-0",
|
|
204
|
-
"1": "gap-y-1",
|
|
205
|
-
"2": "gap-y-2",
|
|
206
|
-
"3": "gap-y-3",
|
|
207
|
-
"4": "gap-y-4",
|
|
208
|
-
"5": "gap-y-5",
|
|
209
|
-
"6": "gap-y-6",
|
|
210
|
-
"7": "gap-y-7",
|
|
211
|
-
"8": "gap-y-8",
|
|
212
|
-
"9": "gap-y-9",
|
|
213
|
-
"10": "gap-y-10"
|
|
214
|
-
},
|
|
215
|
-
position: {
|
|
216
|
-
static: "static",
|
|
217
|
-
fixed: "fixed",
|
|
218
|
-
absolute: "absolute",
|
|
219
|
-
relative: "relative",
|
|
220
|
-
sticky: "sticky"
|
|
221
|
-
},
|
|
222
|
-
top: {
|
|
223
|
-
"0": "top-0",
|
|
224
|
-
"1": "top-1",
|
|
225
|
-
"2": "top-2",
|
|
226
|
-
"3": "top-3",
|
|
227
|
-
"4": "top-4",
|
|
228
|
-
"5": "top-5",
|
|
229
|
-
"6": "top-6",
|
|
230
|
-
"7": "top-7",
|
|
231
|
-
"8": "top-8",
|
|
232
|
-
"9": "top-9",
|
|
233
|
-
"-1": "-top-1",
|
|
234
|
-
"-2": "-top-2",
|
|
235
|
-
"-3": "-top-3",
|
|
236
|
-
"-4": "-top-4",
|
|
237
|
-
"-5": "-top-5",
|
|
238
|
-
"-6": "-top-6",
|
|
239
|
-
"-7": "-top-7",
|
|
240
|
-
"-8": "-top-8",
|
|
241
|
-
"-9": "-top-9"
|
|
242
|
-
},
|
|
243
|
-
right: {
|
|
244
|
-
"0": "right-0",
|
|
245
|
-
"1": "right-1",
|
|
246
|
-
"2": "right-2",
|
|
247
|
-
"3": "right-3",
|
|
248
|
-
"4": "right-4",
|
|
249
|
-
"5": "right-5",
|
|
250
|
-
"6": "right-6",
|
|
251
|
-
"7": "right-7",
|
|
252
|
-
"8": "right-8",
|
|
253
|
-
"9": "right-9",
|
|
254
|
-
"-1": "-right-1",
|
|
255
|
-
"-2": "-right-2",
|
|
256
|
-
"-3": "-right-3",
|
|
257
|
-
"-4": "-right-4",
|
|
258
|
-
"-5": "-right-5",
|
|
259
|
-
"-6": "-right-6",
|
|
260
|
-
"-7": "-right-7",
|
|
261
|
-
"-8": "-right-8",
|
|
262
|
-
"-9": "-right-9"
|
|
263
|
-
},
|
|
264
|
-
bottom: {
|
|
265
|
-
"0": "bottom-0",
|
|
266
|
-
"1": "bottom-1",
|
|
267
|
-
"2": "bottom-2",
|
|
268
|
-
"3": "bottom-3",
|
|
269
|
-
"4": "bottom-4",
|
|
270
|
-
"5": "bottom-5",
|
|
271
|
-
"6": "bottom-6",
|
|
272
|
-
"7": "bottom-7",
|
|
273
|
-
"8": "bottom-8",
|
|
274
|
-
"9": "bottom-9",
|
|
275
|
-
"-1": "-bottom-1",
|
|
276
|
-
"-2": "-bottom-2",
|
|
277
|
-
"-3": "-bottom-3",
|
|
278
|
-
"-4": "-bottom-4",
|
|
279
|
-
"-5": "-bottom-5",
|
|
280
|
-
"-6": "-bottom-6",
|
|
281
|
-
"-7": "-bottom-7",
|
|
282
|
-
"-8": "-bottom-8",
|
|
283
|
-
"-9": "-bottom-9"
|
|
284
|
-
},
|
|
285
|
-
left: {
|
|
286
|
-
"0": "left-0",
|
|
287
|
-
"1": "left-1",
|
|
288
|
-
"2": "left-2",
|
|
289
|
-
"3": "left-3",
|
|
290
|
-
"4": "left-4",
|
|
291
|
-
"5": "left-5",
|
|
292
|
-
"6": "left-6",
|
|
293
|
-
"7": "left-7",
|
|
294
|
-
"8": "left-8",
|
|
295
|
-
"9": "left-9",
|
|
296
|
-
"-1": "-left-1",
|
|
297
|
-
"-2": "-left-2",
|
|
298
|
-
"-3": "-left-3",
|
|
299
|
-
"-4": "-left-4",
|
|
300
|
-
"-5": "-left-5",
|
|
301
|
-
"-6": "-left-6",
|
|
302
|
-
"-7": "-left-7",
|
|
303
|
-
"-8": "-left-8",
|
|
304
|
-
"-9": "-left-9"
|
|
305
|
-
},
|
|
306
|
-
overflow: {
|
|
307
|
-
auto: "overflow-auto",
|
|
308
|
-
hidden: "overflow-hidden",
|
|
309
|
-
clip: "overflow-clip",
|
|
310
|
-
scroll: "overflow-scroll",
|
|
311
|
-
visible: "overflow-visible"
|
|
312
|
-
},
|
|
313
|
-
overflowX: {
|
|
314
|
-
auto: "overflow-x-auto",
|
|
315
|
-
hidden: "overflow-x-hidden",
|
|
316
|
-
clip: "overflow-x-clip",
|
|
317
|
-
scroll: "overflow-x-scroll",
|
|
318
|
-
visible: "overflow-x-visible"
|
|
319
|
-
},
|
|
320
|
-
overflowY: {
|
|
321
|
-
auto: "overflow-y-auto",
|
|
322
|
-
hidden: "overflow-y-hidden",
|
|
323
|
-
clip: "overflow-y-clip",
|
|
324
|
-
scroll: "overflow-y-scroll",
|
|
325
|
-
visible: "overflow-y-visible"
|
|
326
|
-
},
|
|
327
|
-
flexGrow: {
|
|
328
|
-
0: "grow-0",
|
|
329
|
-
1: "grow"
|
|
330
|
-
},
|
|
331
|
-
flexShrink: {
|
|
332
|
-
0: "shrink-0",
|
|
333
|
-
1: "shrink"
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
defaultVariants: {
|
|
337
|
-
position: "relative",
|
|
338
|
-
overflow: "visible",
|
|
339
|
-
flexGrow: 0,
|
|
340
|
-
flexShrink: 1
|
|
341
|
-
}
|
|
342
|
-
});
|
|
2
|
+
import { forwardRef, memo } from "react";
|
|
343
3
|
|
|
344
4
|
// packages/tailwindTheme.ts
|
|
345
5
|
var themes = {
|
|
@@ -585,222 +245,64 @@ var cn = (...inputs) => {
|
|
|
585
245
|
return customTwMerge(clsx(inputs));
|
|
586
246
|
};
|
|
587
247
|
|
|
588
|
-
// packages/
|
|
589
|
-
import { jsx
|
|
590
|
-
var
|
|
248
|
+
// packages/Atoms/Input/index.tsx
|
|
249
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
250
|
+
var Input = memo(
|
|
591
251
|
forwardRef(
|
|
592
252
|
({
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
justify = "start",
|
|
598
|
-
align = "center",
|
|
599
|
-
gap,
|
|
600
|
-
gapX,
|
|
601
|
-
gapY,
|
|
602
|
-
p,
|
|
603
|
-
px,
|
|
604
|
-
py,
|
|
605
|
-
pt,
|
|
606
|
-
pr,
|
|
607
|
-
pb,
|
|
608
|
-
pl,
|
|
609
|
-
position,
|
|
610
|
-
top,
|
|
611
|
-
right,
|
|
612
|
-
bottom,
|
|
613
|
-
left,
|
|
614
|
-
flexGrow,
|
|
615
|
-
flexShrink,
|
|
616
|
-
children,
|
|
253
|
+
isErrored = false,
|
|
254
|
+
value,
|
|
255
|
+
placeholder = "",
|
|
256
|
+
icon,
|
|
617
257
|
className,
|
|
258
|
+
inputClassName,
|
|
259
|
+
onChange,
|
|
260
|
+
onBlur,
|
|
261
|
+
onFocus,
|
|
618
262
|
...props
|
|
619
|
-
},
|
|
620
|
-
const generateStyle = useMemo(() => {
|
|
621
|
-
let widthValue = "fit";
|
|
622
|
-
let heightValue = "fit";
|
|
623
|
-
switch (width) {
|
|
624
|
-
case "full": {
|
|
625
|
-
widthValue = "100%";
|
|
626
|
-
break;
|
|
627
|
-
}
|
|
628
|
-
case "screen": {
|
|
629
|
-
widthValue = "100vw";
|
|
630
|
-
break;
|
|
631
|
-
}
|
|
632
|
-
case "auto": {
|
|
633
|
-
widthValue = "auto";
|
|
634
|
-
break;
|
|
635
|
-
}
|
|
636
|
-
case "fit": {
|
|
637
|
-
widthValue = "fit-content";
|
|
638
|
-
break;
|
|
639
|
-
}
|
|
640
|
-
default: {
|
|
641
|
-
widthValue = `${width}px`;
|
|
642
|
-
break;
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
switch (height) {
|
|
646
|
-
case "full": {
|
|
647
|
-
heightValue = "100%";
|
|
648
|
-
break;
|
|
649
|
-
}
|
|
650
|
-
case "screen": {
|
|
651
|
-
heightValue = "100vh";
|
|
652
|
-
break;
|
|
653
|
-
}
|
|
654
|
-
case "auto": {
|
|
655
|
-
heightValue = "auto";
|
|
656
|
-
break;
|
|
657
|
-
}
|
|
658
|
-
case "fit": {
|
|
659
|
-
heightValue = "fit-content";
|
|
660
|
-
break;
|
|
661
|
-
}
|
|
662
|
-
default: {
|
|
663
|
-
heightValue = `${height}px`;
|
|
664
|
-
break;
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
return {
|
|
668
|
-
width: widthValue,
|
|
669
|
-
height: heightValue
|
|
670
|
-
};
|
|
671
|
-
}, [width, height]);
|
|
672
|
-
return /* @__PURE__ */ jsx2(
|
|
673
|
-
"div",
|
|
674
|
-
{
|
|
675
|
-
ref: reference,
|
|
676
|
-
className: cn(
|
|
677
|
-
flexVariant_default({ wrap, justify, align }),
|
|
678
|
-
commonLayout({
|
|
679
|
-
position,
|
|
680
|
-
top,
|
|
681
|
-
right,
|
|
682
|
-
bottom,
|
|
683
|
-
left,
|
|
684
|
-
flexGrow,
|
|
685
|
-
flexShrink
|
|
686
|
-
}),
|
|
687
|
-
{
|
|
688
|
-
[`flex-col`]: vertical,
|
|
689
|
-
[`p-${p}`]: p,
|
|
690
|
-
[`px-${px}`]: px,
|
|
691
|
-
[`py-${py}`]: py,
|
|
692
|
-
[`pt-${pt}`]: pt,
|
|
693
|
-
[`pr-${pr}`]: pr,
|
|
694
|
-
[`pb-${pb}`]: pb,
|
|
695
|
-
[`pl-${pl}`]: pl,
|
|
696
|
-
[`gap-${gap}`]: gap,
|
|
697
|
-
[`gap-x-${gapX}`]: gapX,
|
|
698
|
-
[`gap-y-${gapY}`]: gapY
|
|
699
|
-
},
|
|
700
|
-
className
|
|
701
|
-
),
|
|
702
|
-
style: generateStyle,
|
|
703
|
-
...props,
|
|
704
|
-
children
|
|
705
|
-
}
|
|
706
|
-
);
|
|
707
|
-
}
|
|
708
|
-
)
|
|
709
|
-
);
|
|
710
|
-
Flex.displayName = "Flex";
|
|
711
|
-
var Flex_default = Flex;
|
|
712
|
-
|
|
713
|
-
// packages/Atoms/Input/index.tsx
|
|
714
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
715
|
-
var Input = memo2(
|
|
716
|
-
forwardRef2(
|
|
717
|
-
({ isErrored = false, placeholder = "", icon, className, onChange, ...props }, reference) => {
|
|
718
|
-
const inputReference = useRef(null);
|
|
719
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
720
|
-
const [inputValue, setInputValue] = useState("");
|
|
721
|
-
const handleFocus = useCallback(() => {
|
|
722
|
-
setIsFocused(() => true);
|
|
723
|
-
}, []);
|
|
724
|
-
const handleBlur = useCallback(() => {
|
|
725
|
-
setIsFocused(() => false);
|
|
726
|
-
}, []);
|
|
727
|
-
const handleClear = useCallback(() => {
|
|
728
|
-
setInputValue(() => "");
|
|
729
|
-
}, []);
|
|
730
|
-
const handleInputChange = useCallback(
|
|
731
|
-
(event) => {
|
|
732
|
-
const {
|
|
733
|
-
target: { value }
|
|
734
|
-
} = event;
|
|
735
|
-
setInputValue(() => value);
|
|
736
|
-
onChange?.(event);
|
|
737
|
-
},
|
|
738
|
-
[onChange]
|
|
739
|
-
);
|
|
740
|
-
useEffect(() => {
|
|
741
|
-
if (isFocused && inputReference.current) {
|
|
742
|
-
inputReference.current.focus();
|
|
743
|
-
}
|
|
744
|
-
return void 0;
|
|
745
|
-
}, [isFocused]);
|
|
263
|
+
}, ref) => {
|
|
746
264
|
return /* @__PURE__ */ jsxs(
|
|
747
265
|
"div",
|
|
748
266
|
{
|
|
749
|
-
ref
|
|
750
|
-
className: cn(
|
|
751
|
-
[
|
|
752
|
-
"relative flex flex-row items-center justify-start",
|
|
753
|
-
"rounded-md border border-solid border-neutral-300 px-2",
|
|
754
|
-
"bg-neutral-50",
|
|
755
|
-
"hover:border-ui-primary-300",
|
|
756
|
-
"cursor-text text-ui-note text-ui-text-900",
|
|
757
|
-
"transition-all duration-300 ease-in-out"
|
|
758
|
-
],
|
|
759
|
-
{
|
|
760
|
-
"border-ui-primary-400 outline-ui-primary-200 ring-4 ring-ui-primary-200": isFocused,
|
|
761
|
-
"border-ui-destructive-300 bg-ui-destructive-50 hover:border-ui-destructive-300": isErrored,
|
|
762
|
-
"border-ui-destructive-400 outline-ui-destructive-200 ring-4 ring-ui-destructive-200": isErrored && isFocused
|
|
763
|
-
},
|
|
764
|
-
className
|
|
765
|
-
),
|
|
766
|
-
onFocus: handleFocus,
|
|
767
|
-
onBlur: handleBlur,
|
|
267
|
+
ref,
|
|
268
|
+
className: cn("relative", isErrored && "bg-ui-destructive-50", className),
|
|
768
269
|
...props,
|
|
769
270
|
children: [
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
"div",
|
|
772
|
-
{
|
|
773
|
-
className: cn("flex h-8 items-center justify-center", {
|
|
774
|
-
"mr-2 border-r border-neutral-300 pr-2": Boolean(icon)
|
|
775
|
-
}),
|
|
776
|
-
children: icon
|
|
777
|
-
}
|
|
778
|
-
),
|
|
779
|
-
/* @__PURE__ */ jsx3(
|
|
271
|
+
/* @__PURE__ */ jsx(
|
|
780
272
|
"input",
|
|
781
273
|
{
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
274
|
+
type: "text",
|
|
275
|
+
placeholder,
|
|
276
|
+
value,
|
|
277
|
+
className: cn(
|
|
278
|
+
"w-full",
|
|
279
|
+
"rounded border border-ui-border-400 bg-transparent",
|
|
280
|
+
"px-3 py-1",
|
|
281
|
+
"text-ui-note text-ui-text-500",
|
|
282
|
+
"outline-none",
|
|
283
|
+
"focus-within:text-ui-text-800",
|
|
284
|
+
"focus-within:border-ui-primary-500",
|
|
285
|
+
"focus-within:ring-4",
|
|
286
|
+
"focus-within:ring-ui-primary-100",
|
|
287
|
+
"transition-colors duration-300",
|
|
288
|
+
icon && "pl-12",
|
|
289
|
+
isErrored && "border-ui-destructive-500",
|
|
290
|
+
isErrored && "focus-within:border-ui-destructive-500",
|
|
291
|
+
isErrored && "focus-within:ring-ui-destructive-100",
|
|
292
|
+
inputClassName
|
|
293
|
+
),
|
|
294
|
+
onChange,
|
|
295
|
+
onBlur,
|
|
296
|
+
onFocus
|
|
787
297
|
}
|
|
788
298
|
),
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
|
|
299
|
+
icon && /* @__PURE__ */ jsx(
|
|
300
|
+
"div",
|
|
791
301
|
{
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
className: cn([
|
|
797
|
-
"opacity-1 z-50 rounded-full",
|
|
798
|
-
{
|
|
799
|
-
"bg-neutral-100": inputValue,
|
|
800
|
-
"opacity-0": !isFocused
|
|
801
|
-
}
|
|
802
|
-
]),
|
|
803
|
-
children: /* @__PURE__ */ jsx3("button", { onClick: handleClear, children: /* @__PURE__ */ jsx3(Lucide2XIcon_default, { size: 12, color: inputValue ? "#A3A3A3" : "#D4D4D4" }) })
|
|
302
|
+
className: cn(
|
|
303
|
+
"absolute top-1/2 flex h-[2.125rem] w-9 -translate-y-1/2 transform items-center justify-center border-r border-ui-border-400"
|
|
304
|
+
),
|
|
305
|
+
children: icon
|
|
804
306
|
}
|
|
805
307
|
)
|
|
806
308
|
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface IProps {
|
|
5
|
+
name?: string;
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
leftIcon?: ReactNode;
|
|
9
|
+
rightIcon?: ReactNode;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: React.NamedExoticComponent<IProps>;
|
|
13
|
+
|
|
14
|
+
export { _default as default };
|