@vygruppen/spor-react 13.4.0 → 13.4.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 +10 -10
- package/.turbo/turbo-postinstall.log +2 -2
- package/CHANGELOG.md +7 -0
- package/dist/index.cjs +24 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -56
- package/dist/index.d.ts +17 -56
- package/dist/index.mjs +24 -64
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/linjetag/InfoTag.tsx +4 -2
- package/src/linjetag/LineIcon.tsx +1 -1
- package/src/linjetag/TravelTag.tsx +4 -4
- package/src/linjetag/types.ts +4 -0
- package/src/theme/slot-recipes/travel-tag.ts +15 -58
package/package.json
CHANGED
package/src/linjetag/InfoTag.tsx
CHANGED
|
@@ -47,6 +47,8 @@ export const InfoTag = ({
|
|
|
47
47
|
size = "md",
|
|
48
48
|
title,
|
|
49
49
|
description,
|
|
50
|
+
descriptionProps,
|
|
51
|
+
titleProps,
|
|
50
52
|
...customProps
|
|
51
53
|
}: InfoTagProps) => {
|
|
52
54
|
const recipe = useSlotRecipe({ key: "infoTag" });
|
|
@@ -67,13 +69,13 @@ export const InfoTag = ({
|
|
|
67
69
|
/>
|
|
68
70
|
<Box css={styles.textContainer}>
|
|
69
71
|
{title && (
|
|
70
|
-
<Box as="span" css={styles.title}>
|
|
72
|
+
<Box as="span" css={styles.title} {...titleProps}>
|
|
71
73
|
{title}
|
|
72
74
|
</Box>
|
|
73
75
|
)}
|
|
74
76
|
{title && description && " "}
|
|
75
77
|
{description && (
|
|
76
|
-
<Box as="span" css={styles.description}>
|
|
78
|
+
<Box as="span" css={styles.description} {...descriptionProps}>
|
|
77
79
|
{description}
|
|
78
80
|
</Box>
|
|
79
81
|
)}
|
|
@@ -111,7 +111,7 @@ export const LineIcon = function LineIcon({
|
|
|
111
111
|
borderColor={variant === "walk" ? "outline.core" : "transparent"}
|
|
112
112
|
aria-label={label}
|
|
113
113
|
ref={ref}
|
|
114
|
-
className={clsx("light", rest.className)}
|
|
114
|
+
className={variant === "walk" ? undefined : clsx("light", rest.className)}
|
|
115
115
|
>
|
|
116
116
|
<LinjeTagIcon size={size} css={styles.icon} variant={getIconVariant()} />
|
|
117
117
|
</Box>
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
WarningFill18Icon,
|
|
15
15
|
WarningFill24Icon,
|
|
16
16
|
} from "@vygruppen/spor-icon-react";
|
|
17
|
-
import clsx from "clsx";
|
|
18
17
|
import { PropsWithChildren } from "react";
|
|
19
18
|
|
|
20
19
|
import { travelTagSlotRecipe } from "../theme/slot-recipes/travel-tag";
|
|
@@ -139,6 +138,8 @@ export const TravelTag = function TravelTag({
|
|
|
139
138
|
foregroundColor,
|
|
140
139
|
backgroundColor,
|
|
141
140
|
customIconVariant,
|
|
141
|
+
descriptionProps,
|
|
142
|
+
titleProps,
|
|
142
143
|
...rest
|
|
143
144
|
}: TravelTagProps & {
|
|
144
145
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -155,7 +156,6 @@ export const TravelTag = function TravelTag({
|
|
|
155
156
|
css={styles.container}
|
|
156
157
|
aria-disabled={disabled}
|
|
157
158
|
ref={ref}
|
|
158
|
-
className={clsx("light", rest.className)}
|
|
159
159
|
backgroundColor={backgroundColor}
|
|
160
160
|
{...rest}
|
|
161
161
|
>
|
|
@@ -172,13 +172,13 @@ export const TravelTag = function TravelTag({
|
|
|
172
172
|
/>
|
|
173
173
|
<Box css={styles.textContainer}>
|
|
174
174
|
{title && (
|
|
175
|
-
<Box as="span" css={styles.title}>
|
|
175
|
+
<Box as="span" css={styles.title} {...titleProps}>
|
|
176
176
|
{title}
|
|
177
177
|
</Box>
|
|
178
178
|
)}
|
|
179
179
|
{title && description && " "}
|
|
180
180
|
{description && (
|
|
181
|
-
<Box as="span" css={styles.description}>
|
|
181
|
+
<Box as="span" css={styles.description} {...descriptionProps}>
|
|
182
182
|
{description}
|
|
183
183
|
</Box>
|
|
184
184
|
)}
|
package/src/linjetag/types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { BoxProps } from "@chakra-ui/react";
|
|
2
|
+
|
|
1
3
|
export type Variant =
|
|
2
4
|
| "local-train"
|
|
3
5
|
| "region-train"
|
|
@@ -20,6 +22,8 @@ export type TagProps = VariantProps & {
|
|
|
20
22
|
size?: Size;
|
|
21
23
|
title: string;
|
|
22
24
|
description?: string;
|
|
25
|
+
descriptionProps?: BoxProps;
|
|
26
|
+
titleProps?: BoxProps;
|
|
23
27
|
};
|
|
24
28
|
|
|
25
29
|
type DefaultVariantProps = {
|
|
@@ -11,10 +11,7 @@ export const travelTagSlotRecipe = defineSlotRecipe({
|
|
|
11
11
|
display: "flex",
|
|
12
12
|
alignItems: "center",
|
|
13
13
|
padding: 0.5,
|
|
14
|
-
|
|
15
|
-
_disabled: {
|
|
16
|
-
background: "surface.disabled",
|
|
17
|
-
},
|
|
14
|
+
backgroundColor: "surface.disabled",
|
|
18
15
|
|
|
19
16
|
width: "fit-content",
|
|
20
17
|
transitionDuration: "fast",
|
|
@@ -79,62 +76,22 @@ export const travelTagSlotRecipe = defineSlotRecipe({
|
|
|
79
76
|
none: {},
|
|
80
77
|
},
|
|
81
78
|
variant: {
|
|
82
|
-
"local-train": {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
backgroundColor: "linjetag.regionEkspressLight",
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
"long-distance-train": {
|
|
98
|
-
container: {
|
|
99
|
-
backgroundColor: "linjetag.fjerntogLight",
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
"airport-express-train": {
|
|
103
|
-
container: {
|
|
104
|
-
backgroundColor: "linjetag.flytogLight",
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
"vy-bus": {
|
|
108
|
-
container: {
|
|
109
|
-
backgroundColor: "linjetag.vyBussLight",
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
"local-bus": {
|
|
113
|
-
container: {
|
|
114
|
-
backgroundColor: "linjetag.lokalbussLight",
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
ferry: {
|
|
118
|
-
container: {
|
|
119
|
-
backgroundColor: "linjetag.fergeLight",
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
subway: {
|
|
123
|
-
container: {
|
|
124
|
-
backgroundColor: "linjetag.tbaneLight",
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
tram: {
|
|
128
|
-
container: {
|
|
129
|
-
backgroundColor: "linjetag.trikkLight",
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
"alt-transport": {
|
|
79
|
+
"local-train": {},
|
|
80
|
+
"region-train": {},
|
|
81
|
+
"region-express-train": {},
|
|
82
|
+
"long-distance-train": {},
|
|
83
|
+
"airport-express-train": {},
|
|
84
|
+
"vy-bus": {},
|
|
85
|
+
"local-bus": {},
|
|
86
|
+
ferry: {},
|
|
87
|
+
subway: {},
|
|
88
|
+
tram: {},
|
|
89
|
+
"alt-transport": {},
|
|
90
|
+
walk: {
|
|
133
91
|
container: {
|
|
134
|
-
backgroundColor: "
|
|
92
|
+
backgroundColor: "none",
|
|
135
93
|
},
|
|
136
|
-
|
|
137
|
-
walk: {
|
|
94
|
+
|
|
138
95
|
textContainer: {
|
|
139
96
|
position: "absolute",
|
|
140
97
|
left: "0.875rem",
|