@vygruppen/spor-react 11.3.9 → 12.0.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/.turbo/turbo-build.log +32 -11
- package/.turbo/turbo-typegen.log +23 -0
- package/CHANGELOG.md +245 -0
- package/dist/index.d.mts +2552 -8319
- package/dist/index.d.ts +2552 -8319
- package/dist/index.js +9609 -8607
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9487 -8454
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -13
- package/src/accordion/Accordion.tsx +96 -45
- package/src/accordion/Expandable.tsx +54 -127
- package/src/accordion/helpers.ts +31 -0
- package/src/accordion/types.ts +60 -0
- package/src/alert/Alert.tsx +101 -0
- package/src/alert/AlertIcon.tsx +63 -45
- package/src/alert/ExpandableAlert.tsx +96 -64
- package/src/alert/ServiceAlert.tsx +127 -125
- package/src/alert/{index.tsx → index.ts} +1 -2
- package/src/breadcrumb/Breadcrumb.tsx +39 -24
- package/src/button/Button.tsx +86 -105
- package/src/button/ButtonGroup.tsx +45 -20
- package/src/button/Clipboard.tsx +82 -0
- package/src/button/CloseButton.tsx +4 -3
- package/src/button/FloatingActionButton.tsx +35 -41
- package/src/button/IconButton.tsx +34 -30
- package/src/button/index.tsx +1 -0
- package/src/color-mode/color-mode.tsx +75 -0
- package/src/color-mode/index.ts +1 -0
- package/src/datepicker/Calendar.tsx +17 -8
- package/src/datepicker/CalendarCell.tsx +20 -13
- package/src/datepicker/CalendarGrid.tsx +18 -10
- package/src/datepicker/CalendarHeader.tsx +2 -0
- package/src/datepicker/CalendarNavigationButton.tsx +1 -0
- package/src/datepicker/CalendarTriggerButton.tsx +43 -45
- package/src/datepicker/DateField.tsx +21 -12
- package/src/datepicker/DatePicker.tsx +61 -58
- package/src/datepicker/DateRangePicker.tsx +52 -58
- package/src/datepicker/DateTimeSegment.tsx +13 -5
- package/src/datepicker/RangeCalendar.tsx +13 -7
- package/src/datepicker/StyledField.tsx +25 -17
- package/src/datepicker/TimeField.tsx +10 -8
- package/src/datepicker/TimePicker.tsx +48 -45
- package/src/datepicker/types.ts +5 -0
- package/src/dialog/Dialog.tsx +56 -0
- package/src/dialog/Drawer.tsx +187 -0
- package/src/dialog/index.ts +2 -0
- package/src/dialog/types.ts +26 -0
- package/src/image/index.tsx +2 -2
- package/src/index.tsx +5 -3
- package/src/input/AttachedInputs.tsx +17 -42
- package/src/input/CardSelect.tsx +75 -162
- package/src/input/Checkbox.tsx +30 -6
- package/src/input/CheckboxGroup.tsx +25 -16
- package/src/input/ChoiceChip.tsx +58 -77
- package/src/input/Combobox.tsx +172 -172
- package/src/input/CountryCodeSelect.tsx +42 -28
- package/src/input/Dialog.tsx +1 -0
- package/src/input/Field.tsx +71 -0
- package/src/input/Fieldset.tsx +7 -0
- package/src/input/Input.tsx +68 -73
- package/src/input/InputGroup.tsx +66 -0
- package/src/input/ListBox.tsx +83 -70
- package/src/input/NativeSelect.tsx +68 -33
- package/src/input/NumericStepper.tsx +173 -171
- package/src/input/PasswordInput.tsx +99 -52
- package/src/input/PhoneNumberInput.tsx +69 -72
- package/src/input/Popover.tsx +1 -0
- package/src/input/Radio.tsx +37 -17
- package/src/input/SearchInput.tsx +24 -86
- package/src/input/Select.tsx +237 -0
- package/src/input/Switch.tsx +60 -18
- package/src/input/Textarea.tsx +53 -101
- package/src/input/{index.tsx → index.ts} +2 -8
- package/src/layout/PressableCard.tsx +12 -21
- package/src/layout/RadioCard.tsx +68 -100
- package/src/layout/Separator.tsx +32 -0
- package/src/layout/StaticCard.tsx +13 -33
- package/src/layout/index.tsx +3 -7
- package/src/linjetag/InfoTag.tsx +16 -9
- package/src/linjetag/LineIcon.tsx +74 -28
- package/src/linjetag/TravelTag.tsx +38 -27
- package/src/link/TextLink.tsx +25 -16
- package/src/list/index.tsx +24 -2
- package/src/loader/ClientOnly.tsx +8 -7
- package/src/loader/ColorInlineLoader.tsx +4 -3
- package/src/loader/ColorSpinner.tsx +5 -4
- package/src/loader/ContentLoader.tsx +6 -4
- package/src/loader/DarkFullScreenLoader.tsx +11 -3
- package/src/loader/DarkInlineLoader.tsx +5 -3
- package/src/loader/DarkSpinner.tsx +7 -3
- package/src/loader/LightFullScreenLoader.tsx +11 -3
- package/src/loader/LightInlineLoader.tsx +11 -3
- package/src/loader/LightSpinner.tsx +5 -3
- package/src/loader/Lottie.tsx +3 -3
- package/src/loader/ProgressBar.tsx +83 -84
- package/src/loader/ProgressLoader.tsx +120 -75
- package/src/loader/Skeleton.tsx +94 -19
- package/src/loader/index.tsx +0 -2
- package/src/loader/useHydrated.tsx +1 -0
- package/src/loader/useRotatingLabel.tsx +2 -1
- package/src/logo/CargonetLogo.tsx +89 -89
- package/src/logo/VyLogo.tsx +61 -42
- package/src/logo/VyLogoPride.tsx +137 -139
- package/src/media-controller/JumpButton.tsx +48 -38
- package/src/media-controller/PlayPauseButton.tsx +31 -29
- package/src/media-controller/SkipButton.tsx +38 -37
- package/src/nudge/Nudge.tsx +195 -123
- package/src/nudge/index.tsx +0 -1
- package/src/pagination/Pagination.tsx +221 -118
- package/src/pagination/types.ts +23 -0
- package/src/popover/index.tsx +67 -0
- package/src/progress-indicator/ProgressDot.tsx +11 -10
- package/src/progress-indicator/ProgressIndicator.tsx +28 -15
- package/src/provider/SporProvider.tsx +17 -14
- package/src/stepper/Stepper.tsx +88 -85
- package/src/stepper/StepperContext.tsx +2 -1
- package/src/stepper/StepperStep.tsx +28 -21
- package/src/tab/Tabs.tsx +62 -12
- package/src/tab/index.tsx +1 -9
- package/src/table/Table.tsx +35 -30
- package/src/table/index.tsx +11 -7
- package/src/theme/brand.ts +7 -0
- package/src/theme/index.ts +45 -37
- package/src/theme/recipes/attached-inputs.ts +43 -0
- package/src/theme/recipes/badge.ts +104 -0
- package/src/theme/recipes/button.ts +124 -0
- package/src/theme/recipes/choice-chip.ts +144 -0
- package/src/theme/recipes/close-button.ts +41 -0
- package/src/theme/recipes/code.ts +14 -0
- package/src/theme/recipes/group.ts +19 -0
- package/src/theme/recipes/index.ts +29 -0
- package/src/theme/recipes/input.ts +89 -0
- package/src/theme/recipes/link.ts +64 -0
- package/src/theme/recipes/nudge.ts +12 -0
- package/src/theme/recipes/pressable-card.ts +83 -0
- package/src/theme/recipes/progress-loader.ts +14 -0
- package/src/theme/recipes/separator.ts +85 -0
- package/src/theme/recipes/skeleton.ts +57 -0
- package/src/theme/recipes/static-card.ts +39 -0
- package/src/theme/recipes/textarea.ts +27 -0
- package/src/theme/semantic-tokens/colors.ts +22 -0
- package/src/theme/semantic-tokens/index.ts +24 -0
- package/src/theme/semantic-tokens/radii.ts +14 -0
- package/src/theme/semantic-tokens/shadows.ts +17 -0
- package/src/theme/slot-recipes/accordion.ts +131 -0
- package/src/theme/slot-recipes/alert-expandable.ts +133 -0
- package/src/theme/slot-recipes/alert-service.ts +66 -0
- package/src/theme/slot-recipes/alert.ts +72 -0
- package/src/theme/slot-recipes/anatomy.ts +269 -0
- package/src/theme/slot-recipes/breadcrumb.ts +61 -0
- package/src/theme/slot-recipes/checkbox.ts +89 -0
- package/src/theme/slot-recipes/datepicker.ts +214 -0
- package/src/theme/slot-recipes/dialog.ts +221 -0
- package/src/theme/slot-recipes/drawer.ts +205 -0
- package/src/theme/slot-recipes/field.ts +79 -0
- package/src/theme/slot-recipes/floating-action-button.ts +131 -0
- package/src/theme/slot-recipes/index.ts +65 -0
- package/src/theme/slot-recipes/info-tag.ts +62 -0
- package/src/theme/slot-recipes/line-icon.ts +140 -0
- package/src/theme/slot-recipes/list.ts +45 -0
- package/src/theme/slot-recipes/listbox.ts +72 -0
- package/src/theme/slot-recipes/media-controller-button.ts +131 -0
- package/src/theme/slot-recipes/native-select.ts +54 -0
- package/src/theme/slot-recipes/numeric-stepper.ts +65 -0
- package/src/theme/slot-recipes/pagination.ts +41 -0
- package/src/theme/slot-recipes/popover.ts +78 -0
- package/src/theme/slot-recipes/progress-bar.ts +39 -0
- package/src/theme/slot-recipes/progress-indicator.ts +22 -0
- package/src/theme/slot-recipes/radio-card.ts +112 -0
- package/src/theme/slot-recipes/radio.ts +80 -0
- package/src/theme/slot-recipes/select.ts +243 -0
- package/src/theme/slot-recipes/stepper.ts +92 -0
- package/src/theme/slot-recipes/switch.ts +147 -0
- package/src/theme/slot-recipes/table.ts +200 -0
- package/src/theme/slot-recipes/tabs.ts +169 -0
- package/src/theme/slot-recipes/toast.ts +56 -0
- package/src/theme/slot-recipes/travel-tag.ts +192 -0
- package/src/theme/tokens/animation-styles.ts +50 -0
- package/src/theme/tokens/animations.ts +22 -0
- package/src/theme/tokens/aspect-ratios.ts +22 -0
- package/src/theme/tokens/blurs.ts +28 -0
- package/src/theme/tokens/borders.ts +26 -0
- package/src/theme/{foundations → tokens}/breakpoints.ts +0 -1
- package/src/theme/tokens/colors.ts +10 -0
- package/src/theme/tokens/config.ts +10 -0
- package/src/theme/tokens/cursor.ts +28 -0
- package/src/theme/tokens/durations.ts +25 -0
- package/src/theme/tokens/easings.ts +16 -0
- package/src/theme/tokens/font-sizes.ts +30 -0
- package/src/theme/tokens/font-weights.ts +31 -0
- package/src/theme/tokens/fonts.ts +8 -0
- package/src/theme/tokens/global-css.ts +18 -0
- package/src/theme/tokens/index.ts +37 -0
- package/src/theme/tokens/keyframes.ts +255 -0
- package/src/theme/tokens/letter-spacings.ts +19 -0
- package/src/theme/tokens/line-heights.ts +19 -0
- package/src/theme/tokens/radii.ts +13 -0
- package/src/theme/tokens/sizes.ts +51 -0
- package/src/theme/tokens/spacing.ts +20 -0
- package/src/theme/tokens/text-styles.ts +89 -0
- package/src/theme/tokens/z-index.ts +17 -0
- package/src/theme/utils/accent-utils.ts +8 -21
- package/src/theme/utils/bg-utils.ts +4 -6
- package/src/theme/utils/brand-utils.ts +6 -19
- package/src/theme/utils/core-utils.ts +91 -0
- package/src/theme/utils/floating-utils.ts +20 -39
- package/src/theme/utils/ghost-utils.ts +7 -21
- package/src/theme/utils/input-utils.ts +32 -37
- package/src/theme/utils/outline-utils.ts +4 -11
- package/src/theme/utils/surface-utils.ts +5 -19
- package/src/theme/utils/types.ts +1 -0
- package/src/toast/index.tsx +1 -1
- package/src/toast/toast.tsx +105 -0
- package/src/transition/index.ts +2 -8
- package/src/typography/Badge.tsx +15 -61
- package/src/typography/Code.tsx +16 -28
- package/src/typography/Heading.tsx +34 -19
- package/src/typography/Text.tsx +9 -6
- package/src/typography/{index.tsx → index.ts} +1 -0
- package/src/util/externals.tsx +13 -27
- package/tsconfig.json +5 -1
- package/src/accordion/Accordion.test.tsx +0 -20
- package/src/alert/BaseAlert.test.tsx +0 -37
- package/src/alert/BaseAlert.tsx +0 -34
- package/src/alert/ClosableAlert.test.tsx +0 -37
- package/src/alert/ClosableAlert.tsx +0 -85
- package/src/alert/ExpandableAlert.test.tsx +0 -84
- package/src/alert/StaticAlert.tsx +0 -33
- package/src/button/Button.test.tsx +0 -23
- package/src/datepicker/TimePicker.test.tsx +0 -74
- package/src/input/FormControl.tsx +0 -2
- package/src/input/FormErrorMessage.tsx +0 -95
- package/src/input/FormLabel.tsx +0 -11
- package/src/input/InfoSelect.tsx +0 -274
- package/src/input/InputElement.tsx +0 -44
- package/src/input/RadioGroup.tsx +0 -47
- package/src/layout/Divider.tsx +0 -27
- package/src/layout/RadioCardGroup.tsx +0 -79
- package/src/layout/Stack.tsx +0 -42
- package/src/loader/SkeletonCircle.tsx +0 -13
- package/src/loader/SkeletonText.tsx +0 -14
- package/src/media-controller/index.test.tsx +0 -59
- package/src/modal/Drawer.tsx +0 -120
- package/src/modal/FullScreenDrawer.tsx +0 -239
- package/src/modal/Modal.tsx +0 -15
- package/src/modal/ModalHeader.tsx +0 -31
- package/src/modal/SimpleDrawer.tsx +0 -51
- package/src/modal/index.tsx +0 -5
- package/src/nudge/WizardNudge.tsx +0 -107
- package/src/theme/components/accordion.ts +0 -102
- package/src/theme/components/alert-expandable.ts +0 -125
- package/src/theme/components/alert-service.ts +0 -98
- package/src/theme/components/alert.ts +0 -71
- package/src/theme/components/badge.ts +0 -109
- package/src/theme/components/breadcrumb.ts +0 -60
- package/src/theme/components/button.ts +0 -125
- package/src/theme/components/card-select.ts +0 -117
- package/src/theme/components/checkbox.ts +0 -88
- package/src/theme/components/choice-chip.ts +0 -161
- package/src/theme/components/close-button.ts +0 -48
- package/src/theme/components/code.ts +0 -17
- package/src/theme/components/datepicker.ts +0 -198
- package/src/theme/components/divider.ts +0 -50
- package/src/theme/components/drawer.ts +0 -95
- package/src/theme/components/fab.ts +0 -109
- package/src/theme/components/form-label.ts +0 -17
- package/src/theme/components/form.ts +0 -27
- package/src/theme/components/index.ts +0 -45
- package/src/theme/components/info-select.ts +0 -85
- package/src/theme/components/info-tag.ts +0 -63
- package/src/theme/components/input.ts +0 -28
- package/src/theme/components/line-icon.ts +0 -129
- package/src/theme/components/link.ts +0 -78
- package/src/theme/components/list.ts +0 -23
- package/src/theme/components/listbox.ts +0 -77
- package/src/theme/components/media-controller-button.ts +0 -97
- package/src/theme/components/modal.ts +0 -96
- package/src/theme/components/numeric-stepper.ts +0 -65
- package/src/theme/components/pagination.ts +0 -74
- package/src/theme/components/popover.ts +0 -68
- package/src/theme/components/pressable-card.ts +0 -72
- package/src/theme/components/progress-bar.ts +0 -47
- package/src/theme/components/progress-indicator.ts +0 -44
- package/src/theme/components/radio-card.ts +0 -134
- package/src/theme/components/radio.ts +0 -68
- package/src/theme/components/select.ts +0 -74
- package/src/theme/components/skeleton.ts +0 -40
- package/src/theme/components/static-card.ts +0 -82
- package/src/theme/components/stepper.ts +0 -100
- package/src/theme/components/switch.ts +0 -112
- package/src/theme/components/table.ts +0 -161
- package/src/theme/components/tabs.ts +0 -135
- package/src/theme/components/textarea.ts +0 -33
- package/src/theme/components/toast.ts +0 -28
- package/src/theme/components/travel-tag.ts +0 -256
- package/src/theme/foundations/borders.ts +0 -11
- package/src/theme/foundations/colors.ts +0 -12
- package/src/theme/foundations/config.ts +0 -5
- package/src/theme/foundations/fontSizes.ts +0 -29
- package/src/theme/foundations/fontWeights.ts +0 -5
- package/src/theme/foundations/fonts.ts +0 -7
- package/src/theme/foundations/index.ts +0 -15
- package/src/theme/foundations/lineHeights.ts +0 -6
- package/src/theme/foundations/radii.ts +0 -12
- package/src/theme/foundations/shadows.ts +0 -8
- package/src/theme/foundations/sizes.ts +0 -36
- package/src/theme/foundations/spacing.ts +0 -31
- package/src/theme/foundations/styles.ts +0 -12
- package/src/theme/foundations/textStyles.ts +0 -74
- package/src/theme/foundations/zIndices.ts +0 -17
- package/src/theme/utils/base-utils.ts +0 -104
- package/src/theme/utils/focus-utils.ts +0 -10
- package/src/toast/ActionToast.test.tsx +0 -22
- package/src/toast/ActionToast.tsx +0 -28
- package/src/toast/BaseToast.test.tsx +0 -27
- package/src/toast/BaseToast.tsx +0 -75
- package/src/toast/ClosableToast.test.tsx +0 -17
- package/src/toast/ClosableToast.tsx +0 -40
- package/src/toast/useToast.tsx +0 -121
- package/src/tooltip/Tooltip.tsx +0 -70
- package/src/tooltip/index.tsx +0 -1
@@ -0,0 +1,255 @@
|
|
1
|
+
export const keyframes = {
|
2
|
+
spin: {
|
3
|
+
"0%": {
|
4
|
+
transform: "rotate(0deg)",
|
5
|
+
},
|
6
|
+
"100%": {
|
7
|
+
transform: "rotate(360deg)",
|
8
|
+
},
|
9
|
+
},
|
10
|
+
pulse: {
|
11
|
+
"50%": {
|
12
|
+
opacity: "0.5",
|
13
|
+
},
|
14
|
+
},
|
15
|
+
ping: {
|
16
|
+
"75%, 100%": {
|
17
|
+
transform: "scale(2)",
|
18
|
+
opacity: "0",
|
19
|
+
},
|
20
|
+
},
|
21
|
+
bounce: {
|
22
|
+
"0%, 100%": {
|
23
|
+
transform: "translateY(-25%)",
|
24
|
+
animationTimingFunction: "cubic-bezier(0.8,0,1,1)",
|
25
|
+
},
|
26
|
+
"50%": {
|
27
|
+
transform: "none",
|
28
|
+
animationTimingFunction: "cubic-bezier(0,0,0.2,1)",
|
29
|
+
},
|
30
|
+
},
|
31
|
+
"bg-position": {
|
32
|
+
from: {
|
33
|
+
backgroundPosition: "var(--animate-from, 1rem) 0",
|
34
|
+
},
|
35
|
+
to: {
|
36
|
+
backgroundPosition: "var(--animate-to, 0) 0",
|
37
|
+
},
|
38
|
+
},
|
39
|
+
position: {
|
40
|
+
from: {
|
41
|
+
insetInlineStart: "var(--animate-from-x)",
|
42
|
+
insetBlockStart: "var(--animate-from-y)",
|
43
|
+
},
|
44
|
+
to: {
|
45
|
+
insetInlineStart: "var(--animate-to-x)",
|
46
|
+
insetBlockStart: "var(--animate-to-y)",
|
47
|
+
},
|
48
|
+
},
|
49
|
+
"circular-progress": {
|
50
|
+
"0%": {
|
51
|
+
strokeDasharray: "1, 400",
|
52
|
+
strokeDashoffset: "0",
|
53
|
+
},
|
54
|
+
"50%": {
|
55
|
+
strokeDasharray: "400, 400",
|
56
|
+
strokeDashoffset: "-100%",
|
57
|
+
},
|
58
|
+
"100%": {
|
59
|
+
strokeDasharray: "400, 400",
|
60
|
+
strokeDashoffset: "-260%",
|
61
|
+
},
|
62
|
+
},
|
63
|
+
"expand-height": {
|
64
|
+
from: {
|
65
|
+
height: "0",
|
66
|
+
},
|
67
|
+
to: {
|
68
|
+
height: "var(--height)",
|
69
|
+
},
|
70
|
+
},
|
71
|
+
"collapse-height": {
|
72
|
+
from: {
|
73
|
+
height: "var(--height)",
|
74
|
+
},
|
75
|
+
to: {
|
76
|
+
height: "0",
|
77
|
+
},
|
78
|
+
},
|
79
|
+
"expand-width": {
|
80
|
+
from: {
|
81
|
+
width: "auto",
|
82
|
+
},
|
83
|
+
to: {
|
84
|
+
width: "var(--width)",
|
85
|
+
},
|
86
|
+
},
|
87
|
+
"collapse-width": {
|
88
|
+
from: {
|
89
|
+
width: "var(--width)",
|
90
|
+
},
|
91
|
+
to: {
|
92
|
+
width: "auto",
|
93
|
+
},
|
94
|
+
},
|
95
|
+
"fade-in": {
|
96
|
+
from: {
|
97
|
+
opacity: 0,
|
98
|
+
},
|
99
|
+
to: {
|
100
|
+
opacity: 1,
|
101
|
+
},
|
102
|
+
},
|
103
|
+
"fade-out": {
|
104
|
+
from: {
|
105
|
+
opacity: 1,
|
106
|
+
},
|
107
|
+
to: {
|
108
|
+
opacity: 0,
|
109
|
+
},
|
110
|
+
},
|
111
|
+
"slide-from-left-full": {
|
112
|
+
from: {
|
113
|
+
translate: "-100% 0",
|
114
|
+
},
|
115
|
+
to: {
|
116
|
+
translate: "0 0",
|
117
|
+
},
|
118
|
+
},
|
119
|
+
"slide-from-right-full": {
|
120
|
+
from: {
|
121
|
+
translate: "100% 0",
|
122
|
+
},
|
123
|
+
to: {
|
124
|
+
translate: "0 0",
|
125
|
+
},
|
126
|
+
},
|
127
|
+
"slide-from-top-full": {
|
128
|
+
from: {
|
129
|
+
translate: "0 -100%",
|
130
|
+
},
|
131
|
+
to: {
|
132
|
+
translate: "0 0",
|
133
|
+
},
|
134
|
+
},
|
135
|
+
"slide-from-bottom-full": {
|
136
|
+
from: {
|
137
|
+
translate: "0 100%",
|
138
|
+
},
|
139
|
+
to: {
|
140
|
+
translate: "0 0",
|
141
|
+
},
|
142
|
+
},
|
143
|
+
"slide-to-left-full": {
|
144
|
+
from: {
|
145
|
+
translate: "0 0",
|
146
|
+
},
|
147
|
+
to: {
|
148
|
+
translate: "-100% 0",
|
149
|
+
},
|
150
|
+
},
|
151
|
+
"slide-to-right-full": {
|
152
|
+
from: {
|
153
|
+
translate: "0 0",
|
154
|
+
},
|
155
|
+
to: {
|
156
|
+
translate: "100% 0",
|
157
|
+
},
|
158
|
+
},
|
159
|
+
"slide-to-top-full": {
|
160
|
+
from: {
|
161
|
+
translate: "0 0",
|
162
|
+
},
|
163
|
+
to: {
|
164
|
+
translate: "0 -100%",
|
165
|
+
},
|
166
|
+
},
|
167
|
+
"slide-to-bottom-full": {
|
168
|
+
from: {
|
169
|
+
translate: "0 0",
|
170
|
+
},
|
171
|
+
to: {
|
172
|
+
translate: "0 100%",
|
173
|
+
},
|
174
|
+
},
|
175
|
+
"slide-from-top": {
|
176
|
+
"0%": {
|
177
|
+
translate: "0 -0.5rem",
|
178
|
+
},
|
179
|
+
to: {
|
180
|
+
translate: "0",
|
181
|
+
},
|
182
|
+
},
|
183
|
+
"slide-from-bottom": {
|
184
|
+
"0%": {
|
185
|
+
translate: "0 0.5rem",
|
186
|
+
},
|
187
|
+
to: {
|
188
|
+
translate: "0",
|
189
|
+
},
|
190
|
+
},
|
191
|
+
"slide-from-left": {
|
192
|
+
"0%": {
|
193
|
+
translate: "-0.5rem 0",
|
194
|
+
},
|
195
|
+
to: {
|
196
|
+
translate: "0",
|
197
|
+
},
|
198
|
+
},
|
199
|
+
"slide-from-right": {
|
200
|
+
"0%": {
|
201
|
+
translate: "0.5rem 0",
|
202
|
+
},
|
203
|
+
to: {
|
204
|
+
translate: "0",
|
205
|
+
},
|
206
|
+
},
|
207
|
+
"slide-to-top": {
|
208
|
+
"0%": {
|
209
|
+
translate: "0",
|
210
|
+
},
|
211
|
+
to: {
|
212
|
+
translate: "0 -0.5rem",
|
213
|
+
},
|
214
|
+
},
|
215
|
+
"slide-to-bottom": {
|
216
|
+
"0%": {
|
217
|
+
translate: "0",
|
218
|
+
},
|
219
|
+
to: {
|
220
|
+
translate: "0 0.5rem",
|
221
|
+
},
|
222
|
+
},
|
223
|
+
"slide-to-left": {
|
224
|
+
"0%": {
|
225
|
+
translate: "0",
|
226
|
+
},
|
227
|
+
to: {
|
228
|
+
translate: "-0.5rem 0",
|
229
|
+
},
|
230
|
+
},
|
231
|
+
"slide-to-right": {
|
232
|
+
"0%": {
|
233
|
+
translate: "0",
|
234
|
+
},
|
235
|
+
to: {
|
236
|
+
translate: "0.5rem 0",
|
237
|
+
},
|
238
|
+
},
|
239
|
+
"scale-in": {
|
240
|
+
from: {
|
241
|
+
scale: "0.95",
|
242
|
+
},
|
243
|
+
to: {
|
244
|
+
scale: "1",
|
245
|
+
},
|
246
|
+
},
|
247
|
+
"scale-out": {
|
248
|
+
from: {
|
249
|
+
scale: "1",
|
250
|
+
},
|
251
|
+
to: {
|
252
|
+
scale: "0.95",
|
253
|
+
},
|
254
|
+
},
|
255
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { defineTokens } from "@chakra-ui/react";
|
2
|
+
|
3
|
+
export const letterSpacings = defineTokens.letterSpacings({
|
4
|
+
tighter: {
|
5
|
+
value: "-0.05em",
|
6
|
+
},
|
7
|
+
tight: {
|
8
|
+
value: "-0.025em",
|
9
|
+
},
|
10
|
+
wide: {
|
11
|
+
value: "0.025em",
|
12
|
+
},
|
13
|
+
wider: {
|
14
|
+
value: "0.05em",
|
15
|
+
},
|
16
|
+
widest: {
|
17
|
+
value: "0.1em",
|
18
|
+
},
|
19
|
+
});
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { defineTokens } from "@chakra-ui/react";
|
2
|
+
|
3
|
+
export const lineHeights = defineTokens.lineHeights({
|
4
|
+
shorter: {
|
5
|
+
value: 1.25,
|
6
|
+
},
|
7
|
+
short: {
|
8
|
+
value: 1.375,
|
9
|
+
},
|
10
|
+
moderate: {
|
11
|
+
value: 1.5,
|
12
|
+
},
|
13
|
+
tall: {
|
14
|
+
value: 1.625,
|
15
|
+
},
|
16
|
+
taller: {
|
17
|
+
value: 2,
|
18
|
+
},
|
19
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { defineTokens } from "@chakra-ui/react";
|
2
|
+
import tokens from "@vygruppen/spor-design-tokens";
|
3
|
+
|
4
|
+
export const radii = defineTokens.radii({
|
5
|
+
none: { value: tokens.size["border-radius"].none },
|
6
|
+
xs: { value: tokens.size["border-radius"].xs },
|
7
|
+
sm: { value: tokens.size["border-radius"].sm },
|
8
|
+
md: { value: tokens.size["border-radius"].md },
|
9
|
+
lg: { value: tokens.size["border-radius"].lg },
|
10
|
+
xl: { value: tokens.size["border-radius"].xl },
|
11
|
+
"2xl": { value: tokens.size["border-radius"]["2xl"] },
|
12
|
+
round: { value: "50%" },
|
13
|
+
});
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { defineTokens } from "@chakra-ui/react";
|
2
|
+
import tokens from "@vygruppen/spor-design-tokens";
|
3
|
+
import { spacing } from "./spacing";
|
4
|
+
|
5
|
+
export const largeSizes = defineTokens.sizes({
|
6
|
+
"3xs": { value: "14rem" },
|
7
|
+
"2xs": { value: "16rem" },
|
8
|
+
xs: { value: "20rem" },
|
9
|
+
sm: { value: "24rem" },
|
10
|
+
md: { value: "28rem" },
|
11
|
+
lg: { value: "32rem" },
|
12
|
+
xl: { value: "36rem" },
|
13
|
+
"2xl": { value: "42rem" },
|
14
|
+
"3xl": { value: "48rem" },
|
15
|
+
"4xl": { value: "56rem" },
|
16
|
+
"5xl": { value: "64rem" },
|
17
|
+
"6xl": { value: "72rem" },
|
18
|
+
"7xl": { value: "80rem" },
|
19
|
+
"8xl": { value: "90rem" },
|
20
|
+
});
|
21
|
+
|
22
|
+
const namedSizes = defineTokens.sizes({
|
23
|
+
max: { value: "max-content" },
|
24
|
+
min: { value: "min-content" },
|
25
|
+
fit: { value: "fit-content" },
|
26
|
+
prose: { value: "60ch" },
|
27
|
+
full: { value: "100%" },
|
28
|
+
dvh: { value: "100dvh" },
|
29
|
+
svh: { value: "100svh" },
|
30
|
+
lvh: { value: "100lvh" },
|
31
|
+
dvw: { value: "100dvw" },
|
32
|
+
svw: { value: "100svw" },
|
33
|
+
lvw: { value: "100lvw" },
|
34
|
+
vw: { value: "100vw" },
|
35
|
+
vh: { value: "100vh" },
|
36
|
+
});
|
37
|
+
|
38
|
+
const container = defineTokens.sizes({
|
39
|
+
base: { value: 0 },
|
40
|
+
sm: { value: tokens.size.breakpoint.sm },
|
41
|
+
md: { value: tokens.size.breakpoint.md },
|
42
|
+
lg: { value: tokens.size.breakpoint.lg },
|
43
|
+
xl: { value: tokens.size.breakpoint.xl },
|
44
|
+
});
|
45
|
+
|
46
|
+
export const sizes = {
|
47
|
+
...largeSizes,
|
48
|
+
...namedSizes,
|
49
|
+
...spacing,
|
50
|
+
container,
|
51
|
+
};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { defineTokens } from "@chakra-ui/react";
|
2
|
+
import tokens from "@vygruppen/spor-design-tokens";
|
3
|
+
|
4
|
+
export const spacing = defineTokens.spacing({
|
5
|
+
0: { value: tokens.size.spacing["0"] },
|
6
|
+
0.5: { value: tokens.size.spacing["0.5"] },
|
7
|
+
1: { value: tokens.size.spacing["1"] },
|
8
|
+
1.5: { value: tokens.size.spacing["1.5"] },
|
9
|
+
2: { value: tokens.size.spacing["2"] },
|
10
|
+
3: { value: tokens.size.spacing["3"] },
|
11
|
+
4: { value: tokens.size.spacing["4"] },
|
12
|
+
5: { value: tokens.size.spacing["5"] },
|
13
|
+
6: { value: tokens.size.spacing["6"] },
|
14
|
+
7: { value: tokens.size.spacing["7"] },
|
15
|
+
8: { value: tokens.size.spacing["8"] },
|
16
|
+
9: { value: tokens.size.spacing["9"] },
|
17
|
+
10: { value: tokens.size.spacing["10"] },
|
18
|
+
11: { value: tokens.size.spacing["11"] },
|
19
|
+
12: { value: tokens.size.spacing["12"] },
|
20
|
+
});
|
@@ -0,0 +1,89 @@
|
|
1
|
+
import { defineTextStyles } from "@chakra-ui/react";
|
2
|
+
import tokens from "@vygruppen/spor-design-tokens";
|
3
|
+
|
4
|
+
export const textStyles = defineTextStyles({
|
5
|
+
xxl: {
|
6
|
+
value: {
|
7
|
+
fontSize: [
|
8
|
+
tokens.font.style.xxl["font-size"].mobile,
|
9
|
+
null,
|
10
|
+
null,
|
11
|
+
tokens.font.style.xxl["font-size"].desktop,
|
12
|
+
],
|
13
|
+
fontFamily: tokens.font.style.xxl["font-family"],
|
14
|
+
lineHeight: tokens.font.style.xxl["line-height"],
|
15
|
+
},
|
16
|
+
},
|
17
|
+
"xl-display": {
|
18
|
+
value: {
|
19
|
+
fontSize: [
|
20
|
+
tokens.font.style["xl-display"]["font-size"].mobile,
|
21
|
+
null,
|
22
|
+
null,
|
23
|
+
tokens.font.style["xl-display"]["font-size"].desktop,
|
24
|
+
],
|
25
|
+
fontFamily: tokens.font.style["xl-display"]["font-family"],
|
26
|
+
lineHeight: tokens.font.style["xl-display"]["line-height"],
|
27
|
+
},
|
28
|
+
},
|
29
|
+
"xl-sans": {
|
30
|
+
value: {
|
31
|
+
fontSize: [
|
32
|
+
tokens.font.style["xl-sans"]["font-size"].mobile,
|
33
|
+
null,
|
34
|
+
null,
|
35
|
+
tokens.font.style["xl-sans"]["font-size"].desktop,
|
36
|
+
],
|
37
|
+
fontFamily: tokens.font.style["xl-sans"]["font-family"],
|
38
|
+
lineHeight: tokens.font.style["xl-sans"]["line-height"],
|
39
|
+
},
|
40
|
+
},
|
41
|
+
lg: {
|
42
|
+
value: {
|
43
|
+
fontSize: [
|
44
|
+
tokens.font.style.lg["font-size"].mobile,
|
45
|
+
null,
|
46
|
+
null,
|
47
|
+
tokens.font.style.lg["font-size"].desktop,
|
48
|
+
],
|
49
|
+
fontFamily: tokens.font.style.lg["font-family"],
|
50
|
+
lineHeight: tokens.font.style.lg["line-height"],
|
51
|
+
},
|
52
|
+
},
|
53
|
+
md: {
|
54
|
+
value: {
|
55
|
+
fontSize: [
|
56
|
+
tokens.font.style.md["font-size"].mobile,
|
57
|
+
null,
|
58
|
+
null,
|
59
|
+
tokens.font.style.md["font-size"].desktop,
|
60
|
+
],
|
61
|
+
fontFamily: tokens.font.style.md["font-family"],
|
62
|
+
lineHeight: tokens.font.style.md["line-height"],
|
63
|
+
},
|
64
|
+
},
|
65
|
+
sm: {
|
66
|
+
value: {
|
67
|
+
fontSize: [
|
68
|
+
tokens.font.style.sm["font-size"].mobile,
|
69
|
+
null,
|
70
|
+
null,
|
71
|
+
tokens.font.style.sm["font-size"].desktop,
|
72
|
+
],
|
73
|
+
fontFamily: tokens.font.style.sm["font-family"],
|
74
|
+
lineHeight: tokens.font.style.sm["line-height"],
|
75
|
+
},
|
76
|
+
},
|
77
|
+
xs: {
|
78
|
+
value: {
|
79
|
+
fontSize: [
|
80
|
+
tokens.font.style.xs["font-size"].mobile,
|
81
|
+
null,
|
82
|
+
null,
|
83
|
+
tokens.font.style.xs["font-size"].desktop,
|
84
|
+
],
|
85
|
+
fontFamily: tokens.font.style.xs["font-family"],
|
86
|
+
lineHeight: tokens.font.style.xs["line-height"],
|
87
|
+
},
|
88
|
+
},
|
89
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { defineTokens } from "@chakra-ui/react";
|
2
|
+
import tokens from "@vygruppen/spor-design-tokens";
|
3
|
+
|
4
|
+
export const zIndex = defineTokens.zIndex({
|
5
|
+
hide: { value: tokens.depth["z-index"].hide },
|
6
|
+
auto: { value: "auto" },
|
7
|
+
base: { value: tokens.depth["z-index"].base },
|
8
|
+
docked: { value: tokens.depth["z-index"].docked },
|
9
|
+
dropdown: { value: tokens.depth["z-index"].dropdown },
|
10
|
+
sticky: { value: tokens.depth["z-index"].sticky },
|
11
|
+
banner: { value: tokens.depth["z-index"].banner },
|
12
|
+
overlay: { value: tokens.depth["z-index"].overlay },
|
13
|
+
modal: { value: tokens.depth["z-index"].modal },
|
14
|
+
popover: { value: tokens.depth["z-index"].popover },
|
15
|
+
skipLink: { value: tokens.depth["z-index"].skipLink },
|
16
|
+
toast: { value: tokens.depth["z-index"].toast },
|
17
|
+
});
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { mode, StyleFunctionProps } from "@chakra-ui/theme-tools";
|
2
1
|
import { brandBackground } from "./brand-utils";
|
3
2
|
import { State, Subset } from "./types";
|
4
3
|
|
@@ -7,48 +6,36 @@ type AccentBackgroundState = Subset<
|
|
7
6
|
"default" | "hover" | "active" | "selected"
|
8
7
|
>;
|
9
8
|
|
10
|
-
export function accentBackground(
|
11
|
-
state: AccentBackgroundState,
|
12
|
-
props: StyleFunctionProps,
|
13
|
-
) {
|
9
|
+
export function accentBackground(state: AccentBackgroundState) {
|
14
10
|
switch (state) {
|
15
11
|
case "selected":
|
16
|
-
return brandBackground("default"
|
12
|
+
return brandBackground("default");
|
17
13
|
case "active":
|
18
14
|
return {
|
19
|
-
backgroundColor:
|
20
|
-
"accent.surface.active.light",
|
21
|
-
"accent.surface.active.dark",
|
22
|
-
)(props),
|
15
|
+
backgroundColor: "accent.surface.active",
|
23
16
|
};
|
24
17
|
case "hover":
|
25
18
|
return {
|
26
|
-
backgroundColor:
|
27
|
-
"accent.surface.hover.light",
|
28
|
-
"accent.surface.hover.dark",
|
29
|
-
)(props),
|
19
|
+
backgroundColor: "accent.surface.hover",
|
30
20
|
};
|
31
21
|
default:
|
32
22
|
return {
|
33
|
-
backgroundColor:
|
34
|
-
"accent.surface.default.light",
|
35
|
-
"accent.surface.default.dark",
|
36
|
-
)(props),
|
23
|
+
backgroundColor: "accent.surface",
|
37
24
|
};
|
38
25
|
}
|
39
26
|
}
|
40
27
|
|
41
28
|
type AccentTextState = Subset<State, "default" | "selected">;
|
42
29
|
|
43
|
-
export function accentText(state: AccentTextState
|
30
|
+
export function accentText(state: AccentTextState) {
|
44
31
|
switch (state) {
|
45
32
|
case "selected":
|
46
33
|
return {
|
47
|
-
color:
|
34
|
+
color: "brand.text",
|
48
35
|
};
|
49
36
|
default:
|
50
37
|
return {
|
51
|
-
color:
|
38
|
+
color: "accent.text",
|
52
39
|
};
|
53
40
|
}
|
54
41
|
}
|
@@ -1,19 +1,17 @@
|
|
1
|
-
import { mode } from "@chakra-ui/theme-tools";
|
2
|
-
|
3
1
|
type Bg = "default" | "secondary" | "tertiary";
|
4
|
-
export const bg = (bg: Bg
|
2
|
+
export const bg = (bg: Bg) => {
|
5
3
|
switch (bg) {
|
6
4
|
case "default":
|
7
5
|
return {
|
8
|
-
backgroundColor:
|
6
|
+
backgroundColor: "bg",
|
9
7
|
};
|
10
8
|
case "secondary":
|
11
9
|
return {
|
12
|
-
backgroundColor:
|
10
|
+
backgroundColor: "bg.secondary",
|
13
11
|
};
|
14
12
|
case "tertiary":
|
15
13
|
return {
|
16
|
-
backgroundColor:
|
14
|
+
backgroundColor: "bg.tertiary",
|
17
15
|
};
|
18
16
|
}
|
19
17
|
};
|
@@ -1,42 +1,29 @@
|
|
1
|
-
import { mode, StyleFunctionProps } from "@chakra-ui/theme-tools";
|
2
1
|
import { State, Subset } from "./types";
|
3
2
|
|
4
3
|
type BrandBackgroundState = Subset<State, "default" | "hover" | "active">;
|
5
4
|
|
6
|
-
export function brandBackground(
|
7
|
-
state: BrandBackgroundState,
|
8
|
-
props: StyleFunctionProps,
|
9
|
-
) {
|
5
|
+
export function brandBackground(state: BrandBackgroundState) {
|
10
6
|
switch (state) {
|
11
7
|
case "active":
|
12
8
|
return {
|
13
|
-
backgroundColor:
|
14
|
-
"brand.surface.active.light",
|
15
|
-
"brand.surface.active.dark",
|
16
|
-
)(props),
|
9
|
+
backgroundColor: "brand.surface.active",
|
17
10
|
};
|
18
11
|
case "hover":
|
19
12
|
return {
|
20
|
-
backgroundColor:
|
21
|
-
"brand.surface.hover.light",
|
22
|
-
"brand.surface.hover.dark",
|
23
|
-
)(props),
|
13
|
+
backgroundColor: "brand.surface.hover",
|
24
14
|
};
|
25
15
|
case "default":
|
26
16
|
default:
|
27
17
|
return {
|
28
|
-
backgroundColor:
|
29
|
-
"brand.surface.default.light",
|
30
|
-
"brand.surface.default.dark",
|
31
|
-
)(props),
|
18
|
+
backgroundColor: "brand.surface",
|
32
19
|
};
|
33
20
|
}
|
34
21
|
}
|
35
22
|
|
36
23
|
type BrandTextState = Subset<State, "hover" | "active" | "default">;
|
37
24
|
|
38
|
-
export function brandText(state: BrandTextState
|
25
|
+
export function brandText(state: BrandTextState) {
|
39
26
|
return {
|
40
|
-
color:
|
27
|
+
color: "brand.text",
|
41
28
|
};
|
42
29
|
}
|