@boeet/next-ui 0.1.0 → 0.1.1

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.
Files changed (58) hide show
  1. package/README.md +107 -3
  2. package/dist/components/app-shell/app-header.d.ts +3 -0
  3. package/dist/components/app-shell/app-header.d.ts.map +1 -0
  4. package/dist/components/app-shell/app-header.js +8 -0
  5. package/dist/components/app-shell/app-header.js.map +1 -0
  6. package/dist/components/app-shell/app-shell-content.d.ts +6 -0
  7. package/dist/components/app-shell/app-shell-content.d.ts.map +1 -0
  8. package/dist/components/app-shell/app-shell-content.js +7 -0
  9. package/dist/components/app-shell/app-shell-content.js.map +1 -0
  10. package/dist/components/app-shell/app-shell-link.d.ts +5 -0
  11. package/dist/components/app-shell/app-shell-link.d.ts.map +1 -0
  12. package/dist/components/app-shell/app-shell-link.js +9 -0
  13. package/dist/components/app-shell/app-shell-link.js.map +1 -0
  14. package/dist/components/app-shell/app-sidebar-nav.d.ts +3 -0
  15. package/dist/components/app-shell/app-sidebar-nav.d.ts.map +1 -0
  16. package/dist/components/app-shell/app-sidebar-nav.js +49 -0
  17. package/dist/components/app-shell/app-sidebar-nav.js.map +1 -0
  18. package/dist/components/app-shell/index.d.ts +7 -0
  19. package/dist/components/app-shell/index.d.ts.map +1 -0
  20. package/dist/components/app-shell/index.js +7 -0
  21. package/dist/components/app-shell/index.js.map +1 -0
  22. package/dist/components/app-shell/sidebar-app-shell.d.ts +3 -0
  23. package/dist/components/app-shell/sidebar-app-shell.d.ts.map +1 -0
  24. package/dist/components/app-shell/sidebar-app-shell.js +12 -0
  25. package/dist/components/app-shell/sidebar-app-shell.js.map +1 -0
  26. package/dist/components/app-shell/top-sidebar-app-shell.d.ts +3 -0
  27. package/dist/components/app-shell/top-sidebar-app-shell.d.ts.map +1 -0
  28. package/dist/components/app-shell/top-sidebar-app-shell.js +12 -0
  29. package/dist/components/app-shell/top-sidebar-app-shell.js.map +1 -0
  30. package/dist/components/app-shell/types.d.ts +54 -0
  31. package/dist/components/app-shell/types.d.ts.map +1 -0
  32. package/dist/components/app-shell/types.js +2 -0
  33. package/dist/components/app-shell/types.js.map +1 -0
  34. package/dist/components/app-shell/utils.d.ts +6 -0
  35. package/dist/components/app-shell/utils.d.ts.map +1 -0
  36. package/dist/components/app-shell/utils.js +22 -0
  37. package/dist/components/app-shell/utils.js.map +1 -0
  38. package/dist/components/theme-switcher/index.d.ts +3 -0
  39. package/dist/components/theme-switcher/index.d.ts.map +1 -0
  40. package/dist/components/theme-switcher/index.js +3 -0
  41. package/dist/components/theme-switcher/index.js.map +1 -0
  42. package/dist/components/theme-switcher/theme-switcher.d.ts +14 -0
  43. package/dist/components/theme-switcher/theme-switcher.d.ts.map +1 -0
  44. package/dist/components/theme-switcher/theme-switcher.js +13 -0
  45. package/dist/components/theme-switcher/theme-switcher.js.map +1 -0
  46. package/dist/components/ui/app-shell.d.ts +2 -0
  47. package/dist/components/ui/app-shell.d.ts.map +1 -0
  48. package/dist/components/ui/app-shell.js +3 -0
  49. package/dist/components/ui/app-shell.js.map +1 -0
  50. package/dist/components/ui/switch.d.ts +3 -2
  51. package/dist/components/ui/switch.d.ts.map +1 -1
  52. package/dist/components/ui/switch.js +3 -3
  53. package/dist/components/ui/switch.js.map +1 -1
  54. package/dist/index.d.ts +2 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +2 -0
  57. package/dist/index.js.map +1 -1
  58. package/package.json +15 -7
package/README.md CHANGED
@@ -3,9 +3,12 @@
3
3
  Reusable React UI components extracted from the Next.js demo and aligned with
4
4
  `design.md`.
5
5
 
6
+ The `next-ui` name identifies the newer BOEET design-system line and separates
7
+ it from earlier BOEET UI libraries. It does not mean this package can only be
8
+ used in Next.js projects.
9
+
6
10
  This package intentionally avoids Next.js-only APIs so it can be published to
7
- npm and consumed by Vite-based tools such as Figma Make, as well as Lovable
8
- design-system projects.
11
+ npm and consumed by Vite-based tools such as Figma Make.
9
12
 
10
13
  ## Install
11
14
 
@@ -50,5 +53,106 @@ export function Example() {
50
53
  }
51
54
  ```
52
55
 
56
+ ## Theme Switcher
57
+
58
+ Use `ThemeSwitcher` as a controlled UI component. Keep theme state management
59
+ in the host app, for example with `next-themes`, and pass a normalized `light`
60
+ or `dark` value into the component. The component renders the `52px x 26px`
61
+ icon switch used in the workbench header and does not manage `html` classes by
62
+ itself. It has no visible label by default; pass `label` only when surrounding
63
+ UI needs visible text.
64
+
65
+ ```tsx
66
+ import { useTheme } from "next-themes"
67
+ import {
68
+ ThemeSwitcher,
69
+ type ThemeMode,
70
+ } from "@boeet/next-ui/theme-switcher"
71
+
72
+ export function AppThemeSwitcher() {
73
+ const { theme, setTheme } = useTheme()
74
+ const currentTheme: ThemeMode = theme === "dark" ? "dark" : "light"
75
+
76
+ return (
77
+ <ThemeSwitcher
78
+ value={currentTheme}
79
+ onValueChange={setTheme}
80
+ ariaLabel="切换深浅主题"
81
+ />
82
+ )
83
+ }
84
+ ```
85
+
86
+ ## App Shell
87
+
88
+ Use `SidebarAppShell` or `TopSidebarAppShell` for admin-style pages that need
89
+ the standard `244px` sidebar, `64px` top bar, `20px` content padding, active
90
+ navigation, expandable submenu, and mobile off-canvas navigation.
91
+
92
+ The app shell components do not depend on Next.js. Pass the current path from
93
+ your router and optionally provide a custom link component. `AppShell` remains
94
+ an alias of `SidebarAppShell` for compatibility.
95
+
96
+ ```tsx
97
+ import type { ReactNode } from "react"
98
+ import {
99
+ SidebarAppShell,
100
+ TopSidebarAppShell,
101
+ type AppShellLinkComponent,
102
+ type AppShellNavItem,
103
+ } from "@boeet/next-ui/app-shell"
104
+
105
+ const navItems: AppShellNavItem[] = [
106
+ { id: "overview", title: "Overview", href: "/overview" },
107
+ {
108
+ id: "examples",
109
+ title: "业务示例",
110
+ href: "/examples/admin",
111
+ children: [
112
+ { id: "examples-admin", title: "后台配置", href: "/examples/admin" },
113
+ { id: "examples-forecast", title: "光伏预测", href: "/examples/forecast" },
114
+ ],
115
+ },
116
+ ]
117
+
118
+ const LinkComponent: AppShellLinkComponent = ({ href, children, ...props }) => (
119
+ <a href={href} {...props}>
120
+ {children}
121
+ </a>
122
+ )
123
+
124
+ export function AdminLayout({ children }: { children: ReactNode }) {
125
+ return (
126
+ <SidebarAppShell
127
+ navItems={navItems}
128
+ currentPath="/overview"
129
+ linkComponent={LinkComponent}
130
+ brand="Design Spec"
131
+ headerTitle="综合能源管理平台"
132
+ defaultExpandedIds={["examples"]}
133
+ >
134
+ {children}
135
+ </SidebarAppShell>
136
+ )
137
+ }
138
+
139
+ export function WorkbenchLayout({ children }: { children: ReactNode }) {
140
+ return (
141
+ <TopSidebarAppShell
142
+ navItems={navItems}
143
+ currentPath="/examples/microgrid"
144
+ linkComponent={LinkComponent}
145
+ brand="Design Spec"
146
+ headerActions="User"
147
+ >
148
+ {children}
149
+ </TopSidebarAppShell>
150
+ )
151
+ }
152
+ ```
153
+
154
+ Keep business-specific right rails or auxiliary card columns inside
155
+ `children`; they are content layout, not app-shell slots.
156
+
53
157
  Use `design.md` as the source of truth for visual rules and
54
- `packages/figma-make-kit` for Lovable/Figma Make handoff guidance.
158
+ `packages/figma-make-kit` for Figma Make handoff guidance.
@@ -0,0 +1,3 @@
1
+ import type { AppHeaderProps } from "./types";
2
+ export declare function AppHeader({ brand, headerTitle, headerDescription, headerActions, className, showSidebarTrigger, sidebarTriggerLabel, sidebarTriggerClassName, }: AppHeaderProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=app-header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-header.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/app-header.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,kBAA0B,EAC1B,mBAA4B,EAC5B,uBAAuB,GACxB,EAAE,cAAc,2CAwChB"}
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../../utils";
4
+ import { SidebarTrigger } from "../ui/sidebar";
5
+ export function AppHeader({ brand, headerTitle, headerDescription, headerActions, className, showSidebarTrigger = false, sidebarTriggerLabel = "打开导航", sidebarTriggerClassName, }) {
6
+ return (_jsxs("header", { "data-slot": "app-header", className: cn("sticky top-0 z-20 flex h-16 items-center justify-between border-b bg-background/95 px-5 shadow-[var(--shadow-float)] backdrop-blur", className), children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [showSidebarTrigger ? (_jsx(SidebarTrigger, { "aria-label": sidebarTriggerLabel, className: cn("rounded-[var(--radius-control)] md:hidden", sidebarTriggerClassName) })) : null, brand ? _jsx("div", { className: "min-w-0 shrink-0", children: brand }) : null, headerTitle || headerDescription ? (_jsxs("div", { className: "min-w-0", children: [headerTitle ? (_jsx("h1", { className: "truncate text-[20px] font-semibold leading-[30px]", children: headerTitle })) : null, headerDescription ? (_jsx("p", { className: "truncate text-[12px] leading-[18px] text-muted-foreground", children: headerDescription })) : null] })) : null] }), headerActions ? (_jsx("div", { className: "flex shrink-0 items-center gap-2", children: headerActions })) : null] }));
7
+ }
8
+ //# sourceMappingURL=app-header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-header.js","sourceRoot":"","sources":["../../../src/components/app-shell/app-header.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAG9C,MAAM,UAAU,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,kBAAkB,GAAG,KAAK,EAC1B,mBAAmB,GAAG,MAAM,EAC5B,uBAAuB,GACR;IACf,OAAO,CACL,+BACY,YAAY,EACtB,SAAS,EAAE,EAAE,CACX,oIAAoI,EACpI,SAAS,CACV,aAED,eAAK,SAAS,EAAC,iCAAiC,aAC7C,kBAAkB,CAAC,CAAC,CAAC,CACpB,KAAC,cAAc,kBACD,mBAAmB,EAC/B,SAAS,EAAE,EAAE,CACX,2CAA2C,EAC3C,uBAAuB,CACxB,GACD,CACH,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,kBAAkB,YAAE,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,EAC9D,WAAW,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAClC,eAAK,SAAS,EAAC,SAAS,aACrB,WAAW,CAAC,CAAC,CAAC,CACb,aAAI,SAAS,EAAC,mDAAmD,YAC9D,WAAW,GACT,CACN,CAAC,CAAC,CAAC,IAAI,EACP,iBAAiB,CAAC,CAAC,CAAC,CACnB,YAAG,SAAS,EAAC,2DAA2D,YACrE,iBAAiB,GAChB,CACL,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,aAAa,CAAC,CAAC,CAAC,CACf,cAAK,SAAS,EAAC,kCAAkC,YAAE,aAAa,GAAO,CACxE,CAAC,CAAC,CAAC,IAAI,IACD,CACV,CAAA;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type * as React from "react";
2
+ export declare function AppShellContent({ children, className, }: {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=app-shell-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-shell-content.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/app-shell-content.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAInC,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,2CASA"}
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cn } from "../../utils";
4
+ export function AppShellContent({ children, className, }) {
5
+ return (_jsx("div", { "data-slot": "app-shell-content", className: cn("mx-auto flex max-w-[1680px] flex-col gap-8 p-5", className), children: children }));
6
+ }
7
+ //# sourceMappingURL=app-shell-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-shell-content.js","sourceRoot":"","sources":["../../../src/components/app-shell/app-shell-content.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAIZ,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,MAAM,UAAU,eAAe,CAAC,EAC9B,QAAQ,EACR,SAAS,GAIV;IACC,OAAO,CACL,2BACY,mBAAmB,EAC7B,SAAS,EAAE,EAAE,CAAC,gDAAgD,EAAE,SAAS,CAAC,YAEzE,QAAQ,GACL,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { AppShellLinkComponent, AppShellLinkProps } from "./types";
2
+ export declare function AppShellLink({ component: LinkComponent, href, children, ...props }: AppShellLinkProps & {
3
+ component?: AppShellLinkComponent;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=app-shell-link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-shell-link.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/app-shell-link.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEvE,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EAAE,aAAa,EACxB,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG;IACrB,SAAS,CAAC,EAAE,qBAAqB,CAAA;CAClC,2CAcA"}
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export function AppShellLink({ component: LinkComponent, href, children, ...props }) {
4
+ if (LinkComponent) {
5
+ return (_jsx(LinkComponent, { href: href, ...props, children: children }));
6
+ }
7
+ return (_jsx("a", { href: href, ...props, children: children }));
8
+ }
9
+ //# sourceMappingURL=app-shell-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-shell-link.js","sourceRoot":"","sources":["../../../src/components/app-shell/app-shell-link.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAIZ,MAAM,UAAU,YAAY,CAAC,EAC3B,SAAS,EAAE,aAAa,EACxB,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EAGT;IACC,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CACL,KAAC,aAAa,IAAC,IAAI,EAAE,IAAI,KAAM,KAAK,YACjC,QAAQ,GACK,CACjB,CAAA;IACH,CAAC;IAED,OAAO,CACL,YAAG,IAAI,EAAE,IAAI,KAAM,KAAK,YACrB,QAAQ,GACP,CACL,CAAA;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { AppSidebarNavProps } from "./types";
2
+ export declare function AppSidebarNav({ navItems, currentPath, linkComponent, defaultExpandedIds, isItemActive, }: AppSidebarNavProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=app-sidebar-nav.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-sidebar-nav.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/app-sidebar-nav.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAmB,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAElE,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,WAAW,EACX,aAAa,EACb,kBAAuB,EACvB,YAAY,GACb,EAAE,kBAAkB,2CAkIpB"}
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { ChevronDownIcon } from "lucide-react";
5
+ import { cn } from "../../utils";
6
+ import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, } from "../ui/sidebar";
7
+ import { AppShellLink } from "./app-shell-link";
8
+ import { getItemActive } from "./utils";
9
+ export function AppSidebarNav({ navItems, currentPath, linkComponent, defaultExpandedIds = [], isItemActive, }) {
10
+ const activeParentIds = React.useMemo(() => {
11
+ return navItems
12
+ .filter((item) => item.children?.some((child) => getItemActive(child, currentPath, isItemActive)))
13
+ .map((item) => item.id);
14
+ }, [currentPath, isItemActive, navItems]);
15
+ const [expandedIds, setExpandedIds] = React.useState(() => {
16
+ return new Set([...defaultExpandedIds, ...activeParentIds]);
17
+ });
18
+ React.useEffect(() => {
19
+ const requiredIds = [...defaultExpandedIds, ...activeParentIds];
20
+ setExpandedIds((current) => {
21
+ if (requiredIds.every((id) => current.has(id))) {
22
+ return current;
23
+ }
24
+ return new Set([...current, ...requiredIds]);
25
+ });
26
+ }, [activeParentIds, defaultExpandedIds]);
27
+ const isActive = React.useCallback((item) => {
28
+ return getItemActive(item, currentPath, isItemActive);
29
+ }, [currentPath, isItemActive]);
30
+ return (_jsx(SidebarMenu, { className: "gap-1", children: navItems.map((item) => {
31
+ const Icon = item.icon;
32
+ const itemIsActive = isActive(item);
33
+ if (item.children?.length) {
34
+ const isExpanded = expandedIds.has(item.id);
35
+ return (_jsxs(SidebarMenuItem, { children: [_jsxs(SidebarMenuButton, { type: "button", "aria-expanded": isExpanded, onClick: () => setExpandedIds((current) => {
36
+ const next = new Set(current);
37
+ if (next.has(item.id)) {
38
+ next.delete(item.id);
39
+ }
40
+ else {
41
+ next.add(item.id);
42
+ }
43
+ return next;
44
+ }), isActive: itemIsActive, tooltip: item.title, className: cn("h-11 gap-3 rounded-[var(--radius-control)] px-3 text-[14px] leading-5", "data-[active=true]:bg-primary/10 data-[active=true]:text-primary dark:data-[active=true]:bg-primary/15"), children: [Icon ? _jsx(Icon, {}) : null, _jsx("span", { className: "min-w-0 flex-1 truncate", children: item.title }), _jsx(ChevronDownIcon, { className: cn("size-4 transition-transform", isExpanded && "rotate-180") })] }), isExpanded ? (_jsx(SidebarMenuSub, { className: "ml-7 gap-1 px-2 py-0.5", children: item.children.map((child) => (_jsx(SidebarMenuSubItem, { children: _jsx(SidebarMenuSubButton, { asChild: true, isActive: isActive(child), className: cn("h-9 rounded-[var(--radius-control)] px-3 text-[13px] leading-5", "data-[active=true]:bg-primary/10 data-[active=true]:text-primary dark:data-[active=true]:bg-primary/15"), children: _jsx(AppShellLink, { component: linkComponent, href: child.href ?? "#", "aria-current": isActive(child) ? "page" : undefined, children: _jsx("span", { children: child.title }) }) }) }, child.id))) })) : null] }, item.id));
45
+ }
46
+ return (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, isActive: itemIsActive, tooltip: item.title, className: cn("h-11 gap-3 rounded-[var(--radius-control)] px-3 text-[14px] leading-5", "data-[active=true]:bg-primary/10 data-[active=true]:text-primary dark:data-[active=true]:bg-primary/15"), children: _jsxs(AppShellLink, { component: linkComponent, href: item.href ?? "#", "aria-current": itemIsActive ? "page" : undefined, children: [Icon ? _jsx(Icon, {}) : null, _jsx("span", { children: item.title })] }) }) }, item.id));
47
+ }) }));
48
+ }
49
+ //# sourceMappingURL=app-sidebar-nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-sidebar-nav.js","sourceRoot":"","sources":["../../../src/components/app-shell/app-sidebar-nav.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAChC,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,eAAe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aAE9C,IAAI,CAAC,CAAC,CAAC,KAAC,IAAI,KAAG,CAAC,CAAC,CAAC,IAAI,EACvB,yBAAO,IAAI,CAAC,KAAK,GAAQ,IACZ,GACG,IAlBA,IAAI,CAAC,EAAE,CAmBX,CACnB,CAAA;QACH,CAAC,CAAC,GACU,CACf,CAAA;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ export type { AppHeaderProps, AppShellIcon, AppShellLinkComponent, AppShellLinkProps, AppShellNavItem, AppShellProps, AppSidebarNavProps, SidebarAppShellProps, TopSidebarAppShellProps, } from "./types";
2
+ export { AppHeader } from "./app-header";
3
+ export { AppSidebarNav } from "./app-sidebar-nav";
4
+ export { SidebarAppShell } from "./sidebar-app-shell";
5
+ export { TopSidebarAppShell } from "./top-sidebar-app-shell";
6
+ export { SidebarAppShell as AppShell } from "./sidebar-app-shell";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ export { AppHeader } from "./app-header";
3
+ export { AppSidebarNav } from "./app-sidebar-nav";
4
+ export { SidebarAppShell } from "./sidebar-app-shell";
5
+ export { TopSidebarAppShell } from "./top-sidebar-app-shell";
6
+ export { SidebarAppShell as AppShell } from "./sidebar-app-shell";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/app-shell/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAaZ,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { SidebarAppShellProps } from "./types";
2
+ export declare function SidebarAppShell({ navItems, currentPath, children, linkComponent, brand, headerTitle, headerDescription, headerActions, sidebarWidth, sidebarIconWidth, defaultExpandedIds, isItemActive, className, sidebarClassName, headerClassName, contentClassName, sidebarTriggerLabel, }: SidebarAppShellProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=sidebar-app-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-app-shell.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/sidebar-app-shell.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,aAAa,EACb,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,YAAsB,EACtB,gBAAyB,EACzB,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,mBAA4B,GAC7B,EAAE,oBAAoB,2CAsCtB"}
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../../utils";
4
+ import { Sidebar, SidebarContent, SidebarHeader, SidebarInset, SidebarProvider, } from "../ui/sidebar";
5
+ import { AppHeader } from "./app-header";
6
+ import { AppShellContent } from "./app-shell-content";
7
+ import { AppSidebarNav } from "./app-sidebar-nav";
8
+ import { getSidebarProviderStyle } from "./utils";
9
+ export function SidebarAppShell({ navItems, currentPath, children, linkComponent, brand, headerTitle, headerDescription, headerActions, sidebarWidth = "244px", sidebarIconWidth = "48px", defaultExpandedIds, isItemActive, className, sidebarClassName, headerClassName, contentClassName, sidebarTriggerLabel = "打开导航", }) {
10
+ return (_jsxs(SidebarProvider, { className: cn("min-h-screen bg-background text-foreground", className), style: getSidebarProviderStyle(sidebarWidth, sidebarIconWidth), children: [_jsxs(Sidebar, { collapsible: "offcanvas", className: cn("shadow-[var(--shadow-float)]", sidebarClassName), children: [brand ? (_jsx(SidebarHeader, { className: "h-16 justify-center border-b px-5 py-0", children: brand })) : null, _jsx(SidebarContent, { className: "px-3 py-4", children: _jsx(AppSidebarNav, { navItems: navItems, currentPath: currentPath, linkComponent: linkComponent, defaultExpandedIds: defaultExpandedIds, isItemActive: isItemActive }) })] }), _jsxs(SidebarInset, { className: "min-h-screen", children: [_jsx(AppHeader, { headerTitle: headerTitle, headerDescription: headerDescription, headerActions: headerActions, showSidebarTrigger: true, sidebarTriggerLabel: sidebarTriggerLabel, className: headerClassName }), _jsx(AppShellContent, { className: contentClassName, children: children })] })] }));
11
+ }
12
+ //# sourceMappingURL=sidebar-app-shell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-app-shell.js","sourceRoot":"","sources":["../../../src/components/app-shell/sidebar-app-shell.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAChC,OAAO,EACL,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,GAChB,MAAM,eAAe,CAAA;AACt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EACxC,SAAS,EAAE,eAAe,GAC1B,EACF,KAAC,eAAe,IAAC,SAAS,EAAE,gBAAgB,YAAG,QAAQ,GAAmB,IAC7D,IACC,CACnB,CAAA;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { TopSidebarAppShellProps } from "./types";
2
+ export declare function TopSidebarAppShell({ navItems, currentPath, children, linkComponent, brand, headerTitle, headerDescription, headerActions, sidebarWidth, sidebarIconWidth, defaultExpandedIds, isItemActive, className, sidebarClassName, headerClassName, contentClassName, sidebarTriggerLabel, }: TopSidebarAppShellProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=top-sidebar-app-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top-sidebar-app-shell.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/top-sidebar-app-shell.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAEtD,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,aAAa,EACb,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,YAAsB,EACtB,gBAAyB,EACzB,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,mBAA4B,GAC7B,EAAE,uBAAuB,2CA4CzB"}
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../../utils";
4
+ import { Sidebar, SidebarContent, SidebarInset, SidebarProvider, } from "../ui/sidebar";
5
+ import { AppHeader } from "./app-header";
6
+ import { AppShellContent } from "./app-shell-content";
7
+ import { AppSidebarNav } from "./app-sidebar-nav";
8
+ import { getSidebarProviderStyle } from "./utils";
9
+ export function TopSidebarAppShell({ navItems, currentPath, children, linkComponent, brand, headerTitle, headerDescription, headerActions, sidebarWidth = "244px", sidebarIconWidth = "48px", defaultExpandedIds, isItemActive, className, sidebarClassName, headerClassName, contentClassName, sidebarTriggerLabel = "打开导航", }) {
10
+ return (_jsxs(SidebarProvider, { className: cn("min-h-screen flex-col bg-background text-foreground", className), style: getSidebarProviderStyle(sidebarWidth, sidebarIconWidth), children: [_jsx(AppHeader, { brand: brand, headerTitle: headerTitle, headerDescription: headerDescription, headerActions: headerActions, showSidebarTrigger: true, sidebarTriggerLabel: sidebarTriggerLabel, className: headerClassName }), _jsxs("div", { className: "flex min-h-0 flex-1", children: [_jsx(Sidebar, { collapsible: "offcanvas", className: cn("shadow-[var(--shadow-float)] md:top-16 md:h-[calc(100svh-4rem)]", sidebarClassName), children: _jsx(SidebarContent, { className: "px-3 py-4", children: _jsx(AppSidebarNav, { navItems: navItems, currentPath: currentPath, linkComponent: linkComponent, defaultExpandedIds: defaultExpandedIds, isItemActive: isItemActive }) }) }), _jsx(SidebarInset, { className: "min-h-[calc(100svh-4rem)]", children: _jsx(AppShellContent, { className: contentClassName, children: children }) })] })] }));
11
+ }
12
+ //# sourceMappingURL=top-sidebar-app-shell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top-sidebar-app-shell.js","sourceRoot":"","sources":["../../../src/components/app-shell/top-sidebar-app-shell.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAChC,OAAO,EACL,OAAO,EACP,cAAc,EACd,YAAY,EACZ,eAAe,GAChB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAGjD,MAAM,UAAU,kBAAkB,CAAC,EACjC,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,aAAa,EACb,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,YAAY,GAAG,OAAO,EACtB,gBAAgB,GAAG,MAAM,EACzB,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,GAAG,MAAM,GACJ;IACxB,OAAO,CACL,MAAC,eAAe,IACd,SAAS,EAAE,EAAE,CACX,qDAAqD,EACrD,SAAS,CACV,EACD,KAAK,EAAE,uBAAuB,CAAC,YAAY,EAAE,gBAAgB,CAAC,aAE9D,KAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,kBAAkB,QAClB,mBAAmB,EAAE,mBAAmB,EACxC,SAAS,EAAE,eAAe,GAC1B,EACF,eAAK,SAAS,EAAC,qBAAqB,aAClC,KAAC,OAAO,IACN,WAAW,EAAC,WAAW,EACvB,SAAS,EAAE,EAAE,CACX,iEAAiE,EACjE,gBAAgB,CACjB,YAED,KAAC,cAAc,IAAC,SAAS,EAAC,WAAW,YACnC,KAAC,aAAa,IACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,GAC1B,GACa,GACT,EACV,KAAC,YAAY,IAAC,SAAS,EAAC,2BAA2B,YACjD,KAAC,eAAe,IAAC,SAAS,EAAE,gBAAgB,YACzC,QAAQ,GACO,GACL,IACX,IACU,CACnB,CAAA;AACH,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type * as React from "react";
2
+ export type AppShellIcon = React.ComponentType<React.SVGProps<SVGSVGElement>>;
3
+ export type AppShellNavItem = {
4
+ id: string;
5
+ title: string;
6
+ href?: string;
7
+ icon?: AppShellIcon;
8
+ children?: AppShellNavItem[];
9
+ };
10
+ export type AppShellLinkProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & {
11
+ href: string;
12
+ children: React.ReactNode;
13
+ };
14
+ export type AppShellLinkComponent = React.ComponentType<AppShellLinkProps>;
15
+ export type AppSidebarNavProps = {
16
+ navItems: AppShellNavItem[];
17
+ currentPath: string;
18
+ linkComponent?: AppShellLinkComponent;
19
+ defaultExpandedIds?: string[];
20
+ isItemActive?: (item: AppShellNavItem, currentPath: string) => boolean;
21
+ };
22
+ export type AppHeaderProps = {
23
+ brand?: React.ReactNode;
24
+ headerTitle?: React.ReactNode;
25
+ headerDescription?: React.ReactNode;
26
+ headerActions?: React.ReactNode;
27
+ className?: string;
28
+ showSidebarTrigger?: boolean;
29
+ sidebarTriggerLabel?: string;
30
+ sidebarTriggerClassName?: string;
31
+ };
32
+ export type AppShellBaseProps = {
33
+ navItems: AppShellNavItem[];
34
+ currentPath: string;
35
+ children: React.ReactNode;
36
+ linkComponent?: AppShellLinkComponent;
37
+ brand?: React.ReactNode;
38
+ headerTitle?: React.ReactNode;
39
+ headerDescription?: React.ReactNode;
40
+ headerActions?: React.ReactNode;
41
+ sidebarWidth?: string;
42
+ sidebarIconWidth?: string;
43
+ defaultExpandedIds?: string[];
44
+ isItemActive?: (item: AppShellNavItem, currentPath: string) => boolean;
45
+ className?: string;
46
+ sidebarClassName?: string;
47
+ headerClassName?: string;
48
+ contentClassName?: string;
49
+ sidebarTriggerLabel?: string;
50
+ };
51
+ export type SidebarAppShellProps = AppShellBaseProps;
52
+ export type TopSidebarAppShellProps = AppShellBaseProps;
53
+ export type AppShellProps = SidebarAppShellProps;
54
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAEnC,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa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Q,EAAE,eAAe,EAAE,CAAA;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,qBAAqB,CAAA;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAA;IACtE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAA;AACpD,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAA;AACvD,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/app-shell/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type * as React from "react";
2
+ import type { AppShellNavItem } from "./types";
3
+ export declare function normalizePath(path: string): string;
4
+ export declare function getItemActive(item: AppShellNavItem, currentPath: string, isItemActive?: (item: AppShellNavItem, currentPath: string) => boolean): boolean;
5
+ export declare function getSidebarProviderStyle(sidebarWidth: string, sidebarIconWidth: string): React.CSSProperties;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAEnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,UAMzC;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,eAAe,EACrB,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,GACrE,OAAO,CAgBT;AAED,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,GACvB,KAAK,CAAC,aAAa,CAKrB"}
@@ -0,0 +1,22 @@
1
+ export function normalizePath(path) {
2
+ if (path.length > 1 && path.endsWith("/")) {
3
+ return path.slice(0, -1);
4
+ }
5
+ return path;
6
+ }
7
+ export function getItemActive(item, currentPath, isItemActive) {
8
+ if (isItemActive?.(item, currentPath)) {
9
+ return true;
10
+ }
11
+ if (item.children?.some((child) => getItemActive(child, currentPath, isItemActive))) {
12
+ return true;
13
+ }
14
+ return Boolean(item.href && normalizePath(item.href) === normalizePath(currentPath));
15
+ }
16
+ export function getSidebarProviderStyle(sidebarWidth, sidebarIconWidth) {
17
+ return {
18
+ "--sidebar-width": sidebarWidth,
19
+ "--sidebar-width-icon": sidebarIconWidth,
20
+ };
21
+ }
22
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/app-shell/utils.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAC1B,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,IAAqB,EACrB,WAAmB,EACnB,YAAsE;IAEtE,IAAI,YAAY,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IACE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5B,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,CAAC,CAChD,EACD,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,OAAO,CACZ,IAAI,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,aAAa,CAAC,WAAW,CAAC,CACrE,CAAA;AACH,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,YAAoB,EACpB,gBAAwB;IAExB,OAAO;QACL,iBAAiB,EAAE,YAAY;QAC/B,sBAAsB,EAAE,gBAAgB;KAClB,CAAA;AAC1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { ThemeSwitcher } from "./theme-switcher";
2
+ export type { ThemeMode, ThemeSwitcherProps } from "./theme-switcher";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/theme-switcher/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ export { ThemeSwitcher } from "./theme-switcher";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/theme-switcher/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ export type ThemeMode = "light" | "dark";
3
+ export type ThemeSwitcherProps = {
4
+ value?: ThemeMode;
5
+ onValueChange?: (theme: ThemeMode) => void;
6
+ label?: React.ReactNode;
7
+ ariaLabel?: string;
8
+ className?: string;
9
+ switchClassName?: string;
10
+ id?: string;
11
+ disabled?: boolean;
12
+ };
13
+ export declare function ThemeSwitcher({ value, onValueChange, label, ariaLabel, className, switchClassName, id, disabled, }: ThemeSwitcherProps): import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=theme-switcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-switcher.d.ts","sourceRoot":"","sources":["../../../src/components/theme-switcher/theme-switcher.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAe,EACf,aAAa,EACb,KAAY,EACZ,SAAoB,EACpB,SAAS,EACT,eAAe,EACf,EAAE,EACF,QAAQ,GACT,EAAE,kBAAkB,2CAsCpB"}
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { MoonIcon, SunIcon } from "lucide-react";
5
+ import { cn } from "../../utils";
6
+ import { Switch } from "../ui/switch";
7
+ export function ThemeSwitcher({ value = "light", onValueChange, label = null, ariaLabel = "切换深浅主题", className, switchClassName, id, disabled, }) {
8
+ const generatedId = React.useId();
9
+ const switchId = id ?? generatedId;
10
+ const checked = value === "dark";
11
+ return (_jsxs("div", { className: cn("flex items-center gap-2", className), children: [_jsxs(Switch, { id: switchId, size: "theme", checked: checked, disabled: disabled, "aria-label": typeof label === "string" ? label : ariaLabel, className: cn("border-0 bg-[#eff2f7] p-0 shadow-[inset_0_0_0_1px_rgba(224,224,230,0.45)] data-checked:bg-[var(--color-dark-control)] data-unchecked:bg-[#eff2f7] dark:data-unchecked:bg-[#eff2f7]", switchClassName), thumbClassName: "relative z-10 bg-white shadow-[0_1px_4px_rgba(16,16,21,0.20)] dark:bg-white dark:data-checked:bg-white dark:data-unchecked:bg-white", onCheckedChange: (nextChecked) => onValueChange?.(nextChecked ? "dark" : "light"), children: [_jsx(SunIcon, { className: "pointer-events-none absolute left-[7px] z-0 size-[12px] text-[var(--color-warning-token)] opacity-0 transition-opacity group-data-checked/switch:opacity-100" }), _jsx(MoonIcon, { className: "pointer-events-none absolute right-[8px] z-0 size-[12px] text-[var(--color-warning-token)] opacity-100 transition-opacity group-data-checked/switch:opacity-0" })] }), label ? (_jsx("label", { htmlFor: switchId, className: cn("cursor-pointer text-[14px] leading-5 text-muted-foreground", disabled && "cursor-not-allowed opacity-50"), children: label })) : null] }));
12
+ }
13
+ //# sourceMappingURL=theme-switcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-switcher.js","sourceRoot":"","sources":["../../../src/components/theme-switcher/theme-switcher.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OA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,YAEA,KAAK,GACA,CACT,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "../app-shell";
2
+ //# sourceMappingURL=app-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../../src/components/ui/app-shell.tsx"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ export * from "../app-shell";
3
+ //# sourceMappingURL=app-shell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-shell.js","sourceRoot":"","sources":["../../../src/components/ui/app-shell.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,cAAc,cAAc,CAAA"}
@@ -1,7 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { Switch as SwitchPrimitive } from "radix-ui";
3
- declare function Switch({ className, size, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
4
- size?: "sm" | "default";
3
+ declare function Switch({ className, thumbClassName, size, children, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
4
+ size?: "sm" | "default" | "theme";
5
+ thumbClassName?: string;
5
6
  }): import("react/jsx-runtime").JSX.Element;
6
7
  export { Switch };
7
8
  //# sourceMappingURL=switch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/ui/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAIpD,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAAG;IACrD,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CACxB,2CAiBA;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/ui/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAIpD,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,cAAc,EACd,IAAgB,EAChB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAAG;IACrD,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAA;IACjC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,2CAqBA;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Switch as SwitchPrimitive } from "radix-ui";
4
4
  import { cn } from "../../utils";
5
- function Switch({ className, size = "default", ...props }) {
6
- return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground" }) }));
5
+ function Switch({ className, thumbClassName, size = "default", children, ...props }) {
6
+ return (_jsxs(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] data-[size=theme]:h-[26px] data-[size=theme]:w-[52px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50", className), ...props, children: [children, _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: cn("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=theme]/switch:size-[22px] group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=theme]/switch:data-checked:translate-x-[26px] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 group-data-[size=theme]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground", thumbClassName) })] }));
7
7
  }
8
8
  export { Switch };
9
9
  //# sourceMappingURL=switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/components/ui/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,SAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAI,GAAG,SAAS,EAChB,GAAG,KAAK,EAGT;IACC,OAAO,CACL,KAAC,eAAe,CAAC,IAAI,iBACT,QAAQ,eACP,IAAI,EACf,SAAS,EAAE,EAAE,CACX,qpBAAqpB,EACrpB,SAAS,CACV,KACG,KAAK,YAET,KAAC,eAAe,CAAC,KAAK,iBACV,cAAc,EACxB,SAAS,EAAC,+eAA+e,GACzf,GACmB,CACxB,CAAA;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/components/ui/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,SAAS,MAAM,CAAC,EACd,SAAS,EACT,cAAc,EACd,IAAI,GAAG,SAAS,EAChB,QAAQ,EACR,GAAG,KAAK,EAIT;IACC,OAAO,CACL,MAAC,eAAe,CAAC,IAAI,iBACT,QAAQ,eACP,IAAI,EACf,SAAS,EAAE,EAAE,CACX,2sBAA2sB,EAC3sB,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACT,KAAC,eAAe,CAAC,KAAK,iBACV,cAAc,EACxB,SAAS,EAAE,EAAE,CACX,qpBAAqpB,EACrpB,cAAc,CACf,GACD,IACmB,CACxB,CAAA;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./components/ui/alert";
2
2
  export * from "./components/ui/alert-dialog";
3
+ export * from "./components/ui/app-shell";
3
4
  export * from "./components/ui/avatar";
4
5
  export * from "./components/ui/badge";
5
6
  export * from "./components/ui/breadcrumb";
@@ -31,6 +32,7 @@ export * from "./components/ui/textarea";
31
32
  export * from "./components/ui/toggle";
32
33
  export * from "./components/ui/toggle-group";
33
34
  export * from "./components/ui/tooltip";
35
+ export * from "./components/theme-switcher";
34
36
  export * from "./hooks/use-mobile";
35
37
  export * from "./utils";
36
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oBAAoB,CAAA;AAClC,cAAc,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./components/ui/alert";
2
2
  export * from "./components/ui/alert-dialog";
3
+ export * from "./components/ui/app-shell";
3
4
  export * from "./components/ui/avatar";
4
5
  export * from "./components/ui/badge";
5
6
  export * from "./components/ui/breadcrumb";
@@ -31,6 +32,7 @@ export * from "./components/ui/textarea";
31
32
  export * from "./components/ui/toggle";
32
33
  export * from "./components/ui/toggle-group";
33
34
  export * from "./components/ui/tooltip";
35
+ export * from "./components/theme-switcher";
34
36
  export * from "./hooks/use-mobile";
35
37
  export * from "./utils";
36
38
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oBAAoB,CAAA;AAClC,cAAc,SAAS,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boeet/next-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,6 +18,14 @@
18
18
  "types": "./dist/hooks/use-mobile.d.ts",
19
19
  "import": "./dist/hooks/use-mobile.js"
20
20
  },
21
+ "./app-shell": {
22
+ "types": "./dist/components/app-shell/index.d.ts",
23
+ "import": "./dist/components/app-shell/index.js"
24
+ },
25
+ "./theme-switcher": {
26
+ "types": "./dist/components/theme-switcher/index.d.ts",
27
+ "import": "./dist/components/theme-switcher/index.js"
28
+ },
21
29
  "./*": {
22
30
  "types": "./dist/components/ui/*.d.ts",
23
31
  "import": "./dist/components/ui/*.js"
@@ -35,11 +43,15 @@
35
43
  "sideEffects": [
36
44
  "**/*.css"
37
45
  ],
46
+ "scripts": {
47
+ "build": "tsc -p tsconfig.json"
48
+ },
38
49
  "peerDependencies": {
39
50
  "react": ">=18 <20",
40
51
  "react-dom": ">=18 <20"
41
52
  },
42
53
  "dependencies": {
54
+ "@boeet/next-tokens": "workspace:*",
43
55
  "class-variance-authority": "^0.7.1",
44
56
  "clsx": "^2.1.1",
45
57
  "lucide-react": "^1.16.0",
@@ -47,15 +59,11 @@
47
59
  "react-day-picker": "^10.0.1",
48
60
  "recharts": "^3.8.0",
49
61
  "sonner": "^2.0.7",
50
- "tailwind-merge": "^3.6.0",
51
- "@boeet/next-tokens": "0.1.0"
62
+ "tailwind-merge": "^3.6.0"
52
63
  },
53
64
  "devDependencies": {
54
65
  "@types/react": "^19",
55
66
  "@types/react-dom": "^19",
56
67
  "typescript": "^5"
57
- },
58
- "scripts": {
59
- "build": "tsc -p tsconfig.json"
60
68
  }
61
- }
69
+ }