@noya-app/noya-designsystem 0.1.83 → 0.1.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -18871,28 +18871,32 @@ function ToastContent3({ toast }) {
18871
18871
  index_parts_exports3.Root,
18872
18872
  {
18873
18873
  toast,
18874
- className: "n-px-2 n-py-2.5 n-grid n-grid-cols-[auto_max-content] n-gap-x-2.5 n-items-center n-rounded n-text-sm n-bg-popover-background n-shadow-popover n-text-text-muted"
18874
+ className: "n-relative n-flex n-items-start n-gap-2 n-rounded n-text-sm n-bg-popover-background n-shadow-popover n-text-text-muted n-px-3 n-py-2.5 n-pr-10"
18875
18875
  },
18876
- toast.data?.title && /* @__PURE__ */ React123.createElement(
18876
+ /* @__PURE__ */ React123.createElement("div", { className: "n-flex n-flex-col n-gap-0.5 n-min-w-0" }, toast.data?.title && /* @__PURE__ */ React123.createElement(
18877
18877
  index_parts_exports3.Title,
18878
18878
  {
18879
- className: `n-mb-[5px] ${textStyles.label} n-font-bold n-text-text`
18879
+ className: `${textStyles.label} n-font-bold n-text-text`
18880
18880
  },
18881
18881
  toast.data.title
18882
- ),
18883
- /* @__PURE__ */ React123.createElement(
18882
+ ), /* @__PURE__ */ React123.createElement(
18884
18883
  index_parts_exports3.Description,
18885
18884
  {
18886
18885
  className: `${textStyles.small} n-text-text-muted`
18887
18886
  },
18888
18887
  toast.data?.content
18889
- ),
18890
- toast.data?.action && /* @__PURE__ */ React123.createElement(index_parts_exports3.Action, { render: /* @__PURE__ */ React123.createElement("span", null) }, toast.data.action),
18888
+ ), toast.data?.action && /* @__PURE__ */ React123.createElement(index_parts_exports3.Action, { render: /* @__PURE__ */ React123.createElement("span", { className: "n-mt-1" }) }, toast.data.action)),
18891
18889
  /* @__PURE__ */ React123.createElement(
18892
18890
  index_parts_exports3.Close,
18893
18891
  {
18894
18892
  "aria-label": "Close",
18895
- render: /* @__PURE__ */ React123.createElement(IconButton, { iconName: "Cross1Icon" })
18893
+ render: /* @__PURE__ */ React123.createElement(
18894
+ IconButton,
18895
+ {
18896
+ className: "!n-absolute n-top-2 n-right-2",
18897
+ iconName: "Cross1Icon"
18898
+ }
18899
+ )
18896
18900
  }
18897
18901
  )
18898
18902
  );
@@ -22033,17 +22037,19 @@ var DialogProvider = function DialogProvider2({
22033
22037
  const inputRef = useRef53(null);
22034
22038
  const confirmButtonRef = useRef53(null);
22035
22039
  const dialogRef = useRef53(null);
22040
+ const contentsType = contents?.type;
22041
+ const contentsInstance = contents?.resolve;
22036
22042
  React160.useEffect(() => {
22037
- if (!contents) return;
22043
+ if (!contentsType || !contentsInstance) return;
22038
22044
  requestAnimationFrame(() => {
22039
- if (contents.type === "input") {
22045
+ if (contentsType === "input") {
22040
22046
  inputRef.current?.focus();
22041
22047
  inputRef.current?.setSelectionRange(0, inputRef.current.value.length);
22042
- } else if (contents.type === "confirmation") {
22048
+ } else if (contentsType === "confirmation") {
22043
22049
  confirmButtonRef.current?.focus();
22044
22050
  }
22045
22051
  });
22046
- }, [contents]);
22052
+ }, [contentsType, contentsInstance]);
22047
22053
  const containsElement = useCallback41((element) => {
22048
22054
  if (!dialogRef.current) return false;
22049
22055
  return dialogRef.current.containsElement(element);
@@ -41760,7 +41766,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
41760
41766
  rightTabItems,
41761
41767
  rightTabValue,
41762
41768
  onChangeRightTab,
41763
- onChangeLeftTab
41769
+ onChangeLeftTab,
41770
+ compactDrawerMenu
41764
41771
  }) {
41765
41772
  const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] = useState76({
41766
41773
  leftSidebarCollapsed: true,
@@ -41804,6 +41811,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
41804
41811
  [allTabItems]
41805
41812
  );
41806
41813
  const hasTabs = allSelectableTabItems.length > 0;
41814
+ const compactTabItem = compactDrawerMenu && allSelectableTabItems.length === 1 ? allSelectableTabItems[0] : void 0;
41807
41815
  const leftSelectableTabItems = useMemo151(
41808
41816
  () => (leftTabItems ?? []).filter(isSelectableMenuItem),
41809
41817
  [leftTabItems]
@@ -41857,7 +41865,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
41857
41865
  id: EDITOR_PANEL_GROUP_ID,
41858
41866
  className: "n-flex n-flex-col n-flex-1 n-relative focus:n-outline-none"
41859
41867
  },
41860
- hasTabs && /* @__PURE__ */ React311.createElement(React311.Fragment, null, /* @__PURE__ */ React311.createElement(
41868
+ hasTabs && !compactTabItem && /* @__PURE__ */ React311.createElement(React311.Fragment, null, /* @__PURE__ */ React311.createElement(
41861
41869
  "div",
41862
41870
  {
41863
41871
  className: "n-flex n-flex-row n-items-center n-gap-1 n-px-2 n-py-1.5 n-bg-sidebar-background n-flex-none",
@@ -41874,6 +41882,22 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
41874
41882
  }
41875
41883
  )
41876
41884
  ), /* @__PURE__ */ React311.createElement(Divider, null)),
41885
+ compactTabItem && /* @__PURE__ */ React311.createElement("div", { className: "n-absolute n-top-0 n-left-0 n-h-[calc(var(--n-toolbar-height)+1px)] n-w-[calc(var(--n-toolbar-height)+1px)] n-bg-sidebar-background n-border-r n-border-b n-border-divider-strong n-z-10 n-flex n-items-center n-justify-center" }, /* @__PURE__ */ React311.createElement(
41886
+ Button,
41887
+ {
41888
+ "aria-label": typeof compactTabItem.title === "string" ? compactTabItem.title : "Toggle sidebar",
41889
+ variant: "none",
41890
+ className: "n-rounded",
41891
+ style: {
41892
+ width: "var(--n-input-height)",
41893
+ height: "var(--n-input-height)"
41894
+ },
41895
+ icon: compactTabItem.icon,
41896
+ tooltip: compactTabItem.tooltip ?? compactTabItem.title,
41897
+ active: activeTabValue === compactTabItem.value,
41898
+ onClick: () => handleSelectTab(compactTabItem.value)
41899
+ }
41900
+ )),
41877
41901
  /* @__PURE__ */ React311.createElement("div", { className: "n-flex-1 n-flex n-flex-col n-relative n-min-h-0" }, isDrawerOpen && /* @__PURE__ */ React311.createElement("div", { className: "n-absolute n-inset-0 n-z-20 n-flex n-flex-col" }, /* @__PURE__ */ React311.createElement("div", { className: "n-flex-none n-max-h-[50vh] n-overflow-auto n-bg-sidebar-background n-border-b n-border-divider-strong n-shadow-lg" }, activeDrawerPanel), /* @__PURE__ */ React311.createElement(
41878
41902
  "div",
41879
41903
  {
@@ -42668,6 +42692,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
42668
42692
  sideType = "auto",
42669
42693
  sideTypeBreakpoint = 800,
42670
42694
  detectSize = "container",
42695
+ compactDrawerMenu,
42671
42696
  leftOptions: {
42672
42697
  visible: leftVisible = true,
42673
42698
  minSize: leftMinSize = 200,
@@ -42898,6 +42923,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
42898
42923
  autoSavePrefix,
42899
42924
  leftSidebarRef,
42900
42925
  rightSidebarRef,
42926
+ compactDrawerMenu,
42901
42927
  onLeftSidebarStateChange,
42902
42928
  onRightSidebarStateChange,
42903
42929
  shouldAutoSave