@vygruppen/spor-react 12.0.2 → 12.0.4

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.
Files changed (163) hide show
  1. package/.turbo/turbo-build.log +11 -10
  2. package/.turbo/turbo-typegen.log +1 -1
  3. package/CHANGELOG.md +16 -0
  4. package/dist/index.d.mts +576 -576
  5. package/dist/index.d.ts +576 -576
  6. package/dist/index.js +8641 -8613
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +8842 -8814
  9. package/dist/index.mjs.map +1 -1
  10. package/eslint.config.mjs +9 -0
  11. package/package.json +10 -7
  12. package/src/accordion/Accordion.tsx +5 -4
  13. package/src/accordion/Expandable.tsx +2 -1
  14. package/src/accordion/types.ts +3 -2
  15. package/src/alert/Alert.tsx +5 -3
  16. package/src/alert/AlertIcon.tsx +2 -1
  17. package/src/alert/ExpandableAlert.tsx +6 -4
  18. package/src/alert/ServiceAlert.tsx +5 -4
  19. package/src/alert/index.ts +1 -1
  20. package/src/breadcrumb/Breadcrumb.tsx +3 -3
  21. package/src/button/Button.tsx +4 -3
  22. package/src/button/ButtonGroup.tsx +3 -2
  23. package/src/button/Clipboard.tsx +5 -3
  24. package/src/button/CloseButton.tsx +1 -0
  25. package/src/button/FloatingActionButton.tsx +1 -0
  26. package/src/button/IconButton.tsx +1 -0
  27. package/src/button/index.tsx +1 -1
  28. package/src/color-mode/color-mode.tsx +1 -1
  29. package/src/datepicker/Calendar.tsx +5 -3
  30. package/src/datepicker/CalendarCell.tsx +2 -1
  31. package/src/datepicker/CalendarGrid.tsx +4 -3
  32. package/src/datepicker/CalendarHeader.tsx +1 -0
  33. package/src/datepicker/CalendarNavigationButton.tsx +1 -0
  34. package/src/datepicker/CalendarTriggerButton.tsx +1 -0
  35. package/src/datepicker/DateField.tsx +5 -4
  36. package/src/datepicker/DatePicker.tsx +4 -2
  37. package/src/datepicker/DateRangePicker.tsx +7 -7
  38. package/src/datepicker/DateTimeSegment.tsx +3 -2
  39. package/src/datepicker/RangeCalendar.tsx +5 -3
  40. package/src/datepicker/StyledField.tsx +2 -1
  41. package/src/datepicker/TimeField.tsx +2 -1
  42. package/src/datepicker/TimePicker.tsx +4 -2
  43. package/src/datepicker/index.tsx +1 -1
  44. package/src/datepicker/utils.ts +1 -0
  45. package/src/dialog/Dialog.tsx +1 -0
  46. package/src/dialog/Drawer.tsx +2 -1
  47. package/src/dialog/index.ts +1 -1
  48. package/src/dialog/types.ts +3 -2
  49. package/src/image/index.tsx +1 -1
  50. package/src/index.tsx +5 -5
  51. package/src/input/AttachedInputs.tsx +3 -1
  52. package/src/input/CardSelect.tsx +3 -2
  53. package/src/input/Checkbox.tsx +2 -1
  54. package/src/input/ChoiceChip.tsx +2 -1
  55. package/src/input/Combobox.tsx +1 -0
  56. package/src/input/CountryCodeSelect.tsx +2 -1
  57. package/src/input/Field.tsx +1 -0
  58. package/src/input/Input.tsx +5 -3
  59. package/src/input/InputGroup.tsx +2 -1
  60. package/src/input/ListBox.tsx +5 -4
  61. package/src/input/NativeSelect.tsx +2 -1
  62. package/src/input/NumericStepper.tsx +1 -0
  63. package/src/input/PasswordInput.tsx +1 -0
  64. package/src/input/PhoneNumberInput.tsx +2 -1
  65. package/src/input/Radio.tsx +3 -2
  66. package/src/input/SearchInput.tsx +1 -0
  67. package/src/input/Select.tsx +5 -4
  68. package/src/input/Switch.tsx +2 -1
  69. package/src/input/Textarea.tsx +3 -2
  70. package/src/input/index.ts +1 -1
  71. package/src/layout/PressableCard.tsx +2 -1
  72. package/src/layout/RadioCard.tsx +1 -0
  73. package/src/layout/Separator.tsx +2 -1
  74. package/src/layout/StaticCard.tsx +2 -1
  75. package/src/layout/index.tsx +16 -16
  76. package/src/linjetag/InfoTag.tsx +2 -1
  77. package/src/linjetag/LineIcon.tsx +1 -0
  78. package/src/linjetag/TravelTag.tsx +2 -1
  79. package/src/linjetag/icons.tsx +1 -0
  80. package/src/link/TextLink.tsx +1 -0
  81. package/src/loader/ClientOnly.tsx +1 -0
  82. package/src/loader/ColorInlineLoader.tsx +1 -0
  83. package/src/loader/ColorSpinner.tsx +1 -0
  84. package/src/loader/ContentLoader.tsx +1 -0
  85. package/src/loader/DarkFullScreenLoader.tsx +1 -0
  86. package/src/loader/DarkInlineLoader.tsx +1 -0
  87. package/src/loader/DarkSpinner.tsx +1 -0
  88. package/src/loader/LightFullScreenLoader.tsx +1 -0
  89. package/src/loader/LightInlineLoader.tsx +1 -0
  90. package/src/loader/LightSpinner.tsx +1 -0
  91. package/src/loader/Lottie.tsx +1 -2
  92. package/src/loader/ProgressBar.tsx +2 -1
  93. package/src/loader/ProgressLoader.tsx +3 -2
  94. package/src/loader/Skeleton.tsx +4 -3
  95. package/src/loader/useHydrated.tsx +1 -1
  96. package/src/logo/VyLogo.tsx +1 -0
  97. package/src/logo/VyLogoPride.tsx +1 -0
  98. package/src/logo/index.tsx +1 -1
  99. package/src/media-controller/JumpButton.tsx +3 -2
  100. package/src/media-controller/PlayPauseButton.tsx +3 -2
  101. package/src/media-controller/SkipButton.tsx +3 -2
  102. package/src/nudge/Nudge.tsx +14 -14
  103. package/src/pagination/Pagination.tsx +4 -3
  104. package/src/pagination/types.ts +2 -1
  105. package/src/popover/index.tsx +4 -3
  106. package/src/progress-indicator/ProgressDot.tsx +2 -1
  107. package/src/progress-indicator/ProgressIndicator.tsx +2 -1
  108. package/src/provider/SporProvider.tsx +4 -5
  109. package/src/stepper/Stepper.tsx +2 -1
  110. package/src/stepper/StepperStep.tsx +1 -0
  111. package/src/tab/Tabs.tsx +2 -1
  112. package/src/table/Table.tsx +2 -1
  113. package/src/table/index.tsx +14 -14
  114. package/src/theme/index.ts +7 -6
  115. package/src/theme/recipes/close-button.ts +1 -0
  116. package/src/theme/recipes/code.ts +1 -0
  117. package/src/theme/recipes/link.ts +1 -0
  118. package/src/theme/recipes/pressable-card.ts +2 -1
  119. package/src/theme/recipes/textarea.ts +1 -0
  120. package/src/theme/semantic-tokens/colors.ts +1 -1
  121. package/src/theme/semantic-tokens/index.ts +1 -1
  122. package/src/theme/slot-recipes/accordion.ts +2 -1
  123. package/src/theme/slot-recipes/alert-expandable.ts +2 -1
  124. package/src/theme/slot-recipes/alert-service.ts +1 -0
  125. package/src/theme/slot-recipes/alert.ts +1 -0
  126. package/src/theme/slot-recipes/breadcrumb.ts +2 -1
  127. package/src/theme/slot-recipes/checkbox.ts +1 -0
  128. package/src/theme/slot-recipes/datepicker.ts +1 -0
  129. package/src/theme/slot-recipes/dialog.ts +1 -0
  130. package/src/theme/slot-recipes/drawer.ts +1 -0
  131. package/src/theme/slot-recipes/field.ts +1 -0
  132. package/src/theme/slot-recipes/floating-action-button.ts +1 -0
  133. package/src/theme/slot-recipes/index.ts +2 -2
  134. package/src/theme/slot-recipes/info-tag.ts +3 -2
  135. package/src/theme/slot-recipes/line-icon.ts +1 -0
  136. package/src/theme/slot-recipes/list.ts +1 -0
  137. package/src/theme/slot-recipes/listbox.ts +1 -0
  138. package/src/theme/slot-recipes/media-controller-button.ts +1 -0
  139. package/src/theme/slot-recipes/native-select.ts +3 -2
  140. package/src/theme/slot-recipes/numeric-stepper.ts +1 -0
  141. package/src/theme/slot-recipes/pagination.ts +1 -0
  142. package/src/theme/slot-recipes/popover.ts +2 -1
  143. package/src/theme/slot-recipes/progress-bar.ts +1 -0
  144. package/src/theme/slot-recipes/radio-card.ts +2 -1
  145. package/src/theme/slot-recipes/radio.ts +1 -0
  146. package/src/theme/slot-recipes/select.ts +1 -0
  147. package/src/theme/slot-recipes/stepper.ts +1 -0
  148. package/src/theme/slot-recipes/switch.ts +2 -1
  149. package/src/theme/slot-recipes/table.ts +1 -0
  150. package/src/theme/slot-recipes/tabs.ts +1 -0
  151. package/src/theme/slot-recipes/toast.ts +1 -0
  152. package/src/theme/slot-recipes/travel-tag.ts +1 -0
  153. package/src/theme/tokens/colors.ts +1 -1
  154. package/src/theme/tokens/index.ts +4 -4
  155. package/src/theme/tokens/sizes.ts +1 -0
  156. package/src/theme/utils/input-utils.ts +1 -1
  157. package/src/toast/toast.tsx +6 -6
  158. package/src/transition/index.ts +1 -1
  159. package/src/typography/Badge.tsx +1 -2
  160. package/src/typography/Code.tsx +2 -1
  161. package/src/typography/Heading.tsx +2 -1
  162. package/src/typography/index.ts +1 -1
  163. package/src/util/externals.tsx +11 -11
@@ -0,0 +1,9 @@
1
+ import config from "@vygruppen/eslint-config";
2
+
3
+ /** @type {import("eslint").Linter.Config} */
4
+ export default [
5
+ ...config,
6
+ {
7
+ ignores: ["./dist/*"],
8
+ },
9
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "12.0.2",
3
+ "version": "12.0.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -13,9 +13,9 @@
13
13
  "directory": "packages/spor-react"
14
14
  },
15
15
  "dependencies": {
16
- "@chakra-ui/react": "^3.9.0",
17
16
  "@ark-ui/react": "^4.9.2",
18
17
  "@chakra-ui/anatomy": "^2.3.4",
18
+ "@chakra-ui/react": "^3.9.0",
19
19
  "@chakra-ui/react-use-size": "^2.1.0",
20
20
  "@chakra-ui/styled-system": "^2.12.0",
21
21
  "@chakra-ui/system": "^2.6.2",
@@ -35,9 +35,9 @@
35
35
  "react-stately": "^3.31.1",
36
36
  "react-swipeable": "^7.0.1",
37
37
  "usehooks-ts": "^3.1.0",
38
- "@vygruppen/spor-design-tokens": "4.0.0",
39
- "@vygruppen/spor-icon-react": "4.0.1",
40
- "@vygruppen/spor-loader": "0.6.0"
38
+ "@vygruppen/spor-design-tokens": "4.0.2",
39
+ "@vygruppen/spor-loader": "0.6.0",
40
+ "@vygruppen/spor-icon-react": "4.0.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@chakra-ui/cli": "^3.8.0",
@@ -48,6 +48,7 @@
48
48
  "@types/node": "^22.13.4",
49
49
  "@types/react": "^18.3.3",
50
50
  "@types/react-dom": "^18.3.0",
51
+ "eslint": "^9.25.1",
51
52
  "react": "^18.3.1",
52
53
  "react-dom": "^18.3.1",
53
54
  "tsup": "^7.2.0",
@@ -55,7 +56,8 @@
55
56
  "vitest": "^0.26.3",
56
57
  "vitest-axe": "^0.1.0",
57
58
  "vitest-canvas-mock": "^0.2.2",
58
- "@vygruppen/tsconfig": "0.1.0"
59
+ "@vygruppen/tsconfig": "0.1.0",
60
+ "@vygruppen/eslint-config": "1.0.0"
59
61
  },
60
62
  "peerDependencies": {
61
63
  "react": ">=18.0.0 <19.0.0",
@@ -66,6 +68,7 @@
66
68
  "dev": "tsup --watch",
67
69
  "typegen": "npx @chakra-ui/cli typegen src/theme/index.ts",
68
70
  "typegen:watch": "npx @chakra-ui/cli typegen src/theme/index.ts --watch",
69
- "typegen:strict": "npx @chakra-ui/cli typegen /src/theme/index.ts --strict"
71
+ "typegen:strict": "npx @chakra-ui/cli typegen /src/theme/index.ts --strict",
72
+ "lint": "eslint ."
70
73
  }
71
74
  }
@@ -1,20 +1,21 @@
1
1
  "use client";
2
2
 
3
3
  import {
4
- Box,
5
4
  Accordion as ChakraAccordion,
5
+ Box,
6
6
  HStack,
7
7
  Stack,
8
8
  useSlotRecipe,
9
9
  } from "@chakra-ui/react";
10
10
  import { DropdownDownFill24Icon } from "@vygruppen/spor-icon-react";
11
11
  import React, { forwardRef } from "react";
12
+
13
+ import { warnAboutMismatchingIcon } from "./helpers";
12
14
  import {
13
- AccordionProps,
14
- AccordionItemTriggerProps,
15
15
  AccordionItemContentProps,
16
+ AccordionItemTriggerProps,
17
+ AccordionProps,
16
18
  } from "./types";
17
- import { warnAboutMismatchingIcon } from "./helpers";
18
19
 
19
20
  /*
20
21
  * Wraps a set of AccordionItem or AccordionItem components.
@@ -1,14 +1,15 @@
1
1
  "use client";
2
2
 
3
3
  import React, { forwardRef } from "react";
4
+
4
5
  import {
5
6
  Accordion,
6
7
  AccordionItem,
7
8
  AccordionItemContent,
8
9
  AccordionItemTrigger,
9
10
  } from "./Accordion";
10
- import { ExpandableItemProps, ExpandableProps } from "./types";
11
11
  import { warnAboutMismatchingIcon } from "./helpers";
12
+ import { ExpandableItemProps, ExpandableProps } from "./types";
12
13
 
13
14
  /**
14
15
  * A standalone expandable component.
@@ -1,11 +1,12 @@
1
- import { accordionSlotRecipe } from "@/theme/slot-recipes/accordion";
2
1
  import { RecipeVariantProps } from "@chakra-ui/react";
3
2
  import {
4
- AccordionRootProps as ChakraAccordionProps,
5
3
  Accordion as ChakraAccordion,
4
+ AccordionRootProps as ChakraAccordionProps,
6
5
  } from "@chakra-ui/react";
7
6
  import { PropsWithChildren } from "react";
8
7
 
8
+ import { accordionSlotRecipe } from "@/theme/slot-recipes/accordion";
9
+
9
10
  export type AccordionVariantProps = RecipeVariantProps<
10
11
  typeof accordionSlotRecipe
11
12
  >;
@@ -2,14 +2,16 @@
2
2
 
3
3
  import {
4
4
  Alert as ChakraAlert,
5
- useDisclosure,
6
5
  HStack,
6
+ useDisclosure,
7
7
  useSlotRecipe,
8
8
  } from "@chakra-ui/react";
9
+ import { IconComponent } from "@vygruppen/spor-icon-react";
9
10
  import React, { forwardRef } from "react";
10
- import { AlertIcon } from "./AlertIcon";
11
+
11
12
  import { CloseButton } from "@/button";
12
- import { IconComponent } from "@vygruppen/spor-icon-react";
13
+
14
+ import { AlertIcon } from "./AlertIcon";
13
15
 
14
16
  export type AlertProps = Omit<ChakraAlert.RootProps, "colorPalette"> & {
15
17
  /** Whether or not to show the alert icon */
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
 
3
+ import { Alert as ChakraAlert, Box, useSlotRecipe } from "@chakra-ui/react";
3
4
  import {
4
5
  AltTransportFill24Icon,
5
6
  ErrorFill24Icon,
@@ -12,9 +13,9 @@ import {
12
13
  WarningFill24Icon,
13
14
  } from "@vygruppen/spor-icon-react";
14
15
  import React, { PropsWithChildren } from "react";
16
+
15
17
  import { createTexts, useTranslation } from "../i18n";
16
18
  import { AlertProps } from "./Alert";
17
- import { Box, useSlotRecipe, Alert as ChakraAlert } from "@chakra-ui/react";
18
19
 
19
20
  type AlertIconProps = {
20
21
  variant: ChakraAlert.RootProps["variant"];
@@ -9,12 +9,14 @@ import {
9
9
  Span,
10
10
  useSlotRecipe,
11
11
  } from "@chakra-ui/react";
12
- import React, { forwardRef, PropsWithChildren } from "react";
13
- import { AlertIcon } from "./AlertIcon";
14
- import { AlertProps } from "./Alert";
15
- import { alertExpandableSlotRecipe } from "@/theme/slot-recipes/alert-expandable";
16
12
  import { DropdownDownFill18Icon } from "@vygruppen/spor-icon-react";
13
+ import React, { forwardRef, PropsWithChildren } from "react";
14
+
17
15
  import { AccordionItemContent } from "@/accordion";
16
+ import { alertExpandableSlotRecipe } from "@/theme/slot-recipes/alert-expandable";
17
+
18
+ import { AlertProps } from "./Alert";
19
+ import { AlertIcon } from "./AlertIcon";
18
20
 
19
21
  type ExpandableAlertVariantProps = RecipeVariantProps<
20
22
  typeof alertExpandableSlotRecipe
@@ -10,15 +10,16 @@ import {
10
10
  Text,
11
11
  useSlotRecipe,
12
12
  } from "@chakra-ui/react";
13
- import React, { forwardRef, PropsWithChildren } from "react";
14
- import { AlertProps } from "./Alert";
15
- import { createTexts, useTranslation } from "../i18n";
16
- import { alertServiceSlotRecipe } from "../theme/slot-recipes/alert-service";
17
13
  import {
18
14
  DropdownDownFill24Icon,
19
15
  ServiceFill24Icon,
20
16
  WarningFill24Icon,
21
17
  } from "@vygruppen/spor-icon-react";
18
+ import React, { forwardRef, PropsWithChildren } from "react";
19
+
20
+ import { createTexts, useTranslation } from "../i18n";
21
+ import { alertServiceSlotRecipe } from "../theme/slot-recipes/alert-service";
22
+ import { AlertProps } from "./Alert";
22
23
 
23
24
  type ServiceAlertVariantProps = RecipeVariantProps<
24
25
  typeof alertServiceSlotRecipe
@@ -1,3 +1,3 @@
1
+ export * from "./Alert";
1
2
  export * from "./ExpandableAlert";
2
3
  export * from "./ServiceAlert";
3
- export * from "./Alert";
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
 
3
- import React, { forwardRef } from "react";
4
3
  import {
5
4
  Breadcrumb as ChakraBreadcrumb,
6
- BreadcrumbRootProps,
7
- BreadcrumbLink as ChakraBreadcrumbLink,
8
5
  BreadcrumbCurrentLink as ChakraBreadcrumbCurrentLink,
9
6
  BreadcrumbEllipsis as ChakraBreadcrumbEllipsis,
7
+ BreadcrumbLink as ChakraBreadcrumbLink,
8
+ BreadcrumbRootProps,
10
9
  } from "@chakra-ui/react";
11
10
  import { DropdownRightFill18Icon } from "@vygruppen/spor-icon-react";
11
+ import React, { forwardRef } from "react";
12
12
  /**
13
13
  * A breadcrumb component.
14
14
  *
@@ -1,13 +1,14 @@
1
1
  import {
2
2
  Box,
3
- Center,
4
3
  Button as ChakraButton,
5
- Flex,
6
- Span,
7
4
  type ButtonProps as ChakraButtonProps,
5
+ Center,
6
+ Flex,
8
7
  type RecipeVariantProps,
8
+ Span,
9
9
  } from "@chakra-ui/react";
10
10
  import React, { forwardRef, PropsWithChildren } from "react";
11
+
11
12
  import { createTexts, useTranslation } from "../i18n";
12
13
  import { ColorInlineLoader } from "../loader";
13
14
  import { buttonRecipe } from "../theme/recipes/button";
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
 
3
3
  import {
4
- type GroupProps as ChakraGroupProps,
4
+ chakra,
5
5
  Group as ChakraGroup,
6
+ type GroupProps as ChakraGroupProps,
6
7
  type RecipeVariantProps,
7
- chakra,
8
8
  } from "@chakra-ui/react";
9
9
  import React, { forwardRef, PropsWithChildren } from "react";
10
+
10
11
  import { groupRecipe } from "../theme/recipes/group";
11
12
 
12
13
  export type GroupVariantProps = RecipeVariantProps<typeof groupRecipe>;
@@ -1,13 +1,15 @@
1
1
  import { Clipboard as ChakraClipboard } from "@chakra-ui/react";
2
- import * as React from "react";
3
- import { createTexts, useTranslation } from "@/i18n";
4
2
  import {
5
3
  CheckmarkFill18Icon,
6
4
  CopyOutline18Icon,
7
5
  } from "@vygruppen/spor-icon-react";
8
- import { Button, ButtonProps } from "./Button";
6
+ import * as React from "react";
7
+
8
+ import { createTexts, useTranslation } from "@/i18n";
9
9
  import { Text } from "@/typography";
10
10
 
11
+ import { Button, ButtonProps } from "./Button";
12
+
11
13
  /**
12
14
  *
13
15
  * Creates a button that copies text to the clipboard.
@@ -6,6 +6,7 @@ import {
6
6
  CloseFill30Icon,
7
7
  } from "@vygruppen/spor-icon-react";
8
8
  import React, { forwardRef } from "react";
9
+
9
10
  import { createTexts, useTranslation } from "../i18n";
10
11
  import { IconButton, IconButtonProps } from "./IconButton";
11
12
 
@@ -8,6 +8,7 @@ import {
8
8
  useSlotRecipe,
9
9
  } from "@chakra-ui/react";
10
10
  import React, { forwardRef, PropsWithChildren, useEffect } from "react";
11
+
11
12
  import { floatingActionButtonSlotRecipe } from "../theme/slot-recipes/floating-action-button";
12
13
 
13
14
  type FloatingActionButtonVariantProps = RecipeVariantProps<
@@ -3,6 +3,7 @@ import {
3
3
  type IconButtonProps as ChakraIconButtonProps,
4
4
  } from "@chakra-ui/react";
5
5
  import React, { forwardRef, PropsWithChildren } from "react";
6
+
6
7
  import { ButtonVariantProps, ColorSpinner } from "..";
7
8
 
8
9
  export type IconButtonProps = Exclude<
@@ -1,6 +1,6 @@
1
1
  export * from "./Button";
2
2
  export * from "./ButtonGroup";
3
+ export * from "./Clipboard";
3
4
  export * from "./CloseButton";
4
5
  export * from "./FloatingActionButton";
5
6
  export * from "./IconButton";
6
- export * from "./Clipboard";
@@ -2,8 +2,8 @@
2
2
 
3
3
  import type { IconButtonProps } from "@chakra-ui/react";
4
4
  import { ClientOnly, IconButton, Skeleton } from "@chakra-ui/react";
5
- import { ThemeProvider, useTheme } from "next-themes";
6
5
  import type { ThemeProviderProps } from "next-themes";
6
+ import { ThemeProvider, useTheme } from "next-themes";
7
7
  import * as React from "react";
8
8
  import { LuMoon, LuSun } from "react-icons/lu";
9
9
 
@@ -5,16 +5,18 @@ import { createCalendar } from "@internationalized/date";
5
5
  import React from "react";
6
6
  import {
7
7
  CalendarProps as ReactAriaCalendarProps,
8
- useCalendar,
9
8
  DateValue,
9
+ useCalendar,
10
10
  } from "react-aria";
11
11
  import { useCalendarState } from "react-stately";
12
+
13
+ import { datePickerSlotRecipe } from "@/theme/slot-recipes/datepicker";
14
+
12
15
  import { createTexts, useTranslation } from "../i18n";
13
16
  import { CalendarGrid } from "./CalendarGrid";
14
17
  import { CalendarHeader } from "./CalendarHeader";
15
- import { useCurrentLocale } from "./utils";
16
18
  import { CalendarVariants } from "./types";
17
- import { datePickerSlotRecipe } from "@/theme/slot-recipes/datepicker";
19
+ import { useCurrentLocale } from "./utils";
18
20
 
19
21
  type CalendarProps = ReactAriaCalendarProps<DateValue> &
20
22
  CalendarVariants & {
@@ -10,8 +10,9 @@ import {
10
10
  import React, { PropsWithChildren, useEffect, useRef } from "react";
11
11
  import { useCalendarCell } from "react-aria";
12
12
  import { CalendarState, RangeCalendarState } from "react-stately";
13
- import { DatePickerVariantProps } from "./DatePicker";
13
+
14
14
  import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
15
+ import { DatePickerVariantProps } from "./DatePicker";
15
16
  import { CalendarVariants } from "./types";
16
17
 
17
18
  type CalendarCellProps = PropsWithChildren<DatePickerVariantProps> &
@@ -1,16 +1,17 @@
1
1
  "use client";
2
2
 
3
+ import { Box, useSlotRecipe } from "@chakra-ui/react";
3
4
  import { endOfMonth, getWeeksInMonth } from "@internationalized/date";
4
5
  import React from "react";
5
6
  import { AriaCalendarGridProps, useCalendarGrid } from "react-aria";
6
7
  import { CalendarState, RangeCalendarState } from "react-stately";
8
+
7
9
  import { Language, useTranslation } from "../i18n";
10
+ import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
8
11
  import { Text } from "../typography";
9
12
  import { CalendarCell } from "./CalendarCell";
10
- import { useCurrentLocale } from "./utils";
11
- import { Box, useSlotRecipe } from "@chakra-ui/react";
12
- import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
13
13
  import { CalendarVariants } from "./types";
14
+ import { useCurrentLocale } from "./utils";
14
15
 
15
16
  const weekDays: Record<Language, string[]> = {
16
17
  nb: ["Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"],
@@ -7,6 +7,7 @@ import {
7
7
  } from "@vygruppen/spor-icon-react";
8
8
  import React from "react";
9
9
  import { CalendarState, RangeCalendarState } from "react-stately";
10
+
10
11
  import { createTexts, useTranslation } from "../i18n";
11
12
  import { CalendarNavigationButton } from "./CalendarNavigationButton";
12
13
  import { useCurrentLocale } from "./utils";
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import React, { useRef } from "react";
3
3
  import { AriaButtonProps, useButton } from "react-aria";
4
+
4
5
  import { IconButton } from "..";
5
6
 
6
7
  type CalendarButtonProps = AriaButtonProps<"button"> & {
@@ -4,6 +4,7 @@ import { BoxProps, PopoverAnchor, useSlotRecipe } from "@chakra-ui/react";
4
4
  import { CalendarOutline24Icon } from "@vygruppen/spor-icon-react";
5
5
  import React, { forwardRef, PropsWithChildren } from "react";
6
6
  import { AriaButtonProps } from "react-aria";
7
+
7
8
  import {
8
9
  createTexts,
9
10
  DatePickerVariantProps,
@@ -2,14 +2,15 @@
2
2
  import { Box, Flex, useSlotRecipe } from "@chakra-ui/react";
3
3
  import { DateValue, GregorianCalendar } from "@internationalized/date";
4
4
  import { DOMAttributes, FocusableElement } from "@react-types/shared";
5
- import React, { PropsWithChildren, RefObject, forwardRef, useRef } from "react";
5
+ import React, { forwardRef, PropsWithChildren, RefObject, useRef } from "react";
6
6
  import { AriaDateFieldProps, useDateField } from "react-aria";
7
7
  import { DateSegment, useDateFieldState } from "react-stately";
8
- import { DateTimeSegment } from "./DateTimeSegment";
9
- import { useCurrentLocale } from "./utils";
8
+
10
9
  import { createTexts, useTranslation } from "../i18n";
11
- import { DatePickerVariantProps } from "./DatePicker";
12
10
  import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
11
+ import { DatePickerVariantProps } from "./DatePicker";
12
+ import { DateTimeSegment } from "./DateTimeSegment";
13
+ import { useCurrentLocale } from "./utils";
13
14
 
14
15
  function createCalendar(identifier: string) {
15
16
  switch (identifier) {
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import { Field } from "@/input/Field";
3
2
  import {
4
3
  Box,
5
4
  BoxProps,
@@ -11,9 +10,9 @@ import {
11
10
  useSlotRecipe,
12
11
  } from "@chakra-ui/react";
13
12
  import React, {
13
+ forwardRef,
14
14
  PropsWithChildren,
15
15
  ReactNode,
16
- forwardRef,
17
16
  useId,
18
17
  useRef,
19
18
  } from "react";
@@ -24,6 +23,9 @@ import {
24
23
  useDatePicker,
25
24
  } from "react-aria";
26
25
  import { useDatePickerState } from "react-stately";
26
+
27
+ import { Field } from "@/input/Field";
28
+
27
29
  import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
28
30
  import { Calendar } from "./Calendar";
29
31
  import { CalendarTriggerButton } from "./CalendarTriggerButton";
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  Box,
4
4
  BoxProps,
5
- PopoverAnchor,
6
5
  Popover as ChakraPopover,
6
+ PopoverAnchor,
7
7
  Portal,
8
8
  useFieldContext,
9
9
  useSlotRecipe,
@@ -17,16 +17,16 @@ import {
17
17
  useId,
18
18
  } from "react-aria";
19
19
  import { useDateRangePickerState } from "react-stately";
20
- import { DateField } from "./DateField";
21
- import { RangeCalendar } from "./RangeCalendar";
22
- import { StyledField } from "./StyledField";
23
- import { useCurrentLocale } from "./utils";
24
20
 
25
21
  import { Field } from "../input/Field";
26
- import { DatePickerVariantProps } from "./DatePicker";
27
22
  import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
28
- import { CalendarVariants } from "./types";
29
23
  import { CalendarTriggerButton } from "./CalendarTriggerButton";
24
+ import { DateField } from "./DateField";
25
+ import { DatePickerVariantProps } from "./DatePicker";
26
+ import { RangeCalendar } from "./RangeCalendar";
27
+ import { StyledField } from "./StyledField";
28
+ import { CalendarVariants } from "./types";
29
+ import { useCurrentLocale } from "./utils";
30
30
 
31
31
  type DateRangePickerProps = Omit<
32
32
  AriaDateRangePickerProps<DateValue>,
@@ -1,10 +1,11 @@
1
1
  "use client";
2
2
  import { Box, useSlotRecipe } from "@chakra-ui/react";
3
- import React, { PropsWithChildren, RefObject, forwardRef, useRef } from "react";
3
+ import React, { forwardRef, PropsWithChildren, RefObject, useRef } from "react";
4
4
  import { useDateSegment } from "react-aria";
5
5
  import { DateFieldState, DateSegment } from "react-stately";
6
- import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
6
+
7
7
  import { DatePickerVariantProps } from "..";
8
+ import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
8
9
 
9
10
  type DateTimeSegmentProps = PropsWithChildren<DatePickerVariantProps> & {
10
11
  segment: DateSegment;
@@ -1,17 +1,19 @@
1
1
  "use client";
2
2
  import { Box, useSlotRecipe } from "@chakra-ui/react";
3
- import { DateValue, createCalendar } from "@internationalized/date";
3
+ import { createCalendar, DateValue } from "@internationalized/date";
4
4
  import React, { useRef } from "react";
5
5
  import {
6
6
  RangeCalendarProps as ReactAriaRangeCalendarProps,
7
7
  useRangeCalendar,
8
8
  } from "react-aria";
9
9
  import { useRangeCalendarState } from "react-stately";
10
+
11
+ import { datePickerSlotRecipe } from "@/theme/slot-recipes/datepicker";
12
+
10
13
  import { CalendarGrid } from "./CalendarGrid";
11
14
  import { CalendarHeader } from "./CalendarHeader";
12
- import { useCurrentLocale } from "./utils";
13
15
  import { CalendarVariants } from "./types";
14
- import { datePickerSlotRecipe } from "@/theme/slot-recipes/datepicker";
16
+ import { useCurrentLocale } from "./utils";
15
17
 
16
18
  type RangeCalendarProps = ReactAriaRangeCalendarProps<DateValue> &
17
19
  CalendarVariants;
@@ -6,8 +6,9 @@ import {
6
6
  useSlotRecipe,
7
7
  } from "@chakra-ui/react";
8
8
  import React, { forwardRef, PropsWithChildren } from "react";
9
- import { DatePickerVariantProps } from "./DatePicker";
9
+
10
10
  import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
11
+ import { DatePickerVariantProps } from "./DatePicker";
11
12
  import { CalendarVariants } from "./types";
12
13
 
13
14
  type StyledFieldProps = BoxProps &
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  import { Box, Flex } from "@chakra-ui/react";
3
3
  import { CalendarDateTime, Time } from "@internationalized/date";
4
+ import { TimeFieldState } from "@react-stately/datepicker";
4
5
  import React, { useRef } from "react";
5
6
  import { AriaTimeFieldProps, useTimeField } from "react-aria";
6
- import { TimeFieldState } from "@react-stately/datepicker";
7
+
7
8
  import { DateTimeSegment } from "./DateTimeSegment";
8
9
  import { getTimestampFromTime } from "./utils";
9
10
 
@@ -8,11 +8,13 @@ import {
8
8
  } from "@vygruppen/spor-icon-react";
9
9
  import React from "react";
10
10
  import { useTimeFieldState } from "react-stately";
11
- import { IconButton, createTexts, useTranslation } from "..";
11
+
12
+ import { Field } from "@/input/Field";
13
+
14
+ import { createTexts, IconButton, useTranslation } from "..";
12
15
  import { StyledField } from "./StyledField";
13
16
  import { TimeField } from "./TimeField";
14
17
  import { getCurrentTime, useCurrentLocale } from "./utils";
15
- import { Field } from "@/input/Field";
16
18
 
17
19
  type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
18
20
  /** The label. Defaults to a localized version of "Time" */
@@ -1,4 +1,4 @@
1
- export { Time } from "@internationalized/date";
2
1
  export * from "./DatePicker";
3
2
  export * from "./DateRangePicker";
4
3
  export * from "./TimePicker";
4
+ export { Time } from "@internationalized/date";
@@ -1,4 +1,5 @@
1
1
  import { CalendarDateTime, parseTime } from "@internationalized/date";
2
+
2
3
  import { useTranslation } from "..";
3
4
 
4
5
  /**
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { Dialog as ChakraDialog, Portal } from "@chakra-ui/react";
3
3
  import * as React from "react";
4
+
4
5
  import { CloseButton } from "../button";
5
6
 
6
7
  interface DialogContentProps extends ChakraDialog.ContentProps {
@@ -2,8 +2,8 @@
2
2
 
3
3
  import {
4
4
  Box,
5
- Drawer as ChakraDrawer,
6
5
  createContext,
6
+ Drawer as ChakraDrawer,
7
7
  Grid,
8
8
  GridItem,
9
9
  Portal,
@@ -13,6 +13,7 @@ import {
13
13
  CloseFill24Icon,
14
14
  } from "@vygruppen/spor-icon-react";
15
15
  import React, { forwardRef } from "react";
16
+
16
17
  import { Button, CloseButton } from "../button";
17
18
  import { createTexts, useTranslation } from "../i18n";
18
19
  import {
@@ -1,2 +1,2 @@
1
- export * from "./Drawer";
2
1
  export * from "./Dialog";
2
+ export * from "./Drawer";
@@ -1,7 +1,8 @@
1
- import { drawerSlotRecipe } from "@/theme/slot-recipes/drawer";
2
- import { RecipeVariantProps, Drawer as ChakraDrawer } from "@chakra-ui/react";
1
+ import { Drawer as ChakraDrawer, RecipeVariantProps } from "@chakra-ui/react";
3
2
  import { PropsWithChildren } from "react";
4
3
 
4
+ import { drawerSlotRecipe } from "@/theme/slot-recipes/drawer";
5
+
5
6
  export type DrawerVariantProps = RecipeVariantProps<typeof drawerSlotRecipe>;
6
7
 
7
8
  export type DrawerContentProps = ChakraDrawer.ContentProps &
@@ -1,2 +1,2 @@
1
- export { Image } from "@chakra-ui/react";
2
1
  export type { ImageProps } from "@chakra-ui/react";
2
+ export { Image } from "@chakra-ui/react";