@epilot/spark-ui 1.0.0-alpha.1 → 1.0.0-alpha.2
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/index.cjs +1364 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +227 -3
- package/dist/index.d.ts +227 -3
- package/dist/index.js +1298 -35
- package/dist/index.js.map +1 -1
- package/package.json +30 -15
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var React2 = require('react');
|
|
3
|
+
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
4
|
+
var React4 = require('react');
|
|
6
5
|
var clsx = require('clsx');
|
|
7
6
|
var tailwindMerge = require('tailwind-merge');
|
|
8
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
var
|
|
8
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
9
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
10
|
+
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
11
|
+
var SheetPrimitive = require('@radix-ui/react-dialog');
|
|
12
|
+
var vaul = require('vaul');
|
|
13
|
+
var curve = require('@visx/curve');
|
|
14
|
+
var event = require('@visx/event');
|
|
15
|
+
var group = require('@visx/group');
|
|
16
|
+
var scale = require('@visx/scale');
|
|
17
|
+
var shape = require('@visx/shape');
|
|
18
|
+
var tooltip = require('@visx/tooltip');
|
|
19
|
+
var d3Array = require('@visx/vendor/d3-array');
|
|
20
|
+
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
21
|
+
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
|
22
|
+
var SelectPrimitive = require('@radix-ui/react-select');
|
|
23
|
+
var SliderPrimitive = require('@radix-ui/react-slider');
|
|
24
|
+
var SwitchPrimitives = require('@radix-ui/react-switch');
|
|
25
|
+
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
10
26
|
|
|
11
27
|
function _interopNamespace(e) {
|
|
12
28
|
if (e && e.__esModule) return e;
|
|
@@ -26,12 +42,96 @@ function _interopNamespace(e) {
|
|
|
26
42
|
return Object.freeze(n);
|
|
27
43
|
}
|
|
28
44
|
|
|
29
|
-
var
|
|
30
|
-
var
|
|
45
|
+
var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
|
|
46
|
+
var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
|
|
47
|
+
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
48
|
+
var SheetPrimitive__namespace = /*#__PURE__*/_interopNamespace(SheetPrimitive);
|
|
49
|
+
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
50
|
+
var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
|
|
51
|
+
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
52
|
+
var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
|
|
53
|
+
var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
|
|
54
|
+
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
31
55
|
|
|
32
56
|
function cn(...inputs) {
|
|
33
57
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
34
58
|
}
|
|
59
|
+
var ChevronDown = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
+
"svg",
|
|
61
|
+
{
|
|
62
|
+
fill: "none",
|
|
63
|
+
height: "16",
|
|
64
|
+
viewBox: "0 0 16 16",
|
|
65
|
+
width: "16",
|
|
66
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
67
|
+
...props,
|
|
68
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
69
|
+
"path",
|
|
70
|
+
{
|
|
71
|
+
d: "M8 7.19992L4.93333 10.2666L4 9.33325L8 5.33325L12 9.33325L11.0667 10.2666L8 7.19992Z",
|
|
72
|
+
fill: "currentColor",
|
|
73
|
+
fillOpacity: "0.934"
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
var Accordion = AccordionPrimitive__namespace.Root;
|
|
79
|
+
var AccordionItem = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
80
|
+
AccordionPrimitive__namespace.Item,
|
|
81
|
+
{
|
|
82
|
+
className: cn("border-b border-gray", className),
|
|
83
|
+
ref,
|
|
84
|
+
...props
|
|
85
|
+
}
|
|
86
|
+
));
|
|
87
|
+
AccordionItem.displayName = "AccordionItem";
|
|
88
|
+
var AccordionTrigger = React4__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
89
|
+
AccordionPrimitive__namespace.Trigger,
|
|
90
|
+
{
|
|
91
|
+
className: cn(
|
|
92
|
+
"flex flex-1 items-center justify-between rounded-md py-4 font-medium underline-offset-4 transition-all hover:underline focus-visible:ring [&[data-state=open]>svg]:rotate-180",
|
|
93
|
+
className
|
|
94
|
+
),
|
|
95
|
+
ref,
|
|
96
|
+
...props,
|
|
97
|
+
children: [
|
|
98
|
+
children,
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
100
|
+
ChevronDown,
|
|
101
|
+
{
|
|
102
|
+
className: "h-4 w-4 shrink-0 transition-transform duration-200",
|
|
103
|
+
role: "presentation"
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
) }));
|
|
109
|
+
AccordionTrigger.displayName = AccordionPrimitive__namespace.Trigger.displayName;
|
|
110
|
+
var AccordionContent = React4__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
111
|
+
AccordionPrimitive__namespace.Content,
|
|
112
|
+
{
|
|
113
|
+
className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
114
|
+
ref,
|
|
115
|
+
...props,
|
|
116
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(className), children })
|
|
117
|
+
}
|
|
118
|
+
));
|
|
119
|
+
AccordionContent.displayName = AccordionPrimitive__namespace.Content.displayName;
|
|
120
|
+
var Badge = React4__namespace.forwardRef(
|
|
121
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
122
|
+
"span",
|
|
123
|
+
{
|
|
124
|
+
className: cn(
|
|
125
|
+
"inline-flex h-5 min-w-5 items-center justify-center rounded-md bg-base-gray-soft px-1.5 text-center text-xs font-normal tabular-nums text-gray",
|
|
126
|
+
className
|
|
127
|
+
),
|
|
128
|
+
ref,
|
|
129
|
+
...props,
|
|
130
|
+
children
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
);
|
|
134
|
+
Badge.displayName = "Badge";
|
|
35
135
|
var buttonVariants = classVarianceAuthority.cva(
|
|
36
136
|
`inline-flex items-center justify-center gap-2 whitespace-nowrap cursor-pointer text-base font-medium transition-colors focus-visible:outline-hidden focus-visible:ring focus-visible:ring-offset-2 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-6 [&_svg]:shrink-0`,
|
|
37
137
|
{
|
|
@@ -59,14 +159,108 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
59
159
|
}
|
|
60
160
|
}
|
|
61
161
|
);
|
|
62
|
-
var Button =
|
|
162
|
+
var Button = React4__namespace.forwardRef(
|
|
63
163
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
64
164
|
const Comp = asChild ? reactSlot.Slot : "button";
|
|
65
165
|
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props });
|
|
66
166
|
}
|
|
67
167
|
);
|
|
68
168
|
Button.displayName = "Button";
|
|
69
|
-
var
|
|
169
|
+
var InfoIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
170
|
+
"svg",
|
|
171
|
+
{
|
|
172
|
+
fill: "none",
|
|
173
|
+
height: "24",
|
|
174
|
+
viewBox: "0 0 24 24",
|
|
175
|
+
width: "24",
|
|
176
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
177
|
+
...props,
|
|
178
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
179
|
+
"path",
|
|
180
|
+
{
|
|
181
|
+
d: "M11 17H13V11H11V17ZM12 9C12.2833 9 12.5208 8.90417 12.7125 8.7125C12.9042 8.52083 13 8.28333 13 8C13 7.71667 12.9042 7.47917 12.7125 7.2875C12.5208 7.09583 12.2833 7 12 7C11.7167 7 11.4792 7.09583 11.2875 7.2875C11.0958 7.47917 11 7.71667 11 8C11 8.28333 11.0958 8.52083 11.2875 8.7125C11.4792 8.90417 11.7167 9 12 9ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z",
|
|
182
|
+
fill: "currentColor"
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
var PendingIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
188
|
+
"svg",
|
|
189
|
+
{
|
|
190
|
+
fill: "none",
|
|
191
|
+
height: "24",
|
|
192
|
+
viewBox: "0 0 24 24",
|
|
193
|
+
width: "24",
|
|
194
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
195
|
+
...props,
|
|
196
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
197
|
+
"path",
|
|
198
|
+
{
|
|
199
|
+
d: "M12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20ZM12.5 7V12.25L16.5 14.65L15.75 15.85L11 13V7H12.5Z",
|
|
200
|
+
fill: "currentColor"
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
var WarningIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
206
|
+
"svg",
|
|
207
|
+
{
|
|
208
|
+
fill: "none",
|
|
209
|
+
height: "24",
|
|
210
|
+
viewBox: "0 0 24 24",
|
|
211
|
+
width: "24",
|
|
212
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
213
|
+
...props,
|
|
214
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
215
|
+
"path",
|
|
216
|
+
{
|
|
217
|
+
d: "M1 21L12 2L23 21H1ZM4.45 19H19.55L12 6L4.45 19ZM12 18C12.2833 18 12.5208 17.9042 12.7125 17.7125C12.9042 17.5208 13 17.2833 13 17C13 16.7167 12.9042 16.4792 12.7125 16.2875C12.5208 16.0958 12.2833 16 12 16C11.7167 16 11.4792 16.0958 11.2875 16.2875C11.0958 16.4792 11 16.7167 11 17C11 17.2833 11.0958 17.5208 11.2875 17.7125C11.4792 17.9042 11.7167 18 12 18ZM11 15H13V10H11V15Z",
|
|
218
|
+
fill: "currentColor"
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
var getIcon = (type) => {
|
|
224
|
+
switch (type) {
|
|
225
|
+
case "pending":
|
|
226
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PendingIcon, { className: "shrink-0 text-info-light", role: "presentation" });
|
|
227
|
+
case "success":
|
|
228
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InfoIcon, { className: "shrink-0 text-info-light", role: "presentation" });
|
|
229
|
+
case "warning":
|
|
230
|
+
return /* @__PURE__ */ jsxRuntime.jsx(WarningIcon, { className: "shrink-0 text-orange-11", role: "presentation" });
|
|
231
|
+
case "info":
|
|
232
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InfoIcon, { className: "shrink-0 text-info-light", role: "presentation" });
|
|
233
|
+
default:
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
var getContainerClasses = (type) => {
|
|
238
|
+
const baseClasses = "flex items-center gap-3 rounded-2xl p-4 text-sm transition-colors duration-500";
|
|
239
|
+
switch (type) {
|
|
240
|
+
case "error":
|
|
241
|
+
return `${baseClasses} bg-base-error-soft text-error`;
|
|
242
|
+
case "pending":
|
|
243
|
+
case "success":
|
|
244
|
+
return `${baseClasses} bg-base-info-soft text-info`;
|
|
245
|
+
case "warning":
|
|
246
|
+
return `${baseClasses} bg-orange-a3 text-orange-12`;
|
|
247
|
+
case "info":
|
|
248
|
+
default:
|
|
249
|
+
return `${baseClasses} bg-base-info-soft text-info`;
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
var Callout = ({ text, type = "info", title, role, className }) => {
|
|
253
|
+
const icon = getIcon(type);
|
|
254
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(getContainerClasses(type), className), role, children: [
|
|
255
|
+
icon,
|
|
256
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
257
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold", children: title }),
|
|
258
|
+
text
|
|
259
|
+
] })
|
|
260
|
+
] });
|
|
261
|
+
};
|
|
262
|
+
Callout.displayName = "Callout";
|
|
263
|
+
var Card = React4__namespace.forwardRef(
|
|
70
264
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
71
265
|
"div",
|
|
72
266
|
{
|
|
@@ -80,11 +274,11 @@ var Card = React2__namespace.forwardRef(
|
|
|
80
274
|
)
|
|
81
275
|
);
|
|
82
276
|
Card.displayName = "Card";
|
|
83
|
-
var CardHeader =
|
|
277
|
+
var CardHeader = React4__namespace.forwardRef(
|
|
84
278
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center gap-4", className), ref, ...props })
|
|
85
279
|
);
|
|
86
280
|
CardHeader.displayName = "CardHeader";
|
|
87
|
-
var CardIcon =
|
|
281
|
+
var CardIcon = React4__namespace.forwardRef(
|
|
88
282
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
89
283
|
"div",
|
|
90
284
|
{
|
|
@@ -95,7 +289,7 @@ var CardIcon = React2__namespace.forwardRef(
|
|
|
95
289
|
)
|
|
96
290
|
);
|
|
97
291
|
CardIcon.displayName = "CardIcon";
|
|
98
|
-
var CardTitle =
|
|
292
|
+
var CardTitle = React4__namespace.forwardRef(
|
|
99
293
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
100
294
|
"h3",
|
|
101
295
|
{
|
|
@@ -106,13 +300,13 @@ var CardTitle = React2__namespace.forwardRef(
|
|
|
106
300
|
)
|
|
107
301
|
);
|
|
108
302
|
CardTitle.displayName = "CardTitle";
|
|
109
|
-
var CardDescription =
|
|
303
|
+
var CardDescription = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-sm leading-5 text-gray-light", className), ref, ...props }));
|
|
110
304
|
CardDescription.displayName = "CardDescription";
|
|
111
|
-
var CardContent =
|
|
305
|
+
var CardContent = React4__namespace.forwardRef(
|
|
112
306
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("", className), ref, ...props })
|
|
113
307
|
);
|
|
114
308
|
CardContent.displayName = "CardContent";
|
|
115
|
-
var CardFooter =
|
|
309
|
+
var CardFooter = React4__namespace.forwardRef(
|
|
116
310
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
117
311
|
"div",
|
|
118
312
|
{
|
|
@@ -123,7 +317,7 @@ var CardFooter = React2__namespace.forwardRef(
|
|
|
123
317
|
)
|
|
124
318
|
);
|
|
125
319
|
CardFooter.displayName = "CardFooter";
|
|
126
|
-
var CardSkeleton =
|
|
320
|
+
var CardSkeleton = React4__namespace.forwardRef(
|
|
127
321
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
128
322
|
"div",
|
|
129
323
|
{
|
|
@@ -144,12 +338,46 @@ var CardSkeleton = React2__namespace.forwardRef(
|
|
|
144
338
|
)
|
|
145
339
|
);
|
|
146
340
|
CardSkeleton.displayName = "CardSkeleton";
|
|
147
|
-
var
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
341
|
+
var CheckIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
342
|
+
"svg",
|
|
343
|
+
{
|
|
344
|
+
fill: "none",
|
|
345
|
+
height: "12",
|
|
346
|
+
viewBox: "0 0 12 12",
|
|
347
|
+
width: "12",
|
|
348
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
349
|
+
...props,
|
|
350
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
351
|
+
"path",
|
|
352
|
+
{
|
|
353
|
+
d: "M4.77498 7.575L9.01248 3.3375C9.11248 3.2375 9.22915 3.1875 9.36248 3.1875C9.49582 3.1875 9.61248 3.2375 9.71248 3.3375C9.81248 3.4375 9.86248 3.55625 9.86248 3.69375C9.86248 3.83125 9.81248 3.95 9.71248 4.05L5.12498 8.65C5.02498 8.75 4.90832 8.8 4.77498 8.8C4.64165 8.8 4.52498 8.75 4.42498 8.65L2.27498 6.5C2.17498 6.4 2.12706 6.28125 2.13123 6.14375C2.1354 6.00625 2.18748 5.8875 2.28748 5.7875C2.38748 5.6875 2.50623 5.6375 2.64373 5.6375C2.78123 5.6375 2.89998 5.6875 2.99998 5.7875L4.77498 7.575Z",
|
|
354
|
+
fill: "currentColor"
|
|
355
|
+
}
|
|
356
|
+
)
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
var Checkbox = React4__namespace.forwardRef(({ className, size = "default", bordered = false, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
360
|
+
CheckboxPrimitive__namespace.Root,
|
|
361
|
+
{
|
|
362
|
+
className: cn(
|
|
363
|
+
"peer inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors focus-visible:outline-hidden focus-visible:ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-base-accent-solid data-[state=unchecked]:bg-base-accent-soft",
|
|
364
|
+
size === "default" && "h-4 w-4",
|
|
365
|
+
size === "large" && "h-6 w-6",
|
|
366
|
+
bordered ? "border-2 border-accent-ui" : "border-2 border-transparent",
|
|
367
|
+
className
|
|
368
|
+
),
|
|
369
|
+
ref,
|
|
370
|
+
...props,
|
|
371
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxPrimitive__namespace.Indicator, { className: "inline-flex items-center justify-center text-accent-contrast transition-none", children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: cn(size === "large" ? "size-4" : "size-3.5") }) })
|
|
372
|
+
}
|
|
373
|
+
));
|
|
374
|
+
Checkbox.displayName = "Checkbox";
|
|
375
|
+
var Dialog = SheetPrimitive__namespace.Root;
|
|
376
|
+
var DialogTrigger = SheetPrimitive__namespace.Trigger;
|
|
377
|
+
var DialogPortal = SheetPrimitive__namespace.Portal;
|
|
378
|
+
var DialogClose = SheetPrimitive__namespace.Close;
|
|
379
|
+
var DialogOverlay = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
380
|
+
SheetPrimitive__namespace.Overlay,
|
|
153
381
|
{
|
|
154
382
|
className: cn(
|
|
155
383
|
"fixed inset-0 z-50 bg-black-a6 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 dark:bg-black-a8",
|
|
@@ -160,16 +388,16 @@ var DialogOverlay = React2__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
160
388
|
...props
|
|
161
389
|
}
|
|
162
390
|
));
|
|
163
|
-
DialogOverlay.displayName =
|
|
391
|
+
DialogOverlay.displayName = SheetPrimitive__namespace.Overlay.displayName;
|
|
164
392
|
var onInteractOutsideHandler = (event) => {
|
|
165
393
|
const target = event.target;
|
|
166
394
|
const isOverlay = target.dataset.overlay === "true";
|
|
167
395
|
if (!isOverlay) event.preventDefault();
|
|
168
396
|
};
|
|
169
|
-
var DialogContent =
|
|
397
|
+
var DialogContent = React4__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
170
398
|
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
171
399
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
172
|
-
|
|
400
|
+
SheetPrimitive__namespace.Content,
|
|
173
401
|
{
|
|
174
402
|
className: cn(
|
|
175
403
|
"fixed left-[50%] top-[50%] z-50 grid w-[90%] min-w-80 max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl bg-slate-2 p-6 text-gray shadow-lg duration-200 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-50% data-[state=closed]:slide-out-to-top-48% data-[state=open]:slide-in-from-top-48% dark:bg-gray-2 sm:w-1/2",
|
|
@@ -182,7 +410,7 @@ var DialogContent = React2__namespace.forwardRef(({ className, children, ...prop
|
|
|
182
410
|
}
|
|
183
411
|
)
|
|
184
412
|
] }));
|
|
185
|
-
DialogContent.displayName =
|
|
413
|
+
DialogContent.displayName = SheetPrimitive__namespace.Content.displayName;
|
|
186
414
|
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("", className), ...props });
|
|
187
415
|
DialogHeader.displayName = "DialogHeader";
|
|
188
416
|
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -193,25 +421,25 @@ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
193
421
|
}
|
|
194
422
|
);
|
|
195
423
|
DialogFooter.displayName = "DialogFooter";
|
|
196
|
-
var DialogTitle =
|
|
197
|
-
|
|
424
|
+
var DialogTitle = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
425
|
+
SheetPrimitive__namespace.Title,
|
|
198
426
|
{
|
|
199
427
|
className: cn("text-lg font-bold text-gray", className),
|
|
200
428
|
ref,
|
|
201
429
|
...props
|
|
202
430
|
}
|
|
203
431
|
));
|
|
204
|
-
DialogTitle.displayName =
|
|
205
|
-
var DialogDescription =
|
|
206
|
-
|
|
432
|
+
DialogTitle.displayName = SheetPrimitive__namespace.Title.displayName;
|
|
433
|
+
var DialogDescription = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
434
|
+
SheetPrimitive__namespace.Description,
|
|
207
435
|
{
|
|
208
436
|
className: cn("text-md text-gray", className),
|
|
209
437
|
ref,
|
|
210
438
|
...props
|
|
211
439
|
}
|
|
212
440
|
));
|
|
213
|
-
DialogDescription.displayName =
|
|
214
|
-
var DisplayField =
|
|
441
|
+
DialogDescription.displayName = SheetPrimitive__namespace.Description.displayName;
|
|
442
|
+
var DisplayField = React4__namespace.forwardRef(
|
|
215
443
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
216
444
|
"div",
|
|
217
445
|
{
|
|
@@ -225,7 +453,7 @@ var DisplayField = React2__namespace.forwardRef(
|
|
|
225
453
|
)
|
|
226
454
|
);
|
|
227
455
|
DisplayField.displayName = "DisplayField";
|
|
228
|
-
var DisplayFieldLabel =
|
|
456
|
+
var DisplayFieldLabel = React4__namespace.forwardRef(
|
|
229
457
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
230
458
|
"span",
|
|
231
459
|
{
|
|
@@ -236,7 +464,7 @@ var DisplayFieldLabel = React2__namespace.forwardRef(
|
|
|
236
464
|
)
|
|
237
465
|
);
|
|
238
466
|
DisplayFieldLabel.displayName = "DisplayFieldLabel";
|
|
239
|
-
var DisplayFieldValue =
|
|
467
|
+
var DisplayFieldValue = React4__namespace.forwardRef(
|
|
240
468
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
241
469
|
"span",
|
|
242
470
|
{
|
|
@@ -250,11 +478,11 @@ var DisplayFieldValue = React2__namespace.forwardRef(
|
|
|
250
478
|
)
|
|
251
479
|
);
|
|
252
480
|
DisplayFieldValue.displayName = "DisplayFieldValue";
|
|
253
|
-
var DisplayFieldContent =
|
|
481
|
+
var DisplayFieldContent = React4__namespace.forwardRef(
|
|
254
482
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("", className), ref, ...props })
|
|
255
483
|
);
|
|
256
484
|
DisplayFieldContent.displayName = "DisplayFieldContent";
|
|
257
|
-
var DisplayFieldSkeleton =
|
|
485
|
+
var DisplayFieldSkeleton = React4__namespace.forwardRef(
|
|
258
486
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
259
487
|
"div",
|
|
260
488
|
{
|
|
@@ -272,8 +500,1056 @@ var DisplayFieldSkeleton = React2__namespace.forwardRef(
|
|
|
272
500
|
)
|
|
273
501
|
);
|
|
274
502
|
DisplayFieldSkeleton.displayName = "DisplayFieldSkeleton";
|
|
503
|
+
var Drawer = ({
|
|
504
|
+
shouldScaleBackground = true,
|
|
505
|
+
...props
|
|
506
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Root, { shouldScaleBackground, ...props });
|
|
507
|
+
Drawer.displayName = "Drawer";
|
|
508
|
+
var DrawerTrigger = vaul.Drawer.Trigger;
|
|
509
|
+
var DrawerPortal = vaul.Drawer.Portal;
|
|
510
|
+
var DrawerClose = vaul.Drawer.Close;
|
|
511
|
+
var DrawerOverlay = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
512
|
+
vaul.Drawer.Overlay,
|
|
513
|
+
{
|
|
514
|
+
className: cn("fixed inset-0 z-50 bg-black-a6 dark:bg-black-a8", className),
|
|
515
|
+
"data-overlay": "true",
|
|
516
|
+
ref,
|
|
517
|
+
...props
|
|
518
|
+
}
|
|
519
|
+
));
|
|
520
|
+
DrawerOverlay.displayName = vaul.Drawer.Overlay.displayName;
|
|
521
|
+
var DrawerPill = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
522
|
+
"div",
|
|
523
|
+
{
|
|
524
|
+
className: cn(
|
|
525
|
+
"mx-auto mt-2.5 h-1.5 w-16 shrink-0 rounded-[24px] bg-base-gray-soft",
|
|
526
|
+
className
|
|
527
|
+
)
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
var DrawerContent = React4__namespace.forwardRef(({ className, pillClassName, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DrawerPortal, { children: [
|
|
531
|
+
/* @__PURE__ */ jsxRuntime.jsx(DrawerOverlay, {}),
|
|
532
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
533
|
+
vaul.Drawer.Content,
|
|
534
|
+
{
|
|
535
|
+
className: cn(
|
|
536
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col gap-4 rounded-t-2xl bg-slate-2 text-gray dark:bg-gray-2",
|
|
537
|
+
className
|
|
538
|
+
),
|
|
539
|
+
ref,
|
|
540
|
+
...props,
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ jsxRuntime.jsx(DrawerPill, { className: pillClassName }),
|
|
543
|
+
children
|
|
544
|
+
]
|
|
545
|
+
}
|
|
546
|
+
)
|
|
547
|
+
] }));
|
|
548
|
+
DrawerContent.displayName = "DrawerContent";
|
|
549
|
+
var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col gap-1 px-6 py-3", className), ...props });
|
|
550
|
+
DrawerHeader.displayName = "DrawerHeader";
|
|
551
|
+
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mt-auto flex flex-col gap-2 text-gray", className), ...props });
|
|
552
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
553
|
+
var DrawerTitle = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
554
|
+
vaul.Drawer.Title,
|
|
555
|
+
{
|
|
556
|
+
className: cn("text-lg font-bold text-gray", className),
|
|
557
|
+
ref,
|
|
558
|
+
...props
|
|
559
|
+
}
|
|
560
|
+
));
|
|
561
|
+
DrawerTitle.displayName = vaul.Drawer.Title.displayName;
|
|
562
|
+
var DrawerDescription = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
563
|
+
vaul.Drawer.Description,
|
|
564
|
+
{
|
|
565
|
+
className: cn("text-sm text-gray", className),
|
|
566
|
+
ref,
|
|
567
|
+
...props
|
|
568
|
+
}
|
|
569
|
+
));
|
|
570
|
+
DrawerDescription.displayName = vaul.Drawer.Description.displayName;
|
|
571
|
+
var POSITIONS = {
|
|
572
|
+
solar: { x: 120, y: 70 },
|
|
573
|
+
grid: { x: 360, y: 70 },
|
|
574
|
+
home: { x: 240, y: 190 },
|
|
575
|
+
battery: { x: 100, y: 330 },
|
|
576
|
+
"heat-pump": { x: 240, y: 355 },
|
|
577
|
+
ev: { x: 380, y: 330 }
|
|
578
|
+
};
|
|
579
|
+
var NODE_RADIUS = 32;
|
|
580
|
+
var HOME_RADIUS = 38;
|
|
581
|
+
var STYLES = {
|
|
582
|
+
solar: { label: "Solar", bg: "var(--orange-3)", icon: "var(--orange-11)", flow: "var(--orange-9)" },
|
|
583
|
+
battery: { label: "Battery", bg: "var(--green-3)", icon: "var(--green-11)", flow: "var(--green-9)" },
|
|
584
|
+
grid: { label: "Grid", bg: "var(--mauve-3)", icon: "var(--mauve-11)", flow: "var(--mauve-9)" },
|
|
585
|
+
home: { label: "Home", bg: "var(--slate-3)", icon: "var(--slate-11)", flow: "var(--slate-9)" },
|
|
586
|
+
ev: { label: "EV Charger", bg: "var(--blue-3)", icon: "var(--blue-11)", flow: "var(--blue-9)" },
|
|
587
|
+
"heat-pump": { label: "Heat Pump", bg: "var(--red-3)", icon: "var(--red-11)", flow: "var(--red-9)" }
|
|
588
|
+
};
|
|
589
|
+
var defaultFormatPower = (power) => {
|
|
590
|
+
const abs = Math.abs(power);
|
|
591
|
+
if (abs >= 1) return `${abs.toFixed(1)} kW`;
|
|
592
|
+
return `${(abs * 1e3).toFixed(0)} W`;
|
|
593
|
+
};
|
|
594
|
+
function getFlowPath(from, to) {
|
|
595
|
+
const mx = (from.x + to.x) / 2;
|
|
596
|
+
return `M ${from.x} ${from.y} C ${mx} ${from.y}, ${mx} ${to.y}, ${to.x} ${to.y}`;
|
|
597
|
+
}
|
|
598
|
+
function getAnimDuration(power) {
|
|
599
|
+
const clamped = Math.max(0.1, Math.min(10, Math.abs(power)));
|
|
600
|
+
return Math.max(1, 4 - clamped * 0.3);
|
|
601
|
+
}
|
|
602
|
+
function SolarIcon({ color }) {
|
|
603
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { style: { color }, children: [
|
|
604
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "none", height: "18", rx: "1.5", stroke: "currentColor", strokeWidth: "1.8", width: "18", x: "-9", y: "-9" }),
|
|
605
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { stroke: "currentColor", strokeWidth: "1", x1: "-9", x2: "9", y1: "-3", y2: "-3" }),
|
|
606
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { stroke: "currentColor", strokeWidth: "1", x1: "-9", x2: "9", y1: "3", y2: "3" }),
|
|
607
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { stroke: "currentColor", strokeWidth: "1", x1: "-3", x2: "-3", y1: "-9", y2: "9" }),
|
|
608
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { stroke: "currentColor", strokeWidth: "1", x1: "3", x2: "3", y1: "-9", y2: "9" })
|
|
609
|
+
] });
|
|
610
|
+
}
|
|
611
|
+
function BatteryIcon({ color, level = 50 }) {
|
|
612
|
+
const h = Math.max(1, Math.min(100, level) / 100 * 16);
|
|
613
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { style: { color }, children: [
|
|
614
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "currentColor", height: "3", rx: "1", width: "6", x: "-3", y: "-13" }),
|
|
615
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "none", height: "20", rx: "2.5", stroke: "currentColor", strokeWidth: "1.8", width: "14", x: "-7", y: "-10" }),
|
|
616
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "currentColor", height: h, opacity: 0.5, rx: "1", width: "9", x: "-4.5", y: 10 - h })
|
|
617
|
+
] });
|
|
618
|
+
}
|
|
619
|
+
function GridIcon({ color }) {
|
|
620
|
+
return /* @__PURE__ */ jsxRuntime.jsx("g", { style: { color }, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 -12 L0 12 M-9 -5 L9 -5 M-7 1 L7 1 M-5 7 L5 7", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeWidth: "2" }) });
|
|
621
|
+
}
|
|
622
|
+
function HomeIcon({ color }) {
|
|
623
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { style: { color }, children: [
|
|
624
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M-12 2 L0 -11 L12 2", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2.2" }),
|
|
625
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "none", height: "12", rx: "1.5", stroke: "currentColor", strokeWidth: "1.8", width: "18", x: "-9", y: "2" }),
|
|
626
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "currentColor", height: "7", opacity: 0.35, rx: "1", width: "6", x: "-3", y: "7" })
|
|
627
|
+
] });
|
|
628
|
+
}
|
|
629
|
+
function EvIcon({ color }) {
|
|
630
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { style: { color }, children: [
|
|
631
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M-11 3 L-9 -3 L-3 -8 L7 -8 L11 -1 L11 3 Z", fill: "none", stroke: "currentColor", strokeLinejoin: "round", strokeWidth: "1.8" }),
|
|
632
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "-5", cy: "5", fill: "none", r: "3", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
633
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "7", cy: "5", fill: "none", r: "3", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
634
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 -5 L-1 0 L2 0 L0 4", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.2" })
|
|
635
|
+
] });
|
|
636
|
+
}
|
|
637
|
+
function HeatPumpIcon({ color }) {
|
|
638
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { style: { color }, children: [
|
|
639
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { fill: "none", height: "16", rx: "3", stroke: "currentColor", strokeWidth: "1.8", width: "22", x: "-11", y: "-8" }),
|
|
640
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "0", cy: "0", fill: "none", r: "5", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
641
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 -4 C2 -2 2 2 0 4 C-2 2 -2 -2 0 -4", fill: "currentColor", opacity: 0.3 }),
|
|
642
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M-4 0 C-2 -2 2 -2 4 0 C2 2 -2 2 -4 0", fill: "currentColor", opacity: 0.3 })
|
|
643
|
+
] });
|
|
644
|
+
}
|
|
645
|
+
var NODE_ICONS = {
|
|
646
|
+
solar: SolarIcon,
|
|
647
|
+
battery: BatteryIcon,
|
|
648
|
+
grid: GridIcon,
|
|
649
|
+
home: HomeIcon,
|
|
650
|
+
ev: EvIcon,
|
|
651
|
+
"heat-pump": HeatPumpIcon
|
|
652
|
+
};
|
|
653
|
+
function FlowConnection({
|
|
654
|
+
from,
|
|
655
|
+
to,
|
|
656
|
+
color,
|
|
657
|
+
power
|
|
658
|
+
}) {
|
|
659
|
+
const d = getFlowPath(from, to);
|
|
660
|
+
const dur = getAnimDuration(power);
|
|
661
|
+
const dots = 3;
|
|
662
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
663
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d, fill: "none", opacity: 0.15, stroke: color, strokeWidth: 2 }),
|
|
664
|
+
Array.from({ length: dots }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx("circle", { fill: color, opacity: 0.85, r: 3.5, children: /* @__PURE__ */ jsxRuntime.jsx("animateMotion", { begin: `${i * dur / dots}s`, dur: `${dur}s`, path: d, repeatCount: "indefinite" }) }, i))
|
|
665
|
+
] });
|
|
666
|
+
}
|
|
667
|
+
function FlowNode({
|
|
668
|
+
node,
|
|
669
|
+
formatPower
|
|
670
|
+
}) {
|
|
671
|
+
const pos = POSITIONS[node.type];
|
|
672
|
+
const style = STYLES[node.type];
|
|
673
|
+
const radius = node.type === "home" ? HOME_RADIUS : NODE_RADIUS;
|
|
674
|
+
const Icon2 = NODE_ICONS[node.type];
|
|
675
|
+
const label = node.label ?? style.label;
|
|
676
|
+
const inactive = node.power === 0;
|
|
677
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${pos.x}, ${pos.y})`, children: [
|
|
678
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
679
|
+
"circle",
|
|
680
|
+
{
|
|
681
|
+
fill: style.bg,
|
|
682
|
+
opacity: inactive ? 0.5 : 1,
|
|
683
|
+
r: radius,
|
|
684
|
+
stroke: style.flow,
|
|
685
|
+
strokeWidth: 2
|
|
686
|
+
}
|
|
687
|
+
),
|
|
688
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { transform: "translate(0, -2)", children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { color: style.icon, level: node.batteryLevel }) }),
|
|
689
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
690
|
+
"text",
|
|
691
|
+
{
|
|
692
|
+
fill: style.icon,
|
|
693
|
+
fontSize: "11",
|
|
694
|
+
fontWeight: "600",
|
|
695
|
+
textAnchor: "middle",
|
|
696
|
+
y: radius + 16,
|
|
697
|
+
children: label
|
|
698
|
+
}
|
|
699
|
+
),
|
|
700
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
701
|
+
"text",
|
|
702
|
+
{
|
|
703
|
+
fill: style.icon,
|
|
704
|
+
fontSize: "12",
|
|
705
|
+
fontWeight: "500",
|
|
706
|
+
opacity: 0.75,
|
|
707
|
+
textAnchor: "middle",
|
|
708
|
+
y: radius + 30,
|
|
709
|
+
children: formatPower(node.power)
|
|
710
|
+
}
|
|
711
|
+
),
|
|
712
|
+
node.type === "battery" && node.batteryLevel != null && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
713
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
714
|
+
"rect",
|
|
715
|
+
{
|
|
716
|
+
fill: style.flow,
|
|
717
|
+
height: "16",
|
|
718
|
+
rx: "8",
|
|
719
|
+
width: "24",
|
|
720
|
+
x: radius - 24,
|
|
721
|
+
y: -radius + 2
|
|
722
|
+
}
|
|
723
|
+
),
|
|
724
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
725
|
+
"text",
|
|
726
|
+
{
|
|
727
|
+
fill: "white",
|
|
728
|
+
fontSize: "9",
|
|
729
|
+
fontWeight: "700",
|
|
730
|
+
textAnchor: "middle",
|
|
731
|
+
x: radius - 12,
|
|
732
|
+
y: -radius + 13,
|
|
733
|
+
children: [
|
|
734
|
+
Math.round(node.batteryLevel),
|
|
735
|
+
"%"
|
|
736
|
+
]
|
|
737
|
+
}
|
|
738
|
+
)
|
|
739
|
+
] })
|
|
740
|
+
] });
|
|
741
|
+
}
|
|
742
|
+
function EnergyFlowChart({
|
|
743
|
+
nodes,
|
|
744
|
+
flows = [],
|
|
745
|
+
className,
|
|
746
|
+
formatPower = defaultFormatPower
|
|
747
|
+
}) {
|
|
748
|
+
const nodeMap = React4.useMemo(() => new Map(nodes.map((n) => [n.type, n])), [nodes]);
|
|
749
|
+
const validFlows = React4.useMemo(
|
|
750
|
+
() => flows.filter((f) => nodeMap.has(f.from) && nodeMap.has(f.to) && f.power > 0),
|
|
751
|
+
[flows, nodeMap]
|
|
752
|
+
);
|
|
753
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
754
|
+
"svg",
|
|
755
|
+
{
|
|
756
|
+
"aria-label": "Energy flow diagram",
|
|
757
|
+
className: "block h-auto w-full",
|
|
758
|
+
role: "img",
|
|
759
|
+
viewBox: "0 0 480 420",
|
|
760
|
+
children: [
|
|
761
|
+
validFlows.map((f, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
762
|
+
FlowConnection,
|
|
763
|
+
{
|
|
764
|
+
color: STYLES[f.from].flow,
|
|
765
|
+
from: POSITIONS[f.from],
|
|
766
|
+
power: f.power,
|
|
767
|
+
to: POSITIONS[f.to]
|
|
768
|
+
},
|
|
769
|
+
`${f.from}-${f.to}-${i}`
|
|
770
|
+
)),
|
|
771
|
+
nodes.map((node) => /* @__PURE__ */ jsxRuntime.jsx(FlowNode, { formatPower, node }, node.type))
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
) });
|
|
775
|
+
}
|
|
776
|
+
EnergyFlowChart.displayName = "EnergyFlowChart";
|
|
777
|
+
var hintIdCounter = 0;
|
|
778
|
+
var Input = React4__namespace.forwardRef(
|
|
779
|
+
({ containerClassName, label, value, className, onChange, readOnly, hint, icon, ...props }, ref) => {
|
|
780
|
+
const hintId = React4.useMemo(() => {
|
|
781
|
+
if (!hint) return void 0;
|
|
782
|
+
return `input-hint-${++hintIdCounter}`;
|
|
783
|
+
}, [hint]);
|
|
784
|
+
const customClassName = {
|
|
785
|
+
"border-transparent": !label?.length,
|
|
786
|
+
"border-input-active": props["aria-invalid"] !== true && (typeof value === "string" ? value.length > 0 : typeof value === "number" ? true : false),
|
|
787
|
+
"text-error! !focus-visible:border-input-invalid border-input-invalid!": props["aria-invalid"] === true
|
|
788
|
+
};
|
|
789
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
790
|
+
"div",
|
|
791
|
+
{
|
|
792
|
+
className: cn(
|
|
793
|
+
"relative flex w-full flex-col gap-y-1 rounded-2xl bg-input-base px-4 py-3",
|
|
794
|
+
containerClassName
|
|
795
|
+
),
|
|
796
|
+
children: [
|
|
797
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-normal leading-5 text-gray-light", htmlFor: label, children: label }),
|
|
798
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center justify-between gap-2", children: [
|
|
799
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
800
|
+
"input",
|
|
801
|
+
{
|
|
802
|
+
"aria-describedby": hintId,
|
|
803
|
+
className: cn(
|
|
804
|
+
"flex h-10 w-full rounded-none border-b-2 border-input bg-transparent py-2 text-base leading-5 text-gray outline-hidden transition-colors duration-100 placeholder:text-gray-disabled focus:border-input-active read-only:focus:border-transparent focus-visible:border-input-active read-only:focus-visible:border-transparent disabled:cursor-not-allowed disabled:border-input-disabled disabled:text-gray-disabled [&:user-invalid]:border-input-invalid [&:user-invalid]:text-error [&:user-invalid]:focus-visible:border-input-invalid [&:user-valid]:border-input-active",
|
|
805
|
+
customClassName,
|
|
806
|
+
className
|
|
807
|
+
),
|
|
808
|
+
id: label,
|
|
809
|
+
onChange,
|
|
810
|
+
readOnly,
|
|
811
|
+
ref,
|
|
812
|
+
value,
|
|
813
|
+
...props
|
|
814
|
+
}
|
|
815
|
+
),
|
|
816
|
+
icon ? icon : null
|
|
817
|
+
] }),
|
|
818
|
+
hint ? /* @__PURE__ */ jsxRuntime.jsx("div", { id: hintId, children: hint }) : null
|
|
819
|
+
]
|
|
820
|
+
}
|
|
821
|
+
);
|
|
822
|
+
}
|
|
823
|
+
);
|
|
824
|
+
Input.displayName = "Input";
|
|
825
|
+
var Label = React4__namespace.forwardRef(
|
|
826
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
827
|
+
"label",
|
|
828
|
+
{
|
|
829
|
+
className: cn("text-base font-normal leading-5 text-gray-light", className),
|
|
830
|
+
ref,
|
|
831
|
+
...props
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
);
|
|
835
|
+
Label.displayName = "Label";
|
|
836
|
+
var DEFAULT_MARGIN = { top: 16, right: 16, bottom: 40, left: 48 };
|
|
837
|
+
var CURVE_MAP = {
|
|
838
|
+
monotone: curve.curveMonotoneX,
|
|
839
|
+
step: curve.curveStep,
|
|
840
|
+
"step-after": curve.curveStepAfter,
|
|
841
|
+
"step-before": curve.curveStepBefore,
|
|
842
|
+
linear: curve.curveLinear
|
|
843
|
+
};
|
|
844
|
+
var resolveCurve = (type) => CURVE_MAP[type];
|
|
845
|
+
var bisectDate = d3Array.bisector((d) => d.date).left;
|
|
846
|
+
var defaultFormatDate = (date) => date.toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
847
|
+
var defaultFormatValue = (value) => value.toLocaleString();
|
|
848
|
+
var LINE_COLORS = [
|
|
849
|
+
"stroke-spark-9",
|
|
850
|
+
"stroke-green-9",
|
|
851
|
+
"stroke-blue-9",
|
|
852
|
+
"stroke-orange-9",
|
|
853
|
+
"stroke-red-9"
|
|
854
|
+
];
|
|
855
|
+
var DOT_COLORS = ["fill-spark-9", "fill-green-9", "fill-blue-9", "fill-orange-9", "fill-red-9"];
|
|
856
|
+
var TEXT_COLORS = [
|
|
857
|
+
"text-spark-a11",
|
|
858
|
+
"text-success-light",
|
|
859
|
+
"text-info-light",
|
|
860
|
+
"text-warning-light",
|
|
861
|
+
"text-error-light"
|
|
862
|
+
];
|
|
863
|
+
function LineChart({
|
|
864
|
+
series,
|
|
865
|
+
width,
|
|
866
|
+
height,
|
|
867
|
+
margin = DEFAULT_MARGIN,
|
|
868
|
+
curve: defaultCurve = "monotone",
|
|
869
|
+
showGrid = true,
|
|
870
|
+
showTooltip: enableTooltip = true,
|
|
871
|
+
className,
|
|
872
|
+
xTickCount = 5,
|
|
873
|
+
yTickCount = 4,
|
|
874
|
+
formatDate = defaultFormatDate,
|
|
875
|
+
formatValue = defaultFormatValue
|
|
876
|
+
}) {
|
|
877
|
+
const { showTooltip, hideTooltip, tooltipData, tooltipLeft, tooltipTop, tooltipOpen } = tooltip.useTooltip();
|
|
878
|
+
const innerWidth = Math.max(0, width - margin.left - margin.right);
|
|
879
|
+
const innerHeight = Math.max(0, height - margin.top - margin.bottom);
|
|
880
|
+
const allData = React4.useMemo(() => series.flatMap((s) => s.data), [series]);
|
|
881
|
+
const xScale = React4.useMemo(
|
|
882
|
+
() => scale.scaleTime({
|
|
883
|
+
range: [0, innerWidth],
|
|
884
|
+
domain: d3Array.extent(allData, (d) => d.date)
|
|
885
|
+
}),
|
|
886
|
+
[allData, innerWidth]
|
|
887
|
+
);
|
|
888
|
+
const yScale = React4.useMemo(
|
|
889
|
+
() => scale.scaleLinear({
|
|
890
|
+
range: [innerHeight, 0],
|
|
891
|
+
domain: [0, Math.max(...allData.map((d) => d.value)) * 1.1],
|
|
892
|
+
nice: true
|
|
893
|
+
}),
|
|
894
|
+
[allData, innerHeight]
|
|
895
|
+
);
|
|
896
|
+
const xTicks = xScale.ticks(xTickCount);
|
|
897
|
+
const yTicks = yScale.ticks(yTickCount);
|
|
898
|
+
const handleTooltip = React4.useCallback(
|
|
899
|
+
(event$1) => {
|
|
900
|
+
if (!enableTooltip) return;
|
|
901
|
+
const point = event.localPoint(event$1);
|
|
902
|
+
if (!point) return;
|
|
903
|
+
const x0 = xScale.invert(point.x - margin.left);
|
|
904
|
+
for (let i = 0; i < series.length; i++) {
|
|
905
|
+
const s = series[i];
|
|
906
|
+
if (!s) continue;
|
|
907
|
+
const index = bisectDate(s.data, x0, 1);
|
|
908
|
+
const d0 = s.data[index - 1];
|
|
909
|
+
const d1 = s.data[index];
|
|
910
|
+
if (!d0) continue;
|
|
911
|
+
const d = d1 && x0.valueOf() - d0.date.valueOf() > d1.date.valueOf() - x0.valueOf() ? d1 : d0;
|
|
912
|
+
showTooltip({
|
|
913
|
+
tooltipData: { datum: d, seriesIndex: i },
|
|
914
|
+
tooltipLeft: xScale(d.date) + margin.left,
|
|
915
|
+
tooltipTop: yScale(d.value) + margin.top
|
|
916
|
+
});
|
|
917
|
+
break;
|
|
918
|
+
}
|
|
919
|
+
},
|
|
920
|
+
[enableTooltip, margin, series, showTooltip, xScale, yScale]
|
|
921
|
+
);
|
|
922
|
+
if (width < 10 || height < 10) return null;
|
|
923
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
924
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "block", height, width, children: /* @__PURE__ */ jsxRuntime.jsxs(group.Group, { left: margin.left, top: margin.top, children: [
|
|
925
|
+
showGrid && yTicks.map((tick) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
926
|
+
"line",
|
|
927
|
+
{
|
|
928
|
+
className: "stroke-slate-a4",
|
|
929
|
+
strokeDasharray: "4,4",
|
|
930
|
+
x1: 0,
|
|
931
|
+
x2: innerWidth,
|
|
932
|
+
y1: yScale(tick),
|
|
933
|
+
y2: yScale(tick)
|
|
934
|
+
},
|
|
935
|
+
`grid-y-${tick}`
|
|
936
|
+
)),
|
|
937
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
938
|
+
"line",
|
|
939
|
+
{
|
|
940
|
+
className: "stroke-slate-a6",
|
|
941
|
+
x1: 0,
|
|
942
|
+
x2: innerWidth,
|
|
943
|
+
y1: innerHeight,
|
|
944
|
+
y2: innerHeight
|
|
945
|
+
}
|
|
946
|
+
),
|
|
947
|
+
xTicks.map((tick) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
948
|
+
"text",
|
|
949
|
+
{
|
|
950
|
+
className: "fill-slate-a11 text-xs",
|
|
951
|
+
dy: "1em",
|
|
952
|
+
textAnchor: "middle",
|
|
953
|
+
x: xScale(tick),
|
|
954
|
+
y: innerHeight + 8,
|
|
955
|
+
children: formatDate(tick)
|
|
956
|
+
},
|
|
957
|
+
`x-${tick.valueOf()}`
|
|
958
|
+
)),
|
|
959
|
+
yTicks.map((tick) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
960
|
+
"text",
|
|
961
|
+
{
|
|
962
|
+
className: "fill-slate-a11 text-xs",
|
|
963
|
+
dx: "-0.5em",
|
|
964
|
+
dy: "0.32em",
|
|
965
|
+
textAnchor: "end",
|
|
966
|
+
x: -4,
|
|
967
|
+
y: yScale(tick),
|
|
968
|
+
children: formatValue(tick)
|
|
969
|
+
},
|
|
970
|
+
`y-${tick}`
|
|
971
|
+
)),
|
|
972
|
+
series.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
973
|
+
shape.LinePath,
|
|
974
|
+
{
|
|
975
|
+
className: cn(LINE_COLORS[i % LINE_COLORS.length], s.className),
|
|
976
|
+
curve: resolveCurve(s.curve ?? defaultCurve),
|
|
977
|
+
data: s.data,
|
|
978
|
+
fill: "none",
|
|
979
|
+
strokeDasharray: s.dashed ? s.dashPattern ?? "6,4" : void 0,
|
|
980
|
+
strokeWidth: 2,
|
|
981
|
+
x: (d) => xScale(d.date),
|
|
982
|
+
y: (d) => yScale(d.value)
|
|
983
|
+
},
|
|
984
|
+
s.id
|
|
985
|
+
)),
|
|
986
|
+
enableTooltip && /* @__PURE__ */ jsxRuntime.jsx(
|
|
987
|
+
"rect",
|
|
988
|
+
{
|
|
989
|
+
fill: "transparent",
|
|
990
|
+
height: innerHeight,
|
|
991
|
+
onMouseLeave: hideTooltip,
|
|
992
|
+
onMouseMove: handleTooltip,
|
|
993
|
+
onTouchEnd: hideTooltip,
|
|
994
|
+
onTouchMove: handleTooltip,
|
|
995
|
+
width: innerWidth,
|
|
996
|
+
x: 0,
|
|
997
|
+
y: 0
|
|
998
|
+
}
|
|
999
|
+
),
|
|
1000
|
+
tooltipOpen && tooltipData && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1001
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1002
|
+
"line",
|
|
1003
|
+
{
|
|
1004
|
+
className: "stroke-slate-a6",
|
|
1005
|
+
pointerEvents: "none",
|
|
1006
|
+
strokeDasharray: "4,4",
|
|
1007
|
+
x1: xScale(tooltipData.datum.date),
|
|
1008
|
+
x2: xScale(tooltipData.datum.date),
|
|
1009
|
+
y1: 0,
|
|
1010
|
+
y2: innerHeight
|
|
1011
|
+
}
|
|
1012
|
+
),
|
|
1013
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1014
|
+
"circle",
|
|
1015
|
+
{
|
|
1016
|
+
className: cn(DOT_COLORS[tooltipData.seriesIndex % DOT_COLORS.length]),
|
|
1017
|
+
cx: xScale(tooltipData.datum.date),
|
|
1018
|
+
cy: yScale(tooltipData.datum.value),
|
|
1019
|
+
pointerEvents: "none",
|
|
1020
|
+
r: 4,
|
|
1021
|
+
stroke: "white",
|
|
1022
|
+
strokeWidth: 2
|
|
1023
|
+
}
|
|
1024
|
+
)
|
|
1025
|
+
] })
|
|
1026
|
+
] }) }),
|
|
1027
|
+
tooltipOpen && !!tooltipData && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1028
|
+
tooltip.Tooltip,
|
|
1029
|
+
{
|
|
1030
|
+
left: tooltipLeft,
|
|
1031
|
+
style: {
|
|
1032
|
+
position: "absolute",
|
|
1033
|
+
pointerEvents: "none",
|
|
1034
|
+
background: "transparent",
|
|
1035
|
+
border: "none",
|
|
1036
|
+
boxShadow: "none",
|
|
1037
|
+
padding: 0
|
|
1038
|
+
},
|
|
1039
|
+
top: tooltipTop,
|
|
1040
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-slate-2 px-3 py-2 text-sm shadow-md dark:bg-gray-2", children: [
|
|
1041
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-light", children: formatDate(tooltipData.datum.date) }),
|
|
1042
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1043
|
+
"div",
|
|
1044
|
+
{
|
|
1045
|
+
className: cn(
|
|
1046
|
+
"font-medium",
|
|
1047
|
+
TEXT_COLORS[tooltipData.seriesIndex % TEXT_COLORS.length]
|
|
1048
|
+
),
|
|
1049
|
+
children: formatValue(tooltipData.datum.value)
|
|
1050
|
+
}
|
|
1051
|
+
)
|
|
1052
|
+
] })
|
|
1053
|
+
}
|
|
1054
|
+
)
|
|
1055
|
+
] });
|
|
1056
|
+
}
|
|
1057
|
+
LineChart.displayName = "LineChart";
|
|
1058
|
+
var Popover = PopoverPrimitive__namespace.Root;
|
|
1059
|
+
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
1060
|
+
var PopoverContent = React4__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1061
|
+
PopoverPrimitive__namespace.Content,
|
|
1062
|
+
{
|
|
1063
|
+
align,
|
|
1064
|
+
className: cn(
|
|
1065
|
+
"z-50 w-72 rounded-xl border bg-slate-2 p-4 shadow-xs outline-hidden 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin)",
|
|
1066
|
+
className
|
|
1067
|
+
),
|
|
1068
|
+
ref,
|
|
1069
|
+
sideOffset,
|
|
1070
|
+
...props
|
|
1071
|
+
}
|
|
1072
|
+
) }));
|
|
1073
|
+
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
1074
|
+
var sizeClasses = {
|
|
1075
|
+
sm: "h-1",
|
|
1076
|
+
default: "h-2",
|
|
1077
|
+
lg: "h-3"
|
|
1078
|
+
};
|
|
1079
|
+
var Progress = React4__namespace.forwardRef(
|
|
1080
|
+
({ className, value, max = 100, size = "default", ...props }, ref) => {
|
|
1081
|
+
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
1082
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1083
|
+
"div",
|
|
1084
|
+
{
|
|
1085
|
+
"aria-valuemax": max,
|
|
1086
|
+
"aria-valuemin": 0,
|
|
1087
|
+
"aria-valuenow": value,
|
|
1088
|
+
className: cn(
|
|
1089
|
+
"w-full overflow-hidden rounded-full bg-slate-a4",
|
|
1090
|
+
sizeClasses[size],
|
|
1091
|
+
className
|
|
1092
|
+
),
|
|
1093
|
+
ref,
|
|
1094
|
+
role: "progressbar",
|
|
1095
|
+
...props,
|
|
1096
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1097
|
+
"div",
|
|
1098
|
+
{
|
|
1099
|
+
className: "h-full rounded-full bg-spark-9 transition-all duration-300",
|
|
1100
|
+
style: { width: `${percentage}%` }
|
|
1101
|
+
}
|
|
1102
|
+
)
|
|
1103
|
+
}
|
|
1104
|
+
);
|
|
1105
|
+
}
|
|
1106
|
+
);
|
|
1107
|
+
Progress.displayName = "Progress";
|
|
1108
|
+
var ScrollArea = React4__namespace.forwardRef(({ className, children, direction = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1109
|
+
ScrollAreaPrimitive__namespace.Root,
|
|
1110
|
+
{
|
|
1111
|
+
className: cn("relative overflow-hidden", className),
|
|
1112
|
+
ref,
|
|
1113
|
+
...props,
|
|
1114
|
+
children: [
|
|
1115
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Viewport, { className: "size-full rounded-[inherit]", children }),
|
|
1116
|
+
direction !== "horizontal" && /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { orientation: "vertical" }),
|
|
1117
|
+
direction !== "vertical" && /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { orientation: "horizontal" }),
|
|
1118
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
|
|
1119
|
+
]
|
|
1120
|
+
}
|
|
1121
|
+
));
|
|
1122
|
+
ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
|
|
1123
|
+
var ScrollBar = React4__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1124
|
+
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
1125
|
+
{
|
|
1126
|
+
className: cn(
|
|
1127
|
+
"flex touch-none select-none transition-colors",
|
|
1128
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-px",
|
|
1129
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-px empty:hidden",
|
|
1130
|
+
className
|
|
1131
|
+
),
|
|
1132
|
+
orientation,
|
|
1133
|
+
ref,
|
|
1134
|
+
...props,
|
|
1135
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.ScrollAreaThumb, { className: "relative flex-1 rounded-[24px] bg-gray-8" })
|
|
1136
|
+
}
|
|
1137
|
+
));
|
|
1138
|
+
ScrollBar.displayName = ScrollAreaPrimitive__namespace.ScrollAreaScrollbar.displayName;
|
|
1139
|
+
var ChevronDownIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1140
|
+
"svg",
|
|
1141
|
+
{
|
|
1142
|
+
fill: "none",
|
|
1143
|
+
height: "24",
|
|
1144
|
+
viewBox: "0 0 24 24",
|
|
1145
|
+
width: "24",
|
|
1146
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1147
|
+
...props,
|
|
1148
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1149
|
+
"path",
|
|
1150
|
+
{
|
|
1151
|
+
d: "M12 14.975C11.8667 14.975 11.7417 14.9542 11.625 14.9125C11.5083 14.8708 11.4 14.8 11.3 14.7L6.7 10.1C6.51667 9.91667 6.425 9.68334 6.425 9.4C6.425 9.11667 6.51667 8.88334 6.7 8.7C6.88334 8.51667 7.11667 8.425 7.4 8.425C7.68334 8.425 7.91667 8.51667 8.1 8.7L12 12.6L15.9 8.7C16.0833 8.51667 16.3167 8.425 16.6 8.425C16.8833 8.425 17.1167 8.51667 17.3 8.7C17.4833 8.88334 17.575 9.11667 17.575 9.4C17.575 9.68334 17.4833 9.91667 17.3 10.1L12.7 14.7C12.6 14.8 12.4917 14.8708 12.375 14.9125C12.2583 14.9542 12.1333 14.975 12 14.975Z",
|
|
1152
|
+
fill: "currentColor"
|
|
1153
|
+
}
|
|
1154
|
+
)
|
|
1155
|
+
}
|
|
1156
|
+
);
|
|
1157
|
+
var Select = SelectPrimitive__namespace.Root;
|
|
1158
|
+
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
1159
|
+
var SelectValue = SelectPrimitive__namespace.Value;
|
|
1160
|
+
var SelectTrigger = React4__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1161
|
+
SelectPrimitive__namespace.Trigger,
|
|
1162
|
+
{
|
|
1163
|
+
className: cn(
|
|
1164
|
+
"flex w-full items-center justify-between focus:outline-hidden focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
1165
|
+
className
|
|
1166
|
+
),
|
|
1167
|
+
ref,
|
|
1168
|
+
...props,
|
|
1169
|
+
children
|
|
1170
|
+
}
|
|
1171
|
+
));
|
|
1172
|
+
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
1173
|
+
var SelectTriggerIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1174
|
+
SelectPrimitive__namespace.Icon,
|
|
1175
|
+
{
|
|
1176
|
+
asChild: true,
|
|
1177
|
+
className: "not-sr-only in-data-[state=open]:rotate-180",
|
|
1178
|
+
role: "presentation",
|
|
1179
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, { className: "size-6 shrink-0 text-spark-a11" })
|
|
1180
|
+
}
|
|
1181
|
+
);
|
|
1182
|
+
SelectTriggerIcon.displayName = "SelectTriggerIcon";
|
|
1183
|
+
var SelectScrollUpButton = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1184
|
+
SelectPrimitive__namespace.ScrollUpButton,
|
|
1185
|
+
{
|
|
1186
|
+
className: cn(
|
|
1187
|
+
"absolute left-0 right-0 top-0 z-1 flex w-full cursor-default items-center justify-center py-1 transition-all max-sm:pointer-events-none",
|
|
1188
|
+
className
|
|
1189
|
+
),
|
|
1190
|
+
ref,
|
|
1191
|
+
...props,
|
|
1192
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, { className: "size-6 shrink-0 rotate-180" })
|
|
1193
|
+
}
|
|
1194
|
+
));
|
|
1195
|
+
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
1196
|
+
var SelectScrollDownButton = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1197
|
+
SelectPrimitive__namespace.ScrollDownButton,
|
|
1198
|
+
{
|
|
1199
|
+
className: cn(
|
|
1200
|
+
"absolute bottom-0 left-0 right-0 z-1 flex w-full cursor-default items-center justify-center py-1 transition-all max-sm:pointer-events-none",
|
|
1201
|
+
className
|
|
1202
|
+
),
|
|
1203
|
+
ref,
|
|
1204
|
+
...props,
|
|
1205
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, { className: "size-6 shrink-0" })
|
|
1206
|
+
}
|
|
1207
|
+
));
|
|
1208
|
+
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
1209
|
+
var SelectLabel = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1210
|
+
SelectPrimitive__namespace.Label,
|
|
1211
|
+
{
|
|
1212
|
+
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
1213
|
+
ref,
|
|
1214
|
+
...props
|
|
1215
|
+
}
|
|
1216
|
+
));
|
|
1217
|
+
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
1218
|
+
var SelectItem = React4__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1219
|
+
SelectPrimitive__namespace.Item,
|
|
1220
|
+
{
|
|
1221
|
+
className: cn(
|
|
1222
|
+
"relative flex w-full cursor-default select-none items-center outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1223
|
+
className
|
|
1224
|
+
),
|
|
1225
|
+
ref,
|
|
1226
|
+
...props,
|
|
1227
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
|
|
1228
|
+
}
|
|
1229
|
+
));
|
|
1230
|
+
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
1231
|
+
var SelectSeparator = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1232
|
+
SelectPrimitive__namespace.Separator,
|
|
1233
|
+
{
|
|
1234
|
+
className: cn("-mx-1 my-1 h-px", className),
|
|
1235
|
+
ref,
|
|
1236
|
+
...props
|
|
1237
|
+
}
|
|
1238
|
+
));
|
|
1239
|
+
SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
|
|
1240
|
+
var SelectContent = React4__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1241
|
+
SelectPrimitive__namespace.Content,
|
|
1242
|
+
{
|
|
1243
|
+
className: cn(
|
|
1244
|
+
"duration-250 relative z-50 max-h-96 w-[var(--radix-select-trigger-width)] min-w-[8rem] overflow-hidden 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-100 data-[state=open]:zoom-in-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-select-content-transform-origin)",
|
|
1245
|
+
position === "popper" && "data-[side=bottom]:translate-y-0 data-[side=left]:-translate-x-0 data-[side=right]:translate-x-0 data-[side=top]:-translate-y-0",
|
|
1246
|
+
className
|
|
1247
|
+
),
|
|
1248
|
+
position,
|
|
1249
|
+
ref,
|
|
1250
|
+
...props,
|
|
1251
|
+
children: [
|
|
1252
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
|
|
1253
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1254
|
+
SelectPrimitive__namespace.Viewport,
|
|
1255
|
+
{
|
|
1256
|
+
className: cn(
|
|
1257
|
+
"p-0",
|
|
1258
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-[var(--radix-select-trigger-width)]"
|
|
1259
|
+
),
|
|
1260
|
+
children
|
|
1261
|
+
}
|
|
1262
|
+
),
|
|
1263
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
|
|
1264
|
+
]
|
|
1265
|
+
}
|
|
1266
|
+
) }));
|
|
1267
|
+
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
1268
|
+
var Separator2 = React4__namespace.forwardRef(
|
|
1269
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1270
|
+
"div",
|
|
1271
|
+
{
|
|
1272
|
+
className: cn(
|
|
1273
|
+
"shrink-0 bg-gray",
|
|
1274
|
+
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
1275
|
+
className
|
|
1276
|
+
),
|
|
1277
|
+
"data-orientation": orientation,
|
|
1278
|
+
ref,
|
|
1279
|
+
role: decorative ? "none" : "separator",
|
|
1280
|
+
...props
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
);
|
|
1284
|
+
Separator2.displayName = "Separator";
|
|
1285
|
+
var XIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1286
|
+
"svg",
|
|
1287
|
+
{
|
|
1288
|
+
className: "size-6",
|
|
1289
|
+
fill: "none",
|
|
1290
|
+
height: "24",
|
|
1291
|
+
viewBox: "0 0 24 24",
|
|
1292
|
+
width: "24",
|
|
1293
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1294
|
+
...props,
|
|
1295
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1296
|
+
"path",
|
|
1297
|
+
{
|
|
1298
|
+
d: "M12 13.4L7.1 18.3C6.91667 18.4833 6.68333 18.575 6.4 18.575C6.11667 18.575 5.88333 18.4833 5.7 18.3C5.51667 18.1167 5.425 17.8833 5.425 17.6C5.425 17.3167 5.51667 17.0833 5.7 16.9L10.6 12L5.7 7.09999C5.51667 6.91665 5.425 6.68332 5.425 6.39999C5.425 6.11665 5.51667 5.88332 5.7 5.69999C5.88333 5.51665 6.11667 5.42499 6.4 5.42499C6.68333 5.42499 6.91667 5.51665 7.1 5.69999L12 10.6L16.9 5.69999C17.0833 5.51665 17.3167 5.42499 17.6 5.42499C17.8833 5.42499 18.1167 5.51665 18.3 5.69999C18.4833 5.88332 18.575 6.11665 18.575 6.39999C18.575 6.68332 18.4833 6.91665 18.3 7.09999L13.4 12L18.3 16.9C18.4833 17.0833 18.575 17.3167 18.575 17.6C18.575 17.8833 18.4833 18.1167 18.3 18.3C18.1167 18.4833 17.8833 18.575 17.6 18.575C17.3167 18.575 17.0833 18.4833 16.9 18.3L12 13.4Z",
|
|
1299
|
+
fill: "currentColor"
|
|
1300
|
+
}
|
|
1301
|
+
)
|
|
1302
|
+
}
|
|
1303
|
+
);
|
|
1304
|
+
var Sheet = SheetPrimitive__namespace.Root;
|
|
1305
|
+
var SheetTrigger = SheetPrimitive__namespace.Trigger;
|
|
1306
|
+
var SheetClose = SheetPrimitive__namespace.Close;
|
|
1307
|
+
var SheetPortal = SheetPrimitive__namespace.Portal;
|
|
1308
|
+
var SheetOverlay = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1309
|
+
SheetPrimitive__namespace.Overlay,
|
|
1310
|
+
{
|
|
1311
|
+
className: cn(
|
|
1312
|
+
"fixed inset-0 z-50 bg-black-a6 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1313
|
+
className
|
|
1314
|
+
),
|
|
1315
|
+
ref,
|
|
1316
|
+
...props
|
|
1317
|
+
}
|
|
1318
|
+
));
|
|
1319
|
+
SheetOverlay.displayName = SheetPrimitive__namespace.Overlay.displayName;
|
|
1320
|
+
var sheetVariants = classVarianceAuthority.cva(
|
|
1321
|
+
"fixed z-50 gap-4 bg-slate-2 shadow-lg transition ease-in-out p-safe-offset-6 data-[state=closed]:duration-300 data-[state=open]:duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1322
|
+
{
|
|
1323
|
+
variants: {
|
|
1324
|
+
side: {
|
|
1325
|
+
top: "inset-x-0 top-0 data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
1326
|
+
bottom: "inset-x-0 bottom-0 data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
1327
|
+
left: "inset-y-0 left-0 h-full w-3/4 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
1328
|
+
right: "inset-y-0 right-0 h-full w-3/4 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
1329
|
+
}
|
|
1330
|
+
},
|
|
1331
|
+
defaultVariants: {
|
|
1332
|
+
side: "right"
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
);
|
|
1336
|
+
var SheetContent = React4__namespace.forwardRef(({ side = "right", className, children, closeLabel, closeClassName, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
|
|
1337
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
|
|
1338
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1339
|
+
SheetPrimitive__namespace.Content,
|
|
1340
|
+
{
|
|
1341
|
+
className: cn("text-gray", sheetVariants({ side }), className),
|
|
1342
|
+
ref,
|
|
1343
|
+
...props,
|
|
1344
|
+
children: [
|
|
1345
|
+
closeLabel ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1346
|
+
SheetPrimitive__namespace.Close,
|
|
1347
|
+
{
|
|
1348
|
+
className: cn(
|
|
1349
|
+
"inline-flex w-fit items-center gap-1 rounded-sm p-1 text-sm font-bold text-spark-a11 transition-colors focus:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-0 disabled:pointer-events-none hover:text-spark-a12",
|
|
1350
|
+
closeClassName
|
|
1351
|
+
),
|
|
1352
|
+
children: [
|
|
1353
|
+
/* @__PURE__ */ jsxRuntime.jsx(XIcon, {}),
|
|
1354
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: closeLabel })
|
|
1355
|
+
]
|
|
1356
|
+
}
|
|
1357
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 transition-opacity focus:outline-hidden focus:ring focus-visible:ring disabled:pointer-events-none data-[state=open]:bg-base-gray-soft hover:opacity-100", children: /* @__PURE__ */ jsxRuntime.jsx(XIcon, {}) }),
|
|
1358
|
+
children
|
|
1359
|
+
]
|
|
1360
|
+
}
|
|
1361
|
+
)
|
|
1362
|
+
] }));
|
|
1363
|
+
SheetContent.displayName = SheetPrimitive__namespace.Content.displayName;
|
|
1364
|
+
var SheetHeader = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props });
|
|
1365
|
+
SheetHeader.displayName = "SheetHeader";
|
|
1366
|
+
var SheetFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1367
|
+
"div",
|
|
1368
|
+
{
|
|
1369
|
+
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
1370
|
+
...props
|
|
1371
|
+
}
|
|
1372
|
+
);
|
|
1373
|
+
SheetFooter.displayName = "SheetFooter";
|
|
1374
|
+
var SheetTitle = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1375
|
+
SheetPrimitive__namespace.Title,
|
|
1376
|
+
{
|
|
1377
|
+
className: cn("text-lg font-semibold text-gray", className),
|
|
1378
|
+
ref,
|
|
1379
|
+
...props
|
|
1380
|
+
}
|
|
1381
|
+
));
|
|
1382
|
+
SheetTitle.displayName = SheetPrimitive__namespace.Title.displayName;
|
|
1383
|
+
var SheetDescription = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1384
|
+
SheetPrimitive__namespace.Description,
|
|
1385
|
+
{
|
|
1386
|
+
className: cn("text-sm text-gray-light", className),
|
|
1387
|
+
ref,
|
|
1388
|
+
...props
|
|
1389
|
+
}
|
|
1390
|
+
));
|
|
1391
|
+
SheetDescription.displayName = SheetPrimitive__namespace.Description.displayName;
|
|
1392
|
+
var Slider = React4__namespace.forwardRef(
|
|
1393
|
+
({ className, hint, min = 0, max = 100, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
|
|
1394
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex gap-0.75 pr-2 text-sm text-gray-light", children: [
|
|
1395
|
+
min,
|
|
1396
|
+
hint ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: hint }) : null
|
|
1397
|
+
] }),
|
|
1398
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1399
|
+
SliderPrimitive__namespace.Root,
|
|
1400
|
+
{
|
|
1401
|
+
className: cn("relative flex h-5 touch-none select-none items-center", className),
|
|
1402
|
+
max,
|
|
1403
|
+
min,
|
|
1404
|
+
ref,
|
|
1405
|
+
...props,
|
|
1406
|
+
children: [
|
|
1407
|
+
/* @__PURE__ */ jsxRuntime.jsx(SliderPrimitive__namespace.Track, { className: "relative h-[5px] w-full grow rounded-md bg-slate-a7", children: /* @__PURE__ */ jsxRuntime.jsx(SliderPrimitive__namespace.Range, { className: "absolute h-full rounded-md bg-base-accent-solid outline-hidden focus:outline-hidden" }) }),
|
|
1408
|
+
/* @__PURE__ */ jsxRuntime.jsx(SliderPrimitive__namespace.Thumb, { className: "block size-4 rounded-circle bg-base-accent-solid outline-hidden ring-4 ring-spark-a8 ring-offset-2 ring-offset-spark-3 focus:outline-hidden dark:ring-offset-white-contrast" })
|
|
1409
|
+
]
|
|
1410
|
+
}
|
|
1411
|
+
) }),
|
|
1412
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex gap-0.75 pl-2 text-sm text-gray-light", children: [
|
|
1413
|
+
max,
|
|
1414
|
+
hint ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: hint }) : null
|
|
1415
|
+
] })
|
|
1416
|
+
] })
|
|
1417
|
+
);
|
|
1418
|
+
Slider.displayName = "Slider";
|
|
1419
|
+
var CloseIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1420
|
+
"svg",
|
|
1421
|
+
{
|
|
1422
|
+
fill: "none",
|
|
1423
|
+
height: "12",
|
|
1424
|
+
viewBox: "0 0 12 12",
|
|
1425
|
+
width: "12",
|
|
1426
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1427
|
+
...props,
|
|
1428
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("g", { opacity: "0.6", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1429
|
+
"path",
|
|
1430
|
+
{
|
|
1431
|
+
d: "M6.00003 6.6999L3.55002 9.1499C3.45836 9.24157 3.34169 9.2874 3.20002 9.2874C3.05836 9.2874 2.94169 9.24157 2.85002 9.1499C2.75836 9.05824 2.71252 8.94157 2.71252 8.7999C2.71252 8.65824 2.75836 8.54157 2.85002 8.4499L5.30002 5.9999L2.85002 3.5499C2.75836 3.45824 2.71252 3.34157 2.71252 3.1999C2.71252 3.05824 2.75836 2.94157 2.85002 2.8499C2.94169 2.75824 3.05836 2.7124 3.20002 2.7124C3.34169 2.7124 3.45836 2.75824 3.55002 2.8499L6.00003 5.2999L8.45003 2.8499C8.54169 2.75824 8.65836 2.7124 8.80003 2.7124C8.94169 2.7124 9.05836 2.75824 9.15003 2.8499C9.24169 2.94157 9.28753 3.05824 9.28753 3.1999C9.28753 3.34157 9.24169 3.45824 9.15003 3.5499L6.70002 5.9999L9.15003 8.4499C9.24169 8.54157 9.28753 8.65824 9.28753 8.7999C9.28753 8.94157 9.24169 9.05824 9.15003 9.1499C9.05836 9.24157 8.94169 9.2874 8.80003 9.2874C8.65836 9.2874 8.54169 9.24157 8.45003 9.1499L6.00003 6.6999Z",
|
|
1432
|
+
fill: "currentColor"
|
|
1433
|
+
}
|
|
1434
|
+
) })
|
|
1435
|
+
}
|
|
1436
|
+
);
|
|
1437
|
+
var CheckIcon2 = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1438
|
+
"svg",
|
|
1439
|
+
{
|
|
1440
|
+
fill: "none",
|
|
1441
|
+
height: "12",
|
|
1442
|
+
viewBox: "0 0 12 12",
|
|
1443
|
+
width: "12",
|
|
1444
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1445
|
+
...props,
|
|
1446
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1447
|
+
"path",
|
|
1448
|
+
{
|
|
1449
|
+
d: "M4.77498 7.575L9.01248 3.3375C9.11248 3.2375 9.22915 3.1875 9.36248 3.1875C9.49582 3.1875 9.61248 3.2375 9.71248 3.3375C9.81248 3.4375 9.86248 3.55625 9.86248 3.69375C9.86248 3.83125 9.81248 3.95 9.71248 4.05L5.12498 8.65C5.02498 8.75 4.90832 8.8 4.77498 8.8C4.64165 8.8 4.52498 8.75 4.42498 8.65L2.27498 6.5C2.17498 6.4 2.12706 6.28125 2.13123 6.14375C2.1354 6.00625 2.18748 5.8875 2.28748 5.7875C2.38748 5.6875 2.50623 5.6375 2.64373 5.6375C2.78123 5.6375 2.89998 5.6875 2.99998 5.7875L4.77498 7.575Z",
|
|
1450
|
+
fill: "currentColor"
|
|
1451
|
+
}
|
|
1452
|
+
)
|
|
1453
|
+
}
|
|
1454
|
+
);
|
|
1455
|
+
var Switch = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1456
|
+
SwitchPrimitives__namespace.Root,
|
|
1457
|
+
{
|
|
1458
|
+
className: cn(
|
|
1459
|
+
"peer inline-flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-circle border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-base-accent-solid data-[state=unchecked]:bg-base-accent-soft",
|
|
1460
|
+
className
|
|
1461
|
+
),
|
|
1462
|
+
ref,
|
|
1463
|
+
...props,
|
|
1464
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1465
|
+
SwitchPrimitives__namespace.Thumb,
|
|
1466
|
+
{
|
|
1467
|
+
className: cn(
|
|
1468
|
+
"pointer-events-none inline-flex h-5 w-5 items-center justify-center rounded-circle bg-white-contrast shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
1469
|
+
),
|
|
1470
|
+
children: props.checked ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon2, { className: "text-accent-active dark:text-spark-8", role: "presentation" }) : /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { className: "text-gray-light dark:text-slate-8", role: "presentation" })
|
|
1471
|
+
}
|
|
1472
|
+
)
|
|
1473
|
+
}
|
|
1474
|
+
));
|
|
1475
|
+
Switch.displayName = "Switch";
|
|
1476
|
+
var Tabs = TabsPrimitive__namespace.Root;
|
|
1477
|
+
var tabsListVariants = {
|
|
1478
|
+
default: "inline-flex h-10 items-center justify-center gap-1",
|
|
1479
|
+
underline: "inline-flex h-10 items-center gap-4 border-b border-gray",
|
|
1480
|
+
pill: "inline-flex h-10 items-center gap-0 rounded-lg bg-slate-a3 p-1"
|
|
1481
|
+
};
|
|
1482
|
+
var TabsList = React4__namespace.forwardRef(({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1483
|
+
TabsPrimitive__namespace.List,
|
|
1484
|
+
{
|
|
1485
|
+
className: cn(tabsListVariants[variant], className),
|
|
1486
|
+
"data-variant": variant,
|
|
1487
|
+
ref,
|
|
1488
|
+
...props
|
|
1489
|
+
}
|
|
1490
|
+
));
|
|
1491
|
+
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
1492
|
+
var tabsTriggerBase = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all duration-200 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50";
|
|
1493
|
+
var tabsTriggerVariants = {
|
|
1494
|
+
default: "rounded-sm px-3 py-1.5 text-gray-light data-[state=active]:text-accent-active",
|
|
1495
|
+
underline: "relative px-1 pb-2.5 text-gray-light data-[state=active]:text-accent-active after:absolute after:bottom-0 after:left-0 after:h-0.5 after:w-full after:scale-x-0 after:bg-base-accent-solid after:transition-transform data-[state=active]:after:scale-x-100",
|
|
1496
|
+
pill: "rounded-md px-4 py-1.5 text-gray-light data-[state=active]:bg-slate-1 data-[state=active]:text-accent-active data-[state=active]:shadow-sm"
|
|
1497
|
+
};
|
|
1498
|
+
var TabsTrigger = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1499
|
+
TabsPrimitive__namespace.Trigger,
|
|
1500
|
+
{
|
|
1501
|
+
className: cn(
|
|
1502
|
+
tabsTriggerBase,
|
|
1503
|
+
// Auto-detect variant from parent via CSS — fallback to default styling.
|
|
1504
|
+
// The variant-specific classes are applied via group selectors.
|
|
1505
|
+
"group-data-[variant=underline]:relative group-data-[variant=underline]:px-1 group-data-[variant=underline]:pb-2.5",
|
|
1506
|
+
tabsTriggerVariants.default,
|
|
1507
|
+
className
|
|
1508
|
+
),
|
|
1509
|
+
ref,
|
|
1510
|
+
...props,
|
|
1511
|
+
children: props.children
|
|
1512
|
+
}
|
|
1513
|
+
));
|
|
1514
|
+
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
1515
|
+
var TabsTriggerUnderline = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1516
|
+
TabsPrimitive__namespace.Trigger,
|
|
1517
|
+
{
|
|
1518
|
+
className: cn(tabsTriggerBase, tabsTriggerVariants.underline, className),
|
|
1519
|
+
ref,
|
|
1520
|
+
...props
|
|
1521
|
+
}
|
|
1522
|
+
));
|
|
1523
|
+
TabsTriggerUnderline.displayName = "TabsTriggerUnderline";
|
|
1524
|
+
var TabsTriggerPill = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1525
|
+
TabsPrimitive__namespace.Trigger,
|
|
1526
|
+
{
|
|
1527
|
+
className: cn(tabsTriggerBase, tabsTriggerVariants.pill, className),
|
|
1528
|
+
ref,
|
|
1529
|
+
...props
|
|
1530
|
+
}
|
|
1531
|
+
));
|
|
1532
|
+
TabsTriggerPill.displayName = "TabsTriggerPill";
|
|
1533
|
+
var TabsContent = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1534
|
+
TabsPrimitive__namespace.Content,
|
|
1535
|
+
{
|
|
1536
|
+
className: cn(
|
|
1537
|
+
"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-0",
|
|
1538
|
+
className
|
|
1539
|
+
),
|
|
1540
|
+
ref,
|
|
1541
|
+
...props
|
|
1542
|
+
}
|
|
1543
|
+
));
|
|
1544
|
+
TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
|
|
275
1545
|
|
|
1546
|
+
exports.Accordion = Accordion;
|
|
1547
|
+
exports.AccordionContent = AccordionContent;
|
|
1548
|
+
exports.AccordionItem = AccordionItem;
|
|
1549
|
+
exports.AccordionTrigger = AccordionTrigger;
|
|
1550
|
+
exports.Badge = Badge;
|
|
276
1551
|
exports.Button = Button;
|
|
1552
|
+
exports.Callout = Callout;
|
|
277
1553
|
exports.Card = Card;
|
|
278
1554
|
exports.CardContent = CardContent;
|
|
279
1555
|
exports.CardDescription = CardDescription;
|
|
@@ -282,6 +1558,7 @@ exports.CardHeader = CardHeader;
|
|
|
282
1558
|
exports.CardIcon = CardIcon;
|
|
283
1559
|
exports.CardSkeleton = CardSkeleton;
|
|
284
1560
|
exports.CardTitle = CardTitle;
|
|
1561
|
+
exports.Checkbox = Checkbox;
|
|
285
1562
|
exports.Dialog = Dialog;
|
|
286
1563
|
exports.DialogClose = DialogClose;
|
|
287
1564
|
exports.DialogContent = DialogContent;
|
|
@@ -297,7 +1574,58 @@ exports.DisplayFieldContent = DisplayFieldContent;
|
|
|
297
1574
|
exports.DisplayFieldLabel = DisplayFieldLabel;
|
|
298
1575
|
exports.DisplayFieldSkeleton = DisplayFieldSkeleton;
|
|
299
1576
|
exports.DisplayFieldValue = DisplayFieldValue;
|
|
1577
|
+
exports.Drawer = Drawer;
|
|
1578
|
+
exports.DrawerClose = DrawerClose;
|
|
1579
|
+
exports.DrawerContent = DrawerContent;
|
|
1580
|
+
exports.DrawerDescription = DrawerDescription;
|
|
1581
|
+
exports.DrawerFooter = DrawerFooter;
|
|
1582
|
+
exports.DrawerHeader = DrawerHeader;
|
|
1583
|
+
exports.DrawerOverlay = DrawerOverlay;
|
|
1584
|
+
exports.DrawerPortal = DrawerPortal;
|
|
1585
|
+
exports.DrawerTitle = DrawerTitle;
|
|
1586
|
+
exports.DrawerTrigger = DrawerTrigger;
|
|
1587
|
+
exports.EnergyFlowChart = EnergyFlowChart;
|
|
1588
|
+
exports.Input = Input;
|
|
1589
|
+
exports.Label = Label;
|
|
1590
|
+
exports.LineChart = LineChart;
|
|
1591
|
+
exports.Popover = Popover;
|
|
1592
|
+
exports.PopoverContent = PopoverContent;
|
|
1593
|
+
exports.PopoverTrigger = PopoverTrigger;
|
|
1594
|
+
exports.Progress = Progress;
|
|
1595
|
+
exports.ScrollArea = ScrollArea;
|
|
1596
|
+
exports.ScrollBar = ScrollBar;
|
|
1597
|
+
exports.Select = Select;
|
|
1598
|
+
exports.SelectContent = SelectContent;
|
|
1599
|
+
exports.SelectGroup = SelectGroup;
|
|
1600
|
+
exports.SelectItem = SelectItem;
|
|
1601
|
+
exports.SelectLabel = SelectLabel;
|
|
1602
|
+
exports.SelectScrollDownButton = SelectScrollDownButton;
|
|
1603
|
+
exports.SelectScrollUpButton = SelectScrollUpButton;
|
|
1604
|
+
exports.SelectSeparator = SelectSeparator;
|
|
1605
|
+
exports.SelectTrigger = SelectTrigger;
|
|
1606
|
+
exports.SelectTriggerIcon = SelectTriggerIcon;
|
|
1607
|
+
exports.SelectValue = SelectValue;
|
|
1608
|
+
exports.Separator = Separator2;
|
|
1609
|
+
exports.Sheet = Sheet;
|
|
1610
|
+
exports.SheetClose = SheetClose;
|
|
1611
|
+
exports.SheetContent = SheetContent;
|
|
1612
|
+
exports.SheetDescription = SheetDescription;
|
|
1613
|
+
exports.SheetFooter = SheetFooter;
|
|
1614
|
+
exports.SheetHeader = SheetHeader;
|
|
1615
|
+
exports.SheetOverlay = SheetOverlay;
|
|
1616
|
+
exports.SheetPortal = SheetPortal;
|
|
1617
|
+
exports.SheetTitle = SheetTitle;
|
|
1618
|
+
exports.SheetTrigger = SheetTrigger;
|
|
1619
|
+
exports.Slider = Slider;
|
|
1620
|
+
exports.Switch = Switch;
|
|
1621
|
+
exports.Tabs = Tabs;
|
|
1622
|
+
exports.TabsContent = TabsContent;
|
|
1623
|
+
exports.TabsList = TabsList;
|
|
1624
|
+
exports.TabsTrigger = TabsTrigger;
|
|
1625
|
+
exports.TabsTriggerPill = TabsTriggerPill;
|
|
1626
|
+
exports.TabsTriggerUnderline = TabsTriggerUnderline;
|
|
300
1627
|
exports.buttonVariants = buttonVariants;
|
|
301
1628
|
exports.cn = cn;
|
|
1629
|
+
exports.sheetVariants = sheetVariants;
|
|
302
1630
|
//# sourceMappingURL=index.cjs.map
|
|
303
1631
|
//# sourceMappingURL=index.cjs.map
|