@adamosuiteservices/ui 1.7.9 → 1.7.10

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.
@@ -13,7 +13,9 @@ declare function SidebarInset({ className, children, ...props }: PropsWithChildr
13
13
  declare function SidebarTopBar({ className, children, ...props }: PropsWithChildren<ComponentProps<"div">>): import("react/jsx-runtime").JSX.Element;
14
14
  declare function SidebarHeader({ className, children, ...props }: PropsWithChildren<ComponentProps<"header">>): import("react/jsx-runtime").JSX.Element;
15
15
  declare function SidebarFooter({ className, children, ...props }: PropsWithChildren<ComponentProps<"footer">>): import("react/jsx-runtime").JSX.Element;
16
- declare function SidebarMenu({ className, children, ...props }: PropsWithChildren<ComponentProps<"div">>): import("react/jsx-runtime").JSX.Element;
16
+ declare function SidebarMenu({ asChild, className, ...props }: PropsWithChildren<ComponentProps<"div">> & {
17
+ asChild?: boolean;
18
+ }): import("react/jsx-runtime").JSX.Element;
17
19
  declare function SidebarMenuItem({ asChild, className, ...props }: ComponentProps<"button"> & {
18
20
  asChild?: boolean;
19
21
  }): import("react/jsx-runtime").JSX.Element;
package/dist/sidebar.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-BB_1_6y_.cjs"),m=require("react"),p=require("./index-Dbj9vHNq.cjs"),s=require("./index-DoxiiusW.cjs"),o=require("./sheet-CU-sFSaJ.cjs"),h=require("./index-BDs8lUfq.cjs"),S=require("./index-CjyiloO7.cjs"),f=require("./button-DEQVHMrX.cjs"),j=require("./createLucideIcon-CAtnV-yz.cjs");function g(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const x=g(m);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-BB_1_6y_.cjs"),m=require("react"),h=require("./index-Dbj9vHNq.cjs"),s=require("./index-DoxiiusW.cjs"),d=require("./sheet-CU-sFSaJ.cjs"),S=require("./index-BDs8lUfq.cjs"),l=require("./index-CjyiloO7.cjs"),f=require("./button-DEQVHMrX.cjs"),j=require("./createLucideIcon-CAtnV-yz.cjs");function g(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const x=g(m);/**
2
2
  * @license lucide-react v0.546.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const E=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],y=j.createLucideIcon("menu",E);function R(e){const t=x.useCallback(i=>{const d=window.matchMedia(e);return d.addEventListener("change",i),()=>{d.removeEventListener("change",i)}},[e]),a=()=>window.matchMedia(e).matches,n=()=>{throw Error("useMediaQuery is a client-only hook")};return x.useSyncExternalStore(t,a,n)}const l=m.createContext({});function w({children:e}){const[t,a]=m.useState(!1),[n,i]=m.useState("auto"),d=R("(min-width: 1280px)");return r.jsxRuntimeExports.jsx(l.Provider,{value:{isXl:d,sidebarHeight:n,setSidebarHeight:i,sheetOpen:t,setSheetOpen:a},children:r.jsxRuntimeExports.jsx("nav",{"data-slot":"sidebar",children:e})})}function v({className:e,children:t,...a}){const{isXl:n,setSidebarHeight:i,sheetOpen:d,setSheetOpen:b}=c();return r.jsxRuntimeExports.jsx(p.Portal,{children:r.jsxRuntimeExports.jsxs("div",{ref:u=>{u&&i(n?"auto":`${u.clientHeight}px`)},"data-slot":"sidebar-content",className:s.cn("adm:fixed adm:bg-sidebar-primary adm:text-sidebar-primary-foreground adm:xl:flex adm:xl:flex-col","adm:left-0 adm:top-0 adm:right-0","adm:xl:left-0 adm:xl:top-0 adm:xl:bottom-0 adm:xl:w-3xs adm:xl:h-auto",e),...a,children:[n&&t,r.jsxRuntimeExports.jsx(o.Sheet,{open:d,onOpenChange:b,children:r.jsxRuntimeExports.jsxs(o.SheetContent,{showCloseButton:!1,className:"adm:bg-sidebar-primary adm:text-sidebar-primary-foreground adm:border-sidebar-primary adm:rounded-none",children:[r.jsxRuntimeExports.jsx(h.VisuallyHidden,{children:r.jsxRuntimeExports.jsxs(o.SheetHeader,{children:[r.jsxRuntimeExports.jsx(o.SheetTitle,{children:"Sidebar"}),r.jsxRuntimeExports.jsx(o.SheetDescription,{children:"Sidebar"})]})}),t]})})]})})}function M({className:e,...t}){const{setSheetOpen:a}=c();return r.jsxRuntimeExports.jsx(f.Button,{"data-slot":"sidebar-trigger",className:s.cn("adm:xl:hidden",e),onClick:()=>a(n=>!n),...t,children:r.jsxRuntimeExports.jsx(y,{})})}function C({className:e,children:t,...a}){return r.jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-inset",className:s.cn(e,"adm:xl:ml-[256px] adm:xl:mt-auto"),...a,children:t})}function O({className:e,children:t,...a}){return r.jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-top-bar",className:s.cn("adm:sticky adm:z-50 adm:top-0 adm:flex adm:gap-2 adm:items-center adm:justify-between adm:bg-background adm:p-4 adm:border-b",e),...a,children:t})}function N({className:e,children:t,...a}){return r.jsxRuntimeExports.jsx("header",{"data-slot":"sidebar-header",className:s.cn(e,"adm:flex adm:flex-col adm:mt-12"),...a,children:t})}function k({className:e,children:t,...a}){return r.jsxRuntimeExports.jsx("footer",{"data-slot":"sidebar-footer",className:s.cn(e,"adm:mt-auto adm:mb-12 adm:flex adm:flex-col"),...a,children:t})}function H({className:e,children:t,...a}){return r.jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-menu",className:s.cn(e,"adm:flex adm:flex-col adm:gap-4 adm:overflow-y-auto adm:my-12 adm:py-1"),...a,children:t})}function q({asChild:e,className:t,...a}){const n=e?S.Slot:"button";return r.jsxRuntimeExports.jsx(n,{"data-slot":"sidebar-menu-item",className:s.cn(t,"adm:mx-4 adm:flex adm:gap-4 adm:items-center adm:p-4 adm:hover:bg-white/10 adm:rounded-xl adm:transition-all adm:w-[stretch]"),...a})}function c(){const e=m.useContext(l);if(!e)throw new Error("useSidebarContext must be used within a Sidebar component");return e}exports.Sidebar=w;exports.SidebarContent=v;exports.SidebarFooter=k;exports.SidebarHeader=N;exports.SidebarInset=C;exports.SidebarMenu=H;exports.SidebarMenuItem=q;exports.SidebarTopBar=O;exports.SidebarTrigger=M;exports.useSidebarContext=c;
6
+ */const E=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],y=j.createLucideIcon("menu",E);function R(e){const t=x.useCallback(i=>{const o=window.matchMedia(e);return o.addEventListener("change",i),()=>{o.removeEventListener("change",i)}},[e]),a=()=>window.matchMedia(e).matches,n=()=>{throw Error("useMediaQuery is a client-only hook")};return x.useSyncExternalStore(t,a,n)}const b=m.createContext({});function w({children:e}){const[t,a]=m.useState(!1),[n,i]=m.useState("auto"),o=R("(min-width: 1280px)");return r.jsxRuntimeExports.jsx(b.Provider,{value:{isXl:o,sidebarHeight:n,setSidebarHeight:i,sheetOpen:t,setSheetOpen:a},children:r.jsxRuntimeExports.jsx("nav",{"data-slot":"sidebar",children:e})})}function v({className:e,children:t,...a}){const{isXl:n,setSidebarHeight:i,sheetOpen:o,setSheetOpen:p}=c();return r.jsxRuntimeExports.jsx(h.Portal,{children:r.jsxRuntimeExports.jsxs("div",{ref:u=>{u&&i(n?"auto":`${u.clientHeight}px`)},"data-slot":"sidebar-content",className:s.cn("adm:fixed adm:bg-sidebar-primary adm:text-sidebar-primary-foreground adm:xl:flex adm:xl:flex-col","adm:left-0 adm:top-0 adm:right-0","adm:xl:left-0 adm:xl:top-0 adm:xl:bottom-0 adm:xl:w-3xs adm:xl:h-auto",e),...a,children:[n&&t,r.jsxRuntimeExports.jsx(d.Sheet,{open:o,onOpenChange:p,children:r.jsxRuntimeExports.jsxs(d.SheetContent,{showCloseButton:!1,className:"adm:bg-sidebar-primary adm:text-sidebar-primary-foreground adm:border-sidebar-primary adm:rounded-none",children:[r.jsxRuntimeExports.jsx(S.VisuallyHidden,{children:r.jsxRuntimeExports.jsxs(d.SheetHeader,{children:[r.jsxRuntimeExports.jsx(d.SheetTitle,{children:"Sidebar"}),r.jsxRuntimeExports.jsx(d.SheetDescription,{children:"Sidebar"})]})}),t]})})]})})}function C({className:e,...t}){const{setSheetOpen:a}=c();return r.jsxRuntimeExports.jsx(f.Button,{"data-slot":"sidebar-trigger",className:s.cn("adm:xl:hidden",e),onClick:()=>a(n=>!n),...t,children:r.jsxRuntimeExports.jsx(y,{})})}function M({className:e,children:t,...a}){return r.jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-inset",className:s.cn(e,"adm:xl:ml-[256px] adm:xl:mt-auto"),...a,children:t})}function O({className:e,children:t,...a}){return r.jsxRuntimeExports.jsx("div",{"data-slot":"sidebar-top-bar",className:s.cn("adm:sticky adm:z-50 adm:top-0 adm:flex adm:gap-2 adm:items-center adm:justify-between adm:bg-background adm:p-4 adm:border-b",e),...a,children:t})}function N({className:e,children:t,...a}){return r.jsxRuntimeExports.jsx("header",{"data-slot":"sidebar-header",className:s.cn(e,"adm:flex adm:flex-col adm:mt-12"),...a,children:t})}function k({className:e,children:t,...a}){return r.jsxRuntimeExports.jsx("footer",{"data-slot":"sidebar-footer",className:s.cn(e,"adm:mt-auto adm:mb-12 adm:flex adm:flex-col"),...a,children:t})}function H({asChild:e,className:t,...a}){const n=e?l.Slot:"div";return r.jsxRuntimeExports.jsx(n,{"data-slot":"sidebar-menu",className:s.cn(t,"adm:flex adm:flex-col adm:gap-4 adm:overflow-y-auto adm:my-12 adm:py-1"),...a})}function q({asChild:e,className:t,...a}){const n=e?l.Slot:"button";return r.jsxRuntimeExports.jsx(n,{"data-slot":"sidebar-menu-item",className:s.cn(t,"adm:mx-4 adm:flex adm:gap-4 adm:items-center adm:p-4 adm:hover:bg-white/10 adm:rounded-xl adm:transition-all adm:w-[stretch]"),...a})}function c(){const e=m.useContext(b);if(!e)throw new Error("useSidebarContext must be used within a Sidebar component");return e}exports.Sidebar=w;exports.SidebarContent=v;exports.SidebarFooter=k;exports.SidebarHeader=N;exports.SidebarInset=M;exports.SidebarMenu=H;exports.SidebarMenuItem=q;exports.SidebarTopBar=O;exports.SidebarTrigger=C;exports.useSidebarContext=c;
package/dist/sidebar.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { j as r } from "./jsx-runtime-BzflLqGi.js";
2
2
  import * as m from "react";
3
- import { createContext as h, useState as c, useContext as b } from "react";
4
- import { P as p } from "./index-BX9hz-JD.js";
3
+ import { createContext as b, useState as c, useContext as p } from "react";
4
+ import { P as f } from "./index-BX9hz-JD.js";
5
5
  import { c as s } from "./index-CRiPKpXj.js";
6
- import { S as f, c as S, d as g, f as j, g as w } from "./sheet-B-9YHdR5.js";
7
- import { V as y } from "./index-PYkEXTqJ.js";
8
- import { S as v } from "./index-BvLQnI56.js";
6
+ import { S, c as g, d as j, f as w, g as y } from "./sheet-B-9YHdR5.js";
7
+ import { V as v } from "./index-PYkEXTqJ.js";
8
+ import { S as l } from "./index-BvLQnI56.js";
9
9
  import { B as C } from "./button-2GdKenQI.js";
10
10
  import { c as M } from "./createLucideIcon-B_8CJpcQ.js";
11
11
  /**
@@ -20,7 +20,7 @@ const N = [
20
20
  ["path", { d: "M4 19h16", key: "1djgab" }]
21
21
  ], k = M("menu", N);
22
22
  function H(e) {
23
- const a = m.useCallback(
23
+ const t = m.useCallback(
24
24
  (o) => {
25
25
  const n = window.matchMedia(e);
26
26
  return n.addEventListener("change", o), () => {
@@ -28,19 +28,19 @@ function H(e) {
28
28
  };
29
29
  },
30
30
  [e]
31
- ), t = () => window.matchMedia(e).matches, d = () => {
31
+ ), a = () => window.matchMedia(e).matches, d = () => {
32
32
  throw Error("useMediaQuery is a client-only hook");
33
33
  };
34
- return m.useSyncExternalStore(a, t, d);
34
+ return m.useSyncExternalStore(t, a, d);
35
35
  }
36
- const l = h({});
36
+ const u = b({});
37
37
  function V({ children: e }) {
38
- const [a, t] = c(!1), [d, o] = c("auto"), n = H("(min-width: 1280px)");
39
- return /* @__PURE__ */ r.jsx(l.Provider, { value: { isXl: n, sidebarHeight: d, setSidebarHeight: o, sheetOpen: a, setSheetOpen: t }, children: /* @__PURE__ */ r.jsx("nav", { "data-slot": "sidebar", children: e }) });
38
+ const [t, a] = c(!1), [d, o] = c("auto"), n = H("(min-width: 1280px)");
39
+ return /* @__PURE__ */ r.jsx(u.Provider, { value: { isXl: n, sidebarHeight: d, setSidebarHeight: o, sheetOpen: t, setSheetOpen: a }, children: /* @__PURE__ */ r.jsx("nav", { "data-slot": "sidebar", children: e }) });
40
40
  }
41
- function X({ className: e, children: a, ...t }) {
42
- const { isXl: d, setSidebarHeight: o, sheetOpen: n, setSheetOpen: x } = u();
43
- return /* @__PURE__ */ r.jsx(p, { children: /* @__PURE__ */ r.jsxs(
41
+ function X({ className: e, children: t, ...a }) {
42
+ const { isXl: d, setSidebarHeight: o, sheetOpen: n, setSheetOpen: h } = x();
43
+ return /* @__PURE__ */ r.jsx(f, { children: /* @__PURE__ */ r.jsxs(
44
44
  "div",
45
45
  {
46
46
  ref: (i) => {
@@ -53,85 +53,85 @@ function X({ className: e, children: a, ...t }) {
53
53
  "adm:xl:left-0 adm:xl:top-0 adm:xl:bottom-0 adm:xl:w-3xs adm:xl:h-auto",
54
54
  e
55
55
  ),
56
- ...t,
56
+ ...a,
57
57
  children: [
58
- d && a,
59
- /* @__PURE__ */ r.jsx(f, { open: n, onOpenChange: x, children: /* @__PURE__ */ r.jsxs(S, { showCloseButton: !1, className: "adm:bg-sidebar-primary adm:text-sidebar-primary-foreground adm:border-sidebar-primary adm:rounded-none", children: [
60
- /* @__PURE__ */ r.jsx(y, { children: /* @__PURE__ */ r.jsxs(g, { children: [
61
- /* @__PURE__ */ r.jsx(j, { children: "Sidebar" }),
62
- /* @__PURE__ */ r.jsx(w, { children: "Sidebar" })
58
+ d && t,
59
+ /* @__PURE__ */ r.jsx(S, { open: n, onOpenChange: h, children: /* @__PURE__ */ r.jsxs(g, { showCloseButton: !1, className: "adm:bg-sidebar-primary adm:text-sidebar-primary-foreground adm:border-sidebar-primary adm:rounded-none", children: [
60
+ /* @__PURE__ */ r.jsx(v, { children: /* @__PURE__ */ r.jsxs(j, { children: [
61
+ /* @__PURE__ */ r.jsx(w, { children: "Sidebar" }),
62
+ /* @__PURE__ */ r.jsx(y, { children: "Sidebar" })
63
63
  ] }) }),
64
- a
64
+ t
65
65
  ] }) })
66
66
  ]
67
67
  }
68
68
  ) });
69
69
  }
70
- function _({ className: e, ...a }) {
71
- const { setSheetOpen: t } = u();
72
- return /* @__PURE__ */ r.jsx(C, { "data-slot": "sidebar-trigger", className: s("adm:xl:hidden", e), onClick: () => t((d) => !d), ...a, children: /* @__PURE__ */ r.jsx(k, {}) });
70
+ function _({ className: e, ...t }) {
71
+ const { setSheetOpen: a } = x();
72
+ return /* @__PURE__ */ r.jsx(C, { "data-slot": "sidebar-trigger", className: s("adm:xl:hidden", e), onClick: () => a((d) => !d), ...t, children: /* @__PURE__ */ r.jsx(k, {}) });
73
73
  }
74
- function z({ className: e, children: a, ...t }) {
74
+ function z({ className: e, children: t, ...a }) {
75
75
  return /* @__PURE__ */ r.jsx(
76
76
  "div",
77
77
  {
78
78
  "data-slot": "sidebar-inset",
79
79
  className: s(e, "adm:xl:ml-[256px] adm:xl:mt-auto"),
80
- ...t,
81
- children: a
80
+ ...a,
81
+ children: t
82
82
  }
83
83
  );
84
84
  }
85
- function D({ className: e, children: a, ...t }) {
85
+ function D({ className: e, children: t, ...a }) {
86
86
  return /* @__PURE__ */ r.jsx(
87
87
  "div",
88
88
  {
89
89
  "data-slot": "sidebar-top-bar",
90
90
  className: s("adm:sticky adm:z-50 adm:top-0 adm:flex adm:gap-2 adm:items-center adm:justify-between adm:bg-background adm:p-4 adm:border-b", e),
91
- ...t,
92
- children: a
91
+ ...a,
92
+ children: t
93
93
  }
94
94
  );
95
95
  }
96
- function F({ className: e, children: a, ...t }) {
96
+ function F({ className: e, children: t, ...a }) {
97
97
  return /* @__PURE__ */ r.jsx(
98
98
  "header",
99
99
  {
100
100
  "data-slot": "sidebar-header",
101
101
  className: s(e, "adm:flex adm:flex-col adm:mt-12"),
102
- ...t,
103
- children: a
102
+ ...a,
103
+ children: t
104
104
  }
105
105
  );
106
106
  }
107
- function $({ className: e, children: a, ...t }) {
107
+ function $({ className: e, children: t, ...a }) {
108
108
  return /* @__PURE__ */ r.jsx(
109
109
  "footer",
110
110
  {
111
111
  "data-slot": "sidebar-footer",
112
112
  className: s(e, "adm:mt-auto adm:mb-12 adm:flex adm:flex-col"),
113
- ...t,
114
- children: a
113
+ ...a,
114
+ children: t
115
115
  }
116
116
  );
117
117
  }
118
- function A({ className: e, children: a, ...t }) {
118
+ function A({ asChild: e, className: t, ...a }) {
119
+ const d = e ? l : "div";
119
120
  return /* @__PURE__ */ r.jsx(
120
- "div",
121
+ d,
121
122
  {
122
123
  "data-slot": "sidebar-menu",
123
- className: s(e, "adm:flex adm:flex-col adm:gap-4 adm:overflow-y-auto adm:my-12 adm:py-1"),
124
- ...t,
125
- children: a
124
+ className: s(t, "adm:flex adm:flex-col adm:gap-4 adm:overflow-y-auto adm:my-12 adm:py-1"),
125
+ ...a
126
126
  }
127
127
  );
128
128
  }
129
- function G({ asChild: e, className: a, ...t }) {
130
- const d = e ? v : "button";
131
- return /* @__PURE__ */ r.jsx(d, { "data-slot": "sidebar-menu-item", className: s(a, "adm:mx-4 adm:flex adm:gap-4 adm:items-center adm:p-4 adm:hover:bg-white/10 adm:rounded-xl adm:transition-all adm:w-[stretch]"), ...t });
129
+ function G({ asChild: e, className: t, ...a }) {
130
+ const d = e ? l : "button";
131
+ return /* @__PURE__ */ r.jsx(d, { "data-slot": "sidebar-menu-item", className: s(t, "adm:mx-4 adm:flex adm:gap-4 adm:items-center adm:p-4 adm:hover:bg-white/10 adm:rounded-xl adm:transition-all adm:w-[stretch]"), ...a });
132
132
  }
133
- function u() {
134
- const e = b(l);
133
+ function x() {
134
+ const e = p(u);
135
135
  if (!e)
136
136
  throw new Error("useSidebarContext must be used within a Sidebar component");
137
137
  return e;
@@ -146,5 +146,5 @@ export {
146
146
  G as SidebarMenuItem,
147
147
  D as SidebarTopBar,
148
148
  _ as SidebarTrigger,
149
- u as useSidebarContext
149
+ x as useSidebarContext
150
150
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamosuiteservices/ui",
3
- "version": "1.7.9",
3
+ "version": "1.7.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",