@warmio/ui 1.0.0 → 1.1.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/README.md +16 -1
- package/dist/button.js +10 -0
- package/dist/chunks/chunk-D25QMXJR.js +85 -0
- package/dist/chunks/chunk-KCEDMF2I.js +124 -0
- package/dist/chunks/chunk-OWDC2VC6.js +135 -0
- package/dist/chunks/{chunk-EJ2CNGRW.js → chunk-PBTUB66J.js} +135 -242
- package/dist/chunks/chunk-SK7IZUFC.js +333 -0
- package/dist/chunks/chunk-T2TXMN3G.js +74 -0
- package/dist/chunks/{chunk-HMXXCKZG.js → chunk-VNQVIATP.js} +4 -4
- package/dist/chunks/chunk-ZEDHNFX6.js +92 -0
- package/dist/dropdown-menu.js +28 -0
- package/dist/index.js +63 -2
- package/dist/logo.js +1 -1
- package/dist/sheet.js +24 -0
- package/dist/sidebar.js +7 -1
- package/dist/text.js +9 -0
- package/package.json +23 -2
- package/types/button.d.ts +48 -0
- package/types/dropdown-menu.d.ts +54 -0
- package/types/index.d.ts +4 -0
- package/types/sheet.d.ts +40 -0
- package/types/sidebar.d.ts +26 -3
- package/types/text.d.ts +36 -0
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Sheet,
|
|
3
|
+
SheetContent,
|
|
4
|
+
SheetDescription,
|
|
5
|
+
SheetHeader,
|
|
6
|
+
SheetTitle
|
|
7
|
+
} from "./chunk-OWDC2VC6.js";
|
|
1
8
|
import {
|
|
2
9
|
cn
|
|
3
10
|
} from "./chunk-VIB7OX7D.js";
|
|
4
11
|
|
|
5
|
-
// ../ui/src/
|
|
12
|
+
// ../ui/src/warmio/sidebar.tsx
|
|
6
13
|
import * as React6 from "react";
|
|
7
|
-
|
|
14
|
+
|
|
15
|
+
// ../ui/src/components/sidebar.tsx
|
|
16
|
+
import * as React4 from "react";
|
|
17
|
+
import { cva } from "class-variance-authority";
|
|
8
18
|
|
|
9
19
|
// ../ui/src/hooks/use-mobile.ts
|
|
10
20
|
import * as React from "react";
|
|
@@ -51,184 +61,16 @@ function RenderSlot({
|
|
|
51
61
|
});
|
|
52
62
|
}
|
|
53
63
|
|
|
54
|
-
// ../ui/src/components/button.tsx
|
|
55
|
-
import * as React3 from "react";
|
|
56
|
-
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
57
|
-
|
|
58
|
-
// ../ui/src/components/button.variants.ts
|
|
59
|
-
import { cva } from "class-variance-authority";
|
|
60
|
-
var buttonVariants = cva(
|
|
61
|
-
"group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-inset aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
62
|
-
{
|
|
63
|
-
variants: {
|
|
64
|
-
variant: {
|
|
65
|
-
default: "border-[color:var(--button-primary-border)] bg-[var(--button-primary-bg)] bg-[image:var(--button-primary-gradient)] text-[color:var(--button-primary-foreground)] shadow-[var(--button-primary-shadow)] hover:bg-[var(--button-primary-hover)] active:bg-[var(--button-primary-active)]",
|
|
66
|
-
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
67
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
68
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
69
|
-
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
70
|
-
link: "underline-offset-4 decoration-current hover:underline"
|
|
71
|
-
},
|
|
72
|
-
size: {
|
|
73
|
-
default: "h-9 gap-2 rounded-lg px-3 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
|
|
74
|
-
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
75
|
-
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
76
|
-
md: "h-9 gap-2 rounded-lg px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
|
|
77
|
-
lg: "h-11 gap-2 rounded-xl px-5 text-base has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4",
|
|
78
|
-
xl: "h-12 gap-2 rounded-xl px-6 text-base has-data-[icon=inline-end]:pr-5 has-data-[icon=inline-start]:pl-5",
|
|
79
|
-
option: "h-auto min-h-16 items-start justify-start gap-2 whitespace-normal rounded-xl px-3 py-3 text-sm",
|
|
80
|
-
icon: "size-9",
|
|
81
|
-
"icon-round": "size-9 rounded-full",
|
|
82
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
83
|
-
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
84
|
-
"icon-lg": "size-10",
|
|
85
|
-
"icon-xl": "size-11 rounded-lg",
|
|
86
|
-
"input-icon": "h-full w-10 rounded-l-none"
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
defaultVariants: {
|
|
90
|
-
variant: "default",
|
|
91
|
-
size: "default"
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
// ../ui/src/components/button.tsx
|
|
97
|
-
import { jsx } from "react/jsx-runtime";
|
|
98
|
-
function Button({
|
|
99
|
-
className,
|
|
100
|
-
variant = "default",
|
|
101
|
-
size = "default",
|
|
102
|
-
asChild = false,
|
|
103
|
-
render,
|
|
104
|
-
children,
|
|
105
|
-
...props
|
|
106
|
-
}) {
|
|
107
|
-
const resolvedRender = render ?? (asChild && React3.isValidElement(children) ? children : void 0);
|
|
108
|
-
return /* @__PURE__ */ jsx(
|
|
109
|
-
ButtonPrimitive,
|
|
110
|
-
{
|
|
111
|
-
"data-slot": "button",
|
|
112
|
-
"data-variant": variant,
|
|
113
|
-
"data-size": size,
|
|
114
|
-
className: cn(buttonVariants({ variant, size }), className),
|
|
115
|
-
...props,
|
|
116
|
-
render: resolvedRender,
|
|
117
|
-
children: resolvedRender ? void 0 : children
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// ../ui/src/components/sheet.tsx
|
|
123
|
-
import * as React4 from "react";
|
|
124
|
-
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
|
|
125
|
-
import { XIcon } from "lucide-react";
|
|
126
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
127
|
-
function Sheet(props) {
|
|
128
|
-
return /* @__PURE__ */ jsx2(SheetPrimitive.Root, { ...props });
|
|
129
|
-
}
|
|
130
|
-
function SheetPortal({ ...props }) {
|
|
131
|
-
return /* @__PURE__ */ jsx2(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
132
|
-
}
|
|
133
|
-
function SheetOverlay({ className, ...props }) {
|
|
134
|
-
return /* @__PURE__ */ jsx2(
|
|
135
|
-
SheetPrimitive.Backdrop,
|
|
136
|
-
{
|
|
137
|
-
"data-slot": "sheet-overlay",
|
|
138
|
-
className: cn(
|
|
139
|
-
"fixed inset-0 z-[var(--z-overlay-backdrop)] bg-black/20 duration-100 supports-backdrop-filter:backdrop-blur data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
140
|
-
className
|
|
141
|
-
),
|
|
142
|
-
...props
|
|
143
|
-
}
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
function SheetContent({
|
|
147
|
-
className,
|
|
148
|
-
children,
|
|
149
|
-
side = "right",
|
|
150
|
-
showCloseButton = true,
|
|
151
|
-
overlayClassName,
|
|
152
|
-
...props
|
|
153
|
-
}) {
|
|
154
|
-
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
155
|
-
/* @__PURE__ */ jsx2(SheetOverlay, { className: overlayClassName }),
|
|
156
|
-
/* @__PURE__ */ jsxs(
|
|
157
|
-
SheetPrimitive.Popup,
|
|
158
|
-
{
|
|
159
|
-
"data-slot": "sheet-content",
|
|
160
|
-
"data-side": side,
|
|
161
|
-
className: cn(
|
|
162
|
-
"fixed z-[calc(var(--z-overlay-backdrop)+1)] flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:max-h-[calc(100dvh-var(--safe-area-inset-top)-var(--safe-area-inset-bottom))] data-[side=bottom]:overflow-y-auto data-[side=bottom]:border-t data-[side=bottom]:pb-[var(--safe-area-inset-bottom)] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:pt-[var(--safe-area-inset-top)] data-[side=left]:pb-[var(--safe-area-inset-bottom)] data-[side=left]:pl-[var(--safe-area-inset-left)] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:pt-[var(--safe-area-inset-top)] data-[side=right]:pr-[var(--safe-area-inset-right)] data-[side=right]:pb-[var(--safe-area-inset-bottom)] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:max-h-[calc(100dvh-var(--safe-area-inset-top)-var(--safe-area-inset-bottom))] data-[side=top]:overflow-y-auto data-[side=top]:border-b data-[side=top]:pt-[var(--safe-area-inset-top)] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10 motion-reduce:animate-none motion-reduce:transition-none",
|
|
163
|
-
className
|
|
164
|
-
),
|
|
165
|
-
...props,
|
|
166
|
-
children: [
|
|
167
|
-
children,
|
|
168
|
-
showCloseButton && /* @__PURE__ */ jsxs(
|
|
169
|
-
SheetPrimitive.Close,
|
|
170
|
-
{
|
|
171
|
-
"data-slot": "sheet-close",
|
|
172
|
-
render: /* @__PURE__ */ jsx2(
|
|
173
|
-
Button,
|
|
174
|
-
{
|
|
175
|
-
variant: "ghost",
|
|
176
|
-
className: "absolute top-[max(1rem,var(--safe-area-inset-top))] right-[max(1rem,var(--safe-area-inset-right))]",
|
|
177
|
-
size: "icon-sm"
|
|
178
|
-
}
|
|
179
|
-
),
|
|
180
|
-
children: [
|
|
181
|
-
/* @__PURE__ */ jsx2(XIcon, {}),
|
|
182
|
-
/* @__PURE__ */ jsx2("span", { className: "sr-only", children: "Close" })
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
)
|
|
186
|
-
]
|
|
187
|
-
}
|
|
188
|
-
)
|
|
189
|
-
] });
|
|
190
|
-
}
|
|
191
|
-
function SheetHeader({ className, ...props }) {
|
|
192
|
-
return /* @__PURE__ */ jsx2(
|
|
193
|
-
"div",
|
|
194
|
-
{
|
|
195
|
-
"data-slot": "sheet-header",
|
|
196
|
-
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
197
|
-
...props
|
|
198
|
-
}
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
function SheetTitle({ className, ...props }) {
|
|
202
|
-
return /* @__PURE__ */ jsx2(
|
|
203
|
-
SheetPrimitive.Title,
|
|
204
|
-
{
|
|
205
|
-
"data-slot": "sheet-title",
|
|
206
|
-
className: cn("font-heading font-bold text-foreground", className),
|
|
207
|
-
...props
|
|
208
|
-
}
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
function SheetDescription({ className, ...props }) {
|
|
212
|
-
return /* @__PURE__ */ jsx2(
|
|
213
|
-
SheetPrimitive.Description,
|
|
214
|
-
{
|
|
215
|
-
"data-slot": "sheet-description",
|
|
216
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
217
|
-
...props
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
64
|
// ../ui/src/components/tooltip.tsx
|
|
223
|
-
import * as
|
|
65
|
+
import * as React3 from "react";
|
|
224
66
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
225
|
-
import { jsx
|
|
67
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
226
68
|
function Tooltip(props) {
|
|
227
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Root, { ...props });
|
|
228
70
|
}
|
|
229
71
|
function TooltipTrigger({ asChild = false, children, render, ...props }) {
|
|
230
|
-
const resolvedRender = render ?? (asChild &&
|
|
231
|
-
return /* @__PURE__ */
|
|
72
|
+
const resolvedRender = render ?? (asChild && React3.isValidElement(children) ? children : void 0);
|
|
73
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", render: resolvedRender, ...props, children: resolvedRender ? void 0 : children });
|
|
232
74
|
}
|
|
233
75
|
function TooltipContent({
|
|
234
76
|
className,
|
|
@@ -238,7 +80,7 @@ function TooltipContent({
|
|
|
238
80
|
children,
|
|
239
81
|
...props
|
|
240
82
|
}) {
|
|
241
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Positioner, { side, align, sideOffset, children: /* @__PURE__ */ jsxs(
|
|
242
84
|
TooltipPrimitive.Popup,
|
|
243
85
|
{
|
|
244
86
|
"data-slot": "tooltip-content",
|
|
@@ -249,7 +91,7 @@ function TooltipContent({
|
|
|
249
91
|
...props,
|
|
250
92
|
children: [
|
|
251
93
|
children,
|
|
252
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "z-[calc(var(--z-popover)+1)] size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-lg bg-foreground fill-foreground" })
|
|
253
95
|
]
|
|
254
96
|
}
|
|
255
97
|
) }) });
|
|
@@ -257,23 +99,23 @@ function TooltipContent({
|
|
|
257
99
|
|
|
258
100
|
// ../ui/src/components/sidebar.tsx
|
|
259
101
|
import { MenuIcon, PanelLeftIcon } from "lucide-react";
|
|
260
|
-
import { jsx as
|
|
102
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
261
103
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
262
104
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
263
105
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
264
106
|
var TABLET_ICON_SIDEBAR_QUERY = "(min-width: 768px) and (max-width: 1279px)";
|
|
265
107
|
var getServerForceIconSidebarSnapshot = () => false;
|
|
266
|
-
var SidebarContext =
|
|
108
|
+
var SidebarContext = React4.createContext(null);
|
|
267
109
|
function useSidebar() {
|
|
268
|
-
const context =
|
|
110
|
+
const context = React4.use(SidebarContext);
|
|
269
111
|
if (!context) {
|
|
270
112
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
271
113
|
}
|
|
272
114
|
return context;
|
|
273
115
|
}
|
|
274
116
|
function useForceIconSidebar(forceIconAtTablet) {
|
|
275
|
-
return
|
|
276
|
-
|
|
117
|
+
return React4.useSyncExternalStore(
|
|
118
|
+
React4.useCallback(
|
|
277
119
|
(onStoreChange) => {
|
|
278
120
|
if (!forceIconAtTablet) return () => {
|
|
279
121
|
};
|
|
@@ -283,7 +125,7 @@ function useForceIconSidebar(forceIconAtTablet) {
|
|
|
283
125
|
},
|
|
284
126
|
[forceIconAtTablet]
|
|
285
127
|
),
|
|
286
|
-
|
|
128
|
+
React4.useCallback(() => {
|
|
287
129
|
if (!forceIconAtTablet) return false;
|
|
288
130
|
return window.matchMedia(TABLET_ICON_SIDEBAR_QUERY).matches;
|
|
289
131
|
}, [forceIconAtTablet]),
|
|
@@ -303,13 +145,13 @@ function SidebarProvider({
|
|
|
303
145
|
}) {
|
|
304
146
|
const isMobile = useIsMobile();
|
|
305
147
|
const forceIcon = useForceIconSidebar(forceIconAtTablet);
|
|
306
|
-
const [openMobile, setOpenMobile] =
|
|
307
|
-
const [_open, _setOpen] =
|
|
148
|
+
const [openMobile, setOpenMobile] = React4.useState(false);
|
|
149
|
+
const [_open, _setOpen] = React4.useReducer(
|
|
308
150
|
(_, nextOpen) => nextOpen,
|
|
309
151
|
defaultOpen
|
|
310
152
|
);
|
|
311
153
|
const open = openProp ?? _open;
|
|
312
|
-
const setOpen =
|
|
154
|
+
const setOpen = React4.useCallback(
|
|
313
155
|
(value) => {
|
|
314
156
|
if (!allowUserCollapse) {
|
|
315
157
|
return;
|
|
@@ -324,14 +166,14 @@ function SidebarProvider({
|
|
|
324
166
|
},
|
|
325
167
|
[allowUserCollapse, setOpenProp, open]
|
|
326
168
|
);
|
|
327
|
-
const toggleSidebar =
|
|
169
|
+
const toggleSidebar = React4.useCallback(() => {
|
|
328
170
|
if (!allowUserCollapse) {
|
|
329
171
|
return;
|
|
330
172
|
}
|
|
331
173
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
332
174
|
}, [allowUserCollapse, isMobile, setOpen, setOpenMobile]);
|
|
333
|
-
const toggleSidebarEvent =
|
|
334
|
-
|
|
175
|
+
const toggleSidebarEvent = React4.useEffectEvent(toggleSidebar);
|
|
176
|
+
React4.useEffect(() => {
|
|
335
177
|
if (!allowUserCollapse) {
|
|
336
178
|
return;
|
|
337
179
|
}
|
|
@@ -345,7 +187,7 @@ function SidebarProvider({
|
|
|
345
187
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
346
188
|
}, [allowUserCollapse]);
|
|
347
189
|
const state = forceIcon && !isMobile ? "collapsed" : open ? "expanded" : "collapsed";
|
|
348
|
-
const contextValue =
|
|
190
|
+
const contextValue = React4.useMemo(
|
|
349
191
|
() => ({
|
|
350
192
|
state,
|
|
351
193
|
open,
|
|
@@ -357,7 +199,7 @@ function SidebarProvider({
|
|
|
357
199
|
}),
|
|
358
200
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
359
201
|
);
|
|
360
|
-
return /* @__PURE__ */
|
|
202
|
+
return /* @__PURE__ */ jsx2(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx2(
|
|
361
203
|
"div",
|
|
362
204
|
{
|
|
363
205
|
"data-slot": "sidebar-wrapper",
|
|
@@ -382,7 +224,7 @@ function Sidebar({
|
|
|
382
224
|
}) {
|
|
383
225
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
384
226
|
if (collapsible === "none") {
|
|
385
|
-
return /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ jsx2(
|
|
386
228
|
"div",
|
|
387
229
|
{
|
|
388
230
|
"data-slot": "sidebar",
|
|
@@ -396,7 +238,7 @@ function Sidebar({
|
|
|
396
238
|
);
|
|
397
239
|
}
|
|
398
240
|
if (isMobile) {
|
|
399
|
-
return /* @__PURE__ */
|
|
241
|
+
return /* @__PURE__ */ jsx2(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs2(
|
|
400
242
|
SheetContent,
|
|
401
243
|
{
|
|
402
244
|
dir,
|
|
@@ -406,16 +248,16 @@ function Sidebar({
|
|
|
406
248
|
className: "w-[var(--sidebar-width-mobile)] bg-sidebar p-0 text-sidebar-foreground dark:bg-card [&>button]:hidden",
|
|
407
249
|
side,
|
|
408
250
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ jsxs2(SheetHeader, { className: "sr-only", children: [
|
|
252
|
+
/* @__PURE__ */ jsx2(SheetTitle, { children: "Sidebar" }),
|
|
253
|
+
/* @__PURE__ */ jsx2(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
412
254
|
] }),
|
|
413
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ jsx2("div", { className: "flex h-full w-full flex-col", children })
|
|
414
256
|
]
|
|
415
257
|
}
|
|
416
258
|
) });
|
|
417
259
|
}
|
|
418
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ jsxs2(
|
|
419
261
|
"div",
|
|
420
262
|
{
|
|
421
263
|
className: "group peer hidden text-sidebar-foreground md:block",
|
|
@@ -425,7 +267,7 @@ function Sidebar({
|
|
|
425
267
|
"data-side": side,
|
|
426
268
|
"data-slot": "sidebar",
|
|
427
269
|
children: [
|
|
428
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ jsx2(
|
|
429
271
|
"div",
|
|
430
272
|
{
|
|
431
273
|
"data-slot": "sidebar-gap",
|
|
@@ -437,7 +279,7 @@ function Sidebar({
|
|
|
437
279
|
)
|
|
438
280
|
}
|
|
439
281
|
),
|
|
440
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ jsx2(
|
|
441
283
|
"div",
|
|
442
284
|
{
|
|
443
285
|
"data-slot": "sidebar-container",
|
|
@@ -449,7 +291,7 @@ function Sidebar({
|
|
|
449
291
|
className
|
|
450
292
|
),
|
|
451
293
|
...props,
|
|
452
|
-
children: /* @__PURE__ */
|
|
294
|
+
children: /* @__PURE__ */ jsx2(
|
|
453
295
|
"div",
|
|
454
296
|
{
|
|
455
297
|
"data-sidebar": "sidebar",
|
|
@@ -465,7 +307,7 @@ function Sidebar({
|
|
|
465
307
|
);
|
|
466
308
|
}
|
|
467
309
|
function SidebarInset({ className, ...props }) {
|
|
468
|
-
return /* @__PURE__ */
|
|
310
|
+
return /* @__PURE__ */ jsx2(
|
|
469
311
|
"main",
|
|
470
312
|
{
|
|
471
313
|
"data-slot": "sidebar-inset",
|
|
@@ -478,7 +320,7 @@ function SidebarInset({ className, ...props }) {
|
|
|
478
320
|
);
|
|
479
321
|
}
|
|
480
322
|
function SidebarHeader({ className, ...props }) {
|
|
481
|
-
return /* @__PURE__ */
|
|
323
|
+
return /* @__PURE__ */ jsx2(
|
|
482
324
|
"div",
|
|
483
325
|
{
|
|
484
326
|
"data-slot": "sidebar-header",
|
|
@@ -489,7 +331,7 @@ function SidebarHeader({ className, ...props }) {
|
|
|
489
331
|
);
|
|
490
332
|
}
|
|
491
333
|
function SidebarFooter({ className, ...props }) {
|
|
492
|
-
return /* @__PURE__ */
|
|
334
|
+
return /* @__PURE__ */ jsx2(
|
|
493
335
|
"div",
|
|
494
336
|
{
|
|
495
337
|
"data-slot": "sidebar-footer",
|
|
@@ -500,7 +342,7 @@ function SidebarFooter({ className, ...props }) {
|
|
|
500
342
|
);
|
|
501
343
|
}
|
|
502
344
|
function SidebarContent({ className, ...props }) {
|
|
503
|
-
return /* @__PURE__ */
|
|
345
|
+
return /* @__PURE__ */ jsx2(
|
|
504
346
|
"div",
|
|
505
347
|
{
|
|
506
348
|
"data-slot": "sidebar-content",
|
|
@@ -514,7 +356,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
514
356
|
);
|
|
515
357
|
}
|
|
516
358
|
function SidebarGroup({ className, ...props }) {
|
|
517
|
-
return /* @__PURE__ */
|
|
359
|
+
return /* @__PURE__ */ jsx2(
|
|
518
360
|
"div",
|
|
519
361
|
{
|
|
520
362
|
"data-slot": "sidebar-group",
|
|
@@ -530,7 +372,7 @@ function SidebarGroupLabel({
|
|
|
530
372
|
render,
|
|
531
373
|
...props
|
|
532
374
|
}) {
|
|
533
|
-
return /* @__PURE__ */
|
|
375
|
+
return /* @__PURE__ */ jsx2(
|
|
534
376
|
RenderSlot,
|
|
535
377
|
{
|
|
536
378
|
defaultTagName: "div",
|
|
@@ -547,7 +389,7 @@ function SidebarGroupLabel({
|
|
|
547
389
|
);
|
|
548
390
|
}
|
|
549
391
|
function SidebarGroupContent({ className, ...props }) {
|
|
550
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */ jsx2(
|
|
551
393
|
"div",
|
|
552
394
|
{
|
|
553
395
|
"data-slot": "sidebar-group-content",
|
|
@@ -557,19 +399,31 @@ function SidebarGroupContent({ className, ...props }) {
|
|
|
557
399
|
}
|
|
558
400
|
);
|
|
559
401
|
}
|
|
560
|
-
|
|
561
|
-
|
|
402
|
+
var sidebarMenuSpacingClassName = {
|
|
403
|
+
default: "gap-1",
|
|
404
|
+
roomy: "gap-2"
|
|
405
|
+
};
|
|
406
|
+
function SidebarMenu({
|
|
407
|
+
className,
|
|
408
|
+
spacing = "default",
|
|
409
|
+
...props
|
|
410
|
+
}) {
|
|
411
|
+
return /* @__PURE__ */ jsx2(
|
|
562
412
|
"ul",
|
|
563
413
|
{
|
|
564
414
|
"data-slot": "sidebar-menu",
|
|
565
415
|
"data-sidebar": "menu",
|
|
566
|
-
className: cn(
|
|
416
|
+
className: cn(
|
|
417
|
+
"flex w-full min-w-0 flex-col",
|
|
418
|
+
sidebarMenuSpacingClassName[spacing],
|
|
419
|
+
className
|
|
420
|
+
),
|
|
567
421
|
...props
|
|
568
422
|
}
|
|
569
423
|
);
|
|
570
424
|
}
|
|
571
425
|
function SidebarMenuItem({ className, ...props }) {
|
|
572
|
-
return /* @__PURE__ */
|
|
426
|
+
return /* @__PURE__ */ jsx2(
|
|
573
427
|
"li",
|
|
574
428
|
{
|
|
575
429
|
"data-slot": "sidebar-menu-item",
|
|
@@ -579,7 +433,7 @@ function SidebarMenuItem({ className, ...props }) {
|
|
|
579
433
|
}
|
|
580
434
|
);
|
|
581
435
|
}
|
|
582
|
-
var sidebarMenuButtonVariants =
|
|
436
|
+
var sidebarMenuButtonVariants = cva(
|
|
583
437
|
"peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-inset active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-bold data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
|
|
584
438
|
{
|
|
585
439
|
variants: {
|
|
@@ -610,7 +464,7 @@ function SidebarMenuButton({
|
|
|
610
464
|
...props
|
|
611
465
|
}) {
|
|
612
466
|
const { isMobile, state } = useSidebar();
|
|
613
|
-
const button = /* @__PURE__ */
|
|
467
|
+
const button = /* @__PURE__ */ jsx2(
|
|
614
468
|
RenderSlot,
|
|
615
469
|
{
|
|
616
470
|
defaultTagName: "button",
|
|
@@ -632,9 +486,9 @@ function SidebarMenuButton({
|
|
|
632
486
|
children: tooltip
|
|
633
487
|
};
|
|
634
488
|
}
|
|
635
|
-
return /* @__PURE__ */
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
489
|
+
return /* @__PURE__ */ jsxs2(Tooltip, { children: [
|
|
490
|
+
/* @__PURE__ */ jsx2(TooltipTrigger, { asChild: true, children: button }),
|
|
491
|
+
/* @__PURE__ */ jsx2(
|
|
638
492
|
TooltipContent,
|
|
639
493
|
{
|
|
640
494
|
side: "right",
|
|
@@ -646,7 +500,7 @@ function SidebarMenuButton({
|
|
|
646
500
|
] });
|
|
647
501
|
}
|
|
648
502
|
function SidebarMenuBadge({ className, ...props }) {
|
|
649
|
-
return /* @__PURE__ */
|
|
503
|
+
return /* @__PURE__ */ jsx2(
|
|
650
504
|
"div",
|
|
651
505
|
{
|
|
652
506
|
"data-slot": "sidebar-menu-badge",
|
|
@@ -660,16 +514,43 @@ function SidebarMenuBadge({ className, ...props }) {
|
|
|
660
514
|
);
|
|
661
515
|
}
|
|
662
516
|
|
|
517
|
+
// ../ui/src/warmio/sidebar-compositions.tsx
|
|
518
|
+
import * as React5 from "react";
|
|
519
|
+
import { ChevronUp, UserRound } from "lucide-react";
|
|
520
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
521
|
+
function SidebarBrand({ actions, collapsed, expanded }) {
|
|
522
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex w-full items-center justify-between gap-2 px-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0", children: [
|
|
523
|
+
React5.cloneElement(expanded, {
|
|
524
|
+
className: "flex shrink-0 items-center text-sidebar-foreground transition-colors hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:hidden"
|
|
525
|
+
}),
|
|
526
|
+
React5.cloneElement(collapsed, {
|
|
527
|
+
className: "hidden size-8 shrink-0 items-center justify-center rounded-lg text-sidebar-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:outline-hidden group-data-[collapsible=icon]:flex"
|
|
528
|
+
}),
|
|
529
|
+
actions ? /* @__PURE__ */ jsx3("div", { className: "flex items-center gap-1 group-data-[collapsible=icon]:hidden", children: actions }) : null
|
|
530
|
+
] });
|
|
531
|
+
}
|
|
532
|
+
var SidebarAccountTrigger = React5.forwardRef(function SidebarAccountTrigger2({ avatar, className: _className, email, label, style: _style, ...props }, ref) {
|
|
533
|
+
return /* @__PURE__ */ jsxs3(SidebarMenuButton2, { ...props, ref, presentation: "account", children: [
|
|
534
|
+
/* @__PURE__ */ jsx3("div", { className: "grid size-8 shrink-0 place-items-center rounded-lg bg-sidebar-primary text-xs font-bold text-sidebar-primary-foreground", children: avatar ?? /* @__PURE__ */ jsx3(UserRound, { className: "size-4", "aria-hidden": "true" }) }),
|
|
535
|
+
/* @__PURE__ */ jsxs3("div", { className: "min-w-0 flex-1 text-left group-data-[collapsible=icon]:hidden", children: [
|
|
536
|
+
/* @__PURE__ */ jsx3("div", { className: "truncate text-sm font-bold", children: label }),
|
|
537
|
+
/* @__PURE__ */ jsx3("div", { className: "truncate text-xs text-sidebar-foreground/60", children: email })
|
|
538
|
+
] }),
|
|
539
|
+
/* @__PURE__ */ jsx3(ChevronUp, { className: "ml-auto size-4 group-data-[collapsible=icon]:hidden" })
|
|
540
|
+
] });
|
|
541
|
+
});
|
|
542
|
+
SidebarAccountTrigger.displayName = "WarmSidebarAccountTrigger";
|
|
543
|
+
|
|
663
544
|
// ../ui/src/warmio/sidebar.tsx
|
|
664
|
-
import { jsx as
|
|
545
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
665
546
|
function SidebarProvider2({
|
|
666
547
|
className: _className,
|
|
667
548
|
presentation,
|
|
668
549
|
style: _style,
|
|
669
550
|
...props
|
|
670
551
|
}) {
|
|
671
|
-
const presentationClassName = presentation === "mockup" ? "min-h-0
|
|
672
|
-
return /* @__PURE__ */
|
|
552
|
+
const presentationClassName = presentation === "mockup" ? "min-h-0" : presentation === "preview" ? "min-h-full" : void 0;
|
|
553
|
+
return /* @__PURE__ */ jsx4(SidebarProvider, { ...props, className: presentationClassName });
|
|
673
554
|
}
|
|
674
555
|
function Sidebar2({
|
|
675
556
|
className: _className,
|
|
@@ -677,7 +558,7 @@ function Sidebar2({
|
|
|
677
558
|
style: _style,
|
|
678
559
|
...props
|
|
679
560
|
}) {
|
|
680
|
-
return /* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ jsx4(
|
|
681
562
|
Sidebar,
|
|
682
563
|
{
|
|
683
564
|
...props,
|
|
@@ -691,7 +572,7 @@ function SidebarInset2({
|
|
|
691
572
|
style: _style,
|
|
692
573
|
...props
|
|
693
574
|
}) {
|
|
694
|
-
return /* @__PURE__ */
|
|
575
|
+
return /* @__PURE__ */ jsx4(SidebarInset, { ...props, className: presentation === "product" ? "min-w-0" : void 0 });
|
|
695
576
|
}
|
|
696
577
|
function SidebarHeader2({
|
|
697
578
|
className: _className,
|
|
@@ -700,7 +581,7 @@ function SidebarHeader2({
|
|
|
700
581
|
...props
|
|
701
582
|
}) {
|
|
702
583
|
const className = presentation === "product" ? "h-[var(--header-height)] justify-center border-b border-border p-2" : presentation === "mockup" ? "h-14 justify-center border-b border-border p-2" : void 0;
|
|
703
|
-
return /* @__PURE__ */
|
|
584
|
+
return /* @__PURE__ */ jsx4(SidebarHeader, { ...props, className });
|
|
704
585
|
}
|
|
705
586
|
function SidebarContent2({
|
|
706
587
|
className: _className,
|
|
@@ -709,7 +590,7 @@ function SidebarContent2({
|
|
|
709
590
|
...props
|
|
710
591
|
}) {
|
|
711
592
|
const className = presentation === "product" ? "pb-0" : presentation === "mockup" ? "px-1 py-3" : void 0;
|
|
712
|
-
return /* @__PURE__ */
|
|
593
|
+
return /* @__PURE__ */ jsx4(SidebarContent, { ...props, className });
|
|
713
594
|
}
|
|
714
595
|
function SidebarFooter2({
|
|
715
596
|
className: _className,
|
|
@@ -717,7 +598,7 @@ function SidebarFooter2({
|
|
|
717
598
|
style: _style,
|
|
718
599
|
...props
|
|
719
600
|
}) {
|
|
720
|
-
return /* @__PURE__ */
|
|
601
|
+
return /* @__PURE__ */ jsx4(
|
|
721
602
|
SidebarFooter,
|
|
722
603
|
{
|
|
723
604
|
...props,
|
|
@@ -732,15 +613,15 @@ function SidebarGroup2({
|
|
|
732
613
|
style: _style,
|
|
733
614
|
...props
|
|
734
615
|
}) {
|
|
735
|
-
const className = presentation === "navigation" ? `${collapsed ? "items-center " : ""}px-2 py-1` : presentation === "mockup" ? "py-1" : void 0;
|
|
736
|
-
return /* @__PURE__ */
|
|
616
|
+
const className = presentation === "navigation" || presentation === "navigation-primary" ? `${collapsed ? "items-center " : ""}${presentation === "navigation-primary" ? "px-2 pt-3 pb-1" : "px-2 py-1"}` : presentation === "mockup" ? "py-1" : void 0;
|
|
617
|
+
return /* @__PURE__ */ jsx4(SidebarGroup, { ...props, className });
|
|
737
618
|
}
|
|
738
619
|
function SidebarGroupContent2({
|
|
739
620
|
className: _className,
|
|
740
621
|
style: _style,
|
|
741
622
|
...props
|
|
742
623
|
}) {
|
|
743
|
-
return /* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ jsx4(SidebarGroupContent, { ...props });
|
|
744
625
|
}
|
|
745
626
|
function SidebarGroupLabel2({
|
|
746
627
|
className: _className,
|
|
@@ -749,34 +630,44 @@ function SidebarGroupLabel2({
|
|
|
749
630
|
...props
|
|
750
631
|
}) {
|
|
751
632
|
const className = presentation === "navigation" ? "px-2 tabular-nums text-xs uppercase tracking-wider text-sidebar-foreground/60" : presentation === "mockup" ? "uppercase tracking-wider" : void 0;
|
|
752
|
-
return /* @__PURE__ */
|
|
633
|
+
return /* @__PURE__ */ jsx4(SidebarGroupLabel, { ...props, className });
|
|
753
634
|
}
|
|
754
635
|
function SidebarMenu2({ className: _className, style: _style, ...props }) {
|
|
755
|
-
return /* @__PURE__ */
|
|
636
|
+
return /* @__PURE__ */ jsx4(SidebarMenu, { ...props });
|
|
756
637
|
}
|
|
757
638
|
function SidebarMenuItem2({
|
|
758
639
|
className: _className,
|
|
759
640
|
style: _style,
|
|
760
641
|
...props
|
|
761
642
|
}) {
|
|
762
|
-
return /* @__PURE__ */
|
|
763
|
-
}
|
|
764
|
-
function SidebarMenuButton2({
|
|
765
|
-
className: _className,
|
|
766
|
-
presentation,
|
|
767
|
-
style: _style,
|
|
768
|
-
...props
|
|
769
|
-
}) {
|
|
770
|
-
const className = presentation === "account" ? "h-12" : presentation === "disabled" ? "text-muted-foreground/60" : presentation === "previewCollapsed" ? "mx-auto size-8 gap-0 p-2" : void 0;
|
|
771
|
-
return /* @__PURE__ */ jsx5(SidebarMenuButton, { ...props, className });
|
|
643
|
+
return /* @__PURE__ */ jsx4(SidebarMenuItem, { ...props });
|
|
772
644
|
}
|
|
645
|
+
var SidebarMenuButton2 = React6.forwardRef(
|
|
646
|
+
function SidebarMenuButton3({ className: _className, collapsed = false, disabled, presentation, style: _style, ...props }, ref) {
|
|
647
|
+
return /* @__PURE__ */ jsx4(
|
|
648
|
+
SidebarMenuButton,
|
|
649
|
+
{
|
|
650
|
+
...props,
|
|
651
|
+
disabled,
|
|
652
|
+
ref,
|
|
653
|
+
className: cn(
|
|
654
|
+
(collapsed || presentation === "previewCollapsed") && "mx-auto size-8 gap-0 p-2",
|
|
655
|
+
presentation === "account" && "h-12",
|
|
656
|
+
presentation === "navigation" && "[&>span:last-child]:text-sidebar-foreground/50 [&>span:last-child]:transition-colors hover:[&>span:last-child]:text-sidebar-accent-foreground data-active:[&>span:last-child]:text-sidebar-accent-foreground",
|
|
657
|
+
(disabled || presentation === "disabled") && "text-muted-foreground/60"
|
|
658
|
+
)
|
|
659
|
+
}
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
);
|
|
663
|
+
SidebarMenuButton2.displayName = "WarmSidebarMenuButton";
|
|
773
664
|
function SidebarMenuBadge2({
|
|
774
665
|
className: _className,
|
|
775
666
|
presentation,
|
|
776
667
|
style: _style,
|
|
777
668
|
...props
|
|
778
669
|
}) {
|
|
779
|
-
return /* @__PURE__ */
|
|
670
|
+
return /* @__PURE__ */ jsx4(
|
|
780
671
|
SidebarMenuBadge,
|
|
781
672
|
{
|
|
782
673
|
...props,
|
|
@@ -787,6 +678,8 @@ function SidebarMenuBadge2({
|
|
|
787
678
|
|
|
788
679
|
export {
|
|
789
680
|
useSidebar,
|
|
681
|
+
SidebarBrand,
|
|
682
|
+
SidebarAccountTrigger,
|
|
790
683
|
SidebarProvider2 as SidebarProvider,
|
|
791
684
|
Sidebar2 as Sidebar,
|
|
792
685
|
SidebarInset2 as SidebarInset,
|