@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
@@ -1,95 +0,0 @@
|
|
1
|
-
import { modalAnatomy as parts } from "@chakra-ui/anatomy";
|
2
|
-
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import { type PartsStyleObject } from "@chakra-ui/theme-tools";
|
4
|
-
import { baseText } from "../utils/base-utils";
|
5
|
-
import { bg } from "../utils/bg-utils";
|
6
|
-
|
7
|
-
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
8
|
-
|
9
|
-
const config = helpers.defineMultiStyleConfig({
|
10
|
-
baseStyle: (props) => ({
|
11
|
-
overlay: {
|
12
|
-
backgroundColor: "blackAlpha.600",
|
13
|
-
zIndex: "modal",
|
14
|
-
color: "red",
|
15
|
-
},
|
16
|
-
dialogContainer: {
|
17
|
-
display: "flex",
|
18
|
-
zIndex: "modal",
|
19
|
-
justifyContent: "center",
|
20
|
-
alignItems: props.isCentered ? "center" : "flex-start",
|
21
|
-
overflow: props.scrollBehavior === "inside" ? "hidden" : "auto",
|
22
|
-
},
|
23
|
-
dialog: {
|
24
|
-
...bg("default", props),
|
25
|
-
...baseText("default", props),
|
26
|
-
zIndex: "modal",
|
27
|
-
maxHeight:
|
28
|
-
props.scrollBehavior === "inside" ? "calc(100% - 7.5rem)" : undefined,
|
29
|
-
boxShadow: "md",
|
30
|
-
},
|
31
|
-
header: {
|
32
|
-
paddingX: 3,
|
33
|
-
paddingTop: 6,
|
34
|
-
paddingBottom: 2,
|
35
|
-
fontWeight: "bold",
|
36
|
-
fontFamily: "body",
|
37
|
-
},
|
38
|
-
closeButton: {
|
39
|
-
position: "absolute",
|
40
|
-
top: 3,
|
41
|
-
insetEnd: 3,
|
42
|
-
zIndex: "modal",
|
43
|
-
},
|
44
|
-
body: {
|
45
|
-
paddingX: 3,
|
46
|
-
paddingBottom: 6,
|
47
|
-
flex: 1,
|
48
|
-
overflow: props.scrollBehavior === "inside" ? "auto" : undefined,
|
49
|
-
},
|
50
|
-
footer: {
|
51
|
-
paddingX: 3,
|
52
|
-
paddingBottom: 3,
|
53
|
-
},
|
54
|
-
}),
|
55
|
-
sizes: {
|
56
|
-
xs: getSize("xs"),
|
57
|
-
sm: getSize("sm"),
|
58
|
-
md: getSize("md"),
|
59
|
-
lg: getSize("lg"),
|
60
|
-
xl: getSize("xl"),
|
61
|
-
"2xl": getSize("2xl"),
|
62
|
-
"3xl": getSize("3xl"),
|
63
|
-
"4xl": getSize("4xl"),
|
64
|
-
"5xl": getSize("5xl"),
|
65
|
-
"6xl": getSize("6xl"),
|
66
|
-
full: getSize("full"),
|
67
|
-
},
|
68
|
-
defaultProps: {
|
69
|
-
size: "md",
|
70
|
-
},
|
71
|
-
});
|
72
|
-
|
73
|
-
/**
|
74
|
-
* Since the `maxWidth` prop references theme.sizes internally,
|
75
|
-
* we can leverage that to size our modals.
|
76
|
-
*/
|
77
|
-
function getSize(value: string): PartsStyleObject<typeof parts> {
|
78
|
-
if (value === "full") {
|
79
|
-
return {
|
80
|
-
dialog: {
|
81
|
-
maxWidth: "100vw",
|
82
|
-
minHeight: "100vh",
|
83
|
-
"@supports(min-height: -webkit-fill-available)": {
|
84
|
-
minHeight: "-webkit-fill-available",
|
85
|
-
},
|
86
|
-
marginY: 0,
|
87
|
-
},
|
88
|
-
};
|
89
|
-
}
|
90
|
-
return {
|
91
|
-
dialog: { maxWidth: value },
|
92
|
-
};
|
93
|
-
}
|
94
|
-
|
95
|
-
export default config;
|
@@ -1,109 +0,0 @@
|
|
1
|
-
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
2
|
-
import { anatomy, StyleFunctionProps } from "@chakra-ui/theme-tools";
|
3
|
-
|
4
|
-
import { accentBackground, accentText } from "../utils/accent-utils";
|
5
|
-
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
6
|
-
import { brandBackground, brandText } from "../utils/brand-utils";
|
7
|
-
import { focusVisibleStyles } from "../utils/focus-utils";
|
8
|
-
import { surface } from "../utils/surface-utils";
|
9
|
-
|
10
|
-
const parts = anatomy("fab").parts("container", "icon", "text");
|
11
|
-
|
12
|
-
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
13
|
-
const config = helpers.defineMultiStyleConfig({
|
14
|
-
baseStyle: (props) => ({
|
15
|
-
container: {
|
16
|
-
display: "flex",
|
17
|
-
alignItems: "center",
|
18
|
-
paddingY: 2,
|
19
|
-
paddingLeft: 2,
|
20
|
-
paddingRight: props.isTextVisible ? 3 : 2,
|
21
|
-
cursor: "pointer",
|
22
|
-
overflowX: "hidden",
|
23
|
-
whiteSpace: "nowrap",
|
24
|
-
borderRadius: "xl",
|
25
|
-
boxShadow: "md",
|
26
|
-
transitionDuration: "fast",
|
27
|
-
transitionProperty: "common",
|
28
|
-
position: "fixed",
|
29
|
-
zIndex: "sticky",
|
30
|
-
...getPositionProps(props),
|
31
|
-
...focusVisibleStyles(props),
|
32
|
-
_disabled: {
|
33
|
-
...surface("disabled", props),
|
34
|
-
...baseText("disabled", props),
|
35
|
-
pointerEvents: "none",
|
36
|
-
},
|
37
|
-
},
|
38
|
-
icon: {
|
39
|
-
marginRight: props.isTextVisible ? 1 : 0,
|
40
|
-
},
|
41
|
-
text: {
|
42
|
-
display: "flex",
|
43
|
-
flex: "none",
|
44
|
-
alignItems: "center",
|
45
|
-
fontWeight: "bold",
|
46
|
-
textStyle: "sm",
|
47
|
-
},
|
48
|
-
}),
|
49
|
-
variants: {
|
50
|
-
brand: (props) => ({
|
51
|
-
container: {
|
52
|
-
...brandBackground("default", props),
|
53
|
-
...brandText("default", props),
|
54
|
-
_hover: {
|
55
|
-
...brandBackground("hover", props),
|
56
|
-
},
|
57
|
-
_active: {
|
58
|
-
...brandBackground("active", props),
|
59
|
-
},
|
60
|
-
},
|
61
|
-
}),
|
62
|
-
base: (props) => ({
|
63
|
-
container: {
|
64
|
-
...baseBackground("default", props),
|
65
|
-
...baseBorder("default", props),
|
66
|
-
...baseText("default", props),
|
67
|
-
_hover: {
|
68
|
-
...baseBackground("hover", props),
|
69
|
-
...baseBorder("hover", props),
|
70
|
-
},
|
71
|
-
_active: {
|
72
|
-
...baseBorder("default", props),
|
73
|
-
...baseBackground("active", props),
|
74
|
-
},
|
75
|
-
},
|
76
|
-
}),
|
77
|
-
accent: (props) => ({
|
78
|
-
container: {
|
79
|
-
...accentBackground("default", props),
|
80
|
-
...accentText("default", props),
|
81
|
-
_hover: {
|
82
|
-
...accentBackground("hover", props),
|
83
|
-
...accentText("default", props),
|
84
|
-
},
|
85
|
-
_active: {
|
86
|
-
...accentBackground("active", props),
|
87
|
-
},
|
88
|
-
},
|
89
|
-
}),
|
90
|
-
},
|
91
|
-
defaultProps: {
|
92
|
-
variant: "brand",
|
93
|
-
},
|
94
|
-
});
|
95
|
-
|
96
|
-
export default config;
|
97
|
-
|
98
|
-
const getPositionProps = (props: StyleFunctionProps) => {
|
99
|
-
switch (props.placement) {
|
100
|
-
case "top left":
|
101
|
-
return { top: "1em", left: "1em" };
|
102
|
-
case "top right":
|
103
|
-
return { top: "1em", right: "1em" };
|
104
|
-
case "bottom left":
|
105
|
-
return { bottom: "1em", left: "1em" };
|
106
|
-
case "bottom right":
|
107
|
-
return { bottom: "1em", right: "1em" };
|
108
|
-
}
|
109
|
-
};
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { defineStyleConfig } from "@chakra-ui/react";
|
2
|
-
|
3
|
-
const config = defineStyleConfig({
|
4
|
-
baseStyle: {
|
5
|
-
fontSize: "mobile.sm",
|
6
|
-
marginEnd: 3,
|
7
|
-
marginBottom: 2,
|
8
|
-
transitionProperty: "common",
|
9
|
-
transitionDuration: "normal",
|
10
|
-
opacity: 1,
|
11
|
-
_disabled: {
|
12
|
-
opacity: 0.4,
|
13
|
-
},
|
14
|
-
},
|
15
|
-
});
|
16
|
-
|
17
|
-
export default config;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import { formAnatomy as parts } from "@chakra-ui/anatomy";
|
2
|
-
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import { mode } from "@chakra-ui/theme-tools";
|
4
|
-
|
5
|
-
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
6
|
-
|
7
|
-
const config = helpers.defineMultiStyleConfig({
|
8
|
-
baseStyle: (props) => ({
|
9
|
-
container: {
|
10
|
-
width: "100%",
|
11
|
-
position: "relative",
|
12
|
-
transitionProperty: "common",
|
13
|
-
transitionDuration: "fast",
|
14
|
-
},
|
15
|
-
requiredIndicator: {
|
16
|
-
marginStart: 1,
|
17
|
-
color: mode("brightRed", "lightRed")(props),
|
18
|
-
},
|
19
|
-
helperText: {
|
20
|
-
marginTop: 2,
|
21
|
-
color: mode("dimGrey", "whiteAlpha.600")(props),
|
22
|
-
lineHeight: "normal",
|
23
|
-
fontSize: "sm",
|
24
|
-
},
|
25
|
-
}),
|
26
|
-
});
|
27
|
-
export default config;
|
@@ -1,45 +0,0 @@
|
|
1
|
-
export { default as Accordion } from "./accordion";
|
2
|
-
export { default as Alert } from "./alert";
|
3
|
-
export { default as AlertExpandable } from "./alert-expandable";
|
4
|
-
export { default as AlertService } from "./alert-service";
|
5
|
-
export { default as Badge } from "./badge";
|
6
|
-
export { default as Breadcrumb } from "./breadcrumb";
|
7
|
-
export { default as Button } from "./button";
|
8
|
-
export { default as CardSelect } from "./card-select";
|
9
|
-
export { default as Checkbox } from "./checkbox";
|
10
|
-
export { default as ChoiceChip } from "./choice-chip";
|
11
|
-
export { default as CloseButton } from "./close-button";
|
12
|
-
export { default as Code } from "./code";
|
13
|
-
export { default as Datepicker } from "./datepicker";
|
14
|
-
export { default as Divider } from "./divider";
|
15
|
-
export { default as Drawer } from "./drawer";
|
16
|
-
export { default as FloatingActionButton } from "./fab";
|
17
|
-
export { default as Form } from "./form";
|
18
|
-
export { default as FormLabel } from "./form-label";
|
19
|
-
export { default as InfoSelect } from "./info-select";
|
20
|
-
export { default as InfoTag } from "./info-tag";
|
21
|
-
export { default as Input } from "./input";
|
22
|
-
export { default as LineIcon } from "./line-icon";
|
23
|
-
export { default as Link } from "./link";
|
24
|
-
export { default as List } from "./list";
|
25
|
-
export { default as ListBox } from "./listbox";
|
26
|
-
export { default as MediaControllerButton } from "./media-controller-button";
|
27
|
-
export { default as Modal } from "./modal";
|
28
|
-
export { default as NumericStepper } from "./numeric-stepper";
|
29
|
-
export { default as Pagination } from "./pagination";
|
30
|
-
export { default as Popover } from "./popover";
|
31
|
-
export { default as ProgressBar } from "./progress-bar";
|
32
|
-
export { default as ProgressIndicator } from "./progress-indicator";
|
33
|
-
export { default as RadioCard } from "./radio-card";
|
34
|
-
export { default as Radio } from "./radio";
|
35
|
-
export { default as Select } from "./select";
|
36
|
-
export { default as Skeleton } from "./skeleton";
|
37
|
-
export { default as Stepper } from "./stepper";
|
38
|
-
export { default as Switch } from "./switch";
|
39
|
-
export { default as Table } from "./table";
|
40
|
-
export { default as Tabs } from "./tabs";
|
41
|
-
export { default as Textarea } from "./textarea";
|
42
|
-
export { default as Toast } from "./toast";
|
43
|
-
export { default as StaticCard } from "./static-card";
|
44
|
-
export { default as PressableCard } from "./pressable-card";
|
45
|
-
export { default as TravelTag } from "./travel-tag";
|
@@ -1,85 +0,0 @@
|
|
1
|
-
import { anatomy } from "@chakra-ui/anatomy";
|
2
|
-
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
4
|
-
import { floatingBackground, floatingBorder } from "../utils/floating-utils";
|
5
|
-
import { focusVisibleStyles } from "../utils/focus-utils";
|
6
|
-
import { srOnly } from "../utils/sr-utils";
|
7
|
-
|
8
|
-
const parts = anatomy("InfoSelect").parts(
|
9
|
-
"container",
|
10
|
-
"label",
|
11
|
-
"button",
|
12
|
-
"arrowIcon",
|
13
|
-
);
|
14
|
-
|
15
|
-
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
16
|
-
|
17
|
-
const config = helpers.defineMultiStyleConfig({
|
18
|
-
baseStyle: (props) => ({
|
19
|
-
container: {},
|
20
|
-
label: {
|
21
|
-
position: "relative",
|
22
|
-
fontSize: ["mobile.xs", "desktop.sm"],
|
23
|
-
marginTop: props.hasChosenValue ? 2 : 0,
|
24
|
-
...(props.isLabelSrOnly ? srOnly : {}),
|
25
|
-
},
|
26
|
-
innerButton: {
|
27
|
-
display: "flex",
|
28
|
-
flexDir: "column",
|
29
|
-
alignItems: "start",
|
30
|
-
justifyContent: "start",
|
31
|
-
},
|
32
|
-
button: {
|
33
|
-
display: "flex",
|
34
|
-
appearance: "none",
|
35
|
-
width: "100%",
|
36
|
-
height: 8,
|
37
|
-
borderTopRadius: "sm",
|
38
|
-
borderBottomRadius: props.isOpen ? 0 : "sm",
|
39
|
-
paddingY: 1.5,
|
40
|
-
paddingX: 3,
|
41
|
-
justifyContent: "space-between",
|
42
|
-
alignItems: "center",
|
43
|
-
fontSize: "mobile.md",
|
44
|
-
...baseBorder("default", props),
|
45
|
-
_hover: {
|
46
|
-
...baseBorder("hover", props),
|
47
|
-
},
|
48
|
-
...focusVisibleStyles(props),
|
49
|
-
_disabled: {
|
50
|
-
pointerEvents: "none",
|
51
|
-
...baseText("disabled", props),
|
52
|
-
...baseBackground("disabled", props),
|
53
|
-
},
|
54
|
-
_active: {
|
55
|
-
...baseBackground("active", props),
|
56
|
-
},
|
57
|
-
_invalid: {
|
58
|
-
...baseBorder("invalid", props),
|
59
|
-
},
|
60
|
-
},
|
61
|
-
placeholder: {},
|
62
|
-
arrowIcon: {},
|
63
|
-
}),
|
64
|
-
variants: {
|
65
|
-
base: () => ({}),
|
66
|
-
floating: (props) => ({
|
67
|
-
button: {
|
68
|
-
...floatingBackground("default", props),
|
69
|
-
...floatingBorder("default", props),
|
70
|
-
_hover: {
|
71
|
-
...floatingBorder("hover", props),
|
72
|
-
...floatingBackground("hover", props),
|
73
|
-
},
|
74
|
-
_active: {
|
75
|
-
...floatingBorder("active", props),
|
76
|
-
...floatingBackground("active", props),
|
77
|
-
},
|
78
|
-
},
|
79
|
-
}),
|
80
|
-
},
|
81
|
-
defaultProps: {
|
82
|
-
variant: "base",
|
83
|
-
},
|
84
|
-
});
|
85
|
-
export default config;
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
2
|
-
import { anatomy, mode } from "@chakra-ui/theme-tools";
|
3
|
-
import travelTagStyles from "./travel-tag";
|
4
|
-
|
5
|
-
const parts = anatomy("info-tag").parts(
|
6
|
-
"container",
|
7
|
-
"iconContainer",
|
8
|
-
"icon",
|
9
|
-
"textContainer",
|
10
|
-
"title",
|
11
|
-
"description",
|
12
|
-
);
|
13
|
-
|
14
|
-
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
15
|
-
|
16
|
-
const config = helpers.defineMultiStyleConfig({
|
17
|
-
baseStyle: (props) => ({
|
18
|
-
...travelTagStyles.baseStyle!(props),
|
19
|
-
iconContainer: {
|
20
|
-
...travelTagStyles.baseStyle!(props).iconContainer,
|
21
|
-
padding: 1,
|
22
|
-
},
|
23
|
-
textContainer: {
|
24
|
-
color: mode("darkGrey", "white")(props),
|
25
|
-
},
|
26
|
-
}),
|
27
|
-
sizes: {
|
28
|
-
...travelTagStyles.sizes,
|
29
|
-
sm: {
|
30
|
-
...travelTagStyles.sizes!.sm,
|
31
|
-
iconContainer: {
|
32
|
-
borderRadius: "0.375rem",
|
33
|
-
},
|
34
|
-
},
|
35
|
-
md: {
|
36
|
-
...travelTagStyles.sizes!.md,
|
37
|
-
iconContainer: {
|
38
|
-
borderRadius: "0.375rem",
|
39
|
-
},
|
40
|
-
},
|
41
|
-
lg: {
|
42
|
-
...travelTagStyles.sizes!.lg,
|
43
|
-
iconContainer: {
|
44
|
-
borderRadius: "sm",
|
45
|
-
},
|
46
|
-
},
|
47
|
-
},
|
48
|
-
defaultProps: {
|
49
|
-
size: "md",
|
50
|
-
},
|
51
|
-
variants: {
|
52
|
-
walk: (props) => ({
|
53
|
-
iconContainer: {
|
54
|
-
backgroundColor: mode("white", "transparent")(props),
|
55
|
-
boxShadow: mode(
|
56
|
-
`${props.theme.shadows.md}, inset 0 0 0 2px ${props.theme.colors.black[200]}`,
|
57
|
-
`${props.theme.shadows.md}, inset 0 0 0 2px ${props.theme.colors.whiteAlpha[400]}`,
|
58
|
-
)(props),
|
59
|
-
},
|
60
|
-
}),
|
61
|
-
},
|
62
|
-
});
|
63
|
-
export default config;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import { inputAnatomy as parts } from "@chakra-ui/anatomy";
|
2
|
-
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import { inputBaseStyle, inputVariant } from "../utils/input-utils";
|
4
|
-
|
5
|
-
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
6
|
-
|
7
|
-
const config = helpers.defineMultiStyleConfig({
|
8
|
-
baseStyle: (props) => ({
|
9
|
-
...inputBaseStyle(props),
|
10
|
-
}),
|
11
|
-
variants: {
|
12
|
-
base: (props) => ({
|
13
|
-
field: {
|
14
|
-
...inputVariant("base", props),
|
15
|
-
},
|
16
|
-
}),
|
17
|
-
floating: (props) => ({
|
18
|
-
field: {
|
19
|
-
...inputVariant("floating", props),
|
20
|
-
},
|
21
|
-
}),
|
22
|
-
},
|
23
|
-
defaultProps: {
|
24
|
-
variant: "base",
|
25
|
-
},
|
26
|
-
});
|
27
|
-
|
28
|
-
export default config;
|
@@ -1,129 +0,0 @@
|
|
1
|
-
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
2
|
-
import { anatomy, mode } from "@chakra-ui/theme-tools";
|
3
|
-
|
4
|
-
const parts = anatomy("line-tag").parts("iconContainer", "icon");
|
5
|
-
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
6
|
-
|
7
|
-
const config = helpers.defineMultiStyleConfig({
|
8
|
-
baseStyle: {
|
9
|
-
iconContainer: {
|
10
|
-
display: "flex",
|
11
|
-
justifyContent: "center",
|
12
|
-
alignItems: "center",
|
13
|
-
},
|
14
|
-
icon: {
|
15
|
-
color: "white",
|
16
|
-
"[aria-disabled=true] &": {
|
17
|
-
color: mode("icon.disabled.light", "icon.disabled.dark"),
|
18
|
-
},
|
19
|
-
},
|
20
|
-
},
|
21
|
-
variants: {
|
22
|
-
"local-train": {
|
23
|
-
iconContainer: {
|
24
|
-
backgroundColor: "linjetag.lokaltog",
|
25
|
-
},
|
26
|
-
},
|
27
|
-
"region-train": {
|
28
|
-
iconContainer: {
|
29
|
-
backgroundColor: "linjetag.regiontog",
|
30
|
-
},
|
31
|
-
},
|
32
|
-
"region-express-train": {
|
33
|
-
iconContainer: {
|
34
|
-
backgroundColor: "linjetag.regionEkspress",
|
35
|
-
},
|
36
|
-
},
|
37
|
-
"long-distance-train": {
|
38
|
-
iconContainer: {
|
39
|
-
backgroundColor: "linjetag.fjerntog",
|
40
|
-
},
|
41
|
-
},
|
42
|
-
"airport-express-train": {
|
43
|
-
iconContainer: {
|
44
|
-
backgroundColor: "linjetag.flytog",
|
45
|
-
},
|
46
|
-
},
|
47
|
-
"vy-bus": {
|
48
|
-
iconContainer: {
|
49
|
-
backgroundColor: "linjetag.vyBuss",
|
50
|
-
},
|
51
|
-
},
|
52
|
-
"local-bus": {
|
53
|
-
iconContainer: {
|
54
|
-
backgroundColor: "linjetag.lokalbuss",
|
55
|
-
},
|
56
|
-
},
|
57
|
-
ferry: {
|
58
|
-
iconContainer: {
|
59
|
-
backgroundColor: "linjetag.ferge",
|
60
|
-
},
|
61
|
-
},
|
62
|
-
subway: {
|
63
|
-
iconContainer: {
|
64
|
-
backgroundColor: "linjetag.tbane",
|
65
|
-
},
|
66
|
-
},
|
67
|
-
tram: {
|
68
|
-
iconContainer: {
|
69
|
-
backgroundColor: "linjetag.trikk",
|
70
|
-
},
|
71
|
-
},
|
72
|
-
"alt-transport": {
|
73
|
-
iconContainer: {
|
74
|
-
backgroundColor: "linjetag.altTransport",
|
75
|
-
},
|
76
|
-
icon: {
|
77
|
-
color: "darkGrey",
|
78
|
-
"[aria-disabled=true] &": {
|
79
|
-
color: "white",
|
80
|
-
},
|
81
|
-
},
|
82
|
-
},
|
83
|
-
|
84
|
-
walk: (props) => ({
|
85
|
-
iconContainer: {
|
86
|
-
backgroundColor: "white",
|
87
|
-
borderWidth: 1,
|
88
|
-
borderStyle: "solid",
|
89
|
-
borderColor: "blackAlpha.200",
|
90
|
-
},
|
91
|
-
icon: {
|
92
|
-
color: mode("darkGrey", "white")(props),
|
93
|
-
"[aria-disabled=true] &": {
|
94
|
-
color: "osloGrey",
|
95
|
-
},
|
96
|
-
},
|
97
|
-
}),
|
98
|
-
custom: (props) => ({
|
99
|
-
iconContainer: {
|
100
|
-
backgroundColor: props.backgroundColor,
|
101
|
-
},
|
102
|
-
}),
|
103
|
-
},
|
104
|
-
sizes: {
|
105
|
-
sm: {
|
106
|
-
iconContainer: {
|
107
|
-
borderRadius: "0.5625rem",
|
108
|
-
padding: 1,
|
109
|
-
},
|
110
|
-
},
|
111
|
-
md: {
|
112
|
-
iconContainer: {
|
113
|
-
borderRadius: "0.5625rem",
|
114
|
-
padding: 1,
|
115
|
-
},
|
116
|
-
},
|
117
|
-
lg: {
|
118
|
-
iconContainer: {
|
119
|
-
borderRadius: "sm",
|
120
|
-
padding: 1,
|
121
|
-
},
|
122
|
-
},
|
123
|
-
},
|
124
|
-
defaultProps: {
|
125
|
-
size: "md",
|
126
|
-
},
|
127
|
-
});
|
128
|
-
|
129
|
-
export default config;
|
@@ -1,78 +0,0 @@
|
|
1
|
-
import { defineStyleConfig } from "@chakra-ui/react";
|
2
|
-
import { mode } from "@chakra-ui/theme-tools";
|
3
|
-
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
4
|
-
import { brandBackground, brandText } from "../utils/brand-utils";
|
5
|
-
import { focusVisibleStyles } from "../utils/focus-utils";
|
6
|
-
|
7
|
-
const config = defineStyleConfig({
|
8
|
-
baseStyle: (props) => ({
|
9
|
-
transitionProperty: "common",
|
10
|
-
transitionDuration: "fast",
|
11
|
-
transitionTimingFunction: "ease-out",
|
12
|
-
cursor: "pointer",
|
13
|
-
backgroundImage: "linear-gradient(currentColor, currentColor)",
|
14
|
-
backgroundSize: "100% 1px",
|
15
|
-
backgroundPosition: "0 100%",
|
16
|
-
backgroundRepeat: "no-repeat",
|
17
|
-
borderRadius: "none",
|
18
|
-
padding: "2px",
|
19
|
-
color: "inherit",
|
20
|
-
display: "inline",
|
21
|
-
position: "relative",
|
22
|
-
boxDecorationBreak: "clone",
|
23
|
-
|
24
|
-
"&:focus, &:focus-visible, &:active, &:hover": {
|
25
|
-
backgroundImage: "none",
|
26
|
-
backgroundSize: "100%",
|
27
|
-
outline: "none",
|
28
|
-
borderRadius: "xs",
|
29
|
-
},
|
30
|
-
|
31
|
-
...focusVisibleStyles(props),
|
32
|
-
|
33
|
-
svg: {
|
34
|
-
display: "inline-block",
|
35
|
-
width: "1.125em",
|
36
|
-
height: "1.125em",
|
37
|
-
position: "relative",
|
38
|
-
bottom: "-0.2em",
|
39
|
-
},
|
40
|
-
}),
|
41
|
-
variants: {
|
42
|
-
primary: (props) => ({
|
43
|
-
...baseText("default", props),
|
44
|
-
_hover: {
|
45
|
-
...brandText("hover", props),
|
46
|
-
...brandBackground("hover", props),
|
47
|
-
},
|
48
|
-
_active: {
|
49
|
-
...brandText("active", props),
|
50
|
-
...brandBackground("active", props),
|
51
|
-
},
|
52
|
-
}),
|
53
|
-
secondary: (props) => ({
|
54
|
-
backgroundImage: `linear-gradient(${mode(
|
55
|
-
"blackAlpha.400",
|
56
|
-
"whiteAlpha.400",
|
57
|
-
)(props)}, ${mode("blackAlpha.400", "whiteAlpha.400")(props)})`,
|
58
|
-
...baseText("default", props),
|
59
|
-
"&:focus, &:focus-visible, &:active, &:hover": {
|
60
|
-
outline: "1px solid",
|
61
|
-
},
|
62
|
-
...baseBackground("default", props),
|
63
|
-
_hover: {
|
64
|
-
...baseBorder("hover", props), // TODO: This is also weird
|
65
|
-
...baseBackground("hover", props),
|
66
|
-
outlineWidth: 1,
|
67
|
-
},
|
68
|
-
_active: {
|
69
|
-
...baseBackground("active", props),
|
70
|
-
},
|
71
|
-
}),
|
72
|
-
},
|
73
|
-
defaultProps: {
|
74
|
-
variant: "primary",
|
75
|
-
},
|
76
|
-
});
|
77
|
-
|
78
|
-
export default config;
|