@stigg/react-sdk 5.6.0 → 5.7.0

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,5 +1,5 @@
1
1
  {
2
- "version": "5.6.0",
2
+ "version": "5.7.0",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -12,6 +12,7 @@ import { usePlanStepModel } from '../../hooks/usePlanStepModel';
12
12
  import { AddonListItemContainer, CheckoutAddonsContainer, TrashButton } from './CheckoutAddonsStep.style';
13
13
  import { CheckoutLocalization } from '../../configurations/textOverrides';
14
14
  import { useCheckoutModel, useProgressBarModel } from '../../hooks';
15
+ import { ON_WHEEL_BLUR } from '../../../utils/onWheelBlur';
15
16
 
16
17
  type UseAddonsStepModel = ReturnType<typeof useAddonsStepModel>;
17
18
 
@@ -96,6 +97,7 @@ function AddonListItem({
96
97
  <InputField
97
98
  id={`${addon.id}-input`}
98
99
  type="number"
100
+ onWheel={ON_WHEEL_BLUR}
99
101
  sx={{ width: 120, marginX: 2 }}
100
102
  value={addonState?.quantity ?? ''}
101
103
  error={!isValid}
@@ -14,6 +14,7 @@ import { useCheckoutModel, usePlanStepModel, useProgressBarModel } from '../../h
14
14
  import { TiersSelectContainer } from '../../../common/TiersSelectContainer';
15
15
  import { getValidPriceQuantity } from '../../../utils/priceUtils';
16
16
  import { getFeatureDisplayNameText } from '../../../utils/getFeatureName';
17
+ import { ON_WHEEL_BLUR } from '../../../utils/onWheelBlur';
17
18
 
18
19
  export type UsePlanStepModel = ReturnType<typeof usePlanStepModel>;
19
20
 
@@ -122,12 +123,12 @@ export function PlanCharge({
122
123
  sx={{ width: 120 }}
123
124
  id={`${featureId}-input`}
124
125
  type="number"
126
+ onWheel={ON_WHEEL_BLUR}
125
127
  error={!isValid}
126
128
  helperText={!isValid ? getValidationText(charge, billableFeature?.quantity) : undefined}
127
129
  FormHelperTextProps={{ sx: { margin: '4px' } }}
128
130
  value={billableFeature?.quantity ?? ''}
129
131
  onChange={handleQuantityChange}
130
- onWheel={(e: React.WheelEvent<HTMLInputElement>) => (e.target as HTMLElement).blur()}
131
132
  />
132
133
  );
133
134
  }
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  import { Typography } from './Typography';
4
4
  import { InputField } from '../checkout/components';
5
5
  import { TiersSelectContainerProps } from './TiersSelectContainer';
6
+ import { ON_WHEEL_BLUR } from '../utils/onWheelBlur';
6
7
 
7
8
  export function VolumePerUnitInput({
8
9
  width,
@@ -15,6 +16,7 @@ export function VolumePerUnitInput({
15
16
  return (
16
17
  <InputField
17
18
  type="number"
19
+ onWheel={ON_WHEEL_BLUR}
18
20
  fullWidth
19
21
  sx={{ minHeight: '46px', width }}
20
22
  InputProps={{
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+
3
+ export const ON_WHEEL_BLUR = (e: React.WheelEvent<HTMLInputElement>) => (e.target as HTMLElement).blur();