@moontra/moonui-pro 3.4.35 → 3.4.37

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/dist/index.mjs CHANGED
@@ -16519,6 +16519,12 @@ var MoonUIAnimatedButtonProInternal = React71__default.forwardRef(
16519
16519
  const handleClick2 = async (e) => {
16520
16520
  if (currentState === "loading")
16521
16521
  return;
16522
+ if (props.type === "submit" && !onClick) {
16523
+ return;
16524
+ }
16525
+ if (onClick) {
16526
+ e.preventDefault();
16527
+ }
16522
16528
  if (ripple) {
16523
16529
  const rect = e.currentTarget.getBoundingClientRect();
16524
16530
  const x = e.clientX - rect.left;
@@ -70687,7 +70693,7 @@ function formatPhoneNumber(number) {
70687
70693
  return cleaned;
70688
70694
  } else if (cleaned.length <= 6) {
70689
70695
  return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
70690
- } else if (cleaned.length <= 10) {
70696
+ } else if (cleaned.length <= 8) {
70691
70697
  return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6)}`;
70692
70698
  } else {
70693
70699
  return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8, 10)}`;
@@ -70713,6 +70719,12 @@ var MoonUIPhoneNumberInputSimple = React71__default.forwardRef(({
70713
70719
  const [isFocused, setIsFocused] = useState(false);
70714
70720
  const [localValue, setLocalValue] = useState(value);
70715
70721
  const isValid = validatePhoneNumber(localValue);
70722
+ useEffect(() => {
70723
+ if (value !== void 0 && value !== localValue) {
70724
+ const formatted = formatPhoneNumber(value);
70725
+ setLocalValue(formatted);
70726
+ }
70727
+ }, [value]);
70716
70728
  const handleChange = (e) => {
70717
70729
  const newValue = e.target.value;
70718
70730
  const formattedValue = formatPhoneNumber(newValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "3.4.35",
3
+ "version": "3.4.37",
4
4
  "description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",