prime-ui-kit 0.4.0 → 0.4.1

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.js CHANGED
@@ -104,9 +104,7 @@ function toDataAttributes(input) {
104
104
  var AppShell_default = {
105
105
  layoutRoot: "AppShell_layoutRoot",
106
106
  layoutMain: "AppShell_layoutMain",
107
- layoutNav: "AppShell_layoutNav",
108
- layoutMainSurface: "AppShell_layoutMainSurface",
109
- layoutMainPage: "AppShell_layoutMainPage"
107
+ layoutNav: "AppShell_layoutNav"
110
108
  };
111
109
 
112
110
  // src/layout/app-shell/AppShell.tsx
@@ -128,7 +126,7 @@ function AppShellNav({ className, children, ...rest }) {
128
126
  return /* @__PURE__ */ jsx4("div", { className: cx(AppShell_default.layoutNav, className), "data-layout-region": "nav", ...rest, children });
129
127
  }
130
128
  AppShellNav.displayName = "AppShell.Nav";
131
- var AppShellMain = React4.forwardRef(function AppShellMain2({ variant = "plain", className, children, ...rest }, forwardedRef) {
129
+ var AppShellMain = React4.forwardRef(function AppShellMain2({ className, children, ...rest }, forwardedRef) {
132
130
  return /* @__PURE__ */ jsx4(
133
131
  ScrollContainer,
134
132
  {
@@ -136,12 +134,7 @@ var AppShellMain = React4.forwardRef(function AppShellMain2({ variant = "plain",
136
134
  ref: forwardedRef,
137
135
  axis: "vertical",
138
136
  overscrollBehavior: "contain",
139
- className: cx(
140
- AppShell_default.layoutMain,
141
- variant === "surface" && AppShell_default.layoutMainSurface,
142
- variant === "page" && AppShell_default.layoutMainPage,
143
- className
144
- ),
137
+ className: cx(AppShell_default.layoutMain, className),
145
138
  "data-layout-region": "main",
146
139
  ...rest,
147
140
  children
@@ -178,9 +171,9 @@ var AppShell = {
178
171
  import {
179
172
  ChevronsUpDown,
180
173
  PanelLeftClose,
181
- PanelLeftOpen as PanelLeftOpen2,
174
+ PanelLeftOpen,
182
175
  PanelRightClose,
183
- PanelRightOpen as PanelRightOpen2
176
+ PanelRightOpen
184
177
  } from "lucide-react";
185
178
  import * as React17 from "react";
186
179
  import { NavLink } from "react-router-dom";
@@ -560,6 +553,7 @@ var Sidebar_default = {
560
553
  navArea: "Sidebar_navArea",
561
554
  backdrop: "Sidebar_backdrop",
562
555
  navPanel: "Sidebar_navPanel",
556
+ navPanelSurface: "Sidebar_navPanelSurface",
563
557
  header: "Sidebar_header",
564
558
  headerRow: "Sidebar_headerRow",
565
559
  headerMain: "Sidebar_headerMain",
@@ -597,15 +591,12 @@ var Sidebar_default = {
597
591
  navCategoryTrigger: "Sidebar_navCategoryTrigger",
598
592
  navCategoryLabel: "Sidebar_navCategoryLabel",
599
593
  navCategoryCount: "Sidebar_navCategoryCount",
600
- navCategoryPanel: "Sidebar_navCategoryPanel",
601
- floatingToggle: "Sidebar_floatingToggle"
594
+ navCategoryPanel: "Sidebar_navCategoryPanel"
602
595
  };
603
596
 
604
597
  // src/layout/sidebar/SidebarRoot.tsx
605
598
  import { animate, useMotionValue, useMotionValueEvent, useReducedMotion } from "framer-motion";
606
- import { PanelLeftOpen, PanelRightOpen } from "lucide-react";
607
599
  import * as React16 from "react";
608
- import { createPortal as createPortal2 } from "react-dom";
609
600
 
610
601
  // src/hooks/useEscapeKey.ts
611
602
  import * as React13 from "react";
@@ -870,21 +861,11 @@ var SidebarRoot = React16.forwardRef(function SidebarRoot2({
870
861
  if (root == null) return;
871
862
  root.style.setProperty("--sb-progress", value.toString());
872
863
  });
873
- const [floatingPortalReady, setFloatingPortalReady] = React16.useState(false);
874
- React16.useLayoutEffect(() => {
875
- setFloatingPortalReady(true);
876
- }, []);
877
- const showFloatingToggle = Boolean(responsive) && isMobile && !openState;
878
864
  const closeMobile = React16.useCallback(() => {
879
865
  setLayoutState("hidden");
880
866
  }, [setLayoutState]);
881
867
  const navAreaRef = useOverlayModal(mobileOpen, closeMobile);
882
868
  const navPanelId = React16.useId();
883
- const floatingToggleLabel = side === "left" ? "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0430\u0439\u0434\u0431\u0430\u0440" : "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0430\u0439\u0434\u0431\u0430\u0440 \u0441\u043F\u0440\u0430\u0432\u0430";
884
- const floatingToggleIcon = side === "left" ? /* @__PURE__ */ jsx9(PanelLeftOpen, { size: "1em" }) : /* @__PURE__ */ jsx9(PanelRightOpen, { size: "1em" });
885
- const onFloatingToggleClick = React16.useCallback(() => {
886
- setLayoutState("expanded");
887
- }, [setLayoutState]);
888
869
  const contextValue = React16.useMemo(
889
870
  () => ({
890
871
  size,
@@ -901,7 +882,7 @@ var SidebarRoot = React16.forwardRef(function SidebarRoot2({
901
882
  }),
902
883
  [isMobile, layoutState, navPanelId, openState, setOpen, setState, side, size, toggleOpen]
903
884
  );
904
- return /* @__PURE__ */ jsx9(SidebarProvider, { value: contextValue, children: /* @__PURE__ */ jsxs2(
885
+ return /* @__PURE__ */ jsx9(SidebarProvider, { value: contextValue, children: /* @__PURE__ */ jsx9(
905
886
  "aside",
906
887
  {
907
888
  ...rest,
@@ -920,37 +901,20 @@ var SidebarRoot = React16.forwardRef(function SidebarRoot2({
920
901
  "sidebar-mode": layoutState,
921
902
  "sidebar-root": true
922
903
  }),
923
- children: [
924
- /* @__PURE__ */ jsxs2("div", { ref: navAreaRef, className: Sidebar_default.navArea, children: [
925
- /* @__PURE__ */ jsx9(
926
- "button",
927
- {
928
- type: "button",
929
- className: Sidebar_default.backdrop,
930
- "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0441\u0430\u0439\u0434\u0431\u0430\u0440",
931
- onClick: closeMobile,
932
- tabIndex: mobileOpen ? 0 : -1,
933
- "aria-hidden": mobileOpen ? void 0 : true
934
- }
935
- ),
936
- children
937
- ] }),
938
- showFloatingToggle && floatingPortalReady && typeof document !== "undefined" ? createPortal2(
939
- /* @__PURE__ */ jsx9(
940
- "button",
941
- {
942
- type: "button",
943
- className: Sidebar_default.floatingToggle,
944
- onClick: onFloatingToggleClick,
945
- "aria-label": floatingToggleLabel,
946
- "aria-controls": navPanelId,
947
- "data-side": side,
948
- children: /* @__PURE__ */ jsx9("span", { className: Sidebar_default.menuIcon, "aria-hidden": "true", children: floatingToggleIcon })
949
- }
950
- ),
951
- document.body
952
- ) : null
953
- ]
904
+ children: /* @__PURE__ */ jsxs2("div", { ref: navAreaRef, className: Sidebar_default.navArea, children: [
905
+ /* @__PURE__ */ jsx9(
906
+ "button",
907
+ {
908
+ type: "button",
909
+ className: Sidebar_default.backdrop,
910
+ "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0441\u0430\u0439\u0434\u0431\u0430\u0440",
911
+ onClick: closeMobile,
912
+ tabIndex: mobileOpen ? 0 : -1,
913
+ "aria-hidden": mobileOpen ? void 0 : true
914
+ }
915
+ ),
916
+ children
917
+ ] })
954
918
  }
955
919
  ) });
956
920
  });
@@ -961,9 +925,9 @@ import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
961
925
  var SidebarComposedRoot = SidebarRoot;
962
926
  function iconForToggle(state, side) {
963
927
  if (side === "left") {
964
- return state === "hidden" ? /* @__PURE__ */ jsx10(PanelLeftOpen2, { size: "1em" }) : /* @__PURE__ */ jsx10(PanelLeftClose, { size: "1em" });
928
+ return state === "hidden" ? /* @__PURE__ */ jsx10(PanelLeftOpen, { size: "1em" }) : /* @__PURE__ */ jsx10(PanelLeftClose, { size: "1em" });
965
929
  }
966
- return state === "hidden" ? /* @__PURE__ */ jsx10(PanelRightOpen2, { size: "1em" }) : /* @__PURE__ */ jsx10(PanelRightClose, { size: "1em" });
930
+ return state === "hidden" ? /* @__PURE__ */ jsx10(PanelRightOpen, { size: "1em" }) : /* @__PURE__ */ jsx10(PanelRightClose, { size: "1em" });
967
931
  }
968
932
  var SidebarToggleButton = React17.forwardRef(
969
933
  ({
@@ -1005,19 +969,18 @@ function SidebarNavPanel({
1005
969
  children,
1006
970
  ...rest
1007
971
  }) {
1008
- const { navPanelId, isMobile, state } = useSidebarContext();
1009
- const showEdgeToggle = showToggle && !(isMobile && state === "hidden");
1010
- return /* @__PURE__ */ jsxs3(
972
+ const { navPanelId } = useSidebarContext();
973
+ return /* @__PURE__ */ jsx10(
1011
974
  "nav",
1012
975
  {
1013
976
  ...rest,
1014
977
  id: id ?? navPanelId,
1015
978
  className: cx(Sidebar_default.navPanel, className),
1016
979
  "aria-label": rest["aria-label"] ?? "Sidebar navigation",
1017
- children: [
980
+ children: /* @__PURE__ */ jsxs3("div", { className: Sidebar_default.navPanelSurface, children: [
1018
981
  children,
1019
- showEdgeToggle ? /* @__PURE__ */ jsx10(SidebarToggleButton, { placement: "edge" }) : null
1020
- ]
982
+ showToggle ? /* @__PURE__ */ jsx10(SidebarToggleButton, { placement: "edge" }) : null
983
+ ] })
1021
984
  }
1022
985
  );
1023
986
  }