@kismet-ux/constellation 1.11.0 → 1.11.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.
package/dist/form.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as Checkbox, a as CheckboxProps, b as Combobox, c as ComboboxOption, d as ComboboxProps, D as DatePicker, L as Label, f as LabelProps, S as Select, h as SelectContent, j as SelectField, l as SelectGroup, m as SelectItem, p as SelectSeparator, r as SelectTrigger, s as SelectValue, t as __Surface } from './index-2nHZOukj.js';
1
+ export { C as Checkbox, a as CheckboxProps, b as Combobox, c as ComboboxOption, d as ComboboxProps, D as DatePicker, L as Label, f as LabelProps, S as Select, h as SelectContent, j as SelectField, l as SelectGroup, m as SelectItem, p as SelectSeparator, r as SelectTrigger, s as SelectValue, t as __Surface } from './index-CIK_SmBm.js';
2
2
  export { I as Input, a as InputBaseProps } from './input-Cp5LET5i.js';
3
3
  import 'react';
4
4
  import 'class-variance-authority';
@@ -0,0 +1,354 @@
1
+ import * as React from 'react';
2
+ import React__default from 'react';
3
+ import { d as SidebarSection, S as SidebarNavItem, B as BreadcrumbItemData, c as NavUserProps } from './nav-user-CilmWvtr.js';
4
+ import { R as RowProps } from './row-CuhTBQhK.js';
5
+ import { I as Input } from './input-Cp5LET5i.js';
6
+ import { b as TooltipContent, B as Button } from './tooltip-DxO_DWMO.js';
7
+ import { VariantProps } from 'class-variance-authority';
8
+ import * as class_variance_authority_types from 'class-variance-authority/types';
9
+
10
+ interface ColumnProps extends React__default.HTMLAttributes<HTMLDivElement> {
11
+ children?: React__default.ReactNode;
12
+ el?: React__default.ElementType<React__default.HTMLAttributes<HTMLDivElement>>;
13
+ gap?: number;
14
+ full?: boolean;
15
+ fullHeight?: boolean;
16
+ align?: 'start' | 'center' | 'end';
17
+ flex?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
18
+ }
19
+
20
+ interface ContainerProps extends React__default.HTMLAttributes<HTMLDivElement> {
21
+ children?: React__default.ReactNode;
22
+ el?: React__default.ElementType<React__default.HTMLAttributes<HTMLDivElement>>;
23
+ styled?: boolean;
24
+ direction?: 'column' | 'row';
25
+ align?: 'start' | 'center' | 'end' | 'stretch';
26
+ justify?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
27
+ full?: boolean;
28
+ rounded?: boolean | 'extra';
29
+ outlined?: boolean;
30
+ /** A border colour outside the theme scale; pairs with `outlined`. */
31
+ color?: string;
32
+ theme?: 'primary' | 'secondary' | 'success' | 'destructive' | 'warning' | 'info' | 'slate' | 'light-slate';
33
+ elevation?: number;
34
+ padding?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | 'none';
35
+ darkMode?: boolean;
36
+ gap?: number;
37
+ /**
38
+ * Draw one edge in `color` as a thick rule.
39
+ *
40
+ * A card that belongs to a category — an aisle, a shelf, a queue — reads
41
+ * faster with a coloured edge than with a full outline in the same hue,
42
+ * because the edge is a mark and the outline is a box. Pairs with `color`.
43
+ */
44
+ accent?: 'left' | 'right' | 'top' | 'bottom';
45
+ /** Colour for the `accent` edge. Falls back to `color`, then the divider. */
46
+ accentColor?: string;
47
+ /**
48
+ * Cap the content width and centre it.
49
+ *
50
+ * `text` for a column of prose, `content` for ordinary forms and lists,
51
+ * `wide` for dense work that earns the room. A CSS length is accepted for
52
+ * the case the scale does not cover. Without it a container simply fills its
53
+ * parent, which is right until the parent is a very large screen.
54
+ */
55
+ measure?: 'text' | 'content' | 'wide' | 'full' | (string & {});
56
+ /**
57
+ * Fade the container in shortly after mount.
58
+ *
59
+ * Off by default. Only sensible for something that appears once — a hero
60
+ * panel, an empty state. Anything that repeats or is toggled should not use
61
+ * it: the container renders invisible until the timer fires.
62
+ */
63
+ appear?: boolean;
64
+ }
65
+
66
+ type GridColumns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
67
+ interface GridProps extends React__default.HTMLAttributes<HTMLDivElement> {
68
+ children?: React__default.ReactNode;
69
+ /** Number of columns (1–12). Default: 1. */
70
+ columns?: GridColumns;
71
+ /** Responsive column overrides. Each breakpoint sets the column count at that width and above. */
72
+ sm?: GridColumns;
73
+ md?: GridColumns;
74
+ lg?: GridColumns;
75
+ xl?: GridColumns;
76
+ /** Gap between items (0–12, maps to --size-N tokens). Default: 2. */
77
+ gap?: number;
78
+ /**
79
+ * A minimum track width — `repeat(auto-fit, minmax(<min>, 1fr))`.
80
+ *
81
+ * For a grid whose column COUNT is not the interesting question: "these
82
+ * boxes hold one word each, fit as many as will read" is a statement about
83
+ * the content, and it reflows without naming a breakpoint. Takes precedence
84
+ * over `columns` and the responsive overrides, which it replaces.
85
+ */
86
+ min?: string;
87
+ /**
88
+ * With `min`, keep empty tracks instead of collapsing them (`auto-fill`
89
+ * rather than `auto-fit`).
90
+ *
91
+ * The difference only shows when the items do not fill the row. A grid of
92
+ * CARDS wants this: one card in an aisle should stay card-sized, not stretch
93
+ * to the full width. A grid of form FIELDS wants the default, where two
94
+ * fields share the row rather than leaving a hole.
95
+ */
96
+ fill?: boolean;
97
+ /**
98
+ * Pack items by height instead of by row, so a short item does not leave a
99
+ * hole under a tall neighbour.
100
+ *
101
+ * Implemented with CSS multi-column, which is the only masonry that works
102
+ * everywhere today — `grid-template-rows: masonry` is still behind a flag.
103
+ * The trade is reading order: items flow DOWN each column and then across,
104
+ * rather than left to right. For a list already grouped and sorted that is
105
+ * fine; for anything where "the next one" must sit to the right, it is not.
106
+ *
107
+ * Pairs with `min`, which sets the column width.
108
+ */
109
+ masonry?: boolean;
110
+ /**
111
+ * Animate children to their new positions instead of letting them jump.
112
+ *
113
+ * Wires up FLIP (see `useFlip`). Worth it wherever the layout reflows on its
114
+ * own — a masonry that restacks when the window narrows, or a card that
115
+ * pushes its neighbours down as it expands. Respects
116
+ * the app's motion preference (`useMotion`), which defaults to
117
+ * `prefers-reduced-motion`.
118
+ */
119
+ animate?: boolean;
120
+ /** Horizontal alignment of items within cells. */
121
+ align?: 'start' | 'center' | 'end' | 'stretch';
122
+ /** Vertical alignment of items within cells. */
123
+ justify?: 'start' | 'center' | 'end' | 'stretch';
124
+ /** Whether the grid fills its parent width. */
125
+ full?: boolean;
126
+ /** Semantic HTML element to render. Default: div. */
127
+ el?: React__default.ElementType<React__default.HTMLAttributes<HTMLDivElement>>;
128
+ }
129
+
130
+ type SidebarVariant = 'sidebar' | 'floating' | 'inset';
131
+ type SidebarContextValue = {
132
+ state: 'expanded' | 'collapsed';
133
+ open: boolean;
134
+ setOpen: React__default.Dispatch<React__default.SetStateAction<boolean>>;
135
+ isMobile: boolean;
136
+ openMobile: boolean;
137
+ setOpenMobile: React__default.Dispatch<React__default.SetStateAction<boolean>>;
138
+ toggleSidebar: () => void;
139
+ variant: SidebarVariant;
140
+ setVariant: React__default.Dispatch<React__default.SetStateAction<SidebarVariant>>;
141
+ };
142
+
143
+ declare function AppContent({ children, className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
144
+
145
+ interface AppContentFooterProps extends React.HTMLAttributes<HTMLDivElement> {
146
+ /** The element to render. Defaults to `footer`. */
147
+ el?: React.ElementType<React.HTMLAttributes<HTMLDivElement>>;
148
+ }
149
+ /**
150
+ * The band at the foot of a content area — a search field, a toolbar, the
151
+ * action that commits the page.
152
+ *
153
+ * ⚠️ It must be a SIBLING of `AppContentMain`, not a child of it:
154
+ *
155
+ * ```tsx
156
+ * <AppContent>
157
+ * <AppSidebarHeader />
158
+ * <AppContentMain>{page}</AppContentMain>
159
+ * <AppContentFooter>{search}</AppContentFooter>
160
+ * </AppContent>
161
+ * ```
162
+ *
163
+ * Nothing here is pinned. `AppContent` is a full-height column and only the
164
+ * middle band scrolls, so the foot of the column IS the foot of the screen and
165
+ * the band stays there by arithmetic rather than by being told to.
166
+ *
167
+ * It was `position: sticky; bottom: 0` inside the scrolling area, and that
168
+ * cannot work however the offsets are tuned: a sticky element travels only
169
+ * within its containing block, and a band that is the LAST child of the page it
170
+ * scrolls with has nothing below it to travel over. It docked on short pages,
171
+ * where there was no scrolling to survive, and scrolled away on long ones.
172
+ *
173
+ * Fixed positioning is the other wrong answer — it is measured against the
174
+ * viewport, so in an app with a sidebar the band runs underneath it and has to
175
+ * be inset by hand for every state the sidebar can be in.
176
+ *
177
+ * There is no matching header band; the shell's header is already a band of the
178
+ * same column, so it is always in view without being told to be.
179
+ */
180
+ declare function AppContentFooter({ children, className, el, ...props }: AppContentFooterProps): React.JSX.Element;
181
+
182
+ interface AppContentMainProps extends React.HTMLAttributes<HTMLElement> {
183
+ /** The element to render. Defaults to `main`. */
184
+ el?: React.ElementType<React.HTMLAttributes<HTMLElement>>;
185
+ }
186
+ /**
187
+ * The scrolling middle band of a content area.
188
+ *
189
+ * `AppContent` is a column of exactly three bands — header, this, footer — and
190
+ * this is the only one that scrolls. It takes whatever height the other two
191
+ * leave and scrolls inside itself, so the bands above and below it are always
192
+ * on screen without being pinned there.
193
+ *
194
+ * That is why the footer does not need to be sticky, and why a page must not
195
+ * put its footer INSIDE this band hoping `position: sticky; bottom: 0` will
196
+ * dock it. A sticky element can only travel within its containing block, and a
197
+ * band that is the last child of the thing it scrolls in has no room below it
198
+ * to travel — it looks docked on a short page (where nothing scrolls anyway)
199
+ * and scrolls away on a long one, which is the case it was added for.
200
+ *
201
+ * The composition, and the only one that docks a footer:
202
+ *
203
+ * ```tsx
204
+ * <AppContent>
205
+ * <AppSidebarHeader />
206
+ * <AppContentMain>{page}</AppContentMain>
207
+ * <AppContentFooter>{search}</AppContentFooter>
208
+ * </AppContent>
209
+ * ```
210
+ *
211
+ * A sticky band INSIDE the page still works, and now pins to this element
212
+ * rather than to the window — but note that sticky offsets are measured from
213
+ * the scroller's PADDING edge, so a band meant to sit flush against the top of
214
+ * the scrollport has to offset by this element's own padding.
215
+ */
216
+ declare function AppContentMain({ children, className, el, ...props }: AppContentMainProps): React.JSX.Element;
217
+
218
+ interface AppFooterProps {
219
+ brand: string;
220
+ links: {
221
+ label: string;
222
+ href: string;
223
+ }[];
224
+ }
225
+ declare function AppFooter({ brand, links }: AppFooterProps): React.JSX.Element;
226
+
227
+ interface AppShellProps {
228
+ children: React.ReactNode;
229
+ /**
230
+ * Initial sidebar state. Persist this server-side (cookie, session) or in
231
+ * localStorage and pass it in, so the sidebar doesn't flash open on load.
232
+ */
233
+ defaultSidebarOpen?: boolean;
234
+ }
235
+ declare function AppShell({ children, defaultSidebarOpen }: AppShellProps): React.JSX.Element;
236
+
237
+ interface AppSidebarProps {
238
+ logo: React.ReactNode;
239
+ homeHref?: string;
240
+ currentPath?: string;
241
+ linkComponent?: React.ElementType;
242
+ sections: SidebarSection[];
243
+ footerItems?: SidebarNavItem[];
244
+ footerSeparator?: boolean;
245
+ children?: React.ReactNode;
246
+ }
247
+ declare function AppSidebar({ logo, homeHref, currentPath, linkComponent, sections, footerItems, footerSeparator, children, }: AppSidebarProps): React.JSX.Element;
248
+
249
+ interface AppSidebarHeaderProps extends React.HTMLAttributes<HTMLElement> {
250
+ breadcrumbs?: BreadcrumbItemData[];
251
+ /** Omit to hide the account menu (e.g. on signed-out chrome). */
252
+ user?: NavUserProps['user'];
253
+ userMenu?: Omit<NavUserProps, 'user'>;
254
+ /** Extra controls between the appearance toggle and the account menu. */
255
+ actions?: React.ReactNode;
256
+ }
257
+ /**
258
+ * The header band of a content area.
259
+ *
260
+ * `className` and any other DOM props reach the `header` element. They used to
261
+ * be dropped on the floor — the component took four named props and spread
262
+ * nothing — so a caller passing `className` got no error and no class, and
263
+ * spent the difference looking at its own stylesheet.
264
+ */
265
+ declare function AppSidebarHeader({ breadcrumbs, user, userMenu, actions, className, ...props }: AppSidebarHeaderProps): React.JSX.Element;
266
+
267
+ interface CollapseProps extends React.HTMLAttributes<HTMLDivElement> {
268
+ open: boolean;
269
+ /** Transition length in ms. Also how long the unmount is deferred. */
270
+ duration?: number;
271
+ /**
272
+ * Unmount children once the close animation finishes. Keeps focus traps,
273
+ * `autoFocus` and dismiss handlers out of the tree while the panel is shut.
274
+ * Set `false` to keep children mounted — cheaper for a panel toggled often,
275
+ * and required if they hold state you need to survive a close.
276
+ */
277
+ unmountOnClose?: boolean;
278
+ }
279
+ /**
280
+ * A panel that animates its own height, so content below slides rather than
281
+ * jumping.
282
+ *
283
+ * Uses `grid-template-rows: 0fr → 1fr` rather than animating `max-height`: it
284
+ * interpolates to the panel's real height, so there is no magic number to
285
+ * guess and no pause at the end when the guess was too generous.
286
+ */
287
+ declare const Collapse: React.ForwardRefExoticComponent<CollapseProps & React.RefAttributes<HTMLDivElement>>;
288
+
289
+ declare const Column: React.FC<ColumnProps>;
290
+
291
+ declare const Container: React.ForwardRefExoticComponent<ContainerProps & React.RefAttributes<HTMLDivElement>>;
292
+
293
+ declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLDivElement>>;
294
+
295
+ declare const Row: React.FC<RowProps>;
296
+
297
+ declare const sidebarMenuButtonVariants: (props?: ({
298
+ variant?: "outline" | "default" | null | undefined;
299
+ size?: "sm" | "md" | "lg" | null | undefined;
300
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
301
+
302
+ declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<'div'> & {
303
+ defaultOpen?: boolean;
304
+ open?: boolean;
305
+ onOpenChange?: React.Dispatch<React.SetStateAction<boolean>>;
306
+ }): React.JSX.Element;
307
+ declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React.ComponentProps<'div'> & {
308
+ side?: 'left' | 'right';
309
+ variant?: SidebarVariant;
310
+ collapsible?: 'offcanvas' | 'icon' | 'none';
311
+ }): React.JSX.Element;
312
+ declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
313
+ declare function SidebarRail({ className, ...props }: React.ComponentProps<'button'>): React.JSX.Element;
314
+ declare function SidebarInset({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
315
+ declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): React.JSX.Element;
316
+ declare function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
317
+ declare function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
318
+ declare function SidebarContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
319
+ declare function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
320
+ declare function SidebarGroupLabel({ className, asChild, ...props }: React.ComponentProps<'div'> & {
321
+ asChild?: boolean;
322
+ }): React.JSX.Element;
323
+ declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<'button'> & {
324
+ asChild?: boolean;
325
+ }): React.JSX.Element;
326
+ declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
327
+ declare function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>): React.JSX.Element;
328
+ declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
329
+ declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<'button'> & {
330
+ asChild?: boolean;
331
+ isActive?: boolean;
332
+ tooltip?: string | React.ComponentProps<typeof TooltipContent>;
333
+ } & VariantProps<typeof sidebarMenuButtonVariants>): React.JSX.Element;
334
+ declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<'button'> & {
335
+ asChild?: boolean;
336
+ showOnHover?: boolean;
337
+ }): React.JSX.Element;
338
+ declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
339
+ declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<'div'> & {
340
+ showIcon?: boolean;
341
+ }): React.JSX.Element;
342
+ declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>): React.JSX.Element;
343
+ declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
344
+ declare function SidebarMenuSubButton({ asChild, size, isActive, tooltip, className, ...props }: React.ComponentProps<'a'> & {
345
+ asChild?: boolean;
346
+ size?: 'sm' | 'md';
347
+ isActive?: boolean;
348
+ tooltip?: string | React.ComponentProps<typeof TooltipContent>;
349
+ }): React.JSX.Element;
350
+
351
+ declare function Skeleton({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
352
+
353
+ export { AppContent as A, SidebarHeader as B, Collapse as C, SidebarInput as D, SidebarInset as E, SidebarMenu as F, Grid as G, SidebarMenuAction as H, SidebarMenuBadge as I, SidebarMenuButton as J, SidebarMenuItem as K, SidebarMenuSkeleton as L, SidebarMenuSub as M, SidebarMenuSubButton as N, SidebarMenuSubItem as O, SidebarProvider as P, SidebarRail as Q, Row as R, SidebarTrigger as T, Skeleton as V, AppContentFooter as a, AppContentMain as c, AppFooter as e, AppShell as g, AppSidebar as i, AppSidebarHeader as j, Column as n, Container as p, Sidebar as t, SidebarContent as u, SidebarFooter as v, SidebarGroup as w, SidebarGroupAction as x, SidebarGroupContent as y, SidebarGroupLabel as z };
354
+ export type { SidebarContextValue as S, SidebarVariant as U, AppContentFooterProps as b, AppContentMainProps as d, AppFooterProps as f, AppShellProps as h, AppSidebarHeaderProps as k, AppSidebarProps as l, CollapseProps as m, ColumnProps as o, ContainerProps as q, GridColumns as r, GridProps as s };
@@ -0,0 +1,566 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ import React__default, { ReactNode } from 'react';
4
+ import * as class_variance_authority_types from 'class-variance-authority/types';
5
+ import './tooltip-DxO_DWMO.js';
6
+ import { f as TypographyVariant } from './typography-CTGVc_Gg.js';
7
+
8
+ type AlertTheme = 'default' | 'primary' | 'secondary' | 'success' | 'destructive' | 'warning' | 'info' | 'slate';
9
+ type AlertMessage = {
10
+ id: string;
11
+ title: string;
12
+ description?: string;
13
+ theme: AlertTheme;
14
+ timeout?: number;
15
+ persistent?: boolean;
16
+ closable?: boolean;
17
+ };
18
+ type PushAlertInput = Omit<AlertMessage, 'id'> & {
19
+ icon?: ReactNode;
20
+ action?: ReactNode;
21
+ };
22
+ type AlertContextValue = {
23
+ pushAlert: (alert: PushAlertInput) => void;
24
+ removeAlert: (id: string) => void;
25
+ };
26
+
27
+ type PaginationProps = {
28
+ page: number;
29
+ pageSize: number;
30
+ totalItems: number;
31
+ onPageChange: (page: number) => void;
32
+ onPageSizeChange: (size: number) => void;
33
+ pageSizeOptions?: number[];
34
+ className?: string;
35
+ };
36
+
37
+ type SortDirection = 'asc' | 'desc';
38
+ type SortState = {
39
+ key: string;
40
+ direction: SortDirection;
41
+ };
42
+ type SortContextValue = {
43
+ sortState: SortState | null;
44
+ setSortState: React__default.Dispatch<React__default.SetStateAction<SortState | null>>;
45
+ };
46
+
47
+ declare const alertVariants: (props?: ({
48
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "default" | null | undefined;
49
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
50
+
51
+ interface AlertProps extends VariantProps<typeof alertVariants> {
52
+ className?: string;
53
+ icon?: React.ReactNode;
54
+ action?: React.ReactNode;
55
+ onClose?: () => void;
56
+ /** A colour outside the theme scale; overrides the theme's colour roles. */
57
+ color?: string;
58
+ style?: React.CSSProperties;
59
+ children?: React.ReactNode;
60
+ }
61
+ declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
62
+ declare function AlertTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
63
+ declare function AlertDescription({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
64
+ interface AlertBannerProps extends VariantProps<typeof alertVariants> {
65
+ open: boolean;
66
+ onClose?: () => void;
67
+ icon?: boolean | React.ReactNode;
68
+ action?: React.ReactNode;
69
+ className?: string;
70
+ children?: React.ReactNode;
71
+ }
72
+ declare const AlertBanner: React.ForwardRefExoticComponent<AlertBannerProps & React.RefAttributes<HTMLDivElement>>;
73
+
74
+ declare const persistAlert: (alert: Omit<AlertMessage, "id">) => void;
75
+
76
+ declare function AlertProvider({ children }: {
77
+ children: React.ReactNode;
78
+ }): React.JSX.Element;
79
+
80
+ type AvatarProps = React.HTMLAttributes<HTMLSpanElement>;
81
+ declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
82
+ type AvatarImageProps = React.ImgHTMLAttributes<HTMLImageElement>;
83
+ declare const AvatarImage: React.ForwardRefExoticComponent<AvatarImageProps & React.RefAttributes<HTMLImageElement>>;
84
+ type AvatarFallbackProps = React.HTMLAttributes<HTMLSpanElement>;
85
+ declare const AvatarFallback: React.ForwardRefExoticComponent<AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>>;
86
+
87
+ declare const chipVariants: (props?: ({
88
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "inherit" | null | undefined;
89
+ variant?: "soft" | "outline" | "solid" | null | undefined;
90
+ size?: "2xs" | "xs" | "sm" | "md" | null | undefined;
91
+ shape?: "pill" | "rounded" | null | undefined;
92
+ dashed?: boolean | null | undefined;
93
+ mono?: boolean | null | undefined;
94
+ uppercase?: boolean | null | undefined;
95
+ wrap?: boolean | null | undefined;
96
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
97
+
98
+ interface ChipProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof chipVariants> {
99
+ /**
100
+ * Any colour outside the theme scale — a category hue, a dietary marker.
101
+ * Overrides the whole set of colour roles the theme would otherwise supply,
102
+ * so one value is enough for every `variant`.
103
+ */
104
+ color?: string;
105
+ /**
106
+ * Render the caller's own element instead of a `<span>`, keeping the chip's
107
+ * styling.
108
+ *
109
+ * A chip is a status marker by default and a span is right for that. But a
110
+ * row of chips is often a CHOICE — pick a variant, filter a list — and that
111
+ * needs real button semantics: focusable, keyboard-operable, `aria-pressed`.
112
+ * Styling a `<span>` to look tappable does not give any of that.
113
+ *
114
+ * ```tsx
115
+ * <Chip asChild variant={'outline'}>
116
+ * <button type={'button'} aria-pressed={on} onClick={pick}>Diced</button>
117
+ * </Chip>
118
+ * ```
119
+ */
120
+ asChild?: boolean;
121
+ }
122
+ /**
123
+ * A small status marker.
124
+ *
125
+ * `variant` chooses how much weight it carries: `soft` (a tinted fill, the
126
+ * default) reads as ambient, `outline` recedes further, and `solid` is a claim.
127
+ * `dashed` marks the value as provisional — a guess rather than a reading —
128
+ * which is a distinction worth drawing without spending a second colour on it.
129
+ */
130
+ declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLSpanElement>>;
131
+
132
+ declare const codeBlockVariants: (props?: ({
133
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "default" | null | undefined;
134
+ size?: "sm" | "md" | "lg" | null | undefined;
135
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
136
+
137
+ interface CodeBlockProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, VariantProps<typeof codeBlockVariants> {
138
+ /** The code content to display. */
139
+ children: string;
140
+ /** Language label displayed in the header (e.g. "sql", "json", "typescript"). */
141
+ language?: string;
142
+ /** Show a copy-to-clipboard button. */
143
+ copyable?: boolean;
144
+ /** Enable collapse/expand behavior. When true, content is initially collapsed. */
145
+ collapsible?: boolean;
146
+ /** Max height in rem when collapsed. Defaults to 12. */
147
+ collapsedHeight?: number;
148
+ /** Whether the code block starts expanded when `collapsible` is true. */
149
+ defaultExpanded?: boolean;
150
+ }
151
+ declare const CodeBlock: React.ForwardRefExoticComponent<CodeBlockProps & React.RefAttributes<HTMLDivElement>>;
152
+
153
+ interface DevIndicatorProps {
154
+ className?: string;
155
+ }
156
+ declare function DevIndicator({ className }: DevIndicatorProps): React.JSX.Element | null;
157
+
158
+ interface DialogProps {
159
+ open?: boolean;
160
+ defaultOpen?: boolean;
161
+ onOpenChange?: (open: boolean) => void;
162
+ onAfterClose?: () => void;
163
+ children?: React.ReactNode;
164
+ }
165
+ declare function Dialog({ open: controlledOpen, defaultOpen, onOpenChange, onAfterClose, children, }: DialogProps): React.JSX.Element;
166
+ interface DialogTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
167
+ asChild?: boolean;
168
+ }
169
+ declare function DialogTrigger({ asChild, onClick, children, ...props }: DialogTriggerProps): React.JSX.Element;
170
+ interface DialogCloseProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
171
+ asChild?: boolean;
172
+ }
173
+ declare function DialogClose({ asChild, onClick, children, ...props }: DialogCloseProps): React.JSX.Element;
174
+ declare function DialogOverlay({ className, passThrough, ...props }: React.HTMLAttributes<HTMLDivElement> & {
175
+ passThrough?: boolean;
176
+ }): React.JSX.Element;
177
+ type DialogContentProps = React.HTMLAttributes<HTMLDivElement> & {
178
+ width?: 'max' | 'min';
179
+ /**
180
+ * Give the panel a real width instead of letting its content decide.
181
+ *
182
+ * `width` is `max-content`/`min-content`, which is fine for a confirm but
183
+ * wrong for anything with a form in it: the panel ends up as narrow as the
184
+ * longest line allows and every row inside is squashed. Takes the same
185
+ * vocabulary as `Container` — `text`, `content`, `wide`, or a CSS length —
186
+ * and stays capped by the viewport either way.
187
+ */
188
+ measure?: 'text' | 'content' | 'wide' | (string & {});
189
+ /**
190
+ * The element the dialog came from, so it grows out of it and shrinks back
191
+ * into it rather than fading in over the top of the page.
192
+ *
193
+ * Pass the tile, row or card that was clicked. Where a modal has an obvious
194
+ * origin on screen, morphing from it says "this is that thing, larger" — a
195
+ * dialog that fades in centre-screen makes the reader find their place
196
+ * again when it closes.
197
+ *
198
+ * A `DOMRect` is accepted too, for the case where the origin has since been
199
+ * unmounted or moved.
200
+ */
201
+ origin?: React.RefObject<HTMLElement | null> | DOMRect | null;
202
+ /**
203
+ * Whether the scrim takes the pointer.
204
+ *
205
+ * `blocking` (the default) is a modal in the usual sense: the page behind is
206
+ * dimmed and inert, and a click on the scrim dismisses.
207
+ *
208
+ * `pass-through` dims the page but leaves it live, for a panel that is a
209
+ * DETAIL VIEW of something still on screen — a tile in a grid, a row in a
210
+ * table. Clicking the next tile should show the next thing, not spend one
211
+ * click closing and a second one opening. The dialog still dismisses on a
212
+ * click that lands outside it, so a click on the empty background behaves as
213
+ * it always did; a handler that calls `stopPropagation()` keeps it open,
214
+ * which is how the tile says "I am taking this click".
215
+ *
216
+ * Scroll is not locked in this mode, for the same reason: the thing you want
217
+ * to look at next may be further down the page.
218
+ */
219
+ overlay?: 'blocking' | 'pass-through';
220
+ };
221
+ declare function DialogContent({ className, children, width, origin, measure, overlay, style, ...props }: DialogContentProps): React.ReactPortal | null;
222
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
223
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
224
+ /**
225
+ * Renders the dialog's heading. Defaults to `<Typography variant='h6'>`
226
+ * so consumers can write `<DialogTitle>My dialog</DialogTitle>` without
227
+ * manually wrapping in Typography. Override the variant with the
228
+ * `variant` prop, or opt out entirely with `asChild` to supply a custom
229
+ * element (e.g., a Heading component).
230
+ */
231
+ declare function DialogTitle({ className, asChild, variant, ...props }: React.ComponentProps<'h2'> & {
232
+ asChild?: boolean;
233
+ variant?: TypographyVariant;
234
+ }): React.JSX.Element;
235
+ /**
236
+ * Renders the dialog's supporting description text. Defaults to
237
+ * `<Typography variant='body2'>`. Override with `variant` or supply a
238
+ * custom element via `asChild`.
239
+ */
240
+ declare function DialogDescription({ className, asChild, variant, ...props }: React.ComponentProps<'p'> & {
241
+ asChild?: boolean;
242
+ variant?: TypographyVariant;
243
+ }): React.JSX.Element;
244
+ declare function DialogPortal({ children }: {
245
+ children?: React.ReactNode;
246
+ }): React.JSX.Element;
247
+
248
+ declare const emptyStateVariants: (props?: ({
249
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "default" | null | undefined;
250
+ size?: "sm" | "md" | "lg" | null | undefined;
251
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
252
+
253
+ interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof emptyStateVariants> {
254
+ /** Icon displayed above the title. */
255
+ icon?: React.ReactNode;
256
+ /** Primary heading text. */
257
+ title: string;
258
+ /** Secondary descriptive text below the title. */
259
+ description?: string;
260
+ /** Action element (typically a Button) rendered below the text. */
261
+ action?: React.ReactNode;
262
+ }
263
+ declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
264
+
265
+ declare const iconVariants: (props?: ({
266
+ variant?: "contained" | "outlined" | "ghost" | "plain" | null | undefined;
267
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "inherit" | null | undefined;
268
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
269
+ rounded?: boolean | "extra" | null | undefined;
270
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
271
+
272
+ type IconVariantSize = NonNullable<VariantProps<typeof iconVariants>['size']>;
273
+ type IconNodeProps = React.SVGProps<SVGSVGElement> & {
274
+ size?: string | number;
275
+ };
276
+ interface IconProps extends React.HTMLAttributes<HTMLSpanElement>, Omit<VariantProps<typeof iconVariants>, 'size'> {
277
+ iconNode: React.ComponentType<IconNodeProps>;
278
+ size?: IconVariantSize | number;
279
+ /** Apply 1s linear infinite rotation to the inner SVG; also defaults role='status' for a11y. */
280
+ spin?: boolean;
281
+ }
282
+ /**
283
+ * Standalone icon with a sized wrapper box (e.g. status indicators, list-item
284
+ * leaders, themed avatars). Renders `<span><svg/></span>` — the span carries
285
+ * the `iconVariants` background/border for contained/outlined variants and a
286
+ * fixed pixel box per `size`.
287
+ *
288
+ * **DO NOT** place inside `Button`, `Chip`, `DropdownMenuItem`, or other host
289
+ * components that already size their SVG children via `:has(> svg)`. The host's
290
+ * size + padding adjustments only trigger for a direct-child `<svg>`, and
291
+ * Icon's wrapper span breaks that rule — you end up with the host's default
292
+ * (wider) padding plus Icon's full-height box (e.g. 1.85rem for `size='sm'`).
293
+ *
294
+ * Inside a host that sizes its own svg, pass the raw lucide component directly:
295
+ *
296
+ * ```tsx
297
+ * <Button>
298
+ * <CheckIcon />
299
+ * Save
300
+ * </Button>
301
+ *
302
+ * <Button>
303
+ * <Loader2Icon className={'animate-spin'} />
304
+ * Saving…
305
+ * </Button>
306
+ * ```
307
+ *
308
+ * Use `Icon` only when the wrapper box is desired (standalone use).
309
+ */
310
+ declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLSpanElement>>;
311
+
312
+ interface ListProps extends React.HTMLAttributes<HTMLUListElement | HTMLOListElement> {
313
+ variant?: 'disc' | 'decimal' | 'none';
314
+ gap?: number;
315
+ size?: 'xs' | 'sm' | 'md' | 'lg';
316
+ muted?: boolean;
317
+ }
318
+ declare const List: React.ForwardRefExoticComponent<ListProps & React.RefAttributes<HTMLUListElement | HTMLOListElement>>;
319
+ interface ListItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
320
+ icon?: React.ReactNode;
321
+ }
322
+ declare const ListItem: React.ForwardRefExoticComponent<ListItemProps & React.RefAttributes<HTMLLIElement>>;
323
+
324
+ declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
325
+
326
+ declare const progressBarVariants: (props?: ({
327
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "inherit" | null | undefined;
328
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
329
+ rounded?: boolean | null | undefined;
330
+ animated?: boolean | null | undefined;
331
+ indeterminate?: boolean | null | undefined;
332
+ striped?: boolean | null | undefined;
333
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
334
+
335
+ interface ProgressBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, VariantProps<typeof progressBarVariants> {
336
+ /** Current progress value (0–100). Ignored when `indeterminate` is true. */
337
+ value?: number;
338
+ /** Accessible label describing what the progress bar represents. */
339
+ label?: string;
340
+ }
341
+ declare const ProgressBar: React.ForwardRefExoticComponent<ProgressBarProps & React.RefAttributes<HTMLDivElement>>;
342
+
343
+ interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
344
+ orientation?: 'horizontal' | 'vertical';
345
+ decorative?: boolean;
346
+ }
347
+ declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
348
+
349
+ type TrendDirection = 'up' | 'down' | 'neutral';
350
+ type StatCardTheme = 'default' | 'primary' | 'secondary' | 'destructive' | 'warning' | 'success' | 'info' | 'slate';
351
+ type StatCardSize = 'sm' | 'md' | 'lg';
352
+ type StatCardVariant = 'unstyled' | 'outlined' | 'filled';
353
+ type StatCardDirection = 'row' | 'column';
354
+ interface StatCardProps extends React.ComponentPropsWithoutRef<'div'> {
355
+ /** Text label describing the metric. */
356
+ label: string;
357
+ /** The metric value to display. */
358
+ value?: React.ReactNode;
359
+ /** Icon displayed beside the metric. */
360
+ icon?: React.ReactNode;
361
+ /** Optional description below the value. */
362
+ description?: string;
363
+ /** Trend direction indicator. */
364
+ trend?: TrendDirection;
365
+ /** Trend label text (e.g. "+12%", "−3.4%"). */
366
+ trendLabel?: string;
367
+ /** Visual theme for the card. */
368
+ theme?: StatCardTheme;
369
+ /** Card size. */
370
+ size?: StatCardSize;
371
+ /** Card Direction. */
372
+ direction?: StatCardDirection;
373
+ /** Surface variant. */
374
+ variant?: StatCardVariant;
375
+ /**
376
+ * The element the card renders as.
377
+ *
378
+ * A figure that FILTERS the thing it counts is a control, and should be a
379
+ * real one: `el='button'` makes the whole card the target, so it takes
380
+ * focus, answers the keyboard, and reads as pressable rather than as a
381
+ * number that happens to react to a click.
382
+ */
383
+ el?: React.ElementType<React.HTMLAttributes<HTMLDivElement>>;
384
+ }
385
+ declare const StatCard: React.ForwardRefExoticComponent<StatCardProps & React.RefAttributes<HTMLDivElement>>;
386
+
387
+ declare const statusDotVariants: (props?: ({
388
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "inherit" | null | undefined;
389
+ size?: "sm" | "md" | "lg" | null | undefined;
390
+ glow?: boolean | null | undefined;
391
+ pulse?: boolean | null | undefined;
392
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
393
+
394
+ interface StatusDotProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'>, VariantProps<typeof statusDotVariants> {
395
+ /** A colour outside the theme scale. */
396
+ color?: string;
397
+ /** Accessible name. Omit only when adjacent text already says the state. */
398
+ label?: string;
399
+ }
400
+ /**
401
+ * The dot that says what state a connection or process is in.
402
+ *
403
+ * Deliberately not a `Chip`: a chip is a bordered object that holds a word,
404
+ * where this is a single mark that usually sits *beside* one. Pairing it with
405
+ * text is the caller's job, which keeps the wording — and its translation —
406
+ * out of here.
407
+ *
408
+ * `glow` is for the state worth catching in peripheral vision (a save landing);
409
+ * `pulse` for one that is still in flight.
410
+ */
411
+ declare const StatusDot: React.ForwardRefExoticComponent<StatusDotProps & React.RefAttributes<HTMLSpanElement>>;
412
+
413
+ declare const stepProgressVariants: (props?: ({
414
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "inherit" | null | undefined;
415
+ size?: "sm" | "md" | "lg" | null | undefined;
416
+ orientation?: "horizontal" | "vertical" | null | undefined;
417
+ stretch?: boolean | null | undefined;
418
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
419
+
420
+ interface Step {
421
+ /** Label displayed next to or below the step indicator. */
422
+ label: string;
423
+ /** Optional secondary description below the label. */
424
+ description?: string;
425
+ /** Optional icon rendered inside the dot. Defaults to a checkmark for completed steps. */
426
+ icon?: React.ReactNode;
427
+ }
428
+ interface StepProgressProps extends Omit<React.HTMLAttributes<HTMLOListElement>, 'children'>, VariantProps<typeof stepProgressVariants> {
429
+ /** Array of step definitions. */
430
+ steps: Step[];
431
+ /** Zero-based index of the currently active step. Steps before this are complete. */
432
+ currentStep: number;
433
+ }
434
+ declare const StepProgress: React.ForwardRefExoticComponent<StepProgressProps & React.RefAttributes<HTMLOListElement>>;
435
+
436
+ declare const switchVariants: (props?: ({
437
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "inherit" | null | undefined;
438
+ size?: "sm" | "md" | "lg" | null | undefined;
439
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
440
+
441
+ interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'onClick'>, VariantProps<typeof switchVariants> {
442
+ pressed?: boolean;
443
+ onPressedChange?: (pressed: boolean) => void;
444
+ }
445
+ declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
446
+
447
+ declare const TableCard: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
448
+ declare const Table: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLTableElement> & React.TableHTMLAttributes<HTMLTableElement> & {
449
+ defaultSort?: SortState;
450
+ }, "ref"> & React.RefAttributes<HTMLTableElement>>;
451
+ declare const TableHead: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
452
+ declare const TableFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
453
+ interface TableBodyProps extends React.ComponentProps<'tbody'> {
454
+ showEmptyState?: boolean;
455
+ emptyState?: React.ReactNode;
456
+ emptyStateColSpan?: number;
457
+ }
458
+ declare const TableBody: React.ForwardRefExoticComponent<Omit<TableBodyProps, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
459
+ declare const TableRow: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & React.RefAttributes<HTMLTableRowElement>>;
460
+ type TableHeaderProps = React.ComponentProps<'th'> & {
461
+ action?: 'sticky';
462
+ };
463
+ declare const TableHeader: React.ForwardRefExoticComponent<Omit<TableHeaderProps, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
464
+ type TableCellProps = React.ComponentProps<'td'> & {
465
+ action?: 'sticky';
466
+ };
467
+ declare const TableCell: React.ForwardRefExoticComponent<Omit<TableCellProps, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
468
+ interface TableSortableHeaderProps<Key extends string = string> {
469
+ label: string;
470
+ sortKey: Key;
471
+ defaultSort?: true | SortDirection;
472
+ action?: 'sticky';
473
+ }
474
+ declare function TableSortableHeader<Key extends string = string>({ label, sortKey, defaultSort, action, }: TableSortableHeaderProps<Key>): React.JSX.Element;
475
+
476
+ interface TableActionItem {
477
+ /** Visible label for the action. */
478
+ label: string;
479
+ /** Optional icon rendered before the label. */
480
+ icon?: React.ReactNode;
481
+ /** Click handler for this action. */
482
+ onClick?: () => void;
483
+ /** Whether the action is disabled. */
484
+ disabled?: boolean;
485
+ /** Visual variant — `destructive` renders the item in the destructive theme. */
486
+ variant?: 'default' | 'destructive';
487
+ }
488
+ interface TableActionCellProps extends React.ComponentProps<'div'> {
489
+ /** Array of actions to display. Renders a single button for one action, or a dropdown for multiple. */
490
+ actions: TableActionItem[];
491
+ /** Accessible label for the dropdown trigger button. */
492
+ dropdownLabel?: string;
493
+ }
494
+ /**
495
+ * Renders a right-aligned action cell for table rows.
496
+ *
497
+ * - **Single action**: renders a visible `<Button>` with the action label and optional icon.
498
+ * - **Multiple actions**: renders a `...` icon button that opens a `<DropdownMenu>`.
499
+ */
500
+ declare const TableActionCell: React.ForwardRefExoticComponent<Omit<TableActionCellProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
501
+
502
+ interface TableToolbarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
503
+ /**
504
+ * Left-aligned controls — typically a search Input plus zero or more
505
+ * filter SelectFields / DatePickers / Toggles. Children flow horizontally
506
+ * with `gap` and wrap on narrow screens.
507
+ */
508
+ children?: React.ReactNode;
509
+ /**
510
+ * Right-aligned slot — for reset / clear / bulk-action buttons. Pushed to
511
+ * the end of the row via auto-margin; wraps to a new line on narrow
512
+ * screens if the controls grow too wide.
513
+ */
514
+ actions?: React.ReactNode;
515
+ /**
516
+ * Render a 1px subtle bottom border to separate the toolbar from the
517
+ * Table or content below. Default `true`.
518
+ */
519
+ divider?: boolean;
520
+ }
521
+ /**
522
+ * Container for the row of controls (search, filters, actions) that sits
523
+ * above a `Table` inside a `TableCard`. Presentational only — consumers
524
+ * own all filter state and search debouncing. The companion to
525
+ * `TableSearch` for the more common single-search case.
526
+ */
527
+ declare const TableToolbar: React.ForwardRefExoticComponent<TableToolbarProps & React.RefAttributes<HTMLDivElement>>;
528
+
529
+ declare const toggleVariants: (props?: ({
530
+ variant?: "contained" | "outlined" | "ghost" | null | undefined;
531
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "inherit" | null | undefined;
532
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
533
+ iconOnly?: boolean | null | undefined;
534
+ rounded?: boolean | "extra" | null | undefined;
535
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
536
+
537
+ interface ToggleProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'>, VariantProps<typeof toggleVariants> {
538
+ pressed?: boolean;
539
+ defaultPressed?: boolean;
540
+ onPressedChange?: (pressed: boolean) => void;
541
+ value?: string;
542
+ }
543
+ declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
544
+
545
+ type ToggleGroupBaseProps = VariantProps<typeof toggleVariants> & {
546
+ className?: string;
547
+ children?: React.ReactNode;
548
+ stretch?: boolean;
549
+ };
550
+ type ToggleGroupSingleProps = ToggleGroupBaseProps & {
551
+ type: 'single';
552
+ value?: string;
553
+ defaultValue?: string;
554
+ onValueChange?: (value: string) => void;
555
+ };
556
+ type ToggleGroupMultipleProps = ToggleGroupBaseProps & {
557
+ type: 'multiple';
558
+ value?: string[];
559
+ defaultValue?: string[];
560
+ onValueChange?: (value: string[]) => void;
561
+ };
562
+ type ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps;
563
+ declare const ToggleGroup: React.ForwardRefExoticComponent<ToggleGroupProps & React.RefAttributes<HTMLDivElement>>;
564
+
565
+ export { DialogHeader as B, Chip as C, DevIndicator as D, DialogOverlay as E, DialogPortal as F, DialogTitle as H, DialogTrigger as I, EmptyState as K, Icon as M, List as O, ListItem as P, Pagination as T, ProgressBar as V, Separator as Y, Alert as a, StatCard as a0, StatusDot as a6, StepProgress as a9, Switch as ab, Table as ad, TableActionCell as ae, TableBody as ah, TableCard as aj, TableCell as ak, TableFooter as al, TableHead as am, TableHeader as an, TableRow as ao, TableSortableHeader as ap, TableToolbar as ar, Toggle as at, ToggleGroup as au, persistAlert as ay, statusDotVariants as az, AlertBanner as b, AlertDescription as d, AlertProvider as g, AlertTitle as i, Avatar as j, AvatarFallback as k, AvatarImage as m, CodeBlock as q, Dialog as t, DialogClose as u, DialogContent as w, DialogDescription as y, DialogFooter as z };
566
+ export type { SortDirection as $, AlertContextValue as A, DialogProps as G, DialogTriggerProps as J, EmptyStateProps as L, IconProps as N, ListItemProps as Q, ListProps as R, SortState as S, PaginationProps as U, ProgressBarProps as W, PushAlertInput as X, SeparatorProps as Z, SortContextValue as _, StatCardDirection as a1, StatCardProps as a2, StatCardSize as a3, StatCardTheme as a4, StatCardVariant as a5, StatusDotProps as a7, Step as a8, StepProgressProps as aa, SwitchProps as ac, TableActionCellProps as af, TableActionItem as ag, TableBodyProps as ai, TableSortableHeaderProps as aq, TableToolbarProps as as, ToggleGroupProps as av, ToggleProps as aw, TrendDirection as ax, AlertBannerProps as c, AlertMessage as e, AlertProps as f, AlertTheme as h, AvatarFallbackProps as l, AvatarImageProps as n, AvatarProps as o, ChipProps as p, CodeBlockProps as r, DevIndicatorProps as s, DialogCloseProps as v, DialogContentProps as x };
package/dist/index.d.ts CHANGED
@@ -1,19 +1,19 @@
1
1
  export { Logo, LogoProps } from './brand.js';
2
- export { C as Checkbox, a as CheckboxProps, b as Combobox, c as ComboboxOption, d as ComboboxProps, D as DatePicker, e as DatePickerProps, F as FormTheme, L as Label, f as LabelProps, S as Select, g as SelectAlign, h as SelectContent, i as SelectContentProps, j as SelectField, k as SelectFieldProps, l as SelectGroup, m as SelectItem, n as SelectPosition, o as SelectProps, p as SelectSeparator, q as SelectSide, r as SelectTrigger, s as SelectValue, t as __Surface } from './index-2nHZOukj.js';
2
+ export { C as Checkbox, a as CheckboxProps, b as Combobox, c as ComboboxOption, d as ComboboxProps, D as DatePicker, e as DatePickerProps, F as FormTheme, L as Label, f as LabelProps, S as Select, g as SelectAlign, h as SelectContent, i as SelectContentProps, j as SelectField, k as SelectFieldProps, l as SelectGroup, m as SelectItem, n as SelectPosition, o as SelectProps, p as SelectSeparator, q as SelectSide, r as SelectTrigger, s as SelectValue, t as __Surface } from './index-CIK_SmBm.js';
3
3
  export { I as Input, a as InputBaseProps } from './input-Cp5LET5i.js';
4
4
  import * as React from 'react';
5
- import { S as SidebarContextValue } from './index-BWTwKQsp.js';
6
- export { A as AppContent, a as AppContentFooter, b as AppContentFooterProps, c as AppContentMain, d as AppContentMainProps, e as AppFooter, f as AppFooterProps, g as AppShell, h as AppShellProps, i as AppSidebar, j as AppSidebarHeader, k as AppSidebarHeaderProps, l as AppSidebarProps, C as Collapse, m as CollapseProps, n as Column, o as ColumnProps, p as Container, q as ContainerProps, G as Grid, r as GridColumns, s as GridProps, R as Row, t as Sidebar, u as SidebarContent, v as SidebarFooter, w as SidebarGroup, x as SidebarGroupAction, y as SidebarGroupContent, z as SidebarGroupLabel, B as SidebarHeader, D as SidebarInput, E as SidebarInset, F as SidebarMenu, H as SidebarMenuAction, I as SidebarMenuBadge, J as SidebarMenuButton, K as SidebarMenuItem, L as SidebarMenuSkeleton, M as SidebarMenuSub, N as SidebarMenuSubButton, O as SidebarMenuSubItem, P as SidebarProvider, Q as SidebarRail, T as SidebarTrigger, U as SidebarVariant, V as Skeleton } from './index-BWTwKQsp.js';
7
- import { A as AlertContextValue, S as SortState } from './index-CWM2ewRz.js';
8
- export { a as Alert, b as AlertBanner, c as AlertBannerProps, d as AlertDescription, e as AlertMessage, f as AlertProps, g as AlertProvider, h as AlertTheme, i as AlertTitle, j as Avatar, k as AvatarFallback, l as AvatarFallbackProps, m as AvatarImage, n as AvatarImageProps, o as AvatarProps, C as Chip, p as ChipProps, q as CodeBlock, r as CodeBlockProps, D as DevIndicator, s as DevIndicatorProps, t as Dialog, u as DialogClose, v as DialogCloseProps, w as DialogContent, x as DialogContentProps, y as DialogDescription, z as DialogFooter, B as DialogHeader, E as DialogOverlay, F as DialogPortal, G as DialogProps, H as DialogTitle, I as DialogTrigger, J as DialogTriggerProps, K as EmptyState, L as EmptyStateProps, M as Icon, N as IconProps, O as List, P as ListItem, Q as ListItemProps, R as ListProps, T as Pagination, U as PaginationProps, V as ProgressBar, W as ProgressBarProps, X as PushAlertInput, Y as Separator, Z as SeparatorProps, _ as SortContextValue, $ as SortDirection, a0 as StatCard, a1 as StatCardDirection, a2 as StatCardProps, a3 as StatCardSize, a4 as StatCardTheme, a5 as StatCardVariant, a6 as StatusDot, a7 as StatusDotProps, a8 as Step, a9 as StepProgress, aa as StepProgressProps, ab as Switch, ac as SwitchProps, ad as Table, ae as TableActionCell, af as TableActionCellProps, ag as TableActionItem, ah as TableBody, ai as TableBodyProps, aj as TableCard, ak as TableCell, al as TableFooter, am as TableHead, an as TableHeader, ao as TableRow, ap as TableSortableHeader, aq as TableSortableHeaderProps, ar as TableToolbar, as as TableToolbarProps, at as Toggle, au as ToggleGroup, av as ToggleGroupProps, aw as ToggleProps, ax as TrendDirection, ay as persistAlert, az as statusDotVariants } from './index-CWM2ewRz.js';
5
+ import { S as SidebarContextValue } from './index-BxBAq63A.js';
6
+ export { A as AppContent, a as AppContentFooter, b as AppContentFooterProps, c as AppContentMain, d as AppContentMainProps, e as AppFooter, f as AppFooterProps, g as AppShell, h as AppShellProps, i as AppSidebar, j as AppSidebarHeader, k as AppSidebarHeaderProps, l as AppSidebarProps, C as Collapse, m as CollapseProps, n as Column, o as ColumnProps, p as Container, q as ContainerProps, G as Grid, r as GridColumns, s as GridProps, R as Row, t as Sidebar, u as SidebarContent, v as SidebarFooter, w as SidebarGroup, x as SidebarGroupAction, y as SidebarGroupContent, z as SidebarGroupLabel, B as SidebarHeader, D as SidebarInput, E as SidebarInset, F as SidebarMenu, H as SidebarMenuAction, I as SidebarMenuBadge, J as SidebarMenuButton, K as SidebarMenuItem, L as SidebarMenuSkeleton, M as SidebarMenuSub, N as SidebarMenuSubButton, O as SidebarMenuSubItem, P as SidebarProvider, Q as SidebarRail, T as SidebarTrigger, U as SidebarVariant, V as Skeleton } from './index-BxBAq63A.js';
7
+ import { A as AlertContextValue, S as SortState } from './index-D3J_UMR7.js';
8
+ export { a as Alert, b as AlertBanner, c as AlertBannerProps, d as AlertDescription, e as AlertMessage, f as AlertProps, g as AlertProvider, h as AlertTheme, i as AlertTitle, j as Avatar, k as AvatarFallback, l as AvatarFallbackProps, m as AvatarImage, n as AvatarImageProps, o as AvatarProps, C as Chip, p as ChipProps, q as CodeBlock, r as CodeBlockProps, D as DevIndicator, s as DevIndicatorProps, t as Dialog, u as DialogClose, v as DialogCloseProps, w as DialogContent, x as DialogContentProps, y as DialogDescription, z as DialogFooter, B as DialogHeader, E as DialogOverlay, F as DialogPortal, G as DialogProps, H as DialogTitle, I as DialogTrigger, J as DialogTriggerProps, K as EmptyState, L as EmptyStateProps, M as Icon, N as IconProps, O as List, P as ListItem, Q as ListItemProps, R as ListProps, T as Pagination, U as PaginationProps, V as ProgressBar, W as ProgressBarProps, X as PushAlertInput, Y as Separator, Z as SeparatorProps, _ as SortContextValue, $ as SortDirection, a0 as StatCard, a1 as StatCardDirection, a2 as StatCardProps, a3 as StatCardSize, a4 as StatCardTheme, a5 as StatCardVariant, a6 as StatusDot, a7 as StatusDotProps, a8 as Step, a9 as StepProgress, aa as StepProgressProps, ab as Switch, ac as SwitchProps, ad as Table, ae as TableActionCell, af as TableActionCellProps, ag as TableActionItem, ah as TableBody, ai as TableBodyProps, aj as TableCard, ak as TableCell, al as TableFooter, am as TableHead, an as TableHeader, ao as TableRow, ap as TableSortableHeader, aq as TableSortableHeaderProps, ar as TableToolbar, as as TableToolbarProps, at as Toggle, au as ToggleGroup, av as ToggleGroupProps, aw as ToggleProps, ax as TrendDirection, ay as persistAlert, az as statusDotVariants } from './index-D3J_UMR7.js';
9
9
  export { R as RowProps } from './row-CuhTBQhK.js';
10
10
  export { Breadcrumbs, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DropdownMenuTriggerProps, Link, LinkProps, RouterAdapter, RouterProvider, Sheet, SheetBody, SheetClose, SheetCloseProps, SheetContent, SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetProps, SheetTitle, SheetTrigger, SheetTriggerProps, useRouterAdapter } from './navigation.js';
11
- export { B as BreadcrumbItemData, N as NavGroup, a as NavItem, b as NavUser, c as NavUserProps, S as SidebarNavItem, d as SidebarSection } from './nav-user-CJIcWKyY.js';
11
+ export { B as BreadcrumbItemData, N as NavGroup, a as NavItem, b as NavUser, c as NavUserProps, S as SidebarNavItem, d as SidebarSection } from './nav-user-CilmWvtr.js';
12
12
  export { AppearanceTabs, AppearanceToggleDropdown } from './settings.js';
13
13
  export { a as User, b as UserMenuContent, U as UserMenuContentProps, c as UserMenuItem } from './user-menu-content-D0Ldzigm.js';
14
14
  export { Heading, TruncatedText, TruncatedTextProps } from './typography.js';
15
15
  export { T as Typography, a as TypographyAlign, b as TypographyProps, c as TypographySize, d as TypographyTheme, e as TypographyTransform, f as TypographyVariant, g as TypographyWeight } from './typography-CTGVc_Gg.js';
16
- export { B as Button, a as ButtonProps, T as Tooltip, b as TooltipContent, c as TooltipContentProps, d as TooltipProps, e as TooltipProvider, f as TooltipTrigger, g as TooltipTriggerProps } from './tooltip-BpAJwi3K.js';
16
+ export { B as Button, a as ButtonProps, T as Tooltip, b as TooltipContent, c as TooltipContentProps, d as TooltipProps, e as TooltipProvider, f as TooltipTrigger, g as TooltipTriggerProps } from './tooltip-DxO_DWMO.js';
17
17
  export { UserInfo } from './user.js';
18
18
  export { CONSTELLATION_PORTAL_SELECTOR, getCsrfToken, isInConstellationPortal } from './utils.js';
19
19
  import 'class-variance-authority';
@@ -61,7 +61,7 @@ function AppSidebar({ logo, homeHref = '/dashboard', currentPath = '', linkCompo
61
61
  return (jsxs(Fragment, { children: [jsxs(Sidebar, { "data-slot": 'app-sidebar', collapsible: 'icon', variant: 'inset', children: [jsx(SidebarHeader, { children: jsx(SidebarMenu, { children: jsx(SidebarMenuItem, { children: jsx(SidebarMenuButton, { size: 'lg', asChild: true, children: LinkComp ? (jsx(LinkComp, { href: homeHref, onClick: handleNavigation, children: logo })) : (jsx("a", { href: homeHref, onClick: handleNavigation, children: logo })) }) }) }) }), jsx(SidebarContent, { children: sections.map(section => (jsxs(SidebarGroup, { children: [jsx(SidebarGroupLabel, { children: section.label }), jsx(SidebarMenu, { children: section.items.map(item => {
62
62
  const isActive = item.href === bestMatch;
63
63
  if (section.renderItem) {
64
- return (jsx(SidebarMenuItem, { children: section.renderItem(item, { isActive }) }, item.title));
64
+ return (jsx(SidebarMenuItem, { children: section.renderItem(item, { isActive, onNavigate: handleNavigation }) }, item.title));
65
65
  }
66
66
  return (jsx(SidebarMenuItem, { children: jsx(SidebarMenuButton, { asChild: true, isActive: isActive, tooltip: { children: item.title }, children: jsx(NavLink, { item: item, linkComponent: LinkComp, onNavigate: handleNavigation }) }) }, item.title));
67
67
  }) })] }, section.label))) }), footerItems?.length ? (jsxs(Fragment, { children: [footerSeparator && jsx(Separator, {}), jsx(SidebarFooter, { children: jsx(SidebarMenu, { children: footerItems.map(item => (jsx(SidebarMenuItem, { children: jsx(SidebarMenuButton, { asChild: true, isActive: item.href === bestMatch, tooltip: { children: item.title }, children: jsx(NavLink, { item: item, linkComponent: LinkComp, onNavigate: handleNavigation }) }) }, item.title))) }) })] })) : null] }), children] }));
@@ -1 +1 @@
1
- {"version":3,"file":"app-sidebar.js","sources":["../../../src/layout/AppSidebar/app-sidebar.tsx"],"sourcesContent":["import { useSidebar } from '@constellation/hooks';\nimport { useMobileNavigation } from '@constellation/hooks/use-mobile-navigation';\nimport { useRouterAdapter } from '@constellation/navigation/Router';\nimport { type SidebarNavItem, type SidebarSection } from '@constellation/types';\nimport { Separator } from '@constellation/ui/Separator';\nimport * as React from 'react';\nimport { flushSync } from 'react-dom';\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n} from '../Sidebar';\n\nexport interface AppSidebarProps {\n logo: React.ReactNode;\n homeHref?: string;\n currentPath?: string;\n linkComponent?: React.ElementType;\n sections: SidebarSection[];\n footerItems?: SidebarNavItem[];\n footerSeparator?: boolean;\n children?: React.ReactNode;\n}\n\ntype NavLinkProps = {\n item: SidebarNavItem;\n linkComponent?: React.ElementType;\n onNavigate?: (event: React.MouseEvent<HTMLAnchorElement>) => void;\n} & React.AnchorHTMLAttributes<HTMLAnchorElement>;\n\nfunction NavLink({ item, linkComponent: LinkComp, onNavigate, onClick, ...props }: NavLinkProps) {\n const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {\n onClick?.(event);\n if (event.defaultPrevented) {\n return;\n }\n\n onNavigate?.(event);\n };\n\n if (item.href.startsWith('http')) {\n return (\n <a\n href={item.href}\n target={'_blank'}\n rel={'noopener noreferrer'}\n onClick={handleClick}\n {...props}\n >\n {item.icon}\n <span>{item.title}</span>\n <span className={'srOnly'}>(opens in new tab)</span>\n </a>\n );\n }\n\n if (!LinkComp) {\n return (\n <a href={item.href} onClick={handleClick} {...props}>\n {item.icon}\n <span>{item.title}</span>\n </a>\n );\n }\n\n return (\n <LinkComp href={item.href} onClick={handleClick} {...props}>\n {item.icon}\n <span>{item.title}</span>\n </LinkComp>\n );\n}\n\nexport function AppSidebar({\n logo,\n homeHref = '/dashboard',\n currentPath = '',\n linkComponent,\n sections,\n footerItems,\n footerSeparator,\n children,\n}: AppSidebarProps) {\n const { isMobile, openMobile, setOpenMobile } = useSidebar();\n // Falls back to the RouterProvider's link component, so configuring the\n // router once upgrades the whole sidebar without threading a prop here.\n const { linkComponent: adapterLink } = useRouterAdapter();\n const LinkComp = linkComponent ?? adapterLink;\n const cleanupMobileNavigation = useMobileNavigation();\n const allHrefs = [\n ...sections.flatMap(s => s.items.map(i => i.href)),\n ...(footerItems ?? []).map(i => i.href),\n ];\n const bestMatch =\n allHrefs\n .filter(\n href =>\n currentPath === href ||\n currentPath.startsWith(href + '/') ||\n currentPath.startsWith(href + '?'),\n )\n .sort((a, b) => b.length - a.length)[0] ?? '';\n\n const handleNavigation = (event: React.MouseEvent<HTMLAnchorElement>) => {\n if (!isMobile || !openMobile || event.button !== 0) {\n return;\n }\n\n if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) {\n return;\n }\n\n const currentTarget = event.currentTarget;\n const target = currentTarget.getAttribute('target');\n if ((target && target.toLowerCase() !== '_self') || currentTarget.hasAttribute('download')) {\n return;\n }\n\n flushSync(() => {\n setOpenMobile(false);\n });\n cleanupMobileNavigation();\n };\n\n return (\n <>\n <Sidebar data-slot={'app-sidebar'} collapsible={'icon'} variant={'inset'}>\n <SidebarHeader>\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarMenuButton size={'lg'} asChild>\n {LinkComp ? (\n <LinkComp href={homeHref} onClick={handleNavigation}>\n {logo}\n </LinkComp>\n ) : (\n <a href={homeHref} onClick={handleNavigation}>\n {logo}\n </a>\n )}\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n </SidebarHeader>\n <SidebarContent>\n {sections.map(section => (\n <SidebarGroup key={section.label}>\n <SidebarGroupLabel>{section.label}</SidebarGroupLabel>\n <SidebarMenu>\n {section.items.map(item => {\n const isActive = item.href === bestMatch;\n\n if (section.renderItem) {\n return (\n <SidebarMenuItem key={item.title}>\n {section.renderItem(item, { isActive })}\n </SidebarMenuItem>\n );\n }\n\n return (\n <SidebarMenuItem key={item.title}>\n <SidebarMenuButton\n asChild\n isActive={isActive}\n tooltip={{ children: item.title }}\n >\n <NavLink\n item={item}\n linkComponent={LinkComp}\n onNavigate={handleNavigation}\n />\n </SidebarMenuButton>\n </SidebarMenuItem>\n );\n })}\n </SidebarMenu>\n </SidebarGroup>\n ))}\n </SidebarContent>\n {footerItems?.length ? (\n <>\n {footerSeparator && <Separator />}\n <SidebarFooter>\n <SidebarMenu>\n {footerItems.map(item => (\n <SidebarMenuItem key={item.title}>\n <SidebarMenuButton\n asChild\n isActive={item.href === bestMatch}\n tooltip={{ children: item.title }}\n >\n <NavLink item={item} linkComponent={LinkComp} onNavigate={handleNavigation} />\n </SidebarMenuButton>\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n </SidebarFooter>\n </>\n ) : null}\n </Sidebar>\n {children}\n </>\n );\n}\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;AAoCA,SAAS,OAAO,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,KAAK,EAAgB,EAAA;AAC7F,IAAA,MAAM,WAAW,GAAG,CAAC,KAA0C,KAAI;AACjE,QAAA,OAAO,GAAG,KAAK,CAAC;AAChB,QAAA,IAAI,KAAK,CAAC,gBAAgB,EAAE;YAC1B;QACF;AAEA,QAAA,UAAU,GAAG,KAAK,CAAC;AACrB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","sources":["../../../src/layout/AppSidebar/app-sidebar.tsx"],"sourcesContent":["import { useSidebar } from '@constellation/hooks';\nimport { useMobileNavigation } from '@constellation/hooks/use-mobile-navigation';\nimport { useRouterAdapter } from '@constellation/navigation/Router';\nimport { type SidebarNavItem, type SidebarSection } from '@constellation/types';\nimport { Separator } from '@constellation/ui/Separator';\nimport * as React from 'react';\nimport { flushSync } from 'react-dom';\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n} from '../Sidebar';\n\nexport interface AppSidebarProps {\n logo: React.ReactNode;\n homeHref?: string;\n currentPath?: string;\n linkComponent?: React.ElementType;\n sections: SidebarSection[];\n footerItems?: SidebarNavItem[];\n footerSeparator?: boolean;\n children?: React.ReactNode;\n}\n\ntype NavLinkProps = {\n item: SidebarNavItem;\n linkComponent?: React.ElementType;\n onNavigate?: (event: React.MouseEvent<HTMLAnchorElement>) => void;\n} & React.AnchorHTMLAttributes<HTMLAnchorElement>;\n\nfunction NavLink({ item, linkComponent: LinkComp, onNavigate, onClick, ...props }: NavLinkProps) {\n const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {\n onClick?.(event);\n if (event.defaultPrevented) {\n return;\n }\n\n onNavigate?.(event);\n };\n\n if (item.href.startsWith('http')) {\n return (\n <a\n href={item.href}\n target={'_blank'}\n rel={'noopener noreferrer'}\n onClick={handleClick}\n {...props}\n >\n {item.icon}\n <span>{item.title}</span>\n <span className={'srOnly'}>(opens in new tab)</span>\n </a>\n );\n }\n\n if (!LinkComp) {\n return (\n <a href={item.href} onClick={handleClick} {...props}>\n {item.icon}\n <span>{item.title}</span>\n </a>\n );\n }\n\n return (\n <LinkComp href={item.href} onClick={handleClick} {...props}>\n {item.icon}\n <span>{item.title}</span>\n </LinkComp>\n );\n}\n\nexport function AppSidebar({\n logo,\n homeHref = '/dashboard',\n currentPath = '',\n linkComponent,\n sections,\n footerItems,\n footerSeparator,\n children,\n}: AppSidebarProps) {\n const { isMobile, openMobile, setOpenMobile } = useSidebar();\n // Falls back to the RouterProvider's link component, so configuring the\n // router once upgrades the whole sidebar without threading a prop here.\n const { linkComponent: adapterLink } = useRouterAdapter();\n const LinkComp = linkComponent ?? adapterLink;\n const cleanupMobileNavigation = useMobileNavigation();\n const allHrefs = [\n ...sections.flatMap(s => s.items.map(i => i.href)),\n ...(footerItems ?? []).map(i => i.href),\n ];\n const bestMatch =\n allHrefs\n .filter(\n href =>\n currentPath === href ||\n currentPath.startsWith(href + '/') ||\n currentPath.startsWith(href + '?'),\n )\n .sort((a, b) => b.length - a.length)[0] ?? '';\n\n const handleNavigation = (event: React.MouseEvent<HTMLAnchorElement>) => {\n if (!isMobile || !openMobile || event.button !== 0) {\n return;\n }\n\n if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) {\n return;\n }\n\n const currentTarget = event.currentTarget;\n const target = currentTarget.getAttribute('target');\n if ((target && target.toLowerCase() !== '_self') || currentTarget.hasAttribute('download')) {\n return;\n }\n\n flushSync(() => {\n setOpenMobile(false);\n });\n cleanupMobileNavigation();\n };\n\n return (\n <>\n <Sidebar data-slot={'app-sidebar'} collapsible={'icon'} variant={'inset'}>\n <SidebarHeader>\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarMenuButton size={'lg'} asChild>\n {LinkComp ? (\n <LinkComp href={homeHref} onClick={handleNavigation}>\n {logo}\n </LinkComp>\n ) : (\n <a href={homeHref} onClick={handleNavigation}>\n {logo}\n </a>\n )}\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n </SidebarHeader>\n <SidebarContent>\n {sections.map(section => (\n <SidebarGroup key={section.label}>\n <SidebarGroupLabel>{section.label}</SidebarGroupLabel>\n <SidebarMenu>\n {section.items.map(item => {\n const isActive = item.href === bestMatch;\n\n if (section.renderItem) {\n return (\n <SidebarMenuItem key={item.title}>\n {section.renderItem(item, { isActive, onNavigate: handleNavigation })}\n </SidebarMenuItem>\n );\n }\n\n return (\n <SidebarMenuItem key={item.title}>\n <SidebarMenuButton\n asChild\n isActive={isActive}\n tooltip={{ children: item.title }}\n >\n <NavLink\n item={item}\n linkComponent={LinkComp}\n onNavigate={handleNavigation}\n />\n </SidebarMenuButton>\n </SidebarMenuItem>\n );\n })}\n </SidebarMenu>\n </SidebarGroup>\n ))}\n </SidebarContent>\n {footerItems?.length ? (\n <>\n {footerSeparator && <Separator />}\n <SidebarFooter>\n <SidebarMenu>\n {footerItems.map(item => (\n <SidebarMenuItem key={item.title}>\n <SidebarMenuButton\n asChild\n isActive={item.href === bestMatch}\n tooltip={{ children: item.title }}\n >\n <NavLink item={item} linkComponent={LinkComp} onNavigate={handleNavigation} />\n </SidebarMenuButton>\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n </SidebarFooter>\n </>\n ) : null}\n </Sidebar>\n {children}\n </>\n );\n}\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;AAoCA,SAAS,OAAO,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,KAAK,EAAgB,EAAA;AAC7F,IAAA,MAAM,WAAW,GAAG,CAAC,KAA0C,KAAI;AACjE,QAAA,OAAO,GAAG,KAAK,CAAC;AAChB,QAAA,IAAI,KAAK,CAAC,gBAAgB,EAAE;YAC1B;QACF;AAEA,QAAA,UAAU,GAAG,KAAK,CAAC;AACrB,IAAA,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAChC,QAAA,QACEA,IAAA,CAAA,GAAA,EAAA,EACE,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,qBAAqB,EAC1B,OAAO,EAAE,WAAW,EAAA,GAChB,KAAK,aAER,IAAI,CAAC,IAAI,EACVC,GAAA,CAAA,MAAA,EAAA,EAAA,Q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AC,OAAO,IACN,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,QAAQ,EACvB,UAAU,EAAE,gBAAgB,GAC5B,EAAA,CACgB,EAAA,EAXA,IAAI,CAAC,KAAK,CAYd;oCAEtB,CAAC,CAAC,GACU,CAAA,EAAA,EA9BG,OAAO,CAAC,KAAK,CA+BjB,CAChB,CAAC,EAAA,CACa,EAChB,WAAW,EAAE,MAAM,IAClBD,IAAA,CAAAE,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,eAAe,IAAID,GAAA,CAAC,SAAS,EAAA,EAAA,CAAG,EACjCA,GAAA,CAAC,aAAa,cACZA,GAAA,CAAC,WAAW,cACT,WAAW,CAAC,GAAG,CAAC,IAAI,KACnBA,GAAA,CAAC,eAAe,EAAA,EAAA,QAAA,EACdA,GAAA,CAAC,iBAAiB,EAAA,EAChB,OAAO,EAAA,IAAA,EACP,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS,EACjC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,EAAA,QAAA,EAEjCA,GAAA,CAAC,OAAO,EAAA,EAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,GAAI,EAAA,CAC5D,EAAA,EAPA,IAAI,CAAC,KAAK,CAQd,CACnB,CAAC,EAAA,CACU,GACA,CAAA,EAAA,CACf,IACD,IAAI,IACA,EACT,QAAQ,CAAA,EAAA,CACR;AAEP;;"}
package/dist/layout.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { A as AppContent, a as AppContentFooter, b as AppContentFooterProps, c as AppContentMain, d as AppContentMainProps, e as AppFooter, f as AppFooterProps, g as AppShell, h as AppShellProps, i as AppSidebar, j as AppSidebarHeader, k as AppSidebarHeaderProps, l as AppSidebarProps, C as Collapse, m as CollapseProps, n as Column, o as ColumnProps, p as Container, G as Grid, R as Row, t as Sidebar, u as SidebarContent, v as SidebarFooter, w as SidebarGroup, x as SidebarGroupAction, y as SidebarGroupContent, z as SidebarGroupLabel, B as SidebarHeader, D as SidebarInput, E as SidebarInset, F as SidebarMenu, H as SidebarMenuAction, I as SidebarMenuBadge, J as SidebarMenuButton, K as SidebarMenuItem, L as SidebarMenuSkeleton, M as SidebarMenuSub, N as SidebarMenuSubButton, O as SidebarMenuSubItem, P as SidebarProvider, Q as SidebarRail, T as SidebarTrigger, V as Skeleton } from './index-BWTwKQsp.js';
1
+ export { A as AppContent, a as AppContentFooter, b as AppContentFooterProps, c as AppContentMain, d as AppContentMainProps, e as AppFooter, f as AppFooterProps, g as AppShell, h as AppShellProps, i as AppSidebar, j as AppSidebarHeader, k as AppSidebarHeaderProps, l as AppSidebarProps, C as Collapse, m as CollapseProps, n as Column, o as ColumnProps, p as Container, G as Grid, R as Row, t as Sidebar, u as SidebarContent, v as SidebarFooter, w as SidebarGroup, x as SidebarGroupAction, y as SidebarGroupContent, z as SidebarGroupLabel, B as SidebarHeader, D as SidebarInput, E as SidebarInset, F as SidebarMenu, H as SidebarMenuAction, I as SidebarMenuBadge, J as SidebarMenuButton, K as SidebarMenuItem, L as SidebarMenuSkeleton, M as SidebarMenuSub, N as SidebarMenuSubButton, O as SidebarMenuSubItem, P as SidebarProvider, Q as SidebarRail, T as SidebarTrigger, V as Skeleton } from './index-BxBAq63A.js';
2
2
  export { R as RowProps } from './row-CuhTBQhK.js';
3
3
  import 'react';
4
- import './nav-user-CJIcWKyY.js';
4
+ import './nav-user-CilmWvtr.js';
5
5
  import 'lucide-react';
6
6
  import './user-menu-content-D0Ldzigm.js';
7
7
  import './input-Cp5LET5i.js';
8
- import './tooltip-BpAJwi3K.js';
8
+ import './tooltip-DxO_DWMO.js';
9
9
  import 'class-variance-authority';
10
10
  import 'class-variance-authority/types';
@@ -0,0 +1,52 @@
1
+ import { LucideIcon } from 'lucide-react';
2
+ import * as React$1 from 'react';
3
+ import { ReactNode } from 'react';
4
+ import { U as UserMenuContentProps, a as User } from './user-menu-content-D0Ldzigm.js';
5
+
6
+ interface BreadcrumbItemData {
7
+ title: string;
8
+ href: string;
9
+ }
10
+ interface NavGroup {
11
+ title: string;
12
+ items: NavItem[];
13
+ }
14
+ interface NavItem {
15
+ title: string;
16
+ href: string;
17
+ icon?: LucideIcon | null;
18
+ isActive?: boolean;
19
+ }
20
+ interface SidebarNavItem {
21
+ title: string;
22
+ href: string;
23
+ icon?: ReactNode;
24
+ [key: string]: unknown;
25
+ }
26
+ interface SidebarSection {
27
+ label: string;
28
+ items: SidebarNavItem[];
29
+ /**
30
+ * Render an item yourself — for a badge, a count, anything the default row
31
+ * has no slot for.
32
+ *
33
+ * ⚠️ Wire `onNavigate` to your link's `onClick`. It is what closes the
34
+ * offcanvas sidebar after a tap on a phone, and a custom renderer that
35
+ * leaves it off silently loses that: the menu stays open over the page it
36
+ * just navigated to. The default row wires it for you, which is exactly why
37
+ * overriding the row is where it goes missing.
38
+ */
39
+ renderItem?: (item: SidebarNavItem, props: {
40
+ isActive: boolean;
41
+ onNavigate: (event: React.MouseEvent<HTMLAnchorElement>) => void;
42
+ }) => ReactNode;
43
+ }
44
+
45
+ interface NavUserProps extends Omit<UserMenuContentProps, 'user'> {
46
+ user: User;
47
+ }
48
+ /** Sidebar footer control: the signed-in user plus their account menu. */
49
+ declare function NavUser({ user, ...menuProps }: NavUserProps): React$1.JSX.Element;
50
+
51
+ export { NavUser as b };
52
+ export type { BreadcrumbItemData as B, NavGroup as N, SidebarNavItem as S, NavItem as a, NavUserProps as c, SidebarSection as d };
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { BreadcrumbItemData } from './index.js';
3
- export { b as NavUser, c as NavUserProps } from './nav-user-CJIcWKyY.js';
3
+ export { b as NavUser, c as NavUserProps } from './nav-user-CilmWvtr.js';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
6
6
  import 'lucide-react';
@@ -62,7 +62,7 @@ declare function DropdownMenuSubContent({ className, ...props }: React.HTMLAttri
62
62
  declare const linkVariants: (props?: ({
63
63
  underline?: boolean | null | undefined;
64
64
  hover?: "default" | "none" | null | undefined;
65
- theme?: "primary" | "secondary" | "destructive" | "success" | "warning" | "info" | "slate" | "inherit" | null | undefined;
65
+ theme?: "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | "inherit" | null | undefined;
66
66
  } & class_variance_authority_types.ClassProp) | undefined) => string;
67
67
 
68
68
  interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'onClick'>, VariantProps<typeof linkVariants> {
@@ -23,8 +23,19 @@ export interface SidebarNavItem {
23
23
  export interface SidebarSection {
24
24
  label: string;
25
25
  items: SidebarNavItem[];
26
+ /**
27
+ * Render an item yourself — for a badge, a count, anything the default row
28
+ * has no slot for.
29
+ *
30
+ * ⚠️ Wire `onNavigate` to your link's `onClick`. It is what closes the
31
+ * offcanvas sidebar after a tap on a phone, and a custom renderer that
32
+ * leaves it off silently loses that: the menu stays open over the page it
33
+ * just navigated to. The default row wires it for you, which is exactly why
34
+ * overriding the row is where it goes missing.
35
+ */
26
36
  renderItem?: (item: SidebarNavItem, props: {
27
37
  isActive: boolean;
38
+ onNavigate: (event: React.MouseEvent<HTMLAnchorElement>) => void;
28
39
  }) => ReactNode;
29
40
  }
30
41
  //# sourceMappingURL=navigation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,EAAE,CAAC;CAClB;AAED,MAAM,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AE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE;QACL,QAAQ,EAAE,OAAO,CAAC;QAClB,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KAClE,KACE,SAAS,CAAC;CAChB"}
package/dist/ui.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { a as Alert, b as AlertBanner, c as AlertBannerProps, d as AlertDescription, f as AlertProps, g as AlertProvider, i as AlertTitle, j as Avatar, k as AvatarFallback, l as AvatarFallbackProps, m as AvatarImage, n as AvatarImageProps, o as AvatarProps, C as Chip, p as ChipProps, q as CodeBlock, r as CodeBlockProps, D as DevIndicator, s as DevIndicatorProps, t as Dialog, u as DialogClose, v as DialogCloseProps, w as DialogContent, x as DialogContentProps, y as DialogDescription, z as DialogFooter, B as DialogHeader, E as DialogOverlay, F as DialogPortal, G as DialogProps, H as DialogTitle, I as DialogTrigger, J as DialogTriggerProps, K as EmptyState, L as EmptyStateProps, M as Icon, N as IconProps, O as List, P as ListItem, Q as ListItemProps, R as ListProps, T as Pagination, V as ProgressBar, W as ProgressBarProps, Y as Separator, Z as SeparatorProps, a0 as StatCard, a1 as StatCardDirection, a2 as StatCardProps, a3 as StatCardSize, a4 as StatCardTheme, a5 as StatCardVariant, a6 as StatusDot, a7 as StatusDotProps, a8 as Step, a9 as StepProgress, aa as StepProgressProps, ab as Switch, ac as SwitchProps, ad as Table, ae as TableActionCell, af as TableActionCellProps, ag as TableActionItem, ah as TableBody, ai as TableBodyProps, aj as TableCard, ak as TableCell, al as TableFooter, am as TableHead, an as TableHeader, ao as TableRow, ap as TableSortableHeader, aq as TableSortableHeaderProps, ar as TableToolbar, as as TableToolbarProps, at as Toggle, au as ToggleGroup, av as ToggleGroupProps, aw as ToggleProps, ax as TrendDirection, ay as persistAlert, az as statusDotVariants } from './index-CWM2ewRz.js';
2
- export { B as Button, a as ButtonProps, T as Tooltip, b as TooltipContent, c as TooltipContentProps, d as TooltipProps, e as TooltipProvider, f as TooltipTrigger, g as TooltipTriggerProps } from './tooltip-BpAJwi3K.js';
1
+ export { a as Alert, b as AlertBanner, c as AlertBannerProps, d as AlertDescription, f as AlertProps, g as AlertProvider, i as AlertTitle, j as Avatar, k as AvatarFallback, l as AvatarFallbackProps, m as AvatarImage, n as AvatarImageProps, o as AvatarProps, C as Chip, p as ChipProps, q as CodeBlock, r as CodeBlockProps, D as DevIndicator, s as DevIndicatorProps, t as Dialog, u as DialogClose, v as DialogCloseProps, w as DialogContent, x as DialogContentProps, y as DialogDescription, z as DialogFooter, B as DialogHeader, E as DialogOverlay, F as DialogPortal, G as DialogProps, H as DialogTitle, I as DialogTrigger, J as DialogTriggerProps, K as EmptyState, L as EmptyStateProps, M as Icon, N as IconProps, O as List, P as ListItem, Q as ListItemProps, R as ListProps, T as Pagination, V as ProgressBar, W as ProgressBarProps, Y as Separator, Z as SeparatorProps, a0 as StatCard, a1 as StatCardDirection, a2 as StatCardProps, a3 as StatCardSize, a4 as StatCardTheme, a5 as StatCardVariant, a6 as StatusDot, a7 as StatusDotProps, a8 as Step, a9 as StepProgress, aa as StepProgressProps, ab as Switch, ac as SwitchProps, ad as Table, ae as TableActionCell, af as TableActionCellProps, ag as TableActionItem, ah as TableBody, ai as TableBodyProps, aj as TableCard, ak as TableCell, al as TableFooter, am as TableHead, an as TableHeader, ao as TableRow, ap as TableSortableHeader, aq as TableSortableHeaderProps, ar as TableToolbar, as as TableToolbarProps, at as Toggle, au as ToggleGroup, av as ToggleGroupProps, aw as ToggleProps, ax as TrendDirection, ay as persistAlert, az as statusDotVariants } from './index-D3J_UMR7.js';
2
+ export { B as Button, a as ButtonProps, T as Tooltip, b as TooltipContent, c as TooltipContentProps, d as TooltipProps, e as TooltipProvider, f as TooltipTrigger, g as TooltipTriggerProps } from './tooltip-DxO_DWMO.js';
3
3
  import 'class-variance-authority';
4
4
  import 'react';
5
5
  import 'class-variance-authority/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kismet-ux/constellation",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -198,7 +198,7 @@
198
198
  "qs": "^6.15.2",
199
199
  "ws": "^8.20.1"
200
200
  },
201
- "description": "Kismet Constellation \u2014 a themeable React component library: design tokens, light/dark, and 60+ router-agnostic components.",
201
+ "description": "Kismet Constellation a themeable React component library: design tokens, light/dark, and 60+ router-agnostic components.",
202
202
  "license": "MIT",
203
203
  "publishConfig": {
204
204
  "access": "public"