@kopexa/sidebar 17.2.0 → 17.3.0

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
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-FPVGSRAX.mjs";
24
24
  import {
25
25
  SidebarV2
26
- } from "./chunk-WA2NSEYE.mjs";
26
+ } from "./chunk-6H2EH7LL.mjs";
27
27
  import {
28
28
  AppShell,
29
29
  AppShellAside,
@@ -31,10 +31,10 @@ import {
31
31
  AppShellMain,
32
32
  AppShellPanelContent,
33
33
  AppShellRoot
34
- } from "./chunk-PZFEB2PM.mjs";
34
+ } from "./chunk-WIP5GNGJ.mjs";
35
35
  import {
36
36
  SidebarV2FromConfig
37
- } from "./chunk-CMYTESJM.mjs";
37
+ } from "./chunk-G2J7EJQ6.mjs";
38
38
  import {
39
39
  SidebarV2Inset,
40
40
  SidebarV2Panel,
@@ -48,12 +48,12 @@ import {
48
48
  SidebarV2RailSpacer,
49
49
  SidebarV2Trigger,
50
50
  SidebarV2Workspace
51
- } from "./chunk-EIXUCY5M.mjs";
52
- import "./chunk-SDMGFB6V.mjs";
51
+ } from "./chunk-5VE25P3M.mjs";
53
52
  import {
54
53
  SidebarV2Provider,
55
54
  useSidebarV2
56
- } from "./chunk-3L2F566G.mjs";
55
+ } from "./chunk-XBTONQ3L.mjs";
56
+ import "./chunk-BFZFZSUC.mjs";
57
57
  export {
58
58
  AppShell,
59
59
  AppShellAside,
@@ -30,12 +30,12 @@ __export(app_shell_exports, {
30
30
  AppShellRoot: () => AppShellRoot
31
31
  });
32
32
  module.exports = __toCommonJS(app_shell_exports);
33
- var import_shared_utils = require("@kopexa/shared-utils");
34
33
  var import_react2 = require("react");
35
34
  var import_react_dom = require("react-dom");
36
35
 
37
36
  // src/v2/context.tsx
38
37
  var import_react_utils = require("@kopexa/react-utils");
38
+ var import_theme = require("@kopexa/theme");
39
39
  var import_tooltip = require("@kopexa/tooltip");
40
40
  var import_use_is_mobile = require("@kopexa/use-is-mobile");
41
41
  var import_react = require("react");
@@ -56,17 +56,13 @@ function AppShellRoot({
56
56
  children,
57
57
  ...props
58
58
  }) {
59
- const { tone } = useSidebarV2();
59
+ const { tone, styles } = useSidebarV2();
60
60
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
61
61
  "div",
62
62
  {
63
63
  "data-slot": "app-shell",
64
64
  "data-tone": tone,
65
- className: (0, import_shared_utils.cn)(
66
- "relative isolate grid h-svh w-full overflow-hidden antialiased",
67
- tone === "light" ? "bg-muted text-foreground" : "bg-sidebar text-sidebar-foreground",
68
- className
69
- ),
65
+ className: styles.shell({ className }),
70
66
  style: {
71
67
  "--kpx-rail-width": RAIL_WIDTH,
72
68
  "--kpx-panel-width": PANEL_WIDTH,
@@ -85,26 +81,24 @@ function AppShellHeader({
85
81
  style,
86
82
  ...props
87
83
  }) {
84
+ const { styles } = useSidebarV2();
88
85
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
89
86
  "header",
90
87
  {
91
88
  "data-slot": "app-shell-header",
92
- className: (0, import_shared_utils.cn)("z-20 flex h-14 items-center gap-3 px-2", className),
89
+ className: styles.header({ className }),
93
90
  style: { gridArea: "header", ...style },
94
91
  ...props
95
92
  }
96
93
  );
97
94
  }
98
95
  function AppShellMain({ className, style, ...props }) {
96
+ const { styles } = useSidebarV2();
99
97
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
100
98
  "main",
101
99
  {
102
100
  "data-slot": "app-shell-main",
103
- className: (0, import_shared_utils.cn)(
104
- "relative flex min-h-0 min-w-0 flex-col overflow-hidden bg-background",
105
- "m-2 rounded-xl shadow-sm",
106
- className
107
- ),
101
+ className: styles.main({ className }),
108
102
  style: { gridArea: "main", ...style },
109
103
  ...props
110
104
  }
@@ -115,11 +109,12 @@ function AppShellAside({
115
109
  style,
116
110
  ...props
117
111
  }) {
112
+ const { styles } = useSidebarV2();
118
113
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
119
114
  "aside",
120
115
  {
121
116
  "data-slot": "app-shell-aside",
122
- className: (0, import_shared_utils.cn)("min-h-0 min-w-0 overflow-hidden", className),
117
+ className: styles.aside({ className }),
123
118
  style: { gridArea: "aside", ...style },
124
119
  ...props
125
120
  }
@@ -7,8 +7,9 @@ import {
7
7
  AppShellMain,
8
8
  AppShellPanelContent,
9
9
  AppShellRoot
10
- } from "../chunk-PZFEB2PM.mjs";
11
- import "../chunk-3L2F566G.mjs";
10
+ } from "../chunk-WIP5GNGJ.mjs";
11
+ import "../chunk-XBTONQ3L.mjs";
12
+ import "../chunk-BFZFZSUC.mjs";
12
13
  export {
13
14
  AppShell,
14
15
  AppShellAside,
@@ -65,10 +65,16 @@ declare function SidebarV2PanelLeaf({ item, active: activeProp, }: {
65
65
  /** Override the derived active state (e.g. for custom page routing rules). */
66
66
  active?: boolean;
67
67
  }): react_jsx_runtime.JSX.Element;
68
- declare function SidebarV2PanelGroup({ item, }: {
68
+ declare function SidebarV2PanelGroup({ item, winningHref, }: {
69
69
  item: Extract<SidebarV2PanelItem, {
70
70
  children: unknown;
71
71
  }>;
72
+ /**
73
+ * Panel-level winning href (most-specific match across all sibling items).
74
+ * Provided by <SidebarV2PanelItems> so a sibling leaf can out-rank our children.
75
+ * Omit for standalone use — then the best child among our own is computed.
76
+ */
77
+ winningHref?: string | null;
72
78
  }): react_jsx_runtime.JSX.Element;
73
79
  declare function SidebarV2PanelItems({ items, }: {
74
80
  items: SidebarV2PanelItem[];
@@ -65,10 +65,16 @@ declare function SidebarV2PanelLeaf({ item, active: activeProp, }: {
65
65
  /** Override the derived active state (e.g. for custom page routing rules). */
66
66
  active?: boolean;
67
67
  }): react_jsx_runtime.JSX.Element;
68
- declare function SidebarV2PanelGroup({ item, }: {
68
+ declare function SidebarV2PanelGroup({ item, winningHref, }: {
69
69
  item: Extract<SidebarV2PanelItem, {
70
70
  children: unknown;
71
71
  }>;
72
+ /**
73
+ * Panel-level winning href (most-specific match across all sibling items).
74
+ * Provided by <SidebarV2PanelItems> so a sibling leaf can out-rank our children.
75
+ * Omit for standalone use — then the best child among our own is computed.
76
+ */
77
+ winningHref?: string | null;
72
78
  }): react_jsx_runtime.JSX.Element;
73
79
  declare function SidebarV2PanelItems({ items, }: {
74
80
  items: SidebarV2PanelItem[];