@vygruppen/spor-react 9.11.4 → 9.13.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/dist/index.js CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  var react = require('@chakra-ui/react');
4
4
  var React88 = require('react');
5
- var lottieReact = require('lottie-react');
6
5
  var reactAria = require('react-aria');
7
6
  var sporIconReact = require('@vygruppen/spor-icon-react');
8
7
  var reactStately = require('react-stately');
9
8
  var awesomePhonenumber = require('awesome-phonenumber');
9
+ var lottieReact = require('lottie-react');
10
10
  var sporLoader = require('@vygruppen/spor-loader');
11
11
  var framerMotion = require('framer-motion');
12
12
  var date = require('@internationalized/date');
@@ -90,583 +90,213 @@ var init_Stack = __esm({
90
90
  );
91
91
  }
92
92
  });
93
- exports.RadioCard = void 0;
94
- var init_RadioCard = __esm({
95
- "src/layout/RadioCard.tsx"() {
96
- exports.RadioCard = react.forwardRef(
97
- ({ children, variant = "base", isChecked, onChange, ...props }, ref) => {
98
- const styles3 = react.useMultiStyleConfig("RadioCard", { variant });
99
- const id = `radio-card-${React88.useId()}`;
100
- const handleChange = (event) => {
101
- onChange && onChange(event);
102
- };
103
- return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { as: "label", htmlFor: id, "aria-label": String(children), ref }, /* @__PURE__ */ React88__namespace.default.createElement(
104
- react.chakra.input,
105
- {
106
- type: "radio",
107
- id,
108
- checked: isChecked,
109
- onChange: handleChange,
110
- ...props,
111
- sx: styles3.radioInput
93
+ exports.AttachedInputs = void 0;
94
+ var init_AttachedInputs = __esm({
95
+ "src/input/AttachedInputs.tsx"() {
96
+ init_src();
97
+ exports.AttachedInputs = ({
98
+ flexDirection = "row",
99
+ ...rest
100
+ }) => {
101
+ const attachedStyles = {
102
+ horizontal: {
103
+ "> *:first-of-type:not(:last-of-type) [data-attachable]": {
104
+ borderEndRadius: 0
105
+ },
106
+ "> *:not(:first-of-type):not(:last-of-type) [data-attachable]": {
107
+ borderRadius: 0
108
+ },
109
+ "> *:not(:first-of-type):last-of-type [data-attachable]": {
110
+ borderStartRadius: 0
112
111
  }
113
- ), /* @__PURE__ */ React88__namespace.default.createElement(
112
+ },
113
+ vertical: {
114
+ "> *:first-of-type:not(:last-of-type) [data-attachable]": {
115
+ borderBottomRadius: 0
116
+ },
117
+ "> *:not(:first-of-type):not(:last-of-type) [data-attachable]": {
118
+ borderRadius: 0
119
+ },
120
+ "> *:not(:first-of-type):last-of-type [data-attachable]": {
121
+ borderTopRadius: 0
122
+ }
123
+ }
124
+ };
125
+ const direction2 = flexDirection === "row" ? "horizontal" : "vertical";
126
+ return /* @__PURE__ */ React88__namespace.default.createElement(
127
+ react.Flex,
128
+ {
129
+ role: "group",
130
+ __css: attachedStyles[direction2],
131
+ display: "flex",
132
+ flexDirection,
133
+ ...rest
134
+ }
135
+ );
136
+ };
137
+ }
138
+ });
139
+ var Dialog;
140
+ var init_Dialog = __esm({
141
+ "src/input/Dialog.tsx"() {
142
+ Dialog = ({ title, children, ...props }) => {
143
+ const ref = React88.useRef(null);
144
+ const { dialogProps, titleProps } = reactAria.useDialog(props, ref);
145
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { ...dialogProps, ref, outline: "none" }, title && /* @__PURE__ */ React88__namespace.default.createElement(react.Heading, { as: "h3", ...titleProps }, title), children);
146
+ };
147
+ }
148
+ });
149
+ var Popover;
150
+ var init_Popover = __esm({
151
+ "src/input/Popover.tsx"() {
152
+ Popover = React88.forwardRef(
153
+ ({
154
+ children,
155
+ state: state2,
156
+ triggerRef,
157
+ offset = 0,
158
+ crossOffset = 0,
159
+ placement = "bottom",
160
+ shouldFlip = false,
161
+ isNonModal = false,
162
+ hasBackdrop = true,
163
+ containerPadding = 12
164
+ }, ref) => {
165
+ var _a6;
166
+ const internalRef = React88.useRef(null);
167
+ const popoverRef = ref ?? internalRef;
168
+ const { popoverProps, underlayProps } = reactAria.usePopover(
169
+ {
170
+ triggerRef,
171
+ popoverRef,
172
+ offset,
173
+ crossOffset,
174
+ placement,
175
+ shouldFlip,
176
+ isNonModal,
177
+ containerPadding
178
+ },
179
+ state2
180
+ );
181
+ const popoverBox = /* @__PURE__ */ React88__namespace.default.createElement(
114
182
  react.Box,
115
183
  {
116
- ...props,
117
- __css: {
118
- ...styles3.container,
119
- ...isChecked && styles3.checked
120
- }
184
+ ...popoverProps,
185
+ ref: popoverRef,
186
+ minWidth: ((_a6 = triggerRef.current) == null ? void 0 : _a6.clientWidth) ?? "auto"
121
187
  },
122
- children
123
- ));
188
+ /* @__PURE__ */ React88__namespace.default.createElement(reactAria.DismissButton, { onDismiss: state2.close }),
189
+ children,
190
+ /* @__PURE__ */ React88__namespace.default.createElement(reactAria.DismissButton, { onDismiss: state2.close })
191
+ );
192
+ if (isNonModal) {
193
+ return popoverBox;
194
+ }
195
+ return /* @__PURE__ */ React88__namespace.default.createElement(reactAria.Overlay, null, hasBackdrop && /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { ...underlayProps, position: "fixed", inset: "0" }), popoverBox);
124
196
  }
125
197
  );
126
198
  }
127
199
  });
128
- function recursiveMap(children, fn) {
129
- return React88__namespace.default.Children.map(children, (child) => {
130
- if (React88__namespace.default.isValidElement(child) && child.props.children) {
131
- child = React88__namespace.default.cloneElement(child, {
132
- children: recursiveMap(child.props.children, fn)
133
- });
134
- }
135
- if (React88__namespace.default.isValidElement(child)) {
136
- return fn(child);
200
+ function useForceRerender(shouldRerender) {
201
+ const [_, update] = React88.useState(false);
202
+ React88.useEffect(() => {
203
+ if (shouldRerender) {
204
+ update((x) => !x);
137
205
  }
138
- return child;
139
- });
206
+ }, [shouldRerender]);
140
207
  }
141
- exports.RadioCardGroup = void 0;
142
- var init_RadioCardGroup = __esm({
143
- "src/layout/RadioCardGroup.tsx"() {
144
- init_RadioCard();
145
- exports.RadioCardGroup = ({
146
- children,
147
- name,
148
- direction: direction2 = "row",
149
- onChange,
150
- defaultValue,
151
- variant = "base",
152
- ...props
153
- }) => {
154
- const { getRootProps, getRadioProps } = react.useRadioGroup({
155
- defaultValue,
156
- name,
157
- onChange,
208
+ exports.CardSelect = void 0;
209
+ var init_CardSelect = __esm({
210
+ "src/input/CardSelect.tsx"() {
211
+ init_src();
212
+ init_Dialog();
213
+ init_Popover();
214
+ exports.CardSelect = react.forwardRef(
215
+ ({
216
+ variant,
217
+ size: size2,
218
+ isOpen: externalIsOpen,
219
+ defaultOpen = false,
220
+ onToggle,
221
+ icon,
222
+ children,
223
+ width = "fit-content",
224
+ crossOffset = 0,
225
+ placement = "bottom",
226
+ withChevron = true,
227
+ fontWeight = "normal",
158
228
  ...props
159
- });
160
- const rootProps = getRootProps();
161
- return /* @__PURE__ */ React88__namespace.default.createElement(react.Stack, { direction: direction2, ...rootProps }, recursiveMap(children, (child) => {
162
- if (child.type === exports.RadioCard) {
163
- const radioProps = getRadioProps({ value: child.props.value });
164
- const variantValue = variant;
165
- return React88__namespace.default.cloneElement(
166
- child,
229
+ }, externalRef) => {
230
+ const label = "label" in props ? props.label : props["aria-label"];
231
+ const internalRef = React88.useRef(null);
232
+ const triggerRef = externalRef ?? internalRef;
233
+ const state2 = reactStately.useOverlayTriggerState({
234
+ isOpen: externalIsOpen,
235
+ onOpenChange: onToggle,
236
+ defaultOpen
237
+ });
238
+ const { triggerProps, overlayProps } = reactAria.useOverlayTrigger(
239
+ { type: "dialog" },
240
+ state2,
241
+ triggerRef
242
+ );
243
+ const { buttonProps } = reactAria.useButton(triggerProps, triggerRef);
244
+ const styles3 = react.useMultiStyleConfig("CardSelect", {
245
+ variant,
246
+ size: size2
247
+ });
248
+ useForceRerender(state2.isOpen);
249
+ const ChevronIcon = size2 === "sm" ? sporIconReact.DropdownDownFill18Icon : sporIconReact.DropdownDownFill24Icon;
250
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { ...props }, /* @__PURE__ */ React88__namespace.default.createElement(
251
+ react.chakra.button,
252
+ {
253
+ type: "button",
254
+ ref: triggerRef,
255
+ fontWeight: "bold",
256
+ sx: styles3.trigger,
257
+ "aria-label": label,
258
+ ...buttonProps,
259
+ width,
260
+ "data-attachable": true
261
+ },
262
+ /* @__PURE__ */ React88__namespace.default.createElement(react.Flex, { gap: 1.5, alignItems: "center" }, icon, /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { as: "span", display: props["aria-label"] ? "none" : "inline" }, label), withChevron ? /* @__PURE__ */ React88__namespace.default.createElement(
263
+ ChevronIcon,
167
264
  {
168
- ...radioProps,
169
- variant: variantValue,
170
- ...props
265
+ transform: state2.isOpen ? "rotate(180deg)" : "none"
171
266
  }
172
- );
173
- }
174
- return child;
175
- }));
176
- };
177
- }
178
- });
179
- exports.StaticCard = void 0;
180
- var init_StaticCard = __esm({
181
- "src/layout/StaticCard.tsx"() {
182
- exports.StaticCard = react.forwardRef(
183
- ({ colorScheme = "white", children, ...props }, ref) => {
184
- const styles3 = react.useStyleConfig("StaticCard", {
185
- colorScheme
186
- });
187
- return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { __css: styles3, ...props, ref }, children);
267
+ ) : null)
268
+ ), state2.isOpen && /* @__PURE__ */ React88__namespace.default.createElement(
269
+ Popover,
270
+ {
271
+ state: state2,
272
+ triggerRef,
273
+ offset: size2 === "sm" ? 6 : 12,
274
+ crossOffset,
275
+ placement
276
+ },
277
+ /* @__PURE__ */ React88__namespace.default.createElement(
278
+ exports.StaticCard,
279
+ {
280
+ colorScheme: "white",
281
+ size: "lg",
282
+ border: "sm",
283
+ borderColor: "grey",
284
+ sx: styles3.card,
285
+ ...overlayProps
286
+ },
287
+ /* @__PURE__ */ React88__namespace.default.createElement(Dialog, { "aria-label": label }, children)
288
+ )
289
+ ));
188
290
  }
189
291
  );
190
292
  }
191
293
  });
192
- exports.PressableCard = void 0;
193
- var init_PressableCard = __esm({
194
- "src/layout/PressableCard.tsx"() {
195
- exports.PressableCard = react.forwardRef(
196
- ({ children, variant = "floating", ...props }, ref) => {
197
- const styles3 = react.useStyleConfig("PressableCard", {
198
- variant
199
- });
200
- return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { __css: styles3, ...props, ref }, children);
201
- }
202
- );
203
- }
204
- });
205
- var init_layout = __esm({
206
- "src/layout/index.tsx"() {
207
- init_Divider();
208
- init_Stack();
209
- init_RadioCard();
210
- init_RadioCardGroup();
211
- init_StaticCard();
212
- init_PressableCard();
213
- }
214
- });
215
- var AccordionContext, AccordionProvider, useAccordionContext;
216
- var init_AccordionContext = __esm({
217
- "src/accordion/AccordionContext.tsx"() {
218
- AccordionContext = React88__namespace.default.createContext(null);
219
- AccordionProvider = ({
220
- size: size2,
221
- ...props
222
- }) => {
223
- return /* @__PURE__ */ React88__namespace.default.createElement(AccordionContext.Provider, { value: { size: size2 }, ...props });
224
- };
225
- useAccordionContext = () => {
226
- const context = React88__namespace.default.useContext(AccordionContext);
227
- if (context === null) {
228
- throw new Error(
229
- "useAccordionContext must be used within AccordionProvider"
230
- );
231
- }
232
- return context;
233
- };
234
- }
235
- });
236
- exports.Accordion = void 0;
237
- var init_Accordion = __esm({
238
- "src/accordion/Accordion.tsx"() {
239
- init_layout();
240
- init_AccordionContext();
241
- exports.Accordion = react.forwardRef(
242
- ({ children, spacing: spacing3 = 2, ...props }, ref) => {
243
- const defaultIndex = typeof props.defaultIndex === "number" && props.allowMultiple ? [props.defaultIndex] : props.defaultIndex;
244
- return /* @__PURE__ */ React88__namespace.default.createElement(AccordionProvider, { size: props.size }, /* @__PURE__ */ React88__namespace.default.createElement(
245
- react.Accordion,
246
- {
247
- ...props,
248
- ref,
249
- defaultIndex
250
- },
251
- /* @__PURE__ */ React88__namespace.default.createElement(exports.Stack, { spacing: spacing3 }, children)
252
- ));
253
- }
254
- );
255
- }
256
- });
257
- exports.Expandable = void 0; exports.ExpandableItem = void 0; var warnAboutMismatchingIcon;
258
- var init_Expandable = __esm({
259
- "src/accordion/Expandable.tsx"() {
260
- init_Accordion();
261
- init_AccordionContext();
262
- exports.Expandable = ({
263
- children,
264
- headingLevel,
265
- title,
266
- leftIcon,
267
- size: size2 = "md",
268
- defaultOpen,
269
- isOpen,
270
- onChange = () => {
271
- },
272
- ...rest
273
- }) => {
274
- return /* @__PURE__ */ React88__namespace.default.createElement(
275
- exports.Accordion,
276
- {
277
- ...rest,
278
- index: isOpen ? 0 : void 0,
279
- defaultIndex: defaultOpen ? 0 : void 0,
280
- allowMultiple: true,
281
- size: size2,
282
- onChange: (expandedIndex) => onChange(expandedIndex === 0)
283
- },
284
- /* @__PURE__ */ React88__namespace.default.createElement(
285
- exports.ExpandableItem,
286
- {
287
- headingLevel,
288
- title,
289
- leftIcon
290
- },
291
- children
292
- )
293
- );
294
- };
295
- exports.ExpandableItem = ({
296
- children,
297
- title,
298
- headingLevel = "h3",
299
- leftIcon,
300
- ...rest
301
- }) => {
302
- const { size: size2 } = useAccordionContext();
303
- warnAboutMismatchingIcon({ icon: leftIcon, size: size2 });
304
- return /* @__PURE__ */ React88__namespace.default.createElement(react.AccordionItem, { ...rest }, /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { as: headingLevel }, /* @__PURE__ */ React88__namespace.default.createElement(react.AccordionButton, null, /* @__PURE__ */ React88__namespace.default.createElement(react.Flex, { alignItems: "center" }, leftIcon && /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { marginRight: 1 }, leftIcon), title), /* @__PURE__ */ React88__namespace.default.createElement(react.AccordionIcon, null))), /* @__PURE__ */ React88__namespace.default.createElement(react.AccordionPanel, null, children));
305
- };
306
- warnAboutMismatchingIcon = ({ icon, size: size2 }) => {
307
- var _a6, _b5;
308
- if (process.env.NODE_ENV !== "production") {
309
- const displayName = (_b5 = (_a6 = icon == null ? void 0 : icon.type) == null ? void 0 : _a6.render) == null ? void 0 : _b5.displayName;
310
- if (!displayName) {
311
- return;
312
- }
313
- if (displayName.includes("Fill")) {
314
- console.warn(
315
- `You passed a filled icon. This component requires outlined icons. You passed ${displayName}, replace it with ${displayName.replace(
316
- "Fill",
317
- "Outline"
318
- )}.`
319
- );
320
- return;
321
- }
322
- if (size2 === "lg" && !displayName.includes("30Icon")) {
323
- console.warn(
324
- `The icon you passed was of the wrong size for the lg size. You passed ${displayName}, replace it with ${displayName.replace(
325
- /(\d{2})Icon/,
326
- "30Icon"
327
- )}.`
328
- );
329
- return;
330
- }
331
- if (["md"].includes(size2) && !displayName.includes("24Icon")) {
332
- console.warn(
333
- `The icon you passed was of the wrong size for the ${size2} size. You passed ${displayName}, replace it with ${displayName.replace(
334
- /(\d{2})Icon/,
335
- "24Icon"
336
- )}.`
337
- );
338
- }
339
- }
340
- };
341
- }
342
- });
343
-
344
- // src/accordion/index.tsx
345
- var init_accordion = __esm({
346
- "src/accordion/index.tsx"() {
347
- init_Accordion();
348
- init_Expandable();
349
- }
350
- });
351
- function LanguageProvider({
352
- language,
353
- children
354
- }) {
355
- return /* @__PURE__ */ React88__namespace.default.createElement(LanguageContext.Provider, { value: language }, children);
356
- }
357
- function useLanguage() {
358
- const language = React88.useContext(LanguageContext);
359
- if (!language) {
360
- throw new Error("Please wrap your application in a LanguageProvider");
361
- }
362
- return language;
363
- }
364
- function useTranslation() {
365
- const language = useLanguage();
366
- const t2 = (text) => {
367
- return text[language];
368
- };
369
- return { t: t2, language };
370
- }
371
- function createTexts(texts29) {
372
- return texts29;
373
- }
374
- exports.Language = void 0; var LanguageContext;
375
- var init_i18n = __esm({
376
- "src/i18n/index.tsx"() {
377
- exports.Language = /* @__PURE__ */ ((Language3) => {
378
- Language3["NorwegianBokmal"] = "nb";
379
- Language3["NorwegianNynorsk"] = "nn";
380
- Language3["Swedish"] = "sv";
381
- Language3["English"] = "en";
382
- return Language3;
383
- })(exports.Language || {});
384
- LanguageContext = React88.createContext(void 0);
385
- }
386
- });
387
- function useHydrated() {
388
- let [hydrated, setHydrated] = React88.useState(() => !hydrating);
389
- React88.useEffect(function hydrate() {
390
- hydrating = false;
391
- setHydrated(true);
392
- }, []);
393
- return hydrated;
394
- }
395
- var hydrating;
396
- var init_useHydrated = __esm({
397
- "src/loader/useHydrated.tsx"() {
398
- hydrating = true;
399
- }
400
- });
401
- var ClientOnly;
402
- var init_ClientOnly = __esm({
403
- "src/loader/ClientOnly.tsx"() {
404
- init_useHydrated();
405
- ClientOnly = ({ children, fallback = null }) => {
406
- const isHydrated = useHydrated();
407
- return /* @__PURE__ */ React88__namespace.default.createElement(React88__namespace.default.Fragment, null, isHydrated ? children() : fallback);
408
- };
409
- }
410
- });
411
- function Lottie({ animationData }) {
412
- const { View } = lottieReact.useLottie({ animationData, loop: true });
413
- return /* @__PURE__ */ React88__namespace.default.createElement(React88__namespace.default.Fragment, null, View);
414
- }
415
- var init_Lottie = __esm({
416
- "src/loader/Lottie.tsx"() {
417
- }
418
- });
419
- var PrideContext; exports.PrideProvider = void 0; exports.usePride = void 0;
420
- var init_PrideProvider = __esm({
421
- "src/pride/PrideProvider.tsx"() {
422
- PrideContext = React88.createContext(void 0);
423
- exports.PrideProvider = ({
424
- children
425
- }) => {
426
- const isBrowser2 = typeof window !== "undefined";
427
- const key = "spor__isPride";
428
- const [isPride, setIsPride] = React88.useState(() => {
429
- if (isBrowser2) {
430
- const savedState = localStorage.getItem(key);
431
- return savedState ? JSON.parse(savedState) : true;
432
- }
433
- return true;
434
- });
435
- const togglePride = () => {
436
- setIsPride((prev) => {
437
- const newState = !prev;
438
- if (isBrowser2) {
439
- localStorage.setItem(key, JSON.stringify(newState));
440
- }
441
- return newState;
442
- });
443
- };
444
- React88.useEffect(() => {
445
- if (isBrowser2) {
446
- const savedState = localStorage.getItem(key);
447
- if (savedState) {
448
- setIsPride(JSON.parse(savedState));
449
- }
450
- }
451
- }, [isBrowser2]);
452
- return /* @__PURE__ */ React88__namespace.default.createElement(PrideContext.Provider, { value: { isPride, togglePride } }, children);
453
- };
454
- exports.usePride = () => {
455
- const context = React88.useContext(PrideContext);
456
- if (context === void 0) {
457
- throw new Error("usePride must be used within a PrideProvider");
458
- }
459
- return context;
460
- };
461
- }
462
- });
463
- exports.AttachedInputs = void 0;
464
- var init_AttachedInputs = __esm({
465
- "src/input/AttachedInputs.tsx"() {
466
- init_src();
467
- exports.AttachedInputs = ({
468
- flexDirection = "row",
469
- ...rest
470
- }) => {
471
- const attachedStyles = {
472
- horizontal: {
473
- "> *:first-of-type:not(:last-of-type) [data-attachable]": {
474
- borderEndRadius: 0
475
- },
476
- "> *:not(:first-of-type):not(:last-of-type) [data-attachable]": {
477
- borderRadius: 0
478
- },
479
- "> *:not(:first-of-type):last-of-type [data-attachable]": {
480
- borderStartRadius: 0
481
- }
482
- },
483
- vertical: {
484
- "> *:first-of-type:not(:last-of-type) [data-attachable]": {
485
- borderBottomRadius: 0
486
- },
487
- "> *:not(:first-of-type):not(:last-of-type) [data-attachable]": {
488
- borderRadius: 0
489
- },
490
- "> *:not(:first-of-type):last-of-type [data-attachable]": {
491
- borderTopRadius: 0
492
- }
493
- }
494
- };
495
- const direction2 = flexDirection === "row" ? "horizontal" : "vertical";
496
- return /* @__PURE__ */ React88__namespace.default.createElement(
497
- react.Flex,
498
- {
499
- role: "group",
500
- __css: attachedStyles[direction2],
501
- display: "flex",
502
- flexDirection,
503
- ...rest
504
- }
505
- );
506
- };
507
- }
508
- });
509
- var Dialog;
510
- var init_Dialog = __esm({
511
- "src/input/Dialog.tsx"() {
512
- Dialog = ({ title, children, ...props }) => {
513
- const ref = React88.useRef(null);
514
- const { dialogProps, titleProps } = reactAria.useDialog(props, ref);
515
- return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { ...dialogProps, ref, outline: "none" }, title && /* @__PURE__ */ React88__namespace.default.createElement(react.Heading, { as: "h3", ...titleProps }, title), children);
516
- };
517
- }
518
- });
519
- var Popover;
520
- var init_Popover = __esm({
521
- "src/input/Popover.tsx"() {
522
- Popover = React88.forwardRef(
523
- ({
524
- children,
525
- state: state2,
526
- triggerRef,
527
- offset = 0,
528
- crossOffset = 0,
529
- placement = "bottom",
530
- shouldFlip = false,
531
- isNonModal = false,
532
- hasBackdrop = true,
533
- containerPadding = 12
534
- }, ref) => {
535
- var _a6;
536
- const internalRef = React88.useRef(null);
537
- const popoverRef = ref ?? internalRef;
538
- const { popoverProps, underlayProps } = reactAria.usePopover(
539
- {
540
- triggerRef,
541
- popoverRef,
542
- offset,
543
- crossOffset,
544
- placement,
545
- shouldFlip,
546
- isNonModal,
547
- containerPadding
548
- },
549
- state2
550
- );
551
- const popoverBox = /* @__PURE__ */ React88__namespace.default.createElement(
552
- react.Box,
553
- {
554
- ...popoverProps,
555
- ref: popoverRef,
556
- minWidth: ((_a6 = triggerRef.current) == null ? void 0 : _a6.clientWidth) ?? "auto"
557
- },
558
- /* @__PURE__ */ React88__namespace.default.createElement(reactAria.DismissButton, { onDismiss: state2.close }),
559
- children,
560
- /* @__PURE__ */ React88__namespace.default.createElement(reactAria.DismissButton, { onDismiss: state2.close })
561
- );
562
- if (isNonModal) {
563
- return popoverBox;
564
- }
565
- return /* @__PURE__ */ React88__namespace.default.createElement(reactAria.Overlay, null, hasBackdrop && /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { ...underlayProps, position: "fixed", inset: "0" }), popoverBox);
566
- }
567
- );
568
- }
569
- });
570
- function useForceRerender(shouldRerender) {
571
- const [_, update] = React88.useState(false);
572
- React88.useEffect(() => {
573
- if (shouldRerender) {
574
- update((x) => !x);
575
- }
576
- }, [shouldRerender]);
577
- }
578
- exports.CardSelect = void 0;
579
- var init_CardSelect = __esm({
580
- "src/input/CardSelect.tsx"() {
581
- init_src();
582
- init_Dialog();
583
- init_Popover();
584
- exports.CardSelect = react.forwardRef(
585
- ({
586
- variant,
587
- size: size2,
588
- isOpen: externalIsOpen,
589
- defaultOpen = false,
590
- onToggle,
591
- icon,
592
- children,
593
- width = "fit-content",
594
- crossOffset = 0,
595
- placement = "bottom",
596
- withChevron = true,
597
- fontWeight = "normal",
598
- ...props
599
- }, externalRef) => {
600
- const label = "label" in props ? props.label : props["aria-label"];
601
- const internalRef = React88.useRef(null);
602
- const triggerRef = externalRef ?? internalRef;
603
- const state2 = reactStately.useOverlayTriggerState({
604
- isOpen: externalIsOpen,
605
- onOpenChange: onToggle,
606
- defaultOpen
607
- });
608
- const { triggerProps, overlayProps } = reactAria.useOverlayTrigger(
609
- { type: "dialog" },
610
- state2,
611
- triggerRef
612
- );
613
- const { buttonProps } = reactAria.useButton(triggerProps, triggerRef);
614
- const styles3 = react.useMultiStyleConfig("CardSelect", {
615
- variant,
616
- size: size2
617
- });
618
- useForceRerender(state2.isOpen);
619
- const ChevronIcon = size2 === "sm" ? sporIconReact.DropdownDownFill18Icon : sporIconReact.DropdownDownFill24Icon;
620
- return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { ...props }, /* @__PURE__ */ React88__namespace.default.createElement(
621
- react.chakra.button,
622
- {
623
- type: "button",
624
- ref: triggerRef,
625
- fontWeight: "bold",
626
- sx: styles3.trigger,
627
- "aria-label": label,
628
- ...buttonProps,
629
- width,
630
- "data-attachable": true
631
- },
632
- /* @__PURE__ */ React88__namespace.default.createElement(react.Flex, { gap: 1.5, alignItems: "center" }, icon, /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { as: "span", display: props["aria-label"] ? "none" : "inline" }, label), withChevron ? /* @__PURE__ */ React88__namespace.default.createElement(
633
- ChevronIcon,
634
- {
635
- transform: state2.isOpen ? "rotate(180deg)" : "none"
636
- }
637
- ) : null)
638
- ), state2.isOpen && /* @__PURE__ */ React88__namespace.default.createElement(
639
- Popover,
640
- {
641
- state: state2,
642
- triggerRef,
643
- offset: size2 === "sm" ? 6 : 12,
644
- crossOffset,
645
- placement
646
- },
647
- /* @__PURE__ */ React88__namespace.default.createElement(
648
- exports.StaticCard,
649
- {
650
- colorScheme: "white",
651
- size: "lg",
652
- border: "sm",
653
- borderColor: "grey",
654
- sx: styles3.card,
655
- ...overlayProps
656
- },
657
- /* @__PURE__ */ React88__namespace.default.createElement(Dialog, { "aria-label": label }, children)
658
- )
659
- ));
660
- }
661
- );
662
- }
663
- });
664
- exports.Checkbox = void 0;
665
- var init_Checkbox = __esm({
666
- "src/input/Checkbox.tsx"() {
667
- exports.Checkbox = react.forwardRef((props, ref) => {
668
- return /* @__PURE__ */ React88__namespace.default.createElement(react.Checkbox, { ...props, ref });
669
- });
294
+ exports.Checkbox = void 0;
295
+ var init_Checkbox = __esm({
296
+ "src/input/Checkbox.tsx"() {
297
+ exports.Checkbox = react.forwardRef((props, ref) => {
298
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Checkbox, { ...props, ref });
299
+ });
670
300
  }
671
301
  });
672
302
  exports.CheckboxGroup = void 0;
@@ -2150,376 +1780,776 @@ var init_NumericStepper = __esm({
2150
1780
  });
2151
1781
  }
2152
1782
  });
2153
- exports.PasswordInput = void 0; var texts3;
2154
- var init_PasswordInput = __esm({
2155
- "src/input/PasswordInput.tsx"() {
1783
+ exports.PasswordInput = void 0; var texts3;
1784
+ var init_PasswordInput = __esm({
1785
+ "src/input/PasswordInput.tsx"() {
1786
+ init_input();
1787
+ init_src();
1788
+ exports.PasswordInput = react.forwardRef(
1789
+ ({ leftIcon, id, label, size: size2, ...props }, ref) => {
1790
+ const { isOpen: isShowingPassword, onToggle } = react.useDisclosure();
1791
+ const { t: t2 } = useTranslation();
1792
+ const formControlProps = react.useFormControlContext();
1793
+ const autoGeneratedId = `password-input-${React88.useId()}`;
1794
+ const inputId = id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? autoGeneratedId;
1795
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.InputGroup, { position: "relative" }, leftIcon && /* @__PURE__ */ React88__namespace.default.createElement(exports.InputLeftElement, null, leftIcon), /* @__PURE__ */ React88__namespace.default.createElement(
1796
+ react.Input,
1797
+ {
1798
+ ...props,
1799
+ id: inputId,
1800
+ placeholder: " ",
1801
+ type: isShowingPassword ? "text" : "password",
1802
+ paddingRight: 10,
1803
+ paddingLeft: leftIcon ? 7 : void 0,
1804
+ ref,
1805
+ "data-attachable": true
1806
+ }
1807
+ ), /* @__PURE__ */ React88__namespace.default.createElement(exports.FormLabel, { htmlFor: inputId, pointerEvents: "none" }, label), /* @__PURE__ */ React88__namespace.default.createElement(exports.InputRightElement, { width: "fit-content" }, /* @__PURE__ */ React88__namespace.default.createElement(
1808
+ react.Button,
1809
+ {
1810
+ variant: "ghost",
1811
+ type: "button",
1812
+ fontWeight: "normal",
1813
+ size: "sm",
1814
+ onClick: onToggle,
1815
+ borderRadius: "sm",
1816
+ marginRight: 1,
1817
+ isDisabled: props.disabled || props.isDisabled
1818
+ },
1819
+ isShowingPassword ? t2(texts3.hidePassword) : t2(texts3.showPassword)
1820
+ )));
1821
+ }
1822
+ );
1823
+ texts3 = createTexts({
1824
+ showPassword: {
1825
+ nb: "Vis",
1826
+ nn: "Vis",
1827
+ en: "Show",
1828
+ sv: "Visa"
1829
+ },
1830
+ hidePassword: {
1831
+ nb: "Skjul",
1832
+ nn: "Skjul",
1833
+ en: "Hide",
1834
+ sv: "D\xF6lj"
1835
+ }
1836
+ });
1837
+ }
1838
+ });
1839
+
1840
+ // src/input/CountryCodeSelect.tsx
1841
+ var CountryCodeSelect_exports = {};
1842
+ __export(CountryCodeSelect_exports, {
1843
+ CountryCodeSelect: () => CountryCodeSelect,
1844
+ default: () => CountryCodeSelect_default
1845
+ });
1846
+ var prioritizedCountryCodes, sortedCallingCodes, callingCodes, CountryCodeSelect, CountryCodeSelect_default, texts4;
1847
+ var init_CountryCodeSelect = __esm({
1848
+ "src/input/CountryCodeSelect.tsx"() {
1849
+ init_src();
1850
+ prioritizedCountryCodes = [
1851
+ { key: "+47", value: "+47" },
1852
+ { key: "+46", value: "+46" },
1853
+ { key: "+45", value: "+45" }
1854
+ ];
1855
+ sortedCallingCodes = awesomePhonenumber.getSupportedCallingCodes().sort((a, b) => Number(a) - Number(b)).map((code) => ({
1856
+ key: `+${code}`,
1857
+ value: `+${code}`
1858
+ })).filter(
1859
+ (code) => !prioritizedCountryCodes.some((pCode) => pCode.key === code.key)
1860
+ );
1861
+ callingCodes = [...prioritizedCountryCodes, ...sortedCallingCodes];
1862
+ CountryCodeSelect = (props) => {
1863
+ const { t: t2 } = useTranslation();
1864
+ return /* @__PURE__ */ React88__namespace.default.createElement(
1865
+ InfoSelect,
1866
+ {
1867
+ label: t2(texts4.countryCode),
1868
+ isLabelSrOnly: true,
1869
+ items: callingCodes,
1870
+ ...props
1871
+ },
1872
+ (item) => /* @__PURE__ */ React88__namespace.default.createElement(reactStately.Item, { key: item.key }, item.key)
1873
+ );
1874
+ };
1875
+ CountryCodeSelect_default = CountryCodeSelect;
1876
+ texts4 = createTexts({
1877
+ countryCode: {
1878
+ nb: "Landkode",
1879
+ nn: "Landskode",
1880
+ en: "Country code",
1881
+ sv: "Landskod"
1882
+ }
1883
+ });
1884
+ }
1885
+ });
1886
+ exports.PhoneNumberInput = void 0; var texts5, LazyCountryCodeSelect;
1887
+ var init_PhoneNumberInput = __esm({
1888
+ "src/input/PhoneNumberInput.tsx"() {
1889
+ init_src();
1890
+ init_AttachedInputs();
1891
+ exports.PhoneNumberInput = react.forwardRef(
1892
+ ({
1893
+ label: externalLabel,
1894
+ name,
1895
+ value: externalValue,
1896
+ onChange: externalOnChange,
1897
+ ...boxProps
1898
+ }, ref) => {
1899
+ const { t: t2 } = useTranslation();
1900
+ const label = externalLabel ?? t2(texts5.phoneNumber);
1901
+ const [value, onChange] = react.useControllableState({
1902
+ value: externalValue,
1903
+ onChange: externalOnChange,
1904
+ defaultValue: {
1905
+ countryCode: "+47",
1906
+ nationalNumber: ""
1907
+ }
1908
+ });
1909
+ return /* @__PURE__ */ React88__namespace.default.createElement(exports.AttachedInputs, { ...boxProps }, /* @__PURE__ */ React88__namespace.default.createElement(
1910
+ React88.Suspense,
1911
+ {
1912
+ fallback: /* @__PURE__ */ React88__namespace.default.createElement(
1913
+ InfoSelect,
1914
+ {
1915
+ isLabelSrOnly: true,
1916
+ label: t2(texts5.countryCodeLabel),
1917
+ width: "6.25rem",
1918
+ height: "100%",
1919
+ value: "+47"
1920
+ },
1921
+ /* @__PURE__ */ React88__namespace.default.createElement(reactStately.Item, { key: "+47" }, "+47")
1922
+ )
1923
+ },
1924
+ /* @__PURE__ */ React88__namespace.default.createElement(
1925
+ LazyCountryCodeSelect,
1926
+ {
1927
+ value: value.countryCode,
1928
+ onChange: (countryCode) => onChange({
1929
+ countryCode,
1930
+ nationalNumber: value.nationalNumber
1931
+ }),
1932
+ name: name ? `${name}-country-code` : "country-code",
1933
+ height: "100%",
1934
+ width: "6.25rem"
1935
+ }
1936
+ )
1937
+ ), /* @__PURE__ */ React88__namespace.default.createElement(
1938
+ exports.Input,
1939
+ {
1940
+ ref,
1941
+ type: "tel",
1942
+ label,
1943
+ value: value.nationalNumber,
1944
+ name: name ? `${name}-phone-number` : "phone-number",
1945
+ onChange: (e) => {
1946
+ const strippedValue = e.target.value.replace(/[^\d\s-]/g, "");
1947
+ onChange({
1948
+ countryCode: value.countryCode,
1949
+ nationalNumber: strippedValue
1950
+ });
1951
+ },
1952
+ position: "relative",
1953
+ left: "1px"
1954
+ }
1955
+ ));
1956
+ }
1957
+ );
1958
+ texts5 = createTexts({
1959
+ phoneNumber: {
1960
+ nb: "Telefonnummer",
1961
+ nn: "Telefonnummer",
1962
+ en: "Phone number",
1963
+ sv: "Telefonnummer"
1964
+ },
1965
+ countryCodeLabel: {
1966
+ nb: "Landskode",
1967
+ nn: "Landskode",
1968
+ en: "Country code",
1969
+ sv: "Landskod"
1970
+ }
1971
+ });
1972
+ LazyCountryCodeSelect = React88__namespace.default.lazy(() => Promise.resolve().then(() => (init_CountryCodeSelect(), CountryCodeSelect_exports)));
1973
+ }
1974
+ });
1975
+ exports.Radio = void 0;
1976
+ var init_Radio = __esm({
1977
+ "src/input/Radio.tsx"() {
1978
+ exports.Radio = react.forwardRef((props, ref) => {
1979
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Radio, { ...props, ref });
1980
+ });
1981
+ }
1982
+ });
1983
+ exports.RadioGroup = void 0;
1984
+ var init_RadioGroup = __esm({
1985
+ "src/input/RadioGroup.tsx"() {
1986
+ exports.RadioGroup = react.forwardRef(
1987
+ ({ children, direction: direction2 = "row", ...rest }, ref) => {
1988
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.RadioGroup, { ...rest, ref }, /* @__PURE__ */ React88__namespace.default.createElement(react.Stack, { direction: direction2 }, children));
1989
+ }
1990
+ );
1991
+ }
1992
+ });
1993
+ exports.SearchInput = void 0; var texts6;
1994
+ var init_SearchInput = __esm({
1995
+ "src/input/SearchInput.tsx"() {
2156
1996
  init_input();
2157
1997
  init_src();
2158
- exports.PasswordInput = react.forwardRef(
2159
- ({ leftIcon, id, label, size: size2, ...props }, ref) => {
2160
- const { isOpen: isShowingPassword, onToggle } = react.useDisclosure();
1998
+ exports.SearchInput = react.forwardRef(
1999
+ ({ label, onReset, ...props }, ref) => {
2161
2000
  const { t: t2 } = useTranslation();
2001
+ const showClearButton = onReset && Boolean(props.value);
2162
2002
  const formControlProps = react.useFormControlContext();
2163
- const autoGeneratedId = `password-input-${React88.useId()}`;
2164
- const inputId = id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? autoGeneratedId;
2165
- return /* @__PURE__ */ React88__namespace.default.createElement(react.InputGroup, { position: "relative" }, leftIcon && /* @__PURE__ */ React88__namespace.default.createElement(exports.InputLeftElement, null, leftIcon), /* @__PURE__ */ React88__namespace.default.createElement(
2003
+ const autoGeneratedId = React88.useId();
2004
+ const inputId = props.id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? autoGeneratedId;
2005
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.InputGroup, { position: "relative" }, /* @__PURE__ */ React88__namespace.default.createElement(exports.InputLeftElement, null, /* @__PURE__ */ React88__namespace.default.createElement(sporIconReact.SearchOutline24Icon, null)), /* @__PURE__ */ React88__namespace.default.createElement(
2166
2006
  react.Input,
2167
2007
  {
2008
+ paddingLeft: 7,
2009
+ paddingRight: 7,
2168
2010
  ...props,
2169
2011
  id: inputId,
2170
- placeholder: " ",
2171
- type: isShowingPassword ? "text" : "password",
2172
- paddingRight: 10,
2173
- paddingLeft: leftIcon ? 7 : void 0,
2012
+ type: "search",
2013
+ css: {
2014
+ "&::-webkit-search-cancel-button": {
2015
+ WebkitAppearance: "none"
2016
+ }
2017
+ },
2174
2018
  ref,
2019
+ placeholder: " ",
2175
2020
  "data-attachable": true
2176
2021
  }
2177
- ), /* @__PURE__ */ React88__namespace.default.createElement(exports.FormLabel, { htmlFor: inputId, pointerEvents: "none" }, label), /* @__PURE__ */ React88__namespace.default.createElement(exports.InputRightElement, { width: "fit-content" }, /* @__PURE__ */ React88__namespace.default.createElement(
2178
- react.Button,
2022
+ ), /* @__PURE__ */ React88__namespace.default.createElement(exports.FormLabel, { htmlFor: inputId, pointerEvents: "none" }, label ?? t2(texts6.label)), showClearButton && /* @__PURE__ */ React88__namespace.default.createElement(exports.InputRightElement, { width: "fit-content" }, /* @__PURE__ */ React88__namespace.default.createElement(
2023
+ react.IconButton,
2179
2024
  {
2180
2025
  variant: "ghost",
2181
2026
  type: "button",
2182
- fontWeight: "normal",
2183
2027
  size: "sm",
2184
- onClick: onToggle,
2185
- borderRadius: "sm",
2186
2028
  marginRight: 1,
2187
- isDisabled: props.disabled || props.isDisabled
2188
- },
2189
- isShowingPassword ? t2(texts3.hidePassword) : t2(texts3.showPassword)
2029
+ "aria-label": t2(texts6.reset),
2030
+ icon: /* @__PURE__ */ React88__namespace.default.createElement(sporIconReact.CloseOutline24Icon, null),
2031
+ onClick: onReset
2032
+ }
2190
2033
  )));
2191
2034
  }
2192
2035
  );
2193
- texts3 = createTexts({
2194
- showPassword: {
2195
- nb: "Vis",
2196
- nn: "Vis",
2197
- en: "Show",
2198
- sv: "Visa"
2036
+ texts6 = createTexts({
2037
+ label: {
2038
+ nb: "S\xF8k",
2039
+ nn: "S\xF8k",
2040
+ sv: "S\xF6k",
2041
+ en: "Search"
2199
2042
  },
2200
- hidePassword: {
2201
- nb: "Skjul",
2202
- nn: "Skjul",
2203
- en: "Hide",
2204
- sv: "D\xF6lj"
2043
+ reset: {
2044
+ nb: "T\xF8m s\xF8kefeltet",
2045
+ nn: "T\xF8m s\xF8kefelt",
2046
+ sv: "Rensa s\xF6krutan",
2047
+ en: "Reset search field"
2205
2048
  }
2206
2049
  });
2207
2050
  }
2208
2051
  });
2209
-
2210
- // src/input/CountryCodeSelect.tsx
2211
- var CountryCodeSelect_exports = {};
2212
- __export(CountryCodeSelect_exports, {
2213
- CountryCodeSelect: () => CountryCodeSelect,
2214
- default: () => CountryCodeSelect_default
2215
- });
2216
- var prioritizedCountryCodes, sortedCallingCodes, callingCodes, CountryCodeSelect, CountryCodeSelect_default, texts4;
2217
- var init_CountryCodeSelect = __esm({
2218
- "src/input/CountryCodeSelect.tsx"() {
2219
- init_src();
2220
- prioritizedCountryCodes = [
2221
- { key: "+47", value: "+47" },
2222
- { key: "+46", value: "+46" },
2223
- { key: "+45", value: "+45" }
2224
- ];
2225
- sortedCallingCodes = awesomePhonenumber.getSupportedCallingCodes().sort((a, b) => Number(a) - Number(b)).map((code) => ({
2226
- key: `+${code}`,
2227
- value: `+${code}`
2228
- })).filter(
2229
- (code) => !prioritizedCountryCodes.some((pCode) => pCode.key === code.key)
2230
- );
2231
- callingCodes = [...prioritizedCountryCodes, ...sortedCallingCodes];
2232
- CountryCodeSelect = (props) => {
2233
- const { t: t2 } = useTranslation();
2234
- return /* @__PURE__ */ React88__namespace.default.createElement(
2235
- InfoSelect,
2236
- {
2237
- label: t2(texts4.countryCode),
2238
- isLabelSrOnly: true,
2239
- items: callingCodes,
2240
- ...props
2241
- },
2242
- (item) => /* @__PURE__ */ React88__namespace.default.createElement(reactStately.Item, { key: item.key }, item.key)
2243
- );
2244
- };
2245
- CountryCodeSelect_default = CountryCodeSelect;
2246
- texts4 = createTexts({
2247
- countryCode: {
2248
- nb: "Landkode",
2249
- nn: "Landskode",
2250
- en: "Country code",
2251
- sv: "Landskod"
2052
+ exports.Switch = void 0;
2053
+ var init_Switch = __esm({
2054
+ "src/input/Switch.tsx"() {
2055
+ exports.Switch = react.forwardRef(
2056
+ ({ size: size2 = "md", ...props }, ref) => {
2057
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Switch, { size: size2, ...props, ref });
2252
2058
  }
2059
+ );
2060
+ }
2061
+ });
2062
+ function getSpacingProps(props) {
2063
+ const {
2064
+ mt,
2065
+ mr,
2066
+ mb,
2067
+ ml,
2068
+ mx,
2069
+ my,
2070
+ marginTop,
2071
+ marginRight,
2072
+ marginBottom,
2073
+ marginLeft,
2074
+ marginX,
2075
+ marginY,
2076
+ pt,
2077
+ pr,
2078
+ pb,
2079
+ pl,
2080
+ px,
2081
+ py,
2082
+ paddingTop,
2083
+ paddingRight,
2084
+ paddingBottom,
2085
+ paddingLeft,
2086
+ paddingX,
2087
+ paddingY,
2088
+ ...remainingProps
2089
+ } = props;
2090
+ return {
2091
+ spacingProps: {
2092
+ mt,
2093
+ mr,
2094
+ mb,
2095
+ ml,
2096
+ mx,
2097
+ my,
2098
+ marginTop,
2099
+ marginRight,
2100
+ marginBottom,
2101
+ marginLeft,
2102
+ marginX,
2103
+ marginY,
2104
+ pt,
2105
+ pr,
2106
+ pb,
2107
+ pl,
2108
+ px,
2109
+ py,
2110
+ paddingTop,
2111
+ paddingRight,
2112
+ paddingBottom,
2113
+ paddingLeft,
2114
+ paddingX,
2115
+ paddingY
2116
+ },
2117
+ remainingProps
2118
+ };
2119
+ }
2120
+ exports.Textarea = void 0;
2121
+ var init_Textarea = __esm({
2122
+ "src/input/Textarea.tsx"() {
2123
+ exports.Textarea = react.forwardRef((props, ref) => {
2124
+ const {
2125
+ spacingProps,
2126
+ remainingProps: { label, ...rest }
2127
+ } = getSpacingProps(props);
2128
+ const formControlProps = react.useFormControlContext();
2129
+ const fallbackId = `textarea-${React88.useId()}`;
2130
+ const inputId = props.id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? fallbackId;
2131
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.InputGroup, { position: "relative", ...spacingProps }, /* @__PURE__ */ React88__namespace.default.createElement(react.Textarea, { ...rest, id: inputId, ref, placeholder: " " }), label && /* @__PURE__ */ React88__namespace.default.createElement(react.FormLabel, { htmlFor: inputId, id: `${inputId}-label` }, label));
2253
2132
  });
2254
2133
  }
2255
2134
  });
2256
- exports.PhoneNumberInput = void 0; var texts5, LazyCountryCodeSelect;
2257
- var init_PhoneNumberInput = __esm({
2258
- "src/input/PhoneNumberInput.tsx"() {
2259
- init_src();
2135
+ var init_input = __esm({
2136
+ "src/input/index.tsx"() {
2260
2137
  init_AttachedInputs();
2261
- exports.PhoneNumberInput = react.forwardRef(
2262
- ({
2263
- label: externalLabel,
2264
- name,
2265
- value: externalValue,
2266
- onChange: externalOnChange,
2267
- ...boxProps
2268
- }, ref) => {
2269
- const { t: t2 } = useTranslation();
2270
- const label = externalLabel ?? t2(texts5.phoneNumber);
2271
- const [value, onChange] = react.useControllableState({
2272
- value: externalValue,
2273
- onChange: externalOnChange,
2274
- defaultValue: {
2275
- countryCode: "+47",
2276
- nationalNumber: ""
2138
+ init_CardSelect();
2139
+ init_Checkbox();
2140
+ init_CheckboxGroup();
2141
+ init_ChoiceChip();
2142
+ init_Combobox();
2143
+ init_FormControl();
2144
+ init_FormErrorMessage();
2145
+ init_FormLabel();
2146
+ init_InfoSelect();
2147
+ init_Input();
2148
+ init_InputElement();
2149
+ init_ListBox();
2150
+ init_NativeSelect();
2151
+ init_NumericStepper();
2152
+ init_PasswordInput();
2153
+ init_PhoneNumberInput();
2154
+ init_Radio();
2155
+ init_RadioGroup();
2156
+ init_SearchInput();
2157
+ init_Switch();
2158
+ init_Textarea();
2159
+ }
2160
+ });
2161
+ exports.RadioCardGroupContext = void 0; exports.RadioCardGroup = void 0;
2162
+ var init_RadioCardGroup = __esm({
2163
+ "src/layout/RadioCardGroup.tsx"() {
2164
+ init_input();
2165
+ exports.RadioCardGroupContext = React88__namespace.default.createContext(null);
2166
+ exports.RadioCardGroup = ({
2167
+ children,
2168
+ name,
2169
+ variant = "base",
2170
+ direction: direction2 = "row",
2171
+ groupLabel,
2172
+ defaultValue,
2173
+ ...props
2174
+ }) => {
2175
+ const [selectedValue, setSelectedValue] = React88.useState(
2176
+ defaultValue || ""
2177
+ );
2178
+ const handleChange = (value) => {
2179
+ setSelectedValue(value);
2180
+ };
2181
+ return /* @__PURE__ */ React88__namespace.default.createElement(
2182
+ exports.RadioCardGroupContext.Provider,
2183
+ {
2184
+ value: {
2185
+ name,
2186
+ selectedValue,
2187
+ onChange: handleChange,
2188
+ variant,
2189
+ defaultValue: defaultValue || ""
2277
2190
  }
2278
- });
2279
- return /* @__PURE__ */ React88__namespace.default.createElement(exports.AttachedInputs, { ...boxProps }, /* @__PURE__ */ React88__namespace.default.createElement(
2280
- React88.Suspense,
2191
+ },
2192
+ /* @__PURE__ */ React88__namespace.default.createElement(
2193
+ react.Stack,
2281
2194
  {
2282
- fallback: /* @__PURE__ */ React88__namespace.default.createElement(
2283
- InfoSelect,
2284
- {
2285
- isLabelSrOnly: true,
2286
- label: "",
2287
- width: "6.25rem",
2288
- height: "100%",
2289
- value: "+47"
2290
- },
2291
- /* @__PURE__ */ React88__namespace.default.createElement(reactStately.Item, { key: "+47" }, "+47")
2292
- )
2195
+ as: "fieldset",
2196
+ direction: direction2,
2197
+ "aria-labelledby": groupLabel || name,
2198
+ role: "radiogroup",
2199
+ tabIndex: 0,
2200
+ ...props
2293
2201
  },
2294
- /* @__PURE__ */ React88__namespace.default.createElement(
2295
- LazyCountryCodeSelect,
2296
- {
2297
- value: value.countryCode,
2298
- onChange: (countryCode) => onChange({
2299
- countryCode,
2300
- nationalNumber: value.nationalNumber
2301
- }),
2302
- name: name ? `${name}-country-code` : "country-code",
2303
- height: "100%",
2304
- width: "6.25rem"
2305
- }
2306
- )
2307
- ), /* @__PURE__ */ React88__namespace.default.createElement(
2308
- exports.Input,
2202
+ groupLabel && /* @__PURE__ */ React88__namespace.default.createElement(exports.FormLabel, { as: "legend", id: groupLabel }, groupLabel),
2203
+ children
2204
+ )
2205
+ );
2206
+ };
2207
+ }
2208
+ });
2209
+ exports.RadioCard = void 0;
2210
+ var init_RadioCard = __esm({
2211
+ "src/layout/RadioCard.tsx"() {
2212
+ init_RadioCardGroup();
2213
+ exports.RadioCard = react.forwardRef(
2214
+ ({ children, value = "base", isDisabled, ...props }, ref) => {
2215
+ const context = React88.useContext(exports.RadioCardGroupContext);
2216
+ if (!context) {
2217
+ throw new Error(
2218
+ "RadioCard components must be wrapped in a RadioCardGroup component"
2219
+ );
2220
+ }
2221
+ const { name, selectedValue, onChange, variant } = context;
2222
+ const styles3 = react.useMultiStyleConfig("RadioCard", { variant });
2223
+ const isChecked = selectedValue === value;
2224
+ const radioCardId = `radio-card-${React88.useId()}`;
2225
+ React88.useEffect(() => {
2226
+ if (isChecked && typeof ref !== "function" && (ref == null ? void 0 : ref.current)) {
2227
+ ref.current.focus();
2228
+ }
2229
+ }, [isChecked]);
2230
+ const handleKeyDown = (event) => {
2231
+ if (event.key === "Enter" || event.key === " ") {
2232
+ onChange(value);
2233
+ }
2234
+ if (event.key === "ArrowRight" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "ArrowUp") {
2235
+ const nextRadioCard = event.currentTarget.nextElementSibling;
2236
+ nextRadioCard.focus();
2237
+ }
2238
+ };
2239
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { as: "label", "aria-label": String(children), onKeyDown: handleKeyDown }, /* @__PURE__ */ React88__namespace.default.createElement(
2240
+ react.chakra.input,
2309
2241
  {
2242
+ type: "radio",
2243
+ id: radioCardId,
2310
2244
  ref,
2311
- type: "tel",
2312
- label,
2313
- value: value.nationalNumber,
2314
- name: name ? `${name}-phone-number` : "phone-number",
2315
- onChange: (e) => {
2316
- const strippedValue = e.target.value.replace(/[^\d\s-]/g, "");
2317
- onChange({
2318
- countryCode: value.countryCode,
2319
- nationalNumber: strippedValue
2320
- });
2321
- },
2322
- position: "relative",
2323
- left: "1px"
2245
+ value,
2246
+ name,
2247
+ checked: isChecked,
2248
+ onChange: () => onChange(value),
2249
+ disabled: isDisabled,
2250
+ __css: styles3.radioInput
2324
2251
  }
2252
+ ), /* @__PURE__ */ React88__namespace.default.createElement(
2253
+ react.Box,
2254
+ {
2255
+ ...props,
2256
+ tabIndex: 0,
2257
+ ref,
2258
+ role: "radio",
2259
+ "aria-checked": isChecked,
2260
+ "aria-labelledby": radioCardId,
2261
+ __css: { ...styles3.container, ...isChecked && styles3.checked },
2262
+ "data-checked": isChecked,
2263
+ "data-disabled": isDisabled
2264
+ },
2265
+ children
2325
2266
  ));
2326
2267
  }
2327
2268
  );
2328
- texts5 = createTexts({
2329
- phoneNumber: {
2330
- nb: "Telefonnummer",
2331
- nn: "Telefonnummer",
2332
- en: "Phone number",
2333
- sv: "Telefonnummer"
2334
- }
2335
- });
2336
- LazyCountryCodeSelect = React88__namespace.default.lazy(() => Promise.resolve().then(() => (init_CountryCodeSelect(), CountryCodeSelect_exports)));
2337
2269
  }
2338
2270
  });
2339
- exports.Radio = void 0;
2340
- var init_Radio = __esm({
2341
- "src/input/Radio.tsx"() {
2342
- exports.Radio = react.forwardRef((props, ref) => {
2343
- return /* @__PURE__ */ React88__namespace.default.createElement(react.Radio, { ...props, ref });
2344
- });
2271
+ exports.StaticCard = void 0;
2272
+ var init_StaticCard = __esm({
2273
+ "src/layout/StaticCard.tsx"() {
2274
+ exports.StaticCard = react.forwardRef(
2275
+ ({ colorScheme = "white", children, ...props }, ref) => {
2276
+ const styles3 = react.useStyleConfig("StaticCard", {
2277
+ colorScheme
2278
+ });
2279
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { __css: styles3, ...props, ref }, children);
2280
+ }
2281
+ );
2345
2282
  }
2346
2283
  });
2347
- exports.RadioGroup = void 0;
2348
- var init_RadioGroup = __esm({
2349
- "src/input/RadioGroup.tsx"() {
2350
- exports.RadioGroup = react.forwardRef(
2351
- ({ children, direction: direction2 = "row", ...rest }, ref) => {
2352
- return /* @__PURE__ */ React88__namespace.default.createElement(react.RadioGroup, { ...rest, ref }, /* @__PURE__ */ React88__namespace.default.createElement(react.Stack, { direction: direction2 }, children));
2284
+ exports.PressableCard = void 0;
2285
+ var init_PressableCard = __esm({
2286
+ "src/layout/PressableCard.tsx"() {
2287
+ exports.PressableCard = react.forwardRef(
2288
+ ({ children, variant = "floating", ...props }, ref) => {
2289
+ const styles3 = react.useStyleConfig("PressableCard", {
2290
+ variant
2291
+ });
2292
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { __css: styles3, ...props, ref }, children);
2353
2293
  }
2354
2294
  );
2355
2295
  }
2356
2296
  });
2357
- exports.SearchInput = void 0; var texts6;
2358
- var init_SearchInput = __esm({
2359
- "src/input/SearchInput.tsx"() {
2360
- init_input();
2361
- init_src();
2362
- exports.SearchInput = react.forwardRef(
2363
- ({ label, onReset, ...props }, ref) => {
2364
- const { t: t2 } = useTranslation();
2365
- const showClearButton = onReset && Boolean(props.value);
2366
- const formControlProps = react.useFormControlContext();
2367
- const autoGeneratedId = React88.useId();
2368
- const inputId = props.id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? autoGeneratedId;
2369
- return /* @__PURE__ */ React88__namespace.default.createElement(react.InputGroup, { position: "relative" }, /* @__PURE__ */ React88__namespace.default.createElement(exports.InputLeftElement, null, /* @__PURE__ */ React88__namespace.default.createElement(sporIconReact.SearchOutline24Icon, null)), /* @__PURE__ */ React88__namespace.default.createElement(
2370
- react.Input,
2297
+ var init_layout = __esm({
2298
+ "src/layout/index.tsx"() {
2299
+ init_Divider();
2300
+ init_Stack();
2301
+ init_RadioCard();
2302
+ init_RadioCardGroup();
2303
+ init_StaticCard();
2304
+ init_PressableCard();
2305
+ }
2306
+ });
2307
+ var AccordionContext, AccordionProvider, useAccordionContext;
2308
+ var init_AccordionContext = __esm({
2309
+ "src/accordion/AccordionContext.tsx"() {
2310
+ AccordionContext = React88__namespace.default.createContext(null);
2311
+ AccordionProvider = ({
2312
+ size: size2,
2313
+ ...props
2314
+ }) => {
2315
+ return /* @__PURE__ */ React88__namespace.default.createElement(AccordionContext.Provider, { value: { size: size2 }, ...props });
2316
+ };
2317
+ useAccordionContext = () => {
2318
+ const context = React88__namespace.default.useContext(AccordionContext);
2319
+ if (context === null) {
2320
+ throw new Error(
2321
+ "useAccordionContext must be used within AccordionProvider"
2322
+ );
2323
+ }
2324
+ return context;
2325
+ };
2326
+ }
2327
+ });
2328
+ exports.Accordion = void 0;
2329
+ var init_Accordion = __esm({
2330
+ "src/accordion/Accordion.tsx"() {
2331
+ init_layout();
2332
+ init_AccordionContext();
2333
+ exports.Accordion = react.forwardRef(
2334
+ ({ children, spacing: spacing3 = 2, ...props }, ref) => {
2335
+ const defaultIndex = typeof props.defaultIndex === "number" && props.allowMultiple ? [props.defaultIndex] : props.defaultIndex;
2336
+ return /* @__PURE__ */ React88__namespace.default.createElement(AccordionProvider, { size: props.size }, /* @__PURE__ */ React88__namespace.default.createElement(
2337
+ react.Accordion,
2371
2338
  {
2372
- paddingLeft: 7,
2373
- paddingRight: 7,
2374
2339
  ...props,
2375
- id: inputId,
2376
- type: "search",
2377
- css: {
2378
- "&::-webkit-search-cancel-button": {
2379
- WebkitAppearance: "none"
2380
- }
2381
- },
2382
2340
  ref,
2383
- placeholder: " ",
2384
- "data-attachable": true
2385
- }
2386
- ), /* @__PURE__ */ React88__namespace.default.createElement(exports.FormLabel, { htmlFor: inputId, pointerEvents: "none" }, label ?? t2(texts6.label)), showClearButton && /* @__PURE__ */ React88__namespace.default.createElement(exports.InputRightElement, { width: "fit-content" }, /* @__PURE__ */ React88__namespace.default.createElement(
2387
- react.IconButton,
2388
- {
2389
- variant: "ghost",
2390
- type: "button",
2391
- size: "sm",
2392
- marginRight: 1,
2393
- "aria-label": t2(texts6.reset),
2394
- icon: /* @__PURE__ */ React88__namespace.default.createElement(sporIconReact.CloseOutline24Icon, null),
2395
- onClick: onReset
2396
- }
2397
- )));
2341
+ defaultIndex
2342
+ },
2343
+ /* @__PURE__ */ React88__namespace.default.createElement(exports.Stack, { spacing: spacing3 }, children)
2344
+ ));
2398
2345
  }
2399
2346
  );
2400
- texts6 = createTexts({
2401
- label: {
2402
- nb: "S\xF8k",
2403
- nn: "S\xF8k",
2404
- sv: "S\xF6k",
2405
- en: "Search"
2347
+ }
2348
+ });
2349
+ exports.Expandable = void 0; exports.ExpandableItem = void 0; var warnAboutMismatchingIcon;
2350
+ var init_Expandable = __esm({
2351
+ "src/accordion/Expandable.tsx"() {
2352
+ init_Accordion();
2353
+ init_AccordionContext();
2354
+ exports.Expandable = ({
2355
+ children,
2356
+ headingLevel,
2357
+ title,
2358
+ leftIcon,
2359
+ size: size2 = "md",
2360
+ defaultOpen,
2361
+ isOpen,
2362
+ onChange = () => {
2406
2363
  },
2407
- reset: {
2408
- nb: "T\xF8m s\xF8kefeltet",
2409
- nn: "T\xF8m s\xF8kefelt",
2410
- sv: "Rensa s\xF6krutan",
2411
- en: "Reset search field"
2364
+ ...rest
2365
+ }) => {
2366
+ return /* @__PURE__ */ React88__namespace.default.createElement(
2367
+ exports.Accordion,
2368
+ {
2369
+ ...rest,
2370
+ index: isOpen ? 0 : void 0,
2371
+ defaultIndex: defaultOpen ? 0 : void 0,
2372
+ allowMultiple: true,
2373
+ size: size2,
2374
+ onChange: (expandedIndex) => onChange(expandedIndex === 0)
2375
+ },
2376
+ /* @__PURE__ */ React88__namespace.default.createElement(
2377
+ exports.ExpandableItem,
2378
+ {
2379
+ headingLevel,
2380
+ title,
2381
+ leftIcon
2382
+ },
2383
+ children
2384
+ )
2385
+ );
2386
+ };
2387
+ exports.ExpandableItem = ({
2388
+ children,
2389
+ title,
2390
+ headingLevel = "h3",
2391
+ leftIcon,
2392
+ ...rest
2393
+ }) => {
2394
+ const { size: size2 } = useAccordionContext();
2395
+ warnAboutMismatchingIcon({ icon: leftIcon, size: size2 });
2396
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.AccordionItem, { ...rest }, /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { as: headingLevel }, /* @__PURE__ */ React88__namespace.default.createElement(react.AccordionButton, null, /* @__PURE__ */ React88__namespace.default.createElement(react.Flex, { alignItems: "center" }, leftIcon && /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { marginRight: 1 }, leftIcon), title), /* @__PURE__ */ React88__namespace.default.createElement(react.AccordionIcon, null))), /* @__PURE__ */ React88__namespace.default.createElement(react.AccordionPanel, null, children));
2397
+ };
2398
+ warnAboutMismatchingIcon = ({ icon, size: size2 }) => {
2399
+ var _a6, _b5;
2400
+ if (process.env.NODE_ENV !== "production") {
2401
+ const displayName = (_b5 = (_a6 = icon == null ? void 0 : icon.type) == null ? void 0 : _a6.render) == null ? void 0 : _b5.displayName;
2402
+ if (!displayName) {
2403
+ return;
2404
+ }
2405
+ if (displayName.includes("Fill")) {
2406
+ console.warn(
2407
+ `You passed a filled icon. This component requires outlined icons. You passed ${displayName}, replace it with ${displayName.replace(
2408
+ "Fill",
2409
+ "Outline"
2410
+ )}.`
2411
+ );
2412
+ return;
2413
+ }
2414
+ if (size2 === "lg" && !displayName.includes("30Icon")) {
2415
+ console.warn(
2416
+ `The icon you passed was of the wrong size for the lg size. You passed ${displayName}, replace it with ${displayName.replace(
2417
+ /(\d{2})Icon/,
2418
+ "30Icon"
2419
+ )}.`
2420
+ );
2421
+ return;
2422
+ }
2423
+ if (["md"].includes(size2) && !displayName.includes("24Icon")) {
2424
+ console.warn(
2425
+ `The icon you passed was of the wrong size for the ${size2} size. You passed ${displayName}, replace it with ${displayName.replace(
2426
+ /(\d{2})Icon/,
2427
+ "24Icon"
2428
+ )}.`
2429
+ );
2430
+ }
2412
2431
  }
2413
- });
2432
+ };
2414
2433
  }
2415
2434
  });
2416
- exports.Switch = void 0;
2417
- var init_Switch = __esm({
2418
- "src/input/Switch.tsx"() {
2419
- exports.Switch = react.forwardRef(
2420
- ({ size: size2 = "md", ...props }, ref) => {
2421
- return /* @__PURE__ */ React88__namespace.default.createElement(react.Switch, { size: size2, ...props, ref });
2422
- }
2423
- );
2435
+
2436
+ // src/accordion/index.tsx
2437
+ var init_accordion = __esm({
2438
+ "src/accordion/index.tsx"() {
2439
+ init_Accordion();
2440
+ init_Expandable();
2424
2441
  }
2425
2442
  });
2426
- function getSpacingProps(props) {
2427
- const {
2428
- mt,
2429
- mr,
2430
- mb,
2431
- ml,
2432
- mx,
2433
- my,
2434
- marginTop,
2435
- marginRight,
2436
- marginBottom,
2437
- marginLeft,
2438
- marginX,
2439
- marginY,
2440
- pt,
2441
- pr,
2442
- pb,
2443
- pl,
2444
- px,
2445
- py,
2446
- paddingTop,
2447
- paddingRight,
2448
- paddingBottom,
2449
- paddingLeft,
2450
- paddingX,
2451
- paddingY,
2452
- ...remainingProps
2453
- } = props;
2454
- return {
2455
- spacingProps: {
2456
- mt,
2457
- mr,
2458
- mb,
2459
- ml,
2460
- mx,
2461
- my,
2462
- marginTop,
2463
- marginRight,
2464
- marginBottom,
2465
- marginLeft,
2466
- marginX,
2467
- marginY,
2468
- pt,
2469
- pr,
2470
- pb,
2471
- pl,
2472
- px,
2473
- py,
2474
- paddingTop,
2475
- paddingRight,
2476
- paddingBottom,
2477
- paddingLeft,
2478
- paddingX,
2479
- paddingY
2480
- },
2481
- remainingProps
2443
+ function LanguageProvider({
2444
+ language,
2445
+ children
2446
+ }) {
2447
+ return /* @__PURE__ */ React88__namespace.default.createElement(LanguageContext.Provider, { value: language }, children);
2448
+ }
2449
+ function useLanguage() {
2450
+ const language = React88.useContext(LanguageContext);
2451
+ if (!language) {
2452
+ throw new Error("Please wrap your application in a LanguageProvider");
2453
+ }
2454
+ return language;
2455
+ }
2456
+ function useTranslation() {
2457
+ const language = useLanguage();
2458
+ const t2 = (text) => {
2459
+ return text[language];
2482
2460
  };
2461
+ return { t: t2, language };
2483
2462
  }
2484
- exports.Textarea = void 0;
2485
- var init_Textarea = __esm({
2486
- "src/input/Textarea.tsx"() {
2487
- exports.Textarea = react.forwardRef((props, ref) => {
2488
- const {
2489
- spacingProps,
2490
- remainingProps: { label, ...rest }
2491
- } = getSpacingProps(props);
2492
- const formControlProps = react.useFormControlContext();
2493
- const fallbackId = `textarea-${React88.useId()}`;
2494
- const inputId = props.id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? fallbackId;
2495
- return /* @__PURE__ */ React88__namespace.default.createElement(react.InputGroup, { position: "relative", ...spacingProps }, /* @__PURE__ */ React88__namespace.default.createElement(react.Textarea, { ...rest, id: inputId, ref, placeholder: " " }), label && /* @__PURE__ */ React88__namespace.default.createElement(react.FormLabel, { htmlFor: inputId, id: `${inputId}-label` }, label));
2496
- });
2463
+ function createTexts(texts29) {
2464
+ return texts29;
2465
+ }
2466
+ exports.Language = void 0; var LanguageContext;
2467
+ var init_i18n = __esm({
2468
+ "src/i18n/index.tsx"() {
2469
+ exports.Language = /* @__PURE__ */ ((Language3) => {
2470
+ Language3["NorwegianBokmal"] = "nb";
2471
+ Language3["NorwegianNynorsk"] = "nn";
2472
+ Language3["Swedish"] = "sv";
2473
+ Language3["English"] = "en";
2474
+ return Language3;
2475
+ })(exports.Language || {});
2476
+ LanguageContext = React88.createContext(void 0);
2497
2477
  }
2498
2478
  });
2499
- var init_input = __esm({
2500
- "src/input/index.tsx"() {
2501
- init_AttachedInputs();
2502
- init_CardSelect();
2503
- init_Checkbox();
2504
- init_CheckboxGroup();
2505
- init_ChoiceChip();
2506
- init_Combobox();
2507
- init_FormControl();
2508
- init_FormErrorMessage();
2509
- init_FormLabel();
2510
- init_InfoSelect();
2511
- init_Input();
2512
- init_InputElement();
2513
- init_ListBox();
2514
- init_NativeSelect();
2515
- init_NumericStepper();
2516
- init_PasswordInput();
2517
- init_PhoneNumberInput();
2518
- init_Radio();
2519
- init_RadioGroup();
2520
- init_SearchInput();
2521
- init_Switch();
2522
- init_Textarea();
2479
+ function useHydrated() {
2480
+ let [hydrated, setHydrated] = React88.useState(() => !hydrating);
2481
+ React88.useEffect(function hydrate() {
2482
+ hydrating = false;
2483
+ setHydrated(true);
2484
+ }, []);
2485
+ return hydrated;
2486
+ }
2487
+ var hydrating;
2488
+ var init_useHydrated = __esm({
2489
+ "src/loader/useHydrated.tsx"() {
2490
+ hydrating = true;
2491
+ }
2492
+ });
2493
+ var ClientOnly;
2494
+ var init_ClientOnly = __esm({
2495
+ "src/loader/ClientOnly.tsx"() {
2496
+ init_useHydrated();
2497
+ ClientOnly = ({ children, fallback = null }) => {
2498
+ const isHydrated = useHydrated();
2499
+ return /* @__PURE__ */ React88__namespace.default.createElement(React88__namespace.default.Fragment, null, isHydrated ? children() : fallback);
2500
+ };
2501
+ }
2502
+ });
2503
+ function Lottie({ animationData }) {
2504
+ const { View } = lottieReact.useLottie({ animationData, loop: true });
2505
+ return /* @__PURE__ */ React88__namespace.default.createElement(React88__namespace.default.Fragment, null, View);
2506
+ }
2507
+ var init_Lottie = __esm({
2508
+ "src/loader/Lottie.tsx"() {
2509
+ }
2510
+ });
2511
+ var PrideContext; exports.PrideProvider = void 0; exports.usePride = void 0;
2512
+ var init_PrideProvider = __esm({
2513
+ "src/pride/PrideProvider.tsx"() {
2514
+ PrideContext = React88.createContext(void 0);
2515
+ exports.PrideProvider = ({
2516
+ children
2517
+ }) => {
2518
+ const isBrowser2 = typeof window !== "undefined";
2519
+ const key = "spor__isPride";
2520
+ const [isPride, setIsPride] = React88.useState(() => {
2521
+ if (isBrowser2) {
2522
+ const savedState = localStorage.getItem(key);
2523
+ return savedState ? JSON.parse(savedState) : true;
2524
+ }
2525
+ return true;
2526
+ });
2527
+ const togglePride = () => {
2528
+ setIsPride((prev) => {
2529
+ const newState = !prev;
2530
+ if (isBrowser2) {
2531
+ localStorage.setItem(key, JSON.stringify(newState));
2532
+ }
2533
+ return newState;
2534
+ });
2535
+ };
2536
+ React88.useEffect(() => {
2537
+ if (isBrowser2) {
2538
+ const savedState = localStorage.getItem(key);
2539
+ if (savedState) {
2540
+ setIsPride(JSON.parse(savedState));
2541
+ }
2542
+ }
2543
+ }, [isBrowser2]);
2544
+ return /* @__PURE__ */ React88__namespace.default.createElement(PrideContext.Provider, { value: { isPride, togglePride } }, children);
2545
+ };
2546
+ exports.usePride = () => {
2547
+ const context = React88.useContext(PrideContext);
2548
+ if (context === void 0) {
2549
+ throw new Error("usePride must be used within a PrideProvider");
2550
+ }
2551
+ return context;
2552
+ };
2523
2553
  }
2524
2554
  });
2525
2555
  exports.TogglePride = void 0;
@@ -15011,7 +15041,6 @@ var init_radio_card = __esm({
15011
15041
  config33 = helpers24.defineMultiStyleConfig({
15012
15042
  baseStyle: (props) => ({
15013
15043
  container: {
15014
- appearance: "none",
15015
15044
  border: "none",
15016
15045
  overflow: "hidden",
15017
15046
  fontSize: "inherit",
@@ -15053,6 +15082,9 @@ var init_radio_card = __esm({
15053
15082
  _active: {
15054
15083
  ...baseBackground("active", props),
15055
15084
  ...baseBorder("active", props)
15085
+ },
15086
+ _focus: {
15087
+ ...outlineBorder("focus", props)
15056
15088
  }
15057
15089
  },
15058
15090
  checked: {
@@ -15062,13 +15094,17 @@ var init_radio_card = __esm({
15062
15094
  _active: {
15063
15095
  ...baseBackground("active", props),
15064
15096
  ...baseBorder("active", props)
15097
+ },
15098
+ _focus: {
15099
+ outline: "4px solid",
15100
+ outlineStyle: "double",
15101
+ ...outlineBorder("focus", props),
15102
+ outlineOffset: "-1px"
15065
15103
  }
15066
15104
  }
15067
15105
  }),
15068
15106
  floating: (props) => ({
15069
15107
  container: {
15070
- ...baseText("default", props),
15071
- ...baseBackground("default", props),
15072
15108
  ...floatingBackground("default", props),
15073
15109
  ...floatingBorder("default", props),
15074
15110
  boxShadow: "sm",
@@ -15080,16 +15116,25 @@ var init_radio_card = __esm({
15080
15116
  _active: {
15081
15117
  ...floatingBackground("active", props),
15082
15118
  ...floatingBorder("active", props)
15119
+ },
15120
+ _focus: {
15121
+ ...outlineBorder("focus", props)
15083
15122
  }
15084
15123
  },
15085
15124
  checked: {
15086
- cursor: "normal",
15087
15125
  _hover: {
15088
- ...floatingBorder("hover", props)
15126
+ ...floatingBorder("hover", props),
15127
+ boxShadow: "md"
15089
15128
  },
15090
15129
  _active: {
15091
15130
  ...floatingBackground("active", props),
15092
15131
  ...floatingBorder("active", props)
15132
+ },
15133
+ _focus: {
15134
+ outline: "4px solid",
15135
+ outlineStyle: "double",
15136
+ ...outlineBorder("focus", props),
15137
+ outlineOffset: "-1px"
15093
15138
  }
15094
15139
  }
15095
15140
  })