@almadar/ui 4.4.0 → 4.4.1
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/avl/index.cjs +2 -1
- package/dist/avl/index.js +2 -1
- package/dist/components/atoms/AnimatedCounter.d.ts +2 -2
- package/dist/components/index.cjs +2 -1
- package/dist/components/index.js +2 -1
- package/dist/components/molecules/AnimatedCounter.d.ts +2 -2
- package/dist/marketing/index.cjs +3 -3
- package/dist/marketing/index.d.cts +2 -2
- package/dist/marketing/index.js +3 -3
- package/dist/providers/index.cjs +2 -1
- package/dist/providers/index.js +2 -1
- package/dist/runtime/index.cjs +2 -1
- package/dist/runtime/index.js +2 -1
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -7147,7 +7147,8 @@ var init_AnimatedCounter = __esm({
|
|
|
7147
7147
|
suffix,
|
|
7148
7148
|
className
|
|
7149
7149
|
}) => {
|
|
7150
|
-
const
|
|
7150
|
+
const numericRaw = typeof rawValue === "number" ? rawValue : Number.parseFloat(String(rawValue ?? ""));
|
|
7151
|
+
const value = !Number.isNaN(numericRaw) ? numericRaw : 0;
|
|
7151
7152
|
const [displayValue, setDisplayValue] = React126.useState(value);
|
|
7152
7153
|
const previousValueRef = React126.useRef(value);
|
|
7153
7154
|
const animationFrameRef = React126.useRef(null);
|
package/dist/avl/index.js
CHANGED
|
@@ -7101,7 +7101,8 @@ var init_AnimatedCounter = __esm({
|
|
|
7101
7101
|
suffix,
|
|
7102
7102
|
className
|
|
7103
7103
|
}) => {
|
|
7104
|
-
const
|
|
7104
|
+
const numericRaw = typeof rawValue === "number" ? rawValue : Number.parseFloat(String(rawValue ?? ""));
|
|
7105
|
+
const value = !Number.isNaN(numericRaw) ? numericRaw : 0;
|
|
7105
7106
|
const [displayValue, setDisplayValue] = useState(value);
|
|
7106
7107
|
const previousValueRef = useRef(value);
|
|
7107
7108
|
const animationFrameRef = useRef(null);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
8
|
export interface AnimatedCounterProps {
|
|
9
|
-
/** The target
|
|
10
|
-
value: number;
|
|
9
|
+
/** The target value to animate to. Strings are parsed numerically (e.g. "500", "99.9"). */
|
|
10
|
+
value: number | string;
|
|
11
11
|
/** Animation duration in milliseconds */
|
|
12
12
|
duration?: number;
|
|
13
13
|
/** Text to display before the number */
|
|
@@ -3178,7 +3178,8 @@ var init_AnimatedCounter = __esm({
|
|
|
3178
3178
|
suffix,
|
|
3179
3179
|
className
|
|
3180
3180
|
}) => {
|
|
3181
|
-
const
|
|
3181
|
+
const numericRaw = typeof rawValue === "number" ? rawValue : Number.parseFloat(String(rawValue ?? ""));
|
|
3182
|
+
const value = !Number.isNaN(numericRaw) ? numericRaw : 0;
|
|
3182
3183
|
const [displayValue, setDisplayValue] = React110.useState(value);
|
|
3183
3184
|
const previousValueRef = React110.useRef(value);
|
|
3184
3185
|
const animationFrameRef = React110.useRef(null);
|
package/dist/components/index.js
CHANGED
|
@@ -3133,7 +3133,8 @@ var init_AnimatedCounter = __esm({
|
|
|
3133
3133
|
suffix,
|
|
3134
3134
|
className
|
|
3135
3135
|
}) => {
|
|
3136
|
-
const
|
|
3136
|
+
const numericRaw = typeof rawValue === "number" ? rawValue : Number.parseFloat(String(rawValue ?? ""));
|
|
3137
|
+
const value = !Number.isNaN(numericRaw) ? numericRaw : 0;
|
|
3137
3138
|
const [displayValue, setDisplayValue] = useState(value);
|
|
3138
3139
|
const previousValueRef = useRef(value);
|
|
3139
3140
|
const animationFrameRef = useRef(null);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
export interface AnimatedCounterProps {
|
|
9
|
-
/** Target value to count to (e.g. "500+", "99.9%", "3x") */
|
|
10
|
-
value: string;
|
|
9
|
+
/** Target value to count to. Strings allow display formats (e.g. "500+", "99.9%", "3x"); numbers are coerced. */
|
|
10
|
+
value: string | number;
|
|
11
11
|
/** Label displayed below the number */
|
|
12
12
|
label: string;
|
|
13
13
|
/** Animation duration in ms */
|
package/dist/marketing/index.cjs
CHANGED
|
@@ -4641,7 +4641,7 @@ var PullQuote = ({
|
|
|
4641
4641
|
};
|
|
4642
4642
|
PullQuote.displayName = "PullQuote";
|
|
4643
4643
|
function parseValue(value) {
|
|
4644
|
-
if (
|
|
4644
|
+
if (value === "" || value == null) return { num: 0, prefix: "", suffix: "", decimals: 0 };
|
|
4645
4645
|
const match = String(value).match(/^([^0-9]*)([0-9]+(?:\.[0-9]+)?)(.*)$/);
|
|
4646
4646
|
if (!match) {
|
|
4647
4647
|
return { num: 0, prefix: "", suffix: String(value), decimals: 0 };
|
|
@@ -4668,7 +4668,7 @@ var AnimatedCounter = ({
|
|
|
4668
4668
|
const animate = React5.useCallback(() => {
|
|
4669
4669
|
const { num, prefix, suffix, decimals } = parseValue(value);
|
|
4670
4670
|
if (num === 0) {
|
|
4671
|
-
setDisplayValue(value);
|
|
4671
|
+
setDisplayValue(String(value));
|
|
4672
4672
|
return;
|
|
4673
4673
|
}
|
|
4674
4674
|
const startTime = performance.now();
|
|
@@ -4681,7 +4681,7 @@ var AnimatedCounter = ({
|
|
|
4681
4681
|
if (progress < 1) {
|
|
4682
4682
|
requestAnimationFrame(tick);
|
|
4683
4683
|
} else {
|
|
4684
|
-
setDisplayValue(value);
|
|
4684
|
+
setDisplayValue(String(value));
|
|
4685
4685
|
}
|
|
4686
4686
|
};
|
|
4687
4687
|
requestAnimationFrame(tick);
|
|
@@ -822,8 +822,8 @@ declare const PullQuote: React.FC<PullQuoteProps>;
|
|
|
822
822
|
*/
|
|
823
823
|
|
|
824
824
|
interface AnimatedCounterProps {
|
|
825
|
-
/** Target value to count to (e.g. "500+", "99.9%", "3x") */
|
|
826
|
-
value: string;
|
|
825
|
+
/** Target value to count to. Strings allow display formats (e.g. "500+", "99.9%", "3x"); numbers are coerced. */
|
|
826
|
+
value: string | number;
|
|
827
827
|
/** Label displayed below the number */
|
|
828
828
|
label: string;
|
|
829
829
|
/** Animation duration in ms */
|
package/dist/marketing/index.js
CHANGED
|
@@ -4617,7 +4617,7 @@ var PullQuote = ({
|
|
|
4617
4617
|
};
|
|
4618
4618
|
PullQuote.displayName = "PullQuote";
|
|
4619
4619
|
function parseValue(value) {
|
|
4620
|
-
if (
|
|
4620
|
+
if (value === "" || value == null) return { num: 0, prefix: "", suffix: "", decimals: 0 };
|
|
4621
4621
|
const match = String(value).match(/^([^0-9]*)([0-9]+(?:\.[0-9]+)?)(.*)$/);
|
|
4622
4622
|
if (!match) {
|
|
4623
4623
|
return { num: 0, prefix: "", suffix: String(value), decimals: 0 };
|
|
@@ -4644,7 +4644,7 @@ var AnimatedCounter = ({
|
|
|
4644
4644
|
const animate = useCallback(() => {
|
|
4645
4645
|
const { num, prefix, suffix, decimals } = parseValue(value);
|
|
4646
4646
|
if (num === 0) {
|
|
4647
|
-
setDisplayValue(value);
|
|
4647
|
+
setDisplayValue(String(value));
|
|
4648
4648
|
return;
|
|
4649
4649
|
}
|
|
4650
4650
|
const startTime = performance.now();
|
|
@@ -4657,7 +4657,7 @@ var AnimatedCounter = ({
|
|
|
4657
4657
|
if (progress < 1) {
|
|
4658
4658
|
requestAnimationFrame(tick);
|
|
4659
4659
|
} else {
|
|
4660
|
-
setDisplayValue(value);
|
|
4660
|
+
setDisplayValue(String(value));
|
|
4661
4661
|
}
|
|
4662
4662
|
};
|
|
4663
4663
|
requestAnimationFrame(tick);
|
package/dist/providers/index.cjs
CHANGED
|
@@ -3681,7 +3681,8 @@ var init_AnimatedCounter = __esm({
|
|
|
3681
3681
|
suffix,
|
|
3682
3682
|
className
|
|
3683
3683
|
}) => {
|
|
3684
|
-
const
|
|
3684
|
+
const numericRaw = typeof rawValue === "number" ? rawValue : Number.parseFloat(String(rawValue ?? ""));
|
|
3685
|
+
const value = !Number.isNaN(numericRaw) ? numericRaw : 0;
|
|
3685
3686
|
const [displayValue, setDisplayValue] = React115.useState(value);
|
|
3686
3687
|
const previousValueRef = React115.useRef(value);
|
|
3687
3688
|
const animationFrameRef = React115.useRef(null);
|
package/dist/providers/index.js
CHANGED
|
@@ -3636,7 +3636,8 @@ var init_AnimatedCounter = __esm({
|
|
|
3636
3636
|
suffix,
|
|
3637
3637
|
className
|
|
3638
3638
|
}) => {
|
|
3639
|
-
const
|
|
3639
|
+
const numericRaw = typeof rawValue === "number" ? rawValue : Number.parseFloat(String(rawValue ?? ""));
|
|
3640
|
+
const value = !Number.isNaN(numericRaw) ? numericRaw : 0;
|
|
3640
3641
|
const [displayValue, setDisplayValue] = useState(value);
|
|
3641
3642
|
const previousValueRef = useRef(value);
|
|
3642
3643
|
const animationFrameRef = useRef(null);
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -4349,7 +4349,8 @@ var init_AnimatedCounter = __esm({
|
|
|
4349
4349
|
suffix,
|
|
4350
4350
|
className
|
|
4351
4351
|
}) => {
|
|
4352
|
-
const
|
|
4352
|
+
const numericRaw = typeof rawValue === "number" ? rawValue : Number.parseFloat(String(rawValue ?? ""));
|
|
4353
|
+
const value = !Number.isNaN(numericRaw) ? numericRaw : 0;
|
|
4353
4354
|
const [displayValue, setDisplayValue] = React115.useState(value);
|
|
4354
4355
|
const previousValueRef = React115.useRef(value);
|
|
4355
4356
|
const animationFrameRef = React115.useRef(null);
|
package/dist/runtime/index.js
CHANGED
|
@@ -4304,7 +4304,8 @@ var init_AnimatedCounter = __esm({
|
|
|
4304
4304
|
suffix,
|
|
4305
4305
|
className
|
|
4306
4306
|
}) => {
|
|
4307
|
-
const
|
|
4307
|
+
const numericRaw = typeof rawValue === "number" ? rawValue : Number.parseFloat(String(rawValue ?? ""));
|
|
4308
|
+
const value = !Number.isNaN(numericRaw) ? numericRaw : 0;
|
|
4308
4309
|
const [displayValue, setDisplayValue] = useState(value);
|
|
4309
4310
|
const previousValueRef = useRef(value);
|
|
4310
4311
|
const animationFrameRef = useRef(null);
|