@szum-tech/design-system 2.0.4 → 2.1.0
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/chunk-463KEXY6.cjs +79 -0
- package/dist/chunk-4YZSPNLW.cjs +42 -0
- package/dist/chunk-5EN2HNFU.js +50 -0
- package/dist/chunk-5ENMEB5L.cjs +341 -0
- package/dist/chunk-AO4TMCYJ.js +88 -0
- package/dist/chunk-C5YRMEKV.js +319 -0
- package/dist/chunk-H2BWO3SI.cjs +0 -1
- package/dist/chunk-HFHADY43.js +36 -0
- package/dist/chunk-HIWVHD4V.js +56 -0
- package/dist/chunk-HXC3EALP.js +39 -0
- package/dist/chunk-IFBQNWVG.js +70 -0
- package/dist/chunk-INJBKPIE.js +0 -1
- package/dist/chunk-J264N6AZ.js +22 -0
- package/dist/chunk-J56UDYA3.js +70 -0
- package/dist/chunk-KPB3CBHE.cjs +40 -0
- package/dist/chunk-LI7IHIOM.cjs +30 -0
- package/dist/chunk-LND2W67K.cjs +17 -0
- package/dist/chunk-N7DXGCBJ.cjs +30 -0
- package/dist/chunk-PB3EGVTV.cjs +116 -0
- package/dist/chunk-QRSQCHBO.cjs +59 -0
- package/dist/chunk-RF5YR553.cjs +24 -0
- package/dist/chunk-TD2KDWNP.js +57 -0
- package/dist/chunk-TSN5DAKH.cjs +0 -1
- package/dist/chunk-US32J7DK.js +15 -0
- package/dist/chunk-UZBZFCWX.js +28 -0
- package/dist/chunk-V4POHGAW.cjs +60 -0
- package/dist/chunk-VFRIU5CV.cjs +16 -0
- package/dist/chunk-VQMM75HD.cjs +66 -0
- package/dist/chunk-WTVBTZ3P.js +29 -0
- package/dist/chunk-XGA2F5GG.cjs +72 -0
- package/dist/chunk-XPM62WMM.js +23 -0
- package/dist/chunk-YHU2OW52.js +14 -0
- package/dist/chunk-YXTTED5V.cjs +31 -0
- package/dist/chunk-ZD2QRAOX.js +0 -1
- package/dist/components/alert-dialog/index.cjs +43 -0
- package/dist/components/alert-dialog/index.d.cts +32 -0
- package/dist/components/alert-dialog/index.d.ts +32 -0
- package/dist/components/alert-dialog/index.js +2 -0
- package/dist/components/avatar/index.cjs +19 -0
- package/dist/components/avatar/index.d.cts +28 -0
- package/dist/components/avatar/index.d.ts +28 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/button/index.cjs +11 -0
- package/dist/components/button/index.d.cts +64 -0
- package/dist/components/button/index.d.ts +64 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/card/index.cjs +30 -0
- package/dist/components/card/index.d.cts +22 -0
- package/dist/components/card/index.d.ts +22 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/dialog/index.cjs +38 -0
- package/dist/components/dialog/index.d.cts +40 -0
- package/dist/components/dialog/index.d.ts +40 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/form/index.cjs +50 -0
- package/dist/components/form/index.d.cts +32 -0
- package/dist/components/form/index.d.ts +32 -0
- package/dist/components/form/index.js +17 -0
- package/dist/components/header/index.cjs +10 -0
- package/dist/components/header/index.d.cts +9 -0
- package/dist/components/header/index.d.ts +9 -0
- package/dist/components/header/index.js +1 -0
- package/dist/components/helper-text/index.cjs +10 -0
- package/dist/components/helper-text/index.d.cts +18 -0
- package/dist/components/helper-text/index.d.ts +18 -0
- package/dist/components/helper-text/index.js +1 -0
- package/dist/components/index.cjs +230 -0
- package/dist/components/index.d.cts +22 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.js +17 -0
- package/dist/components/input/index.cjs +11 -0
- package/dist/components/input/index.d.cts +11 -0
- package/dist/components/input/index.d.ts +11 -0
- package/dist/components/input/index.js +2 -0
- package/dist/components/label/index.cjs +10 -0
- package/dist/components/label/index.d.cts +8 -0
- package/dist/components/label/index.d.ts +8 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/select/index.cjs +14 -0
- package/dist/components/select/index.d.cts +15 -0
- package/dist/components/select/index.d.ts +15 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/separator/index.cjs +11 -0
- package/dist/components/separator/index.d.cts +8 -0
- package/dist/components/separator/index.d.ts +8 -0
- package/dist/components/separator/index.js +2 -0
- package/dist/components/sheet/index.cjs +38 -0
- package/dist/components/sheet/index.d.cts +40 -0
- package/dist/components/sheet/index.d.ts +40 -0
- package/dist/components/sheet/index.js +1 -0
- package/dist/components/textarea/index.cjs +10 -0
- package/dist/components/textarea/index.d.cts +9 -0
- package/dist/components/textarea/index.d.ts +9 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/tooltip/index.cjs +14 -0
- package/dist/components/tooltip/index.d.cts +20 -0
- package/dist/components/tooltip/index.d.ts +20 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/{icons.cjs → icons/index.cjs} +1 -1
- package/dist/{icons.js → icons/index.js} +1 -1
- package/dist/{utils.cjs → utils/index.cjs} +1 -1
- package/dist/utils/index.js +1 -0
- package/package.json +42 -32
- package/dist/index.cjs +0 -908
- package/dist/index.d.cts +0 -285
- package/dist/index.d.ts +0 -285
- package/dist/index.js +0 -832
- package/dist/utils.js +0 -1
- /package/dist/{icons.d.cts → icons/index.d.cts} +0 -0
- /package/dist/{icons.d.ts → icons/index.d.ts} +0 -0
- /package/dist/{utils.d.cts → utils/index.d.cts} +0 -0
- /package/dist/{utils.d.ts → utils/index.d.ts} +0 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { LoadingIcon } from './chunk-INJBKPIE.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var buttonCva = cva(
|
|
8
|
+
[
|
|
9
|
+
"inline-flex cursor-pointer items-center justify-center align-middle no-underline transition-colors duration-300 ease-in-out",
|
|
10
|
+
"select-none appearance-none rounded-sm border font-sans font-medium tracking-[.02857em]",
|
|
11
|
+
"aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50"
|
|
12
|
+
],
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
fullWidth: {
|
|
16
|
+
true: "w-full"
|
|
17
|
+
},
|
|
18
|
+
color: {
|
|
19
|
+
neutral: "",
|
|
20
|
+
primary: "",
|
|
21
|
+
success: "",
|
|
22
|
+
warning: "",
|
|
23
|
+
error: ""
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
sm: "px-2.5 py-1 text-[.8125rem] leading-4",
|
|
27
|
+
md: "px-4 py-1.5 text-[0.875rem] leading-5",
|
|
28
|
+
lg: "px-5 py-2 text-[.9375rem] leading-6"
|
|
29
|
+
},
|
|
30
|
+
variant: {
|
|
31
|
+
text: "border-transparent bg-transparent",
|
|
32
|
+
outlined: "bg-transparent",
|
|
33
|
+
contained: ""
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
compoundVariants: [
|
|
37
|
+
// ---------- TEXT ---------- //
|
|
38
|
+
{
|
|
39
|
+
variant: "text",
|
|
40
|
+
color: "neutral",
|
|
41
|
+
class: [
|
|
42
|
+
"text-gray-100",
|
|
43
|
+
"hover:border-gray-350 hover:bg-gray-350 hover:text-gray-100",
|
|
44
|
+
"active:border-gray-400 active:bg-gray-400"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
variant: "text",
|
|
49
|
+
color: "primary",
|
|
50
|
+
class: [
|
|
51
|
+
"text-primary-500",
|
|
52
|
+
"hover:border-primary-500 hover:bg-primary-500 hover:text-white",
|
|
53
|
+
"active:border-primary-600 active:bg-primary-600 active:text-white"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
variant: "text",
|
|
58
|
+
color: "success",
|
|
59
|
+
class: [
|
|
60
|
+
"text-success-500",
|
|
61
|
+
"hover:border-success-500 hover:bg-success-500 hover:text-white",
|
|
62
|
+
"active:border-success-600 active:bg-success-600 active:text-white"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
variant: "text",
|
|
67
|
+
color: "warning",
|
|
68
|
+
class: [
|
|
69
|
+
"text-warning-500",
|
|
70
|
+
"hover:border-warning-500 hover:bg-warning-500 hover:text-white",
|
|
71
|
+
"active:border-warning-600 active:bg-warning-600 active:text-white"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
variant: "text",
|
|
76
|
+
color: "error",
|
|
77
|
+
class: [
|
|
78
|
+
"text-error-500",
|
|
79
|
+
"hover:border-error-500 hover:bg-error-500 hover:text-white",
|
|
80
|
+
"active:border-error-600 active:bg-error-600 active:text-white"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
// ---------- OUTLINED ---------- //
|
|
84
|
+
{
|
|
85
|
+
variant: "outlined",
|
|
86
|
+
color: "neutral",
|
|
87
|
+
class: ["border-gray-350 text-gray-100", "hover:bg-gray-350", "active:bg-gray-400"]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
variant: "outlined",
|
|
91
|
+
color: "primary",
|
|
92
|
+
class: [
|
|
93
|
+
"text-primary-500 border-primary-500",
|
|
94
|
+
"hover:bg-primary-500 hover:text-white",
|
|
95
|
+
"active:bg-primary-600 active:text-white"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
variant: "outlined",
|
|
100
|
+
color: "success",
|
|
101
|
+
class: [
|
|
102
|
+
"text-success-500 border-success-500",
|
|
103
|
+
"hover:bg-success-500 hover:text-white",
|
|
104
|
+
"active:bg-success-600 active:text-white"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
variant: "outlined",
|
|
109
|
+
color: "warning",
|
|
110
|
+
class: [
|
|
111
|
+
"text-warning-500 border-warning-500",
|
|
112
|
+
"hover:bg-warning-500 hover:text-white",
|
|
113
|
+
"active:bg-warning-600 active:text-white"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
variant: "outlined",
|
|
118
|
+
color: "error",
|
|
119
|
+
class: [
|
|
120
|
+
"text-error-500 border-error-500",
|
|
121
|
+
"hover:bg-error-500 hover:text-white",
|
|
122
|
+
"active:bg-error-600 active:text-white"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
// ---------- OUTLINED ---------- //
|
|
126
|
+
{
|
|
127
|
+
variant: "contained",
|
|
128
|
+
color: "neutral",
|
|
129
|
+
class: [
|
|
130
|
+
"border-gray-350 bg-gray-350 text-gray-100",
|
|
131
|
+
"hover:border-gray-300 hover:bg-gray-300",
|
|
132
|
+
"active:border-gray-400 active:bg-gray-400"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
variant: "contained",
|
|
137
|
+
color: "primary",
|
|
138
|
+
class: [
|
|
139
|
+
"border-primary-500 bg-primary-500 text-white",
|
|
140
|
+
"hover:border-primary-400 hover:bg-primary-400",
|
|
141
|
+
"active:border-primary-600 active:bg-primary-600"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
variant: "contained",
|
|
146
|
+
color: "success",
|
|
147
|
+
class: [
|
|
148
|
+
"border-success-500 bg-success-500 text-white",
|
|
149
|
+
"hover:border-success-400 hover:bg-success-400",
|
|
150
|
+
"active:border-success-600 active:bg-success-600"
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
variant: "contained",
|
|
155
|
+
color: "warning",
|
|
156
|
+
class: [
|
|
157
|
+
"border-warning-500 bg-warning-500 text-white",
|
|
158
|
+
"hover:border-warning-400 hover:bg-warning-400",
|
|
159
|
+
"active:border-warning-600 active:bg-warning-600"
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
variant: "contained",
|
|
164
|
+
color: "error",
|
|
165
|
+
class: [
|
|
166
|
+
"border-error-500 bg-error-500 text-white",
|
|
167
|
+
"hover:border-error-400 hover:bg-error-400",
|
|
168
|
+
"active:border-error-600 active:bg-error-600"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
defaultVariants: {
|
|
173
|
+
fullWidth: false,
|
|
174
|
+
color: "primary",
|
|
175
|
+
size: "md",
|
|
176
|
+
variant: "text"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
var iconContainerCva = cva("", {
|
|
181
|
+
variants: {
|
|
182
|
+
site: {
|
|
183
|
+
left: "",
|
|
184
|
+
right: ""
|
|
185
|
+
},
|
|
186
|
+
size: {
|
|
187
|
+
sm: "",
|
|
188
|
+
md: "",
|
|
189
|
+
lg: ""
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
compoundVariants: [
|
|
193
|
+
// ---------- LEFT ---------- //
|
|
194
|
+
{
|
|
195
|
+
site: "left",
|
|
196
|
+
size: "sm",
|
|
197
|
+
class: "-ml-0.5 mr-1.5"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
site: "left",
|
|
201
|
+
size: "md",
|
|
202
|
+
class: "-ml-1 mr-2"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
site: "left",
|
|
206
|
+
size: "lg",
|
|
207
|
+
class: "-ml-1.5 mr-2.5"
|
|
208
|
+
},
|
|
209
|
+
// ---------- RIGHT ---------- //
|
|
210
|
+
{
|
|
211
|
+
site: "right",
|
|
212
|
+
size: "sm",
|
|
213
|
+
class: "-mr-0.5 ml-1.5"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
site: "right",
|
|
217
|
+
size: "md",
|
|
218
|
+
class: "-mr-1 ml-2"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
site: "right",
|
|
222
|
+
size: "lg",
|
|
223
|
+
class: "-mr-1.5 ml-2.5"
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
defaultVariants: {
|
|
227
|
+
site: "left",
|
|
228
|
+
size: "md"
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
var iconCva = cva("", {
|
|
232
|
+
variants: {
|
|
233
|
+
loading: {
|
|
234
|
+
true: "animate-spin motion-reduce:hidden"
|
|
235
|
+
},
|
|
236
|
+
size: {
|
|
237
|
+
sm: "h-4.5 w-4.5",
|
|
238
|
+
md: "size-5",
|
|
239
|
+
lg: "h-5.5 w-5.5"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
defaultVariants: {
|
|
243
|
+
loading: false,
|
|
244
|
+
size: "md"
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
function Button({
|
|
248
|
+
asChild = false,
|
|
249
|
+
variant = "text",
|
|
250
|
+
color = "primary",
|
|
251
|
+
disabled = false,
|
|
252
|
+
fullWidth = false,
|
|
253
|
+
loadingPosition = "start",
|
|
254
|
+
ref,
|
|
255
|
+
...props
|
|
256
|
+
}) {
|
|
257
|
+
const {
|
|
258
|
+
children,
|
|
259
|
+
type = "button",
|
|
260
|
+
loading = false,
|
|
261
|
+
size = "md",
|
|
262
|
+
endIcon,
|
|
263
|
+
startIcon,
|
|
264
|
+
...rest
|
|
265
|
+
} = { ...props, loadingPosition };
|
|
266
|
+
const Comp = asChild ? Slot : "button";
|
|
267
|
+
const buttonStyles = buttonCva({ fullWidth, size, variant, color });
|
|
268
|
+
const isDisabled = disabled || loading;
|
|
269
|
+
return /* @__PURE__ */ jsx(
|
|
270
|
+
Comp,
|
|
271
|
+
{
|
|
272
|
+
...asChild ? props : rest,
|
|
273
|
+
"aria-disabled": isDisabled || void 0,
|
|
274
|
+
className: buttonStyles,
|
|
275
|
+
"data-state": loading ? "loading" : void 0,
|
|
276
|
+
disabled: isDisabled,
|
|
277
|
+
ref,
|
|
278
|
+
role: Comp !== "button" ? "button" : void 0,
|
|
279
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
280
|
+
type: Comp === "button" ? type : void 0,
|
|
281
|
+
children: asChild ? /* @__PURE__ */ jsx(ButtonContent, { children }) : /* @__PURE__ */ jsx(ButtonContent, { ...props })
|
|
282
|
+
}
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
function ButtonContent({
|
|
286
|
+
children,
|
|
287
|
+
loading = false,
|
|
288
|
+
size = "md",
|
|
289
|
+
loadingPosition = "start",
|
|
290
|
+
startIcon,
|
|
291
|
+
endIcon,
|
|
292
|
+
...props
|
|
293
|
+
}) {
|
|
294
|
+
const isStartLoading = loading && loadingPosition === "start";
|
|
295
|
+
const StartIcon = isStartLoading ? /* @__PURE__ */ jsx(LoadingIcon, { "aria-label": "Loading" }) : startIcon || null;
|
|
296
|
+
const startIconStyles = iconCva({ size, loading: isStartLoading });
|
|
297
|
+
const startIconContainerStyles = iconContainerCva({ size, site: "left" });
|
|
298
|
+
const isEndLoading = loading && loadingPosition === "end";
|
|
299
|
+
const EndIcon = isEndLoading ? /* @__PURE__ */ jsx(LoadingIcon, { "aria-label": "Loading" }) : endIcon || null;
|
|
300
|
+
const endIconStyles = iconCva({ size, loading: isEndLoading });
|
|
301
|
+
const endIconContainerStyles = iconContainerCva({ size, site: "right" });
|
|
302
|
+
const LeadingIcon = StartIcon ? /* @__PURE__ */ jsx("span", { className: startIconContainerStyles, role: isStartLoading ? "progressbar" : void 0, children: React.cloneElement(StartIcon, { className: startIconStyles }) }) : null;
|
|
303
|
+
const TrailingIcon = EndIcon ? /* @__PURE__ */ jsx("span", { className: endIconContainerStyles, role: isEndLoading ? "progressbar" : void 0, children: React.cloneElement(EndIcon, { className: endIconStyles }) }) : null;
|
|
304
|
+
return React.isValidElement(children) ? React.cloneElement(
|
|
305
|
+
children,
|
|
306
|
+
props,
|
|
307
|
+
/* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
308
|
+
LeadingIcon,
|
|
309
|
+
React.isValidElement(children) ? children.props?.children : null,
|
|
310
|
+
TrailingIcon
|
|
311
|
+
] })
|
|
312
|
+
) : /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
313
|
+
LeadingIcon,
|
|
314
|
+
children,
|
|
315
|
+
TrailingIcon
|
|
316
|
+
] });
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export { Button };
|
package/dist/chunk-H2BWO3SI.cjs
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
2
|
+
import { Avatar as Avatar$1 } from 'radix-ui';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var avatarCva = cva("relative flex shrink-0 overflow-hidden rounded text-gray-100", {
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: "size-6 text-xs",
|
|
10
|
+
md: "size-10 text-lg",
|
|
11
|
+
lg: "size-14 text-2xl"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
size: "md"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
function Avatar({ className, size, ref, ...props }) {
|
|
19
|
+
const avatarStyles = avatarCva({ size });
|
|
20
|
+
return /* @__PURE__ */ jsx(Avatar$1.Root, { ref, className: cn(avatarStyles, className), ...props });
|
|
21
|
+
}
|
|
22
|
+
function AvatarImage({ className, ref, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(Avatar$1.Image, { ref, className: cn("aspect-square h-full w-full", className), ...props });
|
|
24
|
+
}
|
|
25
|
+
function AvatarFallback({ className, ref, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
Avatar$1.Fallback,
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
className: cn("bg-gray-350 flex h-full w-full items-center justify-center", className),
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Select as Select$1 } from 'radix-ui';
|
|
2
|
+
import { CaretSortIcon, CheckIcon } from '@radix-ui/react-icons';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var selectCva = cva(
|
|
7
|
+
[
|
|
8
|
+
"bg-app-foreground text-body-2 inline-flex h-10 w-full appearance-none items-center justify-between gap-2 border px-3 py-2 text-gray-100 outline-0 transition-colors duration-300 ease-in-out",
|
|
9
|
+
"placeholder:select-none placeholder:text-gray-200",
|
|
10
|
+
"invalid:border-error-500 focus:border-primary-400 active:border-primary-400",
|
|
11
|
+
"disabled:border-gray-400 disabled:text-gray-200 disabled:placeholder:text-gray-300"
|
|
12
|
+
],
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
invalid: {
|
|
16
|
+
true: ["text-error-500 border-error-500 hover:border-error-400 focus:text-gray-100"],
|
|
17
|
+
false: ["border-gray-350 hover:border-primary-500 text-gray-100"]
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
invalid: false
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
function Select({ children, placeholder, invalid = false, ref, ...props }) {
|
|
26
|
+
const selectStyles = selectCva({ invalid });
|
|
27
|
+
return /* @__PURE__ */ jsxs(Select$1.Root, { ...props, children: [
|
|
28
|
+
/* @__PURE__ */ jsxs(Select$1.Trigger, { className: selectStyles, ref, children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Select$1.Value, { placeholder }),
|
|
30
|
+
/* @__PURE__ */ jsx(Select$1.Icon, { className: "-mr-1.5", children: /* @__PURE__ */ jsx(CaretSortIcon, { className: "size-5 text-gray-200" }) })
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(
|
|
33
|
+
Select$1.Content,
|
|
34
|
+
{
|
|
35
|
+
sideOffset: 4,
|
|
36
|
+
className: "bg-app-foreground z-50 w-full overflow-hidden border border-gray-400 py-1",
|
|
37
|
+
children: /* @__PURE__ */ jsx(Select$1.Viewport, { children })
|
|
38
|
+
}
|
|
39
|
+
) })
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
function SelectItem({ children, ...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
Select$1.Item,
|
|
45
|
+
{
|
|
46
|
+
className: "text-body-2 data-[state=checked]:bg-primary-300 flex w-full flex-row items-center justify-between px-3 py-2 text-gray-100 select-none data-[disabled]:pointer-events-none data-[highlighted]:bg-gray-400 data-[highlighted]:outline-none",
|
|
47
|
+
...props,
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsx(Select$1.ItemText, { className: "flex-1", children }),
|
|
50
|
+
/* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { Select, SelectItem };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Tooltip as Tooltip$1 } from 'radix-ui';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
function Tooltip({
|
|
5
|
+
defaultOpen,
|
|
6
|
+
content,
|
|
7
|
+
open,
|
|
8
|
+
onOpenChange,
|
|
9
|
+
children,
|
|
10
|
+
side,
|
|
11
|
+
align,
|
|
12
|
+
collisionPadding = 8,
|
|
13
|
+
sideOffset = 8,
|
|
14
|
+
...props
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsxs(Tooltip$1.Root, { delayDuration: 0, open, defaultOpen, onOpenChange, children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Tooltip$1.Trigger, { asChild: true, children }),
|
|
18
|
+
content ? /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsxs(
|
|
19
|
+
Tooltip$1.Content,
|
|
20
|
+
{
|
|
21
|
+
className: "text-body-1 data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade rounded bg-white p-2 text-gray-100 will-change-[transform,opacity] select-none",
|
|
22
|
+
sideOffset,
|
|
23
|
+
side,
|
|
24
|
+
align,
|
|
25
|
+
collisionPadding,
|
|
26
|
+
...props,
|
|
27
|
+
children: [
|
|
28
|
+
content,
|
|
29
|
+
/* @__PURE__ */ jsx(Tooltip$1.Arrow, { width: 8, height: 4, className: "fill-white" })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
) }) : null
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
function TooltipProvider({ children }) {
|
|
36
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Provider, { skipDelayDuration: 500, children });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { Tooltip, TooltipProvider };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var inputCva = cva(
|
|
6
|
+
[
|
|
7
|
+
"bg-app-foreground font-poppins h-10 w-full appearance-none border py-2 outline-0 transition-colors duration-300 ease-in-out",
|
|
8
|
+
"placeholder:select-none placeholder:text-gray-200",
|
|
9
|
+
"invalid:border-error-500 focus:border-primary-400 active:border-primary-400",
|
|
10
|
+
"disabled:border-gray-400 disabled:text-gray-200 disabled:placeholder:text-gray-300"
|
|
11
|
+
],
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
invalid: {
|
|
15
|
+
true: ["text-error-500 border-error-500 hover:border-error-400 focus:text-gray-100"],
|
|
16
|
+
false: ["border-gray-350 hover:border-primary-500 text-gray-100"]
|
|
17
|
+
},
|
|
18
|
+
withStartIcon: {
|
|
19
|
+
true: "pl-11",
|
|
20
|
+
false: "pl-3"
|
|
21
|
+
},
|
|
22
|
+
withEndIcon: {
|
|
23
|
+
true: "pr-11",
|
|
24
|
+
false: "pr-3"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
invalid: false,
|
|
29
|
+
withStartIcon: false,
|
|
30
|
+
withEndIcon: false
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
var inputIconContainerCva = cva(
|
|
35
|
+
["pointer-events-none absolute inset-y-2 inline-flex w-10 place-content-center items-center text-center"],
|
|
36
|
+
{
|
|
37
|
+
variants: {
|
|
38
|
+
disabled: {
|
|
39
|
+
true: "text-gray-200"
|
|
40
|
+
},
|
|
41
|
+
site: {
|
|
42
|
+
right: "right-0 border-l border-l-gray-400 pr-1",
|
|
43
|
+
left: "left-0 border-r border-r-gray-400 pl-1"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
defaultVariants: {
|
|
47
|
+
disabled: false
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
function Input({ invalid = false, startIcon, endIcon, disabled = false, className, ...props }) {
|
|
52
|
+
const inputStyles = inputCva({ withEndIcon: !!endIcon, withStartIcon: !!startIcon, invalid });
|
|
53
|
+
const inputIconStartContainer = inputIconContainerCva({ site: "left", disabled });
|
|
54
|
+
const inputIconEndContainer = inputIconContainerCva({ site: "right", disabled });
|
|
55
|
+
return /* @__PURE__ */ jsxs("div", { className: "text-body-2 relative text-gray-100", children: [
|
|
56
|
+
startIcon ? /* @__PURE__ */ jsx("span", { className: inputIconStartContainer, children: startIcon }) : null,
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
"input",
|
|
59
|
+
{
|
|
60
|
+
"aria-invalid": invalid || void 0,
|
|
61
|
+
disabled,
|
|
62
|
+
className: cn(inputStyles, className),
|
|
63
|
+
...props
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
endIcon ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: inputIconEndContainer, children: endIcon }) : null
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { Input };
|
package/dist/chunk-INJBKPIE.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { cn } from './chunk-ZD2QRAOX.js';
|
|
2
|
+
import { Separator as Separator$1 } from 'radix-ui';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function Separator({ className, orientation = "horizontal", decorative = false, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
Separator$1.Root,
|
|
8
|
+
{
|
|
9
|
+
decorative,
|
|
10
|
+
orientation,
|
|
11
|
+
"aria-orientation": orientation,
|
|
12
|
+
className: cn(
|
|
13
|
+
"shrink-0 bg-gray-400",
|
|
14
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { Separator };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Dialog as Dialog$1 } from 'radix-ui';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import { Cross1Icon } from '@radix-ui/react-icons';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var Dialog = Dialog$1.Root;
|
|
8
|
+
var DialogClose = Dialog$1.Close;
|
|
9
|
+
var dialogContentStyles = cva(
|
|
10
|
+
[
|
|
11
|
+
"bg-foreground fixed left-1/2 top-1/2 z-50 flex w-full -translate-x-1/2 -translate-y-1/2 flex-col rounded border border-gray-400 p-4 shadow-lg",
|
|
12
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] duration-200"
|
|
13
|
+
],
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
width: {
|
|
17
|
+
xs: "max-w-xs",
|
|
18
|
+
sm: "max-w-sm",
|
|
19
|
+
md: "max-w-md",
|
|
20
|
+
lg: "max-w-lg",
|
|
21
|
+
xl: "max-w-xl",
|
|
22
|
+
"2xl": "max-w-2xl",
|
|
23
|
+
"3xl": "max-w-3xl",
|
|
24
|
+
"4xl": "max-w-4xl",
|
|
25
|
+
"5xl": "max-w-5xl",
|
|
26
|
+
"6xl": "max-w-6xl",
|
|
27
|
+
full: "max-w-full"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
width: "md"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
function DialogOverlay(props) {
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
Dialog$1.Overlay,
|
|
38
|
+
{
|
|
39
|
+
className: "bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs",
|
|
40
|
+
...props
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
function DialogContent({ className, children, width = "md", ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [
|
|
46
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
47
|
+
/* @__PURE__ */ jsxs(Dialog$1.Content, { className: twMerge(dialogContentStyles({ width }), className), ...props, children: [
|
|
48
|
+
children,
|
|
49
|
+
/* @__PURE__ */ jsxs(Dialog$1.Close, { className: "focus:ring-ring ring-primary-500 ring-offset-foreground data-[state=open]:bg-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none", children: [
|
|
50
|
+
/* @__PURE__ */ jsx(Cross1Icon, { className: "size-4" }),
|
|
51
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
52
|
+
] })
|
|
53
|
+
] })
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
var DialogTrigger = Dialog$1.Trigger;
|
|
57
|
+
function DialogHeader({ className, ...props }) {
|
|
58
|
+
return /* @__PURE__ */ jsx("div", { className: twMerge("mb-4 flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
59
|
+
}
|
|
60
|
+
function DialogFooter({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx("div", { className: twMerge("mt-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props });
|
|
62
|
+
}
|
|
63
|
+
function DialogTitle({ className, ...props }) {
|
|
64
|
+
return /* @__PURE__ */ jsx(Dialog$1.Title, { className: twMerge("text-heading-6", className), ...props });
|
|
65
|
+
}
|
|
66
|
+
function DialogDescription({ className, ...props }) {
|
|
67
|
+
return /* @__PURE__ */ jsx(Dialog$1.Description, { className: twMerge("text-body-2 text-gray-200", className), ...props });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkH2BWO3SI_cjs = require('./chunk-H2BWO3SI.cjs');
|
|
4
|
+
var radixUi = require('radix-ui');
|
|
5
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
var avatarCva = classVarianceAuthority.cva("relative flex shrink-0 overflow-hidden rounded text-gray-100", {
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
sm: "size-6 text-xs",
|
|
12
|
+
md: "size-10 text-lg",
|
|
13
|
+
lg: "size-14 text-2xl"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
size: "md"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
function Avatar({ className, size, ref, ...props }) {
|
|
21
|
+
const avatarStyles = avatarCva({ size });
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Avatar.Root, { ref, className: chunkH2BWO3SI_cjs.cn(avatarStyles, className), ...props });
|
|
23
|
+
}
|
|
24
|
+
function AvatarImage({ className, ref, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Avatar.Image, { ref, className: chunkH2BWO3SI_cjs.cn("aspect-square h-full w-full", className), ...props });
|
|
26
|
+
}
|
|
27
|
+
function AvatarFallback({ className, ref, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29
|
+
radixUi.Avatar.Fallback,
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
className: chunkH2BWO3SI_cjs.cn("bg-gray-350 flex h-full w-full items-center justify-center", className),
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
exports.Avatar = Avatar;
|
|
39
|
+
exports.AvatarFallback = AvatarFallback;
|
|
40
|
+
exports.AvatarImage = AvatarImage;
|