@geomak/ui 1.7.0 → 1.7.1
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 +170 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +101 -79
- package/dist/index.d.ts +101 -79
- package/dist/index.js +170 -124
- package/dist/index.js.map +1 -1
- package/dist/styles.css +31 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { colors_default } from './chunk-GKXP6OJJ.js';
|
|
2
2
|
export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-GKXP6OJJ.js';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
4
|
import React10, { createContext, useState, useEffect, useMemo, useContext, useRef, useCallback, useId } from 'react';
|
|
4
5
|
import { createPortal } from 'react-dom';
|
|
5
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import * as Dialog from '@radix-ui/react-dialog';
|
|
7
7
|
import { useReducedMotion, AnimatePresence, motion } from 'framer-motion';
|
|
8
8
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
@@ -14,18 +14,6 @@ import * as Popover from '@radix-ui/react-popover';
|
|
|
14
14
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
15
15
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
16
16
|
|
|
17
|
-
function Portal({ children, target }) {
|
|
18
|
-
const [resolved, setResolved] = useState(null);
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (target === null) {
|
|
21
|
-
setResolved(null);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const node = typeof target === "function" ? target() : target ?? document.body;
|
|
25
|
-
setResolved(node ?? null);
|
|
26
|
-
}, [target]);
|
|
27
|
-
return resolved ? createPortal(children, resolved) : null;
|
|
28
|
-
}
|
|
29
17
|
var Moon = ({ color = "gray" }) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: color, viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: color, className: "w-8 h-8", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z" }) });
|
|
30
18
|
var Sun = ({ color = "yellow" }) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: color, viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: color, className: "w-8 h-8", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" }) });
|
|
31
19
|
var CheckCircle = ({ color = "#fff", size = 28 }) => /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 28 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M14 0.25C6.40625 0.25 0.25 6.40625 0.25 14C0.25 21.5937 6.40625 27.75 14 27.75C21.5937 27.75 27.75 21.5937 27.75 14C27.75 6.40625 21.5937 0.25 14 0.25ZM19.96 11.675C20.0697 11.5496 20.1533 11.4034 20.2057 11.2452C20.2582 11.087 20.2784 10.9199 20.2653 10.7537C20.2522 10.5876 20.206 10.4257 20.1295 10.2777C20.0529 10.1296 19.9475 9.99838 19.8194 9.89168C19.6914 9.78497 19.5433 9.70495 19.3839 9.65633C19.2244 9.6077 19.0569 9.59145 18.8911 9.60853C18.7253 9.62562 18.5646 9.67568 18.4184 9.75579C18.2723 9.8359 18.1436 9.94443 18.04 10.075L12.665 16.5237L9.88375 13.7412C9.648 13.5136 9.33224 13.3876 9.0045 13.3904C8.67675 13.3933 8.36324 13.5247 8.13148 13.7565C7.89972 13.9882 7.76825 14.3018 7.76541 14.6295C7.76256 14.9572 7.88855 15.273 8.11625 15.5087L11.8662 19.2587C11.9891 19.3815 12.1361 19.4773 12.298 19.5401C12.4599 19.6028 12.6331 19.6312 12.8066 19.6233C12.98 19.6154 13.15 19.5715 13.3055 19.4943C13.4611 19.4171 13.5988 19.3084 13.71 19.175L19.96 11.675Z", fill: color }) });
|
|
@@ -185,6 +173,18 @@ Icon.Save = Save;
|
|
|
185
173
|
Icon.Copy = Copy;
|
|
186
174
|
Icon.CircleStack = CircleStack;
|
|
187
175
|
var icons_default = Icon;
|
|
176
|
+
function Portal({ children, target }) {
|
|
177
|
+
const [resolved, setResolved] = useState(null);
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
if (target === null) {
|
|
180
|
+
setResolved(null);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const node = typeof target === "function" ? target() : target ?? document.body;
|
|
184
|
+
setResolved(node ?? null);
|
|
185
|
+
}, [target]);
|
|
186
|
+
return resolved ? createPortal(children, resolved) : null;
|
|
187
|
+
}
|
|
188
188
|
function IconButton({
|
|
189
189
|
icon,
|
|
190
190
|
onClick,
|
|
@@ -300,7 +300,8 @@ function Button({
|
|
|
300
300
|
);
|
|
301
301
|
}
|
|
302
302
|
function Modal({
|
|
303
|
-
|
|
303
|
+
width,
|
|
304
|
+
size,
|
|
304
305
|
isOpen = false,
|
|
305
306
|
onClose,
|
|
306
307
|
onOk,
|
|
@@ -312,6 +313,7 @@ function Modal({
|
|
|
312
313
|
children
|
|
313
314
|
}) {
|
|
314
315
|
const reduced = useReducedMotion();
|
|
316
|
+
const maxWidth = width ?? size?.[0] ?? 600;
|
|
315
317
|
return /* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, onOpenChange: (open) => {
|
|
316
318
|
if (!open) onClose?.();
|
|
317
319
|
}, children: /* @__PURE__ */ jsxs(Dialog.Portal, { forceMount: true, children: [
|
|
@@ -330,7 +332,7 @@ function Modal({
|
|
|
330
332
|
{
|
|
331
333
|
className: "fixed left-1/2 top-1/2 z-modal flex flex-col w-[calc(100%-2rem)] max-h-[90dvh] bg-surface rounded-2xl shadow-xl overflow-hidden focus:outline-none",
|
|
332
334
|
style: {
|
|
333
|
-
maxWidth
|
|
335
|
+
maxWidth,
|
|
334
336
|
x: "-50%",
|
|
335
337
|
y: "-50%"
|
|
336
338
|
},
|
|
@@ -355,7 +357,7 @@ function Modal({
|
|
|
355
357
|
}
|
|
356
358
|
) })
|
|
357
359
|
] }),
|
|
358
|
-
/* @__PURE__ */ jsx("div", { className: `flex-1 overflow-y-auto p-5 ${hasFooter ? "" : "pb-5"}`, children
|
|
360
|
+
/* @__PURE__ */ jsx("div", { className: `flex-1 overflow-y-auto p-5 ${hasFooter ? "" : "pb-5"}`, children }),
|
|
359
361
|
hasFooter && /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center justify-end gap-3 border-t border-border px-5 py-3", children: [
|
|
360
362
|
/* @__PURE__ */ jsx(
|
|
361
363
|
Button,
|
|
@@ -437,7 +439,7 @@ function Drawer({
|
|
|
437
439
|
}
|
|
438
440
|
) })
|
|
439
441
|
] }),
|
|
440
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-5", children
|
|
442
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-5", children }),
|
|
441
443
|
hasFooter && /* @__PURE__ */ jsxs("div", { className: `flex flex-shrink-0 items-center gap-3 border-t border-border px-5 py-3 ${isRight ? "justify-start" : "justify-end"}`, children: [
|
|
442
444
|
/* @__PURE__ */ jsx(Button, { style: { width: 90 }, content: cancelText, onClick: onCancel }),
|
|
443
445
|
/* @__PURE__ */ jsx(Button, { style: { width: 90 }, content: okText, onClick: onOk })
|
|
@@ -556,29 +558,46 @@ function Tabs({
|
|
|
556
558
|
{
|
|
557
559
|
"aria-label": "Tabs",
|
|
558
560
|
className: "flex-1 flex items-center gap-1 overflow-x-auto overflow-y-hidden rounded-lg scroll-smooth snap-x snap-mandatory hidden-scrollbar",
|
|
559
|
-
children: tabs.map((tab) =>
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
561
|
+
children: tabs.map((tab) => (
|
|
562
|
+
// Trigger + close button are SIBLINGS, not nested.
|
|
563
|
+
// Nesting a clickable element inside <button> is invalid
|
|
564
|
+
// HTML and breaks keyboard activation of the inner one.
|
|
565
|
+
// The wrapper carries `group` so the close button can
|
|
566
|
+
// react to the trigger's `data-state=active` for styling.
|
|
567
|
+
/* @__PURE__ */ jsxs(
|
|
568
|
+
"div",
|
|
569
|
+
{
|
|
570
|
+
className: "snap-start snap-always relative flex items-center flex-1 min-w-[120px] max-w-[220px] flex-shrink-0 group",
|
|
571
|
+
children: [
|
|
572
|
+
/* @__PURE__ */ jsx(
|
|
573
|
+
TabsPrimitive.Trigger,
|
|
574
|
+
{
|
|
575
|
+
value: tab.key,
|
|
576
|
+
className: `w-full ${tabsClosable ? "pr-8" : "pr-3"} pl-3 py-2 rounded-3xl cursor-pointer transition-all duration-200 select-none h-10 text-left
|
|
577
|
+
text-foreground-secondary bg-surface-raised
|
|
578
|
+
hover:bg-surface hover:text-foreground
|
|
579
|
+
data-[state=active]:bg-accent data-[state=active]:text-accent-foreground
|
|
580
|
+
focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,
|
|
581
|
+
children: /* @__PURE__ */ jsx("span", { className: "truncate text-sm block", children: tab.title })
|
|
582
|
+
}
|
|
583
|
+
),
|
|
584
|
+
tabsClosable && /* @__PURE__ */ jsx(
|
|
585
|
+
"button",
|
|
586
|
+
{
|
|
587
|
+
type: "button",
|
|
588
|
+
"aria-label": `Close ${tab.title}`,
|
|
589
|
+
onClick: (e) => {
|
|
590
|
+
e.stopPropagation();
|
|
591
|
+
onTabClose?.(tab.key);
|
|
592
|
+
},
|
|
593
|
+
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-foreground-secondary group-data-[state=active]:text-accent-foreground hover:bg-black/10 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
594
|
+
children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M15 5L5 15M5 5l10 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
595
|
+
}
|
|
596
|
+
)
|
|
597
|
+
]
|
|
598
|
+
},
|
|
599
|
+
tab.key
|
|
600
|
+
)
|
|
582
601
|
))
|
|
583
602
|
}
|
|
584
603
|
),
|
|
@@ -641,40 +660,41 @@ function TreeNodeItem({
|
|
|
641
660
|
defaultValue: initialOpen,
|
|
642
661
|
style: { paddingLeft: depth * 12 },
|
|
643
662
|
children: /* @__PURE__ */ jsxs(Accordion.Item, { value: item.key, className: "border-none", children: [
|
|
644
|
-
/* @__PURE__ */ jsxs(
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
{
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
663
|
+
/* @__PURE__ */ jsxs(
|
|
664
|
+
Accordion.Trigger,
|
|
665
|
+
{
|
|
666
|
+
onClick: () => onNodeClick({
|
|
667
|
+
isParent: true,
|
|
668
|
+
key: item.key,
|
|
669
|
+
label: item.label,
|
|
670
|
+
data: item.nodeData,
|
|
671
|
+
parentLabel: item.parentLabel
|
|
672
|
+
}),
|
|
673
|
+
className: "flex items-center gap-2 cursor-pointer py-1.5 px-2 group focus:outline-none focus-visible:ring-2 focus-visible:ring-accent w-full text-left rounded-md hover:bg-surface-raised transition-colors duration-150",
|
|
674
|
+
children: [
|
|
675
|
+
/* @__PURE__ */ jsx(
|
|
676
|
+
"svg",
|
|
655
677
|
{
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
678
|
+
viewBox: "0 0 24 24",
|
|
679
|
+
fill: "none",
|
|
680
|
+
stroke: "currentColor",
|
|
681
|
+
strokeWidth: 2.5,
|
|
682
|
+
className: "h-3.5 w-3.5 flex-shrink-0 text-foreground-muted transition-transform duration-200 group-data-[state=open]:rotate-0 group-data-[state=closed]:-rotate-90",
|
|
683
|
+
"aria-hidden": "true",
|
|
684
|
+
children: /* @__PURE__ */ jsx(
|
|
685
|
+
"path",
|
|
686
|
+
{
|
|
687
|
+
strokeLinecap: "round",
|
|
688
|
+
strokeLinejoin: "round",
|
|
689
|
+
d: "M19 9l-7 7-7-7"
|
|
690
|
+
}
|
|
691
|
+
)
|
|
659
692
|
}
|
|
660
|
-
)
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
{
|
|
666
|
-
className: "text-sm font-semibold text-foreground select-none",
|
|
667
|
-
onClick: () => onNodeClick({
|
|
668
|
-
isParent: true,
|
|
669
|
-
key: item.key,
|
|
670
|
-
label: item.label,
|
|
671
|
-
data: item.nodeData,
|
|
672
|
-
parentLabel: item.parentLabel
|
|
673
|
-
}),
|
|
674
|
-
children: item.label
|
|
675
|
-
}
|
|
676
|
-
)
|
|
677
|
-
] }),
|
|
693
|
+
),
|
|
694
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground select-none", children: item.label })
|
|
695
|
+
]
|
|
696
|
+
}
|
|
697
|
+
),
|
|
678
698
|
/* @__PURE__ */ jsx(Accordion.Content, { className: "overflow-hidden data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up", children: /* @__PURE__ */ jsx("div", { className: "ml-3.5 border-l border-border py-0.5", children: item.children.map((child) => /* @__PURE__ */ jsx(
|
|
679
699
|
TreeNodeItem,
|
|
680
700
|
{
|
|
@@ -1214,7 +1234,12 @@ function MenuBarItem({ icon, isActive, title, onClick }) {
|
|
|
1214
1234
|
className: `transition duration-300 hover:bg-prussian-blue ${isActive ? "bg-prussian-blue" : ""} rounded-lg p-2 cursor-pointer`,
|
|
1215
1235
|
onClick,
|
|
1216
1236
|
tabIndex: 0,
|
|
1217
|
-
onKeyDown: (e) =>
|
|
1237
|
+
onKeyDown: (e) => {
|
|
1238
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1239
|
+
e.preventDefault();
|
|
1240
|
+
onClick?.();
|
|
1241
|
+
}
|
|
1242
|
+
},
|
|
1218
1243
|
children: icon
|
|
1219
1244
|
}
|
|
1220
1245
|
) });
|
|
@@ -1449,7 +1474,8 @@ var SearchInput = React10.forwardRef(function SearchInput2({
|
|
|
1449
1474
|
disabled,
|
|
1450
1475
|
value,
|
|
1451
1476
|
onChange,
|
|
1452
|
-
type: "
|
|
1477
|
+
type: "search",
|
|
1478
|
+
enterKeyHint: "search",
|
|
1453
1479
|
name,
|
|
1454
1480
|
id: htmlFor,
|
|
1455
1481
|
className: "focus:outline-none pl-2 h-9 w-56 outline-offset-2 text-prussian-blue mt-1 rounded-lg disabled:bg-disabled disabled:cursor-not-allowed",
|
|
@@ -2420,6 +2446,9 @@ function TextInput({
|
|
|
2420
2446
|
className: `flex ${layout === "vertical" ? "flex-col" : "flex-row items-center gap-2"}`,
|
|
2421
2447
|
style: style ?? {},
|
|
2422
2448
|
children: [
|
|
2449
|
+
label && // Render <label> only when a label is provided. An empty
|
|
2450
|
+
// <label htmlFor=…> announces as an unlabeled control in
|
|
2451
|
+
// some screen readers.
|
|
2423
2452
|
/* @__PURE__ */ jsx(
|
|
2424
2453
|
"label",
|
|
2425
2454
|
{
|
|
@@ -2566,6 +2595,9 @@ function Password({
|
|
|
2566
2595
|
const color = iconColor ?? colors_default.PALETTE["prussian-blue"];
|
|
2567
2596
|
return /* @__PURE__ */ jsxs("div", { className: "relative flex flex-col items-center justify-center", style: style ?? {}, children: [
|
|
2568
2597
|
/* @__PURE__ */ jsxs("div", { className: `flex ${layout === "vertical" ? "flex-col" : "flex-row items-center gap-2"}`, children: [
|
|
2598
|
+
label && // Render <label> only when a label is provided. An empty
|
|
2599
|
+
// <label htmlFor=…> announces as an unlabeled control in
|
|
2600
|
+
// some screen readers.
|
|
2569
2601
|
/* @__PURE__ */ jsx(
|
|
2570
2602
|
"label",
|
|
2571
2603
|
{
|
|
@@ -2926,7 +2958,7 @@ function FileInput({
|
|
|
2926
2958
|
const fileInput = useRef(null);
|
|
2927
2959
|
const [files, setFiles] = useState([]);
|
|
2928
2960
|
const openPicker = () => {
|
|
2929
|
-
fileInput.current?.
|
|
2961
|
+
fileInput.current?.click();
|
|
2930
2962
|
};
|
|
2931
2963
|
const handleFiles = (list) => {
|
|
2932
2964
|
setFiles(list);
|
|
@@ -2958,56 +2990,70 @@ function FileInput({
|
|
|
2958
2990
|
onChange?.({ target: { files: [], name, id: name, value: "" } });
|
|
2959
2991
|
if (fileInput.current) fileInput.current.value = "";
|
|
2960
2992
|
};
|
|
2961
|
-
return
|
|
2962
|
-
"
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
hidden: true,
|
|
2977
|
-
type: "file",
|
|
2978
|
-
accept,
|
|
2979
|
-
multiple: allowMultiple
|
|
2993
|
+
return (
|
|
2994
|
+
// Dropzone is keyboard-activatable: role="button", focusable via
|
|
2995
|
+
// tabIndex, and Space/Enter trigger the file picker. Without these
|
|
2996
|
+
// a keyboard-only user could not upload a file.
|
|
2997
|
+
/* @__PURE__ */ jsxs(
|
|
2998
|
+
"div",
|
|
2999
|
+
{
|
|
3000
|
+
role: "button",
|
|
3001
|
+
tabIndex: 0,
|
|
3002
|
+
"aria-label": "Upload file \u2014 click or drop",
|
|
3003
|
+
onClick: openPicker,
|
|
3004
|
+
onKeyDown: (e) => {
|
|
3005
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
3006
|
+
e.preventDefault();
|
|
3007
|
+
openPicker();
|
|
2980
3008
|
}
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3009
|
+
},
|
|
3010
|
+
className: "border-2 hover:border-prussian-blue border-ice-dark w-full h-full rounded-md transition-all duration-300 border-dashed dark:border-independence hover:dark:border-ice-dark cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
3011
|
+
onDragOver: (e) => e.preventDefault(),
|
|
3012
|
+
onDrop,
|
|
3013
|
+
children: [
|
|
3014
|
+
/* @__PURE__ */ jsx(
|
|
3015
|
+
"input",
|
|
3016
|
+
{
|
|
3017
|
+
id: name,
|
|
3018
|
+
name,
|
|
3019
|
+
onChange: localOnChange,
|
|
3020
|
+
ref: fileInput,
|
|
3021
|
+
hidden: true,
|
|
3022
|
+
type: "file",
|
|
3023
|
+
accept,
|
|
3024
|
+
multiple: allowMultiple
|
|
3025
|
+
}
|
|
3026
|
+
),
|
|
3027
|
+
files.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-full items-center justify-center gap-2", children: [
|
|
3028
|
+
/* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: colors_default.PALETTE["prussian-blue"], className: "w-16 h-16 dark:fill-white", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M11.47 2.47a.75.75 0 011.06 0l4.5 4.5a.75.75 0 01-1.06 1.06l-3.22-3.22V16.5a.75.75 0 01-1.5 0V4.81L8.03 8.03a.75.75 0 01-1.06-1.06l4.5-4.5zM3 15.75a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z", clipRule: "evenodd" }) }),
|
|
3029
|
+
/* @__PURE__ */ jsx("div", { className: "text-prussian-blue dark:text-white text-sm", children: "Click or Drop a file" })
|
|
3030
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "flex gap-3 items-center justify-center w-full h-full", children: files.map((file, id) => /* @__PURE__ */ jsxs(
|
|
3031
|
+
"div",
|
|
3032
|
+
{
|
|
3033
|
+
className: "text-xs flex flex-col items-center w-20 h-24 text-center bg-ice-dark p-4 dark:bg-independence rounded-md relative",
|
|
3034
|
+
children: [
|
|
3035
|
+
/* @__PURE__ */ jsx(
|
|
3036
|
+
"button",
|
|
3037
|
+
{
|
|
3038
|
+
type: "button",
|
|
3039
|
+
onClick: removeFile,
|
|
3040
|
+
className: "bg-error rounded-full w-4 h-4 absolute right-[-5px] top-[-5px] cursor-pointer flex items-center justify-center",
|
|
3041
|
+
"aria-label": "Remove file",
|
|
3042
|
+
children: /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M15 5L5 15M5 5l10 10", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3043
|
+
}
|
|
3044
|
+
),
|
|
3045
|
+
/* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: colors_default.PALETTE["prussian-blue"], className: "w-10 h-10 dark:fill-white", children: [
|
|
3046
|
+
/* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0016.5 9h-1.875a1.875 1.875 0 01-1.875-1.875V5.25A3.75 3.75 0 009 1.5H5.625z", clipRule: "evenodd" }),
|
|
3047
|
+
/* @__PURE__ */ jsx("path", { d: "M12.971 1.816A5.23 5.23 0 0114.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 013.434 1.279 9.768 9.768 0 00-6.963-6.963z" })
|
|
3048
|
+
] }),
|
|
3049
|
+
/* @__PURE__ */ jsx("span", { className: "text-ellipsis whitespace-nowrap overflow-hidden w-full text-prussian-blue dark:text-white", children: file.name })
|
|
3050
|
+
]
|
|
3051
|
+
},
|
|
3052
|
+
`${id}${file.name}`
|
|
3053
|
+
)) })
|
|
3054
|
+
]
|
|
3055
|
+
}
|
|
3056
|
+
)
|
|
3011
3057
|
);
|
|
3012
3058
|
}
|
|
3013
3059
|
var MONTHS = {
|