@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.
- package/.turbo/turbo-build.log +33 -11
- package/.turbo/turbo-typegen.log +22 -0
- package/CHANGELOG.md +247 -0
- package/dist/index.d.mts +2589 -8303
- package/dist/index.d.ts +2589 -8303
- package/dist/index.js +9609 -8608
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9487 -8455
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -15
- 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 +70 -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 -101
- 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 +36 -21
- 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,92 @@
|
|
1
|
+
import { defineSlotRecipe } from "@chakra-ui/react";
|
2
|
+
import { accentBackground, accentText } from "../utils/accent-utils";
|
3
|
+
import { brandBackground } from "../utils/brand-utils";
|
4
|
+
import { coreText } from "../utils/core-utils";
|
5
|
+
import { stepperAnatomy } from "./anatomy";
|
6
|
+
|
7
|
+
export const stepperSlotRecipe = defineSlotRecipe({
|
8
|
+
slots: stepperAnatomy.keys(),
|
9
|
+
className: "spor-stepper",
|
10
|
+
base: {
|
11
|
+
root: {
|
12
|
+
display: "flex",
|
13
|
+
alignItems: "center",
|
14
|
+
justifyContent: ["space-between", null, "center"],
|
15
|
+
minHeight: ["3rem", null, "3.75rem"],
|
16
|
+
overflowX: "auto",
|
17
|
+
width: "100%",
|
18
|
+
"& svg": {
|
19
|
+
color: {
|
20
|
+
_light: "blackAlpha.700",
|
21
|
+
_dark: "whiteAlpha.700",
|
22
|
+
},
|
23
|
+
},
|
24
|
+
},
|
25
|
+
container: {
|
26
|
+
paddingX: [2, null, null, 0],
|
27
|
+
maxWidth: "container.lg",
|
28
|
+
marginX: "auto",
|
29
|
+
width: "100%",
|
30
|
+
},
|
31
|
+
innerContainer: {
|
32
|
+
overflow: "hidden",
|
33
|
+
display: ["flex", null, "none"],
|
34
|
+
alignItems: "center",
|
35
|
+
justifyContent: "space-between",
|
36
|
+
gap: 3,
|
37
|
+
},
|
38
|
+
title: {
|
39
|
+
overflow: "hidden",
|
40
|
+
fontWeight: "bold",
|
41
|
+
WebkitLineClamp: 2,
|
42
|
+
display: "-webkit-box",
|
43
|
+
textAlign: "center",
|
44
|
+
maxWidth: "80%",
|
45
|
+
},
|
46
|
+
stepContainer: {
|
47
|
+
display: "flex",
|
48
|
+
alignItems: "center",
|
49
|
+
},
|
50
|
+
stepTitle: {
|
51
|
+
textStyle: "sm",
|
52
|
+
whiteSpace: "nowrap",
|
53
|
+
},
|
54
|
+
},
|
55
|
+
variants: {
|
56
|
+
variant: {
|
57
|
+
core: {
|
58
|
+
root: {
|
59
|
+
backgroundColor: "transparent",
|
60
|
+
},
|
61
|
+
},
|
62
|
+
accent: {
|
63
|
+
root: {
|
64
|
+
backgroundColor: "accent.bg",
|
65
|
+
},
|
66
|
+
stepButton: {
|
67
|
+
color: {
|
68
|
+
_light: "blackAlpha.900",
|
69
|
+
_dark: "whiteAlpha.900",
|
70
|
+
},
|
71
|
+
_disabled: {
|
72
|
+
color: coreText("disabled").color,
|
73
|
+
},
|
74
|
+
_currentStep: {
|
75
|
+
color: accentText("default").color,
|
76
|
+
},
|
77
|
+
_hover: {
|
78
|
+
backgroundColor: accentBackground("hover").backgroundColor,
|
79
|
+
_disabled: {
|
80
|
+
backgroundColor: "transparent",
|
81
|
+
},
|
82
|
+
},
|
83
|
+
},
|
84
|
+
backButton: {
|
85
|
+
_hover: {
|
86
|
+
...brandBackground("hover"),
|
87
|
+
},
|
88
|
+
},
|
89
|
+
},
|
90
|
+
},
|
91
|
+
},
|
92
|
+
});
|
@@ -0,0 +1,147 @@
|
|
1
|
+
import { defineSlotRecipe } from "@chakra-ui/react";
|
2
|
+
import { switchAnatomy } from "./anatomy";
|
3
|
+
import tokens from "@vygruppen/spor-design-tokens";
|
4
|
+
|
5
|
+
export const switchSlotRecipe = defineSlotRecipe({
|
6
|
+
slots: switchAnatomy.keys(),
|
7
|
+
className: "spor-switch",
|
8
|
+
base: {
|
9
|
+
root: {
|
10
|
+
display: "inline-flex",
|
11
|
+
gap: "2.5",
|
12
|
+
alignItems: "center",
|
13
|
+
position: "relative",
|
14
|
+
verticalAlign: "middle",
|
15
|
+
"--switch-diff": "calc(var(--switch-width) - var(--switch-height))",
|
16
|
+
"--switch-x": {
|
17
|
+
base: "var(--switch-diff)",
|
18
|
+
_rtl: "calc(var(--switch-diff) * -1)",
|
19
|
+
},
|
20
|
+
},
|
21
|
+
thumb: {
|
22
|
+
position: "absolute",
|
23
|
+
transitionProperty: "translate",
|
24
|
+
transitionDuration: "fast",
|
25
|
+
borderRadius: "2xl",
|
26
|
+
display: "flex",
|
27
|
+
flexShrink: 0,
|
28
|
+
alignItems: "center",
|
29
|
+
justifyContent: "center",
|
30
|
+
width: "var(--switch-height)",
|
31
|
+
height: "var(--switch-height)",
|
32
|
+
backgroundColor: "core.icon",
|
33
|
+
|
34
|
+
_disabled: {
|
35
|
+
backgroundColor: "icon.disabled",
|
36
|
+
_checked: {
|
37
|
+
backgroundColor: "icon.disabled",
|
38
|
+
},
|
39
|
+
},
|
40
|
+
_checked: {
|
41
|
+
translate: "var(--switch-x) 0",
|
42
|
+
backgroundColor: "brand.icon",
|
43
|
+
},
|
44
|
+
},
|
45
|
+
|
46
|
+
label: {
|
47
|
+
display: "block",
|
48
|
+
textAlign: "start",
|
49
|
+
marginEnd: 3,
|
50
|
+
opacity: 1,
|
51
|
+
bottom: 4,
|
52
|
+
_disabled: {
|
53
|
+
opacity: "0.5",
|
54
|
+
},
|
55
|
+
},
|
56
|
+
control: {
|
57
|
+
boxSizing: "content-box",
|
58
|
+
padding: 0.5,
|
59
|
+
|
60
|
+
display: "inline-flex",
|
61
|
+
gap: 1.5,
|
62
|
+
flexShrink: 0,
|
63
|
+
justifyContent: "flex-start",
|
64
|
+
cursor: "switch",
|
65
|
+
borderRadius: "xl",
|
66
|
+
position: "relative",
|
67
|
+
width: "var(--switch-width)",
|
68
|
+
height: "var(--switch-height)",
|
69
|
+
transitionProperty: "common",
|
70
|
+
transitionDuration: "fast",
|
71
|
+
outline: "1px solid",
|
72
|
+
outlineColor: "core.outline.default",
|
73
|
+
backgroundColor: "core.background",
|
74
|
+
_hover: {
|
75
|
+
outline: "2px solid",
|
76
|
+
outlineColor: "core.outline.hover",
|
77
|
+
_checked: {
|
78
|
+
outlineColor: "transparent",
|
79
|
+
backgroundColor: "brand.surface.hover",
|
80
|
+
},
|
81
|
+
},
|
82
|
+
|
83
|
+
_focusVisible: {
|
84
|
+
outlineWidth: "2px",
|
85
|
+
outlineColor: "outline.focus",
|
86
|
+
outlineStyle: "solid",
|
87
|
+
},
|
88
|
+
|
89
|
+
_checked: {
|
90
|
+
backgroundColor: "brand.surface",
|
91
|
+
_focusVisible: {
|
92
|
+
outlineStyle: "double",
|
93
|
+
outlineWidth: `calc(3 * ${tokens.size.stroke.md})`, // space for double outline
|
94
|
+
},
|
95
|
+
},
|
96
|
+
_disabled: {
|
97
|
+
pointerEvents: "none",
|
98
|
+
backgroundColor: "core.disabled",
|
99
|
+
outlineColor: "outline.disabled",
|
100
|
+
|
101
|
+
_checked: {
|
102
|
+
backgroundColor: "icon.disabled",
|
103
|
+
outlineColor: "transparent",
|
104
|
+
},
|
105
|
+
},
|
106
|
+
_invalid: {
|
107
|
+
outline: "2px solid",
|
108
|
+
outlineColor: "outline.error",
|
109
|
+
outlineOffset: "2px",
|
110
|
+
},
|
111
|
+
},
|
112
|
+
},
|
113
|
+
variants: {
|
114
|
+
size: {
|
115
|
+
sm: {
|
116
|
+
root: {
|
117
|
+
"--switch-width": "3.3rem",
|
118
|
+
"--switch-height": "1.5rem",
|
119
|
+
},
|
120
|
+
control: {
|
121
|
+
borderRadius: "lg",
|
122
|
+
padding: "0.12rem",
|
123
|
+
},
|
124
|
+
},
|
125
|
+
md: {
|
126
|
+
root: {
|
127
|
+
"--switch-width": "4.1rem",
|
128
|
+
"--switch-height": "1.8rem",
|
129
|
+
},
|
130
|
+
control: {
|
131
|
+
borderRadius: "xl",
|
132
|
+
padding: 0.5,
|
133
|
+
},
|
134
|
+
},
|
135
|
+
lg: {
|
136
|
+
root: {
|
137
|
+
"--switch-width": "4.8rem",
|
138
|
+
"--switch-height": "2.25rem",
|
139
|
+
},
|
140
|
+
control: {
|
141
|
+
borderRadius: "2xl",
|
142
|
+
padding: 0.5,
|
143
|
+
},
|
144
|
+
},
|
145
|
+
},
|
146
|
+
},
|
147
|
+
});
|
@@ -0,0 +1,200 @@
|
|
1
|
+
import { defineSlotRecipe } from "@chakra-ui/react";
|
2
|
+
import { tableAnatomy } from "./anatomy";
|
3
|
+
|
4
|
+
const numericStyles = {
|
5
|
+
"&[data-is-numeric=true]": {
|
6
|
+
textAlign: "right",
|
7
|
+
},
|
8
|
+
};
|
9
|
+
|
10
|
+
export const tableSlotRecipe = defineSlotRecipe({
|
11
|
+
className: "spor-table",
|
12
|
+
slots: tableAnatomy.keys(),
|
13
|
+
base: {
|
14
|
+
root: {
|
15
|
+
tableLayout: "fixed",
|
16
|
+
borderCollapse: "collapse",
|
17
|
+
width: "100%",
|
18
|
+
},
|
19
|
+
columnHeader: {
|
20
|
+
fontWeight: "bold",
|
21
|
+
textAlign: "start",
|
22
|
+
borderBottom: "sm",
|
23
|
+
borderColor: "outline.disabled",
|
24
|
+
...numericStyles,
|
25
|
+
paddingX: 1.5,
|
26
|
+
paddingY: 1,
|
27
|
+
},
|
28
|
+
row: {
|
29
|
+
borderBottom: "sm",
|
30
|
+
borderColor: "outline.disabled",
|
31
|
+
...numericStyles,
|
32
|
+
},
|
33
|
+
cell: {
|
34
|
+
...numericStyles,
|
35
|
+
paddingX: 1.5,
|
36
|
+
paddingY: 1,
|
37
|
+
},
|
38
|
+
footer: {
|
39
|
+
fontWeight: "medium",
|
40
|
+
},
|
41
|
+
},
|
42
|
+
|
43
|
+
variants: {
|
44
|
+
colorPalette: {
|
45
|
+
green: {
|
46
|
+
root: {
|
47
|
+
backgroundColor: "bg",
|
48
|
+
},
|
49
|
+
header: {
|
50
|
+
backgroundColor: "bg.tertiary",
|
51
|
+
},
|
52
|
+
columnHeader: {
|
53
|
+
color: "text.secondary",
|
54
|
+
},
|
55
|
+
},
|
56
|
+
grey: {
|
57
|
+
root: {
|
58
|
+
backgroundColor: "bg",
|
59
|
+
},
|
60
|
+
columnHeader: {
|
61
|
+
color: "brand.text.inverted",
|
62
|
+
backgroundColor: "surface.disabled",
|
63
|
+
_hover: {
|
64
|
+
backgroundColor: "surface.disabled",
|
65
|
+
},
|
66
|
+
},
|
67
|
+
},
|
68
|
+
white: {
|
69
|
+
root: {
|
70
|
+
backgroundColor: "bg",
|
71
|
+
},
|
72
|
+
columnHeader: {
|
73
|
+
color: "text",
|
74
|
+
backgroundColor: "bg",
|
75
|
+
},
|
76
|
+
},
|
77
|
+
},
|
78
|
+
variant: {
|
79
|
+
ghost: {
|
80
|
+
header: {
|
81
|
+
backgroundColor: "none",
|
82
|
+
},
|
83
|
+
columnHeader: {
|
84
|
+
borderLeft: "none",
|
85
|
+
borderBottom: "sm",
|
86
|
+
borderColor: "outline.disabled",
|
87
|
+
backgroundColor: "none",
|
88
|
+
color: "text",
|
89
|
+
},
|
90
|
+
|
91
|
+
cell: {
|
92
|
+
borderBottom: "sm",
|
93
|
+
borderColor: "outline.disabled",
|
94
|
+
...numericStyles,
|
95
|
+
_first: {
|
96
|
+
borderLeft: "none",
|
97
|
+
},
|
98
|
+
},
|
99
|
+
},
|
100
|
+
|
101
|
+
core: {
|
102
|
+
table: {
|
103
|
+
borderRadius: "md",
|
104
|
+
overflow: "hidden",
|
105
|
+
border: "sm",
|
106
|
+
borderColor: "outline.disabled",
|
107
|
+
},
|
108
|
+
cell: {
|
109
|
+
borderLeft: "sm",
|
110
|
+
borderColor: "outline.disabled",
|
111
|
+
...numericStyles,
|
112
|
+
_first: {
|
113
|
+
borderLeft: "none",
|
114
|
+
},
|
115
|
+
},
|
116
|
+
header: {
|
117
|
+
border: "none",
|
118
|
+
},
|
119
|
+
columnHeader: {
|
120
|
+
borderBottom: "sm",
|
121
|
+
borderLeft: "sm",
|
122
|
+
borderLeftColor: "outline.disabled",
|
123
|
+
...numericStyles,
|
124
|
+
_first: {
|
125
|
+
borderLeft: "none",
|
126
|
+
},
|
127
|
+
},
|
128
|
+
row: {
|
129
|
+
...numericStyles,
|
130
|
+
borderBottom: "sm",
|
131
|
+
borderColor: "outline.disabled",
|
132
|
+
_last: {
|
133
|
+
borderBottom: "none",
|
134
|
+
},
|
135
|
+
},
|
136
|
+
},
|
137
|
+
},
|
138
|
+
|
139
|
+
size: {
|
140
|
+
sm: {
|
141
|
+
table: {
|
142
|
+
fontSize: "mobile.sm",
|
143
|
+
},
|
144
|
+
cell: {
|
145
|
+
paddingX: 1,
|
146
|
+
paddingY: 0.5,
|
147
|
+
fontSize: "mobile.sm",
|
148
|
+
},
|
149
|
+
columnHeader: {
|
150
|
+
paddingX: 1,
|
151
|
+
paddingY: 0.5,
|
152
|
+
},
|
153
|
+
caption: {
|
154
|
+
paddingX: 1,
|
155
|
+
paddingY: 0.5,
|
156
|
+
},
|
157
|
+
},
|
158
|
+
md: {
|
159
|
+
table: {
|
160
|
+
fontSize: "mobile.md",
|
161
|
+
},
|
162
|
+
cell: {
|
163
|
+
paddingX: 1.5,
|
164
|
+
paddingY: 1,
|
165
|
+
fontSize: "mobile.md",
|
166
|
+
},
|
167
|
+
|
168
|
+
columnHeader: {
|
169
|
+
paddingX: 1.5,
|
170
|
+
paddingY: 1,
|
171
|
+
fontSize: "mobile.md",
|
172
|
+
},
|
173
|
+
caption: {
|
174
|
+
paddingX: 1.5,
|
175
|
+
paddingY: 1,
|
176
|
+
fontSize: "mobile.md",
|
177
|
+
},
|
178
|
+
},
|
179
|
+
lg: {
|
180
|
+
table: {
|
181
|
+
fontSize: "mobile.md",
|
182
|
+
},
|
183
|
+
cell: {
|
184
|
+
paddingX: 3,
|
185
|
+
paddingY: 3,
|
186
|
+
fontSize: "mobile.md",
|
187
|
+
},
|
188
|
+
columnHeader: {
|
189
|
+
paddingX: 3,
|
190
|
+
paddingY: 2,
|
191
|
+
fontSize: "mobile.md",
|
192
|
+
},
|
193
|
+
caption: {
|
194
|
+
paddingX: 3,
|
195
|
+
paddingY: 2,
|
196
|
+
},
|
197
|
+
},
|
198
|
+
},
|
199
|
+
},
|
200
|
+
});
|
@@ -0,0 +1,169 @@
|
|
1
|
+
import { defineSlotRecipe } from "@chakra-ui/react";
|
2
|
+
import { tabsAnatomy } from "./anatomy";
|
3
|
+
|
4
|
+
export const tabsSlotRecipe = defineSlotRecipe({
|
5
|
+
slots: tabsAnatomy.keys(),
|
6
|
+
className: "spor-tabs",
|
7
|
+
base: {
|
8
|
+
root: {
|
9
|
+
display: "flex",
|
10
|
+
flexDirection: "column",
|
11
|
+
},
|
12
|
+
list: {
|
13
|
+
display: "flex",
|
14
|
+
alignItems: "center",
|
15
|
+
gap: 0.5,
|
16
|
+
borderRadius: "xl",
|
17
|
+
width: "fit-content",
|
18
|
+
},
|
19
|
+
trigger: {
|
20
|
+
display: "flex",
|
21
|
+
cursor: "pointer",
|
22
|
+
justifyContent: "center",
|
23
|
+
alignItems: "center",
|
24
|
+
transitionProperty: "common",
|
25
|
+
transitionDuration: "normal",
|
26
|
+
height: "100%",
|
27
|
+
whiteSpace: "nowrap",
|
28
|
+
borderRadius: "xl",
|
29
|
+
},
|
30
|
+
},
|
31
|
+
variants: {
|
32
|
+
fitted: {
|
33
|
+
true: {
|
34
|
+
list: {
|
35
|
+
display: "flex",
|
36
|
+
width: "auto",
|
37
|
+
},
|
38
|
+
trigger: {
|
39
|
+
flex: 1,
|
40
|
+
textAlign: "center",
|
41
|
+
justifyContent: "center",
|
42
|
+
},
|
43
|
+
},
|
44
|
+
},
|
45
|
+
justify: {
|
46
|
+
start: {
|
47
|
+
list: {
|
48
|
+
justifyContent: "flex-start",
|
49
|
+
},
|
50
|
+
},
|
51
|
+
center: {
|
52
|
+
list: {
|
53
|
+
justifyContent: "center",
|
54
|
+
},
|
55
|
+
},
|
56
|
+
end: {
|
57
|
+
list: {
|
58
|
+
justifyContent: "flex-end",
|
59
|
+
},
|
60
|
+
},
|
61
|
+
},
|
62
|
+
variant: {
|
63
|
+
core: {
|
64
|
+
list: {
|
65
|
+
backgroundColor: "core.surface",
|
66
|
+
color: "core.text",
|
67
|
+
border: "sm",
|
68
|
+
},
|
69
|
+
trigger: {
|
70
|
+
color: "core.text",
|
71
|
+
border: "md",
|
72
|
+
borderColor: "transparent",
|
73
|
+
_hover: {
|
74
|
+
outline: "2px solid",
|
75
|
+
outlineColor: "core.surface.hover",
|
76
|
+
outlineOffset: "-2px",
|
77
|
+
},
|
78
|
+
_active: {
|
79
|
+
backgroundColor: "brand.surface.active",
|
80
|
+
color: "brand.text",
|
81
|
+
outline: "none",
|
82
|
+
},
|
83
|
+
_selected: {
|
84
|
+
backgroundColor: "brand.surface",
|
85
|
+
color: "brand.text",
|
86
|
+
},
|
87
|
+
_disabled: {
|
88
|
+
backgroundColor: "surface.disabled",
|
89
|
+
color: "brand.text.disabled",
|
90
|
+
},
|
91
|
+
},
|
92
|
+
},
|
93
|
+
accent: {
|
94
|
+
list: {
|
95
|
+
backgroundColor: "accent.bg",
|
96
|
+
color: "accent.text",
|
97
|
+
},
|
98
|
+
trigger: {
|
99
|
+
color: "accent.text",
|
100
|
+
_disabled: {
|
101
|
+
backgroundColor: "surface.disabled",
|
102
|
+
color: "accent.text.disabled",
|
103
|
+
},
|
104
|
+
_hover: {
|
105
|
+
backgroundColor: "accent.surface.hover",
|
106
|
+
_active: {
|
107
|
+
backgroundColor: "brand.surface.active",
|
108
|
+
color: "brand.text",
|
109
|
+
},
|
110
|
+
},
|
111
|
+
_selected: {
|
112
|
+
backgroundColor: "brand.surface",
|
113
|
+
color: "brand.text",
|
114
|
+
_hover: {
|
115
|
+
backgroundColor: "brand.surface.hover",
|
116
|
+
color: "brand.text",
|
117
|
+
},
|
118
|
+
},
|
119
|
+
},
|
120
|
+
},
|
121
|
+
},
|
122
|
+
size: {
|
123
|
+
xs: {
|
124
|
+
list: {
|
125
|
+
height: 5,
|
126
|
+
padding: "0.1rem",
|
127
|
+
},
|
128
|
+
trigger: {
|
129
|
+
paddingX: 2,
|
130
|
+
paddingY: 0,
|
131
|
+
},
|
132
|
+
},
|
133
|
+
sm: {
|
134
|
+
list: {
|
135
|
+
height: 6,
|
136
|
+
padding: 0.5,
|
137
|
+
},
|
138
|
+
trigger: {
|
139
|
+
paddingX: 2,
|
140
|
+
},
|
141
|
+
},
|
142
|
+
md: {
|
143
|
+
list: {
|
144
|
+
height: 7,
|
145
|
+
padding: 0.5,
|
146
|
+
},
|
147
|
+
trigger: {
|
148
|
+
fontWeight: "bold",
|
149
|
+
paddingX: 2,
|
150
|
+
},
|
151
|
+
},
|
152
|
+
lg: {
|
153
|
+
list: {
|
154
|
+
height: 8,
|
155
|
+
padding: "0.2rem",
|
156
|
+
},
|
157
|
+
trigger: {
|
158
|
+
fontWeight: "bold",
|
159
|
+
fontSize: "sm",
|
160
|
+
paddingX: 3,
|
161
|
+
_focus: {
|
162
|
+
border: "md",
|
163
|
+
borderColor: "accent.surface",
|
164
|
+
},
|
165
|
+
},
|
166
|
+
},
|
167
|
+
},
|
168
|
+
},
|
169
|
+
});
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import { defineSlotRecipe } from "@chakra-ui/react";
|
2
|
+
import { toastAnatomy } from "./anatomy";
|
3
|
+
|
4
|
+
export const toastSlotRecipe = defineSlotRecipe({
|
5
|
+
slots: toastAnatomy.keys(),
|
6
|
+
className: "chakra-toast",
|
7
|
+
base: {
|
8
|
+
root: {
|
9
|
+
width: "full",
|
10
|
+
display: "flex",
|
11
|
+
position: "relative",
|
12
|
+
alignItems: "center",
|
13
|
+
gap: "0.75rem",
|
14
|
+
padding: "0.563rem 0.75rem",
|
15
|
+
translate: "var(--x) var(--y)",
|
16
|
+
opacity: "var(--opacity)",
|
17
|
+
willChange: "translate, opacity, scale",
|
18
|
+
|
19
|
+
borderRadius: "sm",
|
20
|
+
transition:
|
21
|
+
"translate 400ms, scale 400ms, opacity 400ms, height 400ms, box-shadow 200ms",
|
22
|
+
transitionTimingFunction: "cubic-bezier(0.21, 1.02, 0.73, 1)",
|
23
|
+
_closed: {
|
24
|
+
transition: "translate 400ms, scale 400ms, opacity 200ms",
|
25
|
+
transitionTimingFunction: "cubic-bezier(0.06, 0.71, 0.55, 1)",
|
26
|
+
},
|
27
|
+
boxShadow: "xl",
|
28
|
+
|
29
|
+
color: "text",
|
30
|
+
"&[data-type=success]": {
|
31
|
+
backgroundColor: "alert.success.surface",
|
32
|
+
"& svg": {
|
33
|
+
color: "primaryGreen",
|
34
|
+
},
|
35
|
+
},
|
36
|
+
"&[data-type=error]": {
|
37
|
+
backgroundColor: "alert.error.surface",
|
38
|
+
"& svg": {
|
39
|
+
color: "brightRed",
|
40
|
+
},
|
41
|
+
},
|
42
|
+
|
43
|
+
"&[data-type=info]": {
|
44
|
+
backgroundColor: "alert.info.surface",
|
45
|
+
"& svg": {
|
46
|
+
color: "darkBlue",
|
47
|
+
},
|
48
|
+
},
|
49
|
+
},
|
50
|
+
|
51
|
+
title: {
|
52
|
+
textStyle: "sm",
|
53
|
+
marginEnd: "2",
|
54
|
+
},
|
55
|
+
},
|
56
|
+
});
|