@geomak/ui 1.0.0 → 1.1.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.cjs CHANGED
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var React9 = require('react');
5
5
  var Dialog = require('@radix-ui/react-dialog');
6
+ var framerMotion = require('framer-motion');
6
7
  var TooltipPrimitive = require('@radix-ui/react-tooltip');
7
8
  var TabsPrimitive = require('@radix-ui/react-tabs');
8
9
  var Accordion = require('@radix-ui/react-accordion');
@@ -321,33 +322,57 @@ function Modal({
321
322
  title,
322
323
  children
323
324
  }) {
325
+ const reduced = framerMotion.useReducedMotion();
324
326
  return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Root, { open: isOpen, onOpenChange: (open) => {
325
327
  if (!open) onClose?.();
326
- }, children: /* @__PURE__ */ jsxRuntime.jsxs(Dialog__namespace.Portal, { children: [
327
- /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.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" }),
328
- /* @__PURE__ */ jsxRuntime.jsxs(
329
- Dialog__namespace.Content,
328
+ }, children: /* @__PURE__ */ jsxRuntime.jsxs(Dialog__namespace.Portal, { forceMount: true, children: [
329
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Overlay, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
330
+ framerMotion.motion.div,
331
+ {
332
+ className: "fixed inset-0 bg-oxford-blue-700-opaque z-50",
333
+ initial: { opacity: 0 },
334
+ animate: { opacity: 1 },
335
+ exit: { opacity: 0 },
336
+ transition: { duration: reduced ? 0 : 0.18, ease: "easeOut" }
337
+ }
338
+ ) }) }),
339
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Content, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
340
+ framerMotion.motion.div,
330
341
  {
331
- style: { width: size[0], height: size[1] },
332
- 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",
342
+ 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",
343
+ style: {
344
+ width: size[0],
345
+ height: size[1],
346
+ x: "-50%",
347
+ y: "-50%"
348
+ },
349
+ initial: { opacity: 0, scale: reduced ? 1 : 0.96 },
350
+ animate: { opacity: 1, scale: 1 },
351
+ exit: { opacity: 0, scale: reduced ? 1 : 0.96 },
352
+ transition: reduced ? { duration: 0 } : {
353
+ type: "spring",
354
+ damping: 28,
355
+ stiffness: 380,
356
+ duration: 0.25
357
+ },
333
358
  children: [
334
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-[12%] flex items-center justify-between border-b border-ice dark:border-independence p-2", children: [
335
- /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Title, { className: "text-prussian-blue dark:text-white font-bold text-lg", children: title }),
359
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-14 flex-shrink-0 items-center justify-between border-b border-ice dark:border-independence px-5", children: [
360
+ /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Title, { className: "text-base font-semibold text-prussian-blue dark:text-white tracking-tight", children: title }),
336
361
  /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
337
362
  "button",
338
363
  {
339
364
  "aria-label": "Close",
340
- className: "cursor-pointer rounded p-1 hover:bg-ice dark:hover:bg-independence transition-colors",
341
- children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.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" }) })
365
+ 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",
366
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", children: /* @__PURE__ */ jsxRuntime.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" }) })
342
367
  }
343
368
  ) })
344
369
  ] }),
345
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${hasFooter ? "max-h-[77%]" : "max-h-[90%]"} p-2 overflow-y-auto`, children: isOpen && children }),
346
- hasFooter && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end items-center gap-5 border-t border-ice dark:border-independence h-max p-2", children: [
370
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-1 overflow-y-auto p-5 ${hasFooter ? "" : "pb-5"}`, children: isOpen && children }),
371
+ hasFooter && /* @__PURE__ */ jsxRuntime.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: [
347
372
  /* @__PURE__ */ jsxRuntime.jsx(
348
373
  Button,
349
374
  {
350
- style: { width: 100, margin: "0" },
375
+ style: { width: 90 },
351
376
  content: cancelText,
352
377
  onClick: onCancel
353
378
  }
@@ -355,7 +380,7 @@ function Modal({
355
380
  /* @__PURE__ */ jsxRuntime.jsx(
356
381
  Button,
357
382
  {
358
- style: { width: 100, margin: "0" },
383
+ style: { width: 90 },
359
384
  content: okText,
360
385
  onClick: onOk
361
386
  }
@@ -363,7 +388,7 @@ function Modal({
363
388
  ] })
364
389
  ]
365
390
  }
366
- )
391
+ ) }) })
367
392
  ] }) });
368
393
  }
369
394
  function Drawer({
@@ -379,48 +404,59 @@ function Drawer({
379
404
  title,
380
405
  children
381
406
  }) {
407
+ const reduced = framerMotion.useReducedMotion();
382
408
  const isRight = placement === "right";
409
+ const hiddenX = isRight ? "100%" : "-100%";
383
410
  return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Root, { open: isOpen, onOpenChange: (open) => {
384
411
  if (!open) onClose?.();
385
- }, children: /* @__PURE__ */ jsxRuntime.jsxs(Dialog__namespace.Portal, { children: [
386
- /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.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" }),
387
- /* @__PURE__ */ jsxRuntime.jsxs(
388
- Dialog__namespace.Content,
412
+ }, children: /* @__PURE__ */ jsxRuntime.jsxs(Dialog__namespace.Portal, { forceMount: true, children: [
413
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Overlay, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
414
+ framerMotion.motion.div,
415
+ {
416
+ className: "fixed inset-0 bg-oxford-blue-700-opaque z-[5000]",
417
+ initial: { opacity: 0 },
418
+ animate: { opacity: 1 },
419
+ exit: { opacity: 0 },
420
+ transition: { duration: reduced ? 0 : 0.2, ease: "easeOut" }
421
+ }
422
+ ) }) }),
423
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Content, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
424
+ framerMotion.motion.div,
389
425
  {
426
+ 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`,
390
427
  style: { width },
391
- 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`,
428
+ initial: { x: reduced ? 0 : hiddenX, opacity: reduced ? 0 : 1 },
429
+ animate: { x: 0, opacity: 1 },
430
+ exit: { x: reduced ? 0 : hiddenX, opacity: reduced ? 0 : 1 },
431
+ transition: reduced ? { duration: 0 } : {
432
+ x: {
433
+ type: "tween",
434
+ duration: 0.26,
435
+ ease: [0.16, 1, 0.3, 1]
436
+ // ease-out-expo
437
+ },
438
+ opacity: { duration: 0 }
439
+ },
392
440
  children: [
393
- /* @__PURE__ */ jsxRuntime.jsxs(
394
- "div",
395
- {
396
- className: `h-[5%] border-b border-ice dark:border-independence p-2 flex items-center justify-between ${isRight && "flex-row-reverse"}`,
397
- children: [
398
- /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Title, { className: "text-prussian-blue dark:text-white font-bold text-lg", children: title }),
399
- /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
400
- "button",
401
- {
402
- "aria-label": "Close drawer",
403
- className: "cursor-pointer rounded p-1 hover:bg-ice dark:hover:bg-independence transition-colors",
404
- children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.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" }) })
405
- }
406
- ) })
407
- ]
408
- }
409
- ),
410
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${hasFooter ? "h-[88%]" : "h-[95%]"} overflow-y-auto`, children: isOpen && children }),
411
- hasFooter && /* @__PURE__ */ jsxRuntime.jsxs(
412
- "div",
413
- {
414
- className: `gap-5 h-[7%] pr-2 pl-2 border-t border-ice dark:border-independence flex items-center ${isRight ? "justify-start" : "justify-end"}`,
415
- children: [
416
- /* @__PURE__ */ jsxRuntime.jsx(Button, { style: { width: 100 }, content: cancelText, onClick: onCancel }),
417
- /* @__PURE__ */ jsxRuntime.jsx(Button, { style: { width: 100 }, content: okText, onClick: onOk })
418
- ]
419
- }
420
- )
441
+ /* @__PURE__ */ jsxRuntime.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: [
442
+ /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Title, { className: "text-base font-semibold text-prussian-blue dark:text-white tracking-tight", children: title }),
443
+ /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
444
+ "button",
445
+ {
446
+ "aria-label": "Close drawer",
447
+ 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",
448
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", children: /* @__PURE__ */ jsxRuntime.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" }) })
449
+ }
450
+ ) })
451
+ ] }),
452
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto p-5", children: isOpen && children }),
453
+ hasFooter && /* @__PURE__ */ jsxRuntime.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: [
454
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { style: { width: 90 }, content: cancelText, onClick: onCancel }),
455
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { style: { width: 90 }, content: okText, onClick: onOk })
456
+ ] })
421
457
  ]
422
458
  }
423
- )
459
+ ) }) })
424
460
  ] }) });
425
461
  }
426
462
  function Tooltip({
@@ -557,27 +593,28 @@ function Tabs({
557
593
  var isParent = (item) => Boolean(item.children && item.children.length > 0);
558
594
  function TreeNodeItem({
559
595
  item,
560
- onItemClick,
596
+ onNodeClick,
561
597
  defaultExpandAll,
562
598
  defaultExpandedKeys,
563
599
  depth = 0
564
600
  }) {
565
601
  if (!isParent(item)) {
566
602
  return /* @__PURE__ */ jsxRuntime.jsxs(
567
- "div",
603
+ "button",
568
604
  {
569
- style: { marginLeft: depth * 10 + 16 },
570
- className: "flex items-center gap-2 cursor-pointer py-0.5",
571
- onClick: () => onItemClick({
605
+ type: "button",
606
+ 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",
607
+ style: { paddingLeft: depth * 12 + 8 },
608
+ onClick: () => onNodeClick({
572
609
  isParent: false,
573
610
  key: item.key,
574
- label: item.value,
611
+ label: item.label,
575
612
  data: item.nodeData,
576
613
  parentLabel: item.parentLabel
577
614
  }),
578
615
  children: [
579
- /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", d: "M5 12h14" }) }),
580
- /* @__PURE__ */ jsxRuntime.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 })
616
+ /* @__PURE__ */ jsxRuntime.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" }),
617
+ /* @__PURE__ */ jsxRuntime.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 })
581
618
  ]
582
619
  }
583
620
  );
@@ -588,47 +625,47 @@ function TreeNodeItem({
588
625
  {
589
626
  type: "multiple",
590
627
  defaultValue: initialOpen,
591
- style: { marginLeft: depth * 10 },
628
+ style: { paddingLeft: depth * 12 },
592
629
  children: /* @__PURE__ */ jsxRuntime.jsxs(Accordion__namespace.Item, { value: item.key, className: "border-none", children: [
593
- /* @__PURE__ */ jsxRuntime.jsxs(
594
- Accordion__namespace.Trigger,
595
- {
596
- className: "flex items-center gap-2 cursor-pointer py-0.5 group focus:outline-none w-full text-left",
597
- onClick: (e) => e.stopPropagation(),
598
- children: [
599
- /* @__PURE__ */ jsxRuntime.jsx(
600
- "svg",
601
- {
602
- viewBox: "0 0 24 24",
603
- fill: "none",
604
- stroke: colors_default.PALETTE["prussian-blue"],
605
- strokeWidth: 2,
606
- className: "h-4 w-4 flex-shrink-0 transition-transform duration-300 group-data-[state=closed]:-rotate-90 dark:stroke-white",
607
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
608
- }
609
- ),
610
- /* @__PURE__ */ jsxRuntime.jsx(
611
- "span",
630
+ /* @__PURE__ */ jsxRuntime.jsxs(Accordion__namespace.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: [
631
+ /* @__PURE__ */ jsxRuntime.jsx(
632
+ "svg",
633
+ {
634
+ viewBox: "0 0 24 24",
635
+ fill: "none",
636
+ stroke: "currentColor",
637
+ strokeWidth: 2.5,
638
+ 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",
639
+ children: /* @__PURE__ */ jsxRuntime.jsx(
640
+ "path",
612
641
  {
613
- 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",
614
- onClick: () => onItemClick({
615
- isParent: true,
616
- key: item.key,
617
- label: item.value,
618
- data: item.nodeData,
619
- parentLabel: item.parentLabel
620
- }),
621
- children: item.value
642
+ strokeLinecap: "round",
643
+ strokeLinejoin: "round",
644
+ d: "M19 9l-7 7-7-7"
622
645
  }
623
646
  )
624
- ]
625
- }
626
- ),
627
- /* @__PURE__ */ jsxRuntime.jsx(Accordion__namespace.Content, { className: "overflow-hidden data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-[7px] border-l border-prussian-blue dark:border-ice-dark", children: item.children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
647
+ }
648
+ ),
649
+ /* @__PURE__ */ jsxRuntime.jsx(
650
+ "span",
651
+ {
652
+ className: "text-sm font-semibold text-prussian-blue dark:text-white select-none",
653
+ onClick: () => onNodeClick({
654
+ isParent: true,
655
+ key: item.key,
656
+ label: item.label,
657
+ data: item.nodeData,
658
+ parentLabel: item.parentLabel
659
+ }),
660
+ children: item.label
661
+ }
662
+ )
663
+ ] }),
664
+ /* @__PURE__ */ jsxRuntime.jsx(Accordion__namespace.Content, { className: "overflow-hidden data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-3.5 border-l border-ice-dark dark:border-independence py-0.5", children: item.children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
628
665
  TreeNodeItem,
629
666
  {
630
667
  item: child,
631
- onItemClick,
668
+ onNodeClick,
632
669
  defaultExpandAll,
633
670
  defaultExpandedKeys,
634
671
  depth: depth + 1
@@ -640,16 +677,16 @@ function TreeNodeItem({
640
677
  );
641
678
  }
642
679
  function Tree({
643
- structure,
644
- onItemClick,
680
+ nodes,
681
+ onNodeClick,
645
682
  defaultExpandAll = false,
646
683
  defaultExpandedKeys = []
647
684
  }) {
648
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2", children: structure.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
685
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-1 w-full", children: nodes.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
649
686
  TreeNodeItem,
650
687
  {
651
688
  item,
652
- onItemClick,
689
+ onNodeClick,
653
690
  defaultExpandAll,
654
691
  defaultExpandedKeys
655
692
  },