@still-void/ui 3.2.0 → 3.3.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/CHANGELOG.md +71 -0
- package/README.md +5 -2
- package/dist/react/client/index.cjs +522 -77
- package/dist/react/client/index.cjs.map +1 -1
- package/dist/react/client/index.d.cts +145 -2
- package/dist/react/client/index.d.ts +145 -2
- package/dist/react/client/index.js +521 -77
- package/dist/react/client/index.js.map +1 -1
- package/dist/react/index.cjs +35 -8
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +7 -1
- package/dist/react/index.d.ts +7 -1
- package/dist/react/index.js +44 -17
- package/dist/react/index.js.map +1 -1
- package/dist/style.css +344 -1
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { ReactNode, ComponentPropsWithoutRef, RefObject } from 'react';
|
|
3
3
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
4
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
5
5
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
@@ -129,6 +129,124 @@ declare function useScrollSpy(ids: readonly string[], rootMargin?: string): stri
|
|
|
129
129
|
* passes 0.1 for a coarse 10%-step live value.
|
|
130
130
|
*/
|
|
131
131
|
declare function useReadingProgress(target?: HTMLElement | null, step?: number): number;
|
|
132
|
+
/**
|
|
133
|
+
* Check if a media query matches, with safe SSR hydration.
|
|
134
|
+
*
|
|
135
|
+
* Uses `useSyncExternalStore` to provide a server snapshot (desktop/false) that
|
|
136
|
+
* matches during hydration without warnings. After hydration, reflects the true
|
|
137
|
+
* client-side media query state.
|
|
138
|
+
*
|
|
139
|
+
* @param query - Media query string, e.g. `'(min-width: 1024px)'`
|
|
140
|
+
* @returns boolean indicating if the media query matches
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* const isMobile = !useMediaQuery('(min-width: 1024px)');
|
|
144
|
+
*/
|
|
145
|
+
declare function useMediaQuery(query: string): boolean;
|
|
146
|
+
|
|
147
|
+
type ToastVariant = 'info' | 'success' | 'warning' | 'danger';
|
|
148
|
+
interface ToastAction {
|
|
149
|
+
label: React.ReactNode;
|
|
150
|
+
/** Required by the primitive: the screen-reader alternative to reaching the
|
|
151
|
+
* button before auto-dismiss (e.g. "Undo (Alt+U)"). */
|
|
152
|
+
altText: string;
|
|
153
|
+
onClick: () => void;
|
|
154
|
+
}
|
|
155
|
+
interface ToastOptions {
|
|
156
|
+
title?: React.ReactNode;
|
|
157
|
+
description?: React.ReactNode;
|
|
158
|
+
variant?: ToastVariant;
|
|
159
|
+
duration?: number;
|
|
160
|
+
action?: ToastAction;
|
|
161
|
+
}
|
|
162
|
+
interface ToastEntry extends ToastOptions {
|
|
163
|
+
id: string;
|
|
164
|
+
/** Incremented on update to force Toast.Root remount and timer restart */
|
|
165
|
+
version: number;
|
|
166
|
+
}
|
|
167
|
+
interface ToastHandle {
|
|
168
|
+
id: string;
|
|
169
|
+
dismiss: () => void;
|
|
170
|
+
update: (patch: Partial<ToastOptions>) => void;
|
|
171
|
+
}
|
|
172
|
+
interface ToastContextValue {
|
|
173
|
+
toast: (options: ToastOptions) => ToastHandle;
|
|
174
|
+
dismiss: (id: string) => void;
|
|
175
|
+
dismissAll: () => void;
|
|
176
|
+
toasts: readonly ToastEntry[];
|
|
177
|
+
}
|
|
178
|
+
declare function useToast(): ToastContextValue;
|
|
179
|
+
interface ToastProviderProps {
|
|
180
|
+
children: React.ReactNode;
|
|
181
|
+
duration?: number;
|
|
182
|
+
max?: number;
|
|
183
|
+
label?: string;
|
|
184
|
+
closeLabel?: string;
|
|
185
|
+
swipeDirection?: 'up' | 'down' | 'left' | 'right';
|
|
186
|
+
}
|
|
187
|
+
declare function ToastProvider({ children, duration, max, label, closeLabel, swipeDirection, }: ToastProviderProps): React.JSX.Element;
|
|
188
|
+
|
|
189
|
+
type SidebarCollapsible = 'offcanvas' | 'icon' | 'none';
|
|
190
|
+
interface SidebarContextValue {
|
|
191
|
+
open: boolean;
|
|
192
|
+
setOpen: (open: boolean) => void;
|
|
193
|
+
toggle: () => void;
|
|
194
|
+
isMobile: boolean;
|
|
195
|
+
collapsible: SidebarCollapsible;
|
|
196
|
+
panelId: string;
|
|
197
|
+
/**
|
|
198
|
+
* R5-02 AC-5: SidebarTrigger is a plain button, not Radix's own
|
|
199
|
+
* `Dialog.Trigger` (structurally it can't be — Dialog.Root only exists
|
|
200
|
+
* inside SidebarPanel's conditional drawer render, and SidebarTrigger is
|
|
201
|
+
* that component's sibling, not its child) — so Radix's built-in
|
|
202
|
+
* "restore focus to the trigger that opened the dialog" behavior has no
|
|
203
|
+
* trigger ref to restore to. SidebarPanel's Dialog.Content reads this ref
|
|
204
|
+
* directly in its own `onCloseAutoFocus` to do that restoration itself.
|
|
205
|
+
*/
|
|
206
|
+
triggerRef: RefObject<HTMLButtonElement | null>;
|
|
207
|
+
}
|
|
208
|
+
interface SidebarProviderProps {
|
|
209
|
+
children: ReactNode;
|
|
210
|
+
defaultOpen?: boolean;
|
|
211
|
+
open?: boolean;
|
|
212
|
+
onOpenChange?: (open: boolean) => void;
|
|
213
|
+
collapsible?: SidebarCollapsible;
|
|
214
|
+
breakpoint?: number;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Wrapper component that provides sidebar state to the tree.
|
|
218
|
+
* Renders as <div class="sv-app-shell" data-state data-collapsible data-mobile>
|
|
219
|
+
*/
|
|
220
|
+
declare function SidebarProvider({ children, defaultOpen, open: controlledOpen, onOpenChange, collapsible: collapsibleProp, breakpoint: breakpointProp, }: SidebarProviderProps): React.JSX.Element;
|
|
221
|
+
/**
|
|
222
|
+
* Hook to access sidebar state.
|
|
223
|
+
* Throws if called outside SidebarProvider.
|
|
224
|
+
*/
|
|
225
|
+
declare function useSidebar(): SidebarContextValue;
|
|
226
|
+
/**
|
|
227
|
+
* R5-02: Sidebar panel that is static in-flow above breakpoint,
|
|
228
|
+
* drawer in portal below breakpoint.
|
|
229
|
+
*/
|
|
230
|
+
interface SidebarPanelProps extends ComponentPropsWithoutRef<'aside'> {
|
|
231
|
+
title?: string;
|
|
232
|
+
}
|
|
233
|
+
declare const SidebarPanel: React.ForwardRefExoticComponent<SidebarPanelProps & React.RefAttributes<HTMLElement>>;
|
|
234
|
+
/**
|
|
235
|
+
* R5-02: Trigger button to open/close sidebar.
|
|
236
|
+
* Renders as menu icon by default, or custom children.
|
|
237
|
+
* aria-expanded and aria-controls are derived and override props.
|
|
238
|
+
*/
|
|
239
|
+
interface SidebarTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
240
|
+
label?: string;
|
|
241
|
+
}
|
|
242
|
+
declare const SidebarTrigger: React.ForwardRefExoticComponent<SidebarTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
243
|
+
/**
|
|
244
|
+
* R5-04: Inset container that adjusts to sidebar state via CSS.
|
|
245
|
+
* Does not read context — state is read by CSS selectors on the wrapper.
|
|
246
|
+
*/
|
|
247
|
+
interface SidebarInsetProps extends ComponentPropsWithoutRef<'main'> {
|
|
248
|
+
}
|
|
249
|
+
declare const SidebarInset: React.ForwardRefExoticComponent<SidebarInsetProps & React.RefAttributes<HTMLElement>>;
|
|
132
250
|
|
|
133
251
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
134
252
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -298,6 +416,31 @@ interface ScrollSpy {
|
|
|
298
416
|
*/
|
|
299
417
|
declare function createScrollSpy(ids: readonly string[], options: ScrollSpyOptions): ScrollSpy;
|
|
300
418
|
|
|
419
|
+
/**
|
|
420
|
+
* Source external state (media query match) for React's useSyncExternalStore.
|
|
421
|
+
* Framework-agnostic core used by useMediaQuery.
|
|
422
|
+
*/
|
|
423
|
+
interface MediaQueryController {
|
|
424
|
+
/** Get current media query match state. */
|
|
425
|
+
getSnapshot(): boolean;
|
|
426
|
+
/** Subscribe to changes. Returns unsubscribe function. */
|
|
427
|
+
subscribe(listener: () => void): () => void;
|
|
428
|
+
/** Cleanup: remove all listeners. */
|
|
429
|
+
destroy(): void;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Create a media query controller that notifies listeners on transitions.
|
|
433
|
+
* If matchMedia is unavailable, returns an inert controller (always false, subscribe is no-op).
|
|
434
|
+
*
|
|
435
|
+
* @example
|
|
436
|
+
* const mq = createMediaQuery('(min-width: 1024px)');
|
|
437
|
+
* const unsubscribe = mq.subscribe(() => console.log('changed'));
|
|
438
|
+
* console.log(mq.getSnapshot()); // boolean
|
|
439
|
+
* unsubscribe();
|
|
440
|
+
* mq.destroy();
|
|
441
|
+
*/
|
|
442
|
+
declare function createMediaQuery(query: string): MediaQueryController;
|
|
443
|
+
|
|
301
444
|
interface ReadingProgressOptions {
|
|
302
445
|
/** Element whose scroll extent defines 100%. Defaults to the document. */
|
|
303
446
|
target?: HTMLElement;
|
|
@@ -319,4 +462,4 @@ declare function createReadingProgress(options?: ReadingProgressOptions): Readin
|
|
|
319
462
|
/** Copy text to the clipboard. Returns false when the Clipboard API is unavailable or denied. */
|
|
320
463
|
declare function copyToClipboard(text: string): Promise<boolean>;
|
|
321
464
|
|
|
322
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, CopyButton, type CopyButtonProps, DEFAULT_STORAGE_KEY, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, ReadingProgress$1 as ReadingProgress, type ReadingProgress as ReadingProgressController, type ReadingProgressOptions, type ReadingProgressProps, type ScrollSpy, type ScrollSpyOptions, Select, SelectContent, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, TableOfContents, type TableOfContentsProps, Tabs, TabsContent, TabsList, TabsTrigger, type ThemeContextValue, type ThemeManager, type ThemeManagerOptions, ThemeProvider, type ThemeProviderProps, type ThemeState, ThemeToggle, type ThemeToggleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, copyToClipboard, createReadingProgress, createScrollSpy, createThemeManager, useReadingProgress, useScrollSpy, useTheme };
|
|
465
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, CopyButton, type CopyButtonProps, DEFAULT_STORAGE_KEY, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type MediaQueryController, ReadingProgress$1 as ReadingProgress, type ReadingProgress as ReadingProgressController, type ReadingProgressOptions, type ReadingProgressProps, type ScrollSpy, type ScrollSpyOptions, Select, SelectContent, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, type SidebarCollapsible, type SidebarContextValue, SidebarInset, type SidebarInsetProps, SidebarPanel, type SidebarPanelProps, SidebarProvider, type SidebarProviderProps, SidebarTrigger, type SidebarTriggerProps, TableOfContents, type TableOfContentsProps, Tabs, TabsContent, TabsList, TabsTrigger, type ThemeContextValue, type ThemeManager, type ThemeManagerOptions, ThemeProvider, type ThemeProviderProps, type ThemeState, ThemeToggle, type ThemeToggleProps, type ToastAction, type ToastEntry, type ToastHandle, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, copyToClipboard, createMediaQuery, createReadingProgress, createScrollSpy, createThemeManager, useMediaQuery, useReadingProgress, useScrollSpy, useSidebar, useTheme, useToast };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { ReactNode, ComponentPropsWithoutRef, RefObject } from 'react';
|
|
3
3
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
4
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
5
5
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
@@ -129,6 +129,124 @@ declare function useScrollSpy(ids: readonly string[], rootMargin?: string): stri
|
|
|
129
129
|
* passes 0.1 for a coarse 10%-step live value.
|
|
130
130
|
*/
|
|
131
131
|
declare function useReadingProgress(target?: HTMLElement | null, step?: number): number;
|
|
132
|
+
/**
|
|
133
|
+
* Check if a media query matches, with safe SSR hydration.
|
|
134
|
+
*
|
|
135
|
+
* Uses `useSyncExternalStore` to provide a server snapshot (desktop/false) that
|
|
136
|
+
* matches during hydration without warnings. After hydration, reflects the true
|
|
137
|
+
* client-side media query state.
|
|
138
|
+
*
|
|
139
|
+
* @param query - Media query string, e.g. `'(min-width: 1024px)'`
|
|
140
|
+
* @returns boolean indicating if the media query matches
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* const isMobile = !useMediaQuery('(min-width: 1024px)');
|
|
144
|
+
*/
|
|
145
|
+
declare function useMediaQuery(query: string): boolean;
|
|
146
|
+
|
|
147
|
+
type ToastVariant = 'info' | 'success' | 'warning' | 'danger';
|
|
148
|
+
interface ToastAction {
|
|
149
|
+
label: React.ReactNode;
|
|
150
|
+
/** Required by the primitive: the screen-reader alternative to reaching the
|
|
151
|
+
* button before auto-dismiss (e.g. "Undo (Alt+U)"). */
|
|
152
|
+
altText: string;
|
|
153
|
+
onClick: () => void;
|
|
154
|
+
}
|
|
155
|
+
interface ToastOptions {
|
|
156
|
+
title?: React.ReactNode;
|
|
157
|
+
description?: React.ReactNode;
|
|
158
|
+
variant?: ToastVariant;
|
|
159
|
+
duration?: number;
|
|
160
|
+
action?: ToastAction;
|
|
161
|
+
}
|
|
162
|
+
interface ToastEntry extends ToastOptions {
|
|
163
|
+
id: string;
|
|
164
|
+
/** Incremented on update to force Toast.Root remount and timer restart */
|
|
165
|
+
version: number;
|
|
166
|
+
}
|
|
167
|
+
interface ToastHandle {
|
|
168
|
+
id: string;
|
|
169
|
+
dismiss: () => void;
|
|
170
|
+
update: (patch: Partial<ToastOptions>) => void;
|
|
171
|
+
}
|
|
172
|
+
interface ToastContextValue {
|
|
173
|
+
toast: (options: ToastOptions) => ToastHandle;
|
|
174
|
+
dismiss: (id: string) => void;
|
|
175
|
+
dismissAll: () => void;
|
|
176
|
+
toasts: readonly ToastEntry[];
|
|
177
|
+
}
|
|
178
|
+
declare function useToast(): ToastContextValue;
|
|
179
|
+
interface ToastProviderProps {
|
|
180
|
+
children: React.ReactNode;
|
|
181
|
+
duration?: number;
|
|
182
|
+
max?: number;
|
|
183
|
+
label?: string;
|
|
184
|
+
closeLabel?: string;
|
|
185
|
+
swipeDirection?: 'up' | 'down' | 'left' | 'right';
|
|
186
|
+
}
|
|
187
|
+
declare function ToastProvider({ children, duration, max, label, closeLabel, swipeDirection, }: ToastProviderProps): React.JSX.Element;
|
|
188
|
+
|
|
189
|
+
type SidebarCollapsible = 'offcanvas' | 'icon' | 'none';
|
|
190
|
+
interface SidebarContextValue {
|
|
191
|
+
open: boolean;
|
|
192
|
+
setOpen: (open: boolean) => void;
|
|
193
|
+
toggle: () => void;
|
|
194
|
+
isMobile: boolean;
|
|
195
|
+
collapsible: SidebarCollapsible;
|
|
196
|
+
panelId: string;
|
|
197
|
+
/**
|
|
198
|
+
* R5-02 AC-5: SidebarTrigger is a plain button, not Radix's own
|
|
199
|
+
* `Dialog.Trigger` (structurally it can't be — Dialog.Root only exists
|
|
200
|
+
* inside SidebarPanel's conditional drawer render, and SidebarTrigger is
|
|
201
|
+
* that component's sibling, not its child) — so Radix's built-in
|
|
202
|
+
* "restore focus to the trigger that opened the dialog" behavior has no
|
|
203
|
+
* trigger ref to restore to. SidebarPanel's Dialog.Content reads this ref
|
|
204
|
+
* directly in its own `onCloseAutoFocus` to do that restoration itself.
|
|
205
|
+
*/
|
|
206
|
+
triggerRef: RefObject<HTMLButtonElement | null>;
|
|
207
|
+
}
|
|
208
|
+
interface SidebarProviderProps {
|
|
209
|
+
children: ReactNode;
|
|
210
|
+
defaultOpen?: boolean;
|
|
211
|
+
open?: boolean;
|
|
212
|
+
onOpenChange?: (open: boolean) => void;
|
|
213
|
+
collapsible?: SidebarCollapsible;
|
|
214
|
+
breakpoint?: number;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Wrapper component that provides sidebar state to the tree.
|
|
218
|
+
* Renders as <div class="sv-app-shell" data-state data-collapsible data-mobile>
|
|
219
|
+
*/
|
|
220
|
+
declare function SidebarProvider({ children, defaultOpen, open: controlledOpen, onOpenChange, collapsible: collapsibleProp, breakpoint: breakpointProp, }: SidebarProviderProps): React.JSX.Element;
|
|
221
|
+
/**
|
|
222
|
+
* Hook to access sidebar state.
|
|
223
|
+
* Throws if called outside SidebarProvider.
|
|
224
|
+
*/
|
|
225
|
+
declare function useSidebar(): SidebarContextValue;
|
|
226
|
+
/**
|
|
227
|
+
* R5-02: Sidebar panel that is static in-flow above breakpoint,
|
|
228
|
+
* drawer in portal below breakpoint.
|
|
229
|
+
*/
|
|
230
|
+
interface SidebarPanelProps extends ComponentPropsWithoutRef<'aside'> {
|
|
231
|
+
title?: string;
|
|
232
|
+
}
|
|
233
|
+
declare const SidebarPanel: React.ForwardRefExoticComponent<SidebarPanelProps & React.RefAttributes<HTMLElement>>;
|
|
234
|
+
/**
|
|
235
|
+
* R5-02: Trigger button to open/close sidebar.
|
|
236
|
+
* Renders as menu icon by default, or custom children.
|
|
237
|
+
* aria-expanded and aria-controls are derived and override props.
|
|
238
|
+
*/
|
|
239
|
+
interface SidebarTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
240
|
+
label?: string;
|
|
241
|
+
}
|
|
242
|
+
declare const SidebarTrigger: React.ForwardRefExoticComponent<SidebarTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
243
|
+
/**
|
|
244
|
+
* R5-04: Inset container that adjusts to sidebar state via CSS.
|
|
245
|
+
* Does not read context — state is read by CSS selectors on the wrapper.
|
|
246
|
+
*/
|
|
247
|
+
interface SidebarInsetProps extends ComponentPropsWithoutRef<'main'> {
|
|
248
|
+
}
|
|
249
|
+
declare const SidebarInset: React.ForwardRefExoticComponent<SidebarInsetProps & React.RefAttributes<HTMLElement>>;
|
|
132
250
|
|
|
133
251
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
134
252
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -298,6 +416,31 @@ interface ScrollSpy {
|
|
|
298
416
|
*/
|
|
299
417
|
declare function createScrollSpy(ids: readonly string[], options: ScrollSpyOptions): ScrollSpy;
|
|
300
418
|
|
|
419
|
+
/**
|
|
420
|
+
* Source external state (media query match) for React's useSyncExternalStore.
|
|
421
|
+
* Framework-agnostic core used by useMediaQuery.
|
|
422
|
+
*/
|
|
423
|
+
interface MediaQueryController {
|
|
424
|
+
/** Get current media query match state. */
|
|
425
|
+
getSnapshot(): boolean;
|
|
426
|
+
/** Subscribe to changes. Returns unsubscribe function. */
|
|
427
|
+
subscribe(listener: () => void): () => void;
|
|
428
|
+
/** Cleanup: remove all listeners. */
|
|
429
|
+
destroy(): void;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Create a media query controller that notifies listeners on transitions.
|
|
433
|
+
* If matchMedia is unavailable, returns an inert controller (always false, subscribe is no-op).
|
|
434
|
+
*
|
|
435
|
+
* @example
|
|
436
|
+
* const mq = createMediaQuery('(min-width: 1024px)');
|
|
437
|
+
* const unsubscribe = mq.subscribe(() => console.log('changed'));
|
|
438
|
+
* console.log(mq.getSnapshot()); // boolean
|
|
439
|
+
* unsubscribe();
|
|
440
|
+
* mq.destroy();
|
|
441
|
+
*/
|
|
442
|
+
declare function createMediaQuery(query: string): MediaQueryController;
|
|
443
|
+
|
|
301
444
|
interface ReadingProgressOptions {
|
|
302
445
|
/** Element whose scroll extent defines 100%. Defaults to the document. */
|
|
303
446
|
target?: HTMLElement;
|
|
@@ -319,4 +462,4 @@ declare function createReadingProgress(options?: ReadingProgressOptions): Readin
|
|
|
319
462
|
/** Copy text to the clipboard. Returns false when the Clipboard API is unavailable or denied. */
|
|
320
463
|
declare function copyToClipboard(text: string): Promise<boolean>;
|
|
321
464
|
|
|
322
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, CopyButton, type CopyButtonProps, DEFAULT_STORAGE_KEY, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, ReadingProgress$1 as ReadingProgress, type ReadingProgress as ReadingProgressController, type ReadingProgressOptions, type ReadingProgressProps, type ScrollSpy, type ScrollSpyOptions, Select, SelectContent, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, TableOfContents, type TableOfContentsProps, Tabs, TabsContent, TabsList, TabsTrigger, type ThemeContextValue, type ThemeManager, type ThemeManagerOptions, ThemeProvider, type ThemeProviderProps, type ThemeState, ThemeToggle, type ThemeToggleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, copyToClipboard, createReadingProgress, createScrollSpy, createThemeManager, useReadingProgress, useScrollSpy, useTheme };
|
|
465
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, CopyButton, type CopyButtonProps, DEFAULT_STORAGE_KEY, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type MediaQueryController, ReadingProgress$1 as ReadingProgress, type ReadingProgress as ReadingProgressController, type ReadingProgressOptions, type ReadingProgressProps, type ScrollSpy, type ScrollSpyOptions, Select, SelectContent, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, type SidebarCollapsible, type SidebarContextValue, SidebarInset, type SidebarInsetProps, SidebarPanel, type SidebarPanelProps, SidebarProvider, type SidebarProviderProps, SidebarTrigger, type SidebarTriggerProps, TableOfContents, type TableOfContentsProps, Tabs, TabsContent, TabsList, TabsTrigger, type ThemeContextValue, type ThemeManager, type ThemeManagerOptions, ThemeProvider, type ThemeProviderProps, type ThemeState, ThemeToggle, type ThemeToggleProps, type ToastAction, type ToastEntry, type ToastHandle, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, copyToClipboard, createMediaQuery, createReadingProgress, createScrollSpy, createThemeManager, useMediaQuery, useReadingProgress, useScrollSpy, useSidebar, useTheme, useToast };
|