@prediktif/ui 0.1.4 → 0.1.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/index.d.mts CHANGED
@@ -1,10 +1,34 @@
1
- import * as react from 'react';
1
+ import * as React$1 from 'react';
2
+ import { ComponentProps } from 'react';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+ import { useRender } from '@base-ui/react/use-render';
5
+ import { VariantProps } from 'class-variance-authority';
6
+ import { Tooltip } from '@base-ui/react/tooltip';
2
7
 
3
8
  interface HeaderTitleProps {
4
9
  title: React.ReactNode;
5
10
  subtitle: React.ReactNode;
6
11
  children?: React.ReactNode;
7
12
  }
8
- declare const HeaderTitle: react.NamedExoticComponent<HeaderTitleProps>;
13
+ declare const HeaderTitle: React$1.NamedExoticComponent<HeaderTitleProps>;
9
14
 
10
- export { HeaderTitle, type HeaderTitleProps };
15
+ declare function TooltipContent({ className, side, sideOffset, align, alignOffset, children, ...props }: Tooltip.Popup.Props & Pick<Tooltip.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React$1.JSX.Element;
16
+
17
+ declare const sidebarMenuButtonVariants: (props?: ({
18
+ variant?: "default" | "outline" | null | undefined;
19
+ size?: "default" | "sm" | "lg" | null | undefined;
20
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
21
+ declare function SidebarMenuButton({ render, isActive, variant, size, tooltip, className, ...props }: useRender.ComponentProps<"button"> & React$1.ComponentProps<"button"> & {
22
+ isActive?: boolean;
23
+ tooltip?: string | React$1.ComponentProps<typeof TooltipContent>;
24
+ } & VariantProps<typeof sidebarMenuButtonVariants>): React$1.JSX.Element;
25
+
26
+ interface NavUserProps {
27
+ name: string;
28
+ email: string;
29
+ image?: string | null;
30
+ render?: ComponentProps<typeof SidebarMenuButton>["render"];
31
+ }
32
+ declare const NavUser: React$1.NamedExoticComponent<NavUserProps>;
33
+
34
+ export { HeaderTitle, type HeaderTitleProps, NavUser, type NavUserProps };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,34 @@
1
- import * as react from 'react';
1
+ import * as React$1 from 'react';
2
+ import { ComponentProps } from 'react';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+ import { useRender } from '@base-ui/react/use-render';
5
+ import { VariantProps } from 'class-variance-authority';
6
+ import { Tooltip } from '@base-ui/react/tooltip';
2
7
 
3
8
  interface HeaderTitleProps {
4
9
  title: React.ReactNode;
5
10
  subtitle: React.ReactNode;
6
11
  children?: React.ReactNode;
7
12
  }
8
- declare const HeaderTitle: react.NamedExoticComponent<HeaderTitleProps>;
13
+ declare const HeaderTitle: React$1.NamedExoticComponent<HeaderTitleProps>;
9
14
 
10
- export { HeaderTitle, type HeaderTitleProps };
15
+ declare function TooltipContent({ className, side, sideOffset, align, alignOffset, children, ...props }: Tooltip.Popup.Props & Pick<Tooltip.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React$1.JSX.Element;
16
+
17
+ declare const sidebarMenuButtonVariants: (props?: ({
18
+ variant?: "default" | "outline" | null | undefined;
19
+ size?: "default" | "sm" | "lg" | null | undefined;
20
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
21
+ declare function SidebarMenuButton({ render, isActive, variant, size, tooltip, className, ...props }: useRender.ComponentProps<"button"> & React$1.ComponentProps<"button"> & {
22
+ isActive?: boolean;
23
+ tooltip?: string | React$1.ComponentProps<typeof TooltipContent>;
24
+ } & VariantProps<typeof sidebarMenuButtonVariants>): React$1.JSX.Element;
25
+
26
+ interface NavUserProps {
27
+ name: string;
28
+ email: string;
29
+ image?: string | null;
30
+ render?: ComponentProps<typeof SidebarMenuButton>["render"];
31
+ }
32
+ declare const NavUser: React$1.NamedExoticComponent<NavUserProps>;
33
+
34
+ export { HeaderTitle, type HeaderTitleProps, NavUser, type NavUserProps };
package/dist/index.js CHANGED
@@ -1,8 +1,39 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
3
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
5
10
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
6
37
  var __export = (target, all) => {
7
38
  for (var name in all)
8
39
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -15,12 +46,21 @@ var __copyProps = (to, from, except, desc) => {
15
46
  }
16
47
  return to;
17
48
  };
49
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
+ // If the importer is in node compatibility mode or this is not an ESM
51
+ // file that has been converted to a CommonJS file using a Babel-
52
+ // compatible transform (i.e. "__esModule" has not been set), then set
53
+ // "default" to the CommonJS "module.exports" for node compatibility.
54
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
+ mod
56
+ ));
18
57
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
58
 
20
59
  // src/index.ts
21
60
  var index_exports = {};
22
61
  __export(index_exports, {
23
- HeaderTitle: () => HeaderTitle
62
+ HeaderTitle: () => HeaderTitle,
63
+ NavUser: () => NavUser
24
64
  });
25
65
  module.exports = __toCommonJS(index_exports);
26
66
 
@@ -40,7 +80,326 @@ var HeaderTitle = (0, import_react.memo)(function HeaderTitle2({
40
80
  children
41
81
  ] });
42
82
  });
83
+
84
+ // src/components/composed/nav-user.tsx
85
+ var import_react2 = require("react");
86
+
87
+ // src/components/ui/avatar.tsx
88
+ var import_avatar = require("@base-ui/react/avatar");
89
+ var import_cn = require("cn");
90
+ var import_jsx_runtime2 = require("react/jsx-runtime");
91
+ function Avatar(_a) {
92
+ var _b = _a, {
93
+ className,
94
+ size = "default"
95
+ } = _b, props = __objRest(_b, [
96
+ "className",
97
+ "size"
98
+ ]);
99
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
100
+ import_avatar.Avatar.Root,
101
+ __spreadValues({
102
+ "data-slot": "avatar",
103
+ "data-size": size,
104
+ className: (0, import_cn.cn)(
105
+ "group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
106
+ className
107
+ )
108
+ }, props)
109
+ );
110
+ }
111
+ function AvatarImage(_a) {
112
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
113
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
114
+ import_avatar.Avatar.Image,
115
+ __spreadValues({
116
+ "data-slot": "avatar-image",
117
+ className: (0, import_cn.cn)(
118
+ "aspect-square size-full rounded-full object-cover",
119
+ className
120
+ )
121
+ }, props)
122
+ );
123
+ }
124
+ function AvatarFallback(_a) {
125
+ var _b = _a, {
126
+ className
127
+ } = _b, props = __objRest(_b, [
128
+ "className"
129
+ ]);
130
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
131
+ import_avatar.Avatar.Fallback,
132
+ __spreadValues({
133
+ "data-slot": "avatar-fallback",
134
+ className: (0, import_cn.cn)(
135
+ "flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
136
+ className
137
+ )
138
+ }, props)
139
+ );
140
+ }
141
+
142
+ // src/components/ui/sidebar.tsx
143
+ var import_merge_props = require("@base-ui/react/merge-props");
144
+ var import_use_render = require("@base-ui/react/use-render");
145
+ var import_class_variance_authority2 = require("class-variance-authority");
146
+ var import_cn8 = require("cn");
147
+ var import_lucide_react2 = require("lucide-react");
148
+ var React2 = __toESM(require("react"));
149
+
150
+ // src/components/ui/button.tsx
151
+ var import_button = require("@base-ui/react/button");
152
+ var import_class_variance_authority = require("class-variance-authority");
153
+ var import_cn2 = require("cn");
154
+ var import_jsx_runtime3 = require("react/jsx-runtime");
155
+ var buttonVariants = (0, import_class_variance_authority.cva)(
156
+ "group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 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",
157
+ {
158
+ variants: {
159
+ variant: {
160
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
161
+ outline: "border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30",
162
+ secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
163
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
164
+ 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",
165
+ link: "text-primary underline-offset-4 hover:underline"
166
+ },
167
+ size: {
168
+ default: "h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
169
+ xs: "h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",
170
+ sm: "h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
171
+ lg: "h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",
172
+ icon: "size-7 [&_svg:not([class*='size-'])]:size-3.5",
173
+ "icon-xs": "size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5",
174
+ "icon-sm": "size-6 [&_svg:not([class*='size-'])]:size-3",
175
+ "icon-lg": "size-8 [&_svg:not([class*='size-'])]:size-4"
176
+ }
177
+ },
178
+ defaultVariants: {
179
+ variant: "default",
180
+ size: "default"
181
+ }
182
+ }
183
+ );
184
+
185
+ // src/components/ui/input.tsx
186
+ var import_input = require("@base-ui/react/input");
187
+ var import_cn3 = require("cn");
188
+ var import_jsx_runtime4 = require("react/jsx-runtime");
189
+
190
+ // src/components/ui/separator.tsx
191
+ var import_separator = require("@base-ui/react/separator");
192
+ var import_cn4 = require("cn");
193
+ var import_jsx_runtime5 = require("react/jsx-runtime");
194
+
195
+ // src/components/ui/sheet.tsx
196
+ var import_dialog = require("@base-ui/react/dialog");
197
+ var import_cn5 = require("cn");
198
+ var import_lucide_react = require("lucide-react");
199
+ var import_jsx_runtime6 = require("react/jsx-runtime");
200
+
201
+ // src/components/ui/skeleton.tsx
202
+ var import_cn6 = require("cn");
203
+ var import_jsx_runtime7 = require("react/jsx-runtime");
204
+
205
+ // src/components/ui/tooltip.tsx
206
+ var import_tooltip = require("@base-ui/react/tooltip");
207
+ var import_cn7 = require("cn");
208
+ var import_jsx_runtime8 = require("react/jsx-runtime");
209
+ function Tooltip(_a) {
210
+ var props = __objRest(_a, []);
211
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tooltip.Tooltip.Root, __spreadValues({ "data-slot": "tooltip" }, props));
212
+ }
213
+ function TooltipTrigger(_a) {
214
+ var props = __objRest(_a, []);
215
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tooltip.Tooltip.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
216
+ }
217
+ function TooltipContent(_a) {
218
+ var _b = _a, {
219
+ className,
220
+ side = "top",
221
+ sideOffset = 4,
222
+ align = "center",
223
+ alignOffset = 0,
224
+ children
225
+ } = _b, props = __objRest(_b, [
226
+ "className",
227
+ "side",
228
+ "sideOffset",
229
+ "align",
230
+ "alignOffset",
231
+ "children"
232
+ ]);
233
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tooltip.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
234
+ import_tooltip.Tooltip.Positioner,
235
+ {
236
+ align,
237
+ alignOffset,
238
+ side,
239
+ sideOffset,
240
+ className: "isolate z-50",
241
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
242
+ import_tooltip.Tooltip.Popup,
243
+ __spreadProps(__spreadValues({
244
+ "data-slot": "tooltip-content",
245
+ className: (0, import_cn7.cn)(
246
+ "z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
247
+ className
248
+ )
249
+ }, props), {
250
+ children: [
251
+ children,
252
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tooltip.Tooltip.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })
253
+ ]
254
+ })
255
+ )
256
+ }
257
+ ) });
258
+ }
259
+
260
+ // src/hooks/use-mobile.ts
261
+ var React = __toESM(require("react"));
262
+
263
+ // src/components/ui/sidebar.tsx
264
+ var import_jsx_runtime9 = require("react/jsx-runtime");
265
+ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
266
+ var SidebarContext = React2.createContext(null);
267
+ function useSidebar() {
268
+ const context = React2.useContext(SidebarContext);
269
+ if (!context) {
270
+ throw new Error("useSidebar must be used within a SidebarProvider.");
271
+ }
272
+ return context;
273
+ }
274
+ function SidebarFooter(_a) {
275
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
276
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
277
+ "div",
278
+ __spreadValues({
279
+ "data-slot": "sidebar-footer",
280
+ "data-sidebar": "footer",
281
+ className: (0, import_cn8.cn)("flex flex-col gap-2 p-2", className)
282
+ }, props)
283
+ );
284
+ }
285
+ function SidebarMenu(_a) {
286
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
287
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
288
+ "ul",
289
+ __spreadValues({
290
+ "data-slot": "sidebar-menu",
291
+ "data-sidebar": "menu",
292
+ className: (0, import_cn8.cn)("flex w-full min-w-0 flex-col gap-px", className)
293
+ }, props)
294
+ );
295
+ }
296
+ function SidebarMenuItem(_a) {
297
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
298
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
299
+ "li",
300
+ __spreadValues({
301
+ "data-slot": "sidebar-menu-item",
302
+ "data-sidebar": "menu-item",
303
+ className: (0, import_cn8.cn)("group/menu-item relative", className)
304
+ }, props)
305
+ );
306
+ }
307
+ var sidebarMenuButtonVariants = (0, import_class_variance_authority2.cva)(
308
+ "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs 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 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-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
309
+ {
310
+ variants: {
311
+ variant: {
312
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
313
+ outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
314
+ },
315
+ size: {
316
+ default: "h-8 text-xs",
317
+ sm: "h-7 text-xs",
318
+ lg: "h-12 text-xs group-data-[collapsible=icon]:p-0!"
319
+ }
320
+ },
321
+ defaultVariants: {
322
+ variant: "default",
323
+ size: "default"
324
+ }
325
+ }
326
+ );
327
+ function SidebarMenuButton(_a) {
328
+ var _b = _a, {
329
+ render,
330
+ isActive = false,
331
+ variant = "default",
332
+ size = "default",
333
+ tooltip,
334
+ className
335
+ } = _b, props = __objRest(_b, [
336
+ "render",
337
+ "isActive",
338
+ "variant",
339
+ "size",
340
+ "tooltip",
341
+ "className"
342
+ ]);
343
+ const { isMobile, state } = useSidebar();
344
+ const comp = (0, import_use_render.useRender)({
345
+ defaultTagName: "button",
346
+ props: (0, import_merge_props.mergeProps)(
347
+ {
348
+ className: (0, import_cn8.cn)(sidebarMenuButtonVariants({ variant, size }), className)
349
+ },
350
+ props
351
+ ),
352
+ render: !tooltip ? render : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipTrigger, { render }),
353
+ state: {
354
+ slot: "sidebar-menu-button",
355
+ sidebar: "menu-button",
356
+ size,
357
+ active: isActive
358
+ }
359
+ });
360
+ if (!tooltip) {
361
+ return comp;
362
+ }
363
+ if (typeof tooltip === "string") {
364
+ tooltip = {
365
+ children: tooltip
366
+ };
367
+ }
368
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Tooltip, { children: [
369
+ comp,
370
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
371
+ TooltipContent,
372
+ __spreadValues({
373
+ side: "right",
374
+ align: "center",
375
+ hidden: state !== "collapsed" || isMobile
376
+ }, tooltip)
377
+ )
378
+ ] });
379
+ }
380
+
381
+ // src/components/composed/nav-user.tsx
382
+ var import_jsx_runtime10 = require("react/jsx-runtime");
383
+ var NavUser = (0, import_react2.memo)(function NavUser2({
384
+ name,
385
+ email,
386
+ image,
387
+ render
388
+ }) {
389
+ const initials = name ? name.trim().split(" ").map((n) => n[0]).join("").substring(0, 2).toUpperCase() : "U";
390
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SidebarFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(SidebarMenuButton, { size: "lg", render, children: [
391
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Avatar, { children: [
392
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AvatarImage, { src: image || "", alt: name || "" }),
393
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AvatarFallback, { children: initials })
394
+ ] }),
395
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
396
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "truncate font-medium", children: name }),
397
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: email })
398
+ ] })
399
+ ] }) }) }) });
400
+ });
43
401
  // Annotate the CommonJS export names for ESM import in node:
44
402
  0 && (module.exports = {
45
- HeaderTitle
403
+ HeaderTitle,
404
+ NavUser
46
405
  });
package/dist/index.mjs CHANGED
@@ -1,3 +1,35 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
1
33
  // src/components/composed/header-title.tsx
2
34
  import { memo } from "react";
3
35
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -14,6 +46,325 @@ var HeaderTitle = memo(function HeaderTitle2({
14
46
  children
15
47
  ] });
16
48
  });
49
+
50
+ // src/components/composed/nav-user.tsx
51
+ import { memo as memo2 } from "react";
52
+
53
+ // src/components/ui/avatar.tsx
54
+ import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
55
+ import { cn } from "cn";
56
+ import { jsx as jsx2 } from "react/jsx-runtime";
57
+ function Avatar(_a) {
58
+ var _b = _a, {
59
+ className,
60
+ size = "default"
61
+ } = _b, props = __objRest(_b, [
62
+ "className",
63
+ "size"
64
+ ]);
65
+ return /* @__PURE__ */ jsx2(
66
+ AvatarPrimitive.Root,
67
+ __spreadValues({
68
+ "data-slot": "avatar",
69
+ "data-size": size,
70
+ className: cn(
71
+ "group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
72
+ className
73
+ )
74
+ }, props)
75
+ );
76
+ }
77
+ function AvatarImage(_a) {
78
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
79
+ return /* @__PURE__ */ jsx2(
80
+ AvatarPrimitive.Image,
81
+ __spreadValues({
82
+ "data-slot": "avatar-image",
83
+ className: cn(
84
+ "aspect-square size-full rounded-full object-cover",
85
+ className
86
+ )
87
+ }, props)
88
+ );
89
+ }
90
+ function AvatarFallback(_a) {
91
+ var _b = _a, {
92
+ className
93
+ } = _b, props = __objRest(_b, [
94
+ "className"
95
+ ]);
96
+ return /* @__PURE__ */ jsx2(
97
+ AvatarPrimitive.Fallback,
98
+ __spreadValues({
99
+ "data-slot": "avatar-fallback",
100
+ className: cn(
101
+ "flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
102
+ className
103
+ )
104
+ }, props)
105
+ );
106
+ }
107
+
108
+ // src/components/ui/sidebar.tsx
109
+ import { mergeProps } from "@base-ui/react/merge-props";
110
+ import { useRender } from "@base-ui/react/use-render";
111
+ import { cva as cva2 } from "class-variance-authority";
112
+ import { cn as cn8 } from "cn";
113
+ import { PanelLeftIcon } from "lucide-react";
114
+ import * as React2 from "react";
115
+
116
+ // src/components/ui/button.tsx
117
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
118
+ import { cva } from "class-variance-authority";
119
+ import { cn as cn2 } from "cn";
120
+ import { jsx as jsx3 } from "react/jsx-runtime";
121
+ var buttonVariants = cva(
122
+ "group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 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",
123
+ {
124
+ variants: {
125
+ variant: {
126
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
127
+ outline: "border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30",
128
+ secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
129
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
130
+ 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",
131
+ link: "text-primary underline-offset-4 hover:underline"
132
+ },
133
+ size: {
134
+ default: "h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
135
+ xs: "h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",
136
+ sm: "h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
137
+ lg: "h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",
138
+ icon: "size-7 [&_svg:not([class*='size-'])]:size-3.5",
139
+ "icon-xs": "size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5",
140
+ "icon-sm": "size-6 [&_svg:not([class*='size-'])]:size-3",
141
+ "icon-lg": "size-8 [&_svg:not([class*='size-'])]:size-4"
142
+ }
143
+ },
144
+ defaultVariants: {
145
+ variant: "default",
146
+ size: "default"
147
+ }
148
+ }
149
+ );
150
+
151
+ // src/components/ui/input.tsx
152
+ import { Input as InputPrimitive } from "@base-ui/react/input";
153
+ import { cn as cn3 } from "cn";
154
+ import { jsx as jsx4 } from "react/jsx-runtime";
155
+
156
+ // src/components/ui/separator.tsx
157
+ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
158
+ import { cn as cn4 } from "cn";
159
+ import { jsx as jsx5 } from "react/jsx-runtime";
160
+
161
+ // src/components/ui/sheet.tsx
162
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
163
+ import { cn as cn5 } from "cn";
164
+ import { XIcon } from "lucide-react";
165
+ import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
166
+
167
+ // src/components/ui/skeleton.tsx
168
+ import { cn as cn6 } from "cn";
169
+ import { jsx as jsx7 } from "react/jsx-runtime";
170
+
171
+ // src/components/ui/tooltip.tsx
172
+ import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
173
+ import { cn as cn7 } from "cn";
174
+ import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
175
+ function Tooltip(_a) {
176
+ var props = __objRest(_a, []);
177
+ return /* @__PURE__ */ jsx8(TooltipPrimitive.Root, __spreadValues({ "data-slot": "tooltip" }, props));
178
+ }
179
+ function TooltipTrigger(_a) {
180
+ var props = __objRest(_a, []);
181
+ return /* @__PURE__ */ jsx8(TooltipPrimitive.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
182
+ }
183
+ function TooltipContent(_a) {
184
+ var _b = _a, {
185
+ className,
186
+ side = "top",
187
+ sideOffset = 4,
188
+ align = "center",
189
+ alignOffset = 0,
190
+ children
191
+ } = _b, props = __objRest(_b, [
192
+ "className",
193
+ "side",
194
+ "sideOffset",
195
+ "align",
196
+ "alignOffset",
197
+ "children"
198
+ ]);
199
+ return /* @__PURE__ */ jsx8(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx8(
200
+ TooltipPrimitive.Positioner,
201
+ {
202
+ align,
203
+ alignOffset,
204
+ side,
205
+ sideOffset,
206
+ className: "isolate z-50",
207
+ children: /* @__PURE__ */ jsxs3(
208
+ TooltipPrimitive.Popup,
209
+ __spreadProps(__spreadValues({
210
+ "data-slot": "tooltip-content",
211
+ className: cn7(
212
+ "z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
213
+ className
214
+ )
215
+ }, props), {
216
+ children: [
217
+ children,
218
+ /* @__PURE__ */ jsx8(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })
219
+ ]
220
+ })
221
+ )
222
+ }
223
+ ) });
224
+ }
225
+
226
+ // src/hooks/use-mobile.ts
227
+ import * as React from "react";
228
+
229
+ // src/components/ui/sidebar.tsx
230
+ import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
231
+ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
232
+ var SidebarContext = React2.createContext(null);
233
+ function useSidebar() {
234
+ const context = React2.useContext(SidebarContext);
235
+ if (!context) {
236
+ throw new Error("useSidebar must be used within a SidebarProvider.");
237
+ }
238
+ return context;
239
+ }
240
+ function SidebarFooter(_a) {
241
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
242
+ return /* @__PURE__ */ jsx9(
243
+ "div",
244
+ __spreadValues({
245
+ "data-slot": "sidebar-footer",
246
+ "data-sidebar": "footer",
247
+ className: cn8("flex flex-col gap-2 p-2", className)
248
+ }, props)
249
+ );
250
+ }
251
+ function SidebarMenu(_a) {
252
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
253
+ return /* @__PURE__ */ jsx9(
254
+ "ul",
255
+ __spreadValues({
256
+ "data-slot": "sidebar-menu",
257
+ "data-sidebar": "menu",
258
+ className: cn8("flex w-full min-w-0 flex-col gap-px", className)
259
+ }, props)
260
+ );
261
+ }
262
+ function SidebarMenuItem(_a) {
263
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
264
+ return /* @__PURE__ */ jsx9(
265
+ "li",
266
+ __spreadValues({
267
+ "data-slot": "sidebar-menu-item",
268
+ "data-sidebar": "menu-item",
269
+ className: cn8("group/menu-item relative", className)
270
+ }, props)
271
+ );
272
+ }
273
+ var sidebarMenuButtonVariants = cva2(
274
+ "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs 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 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-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
275
+ {
276
+ variants: {
277
+ variant: {
278
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
279
+ outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
280
+ },
281
+ size: {
282
+ default: "h-8 text-xs",
283
+ sm: "h-7 text-xs",
284
+ lg: "h-12 text-xs group-data-[collapsible=icon]:p-0!"
285
+ }
286
+ },
287
+ defaultVariants: {
288
+ variant: "default",
289
+ size: "default"
290
+ }
291
+ }
292
+ );
293
+ function SidebarMenuButton(_a) {
294
+ var _b = _a, {
295
+ render,
296
+ isActive = false,
297
+ variant = "default",
298
+ size = "default",
299
+ tooltip,
300
+ className
301
+ } = _b, props = __objRest(_b, [
302
+ "render",
303
+ "isActive",
304
+ "variant",
305
+ "size",
306
+ "tooltip",
307
+ "className"
308
+ ]);
309
+ const { isMobile, state } = useSidebar();
310
+ const comp = useRender({
311
+ defaultTagName: "button",
312
+ props: mergeProps(
313
+ {
314
+ className: cn8(sidebarMenuButtonVariants({ variant, size }), className)
315
+ },
316
+ props
317
+ ),
318
+ render: !tooltip ? render : /* @__PURE__ */ jsx9(TooltipTrigger, { render }),
319
+ state: {
320
+ slot: "sidebar-menu-button",
321
+ sidebar: "menu-button",
322
+ size,
323
+ active: isActive
324
+ }
325
+ });
326
+ if (!tooltip) {
327
+ return comp;
328
+ }
329
+ if (typeof tooltip === "string") {
330
+ tooltip = {
331
+ children: tooltip
332
+ };
333
+ }
334
+ return /* @__PURE__ */ jsxs4(Tooltip, { children: [
335
+ comp,
336
+ /* @__PURE__ */ jsx9(
337
+ TooltipContent,
338
+ __spreadValues({
339
+ side: "right",
340
+ align: "center",
341
+ hidden: state !== "collapsed" || isMobile
342
+ }, tooltip)
343
+ )
344
+ ] });
345
+ }
346
+
347
+ // src/components/composed/nav-user.tsx
348
+ import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
349
+ var NavUser = memo2(function NavUser2({
350
+ name,
351
+ email,
352
+ image,
353
+ render
354
+ }) {
355
+ const initials = name ? name.trim().split(" ").map((n) => n[0]).join("").substring(0, 2).toUpperCase() : "U";
356
+ return /* @__PURE__ */ jsx10(SidebarFooter, { children: /* @__PURE__ */ jsx10(SidebarMenu, { children: /* @__PURE__ */ jsx10(SidebarMenuItem, { children: /* @__PURE__ */ jsxs5(SidebarMenuButton, { size: "lg", render, children: [
357
+ /* @__PURE__ */ jsxs5(Avatar, { children: [
358
+ /* @__PURE__ */ jsx10(AvatarImage, { src: image || "", alt: name || "" }),
359
+ /* @__PURE__ */ jsx10(AvatarFallback, { children: initials })
360
+ ] }),
361
+ /* @__PURE__ */ jsxs5("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
362
+ /* @__PURE__ */ jsx10("span", { className: "truncate font-medium", children: name }),
363
+ /* @__PURE__ */ jsx10("span", { className: "truncate text-xs text-muted-foreground", children: email })
364
+ ] })
365
+ ] }) }) }) });
366
+ });
17
367
  export {
18
- HeaderTitle
368
+ HeaderTitle,
369
+ NavUser
19
370
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prediktif/ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",