@remotion/design 4.0.422 → 4.0.423
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/Button.d.ts +12 -2
- package/dist/Button.js +11 -3
- package/dist/esm/index.mjs +35 -13
- package/dist/tailwind.css +3 -5
- package/package.json +6 -6
package/dist/Button.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type CommonProps = {
|
|
3
3
|
readonly depth?: number;
|
|
4
4
|
readonly loading?: boolean;
|
|
5
|
-
|
|
5
|
+
readonly disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type ButtonAsButton = CommonProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'href' | 'disabled'> & {
|
|
8
|
+
readonly href?: undefined;
|
|
9
|
+
};
|
|
10
|
+
type ButtonAsAnchor = CommonProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'type'> & {
|
|
11
|
+
readonly href: string;
|
|
12
|
+
};
|
|
13
|
+
export type ButtonProps = ButtonAsButton | ButtonAsAnchor;
|
|
14
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
15
|
+
export {};
|
package/dist/Button.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useRef, useState } from 'react';
|
|
3
3
|
import { cn } from './helpers/cn';
|
|
4
4
|
import { useHoverTransforms } from './helpers/hover-transforms';
|
|
5
5
|
import { Outer } from './helpers/Outer';
|
|
6
6
|
import { Spinner } from './Spinner';
|
|
7
|
-
export const Button = ({ children, className, disabled, depth, loading, ...
|
|
7
|
+
export const Button = ({ children, className, disabled, depth, loading, ...rest }) => {
|
|
8
8
|
const [dimensions, setDimensions] = useState(null);
|
|
9
9
|
const ref = useRef(null);
|
|
10
10
|
const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
|
|
@@ -44,6 +44,14 @@ export const Button = ({ children, className, disabled, depth, loading, ...butto
|
|
|
44
44
|
};
|
|
45
45
|
});
|
|
46
46
|
}, []);
|
|
47
|
-
const
|
|
47
|
+
const isDisabled = disabled || loading;
|
|
48
|
+
const sharedClasses = cn('text-text', 'flex', 'justify-center', 'bg-button-bg', 'items-center', 'font-brand', 'border-solid', 'text-[1em]', 'rounded-lg', 'border-black', 'border-2', 'border-b-4', 'cursor-pointer', 'px-4', 'h-12', 'flex', 'flex-row', 'items-center', 'relative', 'overflow-hidden', isDisabled && 'cursor-default opacity-50', className);
|
|
49
|
+
const innerContent = (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(loading && 'invisible', 'inline-flex'), children: children }), loading ? (_jsx("div", { className: cn('absolute w-full h-full flex inset-0 items-center justify-center text-inherit bg-inherit'), children: _jsx(Spinner, { size: 20, duration: 1 }) })) : null] }));
|
|
50
|
+
const isAnchor = 'href' in rest && rest.href !== undefined;
|
|
51
|
+
const content = isAnchor ? (_jsx("a", { ...rest, className: cn('no-underline text-inherit', sharedClasses), "aria-disabled": isDisabled || undefined, tabIndex: isDisabled ? -1 : undefined, onClick: isDisabled
|
|
52
|
+
? (e) => {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
}
|
|
55
|
+
: rest.onClick, children: innerContent })) : (_jsx("button", { type: "button", disabled: isDisabled, className: sharedClasses, ...rest, children: innerContent }));
|
|
48
56
|
return (_jsx("div", { ref: ref, className: "contents", onPointerEnter: onPointerEnter, children: dimensions && (isActive || progress > 0) ? (_jsx(Outer, { parentRef: ref, width: dimensions.width, height: dimensions.height, cornerRadius: dimensions.borderRadius, hoverTransform: progress, depthFactor: depth ?? 1, children: content })) : (content) }));
|
|
49
57
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -367,8 +367,15 @@ var Spinner = ({ size, duration }) => {
|
|
|
367
367
|
};
|
|
368
368
|
|
|
369
369
|
// src/Button.tsx
|
|
370
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
371
|
-
var Button = ({
|
|
370
|
+
import { jsx as jsx4, jsxs as jsxs2, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
371
|
+
var Button = ({
|
|
372
|
+
children,
|
|
373
|
+
className,
|
|
374
|
+
disabled,
|
|
375
|
+
depth,
|
|
376
|
+
loading,
|
|
377
|
+
...rest
|
|
378
|
+
}) => {
|
|
372
379
|
const [dimensions, setDimensions] = useState2(null);
|
|
373
380
|
const ref = useRef2(null);
|
|
374
381
|
const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
|
|
@@ -406,11 +413,9 @@ var Button = ({ children, className, disabled, depth, loading, ...buttonProps })
|
|
|
406
413
|
};
|
|
407
414
|
});
|
|
408
415
|
}, []);
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
className: cn("text-text", "flex", "justify-center", "bg-button-bg", "items-center", "font-brand", "border-solid", "text-[1em]", "rounded-lg", "border-black", "border-2", "border-b-4", "cursor-pointer", "px-4", "h-12", "flex", "flex-row", "items-center", "disabled:cursor-default", "disabled:opacity-50", "relative", "overflow-hidden", className),
|
|
413
|
-
...buttonProps,
|
|
416
|
+
const isDisabled = disabled || loading;
|
|
417
|
+
const sharedClasses = cn("text-text", "flex", "justify-center", "bg-button-bg", "items-center", "font-brand", "border-solid", "text-[1em]", "rounded-lg", "border-black", "border-2", "border-b-4", "cursor-pointer", "px-4", "h-12", "flex", "flex-row", "items-center", "relative", "overflow-hidden", isDisabled && "cursor-default opacity-50", className);
|
|
418
|
+
const innerContent = /* @__PURE__ */ jsxs2(Fragment2, {
|
|
414
419
|
children: [
|
|
415
420
|
/* @__PURE__ */ jsx4("div", {
|
|
416
421
|
className: cn(loading && "invisible", "inline-flex"),
|
|
@@ -425,6 +430,23 @@ var Button = ({ children, className, disabled, depth, loading, ...buttonProps })
|
|
|
425
430
|
}) : null
|
|
426
431
|
]
|
|
427
432
|
});
|
|
433
|
+
const isAnchor = "href" in rest && rest.href !== undefined;
|
|
434
|
+
const content = isAnchor ? /* @__PURE__ */ jsx4("a", {
|
|
435
|
+
...rest,
|
|
436
|
+
className: cn("no-underline text-inherit", sharedClasses),
|
|
437
|
+
"aria-disabled": isDisabled || undefined,
|
|
438
|
+
tabIndex: isDisabled ? -1 : undefined,
|
|
439
|
+
onClick: isDisabled ? (e) => {
|
|
440
|
+
e.preventDefault();
|
|
441
|
+
} : rest.onClick,
|
|
442
|
+
children: innerContent
|
|
443
|
+
}) : /* @__PURE__ */ jsx4("button", {
|
|
444
|
+
type: "button",
|
|
445
|
+
disabled: isDisabled,
|
|
446
|
+
className: sharedClasses,
|
|
447
|
+
...rest,
|
|
448
|
+
children: innerContent
|
|
449
|
+
});
|
|
428
450
|
return /* @__PURE__ */ jsx4("div", {
|
|
429
451
|
ref,
|
|
430
452
|
className: "contents",
|
|
@@ -716,7 +738,7 @@ function useComposedRefs(...refs) {
|
|
|
716
738
|
|
|
717
739
|
// ../../node_modules/.bun/@radix-ui+react-slot@1.1.0+09a4a3ac15cb54ba/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
718
740
|
import * as React8 from "react";
|
|
719
|
-
import { Fragment as
|
|
741
|
+
import { Fragment as Fragment3, jsx as jsx13 } from "react/jsx-runtime";
|
|
720
742
|
var Slot = React8.forwardRef((props, forwardedRef) => {
|
|
721
743
|
const { children, ...slotProps } = props;
|
|
722
744
|
const childrenArray = React8.Children.toArray(children);
|
|
@@ -750,7 +772,7 @@ var SlotClone = React8.forwardRef((props, forwardedRef) => {
|
|
|
750
772
|
});
|
|
751
773
|
SlotClone.displayName = "SlotClone";
|
|
752
774
|
var Slottable = ({ children }) => {
|
|
753
|
-
return /* @__PURE__ */ jsx13(
|
|
775
|
+
return /* @__PURE__ */ jsx13(Fragment3, { children });
|
|
754
776
|
};
|
|
755
777
|
function isSlottable(child) {
|
|
756
778
|
return React8.isValidElement(child) && child.type === Slottable;
|
|
@@ -4429,7 +4451,7 @@ ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
|
4429
4451
|
var Combination_default = ReactRemoveScroll;
|
|
4430
4452
|
|
|
4431
4453
|
// ../../node_modules/.bun/@radix-ui+react-select@2.1.1+f178f9b1194b24ba/node_modules/@radix-ui/react-select/dist/index.mjs
|
|
4432
|
-
import { Fragment as
|
|
4454
|
+
import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
4433
4455
|
"use client";
|
|
4434
4456
|
var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
|
|
4435
4457
|
var SELECTION_KEYS = [" ", "Enter"];
|
|
@@ -4609,7 +4631,7 @@ var SelectValue = React34.forwardRef((props, forwardedRef) => {
|
|
|
4609
4631
|
...valueProps,
|
|
4610
4632
|
ref: composedRefs,
|
|
4611
4633
|
style: { pointerEvents: "none" },
|
|
4612
|
-
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsx23(
|
|
4634
|
+
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsx23(Fragment6, { children: placeholder }) : children
|
|
4613
4635
|
});
|
|
4614
4636
|
});
|
|
4615
4637
|
SelectValue.displayName = VALUE_NAME;
|
|
@@ -5017,7 +5039,7 @@ var SelectViewport = React34.forwardRef((props, forwardedRef) => {
|
|
|
5017
5039
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
5018
5040
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
5019
5041
|
const prevScrollTopRef = React34.useRef(0);
|
|
5020
|
-
return /* @__PURE__ */ jsxs4(
|
|
5042
|
+
return /* @__PURE__ */ jsxs4(Fragment6, { children: [
|
|
5021
5043
|
/* @__PURE__ */ jsx23("style", {
|
|
5022
5044
|
dangerouslySetInnerHTML: {
|
|
5023
5045
|
__html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`
|
|
@@ -5174,7 +5196,7 @@ var SelectItemText = React34.forwardRef((props, forwardedRef) => {
|
|
|
5174
5196
|
onNativeOptionAdd(nativeOption);
|
|
5175
5197
|
return () => onNativeOptionRemove(nativeOption);
|
|
5176
5198
|
}, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
|
|
5177
|
-
return /* @__PURE__ */ jsxs4(
|
|
5199
|
+
return /* @__PURE__ */ jsxs4(Fragment6, { children: [
|
|
5178
5200
|
/* @__PURE__ */ jsx23(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
|
|
5179
5201
|
itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM4.createPortal(itemTextProps.children, context.valueNode) : null
|
|
5180
5202
|
] });
|
package/dist/tailwind.css
CHANGED
|
@@ -532,6 +532,9 @@
|
|
|
532
532
|
--tw-numeric-spacing: tabular-nums;
|
|
533
533
|
font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
|
|
534
534
|
}
|
|
535
|
+
.no-underline {
|
|
536
|
+
text-decoration-line: none;
|
|
537
|
+
}
|
|
535
538
|
.underline {
|
|
536
539
|
text-decoration-line: underline;
|
|
537
540
|
}
|
|
@@ -624,11 +627,6 @@
|
|
|
624
627
|
pointer-events: none;
|
|
625
628
|
}
|
|
626
629
|
}
|
|
627
|
-
.disabled\:cursor-default {
|
|
628
|
-
&:disabled {
|
|
629
|
-
cursor: default;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
630
|
.disabled\:cursor-not-allowed {
|
|
633
631
|
&:disabled {
|
|
634
632
|
cursor: not-allowed;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/design",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.423",
|
|
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.423",
|
|
23
|
+
"@remotion/shapes": "4.0.423",
|
|
24
|
+
"@remotion/svg-3d-engine": "4.0.423",
|
|
25
25
|
"clsx": "^2.1.1",
|
|
26
|
-
"remotion": "4.0.
|
|
26
|
+
"remotion": "4.0.423",
|
|
27
27
|
"@radix-ui/react-select": "2.1.1",
|
|
28
28
|
"@radix-ui/react-tabs": "^1.1.0",
|
|
29
29
|
"lucide-react": "0.439.0"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"react-dom": ">=16.8.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
36
|
+
"@remotion/eslint-config-internal": "4.0.423",
|
|
37
37
|
"eslint": "9.19.0",
|
|
38
38
|
"react": "19.2.3",
|
|
39
39
|
"react-dom": "19.2.3",
|