@aws-amplify/ui-react 6.9.0 → 6.9.2

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.
@@ -45,12 +45,10 @@ const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, desc
45
45
  onChange(value[0]);
46
46
  }
47
47
  }, [onChange]);
48
- const renderedValue = React.useMemo(() => {
49
- const formattedValue = isFunction(formatValue)
50
- ? formatValue(currentValue)
51
- : currentValue;
52
- return typeof formatValue === 'string' ? (React.createElement(View, { as: "span" }, formattedValue)) : (formattedValue);
53
- }, [currentValue, formatValue]);
48
+ const realValue = isControlled ? value : currentValue;
49
+ const formattedValue = isFunction(formatValue)
50
+ ? formatValue(realValue)
51
+ : realValue;
54
52
  const isVertical = orientation === 'vertical';
55
53
  const componentClasses = classNames(ComponentClassName.SliderFieldTrack, classNameModifier(ComponentClassName.SliderFieldTrack, orientation), classNameModifier(ComponentClassName.SliderFieldTrack, size));
56
54
  const rootComponentClasses = classNames(ComponentClassName.SliderFieldRoot, classNameModifier(ComponentClassName.SliderFieldRoot, orientation), classNameModifier(ComponentClassName.SliderFieldRoot, size), classNameModifierByFlag(ComponentClassName.SliderFieldRoot, 'disabled', disabled), className);
@@ -61,7 +59,7 @@ const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, desc
61
59
  className: classNames(ComponentClassName.Field, classNameModifier(ComponentClassName.Field, size), ComponentClassName.SliderField), testId: testId, ...styleProps },
62
60
  React.createElement(Label, { className: ComponentClassName.SliderFieldLabel, id: stableId, testId: SLIDER_LABEL_TEST_ID, visuallyHidden: labelHidden },
63
61
  React.createElement(View, { as: "span" }, label),
64
- !isValueHidden ? renderedValue : null),
62
+ !isValueHidden ? (typeof formatValue === 'string' ? (React.createElement(View, { as: "span" }, formattedValue)) : (formattedValue)) : null),
65
63
  React.createElement(FieldDescription, { id: descriptionId, labelHidden: labelHidden, descriptiveText: descriptiveText }),
66
64
  React.createElement(FieldGroup, { className: ComponentClassName.SliderFieldGroup, id: fieldId, orientation: orientation, outerStartComponent: outerStartComponent, outerEndComponent: outerEndComponent },
67
65
  React.createElement(Root, { className: rootComponentClasses, "data-testid": SLIDER_ROOT_TEST_ID, disabled: disabled, defaultValue: defaultValues, onValueChange: onValueChange, orientation: orientation, ref: ref, value: values, ...rest },
@@ -1,3 +1,3 @@
1
- const VERSION = '6.9.0';
1
+ const VERSION = '6.9.2';
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -1746,12 +1746,10 @@ const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, desc
1746
1746
  onChange(value[0]);
1747
1747
  }
1748
1748
  }, [onChange]);
1749
- const renderedValue = React__namespace.useMemo(() => {
1750
- const formattedValue = ui.isFunction(formatValue)
1751
- ? formatValue(currentValue)
1752
- : currentValue;
1753
- return typeof formatValue === 'string' ? (React__namespace.createElement(Field.View, { as: "span" }, formattedValue)) : (formattedValue);
1754
- }, [currentValue, formatValue]);
1749
+ const realValue = isControlled ? value : currentValue;
1750
+ const formattedValue = ui.isFunction(formatValue)
1751
+ ? formatValue(realValue)
1752
+ : realValue;
1755
1753
  const isVertical = orientation === 'vertical';
1756
1754
  const componentClasses = ui.classNames(ui.ComponentClassName.SliderFieldTrack, ui.classNameModifier(ui.ComponentClassName.SliderFieldTrack, orientation), ui.classNameModifier(ui.ComponentClassName.SliderFieldTrack, size));
1757
1755
  const rootComponentClasses = ui.classNames(ui.ComponentClassName.SliderFieldRoot, ui.classNameModifier(ui.ComponentClassName.SliderFieldRoot, orientation), ui.classNameModifier(ui.ComponentClassName.SliderFieldRoot, size), ui.classNameModifierByFlag(ui.ComponentClassName.SliderFieldRoot, 'disabled', disabled), className);
@@ -1762,7 +1760,7 @@ const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, desc
1762
1760
  className: ui.classNames(ui.ComponentClassName.Field, ui.classNameModifier(ui.ComponentClassName.Field, size), ui.ComponentClassName.SliderField), testId: testId, ...styleProps },
1763
1761
  React__namespace.createElement(Field.Label, { className: ui.ComponentClassName.SliderFieldLabel, id: stableId, testId: SLIDER_LABEL_TEST_ID, visuallyHidden: labelHidden },
1764
1762
  React__namespace.createElement(Field.View, { as: "span" }, label),
1765
- !isValueHidden ? renderedValue : null),
1763
+ !isValueHidden ? (typeof formatValue === 'string' ? (React__namespace.createElement(Field.View, { as: "span" }, formattedValue)) : (formattedValue)) : null),
1766
1764
  React__namespace.createElement(Field.FieldDescription, { id: descriptionId, labelHidden: labelHidden, descriptiveText: descriptiveText }),
1767
1765
  React__namespace.createElement(FieldGroup, { className: ui.ComponentClassName.SliderFieldGroup, id: fieldId, orientation: orientation, outerStartComponent: outerStartComponent, outerEndComponent: outerEndComponent },
1768
1766
  React__namespace.createElement(reactSlider.Root, { className: rootComponentClasses, "data-testid": SLIDER_ROOT_TEST_ID, disabled: disabled, defaultValue: defaultValues, onValueChange: onValueChange, orientation: orientation, ref: ref, value: values, ...rest },
@@ -2471,7 +2469,7 @@ const defaultDeleteUserDisplayText = {
2471
2469
  warningText: 'Deleting your account is not reversible. You will lose access to your account and all data associated with it.',
2472
2470
  };
2473
2471
 
2474
- const VERSION = '6.9.0';
2472
+ const VERSION = '6.9.2';
2475
2473
 
2476
2474
  const logger$2 = ui.getLogger('AccountSettings');
2477
2475
  const getIsDisabled = (formValues, validationError) => {
@@ -1 +1 @@
1
- export declare const VERSION = "6.9.0";
1
+ export declare const VERSION = "6.9.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react",
3
- "version": "6.9.0",
3
+ "version": "6.9.2",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -55,8 +55,8 @@
55
55
  "typecheck": "tsc --noEmit"
56
56
  },
57
57
  "dependencies": {
58
- "@aws-amplify/ui": "6.8.0",
59
- "@aws-amplify/ui-react-core": "3.3.0",
58
+ "@aws-amplify/ui": "6.8.2",
59
+ "@aws-amplify/ui-react-core": "3.3.2",
60
60
  "@radix-ui/react-direction": "^1.1.0",
61
61
  "@radix-ui/react-dropdown-menu": "^2.1.4",
62
62
  "@radix-ui/react-slider": "^1.2.2",