@kakadu/components 6.18.0 → 6.20.0
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/build/components/modal.js +1 -1
- package/build/components/modal.mjs +1 -1
- package/build/components/popover.js +1 -1
- package/build/components/popover.mjs +1 -1
- package/build/components/text-button.js +1 -1
- package/build/components/text-button.mjs +1 -1
- package/build/components.css +1 -1
- package/build/focus-trap-react-BVCKtGPy.js +9 -0
- package/build/{focus-trap-react-Df_V17Wb.mjs → focus-trap-react-C3mPpJGa.mjs} +469 -479
- package/build/hooks/use-local-storage.js +1 -1
- package/build/hooks/use-local-storage.mjs +29 -31
- package/build/hooks/use-session-storage.d.ts +3 -0
- package/build/hooks/use-session-storage.js +1 -0
- package/build/hooks/use-session-storage.mjs +72 -0
- package/build/icons/icon.d.ts +1 -1
- package/build/icons/icon.js +1 -1
- package/build/icons/icon.mjs +29 -27
- package/build/icons/trend-down.d.ts +2 -0
- package/build/icons/trend-down.js +1 -0
- package/build/icons/trend-down.mjs +27 -0
- package/build/icons/trend-up.js +1 -1
- package/build/icons/trend-up.mjs +13 -36
- package/build/index.d.ts +12 -0
- package/build/index.js +1 -1
- package/build/index.mjs +113 -101
- package/build/utilities/average.d.ts +1 -0
- package/build/utilities/average.js +1 -0
- package/build/utilities/average.mjs +7 -0
- package/build/utilities/is-number.d.ts +1 -0
- package/build/utilities/is-number.js +1 -0
- package/build/utilities/is-number.mjs +6 -0
- package/build/utilities/round.d.ts +1 -0
- package/build/utilities/round.js +1 -0
- package/build/utilities/round.mjs +7 -0
- package/build/utilities/sum.d.ts +1 -0
- package/build/utilities/sum.js +1 -0
- package/build/utilities/sum.mjs +6 -0
- package/package.json +13 -13
- package/build/focus-trap-react-4An60CdH.js +0 -9
package/build/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FontFamilyHead as t, buttonResetStyles as a, darkBackgroundColor as r, effectStyles as f, font as s, lightBackgroundColor as
|
|
2
|
-
import { default as
|
|
1
|
+
import { FontFamilyHead as t, buttonResetStyles as a, darkBackgroundColor as r, effectStyles as f, font as s, lightBackgroundColor as u, nonInteractiveEffectStyles as l, overflowProtectionStyles as d, overlayEffectStyles as p, default as m } from "./theme.mjs";
|
|
2
|
+
import { default as n } from "./components/logos/akt-logo.mjs";
|
|
3
3
|
import { default as S } from "./components/logos/senteret-for-et-aldersvennlig-norge-logo.mjs";
|
|
4
4
|
import { default as v } from "./components/logos/amedia-logo.mjs";
|
|
5
5
|
import { default as h } from "./components/logos/bankaxept-logo.mjs";
|
|
@@ -7,11 +7,11 @@ import { default as y } from "./components/logos/bankid-logo.mjs";
|
|
|
7
7
|
import { default as k } from "./components/logos/dnb-logo.mjs";
|
|
8
8
|
import { default as b } from "./components/logos/entur-logo.mjs";
|
|
9
9
|
import { default as P } from "./components/logos/gjensidige-logo.mjs";
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
10
|
+
import { default as A } from "./components/logos/kakadu-academy-logo.mjs";
|
|
11
|
+
import { default as B } from "./components/logos/kakadu-guide-icon.mjs";
|
|
12
12
|
import { default as M, KakaduGuideLogoSvg as E, kakaduGuideLogoVariants as G } from "./components/logos/kakadu-guide-logo.mjs";
|
|
13
13
|
import { default as H } from "./components/logos/kakadu-index-logo.mjs";
|
|
14
|
-
import { default as
|
|
14
|
+
import { default as N } from "./components/logos/kakadu-logo.mjs";
|
|
15
15
|
import { default as U } from "./components/logos/kakadu-play-logo.mjs";
|
|
16
16
|
import { default as J } from "./components/logos/kolumbus-logo.mjs";
|
|
17
17
|
import { default as z } from "./components/logos/nordea-logo.mjs";
|
|
@@ -22,17 +22,17 @@ import { default as $ } from "./components/logos/sparebanken-norge-logo.mjs";
|
|
|
22
22
|
import { default as oe } from "./components/logos/sto-logo.mjs";
|
|
23
23
|
import { default as ae } from "./components/logos/storebrand-logo.mjs";
|
|
24
24
|
import { default as fe, ariaTextStyles as se } from "./components/aria-text.mjs";
|
|
25
|
-
import { default as
|
|
25
|
+
import { default as le, defaultAtomElementType as de } from "./components/atom.mjs";
|
|
26
26
|
import { default as me } from "./components/avatar.mjs";
|
|
27
|
-
import { default as
|
|
27
|
+
import { default as ne } from "./components/box.mjs";
|
|
28
28
|
import { default as Se, ButtonLoader as ie, buttonDangerStyles as ve, buttonSecondaryStyles as ce, buttonSuccessStyles as he, buttonVariants as Le, buttonWarningStyles as ye } from "./components/button.mjs";
|
|
29
29
|
import { default as ke, buttonTooltipPositions as Te } from "./components/button-tooltip.mjs";
|
|
30
30
|
import { default as Ie } from "./components/card.mjs";
|
|
31
|
-
import { default as
|
|
31
|
+
import { default as we, CheckboxIcon as Ae, TextCheckbox as De } from "./components/checkbox.mjs";
|
|
32
32
|
import { default as Fe } from "./components/click-ripples.mjs";
|
|
33
33
|
import { default as Ee, formatCode as Ge } from "./components/code.mjs";
|
|
34
34
|
import { default as He } from "./components/collapsible.mjs";
|
|
35
|
-
import { default as
|
|
35
|
+
import { default as Ne, getComboboxOptionString as Ve } from "./components/combobox.mjs";
|
|
36
36
|
import { default as We } from "./components/copy-icon-button.mjs";
|
|
37
37
|
import { default as je } from "./components/datum.mjs";
|
|
38
38
|
import { default as Oe } from "./components/decorators.mjs";
|
|
@@ -40,27 +40,27 @@ import { default as qe } from "./components/dot.mjs";
|
|
|
40
40
|
import { default as Ye, flagLocales as Ze } from "./components/flags.mjs";
|
|
41
41
|
import { default as $e, flexDirections as eo, flexPresets as oo } from "./components/flex.mjs";
|
|
42
42
|
import { default as ao, footerSectionLinks as ro, footerSections as fo } from "./components/footer.mjs";
|
|
43
|
-
import { default as
|
|
43
|
+
import { default as uo } from "./components/gauge.mjs";
|
|
44
44
|
import { default as po } from "./components/header.mjs";
|
|
45
|
-
import { default as
|
|
45
|
+
import { default as xo, normalBlendStyles as no } from "./components/hover-gradient.mjs";
|
|
46
46
|
import { default as So, iconButtonVariants as io } from "./components/icon-button.mjs";
|
|
47
47
|
import { default as co, InputAttachment as ho, InputLabel as Lo, errorParagraph as yo, inputStyles as Co, legendStyles as ko } from "./components/input.mjs";
|
|
48
|
-
import { default as bo, ModalActions as Io, ModalContent as Po, ModalHeading as
|
|
48
|
+
import { default as bo, ModalActions as Io, ModalContent as Po, ModalHeading as wo, useModal as Ao, useModalContext as Do } from "./components/modal.mjs";
|
|
49
49
|
import { default as Fo } from "./components/moving-gradients.mjs";
|
|
50
50
|
import { default as Eo } from "./components/moving-stars.mjs";
|
|
51
51
|
import { default as Ro, noticeTypes as Ho, noticeTypes as Ko } from "./components/notice.mjs";
|
|
52
|
-
import { default as
|
|
52
|
+
import { default as Vo, NotificationProvider as Uo, useCreateNotification as Wo } from "./components/notification.mjs";
|
|
53
53
|
import { default as jo, dangerPopoverMenuItemStyles as zo, usePopoverMenu as Oo } from "./components/popover-menu.mjs";
|
|
54
54
|
import { default as qo, PopoverContainer as Xo, usePopover as Yo, usePopoverContext as Zo } from "./components/popover.mjs";
|
|
55
55
|
import { default as $o, useRevealer as et } from "./components/revealer.mjs";
|
|
56
56
|
import { default as tt } from "./components/select.mjs";
|
|
57
|
-
import { default as rt, SeparatorLabel as ft, SmallSeparator as st, VerticalSeparator as
|
|
57
|
+
import { default as rt, SeparatorLabel as ft, SmallSeparator as st, VerticalSeparator as ut } from "./components/separator.mjs";
|
|
58
58
|
import { default as dt, SkeletonInstance as pt, getDeterministicSkeletonWidth as mt } from "./components/skeleton.mjs";
|
|
59
|
-
import { RevealSpinner as
|
|
59
|
+
import { RevealSpinner as nt, default as gt } from "./components/spinner.mjs";
|
|
60
60
|
import { AnchorHeading as it, Footnote as vt, Heading as ct, Hero as ht, Label as Lt, Paragraph as yt, Span as Ct, default as kt, defaultHeadingElementType as Tt, spanStyles as bt, textShadowStyles as It } from "./components/text.mjs";
|
|
61
|
-
import { default as
|
|
62
|
-
import { default as
|
|
63
|
-
import { default as
|
|
61
|
+
import { default as wt, textButtonVariants as At } from "./components/text-button.mjs";
|
|
62
|
+
import { default as Bt, getThemePreference as Ft, setThemePreference as Mt, themePreferences as Et, useIsDarkTheme as Gt, useIsLightTheme as Rt, useTheme as Ht } from "./components/theme-setter.mjs";
|
|
63
|
+
import { default as Nt } from "./components/veil.mjs";
|
|
64
64
|
import { default as Ut, wrapperWidths as Wt } from "./components/wrapper.mjs";
|
|
65
65
|
import { default as jt, iconShadowStyles as zt, iconTypes as Ot } from "./icons/icon.mjs";
|
|
66
66
|
import { default as qt } from "./icons/anchor-down.mjs";
|
|
@@ -70,9 +70,9 @@ import { default as ea } from "./icons/arrow-left.mjs";
|
|
|
70
70
|
import { default as ta } from "./icons/arrow-right.mjs";
|
|
71
71
|
import { default as ra } from "./icons/arrow-up.mjs";
|
|
72
72
|
import { default as sa } from "./icons/caret-down.mjs";
|
|
73
|
-
import { default as
|
|
73
|
+
import { default as la } from "./icons/caret-left.mjs";
|
|
74
74
|
import { default as pa } from "./icons/caret-right.mjs";
|
|
75
|
-
import { default as
|
|
75
|
+
import { default as xa } from "./icons/caret-up.mjs";
|
|
76
76
|
import { default as ga } from "./icons/check.mjs";
|
|
77
77
|
import { default as ia } from "./icons/chevron-down.mjs";
|
|
78
78
|
import { default as ca } from "./icons/chevron-left.mjs";
|
|
@@ -80,13 +80,13 @@ import { default as La } from "./icons/chevron-right.mjs";
|
|
|
80
80
|
import { default as Ca } from "./icons/chevron-up.mjs";
|
|
81
81
|
import { default as Ta } from "./icons/cog.mjs";
|
|
82
82
|
import { default as Ia } from "./icons/copy.mjs";
|
|
83
|
-
import { default as
|
|
84
|
-
import { default as
|
|
83
|
+
import { default as wa } from "./icons/document.mjs";
|
|
84
|
+
import { default as Da } from "./icons/dots.mjs";
|
|
85
85
|
import { default as Fa } from "./icons/drag.mjs";
|
|
86
86
|
import { default as Ea } from "./icons/edit.mjs";
|
|
87
87
|
import { default as Ra } from "./icons/external.mjs";
|
|
88
88
|
import { default as Ka } from "./icons/exclamation-triangle.mjs";
|
|
89
|
-
import { default as
|
|
89
|
+
import { default as Va } from "./icons/eye.mjs";
|
|
90
90
|
import { default as Wa } from "./icons/information.mjs";
|
|
91
91
|
import { default as ja } from "./icons/kakadu-guide-glyph.mjs";
|
|
92
92
|
import { default as Oa } from "./icons/kakadu-guide-icon.mjs";
|
|
@@ -97,32 +97,38 @@ import { default as er } from "./icons/reload.mjs";
|
|
|
97
97
|
import { default as tr } from "./icons/select.mjs";
|
|
98
98
|
import { default as rr } from "./icons/share.mjs";
|
|
99
99
|
import { default as sr } from "./icons/sparkle.mjs";
|
|
100
|
-
import { default as
|
|
100
|
+
import { default as lr } from "./icons/test.mjs";
|
|
101
101
|
import { default as pr } from "./icons/thumbs-down.mjs";
|
|
102
|
-
import { default as
|
|
102
|
+
import { default as xr } from "./icons/thumbs-up.mjs";
|
|
103
103
|
import { default as gr } from "./icons/times.mjs";
|
|
104
104
|
import { default as ir } from "./icons/trash.mjs";
|
|
105
|
-
import { default as cr } from "./icons/trend-
|
|
106
|
-
import { default as Lr } from "./icons/
|
|
107
|
-
import { default as Cr } from "./icons/
|
|
108
|
-
import { default as Tr } from "./
|
|
109
|
-
import {
|
|
110
|
-
import { default as Fr } from "./hooks/use-
|
|
111
|
-
import {
|
|
112
|
-
import { default as Hr } from "./hooks/use-
|
|
113
|
-
import { default as
|
|
114
|
-
import { default as Ur } from "./hooks/use-
|
|
115
|
-
import { default as Jr } from "./hooks/use-
|
|
116
|
-
import { default as zr } from "./
|
|
117
|
-
import { default as Qr } from "./
|
|
118
|
-
import { default as Xr } from "./utilities/
|
|
119
|
-
import { default as Zr } from "./utilities/
|
|
120
|
-
import { default as $r } from "./utilities/
|
|
121
|
-
import { default as of } from "./utilities/
|
|
122
|
-
import { default as af } from "./utilities/
|
|
123
|
-
import { default as ff } from "./utilities/
|
|
105
|
+
import { default as cr } from "./icons/trend-down.mjs";
|
|
106
|
+
import { default as Lr } from "./icons/trend-up.mjs";
|
|
107
|
+
import { default as Cr } from "./icons/chrome-browser-logo.mjs";
|
|
108
|
+
import { default as Tr } from "./icons/edge-browser-logo.mjs";
|
|
109
|
+
import { default as Ir } from "./hooks/use-escaped-id.mjs";
|
|
110
|
+
import { purgeCache as wr, default as Ar, useFetcher as Dr, useJsonFetch as Br, useJsonFetcher as Fr } from "./hooks/use-fetch.mjs";
|
|
111
|
+
import { default as Er } from "./hooks/use-is-document-focused.mjs";
|
|
112
|
+
import { useHasBeenInView as Rr, default as Hr } from "./hooks/use-is-in-view.mjs";
|
|
113
|
+
import { default as Nr } from "./hooks/use-local-storage.mjs";
|
|
114
|
+
import { default as Ur } from "./hooks/use-media-query.mjs";
|
|
115
|
+
import { default as Jr } from "./hooks/use-session-storage.mjs";
|
|
116
|
+
import { default as zr } from "./hooks/use-synchronized-value.mjs";
|
|
117
|
+
import { default as Qr } from "./hooks/use-throttled.mjs";
|
|
118
|
+
import { default as Xr } from "./utilities/average.mjs";
|
|
119
|
+
import { default as Zr } from "./utilities/boolean-filter.mjs";
|
|
120
|
+
import { default as $r } from "./utilities/clamp.mjs";
|
|
121
|
+
import { default as of } from "./utilities/copy-to-clipboard.mjs";
|
|
122
|
+
import { default as af } from "./utilities/generate-random-id.mjs";
|
|
123
|
+
import { default as ff } from "./utilities/is-number.mjs";
|
|
124
|
+
import { default as uf } from "./utilities/listeners.mjs";
|
|
125
|
+
import { default as df } from "./utilities/round.mjs";
|
|
126
|
+
import { default as mf } from "./utilities/scale.mjs";
|
|
127
|
+
import { default as nf } from "./utilities/search.mjs";
|
|
128
|
+
import { default as Sf } from "./utilities/string-to-hex-color.mjs";
|
|
129
|
+
import { default as cf } from "./utilities/sum.mjs";
|
|
124
130
|
export {
|
|
125
|
-
|
|
131
|
+
n as AktLogoSvg,
|
|
126
132
|
v as AmediaLogoSvg,
|
|
127
133
|
qt as AnchorDownSvg,
|
|
128
134
|
it as AnchorHeading,
|
|
@@ -132,72 +138,72 @@ export {
|
|
|
132
138
|
ea as ArrowLeftSvg,
|
|
133
139
|
ta as ArrowRightSvg,
|
|
134
140
|
ra as ArrowUpSvg,
|
|
135
|
-
|
|
141
|
+
le as Atom,
|
|
136
142
|
me as Avatar,
|
|
137
143
|
h as BankAxeptLogoSvg,
|
|
138
144
|
y as BankIdLogoSvg,
|
|
139
|
-
|
|
145
|
+
ne as Box,
|
|
140
146
|
Se as Button,
|
|
141
147
|
ie as ButtonLoader,
|
|
142
148
|
ke as ButtonTooltip,
|
|
143
149
|
Ie as Card,
|
|
144
150
|
sa as CaretDownSvg,
|
|
145
|
-
|
|
151
|
+
la as CaretLeftSvg,
|
|
146
152
|
pa as CaretRightSvg,
|
|
147
|
-
|
|
153
|
+
xa as CaretUpSvg,
|
|
148
154
|
ga as CheckSvg,
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
we as Checkbox,
|
|
156
|
+
Ae as CheckboxIcon,
|
|
151
157
|
ia as ChevronDownSvg,
|
|
152
158
|
ca as ChevronLeftSvg,
|
|
153
159
|
La as ChevronRightSvg,
|
|
154
160
|
Ca as ChevronUpSvg,
|
|
155
|
-
|
|
161
|
+
Cr as ChromeBrowserLogoSvg,
|
|
156
162
|
Fe as ClickRipples,
|
|
157
163
|
Ee as Code,
|
|
158
164
|
Ta as CogSvg,
|
|
159
165
|
He as Collapsible,
|
|
160
|
-
|
|
166
|
+
Ne as Combobox,
|
|
161
167
|
We as CopyIconButton,
|
|
162
168
|
Ia as CopySvg,
|
|
163
169
|
je as Datum,
|
|
164
170
|
Oe as Decorators,
|
|
165
171
|
k as DnbLogoSvg,
|
|
166
|
-
|
|
172
|
+
wa as DocumentSvg,
|
|
167
173
|
qe as Dot,
|
|
168
|
-
|
|
174
|
+
Da as DotsSvg,
|
|
169
175
|
Fa as DragSvg,
|
|
170
|
-
|
|
176
|
+
Tr as EdgeBrowserLogoSvg,
|
|
171
177
|
Ea as EditSvg,
|
|
172
178
|
b as EnturLogoSvg,
|
|
173
179
|
Ka as ExclamationTriangleSvg,
|
|
174
180
|
Ra as ExternalSvg,
|
|
175
|
-
|
|
181
|
+
Va as EyeSvg,
|
|
176
182
|
Ye as Flag,
|
|
177
183
|
$e as Flex,
|
|
178
184
|
t as FontFamilyHead,
|
|
179
185
|
ao as Footer,
|
|
180
186
|
vt as Footnote,
|
|
181
|
-
|
|
187
|
+
uo as Gauge,
|
|
182
188
|
P as GjensidigeLogoSvg,
|
|
183
189
|
po as Header,
|
|
184
190
|
ct as Heading,
|
|
185
191
|
ht as Hero,
|
|
186
|
-
|
|
192
|
+
xo as HoverGradient,
|
|
187
193
|
jt as Icon,
|
|
188
194
|
So as IconButton,
|
|
189
195
|
Wa as InformationSvg,
|
|
190
196
|
co as Input,
|
|
191
197
|
ho as InputAttachment,
|
|
192
198
|
Lo as InputLabel,
|
|
193
|
-
|
|
199
|
+
A as KakaduAcademyLogoSvg,
|
|
194
200
|
ja as KakaduGuideGlyphSvg,
|
|
195
|
-
|
|
201
|
+
B as KakaduGuideIcon,
|
|
196
202
|
Oa as KakaduGuideIconSvg,
|
|
197
203
|
M as KakaduGuideLogo,
|
|
198
204
|
E as KakaduGuideLogoSvg,
|
|
199
205
|
H as KakaduIndexLogoSvg,
|
|
200
|
-
|
|
206
|
+
N as KakaduLogoSvg,
|
|
201
207
|
U as KakaduPlayLogoSvg,
|
|
202
208
|
J as KolumbusLogoSvg,
|
|
203
209
|
Lt as Label,
|
|
@@ -205,13 +211,13 @@ export {
|
|
|
205
211
|
bo as Modal,
|
|
206
212
|
Io as ModalActions,
|
|
207
213
|
Po as ModalContent,
|
|
208
|
-
|
|
214
|
+
wo as ModalHeading,
|
|
209
215
|
Fo as MovingGradients,
|
|
210
216
|
Eo as MovingStars,
|
|
211
217
|
z as NordeaLogoSvg,
|
|
212
218
|
Q as NorskTippingLogoSvg,
|
|
213
219
|
Ro as Notice,
|
|
214
|
-
|
|
220
|
+
Vo as Notification,
|
|
215
221
|
Uo as NotificationProvider,
|
|
216
222
|
Ya as PackageSvg,
|
|
217
223
|
yt as Paragraph,
|
|
@@ -220,7 +226,7 @@ export {
|
|
|
220
226
|
Xo as PopoverContainer,
|
|
221
227
|
jo as PopoverMenu,
|
|
222
228
|
er as ReloadSvg,
|
|
223
|
-
|
|
229
|
+
nt as RevealSpinner,
|
|
224
230
|
$o as Revealer,
|
|
225
231
|
X as RuterLogoSvg,
|
|
226
232
|
tt as Select,
|
|
@@ -239,21 +245,23 @@ export {
|
|
|
239
245
|
gt as Spinner,
|
|
240
246
|
oe as StoLogoSvg,
|
|
241
247
|
ae as StorebrandLogoSvg,
|
|
242
|
-
|
|
248
|
+
lr as TestSvg,
|
|
243
249
|
kt as Text,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
250
|
+
wt as TextButton,
|
|
251
|
+
De as TextCheckbox,
|
|
252
|
+
Bt as ThemeSetter,
|
|
247
253
|
pr as ThumbsDownSvg,
|
|
248
|
-
|
|
254
|
+
xr as ThumbsUpSvg,
|
|
249
255
|
gr as TimesSvg,
|
|
250
256
|
ir as TrashSvg,
|
|
251
|
-
cr as
|
|
252
|
-
|
|
253
|
-
|
|
257
|
+
cr as TrendDownSvg,
|
|
258
|
+
Lr as TrendUpSvg,
|
|
259
|
+
Nt as Veil,
|
|
260
|
+
ut as VerticalSeparator,
|
|
254
261
|
Ut as Wrapper,
|
|
255
262
|
se as ariaTextStyles,
|
|
256
|
-
|
|
263
|
+
Xr as average,
|
|
264
|
+
Zr as booleanFilter,
|
|
257
265
|
ve as buttonDangerStyles,
|
|
258
266
|
a as buttonResetStyles,
|
|
259
267
|
ce as buttonSecondaryStyles,
|
|
@@ -261,9 +269,9 @@ export {
|
|
|
261
269
|
Te as buttonTooltipPositions,
|
|
262
270
|
Le as buttonVariants,
|
|
263
271
|
ye as buttonWarningStyles,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
272
|
+
$r as clamp,
|
|
273
|
+
of as copyToClipboard,
|
|
274
|
+
uf as createListener,
|
|
267
275
|
zo as dangerPopoverMenuItemStyles,
|
|
268
276
|
r as darkBackgroundColor,
|
|
269
277
|
de as defaultAtomElementType,
|
|
@@ -277,54 +285,58 @@ export {
|
|
|
277
285
|
ro as footerSectionLinks,
|
|
278
286
|
fo as footerSections,
|
|
279
287
|
Ge as formatCode,
|
|
280
|
-
|
|
281
|
-
|
|
288
|
+
af as generateRandomId,
|
|
289
|
+
Ve as getComboboxOptionString,
|
|
282
290
|
mt as getDeterministicSkeletonWidth,
|
|
283
291
|
Ft as getThemePreference,
|
|
284
292
|
io as iconButtonVariants,
|
|
285
293
|
zt as iconShadowStyles,
|
|
286
294
|
Ot as iconTypes,
|
|
287
295
|
Co as inputStyles,
|
|
296
|
+
ff as isNumber,
|
|
288
297
|
G as kakaduGuideLogoVariants,
|
|
289
298
|
ko as legendStyles,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
299
|
+
u as lightBackgroundColor,
|
|
300
|
+
l as nonInteractiveEffectStyles,
|
|
301
|
+
no as normalBlendStyles,
|
|
293
302
|
Ho as noticeTypes,
|
|
294
303
|
Ko as notificationTypes,
|
|
295
304
|
d as overflowProtectionStyles,
|
|
296
305
|
p as overlayEffectStyles,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
306
|
+
wr as purgeCache,
|
|
307
|
+
df as round,
|
|
308
|
+
mf as scale,
|
|
309
|
+
nf as search,
|
|
300
310
|
Mt as setThemePreference,
|
|
301
311
|
bt as spanStyles,
|
|
302
|
-
|
|
303
|
-
|
|
312
|
+
Sf as stringToHexColor,
|
|
313
|
+
cf as sum,
|
|
314
|
+
At as textButtonVariants,
|
|
304
315
|
It as textShadowStyles,
|
|
305
316
|
m as theme,
|
|
306
317
|
Et as themePreferences,
|
|
307
318
|
Wo as useCreateNotification,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
319
|
+
Ir as useEscapedId,
|
|
320
|
+
Ar as useFetch,
|
|
321
|
+
Dr as useFetcher,
|
|
322
|
+
Rr as useHasBeenInView,
|
|
312
323
|
Gt as useIsDarkTheme,
|
|
313
|
-
|
|
314
|
-
|
|
324
|
+
Er as useIsDocumentFocused,
|
|
325
|
+
Hr as useIsInView,
|
|
315
326
|
Rt as useIsLightTheme,
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
327
|
+
Br as useJsonFetch,
|
|
328
|
+
Fr as useJsonFetcher,
|
|
329
|
+
Nr as useLocalStorage,
|
|
330
|
+
Ur as useMediaQuery,
|
|
331
|
+
Ao as useModal,
|
|
332
|
+
Do as useModalContext,
|
|
322
333
|
Yo as usePopover,
|
|
323
334
|
Zo as usePopoverContext,
|
|
324
335
|
Oo as usePopoverMenu,
|
|
325
336
|
et as useRevealer,
|
|
326
|
-
|
|
337
|
+
Jr as useSessionStorage,
|
|
338
|
+
zr as useSynchronizedValue,
|
|
327
339
|
Ht as useTheme,
|
|
328
|
-
|
|
340
|
+
Qr as useThrottled,
|
|
329
341
|
Wt as wrapperWidths
|
|
330
342
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function average(input: number[]): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./sum.js");function u(e){return e.length>0?t.default(e)/e.length:0}exports.default=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isNumber(input: any): input is number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function u(e){return typeof e=="number"&&!Number.isNaN(e)}exports.default=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function round(input: number, decimals?: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function r(t,u=0){const e=10**u;return Math.round(t*e)/e}exports.default=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function sum(input: number[]): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function r(e){return e.reduce((u,t)=>u+t,0)}exports.default=r;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kakadu/components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.20.0",
|
|
4
4
|
"description": "Kakadu components library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./build/index.js",
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@chromatic-com/storybook": "^4.1.4",
|
|
70
70
|
"@kuma-ui/core": "^1.6.4",
|
|
71
|
-
"@storybook/addon-a11y": "^10.6.
|
|
72
|
-
"@storybook/addon-docs": "^10.6.
|
|
73
|
-
"@storybook/addon-vitest": "^10.6.
|
|
74
|
-
"@storybook/nextjs-vite": "^10.6.
|
|
71
|
+
"@storybook/addon-a11y": "^10.6.7",
|
|
72
|
+
"@storybook/addon-docs": "^10.6.7",
|
|
73
|
+
"@storybook/addon-vitest": "^10.6.7",
|
|
74
|
+
"@storybook/nextjs-vite": "^10.6.7",
|
|
75
75
|
"@testing-library/jest-dom": "^6.9.1",
|
|
76
76
|
"@testing-library/react": "^16.3.3",
|
|
77
|
-
"@testing-library/user-event": "^14.6.
|
|
77
|
+
"@testing-library/user-event": "^14.6.13",
|
|
78
78
|
"@types/fast-levenshtein": "^0.0.4",
|
|
79
79
|
"@types/node": "^20.19.43",
|
|
80
80
|
"@types/react": "^19.3.0",
|
|
@@ -82,19 +82,19 @@
|
|
|
82
82
|
"@vitejs/plugin-react": "^5.2.0",
|
|
83
83
|
"@vitest/browser-playwright": "^4.0.4",
|
|
84
84
|
"@vitest/coverage-v8": "^4.0.4",
|
|
85
|
-
"chromatic": "^18.
|
|
85
|
+
"chromatic": "^18.15.0",
|
|
86
86
|
"dotenv": "^17.4.2",
|
|
87
87
|
"eslint-config-xo-react": "^0.27.0",
|
|
88
|
-
"eslint-plugin-storybook": "^10.6.
|
|
88
|
+
"eslint-plugin-storybook": "^10.6.7",
|
|
89
89
|
"jsdom": "^27.4.0",
|
|
90
|
-
"next": "^16.4.
|
|
91
|
-
"playwright": "^1.65.
|
|
92
|
-
"prettier": "^3.
|
|
90
|
+
"next": "^16.4.6",
|
|
91
|
+
"playwright": "^1.65.1",
|
|
92
|
+
"prettier": "^3.10.1",
|
|
93
93
|
"react": "^19.3.1",
|
|
94
94
|
"react-dom": "^19.3.1",
|
|
95
|
-
"storybook": "^10.6.
|
|
95
|
+
"storybook": "^10.6.7",
|
|
96
96
|
"typescript": "^5.9.3",
|
|
97
|
-
"vite": "^6.4.
|
|
97
|
+
"vite": "^6.4.6",
|
|
98
98
|
"vitest": "^4.0.4",
|
|
99
99
|
"xo": "^0.59.3"
|
|
100
100
|
},
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";const Fe=require("react"),be=require("./_commonjsHelpers-DGT2Y9Xa.js");var Y={exports:{}};/*!
|
|
2
|
-
* tabbable 6.5.1
|
|
3
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
-
*/var pe=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],J=pe.join(","),he=typeof Element>"u",M=he?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Q=!he&&Element.prototype.getRootNode?function(i){return i==null||i.getRootNode==null?void 0:i.getRootNode()}:function(i){return i==null?void 0:i.ownerDocument},ee=function(e,t){t===void 0&&(t=!0);var o=e==null||e.getAttribute==null?void 0:e.getAttribute("inert"),s=o===""||o==="true",l=s||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ee(e.parentNode));return l},Oe=function(e){var t,o=e==null||e.getAttribute==null||(t=e.getAttribute("contenteditable"))==null?void 0:t.toLowerCase();return o===""||o==="true"||o==="plaintext-only"},ye=function(e,t,o){if(ee(e))return[];var s=Array.prototype.slice.apply(e.querySelectorAll(J));return t&&M.call(e,J)&&s.unshift(e),s=s.filter(o),s},te=function(e,t,o){for(var s=[],l=Array.from(e);l.length;){var a=l.shift();if(!ee(a,!1))if(a.tagName==="SLOT"){var y=a.assignedElements(),T=y.length?y:a.children,F=te(T,!0,o);o.flatten?s.push.apply(s,F):s.push({scopeParent:a,candidates:F})}else{var k=M.call(a,J);k&&o.filter(a)&&(t||!e.includes(a))&&s.push(a);var D=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),N=!ee(D,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(D&&N){var _=te(D===!0?a.children:D.children,!0,o);o.flatten?s.push.apply(s,_):s.push({scopeParent:a,candidates:_})}else l.unshift.apply(l,a.children)}}return s},me=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},L=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Oe(e))&&!me(e)?0:e.tabIndex},De=function(e,t){var o=L(e);return o<0&&t&&!me(e)?0:o},ke=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ge=function(e){return e.tagName==="INPUT"},Ne=function(e){return ge(e)&&e.type==="hidden"},Re=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return t},Pe=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]},Ce=function(e){if(!e.name)return!0;var t=e.form||Q(e),o=function(y){return t.querySelectorAll('input[type="radio"][name="'+y+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=o(window.CSS.escape(e.name));else try{s=o(e.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var l=Pe(s,e.form);return!l||l===e},Ae=function(e){return ge(e)&&e.type==="radio"},Ie=function(e){return Ae(e)&&!Ce(e)},_e=function(e){var t,o=e&&Q(e),s=(t=o)==null?void 0:t.host,l=!1;if(o&&o!==e){var a,y;for(l=!!((a=s)!=null&&(a=a.ownerDocument)!=null&&a.contains(s)||e!=null&&(y=e.ownerDocument)!=null&&y.contains(e));!l&&s;){var T,F;o=Q(s),s=(T=o)==null?void 0:T.host,l=!!((F=s)!=null&&(F=F.ownerDocument)!=null&&F.contains(s))}}return l},se=function(e){var t=e.getBoundingClientRect(),o=t.width,s=t.height;return o===0&&s===0},je=function(e,t){var o=t.displayCheck,s=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in e){var l=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!l}var a=getComputedStyle(e),y=a.visibility;if(y==="hidden"||y==="collapse")return!0;var T=M.call(e,"details>summary:first-of-type"),F=T?e.parentElement:e;if(M.call(F,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof s=="function"){for(var k=e;e;){var D=e.parentElement,N=Q(e);if(D&&!D.shadowRoot&&s(D)===!0)return se(e);e.assignedSlot?e=e.assignedSlot:!D&&N!==e.ownerDocument?e=N.host:e=D}e=k}if(_e(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return se(e);return!1},xe=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var s=t.children.item(o);if(s.tagName==="LEGEND")return M.call(t,"fieldset[disabled] *")?!0:!s.contains(e)}return!0}t=t.parentElement}return!1},re=function(e,t){return!(t.disabled||Ne(t)||je(t,e)||Re(t)||xe(t))},oe=function(e,t){return!(Ie(t)||L(t)<0||!re(e,t))},Le=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},we=function(e){var t=[],o=[];return e.forEach(function(s,l){var a=!!s.scopeParent,y=a?s.scopeParent:s,T=De(y,a),F=a?we(s.candidates):y;T===0?a?t.push.apply(t,F):t.push(y):o.push({documentOrder:l,tabIndex:T,item:s,isScope:a,content:F})}),o.sort(ke).reduce(function(s,l){return l.isScope?s.push.apply(s,l.content):s.push(l.content),s},[]).concat(t)},Te=function(e,t){t=t||{};var o;return t.getShadowRoot?o=te([e],t.includeContainer,{filter:oe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Le}):o=ye(e,t.includeContainer,oe.bind(null,t)),we(o)},Se=function(e,t){t=t||{};var o;return t.getShadowRoot?o=te([e],t.includeContainer,{filter:re.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):o=ye(e,t.includeContainer,re.bind(null,t)),o},K=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return M.call(e,J)===!1?!1:oe(t,e)},Be=pe.concat("iframe:not([inert]):not([inert] *)").join(","),X=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return M.call(e,Be)===!1?!1:re(t,e)};const Ke=Object.freeze(Object.defineProperty({__proto__:null,focusable:Se,getTabIndex:L,isFocusable:X,isTabbable:K,tabbable:Te},Symbol.toStringTag,{value:"Module"}));/*!
|
|
5
|
-
* focus-trap 7.8.0
|
|
6
|
-
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
7
|
-
*/function ue(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,o=Array(e);t<e;t++)o[t]=i[t];return o}function Me(i){if(Array.isArray(i))return ue(i)}function ce(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=Ee(i))||e){t&&(i=t);var o=0,s=function(){};return{s,n:function(){return o>=i.length?{done:!0}:{done:!1,value:i[o++]}},e:function(T){throw T},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
8
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,a=!0,y=!1;return{s:function(){t=t.call(i)},n:function(){var T=t.next();return a=T.done,T},e:function(T){y=!0,l=T},f:function(){try{a||t.return==null||t.return()}finally{if(y)throw l}}}}function qe(i,e,t){return(e=He(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function $e(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Ve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
9
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function le(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);e&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,o)}return t}function fe(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?le(Object(t),!0).forEach(function(o){qe(i,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):le(Object(t)).forEach(function(o){Object.defineProperty(i,o,Object.getOwnPropertyDescriptor(t,o))})}return i}function Ge(i){return Me(i)||$e(i)||Ee(i)||Ve()}function Ue(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var o=t.call(i,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function He(i){var e=Ue(i,"string");return typeof e=="symbol"?e:e+""}function Ee(i,e){if(i){if(typeof i=="string")return ue(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ue(i,e):void 0}}var I={getActiveTrap:function(e){return(e==null?void 0:e.length)>0?e[e.length-1]:null},activateTrap:function(e,t){var o=I.getActiveTrap(e);t!==o&&I.pauseTrap(e);var s=e.indexOf(t);s===-1||e.splice(s,1),e.push(t)},deactivateTrap:function(e,t){var o=e.indexOf(t);o!==-1&&e.splice(o,1),I.unpauseTrap(e)},pauseTrap:function(e){var t=I.getActiveTrap(e);t==null||t._setPausedState(!0)},unpauseTrap:function(e){var t=I.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},We=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},ze=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},G=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},Ye=function(e){return G(e)&&!e.shiftKey},Ze=function(e){return G(e)&&e.shiftKey},de=function(e){return setTimeout(e,0)},V=function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),s=1;s<t;s++)o[s-1]=arguments[s];return typeof e=="function"?e.apply(void 0,o):e},Z=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Xe=[],Je=function(e,t){var o=(t==null?void 0:t.document)||document,s=(t==null?void 0:t.trapStack)||Xe,l=fe({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:Ye,isKeyBackward:Ze},t),a={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},y,T=function(n,r,c){return n&&n[r]!==void 0?n[r]:l[c||r]},F=function(n,r){var c=typeof(r==null?void 0:r.composedPath)=="function"?r.composedPath():void 0;return a.containerGroups.findIndex(function(h){var p=h.container,g=h.tabbableNodes;return p.contains(n)||(c==null?void 0:c.includes(p))||g.find(function(v){return v===n})})},k=function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=r.hasFallback,h=c===void 0?!1:c,p=r.params,g=p===void 0?[]:p,v=l[n];if(typeof v=="function"&&(v=v.apply(void 0,Ge(g))),v===!0&&(v=void 0),!v){if(v===void 0||v===!1)return v;throw new Error("`".concat(n,"` was specified but was not a node, or did not return a node"))}var S=v;if(typeof v=="string"){try{S=o.querySelector(v)}catch(E){throw new Error("`".concat(n,'` appears to be an invalid selector; error="').concat(E.message,'"'))}if(!S&&!h)throw new Error("`".concat(n,"` as selector refers to no known node"))}return S},D=function(){var n=k("initialFocus",{hasFallback:!0});if(n===!1)return!1;if(n===void 0||n&&!X(n,l.tabbableOptions))if(F(o.activeElement)>=0)n=o.activeElement;else{var r=a.tabbableGroups[0],c=r&&r.firstTabbableNode;n=c||k("fallbackFocus")}else n===null&&(n=k("fallbackFocus"));if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n},N=function(){if(a.containerGroups=a.containers.map(function(n){var r=Te(n,l.tabbableOptions),c=Se(n,l.tabbableOptions),h=r.length>0?r[0]:void 0,p=r.length>0?r[r.length-1]:void 0,g=c.find(function(E){return K(E)}),v=c.slice().reverse().find(function(E){return K(E)}),S=!!r.find(function(E){return L(E)>0});return{container:n,tabbableNodes:r,focusableNodes:c,posTabIndexesFound:S,firstTabbableNode:h,lastTabbableNode:p,firstDomTabbableNode:g,lastDomTabbableNode:v,nextTabbableNode:function(R){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,C=r.indexOf(R);return C<0?A?c.slice(c.indexOf(R)+1).find(function(B){return K(B)}):c.slice(0,c.indexOf(R)).reverse().find(function(B){return K(B)}):r[C+(A?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(n){return n.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!k("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(n){return n.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},_=function(n){var r=n.activeElement;if(r)return r.shadowRoot&&r.shadowRoot.activeElement!==null?_(r.shadowRoot):r},P=function(n){if(n!==!1&&n!==_(document)){if(!n||!n.focus){P(D());return}n.focus({preventScroll:!!l.preventScroll}),a.mostRecentlyFocusedNode=n,We(n)&&n.select()}},U=function(n){var r=k("setReturnFocus",{params:[n]});return r||(r===!1?!1:n)},j=function(n){var r=n.target,c=n.event,h=n.isBackward,p=h===void 0?!1:h;r=r||Z(c),N();var g=null;if(a.tabbableGroups.length>0){var v=F(r,c),S=v>=0?a.containerGroups[v]:void 0;if(v<0)p?g=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:g=a.tabbableGroups[0].firstTabbableNode;else if(p){var E=a.tabbableGroups.findIndex(function(ne){var ie=ne.firstTabbableNode;return r===ie});if(E<0&&(S.container===r||X(r,l.tabbableOptions)&&!K(r,l.tabbableOptions)&&!S.nextTabbableNode(r,!1))&&(E=v),E>=0){var R=E===0?a.tabbableGroups.length-1:E-1,A=a.tabbableGroups[R];g=L(r)>=0?A.lastTabbableNode:A.lastDomTabbableNode}else G(c)||(g=S.nextTabbableNode(r,!1))}else{var C=a.tabbableGroups.findIndex(function(ne){var ie=ne.lastTabbableNode;return r===ie});if(C<0&&(S.container===r||X(r,l.tabbableOptions)&&!K(r,l.tabbableOptions)&&!S.nextTabbableNode(r))&&(C=v),C>=0){var B=C===a.tabbableGroups.length-1?0:C+1,x=a.tabbableGroups[B];g=L(r)>=0?x.firstTabbableNode:x.firstDomTabbableNode}else G(c)||(g=S.nextTabbableNode(r))}}else g=k("fallbackFocus");return g},q=function(n){var r=Z(n);if(!(F(r,n)>=0)){if(V(l.clickOutsideDeactivates,n)){y.deactivate({returnFocus:l.returnFocusOnDeactivate});return}V(l.allowOutsideClick,n)||n.preventDefault()}},H=function(n){var r=Z(n),c=F(r,n)>=0;if(c||r instanceof Document)c&&(a.mostRecentlyFocusedNode=r);else{n.stopImmediatePropagation();var h,p=!0;if(a.mostRecentlyFocusedNode)if(L(a.mostRecentlyFocusedNode)>0){var g=F(a.mostRecentlyFocusedNode),v=a.containerGroups[g].tabbableNodes;if(v.length>0){var S=v.findIndex(function(E){return E===a.mostRecentlyFocusedNode});S>=0&&(l.isKeyForward(a.recentNavEvent)?S+1<v.length&&(h=v[S+1],p=!1):S-1>=0&&(h=v[S-1],p=!1))}}else a.containerGroups.some(function(E){return E.tabbableNodes.some(function(R){return L(R)>0})})||(p=!1);else p=!1;p&&(h=j({target:a.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(a.recentNavEvent)})),P(h||a.mostRecentlyFocusedNode||D())}a.recentNavEvent=void 0},ae=function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=n;var c=j({event:n,isBackward:r});c&&(G(n)&&n.preventDefault(),P(c))},W=function(n){(l.isKeyForward(n)||l.isKeyBackward(n))&&ae(n,l.isKeyBackward(n))},z=function(n){ze(n)&&V(l.escapeDeactivates,n)!==!1&&(n.preventDefault(),y.deactivate())},$=function(n){var r=Z(n);F(r,n)>=0||V(l.clickOutsideDeactivates,n)||V(l.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())},d=function(){if(a.active)return I.activateTrap(s,y),a.delayInitialFocusTimer=l.delayInitialFocus?de(function(){P(D())}):P(D()),o.addEventListener("focusin",H,!0),o.addEventListener("mousedown",q,{capture:!0,passive:!1}),o.addEventListener("touchstart",q,{capture:!0,passive:!1}),o.addEventListener("click",$,{capture:!0,passive:!1}),o.addEventListener("keydown",W,{capture:!0,passive:!1}),o.addEventListener("keydown",z),y},f=function(n){a.active&&!a.paused&&y._setSubtreeIsolation(!1),a.adjacentElements.clear(),a.alreadySilent.clear();var r=new Set,c=new Set,h=ce(n),p;try{for(h.s();!(p=h.n()).done;){var g=p.value;r.add(g);for(var v=typeof ShadowRoot<"u"&&g.getRootNode()instanceof ShadowRoot,S=g;S;){r.add(S);var E=S.parentElement,R=[];E?R=E.children:!E&&v&&(R=S.getRootNode().children,E=S.getRootNode().host,v=typeof ShadowRoot<"u"&&E.getRootNode()instanceof ShadowRoot);var A=ce(R),C;try{for(A.s();!(C=A.n()).done;){var B=C.value;c.add(B)}}catch(x){A.e(x)}finally{A.f()}S=E}}}catch(x){h.e(x)}finally{h.f()}r.forEach(function(x){c.delete(x)}),a.adjacentElements=c},m=function(){if(a.active)return o.removeEventListener("focusin",H,!0),o.removeEventListener("mousedown",q,!0),o.removeEventListener("touchstart",q,!0),o.removeEventListener("click",$,!0),o.removeEventListener("keydown",W,!0),o.removeEventListener("keydown",z),y},u=function(n){var r=n.some(function(c){var h=Array.from(c.removedNodes);return h.some(function(p){return p===a.mostRecentlyFocusedNode})});r&&P(D())},w=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(u):void 0,O=function(){w&&(w.disconnect(),a.active&&!a.paused&&a.containers.map(function(n){w.observe(n,{subtree:!0,childList:!0})}))};return y={get active(){return a.active},get paused(){return a.paused},activate:function(n){if(a.active)return this;var r=T(n,"onActivate"),c=T(n,"onPostActivate"),h=T(n,"checkCanFocusTrap"),p=I.getActiveTrap(s),g=!1;if(p&&!p.paused){var v;(v=p._setSubtreeIsolation)===null||v===void 0||v.call(p,!1),g=!0}try{h||N(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=_(o),r==null||r();var S=function(){h&&N(),d(),O(),l.isolateSubtrees&&y._setSubtreeIsolation(!0),c==null||c()};if(h)return h(a.containers.concat()).then(S,S),this;S()}catch(R){if(p===I.getActiveTrap(s)&&g){var E;(E=p._setSubtreeIsolation)===null||E===void 0||E.call(p,!0)}throw R}return this},deactivate:function(n){if(!a.active)return this;var r=fe({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},n);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,a.paused||y._setSubtreeIsolation(!1),a.alreadySilent.clear(),m(),a.active=!1,a.paused=!1,O(),I.deactivateTrap(s,y);var c=T(r,"onDeactivate"),h=T(r,"onPostDeactivate"),p=T(r,"checkCanReturnFocus"),g=T(r,"returnFocus","returnFocusOnDeactivate");c==null||c();var v=function(){de(function(){g&&P(U(a.nodeFocusedBeforeActivation)),h==null||h()})};return g&&p?(p(U(a.nodeFocusedBeforeActivation)).then(v,v),this):(v(),this)},pause:function(n){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,n)):this},unpause:function(n){return a.active?(a.manuallyPaused=!1,s[s.length-1]!==this?this:this._setPausedState(!1,n)):this},updateContainerElements:function(n){var r=[].concat(n).filter(Boolean);return a.containers=r.map(function(c){return typeof c=="string"?o.querySelector(c):c}),l.isolateSubtrees&&f(a.containers),a.active&&(N(),l.isolateSubtrees&&!a.paused&&y._setSubtreeIsolation(!0)),O(),this}},Object.defineProperties(y,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(n,r){if(a.paused===n)return this;if(a.paused=n,n){var c=T(r,"onPause"),h=T(r,"onPostPause");c==null||c(),m(),O(),y._setSubtreeIsolation(!1),h==null||h()}else{var p=T(r,"onUnpause"),g=T(r,"onPostUnpause");p==null||p(),y._setSubtreeIsolation(!0),N(),d(),O(),g==null||g()}return this}},_setSubtreeIsolation:{value:function(n){l.isolateSubtrees&&a.adjacentElements.forEach(function(r){var c;if(n)switch(l.isolateSubtrees){case"aria-hidden":(r.ariaHidden==="true"||((c=r.getAttribute("aria-hidden"))===null||c===void 0?void 0:c.toLowerCase())==="true")&&a.alreadySilent.add(r),r.setAttribute("aria-hidden","true");break;default:(r.inert||r.hasAttribute("inert"))&&a.alreadySilent.add(r),r.setAttribute("inert",!0);break}else if(!a.alreadySilent.has(r))switch(l.isolateSubtrees){case"aria-hidden":r.removeAttribute("aria-hidden");break;default:r.removeAttribute("inert");break}})}}}),y.updateContainerElements(e),y};const Qe=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:Je},Symbol.toStringTag,{value:"Module"})),et=be.getAugmentedNamespace(Qe),tt=be.getAugmentedNamespace(Ke);var ve;function rt(){if(ve)return Y.exports;ve=1;function i(d){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},i(d)}var e,t;function o(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}function s(d,f){for(var m=0;m<f.length;m++){var u=f[m];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(d,P(u.key),u)}}function l(d,f,m){return f&&s(d.prototype,f),Object.defineProperty(d,"prototype",{writable:!1}),d}function a(d,f,m){return f=k(f),y(d,F()?Reflect.construct(f,m||[],k(d).constructor):f.apply(d,m))}function y(d,f){if(f&&(i(f)=="object"||typeof f=="function"))return f;if(f!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T(d)}function T(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function F(){try{var d=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F=function(){return!!d})()}function k(d){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},k(d)}function D(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),f&&N(d,f)}function N(d,f){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,u){return m.__proto__=u,m},N(d,f)}function _(d,f,m){return(f=P(f))in d?Object.defineProperty(d,f,{value:m,enumerable:!0,configurable:!0,writable:!0}):d[f]=m,d}function P(d){var f=U(d,"string");return i(f)=="symbol"?f:f+""}function U(d,f){if(i(d)!="object"||!d)return d;var m=d[Symbol.toPrimitive];if(m!==void 0){var u=m.call(d,f);if(i(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(d)}var j=Fe,q=et,H=q.createFocusTrap,ae=tt,W=ae.isFocusable,z=parseInt((e=(t=/^(\d+)\./.exec(j.version))===null||t===void 0?void 0:t[1])!==null&&e!==void 0?e:0,10),$=(function(d){function f(m){var u;o(this,f),u=a(this,f,[m]),_(u,"getNodeForOption",function(b){var n,r=(n=this.internalOptions[b])!==null&&n!==void 0?n:this.originalOptions[b];if(typeof r=="function"){for(var c=arguments.length,h=new Array(c>1?c-1:0),p=1;p<c;p++)h[p-1]=arguments[p];r=r.apply(void 0,h)}if(r===!0&&(r=void 0),!r){if(r===void 0||r===!1)return r;throw new Error("`".concat(b,"` was specified but was not a node, or did not return a node"))}var g=r;if(typeof r=="string"){var v;if(g=(v=this.getDocument())===null||v===void 0?void 0:v.querySelector(r),!g)throw new Error("`".concat(b,"` as selector refers to no known node"))}return g}),u.handleDeactivate=u.handleDeactivate.bind(u),u.handlePostDeactivate=u.handlePostDeactivate.bind(u),u.handleClickOutsideDeactivates=u.handleClickOutsideDeactivates.bind(u),u.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:u.handleDeactivate,onPostDeactivate:u.handlePostDeactivate,clickOutsideDeactivates:u.handleClickOutsideDeactivates},u.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var w=m.focusTrapOptions;for(var O in w)if(Object.prototype.hasOwnProperty.call(w,O)){if(O==="returnFocusOnDeactivate"||O==="onDeactivate"||O==="onPostDeactivate"||O==="checkCanReturnFocus"||O==="clickOutsideDeactivates"){u.originalOptions[O]=w[O];continue}u.internalOptions[O]=w[O]}return u.outsideClick=null,u.focusTrapElements=m.containerElements||[],u.updatePreviousElement(),u}return D(f,d),l(f,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var u=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return u||(u===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var u=this.getDocument();u&&(this.previouslyFocusedElement=u.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(u){var w=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,u):this.originalOptions.clickOutsideDeactivates;return w&&(this.outsideClick={target:u.target,allowDeactivation:w}),w}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var u=this,w=function(){var b=u.getReturnFocusNode(),n=!!(u.originalOptions.returnFocusOnDeactivate&&b!==null&&b!==void 0&&b.focus&&(!u.outsideClick||u.outsideClick.allowDeactivation&&!W(u.outsideClick.target,u.internalOptions.tabbableOptions))),r=u.internalOptions.preventScroll,c=r===void 0?!1:r;n&&b.focus({preventScroll:c}),u.originalOptions.onPostDeactivate&&u.originalOptions.onPostDeactivate.call(null),u.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(w,w):w()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var u=this.focusTrapElements.some(Boolean);u&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(u){if(this.focusTrap){u.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var w=!u.active&&this.props.active,O=u.active&&!this.props.active,b=!u.paused&&this.props.paused,n=u.paused&&!this.props.paused;if(w&&(this.updatePreviousElement(),this.focusTrap.activate()),O){this.deactivateTrap();return}b&&this.focusTrap.pause(),n&&this.focusTrap.unpause()}else u.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var u=this,w=this.props.children?j.Children.only(this.props.children):void 0;if(w){if(w.type&&w.type===j.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var O=function(r){var c=u.props.containerElements;w&&(z>=19?typeof w.props.ref=="function"?w.props.ref(r):w.props.ref&&(w.props.ref.current=r):typeof w.ref=="function"?w.ref(r):w.ref&&(w.ref.current=r)),u.focusTrapElements=c||[r]},b=j.cloneElement(w,{ref:O});return b}return null}}])})(j.Component);return $.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:H},Y.exports=$,Y.exports.FocusTrap=$,Y.exports}var at=rt();exports.focusTrapReactExports=at;
|