@remotion/design 4.0.383 → 4.0.385
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/Counter.d.ts +3 -2
- package/dist/Counter.js +9 -5
- package/dist/esm/index.mjs +12 -7
- package/dist/tailwind.css +3 -0
- package/package.json +6 -6
package/dist/Counter.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import React from 'react';
|
|
|
2
2
|
interface CounterProps {
|
|
3
3
|
readonly count: number;
|
|
4
4
|
readonly setCount: (count: number) => void;
|
|
5
|
-
readonly minCount
|
|
6
|
-
readonly step
|
|
5
|
+
readonly minCount: number;
|
|
6
|
+
readonly step: number;
|
|
7
|
+
readonly incrementStep: number;
|
|
7
8
|
}
|
|
8
9
|
export declare const Counter: React.FC<CounterProps>;
|
|
9
10
|
export {};
|
package/dist/Counter.js
CHANGED
|
@@ -20,22 +20,26 @@ const buttonContainer = {
|
|
|
20
20
|
alignItems: 'center',
|
|
21
21
|
cursor: 'pointer',
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
const MAX_COUNT = 9999999;
|
|
24
|
+
export const Counter = ({ count, setCount, minCount, step, incrementStep, }) => {
|
|
24
25
|
const decrement = () => {
|
|
25
26
|
if (count > minCount) {
|
|
26
|
-
setCount(Math.max(minCount, count -
|
|
27
|
+
setCount(Math.max(minCount, count - incrementStep));
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
const increment = () => {
|
|
30
|
-
|
|
31
|
+
const nextValue = count + incrementStep;
|
|
32
|
+
const roundedValue = Math.round(nextValue / incrementStep) * incrementStep;
|
|
33
|
+
setCount(Math.min(MAX_COUNT, roundedValue));
|
|
31
34
|
};
|
|
32
|
-
|
|
35
|
+
const shrink = String(count).length > 6;
|
|
36
|
+
return (_jsxs(Card, { style: container, className: cn('w-[140px] flex flex-row overflow-hidden'), children: [_jsx("input", { className: cn('fontbrand font-medium min-w-[80px] border-0 text-end outline-0 text-text overflow-hidden flex-1 px-0 py-0 pr-2 w-full h-full tabular-nums', shrink ? 'text-lg' : 'text-2xl'), type: "number", value: count, onClick: (e) => e.currentTarget.select(), onChange: (e) => {
|
|
33
37
|
if (e.target.value.trim() === '') {
|
|
34
38
|
setCount(step === 1 ? 1 : minCount);
|
|
35
39
|
return;
|
|
36
40
|
}
|
|
37
41
|
const inputValue = parseInt(e.target.value, 10);
|
|
38
|
-
const validValue = Math.max(inputValue, minCount);
|
|
42
|
+
const validValue = Math.min(MAX_COUNT, Math.max(inputValue, minCount));
|
|
39
43
|
// For steps > 1, round to the nearest valid step
|
|
40
44
|
if (step > 1) {
|
|
41
45
|
const roundedValue = Math.round(validValue / step) * step;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -498,36 +498,41 @@ var buttonContainer = {
|
|
|
498
498
|
alignItems: "center",
|
|
499
499
|
cursor: "pointer"
|
|
500
500
|
};
|
|
501
|
+
var MAX_COUNT = 9999999;
|
|
501
502
|
var Counter = ({
|
|
502
503
|
count,
|
|
503
504
|
setCount,
|
|
504
|
-
minCount
|
|
505
|
-
step
|
|
505
|
+
minCount,
|
|
506
|
+
step,
|
|
507
|
+
incrementStep
|
|
506
508
|
}) => {
|
|
507
509
|
const decrement = () => {
|
|
508
510
|
if (count > minCount) {
|
|
509
|
-
setCount(Math.max(minCount, count -
|
|
511
|
+
setCount(Math.max(minCount, count - incrementStep));
|
|
510
512
|
}
|
|
511
513
|
};
|
|
512
514
|
const increment = () => {
|
|
513
|
-
|
|
515
|
+
const nextValue = count + incrementStep;
|
|
516
|
+
const roundedValue = Math.round(nextValue / incrementStep) * incrementStep;
|
|
517
|
+
setCount(Math.min(MAX_COUNT, roundedValue));
|
|
514
518
|
};
|
|
519
|
+
const shrink = String(count).length > 6;
|
|
515
520
|
return /* @__PURE__ */ jsxs3(Card, {
|
|
516
521
|
style: container,
|
|
517
522
|
className: cn("w-[140px] flex flex-row overflow-hidden"),
|
|
518
523
|
children: [
|
|
519
524
|
/* @__PURE__ */ jsx7("input", {
|
|
520
|
-
className: "fontbrand
|
|
525
|
+
className: cn("fontbrand font-medium min-w-[80px] border-0 text-end outline-0 text-text overflow-hidden flex-1 px-0 py-0 pr-2 w-full h-full tabular-nums", shrink ? "text-lg" : "text-2xl"),
|
|
521
526
|
type: "number",
|
|
522
|
-
onClick: (e) => e.currentTarget.select(),
|
|
523
527
|
value: count,
|
|
528
|
+
onClick: (e) => e.currentTarget.select(),
|
|
524
529
|
onChange: (e) => {
|
|
525
530
|
if (e.target.value.trim() === "") {
|
|
526
531
|
setCount(step === 1 ? 1 : minCount);
|
|
527
532
|
return;
|
|
528
533
|
}
|
|
529
534
|
const inputValue = parseInt(e.target.value, 10);
|
|
530
|
-
const validValue = Math.max(inputValue, minCount);
|
|
535
|
+
const validValue = Math.min(MAX_COUNT, Math.max(inputValue, minCount));
|
|
531
536
|
if (step > 1) {
|
|
532
537
|
const roundedValue = Math.round(validValue / step) * step;
|
|
533
538
|
setCount(Math.max(roundedValue, minCount));
|
package/dist/tailwind.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/design",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.385",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"make": "tsc -d && bun --env-file=../.env.bundle bundle.ts"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@remotion/paths": "4.0.
|
|
23
|
-
"@remotion/shapes": "4.0.
|
|
24
|
-
"@remotion/svg-3d-engine": "4.0.
|
|
22
|
+
"@remotion/paths": "4.0.385",
|
|
23
|
+
"@remotion/shapes": "4.0.385",
|
|
24
|
+
"@remotion/svg-3d-engine": "4.0.385",
|
|
25
25
|
"clsx": "^2.1.1",
|
|
26
|
-
"remotion": "4.0.
|
|
26
|
+
"remotion": "4.0.385",
|
|
27
27
|
"@radix-ui/react-select": "2.1.1",
|
|
28
28
|
"lucide-react": "0.439.0"
|
|
29
29
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"react-dom": ">=16.8.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
35
|
+
"@remotion/eslint-config-internal": "4.0.385",
|
|
36
36
|
"eslint": "9.19.0",
|
|
37
37
|
"react": "19.2.1",
|
|
38
38
|
"react-dom": "19.2.1",
|