@tribepad/themis 1.0.19 → 1.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 (42) hide show
  1. package/dist/elements/Sidebar/Sidebar.styles.d.ts +41 -0
  2. package/dist/elements/Sidebar/Sidebar.styles.d.ts.map +1 -0
  3. package/dist/elements/Sidebar/Sidebar.types.d.ts +238 -0
  4. package/dist/elements/Sidebar/Sidebar.types.d.ts.map +1 -0
  5. package/dist/elements/Sidebar/SidebarCompound.d.ts +39 -0
  6. package/dist/elements/Sidebar/SidebarCompound.d.ts.map +1 -0
  7. package/dist/elements/Sidebar/SidebarMobileDrawer.d.ts +7 -0
  8. package/dist/elements/Sidebar/SidebarMobileDrawer.d.ts.map +1 -0
  9. package/dist/elements/Sidebar/SidebarPanel.d.ts +21 -0
  10. package/dist/elements/Sidebar/SidebarPanel.d.ts.map +1 -0
  11. package/dist/elements/Sidebar/SidebarPopover.d.ts +13 -0
  12. package/dist/elements/Sidebar/SidebarPopover.d.ts.map +1 -0
  13. package/dist/elements/Sidebar/SidebarRail.d.ts +10 -0
  14. package/dist/elements/Sidebar/SidebarRail.d.ts.map +1 -0
  15. package/dist/elements/Sidebar/SidebarRoot.d.ts +26 -0
  16. package/dist/elements/Sidebar/SidebarRoot.d.ts.map +1 -0
  17. package/dist/elements/Sidebar/index.d.ts +5 -0
  18. package/dist/elements/Sidebar/index.d.ts.map +1 -0
  19. package/dist/elements/Sidebar/index.js +3 -0
  20. package/dist/elements/Sidebar/index.js.map +1 -0
  21. package/dist/elements/Sidebar/index.mjs +3 -0
  22. package/dist/elements/Sidebar/index.mjs.map +1 -0
  23. package/dist/elements/index.d.ts +4 -0
  24. package/dist/elements/index.d.ts.map +1 -1
  25. package/dist/elements/index.js +1 -1
  26. package/dist/elements/index.js.map +1 -1
  27. package/dist/elements/index.mjs +1 -1
  28. package/dist/elements/index.mjs.map +1 -1
  29. package/dist/hooks/index.d.ts +1 -0
  30. package/dist/hooks/index.d.ts.map +1 -1
  31. package/dist/hooks/index.js +1 -1
  32. package/dist/hooks/index.js.map +1 -1
  33. package/dist/hooks/index.mjs +1 -1
  34. package/dist/hooks/index.mjs.map +1 -1
  35. package/dist/hooks/useMediaQuery.d.ts +12 -0
  36. package/dist/hooks/useMediaQuery.d.ts.map +1 -0
  37. package/dist/index.js +2 -2
  38. package/dist/index.js.map +1 -1
  39. package/dist/index.mjs +2 -2
  40. package/dist/index.mjs.map +1 -1
  41. package/package.json +6 -1
  42. package/src/elements/Sidebar/Sidebar.stories.tsx +559 -0
@@ -0,0 +1,41 @@
1
+ export declare const sidebarRootVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
2
+ export declare const sidebarRailVariants: (props?: ({
3
+ variant?: "default" | "primary" | null | undefined;
4
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
+ export declare const sidebarRailToolbarVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
+ /**
7
+ * Rail item outer — the interactive element (link or button).
8
+ * Actual size exceeds the 44x44 touch target floor due to icon + label stacking.
9
+ */
10
+ export declare const sidebarRailItemVariants: (props?: ({
11
+ railVariant?: "default" | "primary" | null | undefined;
12
+ isActive?: boolean | null | undefined;
13
+ isDisabled?: boolean | null | undefined;
14
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
15
+ export declare const sidebarRailItemIconVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
16
+ export declare const sidebarRailItemLabelVariants: (props?: ({
17
+ isActive?: boolean | null | undefined;
18
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
19
+ export declare const sidebarRailItemBadgeVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
20
+ /**
21
+ * Popover overlay — fills the panel area, same look as the panel.
22
+ * Appears over the panel when a rail item with popover content is hovered/focused.
23
+ */
24
+ export declare const sidebarPopoverVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
25
+ export declare const sidebarPanelVariants: (props?: ({
26
+ width?: "sm" | "lg" | "md" | "xl" | null | undefined;
27
+ isCollapsed?: boolean | null | undefined;
28
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
29
+ export declare const sidebarPanelHeaderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
30
+ export declare const sidebarPanelHeaderTitleVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
31
+ export declare const sidebarCollapseButtonVariants: (props?: ({
32
+ railVariant?: "default" | "primary" | null | undefined;
33
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
34
+ export declare const sidebarMobileOverlayVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
35
+ export declare const sidebarMobileDrawerVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
36
+ export declare const sidebarMobileDrawerHeaderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
37
+ export declare const sidebarMobileRailVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
38
+ export declare const sidebarMobileRailItemVariants: (props?: ({
39
+ isActive?: boolean | null | undefined;
40
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
41
+ //# sourceMappingURL=Sidebar.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.styles.d.ts","sourceRoot":"","sources":["../../../src/elements/Sidebar/Sidebar.styles.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,mBAAmB,oFAG9B,CAAC;AAMH,eAAO,MAAM,mBAAmB;;8EAwB/B,CAAC;AAEF,eAAO,MAAM,0BAA0B,oFAIrC,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;8EAsDnC,CAAC;AAEF,eAAO,MAAM,2BAA2B,oFAKtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;8EAmBxC,CAAC;AAEF,eAAO,MAAM,4BAA4B,oFAgBvC,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,sBAAsB,oFAajC,CAAC;AAMH,eAAO,MAAM,oBAAoB;;;8EA8BhC,CAAC;AAEF,eAAO,MAAM,0BAA0B,oFASrC,CAAC;AAEH,eAAO,MAAM,+BAA+B,oFAK1C,CAAC;AAMH,eAAO,MAAM,6BAA6B;;8EAkCzC,CAAC;AAMF,eAAO,MAAM,4BAA4B,oFAKvC,CAAC;AAEH,eAAO,MAAM,2BAA2B,oFAWtC,CAAC;AAEH,eAAO,MAAM,iCAAiC,oFAS5C,CAAC;AAEH,eAAO,MAAM,yBAAyB,oFAYpC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;8EAoCzC,CAAC"}
@@ -0,0 +1,238 @@
1
+ import { z } from 'zod';
2
+ import type { ReactNode, ReactElement } from 'react';
3
+ export declare const SidebarRailVariantSchema: z.ZodEnum<{
4
+ default: "default";
5
+ primary: "primary";
6
+ }>;
7
+ export type SidebarRailVariant = z.infer<typeof SidebarRailVariantSchema>;
8
+ export declare const SidebarPanelWidthSchema: z.ZodEnum<{
9
+ sm: "sm";
10
+ lg: "lg";
11
+ md: "md";
12
+ xl: "xl";
13
+ }>;
14
+ export type SidebarPanelWidth = z.infer<typeof SidebarPanelWidthSchema>;
15
+ export declare const SidebarCurrentTypeSchema: z.ZodEnum<{
16
+ true: "true";
17
+ page: "page";
18
+ location: "location";
19
+ }>;
20
+ export type SidebarCurrentType = z.infer<typeof SidebarCurrentTypeSchema>;
21
+ export declare const SidebarPanelHeaderLevelSchema: z.ZodEnum<{
22
+ h1: "h1";
23
+ h2: "h2";
24
+ h3: "h3";
25
+ h4: "h4";
26
+ }>;
27
+ export type SidebarPanelHeaderLevel = z.infer<typeof SidebarPanelHeaderLevelSchema>;
28
+ export declare const SidebarPropsSchema: z.ZodObject<{
29
+ className: z.ZodOptional<z.ZodString>;
30
+ id: z.ZodOptional<z.ZodString>;
31
+ 'aria-label': z.ZodOptional<z.ZodString>;
32
+ 'aria-labelledby': z.ZodOptional<z.ZodString>;
33
+ 'aria-describedby': z.ZodOptional<z.ZodString>;
34
+ 'aria-live': z.ZodOptional<z.ZodEnum<{
35
+ off: "off";
36
+ polite: "polite";
37
+ assertive: "assertive";
38
+ }>>;
39
+ 'aria-hidden': z.ZodOptional<z.ZodBoolean>;
40
+ 'data-testid': z.ZodOptional<z.ZodString>;
41
+ children: z.ZodCustom<ReactNode, ReactNode>;
42
+ isCollapsed: z.ZodOptional<z.ZodBoolean>;
43
+ defaultCollapsed: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
44
+ onCollapsedChange: z.ZodOptional<z.ZodCustom<(collapsed: boolean) => void, (collapsed: boolean) => void>>;
45
+ isMobileOpen: z.ZodOptional<z.ZodBoolean>;
46
+ onMobileOpenChange: z.ZodOptional<z.ZodCustom<(open: boolean) => void, (open: boolean) => void>>;
47
+ mobileBreakpoint: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
48
+ }, z.core.$strip>;
49
+ export interface SidebarProps {
50
+ children: ReactNode;
51
+ isCollapsed?: boolean;
52
+ defaultCollapsed?: boolean;
53
+ onCollapsedChange?: (collapsed: boolean) => void;
54
+ isMobileOpen?: boolean;
55
+ onMobileOpenChange?: (open: boolean) => void;
56
+ mobileBreakpoint?: number;
57
+ className?: string;
58
+ 'aria-label'?: string;
59
+ 'data-testid'?: string;
60
+ }
61
+ export declare const SidebarRailPropsSchema: z.ZodObject<{
62
+ className: z.ZodOptional<z.ZodString>;
63
+ id: z.ZodOptional<z.ZodString>;
64
+ 'aria-labelledby': z.ZodOptional<z.ZodString>;
65
+ 'aria-describedby': z.ZodOptional<z.ZodString>;
66
+ 'aria-live': z.ZodOptional<z.ZodEnum<{
67
+ off: "off";
68
+ polite: "polite";
69
+ assertive: "assertive";
70
+ }>>;
71
+ 'aria-hidden': z.ZodOptional<z.ZodBoolean>;
72
+ 'data-testid': z.ZodOptional<z.ZodString>;
73
+ children: z.ZodCustom<ReactNode, ReactNode>;
74
+ 'aria-label': z.ZodString;
75
+ variant: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
76
+ default: "default";
77
+ primary: "primary";
78
+ }>>>;
79
+ }, z.core.$strip>;
80
+ export interface SidebarRailProps {
81
+ children: ReactNode;
82
+ 'aria-label': string;
83
+ variant?: SidebarRailVariant;
84
+ className?: string;
85
+ 'data-testid'?: string;
86
+ }
87
+ export declare const SidebarRailItemPropsSchema: z.ZodObject<{
88
+ className: z.ZodOptional<z.ZodString>;
89
+ 'aria-label': z.ZodOptional<z.ZodString>;
90
+ 'aria-labelledby': z.ZodOptional<z.ZodString>;
91
+ 'aria-describedby': z.ZodOptional<z.ZodString>;
92
+ 'aria-live': z.ZodOptional<z.ZodEnum<{
93
+ off: "off";
94
+ polite: "polite";
95
+ assertive: "assertive";
96
+ }>>;
97
+ 'aria-hidden': z.ZodOptional<z.ZodBoolean>;
98
+ 'data-testid': z.ZodOptional<z.ZodString>;
99
+ id: z.ZodString;
100
+ label: z.ZodString;
101
+ icon: z.ZodCustom<ReactElement<unknown, string | import("react").JSXElementConstructor<any>>, ReactElement<unknown, string | import("react").JSXElementConstructor<any>>>;
102
+ href: z.ZodOptional<z.ZodString>;
103
+ badgeCount: z.ZodOptional<z.ZodNumber>;
104
+ isActive: z.ZodOptional<z.ZodBoolean>;
105
+ currentType: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
106
+ true: "true";
107
+ page: "page";
108
+ location: "location";
109
+ }>>>;
110
+ isDisabled: z.ZodOptional<z.ZodBoolean>;
111
+ onPress: z.ZodOptional<z.ZodCustom<() => void, () => void>>;
112
+ children: z.ZodOptional<z.ZodCustom<ReactNode, ReactNode>>;
113
+ }, z.core.$strip>;
114
+ export interface SidebarRailItemProps {
115
+ id: string;
116
+ label: string;
117
+ icon: ReactElement;
118
+ href?: string;
119
+ badgeCount?: number;
120
+ isActive?: boolean;
121
+ currentType?: SidebarCurrentType;
122
+ isDisabled?: boolean;
123
+ onPress?: () => void;
124
+ children?: ReactNode;
125
+ className?: string;
126
+ 'data-testid'?: string;
127
+ }
128
+ export declare const SidebarPopoverPropsSchema: z.ZodObject<{
129
+ className: z.ZodOptional<z.ZodString>;
130
+ id: z.ZodOptional<z.ZodString>;
131
+ 'aria-label': z.ZodOptional<z.ZodString>;
132
+ 'aria-labelledby': z.ZodOptional<z.ZodString>;
133
+ 'aria-describedby': z.ZodOptional<z.ZodString>;
134
+ 'aria-live': z.ZodOptional<z.ZodEnum<{
135
+ off: "off";
136
+ polite: "polite";
137
+ assertive: "assertive";
138
+ }>>;
139
+ 'aria-hidden': z.ZodOptional<z.ZodBoolean>;
140
+ 'data-testid': z.ZodOptional<z.ZodString>;
141
+ children: z.ZodCustom<ReactNode, ReactNode>;
142
+ }, z.core.$strip>;
143
+ export interface SidebarPopoverProps {
144
+ children: ReactNode;
145
+ className?: string;
146
+ 'data-testid'?: string;
147
+ }
148
+ export declare const SidebarPanelPropsSchema: z.ZodObject<{
149
+ className: z.ZodOptional<z.ZodString>;
150
+ id: z.ZodOptional<z.ZodString>;
151
+ 'aria-labelledby': z.ZodOptional<z.ZodString>;
152
+ 'aria-describedby': z.ZodOptional<z.ZodString>;
153
+ 'aria-live': z.ZodOptional<z.ZodEnum<{
154
+ off: "off";
155
+ polite: "polite";
156
+ assertive: "assertive";
157
+ }>>;
158
+ 'aria-hidden': z.ZodOptional<z.ZodBoolean>;
159
+ 'data-testid': z.ZodOptional<z.ZodString>;
160
+ children: z.ZodCustom<ReactNode, ReactNode>;
161
+ width: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
162
+ sm: "sm";
163
+ lg: "lg";
164
+ md: "md";
165
+ xl: "xl";
166
+ }>>>;
167
+ 'aria-label': z.ZodString;
168
+ skeleton: z.ZodOptional<z.ZodCustom<ReactNode, ReactNode>>;
169
+ }, z.core.$strip>;
170
+ export interface SidebarPanelProps {
171
+ children: ReactNode;
172
+ width?: SidebarPanelWidth;
173
+ 'aria-label': string;
174
+ /**
175
+ * Optional placeholder rendered in place of `children` while the panel
176
+ * is collapsed or mid-transition (collapsing/expanding). When the
177
+ * panel is fully expanded, real `children` are shown.
178
+ *
179
+ * Use this to prevent text reflow as the panel's `max-width` animates
180
+ * — the skeleton can be a fixed-width layout (e.g. `Skeleton` blocks)
181
+ * that won't wrap/unwrap as the panel resizes.
182
+ *
183
+ * If omitted, behaviour is unchanged: `children` are always rendered
184
+ * directly inside the panel.
185
+ */
186
+ skeleton?: ReactNode;
187
+ className?: string;
188
+ 'data-testid'?: string;
189
+ }
190
+ export declare const SidebarPanelHeaderPropsSchema: z.ZodObject<{
191
+ className: z.ZodOptional<z.ZodString>;
192
+ id: z.ZodOptional<z.ZodString>;
193
+ 'aria-label': z.ZodOptional<z.ZodString>;
194
+ 'aria-labelledby': z.ZodOptional<z.ZodString>;
195
+ 'aria-describedby': z.ZodOptional<z.ZodString>;
196
+ 'aria-live': z.ZodOptional<z.ZodEnum<{
197
+ off: "off";
198
+ polite: "polite";
199
+ assertive: "assertive";
200
+ }>>;
201
+ 'aria-hidden': z.ZodOptional<z.ZodBoolean>;
202
+ 'data-testid': z.ZodOptional<z.ZodString>;
203
+ title: z.ZodString;
204
+ children: z.ZodOptional<z.ZodCustom<ReactNode, ReactNode>>;
205
+ as: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
206
+ h1: "h1";
207
+ h2: "h2";
208
+ h3: "h3";
209
+ h4: "h4";
210
+ }>>>;
211
+ }, z.core.$strip>;
212
+ export interface SidebarPanelHeaderProps {
213
+ title: string;
214
+ children?: ReactNode;
215
+ as?: SidebarPanelHeaderLevel;
216
+ className?: string;
217
+ 'data-testid'?: string;
218
+ }
219
+ export declare const SidebarCollapseButtonPropsSchema: z.ZodObject<{
220
+ className: z.ZodOptional<z.ZodString>;
221
+ children: z.ZodOptional<z.ZodAny>;
222
+ id: z.ZodOptional<z.ZodString>;
223
+ 'aria-label': z.ZodOptional<z.ZodString>;
224
+ 'aria-labelledby': z.ZodOptional<z.ZodString>;
225
+ 'aria-describedby': z.ZodOptional<z.ZodString>;
226
+ 'aria-live': z.ZodOptional<z.ZodEnum<{
227
+ off: "off";
228
+ polite: "polite";
229
+ assertive: "assertive";
230
+ }>>;
231
+ 'aria-hidden': z.ZodOptional<z.ZodBoolean>;
232
+ 'data-testid': z.ZodOptional<z.ZodString>;
233
+ }, z.core.$strip>;
234
+ export interface SidebarCollapseButtonProps {
235
+ className?: string;
236
+ 'data-testid'?: string;
237
+ }
238
+ //# sourceMappingURL=Sidebar.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.types.d.ts","sourceRoot":"","sources":["../../../src/elements/Sidebar/Sidebar.types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,39 @@
1
+ import { type ReactElement } from 'react';
2
+ import { SidebarCollapseButton } from './SidebarRail';
3
+ import { SidebarPanelHeader } from './SidebarPanel';
4
+ import { SidebarPopover } from './SidebarPopover';
5
+ import type { SidebarProps } from './Sidebar.types';
6
+ /**
7
+ * Sidebar compound wrapper — adds mobile drawer bridge around children.
8
+ */
9
+ declare function SidebarCompound(props: SidebarProps): ReactElement;
10
+ declare namespace SidebarCompound {
11
+ var displayName: string;
12
+ }
13
+ /**
14
+ * Sidebar compound component with dot-syntax sub-components.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <Sidebar>
19
+ * <Sidebar.Rail aria-label="Main navigation">
20
+ * <Sidebar.CollapseButton />
21
+ * <Sidebar.RailItem id="home" icon={<Home />} label="Home" isActive />
22
+ * </Sidebar.Rail>
23
+ * <Sidebar.Panel width="md" aria-label="Details">
24
+ * <Sidebar.PanelHeader title="Home" />
25
+ * {content}
26
+ * </Sidebar.Panel>
27
+ * </Sidebar>
28
+ * ```
29
+ */
30
+ export declare const Sidebar: typeof SidebarCompound & {
31
+ Rail: import("react").ForwardRefExoticComponent<import("./Sidebar.types").SidebarRailProps & import("react").RefAttributes<HTMLElement>>;
32
+ RailItem: import("react").NamedExoticComponent<import("./Sidebar.types").SidebarRailItemProps & import("react").RefAttributes<HTMLElement>>;
33
+ Popover: typeof SidebarPopover;
34
+ Panel: import("react").ForwardRefExoticComponent<import("./Sidebar.types").SidebarPanelProps & import("react").RefAttributes<HTMLElement>>;
35
+ PanelHeader: typeof SidebarPanelHeader;
36
+ CollapseButton: typeof SidebarCollapseButton;
37
+ };
38
+ export {};
39
+ //# sourceMappingURL=SidebarCompound.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarCompound.d.ts","sourceRoot":"","sources":["../../../src/elements/Sidebar/SidebarCompound.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAgC,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAgB,kBAAkB,EAA2B,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAyBpD;;GAEG;AACH,iBAAS,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAS1D;kBATQ,eAAe;;;AAaxB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,OAAO;;;;;;;CAOlB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ interface SidebarMobileDrawerProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare function SidebarMobileDrawer({ children }: SidebarMobileDrawerProps): ReactElement | null;
6
+ export {};
7
+ //# sourceMappingURL=SidebarMobileDrawer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarMobileDrawer.d.ts","sourceRoot":"","sources":["../../../src/elements/Sidebar/SidebarMobileDrawer.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAqEf,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE,wBAAwB,GAAG,YAAY,GAAG,IAAI,CA0F/F"}
@@ -0,0 +1,21 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ import type { SidebarPanelProps, SidebarPanelHeaderProps } from './Sidebar.types';
3
+ interface PopoverRegistryContextValue {
4
+ register: (id: string, content: ReactNode, label: string) => void;
5
+ unregister: (id: string) => void;
6
+ getContent: (id: string) => {
7
+ content: ReactNode;
8
+ label: string;
9
+ } | null;
10
+ }
11
+ export declare function usePopoverRegistry(): PopoverRegistryContextValue;
12
+ export declare function PopoverRegistryProvider({ children }: {
13
+ children: ReactNode;
14
+ }): ReactElement;
15
+ declare const SidebarPanel: import("react").ForwardRefExoticComponent<SidebarPanelProps & import("react").RefAttributes<HTMLElement>>;
16
+ declare function SidebarPanelHeader({ title, children, as: Heading, className, 'data-testid': testId, }: SidebarPanelHeaderProps): ReactElement;
17
+ declare namespace SidebarPanelHeader {
18
+ var displayName: string;
19
+ }
20
+ export { SidebarPanel, SidebarPanelHeader };
21
+ //# sourceMappingURL=SidebarPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarPanel.d.ts","sourceRoot":"","sources":["../../../src/elements/Sidebar/SidebarPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AA6DlF,UAAU,2BAA2B;IACnC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC1E;AAID,wBAAgB,kBAAkB,IAAI,2BAA2B,CAIhE;AAED,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,YAAY,CAsB3F;AA8CD,QAAA,MAAM,YAAY,2GAmFjB,CAAC;AAQF,iBAAS,kBAAkB,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,EAAE,EAAE,OAAc,EAClB,SAAS,EACT,aAAa,EAAE,MAA+B,GAC/C,EAAE,uBAAuB,GAAG,YAAY,CAYxC;kBAlBQ,kBAAkB;;;AAsB3B,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { SidebarPopoverProps } from './Sidebar.types';
3
+ export interface HoverIntentHandlers {
4
+ onTriggerPointerEnter: (e: React.PointerEvent) => void;
5
+ onTriggerPointerLeave: () => void;
6
+ }
7
+ export declare function useHoverIntent(itemId: string, hasPopover: boolean): HoverIntentHandlers;
8
+ declare function SidebarPopoverInner({ children, className, 'data-testid': testId, }: SidebarPopoverProps): ReactElement | null;
9
+ declare namespace SidebarPopoverInner {
10
+ var displayName: string;
11
+ }
12
+ export { SidebarPopoverInner as SidebarPopover };
13
+ //# sourceMappingURL=SidebarPopover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarPopover.d.ts","sourceRoot":"","sources":["../../../src/elements/Sidebar/SidebarPopover.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAc3D,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IACvD,qBAAqB,EAAE,MAAM,IAAI,CAAC;CACnC;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,GAClB,mBAAmB,CAsDrB;AAMD,iBAAS,mBAAmB,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,aAAa,EAAE,MAA0B,GAC1C,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,CAS3C;kBAbQ,mBAAmB;;;AAiB5B,OAAO,EAAE,mBAAmB,IAAI,cAAc,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { SidebarRailProps, SidebarRailItemProps, SidebarCollapseButtonProps } from './Sidebar.types';
3
+ declare const SidebarRail: import("react").ForwardRefExoticComponent<SidebarRailProps & import("react").RefAttributes<HTMLElement>>;
4
+ declare const SidebarRailItem: import("react").NamedExoticComponent<SidebarRailItemProps & import("react").RefAttributes<HTMLElement>>;
5
+ declare function SidebarCollapseButton({ className, 'data-testid': testId, }: SidebarCollapseButtonProps): ReactElement;
6
+ declare namespace SidebarCollapseButton {
7
+ var displayName: string;
8
+ }
9
+ export { SidebarRail, SidebarRailItem, SidebarCollapseButton };
10
+ //# sourceMappingURL=SidebarRail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarRail.d.ts","sourceRoot":"","sources":["../../../src/elements/Sidebar/SidebarRail.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQL,KAAK,YAAY,EAIlB,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,iBAAiB,CAAC;AAkBzB,QAAA,MAAM,WAAW,0GAuChB,CAAC;AAkJF,QAAA,MAAM,eAAe,yGAQnB,CAAC;AASH,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,aAAa,EAAE,MAAkC,GAClD,EAAE,0BAA0B,GAAG,YAAY,CAe3C;kBAlBQ,qBAAqB;;;AAsB9B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { SidebarProps } from './Sidebar.types';
3
+ export interface SidebarLayoutContextValue {
4
+ isMobile: boolean;
5
+ railId: string;
6
+ panelId: string;
7
+ }
8
+ export interface SidebarStateContextValue {
9
+ isCollapsed: boolean;
10
+ setCollapsed: (collapsed: boolean) => void;
11
+ toggleCollapsed: () => void;
12
+ isMobileOpen: boolean;
13
+ setMobileOpen: (open: boolean) => void;
14
+ activePopoverId: string | null;
15
+ setActivePopoverId: (id: string | null) => void;
16
+ cancelPopoverClose: () => void;
17
+ schedulePopoverClose: (delayMs?: number) => void;
18
+ }
19
+ export declare function useSidebarLayout(): SidebarLayoutContextValue;
20
+ export declare function useSidebarState(): SidebarStateContextValue;
21
+ declare function SidebarRoot({ children, isCollapsed: controlledCollapsed, defaultCollapsed, onCollapsedChange, isMobileOpen: controlledMobileOpen, onMobileOpenChange, mobileBreakpoint, className, 'data-testid': testId, }: SidebarProps): ReactElement;
22
+ declare namespace SidebarRoot {
23
+ var displayName: string;
24
+ }
25
+ export { SidebarRoot };
26
+ //# sourceMappingURL=SidebarRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarRoot.d.ts","sourceRoot":"","sources":["../../../src/elements/Sidebar/SidebarRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,YAAY,EASlB,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMpD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,oBAAoB,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAKD,wBAAgB,gBAAgB,IAAI,yBAAyB,CAI5D;AAED,wBAAgB,eAAe,IAAI,wBAAwB,CAI1D;AAMD,iBAAS,WAAW,CAAC,EACnB,QAAQ,EACR,WAAW,EAAE,mBAAmB,EAChC,gBAAwB,EACxB,iBAAiB,EACjB,YAAY,EAAE,oBAAoB,EAClC,kBAAkB,EAClB,gBAAsB,EACtB,SAAS,EACT,aAAa,EAAE,MAAkB,GAClC,EAAE,YAAY,GAAG,YAAY,CAqG7B;kBA/GQ,WAAW;;;AAmHpB,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { Sidebar } from './SidebarCompound';
2
+ export { sidebarRootVariants, sidebarRailVariants, sidebarRailToolbarVariants, sidebarRailItemVariants, sidebarRailItemIconVariants, sidebarRailItemLabelVariants, sidebarRailItemBadgeVariants, sidebarPopoverVariants, sidebarPanelVariants, sidebarPanelHeaderVariants, sidebarPanelHeaderTitleVariants, sidebarCollapseButtonVariants, sidebarMobileOverlayVariants, sidebarMobileDrawerVariants, sidebarMobileDrawerHeaderVariants, sidebarMobileRailVariants, sidebarMobileRailItemVariants, } from './Sidebar.styles';
3
+ export { SidebarPropsSchema, SidebarRailPropsSchema, SidebarRailItemPropsSchema, SidebarPopoverPropsSchema, SidebarPanelPropsSchema, SidebarPanelHeaderPropsSchema, SidebarCollapseButtonPropsSchema, SidebarRailVariantSchema, SidebarPanelWidthSchema, SidebarCurrentTypeSchema, SidebarPanelHeaderLevelSchema, } from './Sidebar.types';
4
+ export type { SidebarProps, SidebarRailProps, SidebarRailItemProps, SidebarPopoverProps, SidebarPanelProps, SidebarPanelHeaderProps, SidebarCollapseButtonProps, SidebarRailVariant, SidebarPanelWidth, SidebarCurrentType, SidebarPanelHeaderLevel, } from './Sidebar.types';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Sidebar/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,sBAAsB,EACtB,oBAAoB,EACpB,0BAA0B,EAC1B,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,gCAAgC,EAChC,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ 'use strict';var react=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime'),reactAriaComponents=require('react-aria-components'),lucideReact=require('lucide-react'),zod=require('zod');var pt=Object.defineProperty;var O=(e,t)=>()=>(e&&(t=e(e=0)),t);var ut=(e,t)=>{for(var a in t)pt(e,a,{get:t[a],enumerable:true});};function Le(e){let t=react.useCallback(o=>{let s=window.matchMedia(e);return s.addEventListener("change",o),()=>s.removeEventListener("change",o)},[e]),a=react.useCallback(()=>window.matchMedia(e).matches,[e]),r=react.useCallback(()=>false,[]);return react.useSyncExternalStore(t,a,r)}var Oe=O(()=>{"use client";});function v(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var _=O(()=>{});function ee(...e){return e.flatMap(t=>Array.isArray(t)?[...t]:[t])}var K,se,ie,U,J,le,_e=O(()=>{K=["focus-visible:outline-none","focus-visible:ring-2","focus-visible:ring-[var(--ring)]","focus-visible:ring-offset-2"],se=["min-h-[44px]","min-w-[44px]"],ie={sm:"h-9",default:"h-10",lg:"h-11"},{sm:`${ie.sm} px-2 text-xs`,default:`${ie.default} px-3 text-sm`,lg:`${ie.lg} px-4 text-base`},U=["motion-reduce:transition-none","motion-reduce:animate-none"],J=["transition-colors","duration-150"],le=["hover:bg-[var(--accent)]","hover:text-[var(--accent-foreground)]"];});exports.sidebarRootVariants=void 0;exports.sidebarRailVariants=void 0;exports.sidebarRailToolbarVariants=void 0;exports.sidebarRailItemVariants=void 0;exports.sidebarRailItemIconVariants=void 0;exports.sidebarRailItemLabelVariants=void 0;exports.sidebarRailItemBadgeVariants=void 0;exports.sidebarPopoverVariants=void 0;exports.sidebarPanelVariants=void 0;exports.sidebarPanelHeaderVariants=void 0;exports.sidebarPanelHeaderTitleVariants=void 0;exports.sidebarCollapseButtonVariants=void 0;exports.sidebarMobileOverlayVariants=void 0;exports.sidebarMobileDrawerVariants=void 0;exports.sidebarMobileDrawerHeaderVariants=void 0;exports.sidebarMobileRailVariants=void 0;exports.sidebarMobileRailItemVariants=void 0;var I=O(()=>{_e();exports.sidebarRootVariants=classVarianceAuthority.cva(["flex","h-full"]),exports.sidebarRailVariants=classVarianceAuthority.cva(["flex","flex-col","w-[68px]","shrink-0","border-r","border-[var(--border)]","py-2","px-1.5","overflow-y-auto","overflow-x-hidden"],{variants:{variant:{default:"bg-[var(--menu-background)]",primary:"bg-[var(--primary-action)]"}},defaultVariants:{variant:"default"}}),exports.sidebarRailToolbarVariants=classVarianceAuthority.cva(["flex","flex-col","gap-1"]),exports.sidebarRailItemVariants=classVarianceAuthority.cva(ee(K,U,J,["flex","flex-col","items-center","justify-center","w-full","min-h-[44px]","gap-0.5","px-1","py-1","rounded-[var(--radius-md)]","cursor-pointer","relative","select-none"]),{variants:{railVariant:{default:"text-[var(--icon)]",primary:"text-[var(--primary-action-foreground)]"},isActive:{true:[],false:[]},isDisabled:{true:["pointer-events-none","opacity-50","cursor-not-allowed"],false:[]}},compoundVariants:[{railVariant:"default",isActive:true,className:"bg-[var(--menu-accent)] text-[var(--menu-foreground)]"},{railVariant:"default",isActive:false,className:"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]"},{railVariant:"primary",isActive:true,className:"bg-white/20 text-[var(--primary-action-foreground)]"},{railVariant:"primary",isActive:false,className:"hover:bg-white/10 hover:text-[var(--primary-action-foreground)]"}],defaultVariants:{railVariant:"default",isActive:false,isDisabled:false}}),exports.sidebarRailItemIconVariants=classVarianceAuthority.cva(["relative","[&_svg]:size-5","[&_svg]:shrink-0","[&_svg]:pointer-events-none"]),exports.sidebarRailItemLabelVariants=classVarianceAuthority.cva(["text-[10px]","leading-tight","text-center","max-w-full","truncate"],{variants:{isActive:{true:"font-semibold",false:"font-medium"}},defaultVariants:{isActive:false}}),exports.sidebarRailItemBadgeVariants=classVarianceAuthority.cva(["absolute","-top-1.5","-right-1.5","min-w-[18px]","h-[18px]","rounded-full","px-1","flex","items-center","justify-center","bg-[var(--destructive-background)]","text-[var(--destructive-foreground)]","text-[10px]","font-bold","leading-none"]),exports.sidebarPopoverVariants=classVarianceAuthority.cva(["h-full","w-full","overflow-y-auto","bg-[var(--content-background)]","text-[var(--content-foreground)]","text-sm","motion-safe:animate-in","motion-safe:fade-in-0","motion-safe:slide-in-from-bottom-1","motion-safe:duration-200","motion-safe:fill-mode-both","[animation-delay:120ms]"]),exports.sidebarPanelVariants=classVarianceAuthority.cva(["flex","flex-col","h-full","overflow-hidden","bg-[var(--content-background)]","text-[var(--content-foreground)]","motion-safe:transition-[max-width,opacity]","motion-safe:duration-[var(--transition-slow)]",...U],{variants:{width:{sm:"max-w-[220px] w-[220px]",md:"max-w-[280px] w-[280px]",lg:"max-w-[340px] w-[340px]",xl:"max-w-[420px] w-[420px]"},isCollapsed:{true:"max-w-0 opacity-0 overflow-hidden",false:"opacity-100"}},defaultVariants:{width:"md",isCollapsed:false}}),exports.sidebarPanelHeaderVariants=classVarianceAuthority.cva(["flex","items-center","justify-between","px-3","py-2","shrink-0","border-b","border-[var(--border)]"]),exports.sidebarPanelHeaderTitleVariants=classVarianceAuthority.cva(["text-base","font-semibold","text-[var(--content-foreground)]","truncate"]),exports.sidebarCollapseButtonVariants=classVarianceAuthority.cva(ee(se,K,U,J,["inline-flex","items-center","justify-center","rounded-[var(--radius-md)]","[&_svg]:size-4","[&_svg]:shrink-0","cursor-pointer","mb-1"]),{variants:{railVariant:{default:["text-[var(--menu-foreground)]",...le],primary:["text-[var(--primary-action-foreground)]","hover:bg-white/10"]}},defaultVariants:{railVariant:"default"}}),exports.sidebarMobileOverlayVariants=classVarianceAuthority.cva(["fixed","inset-0","z-50","bg-black/50"]),exports.sidebarMobileDrawerVariants=classVarianceAuthority.cva(["fixed","inset-y-0","left-0","z-50","flex","flex-col","w-[85vw]","max-w-[380px]","bg-[var(--content-background)]","shadow-[var(--shadow-lg)]"]),exports.sidebarMobileDrawerHeaderVariants=classVarianceAuthority.cva(["flex","items-center","justify-between","px-3","py-2","border-b","border-[var(--border)]","shrink-0"]),exports.sidebarMobileRailVariants=classVarianceAuthority.cva(["flex","items-center","gap-1","px-2","py-2","overflow-x-auto","overflow-y-hidden","shrink-0","border-b","border-[var(--border)]","bg-[var(--menu-background)]"]),exports.sidebarMobileRailItemVariants=classVarianceAuthority.cva(ee(se,K,U,J,["flex","flex-col","items-center","justify-center","gap-0.5","px-2","py-1.5","rounded-[var(--radius-md)]","text-[var(--icon)]","shrink-0","cursor-pointer"]),{variants:{isActive:{true:["bg-[var(--menu-accent)]","text-[var(--menu-foreground)]"],false:[...le]}},defaultVariants:{isActive:false}});});function V(){let e=react.useContext(Re);if(!e)throw new Error("Sidebar compound components must be used within <Sidebar>");return e}function g(){let e=react.useContext(Pe);if(!e)throw new Error("Sidebar compound components must be used within <Sidebar>");return e}function ye({children:e,isCollapsed:t,defaultCollapsed:a=false,onCollapsedChange:r,isMobileOpen:o,onMobileOpenChange:s,mobileBreakpoint:n=768,className:i,"data-testid":l="sidebar"}){let[p,P]=react.useState(a),y=t!==void 0,b=y?t:p,h=react.useCallback(x=>{y||P(x),r?.(x);},[y,r]),w=react.useCallback(()=>h(!b),[h,b]),C=o??false,M=react.useCallback(x=>s?.(x),[s]),[u,m]=react.useState(null),f=react.useRef(null),D=react.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null);},[]),A=react.useCallback((x=300)=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{f.current=null,m(null);},x);},[]);react.useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]);let L=Le(`(max-width: ${n-1}px)`),B=react.useId(),k=`sidebar-rail-${B}`,G=`sidebar-panel-${B}`,z=react.useMemo(()=>({isMobile:L,railId:k,panelId:G}),[L,k,G]),q=react.useMemo(()=>({isCollapsed:b,setCollapsed:h,toggleCollapsed:w,isMobileOpen:C,setMobileOpen:M,activePopoverId:u,setActivePopoverId:m,cancelPopoverClose:D,schedulePopoverClose:A}),[b,h,w,C,M,u,D,A]);return L?jsxRuntime.jsx(Re.Provider,{value:z,children:jsxRuntime.jsx(Pe.Provider,{value:q,children:e})}):jsxRuntime.jsx(Re.Provider,{value:z,children:jsxRuntime.jsx(Pe.Provider,{value:q,children:jsxRuntime.jsx("div",{className:v(exports.sidebarRootVariants(),i),"data-testid":l,children:e})})})}var Re,Pe,H=O(()=>{"use client";Oe();_();I();Re=react.createContext(null),Pe=react.createContext(null);ye.displayName="Sidebar";});var ot={};ut(ot,{SidebarMobileDrawer:()=>Qt});function jt(e){return e>99?"99+":String(e)}function Zt(e){let t=[],a=null,r="Navigation";return react.Children.forEach(e,o=>{if(!react.isValidElement(o))return;let s=o.type.displayName;s==="SidebarRail"?(r=o.props["aria-label"]??r,react.Children.forEach(o.props.children,n=>{if(!react.isValidElement(n))return;n.type.displayName==="SidebarRailItem"&&t.push(n);})):s==="SidebarPanel"&&(a=o.props.children);}),{railItems:t,panelContent:a,railAriaLabel:r}}function Qt({children:e}){let{isMobileOpen:t,setMobileOpen:a}=g(),{railItems:r,panelContent:o,railAriaLabel:s}=Zt(e);return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{isDismissable:true,isOpen:t,onOpenChange:n=>{n||a(false);},className:exports.sidebarMobileOverlayVariants(),children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:exports.sidebarMobileDrawerVariants(),children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{"aria-label":"Navigation menu",className:"flex flex-col h-full outline-none",children:[jsxRuntime.jsxs("header",{className:exports.sidebarMobileDrawerHeaderVariants(),children:[jsxRuntime.jsx("span",{className:"text-base font-semibold text-[var(--content-foreground)]",children:"Menu"}),jsxRuntime.jsx(reactAriaComponents.Button,{"aria-label":"Close navigation",className:v(exports.sidebarCollapseButtonVariants()),onPress:()=>a(false),children:jsxRuntime.jsx(lucideReact.X,{})})]}),r.length>0&&jsxRuntime.jsx("div",{role:"toolbar","aria-orientation":"horizontal","aria-label":s,tabIndex:0,className:exports.sidebarMobileRailVariants(),children:r.map(n=>{let i=n.props;return jsxRuntime.jsxs(reactAriaComponents.Button,{"aria-current":i.isActive?i.currentType??"page":void 0,isDisabled:i.isDisabled,className:exports.sidebarMobileRailItemVariants({isActive:i.isActive??false}),onPress:()=>{i.onPress?.(),i.href&&(window.location.href=i.href),a(false);},"data-testid":`sidebar-mobile-rail-item-${i.id}`,children:[jsxRuntime.jsxs("span",{className:exports.sidebarRailItemIconVariants(),"aria-hidden":"true",children:[i.icon,i.badgeCount!=null&&i.badgeCount>0&&jsxRuntime.jsx("span",{className:exports.sidebarRailItemBadgeVariants(),"aria-hidden":"true",children:jt(i.badgeCount)})]}),jsxRuntime.jsx("span",{className:exports.sidebarRailItemLabelVariants({isActive:i.isActive??false}),children:i.label}),i.badgeCount!=null&&i.badgeCount>0&&jsxRuntime.jsxs("span",{className:"sr-only",children:[i.badgeCount," notifications"]})]},i.id)})}),o&&jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto bg-[var(--content-background)] text-[var(--content-foreground)]","data-testid":"sidebar-mobile-panel-content",children:o})]})})})}var nt=O(()=>{"use client";_();H();I();});H();_();H();_();H();I();var St=200,Rt=300;function Ue(e,t){let{activePopoverId:a,setActivePopoverId:r,cancelPopoverClose:o,schedulePopoverClose:s}=g(),n=react.useRef("IDLE"),i=react.useRef(null),l=react.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null);},[]),p=a===e;react.useEffect(()=>{!p&&n.current!=="IDLE"?(l(),n.current="IDLE"):p&&(n.current="OPEN");},[p,l]),react.useEffect(()=>l,[l]);let P=react.useCallback(b=>{t&&b.pointerType==="mouse"&&(l(),o(),n.current!=="OPEN"&&(n.current="HOVERING_TRIGGER",i.current=setTimeout(()=>{n.current="OPEN",r(e);},St)));},[e,t,r,l,o]),y=react.useCallback(()=>{if(t){if(l(),n.current==="HOVERING_TRIGGER"){n.current="IDLE",r(null);return}n.current==="OPEN"&&s(Rt);}},[t,r,l,s]);return {onTriggerPointerEnter:P,onTriggerPointerLeave:y}}function Ne({children:e,className:t,"data-testid":a="sidebar-popover"}){return jsxRuntime.jsx("div",{className:v(exports.sidebarPopoverVariants(),t),"data-testid":a,children:e})}Ne.displayName="SidebarPopover";_();H();I();function Nt(){let{activePopoverId:e,setActivePopoverId:t}=g(),{isMobile:a}=V(),r=react.useRef(null);return react.useEffect(()=>{if(!e)return;let o=s=>{s.key==="Escape"&&(s.preventDefault(),t(null));};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e,t]),react.useEffect(()=>{if(!e)return;let o=n=>{let i=r.current,l=n.relatedTarget;if(!l||!i)return;let p=document.querySelector('[data-testid="sidebar-rail"]');!i.contains(l)&&!p?.contains(l)&&t(null);},s=r.current;return s?.addEventListener("focusout",o),()=>s?.removeEventListener("focusout",o)},[e,t]),a||!e?null:jsxRuntime.jsx(We,{ref:r})}var Fe=react.createContext(null);function Ie(){let e=react.useContext(Fe);if(!e)throw new Error("usePopoverRegistry must be used within SidebarPanel");return e}function $e({children:e}){let t=react.useRef(new Map),a=react.useCallback((n,i,l)=>{t.current.set(n,{content:i,label:l});},[]),r=react.useCallback(n=>{t.current.delete(n);},[]),o=react.useCallback(n=>t.current.get(n)??null,[]),s=react.useMemo(()=>({register:a,unregister:r,getContent:o}),[a,r,o]);return jsxRuntime.jsx(Fe.Provider,{value:s,children:e})}var We=react.forwardRef((e,t)=>{let{activePopoverId:a,cancelPopoverClose:r,schedulePopoverClose:o}=g(),s=Ie();if(!a)return null;let n=s.getContent(a);return n?jsxRuntime.jsx("div",{ref:t,role:"dialog","aria-label":`${n.label} details`,className:exports.sidebarPopoverVariants(),"data-testid":"sidebar-popover",onPointerEnter:r,onPointerLeave:()=>o(300),children:n.content}):null});We.displayName="PopoverContent";var Tt=300,Ve=react.forwardRef(({children:e,width:t="md","aria-label":a,skeleton:r,className:o,"data-testid":s="sidebar-panel"},n)=>{let{isMobile:i}=V(),{isCollapsed:l,activePopoverId:p}=g(),P=react.useRef(null),y=p!==null,[b,h]=react.useState(!l);react.useEffect(()=>{if(l){h(false);return}let u=window.setTimeout(()=>h(true),Tt);return ()=>window.clearTimeout(u)},[l]);let C=r!==void 0&&!(!l&&b)?r:e;react.useEffect(()=>{if(!l)return;let u=P.current;if(u&&u.contains(document.activeElement)){let m=document.querySelector('[data-testid="sidebar-collapse-button"]');m&&window.requestAnimationFrame(()=>m.focus());}},[l]);let M=u=>{P.current=u,typeof n=="function"?n(u):n&&(n.current=u);};return i?null:jsxRuntime.jsxs("div",{className:"relative shrink-0 border-r border-[var(--border)]",children:[jsxRuntime.jsx("aside",{ref:M,"aria-label":a,"aria-hidden":l,inert:l||void 0,className:v(exports.sidebarPanelVariants({width:t,isCollapsed:l}),o),"data-testid":s,children:C}),y&&!l&&jsxRuntime.jsx("div",{className:"absolute inset-0 z-10",children:jsxRuntime.jsx(Nt,{})})]})});Ve.displayName="SidebarPanel";function Te({title:e,children:t,as:a="h2",className:r,"data-testid":o="sidebar-panel-header"}){return jsxRuntime.jsxs("header",{className:v(exports.sidebarPanelHeaderVariants(),r),"data-testid":o,children:[jsxRuntime.jsx(a,{className:exports.sidebarPanelHeaderTitleVariants(),children:e}),t]})}Te.displayName="SidebarPanelHeader";I();var Ke=react.createContext("default");function Je(){return react.useContext(Ke)}var we=react.forwardRef(({children:e,"aria-label":t,variant:a="default",className:r,"data-testid":o="sidebar-rail"},s)=>{let{isMobile:n}=V();if(n)return null;let i=[],l=[];return react.Children.forEach(e,p=>{react.isValidElement(p)&&p.type.displayName==="SidebarCollapseButton"?i.push(p):l.push(p);}),jsxRuntime.jsx(Ke.Provider,{value:a,children:jsxRuntime.jsxs("nav",{ref:s,"aria-label":t,className:v(exports.sidebarRailVariants({variant:a}),r),"data-testid":o,children:[i,jsxRuntime.jsx(reactAriaComponents.Toolbar,{orientation:"vertical","aria-label":"Navigation items",className:exports.sidebarRailToolbarVariants(),children:l})]})})});we.displayName="SidebarRail";function kt(e){let t=null,a=[];return react.Children.forEach(e,r=>{react.isValidElement(r)&&r.type.displayName==="SidebarPopover"?t=r:a.push(r);}),{popover:t,rest:a.length>0?a:null}}function Gt(e){return e>99?"99+":String(e)}var et=react.forwardRef(({id:e,label:t,icon:a,href:r,badgeCount:o,isActive:s=false,currentType:n="page",isDisabled:i=false,onPress:l,children:p,className:P,"data-testid":y},b)=>{let{activePopoverId:h,setActivePopoverId:w}=g(),C=Je(),M=react.useRef(null),{popover:u}=kt(p),m=u!==null,f=h===e,D=Ue(e,m),A=Ie();react.useEffect(()=>{if(m&&u)return A.register(e,u,t),()=>A.unregister(e)},[e,m,u,t,A]);let L=react.useCallback(()=>{m&&w(f?null:e),l?.();},[m,f,e,l,w]),B=react.useCallback(x=>{M.current=x,typeof b=="function"?b(x):b&&(b.current=x);},[b]),k=y??`sidebar-rail-item-${e}`,G=P?v(exports.sidebarRailItemVariants({railVariant:C,isActive:s,isDisabled:i}),P):exports.sidebarRailItemVariants({railVariant:C,isActive:s,isDisabled:i}),z=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:exports.sidebarRailItemIconVariants(),"aria-hidden":"true",children:[a,o!=null&&o>0&&jsxRuntime.jsx("span",{className:exports.sidebarRailItemBadgeVariants(),"aria-hidden":"true",children:Gt(o)})]}),jsxRuntime.jsx("span",{className:exports.sidebarRailItemLabelVariants({isActive:s}),children:t}),o!=null&&o>0&&jsxRuntime.jsxs("span",{className:"sr-only",children:[o," notifications"]})]}),q=r&&!i?jsxRuntime.jsx(reactAriaComponents.Link,{ref:B,href:r,"aria-current":s?n:void 0,"aria-haspopup":m?"dialog":void 0,"aria-expanded":m?f:void 0,className:G,"data-testid":k,onPress:L,children:z}):jsxRuntime.jsx(reactAriaComponents.Button,{ref:B,isDisabled:i,"aria-current":s?n:void 0,"aria-haspopup":m?"dialog":void 0,"aria-expanded":m?f:void 0,className:G,"data-testid":k,onPress:L,children:z});return jsxRuntime.jsx("div",{onPointerEnter:D.onTriggerPointerEnter,onPointerLeave:D.onTriggerPointerLeave,children:q})});et.displayName="SidebarRailItem";var Me=react.memo(et,(e,t)=>e.id===t.id&&e.isActive===t.isActive&&e.badgeCount===t.badgeCount&&e.isDisabled===t.isDisabled&&e.label===t.label&&e.className===t.className&&e.href===t.href);Me.displayName="SidebarRailItem";function Ae({className:e,"data-testid":t="sidebar-collapse-button"}){let{isCollapsed:a,toggleCollapsed:r}=g(),o=Je();return jsxRuntime.jsx(reactAriaComponents.Button,{"aria-expanded":!a,"aria-label":a?"Expand sidebar":"Collapse sidebar",className:v(exports.sidebarCollapseButtonVariants({railVariant:o}),e),"data-testid":t,onPress:r,children:a?jsxRuntime.jsx(lucideReact.PanelLeftOpen,{}):jsxRuntime.jsx(lucideReact.PanelLeftClose,{})})}Ae.displayName="SidebarCollapseButton";var qt=react.lazy(()=>Promise.resolve().then(()=>(nt(),ot)).then(e=>({default:e.SidebarMobileDrawer})));function Kt({children:e}){let{isMobile:t}=V(),{isMobileOpen:a}=g();return !t||!a?null:jsxRuntime.jsx(react.Suspense,{fallback:null,children:jsxRuntime.jsx(qt,{children:e})})}function it(e){return jsxRuntime.jsx(ye,{...e,children:jsxRuntime.jsxs($e,{children:[e.children,jsxRuntime.jsx(Kt,{children:e.children})]})})}it.displayName="Sidebar";var Jt=Object.assign(it,{Rail:we,RailItem:Me,Popover:Ne,Panel:Ve,PanelHeader:Te,CollapseButton:Ae});I();var E=zod.z.object({className:zod.z.string().optional(),children:zod.z.any().optional(),id:zod.z.string().optional(),"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),"aria-describedby":zod.z.string().optional(),"aria-live":zod.z.enum(["off","polite","assertive"]).optional(),"aria-hidden":zod.z.boolean().optional(),"data-testid":zod.z.string().optional()});var st=zod.z.enum(["default","primary"]),lt=zod.z.enum(["sm","md","lg","xl"]),dt=zod.z.enum(["page","true","location"]),ct=zod.z.enum(["h1","h2","h3","h4"]),ta=E.extend({children:zod.z.custom(),isCollapsed:zod.z.boolean().optional(),defaultCollapsed:zod.z.boolean().optional().default(false),onCollapsedChange:zod.z.custom().optional(),isMobileOpen:zod.z.boolean().optional(),onMobileOpenChange:zod.z.custom().optional(),mobileBreakpoint:zod.z.number().optional().default(768)}),aa=E.extend({children:zod.z.custom(),"aria-label":zod.z.string(),variant:st.optional().default("default")}),ra=E.extend({id:zod.z.string(),label:zod.z.string(),icon:zod.z.custom(),href:zod.z.string().optional(),badgeCount:zod.z.number().optional(),isActive:zod.z.boolean().optional(),currentType:dt.optional().default("page"),isDisabled:zod.z.boolean().optional(),onPress:zod.z.custom().optional(),children:zod.z.custom().optional()}),oa=E.extend({children:zod.z.custom()}),na=E.extend({children:zod.z.custom(),width:lt.optional().default("md"),"aria-label":zod.z.string(),skeleton:zod.z.custom().optional()}),ia=E.extend({title:zod.z.string(),children:zod.z.custom().optional(),as:ct.optional().default("h2")}),sa=E.extend({});exports.Sidebar=Jt;exports.SidebarCollapseButtonPropsSchema=sa;exports.SidebarCurrentTypeSchema=dt;exports.SidebarPanelHeaderLevelSchema=ct;exports.SidebarPanelHeaderPropsSchema=ia;exports.SidebarPanelPropsSchema=na;exports.SidebarPanelWidthSchema=lt;exports.SidebarPopoverPropsSchema=oa;exports.SidebarPropsSchema=ta;exports.SidebarRailItemPropsSchema=ra;exports.SidebarRailPropsSchema=aa;exports.SidebarRailVariantSchema=st;//# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map