@adamosuiteservices/ui 1.3.5 → 1.4.5
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/components/layout/sidebar/sidebar.d.ts +7 -3
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts +2 -2
- package/dist/components/ui/input-group/input-group.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +1 -1
- package/dist/components/ui/typography/typography.d.ts +1 -1
- package/dist/custom-layered-styles.css +1 -1
- package/dist/sidebar.cjs +2 -2
- package/dist/sidebar.js +89 -78
- package/dist/styles.css +1 -1
- package/docs/components/layout/sidebar.md +145 -71
- package/package.json +1 -1
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"),
|
|
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);/**
|
|
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
|
|
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 v({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 w({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: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"),...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=v;exports.SidebarContent=w;exports.SidebarFooter=k;exports.SidebarHeader=N;exports.SidebarInset=C;exports.SidebarMenu=H;exports.SidebarMenuItem=q;exports.SidebarTopBar=O;exports.SidebarTrigger=M;exports.useSidebarContext=c;
|
package/dist/sidebar.js
CHANGED
|
@@ -1,139 +1,150 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { P as
|
|
1
|
+
import { j as r } from "./jsx-runtime-BzflLqGi.js";
|
|
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";
|
|
5
5
|
import { c as s } from "./index-CRiPKpXj.js";
|
|
6
|
-
import { S as
|
|
7
|
-
import { V as
|
|
8
|
-
import { S as
|
|
9
|
-
import {
|
|
6
|
+
import { S as f, c as S, d as g, f as j, g as y } from "./sheet-UZWAbdXr.js";
|
|
7
|
+
import { V as w } from "./index-PYkEXTqJ.js";
|
|
8
|
+
import { S as v } from "./index-BvLQnI56.js";
|
|
9
|
+
import { B as C } from "./button-2GdKenQI.js";
|
|
10
|
+
import { c as M } from "./createLucideIcon-B_8CJpcQ.js";
|
|
10
11
|
/**
|
|
11
12
|
* @license lucide-react v0.546.0 - ISC
|
|
12
13
|
*
|
|
13
14
|
* This source code is licensed under the ISC license.
|
|
14
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
16
|
*/
|
|
16
|
-
const
|
|
17
|
+
const N = [
|
|
17
18
|
["path", { d: "M4 5h16", key: "1tepv9" }],
|
|
18
19
|
["path", { d: "M4 12h16", key: "1lakjw" }],
|
|
19
20
|
["path", { d: "M4 19h16", key: "1djgab" }]
|
|
20
|
-
],
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
(
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
|
|
21
|
+
], k = M("menu", N);
|
|
22
|
+
function H(e) {
|
|
23
|
+
const a = m.useCallback(
|
|
24
|
+
(o) => {
|
|
25
|
+
const n = window.matchMedia(e);
|
|
26
|
+
return n.addEventListener("change", o), () => {
|
|
27
|
+
n.removeEventListener("change", o);
|
|
27
28
|
};
|
|
28
29
|
},
|
|
29
30
|
[e]
|
|
30
|
-
),
|
|
31
|
+
), t = () => window.matchMedia(e).matches, d = () => {
|
|
31
32
|
throw Error("useMediaQuery is a client-only hook");
|
|
32
33
|
};
|
|
33
|
-
return
|
|
34
|
+
return m.useSyncExternalStore(a, t, d);
|
|
34
35
|
}
|
|
35
|
-
const
|
|
36
|
-
function
|
|
37
|
-
const [t,
|
|
38
|
-
return /* @__PURE__ */
|
|
36
|
+
const l = h({});
|
|
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 }) });
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
const { isXl: d, setSidebarHeight:
|
|
42
|
-
return /* @__PURE__ */
|
|
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(
|
|
43
44
|
"div",
|
|
44
45
|
{
|
|
45
|
-
ref: (
|
|
46
|
-
|
|
46
|
+
ref: (i) => {
|
|
47
|
+
i && o(d ? "auto" : `${i.clientHeight}px`);
|
|
47
48
|
},
|
|
48
49
|
"data-slot": "sidebar-content",
|
|
49
|
-
className: s(
|
|
50
|
+
className: s(
|
|
50
51
|
"adm:fixed adm:bg-sidebar-primary adm:text-sidebar-primary-foreground adm:xl:flex adm:xl:flex-col",
|
|
51
52
|
"adm:left-0 adm:top-0 adm:right-0",
|
|
52
|
-
"adm:xl:left-0 adm:xl:top-0 adm:xl:bottom-0 adm:xl:w-3xs adm:xl:h-auto"
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
"adm:xl:left-0 adm:xl:top-0 adm:xl:bottom-0 adm:xl:w-3xs adm:xl:h-auto",
|
|
54
|
+
e
|
|
55
|
+
),
|
|
56
|
+
...t,
|
|
55
57
|
children: [
|
|
56
|
-
d &&
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
] }),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */ a.jsx(g, { children: "Sidebar" }),
|
|
65
|
-
/* @__PURE__ */ a.jsx(j, { children: "Sidebar" })
|
|
66
|
-
] }) }),
|
|
67
|
-
t
|
|
68
|
-
] })
|
|
69
|
-
] })
|
|
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(w, { children: /* @__PURE__ */ r.jsxs(g, { children: [
|
|
61
|
+
/* @__PURE__ */ r.jsx(j, { children: "Sidebar" }),
|
|
62
|
+
/* @__PURE__ */ r.jsx(y, { children: "Sidebar" })
|
|
63
|
+
] }) }),
|
|
64
|
+
a
|
|
65
|
+
] }) })
|
|
70
66
|
]
|
|
71
67
|
}
|
|
72
68
|
) });
|
|
73
69
|
}
|
|
74
|
-
function
|
|
75
|
-
const {
|
|
76
|
-
return /* @__PURE__ */ a.jsx(
|
|
77
|
-
|
|
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, {}) });
|
|
73
|
+
}
|
|
74
|
+
function D({ className: e, children: a, ...t }) {
|
|
75
|
+
return /* @__PURE__ */ r.jsx(
|
|
76
|
+
"div",
|
|
78
77
|
{
|
|
79
78
|
"data-slot": "sidebar-inset",
|
|
80
79
|
className: s(e, "adm:xl:ml-[256px] adm:xl:mt-auto"),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
...t,
|
|
81
|
+
children: a
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
function F({ className: e, children: a, ...t }) {
|
|
86
|
+
return /* @__PURE__ */ r.jsx(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
"data-slot": "sidebar-top-bar",
|
|
90
|
+
className: s("adm:sticky 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
|
|
84
93
|
}
|
|
85
94
|
);
|
|
86
95
|
}
|
|
87
|
-
function
|
|
88
|
-
return /* @__PURE__ */
|
|
96
|
+
function $({ className: e, children: a, ...t }) {
|
|
97
|
+
return /* @__PURE__ */ r.jsx(
|
|
89
98
|
"header",
|
|
90
99
|
{
|
|
91
100
|
"data-slot": "sidebar-header",
|
|
92
101
|
className: s(e, "adm:flex adm:flex-col adm:mt-12"),
|
|
93
|
-
...
|
|
94
|
-
children:
|
|
102
|
+
...t,
|
|
103
|
+
children: a
|
|
95
104
|
}
|
|
96
105
|
);
|
|
97
106
|
}
|
|
98
|
-
function
|
|
99
|
-
return /* @__PURE__ */
|
|
107
|
+
function z({ className: e, children: a, ...t }) {
|
|
108
|
+
return /* @__PURE__ */ r.jsx(
|
|
100
109
|
"footer",
|
|
101
110
|
{
|
|
102
111
|
"data-slot": "sidebar-footer",
|
|
103
112
|
className: s(e, "adm:mt-auto adm:mb-12 adm:flex adm:flex-col"),
|
|
104
|
-
...
|
|
105
|
-
children:
|
|
113
|
+
...t,
|
|
114
|
+
children: a
|
|
106
115
|
}
|
|
107
116
|
);
|
|
108
117
|
}
|
|
109
|
-
function
|
|
110
|
-
return /* @__PURE__ */
|
|
118
|
+
function A({ className: e, children: a, ...t }) {
|
|
119
|
+
return /* @__PURE__ */ r.jsx(
|
|
111
120
|
"div",
|
|
112
121
|
{
|
|
113
122
|
"data-slot": "sidebar-menu",
|
|
114
123
|
className: s(e, "adm:flex adm:flex-col adm:gap-4 adm:overflow-y-auto adm:my-12 adm:py-1"),
|
|
115
|
-
...
|
|
116
|
-
children:
|
|
124
|
+
...t,
|
|
125
|
+
children: a
|
|
117
126
|
}
|
|
118
127
|
);
|
|
119
128
|
}
|
|
120
|
-
function
|
|
121
|
-
const d = e ?
|
|
122
|
-
return /* @__PURE__ */
|
|
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"), ...t });
|
|
123
132
|
}
|
|
124
|
-
function
|
|
125
|
-
const e =
|
|
133
|
+
function u() {
|
|
134
|
+
const e = b(l);
|
|
126
135
|
if (!e)
|
|
127
|
-
throw new Error("useSidebarContext must be used within a
|
|
136
|
+
throw new Error("useSidebarContext must be used within a Sidebar component");
|
|
128
137
|
return e;
|
|
129
138
|
}
|
|
130
139
|
export {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
V as Sidebar,
|
|
141
|
+
X as SidebarContent,
|
|
142
|
+
z as SidebarFooter,
|
|
143
|
+
$ as SidebarHeader,
|
|
144
|
+
D as SidebarInset,
|
|
145
|
+
A as SidebarMenu,
|
|
146
|
+
G as SidebarMenuItem,
|
|
147
|
+
F as SidebarTopBar,
|
|
148
|
+
_ as SidebarTrigger,
|
|
149
|
+
u as useSidebarContext
|
|
139
150
|
};
|