@morze/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +455 -0
- package/dist/index.cjs +3331 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +692 -0
- package/dist/index.d.ts +692 -0
- package/dist/index.js +3161 -0
- package/dist/index.js.map +1 -0
- package/dist/morze-ui-tokens.css +1 -0
- package/dist/morze-ui.css +1 -0
- package/package.json +89 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import { Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Checkbox as Checkbox$1, RadioGroup as RadioGroup$1, Switch as Switch$1, Slider as Slider$1, Label as Label$1, Select as Select$1, Tabs as Tabs$1, Accordion as Accordion$1, Progress as Progress$1, Avatar as Avatar$1, Separator as Separator$1, Dialog as Dialog$1, Popover as Popover$1, DropdownMenu as DropdownMenu$1, Tooltip as Tooltip$1 } from 'radix-ui';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Class name joiner. Morze UI ships plain, prefixed CSS rather than utility
|
|
9
|
+
* classes, so there is nothing to merge — clsx is enough.
|
|
10
|
+
*/
|
|
11
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
12
|
+
type Tone = 'primary' | 'accent' | 'danger' | 'warning' | 'info' | 'success';
|
|
13
|
+
|
|
14
|
+
type MorzeTheme = 'dark' | 'light' | 'system';
|
|
15
|
+
type ThemeContextValue = {
|
|
16
|
+
/** What was requested — may be `system`. */
|
|
17
|
+
theme: MorzeTheme;
|
|
18
|
+
/** What is actually painted — never `system`. */
|
|
19
|
+
resolvedTheme: 'dark' | 'light';
|
|
20
|
+
setTheme: (theme: MorzeTheme) => void;
|
|
21
|
+
};
|
|
22
|
+
type MorzeThemeProviderProps = {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
/** Initial theme. Defaults to the Morze dark palette. */
|
|
25
|
+
defaultTheme?: MorzeTheme;
|
|
26
|
+
/** localStorage key; pass `null` to disable persistence. */
|
|
27
|
+
storageKey?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Where `data-mz-theme` is written. `html` themes the whole document (and is
|
|
30
|
+
* what you want when portalled dialogs and menus should follow the theme);
|
|
31
|
+
* `element` scopes the theme to the wrapper this provider renders.
|
|
32
|
+
*/
|
|
33
|
+
target?: 'html' | 'element';
|
|
34
|
+
className?: string;
|
|
35
|
+
};
|
|
36
|
+
declare function MorzeThemeProvider({ children, defaultTheme, storageKey, target, className, }: MorzeThemeProviderProps): React.JSX.Element;
|
|
37
|
+
declare function useMorzeTheme(): ThemeContextValue;
|
|
38
|
+
|
|
39
|
+
declare const buttonVariants: (props?: ({
|
|
40
|
+
variant?: "primary" | "link" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
41
|
+
size?: "xs" | "sm" | "md" | "lg" | "icon-xs" | "icon-sm" | "icon" | "icon-lg" | null | undefined;
|
|
42
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
43
|
+
type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
/** Re-points the convex gradient, glow and focus ring to another tone. */
|
|
46
|
+
tone?: Tone;
|
|
47
|
+
/** Swaps the label for a spinner and blocks interaction. */
|
|
48
|
+
loading?: boolean;
|
|
49
|
+
/** Pulsing morse dot before the label — the landing's signature accent. */
|
|
50
|
+
dot?: boolean;
|
|
51
|
+
};
|
|
52
|
+
declare function Button({ className, variant, size, asChild, tone, loading, dot, disabled, children, ...props }: ButtonProps): React.JSX.Element;
|
|
53
|
+
|
|
54
|
+
declare const badgeVariants: (props?: ({
|
|
55
|
+
variant?: "outline" | "solid" | "soft" | null | undefined;
|
|
56
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
57
|
+
declare function Badge({ className, variant, tone, dot, asChild, children, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
58
|
+
asChild?: boolean;
|
|
59
|
+
tone?: Tone;
|
|
60
|
+
dot?: boolean;
|
|
61
|
+
}): React.JSX.Element;
|
|
62
|
+
|
|
63
|
+
declare const toggleVariants: (props?: ({
|
|
64
|
+
variant?: "outline" | "default" | null | undefined;
|
|
65
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
66
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
67
|
+
declare function Toggle({ className, variant, size, tone, ...props }: React.ComponentProps<typeof Toggle$1.Root> & VariantProps<typeof toggleVariants> & {
|
|
68
|
+
tone?: Tone;
|
|
69
|
+
}): React.JSX.Element;
|
|
70
|
+
|
|
71
|
+
type ToggleGroupProps = React.ComponentProps<typeof ToggleGroup$1.Root> & VariantProps<typeof toggleVariants> & {
|
|
72
|
+
tone?: Tone;
|
|
73
|
+
/**
|
|
74
|
+
* `segmented` — items sit in one sunken well and the active one pops out.
|
|
75
|
+
* `joined` — items share edges as a single convex bar.
|
|
76
|
+
* `spaced` — free-standing toggles with a gap.
|
|
77
|
+
*/
|
|
78
|
+
appearance?: 'segmented' | 'joined' | 'spaced';
|
|
79
|
+
};
|
|
80
|
+
declare function ToggleGroup({ className, variant, size, tone, appearance, style, children, ...props }: ToggleGroupProps): React.JSX.Element;
|
|
81
|
+
declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroup$1.Item> & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
|
82
|
+
|
|
83
|
+
type CheckboxProps = React.ComponentProps<typeof Checkbox$1.Root> & {
|
|
84
|
+
size?: 'sm' | 'md' | 'lg';
|
|
85
|
+
tone?: Tone;
|
|
86
|
+
};
|
|
87
|
+
declare function Checkbox({ className, size, tone, ...props }: CheckboxProps): React.JSX.Element;
|
|
88
|
+
|
|
89
|
+
declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroup$1.Root>): React.JSX.Element;
|
|
90
|
+
declare function RadioGroupItem({ className, tone, ...props }: React.ComponentProps<typeof RadioGroup$1.Item> & {
|
|
91
|
+
tone?: Tone;
|
|
92
|
+
}): React.JSX.Element;
|
|
93
|
+
|
|
94
|
+
type SwitchProps = React.ComponentProps<typeof Switch$1.Root> & {
|
|
95
|
+
size?: 'sm' | 'md' | 'lg';
|
|
96
|
+
tone?: Tone;
|
|
97
|
+
};
|
|
98
|
+
declare function Switch({ className, size, tone, ...props }: SwitchProps): React.JSX.Element;
|
|
99
|
+
|
|
100
|
+
declare function Slider({ className, defaultValue, value, min, max, tone, ...props }: React.ComponentProps<typeof Slider$1.Root> & {
|
|
101
|
+
tone?: Tone;
|
|
102
|
+
}): React.JSX.Element;
|
|
103
|
+
|
|
104
|
+
type InputProps = React.ComponentProps<'input'> & {
|
|
105
|
+
inputSize?: 'sm' | 'md' | 'lg';
|
|
106
|
+
};
|
|
107
|
+
declare function Input({ className, type, inputSize, ...props }: InputProps): React.JSX.Element;
|
|
108
|
+
|
|
109
|
+
declare function Textarea({ className, ...props }: React.ComponentProps<'textarea'>): React.JSX.Element;
|
|
110
|
+
|
|
111
|
+
declare function Label({ className, ...props }: React.ComponentProps<typeof Label$1.Root>): React.JSX.Element;
|
|
112
|
+
|
|
113
|
+
/** Vertical label + control + hint/error stack. */
|
|
114
|
+
declare function Field({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
115
|
+
declare function FieldHint({ className, ...props }: React.ComponentProps<'p'>): React.JSX.Element;
|
|
116
|
+
declare function FieldError({ className, ...props }: React.ComponentProps<'p'>): React.JSX.Element;
|
|
117
|
+
|
|
118
|
+
declare function Select({ ...props }: React.ComponentProps<typeof Select$1.Root>): React.JSX.Element;
|
|
119
|
+
declare function SelectGroup({ ...props }: React.ComponentProps<typeof Select$1.Group>): React.JSX.Element;
|
|
120
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof Select$1.Value>): React.JSX.Element;
|
|
121
|
+
declare function SelectTrigger({ className, size, tone, children, ...props }: React.ComponentProps<typeof Select$1.Trigger> & {
|
|
122
|
+
size?: 'sm' | 'md';
|
|
123
|
+
tone?: Tone;
|
|
124
|
+
}): React.JSX.Element;
|
|
125
|
+
declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof Select$1.Content>): React.JSX.Element;
|
|
126
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof Select$1.Label>): React.JSX.Element;
|
|
127
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof Select$1.Item>): React.JSX.Element;
|
|
128
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof Select$1.Separator>): React.JSX.Element;
|
|
129
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof Select$1.ScrollUpButton>): React.JSX.Element;
|
|
130
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof Select$1.ScrollDownButton>): React.JSX.Element;
|
|
131
|
+
|
|
132
|
+
declare function Tabs({ className, ...props }: React.ComponentProps<typeof Tabs$1.Root>): React.JSX.Element;
|
|
133
|
+
declare function TabsList({ className, variant, tone, ...props }: React.ComponentProps<typeof Tabs$1.List> & {
|
|
134
|
+
variant?: 'default' | 'line';
|
|
135
|
+
tone?: Tone;
|
|
136
|
+
}): React.JSX.Element;
|
|
137
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Trigger>): React.JSX.Element;
|
|
138
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof Tabs$1.Content>): React.JSX.Element;
|
|
139
|
+
|
|
140
|
+
declare function Card({ className, interactive, onClick, onKeyDown, ...props }: React.ComponentProps<'div'> & {
|
|
141
|
+
interactive?: boolean;
|
|
142
|
+
}): React.JSX.Element;
|
|
143
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
144
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
145
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
146
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
147
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
148
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
149
|
+
|
|
150
|
+
declare function Alert({ className, tone, ...props }: React.ComponentProps<'div'> & {
|
|
151
|
+
tone?: Tone;
|
|
152
|
+
}): React.JSX.Element;
|
|
153
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
154
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
155
|
+
|
|
156
|
+
declare function Accordion({ className, ...props }: React.ComponentProps<typeof Accordion$1.Root>): React.JSX.Element;
|
|
157
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof Accordion$1.Item>): React.JSX.Element;
|
|
158
|
+
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof Accordion$1.Trigger>): React.JSX.Element;
|
|
159
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof Accordion$1.Content>): React.JSX.Element;
|
|
160
|
+
|
|
161
|
+
declare function Progress({ className, value, max, tone, ...props }: React.ComponentProps<typeof Progress$1.Root> & {
|
|
162
|
+
tone?: Tone;
|
|
163
|
+
}): React.JSX.Element;
|
|
164
|
+
|
|
165
|
+
declare function Avatar({ className, size, ...props }: React.ComponentProps<typeof Avatar$1.Root> & {
|
|
166
|
+
size?: 'sm' | 'md' | 'lg';
|
|
167
|
+
}): React.JSX.Element;
|
|
168
|
+
declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof Avatar$1.Image>): React.JSX.Element;
|
|
169
|
+
declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof Avatar$1.Fallback>): React.JSX.Element;
|
|
170
|
+
|
|
171
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof Separator$1.Root>): React.JSX.Element;
|
|
172
|
+
|
|
173
|
+
declare function Skeleton({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
174
|
+
|
|
175
|
+
type SpinnerProps = React.ComponentProps<'span'> & {
|
|
176
|
+
/** Announced by screen readers; pass `null` for a purely decorative spinner. */
|
|
177
|
+
label?: string | null;
|
|
178
|
+
};
|
|
179
|
+
declare function Spinner({ className, label, children, ...props }: SpinnerProps): React.JSX.Element;
|
|
180
|
+
|
|
181
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof Dialog$1.Root>): React.JSX.Element;
|
|
182
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof Dialog$1.Trigger>): React.JSX.Element;
|
|
183
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof Dialog$1.Portal>): React.JSX.Element;
|
|
184
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof Dialog$1.Close>): React.JSX.Element;
|
|
185
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof Dialog$1.Overlay>): React.JSX.Element;
|
|
186
|
+
declare function DialogContent({ className, children, showCloseButton, closeLabel, ...props }: React.ComponentProps<typeof Dialog$1.Content> & {
|
|
187
|
+
showCloseButton?: boolean;
|
|
188
|
+
closeLabel?: string;
|
|
189
|
+
}): React.JSX.Element;
|
|
190
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
191
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
192
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof Dialog$1.Title>): React.JSX.Element;
|
|
193
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof Dialog$1.Description>): React.JSX.Element;
|
|
194
|
+
|
|
195
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof Popover$1.Root>): React.JSX.Element;
|
|
196
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof Popover$1.Trigger>): React.JSX.Element;
|
|
197
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof Popover$1.Anchor>): React.JSX.Element;
|
|
198
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof Popover$1.Content>): React.JSX.Element;
|
|
199
|
+
declare function PopoverHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
200
|
+
declare function PopoverTitle({ className, ...props }: React.ComponentProps<'h2'>): React.JSX.Element;
|
|
201
|
+
declare function PopoverDescription({ className, ...props }: React.ComponentProps<'p'>): React.JSX.Element;
|
|
202
|
+
|
|
203
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Root>): React.JSX.Element;
|
|
204
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Portal>): React.JSX.Element;
|
|
205
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Trigger>): React.JSX.Element;
|
|
206
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenu$1.Content>): React.JSX.Element;
|
|
207
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Group>): React.JSX.Element;
|
|
208
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenu$1.Item> & {
|
|
209
|
+
inset?: boolean;
|
|
210
|
+
variant?: 'default' | 'destructive';
|
|
211
|
+
}): React.JSX.Element;
|
|
212
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenu$1.CheckboxItem>): React.JSX.Element;
|
|
213
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenu$1.RadioGroup>): React.JSX.Element;
|
|
214
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenu$1.RadioItem>): React.JSX.Element;
|
|
215
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenu$1.Label> & {
|
|
216
|
+
inset?: boolean;
|
|
217
|
+
}): React.JSX.Element;
|
|
218
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenu$1.Separator>): React.JSX.Element;
|
|
219
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
220
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Sub>): React.JSX.Element;
|
|
221
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenu$1.SubTrigger> & {
|
|
222
|
+
inset?: boolean;
|
|
223
|
+
}): React.JSX.Element;
|
|
224
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenu$1.SubContent>): React.JSX.Element;
|
|
225
|
+
|
|
226
|
+
declare function TooltipProvider({ delayDuration, children, ...props }: React.ComponentProps<typeof Tooltip$1.Provider>): React.JSX.Element;
|
|
227
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof Tooltip$1.Root>): React.JSX.Element;
|
|
228
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof Tooltip$1.Trigger>): React.JSX.Element;
|
|
229
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof Tooltip$1.Content>): React.JSX.Element;
|
|
230
|
+
|
|
231
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof Dialog$1.Root>): React.JSX.Element;
|
|
232
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof Dialog$1.Trigger>): React.JSX.Element;
|
|
233
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof Dialog$1.Close>): React.JSX.Element;
|
|
234
|
+
declare function SheetPortal({ ...props }: React.ComponentProps<typeof Dialog$1.Portal>): React.JSX.Element;
|
|
235
|
+
declare function SheetOverlay({ className, ...props }: React.ComponentProps<typeof Dialog$1.Overlay>): React.JSX.Element;
|
|
236
|
+
declare function SheetContent({ className, children, side, showCloseButton, closeLabel, ...props }: React.ComponentProps<typeof Dialog$1.Content> & {
|
|
237
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
238
|
+
showCloseButton?: boolean;
|
|
239
|
+
closeLabel?: string;
|
|
240
|
+
}): React.JSX.Element;
|
|
241
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
242
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
243
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof Dialog$1.Title>): React.JSX.Element;
|
|
244
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof Dialog$1.Description>): React.JSX.Element;
|
|
245
|
+
|
|
246
|
+
type SidebarContextValue = {
|
|
247
|
+
/** `expanded` | `collapsed` — what is painted, mobile aside. */
|
|
248
|
+
state: 'expanded' | 'collapsed';
|
|
249
|
+
open: boolean;
|
|
250
|
+
setOpen: (open: boolean) => void;
|
|
251
|
+
openMobile: boolean;
|
|
252
|
+
setOpenMobile: (open: boolean) => void;
|
|
253
|
+
isMobile: boolean;
|
|
254
|
+
toggleSidebar: () => void;
|
|
255
|
+
};
|
|
256
|
+
declare function useSidebar(): SidebarContextValue;
|
|
257
|
+
type SidebarProviderProps = React.ComponentProps<'div'> & {
|
|
258
|
+
defaultOpen?: boolean;
|
|
259
|
+
open?: boolean;
|
|
260
|
+
onOpenChange?: (open: boolean) => void;
|
|
261
|
+
/** localStorage key for the collapsed state; `null` disables persistence. */
|
|
262
|
+
storageKey?: string | null;
|
|
263
|
+
/** Width below which the sidebar becomes an overlay sheet. */
|
|
264
|
+
mobileBreakpoint?: number;
|
|
265
|
+
};
|
|
266
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange, storageKey, mobileBreakpoint, className, style, children, ...props }: SidebarProviderProps): React.JSX.Element;
|
|
267
|
+
type SidebarProps = React.ComponentProps<'div'> & {
|
|
268
|
+
side?: 'left' | 'right';
|
|
269
|
+
/** Announced to screen readers when the panel opens as a sheet on mobile. */
|
|
270
|
+
mobileTitle?: string;
|
|
271
|
+
mobileDescription?: string;
|
|
272
|
+
/**
|
|
273
|
+
* `inset` (default) leaves the navigation on the page background and raises
|
|
274
|
+
* the content in a `SidebarPanel`; `sidebar` gives the navigation its own
|
|
275
|
+
* surface; `floating` lifts it off the edge as a card.
|
|
276
|
+
*/
|
|
277
|
+
variant?: 'sidebar' | 'floating' | 'inset';
|
|
278
|
+
/**
|
|
279
|
+
* `icon` keeps a rail of icons, `offcanvas` slides the panel away entirely,
|
|
280
|
+
* `none` pins it open.
|
|
281
|
+
*/
|
|
282
|
+
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
283
|
+
};
|
|
284
|
+
declare function Sidebar({ side, variant, collapsible, mobileTitle, mobileDescription, className, children, ...props }: SidebarProps): React.JSX.Element;
|
|
285
|
+
declare function SidebarTrigger({ className, onClick, label, ...props }: React.ComponentProps<'button'> & {
|
|
286
|
+
label?: string;
|
|
287
|
+
}): React.JSX.Element;
|
|
288
|
+
/** Thin strip along the sidebar edge — click anywhere on it to toggle. */
|
|
289
|
+
declare function SidebarRail({ className, label, ...props }: React.ComponentProps<'button'> & {
|
|
290
|
+
label?: string;
|
|
291
|
+
}): React.JSX.Element;
|
|
292
|
+
declare function SidebarInset({ className, ...props }: React.ComponentProps<'main'>): React.JSX.Element;
|
|
293
|
+
/**
|
|
294
|
+
* The raised content surface next to the navigation. Anything that belongs on
|
|
295
|
+
* the page background — a top bar, breadcrumbs — goes in `SidebarInset` above
|
|
296
|
+
* it, not inside.
|
|
297
|
+
*/
|
|
298
|
+
declare function SidebarPanel({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
299
|
+
declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): React.JSX.Element;
|
|
300
|
+
declare function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
301
|
+
declare function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
302
|
+
declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
303
|
+
declare function SidebarContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
304
|
+
declare function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
305
|
+
declare function SidebarGroupLabel({ className, asChild, ...props }: React.ComponentProps<'div'> & {
|
|
306
|
+
asChild?: boolean;
|
|
307
|
+
}): React.JSX.Element;
|
|
308
|
+
declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<'button'> & {
|
|
309
|
+
asChild?: boolean;
|
|
310
|
+
}): React.JSX.Element;
|
|
311
|
+
declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
312
|
+
declare function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>): React.JSX.Element;
|
|
313
|
+
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
314
|
+
type SidebarMenuButtonProps = React.ComponentProps<'button'> & {
|
|
315
|
+
asChild?: boolean;
|
|
316
|
+
isActive?: boolean;
|
|
317
|
+
size?: 'sm' | 'md' | 'lg';
|
|
318
|
+
/** Shown as a tooltip while the sidebar is collapsed to icons. */
|
|
319
|
+
tooltip?: React.ReactNode;
|
|
320
|
+
};
|
|
321
|
+
declare function SidebarMenuButton({ asChild, isActive, size, tooltip, className, ...props }: SidebarMenuButtonProps): React.JSX.Element;
|
|
322
|
+
declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<'button'> & {
|
|
323
|
+
asChild?: boolean;
|
|
324
|
+
showOnHover?: boolean;
|
|
325
|
+
}): React.JSX.Element;
|
|
326
|
+
declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
327
|
+
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<'div'> & {
|
|
328
|
+
showIcon?: boolean;
|
|
329
|
+
}): React.JSX.Element;
|
|
330
|
+
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>): React.JSX.Element;
|
|
331
|
+
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
332
|
+
declare function SidebarMenuSubButton({ asChild, isActive, size, className, ...props }: React.ComponentProps<'a'> & {
|
|
333
|
+
asChild?: boolean;
|
|
334
|
+
isActive?: boolean;
|
|
335
|
+
size?: 'sm' | 'md';
|
|
336
|
+
}): React.JSX.Element;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Viewport-width check for layout decisions that CSS cannot make on its own —
|
|
340
|
+
* the sidebar swaps to an overlay sheet rather than restyling in place.
|
|
341
|
+
* Returns false during SSR and the first client render, so hydration matches.
|
|
342
|
+
*/
|
|
343
|
+
declare function useIsMobile(breakpoint?: number): boolean;
|
|
344
|
+
|
|
345
|
+
type SortDir = 'asc' | 'desc';
|
|
346
|
+
type DataTableSort = {
|
|
347
|
+
id: string;
|
|
348
|
+
dir: SortDir;
|
|
349
|
+
};
|
|
350
|
+
type FilterValue = {
|
|
351
|
+
type: 'text';
|
|
352
|
+
value: string;
|
|
353
|
+
} | {
|
|
354
|
+
type: 'select';
|
|
355
|
+
value: string[];
|
|
356
|
+
} | {
|
|
357
|
+
type: 'number-range';
|
|
358
|
+
min?: number;
|
|
359
|
+
max?: number;
|
|
360
|
+
} | {
|
|
361
|
+
type: 'date-range';
|
|
362
|
+
from?: string;
|
|
363
|
+
to?: string;
|
|
364
|
+
} | {
|
|
365
|
+
type: 'boolean';
|
|
366
|
+
value: boolean;
|
|
367
|
+
};
|
|
368
|
+
type DataTableFilters = Record<string, FilterValue>;
|
|
369
|
+
type DataTableQuery = {
|
|
370
|
+
sort: DataTableSort[];
|
|
371
|
+
filters: DataTableFilters;
|
|
372
|
+
page: number;
|
|
373
|
+
pageSize: number;
|
|
374
|
+
};
|
|
375
|
+
type SelectOptionDef = {
|
|
376
|
+
value: string;
|
|
377
|
+
label: string;
|
|
378
|
+
};
|
|
379
|
+
/** Declares which control the header popover shows and what it sends back. */
|
|
380
|
+
type ColumnFilterDef = {
|
|
381
|
+
type: 'text';
|
|
382
|
+
placeholder?: string;
|
|
383
|
+
} | {
|
|
384
|
+
type: 'select';
|
|
385
|
+
options: SelectOptionDef[];
|
|
386
|
+
multiple?: boolean;
|
|
387
|
+
} | {
|
|
388
|
+
type: 'number-range';
|
|
389
|
+
step?: number;
|
|
390
|
+
unit?: string;
|
|
391
|
+
} | {
|
|
392
|
+
type: 'date-range';
|
|
393
|
+
} | {
|
|
394
|
+
type: 'boolean';
|
|
395
|
+
trueLabel?: string;
|
|
396
|
+
falseLabel?: string;
|
|
397
|
+
};
|
|
398
|
+
type EditableDef<T> = {
|
|
399
|
+
type: 'text' | 'number' | 'select';
|
|
400
|
+
options?: SelectOptionDef[];
|
|
401
|
+
/** Resolves the current editable value out of the row. */
|
|
402
|
+
value: (row: T) => string;
|
|
403
|
+
/** Rejected promises roll the cell back and surface the message. */
|
|
404
|
+
onSave: (row: T, value: string) => void | Promise<void>;
|
|
405
|
+
};
|
|
406
|
+
type DataTableColumn<T> = {
|
|
407
|
+
id: string;
|
|
408
|
+
header: React.ReactNode;
|
|
409
|
+
/** Short label used where the header may be a node — column manager, cards. */
|
|
410
|
+
label?: string;
|
|
411
|
+
/** Plain value renderer. Ignored when `cell` is given. */
|
|
412
|
+
accessor?: (row: T) => React.ReactNode;
|
|
413
|
+
cell?: (row: T, context: {
|
|
414
|
+
rowIndex: number;
|
|
415
|
+
}) => React.ReactNode;
|
|
416
|
+
width?: number;
|
|
417
|
+
minWidth?: number;
|
|
418
|
+
maxWidth?: number;
|
|
419
|
+
align?: 'left' | 'center' | 'right';
|
|
420
|
+
sortable?: boolean;
|
|
421
|
+
filter?: ColumnFilterDef;
|
|
422
|
+
/** Sticks the column to an edge while the body scrolls sideways. */
|
|
423
|
+
pinned?: 'left' | 'right';
|
|
424
|
+
resizable?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* `false` keeps the column at exactly `width` when the table stretches its
|
|
427
|
+
* columns to fill the container — for icon or action columns.
|
|
428
|
+
*/
|
|
429
|
+
flex?: boolean;
|
|
430
|
+
/** `false` keeps the column out of the visibility menu (and always visible). */
|
|
431
|
+
hideable?: boolean;
|
|
432
|
+
editable?: EditableDef<T>;
|
|
433
|
+
headerTitle?: string;
|
|
434
|
+
};
|
|
435
|
+
/** Column layout is UI state, not query state — it never reaches the backend. */
|
|
436
|
+
type ColumnLayout = {
|
|
437
|
+
order: string[];
|
|
438
|
+
hidden: string[];
|
|
439
|
+
widths: Record<string, number>;
|
|
440
|
+
pinned: Record<string, 'left' | 'right' | undefined>;
|
|
441
|
+
/** Columns the user resized by hand; auto-fit leaves these alone. */
|
|
442
|
+
sized: string[];
|
|
443
|
+
};
|
|
444
|
+
type SavedView = {
|
|
445
|
+
id: string;
|
|
446
|
+
name: string;
|
|
447
|
+
query: DataTableQuery;
|
|
448
|
+
layout?: Partial<ColumnLayout>;
|
|
449
|
+
};
|
|
450
|
+
type RowSelectionState = {
|
|
451
|
+
/** Explicitly ticked row keys on the current page. */
|
|
452
|
+
keys: string[];
|
|
453
|
+
/**
|
|
454
|
+
* "Everything the current filter matches", including rows never fetched.
|
|
455
|
+
* Bulk actions must send the query instead of the key list in this mode.
|
|
456
|
+
*/
|
|
457
|
+
allMatching: boolean;
|
|
458
|
+
};
|
|
459
|
+
declare const emptyQuery: DataTableQuery;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Every visible string the table owns, in one place. Defaults are English;
|
|
463
|
+
* pass a partial `labels` object to translate or reword any of them.
|
|
464
|
+
*/
|
|
465
|
+
type DataTableLabels = {
|
|
466
|
+
filter: string;
|
|
467
|
+
filterFor: (column: string) => string;
|
|
468
|
+
filterActive: string;
|
|
469
|
+
contains: string;
|
|
470
|
+
apply: string;
|
|
471
|
+
reset: string;
|
|
472
|
+
resetAll: string;
|
|
473
|
+
resetFilters: string;
|
|
474
|
+
clearFilter: string;
|
|
475
|
+
rangeFrom: string;
|
|
476
|
+
rangeTo: string;
|
|
477
|
+
dateFrom: string;
|
|
478
|
+
dateTo: string;
|
|
479
|
+
yes: string;
|
|
480
|
+
no: string;
|
|
481
|
+
columns: string;
|
|
482
|
+
moveUp: (column: string) => string;
|
|
483
|
+
moveDown: (column: string) => string;
|
|
484
|
+
pinning: (column: string, side: string) => string;
|
|
485
|
+
pinnedLeft: string;
|
|
486
|
+
pinnedRight: string;
|
|
487
|
+
notPinned: string;
|
|
488
|
+
show: (column: string) => string;
|
|
489
|
+
hide: (column: string) => string;
|
|
490
|
+
sortBy: (column: string) => string;
|
|
491
|
+
columnWidth: (column: string) => string;
|
|
492
|
+
selectPage: string;
|
|
493
|
+
selectRow: string;
|
|
494
|
+
expandRow: string;
|
|
495
|
+
collapseRow: string;
|
|
496
|
+
details: string;
|
|
497
|
+
empty: string;
|
|
498
|
+
retry: string;
|
|
499
|
+
rowsPerPage: string;
|
|
500
|
+
nothingFound: string;
|
|
501
|
+
of: string;
|
|
502
|
+
firstPage: string;
|
|
503
|
+
previousPage: string;
|
|
504
|
+
nextPage: string;
|
|
505
|
+
lastPage: string;
|
|
506
|
+
selectedCount: (count: string) => string;
|
|
507
|
+
allMatchingSuffix: string;
|
|
508
|
+
selectAllMatching: (total: string) => string;
|
|
509
|
+
clearSelection: string;
|
|
510
|
+
bulkActions: string;
|
|
511
|
+
};
|
|
512
|
+
declare const defaultDataTableLabels: DataTableLabels;
|
|
513
|
+
declare function resolveLabels(labels?: Partial<DataTableLabels>): DataTableLabels;
|
|
514
|
+
|
|
515
|
+
type DataTableProps<T> = {
|
|
516
|
+
columns: DataTableColumn<T>[];
|
|
517
|
+
data: T[];
|
|
518
|
+
rowKey: (row: T) => string;
|
|
519
|
+
/** Total matching rows on the server; drives the pager. */
|
|
520
|
+
total?: number;
|
|
521
|
+
loading?: boolean;
|
|
522
|
+
error?: React.ReactNode;
|
|
523
|
+
onRetry?: () => void;
|
|
524
|
+
query: DataTableQuery;
|
|
525
|
+
onQueryChange: (query: DataTableQuery) => void;
|
|
526
|
+
/** Shift-click extends the range; `allMatching` covers unfetched rows. */
|
|
527
|
+
selection?: RowSelectionState;
|
|
528
|
+
onSelectionChange?: (selection: RowSelectionState) => void;
|
|
529
|
+
bulkActions?: (selection: RowSelectionState) => React.ReactNode;
|
|
530
|
+
renderExpanded?: (row: T) => React.ReactNode;
|
|
531
|
+
onRowClick?: (row: T) => void;
|
|
532
|
+
layout?: Partial<ColumnLayout>;
|
|
533
|
+
onLayoutChange?: (layout: ColumnLayout) => void;
|
|
534
|
+
/** localStorage key for widths, order, visibility and pinning. */
|
|
535
|
+
persistKey?: string | null;
|
|
536
|
+
toolbar?: React.ReactNode;
|
|
537
|
+
/**
|
|
538
|
+
* Stretches the columns to fill the container on mount and on container
|
|
539
|
+
* resize, so there is no dead space at the right edge. Columns the user
|
|
540
|
+
* resized by hand keep their width. `false` uses the declared widths as-is.
|
|
541
|
+
*/
|
|
542
|
+
autoFit?: boolean;
|
|
543
|
+
density?: 'compact' | 'normal' | 'relaxed';
|
|
544
|
+
stickyHeader?: boolean;
|
|
545
|
+
emptyState?: React.ReactNode;
|
|
546
|
+
pageSizeOptions?: number[];
|
|
547
|
+
/** Overrides for any of the table's own strings. Defaults are English. */
|
|
548
|
+
labels?: Partial<DataTableLabels>;
|
|
549
|
+
/** Locale for number formatting; defaults to the browser's. */
|
|
550
|
+
locale?: string;
|
|
551
|
+
caption?: string;
|
|
552
|
+
className?: string;
|
|
553
|
+
};
|
|
554
|
+
declare function DataTable<T>({ columns, data, rowKey, total, loading, error, onRetry, query, onQueryChange, selection, onSelectionChange, bulkActions, renderExpanded, onRowClick, layout: controlledLayout, onLayoutChange, persistKey, toolbar, autoFit, density, stickyHeader, emptyState, pageSizeOptions, labels: labelsProp, locale, caption, className, }: DataTableProps<T>): React.JSX.Element;
|
|
555
|
+
|
|
556
|
+
declare function DataTablePagination({ query, total, rowsOnPage, pageSizeOptions, labels: labelsProp, locale, onQueryChange, }: {
|
|
557
|
+
query: DataTableQuery;
|
|
558
|
+
total?: number;
|
|
559
|
+
rowsOnPage: number;
|
|
560
|
+
pageSizeOptions?: number[];
|
|
561
|
+
labels?: Partial<DataTableLabels>;
|
|
562
|
+
/** Number formatting locale; defaults to the browser's. */
|
|
563
|
+
locale?: string;
|
|
564
|
+
onQueryChange: (query: DataTableQuery) => void;
|
|
565
|
+
}): React.JSX.Element;
|
|
566
|
+
|
|
567
|
+
type Props$1<T> = {
|
|
568
|
+
columns: DataTableColumn<T>[];
|
|
569
|
+
layout: ColumnLayout;
|
|
570
|
+
onToggleHidden: (id: string) => void;
|
|
571
|
+
onSetPinned: (id: string, side: 'left' | 'right' | undefined) => void;
|
|
572
|
+
onMove: (id: string, delta: number) => void;
|
|
573
|
+
onMoveTo: (id: string, targetId: string) => void;
|
|
574
|
+
onReset: () => void;
|
|
575
|
+
labels?: Partial<DataTableLabels>;
|
|
576
|
+
};
|
|
577
|
+
/**
|
|
578
|
+
* Reordering lives here rather than on the header itself: dragging a header
|
|
579
|
+
* would fight the resize handle, and a list gives keyboard users real controls
|
|
580
|
+
* instead of a drag-only affordance.
|
|
581
|
+
*/
|
|
582
|
+
declare function ColumnManager<T>({ columns, layout, onToggleHidden, onSetPinned, onMove, onMoveTo, onReset, labels: labelsProp, }: Props$1<T>): React.JSX.Element;
|
|
583
|
+
|
|
584
|
+
type Props = {
|
|
585
|
+
columnLabel: string;
|
|
586
|
+
def: ColumnFilterDef;
|
|
587
|
+
value: FilterValue | undefined;
|
|
588
|
+
onApply: (value: FilterValue | undefined) => void;
|
|
589
|
+
labels?: Partial<DataTableLabels>;
|
|
590
|
+
};
|
|
591
|
+
/**
|
|
592
|
+
* Filters are staged locally and committed on Apply. On server-driven data an
|
|
593
|
+
* immediate commit would fire a request per keystroke.
|
|
594
|
+
*/
|
|
595
|
+
declare function ColumnFilter({ columnLabel, def, value, onApply, labels: labelsProp }: Props): React.JSX.Element;
|
|
596
|
+
declare function FilterChip({ label, onClear, clearLabel, className, }: {
|
|
597
|
+
label: React.ReactNode;
|
|
598
|
+
onClear: () => void;
|
|
599
|
+
clearLabel?: string;
|
|
600
|
+
className?: string;
|
|
601
|
+
}): React.JSX.Element;
|
|
602
|
+
|
|
603
|
+
type UseTableQueryOptions = {
|
|
604
|
+
initial?: Partial<DataTableQuery>;
|
|
605
|
+
/** Mirrors the query into the query-string under this prefix. */
|
|
606
|
+
urlKey?: string | null;
|
|
607
|
+
/** `replace` keeps table interactions out of the back-button history. */
|
|
608
|
+
history?: 'replace' | 'push';
|
|
609
|
+
};
|
|
610
|
+
declare function useTableQuery({ initial, urlKey, history, }?: UseTableQueryOptions): {
|
|
611
|
+
query: DataTableQuery;
|
|
612
|
+
setQuery: React.Dispatch<React.SetStateAction<DataTableQuery>>;
|
|
613
|
+
reset: () => void;
|
|
614
|
+
};
|
|
615
|
+
type UseSavedViewsOptions = {
|
|
616
|
+
storageKey?: string | null;
|
|
617
|
+
views?: SavedView[];
|
|
618
|
+
onViewsChange?: (views: SavedView[]) => void;
|
|
619
|
+
};
|
|
620
|
+
declare function useSavedViews({ storageKey, views: controlled, onViewsChange, }?: UseSavedViewsOptions): {
|
|
621
|
+
views: SavedView[];
|
|
622
|
+
save: (view: SavedView) => void;
|
|
623
|
+
remove: (id: string) => void;
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
type UseColumnLayoutOptions<T> = {
|
|
627
|
+
columns: DataTableColumn<T>[];
|
|
628
|
+
/** localStorage key for widths, order, visibility and pinning. */
|
|
629
|
+
persistKey?: string | null;
|
|
630
|
+
layout?: Partial<ColumnLayout>;
|
|
631
|
+
onLayoutChange?: (layout: ColumnLayout) => void;
|
|
632
|
+
};
|
|
633
|
+
declare function useColumnLayout<T>({ columns, persistKey, layout: controlled, onLayoutChange, }: UseColumnLayoutOptions<T>): {
|
|
634
|
+
layout: ColumnLayout;
|
|
635
|
+
visible: DataTableColumn<T>[];
|
|
636
|
+
widthOf: (id: string) => number;
|
|
637
|
+
minWidthOf: (id: string) => number;
|
|
638
|
+
setWidth: (id: string, width: number) => void;
|
|
639
|
+
fitTo: (available: number) => void;
|
|
640
|
+
toggleHidden: (id: string) => void;
|
|
641
|
+
setPinned: (id: string, side: "left" | "right" | undefined) => void;
|
|
642
|
+
move: (id: string, delta: number) => void;
|
|
643
|
+
moveTo: (id: string, targetId: string) => void;
|
|
644
|
+
reset: () => void;
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Selection is controlled from the outside so bulk actions can live anywhere,
|
|
649
|
+
* but the shift-range anchor is local UI state.
|
|
650
|
+
*/
|
|
651
|
+
declare function useRowSelection(options: {
|
|
652
|
+
value: RowSelectionState;
|
|
653
|
+
onChange: (next: RowSelectionState) => void;
|
|
654
|
+
pageKeys: string[];
|
|
655
|
+
}): {
|
|
656
|
+
selected: Set<string>;
|
|
657
|
+
count: number | undefined;
|
|
658
|
+
allMatching: boolean;
|
|
659
|
+
pageSelected: boolean;
|
|
660
|
+
pagePartial: boolean;
|
|
661
|
+
toggle: (key: string, event?: {
|
|
662
|
+
shiftKey?: boolean;
|
|
663
|
+
}) => void;
|
|
664
|
+
togglePage: () => void;
|
|
665
|
+
/** Escalates from "this page" to "everything the filter matches". */
|
|
666
|
+
selectAllMatching: () => void;
|
|
667
|
+
clear: () => void;
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
/** A filter that carries no constraint should never reach the backend. */
|
|
671
|
+
declare function isFilterActive(value: FilterValue | undefined): value is FilterValue;
|
|
672
|
+
declare function activeFilters(filters: DataTableFilters): [string, FilterValue][];
|
|
673
|
+
declare function setFilter(query: DataTableQuery, id: string, value: FilterValue | undefined): DataTableQuery;
|
|
674
|
+
/**
|
|
675
|
+
* Click cycles asc → desc → off. With `additive` (shift-click) the column joins
|
|
676
|
+
* the existing sort instead of replacing it, which is how multi-sort is
|
|
677
|
+
* expressed to the backend as an ordered list.
|
|
678
|
+
*/
|
|
679
|
+
declare function toggleSort(query: DataTableQuery, id: string, additive?: boolean): DataTableQuery;
|
|
680
|
+
declare function sortStateOf(query: DataTableQuery, id: string): {
|
|
681
|
+
dir: undefined;
|
|
682
|
+
index: undefined;
|
|
683
|
+
} | {
|
|
684
|
+
dir: SortDir;
|
|
685
|
+
index: number | undefined;
|
|
686
|
+
};
|
|
687
|
+
declare function pageCount(total: number | undefined, pageSize: number): number;
|
|
688
|
+
/** Compact URL form: `-date,name` → [{date desc}, {name asc}]. */
|
|
689
|
+
declare function serializeSort(sort: DataTableSort[]): string;
|
|
690
|
+
declare function parseSort(raw: string | null): DataTableSort[];
|
|
691
|
+
|
|
692
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Button, type ButtonProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, ColumnFilter, type ColumnFilterDef, type ColumnLayout, ColumnManager, DataTable, type DataTableColumn, type DataTableFilters, type DataTableLabels, DataTablePagination, type DataTableProps, type DataTableQuery, type DataTableSort, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type EditableDef, Field, FieldError, FieldHint, FilterChip, type FilterValue, Input, type InputProps, Label, type MorzeTheme, MorzeThemeProvider, type MorzeThemeProviderProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, type RowSelectionState, type SavedView, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOptionDef, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarPanel, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, type SortDir, Spinner, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toggle, ToggleGroup, ToggleGroupItem, type Tone, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseSavedViewsOptions, type UseTableQueryOptions, activeFilters, badgeVariants, buttonVariants, cn, defaultDataTableLabels, emptyQuery, isFilterActive, pageCount, parseSort, resolveLabels, serializeSort, setFilter, sortStateOf, toggleSort, toggleVariants, useColumnLayout, useIsMobile, useMorzeTheme, useRowSelection, useSavedViews, useSidebar, useTableQuery };
|