@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,214 @@
|
|
1
|
+
import { defineSlotRecipe } from "@chakra-ui/react";
|
2
|
+
import { datepickerAnatomy } from "./anatomy";
|
3
|
+
|
4
|
+
export const datePickerSlotRecipe = defineSlotRecipe({
|
5
|
+
slots: datepickerAnatomy.keys(),
|
6
|
+
className: "spor-datepicker",
|
7
|
+
base: {
|
8
|
+
wrapper: {
|
9
|
+
transitionProperty: "box-shadow",
|
10
|
+
transitionDuration: "fast",
|
11
|
+
borderRadius: "sm",
|
12
|
+
display: "flex",
|
13
|
+
flex: 1,
|
14
|
+
paddingY: 0.5,
|
15
|
+
alignItems: "center",
|
16
|
+
_hover: {
|
17
|
+
zIndex: "docked",
|
18
|
+
},
|
19
|
+
_disabled: {
|
20
|
+
pointerEvents: "none",
|
21
|
+
backgroundColor: "surface.disabled",
|
22
|
+
outline: "1px solid",
|
23
|
+
outlineColor: "outline.disabled",
|
24
|
+
color: "text.disabled",
|
25
|
+
},
|
26
|
+
_focusWithin: {
|
27
|
+
outline: "2px solid",
|
28
|
+
outlineColor: "outline.focus",
|
29
|
+
},
|
30
|
+
},
|
31
|
+
inputLabel: {
|
32
|
+
fontSize: "mobile.xs",
|
33
|
+
margin: 0,
|
34
|
+
cursor: "text",
|
35
|
+
},
|
36
|
+
dateTimeSegment: {
|
37
|
+
_focus: {
|
38
|
+
backgroundColor: "ghost.surface.active",
|
39
|
+
color: "text.default",
|
40
|
+
},
|
41
|
+
},
|
42
|
+
box: {
|
43
|
+
width: "100%",
|
44
|
+
},
|
45
|
+
|
46
|
+
calendarTriggerButton: {
|
47
|
+
position: "relative",
|
48
|
+
borderRadius: "xl",
|
49
|
+
display: "flex",
|
50
|
+
alignItems: "center",
|
51
|
+
justifyContent: "center",
|
52
|
+
transitionProperty: "box-shadow, background-color",
|
53
|
+
right: "0.5rem",
|
54
|
+
_hover: {
|
55
|
+
backgroundColor: "ghost.surface.hover",
|
56
|
+
},
|
57
|
+
_active: {
|
58
|
+
backgroundColor: "ghost.surface.active",
|
59
|
+
},
|
60
|
+
_invalid: {
|
61
|
+
outline: "2px solid",
|
62
|
+
outlineColor: "outline.error",
|
63
|
+
},
|
64
|
+
},
|
65
|
+
arrow: {
|
66
|
+
backgroundColor: "surface",
|
67
|
+
},
|
68
|
+
calendarPopover: {
|
69
|
+
color: "core.text",
|
70
|
+
outline: "1px solid",
|
71
|
+
outlineColor: "floating.outline",
|
72
|
+
boxShadow: "md",
|
73
|
+
backgroundColor: "floating.surface",
|
74
|
+
},
|
75
|
+
rangeCalendarPopover: {
|
76
|
+
width: "43rem",
|
77
|
+
maxWidth: "100vw",
|
78
|
+
},
|
79
|
+
weekdays: {
|
80
|
+
color: "core.text",
|
81
|
+
fontWeight: "bold",
|
82
|
+
},
|
83
|
+
weekend: {
|
84
|
+
color: "accent.text",
|
85
|
+
fontWeight: "bold",
|
86
|
+
},
|
87
|
+
cell: {
|
88
|
+
'&[aria-selected="true"] + [aria-selected="true"] > button': {
|
89
|
+
"&::before": {
|
90
|
+
content: '""',
|
91
|
+
display: "block",
|
92
|
+
height: "100%",
|
93
|
+
position: "absolute",
|
94
|
+
left: "-50%",
|
95
|
+
top: 0,
|
96
|
+
bottom: 0,
|
97
|
+
zIndex: -1,
|
98
|
+
backgroundColor: "brand.surface",
|
99
|
+
},
|
100
|
+
},
|
101
|
+
},
|
102
|
+
dateCell: {
|
103
|
+
color: "core.text",
|
104
|
+
borderRadius: "xl",
|
105
|
+
position: "relative",
|
106
|
+
transition: ".1s ease-in-out",
|
107
|
+
userSelect: "none",
|
108
|
+
width: [6, 7],
|
109
|
+
height: [6, 7],
|
110
|
+
transitionProperty: "common",
|
111
|
+
|
112
|
+
_hover: {
|
113
|
+
backgroundColor: "ghost.surface.hover",
|
114
|
+
},
|
115
|
+
_active: {
|
116
|
+
backgroundColor: "ghost.surface.active",
|
117
|
+
},
|
118
|
+
_disabled: {
|
119
|
+
backgroundColor: "surface.disabled",
|
120
|
+
color: "text.disabled",
|
121
|
+
pointerEvents: "none",
|
122
|
+
},
|
123
|
+
_selected: {
|
124
|
+
backgroundColor: "brand.surface",
|
125
|
+
color: "brand.text",
|
126
|
+
_active: {
|
127
|
+
backgroundColor: "brand.surface.active",
|
128
|
+
color: "brand.text",
|
129
|
+
},
|
130
|
+
},
|
131
|
+
"&[data-today]": {
|
132
|
+
outline: "1px solid",
|
133
|
+
outlineColor: "core.outline",
|
134
|
+
},
|
135
|
+
"&[data-unavailable]": {
|
136
|
+
pointerEvents: "none",
|
137
|
+
borderRadius: "xl",
|
138
|
+
backgroundColor: "surface.disabled",
|
139
|
+
color: "text.disabled",
|
140
|
+
},
|
141
|
+
},
|
142
|
+
},
|
143
|
+
variants: {
|
144
|
+
variant: {
|
145
|
+
core: {
|
146
|
+
wrapper: {
|
147
|
+
outline: "1px solid",
|
148
|
+
outlineColor: "core.outline",
|
149
|
+
backgroundColor: "core.surface",
|
150
|
+
|
151
|
+
_hover: {
|
152
|
+
outline: "2px solid",
|
153
|
+
|
154
|
+
outlineColor: "core.outline.hover",
|
155
|
+
_active: {
|
156
|
+
backgroundColor: "ghost.surface.active",
|
157
|
+
outline: "1px solid",
|
158
|
+
outlineColor: "core.outline",
|
159
|
+
},
|
160
|
+
},
|
161
|
+
_invalid: {
|
162
|
+
outline: "2px solid",
|
163
|
+
outlineColor: "outline.error",
|
164
|
+
},
|
165
|
+
},
|
166
|
+
},
|
167
|
+
floating: {
|
168
|
+
wrapper: {
|
169
|
+
backgroundColor: {
|
170
|
+
_light: "bg",
|
171
|
+
_dark: `color-mix(in srgb, white 10%, var(--spor-colors-bg))`,
|
172
|
+
},
|
173
|
+
outline: "1px solid",
|
174
|
+
outlineColor: "floating.outline",
|
175
|
+
boxShadow: "sm",
|
176
|
+
|
177
|
+
_hover: {
|
178
|
+
outline: "1px solid",
|
179
|
+
outlineColor: "floating.outline.hover",
|
180
|
+
_active: {
|
181
|
+
backgroundColor: "ghost.surface.active",
|
182
|
+
outline: "1px solid",
|
183
|
+
outlineColor: "core.outline",
|
184
|
+
},
|
185
|
+
},
|
186
|
+
_invalid: {
|
187
|
+
outline: "2px solid",
|
188
|
+
outlineColor: "outline.error",
|
189
|
+
},
|
190
|
+
},
|
191
|
+
},
|
192
|
+
ghost: {
|
193
|
+
wrapper: {
|
194
|
+
_hover: {
|
195
|
+
outline: "2px solid",
|
196
|
+
outlineColor: "core.outline.hover",
|
197
|
+
_active: {
|
198
|
+
backgroundColor: "ghost.surface.active",
|
199
|
+
outline: "1px solid",
|
200
|
+
outlineColor: "core.outline",
|
201
|
+
},
|
202
|
+
},
|
203
|
+
_invalid: {
|
204
|
+
outline: "2px solid",
|
205
|
+
outlineColor: "outline.error",
|
206
|
+
},
|
207
|
+
},
|
208
|
+
},
|
209
|
+
},
|
210
|
+
},
|
211
|
+
defaultVariants: {
|
212
|
+
variant: "core",
|
213
|
+
},
|
214
|
+
});
|
@@ -0,0 +1,221 @@
|
|
1
|
+
import { defineSlotRecipe } from "@chakra-ui/react";
|
2
|
+
import { dialogAnatomy } from "./anatomy";
|
3
|
+
|
4
|
+
export const dialogSlotRecipe = defineSlotRecipe({
|
5
|
+
slots: dialogAnatomy.keys(),
|
6
|
+
className: "spor-dialog",
|
7
|
+
base: {
|
8
|
+
backdrop: {
|
9
|
+
background: "blackAlpha.500",
|
10
|
+
position: "fixed",
|
11
|
+
left: 0,
|
12
|
+
top: 0,
|
13
|
+
width: "100vw",
|
14
|
+
height: "100dvh",
|
15
|
+
zIndex: "modal",
|
16
|
+
_open: {
|
17
|
+
animationName: "fade-in",
|
18
|
+
animationDuration: "slow",
|
19
|
+
},
|
20
|
+
_closed: {
|
21
|
+
animationName: "fade-out",
|
22
|
+
animationDuration: "moderate",
|
23
|
+
},
|
24
|
+
},
|
25
|
+
positioner: {
|
26
|
+
display: "flex",
|
27
|
+
width: "100vw",
|
28
|
+
height: "100dvh",
|
29
|
+
position: "fixed",
|
30
|
+
left: 0,
|
31
|
+
top: 0,
|
32
|
+
"--dialog-z-index": "zIndex.modal",
|
33
|
+
zIndex: "modal",
|
34
|
+
justifyContent: "center",
|
35
|
+
overscrollBehaviorY: "none",
|
36
|
+
},
|
37
|
+
content: {
|
38
|
+
display: "flex",
|
39
|
+
backgroundColor: "bg",
|
40
|
+
flexDirection: "column",
|
41
|
+
position: "relative",
|
42
|
+
width: "full",
|
43
|
+
outline: 0,
|
44
|
+
borderRadius: "lg",
|
45
|
+
marginY: "3.75rem",
|
46
|
+
textStyle: "sm",
|
47
|
+
boxShadow: "lg",
|
48
|
+
_open: {
|
49
|
+
animationDuration: "moderate",
|
50
|
+
},
|
51
|
+
_closed: {
|
52
|
+
animationDuration: "faster",
|
53
|
+
},
|
54
|
+
},
|
55
|
+
header: {
|
56
|
+
display: "flex",
|
57
|
+
alignItems: "center",
|
58
|
+
justifyContent: "space-between",
|
59
|
+
flex: 0,
|
60
|
+
paddingX: "6",
|
61
|
+
paddingTop: "6",
|
62
|
+
paddingBottom: "2",
|
63
|
+
},
|
64
|
+
body: {
|
65
|
+
flex: "1",
|
66
|
+
paddingX: "6",
|
67
|
+
paddingTop: "2",
|
68
|
+
paddingBottom: "4",
|
69
|
+
fontSize: ["xs", null, null, "sm"],
|
70
|
+
},
|
71
|
+
footer: {
|
72
|
+
display: "flex",
|
73
|
+
alignItems: "center",
|
74
|
+
justifyContent: "flex-end",
|
75
|
+
gap: "3",
|
76
|
+
paddingX: "6",
|
77
|
+
paddingTop: "2",
|
78
|
+
paddingBottom: "4",
|
79
|
+
},
|
80
|
+
title: {
|
81
|
+
fontSize: ["md", null, null, "lg"],
|
82
|
+
fontFamily: "heading",
|
83
|
+
fontWeight: "medium",
|
84
|
+
},
|
85
|
+
closeTrigger: {
|
86
|
+
position: "absolute",
|
87
|
+
top: "2",
|
88
|
+
insetEnd: "2",
|
89
|
+
"& svg": {
|
90
|
+
color: "icon",
|
91
|
+
},
|
92
|
+
},
|
93
|
+
},
|
94
|
+
|
95
|
+
variants: {
|
96
|
+
placement: {
|
97
|
+
center: {
|
98
|
+
positioner: {
|
99
|
+
alignItems: "center",
|
100
|
+
},
|
101
|
+
content: {
|
102
|
+
marginX: "auto",
|
103
|
+
},
|
104
|
+
},
|
105
|
+
top: {
|
106
|
+
positioner: {
|
107
|
+
alignItems: "flex-start",
|
108
|
+
},
|
109
|
+
content: {
|
110
|
+
marginX: "auto",
|
111
|
+
},
|
112
|
+
},
|
113
|
+
bottom: {
|
114
|
+
positioner: {
|
115
|
+
alignItems: "flex-end",
|
116
|
+
},
|
117
|
+
content: {
|
118
|
+
marginX: "auto",
|
119
|
+
},
|
120
|
+
},
|
121
|
+
},
|
122
|
+
|
123
|
+
scrollBehavior: {
|
124
|
+
inside: {
|
125
|
+
positioner: {
|
126
|
+
overflow: "hidden",
|
127
|
+
},
|
128
|
+
content: {
|
129
|
+
maxHeight: "calc(100% - 7.5rem)",
|
130
|
+
},
|
131
|
+
body: {
|
132
|
+
overflow: "auto",
|
133
|
+
},
|
134
|
+
},
|
135
|
+
outside: {
|
136
|
+
positioner: {
|
137
|
+
overflow: "auto",
|
138
|
+
pointerEvents: "auto",
|
139
|
+
},
|
140
|
+
},
|
141
|
+
},
|
142
|
+
|
143
|
+
size: {
|
144
|
+
xs: {
|
145
|
+
content: {
|
146
|
+
maxWidth: "sm",
|
147
|
+
},
|
148
|
+
},
|
149
|
+
sm: {
|
150
|
+
content: {
|
151
|
+
maxWidth: "md",
|
152
|
+
},
|
153
|
+
},
|
154
|
+
md: {
|
155
|
+
content: {
|
156
|
+
maxWidth: "lg",
|
157
|
+
},
|
158
|
+
},
|
159
|
+
lg: {
|
160
|
+
content: {
|
161
|
+
maxWidth: "2xl",
|
162
|
+
},
|
163
|
+
},
|
164
|
+
xl: {
|
165
|
+
content: {
|
166
|
+
maxWidth: "4xl",
|
167
|
+
},
|
168
|
+
},
|
169
|
+
cover: {
|
170
|
+
positioner: {
|
171
|
+
padding: "10",
|
172
|
+
},
|
173
|
+
content: {
|
174
|
+
width: "100%",
|
175
|
+
height: "100%",
|
176
|
+
"--dialog-margin": "0",
|
177
|
+
},
|
178
|
+
},
|
179
|
+
},
|
180
|
+
|
181
|
+
motionPreset: {
|
182
|
+
scale: {
|
183
|
+
content: {
|
184
|
+
_open: { animationName: "scale-in, fade-in" },
|
185
|
+
_closed: { animationName: "scale-out, fade-out" },
|
186
|
+
},
|
187
|
+
},
|
188
|
+
"slide-in-bottom": {
|
189
|
+
content: {
|
190
|
+
_open: { animationName: "slide-from-bottom, fade-in" },
|
191
|
+
_closed: { animationName: "slide-to-bottom, fade-out" },
|
192
|
+
},
|
193
|
+
},
|
194
|
+
"slide-in-top": {
|
195
|
+
content: {
|
196
|
+
_open: { animationName: "slide-from-top, fade-in" },
|
197
|
+
_closed: { animationName: "slide-to-top, fade-out" },
|
198
|
+
},
|
199
|
+
},
|
200
|
+
"slide-in-left": {
|
201
|
+
content: {
|
202
|
+
_open: { animationName: "slide-from-left, fade-in" },
|
203
|
+
_closed: { animationName: "slide-to-left, fade-out" },
|
204
|
+
},
|
205
|
+
},
|
206
|
+
"slide-in-right": {
|
207
|
+
content: {
|
208
|
+
_open: { animationName: "slide-from-right, fade-in" },
|
209
|
+
_closed: { animationName: "slide-to-right, fade-out" },
|
210
|
+
},
|
211
|
+
},
|
212
|
+
none: {},
|
213
|
+
},
|
214
|
+
},
|
215
|
+
defaultVariants: {
|
216
|
+
size: "md",
|
217
|
+
scrollBehavior: "outside",
|
218
|
+
placement: "top",
|
219
|
+
motionPreset: "scale",
|
220
|
+
},
|
221
|
+
});
|
@@ -0,0 +1,205 @@
|
|
1
|
+
import { defineSlotRecipe } from "@chakra-ui/react";
|
2
|
+
import { drawerAnatomy } from "./anatomy";
|
3
|
+
|
4
|
+
export const drawerSlotRecipe = defineSlotRecipe({
|
5
|
+
slots: drawerAnatomy.keys(),
|
6
|
+
className: "spor-drawer",
|
7
|
+
base: {
|
8
|
+
backdrop: {
|
9
|
+
bg: "blackAlpha.500",
|
10
|
+
position: "fixed",
|
11
|
+
insetInlineStart: 0,
|
12
|
+
top: 0,
|
13
|
+
width: "100vw",
|
14
|
+
height: "100dvh",
|
15
|
+
zIndex: "modal",
|
16
|
+
_open: {
|
17
|
+
animationName: "fade-in",
|
18
|
+
animationDuration: "slow",
|
19
|
+
},
|
20
|
+
_closed: {
|
21
|
+
animationName: "fade-out",
|
22
|
+
animationDuration: "slow",
|
23
|
+
},
|
24
|
+
},
|
25
|
+
positioner: {
|
26
|
+
display: "flex",
|
27
|
+
width: "100vw",
|
28
|
+
height: "100dvh",
|
29
|
+
position: "fixed",
|
30
|
+
insetInlineStart: 0,
|
31
|
+
top: 0,
|
32
|
+
zIndex: "modal",
|
33
|
+
overscrollBehaviorY: "none",
|
34
|
+
},
|
35
|
+
content: {
|
36
|
+
display: "flex",
|
37
|
+
flexDirection: "column",
|
38
|
+
background: "bg",
|
39
|
+
position: "relative",
|
40
|
+
width: "100%",
|
41
|
+
outline: 0,
|
42
|
+
zIndex: "modal",
|
43
|
+
maxHeight: "100dvh",
|
44
|
+
color: "inherit",
|
45
|
+
boxShadow: "lg",
|
46
|
+
minHeight: ["50vh", null, null, "auto"],
|
47
|
+
_open: {
|
48
|
+
animationDuration: "slowest",
|
49
|
+
animationTimingFunction: "ease-in-smooth",
|
50
|
+
},
|
51
|
+
_closed: {
|
52
|
+
animationDuration: "slower",
|
53
|
+
animationTimingFunction: "ease-in-smooth",
|
54
|
+
},
|
55
|
+
},
|
56
|
+
header: {
|
57
|
+
display: "flex",
|
58
|
+
alignItems: "center",
|
59
|
+
justifyContent: "space-between",
|
60
|
+
paddingX: "5",
|
61
|
+
paddingBottom: "1",
|
62
|
+
},
|
63
|
+
body: {
|
64
|
+
paddingX: "5",
|
65
|
+
paddingY: ["1", null, null, "2"],
|
66
|
+
flex: "1",
|
67
|
+
overflow: "auto",
|
68
|
+
fontSize: ["xs", null, null, "sm"],
|
69
|
+
minHeight: ["12", null, null, "auto"],
|
70
|
+
},
|
71
|
+
footer: {
|
72
|
+
display: "flex",
|
73
|
+
alignItems: "center",
|
74
|
+
justifyContent: "flex-end",
|
75
|
+
gap: "3",
|
76
|
+
paddingX: "5",
|
77
|
+
paddingTop: "2",
|
78
|
+
},
|
79
|
+
title: {
|
80
|
+
fontSize: ["sm", null, null, "md"],
|
81
|
+
fontWeight: "semibold",
|
82
|
+
textAlign: "left",
|
83
|
+
},
|
84
|
+
closeTrigger: {
|
85
|
+
position: "absolute",
|
86
|
+
top: "2",
|
87
|
+
insetEnd: "2",
|
88
|
+
},
|
89
|
+
},
|
90
|
+
variants: {
|
91
|
+
size: {
|
92
|
+
xs: {
|
93
|
+
content: {
|
94
|
+
width: "15rem",
|
95
|
+
},
|
96
|
+
},
|
97
|
+
sm: {
|
98
|
+
content: {
|
99
|
+
width: "25rem",
|
100
|
+
},
|
101
|
+
},
|
102
|
+
md: {
|
103
|
+
content: {
|
104
|
+
width: "40rem",
|
105
|
+
},
|
106
|
+
},
|
107
|
+
lg: {
|
108
|
+
content: {
|
109
|
+
width: "56rem",
|
110
|
+
},
|
111
|
+
},
|
112
|
+
xl: {
|
113
|
+
content: {
|
114
|
+
width: "68rem",
|
115
|
+
},
|
116
|
+
},
|
117
|
+
full: {
|
118
|
+
content: {
|
119
|
+
width: "100vw",
|
120
|
+
height: "100vh",
|
121
|
+
borderRadius: "0 !important",
|
122
|
+
paddingBottom: "4",
|
123
|
+
},
|
124
|
+
closeTrigger: {
|
125
|
+
position: "relative",
|
126
|
+
},
|
127
|
+
title: {
|
128
|
+
textAlign: "center",
|
129
|
+
},
|
130
|
+
},
|
131
|
+
},
|
132
|
+
|
133
|
+
placement: {
|
134
|
+
start: {
|
135
|
+
positioner: {
|
136
|
+
justifyContent: "flex-start",
|
137
|
+
},
|
138
|
+
content: {
|
139
|
+
paddingTop: "4",
|
140
|
+
_open: {
|
141
|
+
animationName: {
|
142
|
+
base: "slide-from-left-full, fade-in",
|
143
|
+
_rtl: "slide-from-right-full, fade-in",
|
144
|
+
},
|
145
|
+
},
|
146
|
+
_closed: {
|
147
|
+
animationName: {
|
148
|
+
base: "slide-to-left-full, fade-out",
|
149
|
+
_rtl: "slide-to-right-full, fade-out",
|
150
|
+
},
|
151
|
+
},
|
152
|
+
},
|
153
|
+
},
|
154
|
+
|
155
|
+
end: {
|
156
|
+
positioner: {
|
157
|
+
justifyContent: "flex-end",
|
158
|
+
},
|
159
|
+
content: {
|
160
|
+
paddingTop: "4",
|
161
|
+
_open: {
|
162
|
+
animationName: {
|
163
|
+
base: "slide-from-right-full, fade-in",
|
164
|
+
_rtl: "slide-from-left-full, fade-in",
|
165
|
+
},
|
166
|
+
},
|
167
|
+
_closed: {
|
168
|
+
animationName: {
|
169
|
+
base: "slide-to-right-full, fade-out",
|
170
|
+
_rtl: "slide-to-right-full, fade-out",
|
171
|
+
},
|
172
|
+
},
|
173
|
+
},
|
174
|
+
},
|
175
|
+
|
176
|
+
top: {
|
177
|
+
positioner: {
|
178
|
+
alignItems: "flex-start",
|
179
|
+
},
|
180
|
+
content: {
|
181
|
+
maxW: "100%",
|
182
|
+
marginX: "auto",
|
183
|
+
paddingTop: "4",
|
184
|
+
borderBottomRadius: "lg",
|
185
|
+
_open: { animationName: "slide-from-top-full, fade-in" },
|
186
|
+
_closed: { animationName: "slide-to-top-full, fade-out" },
|
187
|
+
},
|
188
|
+
},
|
189
|
+
|
190
|
+
bottom: {
|
191
|
+
positioner: {
|
192
|
+
alignItems: "flex-end",
|
193
|
+
},
|
194
|
+
content: {
|
195
|
+
maxW: "100%",
|
196
|
+
marginX: "auto",
|
197
|
+
paddingBottom: "4",
|
198
|
+
borderTopRadius: "lg",
|
199
|
+
_open: { animationName: "slide-from-bottom-full, fade-in" },
|
200
|
+
_closed: { animationName: "slide-to-bottom-full, fade-out" },
|
201
|
+
},
|
202
|
+
},
|
203
|
+
},
|
204
|
+
},
|
205
|
+
});
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import { defineSlotRecipe } from "@chakra-ui/react";
|
2
|
+
import { fieldAnatomy } from "./anatomy";
|
3
|
+
|
4
|
+
export const fieldSlotRecipe = defineSlotRecipe({
|
5
|
+
className: "spor-field",
|
6
|
+
slots: fieldAnatomy.keys(),
|
7
|
+
base: {
|
8
|
+
root: {
|
9
|
+
display: "flex",
|
10
|
+
width: "100%",
|
11
|
+
position: "relative",
|
12
|
+
flexDirection: "column",
|
13
|
+
},
|
14
|
+
label: {
|
15
|
+
/* For when input is filled */
|
16
|
+
pos: "absolute",
|
17
|
+
paddingX: 3,
|
18
|
+
top: "0.3rem",
|
19
|
+
fontWeight: "normal",
|
20
|
+
fontSize: ["mobile.xs", "desktop.xs"],
|
21
|
+
color: "text",
|
22
|
+
pointerEvents: "none",
|
23
|
+
transition: "position",
|
24
|
+
zIndex: "docked",
|
25
|
+
_peerPlaceholderShown: {
|
26
|
+
/* For when input is not in focus */
|
27
|
+
top: "0.9rem",
|
28
|
+
color: "text",
|
29
|
+
fontSize: ["mobile.sm", "desktop.sm"],
|
30
|
+
},
|
31
|
+
_peerFocusVisible: {
|
32
|
+
/* For when input is in focus */
|
33
|
+
fontSize: ["mobile.xs", "desktop.xs"],
|
34
|
+
color: "text",
|
35
|
+
top: "0.3rem",
|
36
|
+
},
|
37
|
+
_disabled: {
|
38
|
+
opacity: 0.4,
|
39
|
+
},
|
40
|
+
},
|
41
|
+
requiredIndicator: {
|
42
|
+
marginStart: 1,
|
43
|
+
color: "brightRed",
|
44
|
+
},
|
45
|
+
helperText: {
|
46
|
+
marginTop: 2,
|
47
|
+
color: "text.tertiary",
|
48
|
+
lineHeight: "normal",
|
49
|
+
fontSize: "sm",
|
50
|
+
},
|
51
|
+
errorText: {
|
52
|
+
borderRadius: "xs",
|
53
|
+
backgroundColor: "lightRed",
|
54
|
+
color: "darkGrey",
|
55
|
+
paddingX: 1.5,
|
56
|
+
paddingY: 1,
|
57
|
+
textStyle: "xs",
|
58
|
+
width: "fit-content",
|
59
|
+
position: "absolute",
|
60
|
+
bottom: -4,
|
61
|
+
left: 3,
|
62
|
+
zIndex: "dropdown",
|
63
|
+
maxWidth: "50ch",
|
64
|
+
_after: {
|
65
|
+
content: "''",
|
66
|
+
position: "absolute",
|
67
|
+
marginTop: "-0.45em",
|
68
|
+
left: "1em",
|
69
|
+
width: 0,
|
70
|
+
height: 0,
|
71
|
+
transform: "rotate(45deg)",
|
72
|
+
borderLeft: "0.5em solid transparent",
|
73
|
+
borderRight: "0.5em solid transparent",
|
74
|
+
borderBottom: "0.5em solid",
|
75
|
+
borderColor: "lightRed",
|
76
|
+
},
|
77
|
+
},
|
78
|
+
},
|
79
|
+
});
|