@inf-monkeys-tech/monkeys-design 1.0.96 → 1.0.97

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.
@@ -1,4 +1,4 @@
1
- import * as DropdownMenu3 from '@radix-ui/react-dropdown-menu';
1
+ import * as DropdownMenu4 from '@radix-ui/react-dropdown-menu';
2
2
  import { forwardRef, useState, useContext, useMemo, createContext, useRef, useEffect, useCallback, Fragment as Fragment$1, useLayoutEffect } from 'react';
3
3
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
4
  import { twMerge } from 'tailwind-merge';
@@ -757,8 +757,8 @@ function DataExplorerSelect({
757
757
  /* @__PURE__ */ jsx("span", { children: label }),
758
758
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: selected?.label ?? placeholder })
759
759
  ] }) : selected?.label ?? label ?? placeholder;
760
- return /* @__PURE__ */ jsxs(DropdownMenu3.Root, { children: [
761
- /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
760
+ return /* @__PURE__ */ jsxs(DropdownMenu4.Root, { children: [
761
+ /* @__PURE__ */ jsx(DropdownMenu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
762
762
  "button",
763
763
  {
764
764
  type: "button",
@@ -786,8 +786,8 @@ function DataExplorerSelect({
786
786
  ]
787
787
  }
788
788
  ) }),
789
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx(
790
- DropdownMenu3.Content,
789
+ /* @__PURE__ */ jsx(DropdownMenu4.Portal, { children: /* @__PURE__ */ jsx(
790
+ DropdownMenu4.Content,
791
791
  {
792
792
  align,
793
793
  sideOffset,
@@ -795,7 +795,7 @@ function DataExplorerSelect({
795
795
  style: theme.styles.menuContent,
796
796
  onClick: (event) => event.stopPropagation(),
797
797
  children: /* @__PURE__ */ jsx(
798
- DropdownMenu3.RadioGroup,
798
+ DropdownMenu4.RadioGroup,
799
799
  {
800
800
  value,
801
801
  onValueChange: (nextValue) => {
@@ -803,7 +803,7 @@ function DataExplorerSelect({
803
803
  void onValueChange?.(nextValue);
804
804
  },
805
805
  children: options.map((option) => /* @__PURE__ */ jsxs(
806
- DropdownMenu3.RadioItem,
806
+ DropdownMenu4.RadioItem,
807
807
  {
808
808
  value: option.value,
809
809
  title: option.title,
@@ -849,9 +849,9 @@ function renderMenuItem(action, context, theme, className) {
849
849
  const disabled = (resolveDataExplorerValue(action.disabled, context) ?? false) || (resolveDataExplorerValue(action.loading, context) ?? false);
850
850
  const active = resolveDataExplorerValue(action.active, context) ?? false;
851
851
  return /* @__PURE__ */ jsxs("div", { children: [
852
- action.separatorBefore ? /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: theme.slots.menuSeparator }) : null,
852
+ action.separatorBefore ? /* @__PURE__ */ jsx(DropdownMenu4.Separator, { className: theme.slots.menuSeparator }) : null,
853
853
  /* @__PURE__ */ jsxs(
854
- DropdownMenu3.Item,
854
+ DropdownMenu4.Item,
855
855
  {
856
856
  title: action.title,
857
857
  disabled,
@@ -872,7 +872,7 @@ function renderMenuItem(action, context, theme, className) {
872
872
  ]
873
873
  }
874
874
  ),
875
- action.separatorAfter ? /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: theme.slots.menuSeparator }) : null
875
+ action.separatorAfter ? /* @__PURE__ */ jsx(DropdownMenu4.Separator, { className: theme.slots.menuSeparator }) : null
876
876
  ] }, action.id);
877
877
  }
878
878
  function renderMenuAction(action, context, theme, classNames, appearance) {
@@ -881,8 +881,8 @@ function renderMenuAction(action, context, theme, classNames, appearance) {
881
881
  const visibleItems = (action.items ?? []).filter(
882
882
  (item) => resolveDataExplorerValue(item.visible, context) ?? true
883
883
  );
884
- return /* @__PURE__ */ jsxs(DropdownMenu3.Root, { children: [
885
- /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
884
+ return /* @__PURE__ */ jsxs(DropdownMenu4.Root, { children: [
885
+ /* @__PURE__ */ jsx(DropdownMenu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
886
886
  DataExplorerButton,
887
887
  {
888
888
  title: action.title,
@@ -898,8 +898,8 @@ function renderMenuAction(action, context, theme, classNames, appearance) {
898
898
  className: classNames?.action
899
899
  }
900
900
  ) }),
901
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsxs(
902
- DropdownMenu3.Content,
901
+ /* @__PURE__ */ jsx(DropdownMenu4.Portal, { children: /* @__PURE__ */ jsxs(
902
+ DropdownMenu4.Content,
903
903
  {
904
904
  align: action.align ?? "end",
905
905
  sideOffset: action.sideOffset ?? 6,
@@ -908,8 +908,8 @@ function renderMenuAction(action, context, theme, classNames, appearance) {
908
908
  onClick: (event) => event.stopPropagation(),
909
909
  children: [
910
910
  action.menuLabel ? /* @__PURE__ */ jsxs(Fragment, { children: [
911
- /* @__PURE__ */ jsx(DropdownMenu3.Label, { className: theme.slots.menuLabel, children: action.menuLabel }),
912
- /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: theme.slots.menuSeparator })
911
+ /* @__PURE__ */ jsx(DropdownMenu4.Label, { className: theme.slots.menuLabel, children: action.menuLabel }),
912
+ /* @__PURE__ */ jsx(DropdownMenu4.Separator, { className: theme.slots.menuSeparator })
913
913
  ] }) : null,
914
914
  visibleItems.map(
915
915
  (item) => renderMenuItem(item, context, theme, classNames?.menuItem)
@@ -3372,6 +3372,128 @@ function DataExplorerFilterBar({
3372
3372
  }
3373
3373
  );
3374
3374
  }
3375
+ function ChevronDownIcon3({ open }) {
3376
+ return /* @__PURE__ */ jsx(
3377
+ "svg",
3378
+ {
3379
+ "aria-hidden": "true",
3380
+ viewBox: "0 0 24 24",
3381
+ className: cn("h-4 w-4 transition-transform", open && "rotate-180"),
3382
+ fill: "none",
3383
+ stroke: "currentColor",
3384
+ strokeLinecap: "round",
3385
+ strokeLinejoin: "round",
3386
+ strokeWidth: "2",
3387
+ children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
3388
+ }
3389
+ );
3390
+ }
3391
+ function DataExplorerSplitButton({
3392
+ label,
3393
+ icon,
3394
+ items = [],
3395
+ onPrimaryAction,
3396
+ onAction,
3397
+ menuLabel,
3398
+ triggerLabel = "More actions",
3399
+ title,
3400
+ tone,
3401
+ active = false,
3402
+ disabled = false,
3403
+ appearance,
3404
+ className,
3405
+ classNames
3406
+ }) {
3407
+ const [open, setOpen] = useState(false);
3408
+ const theme = resolveDataExplorerAppearance(appearance);
3409
+ const hasItems = items.length > 0;
3410
+ const resolvedActive = active || open;
3411
+ const handlePrimaryClick = (event) => {
3412
+ if (disabled) return;
3413
+ onPrimaryAction?.(event);
3414
+ };
3415
+ return /* @__PURE__ */ jsxs(DropdownMenu4.Root, { open: hasItems && open, onOpenChange: (nextOpen) => setOpen(hasItems ? nextOpen : false), children: [
3416
+ /* @__PURE__ */ jsxs(
3417
+ "div",
3418
+ {
3419
+ className: cn(
3420
+ "inline-flex min-w-0 shrink-0 overflow-hidden rounded-md",
3421
+ getDataExplorerActionToneClassName(theme, tone, resolvedActive),
3422
+ classNames?.root,
3423
+ className
3424
+ ),
3425
+ children: [
3426
+ /* @__PURE__ */ jsx(
3427
+ DataExplorerButton,
3428
+ {
3429
+ label,
3430
+ icon,
3431
+ title,
3432
+ disabled,
3433
+ active: resolvedActive,
3434
+ appearance,
3435
+ className: cn("rounded-none border-r-0", classNames?.primary),
3436
+ onClick: handlePrimaryClick
3437
+ }
3438
+ ),
3439
+ hasItems ? /* @__PURE__ */ jsx(DropdownMenu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
3440
+ "button",
3441
+ {
3442
+ type: "button",
3443
+ "aria-label": triggerLabel,
3444
+ title: triggerLabel,
3445
+ disabled,
3446
+ className: cn(
3447
+ theme.slots.controlButton,
3448
+ "w-9 shrink-0 rounded-none border-l-0 px-0",
3449
+ resolvedActive ? getDataExplorerActionToneClassName(theme, tone, true) : getDataExplorerActionToneClassName(theme, tone, false),
3450
+ classNames?.trigger
3451
+ ),
3452
+ onClick: (event) => event.stopPropagation(),
3453
+ children: /* @__PURE__ */ jsx(ChevronDownIcon3, { open })
3454
+ }
3455
+ ) }) : null
3456
+ ]
3457
+ }
3458
+ ),
3459
+ hasItems ? /* @__PURE__ */ jsx(DropdownMenu4.Portal, { children: /* @__PURE__ */ jsxs(
3460
+ DropdownMenu4.Content,
3461
+ {
3462
+ align: "start",
3463
+ sideOffset: 6,
3464
+ className: cn(theme.slots.menuContent, classNames?.content),
3465
+ style: theme.styles.menuContent,
3466
+ children: [
3467
+ menuLabel ? /* @__PURE__ */ jsxs(Fragment, { children: [
3468
+ /* @__PURE__ */ jsx(DropdownMenu4.Label, { className: theme.slots.menuLabel, children: menuLabel }),
3469
+ /* @__PURE__ */ jsx(DropdownMenu4.Separator, { className: theme.slots.menuSeparator })
3470
+ ] }) : null,
3471
+ items.map((item) => /* @__PURE__ */ jsxs(
3472
+ DropdownMenu4.Item,
3473
+ {
3474
+ title: item.title,
3475
+ disabled: item.disabled,
3476
+ className: cn(
3477
+ theme.slots.menuItem,
3478
+ getDataExplorerActionToneClassName(theme, item.tone, false),
3479
+ classNames?.item
3480
+ ),
3481
+ style: theme.styles.menuItem,
3482
+ onSelect: () => {
3483
+ if (!item.disabled) onAction?.(item.id);
3484
+ },
3485
+ children: [
3486
+ item.icon ? /* @__PURE__ */ jsx("span", { className: theme.slots.menuItemIcon, children: item.icon }) : null,
3487
+ /* @__PURE__ */ jsx("span", { className: theme.slots.menuItemLabel, children: item.label })
3488
+ ]
3489
+ },
3490
+ item.id
3491
+ ))
3492
+ ]
3493
+ }
3494
+ ) }) : null
3495
+ ] });
3496
+ }
3375
3497
  function DataExplorerDetailField({
3376
3498
  field,
3377
3499
  label = field?.label,
@@ -4565,8 +4687,8 @@ function DataExplorerDisplayActionMenu({
4565
4687
  if (visibleActions.length === 0) {
4566
4688
  return null;
4567
4689
  }
4568
- return /* @__PURE__ */ jsx("span", { className: cn("inline-flex", classNames?.root), children: /* @__PURE__ */ jsxs(DropdownMenu3.Root, { open, onOpenChange: setOpen, children: [
4569
- /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
4690
+ return /* @__PURE__ */ jsx("span", { className: cn("inline-flex", classNames?.root), children: /* @__PURE__ */ jsxs(DropdownMenu4.Root, { open, onOpenChange: setOpen, children: [
4691
+ /* @__PURE__ */ jsx(DropdownMenu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
4570
4692
  "button",
4571
4693
  {
4572
4694
  type: "button",
@@ -4583,8 +4705,8 @@ function DataExplorerDisplayActionMenu({
4583
4705
  ]
4584
4706
  }
4585
4707
  ) }),
4586
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsxs(
4587
- DropdownMenu3.Content,
4708
+ /* @__PURE__ */ jsx(DropdownMenu4.Portal, { children: /* @__PURE__ */ jsxs(
4709
+ DropdownMenu4.Content,
4588
4710
  {
4589
4711
  align,
4590
4712
  sideOffset,
@@ -4597,7 +4719,7 @@ function DataExplorerDisplayActionMenu({
4597
4719
  children: [
4598
4720
  label ? /* @__PURE__ */ jsxs(Fragment, { children: [
4599
4721
  /* @__PURE__ */ jsx(
4600
- DropdownMenu3.Label,
4722
+ DropdownMenu4.Label,
4601
4723
  {
4602
4724
  className: cn(
4603
4725
  theme.slots.menuLabel,
@@ -4607,7 +4729,7 @@ function DataExplorerDisplayActionMenu({
4607
4729
  }
4608
4730
  ),
4609
4731
  /* @__PURE__ */ jsx(
4610
- DropdownMenu3.Separator,
4732
+ DropdownMenu4.Separator,
4611
4733
  {
4612
4734
  className: cn(
4613
4735
  theme.slots.menuSeparator,
@@ -4621,7 +4743,7 @@ function DataExplorerDisplayActionMenu({
4621
4743
  if (action.render) {
4622
4744
  return /* @__PURE__ */ jsxs("div", { children: [
4623
4745
  action.separatorBefore ? /* @__PURE__ */ jsx(
4624
- DropdownMenu3.Separator,
4746
+ DropdownMenu4.Separator,
4625
4747
  {
4626
4748
  className: cn(
4627
4749
  theme.slots.menuSeparator,
@@ -4631,7 +4753,7 @@ function DataExplorerDisplayActionMenu({
4631
4753
  ) : null,
4632
4754
  action.render(context),
4633
4755
  action.separatorAfter ? /* @__PURE__ */ jsx(
4634
- DropdownMenu3.Separator,
4756
+ DropdownMenu4.Separator,
4635
4757
  {
4636
4758
  className: cn(
4637
4759
  theme.slots.menuSeparator,
@@ -4643,7 +4765,7 @@ function DataExplorerDisplayActionMenu({
4643
4765
  }
4644
4766
  return /* @__PURE__ */ jsxs("div", { children: [
4645
4767
  action.separatorBefore ? /* @__PURE__ */ jsx(
4646
- DropdownMenu3.Separator,
4768
+ DropdownMenu4.Separator,
4647
4769
  {
4648
4770
  className: cn(
4649
4771
  "-mx-1 my-1 h-px bg-border",
@@ -4652,7 +4774,7 @@ function DataExplorerDisplayActionMenu({
4652
4774
  }
4653
4775
  ) : null,
4654
4776
  /* @__PURE__ */ jsxs(
4655
- DropdownMenu3.Item,
4777
+ DropdownMenu4.Item,
4656
4778
  {
4657
4779
  title: action.title,
4658
4780
  disabled,
@@ -4703,7 +4825,7 @@ function DataExplorerDisplayActionMenu({
4703
4825
  }
4704
4826
  ),
4705
4827
  action.separatorAfter ? /* @__PURE__ */ jsx(
4706
- DropdownMenu3.Separator,
4828
+ DropdownMenu4.Separator,
4707
4829
  {
4708
4830
  className: cn(
4709
4831
  theme.slots.menuSeparator,
@@ -6784,8 +6906,8 @@ function DataExplorerViewTree({
6784
6906
  return resolveDataExplorerValue(action.visible, payload) ?? true;
6785
6907
  });
6786
6908
  if (visibleActions.length === 0) return null;
6787
- return /* @__PURE__ */ jsxs(DropdownMenu3.Root, { children: [
6788
- /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
6909
+ return /* @__PURE__ */ jsxs(DropdownMenu4.Root, { children: [
6910
+ /* @__PURE__ */ jsx(DropdownMenu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
6789
6911
  "button",
6790
6912
  {
6791
6913
  type: "button",
@@ -6800,8 +6922,8 @@ function DataExplorerViewTree({
6800
6922
  children: /* @__PURE__ */ jsx(MoreIcon2, {})
6801
6923
  }
6802
6924
  ) }),
6803
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx(
6804
- DropdownMenu3.Content,
6925
+ /* @__PURE__ */ jsx(DropdownMenu4.Portal, { children: /* @__PURE__ */ jsx(
6926
+ DropdownMenu4.Content,
6805
6927
  {
6806
6928
  align: "end",
6807
6929
  sideOffset: 6,
@@ -6816,9 +6938,9 @@ function DataExplorerViewTree({
6816
6938
  return /* @__PURE__ */ jsx("div", { children: action.render(payload) }, action.id);
6817
6939
  }
6818
6940
  return /* @__PURE__ */ jsxs("div", { children: [
6819
- action.separatorBefore ? /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: theme.slots.menuSeparator }) : null,
6941
+ action.separatorBefore ? /* @__PURE__ */ jsx(DropdownMenu4.Separator, { className: theme.slots.menuSeparator }) : null,
6820
6942
  /* @__PURE__ */ jsxs(
6821
- DropdownMenu3.Item,
6943
+ DropdownMenu4.Item,
6822
6944
  {
6823
6945
  title: action.title,
6824
6946
  disabled,
@@ -6840,7 +6962,7 @@ function DataExplorerViewTree({
6840
6962
  ]
6841
6963
  }
6842
6964
  ),
6843
- action.separatorAfter ? /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: theme.slots.menuSeparator }) : null
6965
+ action.separatorAfter ? /* @__PURE__ */ jsx(DropdownMenu4.Separator, { className: theme.slots.menuSeparator }) : null
6844
6966
  ] }, action.id);
6845
6967
  })
6846
6968
  }
@@ -7381,6 +7503,6 @@ function DataExplorerViewShell({
7381
7503
  );
7382
7504
  }
7383
7505
 
7384
- export { DataExplorerActionBar, DataExplorerButton, DataExplorerCheckbox, DataExplorerCollectionFooter, DataExplorerDetailField, DataExplorerDetailSection, DataExplorerDetailShell, DataExplorerDisplayActionMenu, DataExplorerDisplayCard, DataExplorerDisplayCollectionView, DataExplorerDisplayListItem, DataExplorerDisplayMedia, DataExplorerDraggableTree, DataExplorerFilterBar, DataExplorerImagePreview, DataExplorerPage, DataExplorerRecordCard, DataExplorerSelect, DataExplorerToolbarActions, DataExplorerToolbarShell, DataExplorerTree, DataExplorerTreeShell, DataExplorerView, DataExplorerViewCollection, DataExplorerViewItem, DataExplorerViewItemShell, DataExplorerViewShell, DataExplorerViewTree, getDataExplorerActionToneClassName, getDataExplorerMenuItemToneClassName, resolveDataExplorerAppearance };
7506
+ export { DataExplorerActionBar, DataExplorerButton, DataExplorerCheckbox, DataExplorerCollectionFooter, DataExplorerDetailField, DataExplorerDetailSection, DataExplorerDetailShell, DataExplorerDisplayActionMenu, DataExplorerDisplayCard, DataExplorerDisplayCollectionView, DataExplorerDisplayListItem, DataExplorerDisplayMedia, DataExplorerDraggableTree, DataExplorerFilterBar, DataExplorerImagePreview, DataExplorerPage, DataExplorerRecordCard, DataExplorerSelect, DataExplorerSplitButton, DataExplorerToolbarActions, DataExplorerToolbarShell, DataExplorerTree, DataExplorerTreeShell, DataExplorerView, DataExplorerViewCollection, DataExplorerViewItem, DataExplorerViewItemShell, DataExplorerViewShell, DataExplorerViewTree, getDataExplorerActionToneClassName, getDataExplorerMenuItemToneClassName, resolveDataExplorerAppearance };
7385
7507
  //# sourceMappingURL=index.mjs.map
7386
7508
  //# sourceMappingURL=index.mjs.map