@vygruppen/spor-react 9.11.4 → 9.12.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,770 @@ 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: "",
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
+ });
1966
+ LazyCountryCodeSelect = React88__namespace.default.lazy(() => Promise.resolve().then(() => (init_CountryCodeSelect(), CountryCodeSelect_exports)));
1967
+ }
1968
+ });
1969
+ exports.Radio = void 0;
1970
+ var init_Radio = __esm({
1971
+ "src/input/Radio.tsx"() {
1972
+ exports.Radio = react.forwardRef((props, ref) => {
1973
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Radio, { ...props, ref });
1974
+ });
1975
+ }
1976
+ });
1977
+ exports.RadioGroup = void 0;
1978
+ var init_RadioGroup = __esm({
1979
+ "src/input/RadioGroup.tsx"() {
1980
+ exports.RadioGroup = react.forwardRef(
1981
+ ({ children, direction: direction2 = "row", ...rest }, ref) => {
1982
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.RadioGroup, { ...rest, ref }, /* @__PURE__ */ React88__namespace.default.createElement(react.Stack, { direction: direction2 }, children));
1983
+ }
1984
+ );
1985
+ }
1986
+ });
1987
+ exports.SearchInput = void 0; var texts6;
1988
+ var init_SearchInput = __esm({
1989
+ "src/input/SearchInput.tsx"() {
2156
1990
  init_input();
2157
1991
  init_src();
2158
- exports.PasswordInput = react.forwardRef(
2159
- ({ leftIcon, id, label, size: size2, ...props }, ref) => {
2160
- const { isOpen: isShowingPassword, onToggle } = react.useDisclosure();
1992
+ exports.SearchInput = react.forwardRef(
1993
+ ({ label, onReset, ...props }, ref) => {
2161
1994
  const { t: t2 } = useTranslation();
1995
+ const showClearButton = onReset && Boolean(props.value);
2162
1996
  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(
1997
+ const autoGeneratedId = React88.useId();
1998
+ const inputId = props.id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? autoGeneratedId;
1999
+ 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
2000
  react.Input,
2167
2001
  {
2002
+ paddingLeft: 7,
2003
+ paddingRight: 7,
2168
2004
  ...props,
2169
2005
  id: inputId,
2170
- placeholder: " ",
2171
- type: isShowingPassword ? "text" : "password",
2172
- paddingRight: 10,
2173
- paddingLeft: leftIcon ? 7 : void 0,
2006
+ type: "search",
2007
+ css: {
2008
+ "&::-webkit-search-cancel-button": {
2009
+ WebkitAppearance: "none"
2010
+ }
2011
+ },
2174
2012
  ref,
2013
+ placeholder: " ",
2175
2014
  "data-attachable": true
2176
2015
  }
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,
2016
+ ), /* @__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(
2017
+ react.IconButton,
2179
2018
  {
2180
2019
  variant: "ghost",
2181
2020
  type: "button",
2182
- fontWeight: "normal",
2183
2021
  size: "sm",
2184
- onClick: onToggle,
2185
- borderRadius: "sm",
2186
2022
  marginRight: 1,
2187
- isDisabled: props.disabled || props.isDisabled
2188
- },
2189
- isShowingPassword ? t2(texts3.hidePassword) : t2(texts3.showPassword)
2023
+ "aria-label": t2(texts6.reset),
2024
+ icon: /* @__PURE__ */ React88__namespace.default.createElement(sporIconReact.CloseOutline24Icon, null),
2025
+ onClick: onReset
2026
+ }
2190
2027
  )));
2191
2028
  }
2192
2029
  );
2193
- texts3 = createTexts({
2194
- showPassword: {
2195
- nb: "Vis",
2196
- nn: "Vis",
2197
- en: "Show",
2198
- sv: "Visa"
2030
+ texts6 = createTexts({
2031
+ label: {
2032
+ nb: "S\xF8k",
2033
+ nn: "S\xF8k",
2034
+ sv: "S\xF6k",
2035
+ en: "Search"
2199
2036
  },
2200
- hidePassword: {
2201
- nb: "Skjul",
2202
- nn: "Skjul",
2203
- en: "Hide",
2204
- sv: "D\xF6lj"
2037
+ reset: {
2038
+ nb: "T\xF8m s\xF8kefeltet",
2039
+ nn: "T\xF8m s\xF8kefelt",
2040
+ sv: "Rensa s\xF6krutan",
2041
+ en: "Reset search field"
2205
2042
  }
2206
2043
  });
2207
2044
  }
2208
2045
  });
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"
2046
+ exports.Switch = void 0;
2047
+ var init_Switch = __esm({
2048
+ "src/input/Switch.tsx"() {
2049
+ exports.Switch = react.forwardRef(
2050
+ ({ size: size2 = "md", ...props }, ref) => {
2051
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Switch, { size: size2, ...props, ref });
2252
2052
  }
2053
+ );
2054
+ }
2055
+ });
2056
+ function getSpacingProps(props) {
2057
+ const {
2058
+ mt,
2059
+ mr,
2060
+ mb,
2061
+ ml,
2062
+ mx,
2063
+ my,
2064
+ marginTop,
2065
+ marginRight,
2066
+ marginBottom,
2067
+ marginLeft,
2068
+ marginX,
2069
+ marginY,
2070
+ pt,
2071
+ pr,
2072
+ pb,
2073
+ pl,
2074
+ px,
2075
+ py,
2076
+ paddingTop,
2077
+ paddingRight,
2078
+ paddingBottom,
2079
+ paddingLeft,
2080
+ paddingX,
2081
+ paddingY,
2082
+ ...remainingProps
2083
+ } = props;
2084
+ return {
2085
+ spacingProps: {
2086
+ mt,
2087
+ mr,
2088
+ mb,
2089
+ ml,
2090
+ mx,
2091
+ my,
2092
+ marginTop,
2093
+ marginRight,
2094
+ marginBottom,
2095
+ marginLeft,
2096
+ marginX,
2097
+ marginY,
2098
+ pt,
2099
+ pr,
2100
+ pb,
2101
+ pl,
2102
+ px,
2103
+ py,
2104
+ paddingTop,
2105
+ paddingRight,
2106
+ paddingBottom,
2107
+ paddingLeft,
2108
+ paddingX,
2109
+ paddingY
2110
+ },
2111
+ remainingProps
2112
+ };
2113
+ }
2114
+ exports.Textarea = void 0;
2115
+ var init_Textarea = __esm({
2116
+ "src/input/Textarea.tsx"() {
2117
+ exports.Textarea = react.forwardRef((props, ref) => {
2118
+ const {
2119
+ spacingProps,
2120
+ remainingProps: { label, ...rest }
2121
+ } = getSpacingProps(props);
2122
+ const formControlProps = react.useFormControlContext();
2123
+ const fallbackId = `textarea-${React88.useId()}`;
2124
+ const inputId = props.id ?? (formControlProps == null ? void 0 : formControlProps.id) ?? fallbackId;
2125
+ 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
2126
  });
2254
2127
  }
2255
2128
  });
2256
- exports.PhoneNumberInput = void 0; var texts5, LazyCountryCodeSelect;
2257
- var init_PhoneNumberInput = __esm({
2258
- "src/input/PhoneNumberInput.tsx"() {
2259
- init_src();
2129
+ var init_input = __esm({
2130
+ "src/input/index.tsx"() {
2260
2131
  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: ""
2132
+ init_CardSelect();
2133
+ init_Checkbox();
2134
+ init_CheckboxGroup();
2135
+ init_ChoiceChip();
2136
+ init_Combobox();
2137
+ init_FormControl();
2138
+ init_FormErrorMessage();
2139
+ init_FormLabel();
2140
+ init_InfoSelect();
2141
+ init_Input();
2142
+ init_InputElement();
2143
+ init_ListBox();
2144
+ init_NativeSelect();
2145
+ init_NumericStepper();
2146
+ init_PasswordInput();
2147
+ init_PhoneNumberInput();
2148
+ init_Radio();
2149
+ init_RadioGroup();
2150
+ init_SearchInput();
2151
+ init_Switch();
2152
+ init_Textarea();
2153
+ }
2154
+ });
2155
+ exports.RadioCardGroupContext = void 0; exports.RadioCardGroup = void 0;
2156
+ var init_RadioCardGroup = __esm({
2157
+ "src/layout/RadioCardGroup.tsx"() {
2158
+ init_input();
2159
+ exports.RadioCardGroupContext = React88__namespace.default.createContext(null);
2160
+ exports.RadioCardGroup = ({
2161
+ children,
2162
+ name,
2163
+ variant = "base",
2164
+ direction: direction2 = "row",
2165
+ groupLabel,
2166
+ defaultValue,
2167
+ ...props
2168
+ }) => {
2169
+ const [selectedValue, setSelectedValue] = React88.useState(
2170
+ defaultValue || ""
2171
+ );
2172
+ const handleChange = (value) => {
2173
+ setSelectedValue(value);
2174
+ };
2175
+ return /* @__PURE__ */ React88__namespace.default.createElement(
2176
+ exports.RadioCardGroupContext.Provider,
2177
+ {
2178
+ value: {
2179
+ name,
2180
+ selectedValue,
2181
+ onChange: handleChange,
2182
+ variant,
2183
+ defaultValue: defaultValue || ""
2277
2184
  }
2278
- });
2279
- return /* @__PURE__ */ React88__namespace.default.createElement(exports.AttachedInputs, { ...boxProps }, /* @__PURE__ */ React88__namespace.default.createElement(
2280
- React88.Suspense,
2185
+ },
2186
+ /* @__PURE__ */ React88__namespace.default.createElement(
2187
+ react.Stack,
2281
2188
  {
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
- )
2189
+ as: "fieldset",
2190
+ direction: direction2,
2191
+ "aria-labelledby": groupLabel || name,
2192
+ role: "radiogroup",
2193
+ tabIndex: 0,
2194
+ ...props
2293
2195
  },
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,
2196
+ groupLabel && /* @__PURE__ */ React88__namespace.default.createElement(exports.FormLabel, { as: "legend", id: groupLabel }, groupLabel),
2197
+ children
2198
+ )
2199
+ );
2200
+ };
2201
+ }
2202
+ });
2203
+ exports.RadioCard = void 0;
2204
+ var init_RadioCard = __esm({
2205
+ "src/layout/RadioCard.tsx"() {
2206
+ init_RadioCardGroup();
2207
+ exports.RadioCard = react.forwardRef(
2208
+ ({ children, value = "base", isDisabled, ...props }, ref) => {
2209
+ const context = React88.useContext(exports.RadioCardGroupContext);
2210
+ if (!context) {
2211
+ throw new Error(
2212
+ "RadioCard components must be wrapped in a RadioCardGroup component"
2213
+ );
2214
+ }
2215
+ const { name, selectedValue, onChange, variant } = context;
2216
+ const styles3 = react.useMultiStyleConfig("RadioCard", { variant });
2217
+ const isChecked = selectedValue === value;
2218
+ const radioCardId = `radio-card-${React88.useId()}`;
2219
+ React88.useEffect(() => {
2220
+ if (isChecked && typeof ref !== "function" && (ref == null ? void 0 : ref.current)) {
2221
+ ref.current.focus();
2222
+ }
2223
+ }, [isChecked]);
2224
+ const handleKeyDown = (event) => {
2225
+ if (event.key === "Enter" || event.key === " ") {
2226
+ onChange(value);
2227
+ }
2228
+ if (event.key === "ArrowRight" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "ArrowUp") {
2229
+ const nextRadioCard = event.currentTarget.nextElementSibling;
2230
+ nextRadioCard.focus();
2231
+ }
2232
+ };
2233
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { as: "label", "aria-label": String(children), onKeyDown: handleKeyDown }, /* @__PURE__ */ React88__namespace.default.createElement(
2234
+ react.chakra.input,
2309
2235
  {
2236
+ type: "radio",
2237
+ id: radioCardId,
2310
2238
  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"
2239
+ value,
2240
+ name,
2241
+ checked: isChecked,
2242
+ onChange: () => onChange(value),
2243
+ disabled: isDisabled,
2244
+ __css: styles3.radioInput
2324
2245
  }
2246
+ ), /* @__PURE__ */ React88__namespace.default.createElement(
2247
+ react.Box,
2248
+ {
2249
+ ...props,
2250
+ tabIndex: 0,
2251
+ ref,
2252
+ role: "radio",
2253
+ "aria-checked": isChecked,
2254
+ "aria-labelledby": radioCardId,
2255
+ __css: { ...styles3.container, ...isChecked && styles3.checked },
2256
+ "data-checked": isChecked,
2257
+ "data-disabled": isDisabled
2258
+ },
2259
+ children
2325
2260
  ));
2326
2261
  }
2327
2262
  );
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
2263
  }
2338
2264
  });
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
- });
2265
+ exports.StaticCard = void 0;
2266
+ var init_StaticCard = __esm({
2267
+ "src/layout/StaticCard.tsx"() {
2268
+ exports.StaticCard = react.forwardRef(
2269
+ ({ colorScheme = "white", children, ...props }, ref) => {
2270
+ const styles3 = react.useStyleConfig("StaticCard", {
2271
+ colorScheme
2272
+ });
2273
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { __css: styles3, ...props, ref }, children);
2274
+ }
2275
+ );
2345
2276
  }
2346
2277
  });
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));
2278
+ exports.PressableCard = void 0;
2279
+ var init_PressableCard = __esm({
2280
+ "src/layout/PressableCard.tsx"() {
2281
+ exports.PressableCard = react.forwardRef(
2282
+ ({ children, variant = "floating", ...props }, ref) => {
2283
+ const styles3 = react.useStyleConfig("PressableCard", {
2284
+ variant
2285
+ });
2286
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { __css: styles3, ...props, ref }, children);
2353
2287
  }
2354
2288
  );
2355
2289
  }
2356
2290
  });
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,
2291
+ var init_layout = __esm({
2292
+ "src/layout/index.tsx"() {
2293
+ init_Divider();
2294
+ init_Stack();
2295
+ init_RadioCard();
2296
+ init_RadioCardGroup();
2297
+ init_StaticCard();
2298
+ init_PressableCard();
2299
+ }
2300
+ });
2301
+ var AccordionContext, AccordionProvider, useAccordionContext;
2302
+ var init_AccordionContext = __esm({
2303
+ "src/accordion/AccordionContext.tsx"() {
2304
+ AccordionContext = React88__namespace.default.createContext(null);
2305
+ AccordionProvider = ({
2306
+ size: size2,
2307
+ ...props
2308
+ }) => {
2309
+ return /* @__PURE__ */ React88__namespace.default.createElement(AccordionContext.Provider, { value: { size: size2 }, ...props });
2310
+ };
2311
+ useAccordionContext = () => {
2312
+ const context = React88__namespace.default.useContext(AccordionContext);
2313
+ if (context === null) {
2314
+ throw new Error(
2315
+ "useAccordionContext must be used within AccordionProvider"
2316
+ );
2317
+ }
2318
+ return context;
2319
+ };
2320
+ }
2321
+ });
2322
+ exports.Accordion = void 0;
2323
+ var init_Accordion = __esm({
2324
+ "src/accordion/Accordion.tsx"() {
2325
+ init_layout();
2326
+ init_AccordionContext();
2327
+ exports.Accordion = react.forwardRef(
2328
+ ({ children, spacing: spacing3 = 2, ...props }, ref) => {
2329
+ const defaultIndex = typeof props.defaultIndex === "number" && props.allowMultiple ? [props.defaultIndex] : props.defaultIndex;
2330
+ return /* @__PURE__ */ React88__namespace.default.createElement(AccordionProvider, { size: props.size }, /* @__PURE__ */ React88__namespace.default.createElement(
2331
+ react.Accordion,
2371
2332
  {
2372
- paddingLeft: 7,
2373
- paddingRight: 7,
2374
2333
  ...props,
2375
- id: inputId,
2376
- type: "search",
2377
- css: {
2378
- "&::-webkit-search-cancel-button": {
2379
- WebkitAppearance: "none"
2380
- }
2381
- },
2382
2334
  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
- )));
2335
+ defaultIndex
2336
+ },
2337
+ /* @__PURE__ */ React88__namespace.default.createElement(exports.Stack, { spacing: spacing3 }, children)
2338
+ ));
2398
2339
  }
2399
2340
  );
2400
- texts6 = createTexts({
2401
- label: {
2402
- nb: "S\xF8k",
2403
- nn: "S\xF8k",
2404
- sv: "S\xF6k",
2405
- en: "Search"
2341
+ }
2342
+ });
2343
+ exports.Expandable = void 0; exports.ExpandableItem = void 0; var warnAboutMismatchingIcon;
2344
+ var init_Expandable = __esm({
2345
+ "src/accordion/Expandable.tsx"() {
2346
+ init_Accordion();
2347
+ init_AccordionContext();
2348
+ exports.Expandable = ({
2349
+ children,
2350
+ headingLevel,
2351
+ title,
2352
+ leftIcon,
2353
+ size: size2 = "md",
2354
+ defaultOpen,
2355
+ isOpen,
2356
+ onChange = () => {
2406
2357
  },
2407
- reset: {
2408
- nb: "T\xF8m s\xF8kefeltet",
2409
- nn: "T\xF8m s\xF8kefelt",
2410
- sv: "Rensa s\xF6krutan",
2411
- en: "Reset search field"
2358
+ ...rest
2359
+ }) => {
2360
+ return /* @__PURE__ */ React88__namespace.default.createElement(
2361
+ exports.Accordion,
2362
+ {
2363
+ ...rest,
2364
+ index: isOpen ? 0 : void 0,
2365
+ defaultIndex: defaultOpen ? 0 : void 0,
2366
+ allowMultiple: true,
2367
+ size: size2,
2368
+ onChange: (expandedIndex) => onChange(expandedIndex === 0)
2369
+ },
2370
+ /* @__PURE__ */ React88__namespace.default.createElement(
2371
+ exports.ExpandableItem,
2372
+ {
2373
+ headingLevel,
2374
+ title,
2375
+ leftIcon
2376
+ },
2377
+ children
2378
+ )
2379
+ );
2380
+ };
2381
+ exports.ExpandableItem = ({
2382
+ children,
2383
+ title,
2384
+ headingLevel = "h3",
2385
+ leftIcon,
2386
+ ...rest
2387
+ }) => {
2388
+ const { size: size2 } = useAccordionContext();
2389
+ warnAboutMismatchingIcon({ icon: leftIcon, size: size2 });
2390
+ 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));
2391
+ };
2392
+ warnAboutMismatchingIcon = ({ icon, size: size2 }) => {
2393
+ var _a6, _b5;
2394
+ if (process.env.NODE_ENV !== "production") {
2395
+ const displayName = (_b5 = (_a6 = icon == null ? void 0 : icon.type) == null ? void 0 : _a6.render) == null ? void 0 : _b5.displayName;
2396
+ if (!displayName) {
2397
+ return;
2398
+ }
2399
+ if (displayName.includes("Fill")) {
2400
+ console.warn(
2401
+ `You passed a filled icon. This component requires outlined icons. You passed ${displayName}, replace it with ${displayName.replace(
2402
+ "Fill",
2403
+ "Outline"
2404
+ )}.`
2405
+ );
2406
+ return;
2407
+ }
2408
+ if (size2 === "lg" && !displayName.includes("30Icon")) {
2409
+ console.warn(
2410
+ `The icon you passed was of the wrong size for the lg size. You passed ${displayName}, replace it with ${displayName.replace(
2411
+ /(\d{2})Icon/,
2412
+ "30Icon"
2413
+ )}.`
2414
+ );
2415
+ return;
2416
+ }
2417
+ if (["md"].includes(size2) && !displayName.includes("24Icon")) {
2418
+ console.warn(
2419
+ `The icon you passed was of the wrong size for the ${size2} size. You passed ${displayName}, replace it with ${displayName.replace(
2420
+ /(\d{2})Icon/,
2421
+ "24Icon"
2422
+ )}.`
2423
+ );
2424
+ }
2412
2425
  }
2413
- });
2426
+ };
2414
2427
  }
2415
2428
  });
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
- );
2429
+
2430
+ // src/accordion/index.tsx
2431
+ var init_accordion = __esm({
2432
+ "src/accordion/index.tsx"() {
2433
+ init_Accordion();
2434
+ init_Expandable();
2424
2435
  }
2425
2436
  });
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
2437
+ function LanguageProvider({
2438
+ language,
2439
+ children
2440
+ }) {
2441
+ return /* @__PURE__ */ React88__namespace.default.createElement(LanguageContext.Provider, { value: language }, children);
2442
+ }
2443
+ function useLanguage() {
2444
+ const language = React88.useContext(LanguageContext);
2445
+ if (!language) {
2446
+ throw new Error("Please wrap your application in a LanguageProvider");
2447
+ }
2448
+ return language;
2449
+ }
2450
+ function useTranslation() {
2451
+ const language = useLanguage();
2452
+ const t2 = (text) => {
2453
+ return text[language];
2482
2454
  };
2455
+ return { t: t2, language };
2483
2456
  }
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
- });
2457
+ function createTexts(texts29) {
2458
+ return texts29;
2459
+ }
2460
+ exports.Language = void 0; var LanguageContext;
2461
+ var init_i18n = __esm({
2462
+ "src/i18n/index.tsx"() {
2463
+ exports.Language = /* @__PURE__ */ ((Language3) => {
2464
+ Language3["NorwegianBokmal"] = "nb";
2465
+ Language3["NorwegianNynorsk"] = "nn";
2466
+ Language3["Swedish"] = "sv";
2467
+ Language3["English"] = "en";
2468
+ return Language3;
2469
+ })(exports.Language || {});
2470
+ LanguageContext = React88.createContext(void 0);
2497
2471
  }
2498
2472
  });
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();
2473
+ function useHydrated() {
2474
+ let [hydrated, setHydrated] = React88.useState(() => !hydrating);
2475
+ React88.useEffect(function hydrate() {
2476
+ hydrating = false;
2477
+ setHydrated(true);
2478
+ }, []);
2479
+ return hydrated;
2480
+ }
2481
+ var hydrating;
2482
+ var init_useHydrated = __esm({
2483
+ "src/loader/useHydrated.tsx"() {
2484
+ hydrating = true;
2485
+ }
2486
+ });
2487
+ var ClientOnly;
2488
+ var init_ClientOnly = __esm({
2489
+ "src/loader/ClientOnly.tsx"() {
2490
+ init_useHydrated();
2491
+ ClientOnly = ({ children, fallback = null }) => {
2492
+ const isHydrated = useHydrated();
2493
+ return /* @__PURE__ */ React88__namespace.default.createElement(React88__namespace.default.Fragment, null, isHydrated ? children() : fallback);
2494
+ };
2495
+ }
2496
+ });
2497
+ function Lottie({ animationData }) {
2498
+ const { View } = lottieReact.useLottie({ animationData, loop: true });
2499
+ return /* @__PURE__ */ React88__namespace.default.createElement(React88__namespace.default.Fragment, null, View);
2500
+ }
2501
+ var init_Lottie = __esm({
2502
+ "src/loader/Lottie.tsx"() {
2503
+ }
2504
+ });
2505
+ var PrideContext; exports.PrideProvider = void 0; exports.usePride = void 0;
2506
+ var init_PrideProvider = __esm({
2507
+ "src/pride/PrideProvider.tsx"() {
2508
+ PrideContext = React88.createContext(void 0);
2509
+ exports.PrideProvider = ({
2510
+ children
2511
+ }) => {
2512
+ const isBrowser2 = typeof window !== "undefined";
2513
+ const key = "spor__isPride";
2514
+ const [isPride, setIsPride] = React88.useState(() => {
2515
+ if (isBrowser2) {
2516
+ const savedState = localStorage.getItem(key);
2517
+ return savedState ? JSON.parse(savedState) : true;
2518
+ }
2519
+ return true;
2520
+ });
2521
+ const togglePride = () => {
2522
+ setIsPride((prev) => {
2523
+ const newState = !prev;
2524
+ if (isBrowser2) {
2525
+ localStorage.setItem(key, JSON.stringify(newState));
2526
+ }
2527
+ return newState;
2528
+ });
2529
+ };
2530
+ React88.useEffect(() => {
2531
+ if (isBrowser2) {
2532
+ const savedState = localStorage.getItem(key);
2533
+ if (savedState) {
2534
+ setIsPride(JSON.parse(savedState));
2535
+ }
2536
+ }
2537
+ }, [isBrowser2]);
2538
+ return /* @__PURE__ */ React88__namespace.default.createElement(PrideContext.Provider, { value: { isPride, togglePride } }, children);
2539
+ };
2540
+ exports.usePride = () => {
2541
+ const context = React88.useContext(PrideContext);
2542
+ if (context === void 0) {
2543
+ throw new Error("usePride must be used within a PrideProvider");
2544
+ }
2545
+ return context;
2546
+ };
2523
2547
  }
2524
2548
  });
2525
2549
  exports.TogglePride = void 0;
@@ -15011,7 +15035,6 @@ var init_radio_card = __esm({
15011
15035
  config33 = helpers24.defineMultiStyleConfig({
15012
15036
  baseStyle: (props) => ({
15013
15037
  container: {
15014
- appearance: "none",
15015
15038
  border: "none",
15016
15039
  overflow: "hidden",
15017
15040
  fontSize: "inherit",
@@ -15053,6 +15076,9 @@ var init_radio_card = __esm({
15053
15076
  _active: {
15054
15077
  ...baseBackground("active", props),
15055
15078
  ...baseBorder("active", props)
15079
+ },
15080
+ _focus: {
15081
+ ...outlineBorder("focus", props)
15056
15082
  }
15057
15083
  },
15058
15084
  checked: {
@@ -15062,13 +15088,17 @@ var init_radio_card = __esm({
15062
15088
  _active: {
15063
15089
  ...baseBackground("active", props),
15064
15090
  ...baseBorder("active", props)
15091
+ },
15092
+ _focus: {
15093
+ outline: "4px solid",
15094
+ outlineStyle: "double",
15095
+ ...outlineBorder("focus", props),
15096
+ outlineOffset: "-1px"
15065
15097
  }
15066
15098
  }
15067
15099
  }),
15068
15100
  floating: (props) => ({
15069
15101
  container: {
15070
- ...baseText("default", props),
15071
- ...baseBackground("default", props),
15072
15102
  ...floatingBackground("default", props),
15073
15103
  ...floatingBorder("default", props),
15074
15104
  boxShadow: "sm",
@@ -15080,16 +15110,25 @@ var init_radio_card = __esm({
15080
15110
  _active: {
15081
15111
  ...floatingBackground("active", props),
15082
15112
  ...floatingBorder("active", props)
15113
+ },
15114
+ _focus: {
15115
+ ...outlineBorder("focus", props)
15083
15116
  }
15084
15117
  },
15085
15118
  checked: {
15086
- cursor: "normal",
15087
15119
  _hover: {
15088
- ...floatingBorder("hover", props)
15120
+ ...floatingBorder("hover", props),
15121
+ boxShadow: "md"
15089
15122
  },
15090
15123
  _active: {
15091
15124
  ...floatingBackground("active", props),
15092
15125
  ...floatingBorder("active", props)
15126
+ },
15127
+ _focus: {
15128
+ outline: "4px solid",
15129
+ outlineStyle: "double",
15130
+ ...outlineBorder("focus", props),
15131
+ outlineOffset: "-1px"
15093
15132
  }
15094
15133
  }
15095
15134
  })