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

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 (38) hide show
  1. package/README.md +103 -0
  2. package/dist/components/base/index.d.mts +2 -2
  3. package/dist/components/base/index.d.ts +2 -2
  4. package/dist/components/base/index.js +445 -2
  5. package/dist/components/base/index.js.map +1 -1
  6. package/dist/components/base/index.mjs +445 -3
  7. package/dist/components/base/index.mjs.map +1 -1
  8. package/dist/components/login/index.d.mts +97 -1
  9. package/dist/components/login/index.d.ts +97 -1
  10. package/dist/components/login/index.js +262 -2
  11. package/dist/components/login/index.js.map +1 -1
  12. package/dist/components/login/index.mjs +262 -3
  13. package/dist/components/login/index.mjs.map +1 -1
  14. package/dist/components/workbench/index.d.mts +1 -1
  15. package/dist/components/workbench/index.d.ts +1 -1
  16. package/dist/components/workbench/index.js +444 -2
  17. package/dist/components/workbench/index.js.map +1 -1
  18. package/dist/components/workbench/index.mjs +444 -2
  19. package/dist/components/workbench/index.mjs.map +1 -1
  20. package/dist/index.d.mts +3 -3
  21. package/dist/index.d.ts +3 -3
  22. package/dist/index.js +705 -2
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +704 -3
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/styles/login-page.scss +423 -0
  27. package/dist/{theme-Cuy60thu.d.ts → theme-Clm5dVb0.d.mts} +4 -2
  28. package/dist/{theme-CoG9vCPT.d.mts → theme-sIoU5-YC.d.ts} +4 -2
  29. package/dist/theme-system/index.d.mts +1 -1
  30. package/dist/theme-system/index.d.ts +1 -1
  31. package/dist/theme-system/index.js +444 -2
  32. package/dist/theme-system/index.js.map +1 -1
  33. package/dist/theme-system/index.mjs +444 -2
  34. package/dist/theme-system/index.mjs.map +1 -1
  35. package/dist/{types-CZALgtez.d.ts → types-Bn6PEDsX.d.mts} +43 -1
  36. package/dist/{types-CZALgtez.d.mts → types-Bn6PEDsX.d.ts} +43 -1
  37. package/package.json +5 -2
  38. package/dist/styles/artist-login.scss +0 -375
package/dist/index.mjs CHANGED
@@ -11716,6 +11716,448 @@ function BaseLoadingState({
11716
11716
  }
11717
11717
  );
11718
11718
  }
11719
+ function normalizeValues(values) {
11720
+ const nextValues = [];
11721
+ const seen = /* @__PURE__ */ new Set();
11722
+ values?.forEach((value) => {
11723
+ if (seen.has(value)) return;
11724
+ seen.add(value);
11725
+ nextValues.push(value);
11726
+ });
11727
+ return nextValues;
11728
+ }
11729
+ function getNextEnabledIndex(options, currentIndex, direction) {
11730
+ if (!options.length) return -1;
11731
+ const startIndex = currentIndex >= 0 ? currentIndex : 0;
11732
+ for (let offset = 1; offset <= options.length; offset += 1) {
11733
+ const nextIndex = (startIndex + offset * direction + options.length) % options.length;
11734
+ if (!options[nextIndex]?.disabled) {
11735
+ return nextIndex;
11736
+ }
11737
+ }
11738
+ return -1;
11739
+ }
11740
+ function getFirstEnabledIndex(options) {
11741
+ return options.findIndex((option) => !option.disabled);
11742
+ }
11743
+ function getSafeTagCount(maxTagCount, total) {
11744
+ if (maxTagCount === void 0) return total;
11745
+ if (!Number.isFinite(maxTagCount)) return total;
11746
+ return Math.max(0, Math.min(total, Math.floor(maxTagCount)));
11747
+ }
11748
+ function getDefaultRemoveLabel(option) {
11749
+ return `Remove ${option.value}`;
11750
+ }
11751
+ var BaseMultiSelect = forwardRef(
11752
+ function BaseMultiSelect2({
11753
+ options,
11754
+ value,
11755
+ defaultValue,
11756
+ name,
11757
+ placeholder = "Select options",
11758
+ icon,
11759
+ invalid = false,
11760
+ disabled = false,
11761
+ required = false,
11762
+ openForPreview = false,
11763
+ maxTagCount,
11764
+ removeLabel = getDefaultRemoveLabel,
11765
+ emptyLabel = "No options",
11766
+ appearance,
11767
+ className,
11768
+ classNames,
11769
+ style,
11770
+ id,
11771
+ "aria-invalid": nativeAriaInvalid,
11772
+ "aria-label": nativeAriaLabel,
11773
+ "aria-labelledby": nativeAriaLabelledBy,
11774
+ onValueChange,
11775
+ ...rootProps
11776
+ }, ref) {
11777
+ const theme = resolveBaseAppearance(appearance);
11778
+ const generatedId = useId();
11779
+ const multiSelectId = id ?? generatedId;
11780
+ const controlId = `${multiSelectId}-control`;
11781
+ const listboxId = `${multiSelectId}-listbox`;
11782
+ const rootRef = useRef(null);
11783
+ const optionList = options ?? [];
11784
+ const forceOpen = openForPreview;
11785
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
11786
+ const open = forceOpen || uncontrolledOpen;
11787
+ const [uncontrolledValue, setUncontrolledValue] = useState(
11788
+ () => normalizeValues(defaultValue)
11789
+ );
11790
+ const [activeIndex, setActiveIndex] = useState(
11791
+ () => getFirstEnabledIndex(optionList)
11792
+ );
11793
+ const isControlled = value !== void 0;
11794
+ const selectedValues = useMemo(
11795
+ () => normalizeValues(isControlled ? value : uncontrolledValue),
11796
+ [isControlled, uncontrolledValue, value]
11797
+ );
11798
+ const selectedValueSet = useMemo(
11799
+ () => new Set(selectedValues),
11800
+ [selectedValues]
11801
+ );
11802
+ const optionByValue = useMemo(() => {
11803
+ const map = /* @__PURE__ */ new Map();
11804
+ optionList.forEach((option) => {
11805
+ if (!map.has(option.value)) {
11806
+ map.set(option.value, option);
11807
+ }
11808
+ });
11809
+ return map;
11810
+ }, [optionList]);
11811
+ const selectedOptions = useMemo(
11812
+ () => selectedValues.map((selectedValue) => optionByValue.get(selectedValue)).filter(
11813
+ (option) => option !== void 0
11814
+ ),
11815
+ [optionByValue, selectedValues]
11816
+ );
11817
+ const firstEnabledIndex = useMemo(
11818
+ () => getFirstEnabledIndex(optionList),
11819
+ [optionList]
11820
+ );
11821
+ const resolvedActiveIndex = activeIndex >= 0 && !optionList[activeIndex]?.disabled ? activeIndex : firstEnabledIndex;
11822
+ const visibleTagCount = getSafeTagCount(
11823
+ maxTagCount,
11824
+ selectedOptions.length
11825
+ );
11826
+ const visibleOptions = selectedOptions.slice(0, visibleTagCount);
11827
+ const overflowCount = selectedOptions.length - visibleOptions.length;
11828
+ const isPlaceholder = selectedOptions.length === 0;
11829
+ const setRootRef = (node) => {
11830
+ rootRef.current = node;
11831
+ if (typeof ref === "function") {
11832
+ ref(node);
11833
+ } else if (ref) {
11834
+ ref.current = node;
11835
+ }
11836
+ };
11837
+ const setOpen = (nextOpen) => {
11838
+ if (disabled || forceOpen) return;
11839
+ setUncontrolledOpen(nextOpen);
11840
+ if (nextOpen) {
11841
+ setActiveIndex(resolvedActiveIndex);
11842
+ }
11843
+ };
11844
+ useEffect(() => {
11845
+ if (!open || forceOpen) return void 0;
11846
+ const handlePointerDown = (event) => {
11847
+ if (!rootRef.current?.contains(event.target)) {
11848
+ setUncontrolledOpen(false);
11849
+ }
11850
+ };
11851
+ document.addEventListener("pointerdown", handlePointerDown);
11852
+ return () => {
11853
+ document.removeEventListener("pointerdown", handlePointerDown);
11854
+ };
11855
+ }, [forceOpen, open]);
11856
+ useEffect(() => {
11857
+ if (resolvedActiveIndex >= 0 && resolvedActiveIndex !== activeIndex) {
11858
+ setActiveIndex(resolvedActiveIndex);
11859
+ }
11860
+ }, [activeIndex, resolvedActiveIndex]);
11861
+ const commitValues = (nextValues) => {
11862
+ const normalizedValues = normalizeValues(nextValues);
11863
+ if (!isControlled) {
11864
+ setUncontrolledValue(normalizedValues);
11865
+ }
11866
+ onValueChange?.(normalizedValues);
11867
+ };
11868
+ const toggleOption = (option) => {
11869
+ if (!option || option.disabled || disabled) return;
11870
+ const nextValues = selectedValueSet.has(option.value) ? selectedValues.filter((selectedValue) => selectedValue !== option.value) : [...selectedValues, option.value];
11871
+ commitValues(nextValues);
11872
+ };
11873
+ const removeOption = (option) => {
11874
+ if (disabled) return;
11875
+ commitValues(
11876
+ selectedValues.filter((selectedValue) => selectedValue !== option.value)
11877
+ );
11878
+ };
11879
+ const focusOption = (direction) => {
11880
+ const nextIndex = getNextEnabledIndex(
11881
+ optionList,
11882
+ resolvedActiveIndex,
11883
+ direction
11884
+ );
11885
+ if (nextIndex >= 0) {
11886
+ setActiveIndex(nextIndex);
11887
+ }
11888
+ };
11889
+ const handleKeyDown = (event) => {
11890
+ if (disabled) return;
11891
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
11892
+ event.preventDefault();
11893
+ if (!open) {
11894
+ setOpen(true);
11895
+ setActiveIndex(firstEnabledIndex);
11896
+ return;
11897
+ }
11898
+ focusOption(event.key === "ArrowDown" ? 1 : -1);
11899
+ return;
11900
+ }
11901
+ if (event.key === "Home") {
11902
+ event.preventDefault();
11903
+ setOpen(true);
11904
+ setActiveIndex(firstEnabledIndex);
11905
+ return;
11906
+ }
11907
+ if (event.key === "End") {
11908
+ event.preventDefault();
11909
+ setOpen(true);
11910
+ for (let index = optionList.length - 1; index >= 0; index -= 1) {
11911
+ if (!optionList[index]?.disabled) {
11912
+ setActiveIndex(index);
11913
+ break;
11914
+ }
11915
+ }
11916
+ return;
11917
+ }
11918
+ if (event.key === "Enter" || event.key === " ") {
11919
+ event.preventDefault();
11920
+ if (!open) {
11921
+ setOpen(true);
11922
+ return;
11923
+ }
11924
+ toggleOption(optionList[resolvedActiveIndex]);
11925
+ return;
11926
+ }
11927
+ if (event.key === "Escape") {
11928
+ setOpen(false);
11929
+ }
11930
+ };
11931
+ return /* @__PURE__ */ jsxs(
11932
+ "div",
11933
+ {
11934
+ ...rootProps,
11935
+ id,
11936
+ ref: setRootRef,
11937
+ className: cn(
11938
+ theme.slots.controlWrapper,
11939
+ "overflow-visible",
11940
+ open && "z-50",
11941
+ invalid && theme.slots.controlInvalid,
11942
+ disabled && theme.slots.controlDisabled,
11943
+ classNames?.root,
11944
+ className
11945
+ ),
11946
+ style: {
11947
+ ...theme.styles.control,
11948
+ ...invalid ? theme.styles.controlInvalid : void 0,
11949
+ ...disabled ? theme.styles.controlDisabled : void 0,
11950
+ ...style
11951
+ },
11952
+ children: [
11953
+ hasRenderableNode(icon) ? /* @__PURE__ */ jsx("span", { className: cn(theme.slots.controlIcon, classNames?.icon), children: icon }) : null,
11954
+ /* @__PURE__ */ jsx(
11955
+ "div",
11956
+ {
11957
+ id: controlId,
11958
+ role: "combobox",
11959
+ tabIndex: disabled ? -1 : 0,
11960
+ "aria-haspopup": "listbox",
11961
+ "aria-expanded": open,
11962
+ "aria-controls": listboxId,
11963
+ "aria-disabled": disabled || void 0,
11964
+ "aria-required": required || void 0,
11965
+ "aria-invalid": nativeAriaInvalid ?? (invalid || void 0),
11966
+ "aria-label": nativeAriaLabel,
11967
+ "aria-labelledby": nativeAriaLabelledBy,
11968
+ className: cn(
11969
+ theme.slots.controlBase,
11970
+ "flex min-h-9 cursor-pointer flex-wrap items-center gap-1.5 py-1.5 pr-9 text-left",
11971
+ disabled && "!cursor-not-allowed",
11972
+ classNames?.control
11973
+ ),
11974
+ onClick: () => setOpen(!open),
11975
+ onKeyDown: handleKeyDown,
11976
+ children: /* @__PURE__ */ jsxs(
11977
+ "span",
11978
+ {
11979
+ className: cn(
11980
+ "flex min-w-0 flex-1 flex-wrap items-center gap-1.5",
11981
+ classNames?.tagList
11982
+ ),
11983
+ children: [
11984
+ visibleOptions.map((option) => /* @__PURE__ */ jsxs(
11985
+ "span",
11986
+ {
11987
+ className: cn(
11988
+ "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",
11989
+ classNames?.tag
11990
+ ),
11991
+ children: [
11992
+ /* @__PURE__ */ jsx(
11993
+ "span",
11994
+ {
11995
+ className: cn(
11996
+ "max-w-40 truncate",
11997
+ classNames?.tagLabel
11998
+ ),
11999
+ children: option.label
12000
+ }
12001
+ ),
12002
+ /* @__PURE__ */ jsx(
12003
+ "button",
12004
+ {
12005
+ type: "button",
12006
+ "aria-label": removeLabel(option),
12007
+ disabled,
12008
+ className: cn(
12009
+ "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",
12010
+ classNames?.tagRemove
12011
+ ),
12012
+ onClick: (event) => {
12013
+ event.preventDefault();
12014
+ event.stopPropagation();
12015
+ removeOption(option);
12016
+ },
12017
+ onMouseDown: (event) => {
12018
+ event.preventDefault();
12019
+ event.stopPropagation();
12020
+ },
12021
+ onKeyDown: (event) => event.stopPropagation(),
12022
+ children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "x" })
12023
+ }
12024
+ )
12025
+ ]
12026
+ },
12027
+ option.value
12028
+ )),
12029
+ overflowCount > 0 ? /* @__PURE__ */ jsxs(
12030
+ "span",
12031
+ {
12032
+ className: cn(
12033
+ "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",
12034
+ classNames?.tag
12035
+ ),
12036
+ children: [
12037
+ "+",
12038
+ overflowCount
12039
+ ]
12040
+ }
12041
+ ) : null,
12042
+ isPlaceholder ? /* @__PURE__ */ jsx(
12043
+ "span",
12044
+ {
12045
+ className: cn(
12046
+ "min-w-0 truncate",
12047
+ theme.slots.selectPlaceholder,
12048
+ classNames?.placeholder
12049
+ ),
12050
+ children: placeholder
12051
+ }
12052
+ ) : null
12053
+ ]
12054
+ }
12055
+ )
12056
+ }
12057
+ ),
12058
+ /* @__PURE__ */ jsx(
12059
+ "span",
12060
+ {
12061
+ className: cn(
12062
+ theme.slots.selectChevron,
12063
+ open && "rotate-[225deg]",
12064
+ classNames?.chevron
12065
+ )
12066
+ }
12067
+ ),
12068
+ name ? selectedValues.map((selectedValue) => /* @__PURE__ */ jsx(
12069
+ "input",
12070
+ {
12071
+ type: "hidden",
12072
+ name,
12073
+ value: selectedValue,
12074
+ className: classNames?.hiddenInput
12075
+ },
12076
+ selectedValue
12077
+ )) : null,
12078
+ open ? /* @__PURE__ */ jsx(
12079
+ "div",
12080
+ {
12081
+ id: listboxId,
12082
+ role: "listbox",
12083
+ "aria-multiselectable": "true",
12084
+ "aria-labelledby": controlId,
12085
+ className: cn(theme.slots.selectMenu, classNames?.menu),
12086
+ style: theme.styles.selectMenu,
12087
+ children: optionList.length > 0 ? optionList.map((option, index) => {
12088
+ const selected = selectedValueSet.has(option.value);
12089
+ const active = index === resolvedActiveIndex;
12090
+ return /* @__PURE__ */ jsxs(
12091
+ "button",
12092
+ {
12093
+ type: "button",
12094
+ role: "option",
12095
+ "aria-selected": selected,
12096
+ disabled: option.disabled,
12097
+ className: cn(
12098
+ theme.slots.selectOption,
12099
+ "gap-2",
12100
+ active && theme.slots.selectOptionActive,
12101
+ selected && theme.slots.selectOptionSelected,
12102
+ option.disabled && theme.slots.selectOptionDisabled,
12103
+ classNames?.option
12104
+ ),
12105
+ style: {
12106
+ ...theme.styles.selectOption,
12107
+ ...active ? theme.styles.selectOptionActive : void 0,
12108
+ ...selected ? theme.styles.selectOptionSelected : void 0
12109
+ },
12110
+ onMouseEnter: () => {
12111
+ if (!option.disabled) {
12112
+ setActiveIndex(index);
12113
+ }
12114
+ },
12115
+ onMouseDown: (event) => event.preventDefault(),
12116
+ onClick: () => toggleOption(option),
12117
+ children: [
12118
+ /* @__PURE__ */ jsx(
12119
+ "span",
12120
+ {
12121
+ "aria-hidden": "true",
12122
+ className: cn(
12123
+ "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-border/70 text-[10px]",
12124
+ selected && "border-primary/40 bg-primary text-primary-foreground",
12125
+ classNames?.optionIndicator
12126
+ ),
12127
+ children: selected ? "\u2713" : null
12128
+ }
12129
+ ),
12130
+ /* @__PURE__ */ jsx(
12131
+ "span",
12132
+ {
12133
+ className: cn(
12134
+ "min-w-0 flex-1 truncate",
12135
+ classNames?.optionLabel
12136
+ ),
12137
+ children: option.label
12138
+ }
12139
+ )
12140
+ ]
12141
+ },
12142
+ option.value
12143
+ );
12144
+ }) : /* @__PURE__ */ jsx(
12145
+ "div",
12146
+ {
12147
+ className: cn(
12148
+ "px-2.5 py-2 text-sm text-muted-foreground",
12149
+ classNames?.empty
12150
+ ),
12151
+ children: emptyLabel
12152
+ }
12153
+ )
12154
+ }
12155
+ ) : null
12156
+ ]
12157
+ }
12158
+ );
12159
+ }
12160
+ );
11719
12161
  function BaseNotice({
11720
12162
  tone,
11721
12163
  icon,
@@ -12117,7 +12559,7 @@ function getInitialValue2(options, defaultValue) {
12117
12559
  }
12118
12560
  return "";
12119
12561
  }
12120
- function getNextEnabledIndex(options, currentIndex, direction) {
12562
+ function getNextEnabledIndex2(options, currentIndex, direction) {
12121
12563
  if (!options.length) return -1;
12122
12564
  for (let offset = 1; offset <= options.length; offset += 1) {
12123
12565
  const nextIndex = (currentIndex + offset * direction + options.length) % options.length;
@@ -12219,7 +12661,7 @@ var BaseSelect = forwardRef(
12219
12661
  };
12220
12662
  const focusOption = (direction) => {
12221
12663
  const currentIndex = activeIndex >= 0 ? activeIndex : 0;
12222
- const nextIndex = getNextEnabledIndex(optionList, currentIndex, direction);
12664
+ const nextIndex = getNextEnabledIndex2(optionList, currentIndex, direction);
12223
12665
  if (nextIndex >= 0) {
12224
12666
  commitValue(optionList[nextIndex].value, optionList[nextIndex].disabled);
12225
12667
  }
@@ -19904,6 +20346,265 @@ registerTheme(
19904
20346
  version: "1.0.0"
19905
20347
  }
19906
20348
  );
20349
+ var LOGIN_LOGO_POSITIONS = ["top", "middle", "bottom"];
20350
+ var normalizeCssValue = (value) => {
20351
+ const trimmed = value?.trim();
20352
+ return trimmed || void 0;
20353
+ };
20354
+ var createBackgroundImage = (gradient, imageUrl) => {
20355
+ const resolvedGradient = normalizeCssValue(gradient);
20356
+ const resolvedImageUrl = normalizeCssValue(imageUrl);
20357
+ return [resolvedGradient, resolvedImageUrl ? `url(${JSON.stringify(resolvedImageUrl)})` : void 0].filter(Boolean).join(", ");
20358
+ };
20359
+ var normalizeLogoPosition = (position) => position && LOGIN_LOGO_POSITIONS.includes(position) ? position : "bottom";
20360
+ var normalizeLogoScale = (scale) => typeof scale === "number" && Number.isFinite(scale) && scale > 0 ? scale : void 0;
20361
+ function LoginPage({
20362
+ className,
20363
+ style,
20364
+ background,
20365
+ logo,
20366
+ primaryColor,
20367
+ radius,
20368
+ customCss,
20369
+ toolbar,
20370
+ title,
20371
+ backAction,
20372
+ methods,
20373
+ activeMethodId,
20374
+ defaultMethodId,
20375
+ onMethodChange,
20376
+ externalLabel,
20377
+ externalMethods = [],
20378
+ callout
20379
+ }) {
20380
+ const availableMethods = useMemo(() => methods.filter((method) => !method.hidden), [methods]);
20381
+ const fallbackMethodId = defaultMethodId ?? availableMethods[0]?.id;
20382
+ const [internalMethodId, setInternalMethodId] = useState(fallbackMethodId);
20383
+ const currentMethodId = activeMethodId ?? internalMethodId;
20384
+ const activeMethod = availableMethods.find((method) => method.id === currentMethodId) ?? availableMethods[0];
20385
+ const hasTabs = availableMethods.length > 1;
20386
+ const backgroundImage = createBackgroundImage(background?.gradient, background?.imageUrl);
20387
+ const backgroundMode = backgroundImage ? "custom" : "default";
20388
+ const logoPosition = normalizeLogoPosition(logo?.position);
20389
+ const logoScale = normalizeLogoScale(logo?.scale);
20390
+ useEffect(() => {
20391
+ if (!availableMethods.length) {
20392
+ setInternalMethodId(void 0);
20393
+ return;
20394
+ }
20395
+ if (!currentMethodId || !availableMethods.some((method) => method.id === currentMethodId)) {
20396
+ setInternalMethodId(fallbackMethodId ?? availableMethods[0]?.id);
20397
+ }
20398
+ }, [availableMethods, currentMethodId, fallbackMethodId]);
20399
+ const rootStyle = useMemo(
20400
+ () => ({
20401
+ ...primaryColor ? { ["--login-page-theme-primary-color"]: primaryColor } : null,
20402
+ ...radius ? { ["--login-page-theme-radius"]: radius } : null,
20403
+ ...style
20404
+ }),
20405
+ [primaryColor, radius, style]
20406
+ );
20407
+ const handleMethodChange = (methodId) => {
20408
+ if (activeMethodId === void 0) {
20409
+ setInternalMethodId(methodId);
20410
+ }
20411
+ onMethodChange?.(methodId);
20412
+ };
20413
+ const renderExternalMethod = (method) => {
20414
+ const button = /* @__PURE__ */ jsxs(
20415
+ "button",
20416
+ {
20417
+ type: "button",
20418
+ className: "login-page__oauth-button",
20419
+ "data-login-part": "external-button",
20420
+ "data-login-method-id": method.id,
20421
+ onClick: method.onClick,
20422
+ disabled: method.disabled,
20423
+ children: [
20424
+ method.icon ? /* @__PURE__ */ jsx("span", { className: "login-page__oauth-icon", "data-login-part": "external-icon", children: method.icon }) : null,
20425
+ /* @__PURE__ */ jsx("span", { children: method.label })
20426
+ ]
20427
+ }
20428
+ );
20429
+ return /* @__PURE__ */ jsx(React.Fragment, { children: method.render ? method.render(button) : button }, method.id);
20430
+ };
20431
+ return /* @__PURE__ */ jsxs(
20432
+ "main",
20433
+ {
20434
+ className: ["login-page", className].filter(Boolean).join(" "),
20435
+ "data-login-page": true,
20436
+ "data-login-part": "root",
20437
+ "data-login-background": backgroundMode,
20438
+ style: rootStyle,
20439
+ children: [
20440
+ customCss ? /* @__PURE__ */ jsx("style", { "data-login-page-custom-css": true, children: customCss }) : null,
20441
+ /* @__PURE__ */ jsx(
20442
+ "div",
20443
+ {
20444
+ className: "login-page__background",
20445
+ "data-login-part": "background",
20446
+ "data-login-background": backgroundMode,
20447
+ style: backgroundImage ? { backgroundImage } : void 0,
20448
+ "aria-hidden": "true"
20449
+ }
20450
+ ),
20451
+ toolbar ? /* @__PURE__ */ jsx("div", { className: "login-page__toolbar", "data-login-part": "toolbar", children: toolbar }) : null,
20452
+ logo?.url ? /* @__PURE__ */ jsx(
20453
+ "div",
20454
+ {
20455
+ className: `login-page__logo login-page__logo--${logoPosition}`,
20456
+ "data-login-part": "logo",
20457
+ "data-logo-position": logoPosition,
20458
+ children: /* @__PURE__ */ jsx(
20459
+ "img",
20460
+ {
20461
+ className: "login-page__logo-image",
20462
+ "data-login-part": "logo-image",
20463
+ src: logo.url,
20464
+ alt: logo.alt ?? "",
20465
+ style: logoScale ? { transform: `scale(${logoScale})` } : void 0
20466
+ }
20467
+ )
20468
+ }
20469
+ ) : null,
20470
+ /* @__PURE__ */ jsxs(
20471
+ "section",
20472
+ {
20473
+ className: "login-page__form",
20474
+ "data-login-part": "panel",
20475
+ "aria-label": typeof title === "string" ? title : void 0,
20476
+ children: [
20477
+ backAction ? /* @__PURE__ */ jsxs("button", { type: "button", className: "login-page__back", "data-login-part": "back", onClick: backAction.onClick, children: [
20478
+ backAction.icon ? /* @__PURE__ */ jsx("span", { className: "login-page__back-icon", "data-login-part": "back-icon", children: backAction.icon }) : null,
20479
+ /* @__PURE__ */ jsx("span", { children: backAction.label })
20480
+ ] }) : null,
20481
+ title ? /* @__PURE__ */ jsx("h1", { className: "login-page__title", "data-login-part": "title", children: title }) : null,
20482
+ hasTabs ? /* @__PURE__ */ jsx("div", { className: "login-page__tabs", "data-login-part": "tabs", role: "tablist", children: availableMethods.map((method) => {
20483
+ const selected = method.id === activeMethod?.id;
20484
+ return /* @__PURE__ */ jsxs(
20485
+ "button",
20486
+ {
20487
+ type: "button",
20488
+ role: "tab",
20489
+ "aria-selected": selected,
20490
+ className: `login-page__tab ${selected ? "login-page__tab--active" : ""}`,
20491
+ "data-login-part": "tab",
20492
+ "data-login-method-id": method.id,
20493
+ "data-active": selected ? "true" : "false",
20494
+ onClick: () => handleMethodChange(method.id),
20495
+ children: [
20496
+ method.icon ? /* @__PURE__ */ jsx("span", { className: "login-page__tab-icon", "data-login-part": "tab-icon", children: method.icon }) : null,
20497
+ /* @__PURE__ */ jsx("span", { children: method.label })
20498
+ ]
20499
+ },
20500
+ method.id
20501
+ );
20502
+ }) }) : null,
20503
+ activeMethod ? /* @__PURE__ */ jsxs(
20504
+ "form",
20505
+ {
20506
+ className: "login-page__form-fields",
20507
+ "data-login-part": "form",
20508
+ "data-login-method-id": activeMethod.id,
20509
+ onSubmit: activeMethod.onSubmit,
20510
+ children: [
20511
+ activeMethod.fields.map((field) => /* @__PURE__ */ jsx("div", { className: "login-page__field", "data-login-part": "field", "data-login-field-name": field.name, children: /* @__PURE__ */ jsx(
20512
+ "input",
20513
+ {
20514
+ id: field.id,
20515
+ name: field.name,
20516
+ type: field.type ?? "text",
20517
+ value: field.value,
20518
+ placeholder: field.placeholder,
20519
+ autoComplete: field.autoComplete,
20520
+ inputMode: field.inputMode,
20521
+ maxLength: field.maxLength,
20522
+ pattern: field.pattern,
20523
+ disabled: activeMethod.disabled || activeMethod.isLoading || field.disabled,
20524
+ required: field.required,
20525
+ className: "login-page__input",
20526
+ "data-login-part": "input",
20527
+ onChange: (event) => field.onChange(event.target.value)
20528
+ }
20529
+ ) }, field.name)),
20530
+ activeMethod.checkbox ? /* @__PURE__ */ jsxs("label", { className: "login-page__remember", "data-login-part": "checkbox-label", htmlFor: activeMethod.checkbox.id, children: [
20531
+ /* @__PURE__ */ jsx(
20532
+ "input",
20533
+ {
20534
+ id: activeMethod.checkbox.id,
20535
+ type: "checkbox",
20536
+ className: "login-page__checkbox",
20537
+ "data-login-part": "checkbox",
20538
+ checked: activeMethod.checkbox.checked,
20539
+ disabled: activeMethod.disabled || activeMethod.isLoading || activeMethod.checkbox.disabled,
20540
+ onChange: (event) => activeMethod.checkbox?.onChange(event.target.checked)
20541
+ }
20542
+ ),
20543
+ /* @__PURE__ */ jsx("span", { children: activeMethod.checkbox.label })
20544
+ ] }) : null,
20545
+ activeMethod.footer || activeMethod.footerAction ? /* @__PURE__ */ jsxs("div", { className: "login-page__method-footer", "data-login-part": "method-footer", children: [
20546
+ activeMethod.footer,
20547
+ activeMethod.footerAction ? /* @__PURE__ */ jsx(
20548
+ "button",
20549
+ {
20550
+ type: "button",
20551
+ className: "login-page__method-footer-action",
20552
+ "data-login-part": "method-footer-action",
20553
+ "data-login-method-id": activeMethod.id,
20554
+ onClick: activeMethod.footerAction.onClick,
20555
+ disabled: activeMethod.disabled || activeMethod.isLoading || activeMethod.footerAction.disabled,
20556
+ children: activeMethod.footerAction.label
20557
+ }
20558
+ ) : null
20559
+ ] }) : null,
20560
+ /* @__PURE__ */ jsx(
20561
+ "button",
20562
+ {
20563
+ type: "submit",
20564
+ className: "login-page__submit",
20565
+ "data-login-part": "submit-button",
20566
+ disabled: activeMethod.disabled || activeMethod.isLoading,
20567
+ children: activeMethod.isLoading && activeMethod.loadingLabel ? activeMethod.loadingLabel : activeMethod.submitLabel
20568
+ }
20569
+ )
20570
+ ]
20571
+ }
20572
+ ) : null,
20573
+ callout ? /* @__PURE__ */ jsxs(
20574
+ "div",
20575
+ {
20576
+ className: `login-page__callout login-page__callout--${callout.tone ?? "info"}`,
20577
+ "data-login-part": "callout",
20578
+ "data-tone": callout.tone ?? "info",
20579
+ children: [
20580
+ /* @__PURE__ */ jsx("div", { className: "login-page__callout-title", "data-login-part": "callout-title", children: callout.title }),
20581
+ callout.description ? /* @__PURE__ */ jsx("p", { className: "login-page__callout-description", "data-login-part": "callout-description", children: callout.description }) : null,
20582
+ callout.detail ? /* @__PURE__ */ jsx("p", { className: "login-page__callout-detail", "data-login-part": "callout-detail", children: callout.detail }) : null,
20583
+ callout.action ? /* @__PURE__ */ jsx(
20584
+ "button",
20585
+ {
20586
+ type: "button",
20587
+ className: "login-page__callout-action",
20588
+ "data-login-part": "callout-action",
20589
+ onClick: callout.action.onClick,
20590
+ disabled: callout.action.disabled,
20591
+ children: callout.action.label
20592
+ }
20593
+ ) : null
20594
+ ]
20595
+ }
20596
+ ) : null,
20597
+ externalMethods.length ? /* @__PURE__ */ jsxs("div", { className: "login-page__oauth-section", "data-login-part": "external-methods", children: [
20598
+ externalLabel ? /* @__PURE__ */ jsx("div", { className: "login-page__oauth-label", "data-login-part": "external-label", children: externalLabel }) : null,
20599
+ /* @__PURE__ */ jsx("div", { className: "login-page__oauth-list", "data-login-part": "external-list", children: externalMethods.map(renderExternalMethod) })
20600
+ ] }) : null
20601
+ ]
20602
+ }
20603
+ )
20604
+ ]
20605
+ }
20606
+ );
20607
+ }
19907
20608
  var containerStyle = {
19908
20609
  display: "flex",
19909
20610
  alignItems: "center",
@@ -24674,6 +25375,6 @@ lodash/lodash.js:
24674
25375
  *)
24675
25376
  */
24676
25377
 
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 };
25378
+ 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, LoginPage, 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 };
24678
25379
  //# sourceMappingURL=index.mjs.map
24679
25380
  //# sourceMappingURL=index.mjs.map