@geomak/ui 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,9 @@
1
+ import { colors_default } from './chunk-DNQSZOYD.js';
2
+ export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-DNQSZOYD.js';
1
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
4
  import React9, { createContext, useMemo, useState, useEffect, useContext, useRef, useCallback, useId } from 'react';
3
5
  import * as Dialog from '@radix-ui/react-dialog';
6
+ import { useReducedMotion, AnimatePresence, motion } from 'framer-motion';
4
7
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
5
8
  import * as TabsPrimitive from '@radix-ui/react-tabs';
6
9
  import * as Accordion from '@radix-ui/react-accordion';
@@ -10,43 +13,6 @@ import * as Popover from '@radix-ui/react-popover';
10
13
  import * as SwitchPrimitive from '@radix-ui/react-switch';
11
14
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
12
15
 
13
- // src/utils/colors.ts
14
- var PALETTE = {
15
- "true-blue": "#0466C8",
16
- "usafa-blue": "#0353A4",
17
- "dark-cornflower-blue": "#023E7D",
18
- "oxford-blue-700": "#002855",
19
- "oxford-blue-800": "#001845",
20
- "oxford-blue-900": "#001233",
21
- independence: "#33415C",
22
- "black-coral": "#5C677D",
23
- "roman-silver": "#7D8597",
24
- manatee: "#979DAC",
25
- white: "#fff",
26
- ice: "#DBF1FD",
27
- "ice-dark": "#d0e3ed",
28
- "midnight-green-eagle-900": "#013E53",
29
- "midnight-green-eagle-700": "#125F6C",
30
- "midnight-green-eagle-500": "#125F6C",
31
- "rich-black-fogra": "#000202",
32
- "rich-black-fogra-opaque": "#0000005b",
33
- "prussian-blue": "#00273A",
34
- "indigo-dye": "#013C54",
35
- ming: "#0F6372",
36
- skobeloff: "#217479",
37
- "dark-cyan": "#2A8784",
38
- "celadon-green": "#297E74",
39
- turquise: "#2EB8B0",
40
- "oxford-blue-700-opaque": "rgba(0, 40, 85, .3)",
41
- disabled: "#dee2e6",
42
- error: "tomato",
43
- warning: "orange",
44
- success: "lightgreen",
45
- info: "lightblue",
46
- transparent: "rgba(255, 255, 255, .0)"
47
- };
48
- var COLORS = { PALETTE };
49
- var colors_default = COLORS;
50
16
  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" }) });
51
17
  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" }) });
52
18
  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 }) });
@@ -288,33 +254,57 @@ function Modal({
288
254
  title,
289
255
  children
290
256
  }) {
257
+ const reduced = useReducedMotion();
291
258
  return /* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, onOpenChange: (open) => {
292
259
  if (!open) onClose?.();
293
- }, children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
294
- /* @__PURE__ */ jsx(Dialog.Overlay, { className: "fixed inset-0 bg-oxford-blue-700-opaque z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 transition-all duration-300" }),
295
- /* @__PURE__ */ jsxs(
296
- Dialog.Content,
260
+ }, children: /* @__PURE__ */ jsxs(Dialog.Portal, { forceMount: true, children: [
261
+ /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(Dialog.Overlay, { asChild: true, children: /* @__PURE__ */ jsx(
262
+ motion.div,
263
+ {
264
+ className: "fixed inset-0 bg-oxford-blue-700-opaque z-50",
265
+ initial: { opacity: 0 },
266
+ animate: { opacity: 1 },
267
+ exit: { opacity: 0 },
268
+ transition: { duration: reduced ? 0 : 0.18, ease: "easeOut" }
269
+ }
270
+ ) }) }),
271
+ /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(Dialog.Content, { asChild: true, children: /* @__PURE__ */ jsxs(
272
+ motion.div,
297
273
  {
298
- style: { width: size[0], height: size[1] },
299
- className: "fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-50 shadow-md rounded-lg bg-white dark:bg-prussian-blue p-1 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 duration-300 focus:outline-none",
274
+ className: "fixed left-1/2 top-1/2 z-50 flex flex-col bg-white dark:bg-prussian-blue rounded-2xl shadow-2xl shadow-black/20 overflow-hidden focus:outline-none",
275
+ style: {
276
+ width: size[0],
277
+ height: size[1],
278
+ x: "-50%",
279
+ y: "-50%"
280
+ },
281
+ initial: { opacity: 0, scale: reduced ? 1 : 0.96 },
282
+ animate: { opacity: 1, scale: 1 },
283
+ exit: { opacity: 0, scale: reduced ? 1 : 0.96 },
284
+ transition: reduced ? { duration: 0 } : {
285
+ type: "spring",
286
+ damping: 28,
287
+ stiffness: 380,
288
+ duration: 0.25
289
+ },
300
290
  children: [
301
- /* @__PURE__ */ jsxs("div", { className: "h-[12%] flex items-center justify-between border-b border-ice dark:border-independence p-2", children: [
302
- /* @__PURE__ */ jsx(Dialog.Title, { className: "text-prussian-blue dark:text-white font-bold text-lg", children: title }),
291
+ /* @__PURE__ */ jsxs("div", { className: "flex h-14 flex-shrink-0 items-center justify-between border-b border-ice dark:border-independence px-5", children: [
292
+ /* @__PURE__ */ jsx(Dialog.Title, { className: "text-base font-semibold text-prussian-blue dark:text-white tracking-tight", children: title }),
303
293
  /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(
304
294
  "button",
305
295
  {
306
296
  "aria-label": "Close",
307
- className: "cursor-pointer rounded p-1 hover:bg-ice dark:hover:bg-independence transition-colors",
308
- children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M15 5L5 15M5 5l10 10", stroke: colors_default.PALETTE["prussian-blue"], strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "dark:stroke-white" }) })
297
+ className: "flex h-7 w-7 items-center justify-center rounded-lg text-black-coral dark:text-manatee hover:bg-ice hover:text-prussian-blue dark:hover:bg-oxford-blue-700 dark:hover:text-white transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-true-blue",
298
+ children: /* @__PURE__ */ jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) })
309
299
  }
310
300
  ) })
311
301
  ] }),
312
- /* @__PURE__ */ jsx("div", { className: `${hasFooter ? "max-h-[77%]" : "max-h-[90%]"} p-2 overflow-y-auto`, children: isOpen && children }),
313
- hasFooter && /* @__PURE__ */ jsxs("div", { className: "flex justify-end items-center gap-5 border-t border-ice dark:border-independence h-max p-2", children: [
302
+ /* @__PURE__ */ jsx("div", { className: `flex-1 overflow-y-auto p-5 ${hasFooter ? "" : "pb-5"}`, children: isOpen && children }),
303
+ hasFooter && /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center justify-end gap-3 border-t border-ice dark:border-independence px-5 py-3", children: [
314
304
  /* @__PURE__ */ jsx(
315
305
  Button,
316
306
  {
317
- style: { width: 100, margin: "0" },
307
+ style: { width: 90 },
318
308
  content: cancelText,
319
309
  onClick: onCancel
320
310
  }
@@ -322,7 +312,7 @@ function Modal({
322
312
  /* @__PURE__ */ jsx(
323
313
  Button,
324
314
  {
325
- style: { width: 100, margin: "0" },
315
+ style: { width: 90 },
326
316
  content: okText,
327
317
  onClick: onOk
328
318
  }
@@ -330,7 +320,7 @@ function Modal({
330
320
  ] })
331
321
  ]
332
322
  }
333
- )
323
+ ) }) })
334
324
  ] }) });
335
325
  }
336
326
  function Drawer({
@@ -346,48 +336,59 @@ function Drawer({
346
336
  title,
347
337
  children
348
338
  }) {
339
+ const reduced = useReducedMotion();
349
340
  const isRight = placement === "right";
341
+ const hiddenX = isRight ? "100%" : "-100%";
350
342
  return /* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, onOpenChange: (open) => {
351
343
  if (!open) onClose?.();
352
- }, children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
353
- /* @__PURE__ */ jsx(Dialog.Overlay, { className: "fixed inset-0 bg-oxford-blue-700-opaque z-[5000] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-300" }),
354
- /* @__PURE__ */ jsxs(
355
- Dialog.Content,
344
+ }, children: /* @__PURE__ */ jsxs(Dialog.Portal, { forceMount: true, children: [
345
+ /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(Dialog.Overlay, { asChild: true, children: /* @__PURE__ */ jsx(
346
+ motion.div,
356
347
  {
348
+ className: "fixed inset-0 bg-oxford-blue-700-opaque z-[5000]",
349
+ initial: { opacity: 0 },
350
+ animate: { opacity: 1 },
351
+ exit: { opacity: 0 },
352
+ transition: { duration: reduced ? 0 : 0.2, ease: "easeOut" }
353
+ }
354
+ ) }) }),
355
+ /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(Dialog.Content, { asChild: true, children: /* @__PURE__ */ jsxs(
356
+ motion.div,
357
+ {
358
+ className: `fixed top-0 bottom-0 ${isRight ? "right-0" : "left-0"} z-[5000] flex flex-col bg-white dark:bg-prussian-blue shadow-2xl shadow-black/25 focus:outline-none`,
357
359
  style: { width },
358
- className: `fixed top-0 bottom-0 ${isRight ? "right-0 data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right" : "left-0 data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left"} z-[5000] h-full shadow-md bg-white dark:bg-prussian-blue p-1 data-[state=open]:animate-in data-[state=closed]:animate-out duration-300 focus:outline-none`,
360
+ initial: { x: reduced ? 0 : hiddenX, opacity: reduced ? 0 : 1 },
361
+ animate: { x: 0, opacity: 1 },
362
+ exit: { x: reduced ? 0 : hiddenX, opacity: reduced ? 0 : 1 },
363
+ transition: reduced ? { duration: 0 } : {
364
+ x: {
365
+ type: "tween",
366
+ duration: 0.26,
367
+ ease: [0.16, 1, 0.3, 1]
368
+ // ease-out-expo
369
+ },
370
+ opacity: { duration: 0 }
371
+ },
359
372
  children: [
360
- /* @__PURE__ */ jsxs(
361
- "div",
362
- {
363
- className: `h-[5%] border-b border-ice dark:border-independence p-2 flex items-center justify-between ${isRight && "flex-row-reverse"}`,
364
- children: [
365
- /* @__PURE__ */ jsx(Dialog.Title, { className: "text-prussian-blue dark:text-white font-bold text-lg", children: title }),
366
- /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(
367
- "button",
368
- {
369
- "aria-label": "Close drawer",
370
- className: "cursor-pointer rounded p-1 hover:bg-ice dark:hover:bg-independence transition-colors",
371
- children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M15 5L5 15M5 5l10 10", stroke: colors_default.PALETTE["prussian-blue"], strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", className: "dark:stroke-white" }) })
372
- }
373
- ) })
374
- ]
375
- }
376
- ),
377
- /* @__PURE__ */ jsx("div", { className: `${hasFooter ? "h-[88%]" : "h-[95%]"} overflow-y-auto`, children: isOpen && children }),
378
- hasFooter && /* @__PURE__ */ jsxs(
379
- "div",
380
- {
381
- className: `gap-5 h-[7%] pr-2 pl-2 border-t border-ice dark:border-independence flex items-center ${isRight ? "justify-start" : "justify-end"}`,
382
- children: [
383
- /* @__PURE__ */ jsx(Button, { style: { width: 100 }, content: cancelText, onClick: onCancel }),
384
- /* @__PURE__ */ jsx(Button, { style: { width: 100 }, content: okText, onClick: onOk })
385
- ]
386
- }
387
- )
373
+ /* @__PURE__ */ jsxs("div", { className: `flex h-14 flex-shrink-0 items-center justify-between border-b border-ice dark:border-independence px-5 ${isRight ? "flex-row-reverse" : ""}`, children: [
374
+ /* @__PURE__ */ jsx(Dialog.Title, { className: "text-base font-semibold text-prussian-blue dark:text-white tracking-tight", children: title }),
375
+ /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(
376
+ "button",
377
+ {
378
+ "aria-label": "Close drawer",
379
+ className: "flex h-7 w-7 items-center justify-center rounded-lg text-black-coral dark:text-manatee hover:bg-ice hover:text-prussian-blue dark:hover:bg-oxford-blue-700 dark:hover:text-white transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-true-blue",
380
+ children: /* @__PURE__ */ jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) })
381
+ }
382
+ ) })
383
+ ] }),
384
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-5", children: isOpen && children }),
385
+ hasFooter && /* @__PURE__ */ jsxs("div", { className: `flex flex-shrink-0 items-center gap-3 border-t border-ice dark:border-independence px-5 py-3 ${isRight ? "justify-start" : "justify-end"}`, children: [
386
+ /* @__PURE__ */ jsx(Button, { style: { width: 90 }, content: cancelText, onClick: onCancel }),
387
+ /* @__PURE__ */ jsx(Button, { style: { width: 90 }, content: okText, onClick: onOk })
388
+ ] })
388
389
  ]
389
390
  }
390
- )
391
+ ) }) })
391
392
  ] }) });
392
393
  }
393
394
  function Tooltip({
@@ -524,27 +525,28 @@ function Tabs({
524
525
  var isParent = (item) => Boolean(item.children && item.children.length > 0);
525
526
  function TreeNodeItem({
526
527
  item,
527
- onItemClick,
528
+ onNodeClick,
528
529
  defaultExpandAll,
529
530
  defaultExpandedKeys,
530
531
  depth = 0
531
532
  }) {
532
533
  if (!isParent(item)) {
533
534
  return /* @__PURE__ */ jsxs(
534
- "div",
535
+ "button",
535
536
  {
536
- style: { marginLeft: depth * 10 + 16 },
537
- className: "flex items-center gap-2 cursor-pointer py-0.5",
538
- onClick: () => onItemClick({
537
+ type: "button",
538
+ className: "flex w-full items-center gap-2.5 cursor-pointer select-none group text-left rounded-md px-2 py-1.5 hover:bg-ice dark:hover:bg-oxford-blue-700 transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-true-blue",
539
+ style: { paddingLeft: depth * 12 + 8 },
540
+ onClick: () => onNodeClick({
539
541
  isParent: false,
540
542
  key: item.key,
541
- label: item.value,
543
+ label: item.label,
542
544
  data: item.nodeData,
543
545
  parentLabel: item.parentLabel
544
546
  }),
545
547
  children: [
546
- /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: colors_default.PALETTE["prussian-blue"], strokeWidth: 2, className: "h-4 w-4 flex-shrink-0 dark:stroke-white", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", d: "M5 12h14" }) }),
547
- /* @__PURE__ */ jsx("span", { className: "text-xs text-prussian-blue dark:text-white select-none transition-all duration-300 hover:bg-ice-dark dark:hover:bg-independence rounded-lg p-1", children: item.value })
548
+ /* @__PURE__ */ jsx("span", { className: "w-1.5 h-1.5 rounded-full flex-shrink-0 bg-roman-silver dark:bg-manatee group-hover:bg-true-blue dark:group-hover:bg-true-blue transition-colors duration-150" }),
549
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-independence dark:text-manatee group-hover:text-prussian-blue dark:group-hover:text-white transition-colors duration-150", children: item.label })
548
550
  ]
549
551
  }
550
552
  );
@@ -555,47 +557,47 @@ function TreeNodeItem({
555
557
  {
556
558
  type: "multiple",
557
559
  defaultValue: initialOpen,
558
- style: { marginLeft: depth * 10 },
560
+ style: { paddingLeft: depth * 12 },
559
561
  children: /* @__PURE__ */ jsxs(Accordion.Item, { value: item.key, className: "border-none", children: [
560
- /* @__PURE__ */ jsxs(
561
- Accordion.Trigger,
562
- {
563
- className: "flex items-center gap-2 cursor-pointer py-0.5 group focus:outline-none w-full text-left",
564
- onClick: (e) => e.stopPropagation(),
565
- children: [
566
- /* @__PURE__ */ jsx(
567
- "svg",
568
- {
569
- viewBox: "0 0 24 24",
570
- fill: "none",
571
- stroke: colors_default.PALETTE["prussian-blue"],
572
- strokeWidth: 2,
573
- className: "h-4 w-4 flex-shrink-0 transition-transform duration-300 group-data-[state=closed]:-rotate-90 dark:stroke-white",
574
- children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
575
- }
576
- ),
577
- /* @__PURE__ */ jsx(
578
- "span",
562
+ /* @__PURE__ */ jsxs(Accordion.Trigger, { className: "flex items-center gap-2 cursor-pointer py-1.5 px-2 group focus:outline-none focus-visible:ring-2 focus-visible:ring-true-blue w-full text-left rounded-md hover:bg-ice dark:hover:bg-oxford-blue-700 transition-colors duration-150", children: [
563
+ /* @__PURE__ */ jsx(
564
+ "svg",
565
+ {
566
+ viewBox: "0 0 24 24",
567
+ fill: "none",
568
+ stroke: "currentColor",
569
+ strokeWidth: 2.5,
570
+ className: "h-3.5 w-3.5 flex-shrink-0 text-black-coral dark:text-manatee transition-transform duration-200 group-data-[state=open]:rotate-0 group-data-[state=closed]:-rotate-90",
571
+ children: /* @__PURE__ */ jsx(
572
+ "path",
579
573
  {
580
- className: "text-sm font-bold text-prussian-blue dark:text-white select-none transition-all duration-300 hover:bg-ice-dark dark:hover:bg-independence rounded-lg p-1",
581
- onClick: () => onItemClick({
582
- isParent: true,
583
- key: item.key,
584
- label: item.value,
585
- data: item.nodeData,
586
- parentLabel: item.parentLabel
587
- }),
588
- children: item.value
574
+ strokeLinecap: "round",
575
+ strokeLinejoin: "round",
576
+ d: "M19 9l-7 7-7-7"
589
577
  }
590
578
  )
591
- ]
592
- }
593
- ),
594
- /* @__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-[7px] border-l border-prussian-blue dark:border-ice-dark", children: item.children.map((child) => /* @__PURE__ */ jsx(
579
+ }
580
+ ),
581
+ /* @__PURE__ */ jsx(
582
+ "span",
583
+ {
584
+ className: "text-sm font-semibold text-prussian-blue dark:text-white select-none",
585
+ onClick: () => onNodeClick({
586
+ isParent: true,
587
+ key: item.key,
588
+ label: item.label,
589
+ data: item.nodeData,
590
+ parentLabel: item.parentLabel
591
+ }),
592
+ children: item.label
593
+ }
594
+ )
595
+ ] }),
596
+ /* @__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-ice-dark dark:border-independence py-0.5", children: item.children.map((child) => /* @__PURE__ */ jsx(
595
597
  TreeNodeItem,
596
598
  {
597
599
  item: child,
598
- onItemClick,
600
+ onNodeClick,
599
601
  defaultExpandAll,
600
602
  defaultExpandedKeys,
601
603
  depth: depth + 1
@@ -607,16 +609,16 @@ function TreeNodeItem({
607
609
  );
608
610
  }
609
611
  function Tree({
610
- structure,
611
- onItemClick,
612
+ nodes,
613
+ onNodeClick,
612
614
  defaultExpandAll = false,
613
615
  defaultExpandedKeys = []
614
616
  }) {
615
- return /* @__PURE__ */ jsx("div", { className: "p-2", children: structure.map((item) => /* @__PURE__ */ jsx(
617
+ return /* @__PURE__ */ jsx("div", { className: "p-1 w-full", children: nodes.map((item) => /* @__PURE__ */ jsx(
616
618
  TreeNodeItem,
617
619
  {
618
620
  item,
619
- onItemClick,
621
+ onNodeClick,
620
622
  defaultExpandAll,
621
623
  defaultExpandedKeys
622
624
  },
@@ -2597,6 +2599,6 @@ Temporal.DatePicker = DatePickerBase;
2597
2599
  Temporal.TemporalPicker = TemporalPickerBase;
2598
2600
  var DatePicker_default = Temporal;
2599
2601
 
2600
- export { AutoComplete, Button, colors_default as COLORS, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ContextMenu, Drawer, Dropdown, DropdownPill, FadingBase, FileInput, GridCard, icons_default as Icon, IconButton, List2 as List, LoadingSpinner, MenuBar, MenuBarItem, Modal, NotificationProvider, NumberInput, OpaqueGridCard, Password, ScalableContainer, SearchInput_default as SearchInput, Switch2 as Switch, Table, Tabs, DatePicker_default as Temporal, TextInput, Switch as ThemeSwitch, ToggleButton, Tooltip, TooltipProvider, Tree, TreeSelect, Wizard, useNotification };
2602
+ export { AutoComplete, Button, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ContextMenu, Drawer, Dropdown, DropdownPill, FadingBase, FileInput, GridCard, icons_default as Icon, IconButton, List2 as List, LoadingSpinner, MenuBar, MenuBarItem, Modal, NotificationProvider, NumberInput, OpaqueGridCard, Password, ScalableContainer, SearchInput_default as SearchInput, Switch2 as Switch, Table, Tabs, DatePicker_default as Temporal, TextInput, Switch as ThemeSwitch, ToggleButton, Tooltip, TooltipProvider, Tree, TreeSelect, Wizard, useNotification };
2601
2603
  //# sourceMappingURL=index.js.map
2602
2604
  //# sourceMappingURL=index.js.map