@helpwave/hightide 0.1.27 → 0.1.28
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/coloring/index.d.mts +2 -0
- package/dist/coloring/index.d.ts +2 -0
- package/dist/coloring/index.js +85 -0
- package/dist/coloring/index.js.map +1 -0
- package/dist/coloring/index.mjs +48 -0
- package/dist/coloring/index.mjs.map +1 -0
- package/dist/components/branding/index.d.mts +3 -0
- package/dist/components/branding/index.d.ts +3 -0
- package/dist/components/branding/index.js +140 -0
- package/dist/components/branding/index.js.map +1 -0
- package/dist/components/branding/index.mjs +104 -0
- package/dist/components/branding/index.mjs.map +1 -0
- package/dist/components/date/index.d.mts +10 -0
- package/dist/components/date/index.d.ts +10 -0
- package/dist/components/date/index.js +1168 -0
- package/dist/components/date/index.js.map +1 -0
- package/dist/components/date/index.mjs +1124 -0
- package/dist/components/date/index.mjs.map +1 -0
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/form/index.d.mts +5 -0
- package/dist/components/form/index.d.ts +5 -0
- package/dist/components/form/index.js +100 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/form/index.mjs +64 -0
- package/dist/components/form/index.mjs.map +1 -0
- package/dist/components/icons-and-geometry/index.d.mts +7 -0
- package/dist/components/icons-and-geometry/index.d.ts +7 -0
- package/dist/components/icons-and-geometry/index.js +3955 -0
- package/dist/components/icons-and-geometry/index.js.map +1 -0
- package/dist/components/icons-and-geometry/index.mjs +3939 -0
- package/dist/components/icons-and-geometry/index.mjs.map +1 -0
- package/dist/components/index.d.mts +83 -0
- package/dist/components/index.d.ts +83 -0
- package/dist/components/index.js +15471 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +15377 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/components/layout/index.d.mts +18 -0
- package/dist/components/layout/index.d.ts +18 -0
- package/dist/components/layout/index.js +3111 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/index.mjs +3064 -0
- package/dist/components/layout/index.mjs.map +1 -0
- package/dist/components/loading-states/index.d.mts +12 -0
- package/dist/components/loading-states/index.d.ts +12 -0
- package/dist/components/loading-states/index.js +614 -0
- package/dist/components/loading-states/index.js.map +1 -0
- package/dist/components/loading-states/index.mjs +573 -0
- package/dist/components/loading-states/index.mjs.map +1 -0
- package/dist/components/navigation/index.d.mts +9 -0
- package/dist/components/navigation/index.d.ts +9 -0
- package/dist/components/navigation/index.js +4660 -0
- package/dist/components/navigation/index.js.map +1 -0
- package/dist/components/navigation/index.mjs +4648 -0
- package/dist/components/navigation/index.mjs.map +1 -0
- package/dist/components/properties/index.d.mts +12 -0
- package/dist/components/properties/index.d.ts +12 -0
- package/dist/components/properties/index.js +2983 -0
- package/dist/components/properties/index.js.map +1 -0
- package/dist/components/properties/index.mjs +2951 -0
- package/dist/components/properties/index.mjs.map +1 -0
- package/dist/components/table/index.d.mts +10 -0
- package/dist/components/table/index.d.ts +10 -0
- package/dist/components/table/index.js +2329 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/index.mjs +2293 -0
- package/dist/components/table/index.mjs.map +1 -0
- package/dist/components/user-action/index.d.mts +30 -0
- package/dist/components/user-action/index.d.ts +30 -0
- package/dist/components/user-action/index.js +4257 -0
- package/dist/components/user-action/index.js.map +1 -0
- package/dist/components/user-action/index.mjs +4195 -0
- package/dist/components/user-action/index.mjs.map +1 -0
- package/dist/components/user-action/input/index.d.mts +6 -0
- package/dist/components/user-action/input/index.d.ts +6 -0
- package/dist/components/user-action/input/index.js +398 -0
- package/dist/components/user-action/input/index.js.map +1 -0
- package/dist/components/user-action/input/index.mjs +357 -0
- package/dist/components/user-action/input/index.mjs.map +1 -0
- package/dist/components/user-action/select/index.d.mts +4 -0
- package/dist/components/user-action/select/index.d.ts +4 -0
- package/dist/components/user-action/select/index.js +1369 -0
- package/dist/components/user-action/select/index.js.map +1 -0
- package/dist/components/user-action/select/index.mjs +1333 -0
- package/dist/components/user-action/select/index.mjs.map +1 -0
- package/dist/components/utils/index.d.mts +4 -0
- package/dist/components/utils/index.d.ts +4 -0
- package/dist/components/utils/index.js +302 -0
- package/dist/components/utils/index.js.map +1 -0
- package/dist/components/utils/index.mjs +275 -0
- package/dist/components/utils/index.mjs.map +1 -0
- package/dist/hooks/focus/index.d.mts +6 -0
- package/dist/hooks/focus/index.d.ts +6 -0
- package/dist/hooks/focus/index.js +379 -0
- package/dist/hooks/focus/index.js.map +1 -0
- package/dist/hooks/focus/index.mjs +339 -0
- package/dist/hooks/focus/index.mjs.map +1 -0
- package/dist/hooks/index.d.mts +16 -0
- package/dist/hooks/index.d.ts +16 -0
- package/dist/hooks/index.js +844 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +794 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +110 -0
- package/dist/index.d.ts +110 -0
- package/dist/index.js +16101 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +15941 -0
- package/dist/index.mjs.map +1 -0
- package/dist/localization/defaults/index.d.mts +4 -0
- package/dist/localization/defaults/index.d.ts +4 -0
- package/dist/localization/defaults/index.js +223 -0
- package/dist/localization/defaults/index.js.map +1 -0
- package/dist/localization/defaults/index.mjs +195 -0
- package/dist/localization/defaults/index.mjs.map +1 -0
- package/dist/localization/index.d.mts +7 -0
- package/dist/localization/index.d.ts +7 -0
- package/dist/localization/index.js +415 -0
- package/dist/localization/index.js.map +1 -0
- package/dist/localization/index.mjs +380 -0
- package/dist/localization/index.mjs.map +1 -0
- package/dist/theming/index.d.mts +5 -0
- package/dist/theming/index.d.ts +5 -0
- package/dist/theming/index.js +174 -0
- package/dist/theming/index.js.map +1 -0
- package/dist/theming/index.mjs +145 -0
- package/dist/theming/index.mjs.map +1 -0
- package/dist/utils/index.d.mts +15 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.js +553 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +493 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +25 -24
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/hooks/focus/index.ts
|
|
30
|
+
var focus_exports = {};
|
|
31
|
+
__export(focus_exports, {
|
|
32
|
+
useFocusGuards: () => useFocusGuards,
|
|
33
|
+
useFocusManagement: () => useFocusManagement,
|
|
34
|
+
useFocusOnceVisible: () => useFocusOnceVisible,
|
|
35
|
+
useFocusTrap: () => useFocusTrap,
|
|
36
|
+
useIsMounted: () => useIsMounted
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(focus_exports);
|
|
39
|
+
|
|
40
|
+
// src/hooks/focus/useFocusGuards.ts
|
|
41
|
+
var import_react = require("react");
|
|
42
|
+
var selectorName = "data-hw-focus-guard";
|
|
43
|
+
function FocusGuard() {
|
|
44
|
+
const element = document.createElement("div");
|
|
45
|
+
element.setAttribute(selectorName, "");
|
|
46
|
+
element.tabIndex = 0;
|
|
47
|
+
element.style.border = "none";
|
|
48
|
+
element.style.outline = "none";
|
|
49
|
+
element.style.boxShadow = "none";
|
|
50
|
+
element.style.opacity = "0";
|
|
51
|
+
element.style.position = "fixed";
|
|
52
|
+
element.style.pointerEvents = "none";
|
|
53
|
+
return element;
|
|
54
|
+
}
|
|
55
|
+
var FocusGuardsService = class _FocusGuardsService {
|
|
56
|
+
constructor() {
|
|
57
|
+
this.count = 0;
|
|
58
|
+
}
|
|
59
|
+
static getInstance() {
|
|
60
|
+
if (!_FocusGuardsService.instance) {
|
|
61
|
+
_FocusGuardsService.instance = new _FocusGuardsService();
|
|
62
|
+
}
|
|
63
|
+
return _FocusGuardsService.instance;
|
|
64
|
+
}
|
|
65
|
+
add() {
|
|
66
|
+
const edgeGuards = document.querySelectorAll(`[${selectorName}]`);
|
|
67
|
+
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? FocusGuard());
|
|
68
|
+
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? FocusGuard());
|
|
69
|
+
this.count++;
|
|
70
|
+
}
|
|
71
|
+
remove() {
|
|
72
|
+
if (this.count === 1) {
|
|
73
|
+
document.querySelectorAll(`[${selectorName}]`).forEach((node) => node.remove());
|
|
74
|
+
}
|
|
75
|
+
this.count--;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var useFocusGuards = () => {
|
|
79
|
+
(0, import_react.useEffect)(() => {
|
|
80
|
+
FocusGuardsService.getInstance().add();
|
|
81
|
+
return () => {
|
|
82
|
+
FocusGuardsService.getInstance().remove();
|
|
83
|
+
};
|
|
84
|
+
}, []);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// src/hooks/focus/useFocusManagement.ts
|
|
88
|
+
var import_react2 = require("react");
|
|
89
|
+
function useFocusManagement() {
|
|
90
|
+
const getFocusableElements = (0, import_react2.useCallback)(() => {
|
|
91
|
+
return Array.from(
|
|
92
|
+
document.querySelectorAll(
|
|
93
|
+
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
94
|
+
)
|
|
95
|
+
).filter(
|
|
96
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
97
|
+
);
|
|
98
|
+
}, []);
|
|
99
|
+
const getNextFocusElement = (0, import_react2.useCallback)(() => {
|
|
100
|
+
const elements = getFocusableElements();
|
|
101
|
+
if (elements.length === 0) {
|
|
102
|
+
return void 0;
|
|
103
|
+
}
|
|
104
|
+
let nextElement = elements[0];
|
|
105
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
106
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
107
|
+
nextElement = elements[(currentIndex + 1) % elements.length];
|
|
108
|
+
}
|
|
109
|
+
return nextElement;
|
|
110
|
+
}, [getFocusableElements]);
|
|
111
|
+
const focusNext = (0, import_react2.useCallback)(() => {
|
|
112
|
+
const nextElement = getNextFocusElement();
|
|
113
|
+
nextElement?.focus();
|
|
114
|
+
}, [getNextFocusElement]);
|
|
115
|
+
const getPreviousFocusElement = (0, import_react2.useCallback)(() => {
|
|
116
|
+
const elements = getFocusableElements();
|
|
117
|
+
if (elements.length === 0) {
|
|
118
|
+
return void 0;
|
|
119
|
+
}
|
|
120
|
+
let previousElement = elements[0];
|
|
121
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
122
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
123
|
+
if (currentIndex === 0) {
|
|
124
|
+
previousElement = elements[elements.length - 1];
|
|
125
|
+
} else {
|
|
126
|
+
previousElement = elements[currentIndex - 1];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return previousElement;
|
|
130
|
+
}, [getFocusableElements]);
|
|
131
|
+
const focusPrevious = (0, import_react2.useCallback)(() => {
|
|
132
|
+
const previousElement = getPreviousFocusElement();
|
|
133
|
+
if (previousElement) previousElement.focus();
|
|
134
|
+
}, [getPreviousFocusElement]);
|
|
135
|
+
return {
|
|
136
|
+
getFocusableElements,
|
|
137
|
+
getNextFocusElement,
|
|
138
|
+
getPreviousFocusElement,
|
|
139
|
+
focusNext,
|
|
140
|
+
focusPrevious
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// src/hooks/focus/useFocusOnceVisible.ts
|
|
145
|
+
var import_react3 = __toESM(require("react"));
|
|
146
|
+
var useFocusOnceVisible = (ref, disable = false) => {
|
|
147
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react3.default.useState(false);
|
|
148
|
+
(0, import_react3.useEffect)(() => {
|
|
149
|
+
if (disable || hasUsedFocus) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
153
|
+
if (entry.isIntersecting && !hasUsedFocus) {
|
|
154
|
+
ref.current?.focus();
|
|
155
|
+
setHasUsedFocus(hasUsedFocus);
|
|
156
|
+
}
|
|
157
|
+
}, {
|
|
158
|
+
threshold: 0.1
|
|
159
|
+
});
|
|
160
|
+
if (ref.current) {
|
|
161
|
+
observer.observe(ref.current);
|
|
162
|
+
}
|
|
163
|
+
return () => observer.disconnect();
|
|
164
|
+
}, [disable, hasUsedFocus, ref]);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// src/hooks/focus/useFocusTrap.ts
|
|
168
|
+
var import_react5 = require("react");
|
|
169
|
+
|
|
170
|
+
// src/hooks/focus/useIsMounted.ts
|
|
171
|
+
var import_react4 = require("react");
|
|
172
|
+
var isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
173
|
+
var useIsomorphicEffect = isClient ? import_react4.useLayoutEffect : import_react4.useEffect;
|
|
174
|
+
var useIsMounted = () => {
|
|
175
|
+
const [isMounted, setIsMounted] = (0, import_react4.useState)(false);
|
|
176
|
+
useIsomorphicEffect(() => {
|
|
177
|
+
setIsMounted(true);
|
|
178
|
+
return () => {
|
|
179
|
+
setIsMounted(false);
|
|
180
|
+
};
|
|
181
|
+
}, []);
|
|
182
|
+
return isMounted;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// src/hooks/focus/useFocusTrap.ts
|
|
186
|
+
var createFocusGuard = () => {
|
|
187
|
+
const div = document.createElement("div");
|
|
188
|
+
Object.assign(div.style, {
|
|
189
|
+
opacity: "0",
|
|
190
|
+
outline: "none",
|
|
191
|
+
boxShadow: "none",
|
|
192
|
+
position: "fixed",
|
|
193
|
+
pointerEvents: "none",
|
|
194
|
+
touchAction: "none"
|
|
195
|
+
});
|
|
196
|
+
div.tabIndex = 0;
|
|
197
|
+
div.setAttribute("data-hw-focus-guard", "");
|
|
198
|
+
document.body.appendChild(div);
|
|
199
|
+
return div;
|
|
200
|
+
};
|
|
201
|
+
function getContainedFocusableElements(element) {
|
|
202
|
+
return element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
203
|
+
}
|
|
204
|
+
var FocusTrapService = class {
|
|
205
|
+
constructor() {
|
|
206
|
+
// The last entry is always the active one
|
|
207
|
+
this.listeners = [];
|
|
208
|
+
this.onFocusIn = (event) => {
|
|
209
|
+
const active = this.getActive();
|
|
210
|
+
if (!active || !active.container.current) return;
|
|
211
|
+
const { container } = active;
|
|
212
|
+
if (!container.current.contains(event.target)) {
|
|
213
|
+
this.focusElement();
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
getActive() {
|
|
218
|
+
if (this.listeners.length === 0) return void 0;
|
|
219
|
+
return this.listeners[this.listeners.length - 1];
|
|
220
|
+
}
|
|
221
|
+
focusElement() {
|
|
222
|
+
const active = this.getActive();
|
|
223
|
+
if (!active) return;
|
|
224
|
+
const { container, initialFocusElement } = active;
|
|
225
|
+
const containerElement = container.current;
|
|
226
|
+
if (initialFocusElement?.current) {
|
|
227
|
+
initialFocusElement.current.focus();
|
|
228
|
+
} else {
|
|
229
|
+
const elements = getContainedFocusableElements(containerElement);
|
|
230
|
+
if (elements && elements.length > 0) {
|
|
231
|
+
const first = elements.item(0);
|
|
232
|
+
first.focus();
|
|
233
|
+
} else {
|
|
234
|
+
containerElement.focus();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
removeGuards() {
|
|
239
|
+
document.querySelectorAll("[data-hw-focus-guard]").forEach((node) => node.remove());
|
|
240
|
+
}
|
|
241
|
+
addGuards() {
|
|
242
|
+
document.body.insertAdjacentElement("afterbegin", createFocusGuard());
|
|
243
|
+
document.body.insertAdjacentElement("beforeend", createFocusGuard());
|
|
244
|
+
}
|
|
245
|
+
activate() {
|
|
246
|
+
document.addEventListener("focusin", this.onFocusIn);
|
|
247
|
+
this.addGuards();
|
|
248
|
+
}
|
|
249
|
+
deactivate() {
|
|
250
|
+
document.removeEventListener("focusin", this.onFocusIn);
|
|
251
|
+
this.removeGuards();
|
|
252
|
+
}
|
|
253
|
+
register(listener) {
|
|
254
|
+
this.listeners.push(listener);
|
|
255
|
+
if (this.listeners.length === 1) {
|
|
256
|
+
this.activate();
|
|
257
|
+
}
|
|
258
|
+
const active = listener;
|
|
259
|
+
this.listeners.forEach((listener2) => {
|
|
260
|
+
const { focus, pause } = listener2;
|
|
261
|
+
if (listener2 === active) {
|
|
262
|
+
focus();
|
|
263
|
+
} else {
|
|
264
|
+
pause();
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
unregister(id) {
|
|
269
|
+
const index = this.listeners.findIndex((trap) => trap.id === id);
|
|
270
|
+
if (index !== -1) {
|
|
271
|
+
const isActive = index === this.listeners.length - 1;
|
|
272
|
+
const listener = this.listeners[index];
|
|
273
|
+
this.listeners = this.listeners.filter((listener2) => listener2.id !== id);
|
|
274
|
+
if (isActive) {
|
|
275
|
+
this.deactivate();
|
|
276
|
+
listener.focusLast();
|
|
277
|
+
const active = this.getActive();
|
|
278
|
+
this.listeners.forEach((listener2) => {
|
|
279
|
+
const { pause, unpause } = listener2;
|
|
280
|
+
if (listener2 === active) {
|
|
281
|
+
unpause();
|
|
282
|
+
} else {
|
|
283
|
+
pause();
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
if (this.listeners.length > 0) {
|
|
287
|
+
this.activate();
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
} else {
|
|
291
|
+
console.warn(`Unable to unregister id ${id}: not found`);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
var service = new FocusTrapService();
|
|
296
|
+
var useFocusTrap = ({
|
|
297
|
+
container,
|
|
298
|
+
active = true,
|
|
299
|
+
initialFocus,
|
|
300
|
+
focusFirst = true
|
|
301
|
+
}) => {
|
|
302
|
+
const lastFocusRef = (0, import_react5.useRef)(null);
|
|
303
|
+
const [paused, setPaused] = (0, import_react5.useState)(false);
|
|
304
|
+
const isMounted = useIsMounted();
|
|
305
|
+
const id = (0, import_react5.useId)();
|
|
306
|
+
const focusElement = (0, import_react5.useCallback)(() => {
|
|
307
|
+
const containerElement = container.current;
|
|
308
|
+
if (initialFocus?.current) {
|
|
309
|
+
initialFocus.current.focus();
|
|
310
|
+
} else {
|
|
311
|
+
const elements = getContainedFocusableElements(containerElement);
|
|
312
|
+
if (elements && elements.length > 0) {
|
|
313
|
+
const first = elements.item(0);
|
|
314
|
+
first.focus();
|
|
315
|
+
} else {
|
|
316
|
+
containerElement.focus();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}, [container, initialFocus]);
|
|
320
|
+
(0, import_react5.useEffect)(() => {
|
|
321
|
+
if (active && isMounted) {
|
|
322
|
+
let pause = function() {
|
|
323
|
+
setPaused(true);
|
|
324
|
+
}, unpause = function() {
|
|
325
|
+
setPaused(false);
|
|
326
|
+
if (!container.current.contains(document.activeElement)) {
|
|
327
|
+
focusElement();
|
|
328
|
+
}
|
|
329
|
+
}, focus = function() {
|
|
330
|
+
focusElement();
|
|
331
|
+
setPaused(false);
|
|
332
|
+
}, focusLast = function() {
|
|
333
|
+
lastFocusRef.current?.focus();
|
|
334
|
+
};
|
|
335
|
+
if (!lastFocusRef.current) {
|
|
336
|
+
lastFocusRef.current = document.activeElement;
|
|
337
|
+
}
|
|
338
|
+
service.register({ id, pause, focus, focusLast, unpause, container, initialFocusElement: initialFocus });
|
|
339
|
+
return () => {
|
|
340
|
+
service.unregister(id);
|
|
341
|
+
lastFocusRef.current = void 0;
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
}, [active, container, focusElement, id, initialFocus, isMounted]);
|
|
345
|
+
(0, import_react5.useEffect)(() => {
|
|
346
|
+
if (active && !paused && isMounted) {
|
|
347
|
+
let onKeyDown = function(event) {
|
|
348
|
+
const key = event.key;
|
|
349
|
+
const elements = getContainedFocusableElements(containerElement);
|
|
350
|
+
const active2 = document.activeElement;
|
|
351
|
+
const index = [...elements].findIndex((value) => value === active2);
|
|
352
|
+
if (index === -1 || event.altKey || event.ctrlKey || event.metaKey) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
if (key === "Tab") {
|
|
356
|
+
const next = event.shiftKey ? -1 : 1;
|
|
357
|
+
const nextIndex = (index + next + elements.length) % elements.length;
|
|
358
|
+
const nextElement = elements[nextIndex];
|
|
359
|
+
nextElement.focus();
|
|
360
|
+
event.preventDefault();
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
const containerElement = container.current;
|
|
364
|
+
containerElement.addEventListener("keydown", onKeyDown);
|
|
365
|
+
return () => {
|
|
366
|
+
containerElement.removeEventListener("keydown", onKeyDown);
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
}, [active, paused, isMounted, container, initialFocus, focusFirst, focusElement]);
|
|
370
|
+
};
|
|
371
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
372
|
+
0 && (module.exports = {
|
|
373
|
+
useFocusGuards,
|
|
374
|
+
useFocusManagement,
|
|
375
|
+
useFocusOnceVisible,
|
|
376
|
+
useFocusTrap,
|
|
377
|
+
useIsMounted
|
|
378
|
+
});
|
|
379
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/focus/index.ts","../../../src/hooks/focus/useFocusGuards.ts","../../../src/hooks/focus/useFocusManagement.ts","../../../src/hooks/focus/useFocusOnceVisible.ts","../../../src/hooks/focus/useFocusTrap.ts","../../../src/hooks/focus/useIsMounted.ts"],"sourcesContent":["export * from './useFocusGuards'\nexport * from './useFocusManagement'\nexport * from './useFocusOnceVisible'\nexport * from './useFocusTrap'\nexport * from './useIsMounted'\n","import { useEffect } from 'react'\n\nconst selectorName = 'data-hw-focus-guard'\n\nfunction FocusGuard() {\n const element = document.createElement('div')\n element.setAttribute(selectorName, '')\n element.tabIndex = 0\n element.style.border = 'none'\n element.style.outline = 'none'\n element.style.boxShadow = 'none'\n element.style.opacity = '0'\n element.style.position = 'fixed'\n element.style.pointerEvents = 'none'\n return element\n}\n\nclass FocusGuardsService {\n private count: number = 0\n\n private static instance: FocusGuardsService\n\n private constructor() {}\n\n static getInstance(): FocusGuardsService {\n if (!FocusGuardsService.instance) {\n FocusGuardsService.instance = new FocusGuardsService()\n }\n return FocusGuardsService.instance\n }\n\n add() {\n const edgeGuards = document.querySelectorAll(`[${selectorName}]`)\n document.body.insertAdjacentElement('afterbegin', edgeGuards[0] ?? FocusGuard())\n document.body.insertAdjacentElement('beforeend', edgeGuards[1] ?? FocusGuard())\n this.count++\n }\n\n remove() {\n if (this.count === 1) {\n document.querySelectorAll(`[${selectorName}]`)\n .forEach((node) => node.remove())\n }\n this.count--\n }\n}\n\nexport const useFocusGuards = () => {\n useEffect(() => {\n FocusGuardsService.getInstance().add()\n return () => {\n FocusGuardsService.getInstance().remove()\n }\n }, [])\n}","import { useCallback } from 'react'\n\nexport function useFocusManagement() {\n const getFocusableElements = useCallback((): HTMLElement[] => {\n return Array.from(\n document.querySelectorAll(\n 'input, button, select, textarea, a[href], [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter(\n (el): el is HTMLElement =>\n el instanceof HTMLElement &&\n !el.hasAttribute('disabled') &&\n !el.hasAttribute('hidden') &&\n el.tabIndex !== -1\n )\n }, [])\n\n const getNextFocusElement = useCallback((): HTMLElement | undefined => {\n const elements = getFocusableElements()\n if(elements.length === 0) {\n return undefined\n }\n let nextElement = elements[0]\n if(document.activeElement instanceof HTMLElement) {\n const currentIndex = elements.indexOf(document.activeElement)\n nextElement = elements[(currentIndex + 1) % elements.length]\n }\n return nextElement\n }, [getFocusableElements])\n\n const focusNext = useCallback(() => {\n const nextElement = getNextFocusElement()\n nextElement?.focus()\n }, [getNextFocusElement])\n\n const getPreviousFocusElement = useCallback((): HTMLElement | undefined => {\n const elements = getFocusableElements()\n if(elements.length === 0) {\n return undefined\n }\n let previousElement = elements[0]\n if(document.activeElement instanceof HTMLElement) {\n const currentIndex = elements.indexOf(document.activeElement)\n if(currentIndex === 0) {\n previousElement = elements[elements.length - 1]\n } else {\n previousElement = elements[currentIndex - 1]\n }\n }\n return previousElement\n }, [getFocusableElements])\n\n const focusPrevious = useCallback(() => {\n const previousElement = getPreviousFocusElement()\n if (previousElement) previousElement.focus()\n }, [getPreviousFocusElement])\n\n return {\n getFocusableElements,\n getNextFocusElement,\n getPreviousFocusElement,\n focusNext,\n focusPrevious,\n }\n}","import type { MutableRefObject } from 'react'\nimport React, { useEffect } from 'react'\n\nexport const useFocusOnceVisible = (\n ref: MutableRefObject<HTMLElement>,\n disable: boolean = false\n) => {\n const [hasUsedFocus, setHasUsedFocus] = React.useState(false)\n\n useEffect(() => {\n if (disable || hasUsedFocus) {\n return\n }\n const observer = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting && !hasUsedFocus) {\n ref.current?.focus()\n setHasUsedFocus(hasUsedFocus)\n }\n }, {\n threshold: 0.1,\n })\n\n if (ref.current) {\n observer.observe(ref.current)\n }\n\n return () => observer.disconnect()\n }, [disable, hasUsedFocus, ref])\n}","'use client'\n\nimport type { MutableRefObject } from 'react'\nimport { useCallback, useEffect, useId, useRef, useState } from 'react'\nimport { useIsMounted } from '@/src/hooks/focus/useIsMounted'\n\nconst createFocusGuard = () => {\n const div = document.createElement('div')\n Object.assign(div.style, {\n opacity: '0',\n outline: 'none',\n boxShadow: 'none',\n position: 'fixed',\n pointerEvents: 'none',\n touchAction: 'none',\n })\n div.tabIndex = 0\n div.setAttribute('data-hw-focus-guard', '')\n document.body.appendChild(div)\n return div\n}\n\nfunction getContainedFocusableElements(element: HTMLElement) {\n return element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])')\n}\n\ntype ListenerType = {\n id: string,\n pause: () => void,\n unpause: () => void,\n focus: () => void,\n focusLast: () => void,\n container: MutableRefObject<HTMLElement>,\n initialFocusElement: MutableRefObject<HTMLElement>,\n}\n\nclass FocusTrapService {\n // The last entry is always the active one\n private listeners: ListenerType[] = []\n\n public getActive(): ListenerType | undefined {\n if (this.listeners.length === 0) return undefined\n return this.listeners[this.listeners.length - 1]\n }\n\n private focusElement() {\n const active = this.getActive()\n if(!active) return\n const { container, initialFocusElement } = active\n const containerElement = container.current\n // Try in the following order\n // 1. Focus the initial element\n // 2. Focus the first focusable element in the container\n // 3. Focus the container\n if (initialFocusElement?.current) {\n initialFocusElement.current.focus()\n } else {\n const elements = getContainedFocusableElements(containerElement)\n if (elements && elements.length > 0) {\n const first = elements.item(0) as HTMLElement\n first.focus()\n } else {\n containerElement.focus()\n }\n }\n }\n\n private onFocusIn = (event: FocusEvent) => {\n const active = this.getActive()\n if(!active || !active.container.current) return\n const { container } = active\n if (!container.current.contains(event.target as HTMLElement)) {\n this.focusElement()\n }\n }\n\n private removeGuards() {\n document.querySelectorAll('[data-hw-focus-guard]').forEach((node) => node.remove())\n }\n\n private addGuards() {\n document.body.insertAdjacentElement('afterbegin', createFocusGuard())\n document.body.insertAdjacentElement('beforeend', createFocusGuard())\n }\n\n private activate() {\n document.addEventListener('focusin', this.onFocusIn)\n this.addGuards()\n }\n\n private deactivate() {\n document.removeEventListener('focusin', this.onFocusIn)\n this.removeGuards()\n }\n\n register(listener: ListenerType) {\n this.listeners.push(listener)\n if (this.listeners.length === 1) {\n this.activate()\n }\n const active = listener\n this.listeners.forEach((listener) => {\n const { focus, pause } = listener\n if (listener === active) {\n focus()\n } else {\n pause()\n }\n })\n }\n\n unregister(id: string) {\n const index = this.listeners.findIndex(trap => trap.id === id)\n if (index !== -1) {\n const isActive = index === this.listeners.length - 1\n const listener = this.listeners[index]\n this.listeners = this.listeners.filter(listener => listener.id !== id)\n if (isActive) {\n // Deactivate all focus traps\n this.deactivate()\n // Focus last element in previous focus context\n listener.focusLast()\n // Activate and pause remaining focus traps\n const active = this.getActive()\n this.listeners.forEach((listener) => {\n const { pause, unpause } = listener\n if (listener === active) {\n unpause()\n } else {\n pause()\n }\n })\n // Reactivate\n if (this.listeners.length > 0) {\n this.activate()\n }\n }\n } else {\n console.warn(`Unable to unregister id ${id}: not found`)\n }\n }\n}\n\nconst service = new FocusTrapService()\n\nexport type UseFocusTrapProps = {\n container: MutableRefObject<HTMLElement>,\n active?: boolean,\n initialFocus?: MutableRefObject<HTMLElement>,\n /**\n * Whether to focus the first element when the initialFocus isn't provided\n *\n * Focuses the container instead\n */\n focusFirst?: boolean,\n}\n\nexport const useFocusTrap = ({\n container,\n active = true,\n initialFocus,\n focusFirst = true,\n }: UseFocusTrapProps) => {\n const lastFocusRef = useRef<HTMLElement | null>(null)\n const [paused, setPaused] = useState(false)\n const isMounted = useIsMounted()\n const id = useId()\n\n const focusElement = useCallback(() => {\n const containerElement = container.current\n // Try in the following order\n // 1. Focus the initial element\n // 2. Focus the first focusable element in the container\n // 3. Focus the container\n if (initialFocus?.current) {\n initialFocus.current.focus()\n } else {\n const elements = getContainedFocusableElements(containerElement)\n if (elements && elements.length > 0) {\n const first = elements.item(0) as HTMLElement\n first.focus()\n } else {\n containerElement.focus()\n }\n }\n }, [container, initialFocus])\n\n useEffect(() => {\n if (active && isMounted) {\n if (!lastFocusRef.current) {\n lastFocusRef.current = document.activeElement as HTMLElement\n }\n\n function pause() {\n setPaused(true)\n }\n\n function unpause() {\n setPaused(false)\n if (!container.current.contains(document.activeElement as HTMLElement)) {\n focusElement()\n }\n }\n\n function focus() {\n focusElement()\n setPaused(false)\n }\n\n function focusLast() {\n lastFocusRef.current?.focus()\n }\n\n service.register({ id, pause, focus, focusLast, unpause, container, initialFocusElement: initialFocus })\n return () => {\n service.unregister(id)\n lastFocusRef.current = undefined\n }\n }\n }, [active, container, focusElement, id, initialFocus, isMounted])\n\n useEffect(() => {\n if (active && !paused && isMounted) {\n const containerElement = container.current\n\n function onKeyDown(event: KeyboardEvent) {\n const key = event.key\n const elements = getContainedFocusableElements(containerElement)\n const active = document.activeElement as HTMLElement\n const index = [...elements].findIndex(value => value === active)\n if (index === -1 || event.altKey || event.ctrlKey || event.metaKey) {\n return\n }\n if (key === 'Tab') {\n const next = event.shiftKey ? -1 : 1\n const nextIndex = (index + next + elements.length) % elements.length\n const nextElement = elements[nextIndex] as HTMLElement\n nextElement.focus()\n event.preventDefault()\n }\n }\n\n // Register and unregister the listeners\n containerElement.addEventListener('keydown', onKeyDown)\n return () => {\n containerElement.removeEventListener('keydown', onKeyDown)\n }\n }\n }, [active, paused, isMounted, container, initialFocus, focusFirst, focusElement])\n}","'use client'\n\nimport { useEffect, useLayoutEffect, useState } from 'react'\n\nconst isClient = typeof window !== 'undefined' && typeof document !== 'undefined'\nconst useIsomorphicEffect = isClient ? useLayoutEffect : useEffect\n\nexport const useIsMounted = () => {\n const [isMounted, setIsMounted] = useState(false)\n\n useIsomorphicEffect(() => {\n setIsMounted(true)\n return () => {\n setIsMounted(false)\n }\n }, [])\n return isMounted\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA0B;AAE1B,IAAM,eAAe;AAErB,SAAS,aAAa;AACpB,QAAM,UAAU,SAAS,cAAc,KAAK;AAC5C,UAAQ,aAAa,cAAc,EAAE;AACrC,UAAQ,WAAW;AACnB,UAAQ,MAAM,SAAS;AACvB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,YAAY;AAC1B,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,WAAW;AACzB,UAAQ,MAAM,gBAAgB;AAC9B,SAAO;AACT;AAEA,IAAM,qBAAN,MAAM,oBAAmB;AAAA,EAKf,cAAc;AAJtB,SAAQ,QAAgB;AAAA,EAID;AAAA,EAEvB,OAAO,cAAkC;AACvC,QAAI,CAAC,oBAAmB,UAAU;AAChC,0BAAmB,WAAW,IAAI,oBAAmB;AAAA,IACvD;AACA,WAAO,oBAAmB;AAAA,EAC5B;AAAA,EAEA,MAAM;AACJ,UAAM,aAAa,SAAS,iBAAiB,IAAI,YAAY,GAAG;AAChE,aAAS,KAAK,sBAAsB,cAAc,WAAW,CAAC,KAAK,WAAW,CAAC;AAC/E,aAAS,KAAK,sBAAsB,aAAa,WAAW,CAAC,KAAK,WAAW,CAAC;AAC9E,SAAK;AAAA,EACP;AAAA,EAEA,SAAS;AACP,QAAI,KAAK,UAAU,GAAG;AACpB,eAAS,iBAAiB,IAAI,YAAY,GAAG,EAC1C,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC;AAAA,IACpC;AACA,SAAK;AAAA,EACP;AACF;AAEO,IAAM,iBAAiB,MAAM;AAClC,8BAAU,MAAM;AACd,uBAAmB,YAAY,EAAE,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