@adobe-commerce/elsie 1.0.0 → 1.1.0-alpha6

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/__mocks__/svg.js CHANGED
@@ -7,4 +7,5 @@
7
7
  * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
- export * from '../src/icons';
10
+ const SVGComponent = 'svg';
11
+ export default SVGComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe-commerce/elsie",
3
- "version": "1.0.0",
3
+ "version": "1.1.0-alpha6",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "description": "Domain Package SDK",
6
6
  "engines": {
@@ -8,7 +8,7 @@
8
8
  *******************************************************************/
9
9
 
10
10
  import { FunctionComponent } from 'preact';
11
- import { useState, useCallback } from 'preact/hooks';
11
+ import { useState, useCallback, useEffect } from 'preact/hooks';
12
12
  import { HTMLAttributes } from 'preact/compat';
13
13
  import { classes, debounce } from '@adobe-commerce/elsie/lib';
14
14
  import { Add, Minus } from '@adobe-commerce/elsie/icons';
@@ -56,6 +56,15 @@ export const Incrementer: FunctionComponent<IncrementerProps> = ({
56
56
  ? 'Dropin.Incrementer.maxQuantityMessage'
57
57
  : 'Dropin.Incrementer.errorMessage';
58
58
 
59
+ // Add this effect to synchronize internal state with external value prop
60
+ useEffect(() => {
61
+ const propValue = Number(value);
62
+ if (propValue !== currentValue) {
63
+ setCurrentValue(propValue);
64
+ }
65
+ // eslint-disable-next-line react-hooks/exhaustive-deps
66
+ }, [value]);
67
+
59
68
  // eslint-disable-next-line react-hooks/exhaustive-deps
60
69
  const debouncedOnValueHandler = useCallback(
61
70
  debounce(async (newValue: any) => {