@vygruppen/spor-react 12.10.2 → 12.10.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
3
  "type": "module",
4
- "version": "12.10.2",
4
+ "version": "12.10.3",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -68,8 +68,8 @@
68
68
  "vitest": "^0.26.3",
69
69
  "vitest-axe": "^0.1.0",
70
70
  "vitest-canvas-mock": "^0.2.2",
71
- "@vygruppen/eslint-config": "1.2.3",
72
- "@vygruppen/tsconfig": "0.1.1"
71
+ "@vygruppen/tsconfig": "0.1.1",
72
+ "@vygruppen/eslint-config": "1.2.3"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "react": ">=18.0.0 <19.0.0",
@@ -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>
@@ -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
- <GridItem width="full" alignSelf="end">
159
- <DrawerCloseTrigger justifySelf="end" top="0" />
160
- </GridItem>
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
  );
@@ -23,5 +23,6 @@ export type DrawerProps = Omit<
23
23
 
24
24
  export type DrawerFullScreenHeaderProps = ChakraDrawer.HeaderProps & {
25
25
  backTrigger?: boolean;
26
+ closeTrigger?: boolean;
26
27
  title?: string;
27
28
  };
@@ -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, value, ariaLabel } = props;
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>
@@ -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 href={href} {...props} ref={ref}>
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 href={href} {...props} ref={ref}>
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: ["50vh", null, null, "auto"],
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: ["12", null, null, "auto"],
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: "2",
89
- insetEnd: "2",
88
+ top: "0",
89
+ right: "0",
90
90
  },
91
91
  },
92
92
  variants: {