singularity-components 0.1.103 → 0.1.105
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/README.md +1 -1
- package/dist/client/client.css +1876 -0
- package/dist/client/client.css.map +1 -0
- package/dist/client/client.d.ts +40 -0
- package/dist/client/client.js +381 -0
- package/dist/client/client.js.map +1 -0
- package/dist/main.cjs +5222 -5123
- package/dist/main.cjs.map +1 -1
- package/dist/main.css +197 -65
- package/dist/main.css.map +1 -1
- package/dist/main.d.cts +130 -22
- package/dist/main.d.ts +130 -22
- package/dist/main.js +5213 -5125
- package/dist/main.js.map +1 -1
- package/dist/server/ssr.cjs +834 -0
- package/dist/server/ssr.cjs.map +1 -0
- package/dist/server/ssr.css +1876 -0
- package/dist/server/ssr.css.map +1 -0
- package/dist/server/ssr.d.cts +228 -0
- package/package.json +16 -16
|
@@ -0,0 +1,834 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
4
|
+
var clsx2 = require('clsx');
|
|
5
|
+
var tailwindMerge = require('tailwind-merge');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
8
|
+
var lucideReact = require('lucide-react');
|
|
9
|
+
var React = require('react');
|
|
10
|
+
|
|
11
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
function _interopNamespace(e) {
|
|
14
|
+
if (e && e.__esModule) return e;
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
n.default = e;
|
|
28
|
+
return Object.freeze(n);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var clsx2__default = /*#__PURE__*/_interopDefault(clsx2);
|
|
32
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
33
|
+
|
|
34
|
+
// src/components/server/primitives/alert/alert.tsx
|
|
35
|
+
function cn(...inputs) {
|
|
36
|
+
const classString = clsx2.clsx(inputs);
|
|
37
|
+
const allOriginalClasses = classString.split(/\s+/).filter(Boolean);
|
|
38
|
+
const prefixedClasses = allOriginalClasses.filter((c) => c.startsWith("sg:"));
|
|
39
|
+
const unprefixedClasses = allOriginalClasses.filter(
|
|
40
|
+
(c) => !c.startsWith("sg:")
|
|
41
|
+
);
|
|
42
|
+
const allClassesWithRemovedPrefix = allOriginalClasses.map(
|
|
43
|
+
(c) => c.replace("sg:", "")
|
|
44
|
+
);
|
|
45
|
+
const mergedClasses = tailwindMerge.twMerge(allClassesWithRemovedPrefix).split(/\s+/).filter(Boolean);
|
|
46
|
+
return mergedClasses.map((c) => {
|
|
47
|
+
if (prefixedClasses.includes("sg:" + c) && !unprefixedClasses.includes(c)) {
|
|
48
|
+
return "sg:" + c;
|
|
49
|
+
}
|
|
50
|
+
return c;
|
|
51
|
+
}).join(" ");
|
|
52
|
+
}
|
|
53
|
+
var alertVariants = {
|
|
54
|
+
variant: {
|
|
55
|
+
default: "sg:bg-card sg:text-card-foreground",
|
|
56
|
+
destructive: "sg:text-destructive sg:bg-card sg:[&>svg]:text-current sg:*:data-[slot=alert-description]:text-destructive/90"
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var alertVariantsProps = classVarianceAuthority.cva(
|
|
60
|
+
"sg:relative sg:w-full sg:rounded-lg sg:border sg:px-4 sg:py-3 sg:text-sm sg:grid sg:has-[>svg]:grid-cols-[calc(var(--sg-spacing)*4)_1fr] sg:grid-cols-[0_1fr] sg:has-[>svg]:gap-x-3 sg:gap-y-0.5 sg:items-start sg:[&>svg]:size-4 sg:[&>svg]:translate-y-0.5 sg:[&>svg]:text-current",
|
|
61
|
+
{
|
|
62
|
+
variants: alertVariants,
|
|
63
|
+
defaultVariants: {
|
|
64
|
+
variant: "default"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
function Alert({
|
|
69
|
+
className,
|
|
70
|
+
variant,
|
|
71
|
+
...props
|
|
72
|
+
}) {
|
|
73
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
"data-slot": "alert",
|
|
77
|
+
role: "alert",
|
|
78
|
+
className: cn(alertVariantsProps({ variant }), className),
|
|
79
|
+
...props
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function AlertTitle({ className, ...props }) {
|
|
84
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "alert-title",
|
|
88
|
+
className: cn(
|
|
89
|
+
"sg:col-start-2 sg:line-clamp-1 sg:min-h-4 sg:font-medium sg:tracking-tight",
|
|
90
|
+
className
|
|
91
|
+
),
|
|
92
|
+
...props
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
function AlertDescription({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}) {
|
|
100
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
"data-slot": "alert-description",
|
|
104
|
+
className: cn(
|
|
105
|
+
"sg:text-muted-foreground sg:col-start-2 sg:grid sg:justify-items-start sg:gap-1 sg:text-sm sg:[&_p]:leading-relaxed",
|
|
106
|
+
className
|
|
107
|
+
),
|
|
108
|
+
...props
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
var badgeVariants = classVarianceAuthority.cva(
|
|
113
|
+
"sg:inline-flex sg:items-center sg:justify-center sg:rounded-md sg:border sg:px-2 sg:py-0.5 sg:text-xs sg:font-medium sg:w-fit sg:whitespace-nowrap sg:shrink-0 sg:[&>svg]:size-3 sg:gap-1 sg:[&>svg]:pointer-events-none sg:focus-visible:border-ring sg:focus-visible:ring-ring/50 sg:focus-visible:ring-[3px] sg:aria-invalid:ring-destructive/20 sg:dark:aria-invalid:ring-destructive/40 sg:aria-invalid:border-destructive sg:transition-[color,box-shadow] sg:overflow-hidden",
|
|
114
|
+
{
|
|
115
|
+
variants: {
|
|
116
|
+
variant: {
|
|
117
|
+
default: "sg:border-transparent sg:bg-primary sg:text-primary-foreground sg:[a&]:hover:bg-primary/90",
|
|
118
|
+
secondary: "sg:border-transparent sg:bg-secondary sg:text-secondary-foreground sg:[a&]:hover:bg-secondary/90",
|
|
119
|
+
destructive: "sg:border-transparent sg:bg-destructive sg:text-white sg:[a&]:hover:bg-destructive/90 sg:focus-visible:ring-destructive/20 sg:dark:focus-visible:ring-destructive/40 sg:dark:bg-destructive/60",
|
|
120
|
+
outline: "sg:text-foreground sg:[a&]:hover:bg-accent sg:[a&]:hover:text-accent-foreground"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
defaultVariants: {
|
|
124
|
+
variant: "default"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
function Badge({
|
|
129
|
+
className,
|
|
130
|
+
variant,
|
|
131
|
+
asChild = false,
|
|
132
|
+
...props
|
|
133
|
+
}) {
|
|
134
|
+
const Comp = asChild ? reactSlot.Slot : "span";
|
|
135
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
136
|
+
Comp,
|
|
137
|
+
{
|
|
138
|
+
"data-slot": "badge",
|
|
139
|
+
className: cn(badgeVariants({ variant }), className),
|
|
140
|
+
...props
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
var Badges = ({ children, className, ...props }) => {
|
|
145
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("sg:flex sg:flex-wrap sg:gap-2", className), ...props, children });
|
|
146
|
+
};
|
|
147
|
+
var buttonVariants = {
|
|
148
|
+
variant: {
|
|
149
|
+
default: "sg:bg-primary sg:text-primary-foreground sg:shadow-xs sg:hover:bg-primary/90",
|
|
150
|
+
destructive: "sg:bg-destructive sg:text-white sg:shadow-xs sg:hover:bg-destructive/90 sg:focus-visible:ring-destructive/20 sg:dark:focus-visible:ring-destructive/40 sg:dark:bg-destructive/60",
|
|
151
|
+
outline: "sg:border sg:border-border sg:shadow-xs sg:hover:bg-accent sg:hover:text-accent-foreground",
|
|
152
|
+
secondary: "sg:bg-secondary sg:text-secondary-foreground sg:shadow-xs sg:hover:bg-secondary/80",
|
|
153
|
+
ghost: "sg:hover:bg-accent sg:hover:text-accent-foreground sg:dark:hover:bg-accent/50",
|
|
154
|
+
link: "sg:text-primary sg:underline-offset-4 sg:hover:underline"
|
|
155
|
+
},
|
|
156
|
+
size: {
|
|
157
|
+
default: "sg:h-9 sg:px-4 sg:py-2 sg:has-[>svg]:px-3",
|
|
158
|
+
sm: "sg:h-8 sg:rounded-md sg:gap-1.5 sg:px-3 sg:has-[>svg]:px-2.5",
|
|
159
|
+
lg: "sg:h-10 sg:rounded-md sg:px-6 sg:has-[>svg]:px-4",
|
|
160
|
+
icon: "sg:size-9"
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
var buttonVariantsProps = classVarianceAuthority.cva(
|
|
164
|
+
"sg:inline-flex sg:items-center sg:justify-center sg:gap-2 sg:whitespace-nowrap sg:cursor-pointer sg:rounded-md sg:text-sm sg:font-medium sg:transition-all sg:disabled:pointer-events-none sg:disabled:opacity-50 sg:[&_svg]:pointer-events-none sg:[&_svg:not([class*=size-])]:size-4 sg:shrink-0 sg:[&_svg]:shrink-0 sg:outline-none sg:focus-visible:border-ring sg:focus-visible:ring-ring/50 sg:focus-visible:ring-[3px] sg:aria-invalid:ring-destructive/20 sg:dark:aria-invalid:ring-destructive/40 sg:aria-invalid:border-destructive",
|
|
165
|
+
{
|
|
166
|
+
variants: buttonVariants,
|
|
167
|
+
defaultVariants: {
|
|
168
|
+
variant: "default",
|
|
169
|
+
size: "default"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
function Button({
|
|
174
|
+
className,
|
|
175
|
+
variant,
|
|
176
|
+
size,
|
|
177
|
+
asChild = false,
|
|
178
|
+
iconStart,
|
|
179
|
+
iconStartAnimate,
|
|
180
|
+
iconEnd,
|
|
181
|
+
iconEndAnimate,
|
|
182
|
+
children,
|
|
183
|
+
...props
|
|
184
|
+
}) {
|
|
185
|
+
const Comp = asChild ? reactSlot.Slot : "button";
|
|
186
|
+
const iconAnimateCss = "sg:animate-spin";
|
|
187
|
+
const LucideIconStart = iconStart && lucideReact.icons[iconStart];
|
|
188
|
+
const LucideIconEnd = iconEnd && lucideReact.icons[iconEnd];
|
|
189
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
190
|
+
Comp,
|
|
191
|
+
{
|
|
192
|
+
"data-slot": "button",
|
|
193
|
+
className: cn(buttonVariantsProps({ variant, size, className })),
|
|
194
|
+
...props,
|
|
195
|
+
children: [
|
|
196
|
+
LucideIconStart && /* @__PURE__ */ jsxRuntime.jsx(
|
|
197
|
+
LucideIconStart,
|
|
198
|
+
{
|
|
199
|
+
className: clsx2__default.default(iconStartAnimate && iconAnimateCss)
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
children,
|
|
203
|
+
LucideIconEnd && /* @__PURE__ */ jsxRuntime.jsx(LucideIconEnd, { className: clsx2__default.default(iconEndAnimate && iconAnimateCss) })
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
) });
|
|
207
|
+
}
|
|
208
|
+
var textElementForeground = {
|
|
209
|
+
default: "sg:text-foreground",
|
|
210
|
+
muted: "sg:text-muted-foreground",
|
|
211
|
+
black: "sg:text-black",
|
|
212
|
+
white: "sg:text-white",
|
|
213
|
+
gray: "sg:text-gray",
|
|
214
|
+
primary: "sg:text-primary",
|
|
215
|
+
secondary: "sg:text-secondary",
|
|
216
|
+
pink: "sg:text-pink",
|
|
217
|
+
orange: "sg:text-orange",
|
|
218
|
+
"primary-to-pink": "sg:bg-gradient-to-r sg:from-[hsl(var(--sg-primary))] sg:to-[hsl(var(--sg-pink))] sg:bg-clip-text sg:text-transparent",
|
|
219
|
+
"pink-to-orange": "sg:bg-gradient-to-r sg:from-[hsl(var(--sg-pink))] sg:to-[hsl(var(--sg-orange))] sg:bg-clip-text sg:text-transparent",
|
|
220
|
+
"multi-color": "sg:bg-gradient-to-r sg:from-[hsl(var(--sg-blue))] sg:via-[hsl(var(--sg-pink))] sg:to-[hsl(var(--sg-orange))] sg:bg-clip-text sg:text-transparent"
|
|
221
|
+
};
|
|
222
|
+
var textElementVariants = {
|
|
223
|
+
size: {
|
|
224
|
+
xs: "sg:text-xs",
|
|
225
|
+
sm: "sg:text-sm",
|
|
226
|
+
md: "sg:text-md",
|
|
227
|
+
base: "sg:text-base",
|
|
228
|
+
lg: "sg:text-lg",
|
|
229
|
+
xl: "sg:text-xl",
|
|
230
|
+
"2xl": "sg:text-2xl",
|
|
231
|
+
"3xl": "sg:text-3xl"
|
|
232
|
+
},
|
|
233
|
+
foreground: textElementForeground,
|
|
234
|
+
fontweight: {
|
|
235
|
+
normal: "sg:font-normal",
|
|
236
|
+
medium: "sg:font-medium",
|
|
237
|
+
semibold: "sg:font-semibold",
|
|
238
|
+
bold: "sg:font-bold"
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
var textElementVariantsProps = classVarianceAuthority.cva("", {
|
|
242
|
+
variants: textElementVariants,
|
|
243
|
+
defaultVariants: {
|
|
244
|
+
size: "base",
|
|
245
|
+
foreground: "default",
|
|
246
|
+
fontweight: "normal"
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
var TextElement = ({
|
|
250
|
+
as = "div",
|
|
251
|
+
children,
|
|
252
|
+
size,
|
|
253
|
+
foreground,
|
|
254
|
+
fontweight,
|
|
255
|
+
className,
|
|
256
|
+
...props
|
|
257
|
+
}) => {
|
|
258
|
+
const Component = as;
|
|
259
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
260
|
+
Component,
|
|
261
|
+
{
|
|
262
|
+
className: cn(
|
|
263
|
+
textElementVariantsProps({
|
|
264
|
+
size,
|
|
265
|
+
foreground,
|
|
266
|
+
fontweight
|
|
267
|
+
}),
|
|
268
|
+
className
|
|
269
|
+
),
|
|
270
|
+
...props,
|
|
271
|
+
children
|
|
272
|
+
}
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
var textHeadingVariants = {
|
|
276
|
+
variant: {
|
|
277
|
+
h1: "sg:text-3xl sg:md:text-4xl sg:lg:text-5xl sg:font-bold sg:tracking-tight",
|
|
278
|
+
h2: "sg:text-xl sg:font-semibold sg:tracking-tight sg:transition-colors sg:first:mt-0 sg:lg:text-3xl",
|
|
279
|
+
h3: "sg:text-xl sg:font-semibold sg:tracking-tight sg:lg:text-2xl",
|
|
280
|
+
h4: "sg:text-lg sg:font-semibold sg:tracking-tight",
|
|
281
|
+
h5: "sg:text-md sg:font-semibold sg:tracking-tight",
|
|
282
|
+
h6: "sg:text-md sg:tracking-tight"
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
var textHeadingVariantsProps = classVarianceAuthority.cva("", {
|
|
286
|
+
variants: textHeadingVariants,
|
|
287
|
+
defaultVariants: {
|
|
288
|
+
variant: "h2"
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
var TextHeading = ({
|
|
292
|
+
children,
|
|
293
|
+
as,
|
|
294
|
+
variant,
|
|
295
|
+
foreground,
|
|
296
|
+
className,
|
|
297
|
+
...props
|
|
298
|
+
}) => {
|
|
299
|
+
if (!as && variant) {
|
|
300
|
+
as = variant;
|
|
301
|
+
} else if (!as) {
|
|
302
|
+
as = "h2";
|
|
303
|
+
}
|
|
304
|
+
const Component = as;
|
|
305
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
306
|
+
Component,
|
|
307
|
+
{
|
|
308
|
+
className: cn(
|
|
309
|
+
textElementVariantsProps({ foreground }),
|
|
310
|
+
textHeadingVariantsProps({ variant }),
|
|
311
|
+
className
|
|
312
|
+
),
|
|
313
|
+
...props,
|
|
314
|
+
children
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
};
|
|
318
|
+
var Card = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
319
|
+
"div",
|
|
320
|
+
{
|
|
321
|
+
ref,
|
|
322
|
+
className: cn(
|
|
323
|
+
"sg:rounded-xl sg:bg-card sg:text-card-foreground sg:group sg:overflow-hidden sg:border-0 sg:bg-gradient-to-br sg:from-background sg:to-background/60 sg:shadow-lg sg:ring-1 sg:ring-gray/60",
|
|
324
|
+
className
|
|
325
|
+
),
|
|
326
|
+
...props
|
|
327
|
+
}
|
|
328
|
+
));
|
|
329
|
+
Card.displayName = "Card";
|
|
330
|
+
var CardHeader = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
331
|
+
"div",
|
|
332
|
+
{
|
|
333
|
+
ref,
|
|
334
|
+
className: cn("sg:flex sg:flex-col sg:space-y-1.5 sg:p-6", className),
|
|
335
|
+
...props
|
|
336
|
+
}
|
|
337
|
+
));
|
|
338
|
+
CardHeader.displayName = "CardHeader";
|
|
339
|
+
var CardTitle = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
340
|
+
"div",
|
|
341
|
+
{
|
|
342
|
+
ref,
|
|
343
|
+
className: cn(
|
|
344
|
+
"sg:font-semibold sg:leading-none sg:tracking-tight",
|
|
345
|
+
className
|
|
346
|
+
),
|
|
347
|
+
...props
|
|
348
|
+
}
|
|
349
|
+
));
|
|
350
|
+
CardTitle.displayName = "CardTitle";
|
|
351
|
+
var CardDescription = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
352
|
+
"div",
|
|
353
|
+
{
|
|
354
|
+
ref,
|
|
355
|
+
className: cn("sg:text-sm sg:text-muted-foreground", className),
|
|
356
|
+
...props
|
|
357
|
+
}
|
|
358
|
+
));
|
|
359
|
+
CardDescription.displayName = "CardDescription";
|
|
360
|
+
var CardImage = React__namespace.forwardRef(
|
|
361
|
+
({ className, src, alt = "", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
362
|
+
"div",
|
|
363
|
+
{
|
|
364
|
+
ref,
|
|
365
|
+
className: cn("sg:relative sg:h-48 sg:overflow-hidden", className),
|
|
366
|
+
...props,
|
|
367
|
+
children: [
|
|
368
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
369
|
+
"img",
|
|
370
|
+
{
|
|
371
|
+
src,
|
|
372
|
+
alt,
|
|
373
|
+
className: "sg:h-full sg:w-full sg:object-cover sg:transition-transform sg:duration-500 sg:group-hover:scale-105",
|
|
374
|
+
loading: "lazy"
|
|
375
|
+
}
|
|
376
|
+
),
|
|
377
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg:absolute sg:inset-0 sg:bg-gradient-to-t sg:from-background/80 sg:to-transparent" })
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
)
|
|
381
|
+
);
|
|
382
|
+
CardImage.displayName = "CardImage";
|
|
383
|
+
var CardContent = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("sg:p-6 sg:pt-0", className), ...props }));
|
|
384
|
+
CardContent.displayName = "CardContent";
|
|
385
|
+
var CardFooter = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
386
|
+
"div",
|
|
387
|
+
{
|
|
388
|
+
ref,
|
|
389
|
+
className: cn("sg:flex sg:items-center sg:p-6 sg:pt-0", className),
|
|
390
|
+
...props
|
|
391
|
+
}
|
|
392
|
+
));
|
|
393
|
+
CardFooter.displayName = "CardFooter";
|
|
394
|
+
var TextSpan = ({
|
|
395
|
+
children,
|
|
396
|
+
size,
|
|
397
|
+
foreground,
|
|
398
|
+
fontweight,
|
|
399
|
+
className,
|
|
400
|
+
...props
|
|
401
|
+
}) => {
|
|
402
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
403
|
+
TextElement,
|
|
404
|
+
{
|
|
405
|
+
as: "span",
|
|
406
|
+
className: cn(
|
|
407
|
+
textElementVariantsProps({
|
|
408
|
+
size,
|
|
409
|
+
foreground,
|
|
410
|
+
fontweight
|
|
411
|
+
}),
|
|
412
|
+
className
|
|
413
|
+
),
|
|
414
|
+
...props,
|
|
415
|
+
children
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
};
|
|
419
|
+
var TextParagraph = ({
|
|
420
|
+
children,
|
|
421
|
+
size,
|
|
422
|
+
foreground,
|
|
423
|
+
fontweight,
|
|
424
|
+
className,
|
|
425
|
+
...props
|
|
426
|
+
}) => {
|
|
427
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
428
|
+
TextElement,
|
|
429
|
+
{
|
|
430
|
+
as: "p",
|
|
431
|
+
className: cn(
|
|
432
|
+
textElementVariantsProps({
|
|
433
|
+
size,
|
|
434
|
+
foreground,
|
|
435
|
+
fontweight
|
|
436
|
+
}),
|
|
437
|
+
className
|
|
438
|
+
),
|
|
439
|
+
...props,
|
|
440
|
+
children
|
|
441
|
+
}
|
|
442
|
+
);
|
|
443
|
+
};
|
|
444
|
+
var iconVariants = {
|
|
445
|
+
size: {
|
|
446
|
+
sm: "",
|
|
447
|
+
md: "",
|
|
448
|
+
lg: ""
|
|
449
|
+
},
|
|
450
|
+
color: {
|
|
451
|
+
default: "",
|
|
452
|
+
black: "sg:text-black",
|
|
453
|
+
white: "sg:text-white",
|
|
454
|
+
gray: "sg:text-gray",
|
|
455
|
+
primary: "sg:text-primary",
|
|
456
|
+
secondary: "sg:text-secondary"
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
var iconVariantsProps = classVarianceAuthority.cva("", {
|
|
460
|
+
variants: iconVariants,
|
|
461
|
+
defaultVariants: {
|
|
462
|
+
size: "md",
|
|
463
|
+
color: "default"
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
function Icon({ className, size, color, icon, spin, ...props }) {
|
|
467
|
+
const LucideIcon2 = lucideReact.icons[icon];
|
|
468
|
+
let iconSize = 20;
|
|
469
|
+
if (size == "sm") {
|
|
470
|
+
iconSize = 16;
|
|
471
|
+
} else if (size == "lg") {
|
|
472
|
+
iconSize = 32;
|
|
473
|
+
}
|
|
474
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
475
|
+
LucideIcon2,
|
|
476
|
+
{
|
|
477
|
+
size: iconSize,
|
|
478
|
+
className: cn(
|
|
479
|
+
iconVariantsProps({ color, className }),
|
|
480
|
+
spin && "sg:animate-spin"
|
|
481
|
+
),
|
|
482
|
+
...props
|
|
483
|
+
}
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// src/lib/helpers/date.ts
|
|
488
|
+
function formatDate(dateInput) {
|
|
489
|
+
if (!dateInput) {
|
|
490
|
+
return "";
|
|
491
|
+
}
|
|
492
|
+
const date = new Date(dateInput);
|
|
493
|
+
const year = date.getFullYear();
|
|
494
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
495
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
496
|
+
return `${year}-${month}-${day}`;
|
|
497
|
+
}
|
|
498
|
+
var getGridColsClass = (cols) => {
|
|
499
|
+
if (!cols) return "";
|
|
500
|
+
const colClasses = [];
|
|
501
|
+
if (cols.default) colClasses.push(`sg:grid-cols-${cols.default}`);
|
|
502
|
+
if (cols.sm) colClasses.push(`sg:sm:grid-cols-${cols.sm}`);
|
|
503
|
+
if (cols.md) colClasses.push(`sg:md:grid-cols-${cols.md}`);
|
|
504
|
+
if (cols.lg) colClasses.push(`sg:lg:grid-cols-${cols.lg}`);
|
|
505
|
+
if (cols.xl) colClasses.push(`sg:xl:grid-cols-${cols.xl}`);
|
|
506
|
+
if (cols["2xl"]) colClasses.push(`sg:2xl:grid-cols-${cols["2xl"]}`);
|
|
507
|
+
return colClasses.join(" ");
|
|
508
|
+
};
|
|
509
|
+
var Cards = ({
|
|
510
|
+
children,
|
|
511
|
+
className,
|
|
512
|
+
cols = { default: 1, sm: 2, lg: 3 },
|
|
513
|
+
...props
|
|
514
|
+
}) => {
|
|
515
|
+
if (!cols.default) {
|
|
516
|
+
cols.default = 1;
|
|
517
|
+
}
|
|
518
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
519
|
+
"div",
|
|
520
|
+
{
|
|
521
|
+
className: cn("sg:grid sg:gap-6", getGridColsClass(cols), className),
|
|
522
|
+
...props,
|
|
523
|
+
children
|
|
524
|
+
}
|
|
525
|
+
);
|
|
526
|
+
};
|
|
527
|
+
function Input({ className, type, ...props }) {
|
|
528
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
529
|
+
"input",
|
|
530
|
+
{
|
|
531
|
+
type,
|
|
532
|
+
"data-slot": "input",
|
|
533
|
+
className: cn(
|
|
534
|
+
"sg:file:text-foreground sg:placeholder:text-muted-foreground sg:selection:bg-primary sg:selection:text-primary-foreground sg:dark:bg-input/30 sg:border-input sg:flex sg:h-9 sg:w-full sg:min-w-0 sg:rounded-md sg:border sg:bg-transparent sg:px-3 sg:py-1 sg:text-base sg:shadow-xs sg:transition-[color,box-shadow] sg:outline-none sg:file:inline-flex sg:file:h-7 sg:file:border-0 sg:file:bg-transparent sg:file:text-sm sg:file:font-medium sg:disabled:pointer-events-none sg:disabled:cursor-not-allowed sg:disabled:opacity-50 sg:md:text-sm",
|
|
535
|
+
"sg:focus-visible:border-ring sg:focus-visible:ring-ring/50 sg:focus-visible:ring-[3px]",
|
|
536
|
+
"sg:aria-invalid:ring-destructive/20 sg:dark:aria-invalid:ring-destructive/40 sg:aria-invalid:border-destructive",
|
|
537
|
+
className
|
|
538
|
+
),
|
|
539
|
+
...props
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
var bgColors = {
|
|
544
|
+
transparent: "sg:bg-transparent",
|
|
545
|
+
white: "sg:bg-white",
|
|
546
|
+
black: "sg:bg-black",
|
|
547
|
+
orange: "sg:bg-orange",
|
|
548
|
+
pink: "sg:bg-pink",
|
|
549
|
+
gradient1: "sg:bg-[linear-gradient(135deg,hsl(var(--sg-primary-light))_0%,hsl(var(--sg-pink))_50%,hsl(var(--sg-orange))_100%)]",
|
|
550
|
+
gradient2: "sg:bg-[radial-gradient(1200px_300px_at_10%_-20%,hsl(var(--sg-gradient-1)/0.15),transparent),radial-gradient(800px_200px_at_90%_-20%,hsl(var(--sg-gradient-2)/0.15),transparent)]",
|
|
551
|
+
"primarylight-pink-orange": "sg:bg-[linear-gradient(135deg,hsl(var(--sg-primary-light)/0.1)_0%,hsl(var(--sg-pink)/0.1)_50%,hsl(var(--sg-orange)/0.1)_100%)]"
|
|
552
|
+
};
|
|
553
|
+
var layoutVariants = {
|
|
554
|
+
type: {
|
|
555
|
+
full: "sg:w-full",
|
|
556
|
+
wide: "sg:w-full sg:px-4",
|
|
557
|
+
col: "sg:mx-auto sg:max-w-[768px] sg:px-4 sg:md:px-0"
|
|
558
|
+
},
|
|
559
|
+
cols: {
|
|
560
|
+
"100": "",
|
|
561
|
+
"66-33": "sg:md:grid-cols-[2fr_1fr]",
|
|
562
|
+
"50-50": "sg:md:grid-cols-2",
|
|
563
|
+
"33-33-33": "sg:md:grid-cols-3",
|
|
564
|
+
"25-25-25-25": "sg:md:grid-cols-4"
|
|
565
|
+
},
|
|
566
|
+
bgColor: bgColors
|
|
567
|
+
};
|
|
568
|
+
var layoutVariantsProps = classVarianceAuthority.cva("sg:grid sg:grid-cols-1 sg:gap-4", {
|
|
569
|
+
variants: layoutVariants,
|
|
570
|
+
defaultVariants: {
|
|
571
|
+
type: "col",
|
|
572
|
+
cols: "100"
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
function Layout({
|
|
576
|
+
children,
|
|
577
|
+
className,
|
|
578
|
+
type,
|
|
579
|
+
cols,
|
|
580
|
+
bgColor,
|
|
581
|
+
as: Component = "div",
|
|
582
|
+
...props
|
|
583
|
+
}) {
|
|
584
|
+
const allowedInLayout = (content) => {
|
|
585
|
+
if (content.type === Layout.Col1) {
|
|
586
|
+
return true;
|
|
587
|
+
} else if (content.type === Layout.Col2 && (cols === "66-33" || cols === "50-50" || cols === "33-33-33" || cols === "25-25-25-25")) {
|
|
588
|
+
return true;
|
|
589
|
+
} else if (content.type === Layout.Col3 && (cols === "33-33-33" || cols === "25-25-25-25")) {
|
|
590
|
+
return true;
|
|
591
|
+
} else if (content.type === Layout.Col4 && cols === "25-25-25-25") {
|
|
592
|
+
return true;
|
|
593
|
+
}
|
|
594
|
+
console.error(
|
|
595
|
+
"Content not allowed in column for variant",
|
|
596
|
+
cols,
|
|
597
|
+
content.type
|
|
598
|
+
);
|
|
599
|
+
return false;
|
|
600
|
+
};
|
|
601
|
+
const renderColumn = (content) => {
|
|
602
|
+
if (!allowedInLayout(content)) {
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
return content;
|
|
606
|
+
};
|
|
607
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
608
|
+
Component,
|
|
609
|
+
{
|
|
610
|
+
...props,
|
|
611
|
+
className: cn(bgColors[bgColor ?? "transparent"], className),
|
|
612
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(layoutVariantsProps({ type, cols })), children: React__namespace.Children.map(
|
|
613
|
+
children,
|
|
614
|
+
(child) => React__namespace.isValidElement(child) ? renderColumn(child) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
615
|
+
) })
|
|
616
|
+
}
|
|
617
|
+
);
|
|
618
|
+
}
|
|
619
|
+
function Col({ children, hideDiv, className, as: Component = "div" }) {
|
|
620
|
+
return hideDiv ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children }) : /* @__PURE__ */ jsxRuntime.jsx(Component, { className, children });
|
|
621
|
+
}
|
|
622
|
+
Layout.Col1 = Col;
|
|
623
|
+
Layout.Col2 = Col;
|
|
624
|
+
Layout.Col3 = Col;
|
|
625
|
+
Layout.Col4 = Col;
|
|
626
|
+
function Skeleton({ className, ...props }) {
|
|
627
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
628
|
+
"div",
|
|
629
|
+
{
|
|
630
|
+
"data-slot": "skeleton",
|
|
631
|
+
className: cn("sg:bg-accent sg:animate-pulse sg:rounded-md", className),
|
|
632
|
+
...props
|
|
633
|
+
}
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
var sizeMap = {
|
|
637
|
+
xs: "sg:h-4 sg:w-4",
|
|
638
|
+
sm: "sg:h-5 sg:w-5",
|
|
639
|
+
md: "sg:h-8 sg:w-8",
|
|
640
|
+
lg: "sg:h-12 sg:w-12"
|
|
641
|
+
};
|
|
642
|
+
function Spinner({
|
|
643
|
+
variant = "ring",
|
|
644
|
+
size = "md",
|
|
645
|
+
className
|
|
646
|
+
}) {
|
|
647
|
+
if (variant === "dots") {
|
|
648
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
649
|
+
"span",
|
|
650
|
+
{
|
|
651
|
+
className: cn("sg:inline-flex sg:items-center sg:gap-1", className),
|
|
652
|
+
"aria-label": "Loading",
|
|
653
|
+
children: [
|
|
654
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
655
|
+
"span",
|
|
656
|
+
{
|
|
657
|
+
className: cn(
|
|
658
|
+
"sg:size-2 sg:rounded-full sg:bg-[hsl(var(--sg-gradient-1))] sg:animate-pulse",
|
|
659
|
+
"[animation-delay:-200ms]"
|
|
660
|
+
)
|
|
661
|
+
}
|
|
662
|
+
),
|
|
663
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
664
|
+
"span",
|
|
665
|
+
{
|
|
666
|
+
className: cn(
|
|
667
|
+
"sg:size-2 sg:rounded-full sg:bg-[hsl(var(--sg-gradient-2))] sg:animate-pulse",
|
|
668
|
+
"[animation-delay:-100ms]"
|
|
669
|
+
)
|
|
670
|
+
}
|
|
671
|
+
),
|
|
672
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
673
|
+
"span",
|
|
674
|
+
{
|
|
675
|
+
className: cn(
|
|
676
|
+
"sg:size-2 sg:rounded-full sg:bg-primary sg:animate-pulse"
|
|
677
|
+
)
|
|
678
|
+
}
|
|
679
|
+
)
|
|
680
|
+
]
|
|
681
|
+
}
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
685
|
+
"span",
|
|
686
|
+
{
|
|
687
|
+
role: "status",
|
|
688
|
+
"aria-label": "Loading",
|
|
689
|
+
className: cn(
|
|
690
|
+
"sg:relative sg:inline-block sg:align-[-0.125em]",
|
|
691
|
+
sizeMap[size],
|
|
692
|
+
className
|
|
693
|
+
),
|
|
694
|
+
children: [
|
|
695
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
696
|
+
"span",
|
|
697
|
+
{
|
|
698
|
+
className: cn(
|
|
699
|
+
"sg:absolute sg:inset-0 sg:animate-spin sg:rounded-full",
|
|
700
|
+
"sg:bg-[conic-gradient(hsl(var(--sg-gradient-1)),hsl(var(--sg-gradient-2)),hsl(var(--sg-primary)),hsl(var(--sg-gradient-1)))]",
|
|
701
|
+
"sg:[mask:radial-gradient(farthest-side,transparent_62%,black_63%)]"
|
|
702
|
+
)
|
|
703
|
+
}
|
|
704
|
+
),
|
|
705
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg:absolute sg:inset-[18%] sg:rounded-full sg:bg-background" })
|
|
706
|
+
]
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
var stackVariants = classVarianceAuthority.cva("sg:flex sg:flex-col", {
|
|
711
|
+
variants: {
|
|
712
|
+
gap: {
|
|
713
|
+
0: "",
|
|
714
|
+
1: "sg:gap-1",
|
|
715
|
+
2: "sg:gap-2",
|
|
716
|
+
3: "sg:gap-3",
|
|
717
|
+
4: "sg:gap-4",
|
|
718
|
+
5: "sg:gap-5",
|
|
719
|
+
6: "sg:gap-6",
|
|
720
|
+
7: "sg:gap-7",
|
|
721
|
+
8: "sg:gap-8",
|
|
722
|
+
9: "sg:gap-9",
|
|
723
|
+
10: "sg:gap-10"
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
defaultVariants: {
|
|
727
|
+
gap: 0
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
var Stack = React__namespace.forwardRef(
|
|
731
|
+
({ className, gap, asChild = false, ...props }, ref) => {
|
|
732
|
+
const Comp = asChild ? reactSlot.Slot : "div";
|
|
733
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
734
|
+
Comp,
|
|
735
|
+
{
|
|
736
|
+
className: cn(stackVariants({ gap }), className),
|
|
737
|
+
ref,
|
|
738
|
+
...props
|
|
739
|
+
}
|
|
740
|
+
);
|
|
741
|
+
}
|
|
742
|
+
);
|
|
743
|
+
Stack.displayName = "Stack";
|
|
744
|
+
var TextDiv = ({
|
|
745
|
+
children,
|
|
746
|
+
size,
|
|
747
|
+
foreground,
|
|
748
|
+
fontweight,
|
|
749
|
+
className,
|
|
750
|
+
...props
|
|
751
|
+
}) => {
|
|
752
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
753
|
+
TextElement,
|
|
754
|
+
{
|
|
755
|
+
as: "div",
|
|
756
|
+
className: cn(
|
|
757
|
+
textElementVariantsProps({
|
|
758
|
+
size,
|
|
759
|
+
foreground,
|
|
760
|
+
fontweight
|
|
761
|
+
}),
|
|
762
|
+
className
|
|
763
|
+
),
|
|
764
|
+
...props,
|
|
765
|
+
children
|
|
766
|
+
}
|
|
767
|
+
);
|
|
768
|
+
};
|
|
769
|
+
var TextTime = ({
|
|
770
|
+
children,
|
|
771
|
+
size,
|
|
772
|
+
foreground,
|
|
773
|
+
fontweight,
|
|
774
|
+
className,
|
|
775
|
+
...props
|
|
776
|
+
}) => {
|
|
777
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
778
|
+
TextElement,
|
|
779
|
+
{
|
|
780
|
+
as: "time",
|
|
781
|
+
className: cn(
|
|
782
|
+
textElementVariantsProps({
|
|
783
|
+
size,
|
|
784
|
+
foreground,
|
|
785
|
+
fontweight
|
|
786
|
+
}),
|
|
787
|
+
className
|
|
788
|
+
),
|
|
789
|
+
...props,
|
|
790
|
+
children
|
|
791
|
+
}
|
|
792
|
+
);
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
exports.Alert = Alert;
|
|
796
|
+
exports.AlertDescription = AlertDescription;
|
|
797
|
+
exports.AlertTitle = AlertTitle;
|
|
798
|
+
exports.Badge = Badge;
|
|
799
|
+
exports.Badges = Badges;
|
|
800
|
+
exports.Button = Button;
|
|
801
|
+
exports.Card = Card;
|
|
802
|
+
exports.CardContent = CardContent;
|
|
803
|
+
exports.CardDescription = CardDescription;
|
|
804
|
+
exports.CardFooter = CardFooter;
|
|
805
|
+
exports.CardHeader = CardHeader;
|
|
806
|
+
exports.CardImage = CardImage;
|
|
807
|
+
exports.CardTitle = CardTitle;
|
|
808
|
+
exports.Cards = Cards;
|
|
809
|
+
exports.Icon = Icon;
|
|
810
|
+
exports.Input = Input;
|
|
811
|
+
exports.Layout = Layout;
|
|
812
|
+
exports.Skeleton = Skeleton;
|
|
813
|
+
exports.Spinner = Spinner;
|
|
814
|
+
exports.Stack = Stack;
|
|
815
|
+
exports.TextDiv = TextDiv;
|
|
816
|
+
exports.TextHeading = TextHeading;
|
|
817
|
+
exports.TextParagraph = TextParagraph;
|
|
818
|
+
exports.TextSpan = TextSpan;
|
|
819
|
+
exports.TextTime = TextTime;
|
|
820
|
+
exports.alertVariants = alertVariants;
|
|
821
|
+
exports.badgeVariants = badgeVariants;
|
|
822
|
+
exports.buttonVariants = buttonVariants;
|
|
823
|
+
exports.buttonVariantsProps = buttonVariantsProps;
|
|
824
|
+
exports.formatDate = formatDate;
|
|
825
|
+
exports.getGridColsClass = getGridColsClass;
|
|
826
|
+
exports.iconVariants = iconVariants;
|
|
827
|
+
exports.iconVariantsProps = iconVariantsProps;
|
|
828
|
+
exports.layoutVariants = layoutVariants;
|
|
829
|
+
exports.layoutVariantsProps = layoutVariantsProps;
|
|
830
|
+
exports.stackVariants = stackVariants;
|
|
831
|
+
exports.textHeadingVariants = textHeadingVariants;
|
|
832
|
+
exports.textHeadingVariantsProps = textHeadingVariantsProps;
|
|
833
|
+
//# sourceMappingURL=ssr.cjs.map
|
|
834
|
+
//# sourceMappingURL=ssr.cjs.map
|