pixel-react 1.21.98 → 1.21.99
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/lib/components/AutoTruncateText/resizeObserverService.js +6 -4
- package/lib/components/AutoTruncateText/resizeObserverService.js.map +1 -1
- package/lib/components/HighlightText/HighlightText.d.ts +2 -2
- package/lib/components/HighlightText/HighlightText.js +137 -13
- package/lib/components/HighlightText/HighlightText.js.map +1 -1
- package/lib/components/HighlightText/index.d.ts +1 -0
- package/lib/components/HighlightText/types.d.ts +41 -0
- package/lib/components/Icon/iconList.js +10 -0
- package/lib/components/Icon/iconList.js.map +1 -1
- package/lib/components/TooltipService/TooltipService.js +201 -104
- package/lib/components/TooltipService/TooltipService.js.map +1 -1
- package/lib/hooks/useFocusTrap.d.ts +29 -0
- package/lib/hooks/useFocusTrap.js +97 -0
- package/lib/hooks/useFocusTrap.js.map +1 -0
- package/lib/hooks/useInteractiveAncestor.d.ts +7 -0
- package/lib/hooks/useInteractiveAncestor.js +18 -0
- package/lib/hooks/useInteractiveAncestor.js.map +1 -0
- package/lib/index.d.ts +43 -3
- package/lib/index.js +9 -9
- package/lib/index.js.map +1 -1
- package/lib/styles.css +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/a11y/a11y.d.ts +28 -0
- package/lib/utils/a11y/a11y.js +62 -0
- package/lib/utils/a11y/a11y.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import tippy, { hideAll } from 'tippy.js';
|
|
3
3
|
import 'tippy.js/dist/tippy.css';
|
|
4
4
|
import './TooltipService.scss';
|
|
5
|
+
const TOOLTIP_TARGET = '[data-tooltip], [data-tooltip-id], [data-tooltip-overflow]';
|
|
5
6
|
const VALID_PLACEMENTS = new Set([
|
|
6
7
|
'auto',
|
|
7
8
|
'auto-start',
|
|
@@ -19,6 +20,30 @@ const VALID_PLACEMENTS = new Set([
|
|
|
19
20
|
'left-start',
|
|
20
21
|
'left-end',
|
|
21
22
|
]);
|
|
23
|
+
const TOOLTIP_PROPS = {
|
|
24
|
+
arrow: false,
|
|
25
|
+
theme: 'ff-global-tooltip',
|
|
26
|
+
appendTo: () => document.body,
|
|
27
|
+
allowHTML: true,
|
|
28
|
+
popperOptions: {
|
|
29
|
+
modifiers: [
|
|
30
|
+
{
|
|
31
|
+
name: 'preventOverflow',
|
|
32
|
+
options: {
|
|
33
|
+
altAxis: true,
|
|
34
|
+
padding: 8,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'flip',
|
|
39
|
+
options: {
|
|
40
|
+
padding: 8,
|
|
41
|
+
fallbackPlacements: ['top', 'right', 'left'],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
22
47
|
const getTooltipContent = (reference) => {
|
|
23
48
|
const contentNode = document.createElement('div');
|
|
24
49
|
// Accept template content via id
|
|
@@ -45,7 +70,12 @@ const getTooltipContent = (reference) => {
|
|
|
45
70
|
return contentNode;
|
|
46
71
|
}
|
|
47
72
|
}
|
|
48
|
-
|
|
73
|
+
// An overflow-only element without its own text shows the text it cuts off
|
|
74
|
+
const rawText = reference.getAttribute('data-tooltip') ||
|
|
75
|
+
(reference.hasAttribute('data-tooltip-overflow')
|
|
76
|
+
? reference.textContent
|
|
77
|
+
: '') ||
|
|
78
|
+
'';
|
|
49
79
|
if (!rawText.trim())
|
|
50
80
|
return '';
|
|
51
81
|
const text = rawText
|
|
@@ -79,118 +109,185 @@ const getTooltipContent = (reference) => {
|
|
|
79
109
|
}
|
|
80
110
|
return contentNode;
|
|
81
111
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
112
|
+
// One-line ellipsis cut-off, read only when the element is hovered
|
|
113
|
+
const isClipped = (element) => element.scrollWidth > element.clientWidth + 0.5;
|
|
114
|
+
// The innermost element with something to show. A `data-tooltip-overflow`
|
|
115
|
+
// element counts only while its text is cut off; otherwise the next one out is tried.
|
|
116
|
+
const findTooltipTarget = (start) => {
|
|
117
|
+
let element = start.closest(TOOLTIP_TARGET);
|
|
118
|
+
while (element) {
|
|
119
|
+
const overflowOnly = element.hasAttribute('data-tooltip-overflow');
|
|
120
|
+
if ((!overflowOnly || isClipped(element)) &&
|
|
121
|
+
getTooltipContent(element) !== '') {
|
|
122
|
+
return element;
|
|
123
|
+
}
|
|
124
|
+
element = element.parentElement?.closest(TOOLTIP_TARGET) ?? null;
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
// Tippy's own ARIA, except where it would be wrong: a hoverable tooltip is not
|
|
129
|
+
// interactive, so it still describes its element and sets no aria-expanded;
|
|
130
|
+
// and text shown only because an ellipsis cuts it off repeats what the element
|
|
131
|
+
// already says, so it is not added as a description
|
|
132
|
+
const getAria = (reference) => {
|
|
133
|
+
if (reference.hasAttribute('data-tooltip-interactive'))
|
|
134
|
+
return {};
|
|
135
|
+
const repeatsOwnText = reference.hasAttribute('data-tooltip-overflow') &&
|
|
136
|
+
!reference.hasAttribute('data-tooltip') &&
|
|
137
|
+
!reference.hasAttribute('data-tooltip-id');
|
|
138
|
+
if (!repeatsOwnText && !reference.hasAttribute('data-tooltip-hoverable')) {
|
|
139
|
+
return {};
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
aria: { expanded: false, content: repeatsOwnText ? null : 'describedby' },
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
const getPlacement = (reference) => {
|
|
146
|
+
// placement attribute for tooltip
|
|
147
|
+
const normalizedPlacement = reference
|
|
148
|
+
.getAttribute('data-tooltip-placement')
|
|
149
|
+
?.trim()
|
|
150
|
+
.toLowerCase();
|
|
151
|
+
return normalizedPlacement && VALID_PLACEMENTS.has(normalizedPlacement)
|
|
152
|
+
? normalizedPlacement
|
|
153
|
+
: 'bottom';
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Shows at most one tooltip at a time. The instance is created when its element
|
|
157
|
+
* is hovered or focused and destroyed when it hides, so nothing is kept for
|
|
158
|
+
* elements that were hovered and later removed (e.g. virtualized rows).
|
|
159
|
+
*/
|
|
160
|
+
const startTooltips = () => {
|
|
161
|
+
let active = null;
|
|
162
|
+
// Closed with Escape: stays hidden until the pointer or focus leaves it
|
|
163
|
+
let dismissed = null;
|
|
164
|
+
// While a tooltip shows: refresh it when its attributes change, and drop it
|
|
165
|
+
// when its element leaves the page
|
|
166
|
+
const activeObserver = new MutationObserver((records) => {
|
|
167
|
+
if (!active)
|
|
168
|
+
return;
|
|
169
|
+
if (!active.reference.isConnected) {
|
|
170
|
+
destroyActive();
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (records.some((record) => record.type === 'attributes')) {
|
|
174
|
+
const content = getTooltipContent(active.reference);
|
|
175
|
+
if (content === '') {
|
|
176
|
+
destroyActive();
|
|
88
177
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
content(reference) {
|
|
118
|
-
return getTooltipContent(reference);
|
|
119
|
-
},
|
|
120
|
-
onShow(tippyInstance) {
|
|
121
|
-
const { reference } = tippyInstance;
|
|
122
|
-
if (!document.body.contains(reference)) {
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
const latestContent = getTooltipContent(reference);
|
|
126
|
-
// If no tooltip content is currently available, prevent showing.
|
|
127
|
-
if (latestContent === '') {
|
|
178
|
+
else {
|
|
179
|
+
active.setContent(content);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
const destroyActive = () => {
|
|
184
|
+
activeObserver.disconnect();
|
|
185
|
+
active?.destroy();
|
|
186
|
+
active = null;
|
|
187
|
+
};
|
|
188
|
+
const show = (reference) => {
|
|
189
|
+
destroyActive();
|
|
190
|
+
// Another copy of this service (e.g. from a second bundle) already handles it
|
|
191
|
+
if (reference._tippy)
|
|
192
|
+
return;
|
|
193
|
+
active = tippy(reference, {
|
|
194
|
+
...TOOLTIP_PROPS,
|
|
195
|
+
content: getTooltipContent(reference),
|
|
196
|
+
placement: getPlacement(reference),
|
|
197
|
+
// This is specific tooltip attributefor interactive. A hoverable
|
|
198
|
+
// tooltip uses it only so the pointer can move onto it (WCAG 1.4.13).
|
|
199
|
+
interactive: reference.hasAttribute('data-tooltip-interactive') ||
|
|
200
|
+
reference.hasAttribute('data-tooltip-hoverable'),
|
|
201
|
+
...getAria(reference),
|
|
202
|
+
showOnCreate: true,
|
|
203
|
+
onShow(instance) {
|
|
204
|
+
if (!instance.reference.isConnected)
|
|
128
205
|
return false;
|
|
129
|
-
}
|
|
130
|
-
// This is specific tooltip attributefor interactive
|
|
131
|
-
const isInteractive = tippyInstance.reference.hasAttribute('data-tooltip-interactive');
|
|
132
|
-
// placement attribute for tooltip
|
|
133
|
-
const rawPlacement = tippyInstance.reference.getAttribute('data-tooltip-placement');
|
|
134
|
-
const normalizedPlacement = rawPlacement?.trim().toLowerCase();
|
|
135
|
-
const placement = normalizedPlacement && VALID_PLACEMENTS.has(normalizedPlacement)
|
|
136
|
-
? normalizedPlacement
|
|
137
|
-
: 'bottom';
|
|
138
|
-
tippyInstance.setProps({
|
|
139
|
-
interactive: isInteractive,
|
|
140
|
-
placement,
|
|
141
|
-
content: latestContent,
|
|
142
|
-
});
|
|
143
206
|
},
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
if (tippyInstance.state.isVisible) {
|
|
147
|
-
const newContent = getTooltipContent(tippyInstance.reference);
|
|
148
|
-
if (newContent === '') {
|
|
149
|
-
tippyInstance.hide();
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
tippyInstance.setContent(newContent);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
attrObserver.observe(tippyInstance.reference, {
|
|
157
|
-
attributes: true,
|
|
158
|
-
attributeFilter: ['data-tooltip', 'data-tooltip-id'],
|
|
159
|
-
});
|
|
160
|
-
tippyInstance._attrObserver = attrObserver;
|
|
161
|
-
const parentEl = tippyInstance.reference.parentElement;
|
|
162
|
-
if (parentEl) {
|
|
163
|
-
const domObserver = new MutationObserver(() => {
|
|
164
|
-
if (!document.body.contains(tippyInstance.reference)) {
|
|
165
|
-
tippyInstance.hide();
|
|
166
|
-
tippyInstance.destroy();
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
domObserver.observe(parentEl, { childList: true });
|
|
170
|
-
tippyInstance._domObserver = domObserver;
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
onDestroy(tippyInstance) {
|
|
174
|
-
tippyInstance._attrObserver?.disconnect();
|
|
175
|
-
tippyInstance._domObserver?.disconnect();
|
|
176
|
-
},
|
|
177
|
-
onMount(tippyInstance) {
|
|
178
|
-
const isExplicitlyInteractive = tippyInstance.reference.hasAttribute('data-tooltip-interactive');
|
|
207
|
+
onMount(instance) {
|
|
208
|
+
const isExplicitlyInteractive = instance.reference.hasAttribute('data-tooltip-interactive');
|
|
179
209
|
if (!isExplicitlyInteractive) {
|
|
180
|
-
const tippyBox =
|
|
210
|
+
const tippyBox = instance.popper.querySelector('.tippy-box');
|
|
181
211
|
if (tippyBox && tippyBox.scrollHeight > tippyBox.clientHeight) {
|
|
182
|
-
|
|
212
|
+
instance.setProps({ interactive: true });
|
|
183
213
|
}
|
|
184
214
|
}
|
|
185
215
|
},
|
|
216
|
+
onHidden(instance) {
|
|
217
|
+
if (instance === active) {
|
|
218
|
+
destroyActive();
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
instance.destroy();
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
activeObserver.observe(reference, {
|
|
226
|
+
attributes: true,
|
|
227
|
+
attributeFilter: ['data-tooltip', 'data-tooltip-id'],
|
|
186
228
|
});
|
|
229
|
+
activeObserver.observe(document.body, { childList: true, subtree: true });
|
|
230
|
+
};
|
|
231
|
+
const handlePointerOrFocus = (event) => {
|
|
232
|
+
const { target } = event;
|
|
233
|
+
if (!(target instanceof Element))
|
|
234
|
+
return;
|
|
235
|
+
// Moving into an interactive tooltip keeps it open
|
|
236
|
+
if (active?.popper.contains(target))
|
|
237
|
+
return;
|
|
238
|
+
if (dismissed && !dismissed.contains(target))
|
|
239
|
+
dismissed = null;
|
|
240
|
+
// Nothing new under the pointer: the shown tooltip hides itself on mouseleave
|
|
241
|
+
const closest = target.closest(TOOLTIP_TARGET);
|
|
242
|
+
if (!closest || closest === active?.reference)
|
|
243
|
+
return;
|
|
244
|
+
const reference = findTooltipTarget(closest);
|
|
245
|
+
if (reference &&
|
|
246
|
+
reference !== active?.reference &&
|
|
247
|
+
reference !== dismissed) {
|
|
248
|
+
show(reference);
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
// Escape hides the tooltip without moving the pointer or focus (WCAG 1.4.13)
|
|
252
|
+
const hideOnEscape = (event) => {
|
|
253
|
+
if (event.key !== 'Escape' || !active)
|
|
254
|
+
return;
|
|
255
|
+
dismissed = active.reference;
|
|
256
|
+
destroyActive();
|
|
257
|
+
};
|
|
258
|
+
const hideTooltipsOnScroll = (event) => {
|
|
259
|
+
const target = event.target;
|
|
260
|
+
if (target instanceof Element && target.closest('[data-tippy-root]')) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
hideAll({ duration: 0 });
|
|
264
|
+
destroyActive();
|
|
265
|
+
};
|
|
266
|
+
document.addEventListener('mouseover', handlePointerOrFocus);
|
|
267
|
+
document.addEventListener('focusin', handlePointerOrFocus);
|
|
268
|
+
document.addEventListener('keydown', hideOnEscape);
|
|
269
|
+
window.addEventListener('scroll', hideTooltipsOnScroll, true);
|
|
270
|
+
return () => {
|
|
271
|
+
document.removeEventListener('mouseover', handlePointerOrFocus);
|
|
272
|
+
document.removeEventListener('focusin', handlePointerOrFocus);
|
|
273
|
+
document.removeEventListener('keydown', hideOnEscape);
|
|
274
|
+
window.removeEventListener('scroll', hideTooltipsOnScroll, true);
|
|
275
|
+
destroyActive();
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
// Every mounted TooltipService shares one set of listeners
|
|
279
|
+
let mountedServices = 0;
|
|
280
|
+
let stopTooltips = null;
|
|
281
|
+
const TooltipService = () => {
|
|
282
|
+
useEffect(() => {
|
|
283
|
+
mountedServices += 1;
|
|
284
|
+
if (mountedServices === 1)
|
|
285
|
+
stopTooltips = startTooltips();
|
|
187
286
|
return () => {
|
|
188
|
-
|
|
189
|
-
if (
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
else {
|
|
193
|
-
instance.destroy();
|
|
287
|
+
mountedServices -= 1;
|
|
288
|
+
if (mountedServices === 0) {
|
|
289
|
+
stopTooltips?.();
|
|
290
|
+
stopTooltips = null;
|
|
194
291
|
}
|
|
195
292
|
};
|
|
196
293
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipService.js","sourceRoot":"","sources":["../../../src/components/TooltipService/TooltipService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TooltipService.js","sourceRoot":"","sources":["../../../src/components/TooltipService/TooltipService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,KAAK,EAAE,EAAE,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BAAoB,CAAC,CAAC;QAChE,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAC9D,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QACtD,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC;QACjE,aAAa,EAAE,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,2DAA2D;AAC3D,IAAI,eAAe,GAAG,CAAC,CAAC;AACxB,IAAI,YAAY,GAAwB,IAAI,CAAC;AAE7C,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,SAAS,CAAC,GAAG,EAAE;QACb,eAAe,IAAI,CAAC,CAAC;QACrB,IAAI,eAAe,KAAK,CAAC;YAAE,YAAY,GAAG,aAAa,EAAE,CAAC;QAE1D,OAAO,GAAG,EAAE;YACV,eAAe,IAAI,CAAC,CAAC;YACrB,IAAI,eAAe,KAAK,CAAC,EAAE,CAAC;gBAC1B,YAAY,EAAE,EAAE,CAAC;gBACjB,YAAY,GAAG,IAAI,CAAC;YACtB,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Remembers the element that had focus when `isOpen` became true, read during
|
|
4
|
+
* render — before children with autoFocus take focus — so it can be restored.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useOpenerElement: (isOpen: boolean) => import("react").MutableRefObject<HTMLElement | null>;
|
|
7
|
+
interface FocusTrapOptions {
|
|
8
|
+
active: boolean;
|
|
9
|
+
/** Element to focus on activation; defaults to the first focusable child. */
|
|
10
|
+
initialFocusRef?: RefObject<HTMLElement>;
|
|
11
|
+
/** Return focus to the element that was focused before activation. */
|
|
12
|
+
restoreFocus?: boolean;
|
|
13
|
+
/** Explicit element to return focus to (see useOpenerElement). */
|
|
14
|
+
returnFocusRef?: RefObject<HTMLElement | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Keep Tab/Shift+Tab inside the container (modal). When false, focus only
|
|
17
|
+
* moves in on activation and back out afterwards (non-modal panel).
|
|
18
|
+
*/
|
|
19
|
+
trapTab?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const isTopMostFocusTrap: (container: HTMLElement | null) => boolean;
|
|
22
|
+
export declare const getTopMostFocusTrap: () => HTMLElement | null;
|
|
23
|
+
/**
|
|
24
|
+
* Moves keyboard focus into a dialog when it opens, optionally keeps it there
|
|
25
|
+
* while it is modal, and restores it to the trigger afterwards — WCAG 2.4.3
|
|
26
|
+
* Focus Order and 2.1.2 No Keyboard Trap (focus is released on close).
|
|
27
|
+
*/
|
|
28
|
+
declare const useFocusTrap: (containerRef: RefObject<HTMLElement>, { active, initialFocusRef, restoreFocus, trapTab, returnFocusRef, }: FocusTrapOptions) => void;
|
|
29
|
+
export default useFocusTrap;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { getFocusableElements } from '../utils/a11y/a11y';
|
|
3
|
+
/**
|
|
4
|
+
* Remembers the element that had focus when `isOpen` became true, read during
|
|
5
|
+
* render — before children with autoFocus take focus — so it can be restored.
|
|
6
|
+
*/
|
|
7
|
+
export const useOpenerElement = (isOpen) => {
|
|
8
|
+
const openerRef = useRef(null);
|
|
9
|
+
const wasOpenRef = useRef(false);
|
|
10
|
+
if (isOpen && !wasOpenRef.current && typeof document !== 'undefined') {
|
|
11
|
+
const focused = document.activeElement;
|
|
12
|
+
openerRef.current =
|
|
13
|
+
focused instanceof HTMLElement && focused !== document.body
|
|
14
|
+
? focused
|
|
15
|
+
: null;
|
|
16
|
+
}
|
|
17
|
+
wasOpenRef.current = isOpen;
|
|
18
|
+
return openerRef;
|
|
19
|
+
};
|
|
20
|
+
// Traps are stacked so only the top-most dialog handles Tab and Escape.
|
|
21
|
+
const trapStack = [];
|
|
22
|
+
export const isTopMostFocusTrap = (container) => !!container && trapStack[trapStack.length - 1] === container;
|
|
23
|
+
export const getTopMostFocusTrap = () => trapStack[trapStack.length - 1] ?? null;
|
|
24
|
+
/**
|
|
25
|
+
* Moves keyboard focus into a dialog when it opens, optionally keeps it there
|
|
26
|
+
* while it is modal, and restores it to the trigger afterwards — WCAG 2.4.3
|
|
27
|
+
* Focus Order and 2.1.2 No Keyboard Trap (focus is released on close).
|
|
28
|
+
*/
|
|
29
|
+
const useFocusTrap = (containerRef, { active, initialFocusRef, restoreFocus = true, trapTab = true, returnFocusRef, }) => {
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const container = containerRef.current;
|
|
32
|
+
if (!active || !container)
|
|
33
|
+
return undefined;
|
|
34
|
+
const focusedNow = document.activeElement instanceof HTMLElement
|
|
35
|
+
? document.activeElement
|
|
36
|
+
: null;
|
|
37
|
+
// Prefer the opener captured at render; otherwise whatever had focus,
|
|
38
|
+
// unless that is already inside the container (e.g. an autoFocus field).
|
|
39
|
+
const previouslyFocused = returnFocusRef?.current ??
|
|
40
|
+
(focusedNow && !container.contains(focusedNow) ? focusedNow : null);
|
|
41
|
+
if (trapTab)
|
|
42
|
+
trapStack.push(container);
|
|
43
|
+
// Deferred so children using autoFocus win, and portal content is laid out.
|
|
44
|
+
const frame = requestAnimationFrame(() => {
|
|
45
|
+
if (container.contains(document.activeElement))
|
|
46
|
+
return;
|
|
47
|
+
const target = initialFocusRef?.current ??
|
|
48
|
+
getFocusableElements(container)[0] ??
|
|
49
|
+
container;
|
|
50
|
+
target.focus({ preventScroll: true });
|
|
51
|
+
});
|
|
52
|
+
const handleKeyDown = (event) => {
|
|
53
|
+
if (event.key !== 'Tab' ||
|
|
54
|
+
// Composite widgets (e.g. a spreadsheet) may use Tab internally.
|
|
55
|
+
event.defaultPrevented ||
|
|
56
|
+
!isTopMostFocusTrap(container)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const focusable = getFocusableElements(container);
|
|
60
|
+
const first = focusable[0];
|
|
61
|
+
const last = focusable[focusable.length - 1];
|
|
62
|
+
if (!first || !last) {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
container.focus({ preventScroll: true });
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const activeElement = document.activeElement;
|
|
68
|
+
const focusIsOutside = !container.contains(activeElement);
|
|
69
|
+
if (event.shiftKey && (activeElement === first || focusIsOutside)) {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
last.focus();
|
|
72
|
+
}
|
|
73
|
+
else if (!event.shiftKey && (activeElement === last || focusIsOutside)) {
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
first.focus();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
if (trapTab)
|
|
79
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
80
|
+
return () => {
|
|
81
|
+
cancelAnimationFrame(frame);
|
|
82
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
83
|
+
const index = trapStack.lastIndexOf(container);
|
|
84
|
+
if (index !== -1)
|
|
85
|
+
trapStack.splice(index, 1);
|
|
86
|
+
// Only restore when focus would otherwise be lost (inside the closing
|
|
87
|
+
// container or already on <body>), never steal it from elsewhere.
|
|
88
|
+
const focused = document.activeElement;
|
|
89
|
+
const focusWouldBeLost = !focused || focused === document.body || container.contains(focused);
|
|
90
|
+
if (restoreFocus && focusWouldBeLost && previouslyFocused?.isConnected) {
|
|
91
|
+
previouslyFocused.focus({ preventScroll: true });
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}, [active, containerRef, initialFocusRef, restoreFocus, trapTab, returnFocusRef]);
|
|
95
|
+
};
|
|
96
|
+
export default useFocusTrap;
|
|
97
|
+
//# sourceMappingURL=useFocusTrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusTrap.js","s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AAO,KAAK,QAAQ,CAAC,IAAI,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACvE,IAAI,YAAY,IAAI,gBAAgB,IAAI,iBAAiB,EAAE,WAAW,EAAE,CAAC;gBACvE,iBAAiB,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;YACnD,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;AACrF,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* True when the element is rendered inside a control that already handles
|
|
4
|
+
* keyboard activation, so the element should not add its own tab stop.
|
|
5
|
+
*/
|
|
6
|
+
declare const useInteractiveAncestor: (ref: RefObject<HTMLElement>, enabled: boolean) => boolean;
|
|
7
|
+
export default useInteractiveAncestor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useLayoutEffect, useState } from 'react';
|
|
2
|
+
import { hasInteractiveAncestor } from '../utils/a11y/a11y';
|
|
3
|
+
/**
|
|
4
|
+
* True when the element is rendered inside a control that already handles
|
|
5
|
+
* keyboard activation, so the element should not add its own tab stop.
|
|
6
|
+
*/
|
|
7
|
+
const useInteractiveAncestor = (ref, enabled) => {
|
|
8
|
+
const [isNested, setIsNested] = useState(false);
|
|
9
|
+
useLayoutEffect(() => {
|
|
10
|
+
if (!enabled)
|
|
11
|
+
return;
|
|
12
|
+
const nested = hasInteractiveAncestor(ref.current);
|
|
13
|
+
setIsNested((previous) => (previous === nested ? previous : nested));
|
|
14
|
+
}, [enabled, ref]);
|
|
15
|
+
return enabled && isNested;
|
|
16
|
+
};
|
|
17
|
+
export default useInteractiveAncestor;
|
|
18
|
+
//# sourceMappingURL=useInteractiveAncestor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInteractiveAncestor.js","sourceRoot":"","sources":["../../src/hooks/useInteractiveAncestor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAC7B,GAA2B,EAC3B,OAAgB,EAChB,EAAE;IACF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhD,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,MAAM,MAAM,GAAG,sBAAsB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACnD,WAAW,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACvE,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IAEnB,OAAO,OAAO,IAAI,QAAQ,CAAC;AAC7B,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -2582,13 +2582,53 @@ interface BrowserTabsProps {
|
|
|
2582
2582
|
|
|
2583
2583
|
declare const BrowserTabs: ({ tabsData, activeTabId, onTabClick, onTabClose, onTabAdd, maxTabWidth, showCloseOnActive, maxTabs, enableOverflowTooltip, onTabMouseEnter, onTabMouseLeave, }: BrowserTabsProps) => React$1.JSX.Element;
|
|
2584
2584
|
|
|
2585
|
+
/** A styled part of the text, e.g. a variable inside a step name */
|
|
2586
|
+
interface HighlightTextPart {
|
|
2587
|
+
text: string;
|
|
2588
|
+
/**
|
|
2589
|
+
* Needs the same contrast as `color` on the row. Colour alone must not tell
|
|
2590
|
+
* kinds of parts apart (WCAG 1.4.1): a tooltip can say what the part is.
|
|
2591
|
+
*/
|
|
2592
|
+
color?: string;
|
|
2593
|
+
fontWeight?: CSSProperties['fontWeight'];
|
|
2594
|
+
/** Shown on hover over this part only. Text or JSX, as for `tooltip` below */
|
|
2595
|
+
tooltip?: string | ReactElement;
|
|
2596
|
+
}
|
|
2597
|
+
/** Plain text, or a styled part */
|
|
2598
|
+
type HighlightTextSegment = string | HighlightTextPart;
|
|
2585
2599
|
interface HighlightTextProps {
|
|
2586
2600
|
text?: string;
|
|
2601
|
+
/**
|
|
2602
|
+
* Use instead of `text` when parts need their own colour or tooltip.
|
|
2603
|
+
* Search highlighting runs on the joined text, so a match can span parts.
|
|
2604
|
+
*/
|
|
2605
|
+
segments?: HighlightTextSegment[];
|
|
2587
2606
|
highlight?: String;
|
|
2588
2607
|
onlyExactMatch?: boolean;
|
|
2608
|
+
/**
|
|
2609
|
+
* Text colour: any CSS colour value or variable, e.g. `var(--brand-color)`.
|
|
2610
|
+
* WCAG 1.4.6 (AAA) needs 7:1 contrast with the background (4.5:1 for large
|
|
2611
|
+
* text), also against the search highlight.
|
|
2612
|
+
*/
|
|
2613
|
+
color?: string;
|
|
2614
|
+
fontWeight?: CSSProperties['fontWeight'];
|
|
2615
|
+
/**
|
|
2616
|
+
* Shown on hover or keyboard focus, through the global TooltipService. The
|
|
2617
|
+
* text takes focus for it, except inside another control (e.g. a button),
|
|
2618
|
+
* which should then carry the tooltip itself. Escape hides it. JSX is copied
|
|
2619
|
+
* into the tooltip as HTML, so it is static: event handlers inside it do not
|
|
2620
|
+
* run.
|
|
2621
|
+
*/
|
|
2622
|
+
tooltip?: string | ReactElement;
|
|
2623
|
+
/**
|
|
2624
|
+
* Keep to one line and end with an ellipsis when it does not fit. The full
|
|
2625
|
+
* text shows on hover or focus, only while it is cut off (unless `tooltip`
|
|
2626
|
+
* is set); the row takes focus only then.
|
|
2627
|
+
*/
|
|
2628
|
+
truncate?: boolean;
|
|
2589
2629
|
}
|
|
2590
2630
|
|
|
2591
|
-
declare const
|
|
2631
|
+
declare const MemoizedHighlightText: React$1.MemoExoticComponent<({ text, segments, highlight, onlyExactMatch, color, fontWeight, tooltip, truncate, }: HighlightTextProps) => React$1.JSX.Element>;
|
|
2592
2632
|
|
|
2593
2633
|
interface CheckboxProps {
|
|
2594
2634
|
/**
|
|
@@ -6569,5 +6609,5 @@ interface DotLoaderProps {
|
|
|
6569
6609
|
|
|
6570
6610
|
declare const DotLoader: ({ dotCount, label, labelFontSize, labelFontWeight, dotFontSize, dotFontWeight }: DotLoaderProps) => React$1.JSX.Element;
|
|
6571
6611
|
|
|
6572
|
-
export { AADHAAR_REGEX, ALPHABET_ONLY_REGEX, ALPHABET_WITH_SPACES_ONLY_REGEX, ALPHANUMERIC_PARENTHESIS_REGEX, ALPHANUMERIC_REGEX, ALPHANUMERIC_WITH_DOT_REGEX, ALPHANUMERIC_WITH_ROUND_BRACES_REGEX, ALPHA_NUM_EXTENDED_REGEX, ALPHA_NUM_REGEX, Accordion, AddContentButton, AddResourceButton, AiToggle, AllProjectsDropdown, AnimatedSetting, AppHeader, AttachMedia, AttachmentButton, AudioPlayer, AutoTruncateText, Avatar, BASE64_REGEX, BIG_END_WHITESPACE, BINARY_NUMBER_REGEX, BODY_TAG_TYPE_VALIDATION, BarChart, Card as Box, BrowserTabs, Button, CAMEL_CASE_REGEX, CERTIFICATES_NAME_REGEX, CHECK_CAMEL_CASE, CREDIT_CARD_REGEX, CURRENCY_GENERIC_REGEX, CardPanel, ChatModal, ChatModalAi, Checkbox, Chip, ChipWithCount, ChooseFile, Col, Comments, ConditionalDropdown, ConnectingBranch, Container, ContentCard, CreateVariableSlider, DATE_REGEX, DECIMAL_NUMBER_REGEX, DRIVING_LICENSE_REGEX, DYNAMIC_VALUE_PATTERN_REGEX, DYNAMIC_VALUE_TYPE_REGEX, DYNAMIC_VALUE_WITH_VALID_BRACKETS_REGEX, DYNAMIC_VALUE__PLACEHOLDER_REGEX, DashboardDonutChart, CustomDatePicker as DatePicker, DebugToolsPanel, DonutChart, DotLoader, DownloadClient, DragAndDrop, Drawer, Dropzone, ELEMENTS_TRAILING_SPACE_REGEX, ELEMENTS_WHITE_SPACE_REGEX, EMAIL_FORMAT_REGEX, EMAIL_REGEX, EMAIL_VALIDATION_REGEX, EXCEL_SPACING_REGEX, EXECUTION_ID_VALIDATION, EditLabel, EditTextField, Editor, ErrorBoundary, ExcelFile as Excel, ExpandableMenu, FILENAME_VALIDATION_REGEX, FILE_EXTENSION_REGEX, FILE_NAME_REGEX, FieldSet, FileDropzone, FilePreview, ForwardedForms as Form, formatString as FormatString, GSTIN_REGEX, HEXADECIMAL_NUMBER_REGEX, HEX_COLOR_REGEX, HSL_COLOR_REGEX, HTML_ATTRIBUTE_REGEX, HTML_FILE_TYPE_VALIDATION, HTML_TAG_REGEX, HighlightText, HistoryCard, INDIAN_CURRENCY_REGEX, INDIAN_PASSPORT_REGEX, INDIAN_PHONE_REGEX, INDIAN_PIN_CODE_REGEX, INTERNATIONAL_PHONE_REGEX, INVALID_EMAIL_REGEX, IPV4_REGEX, IPV6_REGEX, Icon, IconButton, IconRadialChart, IconRadioGroup, Input, InputWithDropdown, JAVASCRIPT_FILE_TYPE_VALIDATION, LINKEDIN_PROFILE_REGEX, LINK_VALIDATION_REGEX, LabelEditTextField, LayoutWithDrawer, LineChart, LineLoader, Link, Loader, MAC_ADDRESS_REGEX, MEMORY_VALIDATION_REGEX, MachineInputField, MediaPreview, MediaViewerModal as MediaViewerModel, MenuOption, MessageBox, MiniModal, MobileSkin, Modal, ModuleChip, MultiRadialChart, MultiSelect, NlpInput as NLPInput, NLP_DESCRIPTION_REGEX, NO_LEADING_TRAILING_SPACE_REGEX, NUMBERS_ONLY_REGEX, NUMBER_REGEX, NetworkErrorBoundary, NoDataAvailable, NoDataContent, NoResultFound, OsTree, OtpVerification, OverviewModal, PAN_CARD_REGEX, PARAMETER_ALPHANUMERIC_REGEX, PASSWORD_COMPLEX_REGEX, PASSWORD_SIMPLE_REGEX, PHONE_REGEX, POSTAL_CODE_REGEX, Paper, PhoneInputField, PieChart, PopUpModal, PrePostTable, ProcessedSourceSelector, ProgressBar, Prompt, PromptContainer, RGB_COLOR_REGEX, ROMAN_NUMERALS_REGEX, RadialChart, RadioButton, RadioGroup, Recaptcha, Row, SCRIPT_REGEX, SERVER_HOST_REGEX, SSN_REGEX, START_END_WHITESPACE_REGEX, STEP_GROUP_NAME_REGEX, ScoreGaugeChart, ScriptGenerationLoader, ScriptSwitchButton, Search, Select, SelectionSwitcher, SequentialConnectingBranch, SessionDropdown, SessionManager, StackedBarChart, StateDropdown, StatusBadge, StatusButton, StatusCard, StatusIndicator, StepLandingTable, StepResultStats, StorageUsageBar, SwitchButton, TIME_REGEX, TWITTER_HANDLE_REGEX, Table, TreeTable as TableTree, TableTreeFn, TableWithAccordion, Tabs, TabsWithSilder, Textarea as TextArea, TextEditor, ThemeProvider, Toaster, Toastify, Toggle, ToggleSwitch, Tooltip, TooltipService, TruncatedTooltip, Typography, UNIT_REGEX, URL_REGEX, USERNAME_REGEX, USERNAME_SPECIAL_REGEX, US_ZIP_CODE_REGEX, UUID_REGEX, VALID_NAME_PATTERN, VEHICLE_REGISTRATION_REGEX, VariableDropdown, VariableInput, VariableSuggestionInputDropDown, WHITESPACE_REGEX, WeightageTable, XML_FILE_TYPE_VALIDATION, ZoomControl, addPrePostStepGroup, addStepGroup, autoScrollToTableLastRow, capitalize, checkEmpty, checkMicrophoneAccess, cleanAllTooltips, clearStore, compareArrays, compareObjects, computeTreeCountsAndFormatNodes, convertFormDataToObject, convertToBytes, convertToGB, convertToISO, copyToClipboard, debounce, deleteStoreValue, ffid, findAndInsert, formatDate, formatResponseDate, getEncryptedData, getExtension, getExtensionWithPeriod, getFiltersFromUrl, getNavigateToKey, getSequentialPayload, getStoreValue, getTopVisibleNodeKey, getTreeDetails, handleTimeZoneChange, handleTreeExpandAllCollapseAll, handleTreeNodeExpandCollapse, handleTreeNodeSect, handleUnCheckAllTreeNodesWithUpdates, hasDuplicateFile, isEmptyObject, isTextTruncated, nlpInputDelay, passesFilters, rearrangeDragItem, restoreSelectedFilters, saveFileFromBlob, scrollToView, setStoreValue, throttle, toCamelCase, toast, toggleShowHideEntity, truncateText, updateSearchTree, updateTreeState, useBeforeUnload, useClickOutside, useDeviceType, useFileDropzone, useKeyboardActions, useTheme, useTriggerControl, validateFileContent };
|
|
6573
|
-
export type { RootNode$1 as RootNode, TreeNodeProps, WeightageCellRenderProps, WeightageColumnLabels, WeightageGroup, WeightageRow, WeightageTableProps };
|
|
6612
|
+
export { AADHAAR_REGEX, ALPHABET_ONLY_REGEX, ALPHABET_WITH_SPACES_ONLY_REGEX, ALPHANUMERIC_PARENTHESIS_REGEX, ALPHANUMERIC_REGEX, ALPHANUMERIC_WITH_DOT_REGEX, ALPHANUMERIC_WITH_ROUND_BRACES_REGEX, ALPHA_NUM_EXTENDED_REGEX, ALPHA_NUM_REGEX, Accordion, AddContentButton, AddResourceButton, AiToggle, AllProjectsDropdown, AnimatedSetting, AppHeader, AttachMedia, AttachmentButton, AudioPlayer, AutoTruncateText, Avatar, BASE64_REGEX, BIG_END_WHITESPACE, BINARY_NUMBER_REGEX, BODY_TAG_TYPE_VALIDATION, BarChart, Card as Box, BrowserTabs, Button, CAMEL_CASE_REGEX, CERTIFICATES_NAME_REGEX, CHECK_CAMEL_CASE, CREDIT_CARD_REGEX, CURRENCY_GENERIC_REGEX, CardPanel, ChatModal, ChatModalAi, Checkbox, Chip, ChipWithCount, ChooseFile, Col, Comments, ConditionalDropdown, ConnectingBranch, Container, ContentCard, CreateVariableSlider, DATE_REGEX, DECIMAL_NUMBER_REGEX, DRIVING_LICENSE_REGEX, DYNAMIC_VALUE_PATTERN_REGEX, DYNAMIC_VALUE_TYPE_REGEX, DYNAMIC_VALUE_WITH_VALID_BRACKETS_REGEX, DYNAMIC_VALUE__PLACEHOLDER_REGEX, DashboardDonutChart, CustomDatePicker as DatePicker, DebugToolsPanel, DonutChart, DotLoader, DownloadClient, DragAndDrop, Drawer, Dropzone, ELEMENTS_TRAILING_SPACE_REGEX, ELEMENTS_WHITE_SPACE_REGEX, EMAIL_FORMAT_REGEX, EMAIL_REGEX, EMAIL_VALIDATION_REGEX, EXCEL_SPACING_REGEX, EXECUTION_ID_VALIDATION, EditLabel, EditTextField, Editor, ErrorBoundary, ExcelFile as Excel, ExpandableMenu, FILENAME_VALIDATION_REGEX, FILE_EXTENSION_REGEX, FILE_NAME_REGEX, FieldSet, FileDropzone, FilePreview, ForwardedForms as Form, formatString as FormatString, GSTIN_REGEX, HEXADECIMAL_NUMBER_REGEX, HEX_COLOR_REGEX, HSL_COLOR_REGEX, HTML_ATTRIBUTE_REGEX, HTML_FILE_TYPE_VALIDATION, HTML_TAG_REGEX, MemoizedHighlightText as HighlightText, HistoryCard, INDIAN_CURRENCY_REGEX, INDIAN_PASSPORT_REGEX, INDIAN_PHONE_REGEX, INDIAN_PIN_CODE_REGEX, INTERNATIONAL_PHONE_REGEX, INVALID_EMAIL_REGEX, IPV4_REGEX, IPV6_REGEX, Icon, IconButton, IconRadialChart, IconRadioGroup, Input, InputWithDropdown, JAVASCRIPT_FILE_TYPE_VALIDATION, LINKEDIN_PROFILE_REGEX, LINK_VALIDATION_REGEX, LabelEditTextField, LayoutWithDrawer, LineChart, LineLoader, Link, Loader, MAC_ADDRESS_REGEX, MEMORY_VALIDATION_REGEX, MachineInputField, MediaPreview, MediaViewerModal as MediaViewerModel, MenuOption, MessageBox, MiniModal, MobileSkin, Modal, ModuleChip, MultiRadialChart, MultiSelect, NlpInput as NLPInput, NLP_DESCRIPTION_REGEX, NO_LEADING_TRAILING_SPACE_REGEX, NUMBERS_ONLY_REGEX, NUMBER_REGEX, NetworkErrorBoundary, NoDataAvailable, NoDataContent, NoResultFound, OsTree, OtpVerification, OverviewModal, PAN_CARD_REGEX, PARAMETER_ALPHANUMERIC_REGEX, PASSWORD_COMPLEX_REGEX, PASSWORD_SIMPLE_REGEX, PHONE_REGEX, POSTAL_CODE_REGEX, Paper, PhoneInputField, PieChart, PopUpModal, PrePostTable, ProcessedSourceSelector, ProgressBar, Prompt, PromptContainer, RGB_COLOR_REGEX, ROMAN_NUMERALS_REGEX, RadialChart, RadioButton, RadioGroup, Recaptcha, Row, SCRIPT_REGEX, SERVER_HOST_REGEX, SSN_REGEX, START_END_WHITESPACE_REGEX, STEP_GROUP_NAME_REGEX, ScoreGaugeChart, ScriptGenerationLoader, ScriptSwitchButton, Search, Select, SelectionSwitcher, SequentialConnectingBranch, SessionDropdown, SessionManager, StackedBarChart, StateDropdown, StatusBadge, StatusButton, StatusCard, StatusIndicator, StepLandingTable, StepResultStats, StorageUsageBar, SwitchButton, TIME_REGEX, TWITTER_HANDLE_REGEX, Table, TreeTable as TableTree, TableTreeFn, TableWithAccordion, Tabs, TabsWithSilder, Textarea as TextArea, TextEditor, ThemeProvider, Toaster, Toastify, Toggle, ToggleSwitch, Tooltip, TooltipService, TruncatedTooltip, Typography, UNIT_REGEX, URL_REGEX, USERNAME_REGEX, USERNAME_SPECIAL_REGEX, US_ZIP_CODE_REGEX, UUID_REGEX, VALID_NAME_PATTERN, VEHICLE_REGISTRATION_REGEX, VariableDropdown, VariableInput, VariableSuggestionInputDropDown, WHITESPACE_REGEX, WeightageTable, XML_FILE_TYPE_VALIDATION, ZoomControl, addPrePostStepGroup, addStepGroup, autoScrollToTableLastRow, capitalize, checkEmpty, checkMicrophoneAccess, cleanAllTooltips, clearStore, compareArrays, compareObjects, computeTreeCountsAndFormatNodes, convertFormDataToObject, convertToBytes, convertToGB, convertToISO, copyToClipboard, debounce, deleteStoreValue, ffid, findAndInsert, formatDate, formatResponseDate, getEncryptedData, getExtension, getExtensionWithPeriod, getFiltersFromUrl, getNavigateToKey, getSequentialPayload, getStoreValue, getTopVisibleNodeKey, getTreeDetails, handleTimeZoneChange, handleTreeExpandAllCollapseAll, handleTreeNodeExpandCollapse, handleTreeNodeSect, handleUnCheckAllTreeNodesWithUpdates, hasDuplicateFile, isEmptyObject, isTextTruncated, nlpInputDelay, passesFilters, rearrangeDragItem, restoreSelectedFilters, saveFileFromBlob, scrollToView, setStoreValue, throttle, toCamelCase, toast, toggleShowHideEntity, truncateText, updateSearchTree, updateTreeState, useBeforeUnload, useClickOutside, useDeviceType, useFileDropzone, useKeyboardActions, useTheme, useTriggerControl, validateFileContent };
|
|
6613
|
+
export type { HighlightTextPart, HighlightTextSegment, RootNode$1 as RootNode, TreeNodeProps, WeightageCellRenderProps, WeightageColumnLabels, WeightageGroup, WeightageRow, WeightageTableProps };
|