@mirror-physics/fractal-ui 0.2.0-next.31 → 0.2.0-next.33
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 +269 -246
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +57 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +254 -232
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -165,44 +165,65 @@ var Button = React.forwardRef(
|
|
|
165
165
|
);
|
|
166
166
|
Button.displayName = "Button";
|
|
167
167
|
|
|
168
|
+
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
169
|
+
import { ChevronRight } from "@mirror-physics/fractal-icons";
|
|
170
|
+
import { jsx, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
171
|
+
function Breadcrumbs({
|
|
172
|
+
items,
|
|
173
|
+
ariaLabel = "Breadcrumbs",
|
|
174
|
+
separator = /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", size: 14 }),
|
|
175
|
+
className,
|
|
176
|
+
...props
|
|
177
|
+
}) {
|
|
178
|
+
if (items.length === 0) return null;
|
|
179
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, className: cn("fractal-breadcrumbs", className), ...props, children: /* @__PURE__ */ jsx("ol", { className: "fractal-breadcrumbs__list", children: items.map((item, index) => {
|
|
180
|
+
const isCurrent = index === items.length - 1;
|
|
181
|
+
const content = isCurrent ? /* @__PURE__ */ jsx("span", { "aria-current": "page", className: "fractal-breadcrumbs__current", children: item.label }) : /* @__PURE__ */ jsx("a", { className: "fractal-breadcrumbs__link", href: item.href ?? "#", onClick: item.onClick, children: item.label });
|
|
182
|
+
return /* @__PURE__ */ jsxs2("li", { className: "fractal-breadcrumbs__item", children: [
|
|
183
|
+
index > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "fractal-breadcrumbs__separator", children: separator }),
|
|
184
|
+
content
|
|
185
|
+
] }, index);
|
|
186
|
+
}) }) });
|
|
187
|
+
}
|
|
188
|
+
|
|
168
189
|
// src/components/Card/Card.tsx
|
|
169
190
|
import * as React2 from "react";
|
|
170
191
|
import { Folder as FolderIcon } from "@mirror-physics/fractal-icons";
|
|
171
|
-
import { jsx, jsxs as
|
|
192
|
+
import { jsx as jsx2, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
172
193
|
var Card = React2.forwardRef(
|
|
173
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
194
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2("div", { ref, className: cn("fractal-card", className), ...props })
|
|
174
195
|
);
|
|
175
196
|
Card.displayName = "Card";
|
|
176
197
|
var CardHeader = React2.forwardRef(
|
|
177
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
198
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2("div", { ref, className: cn("fractal-card-header", className), ...props })
|
|
178
199
|
);
|
|
179
200
|
CardHeader.displayName = "CardHeader";
|
|
180
201
|
var CardTitle = React2.forwardRef(
|
|
181
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
202
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2("h3", { ref, className: cn("fractal-card-title", className), ...props })
|
|
182
203
|
);
|
|
183
204
|
CardTitle.displayName = "CardTitle";
|
|
184
205
|
var CardDescription = React2.forwardRef(
|
|
185
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
206
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2("p", { ref, className: cn("fractal-card-description", className), ...props })
|
|
186
207
|
);
|
|
187
208
|
CardDescription.displayName = "CardDescription";
|
|
188
209
|
var CardContent = React2.forwardRef(
|
|
189
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
210
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2("div", { ref, className: cn("fractal-card-content", className), ...props })
|
|
190
211
|
);
|
|
191
212
|
CardContent.displayName = "CardContent";
|
|
192
213
|
var CardFooter = React2.forwardRef(
|
|
193
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
214
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2("div", { ref, className: cn("fractal-card-footer", className), ...props })
|
|
194
215
|
);
|
|
195
216
|
CardFooter.displayName = "CardFooter";
|
|
196
217
|
var FeatureCard = React2.forwardRef(
|
|
197
|
-
({ icon, title, description, className, ...props }, ref) => /* @__PURE__ */
|
|
198
|
-
icon && /* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
218
|
+
({ icon, title, description, className, ...props }, ref) => /* @__PURE__ */ jsxs3("div", { ref, className: cn("fractal-feature-card", className), ...props, children: [
|
|
219
|
+
icon && /* @__PURE__ */ jsx2("div", { className: "fractal-feature-card__icon", children: icon }),
|
|
220
|
+
/* @__PURE__ */ jsx2("h3", { className: "fractal-feature-card__title", children: title }),
|
|
221
|
+
/* @__PURE__ */ jsx2("p", { className: "fractal-feature-card__description", children: description })
|
|
201
222
|
] })
|
|
202
223
|
);
|
|
203
224
|
FeatureCard.displayName = "FeatureCard";
|
|
204
225
|
var FolderCard = React2.forwardRef(
|
|
205
|
-
({ name, sessionCount, selected, className, onClick, ...props }, ref) => /* @__PURE__ */
|
|
226
|
+
({ name, sessionCount, selected, className, onClick, ...props }, ref) => /* @__PURE__ */ jsxs3(
|
|
206
227
|
"div",
|
|
207
228
|
{
|
|
208
229
|
ref,
|
|
@@ -218,11 +239,11 @@ var FolderCard = React2.forwardRef(
|
|
|
218
239
|
className: cn("fractal-folder-card", selected && "fractal-folder-card--selected", className),
|
|
219
240
|
...props,
|
|
220
241
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ jsxs3("div", { className: "fractal-folder-card__header", children: [
|
|
243
|
+
/* @__PURE__ */ jsx2(FolderIcon, { size: 16, className: "fractal-folder-card__icon", "aria-hidden": true }),
|
|
244
|
+
/* @__PURE__ */ jsx2("span", { className: "fractal-folder-card__name", children: name })
|
|
224
245
|
] }),
|
|
225
|
-
sessionCount !== void 0 && /* @__PURE__ */
|
|
246
|
+
sessionCount !== void 0 && /* @__PURE__ */ jsx2("div", { className: "fractal-folder-card__footer", children: /* @__PURE__ */ jsxs3("span", { className: "fractal-folder-card__sessions", children: [
|
|
226
247
|
sessionCount,
|
|
227
248
|
" ",
|
|
228
249
|
sessionCount === 1 ? "session" : "sessions"
|
|
@@ -235,7 +256,7 @@ FolderCard.displayName = "FolderCard";
|
|
|
235
256
|
|
|
236
257
|
// src/components/PromptCard/PromptCard.tsx
|
|
237
258
|
import * as React3 from "react";
|
|
238
|
-
import { jsx as
|
|
259
|
+
import { jsx as jsx3, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
239
260
|
var titleToPrompt = (title) => typeof title === "string" || typeof title === "number" ? String(title) : "";
|
|
240
261
|
var PromptCard = React3.forwardRef(
|
|
241
262
|
({
|
|
@@ -256,7 +277,7 @@ var PromptCard = React3.forwardRef(
|
|
|
256
277
|
onPromptSelect?.(prompt ?? titleToPrompt(title));
|
|
257
278
|
}
|
|
258
279
|
};
|
|
259
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ jsxs4(
|
|
260
281
|
"button",
|
|
261
282
|
{
|
|
262
283
|
ref,
|
|
@@ -271,8 +292,8 @@ var PromptCard = React3.forwardRef(
|
|
|
271
292
|
onClick: handleClick,
|
|
272
293
|
...props,
|
|
273
294
|
children: [
|
|
274
|
-
icon && /* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
295
|
+
icon && /* @__PURE__ */ jsx3("span", { className: "fractal-prompt-card__icon", "aria-hidden": "true", children: icon }),
|
|
296
|
+
/* @__PURE__ */ jsx3("span", { className: "fractal-prompt-card__title", children: title })
|
|
276
297
|
]
|
|
277
298
|
}
|
|
278
299
|
);
|
|
@@ -280,7 +301,7 @@ var PromptCard = React3.forwardRef(
|
|
|
280
301
|
);
|
|
281
302
|
PromptCard.displayName = "PromptCard";
|
|
282
303
|
var PromptGrid = React3.forwardRef(
|
|
283
|
-
({ compact, padded, className, ...props }, ref) => /* @__PURE__ */
|
|
304
|
+
({ compact, padded, className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
284
305
|
"div",
|
|
285
306
|
{
|
|
286
307
|
ref,
|
|
@@ -298,9 +319,9 @@ PromptGrid.displayName = "PromptGrid";
|
|
|
298
319
|
|
|
299
320
|
// src/components/Input/Input.tsx
|
|
300
321
|
import * as React4 from "react";
|
|
301
|
-
import { jsx as
|
|
322
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
302
323
|
var Input = React4.forwardRef(
|
|
303
|
-
({ className, type, ...props }, ref) => /* @__PURE__ */
|
|
324
|
+
({ className, type, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
304
325
|
"input",
|
|
305
326
|
{
|
|
306
327
|
type,
|
|
@@ -314,9 +335,9 @@ Input.displayName = "Input";
|
|
|
314
335
|
|
|
315
336
|
// src/components/Label/Label.tsx
|
|
316
337
|
import * as React5 from "react";
|
|
317
|
-
import { jsx as
|
|
338
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
318
339
|
var Label = React5.forwardRef(
|
|
319
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
340
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
320
341
|
"label",
|
|
321
342
|
{
|
|
322
343
|
ref,
|
|
@@ -330,7 +351,7 @@ Label.displayName = "Label";
|
|
|
330
351
|
// src/components/Alert/Alert.tsx
|
|
331
352
|
import * as React6 from "react";
|
|
332
353
|
import { CircleCheck, CircleClose, CircleInfo, Warning } from "@mirror-physics/fractal-icons";
|
|
333
|
-
import { jsx as
|
|
354
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
334
355
|
var defaultIcons = {
|
|
335
356
|
default: CircleInfo,
|
|
336
357
|
info: CircleInfo,
|
|
@@ -341,7 +362,7 @@ var defaultIcons = {
|
|
|
341
362
|
var Alert = React6.forwardRef(
|
|
342
363
|
({ className, variant = "default", icon, children, ...props }, ref) => {
|
|
343
364
|
const DefaultIcon = defaultIcons[variant];
|
|
344
|
-
return /* @__PURE__ */
|
|
365
|
+
return /* @__PURE__ */ jsxs5(
|
|
345
366
|
"div",
|
|
346
367
|
{
|
|
347
368
|
ref,
|
|
@@ -349,8 +370,8 @@ var Alert = React6.forwardRef(
|
|
|
349
370
|
className: cn("fractal-alert", `fractal-alert--${variant}`, className),
|
|
350
371
|
...props,
|
|
351
372
|
children: [
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ jsx6("span", { className: "fractal-alert-icon", "aria-hidden": true, children: icon ?? /* @__PURE__ */ jsx6(DefaultIcon, { size: 18 }) }),
|
|
374
|
+
/* @__PURE__ */ jsx6("div", { className: "fractal-alert-content", children })
|
|
354
375
|
]
|
|
355
376
|
}
|
|
356
377
|
);
|
|
@@ -358,18 +379,18 @@ var Alert = React6.forwardRef(
|
|
|
358
379
|
);
|
|
359
380
|
Alert.displayName = "Alert";
|
|
360
381
|
var AlertTitle = React6.forwardRef(
|
|
361
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
382
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx6("h5", { ref, className: cn("fractal-alert-title", className), ...props })
|
|
362
383
|
);
|
|
363
384
|
AlertTitle.displayName = "AlertTitle";
|
|
364
385
|
var AlertDescription = React6.forwardRef(
|
|
365
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
386
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx6("div", { ref, className: cn("fractal-alert-description", className), ...props })
|
|
366
387
|
);
|
|
367
388
|
AlertDescription.displayName = "AlertDescription";
|
|
368
389
|
|
|
369
390
|
// src/components/Toggle/Toggle.tsx
|
|
370
|
-
import { jsx as
|
|
391
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
371
392
|
function Toggle({ checked, onChange, label, className }) {
|
|
372
|
-
return /* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ jsxs6(
|
|
373
394
|
"button",
|
|
374
395
|
{
|
|
375
396
|
type: "button",
|
|
@@ -378,8 +399,8 @@ function Toggle({ checked, onChange, label, className }) {
|
|
|
378
399
|
className: cn("fractal-toggle", className),
|
|
379
400
|
onClick: () => onChange(!checked),
|
|
380
401
|
children: [
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
label && /* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ jsx7("span", { className: cn("fractal-toggle-track", checked && "fractal-toggle-track--checked"), children: /* @__PURE__ */ jsx7("span", { className: cn("fractal-toggle-thumb", checked && "fractal-toggle-thumb--checked") }) }),
|
|
403
|
+
label && /* @__PURE__ */ jsx7("span", { className: "fractal-toggle-label", children: label })
|
|
383
404
|
]
|
|
384
405
|
}
|
|
385
406
|
);
|
|
@@ -440,7 +461,7 @@ function useEscapeDismiss(priority, handler, enabled = true) {
|
|
|
440
461
|
|
|
441
462
|
// src/components/UILoader/UILoader.tsx
|
|
442
463
|
import { useId } from "react";
|
|
443
|
-
import { jsx as
|
|
464
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
444
465
|
var LEFT = "M0 53C0 51 1.6 49.5 3.6 49.5h16.5c1 0 1.9.4 2.5 1L42.1 69.6c.7.7 1.1 1.6 1.1 2.5v16.2c0 2-1.6 3.5-3.6 3.5H23.1c-1 0-1.9-.4-2.5-1L1.1 71.7C.4 71 0 70.1 0 69.2V53Z";
|
|
445
466
|
var CENTER = "M0 3.5C0 1.6 1.6 0 3.6 0h16.5c1 0 1.9.4 2.5 1L92.5 69.6c.7.7 1 1.6 1 2.5v16.2c0 2-1.6 3.5-3.6 3.5H73.4c-1 0-1.9-.4-2.5-1L1.1 22.2C.4 21.6 0 20.7 0 19.7V3.5Z";
|
|
446
467
|
var RIGHT = "M50.4 3.5C50.4 1.6 52 0 54 0h16.5c1 0 1.9.4 2.5 1l69.8 68.6c.7.7 1.1 1.6 1.1 2.5v16.2c0 2-1.6 3.5-3.6 3.5h-16.5c-1 0-1.9-.4-2.5-1L51.4 22.2c-.7-.6-1-1.5-1-2.5V3.5Z";
|
|
@@ -449,7 +470,7 @@ function UILoader({ size = 48, tone = "neutral", className, style, label = "Load
|
|
|
449
470
|
const clipId = `fractal-ui-loader-clip-${rawId}`;
|
|
450
471
|
const gradientId = `fractal-ui-loader-gradient-${rawId}`;
|
|
451
472
|
const height = typeof size === "number" ? `${size}px` : size;
|
|
452
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ jsx8(
|
|
453
474
|
"span",
|
|
454
475
|
{
|
|
455
476
|
"aria-hidden": ariaHidden || void 0,
|
|
@@ -457,53 +478,53 @@ function UILoader({ size = 48, tone = "neutral", className, style, label = "Load
|
|
|
457
478
|
className: cn("fractal-ui-loader", `fractal-ui-loader--${tone}`, className),
|
|
458
479
|
role: ariaHidden ? void 0 : "status",
|
|
459
480
|
style,
|
|
460
|
-
children: /* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
/* @__PURE__ */
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
/* @__PURE__ */
|
|
481
|
+
children: /* @__PURE__ */ jsxs7("svg", { "aria-hidden": "true", fill: "none", viewBox: "0 0 144 92", style: { height, width: "auto" }, children: [
|
|
482
|
+
/* @__PURE__ */ jsxs7("defs", { children: [
|
|
483
|
+
/* @__PURE__ */ jsxs7("linearGradient", { id: gradientId, x1: "59", x2: "94.3", y1: "0", y2: "89.1", gradientUnits: "userSpaceOnUse", children: [
|
|
484
|
+
/* @__PURE__ */ jsx8("stop", { className: "fractal-ui-loader__stop-start", offset: "0" }),
|
|
485
|
+
/* @__PURE__ */ jsx8("stop", { className: "fractal-ui-loader__stop-end", offset: "1" })
|
|
465
486
|
] }),
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
/* @__PURE__ */
|
|
469
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ jsxs7("linearGradient", { id: `${gradientId}-shine`, x1: "0", x2: "1", y1: "0", y2: "0", children: [
|
|
488
|
+
/* @__PURE__ */ jsx8("stop", { offset: "0.4", stopColor: "white", stopOpacity: "0" }),
|
|
489
|
+
/* @__PURE__ */ jsx8("stop", { offset: "0.5", stopColor: "white", stopOpacity: "0.62" }),
|
|
490
|
+
/* @__PURE__ */ jsx8("stop", { offset: "0.6", stopColor: "white", stopOpacity: "0" })
|
|
470
491
|
] }),
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ jsxs7("clipPath", { id: clipId, children: [
|
|
493
|
+
/* @__PURE__ */ jsx8("path", { d: LEFT }),
|
|
494
|
+
/* @__PURE__ */ jsx8("path", { d: CENTER }),
|
|
495
|
+
/* @__PURE__ */ jsx8("path", { d: RIGHT })
|
|
475
496
|
] })
|
|
476
497
|
] }),
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
/* @__PURE__ */
|
|
479
|
-
/* @__PURE__ */
|
|
480
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ jsx8("path", { d: CENTER, fill: `url(#${gradientId})` }),
|
|
499
|
+
/* @__PURE__ */ jsx8("path", { d: RIGHT, fill: `url(#${gradientId})` }),
|
|
500
|
+
/* @__PURE__ */ jsx8("path", { d: LEFT, fill: `url(#${gradientId})` }),
|
|
501
|
+
/* @__PURE__ */ jsx8("g", { clipPath: `url(#${clipId})`, children: /* @__PURE__ */ jsx8("g", { className: "fractal-ui-loader__shine-axis", transform: "translate(72 46) rotate(68.4)", children: /* @__PURE__ */ jsx8("rect", { className: "fractal-ui-loader__shine", x: "-160", y: "-100", width: "320", height: "200", fill: `url(#${gradientId}-shine)` }) }) })
|
|
481
502
|
] })
|
|
482
503
|
}
|
|
483
504
|
);
|
|
484
505
|
}
|
|
485
506
|
|
|
486
507
|
// src/components/Modal/Modal.tsx
|
|
487
|
-
import { jsx as
|
|
488
|
-
var CloseIcon = () => /* @__PURE__ */
|
|
508
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
509
|
+
var CloseIcon = () => /* @__PURE__ */ jsx9("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx9("path", { d: "M12 4L4 12M4 4L12 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
489
510
|
function Modal({ open, onClose, title, children, danger, warn, footer, noClose, closeDisabled = false, size = "sm", loading = false, loadingLabel = "Loading", className }) {
|
|
490
511
|
useEscapeDismiss(80, onClose, open && !noClose && !closeDisabled);
|
|
491
512
|
if (!open) return null;
|
|
492
513
|
const sizeClass = `fractal-modal-panel--${size}`;
|
|
493
514
|
const accentClass = danger ? "fractal-modal-panel--danger" : warn ? "fractal-modal-panel--warn" : "";
|
|
494
515
|
return createPortal(
|
|
495
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ jsx9("div", { className: "fractal-modal-overlay", onClick: noClose || closeDisabled ? void 0 : onClose, children: /* @__PURE__ */ jsxs8(
|
|
496
517
|
"div",
|
|
497
518
|
{
|
|
498
519
|
className: cn("fractal-modal-panel", sizeClass, accentClass, className),
|
|
499
520
|
onClick: (e) => e.stopPropagation(),
|
|
500
521
|
children: [
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
-
!noClose && /* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ jsxs8("div", { className: "fractal-modal-title-row", children: [
|
|
523
|
+
/* @__PURE__ */ jsx9("h3", { className: cn("fractal-modal-title", danger && "fractal-modal-title--danger", warn && "fractal-modal-title--warn"), children: title }),
|
|
524
|
+
!noClose && /* @__PURE__ */ jsx9("button", { type: "button", onClick: onClose, title: "Close", disabled: closeDisabled, className: "fractal-modal-close", children: /* @__PURE__ */ jsx9(CloseIcon, {}) })
|
|
504
525
|
] }),
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
footer && /* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ jsx9("div", { "aria-busy": loading || void 0, className: cn("fractal-modal-body", size === "lg" && "fractal-modal-body--lg", loading && "fractal-modal-body--loading"), children: loading ? /* @__PURE__ */ jsx9(UILoader, { label: loadingLabel }) : children }),
|
|
527
|
+
footer && /* @__PURE__ */ jsx9("div", { className: "fractal-modal-footer", children: footer })
|
|
507
528
|
]
|
|
508
529
|
}
|
|
509
530
|
) }),
|
|
@@ -512,17 +533,17 @@ function Modal({ open, onClose, title, children, danger, warn, footer, noClose,
|
|
|
512
533
|
}
|
|
513
534
|
|
|
514
535
|
// src/components/DataTable/DataTable.tsx
|
|
515
|
-
import { jsx as
|
|
536
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
516
537
|
function DataTable({ columns, data, emptyMessage, header, size = "md", className }) {
|
|
517
|
-
return /* @__PURE__ */
|
|
518
|
-
header && /* @__PURE__ */
|
|
519
|
-
data.length === 0 ? /* @__PURE__ */
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */
|
|
538
|
+
return /* @__PURE__ */ jsx10("div", { className: cn("fractal-datatable", `fractal-datatable--${size}`, className), children: /* @__PURE__ */ jsxs9("div", { className: "fractal-datatable-surface", children: [
|
|
539
|
+
header && /* @__PURE__ */ jsx10("div", { className: "fractal-datatable-header", children: header }),
|
|
540
|
+
data.length === 0 ? /* @__PURE__ */ jsx10("div", { className: "fractal-datatable-empty", children: emptyMessage || "No data" }) : /* @__PURE__ */ jsxs9("table", { className: "fractal-datatable-table", children: [
|
|
541
|
+
/* @__PURE__ */ jsx10("thead", { children: /* @__PURE__ */ jsx10("tr", { className: "fractal-datatable-thead-row", children: columns.map((col) => /* @__PURE__ */ jsx10("th", { className: "fractal-datatable-th", style: { width: col.width }, children: col.header }, col.key)) }) }),
|
|
542
|
+
/* @__PURE__ */ jsx10("tbody", { children: data.map((row, rowIndex) => /* @__PURE__ */ jsx10(
|
|
522
543
|
"tr",
|
|
523
544
|
{
|
|
524
545
|
className: "fractal-datatable-row",
|
|
525
|
-
children: columns.map((col) => /* @__PURE__ */
|
|
546
|
+
children: columns.map((col) => /* @__PURE__ */ jsx10("td", { className: "fractal-datatable-td", style: { width: col.width }, children: col.render(row, rowIndex) }, col.key))
|
|
526
547
|
},
|
|
527
548
|
rowIndex
|
|
528
549
|
)) })
|
|
@@ -533,7 +554,7 @@ function DataTable({ columns, data, emptyMessage, header, size = "md", className
|
|
|
533
554
|
// src/components/Dropdown/Dropdown.tsx
|
|
534
555
|
import * as React7 from "react";
|
|
535
556
|
import { ChevronDown, ChevronUp } from "@mirror-physics/fractal-icons";
|
|
536
|
-
import { Fragment as Fragment2, jsx as
|
|
557
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
537
558
|
var MARGIN = 4;
|
|
538
559
|
function Dropdown({
|
|
539
560
|
items,
|
|
@@ -610,8 +631,8 @@ function Dropdown({
|
|
|
610
631
|
document.addEventListener("mousedown", handleClickOutside);
|
|
611
632
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
612
633
|
}, [open]);
|
|
613
|
-
return /* @__PURE__ */
|
|
614
|
-
/* @__PURE__ */
|
|
634
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn("fractal-dropdown", className), children: [
|
|
635
|
+
/* @__PURE__ */ jsxs10(
|
|
615
636
|
"button",
|
|
616
637
|
{
|
|
617
638
|
ref: triggerRef,
|
|
@@ -629,15 +650,15 @@ function Dropdown({
|
|
|
629
650
|
triggerClassName
|
|
630
651
|
),
|
|
631
652
|
children: [
|
|
632
|
-
triggerContent != null ? triggerContent : /* @__PURE__ */
|
|
633
|
-
selected.icon != null && /* @__PURE__ */
|
|
634
|
-
selected.description != null && (typeof selected.description !== "string" || selected.description !== "") && /* @__PURE__ */
|
|
653
|
+
triggerContent != null ? triggerContent : /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
654
|
+
selected.icon != null && /* @__PURE__ */ jsx11("span", { className: "fractal-dropdown-icon fractal-dropdown-icon--trigger", children: selected.icon }),
|
|
655
|
+
selected.description != null && (typeof selected.description !== "string" || selected.description !== "") && /* @__PURE__ */ jsx11("span", { className: "fractal-dropdown-selected-text", children: selected.description })
|
|
635
656
|
] }),
|
|
636
|
-
!noChevron && !iconOnly && /* @__PURE__ */
|
|
657
|
+
!noChevron && !iconOnly && /* @__PURE__ */ jsx11("span", { className: "fractal-dropdown-chevron", "aria-hidden": true, children: /* @__PURE__ */ jsx11(ChevronIcon, { size: size === "sm" ? 14 : 16 }) })
|
|
637
658
|
]
|
|
638
659
|
}
|
|
639
660
|
),
|
|
640
|
-
open && /* @__PURE__ */
|
|
661
|
+
open && /* @__PURE__ */ jsxs10(
|
|
641
662
|
"div",
|
|
642
663
|
{
|
|
643
664
|
ref: panelRef,
|
|
@@ -646,21 +667,21 @@ function Dropdown({
|
|
|
646
667
|
className: cn("fractal-dropdown-panel", `fractal-dropdown-panel--${size}`, panelClassName),
|
|
647
668
|
style: panelStyle,
|
|
648
669
|
children: [
|
|
649
|
-
label != null && /* @__PURE__ */
|
|
670
|
+
label != null && /* @__PURE__ */ jsx11("div", { className: "fractal-dropdown-label", children: label }),
|
|
650
671
|
visibleItems.map((item, index) => {
|
|
651
|
-
const topDivider = item.border === "top" ? /* @__PURE__ */
|
|
652
|
-
const bottomDivider = item.border === "bottom" ? /* @__PURE__ */
|
|
672
|
+
const topDivider = item.border === "top" ? /* @__PURE__ */ jsx11("div", { className: "fractal-dropdown-separator" }) : null;
|
|
673
|
+
const bottomDivider = item.border === "bottom" ? /* @__PURE__ */ jsx11("div", { className: "fractal-dropdown-separator" }) : null;
|
|
653
674
|
if (item.kind === "header") {
|
|
654
|
-
return /* @__PURE__ */
|
|
675
|
+
return /* @__PURE__ */ jsxs10(React7.Fragment, { children: [
|
|
655
676
|
topDivider,
|
|
656
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ jsx11("div", { role: "presentation", className: "fractal-dropdown-label", children: item.description }),
|
|
657
678
|
bottomDivider
|
|
658
679
|
] }, `header-${index}`);
|
|
659
680
|
}
|
|
660
681
|
const isSelected = item.value === selectedValue;
|
|
661
|
-
return /* @__PURE__ */
|
|
682
|
+
return /* @__PURE__ */ jsxs10(React7.Fragment, { children: [
|
|
662
683
|
topDivider,
|
|
663
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ jsxs10(
|
|
664
685
|
"button",
|
|
665
686
|
{
|
|
666
687
|
type: "button",
|
|
@@ -672,9 +693,9 @@ function Dropdown({
|
|
|
672
693
|
},
|
|
673
694
|
className: "fractal-dropdown-option",
|
|
674
695
|
children: [
|
|
675
|
-
item.icon != null && /* @__PURE__ */
|
|
676
|
-
item.description != null && (typeof item.description !== "string" || item.description !== "") && /* @__PURE__ */
|
|
677
|
-
item.trailing != null && /* @__PURE__ */
|
|
696
|
+
item.icon != null && /* @__PURE__ */ jsx11("span", { className: "fractal-dropdown-icon", children: item.icon }),
|
|
697
|
+
item.description != null && (typeof item.description !== "string" || item.description !== "") && /* @__PURE__ */ jsx11("span", { className: "fractal-dropdown-option-text", children: item.description }),
|
|
698
|
+
item.trailing != null && /* @__PURE__ */ jsx11("span", { className: "fractal-dropdown-trailing", children: item.trailing })
|
|
678
699
|
]
|
|
679
700
|
}
|
|
680
701
|
),
|
|
@@ -689,9 +710,9 @@ function Dropdown({
|
|
|
689
710
|
|
|
690
711
|
// src/components/Link/Link.tsx
|
|
691
712
|
import * as React8 from "react";
|
|
692
|
-
import { jsx as
|
|
713
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
693
714
|
var Link = React8.forwardRef(
|
|
694
|
-
({ className, theme = "default", size = "md", ...props }, ref) => /* @__PURE__ */
|
|
715
|
+
({ className, theme = "default", size = "md", ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
695
716
|
"a",
|
|
696
717
|
{
|
|
697
718
|
ref,
|
|
@@ -704,9 +725,9 @@ Link.displayName = "Link";
|
|
|
704
725
|
|
|
705
726
|
// src/components/Chip/Chip.tsx
|
|
706
727
|
import * as React9 from "react";
|
|
707
|
-
import { jsx as
|
|
728
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
708
729
|
var Chip = React9.forwardRef(
|
|
709
|
-
({ className, tone = "neutral", ...props }, ref) => /* @__PURE__ */
|
|
730
|
+
({ className, tone = "neutral", ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
710
731
|
"span",
|
|
711
732
|
{
|
|
712
733
|
ref,
|
|
@@ -719,9 +740,9 @@ Chip.displayName = "Chip";
|
|
|
719
740
|
|
|
720
741
|
// src/components/Checkbox/Checkbox.tsx
|
|
721
742
|
import { Checkbox as CheckboxIcon, CheckboxChecked } from "@mirror-physics/fractal-icons";
|
|
722
|
-
import { jsx as
|
|
743
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
723
744
|
function Checkbox({ checked, onCheckedChange, className, disabled, onClick, onKeyDown, ...props }) {
|
|
724
|
-
return /* @__PURE__ */
|
|
745
|
+
return /* @__PURE__ */ jsx14(
|
|
725
746
|
"button",
|
|
726
747
|
{
|
|
727
748
|
...props,
|
|
@@ -738,7 +759,7 @@ function Checkbox({ checked, onCheckedChange, className, disabled, onClick, onKe
|
|
|
738
759
|
onKeyDown?.(event);
|
|
739
760
|
if (event.key === " " || event.key === "Enter") event.stopPropagation();
|
|
740
761
|
},
|
|
741
|
-
children: checked ? /* @__PURE__ */
|
|
762
|
+
children: checked ? /* @__PURE__ */ jsx14(CheckboxChecked, { "aria-hidden": "true", size: 18 }) : /* @__PURE__ */ jsx14(CheckboxIcon, { "aria-hidden": "true", size: 18 })
|
|
742
763
|
}
|
|
743
764
|
);
|
|
744
765
|
}
|
|
@@ -746,7 +767,7 @@ function Checkbox({ checked, onCheckedChange, className, disabled, onClick, onKe
|
|
|
746
767
|
// src/components/SortableTable/SortableTable.tsx
|
|
747
768
|
import { useMemo, useState as useState3 } from "react";
|
|
748
769
|
import { ArrowUp, ArrowDown, ArrowsUpDown } from "@mirror-physics/fractal-icons";
|
|
749
|
-
import { jsx as
|
|
770
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
750
771
|
function SortableTable({
|
|
751
772
|
columns,
|
|
752
773
|
data,
|
|
@@ -822,13 +843,13 @@ function SortableTable({
|
|
|
822
843
|
onSortChange?.(nextKey, nextDirection);
|
|
823
844
|
}
|
|
824
845
|
};
|
|
825
|
-
return /* @__PURE__ */
|
|
826
|
-
header && /* @__PURE__ */
|
|
827
|
-
sorted.length === 0 ? /* @__PURE__ */
|
|
828
|
-
/* @__PURE__ */
|
|
846
|
+
return /* @__PURE__ */ jsx15("div", { className: cn("fractal-sortable-table", `fractal-sortable-table--${size}`, embedded && "fractal-sortable-table--embedded", className), children: /* @__PURE__ */ jsxs11("div", { className: "fractal-sortable-table-surface", children: [
|
|
847
|
+
header && /* @__PURE__ */ jsx15("div", { className: "fractal-sortable-table-header", children: header }),
|
|
848
|
+
sorted.length === 0 ? /* @__PURE__ */ jsx15("div", { className: "fractal-sortable-table-empty", children: emptyMessage || "No data" }) : /* @__PURE__ */ jsxs11("table", { className: "fractal-sortable-table-table", children: [
|
|
849
|
+
/* @__PURE__ */ jsx15("thead", { children: /* @__PURE__ */ jsx15("tr", { className: "fractal-sortable-table-thead-row", children: columns.map((col) => {
|
|
829
850
|
const isActive = activeKey === col.key && activeDirection !== null;
|
|
830
851
|
if (!col.sortable) {
|
|
831
|
-
return /* @__PURE__ */
|
|
852
|
+
return /* @__PURE__ */ jsx15(
|
|
832
853
|
"th",
|
|
833
854
|
{
|
|
834
855
|
className: "fractal-sortable-table-th",
|
|
@@ -838,12 +859,12 @@ function SortableTable({
|
|
|
838
859
|
col.key
|
|
839
860
|
);
|
|
840
861
|
}
|
|
841
|
-
return /* @__PURE__ */
|
|
862
|
+
return /* @__PURE__ */ jsx15(
|
|
842
863
|
"th",
|
|
843
864
|
{
|
|
844
865
|
className: "fractal-sortable-table-th fractal-sortable-table-th--sortable",
|
|
845
866
|
style: { width: col.width },
|
|
846
|
-
children: /* @__PURE__ */
|
|
867
|
+
children: /* @__PURE__ */ jsxs11(
|
|
847
868
|
"button",
|
|
848
869
|
{
|
|
849
870
|
type: "button",
|
|
@@ -854,8 +875,8 @@ function SortableTable({
|
|
|
854
875
|
onClick: () => handleSortClick(col.key),
|
|
855
876
|
"aria-sort": isActive ? activeDirection === "asc" ? "ascending" : "descending" : "none",
|
|
856
877
|
children: [
|
|
857
|
-
/* @__PURE__ */
|
|
858
|
-
/* @__PURE__ */
|
|
878
|
+
/* @__PURE__ */ jsx15("span", { children: col.header }),
|
|
879
|
+
/* @__PURE__ */ jsx15("span", { className: "fractal-sortable-table-sort-icon", "aria-hidden": "true", children: isActive && activeDirection === "asc" ? /* @__PURE__ */ jsx15(ArrowUp, { size: 14 }) : isActive && activeDirection === "desc" ? /* @__PURE__ */ jsx15(ArrowDown, { size: 14 }) : /* @__PURE__ */ jsx15(ArrowsUpDown, { size: 14 }) })
|
|
859
880
|
]
|
|
860
881
|
}
|
|
861
882
|
)
|
|
@@ -863,13 +884,13 @@ function SortableTable({
|
|
|
863
884
|
col.key
|
|
864
885
|
);
|
|
865
886
|
}) }) }),
|
|
866
|
-
/* @__PURE__ */
|
|
887
|
+
/* @__PURE__ */ jsx15("tbody", { children: sorted.map((row, rowIndex) => {
|
|
867
888
|
const highlighted = highlightRow?.(row, rowIndex) ?? false;
|
|
868
889
|
const action = rowAction ? {
|
|
869
890
|
label: rowAction.label(row, rowIndex),
|
|
870
891
|
icon: rowAction.icon(row, rowIndex)
|
|
871
892
|
} : null;
|
|
872
|
-
return /* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ jsx15(
|
|
873
894
|
"tr",
|
|
874
895
|
{
|
|
875
896
|
className: cn(
|
|
@@ -887,7 +908,7 @@ function SortableTable({
|
|
|
887
908
|
"aria-label": action?.label,
|
|
888
909
|
role: onRowClick ? "button" : void 0,
|
|
889
910
|
tabIndex: onRowClick ? 0 : void 0,
|
|
890
|
-
children: columns.map((col, columnIndex) => /* @__PURE__ */
|
|
911
|
+
children: columns.map((col, columnIndex) => /* @__PURE__ */ jsxs11(
|
|
891
912
|
"td",
|
|
892
913
|
{
|
|
893
914
|
className: cn(
|
|
@@ -897,7 +918,7 @@ function SortableTable({
|
|
|
897
918
|
style: { width: col.width, textAlign: col.align ?? "left" },
|
|
898
919
|
children: [
|
|
899
920
|
col.render(row, rowIndex),
|
|
900
|
-
action && columnIndex === columns.length - 1 && /* @__PURE__ */
|
|
921
|
+
action && columnIndex === columns.length - 1 && /* @__PURE__ */ jsx15("span", { className: "fractal-sortable-table-row-action", "aria-hidden": "true", children: /* @__PURE__ */ jsx15("span", { className: "fractal-sortable-table-row-action__icon", children: action.icon }) })
|
|
901
922
|
]
|
|
902
923
|
},
|
|
903
924
|
col.key
|
|
@@ -912,7 +933,7 @@ function SortableTable({
|
|
|
912
933
|
|
|
913
934
|
// src/components/Tabs/Tabs.tsx
|
|
914
935
|
import { useId as useId2, useLayoutEffect as useLayoutEffect2, useRef as useRef3, useState as useState4 } from "react";
|
|
915
|
-
import { jsx as
|
|
936
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
916
937
|
function Tabs({
|
|
917
938
|
items,
|
|
918
939
|
defaultValue,
|
|
@@ -982,8 +1003,8 @@ function Tabs({
|
|
|
982
1003
|
selectTab(nextId2);
|
|
983
1004
|
requestAnimationFrame(() => tabRefs.current[nextId2]?.focus());
|
|
984
1005
|
};
|
|
985
|
-
return /* @__PURE__ */
|
|
986
|
-
/* @__PURE__ */
|
|
1006
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn("fractal-tabs", divider && "fractal-tabs--divider", className), children: [
|
|
1007
|
+
/* @__PURE__ */ jsx16(
|
|
987
1008
|
"div",
|
|
988
1009
|
{
|
|
989
1010
|
ref: tabListRef,
|
|
@@ -996,7 +1017,7 @@ function Tabs({
|
|
|
996
1017
|
const isActive = item.id === activeId;
|
|
997
1018
|
const tabId = `${reactId}-tab-${item.id}`;
|
|
998
1019
|
const panelId = `${reactId}-panel-${item.id}`;
|
|
999
|
-
return /* @__PURE__ */
|
|
1020
|
+
return /* @__PURE__ */ jsx16(
|
|
1000
1021
|
"button",
|
|
1001
1022
|
{
|
|
1002
1023
|
ref: (el) => {
|
|
@@ -1027,7 +1048,7 @@ function Tabs({
|
|
|
1027
1048
|
const tabId = `${reactId}-tab-${item.id}`;
|
|
1028
1049
|
const panelId = `${reactId}-panel-${item.id}`;
|
|
1029
1050
|
const isActive = item.id === activeId;
|
|
1030
|
-
return /* @__PURE__ */
|
|
1051
|
+
return /* @__PURE__ */ jsx16(
|
|
1031
1052
|
"div",
|
|
1032
1053
|
{
|
|
1033
1054
|
id: panelId,
|
|
@@ -1045,7 +1066,7 @@ function Tabs({
|
|
|
1045
1066
|
|
|
1046
1067
|
// src/components/ContentSwitcher/ContentSwitcher.tsx
|
|
1047
1068
|
import * as React10 from "react";
|
|
1048
|
-
import { jsx as
|
|
1069
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1049
1070
|
function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = false, className }) {
|
|
1050
1071
|
const switcherRef = React10.useRef(null);
|
|
1051
1072
|
const buttonRefs = React10.useRef([]);
|
|
@@ -1085,7 +1106,7 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
1085
1106
|
onValueChange(items[nextIndex].value);
|
|
1086
1107
|
}
|
|
1087
1108
|
};
|
|
1088
|
-
return /* @__PURE__ */
|
|
1109
|
+
return /* @__PURE__ */ jsxs13(
|
|
1089
1110
|
"div",
|
|
1090
1111
|
{
|
|
1091
1112
|
className: cn("fractal-content-switcher", fullWidth && "fractal-content-switcher--full-width", className),
|
|
@@ -1093,10 +1114,10 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
1093
1114
|
"aria-label": ariaLabel,
|
|
1094
1115
|
ref: switcherRef,
|
|
1095
1116
|
children: [
|
|
1096
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ jsx17("span", { className: "fractal-content-switcher__indicator", "aria-hidden": true }),
|
|
1097
1118
|
items.map((item, index) => {
|
|
1098
1119
|
const active = item.value === value;
|
|
1099
|
-
return /* @__PURE__ */
|
|
1120
|
+
return /* @__PURE__ */ jsx17(
|
|
1100
1121
|
"button",
|
|
1101
1122
|
{
|
|
1102
1123
|
className: cn("fractal-content-switcher__item", active && "fractal-content-switcher__item--active"),
|
|
@@ -1129,8 +1150,8 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
1129
1150
|
|
|
1130
1151
|
// src/components/Disclosure/Disclosure.tsx
|
|
1131
1152
|
import { useId as useId3, useState as useState5 } from "react";
|
|
1132
|
-
import { ChevronRight, ChevronDown as ChevronDown2 } from "@mirror-physics/fractal-icons";
|
|
1133
|
-
import { jsx as
|
|
1153
|
+
import { ChevronRight as ChevronRight2, ChevronDown as ChevronDown2 } from "@mirror-physics/fractal-icons";
|
|
1154
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1134
1155
|
function Disclosure({
|
|
1135
1156
|
title,
|
|
1136
1157
|
meta,
|
|
@@ -1158,7 +1179,7 @@ function Disclosure({
|
|
|
1158
1179
|
onOpenChange?.(next);
|
|
1159
1180
|
}
|
|
1160
1181
|
};
|
|
1161
|
-
return /* @__PURE__ */
|
|
1182
|
+
return /* @__PURE__ */ jsxs14(
|
|
1162
1183
|
"div",
|
|
1163
1184
|
{
|
|
1164
1185
|
className: cn(
|
|
@@ -1169,7 +1190,7 @@ function Disclosure({
|
|
|
1169
1190
|
className
|
|
1170
1191
|
),
|
|
1171
1192
|
children: [
|
|
1172
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ jsxs14(
|
|
1173
1194
|
"button",
|
|
1174
1195
|
{
|
|
1175
1196
|
type: "button",
|
|
@@ -1180,13 +1201,13 @@ function Disclosure({
|
|
|
1180
1201
|
disabled,
|
|
1181
1202
|
onClick: toggle,
|
|
1182
1203
|
children: [
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
/* @__PURE__ */
|
|
1185
|
-
meta && /* @__PURE__ */
|
|
1204
|
+
/* @__PURE__ */ jsx18("span", { className: "fractal-disclosure-icon", "aria-hidden": "true", children: isOpen ? /* @__PURE__ */ jsx18(ChevronDown2, { size: 16 }) : /* @__PURE__ */ jsx18(ChevronRight2, { size: 16 }) }),
|
|
1205
|
+
/* @__PURE__ */ jsx18("span", { className: "fractal-disclosure-title", children: title }),
|
|
1206
|
+
meta && /* @__PURE__ */ jsx18("span", { className: "fractal-disclosure-meta", children: meta })
|
|
1186
1207
|
]
|
|
1187
1208
|
}
|
|
1188
1209
|
),
|
|
1189
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ jsx18(
|
|
1190
1211
|
"div",
|
|
1191
1212
|
{
|
|
1192
1213
|
id: panelId,
|
|
@@ -1194,7 +1215,7 @@ function Disclosure({
|
|
|
1194
1215
|
"aria-labelledby": headerId,
|
|
1195
1216
|
className: "fractal-disclosure-panel",
|
|
1196
1217
|
hidden: !isOpen,
|
|
1197
|
-
children: /* @__PURE__ */
|
|
1218
|
+
children: /* @__PURE__ */ jsx18("div", { className: "fractal-disclosure-panel-inner", children })
|
|
1198
1219
|
}
|
|
1199
1220
|
)
|
|
1200
1221
|
]
|
|
@@ -1203,18 +1224,18 @@ function Disclosure({
|
|
|
1203
1224
|
}
|
|
1204
1225
|
|
|
1205
1226
|
// src/components/LatticeLoader/LatticeLoader.tsx
|
|
1206
|
-
import { jsx as
|
|
1227
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1207
1228
|
var LATTICE_COUNT = 160;
|
|
1208
1229
|
var WAVE_PERIOD = 80;
|
|
1209
1230
|
function LatticeLoader({ className, label = "Loading", ...props }) {
|
|
1210
|
-
return /* @__PURE__ */
|
|
1231
|
+
return /* @__PURE__ */ jsx19(
|
|
1211
1232
|
"span",
|
|
1212
1233
|
{
|
|
1213
1234
|
"aria-label": label,
|
|
1214
1235
|
className: cn("fractal-lattice-loader", className),
|
|
1215
1236
|
role: "progressbar",
|
|
1216
1237
|
...props,
|
|
1217
|
-
children: Array.from({ length: LATTICE_COUNT }, (_, index) => /* @__PURE__ */
|
|
1238
|
+
children: Array.from({ length: LATTICE_COUNT }, (_, index) => /* @__PURE__ */ jsx19(
|
|
1218
1239
|
"span",
|
|
1219
1240
|
{
|
|
1220
1241
|
"aria-hidden": "true",
|
|
@@ -1228,10 +1249,10 @@ function LatticeLoader({ className, label = "Loading", ...props }) {
|
|
|
1228
1249
|
}
|
|
1229
1250
|
|
|
1230
1251
|
// src/components/Ghost/Ghost.tsx
|
|
1231
|
-
import { jsx as
|
|
1252
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1232
1253
|
var toCssLength = (value) => typeof value === "number" ? `${value}px` : value;
|
|
1233
1254
|
function Ghost({ className, width, height, radius, style, ...props }) {
|
|
1234
|
-
return /* @__PURE__ */
|
|
1255
|
+
return /* @__PURE__ */ jsx20(
|
|
1235
1256
|
"div",
|
|
1236
1257
|
{
|
|
1237
1258
|
"aria-hidden": "true",
|
|
@@ -1247,15 +1268,15 @@ function Ghost({ className, width, height, radius, style, ...props }) {
|
|
|
1247
1268
|
);
|
|
1248
1269
|
}
|
|
1249
1270
|
function GhostLine({ className, size = "md", width = "100%", ...props }) {
|
|
1250
|
-
return /* @__PURE__ */
|
|
1271
|
+
return /* @__PURE__ */ jsx20(Ghost, { className: cn("fractal-ghost-line", `fractal-ghost-line--${size}`, className), width, ...props });
|
|
1251
1272
|
}
|
|
1252
1273
|
function ButtonGhost({ className, size = "md", iconOnly = false, width, ...props }) {
|
|
1253
|
-
return /* @__PURE__ */
|
|
1274
|
+
return /* @__PURE__ */ jsx20(Ghost, { className: cn("fractal-ghost-button", `fractal-ghost-button--${size}`, iconOnly && "fractal-ghost-button--icon-only", className), width, ...props });
|
|
1254
1275
|
}
|
|
1255
1276
|
function CardGhost({ className, lines = 3, showHeader = true, ...props }) {
|
|
1256
|
-
return /* @__PURE__ */
|
|
1257
|
-
showHeader && /* @__PURE__ */
|
|
1258
|
-
/* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ jsxs15("div", { "aria-hidden": "true", className: cn("fractal-ghost-card", className), ...props, children: [
|
|
1278
|
+
showHeader && /* @__PURE__ */ jsx20(GhostLine, { width: "38%" }),
|
|
1279
|
+
/* @__PURE__ */ jsx20("div", { className: "fractal-ghost-stack", children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ jsx20(GhostLine, { width: index === lines - 1 ? "62%" : "100%" }, index)) })
|
|
1259
1280
|
] });
|
|
1260
1281
|
}
|
|
1261
1282
|
function DataTableGhost({
|
|
@@ -1269,109 +1290,109 @@ function DataTableGhost({
|
|
|
1269
1290
|
...props
|
|
1270
1291
|
}) {
|
|
1271
1292
|
const cells = Array.from({ length: columns }, (_, index) => index);
|
|
1272
|
-
return /* @__PURE__ */
|
|
1273
|
-
(showHeader || headers) && /* @__PURE__ */
|
|
1274
|
-
/* @__PURE__ */
|
|
1293
|
+
return /* @__PURE__ */ jsx20("div", { "aria-busy": "true", "aria-label": "Loading table", className: cn("fractal-ghost-table", `fractal-ghost-table--${size}`, className), role: "status", ...props, children: /* @__PURE__ */ jsxs15("table", { className: "fractal-ghost-table__table", children: [
|
|
1294
|
+
(showHeader || headers) && /* @__PURE__ */ jsx20("thead", { children: /* @__PURE__ */ jsx20("tr", { className: "fractal-ghost-table__head-row", children: cells.map((index) => /* @__PURE__ */ jsx20("th", { style: { width: columnWidths?.[index] }, children: headers?.[index] ?? /* @__PURE__ */ jsx20(GhostLine, { size: "sm", width: index === columns - 1 ? "62%" : "76%" }) }, index)) }) }),
|
|
1295
|
+
/* @__PURE__ */ jsx20("tbody", { children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ jsx20("tr", { className: "fractal-ghost-table__row", children: cells.map((columnIndex) => /* @__PURE__ */ jsx20("td", { style: { width: columnWidths?.[columnIndex] }, children: /* @__PURE__ */ jsx20(GhostLine, { width: `${[72, 54, 82, 63, 46][(rowIndex + columnIndex) % 5]}%` }) }, columnIndex)) }, rowIndex)) })
|
|
1275
1296
|
] }) });
|
|
1276
1297
|
}
|
|
1277
1298
|
function InputGhost({ className, labelWidth = "26%", ...props }) {
|
|
1278
|
-
return /* @__PURE__ */
|
|
1299
|
+
return /* @__PURE__ */ jsx20(FormFieldGhost, { className, labelWidth, ...props });
|
|
1279
1300
|
}
|
|
1280
1301
|
function TextareaGhost({ className, labelWidth = "26%", ...props }) {
|
|
1281
|
-
return /* @__PURE__ */
|
|
1302
|
+
return /* @__PURE__ */ jsx20(FormFieldGhost, { className, labelWidth, multiline: true, ...props });
|
|
1282
1303
|
}
|
|
1283
1304
|
function LabelGhost({ className, width = "26%", ...props }) {
|
|
1284
|
-
return /* @__PURE__ */
|
|
1305
|
+
return /* @__PURE__ */ jsx20(GhostLine, { className: cn("fractal-ghost-label", className), size: "sm", width, ...props });
|
|
1285
1306
|
}
|
|
1286
1307
|
function FormFieldGhost({ className, labelWidth = "26%", multiline = false, ...props }) {
|
|
1287
|
-
return /* @__PURE__ */
|
|
1288
|
-
/* @__PURE__ */
|
|
1289
|
-
/* @__PURE__ */
|
|
1308
|
+
return /* @__PURE__ */ jsxs15("div", { "aria-hidden": "true", className: cn("fractal-ghost-field", className), ...props, children: [
|
|
1309
|
+
/* @__PURE__ */ jsx20(LabelGhost, { width: labelWidth }),
|
|
1310
|
+
/* @__PURE__ */ jsx20(Ghost, { className: cn("fractal-ghost-field__control", multiline && "fractal-ghost-field__control--multiline") })
|
|
1290
1311
|
] });
|
|
1291
1312
|
}
|
|
1292
1313
|
function AlertGhost({ className, ...props }) {
|
|
1293
|
-
return /* @__PURE__ */
|
|
1294
|
-
/* @__PURE__ */
|
|
1295
|
-
/* @__PURE__ */
|
|
1314
|
+
return /* @__PURE__ */ jsxs15("div", { "aria-hidden": "true", className: cn("fractal-ghost-alert", className), ...props, children: [
|
|
1315
|
+
/* @__PURE__ */ jsx20(GhostLine, { width: "30%" }),
|
|
1316
|
+
/* @__PURE__ */ jsx20(GhostLine, { size: "sm", width: "78%" })
|
|
1296
1317
|
] });
|
|
1297
1318
|
}
|
|
1298
1319
|
function CheckboxGhost({ className, ...props }) {
|
|
1299
|
-
return /* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
/* @__PURE__ */
|
|
1320
|
+
return /* @__PURE__ */ jsxs15("div", { "aria-hidden": "true", className: cn("fractal-ghost-choice", className), ...props, children: [
|
|
1321
|
+
/* @__PURE__ */ jsx20(Ghost, { className: "fractal-ghost-choice__control" }),
|
|
1322
|
+
/* @__PURE__ */ jsx20(GhostLine, { width: "42%" })
|
|
1302
1323
|
] });
|
|
1303
1324
|
}
|
|
1304
1325
|
var ToggleGhost = CheckboxGhost;
|
|
1305
1326
|
function ChipGhost({ className, width = 74, ...props }) {
|
|
1306
|
-
return /* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ jsx20(Ghost, { className: cn("fractal-ghost-chip", className), height: 24, width, ...props });
|
|
1307
1328
|
}
|
|
1308
1329
|
function LinkGhost({ className, width = 96, ...props }) {
|
|
1309
|
-
return /* @__PURE__ */
|
|
1330
|
+
return /* @__PURE__ */ jsx20(GhostLine, { className: cn("fractal-ghost-link", className), size: "sm", width, ...props });
|
|
1310
1331
|
}
|
|
1311
1332
|
var TextButtonGhost = LinkGhost;
|
|
1312
1333
|
function DropdownGhost({ className, ...props }) {
|
|
1313
|
-
return /* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ jsxs15("div", { "aria-hidden": "true", className: cn("fractal-ghost-dropdown", className), ...props, children: [
|
|
1335
|
+
/* @__PURE__ */ jsx20(GhostLine, { width: "38%" }),
|
|
1336
|
+
/* @__PURE__ */ jsx20(Ghost, { className: "fractal-ghost-dropdown__chevron" })
|
|
1316
1337
|
] });
|
|
1317
1338
|
}
|
|
1318
1339
|
function ContentSwitcherGhost({ className, options = 3, ...props }) {
|
|
1319
|
-
return /* @__PURE__ */
|
|
1340
|
+
return /* @__PURE__ */ jsx20("div", { "aria-hidden": "true", className: cn("fractal-ghost-switcher", className), ...props, children: Array.from({ length: options }, (_, index) => /* @__PURE__ */ jsx20(Ghost, {}, index)) });
|
|
1320
1341
|
}
|
|
1321
1342
|
var TabsGhost = ContentSwitcherGhost;
|
|
1322
1343
|
function DisclosureGhost({ className, ...props }) {
|
|
1323
|
-
return /* @__PURE__ */
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
/* @__PURE__ */
|
|
1344
|
+
return /* @__PURE__ */ jsxs15("div", { "aria-hidden": "true", className: cn("fractal-ghost-disclosure", className), ...props, children: [
|
|
1345
|
+
/* @__PURE__ */ jsx20(Ghost, { className: "fractal-ghost-disclosure__icon" }),
|
|
1346
|
+
/* @__PURE__ */ jsx20(GhostLine, { width: "42%" })
|
|
1326
1347
|
] });
|
|
1327
1348
|
}
|
|
1328
1349
|
function PaginationGhost({ className, pages = 5, ...props }) {
|
|
1329
|
-
return /* @__PURE__ */
|
|
1350
|
+
return /* @__PURE__ */ jsx20("div", { "aria-hidden": "true", className: cn("fractal-ghost-pagination", className), ...props, children: Array.from({ length: pages }, (_, index) => /* @__PURE__ */ jsx20(Ghost, {}, index)) });
|
|
1330
1351
|
}
|
|
1331
1352
|
function FileDropzoneGhost({ className, ...props }) {
|
|
1332
|
-
return /* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1334
|
-
/* @__PURE__ */
|
|
1335
|
-
/* @__PURE__ */
|
|
1353
|
+
return /* @__PURE__ */ jsxs15("div", { "aria-hidden": "true", className: cn("fractal-ghost-dropzone", className), ...props, children: [
|
|
1354
|
+
/* @__PURE__ */ jsx20(Ghost, { className: "fractal-ghost-dropzone__icon" }),
|
|
1355
|
+
/* @__PURE__ */ jsx20(GhostLine, { width: "26%" }),
|
|
1356
|
+
/* @__PURE__ */ jsx20(GhostLine, { size: "sm", width: "46%" })
|
|
1336
1357
|
] });
|
|
1337
1358
|
}
|
|
1338
1359
|
function PromptCardGhost({ className, ...props }) {
|
|
1339
|
-
return /* @__PURE__ */
|
|
1360
|
+
return /* @__PURE__ */ jsx20(CardGhost, { className: cn("fractal-ghost-prompt-card", className), lines: 4, ...props });
|
|
1340
1361
|
}
|
|
1341
1362
|
function SortableTableGhost(props) {
|
|
1342
|
-
return /* @__PURE__ */
|
|
1363
|
+
return /* @__PURE__ */ jsx20(DataTableGhost, { ...props });
|
|
1343
1364
|
}
|
|
1344
1365
|
function SidebarGhost({ className, items = 6, ...props }) {
|
|
1345
|
-
return /* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
/* @__PURE__ */
|
|
1366
|
+
return /* @__PURE__ */ jsxs15("aside", { "aria-hidden": "true", className: cn("fractal-ghost-sidebar", className), ...props, children: [
|
|
1367
|
+
/* @__PURE__ */ jsx20(Ghost, { className: "fractal-ghost-sidebar__brand" }),
|
|
1368
|
+
/* @__PURE__ */ jsx20("div", { className: "fractal-ghost-sidebar__items", children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ jsxs15("div", { className: "fractal-ghost-sidebar__item", children: [
|
|
1369
|
+
/* @__PURE__ */ jsx20(Ghost, {}),
|
|
1370
|
+
/* @__PURE__ */ jsx20(GhostLine, { width: `${[54, 68, 44, 61][index % 4]}%` })
|
|
1350
1371
|
] }, index)) })
|
|
1351
1372
|
] });
|
|
1352
1373
|
}
|
|
1353
1374
|
function ModalGhost({ className, title, lines = 3, ...props }) {
|
|
1354
|
-
return /* @__PURE__ */
|
|
1375
|
+
return /* @__PURE__ */ jsx20(SurfaceGhost, { className: cn("fractal-ghost-modal", className), title, lines, ...props });
|
|
1355
1376
|
}
|
|
1356
1377
|
function SidePanelGhost({ className, title, lines = 5, ...props }) {
|
|
1357
|
-
return /* @__PURE__ */
|
|
1378
|
+
return /* @__PURE__ */ jsx20(SurfaceGhost, { className: cn("fractal-ghost-side-panel", className), title, lines, ...props });
|
|
1358
1379
|
}
|
|
1359
1380
|
function SurfaceGhost({ className, title, lines = 3, ...props }) {
|
|
1360
|
-
return /* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1381
|
+
return /* @__PURE__ */ jsxs15("div", { "aria-hidden": "true", className: cn("fractal-ghost-surface", className), ...props, children: [
|
|
1382
|
+
/* @__PURE__ */ jsxs15("div", { className: "fractal-ghost-surface__header", children: [
|
|
1383
|
+
/* @__PURE__ */ jsx20(GhostLine, { width: "42%" }),
|
|
1384
|
+
/* @__PURE__ */ jsx20(Ghost, { className: "fractal-ghost-surface__close" })
|
|
1364
1385
|
] }),
|
|
1365
|
-
title && /* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */
|
|
1386
|
+
title && /* @__PURE__ */ jsx20("div", { className: "fractal-ghost-surface__title", children: title }),
|
|
1387
|
+
/* @__PURE__ */ jsx20("div", { className: "fractal-ghost-stack", children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ jsx20(GhostLine, { width: index === lines - 1 ? "64%" : "100%" }, index)) })
|
|
1367
1388
|
] });
|
|
1368
1389
|
}
|
|
1369
1390
|
|
|
1370
1391
|
// src/components/Sidebar/Sidebar.tsx
|
|
1371
1392
|
import * as React11 from "react";
|
|
1372
|
-
import { jsx as
|
|
1393
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1373
1394
|
var Sidebar = React11.forwardRef(
|
|
1374
|
-
({ className, width, style, ...props }, ref) => /* @__PURE__ */
|
|
1395
|
+
({ className, width, style, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1375
1396
|
"aside",
|
|
1376
1397
|
{
|
|
1377
1398
|
ref,
|
|
@@ -1383,11 +1404,11 @@ var Sidebar = React11.forwardRef(
|
|
|
1383
1404
|
);
|
|
1384
1405
|
Sidebar.displayName = "Sidebar";
|
|
1385
1406
|
var SidebarHeader = React11.forwardRef(
|
|
1386
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1407
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx21("div", { ref, className: cn("fractal-sidebar__header", className), ...props })
|
|
1387
1408
|
);
|
|
1388
1409
|
SidebarHeader.displayName = "SidebarHeader";
|
|
1389
1410
|
var SidebarBrand = React11.forwardRef(
|
|
1390
|
-
({ className, type = "button", ...props }, ref) => /* @__PURE__ */
|
|
1411
|
+
({ className, type = "button", ...props }, ref) => /* @__PURE__ */ jsx21("button", { ref, type, className: cn("fractal-sidebar__brand", className), ...props })
|
|
1391
1412
|
);
|
|
1392
1413
|
SidebarBrand.displayName = "SidebarBrand";
|
|
1393
1414
|
function SidebarAccountMenu({
|
|
@@ -1397,7 +1418,7 @@ function SidebarAccountMenu({
|
|
|
1397
1418
|
triggerLabel = "Account menu",
|
|
1398
1419
|
className
|
|
1399
1420
|
}) {
|
|
1400
|
-
return /* @__PURE__ */
|
|
1421
|
+
return /* @__PURE__ */ jsx21(
|
|
1401
1422
|
Dropdown,
|
|
1402
1423
|
{
|
|
1403
1424
|
align: "left",
|
|
@@ -1407,22 +1428,22 @@ function SidebarAccountMenu({
|
|
|
1407
1428
|
panelClassName: "fractal-sidebar__account-panel",
|
|
1408
1429
|
selectedValue: "",
|
|
1409
1430
|
triggerClassName: "fractal-sidebar__account-trigger",
|
|
1410
|
-
triggerContent: /* @__PURE__ */
|
|
1431
|
+
triggerContent: /* @__PURE__ */ jsx21("span", { className: "fractal-sidebar__account-name", children: name }),
|
|
1411
1432
|
triggerLabel,
|
|
1412
1433
|
triggerVariant: "tertiary"
|
|
1413
1434
|
}
|
|
1414
1435
|
);
|
|
1415
1436
|
}
|
|
1416
1437
|
var SidebarNav = React11.forwardRef(
|
|
1417
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1438
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx21("nav", { ref, className: cn("fractal-sidebar__nav", className), ...props })
|
|
1418
1439
|
);
|
|
1419
1440
|
SidebarNav.displayName = "SidebarNav";
|
|
1420
1441
|
var SidebarSection = React11.forwardRef(
|
|
1421
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1442
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx21("div", { ref, className: cn("fractal-sidebar__section", className), ...props })
|
|
1422
1443
|
);
|
|
1423
1444
|
SidebarSection.displayName = "SidebarSection";
|
|
1424
1445
|
var SidebarNavItem = React11.forwardRef(
|
|
1425
|
-
({ active = false, icon, endAdornment, className, type = "button", children, ...props }, ref) => /* @__PURE__ */
|
|
1446
|
+
({ active = false, icon, endAdornment, className, type = "button", children, ...props }, ref) => /* @__PURE__ */ jsxs16(
|
|
1426
1447
|
"button",
|
|
1427
1448
|
{
|
|
1428
1449
|
ref,
|
|
@@ -1432,28 +1453,28 @@ var SidebarNavItem = React11.forwardRef(
|
|
|
1432
1453
|
"aria-current": active ? "page" : void 0,
|
|
1433
1454
|
...props,
|
|
1434
1455
|
children: [
|
|
1435
|
-
icon && /* @__PURE__ */
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
-
endAdornment && /* @__PURE__ */
|
|
1456
|
+
icon && /* @__PURE__ */ jsx21("span", { className: "fractal-sidebar__nav-item-icon", "aria-hidden": "true", children: icon }),
|
|
1457
|
+
/* @__PURE__ */ jsx21("span", { className: "fractal-sidebar__nav-item-label", children }),
|
|
1458
|
+
endAdornment && /* @__PURE__ */ jsx21("span", { className: "fractal-sidebar__nav-item-end", children: endAdornment })
|
|
1438
1459
|
]
|
|
1439
1460
|
}
|
|
1440
1461
|
)
|
|
1441
1462
|
);
|
|
1442
1463
|
SidebarNavItem.displayName = "SidebarNavItem";
|
|
1443
1464
|
var SidebarFooter = React11.forwardRef(
|
|
1444
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1465
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx21("div", { ref, className: cn("fractal-sidebar__footer", className), ...props })
|
|
1445
1466
|
);
|
|
1446
1467
|
SidebarFooter.displayName = "SidebarFooter";
|
|
1447
1468
|
|
|
1448
1469
|
// src/components/SidePanel/SidePanel.tsx
|
|
1449
1470
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1450
1471
|
import { Close } from "@mirror-physics/fractal-icons";
|
|
1451
|
-
import { jsx as
|
|
1472
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1452
1473
|
function SidePanel({ open, onClose, title, description, children, footer, size = "md", loading = false, loadingLabel = "Loading", className }) {
|
|
1453
1474
|
useEscapeDismiss(80, onClose, open);
|
|
1454
1475
|
if (!open) return null;
|
|
1455
1476
|
return createPortal2(
|
|
1456
|
-
/* @__PURE__ */
|
|
1477
|
+
/* @__PURE__ */ jsx22("div", { className: "fractal-side-panel-overlay", onMouseDown: onClose, children: /* @__PURE__ */ jsxs17(
|
|
1457
1478
|
"aside",
|
|
1458
1479
|
{
|
|
1459
1480
|
className: cn("fractal-side-panel", `fractal-side-panel--${size}`, className),
|
|
@@ -1462,15 +1483,15 @@ function SidePanel({ open, onClose, title, description, children, footer, size =
|
|
|
1462
1483
|
role: "dialog",
|
|
1463
1484
|
onMouseDown: (event) => event.stopPropagation(),
|
|
1464
1485
|
children: [
|
|
1465
|
-
/* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
description && /* @__PURE__ */
|
|
1486
|
+
/* @__PURE__ */ jsxs17("header", { className: "fractal-side-panel__header", children: [
|
|
1487
|
+
/* @__PURE__ */ jsxs17("div", { className: "fractal-side-panel__heading", children: [
|
|
1488
|
+
typeof title === "string" ? /* @__PURE__ */ jsx22("h2", { className: "fractal-side-panel__title", children: title }) : /* @__PURE__ */ jsx22("div", { className: "fractal-side-panel__title", children: title }),
|
|
1489
|
+
description && /* @__PURE__ */ jsx22("p", { className: "fractal-side-panel__description", children: description })
|
|
1469
1490
|
] }),
|
|
1470
|
-
/* @__PURE__ */
|
|
1491
|
+
/* @__PURE__ */ jsx22("button", { type: "button", className: "fractal-side-panel__close", "aria-label": "Close panel", onClick: onClose, children: /* @__PURE__ */ jsx22(Close, { size: 18 }) })
|
|
1471
1492
|
] }),
|
|
1472
|
-
/* @__PURE__ */
|
|
1473
|
-
footer && /* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ jsx22("div", { "aria-busy": loading || void 0, className: cn("fractal-side-panel__body", loading && "fractal-side-panel__body--loading"), children: loading ? /* @__PURE__ */ jsx22(UILoader, { label: loadingLabel }) : children }),
|
|
1494
|
+
footer && /* @__PURE__ */ jsx22("footer", { className: "fractal-side-panel__footer", children: footer })
|
|
1474
1495
|
]
|
|
1475
1496
|
}
|
|
1476
1497
|
) }),
|
|
@@ -1480,17 +1501,17 @@ function SidePanel({ open, onClose, title, description, children, footer, size =
|
|
|
1480
1501
|
|
|
1481
1502
|
// src/components/Textarea/Textarea.tsx
|
|
1482
1503
|
import * as React12 from "react";
|
|
1483
|
-
import { jsx as
|
|
1504
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1484
1505
|
var Textarea = React12.forwardRef(
|
|
1485
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1506
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx23("textarea", { ref, className: cn("fractal-textarea", className), ...props })
|
|
1486
1507
|
);
|
|
1487
1508
|
Textarea.displayName = "Textarea";
|
|
1488
1509
|
|
|
1489
1510
|
// src/components/TextButton/TextButton.tsx
|
|
1490
1511
|
import * as React13 from "react";
|
|
1491
|
-
import { jsx as
|
|
1512
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1492
1513
|
var TextButton = React13.forwardRef(
|
|
1493
|
-
({ className, icon, iconPosition = "start", size = "md", tone = "primary", children, ...props }, ref) => /* @__PURE__ */
|
|
1514
|
+
({ className, icon, iconPosition = "start", size = "md", tone = "primary", children, ...props }, ref) => /* @__PURE__ */ jsxs18(
|
|
1494
1515
|
"button",
|
|
1495
1516
|
{
|
|
1496
1517
|
ref,
|
|
@@ -1498,9 +1519,9 @@ var TextButton = React13.forwardRef(
|
|
|
1498
1519
|
type: "button",
|
|
1499
1520
|
...props,
|
|
1500
1521
|
children: [
|
|
1501
|
-
icon && iconPosition === "start" && /* @__PURE__ */
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
icon && iconPosition === "end" && /* @__PURE__ */
|
|
1522
|
+
icon && iconPosition === "start" && /* @__PURE__ */ jsx24("span", { className: "fractal-text-button__icon", "aria-hidden": "true", children: icon }),
|
|
1523
|
+
/* @__PURE__ */ jsx24("span", { children }),
|
|
1524
|
+
icon && iconPosition === "end" && /* @__PURE__ */ jsx24("span", { className: "fractal-text-button__icon", "aria-hidden": "true", children: icon })
|
|
1504
1525
|
]
|
|
1505
1526
|
}
|
|
1506
1527
|
)
|
|
@@ -1510,7 +1531,7 @@ TextButton.displayName = "TextButton";
|
|
|
1510
1531
|
// src/components/FileDropzone/FileDropzone.tsx
|
|
1511
1532
|
import * as React14 from "react";
|
|
1512
1533
|
import { Close as Close2, FileArrowUp } from "@mirror-physics/fractal-icons";
|
|
1513
|
-
import { jsx as
|
|
1534
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1514
1535
|
function FileDropzone({
|
|
1515
1536
|
files,
|
|
1516
1537
|
onFilesChange,
|
|
@@ -1530,8 +1551,8 @@ function FileDropzone({
|
|
|
1530
1551
|
if (additions.length === 0) return;
|
|
1531
1552
|
onFilesChange(multiple ? [...files, ...additions] : additions.slice(0, 1));
|
|
1532
1553
|
};
|
|
1533
|
-
return /* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1554
|
+
return /* @__PURE__ */ jsxs19("div", { className: cn("fractal-file-dropzone", className), children: [
|
|
1555
|
+
/* @__PURE__ */ jsx25(
|
|
1535
1556
|
"input",
|
|
1536
1557
|
{
|
|
1537
1558
|
ref: inputRef,
|
|
@@ -1547,7 +1568,7 @@ function FileDropzone({
|
|
|
1547
1568
|
}
|
|
1548
1569
|
}
|
|
1549
1570
|
),
|
|
1550
|
-
/* @__PURE__ */
|
|
1571
|
+
/* @__PURE__ */ jsxs19(
|
|
1551
1572
|
"button",
|
|
1552
1573
|
{
|
|
1553
1574
|
className: "fractal-file-dropzone__target",
|
|
@@ -1570,18 +1591,18 @@ function FileDropzone({
|
|
|
1570
1591
|
addFiles(event.dataTransfer.files);
|
|
1571
1592
|
},
|
|
1572
1593
|
children: [
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
description && /* @__PURE__ */
|
|
1594
|
+
/* @__PURE__ */ jsx25(FileArrowUp, { "aria-hidden": "true", size: 20 }),
|
|
1595
|
+
/* @__PURE__ */ jsxs19("span", { className: "fractal-file-dropzone__copy", children: [
|
|
1596
|
+
/* @__PURE__ */ jsx25("span", { className: "fractal-file-dropzone__title", children: title }),
|
|
1597
|
+
description && /* @__PURE__ */ jsx25("span", { className: "fractal-file-dropzone__description", children: description })
|
|
1577
1598
|
] })
|
|
1578
1599
|
]
|
|
1579
1600
|
}
|
|
1580
1601
|
),
|
|
1581
|
-
files.length > 0 && /* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
/* @__PURE__ */
|
|
1584
|
-
/* @__PURE__ */
|
|
1602
|
+
files.length > 0 && /* @__PURE__ */ jsx25("ul", { className: "fractal-file-dropzone__files", "aria-label": "Attached files", children: files.map((file, index) => /* @__PURE__ */ jsxs19("li", { className: "fractal-file-dropzone__file", children: [
|
|
1603
|
+
/* @__PURE__ */ jsx25("span", { className: "fractal-file-dropzone__file-name", children: file.name }),
|
|
1604
|
+
/* @__PURE__ */ jsx25("span", { className: "fractal-file-dropzone__file-meta", children: formatFileSize(file.size) }),
|
|
1605
|
+
/* @__PURE__ */ jsx25(
|
|
1585
1606
|
"button",
|
|
1586
1607
|
{
|
|
1587
1608
|
className: "fractal-file-dropzone__remove",
|
|
@@ -1589,7 +1610,7 @@ function FileDropzone({
|
|
|
1589
1610
|
"aria-label": `Remove ${file.name}`,
|
|
1590
1611
|
disabled,
|
|
1591
1612
|
onClick: () => onFilesChange(files.filter((_, fileIndex) => fileIndex !== index)),
|
|
1592
|
-
children: /* @__PURE__ */
|
|
1613
|
+
children: /* @__PURE__ */ jsx25(Close2, { "aria-hidden": "true", size: 14 })
|
|
1593
1614
|
}
|
|
1594
1615
|
)
|
|
1595
1616
|
] }, `${file.name}-${file.size}-${index}`)) })
|
|
@@ -1603,7 +1624,7 @@ function formatFileSize(bytes) {
|
|
|
1603
1624
|
|
|
1604
1625
|
// src/components/Pagination/Pagination.tsx
|
|
1605
1626
|
import { ArrowLeft, ArrowRight } from "@mirror-physics/fractal-icons";
|
|
1606
|
-
import { jsx as
|
|
1627
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1607
1628
|
function Pagination({
|
|
1608
1629
|
page,
|
|
1609
1630
|
pageSize,
|
|
@@ -1619,10 +1640,10 @@ function Pagination({
|
|
|
1619
1640
|
const start = totalItems === 0 ? 0 : (currentPage - 1) * pageSize + 1;
|
|
1620
1641
|
const end = Math.min(currentPage * pageSize, totalItems);
|
|
1621
1642
|
const canChangePageSize = pageSizeOptions != null && pageSizeOptions.length > 0 && onPageSizeChange != null;
|
|
1622
|
-
return /* @__PURE__ */
|
|
1623
|
-
/* @__PURE__ */
|
|
1624
|
-
/* @__PURE__ */
|
|
1625
|
-
canChangePageSize && /* @__PURE__ */
|
|
1643
|
+
return /* @__PURE__ */ jsxs20("nav", { className: cn("fractal-pagination", className), "aria-label": ariaLabel, children: [
|
|
1644
|
+
/* @__PURE__ */ jsx26("span", { className: "fractal-pagination__summary", children: totalItems === 0 ? "No results" : `${start}-${end} of ${totalItems}` }),
|
|
1645
|
+
/* @__PURE__ */ jsxs20("div", { className: "fractal-pagination__controls", children: [
|
|
1646
|
+
canChangePageSize && /* @__PURE__ */ jsx26(
|
|
1626
1647
|
Dropdown,
|
|
1627
1648
|
{
|
|
1628
1649
|
align: "right",
|
|
@@ -1639,7 +1660,7 @@ function Pagination({
|
|
|
1639
1660
|
triggerVariant: "tertiary"
|
|
1640
1661
|
}
|
|
1641
1662
|
),
|
|
1642
|
-
/* @__PURE__ */
|
|
1663
|
+
/* @__PURE__ */ jsx26(
|
|
1643
1664
|
"button",
|
|
1644
1665
|
{
|
|
1645
1666
|
className: "fractal-pagination__button",
|
|
@@ -1648,15 +1669,15 @@ function Pagination({
|
|
|
1648
1669
|
title: "Previous page",
|
|
1649
1670
|
disabled: currentPage === 1 || totalItems === 0,
|
|
1650
1671
|
onClick: () => onPageChange(currentPage - 1),
|
|
1651
|
-
children: /* @__PURE__ */
|
|
1672
|
+
children: /* @__PURE__ */ jsx26(ArrowLeft, { "aria-hidden": "true", size: 16 })
|
|
1652
1673
|
}
|
|
1653
1674
|
),
|
|
1654
|
-
/* @__PURE__ */
|
|
1675
|
+
/* @__PURE__ */ jsxs20("span", { className: "fractal-pagination__page", "aria-current": "page", children: [
|
|
1655
1676
|
currentPage,
|
|
1656
1677
|
" of ",
|
|
1657
1678
|
totalPages
|
|
1658
1679
|
] }),
|
|
1659
|
-
/* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ jsx26(
|
|
1660
1681
|
"button",
|
|
1661
1682
|
{
|
|
1662
1683
|
className: "fractal-pagination__button",
|
|
@@ -1665,7 +1686,7 @@ function Pagination({
|
|
|
1665
1686
|
title: "Next page",
|
|
1666
1687
|
disabled: currentPage === totalPages || totalItems === 0,
|
|
1667
1688
|
onClick: () => onPageChange(currentPage + 1),
|
|
1668
|
-
children: /* @__PURE__ */
|
|
1689
|
+
children: /* @__PURE__ */ jsx26(ArrowRight, { "aria-hidden": "true", size: 16 })
|
|
1669
1690
|
}
|
|
1670
1691
|
)
|
|
1671
1692
|
] })
|
|
@@ -1676,6 +1697,7 @@ export {
|
|
|
1676
1697
|
AlertDescription,
|
|
1677
1698
|
AlertGhost,
|
|
1678
1699
|
AlertTitle,
|
|
1700
|
+
Breadcrumbs,
|
|
1679
1701
|
Button,
|
|
1680
1702
|
ButtonGhost,
|
|
1681
1703
|
Card,
|