@vygruppen/spor-react 9.11.3 → 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;
@@ -2206,320 +1836,714 @@ var init_PasswordInput = __esm({
2206
1836
  });
2207
1837
  }
2208
1838
  });
2209
-
2210
- // src/input/CountryCodeSelect.tsx
2211
- var CountryCodeSelect_exports = {};
2212
- __export(CountryCodeSelect_exports, {
2213
- CountryCodeSelect: () => CountryCodeSelect,
2214
- default: () => CountryCodeSelect_default
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"() {
1990
+ init_input();
1991
+ init_src();
1992
+ exports.SearchInput = react.forwardRef(
1993
+ ({ label, onReset, ...props }, ref) => {
1994
+ const { t: t2 } = useTranslation();
1995
+ const showClearButton = onReset && Boolean(props.value);
1996
+ const formControlProps = react.useFormControlContext();
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(
2000
+ react.Input,
2001
+ {
2002
+ paddingLeft: 7,
2003
+ paddingRight: 7,
2004
+ ...props,
2005
+ id: inputId,
2006
+ type: "search",
2007
+ css: {
2008
+ "&::-webkit-search-cancel-button": {
2009
+ WebkitAppearance: "none"
2010
+ }
2011
+ },
2012
+ ref,
2013
+ placeholder: " ",
2014
+ "data-attachable": true
2015
+ }
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,
2018
+ {
2019
+ variant: "ghost",
2020
+ type: "button",
2021
+ size: "sm",
2022
+ marginRight: 1,
2023
+ "aria-label": t2(texts6.reset),
2024
+ icon: /* @__PURE__ */ React88__namespace.default.createElement(sporIconReact.CloseOutline24Icon, null),
2025
+ onClick: onReset
2026
+ }
2027
+ )));
2028
+ }
2029
+ );
2030
+ texts6 = createTexts({
2031
+ label: {
2032
+ nb: "S\xF8k",
2033
+ nn: "S\xF8k",
2034
+ sv: "S\xF6k",
2035
+ en: "Search"
2036
+ },
2037
+ reset: {
2038
+ nb: "T\xF8m s\xF8kefeltet",
2039
+ nn: "T\xF8m s\xF8kefelt",
2040
+ sv: "Rensa s\xF6krutan",
2041
+ en: "Reset search field"
2042
+ }
2043
+ });
2044
+ }
2045
+ });
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 });
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));
2126
+ });
2127
+ }
2128
+ });
2129
+ var init_input = __esm({
2130
+ "src/input/index.tsx"() {
2131
+ init_AttachedInputs();
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
+ }
2215
2154
  });
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();
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
+ };
2234
2175
  return /* @__PURE__ */ React88__namespace.default.createElement(
2235
- InfoSelect,
2176
+ exports.RadioCardGroupContext.Provider,
2236
2177
  {
2237
- label: t2(texts4.countryCode),
2238
- isLabelSrOnly: true,
2239
- items: callingCodes,
2240
- ...props
2178
+ value: {
2179
+ name,
2180
+ selectedValue,
2181
+ onChange: handleChange,
2182
+ variant,
2183
+ defaultValue: defaultValue || ""
2184
+ }
2241
2185
  },
2242
- (item) => /* @__PURE__ */ React88__namespace.default.createElement(reactStately.Item, { key: item.key }, item.key)
2186
+ /* @__PURE__ */ React88__namespace.default.createElement(
2187
+ react.Stack,
2188
+ {
2189
+ as: "fieldset",
2190
+ direction: direction2,
2191
+ "aria-labelledby": groupLabel || name,
2192
+ role: "radiogroup",
2193
+ tabIndex: 0,
2194
+ ...props
2195
+ },
2196
+ groupLabel && /* @__PURE__ */ React88__namespace.default.createElement(exports.FormLabel, { as: "legend", id: groupLabel }, groupLabel),
2197
+ children
2198
+ )
2243
2199
  );
2244
2200
  };
2245
- CountryCodeSelect_default = CountryCodeSelect;
2246
- texts4 = createTexts({
2247
- countryCode: {
2248
- nb: "Landkode",
2249
- nn: "Landskode",
2250
- en: "Country code",
2251
- sv: "Landskod"
2252
- }
2253
- });
2254
2201
  }
2255
2202
  });
2256
- exports.PhoneNumberInput = void 0; var texts5, LazyCountryCodeSelect;
2257
- var init_PhoneNumberInput = __esm({
2258
- "src/input/PhoneNumberInput.tsx"() {
2259
- init_src();
2260
- 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: ""
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();
2277
2222
  }
2278
- });
2279
- return /* @__PURE__ */ React88__namespace.default.createElement(exports.AttachedInputs, { ...boxProps }, /* @__PURE__ */ React88__namespace.default.createElement(
2280
- React88.Suspense,
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,
2281
2235
  {
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
- )
2293
- },
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
- )
2236
+ type: "radio",
2237
+ id: radioCardId,
2238
+ ref,
2239
+ value,
2240
+ name,
2241
+ checked: isChecked,
2242
+ onChange: () => onChange(value),
2243
+ disabled: isDisabled,
2244
+ __css: styles3.radioInput
2245
+ }
2307
2246
  ), /* @__PURE__ */ React88__namespace.default.createElement(
2308
- exports.Input,
2247
+ react.Box,
2309
2248
  {
2249
+ ...props,
2250
+ tabIndex: 0,
2310
2251
  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"
2324
- }
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"
2263
+ }
2264
+ });
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
+ );
2276
+ }
2277
+ });
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);
2334
2287
  }
2335
- });
2336
- LazyCountryCodeSelect = React88__namespace.default.lazy(() => Promise.resolve().then(() => (init_CountryCodeSelect(), CountryCodeSelect_exports)));
2288
+ );
2337
2289
  }
2338
2290
  });
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
- });
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();
2345
2299
  }
2346
2300
  });
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));
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
+ );
2353
2317
  }
2354
- );
2318
+ return context;
2319
+ };
2355
2320
  }
2356
2321
  });
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,
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
+ };
2427
+ }
2428
+ });
2429
+
2430
+ // src/accordion/index.tsx
2431
+ var init_accordion = __esm({
2432
+ "src/accordion/index.tsx"() {
2433
+ init_Accordion();
2434
+ init_Expandable();
2435
+ }
2436
+ });
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];
2454
+ };
2455
+ return { t: t2, language };
2456
+ }
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);
2414
2471
  }
2415
2472
  });
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
- );
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;
2424
2485
  }
2425
2486
  });
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
2482
- };
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);
2483
2500
  }
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
- });
2501
+ var init_Lottie = __esm({
2502
+ "src/loader/Lottie.tsx"() {
2497
2503
  }
2498
2504
  });
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();
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;
@@ -3537,44 +3561,20 @@ function CalendarCell({
3537
3561
  { passive: false, once: true }
3538
3562
  );
3539
3563
  }, []);
3540
- return /* @__PURE__ */ React88__namespace.default.createElement(
3564
+ return /* @__PURE__ */ React88__namespace.default.createElement(react.Box, { as: "td", ...cellProps, textAlign: "center", sx: styles3.cell }, /* @__PURE__ */ React88__namespace.default.createElement(
3541
3565
  react.Box,
3542
3566
  {
3543
- as: "td",
3544
- ...cellProps,
3545
- textAlign: "center",
3546
- sx: {
3547
- '&[aria-selected="true"] + [aria-selected="true"] > button': {
3548
- "&::before": {
3549
- content: '""',
3550
- display: "block",
3551
- width: "100%",
3552
- height: "100%",
3553
- backgroundColor: "darkTeal",
3554
- position: "absolute",
3555
- left: "-50%",
3556
- top: 0,
3557
- bottom: 0,
3558
- zIndex: -1
3559
- }
3560
- }
3561
- }
3567
+ as: "button",
3568
+ type: "button",
3569
+ ...buttonProps,
3570
+ ...stateProps,
3571
+ ref,
3572
+ sx: styles3.dateCell,
3573
+ hidden: isOutsideVisibleRange,
3574
+ width: "100%"
3562
3575
  },
3563
- /* @__PURE__ */ React88__namespace.default.createElement(
3564
- react.Box,
3565
- {
3566
- as: "button",
3567
- type: "button",
3568
- ...buttonProps,
3569
- ...stateProps,
3570
- ref,
3571
- sx: styles3.dateCell,
3572
- hidden: isOutsideVisibleRange,
3573
- width: "100%"
3574
- },
3575
- date$1.day
3576
- )
3577
- );
3576
+ date$1.day
3577
+ ));
3578
3578
  }
3579
3579
  var init_CalendarCell = __esm({
3580
3580
  "src/datepicker/CalendarCell.tsx"() {
@@ -3736,7 +3736,6 @@ var capitalize, CalendarNavigator, texts13;
3736
3736
  var init_CalendarHeader = __esm({
3737
3737
  "src/datepicker/CalendarHeader.tsx"() {
3738
3738
  init_i18n();
3739
- init_typography();
3740
3739
  init_CalendarNavigationButton();
3741
3740
  init_utils();
3742
3741
  capitalize = (str = "") => str.charAt(0).toUpperCase() + str.slice(1);
@@ -3758,11 +3757,10 @@ var init_CalendarHeader = __esm({
3758
3757
  "aria-label": `${t2(texts13.previous)} ${t2(texts13[unit])}`
3759
3758
  }
3760
3759
  ), /* @__PURE__ */ React88__namespace.default.createElement(
3761
- exports.Heading,
3760
+ react.Box,
3762
3761
  {
3763
- as: "div",
3764
3762
  role: "heading",
3765
- variant: "sm",
3763
+ fontSize: "sm",
3766
3764
  fontWeight: "bold",
3767
3765
  flex: "1",
3768
3766
  textAlign: "center"
@@ -3909,11 +3907,7 @@ var init_DateTimeSegment = __esm({
3909
3907
  outline: "none",
3910
3908
  borderRadius: "xs",
3911
3909
  fontSize: ["mobile.sm", "desktop.sm"],
3912
- sx: styles3.dateTimeSegment,
3913
- _focus: {
3914
- backgroundColor: "darkTeal",
3915
- color: "white"
3916
- }
3910
+ sx: styles3.dateTimeSegment
3917
3911
  },
3918
3912
  isPaddable(segment.type) ? segment.text.padStart(2, "0") : segment.text
3919
3913
  );
@@ -12078,41 +12072,17 @@ var init_badge = __esm({
12078
12072
  };
12079
12073
  }
12080
12074
  });
12081
- var defineMultiStyleConfig27, definePartsStyle27, baseStyleLink2, breadcrumb_default;
12075
+
12076
+ // src/theme/components/breadcrumb.ts
12077
+ var defineMultiStyleConfig27, definePartsStyle27, breadcrumb_default;
12082
12078
  var init_breadcrumb2 = __esm({
12083
12079
  "src/theme/components/breadcrumb.ts"() {
12084
12080
  init_dist4();
12085
12081
  init_dist3();
12086
12082
  init_base_utils();
12087
12083
  init_focus_utils();
12084
+ init_ghost_utils();
12088
12085
  ({ defineMultiStyleConfig: defineMultiStyleConfig27, definePartsStyle: definePartsStyle27 } = createMultiStyleConfigHelpers(breadcrumbAnatomy.keys));
12089
- baseStyleLink2 = defineStyle((props) => ({
12090
- transitionProperty: "common",
12091
- transitionDuration: "fast",
12092
- transitionTimingFunction: "ease-out",
12093
- color: "inherit",
12094
- textDecoration: "none",
12095
- textStyle: "xs",
12096
- paddingX: 0.5,
12097
- borderRadius: "xs",
12098
- "&:not([aria-current=page])": {
12099
- cursor: "pointer",
12100
- _hover: {
12101
- ...baseBackground("hover", props)
12102
- },
12103
- _active: {
12104
- ...baseBackground("active", props)
12105
- },
12106
- ...focusVisibleStyles(props)
12107
- }
12108
- }));
12109
- definePartsStyle27((props) => ({
12110
- link: baseStyleLink2(props),
12111
- list: {
12112
- flexWrap: "wrap",
12113
- alignItems: "flex-start"
12114
- }
12115
- }));
12116
12086
  breadcrumb_default = defineMultiStyleConfig27({
12117
12087
  baseStyle: definePartsStyle27((props) => ({
12118
12088
  link: {
@@ -12151,16 +12121,10 @@ var init_breadcrumb2 = __esm({
12151
12121
  link: {
12152
12122
  "&:not([aria-current=page])": {
12153
12123
  _hover: {
12154
- backgroundColor: themeTools.mode(
12155
- "ghost.surface.hover.light",
12156
- "ghost.surface.hover.dark"
12157
- )(props)
12124
+ ...ghostBackground("hover", props)
12158
12125
  },
12159
12126
  _active: {
12160
- backgroundColor: themeTools.mode(
12161
- "ghost.surface.active.light",
12162
- "ghost.surface.active.dark"
12163
- )(props)
12127
+ ...ghostBackground("active", props)
12164
12128
  }
12165
12129
  }
12166
12130
  }
@@ -12312,26 +12276,26 @@ var init_button2 = __esm({
12312
12276
  lg: {
12313
12277
  minHeight: 8,
12314
12278
  minWidth: 8,
12315
- fontSize: "18px",
12279
+ fontSize: "sm",
12316
12280
  fontWeight: "bold"
12317
12281
  },
12318
12282
  md: {
12319
12283
  minHeight: 7,
12320
12284
  minWidth: 7,
12321
- fontSize: "18px",
12285
+ fontSize: "sm",
12322
12286
  fontWeight: "bold"
12323
12287
  },
12324
12288
  sm: {
12325
12289
  minHeight: 6,
12326
12290
  minWidth: 6,
12327
- fontSize: "16px",
12291
+ fontSize: "xs",
12328
12292
  fontWeight: "normal"
12329
12293
  },
12330
12294
  xs: {
12331
12295
  minHeight: 5,
12332
12296
  minWidth: 5,
12333
12297
  paddingY: 0.5,
12334
- fontSize: "16px",
12298
+ fontSize: "xs",
12335
12299
  fontWeight: "normal"
12336
12300
  }
12337
12301
  },
@@ -13052,9 +13016,10 @@ var init_choice_chip = __esm({
13052
13016
  container: {
13053
13017
  display: "inline-flex",
13054
13018
  alignItems: "center",
13055
- fontSize: "16px",
13019
+ fontSize: "xs",
13056
13020
  cursor: "pointer",
13057
13021
  transitionProperty: "all",
13022
+ borderRadius: "xl",
13058
13023
  transitionDuration: "fast",
13059
13024
  _checked: {
13060
13025
  outlineColor: "transparent",
@@ -13154,42 +13119,38 @@ var init_choice_chip = __esm({
13154
13119
  sizes: {
13155
13120
  xs: {
13156
13121
  container: {
13157
- borderRadius: "30px",
13158
13122
  _checked: {
13159
- borderRadius: "9px"
13123
+ borderRadius: "0.563rem"
13160
13124
  },
13161
- height: "30px",
13125
+ height: 5,
13162
13126
  paddingX: 1.5
13163
13127
  }
13164
13128
  },
13165
13129
  sm: {
13166
13130
  container: {
13167
- borderRadius: "30px",
13168
13131
  _checked: {
13169
- borderRadius: "12px"
13132
+ borderRadius: "sm"
13170
13133
  },
13171
- height: "36px",
13134
+ height: 6,
13172
13135
  paddingX: 2
13173
13136
  }
13174
13137
  },
13175
13138
  md: {
13176
13139
  container: {
13177
- borderRadius: "30px",
13178
13140
  _checked: {
13179
- borderRadius: "12px"
13141
+ borderRadius: "sm"
13180
13142
  },
13181
- height: "42px",
13143
+ height: 7,
13182
13144
  paddingX: 2
13183
13145
  }
13184
13146
  },
13185
13147
  lg: {
13186
13148
  container: {
13187
- borderRadius: "30px",
13188
13149
  _checked: {
13189
- borderRadius: "18px"
13150
+ borderRadius: "md"
13190
13151
  },
13191
- height: "54px",
13192
- px: 3
13152
+ height: 8,
13153
+ paddingX: 3
13193
13154
  }
13194
13155
  }
13195
13156
  },
@@ -13204,6 +13165,7 @@ var $size6, config12, close_button_default;
13204
13165
  var init_close_button = __esm({
13205
13166
  "src/theme/components/close-button.ts"() {
13206
13167
  init_focus_utils();
13168
+ init_ghost_utils();
13207
13169
  $size6 = themeTools.cssVar("close-button-size");
13208
13170
  config12 = react.defineStyleConfig({
13209
13171
  baseStyle: (props) => ({
@@ -13217,27 +13179,27 @@ var init_close_button = __esm({
13217
13179
  fontWeight: "normal",
13218
13180
  ...focusVisibleStyles(props),
13219
13181
  _hover: {
13220
- backgroundColor: themeTools.mode("seaMist", "whiteAlpha.100")(props),
13182
+ ...ghostBackground("hover", props),
13221
13183
  _disabled: {
13222
13184
  color: "dimGrey"
13223
13185
  }
13224
13186
  },
13225
13187
  _active: {
13226
- backgroundColor: themeTools.mode("mint", "whiteAlpha.200")(props)
13188
+ ...ghostBackground("active", props)
13227
13189
  }
13228
13190
  }),
13229
13191
  sizes: {
13230
13192
  lg: {
13231
13193
  [$size6.variable]: "40px",
13232
- fontSize: "16px"
13194
+ fontSize: "xs"
13233
13195
  },
13234
13196
  md: {
13235
13197
  [$size6.variable]: "32px",
13236
- fontSize: "12px"
13198
+ fontSize: "0.75rem"
13237
13199
  },
13238
13200
  sm: {
13239
13201
  [$size6.variable]: "24px",
13240
- fontSize: "10px"
13202
+ fontSize: "0.625rem"
13241
13203
  }
13242
13204
  },
13243
13205
  defaultProps: {
@@ -13286,7 +13248,8 @@ var init_datepicker2 = __esm({
13286
13248
  "weekend",
13287
13249
  "dateCell",
13288
13250
  "inputLabel",
13289
- "dateTimeSegment"
13251
+ "dateTimeSegment",
13252
+ "cell"
13290
13253
  );
13291
13254
  $arrowBackground = themeTools.cssVar("popper-arrow-bg");
13292
13255
  helpers7 = react.createMultiStyleConfigHelpers(parts5.keys);
@@ -13321,7 +13284,11 @@ var init_datepicker2 = __esm({
13321
13284
  color: themeTools.mode(
13322
13285
  "darkGrey",
13323
13286
  props.isPlaceholder ? "whiteAlpha.400" : "white"
13324
- )(props)
13287
+ )(props),
13288
+ _focus: {
13289
+ ...brandBackground("hover", props),
13290
+ color: "white"
13291
+ }
13325
13292
  },
13326
13293
  calendarTriggerButton: {
13327
13294
  width: 8,
@@ -13362,6 +13329,22 @@ var init_datepicker2 = __esm({
13362
13329
  weekend: {
13363
13330
  ...accentText("default", props)
13364
13331
  },
13332
+ cell: {
13333
+ '&[aria-selected="true"] + [aria-selected="true"] > button': {
13334
+ "&::before": {
13335
+ content: '""',
13336
+ display: "block",
13337
+ width: "100%",
13338
+ height: "100%",
13339
+ position: "absolute",
13340
+ left: "-50%",
13341
+ top: 0,
13342
+ bottom: 0,
13343
+ zIndex: -1,
13344
+ ...brandBackground("default", props)
13345
+ }
13346
+ }
13347
+ },
13365
13348
  dateCell: {
13366
13349
  ...ghostBackground("default", props),
13367
13350
  ...baseText("default", props),
@@ -13450,11 +13433,11 @@ var init_datepicker2 = __esm({
13450
13433
  datepicker_default = config14;
13451
13434
  }
13452
13435
  });
13453
- var baseStyle44, variantSolid5, variantDashed2, variants14, sizes25, divider_default;
13436
+ var baseStyle43, variantSolid5, variantDashed2, variants14, sizes25, divider_default;
13454
13437
  var init_divider = __esm({
13455
13438
  "src/theme/components/divider.ts"() {
13456
13439
  init_dist3();
13457
- baseStyle44 = defineStyle((props) => ({
13440
+ baseStyle43 = defineStyle((props) => ({
13458
13441
  borderColor: themeTools.mode("blackAlpha.300", "whiteAlpha.300")(props)
13459
13442
  }));
13460
13443
  variantSolid5 = defineStyle({
@@ -13482,7 +13465,7 @@ var init_divider = __esm({
13482
13465
  }
13483
13466
  };
13484
13467
  divider_default = defineStyleConfig({
13485
- baseStyle: baseStyle44,
13468
+ baseStyle: baseStyle43,
13486
13469
  variants: variants14,
13487
13470
  sizes: sizes25,
13488
13471
  defaultProps: {
@@ -13808,7 +13791,7 @@ var init_info_select = __esm({
13808
13791
  display: "flex",
13809
13792
  appearance: "none",
13810
13793
  width: "100%",
13811
- height: "54px",
13794
+ height: 8,
13812
13795
  borderTopRadius: "sm",
13813
13796
  borderBottomRadius: props.isOpen ? 0 : "sm",
13814
13797
  paddingY: 1.5,
@@ -14195,7 +14178,7 @@ var init_input2 = __esm({
14195
14178
  transitionDuration: "fast",
14196
14179
  position: "relative",
14197
14180
  paddingX: 3,
14198
- height: "54px",
14181
+ height: 8,
14199
14182
  fontSize: "mobile.md",
14200
14183
  ...baseBackground("default", props),
14201
14184
  ...baseBorder("default", props),
@@ -14233,7 +14216,7 @@ var init_input2 = __esm({
14233
14216
  cursor: "text"
14234
14217
  },
14235
14218
  "&:not(:placeholder-shown)": {
14236
- paddingTop: "16px",
14219
+ paddingTop: "1rem",
14237
14220
  "& + label": {
14238
14221
  transform: "scale(0.825) translateY(-10px)"
14239
14222
  }
@@ -14456,13 +14439,13 @@ var init_link2 = __esm({
14456
14439
  });
14457
14440
 
14458
14441
  // src/theme/components/list.ts
14459
- var defineMultiStyleConfig28, definePartsStyle28, baseStyle45, list_default;
14442
+ var defineMultiStyleConfig28, definePartsStyle28, baseStyle44, list_default;
14460
14443
  var init_list2 = __esm({
14461
14444
  "src/theme/components/list.ts"() {
14462
14445
  init_dist4();
14463
14446
  init_dist3();
14464
14447
  ({ defineMultiStyleConfig: defineMultiStyleConfig28, definePartsStyle: definePartsStyle28 } = createMultiStyleConfigHelpers(listAnatomy.keys));
14465
- baseStyle45 = definePartsStyle28({
14448
+ baseStyle44 = definePartsStyle28({
14466
14449
  container: {
14467
14450
  fontSize: ["mobile.sm", "desktop.sm"]
14468
14451
  },
@@ -14476,7 +14459,7 @@ var init_list2 = __esm({
14476
14459
  }
14477
14460
  });
14478
14461
  list_default = defineMultiStyleConfig28({
14479
- baseStyle: baseStyle45
14462
+ baseStyle: baseStyle44
14480
14463
  });
14481
14464
  }
14482
14465
  });
@@ -14946,8 +14929,10 @@ var init_progress_bar = __esm({
14946
14929
  },
14947
14930
  background: {
14948
14931
  display: "flex",
14949
- backgroundColor: themeTools.mode("coralGreen", "pine")(props),
14950
- // TODO: Replace with semantic tokens
14932
+ backgroundColor: themeTools.mode(
14933
+ "brand.surface.default.dark",
14934
+ "brand.surface.default.light"
14935
+ )(props),
14951
14936
  borderRadius: "sm",
14952
14937
  justifyContent: "flex-start",
14953
14938
  marginX: "auto"
@@ -15050,7 +15035,6 @@ var init_radio_card = __esm({
15050
15035
  config33 = helpers24.defineMultiStyleConfig({
15051
15036
  baseStyle: (props) => ({
15052
15037
  container: {
15053
- appearance: "none",
15054
15038
  border: "none",
15055
15039
  overflow: "hidden",
15056
15040
  fontSize: "inherit",
@@ -15092,6 +15076,9 @@ var init_radio_card = __esm({
15092
15076
  _active: {
15093
15077
  ...baseBackground("active", props),
15094
15078
  ...baseBorder("active", props)
15079
+ },
15080
+ _focus: {
15081
+ ...outlineBorder("focus", props)
15095
15082
  }
15096
15083
  },
15097
15084
  checked: {
@@ -15101,13 +15088,17 @@ var init_radio_card = __esm({
15101
15088
  _active: {
15102
15089
  ...baseBackground("active", props),
15103
15090
  ...baseBorder("active", props)
15091
+ },
15092
+ _focus: {
15093
+ outline: "4px solid",
15094
+ outlineStyle: "double",
15095
+ ...outlineBorder("focus", props),
15096
+ outlineOffset: "-1px"
15104
15097
  }
15105
15098
  }
15106
15099
  }),
15107
15100
  floating: (props) => ({
15108
15101
  container: {
15109
- ...baseText("default", props),
15110
- ...baseBackground("default", props),
15111
15102
  ...floatingBackground("default", props),
15112
15103
  ...floatingBorder("default", props),
15113
15104
  boxShadow: "sm",
@@ -15119,16 +15110,25 @@ var init_radio_card = __esm({
15119
15110
  _active: {
15120
15111
  ...floatingBackground("active", props),
15121
15112
  ...floatingBorder("active", props)
15113
+ },
15114
+ _focus: {
15115
+ ...outlineBorder("focus", props)
15122
15116
  }
15123
15117
  },
15124
15118
  checked: {
15125
- cursor: "normal",
15126
15119
  _hover: {
15127
- ...floatingBorder("hover", props)
15120
+ ...floatingBorder("hover", props),
15121
+ boxShadow: "md"
15128
15122
  },
15129
15123
  _active: {
15130
15124
  ...floatingBackground("active", props),
15131
15125
  ...floatingBorder("active", props)
15126
+ },
15127
+ _focus: {
15128
+ outline: "4px solid",
15129
+ outlineStyle: "double",
15130
+ ...outlineBorder("focus", props),
15131
+ outlineOffset: "-1px"
15132
15132
  }
15133
15133
  }
15134
15134
  })
@@ -15177,7 +15177,10 @@ var init_radio = __esm({
15177
15177
  ...baseText("disabled", props)
15178
15178
  },
15179
15179
  _checked: {
15180
- color: themeTools.mode("pine", "coralGreen")(props),
15180
+ color: themeTools.mode(
15181
+ "brand.surface.default.light",
15182
+ "brand.surface.default.dark"
15183
+ )(props),
15181
15184
  borderColor: "currentColor",
15182
15185
  _before: {
15183
15186
  content: `""`,
@@ -15232,17 +15235,17 @@ var init_select = __esm({
15232
15235
  field: {
15233
15236
  ...input_default.baseStyle(props).field,
15234
15237
  appearance: "none",
15235
- paddingTop: "16px",
15238
+ paddingTop: "1rem",
15236
15239
  "option, optgroup": {}
15237
15240
  },
15238
15241
  icon: {
15239
- width: "30px",
15240
- height: "30px",
15242
+ width: 5,
15243
+ height: 5,
15241
15244
  insetEnd: "0.5rem",
15242
15245
  position: "relative",
15243
15246
  color: "currentColor",
15244
15247
  strokeLinecap: "round",
15245
- fontSize: "1.125rem",
15248
+ fontSize: "sm",
15246
15249
  _disabled: {
15247
15250
  ...baseText("disabled", props)
15248
15251
  }
@@ -15750,7 +15753,7 @@ var init_tabs = __esm({
15750
15753
  sizes: {
15751
15754
  xs: {
15752
15755
  tablist: {
15753
- height: "30px",
15756
+ height: 5,
15754
15757
  padding: "2px"
15755
15758
  },
15756
15759
  tab: {
@@ -15760,7 +15763,7 @@ var init_tabs = __esm({
15760
15763
  },
15761
15764
  sm: {
15762
15765
  tablist: {
15763
- height: "36px",
15766
+ height: 6,
15764
15767
  padding: 0.5
15765
15768
  },
15766
15769
  tab: {
@@ -15769,7 +15772,7 @@ var init_tabs = __esm({
15769
15772
  },
15770
15773
  md: {
15771
15774
  tablist: {
15772
- height: "42px",
15775
+ height: 7,
15773
15776
  padding: 0.5
15774
15777
  },
15775
15778
  tab: {
@@ -15779,7 +15782,7 @@ var init_tabs = __esm({
15779
15782
  },
15780
15783
  lg: {
15781
15784
  tablist: {
15782
- height: "54px",
15785
+ height: 8,
15783
15786
  padding: "4px"
15784
15787
  },
15785
15788
  tab: {
@@ -15959,6 +15962,7 @@ var init_pressable_card = __esm({
15959
15962
  }
15960
15963
  }),
15961
15964
  accent: (props) => ({
15965
+ ...accentText("default", props),
15962
15966
  ...accentBackground("default", props),
15963
15967
  boxShadow: "sm",
15964
15968
  _hover: {