@wickermoney/ui-kit 0.4.2 → 0.6.0-rc.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/Dialog.d.ts +21 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.js +35 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/Table.d.ts +12 -2
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +7 -3
- package/dist/Table.js.map +1 -1
- package/dist/components.css +30 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/tokens.css +1 -1
- package/dist/useFocusTrap.d.ts +26 -0
- package/dist/useFocusTrap.d.ts.map +1 -0
- package/dist/useFocusTrap.js +61 -0
- package/dist/useFocusTrap.js.map +1 -0
- package/package.json +6 -2
package/dist/Dialog.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** Props for {@link Dialog}. */
|
|
3
|
+
export interface DialogProps {
|
|
4
|
+
/** Heading shown at the top; also the dialog's accessible name. */
|
|
5
|
+
readonly title: string;
|
|
6
|
+
/** Called when the user dismisses the dialog: Escape, the close button or a click outside it. */
|
|
7
|
+
readonly onClose: () => void;
|
|
8
|
+
/** The dialog content, usually a form. */
|
|
9
|
+
readonly children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A modal dialog: a side drawer on a desktop window and a full-screen sheet on
|
|
13
|
+
* a phone.
|
|
14
|
+
*
|
|
15
|
+
* Rendered only while it is wanted, so a form inside starts fresh each time it
|
|
16
|
+
* opens. It is the native `<dialog>` shown with `showModal()`, which supplies
|
|
17
|
+
* what a hand-rolled modal gets wrong: the page behind it is inert, Tab stays
|
|
18
|
+
* inside, and Escape closes it. Focus goes back to whatever opened it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Dialog({ title, onClose, children }: DialogProps): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../src/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEhE,gCAAgC;AAChC,MAAM,WAAW,WAAW;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,iGAAiG;IACjG,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;IAC5B,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,WAAW,+BAsC/D"}
|
package/dist/Dialog.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useRef } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* A modal dialog: a side drawer on a desktop window and a full-screen sheet on
|
|
5
|
+
* a phone.
|
|
6
|
+
*
|
|
7
|
+
* Rendered only while it is wanted, so a form inside starts fresh each time it
|
|
8
|
+
* opens. It is the native `<dialog>` shown with `showModal()`, which supplies
|
|
9
|
+
* what a hand-rolled modal gets wrong: the page behind it is inert, Tab stays
|
|
10
|
+
* inside, and Escape closes it. Focus goes back to whatever opened it.
|
|
11
|
+
*/
|
|
12
|
+
export function Dialog({ title, onClose, children }) {
|
|
13
|
+
const ref = useRef(null);
|
|
14
|
+
const titleId = useId();
|
|
15
|
+
// A drag that starts inside the dialog (selecting text in an input) and ends
|
|
16
|
+
// on the backdrop still fires a click on the dialog; only a press that began
|
|
17
|
+
// on the backdrop counts as "click outside".
|
|
18
|
+
const pressedBackdrop = useRef(false);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const dialog = ref.current;
|
|
21
|
+
const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
22
|
+
if (dialog !== null && !dialog.open) {
|
|
23
|
+
if (typeof dialog.showModal === 'function')
|
|
24
|
+
dialog.showModal();
|
|
25
|
+
else
|
|
26
|
+
dialog.setAttribute('open', '');
|
|
27
|
+
// showModal() would focus the close button; a form wants its first field.
|
|
28
|
+
dialog.querySelector('.wm-dialog__body :is(input, select, textarea)')?.focus();
|
|
29
|
+
}
|
|
30
|
+
return () => { opener?.focus(); };
|
|
31
|
+
}, []);
|
|
32
|
+
return (_jsxs("dialog", { ref: ref, className: "wm-dialog", "aria-labelledby": titleId, onClose: onClose, onMouseDown: (e) => { pressedBackdrop.current = e.target === e.currentTarget; }, onClick: (e) => { if (pressedBackdrop.current && e.target === e.currentTarget)
|
|
33
|
+
onClose(); }, children: [_jsxs("div", { className: "wm-dialog__header", children: [_jsx("h2", { className: "wm-dialog__title", id: titleId, children: title }), _jsx("button", { type: "button", className: "wm-btn wm-dialog__close", "aria-label": "Close", onClick: onClose, children: "\u00D7" })] }), _jsx("div", { className: "wm-dialog__body", children: children })] }));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=Dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../src/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAA;AAYhE;;;;;;;;GAQG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAe;IAC9D,MAAM,GAAG,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IAC3C,MAAM,OAAO,GAAG,KAAK,EAAE,CAAA;IACvB,6EAA6E;IAC7E,6EAA6E;IAC7E,6CAA6C;IAC7C,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,yBAAyB,gBAAY,OAAO,EAAC,OAAO,EAAE,OAAO,uBAEpF,IACL,EACN,cAAK,SAAS,EAAC,iBAAiB,YAAE,QAAQ,GAAO,IAC1C,CACV,CAAA;AACH,CAAC"}
|
package/dist/Table.d.ts
CHANGED
|
@@ -30,12 +30,22 @@ export interface TableProps<T> {
|
|
|
30
30
|
* is text, so that CSS can place them and label them.
|
|
31
31
|
*/
|
|
32
32
|
readonly className?: string;
|
|
33
|
+
/**
|
|
34
|
+
* A name for the table, announced by screen readers (a visually hidden
|
|
35
|
+
* `<caption>`). Give one whenever a page has more than one table or the
|
|
36
|
+
* heading above it does not say what the rows are.
|
|
37
|
+
*/
|
|
38
|
+
readonly caption?: string;
|
|
33
39
|
}
|
|
34
40
|
/**
|
|
35
41
|
* A data table.
|
|
36
42
|
*
|
|
37
43
|
* Wrapped in its own horizontal scroller so that a wide table does not force the
|
|
38
|
-
* whole page to scroll sideways on a narrow screen.
|
|
44
|
+
* whole page to scroll sideways on a narrow screen. Header cells carry
|
|
45
|
+
* `scope="col"`, and a column with an empty string header (a column of row
|
|
46
|
+
* buttons) gets a visually hidden "Actions" label so no header cell is empty.
|
|
47
|
+
* That label is in the `<th>` only; `data-label` stays unset for it, so the
|
|
48
|
+
* phone card layouts do not print it.
|
|
39
49
|
*/
|
|
40
|
-
export declare function Table<T>({ columns, rows, rowKey, empty, className }: TableProps<T>): import("react").JSX.Element;
|
|
50
|
+
export declare function Table<T>({ columns, rows, rowKey, empty, className, caption }: TableProps<T>): import("react").JSX.Element;
|
|
41
51
|
//# sourceMappingURL=Table.d.ts.map
|
package/dist/Table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../src/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,+CAA+C;AAC/C,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB,wCAAwC;I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CAAC,OAAO,EAAE,SAAS,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;IACtC,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CAAA;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAA;IACnC,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,+BAkC3F"}
|
package/dist/Table.js
CHANGED
|
@@ -3,11 +3,15 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
* A data table.
|
|
4
4
|
*
|
|
5
5
|
* Wrapped in its own horizontal scroller so that a wide table does not force the
|
|
6
|
-
* whole page to scroll sideways on a narrow screen.
|
|
6
|
+
* whole page to scroll sideways on a narrow screen. Header cells carry
|
|
7
|
+
* `scope="col"`, and a column with an empty string header (a column of row
|
|
8
|
+
* buttons) gets a visually hidden "Actions" label so no header cell is empty.
|
|
9
|
+
* That label is in the `<th>` only; `data-label` stays unset for it, so the
|
|
10
|
+
* phone card layouts do not print it.
|
|
7
11
|
*/
|
|
8
|
-
export function Table({ columns, rows, rowKey, empty, className }) {
|
|
12
|
+
export function Table({ columns, rows, rowKey, empty, className, caption }) {
|
|
9
13
|
if (rows.length === 0 && empty !== undefined)
|
|
10
14
|
return _jsx(_Fragment, { children: empty });
|
|
11
|
-
return (_jsx("div", { className: className === undefined ? 'wm-table__scroll' : `wm-table__scroll ${className}`, children: _jsxs("table", { className: "wm-table", children: [_jsx("thead", { children: _jsx("tr", { children: columns.map((c) => (_jsx("th", { "data-col": c.key, className: c.numeric === true ? 'wm-num' : undefined, children: c.header }, c.key))) }) }), _jsx("tbody", { children: rows.map((row) => (_jsx("tr", { children: columns.map((c) => (_jsx("td", { "data-col": c.key, "data-label": typeof c.header === 'string' && c.header !== '' ? c.header : undefined, className: c.numeric === true ? 'wm-num' : undefined, children: c.render(row) }, c.key))) }, rowKey(row)))) })] }) }));
|
|
15
|
+
return (_jsx("div", { className: className === undefined ? 'wm-table__scroll' : `wm-table__scroll ${className}`, children: _jsxs("table", { className: "wm-table", children: [caption === undefined ? null : _jsx("caption", { className: "wm-visually-hidden", children: caption }), _jsx("thead", { children: _jsx("tr", { children: columns.map((c) => (_jsx("th", { scope: "col", "data-col": c.key, className: c.numeric === true ? 'wm-num' : undefined, children: c.header === '' ? _jsx("span", { className: "wm-visually-hidden", children: "Actions" }) : c.header }, c.key))) }) }), _jsx("tbody", { children: rows.map((row) => (_jsx("tr", { children: columns.map((c) => (_jsx("td", { "data-col": c.key, "data-label": typeof c.header === 'string' && c.header !== '' ? c.header : undefined, className: c.numeric === true ? 'wm-num' : undefined, children: c.render(row) }, c.key))) }, rowKey(row)))) })] }) }));
|
|
12
16
|
}
|
|
13
17
|
//# sourceMappingURL=Table.js.map
|
package/dist/Table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../src/Table.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../src/Table.tsx"],"names":[],"mappings":";AA0CA;;;;;;;;;GASG;AACH,MAAM,UAAU,KAAK,CAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAiB;IAC1F,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,KAA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f,CACN,CAAC,GACI,IACF,GACJ,CACP,CAAA;AACH,CAAC"}
|
package/dist/components.css
CHANGED
|
@@ -89,3 +89,33 @@
|
|
|
89
89
|
position: absolute; width: 1px; height: 1px; overflow: hidden;
|
|
90
90
|
clip-path: inset(50%); white-space: nowrap;
|
|
91
91
|
}
|
|
92
|
+
|
|
93
|
+
/* Dialog: a right-hand drawer on a desktop window, a full-screen sheet on a
|
|
94
|
+
phone. Height is dvh so the on-screen keyboard does not push Save off the
|
|
95
|
+
bottom, and the body scrolls on its own while the header stays put. */
|
|
96
|
+
.wm-dialog {
|
|
97
|
+
position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0;
|
|
98
|
+
width: min(460px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
|
|
99
|
+
color: var(--wm-text); background: var(--wm-surface);
|
|
100
|
+
border: 0; border-left: 1px solid var(--wm-border); box-shadow: var(--wm-shadow);
|
|
101
|
+
}
|
|
102
|
+
.wm-dialog[open] { display: flex; flex-direction: column; }
|
|
103
|
+
.wm-dialog::backdrop { background: rgb(9 12 16 / 55%); }
|
|
104
|
+
.wm-dialog__header {
|
|
105
|
+
flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--wm-gap-sm);
|
|
106
|
+
padding: 12px var(--wm-gap); padding-top: max(12px, env(safe-area-inset-top));
|
|
107
|
+
border-bottom: 1px solid var(--wm-border);
|
|
108
|
+
}
|
|
109
|
+
.wm-dialog__title { margin: 0; font-size: 16px; font-weight: 650; }
|
|
110
|
+
.wm-dialog__close { flex: none; width: 36px; height: 36px; padding: 0; font-size: 20px; line-height: 1; }
|
|
111
|
+
.wm-dialog__body {
|
|
112
|
+
flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--wm-gap);
|
|
113
|
+
padding-bottom: max(var(--wm-gap), env(safe-area-inset-bottom));
|
|
114
|
+
}
|
|
115
|
+
/* Cancel and Save at the foot of a dialog's form. */
|
|
116
|
+
.wm-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: var(--wm-gap-sm); }
|
|
117
|
+
/* The page behind a modal dialog does not scroll. */
|
|
118
|
+
body:has(.wm-dialog[open]) { overflow: hidden; }
|
|
119
|
+
@media (max-width: 560px) {
|
|
120
|
+
.wm-dialog { width: 100vw; border-left: 0; }
|
|
121
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import './tokens.css';
|
|
|
2
2
|
import './components.css';
|
|
3
3
|
export { Surface } from './Surface.js';
|
|
4
4
|
export type { SurfaceProps } from './Surface.js';
|
|
5
|
+
export { Dialog } from './Dialog.js';
|
|
6
|
+
export type { DialogProps } from './Dialog.js';
|
|
5
7
|
export { Button } from './Button.js';
|
|
6
8
|
export type { ButtonProps } from './Button.js';
|
|
7
9
|
export { IconButton } from './IconButton.js';
|
|
@@ -35,4 +37,6 @@ export { EmptyState } from './EmptyState.js';
|
|
|
35
37
|
export type { EmptyStateProps } from './EmptyState.js';
|
|
36
38
|
export { Spinner } from './Spinner.js';
|
|
37
39
|
export type { SpinnerProps } from './Spinner.js';
|
|
40
|
+
export { useFocusTrap } from './useFocusTrap.js';
|
|
41
|
+
export type { FocusTrapOptions } from './useFocusTrap.js';
|
|
38
42
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AACrB,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,YAAY,EAAE,eAAe,EAAE,QAAQ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|
import './tokens.css';
|
|
2
2
|
import './components.css';
|
|
3
3
|
export { Surface } from './Surface.js';
|
|
4
|
+
export { Dialog } from './Dialog.js';
|
|
4
5
|
export { Button } from './Button.js';
|
|
5
6
|
export { IconButton } from './IconButton.js';
|
|
6
7
|
export { Field } from './Field.js';
|
|
@@ -17,4 +18,5 @@ export { orderByParent } from './orderByParent.js';
|
|
|
17
18
|
export { Alert } from './Alert.js';
|
|
18
19
|
export { EmptyState } from './EmptyState.js';
|
|
19
20
|
export { Spinner } from './Spinner.js';
|
|
21
|
+
export { useFocusTrap } from './useFocusTrap.js';
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AACrB,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,C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AM,cAAc,CAAA;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/tokens.css
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/** Options for {@link useFocusTrap}. */
|
|
3
|
+
export interface FocusTrapOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Put focus back on whatever had it when the trap turned on, once it turns
|
|
6
|
+
* off. Default `true`. Turn it off when the caller returns focus somewhere
|
|
7
|
+
* more specific itself.
|
|
8
|
+
*/
|
|
9
|
+
readonly restoreFocus?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Keeps Tab and Shift+Tab inside a container while it is `active`.
|
|
13
|
+
*
|
|
14
|
+
* Tab from the last tabbable element wraps to the first and Shift+Tab from the
|
|
15
|
+
* first wraps to the last; if focus is somewhere outside the container (or on
|
|
16
|
+
* the container itself) the next Tab pulls it in. It does not move focus on
|
|
17
|
+
* activation (the caller knows what should be focused first) and does not
|
|
18
|
+
* handle Escape. Elements that are disabled, `inert`, hidden or `tabindex="-1"`
|
|
19
|
+
* are skipped. For a hand-rolled modal that is not a native `<dialog>`.
|
|
20
|
+
*
|
|
21
|
+
* @param ref - The container to trap focus in; must be attached when `active` is true.
|
|
22
|
+
* @param active - Whether the trap is on.
|
|
23
|
+
* @param options - See {@link FocusTrapOptions}.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useFocusTrap<T extends HTMLElement>(ref: RefObject<T | null>, active: boolean, { restoreFocus }?: FocusTrapOptions): void;
|
|
26
|
+
//# sourceMappingURL=useFocusTrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusTrap.d.ts","sourceRoot":"","sources":["../src/useFocusTrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAezD,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAChC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,WAAW,EAChD,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,EACxB,MAAM,EAAE,OAAO,EACf,EAAE,YAAmB,EAAE,GAAE,gBAAqB,GAC7C,IAAI,CA0BN"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
const TABBABLE = 'a[href], button, input, select, textarea, summary, [tabindex], [contenteditable=""], [contenteditable="true"]';
|
|
3
|
+
function tabbablesIn(root) {
|
|
4
|
+
return Array.from(root.querySelectorAll(TABBABLE)).filter((el) => el.tabIndex >= 0 &&
|
|
5
|
+
!el.hasAttribute('disabled') &&
|
|
6
|
+
el.closest('[inert], [hidden]') === null &&
|
|
7
|
+
el.getAttribute('type') !== 'hidden');
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Keeps Tab and Shift+Tab inside a container while it is `active`.
|
|
11
|
+
*
|
|
12
|
+
* Tab from the last tabbable element wraps to the first and Shift+Tab from the
|
|
13
|
+
* first wraps to the last; if focus is somewhere outside the container (or on
|
|
14
|
+
* the container itself) the next Tab pulls it in. It does not move focus on
|
|
15
|
+
* activation (the caller knows what should be focused first) and does not
|
|
16
|
+
* handle Escape. Elements that are disabled, `inert`, hidden or `tabindex="-1"`
|
|
17
|
+
* are skipped. For a hand-rolled modal that is not a native `<dialog>`.
|
|
18
|
+
*
|
|
19
|
+
* @param ref - The container to trap focus in; must be attached when `active` is true.
|
|
20
|
+
* @param active - Whether the trap is on.
|
|
21
|
+
* @param options - See {@link FocusTrapOptions}.
|
|
22
|
+
*/
|
|
23
|
+
export function useFocusTrap(ref, active, { restoreFocus = true } = {}) {
|
|
24
|
+
const restore = useRef(restoreFocus);
|
|
25
|
+
restore.current = restoreFocus;
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!active)
|
|
28
|
+
return;
|
|
29
|
+
const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
30
|
+
const onKey = (e) => {
|
|
31
|
+
const root = ref.current;
|
|
32
|
+
if (e.key !== 'Tab' || root === null)
|
|
33
|
+
return;
|
|
34
|
+
const items = tabbablesIn(root);
|
|
35
|
+
if (items.length === 0) {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
root.focus();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const first = items[0];
|
|
41
|
+
const last = items[items.length - 1];
|
|
42
|
+
const current = document.activeElement;
|
|
43
|
+
const inside = current instanceof Node && root.contains(current) && current !== root;
|
|
44
|
+
if (e.shiftKey && (!inside || current === first)) {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
last.focus();
|
|
47
|
+
}
|
|
48
|
+
else if (!e.shiftKey && (!inside || current === last)) {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
first.focus();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
document.addEventListener('keydown', onKey);
|
|
54
|
+
return () => {
|
|
55
|
+
document.removeEventListener('keydown', onKey);
|
|
56
|
+
if (restore.current && opener?.isConnected === true)
|
|
57
|
+
opener.focus();
|
|
58
|
+
};
|
|
59
|
+
}, [ref, active]);
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=useFocusTrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusTrap.js","sourceRoot":"","sources":["../src/useFocusTrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAA;AAEzD,MAAM,QAAQ,GACZ,+GAA+G,CAAA;AAEjH,SAAS,WAAW,CAAC,IAAiB;IACpC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAc,QAAQ,CAAC,CAAC,CAAC,MAAM,CACpE,CAAC,EAAE,EAAE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YAAY,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,IAAI,CAAA;YACpF,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,CAAC;gBAAC,CAAC,CAAC,cAAc,EAAE,CAAC;gBAAC,IAAI,CAAC,KAAK,EAAE,CAAA;YAAC,CAAC;iBACjF,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,IAAI,OAAO,KAAK,IAAI,CAAC,EAAE,CAAC;gBAAC,CAAC,CAAC,cAAc,EAAE,CAAC;gBAAC,KAAK,CAAC,KAAK,EAAE,CAAA;YAAC,CAAC;QAC9F,CAAC,CAAA;QACD,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAC3C,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;YAC9C,IAAI,OAAO,CAAC,OAAO,IAAI,MAAM,EAAE,WAAW,KAAK,IAAI;gBAAE,MAAM,CAAC,KAAK,EAAE,CAAA;QACrE,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAA;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wickermoney/ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0-rc.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
},
|
|
22
22
|
"./styles.css": "./dist/tokens.css"
|
|
23
23
|
},
|
|
24
|
+
"sideEffects": [
|
|
25
|
+
"./dist/index.js",
|
|
26
|
+
"./dist/*.css"
|
|
27
|
+
],
|
|
24
28
|
"files": [
|
|
25
29
|
"dist"
|
|
26
30
|
],
|
|
@@ -36,7 +40,7 @@
|
|
|
36
40
|
"devDependencies": {
|
|
37
41
|
"@testing-library/react": "^16.3.3",
|
|
38
42
|
"@types/react": "^19.3.0",
|
|
39
|
-
"jsdom": "30.1.
|
|
43
|
+
"jsdom": "30.1.2",
|
|
40
44
|
"react": "^19.3.0",
|
|
41
45
|
"react-dom": "^19.3.0",
|
|
42
46
|
"typescript": "^6.0.3",
|