@vygruppen/spor-react 12.10.2 → 12.10.4
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 +12 -12
- package/.turbo/turbo-postinstall.log +1 -1
- package/CHANGELOG.md +15 -0
- package/dist/index.cjs +67 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.mjs +67 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/alert/Alert.tsx +1 -0
- package/src/datepicker/TimeField.tsx +7 -0
- package/src/datepicker/TimePicker.tsx +3 -0
- package/src/dialog/Drawer.tsx +6 -4
- package/src/dialog/types.ts +1 -0
- package/src/layout/RadioCard.tsx +2 -6
- package/src/linjetag/LineIcon.tsx +1 -1
- package/src/link/TextLink.tsx +18 -2
- package/src/theme/slot-recipes/drawer.ts +6 -6
- package/src/theme/slot-recipes/line-icon.ts +6 -0
- package/src/theme/slot-recipes/travel-tag.ts +2 -1
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vygruppen/spor-react",
|
3
3
|
"type": "module",
|
4
|
-
"version": "12.10.
|
4
|
+
"version": "12.10.4",
|
5
5
|
"exports": {
|
6
6
|
".": {
|
7
7
|
"types": "./dist/index.d.ts",
|
@@ -47,8 +47,8 @@
|
|
47
47
|
"react-swipeable": "^7.0.1",
|
48
48
|
"usehooks-ts": "^3.1.0",
|
49
49
|
"@vygruppen/spor-design-tokens": "4.0.8",
|
50
|
-
"@vygruppen/spor-
|
51
|
-
"@vygruppen/spor-
|
50
|
+
"@vygruppen/spor-loader": "0.7.0",
|
51
|
+
"@vygruppen/spor-icon-react": "4.2.1"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
54
54
|
"@react-types/datepicker": "^3.10.0",
|
package/src/alert/Alert.tsx
CHANGED
@@ -30,9 +30,16 @@ export const TimeField = ({ state, ...props }: TimeFieldProps) => {
|
|
30
30
|
style={{
|
31
31
|
marginBottom: 0,
|
32
32
|
fontSize: "mobile.xs",
|
33
|
+
top: 0,
|
33
34
|
cursor: "text",
|
35
|
+
left: "50%",
|
36
|
+
transform: "translateX(-50%)",
|
34
37
|
position: "absolute",
|
35
38
|
paddingTop: "2px",
|
39
|
+
whiteSpace: "nowrap",
|
40
|
+
overflow: "hidden",
|
41
|
+
textOverflow: "ellipsis",
|
42
|
+
maxWidth: "80%",
|
36
43
|
}}
|
37
44
|
>
|
38
45
|
{props.label}
|
@@ -146,6 +146,7 @@ export const TimePicker = ({
|
|
146
146
|
aria-disabled={isDisabled}
|
147
147
|
aria-live="assertive"
|
148
148
|
aria-label={ariaLabel}
|
149
|
+
position="relative"
|
149
150
|
{...boxProps}
|
150
151
|
>
|
151
152
|
<IconButton
|
@@ -158,6 +159,7 @@ export const TimePicker = ({
|
|
158
159
|
onClick={handleBackwardsClick}
|
159
160
|
disabled={isDisabled}
|
160
161
|
style={isDisabled ? { backgroundColor: "transparent" } : {}}
|
162
|
+
zIndex={1}
|
161
163
|
/>
|
162
164
|
<TimeField label={label} state={state} name={name} />
|
163
165
|
<IconButton
|
@@ -170,6 +172,7 @@ export const TimePicker = ({
|
|
170
172
|
onClick={handleForwardClick}
|
171
173
|
disabled={isDisabled}
|
172
174
|
style={isDisabled ? { backgroundColor: "transparent" } : {}}
|
175
|
+
zIndex={1}
|
173
176
|
/>
|
174
177
|
</StyledField>
|
175
178
|
</Field>
|
package/src/dialog/Drawer.tsx
CHANGED
@@ -145,7 +145,7 @@ export const DrawerFullScreenHeader = forwardRef<
|
|
145
145
|
HTMLDivElement,
|
146
146
|
DrawerFullScreenHeaderProps
|
147
147
|
>((props, ref) => {
|
148
|
-
const { backTrigger = true, title } = props;
|
148
|
+
const { backTrigger = true, closeTrigger = true, title } = props;
|
149
149
|
return (
|
150
150
|
<ChakraDrawer.Header {...props} ref={ref} asChild>
|
151
151
|
<Grid templateColumns="1fr auto 1fr" height="auto" paddingX="8">
|
@@ -155,9 +155,11 @@ export const DrawerFullScreenHeader = forwardRef<
|
|
155
155
|
<GridItem width="full" alignSelf="end" asChild>
|
156
156
|
{title && <DrawerTitle>{title}</DrawerTitle>}
|
157
157
|
</GridItem>
|
158
|
-
|
159
|
-
<
|
160
|
-
|
158
|
+
{closeTrigger && (
|
159
|
+
<GridItem width="full" alignSelf="end">
|
160
|
+
<DrawerCloseTrigger justifySelf="end" top="0" />
|
161
|
+
</GridItem>
|
162
|
+
)}
|
161
163
|
</Grid>
|
162
164
|
</ChakraDrawer.Header>
|
163
165
|
);
|
package/src/dialog/types.ts
CHANGED
package/src/layout/RadioCard.tsx
CHANGED
@@ -40,15 +40,11 @@ type RadioCardItemProps = Exclude<
|
|
40
40
|
|
41
41
|
export const RadioCard = forwardRef<HTMLInputElement, RadioCardItemProps>(
|
42
42
|
(props, ref) => {
|
43
|
-
const { inputProps, children
|
43
|
+
const { inputProps, children } = props;
|
44
44
|
|
45
45
|
return (
|
46
46
|
<ChakraRadioCard.Item {...props}>
|
47
|
-
<ChakraRadioCard.ItemHiddenInput
|
48
|
-
aria-label={ariaLabel ?? value}
|
49
|
-
ref={ref}
|
50
|
-
{...inputProps}
|
51
|
-
/>
|
47
|
+
<ChakraRadioCard.ItemHiddenInput ref={ref} {...inputProps} />
|
52
48
|
|
53
49
|
<ChakraRadioCard.ItemControl>{children}</ChakraRadioCard.ItemControl>
|
54
50
|
</ChakraRadioCard.Item>
|
@@ -86,7 +86,7 @@ export const LineIcon = forwardRef<HTMLDivElement, LineIconProps>(
|
|
86
86
|
};
|
87
87
|
|
88
88
|
const borderContainer = () => {
|
89
|
-
return variant === "walk" && target === "travelTag" ? 0 :
|
89
|
+
return variant === "walk" && target === "travelTag" ? 0 : "1px";
|
90
90
|
};
|
91
91
|
|
92
92
|
const Icon: React.ElementType = getCorrectIcon({
|
package/src/link/TextLink.tsx
CHANGED
@@ -59,7 +59,15 @@ export const TextLink = forwardRef<HTMLAnchorElement, LinkProps>(
|
|
59
59
|
// If asChild is true, we need to clone the children and add the external icon
|
60
60
|
if (props.asChild && isValidElement(children)) {
|
61
61
|
return (
|
62
|
-
<ChakraLink
|
62
|
+
<ChakraLink
|
63
|
+
href={href}
|
64
|
+
{...props}
|
65
|
+
ref={ref}
|
66
|
+
{...(isExternal && {
|
67
|
+
target: "_blank",
|
68
|
+
rel: "noopener noreferrer",
|
69
|
+
})}
|
70
|
+
>
|
63
71
|
{cloneElement(children as React.ReactElement, {
|
64
72
|
...children.props,
|
65
73
|
children: (
|
@@ -76,7 +84,15 @@ export const TextLink = forwardRef<HTMLAnchorElement, LinkProps>(
|
|
76
84
|
}
|
77
85
|
|
78
86
|
return (
|
79
|
-
<ChakraLink
|
87
|
+
<ChakraLink
|
88
|
+
href={href}
|
89
|
+
{...props}
|
90
|
+
ref={ref}
|
91
|
+
{...(isExternal && {
|
92
|
+
target: "_blank",
|
93
|
+
rel: "noopener noreferrer",
|
94
|
+
})}
|
95
|
+
>
|
80
96
|
{children}
|
81
97
|
{isExternal && <ExternalIcon label={externalLabel} size={props.size} />}
|
82
98
|
</ChakraLink>
|
@@ -45,7 +45,7 @@ export const drawerSlotRecipe = defineSlotRecipe({
|
|
45
45
|
maxHeight: "100dvh",
|
46
46
|
color: "inherit",
|
47
47
|
boxShadow: "lg",
|
48
|
-
minHeight: ["
|
48
|
+
minHeight: ["10rem", null, null, "auto"],
|
49
49
|
_open: {
|
50
50
|
animationDuration: "slowest",
|
51
51
|
animationTimingFunction: "ease-in-smooth",
|
@@ -59,16 +59,16 @@ export const drawerSlotRecipe = defineSlotRecipe({
|
|
59
59
|
display: "flex",
|
60
60
|
alignItems: "center",
|
61
61
|
justifyContent: "space-between",
|
62
|
-
paddingX: "5",
|
62
|
+
paddingX: ["3", null, null, "5"],
|
63
63
|
paddingBottom: "1",
|
64
64
|
},
|
65
65
|
body: {
|
66
|
-
paddingX: "5",
|
66
|
+
paddingX: ["3", null, null, "5"],
|
67
67
|
paddingY: ["1", null, null, "2"],
|
68
68
|
flex: "1",
|
69
69
|
overflow: "auto",
|
70
70
|
fontSize: ["xs", null, null, "sm"],
|
71
|
-
minHeight: ["
|
71
|
+
minHeight: ["2", null, null, "auto"],
|
72
72
|
},
|
73
73
|
footer: {
|
74
74
|
display: "flex",
|
@@ -85,8 +85,8 @@ export const drawerSlotRecipe = defineSlotRecipe({
|
|
85
85
|
},
|
86
86
|
closeTrigger: {
|
87
87
|
position: "absolute",
|
88
|
-
top: "
|
89
|
-
|
88
|
+
top: "0",
|
89
|
+
right: "0",
|
90
90
|
},
|
91
91
|
},
|
92
92
|
variants: {
|
@@ -137,9 +137,10 @@ export const travelTagSlotRecipe = defineSlotRecipe({
|
|
137
137
|
walk: {
|
138
138
|
textContainer: {
|
139
139
|
position: "absolute",
|
140
|
-
left: "
|
140
|
+
left: "0.875rem",
|
141
141
|
bottom: 0,
|
142
142
|
},
|
143
|
+
|
143
144
|
title: {
|
144
145
|
fontSize: "mobile.xs",
|
145
146
|
fontWeight: "normal",
|