@vygruppen/spor-react 12.24.7 → 12.24.8

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.24.7",
4
+ "version": "12.24.8",
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/tsconfig": "0.1.1",
72
- "@vygruppen/eslint-config": "2.1.0"
71
+ "@vygruppen/eslint-config": "2.1.0",
72
+ "@vygruppen/tsconfig": "0.1.1"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "react": ">=18.0.0 <19.0.0",
@@ -132,6 +132,7 @@ export const NumericStepper = React.forwardRef<
132
132
  }
133
133
  }}
134
134
  disabled={disabled || value <= minValue}
135
+ withStepLabel={stepSize != 1}
135
136
  />
136
137
  {withInput ? (
137
138
  <Input
@@ -187,6 +188,7 @@ export const NumericStepper = React.forwardRef<
187
188
  )}
188
189
  onClick={() => onChange(Math.min(value + clampedStepSize, maxValue))}
189
190
  disabled={disabled || value >= maxValue}
191
+ withStepLabel={stepSize != 1}
190
192
  />
191
193
  </Field>
192
194
  );
@@ -206,6 +208,8 @@ type VerySmallButtonProps = {
206
208
  disabled?: boolean;
207
209
  /** The ID of the button */
208
210
  id?: string;
211
+ /** Whether or not the stepsize is visible in the button */
212
+ withStepLabel?: boolean;
209
213
  };
210
214
 
211
215
  /** Internal override for extra small icon buttons */
@@ -213,15 +217,16 @@ const VerySmallButton = React.forwardRef<
213
217
  HTMLButtonElement,
214
218
  VerySmallButtonProps
215
219
  >((props, ref) => {
220
+ const { withStepLabel = false, ...rest } = props;
216
221
  const recipe = useSlotRecipe({ key: "numericStepper" });
217
- const styles = recipe({ colorPalette: "default" });
222
+ const styles = recipe({ withStepLabel });
218
223
  return (
219
224
  <IconButton
220
225
  variant="primary"
221
226
  size="xs"
222
227
  css={styles.button}
223
228
  ref={ref}
224
- {...props}
229
+ {...rest}
225
230
  />
226
231
  );
227
232
  });
@@ -36,17 +36,24 @@ type RadioCardItemProps = Exclude<
36
36
  RadioCardVariantProps & {
37
37
  inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
38
38
  ariaLabel?: string;
39
+ value?: string;
39
40
  };
40
41
 
41
42
  export const RadioCard = forwardRef<HTMLInputElement, RadioCardItemProps>(
42
43
  (props, ref) => {
43
- const { inputProps, children } = props;
44
+ const { inputProps, children, value } = props;
44
45
 
45
46
  return (
46
47
  <ChakraRadioCard.Item {...props}>
47
- <ChakraRadioCard.ItemHiddenInput ref={ref} {...inputProps} />
48
+ <ChakraRadioCard.ItemHiddenInput
49
+ ref={ref}
50
+ {...inputProps}
51
+ aria-label={value}
52
+ />
48
53
 
49
- <ChakraRadioCard.ItemControl>{children}</ChakraRadioCard.ItemControl>
54
+ <ChakraRadioCard.ItemControl aria-hidden={value ? true : false}>
55
+ {children}
56
+ </ChakraRadioCard.ItemControl>
50
57
  </ChakraRadioCard.Item>
51
58
  );
52
59
  },
@@ -66,4 +66,15 @@ export const numericStepperRecipe = defineSlotRecipe({
66
66
  },
67
67
  },
68
68
  },
69
+
70
+ variants: {
71
+ withStepLabel: {
72
+ true: {
73
+ button: {
74
+ paddingInline: "1 !important",
75
+ },
76
+ },
77
+ false: {},
78
+ },
79
+ },
69
80
  });