@alfadocs/ui-kit 0.17.1 → 0.17.3
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/_chunks/{accordion-DOmxGEWU.js → accordion-CNcodXuO.js} +6 -6
- package/dist/_chunks/{ai-prompt-input-DEiQwIMn.js → ai-prompt-input-B-w5Rx3V.js} +184 -181
- package/dist/_chunks/{alert-pgdXrEO5.js → alert-DBnawbmf.js} +64 -59
- package/dist/_chunks/{audio-recorder-CRh4uyFL.js → audio-recorder-DNkQLW1G.js} +3 -3
- package/dist/_chunks/{autocomplete-mOg7WLOh.js → autocomplete-BxfabhZ8.js} +167 -164
- package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js → balance-cell-renderer-DJB6WDPe.js} +2 -2
- package/dist/_chunks/{chat-input-UK-bXU7u.js → chat-input-B3XmFGDw.js} +123 -122
- package/dist/_chunks/checkbox-group-Bwmt1ovQ.js +213 -0
- package/dist/_chunks/{checkbox-D5EHnB14.js → checkbox-mwbrPZDY.js} +75 -70
- package/dist/_chunks/{collapsible-CuxUBoHJ.js → collapsible-hHiyZp0b.js} +61 -63
- package/dist/_chunks/{color-picker-BPfcByHH.js → color-picker-Bm-gzpsh.js} +2 -2
- package/dist/_chunks/{combobox-D5tWe0t_.js → combobox-Da9eq00i.js} +214 -211
- package/dist/_chunks/{copy-field-BCHAZ8QV.js → copy-field-BAF4mt9h.js} +95 -132
- package/dist/_chunks/{date-picker-BlhtBhPo.js → date-picker-BIoSLRly.js} +222 -219
- package/dist/_chunks/{date-range-picker-C2hRu_Ke.js → date-range-picker-9gANFNG9.js} +81 -78
- package/dist/_chunks/{date-time-picker-B67mPZmP.js → date-time-picker-DG7BiGdb.js} +98 -95
- package/dist/_chunks/{dialog-DRp6Dejy.js → dialog-DUomPCRS.js} +69 -71
- package/dist/_chunks/{dropdown-menu-dyV7gHh_.js → dropdown-menu-DZxwF23X.js} +108 -110
- package/dist/_chunks/{freemium-paywall-BTEiVkes.js → freemium-paywall-DXc7XlGE.js} +98 -97
- package/dist/_chunks/{leo-sidebar-D3TuyH5_.js → leo-sidebar-DIsiTju3.js} +2 -2
- package/dist/_chunks/{list-DcjV0m5B.js → list-BdvDctBz.js} +184 -180
- package/dist/_chunks/{message-tray-Fsend-du.js → message-tray-BNAS8al4.js} +111 -111
- package/dist/_chunks/{multi-select-DooDzQIp.js → multi-select-CyspR5ZF.js} +157 -154
- package/dist/_chunks/{navigation-menu-DdufF-_4.js → navigation-menu-CyS1fBJ7.js} +85 -87
- package/dist/_chunks/{notification-tray-C3dYdLAF.js → notification-tray-D_69dXFY.js} +114 -114
- package/dist/_chunks/{number-input-DH00o0DN.js → number-input-BZXu6bPY.js} +92 -89
- package/dist/_chunks/{otp-input-BBXYvLx5.js → otp-input-BDF_iNpa.js} +92 -93
- package/dist/_chunks/{pagination-F1ei4khE.js → pagination-BWaXF7W0.js} +194 -211
- package/dist/_chunks/{patient-shell-BE0CdPOJ.js → patient-shell-BOOaWZA9.js} +3 -3
- package/dist/_chunks/{payment-form-CI77oIx1.js → payment-form-BjkuQeqR.js} +2 -2
- package/dist/_chunks/{pdf-viewer-CnEJvmXC.js → pdf-viewer-BG_nsFT5.js} +2 -2
- package/dist/_chunks/{radio-group-Cz1a4QCA.js → radio-group-BHZOxrIK.js} +4 -4
- package/dist/_chunks/{select-Ca6ibiDL.js → select-C92AT_OZ.js} +7 -7
- package/dist/_chunks/{sidebar-D8Lq065m.js → sidebar-BqzlRBvC.js} +271 -291
- package/dist/_chunks/{slider-CkR6CLun.js → slider-CfEzeseL.js} +4 -4
- package/dist/_chunks/{tabs-CRCyPpJo.js → tabs-aEQfQV3x.js} +8 -8
- package/dist/_chunks/{theme-toggle-B3meAb3y.js → theme-toggle-BswYl0Yp.js} +2 -2
- package/dist/_chunks/use-controllable-state-BiY4xTzM.js +23 -0
- package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js +43 -0
- package/dist/_chunks/use-persistent-state-i23OWy6G.js +24 -0
- package/dist/_chunks/{warning-stack-CeRihME9.js → warning-stack-CDH9TudY.js} +2 -2
- package/dist/_chunks/{workflow-map-D3MvrsZV.js → workflow-map-BeKe23uw.js} +3 -3
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/use-debounced-callback.d.ts +1 -5
- package/dist/components/_shared/use-direction.d.ts +1 -18
- package/dist/components/_shared/use-focus-trap.d.ts +1 -31
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/command-palette.d.ts +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/icon-button-group/icon-button-group.d.ts +14 -14
- package/dist/components/list/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sidebar/index.js +8 -7
- package/dist/components/sidebar/sidebar.d.ts +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.js +98 -15
- package/dist/hooks/use-debounced-callback.d.ts +19 -0
- package/dist/hooks/use-debounced-value.d.ts +16 -0
- package/dist/hooks/use-direction.d.ts +19 -0
- package/dist/hooks/use-focus-trap.d.ts +32 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +13 -0
- package/dist/hooks/use-persistent-state.d.ts +16 -0
- package/dist/index.js +493 -492
- package/dist/patterns/leo-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +4 -2
- package/dist/_chunks/checkbox-group-Qkm3Rg1S.js +0 -208
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as r, f as s, p as m, a as e, s as n, b as o, c as i } from "../../_chunks/payment-form-
|
|
1
|
+
import { P as r, f as s, p as m, a as e, s as n, b as o, c as i } from "../../_chunks/payment-form-BjkuQeqR.js";
|
|
2
2
|
export {
|
|
3
3
|
r as PaymentForm,
|
|
4
4
|
s as formatPaymentAmount,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as a, a as l, b as S, c, d as s, e as o, f as r, g as p, h as g, i, j as m } from "../../_chunks/select-
|
|
1
|
+
import { S as a, a as l, b as S, c, d as s, e as o, f as r, g as p, h as g, i, j as m } from "../../_chunks/select-C92AT_OZ.js";
|
|
2
2
|
export {
|
|
3
3
|
a as Select,
|
|
4
4
|
l as SelectContent,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { S as r, a as i, b as s, c as d, d as S, e as b, f as t, g as o, h as m, i as n, j as l, k as c, l as
|
|
1
|
+
import { S as r, a as i, b as s, c as d, d as S, e as b, f as t, g as o, h as m, i as n, j as l, k as c, l as p, m as u, n as I, o as g, p as P, s as f, u as B } from "../../_chunks/sidebar-BqzlRBvC.js";
|
|
2
|
+
import { u as h } from "../../_chunks/use-persistent-state-i23OWy6G.js";
|
|
2
3
|
export {
|
|
3
4
|
r as Sidebar,
|
|
4
5
|
i as SidebarBody,
|
|
@@ -12,13 +13,13 @@ export {
|
|
|
12
13
|
n as SidebarItemBadge,
|
|
13
14
|
l as SidebarItemIcon,
|
|
14
15
|
c as SidebarItemLabel,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
p as SidebarPinButton,
|
|
17
|
+
u as SidebarPrimaryAction,
|
|
18
|
+
I as SidebarProfilePill,
|
|
19
|
+
g as SidebarSection,
|
|
19
20
|
P as SidebarWorkspaceSwitcher,
|
|
20
21
|
f as sidebarAgent,
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
h as usePersistentState,
|
|
23
|
+
B as useSidebar
|
|
23
24
|
};
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -9,7 +9,7 @@ export interface SidebarContextValue {
|
|
|
9
9
|
transitionTo?: (next: SidebarMode) => void;
|
|
10
10
|
}
|
|
11
11
|
export declare const useSidebar: () => SidebarContextValue;
|
|
12
|
-
export
|
|
12
|
+
export { usePersistentState } from '../../hooks/use-persistent-state';
|
|
13
13
|
export interface SidebarHandle {
|
|
14
14
|
getIsCollapsed: () => boolean;
|
|
15
15
|
toggleCollapsed: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as r, W as e, a as s, b as d, c as w, i as t, l as f, m as l, r as i, w as k, d as n, e as A, f as C } from "../../_chunks/workflow-map-
|
|
1
|
+
import { C as r, W as e, a as s, b as d, c as w, i as t, l as f, m as l, r as i, w as k, d as n, e as A, f as C } from "../../_chunks/workflow-map-BeKe23uw.js";
|
|
2
2
|
export {
|
|
3
3
|
r as CORE_PATIENT_FIELDS,
|
|
4
4
|
e as WorkflowCard,
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -8,4 +8,12 @@ export { useLocale } from './use-locale';
|
|
|
8
8
|
export type { LocaleDir, UseLocaleReturn } from './use-locale';
|
|
9
9
|
export { useTheme, resolveTheme, themeClassList, THEME_STORAGE_KEY, ACCESSIBILITY_STORAGE_KEY, THEME_CLASS, } from './use-theme';
|
|
10
10
|
export type { ThemeBase, ThemePreference, AccessibilityPreference, ResolvedTheme, UseThemeReturn, } from './use-theme';
|
|
11
|
+
export { useControllableState, type UseControllableStateOptions, } from './use-controllable-state';
|
|
12
|
+
export { useCopyToClipboard, type CopyStatus, type UseCopyToClipboardOptions, type UseCopyToClipboardReturn, } from './use-copy-to-clipboard';
|
|
13
|
+
export { useDebouncedCallback, type DebouncedCallback, } from './use-debounced-callback';
|
|
14
|
+
export { useDebouncedValue } from './use-debounced-value';
|
|
15
|
+
export { useFocusTrap, type UseFocusTrapOptions } from './use-focus-trap';
|
|
16
|
+
export { useDirection, useDocumentDirection, type Direction, } from './use-direction';
|
|
17
|
+
export { usePersistentState } from './use-persistent-state';
|
|
18
|
+
export { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';
|
|
11
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,18 +1,101 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as
|
|
4
|
-
import { A as
|
|
1
|
+
import { u as D } from "../_chunks/use-prefers-reduced-motion-BMwIQRjB.js";
|
|
2
|
+
import { u as w, a as _, b as k } from "../_chunks/use-locale-C5rS3Xon.js";
|
|
3
|
+
import { u as g } from "../_chunks/use-count-up-BLLetaZ8.js";
|
|
4
|
+
import { A as M, T as O, a as H, r as R, t as Y, u as q } from "../_chunks/use-theme-B1cwAXJR.js";
|
|
5
|
+
import { u as G } from "../_chunks/use-controllable-state-BiY4xTzM.js";
|
|
6
|
+
import { u as U } from "../_chunks/use-copy-to-clipboard-Cyfc_dlv.js";
|
|
7
|
+
import { u as j } from "../_chunks/use-debounced-callback-BisrB-Fq.js";
|
|
8
|
+
import { useState as p, useEffect as l, useRef as T, useLayoutEffect as x } from "react";
|
|
9
|
+
import { u as z, a as J } from "../_chunks/use-direction-D6rvvG9G.js";
|
|
10
|
+
import { u as W } from "../_chunks/use-persistent-state-i23OWy6G.js";
|
|
11
|
+
function S(e, t) {
|
|
12
|
+
const [o, s] = p(e);
|
|
13
|
+
return l(() => {
|
|
14
|
+
if (t <= 0) {
|
|
15
|
+
s(e);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const a = setTimeout(() => s(e), t);
|
|
19
|
+
return () => clearTimeout(a);
|
|
20
|
+
}, [e, t]), o;
|
|
21
|
+
}
|
|
22
|
+
const h = [
|
|
23
|
+
"a[href]",
|
|
24
|
+
"button:not([disabled])",
|
|
25
|
+
'input:not([disabled]):not([type="hidden"])',
|
|
26
|
+
"select:not([disabled])",
|
|
27
|
+
"textarea:not([disabled])",
|
|
28
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
29
|
+
'[contenteditable="true"]',
|
|
30
|
+
"audio[controls]",
|
|
31
|
+
"video[controls]"
|
|
32
|
+
].join(",");
|
|
33
|
+
function E(e) {
|
|
34
|
+
return Array.from(
|
|
35
|
+
e.querySelectorAll(h)
|
|
36
|
+
).filter((t) => {
|
|
37
|
+
if (t.hidden || t.getAttribute("aria-hidden") === "true") return !1;
|
|
38
|
+
let o = t;
|
|
39
|
+
for (; o; ) {
|
|
40
|
+
if (o.hasAttribute("inert")) return !1;
|
|
41
|
+
o = o.parentElement;
|
|
42
|
+
}
|
|
43
|
+
return !0;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function C(e, t = {}) {
|
|
47
|
+
const { enabled: o = !0, autoFocus: s = !0, restoreFocus: a = !0 } = t, f = T(null);
|
|
48
|
+
l(() => {
|
|
49
|
+
if (!o) return;
|
|
50
|
+
const u = e.current;
|
|
51
|
+
if (!u) return;
|
|
52
|
+
if (f.current = typeof document < "u" && document.activeElement instanceof HTMLElement ? document.activeElement : null, s) {
|
|
53
|
+
const n = E(u)[0] ?? (u.tabIndex >= -1 ? u : null);
|
|
54
|
+
n == null || n.focus();
|
|
55
|
+
}
|
|
56
|
+
function d(r) {
|
|
57
|
+
if (r.key !== "Tab") return;
|
|
58
|
+
const n = e.current;
|
|
59
|
+
if (!n) return;
|
|
60
|
+
const c = E(n);
|
|
61
|
+
if (c.length === 0) {
|
|
62
|
+
r.preventDefault();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const m = c[0], b = c[c.length - 1], i = document.activeElement;
|
|
66
|
+
r.shiftKey ? (i === m || !n.contains(i)) && (r.preventDefault(), b.focus()) : (i === b || !n.contains(i)) && (r.preventDefault(), m.focus());
|
|
67
|
+
}
|
|
68
|
+
return u.addEventListener("keydown", d), () => {
|
|
69
|
+
if (u.removeEventListener("keydown", d), a && f.current) {
|
|
70
|
+
const r = f.current;
|
|
71
|
+
queueMicrotask(() => {
|
|
72
|
+
r.isConnected && r.focus();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}, [o, s, a, e]);
|
|
77
|
+
}
|
|
78
|
+
const L = typeof window < "u" ? x : l;
|
|
5
79
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
80
|
+
M as ACCESSIBILITY_STORAGE_KEY,
|
|
81
|
+
O as THEME_CLASS,
|
|
82
|
+
H as THEME_STORAGE_KEY,
|
|
83
|
+
R as resolveTheme,
|
|
84
|
+
Y as themeClassList,
|
|
85
|
+
G as useControllableState,
|
|
86
|
+
U as useCopyToClipboard,
|
|
87
|
+
g as useCountUp,
|
|
88
|
+
j as useDebouncedCallback,
|
|
89
|
+
S as useDebouncedValue,
|
|
90
|
+
z as useDirection,
|
|
91
|
+
J as useDocumentDirection,
|
|
92
|
+
C as useFocusTrap,
|
|
93
|
+
L as useIsomorphicLayoutEffect,
|
|
94
|
+
w as useLocale,
|
|
95
|
+
_ as useMediaQuery,
|
|
96
|
+
W as usePersistentState,
|
|
97
|
+
D as usePrefersReducedMotion,
|
|
98
|
+
k as useScrollToFirstError,
|
|
99
|
+
q as useTheme
|
|
17
100
|
};
|
|
18
101
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type DebouncedCallback<A extends unknown[]> = ((...args: A) => void) & {
|
|
2
|
+
cancel: () => void;
|
|
3
|
+
flush: () => void;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Wrap a callback so successive calls within `delayMs` collapse into a
|
|
7
|
+
* single invocation on the trailing edge. Returns a stable function with
|
|
8
|
+
* `.cancel()` (drop pending) and `.flush()` (run pending immediately).
|
|
9
|
+
*
|
|
10
|
+
* The latest `callback` reference is always invoked — internal ref-sync
|
|
11
|
+
* means re-renders that pass a new closure don't reset the timer.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const onChange = useDebouncedCallback((value: string) => {
|
|
15
|
+
* void search(value);
|
|
16
|
+
* }, 250);
|
|
17
|
+
*/
|
|
18
|
+
export declare function useDebouncedCallback<A extends unknown[]>(callback: (...args: A) => void, delayMs: number): DebouncedCallback<A>;
|
|
19
|
+
//# sourceMappingURL=use-debounced-callback.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a value that lags `input` by `delayMs`. Each new `input`
|
|
3
|
+
* resets the timer; the returned value updates once `input` has been
|
|
4
|
+
* stable for `delayMs` ms.
|
|
5
|
+
*
|
|
6
|
+
* Companion to `useDebouncedCallback` — use this when you want the
|
|
7
|
+
* debounced *value* (to drive a derived effect, query, or render),
|
|
8
|
+
* and use the callback hook when you want the debounced *action*.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const [query, setQuery] = useState('');
|
|
12
|
+
* const debouncedQuery = useDebouncedValue(query, 250);
|
|
13
|
+
* useEffect(() => { void search(debouncedQuery); }, [debouncedQuery]);
|
|
14
|
+
*/
|
|
15
|
+
export declare function useDebouncedValue<T>(input: T, delayMs: number): T;
|
|
16
|
+
//# sourceMappingURL=use-debounced-value.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
export type Direction = 'ltr' | 'rtl';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the effective writing direction for `ref`'s element by walking its
|
|
5
|
+
* ancestor chain and reacting to `dir` attribute mutations along the way.
|
|
6
|
+
*
|
|
7
|
+
* Radix primitives default to `dir="ltr"` when no `DirectionProvider` is
|
|
8
|
+
* present and then stamp `dir="ltr"` onto the rendered element — which
|
|
9
|
+
* overrides any inherited `dir="rtl"` from a parent. Pass the result of this
|
|
10
|
+
* hook to the primitive's `dir` prop so the logical layout flips correctly.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useDirection(ref: RefObject<HTMLElement | null>): Direction;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the document-level writing direction. Use for components whose
|
|
15
|
+
* Root is a pure context provider (no DOM element to ref) — e.g. Radix
|
|
16
|
+
* DropdownMenu/ContextMenu/Menubar Roots.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useDocumentDirection(): Direction;
|
|
19
|
+
//# sourceMappingURL=use-direction.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
export interface UseFocusTrapOptions {
|
|
3
|
+
/** When `false` the trap is inert. Defaults to `true`. */
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* When `true`, focus initial autofocus into the first focusable
|
|
7
|
+
* descendant on mount / enable. @default true
|
|
8
|
+
*/
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* When `true`, restores focus to the previously-focused element on
|
|
12
|
+
* unmount / disable. @default true
|
|
13
|
+
*/
|
|
14
|
+
restoreFocus?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Constrain Tab navigation to descendants of `containerRef`. Wraps Tab
|
|
18
|
+
* forward from the last focusable to the first, and Shift+Tab back from
|
|
19
|
+
* the first to the last. Optionally autofocuses on enable and restores
|
|
20
|
+
* focus on disable.
|
|
21
|
+
*
|
|
22
|
+
* Use this for inline modal patterns or focus zones that don't ship
|
|
23
|
+
* with their own Radix overlay. Don't stack it inside Dialog / Sheet —
|
|
24
|
+
* Radix already traps focus in those.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const ref = useRef<HTMLDivElement>(null);
|
|
28
|
+
* useFocusTrap(ref, { enabled: open });
|
|
29
|
+
* return <div ref={ref}>…</div>;
|
|
30
|
+
*/
|
|
31
|
+
export declare function useFocusTrap<T extends HTMLElement>(containerRef: RefObject<T | null>, options?: UseFocusTrapOptions): void;
|
|
32
|
+
//# sourceMappingURL=use-focus-trap.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `useLayoutEffect` on the client, `useEffect` during SSR. Use when you
|
|
4
|
+
* need a layout effect (e.g. measuring DOM, syncing a ref) without
|
|
5
|
+
* triggering React's "useLayoutEffect does nothing on the server"
|
|
6
|
+
* warning when the same component renders under SSR.
|
|
7
|
+
*
|
|
8
|
+
* The check is `typeof window` rather than `typeof document` so the
|
|
9
|
+
* shim is correct in any non-browser runtime (Node, Deno, edge
|
|
10
|
+
* runtimes, workers).
|
|
11
|
+
*/
|
|
12
|
+
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
13
|
+
//# sourceMappingURL=use-isomorphic-layout-effect.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drop-in `useState` replacement that mirrors its value to
|
|
3
|
+
* `localStorage` under the given key. Same signature as `useState`, so
|
|
4
|
+
* consumers can wire any state that should survive reloads without
|
|
5
|
+
* plumbing effects by hand:
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const [pinnedIds, setPinnedIds] =
|
|
9
|
+
* usePersistentState<string[]>('ui.sidebar.favorites',
|
|
10
|
+
* ['dashboard', 'calendar']);
|
|
11
|
+
*
|
|
12
|
+
* SSR-safe and quota-safe (swallows serialise / storage errors so a
|
|
13
|
+
* disabled-storage or quota-exceeded write never throws into render).
|
|
14
|
+
*/
|
|
15
|
+
export declare function usePersistentState<T>(storageKey: string, initial: T | (() => T)): [T, (value: T | ((prev: T) => T)) => void];
|
|
16
|
+
//# sourceMappingURL=use-persistent-state.d.ts.map
|