@vygruppen/spor-react 11.3.10 → 12.0.1

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 (322) hide show
  1. package/.turbo/turbo-build.log +33 -11
  2. package/.turbo/turbo-typegen.log +22 -0
  3. package/CHANGELOG.md +247 -0
  4. package/dist/index.d.mts +2589 -8303
  5. package/dist/index.d.ts +2589 -8303
  6. package/dist/index.js +9609 -8608
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +9487 -8455
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +23 -15
  11. package/src/accordion/Accordion.tsx +96 -45
  12. package/src/accordion/Expandable.tsx +54 -127
  13. package/src/accordion/helpers.ts +31 -0
  14. package/src/accordion/types.ts +60 -0
  15. package/src/alert/Alert.tsx +101 -0
  16. package/src/alert/AlertIcon.tsx +63 -45
  17. package/src/alert/ExpandableAlert.tsx +96 -64
  18. package/src/alert/ServiceAlert.tsx +127 -125
  19. package/src/alert/{index.tsx → index.ts} +1 -2
  20. package/src/breadcrumb/Breadcrumb.tsx +39 -24
  21. package/src/button/Button.tsx +86 -105
  22. package/src/button/ButtonGroup.tsx +45 -20
  23. package/src/button/Clipboard.tsx +82 -0
  24. package/src/button/CloseButton.tsx +4 -3
  25. package/src/button/FloatingActionButton.tsx +35 -41
  26. package/src/button/IconButton.tsx +34 -30
  27. package/src/button/index.tsx +1 -0
  28. package/src/color-mode/color-mode.tsx +75 -0
  29. package/src/color-mode/index.ts +1 -0
  30. package/src/datepicker/Calendar.tsx +17 -8
  31. package/src/datepicker/CalendarCell.tsx +20 -13
  32. package/src/datepicker/CalendarGrid.tsx +18 -10
  33. package/src/datepicker/CalendarHeader.tsx +2 -0
  34. package/src/datepicker/CalendarNavigationButton.tsx +1 -0
  35. package/src/datepicker/CalendarTriggerButton.tsx +43 -45
  36. package/src/datepicker/DateField.tsx +21 -12
  37. package/src/datepicker/DatePicker.tsx +61 -58
  38. package/src/datepicker/DateRangePicker.tsx +52 -58
  39. package/src/datepicker/DateTimeSegment.tsx +13 -5
  40. package/src/datepicker/RangeCalendar.tsx +13 -7
  41. package/src/datepicker/StyledField.tsx +25 -17
  42. package/src/datepicker/TimeField.tsx +10 -8
  43. package/src/datepicker/TimePicker.tsx +48 -45
  44. package/src/datepicker/types.ts +5 -0
  45. package/src/dialog/Dialog.tsx +56 -0
  46. package/src/dialog/Drawer.tsx +187 -0
  47. package/src/dialog/index.ts +2 -0
  48. package/src/dialog/types.ts +26 -0
  49. package/src/image/index.tsx +2 -2
  50. package/src/index.tsx +5 -3
  51. package/src/input/AttachedInputs.tsx +17 -42
  52. package/src/input/CardSelect.tsx +75 -162
  53. package/src/input/Checkbox.tsx +30 -6
  54. package/src/input/CheckboxGroup.tsx +25 -16
  55. package/src/input/ChoiceChip.tsx +58 -77
  56. package/src/input/Combobox.tsx +172 -172
  57. package/src/input/CountryCodeSelect.tsx +42 -28
  58. package/src/input/Dialog.tsx +1 -0
  59. package/src/input/Field.tsx +71 -0
  60. package/src/input/Fieldset.tsx +7 -0
  61. package/src/input/Input.tsx +68 -73
  62. package/src/input/InputGroup.tsx +66 -0
  63. package/src/input/ListBox.tsx +83 -70
  64. package/src/input/NativeSelect.tsx +70 -33
  65. package/src/input/NumericStepper.tsx +173 -171
  66. package/src/input/PasswordInput.tsx +99 -52
  67. package/src/input/PhoneNumberInput.tsx +69 -72
  68. package/src/input/Popover.tsx +1 -0
  69. package/src/input/Radio.tsx +37 -17
  70. package/src/input/SearchInput.tsx +24 -86
  71. package/src/input/Select.tsx +237 -0
  72. package/src/input/Switch.tsx +60 -18
  73. package/src/input/Textarea.tsx +53 -101
  74. package/src/input/{index.tsx → index.ts} +2 -8
  75. package/src/layout/PressableCard.tsx +12 -21
  76. package/src/layout/RadioCard.tsx +68 -101
  77. package/src/layout/Separator.tsx +32 -0
  78. package/src/layout/StaticCard.tsx +13 -33
  79. package/src/layout/index.tsx +3 -7
  80. package/src/linjetag/InfoTag.tsx +16 -9
  81. package/src/linjetag/LineIcon.tsx +74 -28
  82. package/src/linjetag/TravelTag.tsx +38 -27
  83. package/src/link/TextLink.tsx +25 -16
  84. package/src/list/index.tsx +24 -2
  85. package/src/loader/ClientOnly.tsx +8 -7
  86. package/src/loader/ColorInlineLoader.tsx +4 -3
  87. package/src/loader/ColorSpinner.tsx +5 -4
  88. package/src/loader/ContentLoader.tsx +6 -4
  89. package/src/loader/DarkFullScreenLoader.tsx +11 -3
  90. package/src/loader/DarkInlineLoader.tsx +5 -3
  91. package/src/loader/DarkSpinner.tsx +7 -3
  92. package/src/loader/LightFullScreenLoader.tsx +11 -3
  93. package/src/loader/LightInlineLoader.tsx +11 -3
  94. package/src/loader/LightSpinner.tsx +5 -3
  95. package/src/loader/Lottie.tsx +3 -3
  96. package/src/loader/ProgressBar.tsx +83 -84
  97. package/src/loader/ProgressLoader.tsx +120 -75
  98. package/src/loader/Skeleton.tsx +94 -19
  99. package/src/loader/index.tsx +0 -2
  100. package/src/loader/useHydrated.tsx +1 -0
  101. package/src/loader/useRotatingLabel.tsx +2 -1
  102. package/src/logo/CargonetLogo.tsx +89 -89
  103. package/src/logo/VyLogo.tsx +61 -42
  104. package/src/logo/VyLogoPride.tsx +137 -139
  105. package/src/media-controller/JumpButton.tsx +48 -38
  106. package/src/media-controller/PlayPauseButton.tsx +31 -29
  107. package/src/media-controller/SkipButton.tsx +38 -37
  108. package/src/nudge/Nudge.tsx +195 -123
  109. package/src/nudge/index.tsx +0 -1
  110. package/src/pagination/Pagination.tsx +221 -118
  111. package/src/pagination/types.ts +23 -0
  112. package/src/popover/index.tsx +67 -0
  113. package/src/progress-indicator/ProgressDot.tsx +11 -10
  114. package/src/progress-indicator/ProgressIndicator.tsx +28 -15
  115. package/src/provider/SporProvider.tsx +17 -14
  116. package/src/stepper/Stepper.tsx +88 -85
  117. package/src/stepper/StepperContext.tsx +2 -1
  118. package/src/stepper/StepperStep.tsx +28 -21
  119. package/src/tab/Tabs.tsx +62 -12
  120. package/src/tab/index.tsx +1 -9
  121. package/src/table/Table.tsx +35 -30
  122. package/src/table/index.tsx +11 -7
  123. package/src/theme/brand.ts +7 -0
  124. package/src/theme/index.ts +45 -37
  125. package/src/theme/recipes/attached-inputs.ts +43 -0
  126. package/src/theme/recipes/badge.ts +104 -0
  127. package/src/theme/recipes/button.ts +124 -0
  128. package/src/theme/recipes/choice-chip.ts +144 -0
  129. package/src/theme/recipes/close-button.ts +41 -0
  130. package/src/theme/recipes/code.ts +14 -0
  131. package/src/theme/recipes/group.ts +19 -0
  132. package/src/theme/recipes/index.ts +29 -0
  133. package/src/theme/recipes/input.ts +89 -0
  134. package/src/theme/recipes/link.ts +64 -0
  135. package/src/theme/recipes/nudge.ts +12 -0
  136. package/src/theme/recipes/pressable-card.ts +83 -0
  137. package/src/theme/recipes/progress-loader.ts +14 -0
  138. package/src/theme/recipes/separator.ts +85 -0
  139. package/src/theme/recipes/skeleton.ts +57 -0
  140. package/src/theme/recipes/static-card.ts +39 -0
  141. package/src/theme/recipes/textarea.ts +27 -0
  142. package/src/theme/semantic-tokens/colors.ts +22 -0
  143. package/src/theme/semantic-tokens/index.ts +24 -0
  144. package/src/theme/semantic-tokens/radii.ts +14 -0
  145. package/src/theme/semantic-tokens/shadows.ts +17 -0
  146. package/src/theme/slot-recipes/accordion.ts +131 -0
  147. package/src/theme/slot-recipes/alert-expandable.ts +133 -0
  148. package/src/theme/slot-recipes/alert-service.ts +66 -0
  149. package/src/theme/slot-recipes/alert.ts +72 -0
  150. package/src/theme/slot-recipes/anatomy.ts +269 -0
  151. package/src/theme/slot-recipes/breadcrumb.ts +61 -0
  152. package/src/theme/slot-recipes/checkbox.ts +89 -0
  153. package/src/theme/slot-recipes/datepicker.ts +214 -0
  154. package/src/theme/slot-recipes/dialog.ts +221 -0
  155. package/src/theme/slot-recipes/drawer.ts +205 -0
  156. package/src/theme/slot-recipes/field.ts +79 -0
  157. package/src/theme/slot-recipes/floating-action-button.ts +131 -0
  158. package/src/theme/slot-recipes/index.ts +65 -0
  159. package/src/theme/slot-recipes/info-tag.ts +62 -0
  160. package/src/theme/slot-recipes/line-icon.ts +140 -0
  161. package/src/theme/slot-recipes/list.ts +45 -0
  162. package/src/theme/slot-recipes/listbox.ts +72 -0
  163. package/src/theme/slot-recipes/media-controller-button.ts +131 -0
  164. package/src/theme/slot-recipes/native-select.ts +54 -0
  165. package/src/theme/slot-recipes/numeric-stepper.ts +65 -0
  166. package/src/theme/slot-recipes/pagination.ts +41 -0
  167. package/src/theme/slot-recipes/popover.ts +78 -0
  168. package/src/theme/slot-recipes/progress-bar.ts +39 -0
  169. package/src/theme/slot-recipes/progress-indicator.ts +22 -0
  170. package/src/theme/slot-recipes/radio-card.ts +112 -0
  171. package/src/theme/slot-recipes/radio.ts +80 -0
  172. package/src/theme/slot-recipes/select.ts +243 -0
  173. package/src/theme/slot-recipes/stepper.ts +92 -0
  174. package/src/theme/slot-recipes/switch.ts +147 -0
  175. package/src/theme/slot-recipes/table.ts +200 -0
  176. package/src/theme/slot-recipes/tabs.ts +169 -0
  177. package/src/theme/slot-recipes/toast.ts +56 -0
  178. package/src/theme/slot-recipes/travel-tag.ts +192 -0
  179. package/src/theme/tokens/animation-styles.ts +50 -0
  180. package/src/theme/tokens/animations.ts +22 -0
  181. package/src/theme/tokens/aspect-ratios.ts +22 -0
  182. package/src/theme/tokens/blurs.ts +28 -0
  183. package/src/theme/tokens/borders.ts +26 -0
  184. package/src/theme/{foundations → tokens}/breakpoints.ts +0 -1
  185. package/src/theme/tokens/colors.ts +10 -0
  186. package/src/theme/tokens/config.ts +10 -0
  187. package/src/theme/tokens/cursor.ts +28 -0
  188. package/src/theme/tokens/durations.ts +25 -0
  189. package/src/theme/tokens/easings.ts +16 -0
  190. package/src/theme/tokens/font-sizes.ts +30 -0
  191. package/src/theme/tokens/font-weights.ts +31 -0
  192. package/src/theme/tokens/fonts.ts +8 -0
  193. package/src/theme/tokens/global-css.ts +18 -0
  194. package/src/theme/tokens/index.ts +37 -0
  195. package/src/theme/tokens/keyframes.ts +255 -0
  196. package/src/theme/tokens/letter-spacings.ts +19 -0
  197. package/src/theme/tokens/line-heights.ts +19 -0
  198. package/src/theme/tokens/radii.ts +13 -0
  199. package/src/theme/tokens/sizes.ts +51 -0
  200. package/src/theme/tokens/spacing.ts +20 -0
  201. package/src/theme/tokens/text-styles.ts +89 -0
  202. package/src/theme/tokens/z-index.ts +17 -0
  203. package/src/theme/utils/accent-utils.ts +8 -21
  204. package/src/theme/utils/bg-utils.ts +4 -6
  205. package/src/theme/utils/brand-utils.ts +6 -19
  206. package/src/theme/utils/core-utils.ts +91 -0
  207. package/src/theme/utils/floating-utils.ts +20 -39
  208. package/src/theme/utils/ghost-utils.ts +7 -21
  209. package/src/theme/utils/input-utils.ts +32 -37
  210. package/src/theme/utils/outline-utils.ts +4 -11
  211. package/src/theme/utils/surface-utils.ts +5 -19
  212. package/src/theme/utils/types.ts +1 -0
  213. package/src/toast/index.tsx +1 -1
  214. package/src/toast/toast.tsx +105 -0
  215. package/src/transition/index.ts +2 -8
  216. package/src/typography/Badge.tsx +15 -61
  217. package/src/typography/Code.tsx +16 -28
  218. package/src/typography/Heading.tsx +36 -21
  219. package/src/typography/Text.tsx +9 -6
  220. package/src/typography/{index.tsx → index.ts} +1 -0
  221. package/src/util/externals.tsx +13 -27
  222. package/tsconfig.json +5 -1
  223. package/src/accordion/Accordion.test.tsx +0 -20
  224. package/src/alert/BaseAlert.test.tsx +0 -37
  225. package/src/alert/BaseAlert.tsx +0 -34
  226. package/src/alert/ClosableAlert.test.tsx +0 -37
  227. package/src/alert/ClosableAlert.tsx +0 -85
  228. package/src/alert/ExpandableAlert.test.tsx +0 -84
  229. package/src/alert/StaticAlert.tsx +0 -33
  230. package/src/button/Button.test.tsx +0 -23
  231. package/src/datepicker/TimePicker.test.tsx +0 -74
  232. package/src/input/FormControl.tsx +0 -2
  233. package/src/input/FormErrorMessage.tsx +0 -95
  234. package/src/input/FormLabel.tsx +0 -11
  235. package/src/input/InfoSelect.tsx +0 -274
  236. package/src/input/InputElement.tsx +0 -44
  237. package/src/input/RadioGroup.tsx +0 -47
  238. package/src/layout/Divider.tsx +0 -27
  239. package/src/layout/RadioCardGroup.tsx +0 -79
  240. package/src/layout/Stack.tsx +0 -42
  241. package/src/loader/SkeletonCircle.tsx +0 -13
  242. package/src/loader/SkeletonText.tsx +0 -14
  243. package/src/media-controller/index.test.tsx +0 -59
  244. package/src/modal/Drawer.tsx +0 -120
  245. package/src/modal/FullScreenDrawer.tsx +0 -239
  246. package/src/modal/Modal.tsx +0 -15
  247. package/src/modal/ModalHeader.tsx +0 -31
  248. package/src/modal/SimpleDrawer.tsx +0 -51
  249. package/src/modal/index.tsx +0 -5
  250. package/src/nudge/WizardNudge.tsx +0 -107
  251. package/src/theme/components/accordion.ts +0 -102
  252. package/src/theme/components/alert-expandable.ts +0 -125
  253. package/src/theme/components/alert-service.ts +0 -98
  254. package/src/theme/components/alert.ts +0 -71
  255. package/src/theme/components/badge.ts +0 -109
  256. package/src/theme/components/breadcrumb.ts +0 -60
  257. package/src/theme/components/button.ts +0 -125
  258. package/src/theme/components/card-select.ts +0 -117
  259. package/src/theme/components/checkbox.ts +0 -88
  260. package/src/theme/components/choice-chip.ts +0 -161
  261. package/src/theme/components/close-button.ts +0 -48
  262. package/src/theme/components/code.ts +0 -17
  263. package/src/theme/components/datepicker.ts +0 -198
  264. package/src/theme/components/divider.ts +0 -50
  265. package/src/theme/components/drawer.ts +0 -95
  266. package/src/theme/components/fab.ts +0 -109
  267. package/src/theme/components/form-label.ts +0 -17
  268. package/src/theme/components/form.ts +0 -27
  269. package/src/theme/components/index.ts +0 -45
  270. package/src/theme/components/info-select.ts +0 -85
  271. package/src/theme/components/info-tag.ts +0 -63
  272. package/src/theme/components/input.ts +0 -28
  273. package/src/theme/components/line-icon.ts +0 -129
  274. package/src/theme/components/link.ts +0 -78
  275. package/src/theme/components/list.ts +0 -23
  276. package/src/theme/components/listbox.ts +0 -77
  277. package/src/theme/components/media-controller-button.ts +0 -97
  278. package/src/theme/components/modal.ts +0 -96
  279. package/src/theme/components/numeric-stepper.ts +0 -65
  280. package/src/theme/components/pagination.ts +0 -74
  281. package/src/theme/components/popover.ts +0 -68
  282. package/src/theme/components/pressable-card.ts +0 -72
  283. package/src/theme/components/progress-bar.ts +0 -47
  284. package/src/theme/components/progress-indicator.ts +0 -44
  285. package/src/theme/components/radio-card.ts +0 -134
  286. package/src/theme/components/radio.ts +0 -68
  287. package/src/theme/components/select.ts +0 -74
  288. package/src/theme/components/skeleton.ts +0 -40
  289. package/src/theme/components/static-card.ts +0 -82
  290. package/src/theme/components/stepper.ts +0 -100
  291. package/src/theme/components/switch.ts +0 -112
  292. package/src/theme/components/table.ts +0 -161
  293. package/src/theme/components/tabs.ts +0 -135
  294. package/src/theme/components/textarea.ts +0 -33
  295. package/src/theme/components/toast.ts +0 -28
  296. package/src/theme/components/travel-tag.ts +0 -256
  297. package/src/theme/foundations/borders.ts +0 -11
  298. package/src/theme/foundations/colors.ts +0 -12
  299. package/src/theme/foundations/config.ts +0 -5
  300. package/src/theme/foundations/fontSizes.ts +0 -29
  301. package/src/theme/foundations/fontWeights.ts +0 -5
  302. package/src/theme/foundations/fonts.ts +0 -7
  303. package/src/theme/foundations/index.ts +0 -15
  304. package/src/theme/foundations/lineHeights.ts +0 -6
  305. package/src/theme/foundations/radii.ts +0 -12
  306. package/src/theme/foundations/shadows.ts +0 -8
  307. package/src/theme/foundations/sizes.ts +0 -36
  308. package/src/theme/foundations/spacing.ts +0 -31
  309. package/src/theme/foundations/styles.ts +0 -12
  310. package/src/theme/foundations/textStyles.ts +0 -74
  311. package/src/theme/foundations/zIndices.ts +0 -17
  312. package/src/theme/utils/base-utils.ts +0 -104
  313. package/src/theme/utils/focus-utils.ts +0 -10
  314. package/src/toast/ActionToast.test.tsx +0 -22
  315. package/src/toast/ActionToast.tsx +0 -28
  316. package/src/toast/BaseToast.test.tsx +0 -27
  317. package/src/toast/BaseToast.tsx +0 -75
  318. package/src/toast/ClosableToast.test.tsx +0 -17
  319. package/src/toast/ClosableToast.tsx +0 -40
  320. package/src/toast/useToast.tsx +0 -121
  321. package/src/tooltip/Tooltip.tsx +0 -70
  322. package/src/tooltip/index.tsx +0 -1
@@ -0,0 +1,83 @@
1
+ import { defineRecipe } from "../../util";
2
+ import tokens from "@vygruppen/spor-design-tokens";
3
+
4
+ export const pressableCardRecipe = defineRecipe({
5
+ base: {
6
+ appearance: "none",
7
+ border: "none",
8
+ overflow: "hidden",
9
+ fontSize: "inherit",
10
+ display: "block",
11
+ borderRadius: "md",
12
+ cursor: "pointer",
13
+ transitionProperty: "common",
14
+
15
+ transitionDuration: "fast",
16
+
17
+ _disabled: {
18
+ outline: "none",
19
+ pointerEvents: "none",
20
+ background: "surface.disabled",
21
+ color: "text.disabled",
22
+ },
23
+ },
24
+
25
+ variants: {
26
+ variant: {
27
+ floating: {
28
+ boxShadow: "0px 1px 3px 0px var(--shadow-color)",
29
+ shadowColor: "surface.disabled",
30
+
31
+ border: "sm",
32
+ borderColor: "floating.outline",
33
+
34
+ backgroundColor: "floating.surface",
35
+ _hover: {
36
+ boxShadow: "0px 2px 6px 0px var(--shadow-color)",
37
+ backgroundColor: "floating.surface.hover",
38
+
39
+ borderColor: "floating.outline.hover",
40
+
41
+ _active: {
42
+ boxShadow: "none",
43
+ backgroundColor: "floating.surface.active",
44
+ borderColor: "floating.outline.active",
45
+ },
46
+ },
47
+ },
48
+ core: {
49
+ outlineColor: "core.outline",
50
+ outlineWidth: tokens.size.stroke.sm,
51
+ outlineStyle: "solid",
52
+ backgroundColor: "core.surface",
53
+
54
+ _hover: {
55
+ outlineColor: "core.outline.hover",
56
+ outlineWidth: tokens.size.stroke.md,
57
+ outlineStyle: "solid",
58
+ _active: {
59
+ backgroundColor: "core.surface.active",
60
+ outlineWidth: tokens.size.stroke.sm,
61
+ },
62
+ },
63
+ },
64
+ accent: {
65
+ boxShadow: "0px 1px 3px 0px var(--shadow-color)",
66
+ shadowColor: "surface.disabled",
67
+ background: "alert.success.surface",
68
+ _hover: {
69
+ background: "alert.success.surface.hover",
70
+
71
+ boxShadow: "0px 2px 6px 0px var(--shadow-color)",
72
+ _active: {
73
+ background: "alert.success.surface.active",
74
+ boxShadow: "none",
75
+ },
76
+ },
77
+ },
78
+ },
79
+ },
80
+ defaultVariants: {
81
+ variant: "core",
82
+ },
83
+ });
@@ -0,0 +1,14 @@
1
+ import { defineRecipe } from "@chakra-ui/react";
2
+
3
+ export const progressLoaderRecipe = defineRecipe({
4
+ base: {
5
+ minWidth: "100px",
6
+
7
+ "& path[id$='-track']": {
8
+ stroke: { _light: "coralGreen", _dark: "greenHaze" },
9
+ },
10
+ "& path[id$='-progress']": {
11
+ stroke: { _light: "greenHaze", _dark: "coralGreen" },
12
+ },
13
+ },
14
+ });
@@ -0,0 +1,85 @@
1
+ import { defineRecipe } from "@chakra-ui/react";
2
+
3
+ export const separatorRecipe = defineRecipe({
4
+ className: "spor-separator",
5
+ base: {
6
+ borderColor: "outline.disabled",
7
+ display: "block",
8
+ borderRadius: "xl",
9
+ },
10
+ variants: {
11
+ variant: {
12
+ solid: {
13
+ borderStyle: "solid",
14
+ },
15
+ dashed: {
16
+ width: "100%",
17
+ borderWidth: "0px",
18
+ },
19
+ },
20
+ size: {
21
+ sm: {
22
+ borderBottomWidth: "1px",
23
+ height: "1px",
24
+ },
25
+ md: {
26
+ borderBottomWidth: "2px",
27
+ height: "2px",
28
+ },
29
+ lg: {
30
+ borderBottomWidth: "3px",
31
+ height: "3px",
32
+ },
33
+ },
34
+ orientation: {
35
+ horizontal: {
36
+ width: "100%",
37
+ },
38
+ vertical: {
39
+ height: "100%",
40
+ borderLeftWidth: "1px",
41
+ },
42
+ },
43
+ },
44
+ compoundVariants: [
45
+ {
46
+ variant: "dashed",
47
+ size: "sm",
48
+ css: {
49
+ background:
50
+ "linear-gradient(to left, var(--spor-colors-outline-disabled), var(--spor-colors-outline-disabled) 1px, transparent 1px, transparent 4px)",
51
+ backgroundSize: "4px 1px",
52
+ backgroundRepeat: "repeat-x",
53
+ },
54
+ },
55
+ {
56
+ variant: "dashed",
57
+ size: "md",
58
+ css: {
59
+ background:
60
+ "linear-gradient(to left, var(--spor-colors-outline-disabled), var(--spor-colors-outline-disabled) 3px, transparent 3px, transparent 6px)",
61
+ backgroundSize: "9px 2px",
62
+ backgroundRepeat: "repeat-x",
63
+ },
64
+ },
65
+ {
66
+ variant: "dashed",
67
+ size: "lg",
68
+ css: {
69
+ background:
70
+ "linear-gradient(to left, var(--spor-colors-outline-disabled), var(--spor-colors-outline-disabled) 3px, transparent 3px, transparent 9px)",
71
+ backgroundSize: "9px 3px",
72
+ backgroundRepeat: "repeat-x",
73
+ },
74
+ },
75
+ {
76
+ variant: "dashed",
77
+ orientation: "vertical",
78
+ css: {
79
+ background: "0",
80
+ width: "0%",
81
+ height: "100%",
82
+ },
83
+ },
84
+ ],
85
+ });
@@ -0,0 +1,57 @@
1
+ import { defineRecipe } from "@chakra-ui/react";
2
+
3
+ export const skeletonRecipe = defineRecipe({
4
+ className: "chakra-skeleton",
5
+ variants: {
6
+ loading: {
7
+ true: {
8
+ borderRadius: "xs",
9
+ boxShadow: "none",
10
+ backgroundClip: "padding-box",
11
+ cursor: "default",
12
+ color: "transparent",
13
+ pointerEvents: "none",
14
+ userSelect: "none",
15
+ flexShrink: "0",
16
+ "&::before, &::after, *": {
17
+ visibility: "hidden",
18
+ },
19
+ },
20
+ false: {
21
+ background: "unset",
22
+ animation: "fade-in var(--fade-duration, 0.1s) ease-out !important",
23
+ },
24
+ },
25
+ variant: {
26
+ pulse: {
27
+ background: {
28
+ _light: "silver",
29
+ _dark: "darkGrey",
30
+ },
31
+ animation: "pulse",
32
+ animationDuration: "var(--duration, 1.2s)",
33
+ },
34
+ shine: {
35
+ "--animate-from": "200%",
36
+ "--animate-to": "-200%",
37
+ "--start-color": {
38
+ _light: "colors.lightGrey",
39
+ _dark: "colors.dimGrey",
40
+ },
41
+
42
+ "--end-color": {
43
+ _light: "colors.platinum",
44
+ _dark: "colors.darkGrey",
45
+ },
46
+ backgroundImage:
47
+ "linear-gradient(270deg,var(--start-color),var(--end-color),var(--end-color),var(--start-color))",
48
+ backgroundSize: "400% 100%",
49
+ animation: "bg-position var(--duration, 5s) ease-in-out infinite",
50
+ },
51
+ none: {
52
+ animation: "none",
53
+ background: "steel",
54
+ },
55
+ },
56
+ },
57
+ });
@@ -0,0 +1,39 @@
1
+ import { defineRecipe } from "@chakra-ui/react";
2
+
3
+ export const staticCardRecipe = defineRecipe({
4
+ base: {
5
+ borderRadius: "md",
6
+ },
7
+ variants: {
8
+ colorPalette: {
9
+ white: {
10
+ backgroundColor: "surface.color.neutral",
11
+ color: "text",
12
+ },
13
+ grey: {
14
+ backgroundColor: "surface.color.grey",
15
+ },
16
+ yellow: {
17
+ backgroundColor: "surface.color.cream",
18
+ },
19
+ darkYellow: {
20
+ backgroundColor: "surface.color.yellow",
21
+ },
22
+ red: {
23
+ backgroundColor: "surface.color.red",
24
+ },
25
+ green: {
26
+ backgroundColor: "surface.color.green",
27
+ },
28
+ blue: {
29
+ backgroundColor: "surface.color.blue",
30
+ },
31
+ orange: {
32
+ backgroundColor: "surface.color.orange",
33
+ },
34
+ },
35
+ },
36
+ defaultVariants: {
37
+ colorPalette: "white",
38
+ },
39
+ });
@@ -0,0 +1,27 @@
1
+ import { defineRecipe } from "@chakra-ui/react";
2
+ import { inputRecipe } from "./input";
3
+
4
+ export const textareaRecipe = defineRecipe({
5
+ className: "spor-textarea",
6
+ base: {
7
+ ...inputRecipe.base,
8
+ paddingTop: 0,
9
+ minHeight: "calc(var(--label-height) + 4rem)",
10
+ verticalAlign: "top",
11
+ appearance: "none",
12
+ borderTop: "0.8rem solid transparent",
13
+ "&:focus-visible, &:not(:placeholder-shown)": {
14
+ borderTop: "var(--label-height) solid transparent",
15
+ },
16
+ },
17
+ variants: {
18
+ variant: {
19
+ core: {
20
+ ...inputRecipe.variants?.variant.core,
21
+ },
22
+ floating: {
23
+ ...inputRecipe.variants?.variant.floating,
24
+ },
25
+ },
26
+ },
27
+ });
@@ -0,0 +1,22 @@
1
+ import { defineSemanticTokens } from "@chakra-ui/react";
2
+ import vyDigitalJson from "@vygruppen/spor-design-tokens/tokens/color/vy-digital.json";
3
+ import VyUtviklingJson from "@vygruppen/spor-design-tokens/tokens/color/vy-utvikling.json";
4
+ import cargonetJson from "@vygruppen/spor-design-tokens/tokens/color/cargonet.json";
5
+
6
+ export enum Brand {
7
+ VyDigital = "VyDigital",
8
+ VyUtvikling = "VyUtvikling",
9
+ CargoNet = "CargoNet",
10
+ }
11
+
12
+ export const vyDigitalColors = defineSemanticTokens.colors({
13
+ ...vyDigitalJson.color.vyDigital,
14
+ });
15
+
16
+ export const vyUtviklingColors = defineSemanticTokens.colors({
17
+ ...VyUtviklingJson.color.vyUtvikling,
18
+ });
19
+
20
+ export const cargonetColors = defineSemanticTokens.colors({
21
+ ...cargonetJson.color.cargonet,
22
+ });
@@ -0,0 +1,24 @@
1
+ import { Brand } from "../brand";
2
+ import { cargonetColors, vyUtviklingColors, vyDigitalColors } from "./colors";
3
+ import { radii } from "./radii";
4
+ import { shadows } from "./shadows";
5
+
6
+ const baseSemanticTokens = {
7
+ shadows,
8
+ radii,
9
+ };
10
+
11
+ export const semanticTokens = {
12
+ [Brand.VyUtvikling]: {
13
+ ...baseSemanticTokens,
14
+ colors: vyUtviklingColors,
15
+ },
16
+ [Brand.CargoNet]: {
17
+ ...baseSemanticTokens,
18
+ colors: cargonetColors,
19
+ },
20
+ [Brand.VyDigital]: {
21
+ ...baseSemanticTokens,
22
+ colors: vyDigitalColors,
23
+ },
24
+ };
@@ -0,0 +1,14 @@
1
+ import { defineSemanticTokens } from "@chakra-ui/react";
2
+ import tokens from "@vygruppen/spor-design-tokens";
3
+
4
+ export const radii = defineSemanticTokens.radii({
5
+ none: { value: tokens.size["border-radius"].none },
6
+ xxs: { value: tokens.size["border-radius"].xxs },
7
+ xs: { value: tokens.size["border-radius"].xs },
8
+ sm: { value: tokens.size["border-radius"].sm },
9
+ md: { value: tokens.size["border-radius"].md },
10
+ lg: { value: tokens.size["border-radius"].lg },
11
+ xl: { value: tokens.size["border-radius"].xl },
12
+ "2xl": { value: tokens.size["border-radius"]["2xl"] },
13
+ round: { value: "50%" },
14
+ });
@@ -0,0 +1,17 @@
1
+ import { defineSemanticTokens } from "@chakra-ui/react";
2
+ import tokens from "@vygruppen/spor-design-tokens";
3
+
4
+ export const shadows = defineSemanticTokens.shadows({
5
+ none: {
6
+ value: "none",
7
+ },
8
+ sm: {
9
+ value: tokens.depth.shadow.sm.value,
10
+ },
11
+ md: {
12
+ value: tokens.depth.shadow.md.value,
13
+ },
14
+ lg: {
15
+ value: tokens.depth.shadow.lg.value,
16
+ },
17
+ });
@@ -0,0 +1,131 @@
1
+ import { coreBorder, coreText } from "../utils/core-utils";
2
+ import { floatingBackground, floatingBorder } from "../utils/floating-utils";
3
+ import { ghostBackground } from "../utils/ghost-utils";
4
+ import { defineSlotRecipe } from "@chakra-ui/react";
5
+ import { accordionAnatomy } from "./anatomy";
6
+
7
+ export const accordionSlotRecipe = defineSlotRecipe({
8
+ className: "spor-accordion",
9
+ slots: accordionAnatomy.keys(),
10
+ base: {
11
+ root: {
12
+ borderRadius: "sm",
13
+ },
14
+ item: {
15
+ borderRadius: "sm",
16
+ overflowAnchor: "none",
17
+ },
18
+ itemTrigger: {
19
+ borderRadius: "sm",
20
+ display: "flex",
21
+ justifyContent: "space-between",
22
+ ...coreText("default"),
23
+ textAlign: "left",
24
+ width: "full",
25
+ alignItems: "center",
26
+ fontSize: ["mobile.sm", null, "desktop.sm"],
27
+ fontFamily: "body",
28
+ fontWeight: "bold",
29
+ outlineOffset: "-2px",
30
+ paddingX: [2, null, 3],
31
+ paddingY: [1, null, 1.5],
32
+ minHeight: [6, null, 7],
33
+ cursor: "pointer",
34
+ _disabled: {
35
+ pointerEvents: "none",
36
+ opacity: 0.4,
37
+ },
38
+ },
39
+ itemContent: {
40
+ borderBottomRadius: "sm",
41
+ fontSize: ["mobile.sm", null, "desktop.sm"],
42
+ color: "text",
43
+ height: "auto",
44
+ overflow: "hidden",
45
+ _open: {
46
+ animationName: "expand-height, fade-in",
47
+ animationDuration: "moderate",
48
+ },
49
+ _closed: {
50
+ animationName: "collapse-height, fade-out",
51
+ animationDuration: "moderate",
52
+ },
53
+ },
54
+ itemBody: {
55
+ paddingY: 2,
56
+ paddingX: [2, null, 3],
57
+ },
58
+ itemIndicator: {
59
+ transition: "rotate 0.2s",
60
+ transformOrigin: "center",
61
+
62
+ _open: {
63
+ rotate: "180deg",
64
+ },
65
+ _icon: {
66
+ width: "1.2em",
67
+ height: "1.2em",
68
+ },
69
+ },
70
+ },
71
+ variants: {
72
+ variant: {
73
+ ghost: {
74
+ root: {
75
+ outline: "none",
76
+ },
77
+ itemTrigger: {
78
+ "&:hover": {
79
+ ...ghostBackground("hover"),
80
+ },
81
+ "&:active": {
82
+ ...ghostBackground("active"),
83
+ },
84
+ },
85
+ },
86
+ core: {
87
+ item: {
88
+ ...coreBorder("default"),
89
+ },
90
+ itemTrigger: {
91
+ _expanded: {
92
+ borderBottomRadius: "none",
93
+ },
94
+ "&:hover": {
95
+ ...coreBorder("hover"),
96
+ outlineOffset: 0,
97
+ },
98
+ "&:active": {
99
+ backgroundColor: "core.surface.active",
100
+ ...coreBorder("default"),
101
+ },
102
+ },
103
+ },
104
+ floating: {
105
+ item: {
106
+ ...floatingBackground("default"),
107
+ ...floatingBorder("default"),
108
+ boxShadow: "sm",
109
+ },
110
+ itemTrigger: {
111
+ _expanded: {
112
+ borderBottomRadius: "none",
113
+ },
114
+ "&:hover": {
115
+ outlineOffset: 1,
116
+ ...floatingBackground("hover"),
117
+ ...floatingBorder("hover"),
118
+ "&:active": {
119
+ backgroundColor: "floating.surface.active",
120
+ ...floatingBorder("default"),
121
+ },
122
+ },
123
+ "&:active": {
124
+ backgroundColor: "floating.surface.active",
125
+ ...floatingBorder("default"),
126
+ },
127
+ },
128
+ },
129
+ },
130
+ },
131
+ });
@@ -0,0 +1,133 @@
1
+ import { defineSlotRecipe } from "@chakra-ui/react";
2
+ import { alertSlotRecipe } from "./alert";
3
+ import { alertExpandableAnatomy } from "./anatomy";
4
+ import tokens from "@vygruppen/spor-design-tokens";
5
+
6
+ export const alertExpandableSlotRecipe = defineSlotRecipe({
7
+ className: "spor-alert-expandable",
8
+ slots: alertExpandableAnatomy.keys(),
9
+ base: {
10
+ itemTrigger: {
11
+ paddingX: "2 !important",
12
+ _expanded: {
13
+ borderBottomRadius: "none",
14
+ },
15
+ },
16
+ itemContent: {
17
+ fontSize: "xs !important",
18
+ paddingTop: "1 !important",
19
+ },
20
+ root: {
21
+ border: "sm",
22
+ },
23
+ },
24
+ variants: {
25
+ variant: {
26
+ important: {
27
+ itemContent: {
28
+ color: "alert.important.text.secondary",
29
+ },
30
+ itemTrigger: {
31
+ _hover: {
32
+ bg: "alert.important.surface.hover",
33
+ outlineColor: "alert.important.outline.hover",
34
+ _active: {
35
+ bg: "alert.important.surface.active",
36
+ },
37
+ },
38
+ },
39
+ root: {
40
+ borderColor: "alert.important.outline",
41
+ bg: "alert.important.surface",
42
+ },
43
+ title: {
44
+ color: "alert.important.text",
45
+ },
46
+ },
47
+ success: {
48
+ itemContent: {
49
+ color: "alert.success.text.secondary",
50
+ },
51
+ itemTrigger: {
52
+ _hover: {
53
+ bg: "alert.success.surface.hover",
54
+ outlineColor: "alert.success.outline.hover",
55
+ _active: {
56
+ bg: "alert.success.surface.active",
57
+ },
58
+ },
59
+ },
60
+ root: {
61
+ borderColor: "alert.success.outline",
62
+ bg: "alert.success.surface",
63
+ },
64
+ title: {
65
+ color: "alert.success.text",
66
+ },
67
+ },
68
+ alt: {
69
+ itemContent: {
70
+ color: "alert.alt.text.secondary",
71
+ },
72
+ itemTrigger: {
73
+ _hover: {
74
+ bg: "alert.alt.surface.hover",
75
+ outlineColor: "alert.alt.outline.hover",
76
+ _active: {
77
+ bg: "alert.alt.surface.active",
78
+ },
79
+ },
80
+ },
81
+ root: {
82
+ borderColor: "alert.alt.outline",
83
+ bg: "alert.alt.surface",
84
+ },
85
+ title: {
86
+ color: "alert.alt.text",
87
+ },
88
+ },
89
+ info: {
90
+ itemContent: {
91
+ color: "alert.info.text.secondary",
92
+ },
93
+ itemTrigger: {
94
+ _hover: {
95
+ bg: "alert.info.surface.hover",
96
+ outlineColor: "alert.info.outline.hover",
97
+ _active: {
98
+ bg: "alert.info.surface.active",
99
+ },
100
+ },
101
+ },
102
+ root: {
103
+ borderColor: "alert.info.outline",
104
+ bg: "alert.info.surface",
105
+ },
106
+ title: {
107
+ color: "alert.info.text",
108
+ },
109
+ },
110
+ error: {
111
+ itemContent: {
112
+ color: "alert.error.text.secondary",
113
+ },
114
+ itemTrigger: {
115
+ _hover: {
116
+ bg: "alert.error.surface.hover",
117
+ outlineColor: "alert.error.outline.hover",
118
+ _active: {
119
+ bg: "alert.error.surface.active",
120
+ },
121
+ },
122
+ },
123
+ root: {
124
+ borderColor: "alert.error.outline",
125
+ bg: "alert.error.surface",
126
+ },
127
+ title: {
128
+ color: "alert.error.text",
129
+ },
130
+ },
131
+ },
132
+ },
133
+ });