@inf-monkeys-tech/monkeys-design 0.4.34 → 0.4.35

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.
Files changed (63) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +226 -226
  3. package/dist/components/base/index.d.mts +2 -2
  4. package/dist/components/base/index.d.ts +2 -2
  5. package/dist/components/base/index.js +2 -445
  6. package/dist/components/base/index.js.map +1 -1
  7. package/dist/components/base/index.mjs +3 -445
  8. package/dist/components/base/index.mjs.map +1 -1
  9. package/dist/components/data-explorer/index.js.map +1 -1
  10. package/dist/components/data-explorer/index.mjs.map +1 -1
  11. package/dist/components/layout/index.js.map +1 -1
  12. package/dist/components/layout/index.mjs.map +1 -1
  13. package/dist/components/login/index.js.map +1 -1
  14. package/dist/components/login/index.mjs.map +1 -1
  15. package/dist/components/toast/index.d.mts +75 -0
  16. package/dist/components/toast/index.d.ts +75 -0
  17. package/dist/components/toast/index.js +283 -0
  18. package/dist/components/toast/index.js.map +1 -0
  19. package/dist/components/toast/index.mjs +273 -0
  20. package/dist/components/toast/index.mjs.map +1 -0
  21. package/dist/components/toolbar/index.js.map +1 -1
  22. package/dist/components/toolbar/index.mjs.map +1 -1
  23. package/dist/components/workbench/index.d.mts +1 -1
  24. package/dist/components/workbench/index.d.ts +1 -1
  25. package/dist/components/workbench/index.js +2 -444
  26. package/dist/components/workbench/index.js.map +1 -1
  27. package/dist/components/workbench/index.mjs +2 -444
  28. package/dist/components/workbench/index.mjs.map +1 -1
  29. package/dist/icons/oauth/index.js.map +1 -1
  30. package/dist/icons/oauth/index.mjs.map +1 -1
  31. package/dist/index.d.mts +4 -2
  32. package/dist/index.d.ts +4 -2
  33. package/dist/index.js +286 -455
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +278 -455
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/palette/index.js.map +1 -1
  38. package/dist/palette/index.mjs.map +1 -1
  39. package/dist/registry/index.js.map +1 -1
  40. package/dist/registry/index.mjs.map +1 -1
  41. package/dist/styles/artist-login.scss +374 -374
  42. package/dist/styles/global.scss +21 -21
  43. package/dist/styles/workflow-board.scss +440 -440
  44. package/dist/styles/workflow-nodes.css +340 -340
  45. package/dist/{theme-sIoU5-YC.d.ts → theme-CoG9vCPT.d.mts} +2 -4
  46. package/dist/{theme-Clm5dVb0.d.mts → theme-Cuy60thu.d.ts} +2 -4
  47. package/dist/theme-system/index.d.mts +1 -1
  48. package/dist/theme-system/index.d.ts +1 -1
  49. package/dist/theme-system/index.js +2 -444
  50. package/dist/theme-system/index.js.map +1 -1
  51. package/dist/theme-system/index.mjs +2 -444
  52. package/dist/theme-system/index.mjs.map +1 -1
  53. package/dist/themes/artist/index.js.map +1 -1
  54. package/dist/themes/artist/index.mjs.map +1 -1
  55. package/dist/themes/bsd/index.js.map +1 -1
  56. package/dist/themes/bsd/index.mjs.map +1 -1
  57. package/dist/themes/concept/index.js.map +1 -1
  58. package/dist/themes/concept/index.mjs.map +1 -1
  59. package/dist/themes/default/index.js.map +1 -1
  60. package/dist/themes/default/index.mjs.map +1 -1
  61. package/dist/{types-Bn6PEDsX.d.mts → types-CZALgtez.d.mts} +1 -43
  62. package/dist/{types-Bn6PEDsX.d.ts → types-CZALgtez.d.ts} +1 -43
  63. package/package.json +146 -139
package/dist/index.mjs CHANGED
@@ -3,6 +3,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
3
  import * as ContextMenu from '@radix-ui/react-context-menu';
4
4
  import * as DropdownMenu3 from '@radix-ui/react-dropdown-menu';
5
5
  import { useSensors, useSensor, PointerSensor, DndContext, DragOverlay, useDroppable, useDraggable } from '@dnd-kit/core';
6
+ import { toast as toast$1, Toaster } from 'sonner';
6
7
  import * as Tooltip from '@radix-ui/react-tooltip';
7
8
 
8
9
  var __create = Object.create;
@@ -722,7 +723,7 @@ var require_lodash = __commonJS({
722
723
  }
723
724
  var runInContext = (function runInContext2(context) {
724
725
  context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
725
- var Array2 = context.Array, Date = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
726
+ var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
726
727
  var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
727
728
  var coreJsData = context["__core-js_shared__"];
728
729
  var funcToString = funcProto.toString;
@@ -747,8 +748,8 @@ var require_lodash = __commonJS({
747
748
  } catch (e) {
748
749
  }
749
750
  })();
750
- var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
751
- var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
751
+ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
752
+ var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
752
753
  var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
753
754
  var metaMap = WeakMap && new WeakMap();
754
755
  var realNames = {};
@@ -11715,448 +11716,6 @@ function BaseLoadingState({
11715
11716
  }
11716
11717
  );
11717
11718
  }
11718
- function normalizeValues(values) {
11719
- const nextValues = [];
11720
- const seen = /* @__PURE__ */ new Set();
11721
- values?.forEach((value) => {
11722
- if (seen.has(value)) return;
11723
- seen.add(value);
11724
- nextValues.push(value);
11725
- });
11726
- return nextValues;
11727
- }
11728
- function getNextEnabledIndex(options, currentIndex, direction) {
11729
- if (!options.length) return -1;
11730
- const startIndex = currentIndex >= 0 ? currentIndex : 0;
11731
- for (let offset = 1; offset <= options.length; offset += 1) {
11732
- const nextIndex = (startIndex + offset * direction + options.length) % options.length;
11733
- if (!options[nextIndex]?.disabled) {
11734
- return nextIndex;
11735
- }
11736
- }
11737
- return -1;
11738
- }
11739
- function getFirstEnabledIndex(options) {
11740
- return options.findIndex((option) => !option.disabled);
11741
- }
11742
- function getSafeTagCount(maxTagCount, total) {
11743
- if (maxTagCount === void 0) return total;
11744
- if (!Number.isFinite(maxTagCount)) return total;
11745
- return Math.max(0, Math.min(total, Math.floor(maxTagCount)));
11746
- }
11747
- function getDefaultRemoveLabel(option) {
11748
- return `Remove ${option.value}`;
11749
- }
11750
- var BaseMultiSelect = forwardRef(
11751
- function BaseMultiSelect2({
11752
- options,
11753
- value,
11754
- defaultValue,
11755
- name,
11756
- placeholder = "Select options",
11757
- icon,
11758
- invalid = false,
11759
- disabled = false,
11760
- required = false,
11761
- openForPreview = false,
11762
- maxTagCount,
11763
- removeLabel = getDefaultRemoveLabel,
11764
- emptyLabel = "No options",
11765
- appearance,
11766
- className,
11767
- classNames,
11768
- style,
11769
- id,
11770
- "aria-invalid": nativeAriaInvalid,
11771
- "aria-label": nativeAriaLabel,
11772
- "aria-labelledby": nativeAriaLabelledBy,
11773
- onValueChange,
11774
- ...rootProps
11775
- }, ref) {
11776
- const theme = resolveBaseAppearance(appearance);
11777
- const generatedId = useId();
11778
- const multiSelectId = id ?? generatedId;
11779
- const controlId = `${multiSelectId}-control`;
11780
- const listboxId = `${multiSelectId}-listbox`;
11781
- const rootRef = useRef(null);
11782
- const optionList = options ?? [];
11783
- const forceOpen = openForPreview;
11784
- const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
11785
- const open = forceOpen || uncontrolledOpen;
11786
- const [uncontrolledValue, setUncontrolledValue] = useState(
11787
- () => normalizeValues(defaultValue)
11788
- );
11789
- const [activeIndex, setActiveIndex] = useState(
11790
- () => getFirstEnabledIndex(optionList)
11791
- );
11792
- const isControlled = value !== void 0;
11793
- const selectedValues = useMemo(
11794
- () => normalizeValues(isControlled ? value : uncontrolledValue),
11795
- [isControlled, uncontrolledValue, value]
11796
- );
11797
- const selectedValueSet = useMemo(
11798
- () => new Set(selectedValues),
11799
- [selectedValues]
11800
- );
11801
- const optionByValue = useMemo(() => {
11802
- const map = /* @__PURE__ */ new Map();
11803
- optionList.forEach((option) => {
11804
- if (!map.has(option.value)) {
11805
- map.set(option.value, option);
11806
- }
11807
- });
11808
- return map;
11809
- }, [optionList]);
11810
- const selectedOptions = useMemo(
11811
- () => selectedValues.map((selectedValue) => optionByValue.get(selectedValue)).filter(
11812
- (option) => option !== void 0
11813
- ),
11814
- [optionByValue, selectedValues]
11815
- );
11816
- const firstEnabledIndex = useMemo(
11817
- () => getFirstEnabledIndex(optionList),
11818
- [optionList]
11819
- );
11820
- const resolvedActiveIndex = activeIndex >= 0 && !optionList[activeIndex]?.disabled ? activeIndex : firstEnabledIndex;
11821
- const visibleTagCount = getSafeTagCount(
11822
- maxTagCount,
11823
- selectedOptions.length
11824
- );
11825
- const visibleOptions = selectedOptions.slice(0, visibleTagCount);
11826
- const overflowCount = selectedOptions.length - visibleOptions.length;
11827
- const isPlaceholder = selectedOptions.length === 0;
11828
- const setRootRef = (node) => {
11829
- rootRef.current = node;
11830
- if (typeof ref === "function") {
11831
- ref(node);
11832
- } else if (ref) {
11833
- ref.current = node;
11834
- }
11835
- };
11836
- const setOpen = (nextOpen) => {
11837
- if (disabled || forceOpen) return;
11838
- setUncontrolledOpen(nextOpen);
11839
- if (nextOpen) {
11840
- setActiveIndex(resolvedActiveIndex);
11841
- }
11842
- };
11843
- useEffect(() => {
11844
- if (!open || forceOpen) return void 0;
11845
- const handlePointerDown = (event) => {
11846
- if (!rootRef.current?.contains(event.target)) {
11847
- setUncontrolledOpen(false);
11848
- }
11849
- };
11850
- document.addEventListener("pointerdown", handlePointerDown);
11851
- return () => {
11852
- document.removeEventListener("pointerdown", handlePointerDown);
11853
- };
11854
- }, [forceOpen, open]);
11855
- useEffect(() => {
11856
- if (resolvedActiveIndex >= 0 && resolvedActiveIndex !== activeIndex) {
11857
- setActiveIndex(resolvedActiveIndex);
11858
- }
11859
- }, [activeIndex, resolvedActiveIndex]);
11860
- const commitValues = (nextValues) => {
11861
- const normalizedValues = normalizeValues(nextValues);
11862
- if (!isControlled) {
11863
- setUncontrolledValue(normalizedValues);
11864
- }
11865
- onValueChange?.(normalizedValues);
11866
- };
11867
- const toggleOption = (option) => {
11868
- if (!option || option.disabled || disabled) return;
11869
- const nextValues = selectedValueSet.has(option.value) ? selectedValues.filter((selectedValue) => selectedValue !== option.value) : [...selectedValues, option.value];
11870
- commitValues(nextValues);
11871
- };
11872
- const removeOption = (option) => {
11873
- if (disabled) return;
11874
- commitValues(
11875
- selectedValues.filter((selectedValue) => selectedValue !== option.value)
11876
- );
11877
- };
11878
- const focusOption = (direction) => {
11879
- const nextIndex = getNextEnabledIndex(
11880
- optionList,
11881
- resolvedActiveIndex,
11882
- direction
11883
- );
11884
- if (nextIndex >= 0) {
11885
- setActiveIndex(nextIndex);
11886
- }
11887
- };
11888
- const handleKeyDown = (event) => {
11889
- if (disabled) return;
11890
- if (event.key === "ArrowDown" || event.key === "ArrowUp") {
11891
- event.preventDefault();
11892
- if (!open) {
11893
- setOpen(true);
11894
- setActiveIndex(firstEnabledIndex);
11895
- return;
11896
- }
11897
- focusOption(event.key === "ArrowDown" ? 1 : -1);
11898
- return;
11899
- }
11900
- if (event.key === "Home") {
11901
- event.preventDefault();
11902
- setOpen(true);
11903
- setActiveIndex(firstEnabledIndex);
11904
- return;
11905
- }
11906
- if (event.key === "End") {
11907
- event.preventDefault();
11908
- setOpen(true);
11909
- for (let index = optionList.length - 1; index >= 0; index -= 1) {
11910
- if (!optionList[index]?.disabled) {
11911
- setActiveIndex(index);
11912
- break;
11913
- }
11914
- }
11915
- return;
11916
- }
11917
- if (event.key === "Enter" || event.key === " ") {
11918
- event.preventDefault();
11919
- if (!open) {
11920
- setOpen(true);
11921
- return;
11922
- }
11923
- toggleOption(optionList[resolvedActiveIndex]);
11924
- return;
11925
- }
11926
- if (event.key === "Escape") {
11927
- setOpen(false);
11928
- }
11929
- };
11930
- return /* @__PURE__ */ jsxs(
11931
- "div",
11932
- {
11933
- ...rootProps,
11934
- id,
11935
- ref: setRootRef,
11936
- className: cn(
11937
- theme.slots.controlWrapper,
11938
- "overflow-visible",
11939
- open && "z-50",
11940
- invalid && theme.slots.controlInvalid,
11941
- disabled && theme.slots.controlDisabled,
11942
- classNames?.root,
11943
- className
11944
- ),
11945
- style: {
11946
- ...theme.styles.control,
11947
- ...invalid ? theme.styles.controlInvalid : void 0,
11948
- ...disabled ? theme.styles.controlDisabled : void 0,
11949
- ...style
11950
- },
11951
- children: [
11952
- hasRenderableNode(icon) ? /* @__PURE__ */ jsx("span", { className: cn(theme.slots.controlIcon, classNames?.icon), children: icon }) : null,
11953
- /* @__PURE__ */ jsx(
11954
- "div",
11955
- {
11956
- id: controlId,
11957
- role: "combobox",
11958
- tabIndex: disabled ? -1 : 0,
11959
- "aria-haspopup": "listbox",
11960
- "aria-expanded": open,
11961
- "aria-controls": listboxId,
11962
- "aria-disabled": disabled || void 0,
11963
- "aria-required": required || void 0,
11964
- "aria-invalid": nativeAriaInvalid ?? (invalid || void 0),
11965
- "aria-label": nativeAriaLabel,
11966
- "aria-labelledby": nativeAriaLabelledBy,
11967
- className: cn(
11968
- theme.slots.controlBase,
11969
- "flex min-h-9 cursor-pointer flex-wrap items-center gap-1.5 py-1.5 pr-9 text-left",
11970
- disabled && "!cursor-not-allowed",
11971
- classNames?.control
11972
- ),
11973
- onClick: () => setOpen(!open),
11974
- onKeyDown: handleKeyDown,
11975
- children: /* @__PURE__ */ jsxs(
11976
- "span",
11977
- {
11978
- className: cn(
11979
- "flex min-w-0 flex-1 flex-wrap items-center gap-1.5",
11980
- classNames?.tagList
11981
- ),
11982
- children: [
11983
- visibleOptions.map((option) => /* @__PURE__ */ jsxs(
11984
- "span",
11985
- {
11986
- className: cn(
11987
- "inline-flex max-w-full items-center gap-1 rounded-full border border-border/70 bg-muted/65 px-2 py-0.5 text-xs font-medium text-foreground",
11988
- classNames?.tag
11989
- ),
11990
- children: [
11991
- /* @__PURE__ */ jsx(
11992
- "span",
11993
- {
11994
- className: cn(
11995
- "max-w-40 truncate",
11996
- classNames?.tagLabel
11997
- ),
11998
- children: option.label
11999
- }
12000
- ),
12001
- /* @__PURE__ */ jsx(
12002
- "button",
12003
- {
12004
- type: "button",
12005
- "aria-label": removeLabel(option),
12006
- disabled,
12007
- className: cn(
12008
- "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-background/80 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed",
12009
- classNames?.tagRemove
12010
- ),
12011
- onClick: (event) => {
12012
- event.preventDefault();
12013
- event.stopPropagation();
12014
- removeOption(option);
12015
- },
12016
- onMouseDown: (event) => {
12017
- event.preventDefault();
12018
- event.stopPropagation();
12019
- },
12020
- onKeyDown: (event) => event.stopPropagation(),
12021
- children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "x" })
12022
- }
12023
- )
12024
- ]
12025
- },
12026
- option.value
12027
- )),
12028
- overflowCount > 0 ? /* @__PURE__ */ jsxs(
12029
- "span",
12030
- {
12031
- className: cn(
12032
- "inline-flex max-w-full items-center rounded-full border border-border/70 bg-muted/45 px-2 py-0.5 text-xs font-medium text-muted-foreground",
12033
- classNames?.tag
12034
- ),
12035
- children: [
12036
- "+",
12037
- overflowCount
12038
- ]
12039
- }
12040
- ) : null,
12041
- isPlaceholder ? /* @__PURE__ */ jsx(
12042
- "span",
12043
- {
12044
- className: cn(
12045
- "min-w-0 truncate",
12046
- theme.slots.selectPlaceholder,
12047
- classNames?.placeholder
12048
- ),
12049
- children: placeholder
12050
- }
12051
- ) : null
12052
- ]
12053
- }
12054
- )
12055
- }
12056
- ),
12057
- /* @__PURE__ */ jsx(
12058
- "span",
12059
- {
12060
- className: cn(
12061
- theme.slots.selectChevron,
12062
- open && "rotate-[225deg]",
12063
- classNames?.chevron
12064
- )
12065
- }
12066
- ),
12067
- name ? selectedValues.map((selectedValue) => /* @__PURE__ */ jsx(
12068
- "input",
12069
- {
12070
- type: "hidden",
12071
- name,
12072
- value: selectedValue,
12073
- className: classNames?.hiddenInput
12074
- },
12075
- selectedValue
12076
- )) : null,
12077
- open ? /* @__PURE__ */ jsx(
12078
- "div",
12079
- {
12080
- id: listboxId,
12081
- role: "listbox",
12082
- "aria-multiselectable": "true",
12083
- "aria-labelledby": controlId,
12084
- className: cn(theme.slots.selectMenu, classNames?.menu),
12085
- style: theme.styles.selectMenu,
12086
- children: optionList.length > 0 ? optionList.map((option, index) => {
12087
- const selected = selectedValueSet.has(option.value);
12088
- const active = index === resolvedActiveIndex;
12089
- return /* @__PURE__ */ jsxs(
12090
- "button",
12091
- {
12092
- type: "button",
12093
- role: "option",
12094
- "aria-selected": selected,
12095
- disabled: option.disabled,
12096
- className: cn(
12097
- theme.slots.selectOption,
12098
- "gap-2",
12099
- active && theme.slots.selectOptionActive,
12100
- selected && theme.slots.selectOptionSelected,
12101
- option.disabled && theme.slots.selectOptionDisabled,
12102
- classNames?.option
12103
- ),
12104
- style: {
12105
- ...theme.styles.selectOption,
12106
- ...active ? theme.styles.selectOptionActive : void 0,
12107
- ...selected ? theme.styles.selectOptionSelected : void 0
12108
- },
12109
- onMouseEnter: () => {
12110
- if (!option.disabled) {
12111
- setActiveIndex(index);
12112
- }
12113
- },
12114
- onMouseDown: (event) => event.preventDefault(),
12115
- onClick: () => toggleOption(option),
12116
- children: [
12117
- /* @__PURE__ */ jsx(
12118
- "span",
12119
- {
12120
- "aria-hidden": "true",
12121
- className: cn(
12122
- "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-border/70 text-[10px]",
12123
- selected && "border-primary/40 bg-primary text-primary-foreground",
12124
- classNames?.optionIndicator
12125
- ),
12126
- children: selected ? "\u2713" : null
12127
- }
12128
- ),
12129
- /* @__PURE__ */ jsx(
12130
- "span",
12131
- {
12132
- className: cn(
12133
- "min-w-0 flex-1 truncate",
12134
- classNames?.optionLabel
12135
- ),
12136
- children: option.label
12137
- }
12138
- )
12139
- ]
12140
- },
12141
- option.value
12142
- );
12143
- }) : /* @__PURE__ */ jsx(
12144
- "div",
12145
- {
12146
- className: cn(
12147
- "px-2.5 py-2 text-sm text-muted-foreground",
12148
- classNames?.empty
12149
- ),
12150
- children: emptyLabel
12151
- }
12152
- )
12153
- }
12154
- ) : null
12155
- ]
12156
- }
12157
- );
12158
- }
12159
- );
12160
11719
  function BaseNotice({
12161
11720
  tone,
12162
11721
  icon,
@@ -12558,7 +12117,7 @@ function getInitialValue2(options, defaultValue) {
12558
12117
  }
12559
12118
  return "";
12560
12119
  }
12561
- function getNextEnabledIndex2(options, currentIndex, direction) {
12120
+ function getNextEnabledIndex(options, currentIndex, direction) {
12562
12121
  if (!options.length) return -1;
12563
12122
  for (let offset = 1; offset <= options.length; offset += 1) {
12564
12123
  const nextIndex = (currentIndex + offset * direction + options.length) % options.length;
@@ -12660,7 +12219,7 @@ var BaseSelect = forwardRef(
12660
12219
  };
12661
12220
  const focusOption = (direction) => {
12662
12221
  const currentIndex = activeIndex >= 0 ? activeIndex : 0;
12663
- const nextIndex = getNextEnabledIndex2(optionList, currentIndex, direction);
12222
+ const nextIndex = getNextEnabledIndex(optionList, currentIndex, direction);
12664
12223
  if (nextIndex >= 0) {
12665
12224
  commitValue(optionList[nextIndex].value, optionList[nextIndex].disabled);
12666
12225
  }
@@ -24558,7 +24117,271 @@ function WorkbenchLaneView({
24558
24117
  }) }) : null })
24559
24118
  ] });
24560
24119
  }
24561
- function cn4(...inputs) {
24120
+ var DEFAULT_TOAST_DURATION = 5200;
24121
+ var TOAST_DEDUPE_WINDOW = 1200;
24122
+ var DEFAULT_MESSAGES = {
24123
+ errorTitle: "Error",
24124
+ warningTitle: "Warning",
24125
+ defaultErrorDescription: "Something went wrong.",
24126
+ defaultWarningDescription: "Please check and try again."
24127
+ };
24128
+ var ACTIONABLE_TOAST_PATTERNS = [
24129
+ /^(please|select|enter|provide|write|choose|confirm|fill)\b/i,
24130
+ /^(请|请选择|请先|请输入|请填写|请确认|请留意)/
24131
+ ];
24132
+ var DEFAULT_TOAST_CLASS_NAMES = {
24133
+ toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
24134
+ description: "group-[.toast]:text-muted-foreground",
24135
+ actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
24136
+ cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
24137
+ };
24138
+ var recentToastSignatures = /* @__PURE__ */ new Map();
24139
+ function cn4(...classNames) {
24140
+ return classNames.filter(Boolean).join(" ");
24141
+ }
24142
+ function isToastInput(input) {
24143
+ if (!input || typeof input !== "object" || isValidElement(input)) {
24144
+ return false;
24145
+ }
24146
+ return "title" in input || "description" in input || "variant" in input;
24147
+ }
24148
+ function isEmptyToastContent(value) {
24149
+ return value == null || typeof value === "string" && !value.trim();
24150
+ }
24151
+ function normalizeToastInput(input, variant, options) {
24152
+ const { description: _description, ...baseOptions } = options ?? {};
24153
+ if (isToastInput(input)) {
24154
+ return {
24155
+ ...baseOptions,
24156
+ ...input,
24157
+ variant: input.variant ?? variant
24158
+ };
24159
+ }
24160
+ return {
24161
+ ...baseOptions,
24162
+ title: input,
24163
+ variant
24164
+ };
24165
+ }
24166
+ function resolveValue(candidate, value) {
24167
+ if (typeof candidate === "function") {
24168
+ return candidate(value);
24169
+ }
24170
+ return candidate;
24171
+ }
24172
+ function shouldEmitToast(signature) {
24173
+ const now = Date.now();
24174
+ for (const [key, timestamp] of recentToastSignatures.entries()) {
24175
+ if (now - timestamp > TOAST_DEDUPE_WINDOW) {
24176
+ recentToastSignatures.delete(key);
24177
+ }
24178
+ }
24179
+ const previousTimestamp = recentToastSignatures.get(signature);
24180
+ if (previousTimestamp && now - previousTimestamp < TOAST_DEDUPE_WINDOW) {
24181
+ return false;
24182
+ }
24183
+ recentToastSignatures.set(signature, now);
24184
+ return true;
24185
+ }
24186
+ function translateMessage(translate, value) {
24187
+ return translate ? translate(value, { defaultValue: value }) : value;
24188
+ }
24189
+ function getDefaultMessage(messages, key) {
24190
+ return messages?.[key] ?? DEFAULT_MESSAGES[key];
24191
+ }
24192
+ function emitToast(input) {
24193
+ const { title, description, duration, variant = "info", ...options } = input;
24194
+ const message = isEmptyToastContent(title) ? description : title;
24195
+ if (isEmptyToastContent(message)) {
24196
+ return void 0;
24197
+ }
24198
+ const descriptionValue = !isEmptyToastContent(description) && description !== message ? description : void 0;
24199
+ const sonnerOptions = {
24200
+ ...options,
24201
+ description: descriptionValue,
24202
+ duration: duration ?? DEFAULT_TOAST_DURATION
24203
+ };
24204
+ switch (variant) {
24205
+ case "error":
24206
+ return toast$1.error(message, sonnerOptions);
24207
+ case "warning":
24208
+ return toast$1.warning(message, sonnerOptions);
24209
+ case "success":
24210
+ return toast$1.success(message, sonnerOptions);
24211
+ default:
24212
+ return toast$1(message, sonnerOptions);
24213
+ }
24214
+ }
24215
+ function extractToastMessage(value, fallback = "") {
24216
+ if (!value) return fallback;
24217
+ if (typeof value === "string") {
24218
+ const nextMessage = value.trim();
24219
+ return nextMessage || fallback;
24220
+ }
24221
+ if (value instanceof Error) {
24222
+ const nextMessage = String(value.message || "").trim();
24223
+ return nextMessage || fallback;
24224
+ }
24225
+ if (typeof value === "object" && typeof value.message === "string") {
24226
+ const nextMessage = value.message.trim();
24227
+ if (nextMessage) return nextMessage;
24228
+ }
24229
+ if (typeof value === "object" && typeof value.title === "string") {
24230
+ const nextTitle = value.title.trim();
24231
+ if (nextTitle) return nextTitle;
24232
+ }
24233
+ return fallback;
24234
+ }
24235
+ function resolveToastVariantForMessage(value) {
24236
+ const message = extractToastMessage(value);
24237
+ if (ACTIONABLE_TOAST_PATTERNS.some((pattern) => pattern.test(message))) {
24238
+ return "warning";
24239
+ }
24240
+ return "error";
24241
+ }
24242
+ function MonkeysToaster({
24243
+ className,
24244
+ closeButton = true,
24245
+ position = "bottom-right",
24246
+ richColors = true,
24247
+ toastOptions,
24248
+ useThemeClassNames = true,
24249
+ visibleToasts = 10,
24250
+ ...props
24251
+ }) {
24252
+ return /* @__PURE__ */ jsx(
24253
+ Toaster,
24254
+ {
24255
+ className: cn4("pointer-events-auto toaster group", className),
24256
+ closeButton,
24257
+ position,
24258
+ richColors,
24259
+ toastOptions: {
24260
+ ...toastOptions,
24261
+ classNames: useThemeClassNames ? {
24262
+ ...DEFAULT_TOAST_CLASS_NAMES,
24263
+ ...toastOptions?.classNames
24264
+ } : toastOptions?.classNames
24265
+ },
24266
+ visibleToasts,
24267
+ ...props
24268
+ }
24269
+ );
24270
+ }
24271
+ function MonkeysToastProvider({ children, toasterProps }) {
24272
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
24273
+ children,
24274
+ /* @__PURE__ */ jsx(MonkeysToaster, { ...toasterProps })
24275
+ ] });
24276
+ }
24277
+ function useToastOnValue(value, options = {}) {
24278
+ const previousSignatureRef = useRef(null);
24279
+ const translate = options.translate;
24280
+ useEffect(() => {
24281
+ if (!value) {
24282
+ previousSignatureRef.current = null;
24283
+ return;
24284
+ }
24285
+ const variant = resolveValue(options.variant, value) ?? "error";
24286
+ const rawTitle = resolveValue(options.title, value);
24287
+ const rawFallbackDescription = resolveValue(options.fallbackDescription, value);
24288
+ const rawDescription = resolveValue(options.description, value) ?? extractToastMessage(value, rawFallbackDescription || "");
24289
+ const title = translateMessage(
24290
+ translate,
24291
+ rawTitle || getDefaultMessage(options.messages, variant === "warning" ? "warningTitle" : "errorTitle")
24292
+ );
24293
+ const description = translateMessage(
24294
+ translate,
24295
+ rawDescription || getDefaultMessage(
24296
+ options.messages,
24297
+ variant === "warning" ? "defaultWarningDescription" : "defaultErrorDescription"
24298
+ )
24299
+ );
24300
+ const signature = resolveValue(options.signature, value) || [variant, title, description].join("|");
24301
+ if (previousSignatureRef.current === signature) {
24302
+ return;
24303
+ }
24304
+ previousSignatureRef.current = signature;
24305
+ if (!shouldEmitToast(signature)) {
24306
+ return;
24307
+ }
24308
+ toast.show({
24309
+ variant,
24310
+ title,
24311
+ description,
24312
+ duration: resolveValue(options.duration, value)
24313
+ });
24314
+ }, [
24315
+ options.description,
24316
+ options.duration,
24317
+ options.fallbackDescription,
24318
+ options.messages,
24319
+ options.signature,
24320
+ options.title,
24321
+ options.variant,
24322
+ translate,
24323
+ value
24324
+ ]);
24325
+ }
24326
+ function useToastFeed(items, options = {}) {
24327
+ const previousVisibleSignaturesRef = useRef(/* @__PURE__ */ new Set());
24328
+ const translate = options.translate;
24329
+ const emitItem = useCallback(
24330
+ (item, index, visibleSignatures) => {
24331
+ const variant = item.variant ?? "info";
24332
+ const title = translateMessage(
24333
+ translate,
24334
+ item.title || getDefaultMessage(options.messages, variant === "warning" ? "warningTitle" : "errorTitle")
24335
+ );
24336
+ const description = translateMessage(
24337
+ translate,
24338
+ item.description || getDefaultMessage(
24339
+ options.messages,
24340
+ variant === "warning" ? "defaultWarningDescription" : "defaultErrorDescription"
24341
+ )
24342
+ );
24343
+ const signature = item.signature || [variant, title, description, index].join("|");
24344
+ visibleSignatures.add(signature);
24345
+ if (previousVisibleSignaturesRef.current.has(signature) || !shouldEmitToast(signature)) {
24346
+ return;
24347
+ }
24348
+ toast.show({
24349
+ variant,
24350
+ title,
24351
+ description,
24352
+ duration: item.duration
24353
+ });
24354
+ },
24355
+ [options.messages, translate]
24356
+ );
24357
+ useEffect(() => {
24358
+ const visibleSignatures = /* @__PURE__ */ new Set();
24359
+ items.forEach((item, index) => {
24360
+ if (item) {
24361
+ emitItem(item, index, visibleSignatures);
24362
+ }
24363
+ });
24364
+ previousVisibleSignaturesRef.current = visibleSignatures;
24365
+ }, [emitItem, items]);
24366
+ }
24367
+ var toast = Object.assign(
24368
+ (message, options) => toast$1(message, options),
24369
+ {
24370
+ show: emitToast,
24371
+ error: (input, options) => emitToast(normalizeToastInput(input, "error", options)),
24372
+ warning: (input, options) => emitToast(normalizeToastInput(input, "warning", options)),
24373
+ success: (input, options) => emitToast(normalizeToastInput(input, "success", options)),
24374
+ info: (input, options) => emitToast(normalizeToastInput(input, "info", options)),
24375
+ message: toast$1.message,
24376
+ promise: toast$1.promise,
24377
+ dismiss: toast$1.dismiss,
24378
+ loading: toast$1.loading,
24379
+ custom: toast$1.custom,
24380
+ getHistory: toast$1.getHistory,
24381
+ getToasts: toast$1.getToasts
24382
+ }
24383
+ );
24384
+ function cn5(...inputs) {
24562
24385
  return inputs.filter(Boolean).join(" ");
24563
24386
  }
24564
24387
  function SunIcon({ className }) {
@@ -24610,7 +24433,7 @@ function DarkModeSelector({
24610
24433
  const trigger = /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
24611
24434
  "button",
24612
24435
  {
24613
- className: cn4(
24436
+ className: cn5(
24614
24437
  "inline-flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] transition-colors focus-visible:outline-none",
24615
24438
  className
24616
24439
  ),
@@ -24644,7 +24467,7 @@ function DarkModeSelector({
24644
24467
  children: options.map(({ value, label, Icon }) => /* @__PURE__ */ jsxs(
24645
24468
  DropdownMenu3.Item,
24646
24469
  {
24647
- className: cn4(
24470
+ className: cn5(
24648
24471
  "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",
24649
24472
  mode === value && "bg-[hsl(var(--accent))]"
24650
24473
  ),
@@ -24706,7 +24529,7 @@ function DarkModeSubMenu({
24706
24529
  {
24707
24530
  checked: mode === value,
24708
24531
  disabled: mode === value,
24709
- className: cn4(
24532
+ className: cn5(
24710
24533
  "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 pl-7 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
24711
24534
  ),
24712
24535
  onCheckedChange: () => onModeChange(value),
@@ -24722,7 +24545,7 @@ function DarkModeSubMenu({
24722
24545
  ) })
24723
24546
  ] });
24724
24547
  }
24725
- function cn5(...inputs) {
24548
+ function cn6(...inputs) {
24726
24549
  return inputs.filter(Boolean).join(" ");
24727
24550
  }
24728
24551
  function GlobeIcon({ className }) {
@@ -24742,7 +24565,7 @@ function I18nSelector({
24742
24565
  const trigger = /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
24743
24566
  "button",
24744
24567
  {
24745
- className: cn5(
24568
+ className: cn6(
24746
24569
  "inline-flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] transition-colors focus-visible:outline-none",
24747
24570
  className
24748
24571
  ),
@@ -24776,7 +24599,7 @@ function I18nSelector({
24776
24599
  children: languages.map(({ code, label }) => /* @__PURE__ */ jsx(
24777
24600
  DropdownMenu3.Item,
24778
24601
  {
24779
- className: cn5(
24602
+ className: cn6(
24780
24603
  "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",
24781
24604
  currentLanguage === code && "bg-[hsl(var(--accent))]"
24782
24605
  ),
@@ -24851,6 +24674,6 @@ lodash/lodash.js:
24851
24674
  *)
24852
24675
  */
24853
24676
 
24854
- export { ARTIST_CONFIG, ARTIST_DEFAULT_QUICK_ACTIONS, AppHeader, AppLayout, AppSidebar, ArtistLandingPage, AuthDivider, BSD_CONFIG, BSD_DEFAULT_FEATURE_CARDS, BaseAccordion, BaseAvatar, BaseBadge, BaseBreadcrumb, BaseButton, BaseCheckbox, BaseContextMenu, BaseContextMenuCheckboxItem, BaseContextMenuContent, BaseContextMenuItem, BaseContextMenuLabel, BaseContextMenuRadioGroup, BaseContextMenuRadioItem, BaseContextMenuSeparator, BaseContextMenuSub, BaseContextMenuSubContent, BaseContextMenuSubTrigger, BaseContextMenuTrigger, BaseDescriptionList, BaseDialog, BaseDivider, BaseDropdownMenu, BaseEmptyState, BaseField, BaseInput, BaseLayout, BaseLayoutPane, BaseLayoutResizeHandle, BaseLayoutSplit, BaseLoadingState, BaseMultiSelect, BaseNotice, BasePagination, BasePanel, BaseProgress, BaseRadioGroup, BaseSectionHeader, BaseSegmentedControl, BaseSelect, BaseSkeleton, BaseSwitch, BaseTable, BaseTableBody, BaseTableCaption, BaseTableCell, BaseTableContainer, BaseTableEmpty, BaseTableFooter, BaseTableFooterBar, BaseTableHead, BaseTableHeader, BaseTableLoading, BaseTableRow, BaseTabs, BaseTextarea, BaseToolbar, BaseTooltip, BsdLandingPage, BsdToolboxPanel, CONCEPT_CONFIG, CONCEPT_DEFAULT_QUICK_ACTIONS, ConceptDesignLandingPage, DarkModeSelector, DarkModeSubMenu, DataExplorerActionBar, DataExplorerButton, DataExplorerCheckbox, DataExplorerCollectionFooter, DataExplorerDetailField, DataExplorerDetailSection, DataExplorerDetailShell, DataExplorerDisplayActionMenu, DataExplorerDisplayCard, DataExplorerDisplayCollectionView, DataExplorerDisplayListItem, DataExplorerDisplayMedia, DataExplorerImagePreview, DataExplorerPage, DataExplorerRecordCard, DataExplorerSelect, DataExplorerToolbarActions, DataExplorerToolbarShell, DataExplorerTree, DataExplorerTreeShell, DataExplorerView, DataExplorerViewCollection, DataExplorerViewItem, DataExplorerViewItemShell, DataExplorerViewShell, DataExplorerViewTree, DefaultLandingPage, DynamicComponent, EmailAuth, I18nSelector, InteractiveTable, InteractiveTableEditableTextCell, InteractiveTableReadonlyCell, InteractiveTableSelectCell, LoginLayout, NavButton, OAuthButton, OIDCButton, PendingApproval, WorkbenchContentPane, WorkbenchContentToolbar, WorkbenchDetailSidebar, WorkbenchGalleryCard, WorkbenchGallerySettingsButton, WorkbenchGallerySettingsPanel, WorkbenchGalleryView, WorkbenchLaneView, WorkbenchMasonryLayout, WorkbenchResizableSidebar, WorkbenchTableView, applyMonkeysTheme, calculateHue, calculateLightness, calculateSaturation, clearRegistry, cn3 as cn, createSolidColorScale, genTailwindTheme, getBaseBadgeToneClassName, getBaseButtonToneClassName, getBaseMenuItemToneClassName, getBaseNoticeToneClassName, getDataExplorerActionToneClassName, getDataExplorerMenuItemToneClassName, getRegisteredComponents, getRegisteredThemes, getThemeConfig, hasCustomComponent, markDarkColor, registerComponent, registerTheme, resolveBaseAppearance, resolveComponent, resolveDataExplorerAppearance, resolveMonkeysTheme, setNeocardTheme, setTailwindTheme, useDarkMode };
24677
+ export { ARTIST_CONFIG, ARTIST_DEFAULT_QUICK_ACTIONS, AppHeader, AppLayout, AppSidebar, ArtistLandingPage, AuthDivider, BSD_CONFIG, BSD_DEFAULT_FEATURE_CARDS, BaseAccordion, BaseAvatar, BaseBadge, BaseBreadcrumb, BaseButton, BaseCheckbox, BaseContextMenu, BaseContextMenuCheckboxItem, BaseContextMenuContent, BaseContextMenuItem, BaseContextMenuLabel, BaseContextMenuRadioGroup, BaseContextMenuRadioItem, BaseContextMenuSeparator, BaseContextMenuSub, BaseContextMenuSubContent, BaseContextMenuSubTrigger, BaseContextMenuTrigger, BaseDescriptionList, BaseDialog, BaseDivider, BaseDropdownMenu, BaseEmptyState, BaseField, BaseInput, BaseLayout, BaseLayoutPane, BaseLayoutResizeHandle, BaseLayoutSplit, BaseLoadingState, BaseNotice, BasePagination, BasePanel, BaseProgress, BaseRadioGroup, BaseSectionHeader, BaseSegmentedControl, BaseSelect, BaseSkeleton, BaseSwitch, BaseTable, BaseTableBody, BaseTableCaption, BaseTableCell, BaseTableContainer, BaseTableEmpty, BaseTableFooter, BaseTableFooterBar, BaseTableHead, BaseTableHeader, BaseTableLoading, BaseTableRow, BaseTabs, BaseTextarea, BaseToolbar, BaseTooltip, BsdLandingPage, BsdToolboxPanel, CONCEPT_CONFIG, CONCEPT_DEFAULT_QUICK_ACTIONS, ConceptDesignLandingPage, DarkModeSelector, DarkModeSubMenu, DataExplorerActionBar, DataExplorerButton, DataExplorerCheckbox, DataExplorerCollectionFooter, DataExplorerDetailField, DataExplorerDetailSection, DataExplorerDetailShell, DataExplorerDisplayActionMenu, DataExplorerDisplayCard, DataExplorerDisplayCollectionView, DataExplorerDisplayListItem, DataExplorerDisplayMedia, DataExplorerImagePreview, DataExplorerPage, DataExplorerRecordCard, DataExplorerSelect, DataExplorerToolbarActions, DataExplorerToolbarShell, DataExplorerTree, DataExplorerTreeShell, DataExplorerView, DataExplorerViewCollection, DataExplorerViewItem, DataExplorerViewItemShell, DataExplorerViewShell, DataExplorerViewTree, DefaultLandingPage, DynamicComponent, EmailAuth, I18nSelector, InteractiveTable, InteractiveTableEditableTextCell, InteractiveTableReadonlyCell, InteractiveTableSelectCell, LoginLayout, MonkeysToastProvider, MonkeysToaster, NavButton, OAuthButton, OIDCButton, PendingApproval, MonkeysToastProvider as ToastProvider, MonkeysToaster as Toaster, WorkbenchContentPane, WorkbenchContentToolbar, WorkbenchDetailSidebar, WorkbenchGalleryCard, WorkbenchGallerySettingsButton, WorkbenchGallerySettingsPanel, WorkbenchGalleryView, WorkbenchLaneView, WorkbenchMasonryLayout, WorkbenchResizableSidebar, WorkbenchTableView, applyMonkeysTheme, calculateHue, calculateLightness, calculateSaturation, clearRegistry, cn3 as cn, createSolidColorScale, extractToastMessage, genTailwindTheme, getBaseBadgeToneClassName, getBaseButtonToneClassName, getBaseMenuItemToneClassName, getBaseNoticeToneClassName, getDataExplorerActionToneClassName, getDataExplorerMenuItemToneClassName, getRegisteredComponents, getRegisteredThemes, getThemeConfig, hasCustomComponent, markDarkColor, registerComponent, registerTheme, resolveBaseAppearance, resolveComponent, resolveDataExplorerAppearance, resolveMonkeysTheme, resolveToastVariantForMessage, setNeocardTheme, setTailwindTheme, toast, useDarkMode, useToastFeed, useToastOnValue };
24855
24678
  //# sourceMappingURL=index.mjs.map
24856
24679
  //# sourceMappingURL=index.mjs.map