@pol-studios/ui 1.0.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/adapters/index.js +359 -0
- package/dist/auth/index.js +588 -0
- package/dist/canvas-UVNDA54X.node +0 -0
- package/dist/cards/index.js +872 -0
- package/dist/charts/index.js +54148 -0
- package/dist/components/chat-agent/index.js +21434 -0
- package/dist/components/index.js +148416 -0
- package/dist/contexts/index.js +188 -0
- package/dist/crud/index.js +6550 -0
- package/dist/data/index.js +372 -0
- package/dist/feedback/index.js +9534 -0
- package/dist/file/index.js +256 -0
- package/dist/forms/index.js +504 -0
- package/dist/hooks/index.js +345 -0
- package/dist/index.js +15650 -0
- package/dist/nav/index.js +1556 -0
- package/dist/navbar/index.js +45262 -0
- package/dist/primitives/index.js +15646 -0
- package/dist/providers/index.js +1927 -0
- package/dist/types/index.js +1 -0
- package/package.json +226 -0
- package/src/styles/globals.css +157 -0
|
@@ -0,0 +1,872 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/cards/card.tsx
|
|
4
|
+
import { cn } from "@pol-studios/utils";
|
|
5
|
+
import { motion } from "framer-motion";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var Card = ({
|
|
8
|
+
children,
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
motion.div,
|
|
14
|
+
{
|
|
15
|
+
whileHover: "animate",
|
|
16
|
+
className: cn(
|
|
17
|
+
"isolate flex flex-col border border-muted-200 rounded-2xl bg-muted-100 shadow-[0_1px_1px_rgba(0,0,0,0.05),0_4px_6px_rgba(34,42,53,0.04),0_24px_68px_rgba(47,48,55,0.05),0_2px_3px_rgba(0,0,0,0.04)] overflow-hidden",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
...props,
|
|
21
|
+
children
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
var card_default = Card;
|
|
26
|
+
|
|
27
|
+
// src/cards/card-content.tsx
|
|
28
|
+
import { cn as cn2 } from "@pol-studios/utils";
|
|
29
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
30
|
+
var CardContent = ({
|
|
31
|
+
children,
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}) => {
|
|
35
|
+
return /* @__PURE__ */ jsx2("div", { className: cn2("px-3 pb-5 ", className), ...props, children });
|
|
36
|
+
};
|
|
37
|
+
var card_content_default = CardContent;
|
|
38
|
+
|
|
39
|
+
// src/cards/card-description.tsx
|
|
40
|
+
import { cn as cn3 } from "@pol-studios/utils";
|
|
41
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
42
|
+
var CardDescription = ({
|
|
43
|
+
children,
|
|
44
|
+
className
|
|
45
|
+
}) => {
|
|
46
|
+
return /* @__PURE__ */ jsx3(
|
|
47
|
+
"p",
|
|
48
|
+
{
|
|
49
|
+
className: cn3(
|
|
50
|
+
"font-sans max-w-xs text-base font-normal tracking-tight text-text-500 ",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
children
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
var card_description_default = CardDescription;
|
|
58
|
+
|
|
59
|
+
// src/cards/card-header.tsx
|
|
60
|
+
import { cn as cn4 } from "@pol-studios/utils";
|
|
61
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
62
|
+
var CardHeader = ({
|
|
63
|
+
children,
|
|
64
|
+
className,
|
|
65
|
+
...props
|
|
66
|
+
}) => {
|
|
67
|
+
return /* @__PURE__ */ jsx4("div", { className: cn4("px-5 py-3", className), ...props, children });
|
|
68
|
+
};
|
|
69
|
+
var card_header_default = CardHeader;
|
|
70
|
+
|
|
71
|
+
// src/cards/card-row.tsx
|
|
72
|
+
import { cn as cn12 } from "@pol-studios/utils";
|
|
73
|
+
|
|
74
|
+
// src/animate-primitives/primitives/radix/tooltip.tsx
|
|
75
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
76
|
+
import {
|
|
77
|
+
AnimatePresence,
|
|
78
|
+
motion as motion2,
|
|
79
|
+
useMotionValue,
|
|
80
|
+
useSpring
|
|
81
|
+
} from "motion/react";
|
|
82
|
+
|
|
83
|
+
// src/lib/get-strict-context.tsx
|
|
84
|
+
import * as React from "react";
|
|
85
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
86
|
+
function getStrictContext(name) {
|
|
87
|
+
const Context = React.createContext(null);
|
|
88
|
+
Context.displayName = name;
|
|
89
|
+
function Provider({ value, children }) {
|
|
90
|
+
return /* @__PURE__ */ jsx5(Context.Provider, { value, children });
|
|
91
|
+
}
|
|
92
|
+
function useContext2() {
|
|
93
|
+
const context = React.useContext(Context);
|
|
94
|
+
if (context === null) {
|
|
95
|
+
throw new Error(`${name} must be used within its provider`);
|
|
96
|
+
}
|
|
97
|
+
return context;
|
|
98
|
+
}
|
|
99
|
+
return [Provider, useContext2];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// src/hooks/use-controlled-state.tsx
|
|
103
|
+
import * as React2 from "react";
|
|
104
|
+
function useControlledState(props) {
|
|
105
|
+
const { value, defaultValue, onChange } = props;
|
|
106
|
+
const [state, setInternalState] = React2.useState(
|
|
107
|
+
value !== void 0 ? value : defaultValue
|
|
108
|
+
);
|
|
109
|
+
React2.useEffect(() => {
|
|
110
|
+
if (value !== void 0) setInternalState(value);
|
|
111
|
+
}, [value]);
|
|
112
|
+
const setState = React2.useCallback(
|
|
113
|
+
(next, ...args) => {
|
|
114
|
+
setInternalState(next);
|
|
115
|
+
onChange?.(next, ...args);
|
|
116
|
+
},
|
|
117
|
+
[onChange]
|
|
118
|
+
);
|
|
119
|
+
return [state, setState];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// src/animate-primitives/primitives/radix/tooltip.tsx
|
|
123
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
124
|
+
var [LocalTooltipProvider, useTooltip] = getStrictContext("TooltipContext");
|
|
125
|
+
function TooltipProvider(props) {
|
|
126
|
+
return /* @__PURE__ */ jsx6(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", ...props });
|
|
127
|
+
}
|
|
128
|
+
function Tooltip({
|
|
129
|
+
followCursor = false,
|
|
130
|
+
followCursorSpringOptions = { stiffness: 200, damping: 17 },
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
const [isOpen, setIsOpen] = useControlledState({
|
|
134
|
+
value: props?.open,
|
|
135
|
+
defaultValue: props?.defaultOpen,
|
|
136
|
+
onChange: props?.onOpenChange
|
|
137
|
+
});
|
|
138
|
+
const x = useMotionValue(0);
|
|
139
|
+
const y2 = useMotionValue(0);
|
|
140
|
+
return /* @__PURE__ */ jsx6(
|
|
141
|
+
LocalTooltipProvider,
|
|
142
|
+
{
|
|
143
|
+
value: {
|
|
144
|
+
isOpen,
|
|
145
|
+
setIsOpen,
|
|
146
|
+
x,
|
|
147
|
+
y: y2,
|
|
148
|
+
followCursor,
|
|
149
|
+
followCursorSpringOptions
|
|
150
|
+
},
|
|
151
|
+
children: /* @__PURE__ */ jsx6(
|
|
152
|
+
TooltipPrimitive.Root,
|
|
153
|
+
{
|
|
154
|
+
"data-slot": "tooltip",
|
|
155
|
+
...props,
|
|
156
|
+
onOpenChange: setIsOpen
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
function TooltipTrigger({ onMouseMove, ...props }) {
|
|
163
|
+
const { x, y: y2, followCursor } = useTooltip();
|
|
164
|
+
const handleMouseMove = (event) => {
|
|
165
|
+
onMouseMove?.(event);
|
|
166
|
+
const target = event.currentTarget.getBoundingClientRect();
|
|
167
|
+
if (followCursor === "x" || followCursor === true) {
|
|
168
|
+
const eventOffsetX = event.clientX - target.left;
|
|
169
|
+
const offsetXFromCenter = (eventOffsetX - target.width / 2) / 2;
|
|
170
|
+
x.set(offsetXFromCenter);
|
|
171
|
+
}
|
|
172
|
+
if (followCursor === "y" || followCursor === true) {
|
|
173
|
+
const eventOffsetY = event.clientY - target.top;
|
|
174
|
+
const offsetYFromCenter = (eventOffsetY - target.height / 2) / 2;
|
|
175
|
+
y2.set(offsetYFromCenter);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
return /* @__PURE__ */ jsx6(
|
|
179
|
+
TooltipPrimitive.Trigger,
|
|
180
|
+
{
|
|
181
|
+
"data-slot": "tooltip-trigger",
|
|
182
|
+
onMouseMove: handleMouseMove,
|
|
183
|
+
...props
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
function TooltipPortal(props) {
|
|
188
|
+
const { isOpen } = useTooltip();
|
|
189
|
+
return /* @__PURE__ */ jsx6(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx6(
|
|
190
|
+
TooltipPrimitive.Portal,
|
|
191
|
+
{
|
|
192
|
+
forceMount: true,
|
|
193
|
+
"data-slot": "tooltip-portal",
|
|
194
|
+
...props
|
|
195
|
+
}
|
|
196
|
+
) });
|
|
197
|
+
}
|
|
198
|
+
function TooltipContent({
|
|
199
|
+
onEscapeKeyDown,
|
|
200
|
+
onPointerDownOutside,
|
|
201
|
+
side,
|
|
202
|
+
sideOffset,
|
|
203
|
+
align,
|
|
204
|
+
alignOffset,
|
|
205
|
+
avoidCollisions,
|
|
206
|
+
collisionBoundary,
|
|
207
|
+
collisionPadding,
|
|
208
|
+
arrowPadding,
|
|
209
|
+
sticky,
|
|
210
|
+
hideWhenDetached,
|
|
211
|
+
style,
|
|
212
|
+
transition = { type: "spring", stiffness: 300, damping: 25 },
|
|
213
|
+
...props
|
|
214
|
+
}) {
|
|
215
|
+
const { x, y: y2, followCursor, followCursorSpringOptions } = useTooltip();
|
|
216
|
+
const translateX = useSpring(x, followCursorSpringOptions);
|
|
217
|
+
const translateY = useSpring(y2, followCursorSpringOptions);
|
|
218
|
+
return /* @__PURE__ */ jsx6(
|
|
219
|
+
TooltipPrimitive.Content,
|
|
220
|
+
{
|
|
221
|
+
asChild: true,
|
|
222
|
+
forceMount: true,
|
|
223
|
+
align,
|
|
224
|
+
alignOffset,
|
|
225
|
+
side,
|
|
226
|
+
sideOffset,
|
|
227
|
+
avoidCollisions,
|
|
228
|
+
collisionBoundary,
|
|
229
|
+
collisionPadding,
|
|
230
|
+
arrowPadding,
|
|
231
|
+
sticky,
|
|
232
|
+
hideWhenDetached,
|
|
233
|
+
onEscapeKeyDown,
|
|
234
|
+
onPointerDownOutside,
|
|
235
|
+
children: /* @__PURE__ */ jsx6(
|
|
236
|
+
motion2.div,
|
|
237
|
+
{
|
|
238
|
+
"data-slot": "popover-content",
|
|
239
|
+
initial: { opacity: 0, scale: 0.5 },
|
|
240
|
+
animate: { opacity: 1, scale: 1 },
|
|
241
|
+
exit: { opacity: 0, scale: 0.5 },
|
|
242
|
+
transition,
|
|
243
|
+
style: {
|
|
244
|
+
x: followCursor === "x" || followCursor === true ? translateX : void 0,
|
|
245
|
+
y: followCursor === "y" || followCursor === true ? translateY : void 0,
|
|
246
|
+
...style
|
|
247
|
+
},
|
|
248
|
+
...props
|
|
249
|
+
},
|
|
250
|
+
"popover-content"
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
function TooltipArrow(props) {
|
|
256
|
+
return /* @__PURE__ */ jsx6(TooltipPrimitive.Arrow, { "data-slot": "tooltip-arrow", ...props });
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// src/animate-primitives/components/radix/tooltip.tsx
|
|
260
|
+
import { cn as cn5 } from "@pol-studios/utils/tailwind";
|
|
261
|
+
import { jsx as jsx7, jsxs } from "react/jsx-runtime";
|
|
262
|
+
function TooltipProvider2({
|
|
263
|
+
delayDuration = 0,
|
|
264
|
+
...props
|
|
265
|
+
}) {
|
|
266
|
+
return /* @__PURE__ */ jsx7(TooltipProvider, { delayDuration, ...props });
|
|
267
|
+
}
|
|
268
|
+
function Tooltip2({ delayDuration = 0, ...props }) {
|
|
269
|
+
return /* @__PURE__ */ jsx7(TooltipProvider2, { delayDuration, children: /* @__PURE__ */ jsx7(Tooltip, { ...props }) });
|
|
270
|
+
}
|
|
271
|
+
function TooltipTrigger2({ ...props }) {
|
|
272
|
+
return /* @__PURE__ */ jsx7(TooltipTrigger, { ...props });
|
|
273
|
+
}
|
|
274
|
+
function TooltipContent2({
|
|
275
|
+
className,
|
|
276
|
+
sideOffset = 4,
|
|
277
|
+
children,
|
|
278
|
+
...props
|
|
279
|
+
}) {
|
|
280
|
+
return /* @__PURE__ */ jsx7(TooltipPortal, { children: /* @__PURE__ */ jsxs(
|
|
281
|
+
TooltipContent,
|
|
282
|
+
{
|
|
283
|
+
sideOffset,
|
|
284
|
+
className: cn5(
|
|
285
|
+
"bg-foreground text-background z-50 w-fit origin-[var(--radix-tooltip-content-transform-origin)] rounded-md px-3 py-1.5 text-xs text-balance animate-in fade-in-0 zoom-in-[0.98] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-[0.98]",
|
|
286
|
+
className
|
|
287
|
+
),
|
|
288
|
+
...props,
|
|
289
|
+
children: [
|
|
290
|
+
children,
|
|
291
|
+
/* @__PURE__ */ jsx7(TooltipArrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
) });
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// src/components/Skeleton.tsx
|
|
298
|
+
import { cn as cn7 } from "@pol-studios/utils";
|
|
299
|
+
import React4 from "react";
|
|
300
|
+
|
|
301
|
+
// src/primitives/skeleton.tsx
|
|
302
|
+
import * as React3 from "react";
|
|
303
|
+
import { cn as cn6 } from "@pol-studios/utils";
|
|
304
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
305
|
+
var Skeleton = React3.forwardRef(({ className, ...props }, ref) => {
|
|
306
|
+
return /* @__PURE__ */ jsx8(
|
|
307
|
+
"div",
|
|
308
|
+
{
|
|
309
|
+
ref,
|
|
310
|
+
className: cn6("animate-pulse rounded-md bg-muted", className),
|
|
311
|
+
...props
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
});
|
|
315
|
+
Skeleton.displayName = "Skeleton";
|
|
316
|
+
|
|
317
|
+
// src/components/Skeleton.tsx
|
|
318
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
319
|
+
var Skeleton2 = React4.forwardRef(
|
|
320
|
+
({ ...props }, ref) => {
|
|
321
|
+
return /* @__PURE__ */ jsx9(
|
|
322
|
+
Skeleton,
|
|
323
|
+
{
|
|
324
|
+
ref,
|
|
325
|
+
...props,
|
|
326
|
+
className: cn7("h-full w-full bg-sky-100", props.className)
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
);
|
|
331
|
+
Skeleton2.displayName = "Skeleton";
|
|
332
|
+
var Skeleton_default = Skeleton2;
|
|
333
|
+
|
|
334
|
+
// src/components/Tooltip.tsx
|
|
335
|
+
import { cn as cn8 } from "@pol-studios/utils";
|
|
336
|
+
import { isUsable } from "@pol-studios/utils/types";
|
|
337
|
+
import * as RadixTooltipPrimitive from "@radix-ui/react-tooltip";
|
|
338
|
+
import { jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
339
|
+
function Tooltip3({
|
|
340
|
+
children,
|
|
341
|
+
tooltipContent,
|
|
342
|
+
contentClassName,
|
|
343
|
+
isOpen,
|
|
344
|
+
onOpenChange,
|
|
345
|
+
contentProps,
|
|
346
|
+
delay,
|
|
347
|
+
triggerClassName,
|
|
348
|
+
tooltipAsChild = true
|
|
349
|
+
}) {
|
|
350
|
+
if (isUsable(tooltipContent) === false || tooltipContent === false) {
|
|
351
|
+
return children;
|
|
352
|
+
}
|
|
353
|
+
return /* @__PURE__ */ jsx10(TooltipProvider2, { delayDuration: delay ?? 300, children: /* @__PURE__ */ jsxs2(Tooltip2, { open: isOpen, onOpenChange, children: [
|
|
354
|
+
/* @__PURE__ */ jsx10(TooltipTrigger2, { className: triggerClassName, asChild: tooltipAsChild, children }),
|
|
355
|
+
/* @__PURE__ */ jsx10(RadixTooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx10(
|
|
356
|
+
TooltipContent2,
|
|
357
|
+
{
|
|
358
|
+
className: cn8("backdrop-blur-lg", contentClassName),
|
|
359
|
+
...contentProps ?? {},
|
|
360
|
+
children: tooltipContent
|
|
361
|
+
}
|
|
362
|
+
) })
|
|
363
|
+
] }) });
|
|
364
|
+
}
|
|
365
|
+
var Tooltip_default = Tooltip3;
|
|
366
|
+
|
|
367
|
+
// src/components/Heading.tsx
|
|
368
|
+
import { cn as cn9 } from "@pol-studios/utils";
|
|
369
|
+
|
|
370
|
+
// ../../../node_modules/.pnpm/react-wrap-balancer@1.1.1_react@19.1.1/node_modules/react-wrap-balancer/dist/index.mjs
|
|
371
|
+
import a from "react";
|
|
372
|
+
import p from "react";
|
|
373
|
+
var E = typeof window == "undefined";
|
|
374
|
+
var m = E ? p.useEffect : p.useLayoutEffect;
|
|
375
|
+
var B = 0;
|
|
376
|
+
var _ = () => ++B;
|
|
377
|
+
var v = false;
|
|
378
|
+
function O() {
|
|
379
|
+
let [n, r] = p.useState(v ? _ : void 0);
|
|
380
|
+
return m(() => {
|
|
381
|
+
n === void 0 && r(_()), v = true;
|
|
382
|
+
}, []), n === void 0 ? n : `rwb-${n.toString(32)}`;
|
|
383
|
+
}
|
|
384
|
+
function R() {
|
|
385
|
+
return p.useMemo(() => "useId" in p ? p.useId : O, [])();
|
|
386
|
+
}
|
|
387
|
+
var y = "__wrap_b";
|
|
388
|
+
var f = "__wrap_n";
|
|
389
|
+
var S = "__wrap_o";
|
|
390
|
+
var T = (n, r, e) => {
|
|
391
|
+
e = e || document.querySelector(`[data-br="${n}"]`);
|
|
392
|
+
let t = e == null ? void 0 : e.parentElement;
|
|
393
|
+
if (!t) return;
|
|
394
|
+
let l = (u) => e.style.maxWidth = u + "px";
|
|
395
|
+
e.style.maxWidth = "";
|
|
396
|
+
let i = t.clientWidth, d = t.clientHeight, o = i / 2 - 0.25, s = i + 0.5, c;
|
|
397
|
+
if (i) {
|
|
398
|
+
for (l(o), o = Math.max(e.scrollWidth, o); o + 1 < s; ) c = Math.round((o + s) / 2), l(c), t.clientHeight === d ? s = c : o = c;
|
|
399
|
+
l(s * r + i * (1 - r));
|
|
400
|
+
}
|
|
401
|
+
e.__wrap_o || (typeof ResizeObserver != "undefined" ? (e.__wrap_o = new ResizeObserver(() => {
|
|
402
|
+
self.__wrap_b(0, +e.dataset.brr, e);
|
|
403
|
+
})).observe(t) : process.env.NODE_ENV === "development" && console.warn("The browser you are using does not support the ResizeObserver API. Please consider add polyfill for this API to avoid potential layout shifts or upgrade your browser. Read more: https://github.com/shuding/react-wrap-balancer#browser-support-information"));
|
|
404
|
+
};
|
|
405
|
+
var I = T.toString();
|
|
406
|
+
var w = '(self.CSS&&CSS.supports("text-wrap","balance")?1:2)';
|
|
407
|
+
var g = (n, r, e = "") => (e && (e = `self.${f}!=1&&${e}`), a.createElement("script", { suppressHydrationWarning: true, dangerouslySetInnerHTML: { __html: (n ? "" : `self.${f}=self.${f}||${w};self.${y}=${I};`) + e }, nonce: r }));
|
|
408
|
+
var h = a.createContext({ preferNative: true, hasProvider: false });
|
|
409
|
+
var P = a.forwardRef(({ ratio: n = 1, preferNative: r, nonce: e, children: t, as: l, ...i }, d) => {
|
|
410
|
+
let o = R(), s = a.useRef(), c = a.useContext(h), u = r != null ? r : c.preferNative, x = l || "span";
|
|
411
|
+
return a.useImperativeHandle(d, () => s.current, []), m(() => {
|
|
412
|
+
u && self[f] === 1 || s.current && (self[y] = T)(0, n, s.current);
|
|
413
|
+
}, [t, u, n]), m(() => {
|
|
414
|
+
if (!(u && self[f] === 1)) return () => {
|
|
415
|
+
if (!s.current) return;
|
|
416
|
+
let b = s.current[S];
|
|
417
|
+
b && (b.disconnect(), delete s.current[S]);
|
|
418
|
+
};
|
|
419
|
+
}, [u]), process.env.NODE_ENV === "development" && t && !Array.isArray(t) && typeof t == "object" && "type" in t && typeof t.type == "string" && t.type !== "span" && console.warn(`<Balancer> should not wrap <${t.type}> inside. Instead, it should directly wrap text or inline nodes.
|
|
420
|
+
|
|
421
|
+
Try changing this:
|
|
422
|
+
<Balancer><${t.type}>content</${t.type}></Balancer>
|
|
423
|
+
To:
|
|
424
|
+
<${t.type}><Balancer>content</Balancer></${t.type}>`), a.createElement(a.Fragment, null, a.createElement(x, { ...i, "data-br": o, "data-brr": n, ref: s, style: { display: "inline-block", verticalAlign: "top", textDecoration: "inherit", textWrap: u ? "balance" : "initial" }, suppressHydrationWarning: true }, t), g(c.hasProvider, e, `self.${y}("${o}",${n})`));
|
|
425
|
+
});
|
|
426
|
+
if (!E && process.env.NODE_ENV !== "production") {
|
|
427
|
+
let n = document.querySelector("[data-next-hide-fouc]");
|
|
428
|
+
if (n) {
|
|
429
|
+
let r = (t) => {
|
|
430
|
+
for (let l of t) for (let i of Array.from(l.removedNodes)) {
|
|
431
|
+
if (i !== n) continue;
|
|
432
|
+
e.disconnect();
|
|
433
|
+
let d = document.querySelectorAll("[data-br]");
|
|
434
|
+
for (let o of Array.from(d)) self[y](0, +o.dataset.brr, o);
|
|
435
|
+
}
|
|
436
|
+
}, e = new MutationObserver(r);
|
|
437
|
+
e.observe(document.head, { childList: true });
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
var A = P;
|
|
441
|
+
|
|
442
|
+
// src/components/Heading.tsx
|
|
443
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
444
|
+
var Heading = ({
|
|
445
|
+
className,
|
|
446
|
+
as: Tag = "h2",
|
|
447
|
+
children,
|
|
448
|
+
size = "large",
|
|
449
|
+
...props
|
|
450
|
+
}) => {
|
|
451
|
+
const sizeVariants = {
|
|
452
|
+
sm: "text-large md:text-xl md:leading-snug",
|
|
453
|
+
md: "text-xl md:text-2xl md:leading-tight",
|
|
454
|
+
large: "text-2xl md:text-3xl md:leading-tight",
|
|
455
|
+
xl: "text-3xl md:text-4xl md:leading-none",
|
|
456
|
+
"2xl": "text-4xl md:text-5xl md:leading-none"
|
|
457
|
+
};
|
|
458
|
+
return /* @__PURE__ */ jsx11(
|
|
459
|
+
Tag,
|
|
460
|
+
{
|
|
461
|
+
className: cn9(
|
|
462
|
+
"mt-2 text-2xl/7 font-bold text-muted-900 sm:truncate sm:text-3xl sm:tracking-tight",
|
|
463
|
+
sizeVariants[size],
|
|
464
|
+
className
|
|
465
|
+
),
|
|
466
|
+
...props,
|
|
467
|
+
children: /* @__PURE__ */ jsx11(A, { children })
|
|
468
|
+
}
|
|
469
|
+
);
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
// src/components/PolIcon.tsx
|
|
473
|
+
import { cn as cn10, isUsable as isUsable2 } from "@pol-studios/utils";
|
|
474
|
+
import { useLayoutEffect, useState as useState2 } from "react";
|
|
475
|
+
import React5 from "react";
|
|
476
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
477
|
+
var PolIcon = React5.forwardRef(
|
|
478
|
+
({
|
|
479
|
+
toolTip: tooltip,
|
|
480
|
+
name,
|
|
481
|
+
source = "lucide",
|
|
482
|
+
isIconFilled = false,
|
|
483
|
+
className,
|
|
484
|
+
size = "1.5rem",
|
|
485
|
+
toolTipContentProps,
|
|
486
|
+
...props
|
|
487
|
+
}, ref) => {
|
|
488
|
+
let icon = null;
|
|
489
|
+
if (source == "lucide") {
|
|
490
|
+
icon = /* @__PURE__ */ jsx12(
|
|
491
|
+
LucideIconLoader,
|
|
492
|
+
{
|
|
493
|
+
ref,
|
|
494
|
+
name,
|
|
495
|
+
className: cn10(className, "b-0 icon-hover-effect"),
|
|
496
|
+
style: { fontSize: size },
|
|
497
|
+
size,
|
|
498
|
+
...props,
|
|
499
|
+
"data-testid": props["data-testid"] ?? name + "Icon"
|
|
500
|
+
}
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
if (isUsable2(tooltip)) {
|
|
504
|
+
return /* @__PURE__ */ jsx12(Tooltip_default, { tooltipContent: tooltip, contentProps: toolTipContentProps, children: icon });
|
|
505
|
+
} else {
|
|
506
|
+
return icon;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
var PolIcon_default = PolIcon;
|
|
511
|
+
var modulePromise = import("lucide-react");
|
|
512
|
+
var module = null;
|
|
513
|
+
modulePromise.then((x) => module = x);
|
|
514
|
+
var LucideIconLoader = React5.forwardRef(
|
|
515
|
+
({ name, ...props }, ref) => {
|
|
516
|
+
const [IconComponent, setIconComponent] = useState2(module === null ? null : module[name]);
|
|
517
|
+
const [isLoaded, setIsLoaded] = useState2(module !== null);
|
|
518
|
+
useLayoutEffect(() => {
|
|
519
|
+
setIconComponent(null);
|
|
520
|
+
modulePromise.then((x) => setIsLoaded(true));
|
|
521
|
+
if (isLoaded === false) return;
|
|
522
|
+
if (name in module) {
|
|
523
|
+
const Icon = module[name];
|
|
524
|
+
setIconComponent(() => Icon);
|
|
525
|
+
} else {
|
|
526
|
+
setIconComponent(() => module["CircleAlert"]);
|
|
527
|
+
}
|
|
528
|
+
}, [name, isLoaded]);
|
|
529
|
+
return IconComponent ? /* @__PURE__ */ jsx12(IconComponent, { ...props, ref }) : /* @__PURE__ */ jsx12(
|
|
530
|
+
Skeleton_default,
|
|
531
|
+
{
|
|
532
|
+
className: cn10(" icon-hover-effect rounded-full", props.className),
|
|
533
|
+
style: { height: props.size, width: props.size }
|
|
534
|
+
}
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
|
|
539
|
+
// src/components/PolText.tsx
|
|
540
|
+
import { cn as cn11 } from "@pol-studios/utils";
|
|
541
|
+
import React6 from "react";
|
|
542
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
543
|
+
var PolText = React6.forwardRef(
|
|
544
|
+
({ children, type = "p", className, ...rest }, ref) => {
|
|
545
|
+
switch (type) {
|
|
546
|
+
case "p":
|
|
547
|
+
return /* @__PURE__ */ jsx13(
|
|
548
|
+
"p",
|
|
549
|
+
{
|
|
550
|
+
ref,
|
|
551
|
+
className: cn11(`leading-7 text-text-950`, className),
|
|
552
|
+
...rest,
|
|
553
|
+
children
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
case "lead":
|
|
557
|
+
return /* @__PURE__ */ jsx13(
|
|
558
|
+
"p",
|
|
559
|
+
{
|
|
560
|
+
ref,
|
|
561
|
+
className: cn11(
|
|
562
|
+
`text-md text-muted-foreground text-text-950`,
|
|
563
|
+
className
|
|
564
|
+
),
|
|
565
|
+
...rest,
|
|
566
|
+
children
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
case "large":
|
|
570
|
+
return /* @__PURE__ */ jsx13(
|
|
571
|
+
"div",
|
|
572
|
+
{
|
|
573
|
+
ref,
|
|
574
|
+
className: cn11(`text-lg font-semibold text-text-950`, className),
|
|
575
|
+
...rest,
|
|
576
|
+
children
|
|
577
|
+
}
|
|
578
|
+
);
|
|
579
|
+
case "small":
|
|
580
|
+
return /* @__PURE__ */ jsx13(
|
|
581
|
+
"p",
|
|
582
|
+
{
|
|
583
|
+
ref,
|
|
584
|
+
className: cn11(
|
|
585
|
+
`leading-small text-sm font-medium text-text-950`,
|
|
586
|
+
className
|
|
587
|
+
),
|
|
588
|
+
...rest,
|
|
589
|
+
children
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
case "muted":
|
|
593
|
+
return /* @__PURE__ */ jsx13(
|
|
594
|
+
"p",
|
|
595
|
+
{
|
|
596
|
+
ref,
|
|
597
|
+
className: cn11(
|
|
598
|
+
`text-muted-foreground text-xs text-text-600 text-text-950`,
|
|
599
|
+
className
|
|
600
|
+
),
|
|
601
|
+
...rest,
|
|
602
|
+
children
|
|
603
|
+
}
|
|
604
|
+
);
|
|
605
|
+
case "bold":
|
|
606
|
+
return /* @__PURE__ */ jsx13(
|
|
607
|
+
"p",
|
|
608
|
+
{
|
|
609
|
+
ref,
|
|
610
|
+
className: cn11(`font-bold leading-7 text-text-950`, className),
|
|
611
|
+
...rest,
|
|
612
|
+
children
|
|
613
|
+
}
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
);
|
|
618
|
+
var PolText_default = PolText;
|
|
619
|
+
|
|
620
|
+
// src/components/index.ts
|
|
621
|
+
import { redirect } from "@tanstack/react-router";
|
|
622
|
+
|
|
623
|
+
// src/cards/card-row.tsx
|
|
624
|
+
import { jsx as jsx14, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
625
|
+
function CardRow({
|
|
626
|
+
label,
|
|
627
|
+
labelIcon,
|
|
628
|
+
value,
|
|
629
|
+
className
|
|
630
|
+
}) {
|
|
631
|
+
return /* @__PURE__ */ jsxs3(
|
|
632
|
+
"div",
|
|
633
|
+
{
|
|
634
|
+
className: cn12(
|
|
635
|
+
"grid grid-cols-[1fr_1fr] border-t border-muted-300 px-5 py-2",
|
|
636
|
+
className
|
|
637
|
+
),
|
|
638
|
+
children: [
|
|
639
|
+
/* @__PURE__ */ jsxs3("span", { className: "flex gap-1 items-center", children: [
|
|
640
|
+
/* @__PURE__ */ jsx14(PolText_default, { className: "text-muted-700 text-left text-sm", children: label }),
|
|
641
|
+
labelIcon
|
|
642
|
+
] }),
|
|
643
|
+
/* @__PURE__ */ jsx14(PolText_default, { className: "text-muted-700 text-right text-sm truncate", children: value })
|
|
644
|
+
]
|
|
645
|
+
}
|
|
646
|
+
);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// src/cards/card-title.tsx
|
|
650
|
+
import { cn as cn13 } from "@pol-studios/utils";
|
|
651
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
652
|
+
var CardTitle = ({
|
|
653
|
+
children,
|
|
654
|
+
className
|
|
655
|
+
}) => {
|
|
656
|
+
return /* @__PURE__ */ jsx15(Heading, { size: "md", className: cn13("font-bold text-left", className), children });
|
|
657
|
+
};
|
|
658
|
+
var card_title_default = CardTitle;
|
|
659
|
+
|
|
660
|
+
// src/cards/card-skeleton-body.tsx
|
|
661
|
+
import { cn as cn14 } from "@pol-studios/utils";
|
|
662
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
663
|
+
var CardSkeletonBody = ({
|
|
664
|
+
children,
|
|
665
|
+
className
|
|
666
|
+
}) => {
|
|
667
|
+
return /* @__PURE__ */ jsx16("div", { className: cn14("overflow-hidden relative w-full h-full", className), children });
|
|
668
|
+
};
|
|
669
|
+
var card_skeleton_body_default = CardSkeletonBody;
|
|
670
|
+
|
|
671
|
+
// src/cards/GlassmorphicCard.tsx
|
|
672
|
+
import React7 from "react";
|
|
673
|
+
import { cn as cn15 } from "@pol-studios/utils";
|
|
674
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
675
|
+
var GlassmorphicCard = React7.forwardRef(
|
|
676
|
+
({ children, className, intensity = "medium", ...props }, ref) => {
|
|
677
|
+
const intensityStyles = {
|
|
678
|
+
subtle: [
|
|
679
|
+
"backdrop-blur-md",
|
|
680
|
+
"bg-background-50/70 "
|
|
681
|
+
].join(" "),
|
|
682
|
+
medium: [
|
|
683
|
+
"backdrop-blur-lg",
|
|
684
|
+
"bg-background-50/60 "
|
|
685
|
+
].join(" "),
|
|
686
|
+
prominent: [
|
|
687
|
+
"backdrop-blur-xl",
|
|
688
|
+
"bg-background-50/50 "
|
|
689
|
+
].join(" ")
|
|
690
|
+
};
|
|
691
|
+
return /* @__PURE__ */ jsx17(
|
|
692
|
+
"div",
|
|
693
|
+
{
|
|
694
|
+
ref,
|
|
695
|
+
className: cn15(
|
|
696
|
+
// Base glassmorphic styles
|
|
697
|
+
"rounded-2xl",
|
|
698
|
+
"backdrop-saturate-150",
|
|
699
|
+
intensityStyles[intensity],
|
|
700
|
+
// Soft borders (NO harsh borders)
|
|
701
|
+
"border border-background-50/10 ",
|
|
702
|
+
// Soft shadows for depth
|
|
703
|
+
"shadow-xl shadow-muted-950/5 ",
|
|
704
|
+
// Smooth transitions
|
|
705
|
+
"transition-all duration-300",
|
|
706
|
+
// Hover enhancement
|
|
707
|
+
"hover:shadow-2xl",
|
|
708
|
+
"hover:bg-background-50/70 ",
|
|
709
|
+
// Accessibility: Respect reduced transparency preference
|
|
710
|
+
"motion-reduce:backdrop-blur-none",
|
|
711
|
+
"motion-reduce:bg-background-50 ",
|
|
712
|
+
// Custom className override
|
|
713
|
+
className
|
|
714
|
+
),
|
|
715
|
+
...props,
|
|
716
|
+
children
|
|
717
|
+
}
|
|
718
|
+
);
|
|
719
|
+
}
|
|
720
|
+
);
|
|
721
|
+
GlassmorphicCard.displayName = "GlassmorphicCard";
|
|
722
|
+
var GlassmorphicCard_default = GlassmorphicCard;
|
|
723
|
+
|
|
724
|
+
// src/cards/HeroKPICard.tsx
|
|
725
|
+
import { Link } from "@tanstack/react-router";
|
|
726
|
+
import { cn as cn16 } from "@pol-studios/utils";
|
|
727
|
+
import { Fragment, jsx as jsx18, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
728
|
+
var colorConfig = {
|
|
729
|
+
sapphire: {
|
|
730
|
+
gradient: "from-sapphire-50/80 to-sapphire-100/50",
|
|
731
|
+
border: "border-sapphire-200/40",
|
|
732
|
+
iconBg: "from-sapphire-500 to-sapphire-600",
|
|
733
|
+
text: "text-sapphire-900",
|
|
734
|
+
label: "text-sapphire-700",
|
|
735
|
+
shadow: "shadow-sapphire-500/20"
|
|
736
|
+
},
|
|
737
|
+
lapis: {
|
|
738
|
+
gradient: "from-lapis-50/80 to-lapis-100/50",
|
|
739
|
+
border: "border-lapis-200/40",
|
|
740
|
+
iconBg: "from-lapis-500 to-lapis-600",
|
|
741
|
+
text: "text-lapis-900",
|
|
742
|
+
label: "text-lapis-700",
|
|
743
|
+
shadow: "shadow-lapis-500/20"
|
|
744
|
+
},
|
|
745
|
+
coral: {
|
|
746
|
+
gradient: "from-coral-50/80 to-coral-100/50",
|
|
747
|
+
border: "border-coral-200/40",
|
|
748
|
+
iconBg: "from-coral-500 to-coral-600",
|
|
749
|
+
text: "text-coral-900",
|
|
750
|
+
label: "text-coral-700",
|
|
751
|
+
shadow: "shadow-coral-500/20"
|
|
752
|
+
},
|
|
753
|
+
emerald: {
|
|
754
|
+
gradient: "from-emerald-50/80 to-emerald-100/50",
|
|
755
|
+
border: "border-emerald-200/40",
|
|
756
|
+
iconBg: "from-emerald-500 to-emerald-600",
|
|
757
|
+
text: "text-emerald-900",
|
|
758
|
+
label: "text-emerald-700",
|
|
759
|
+
shadow: "shadow-emerald-500/20"
|
|
760
|
+
},
|
|
761
|
+
amethyst: {
|
|
762
|
+
gradient: "from-amethyst-50/80 to-amethyst-100/50",
|
|
763
|
+
border: "border-amethyst-200/40",
|
|
764
|
+
iconBg: "from-amethyst-500 to-amethyst-600",
|
|
765
|
+
text: "text-amethyst-900",
|
|
766
|
+
label: "text-amethyst-700",
|
|
767
|
+
shadow: "shadow-amethyst-500/20"
|
|
768
|
+
},
|
|
769
|
+
sky: {
|
|
770
|
+
gradient: "from-sky-50/80 to-sky-100/50",
|
|
771
|
+
border: "border-sky-200/40",
|
|
772
|
+
iconBg: "from-sky-500 to-sky-600",
|
|
773
|
+
text: "text-sky-900",
|
|
774
|
+
label: "text-sky-700",
|
|
775
|
+
shadow: "shadow-sky-500/20"
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
var HeroKPICard = ({
|
|
779
|
+
label,
|
|
780
|
+
value,
|
|
781
|
+
icon,
|
|
782
|
+
color,
|
|
783
|
+
onClick,
|
|
784
|
+
href,
|
|
785
|
+
className
|
|
786
|
+
}) => {
|
|
787
|
+
const colors = colorConfig[color];
|
|
788
|
+
const isInteractive = !!onClick || !!href;
|
|
789
|
+
const cardClasses = cn16(
|
|
790
|
+
// Base styles
|
|
791
|
+
"flex flex-col gap-4 p-6 rounded-2xl",
|
|
792
|
+
"bg-gradient-to-br backdrop-blur-sm",
|
|
793
|
+
"border transition-all duration-300 ease-out",
|
|
794
|
+
"min-h-11 min-w-11",
|
|
795
|
+
// Gradient and border
|
|
796
|
+
colors.gradient,
|
|
797
|
+
colors.border,
|
|
798
|
+
// Interactive styles
|
|
799
|
+
isInteractive && [
|
|
800
|
+
"cursor-pointer",
|
|
801
|
+
"hover:shadow-xl hover:scale-[1.02]",
|
|
802
|
+
"active:scale-[0.98]",
|
|
803
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
804
|
+
`focus:ring-${color}-500/50`
|
|
805
|
+
],
|
|
806
|
+
// Custom className
|
|
807
|
+
className
|
|
808
|
+
);
|
|
809
|
+
const content = /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
810
|
+
/* @__PURE__ */ jsx18(
|
|
811
|
+
"div",
|
|
812
|
+
{
|
|
813
|
+
className: cn16(
|
|
814
|
+
"inline-flex h-12 w-12 items-center justify-center rounded-xl",
|
|
815
|
+
"bg-gradient-to-br shadow-lg",
|
|
816
|
+
colors.iconBg,
|
|
817
|
+
colors.shadow
|
|
818
|
+
),
|
|
819
|
+
children: /* @__PURE__ */ jsx18(PolIcon_default, { name: icon, className: "h-6 w-6 text-muted-50" })
|
|
820
|
+
}
|
|
821
|
+
),
|
|
822
|
+
/* @__PURE__ */ jsx18("div", { className: cn16("text-4xl font-semibold", colors.text), children: value }),
|
|
823
|
+
/* @__PURE__ */ jsx18("div", { className: cn16("text-sm font-medium", colors.label), children: label })
|
|
824
|
+
] });
|
|
825
|
+
if (href) {
|
|
826
|
+
return /* @__PURE__ */ jsx18(
|
|
827
|
+
Link,
|
|
828
|
+
{
|
|
829
|
+
to: href,
|
|
830
|
+
className: cardClasses,
|
|
831
|
+
"aria-label": `View ${label}: ${value}`,
|
|
832
|
+
"data-testid": `hero-kpi-card-${label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
833
|
+
children: content
|
|
834
|
+
}
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
if (onClick) {
|
|
838
|
+
return /* @__PURE__ */ jsx18(
|
|
839
|
+
"button",
|
|
840
|
+
{
|
|
841
|
+
type: "button",
|
|
842
|
+
onClick,
|
|
843
|
+
className: cardClasses,
|
|
844
|
+
"aria-label": `View ${label}: ${value}`,
|
|
845
|
+
"data-testid": `hero-kpi-card-${label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
846
|
+
children: content
|
|
847
|
+
}
|
|
848
|
+
);
|
|
849
|
+
}
|
|
850
|
+
return /* @__PURE__ */ jsx18(
|
|
851
|
+
"div",
|
|
852
|
+
{
|
|
853
|
+
className: cardClasses,
|
|
854
|
+
"aria-label": `${label}: ${value}`,
|
|
855
|
+
role: "status",
|
|
856
|
+
"data-testid": `hero-kpi-card-${label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
857
|
+
children: content
|
|
858
|
+
}
|
|
859
|
+
);
|
|
860
|
+
};
|
|
861
|
+
var HeroKPICard_default = HeroKPICard;
|
|
862
|
+
export {
|
|
863
|
+
card_default as Card,
|
|
864
|
+
card_content_default as CardContent,
|
|
865
|
+
card_description_default as CardDescription,
|
|
866
|
+
card_header_default as CardHeader,
|
|
867
|
+
CardRow,
|
|
868
|
+
card_skeleton_body_default as CardSkeletonBody,
|
|
869
|
+
card_title_default as CardTitle,
|
|
870
|
+
GlassmorphicCard_default as GlassmorphicCard,
|
|
871
|
+
HeroKPICard_default as HeroKPICard
|
|
872
|
+
};
|