@seeqdev/qomponents 0.0.191 → 0.0.193
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/README.md +3 -5
- package/dist/index.esm.js +24 -87
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +24 -87
- package/dist/index.js.map +1 -1
- package/dist/src/Alert/Alert.d.ts +0 -1
- package/dist/src/Button/Button.d.ts +0 -1
- package/dist/src/ButtonGroup/ButtonGroup.d.ts +0 -1
- package/dist/src/Checkbox/Checkbox.d.ts +0 -1
- package/dist/src/Icon/Icon.d.ts +0 -1
- package/dist/src/InputGroup/InputGroup.d.ts +0 -1
- package/dist/src/Modal/Modal.d.ts +0 -1
- package/dist/src/Modal/Modal.types.d.ts +5 -0
- package/dist/src/Select/Select.d.ts +0 -1
- package/dist/src/SvgIcon/SvgIcon.d.ts +0 -1
- package/dist/src/TextArea/TextArea.d.ts +0 -1
- package/dist/src/TextField/TextField.d.ts +0 -1
- package/dist/src/TextField/TextField.types.d.ts +7 -0
- package/dist/src/Tooltip/Tooltip.d.ts +0 -1
- package/dist/src/index.build.d.ts +6 -0
- package/dist/styles.css +36 -51
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -86,7 +86,7 @@ const colorClassesThemeDark = {
|
|
|
86
86
|
'dark-gray': 'tw:text-sq-fairly-dark-gray',
|
|
87
87
|
'warning': '',
|
|
88
88
|
'darkish-gray': 'tw:text-sq-darkish-gray',
|
|
89
|
-
'gray': 'tw:dark:text-sq-dark-
|
|
89
|
+
'gray': 'tw:dark:text-sq-fairly-dark-gray',
|
|
90
90
|
'color': '',
|
|
91
91
|
'info': 'tw:dark:text-sq-theme-link',
|
|
92
92
|
'text': 'tw:dark:text-sq-dark-text',
|
|
@@ -154,7 +154,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
154
154
|
'outline': 'tw:bg-white tw:border-sq-disabled-gray',
|
|
155
155
|
'theme': 'tw:bg-sq-theme-dark tw:border-sq-theme-dark',
|
|
156
156
|
'danger': '',
|
|
157
|
-
'theme-light': 'tw:bg-sq-icon',
|
|
157
|
+
'theme-light': 'tw:bg-sq-theme-icon',
|
|
158
158
|
'no-border': '',
|
|
159
159
|
'warning': '',
|
|
160
160
|
};
|
|
@@ -162,7 +162,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
162
162
|
'outline': 'tw:dark:bg-sq-dark-background tw:dark:border-sq-dark-disabled-gray',
|
|
163
163
|
'theme': 'tw:dark:bg-sq-theme-dark tw:dark:border-sq-theme-dark',
|
|
164
164
|
'danger': '',
|
|
165
|
-
'theme-light': 'tw:dark:bg-sq-icon
|
|
165
|
+
'theme-light': 'tw:dark:bg-sq-theme-icon tw:dark:border-sq-theme-icon',
|
|
166
166
|
'no-border': '',
|
|
167
167
|
'warning': '',
|
|
168
168
|
};
|
|
@@ -4966,7 +4966,7 @@ const sizeClasses = {
|
|
|
4966
4966
|
* Textfield.
|
|
4967
4967
|
*/
|
|
4968
4968
|
const TextField = React.forwardRef((props, ref) => {
|
|
4969
|
-
const { readonly = false, disabled = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, id, name, size = 'sm', value, placeholder, extraClassNames, testId, type = 'text', inputGroup, step, showError, errorText, min, max, maxLength, minLength, required = false, autoComplete = 'off', inputWidth = undefined, inputHeight = undefined, autoFocus = false, ...tooltipProps } = props;
|
|
4969
|
+
const { readonly = false, disabled = false, onChange, onPaste, onKeyUp, onFocus, onBlur, onKeyDown, id, name, size = 'sm', value, placeholder, extraClassNames, testId, type = 'text', inputGroup, step, showError, errorText, min, max, maxLength, minLength, required = false, autoComplete = 'off', inputWidth = undefined, inputHeight = undefined, autoFocus = false, ...tooltipProps } = props;
|
|
4970
4970
|
const internalRef = React.useRef(null);
|
|
4971
4971
|
const mergedRef = useMergedRef(ref, internalRef);
|
|
4972
4972
|
const [cursor, setCursor] = React.useState(null);
|
|
@@ -5016,7 +5016,7 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
5016
5016
|
inputLenghtProp.maxLength = maxLength;
|
|
5017
5017
|
if (minLength)
|
|
5018
5018
|
inputLenghtProp.minLength = minLength;
|
|
5019
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("input", { ref: mergedRef, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: disabled, readOnly: readonly, autoComplete: autoComplete, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onKeyUp: onKeyUp, step: step, required: required, min: min, max: max, ...inputLenghtProp, ...inputProp, ...tooltipData }), errorText && showError && jsxRuntime.jsx("div", { className: "tw:text-sq-danger tw:text-xs tw:mt-1", children: errorText })] }));
|
|
5019
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("input", { ref: mergedRef, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: disabled, readOnly: readonly, autoComplete: autoComplete, onChange: handleChange, onPaste: onPaste, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onKeyUp: onKeyUp, step: step, required: required, min: min, max: max, ...inputLenghtProp, ...inputProp, ...tooltipData }), errorText && showError && jsxRuntime.jsx("div", { className: "tw:text-sq-danger tw:text-xs tw:mt-1", children: errorText })] }));
|
|
5020
5020
|
});
|
|
5021
5021
|
|
|
5022
5022
|
const alignment = 'tw:flex';
|
|
@@ -5026,8 +5026,8 @@ const baseClasses$5 = 'tw:appearance-none tw:border tw:h-3.5 tw:w-3.5 tw:focus:r
|
|
|
5026
5026
|
' tw:checked:text-white tw:checked:border-sq-text-color tw:checked:hover:border-sq-theme-dark' +
|
|
5027
5027
|
' tw:checked:active:border-sq-theme-darker tw:checked:focus:border-sq-theme-dark tw:disabled:border-sq-disabled-gray' +
|
|
5028
5028
|
' tw:dark:disabled:border-sq-fairly-dark-gray tw:dark:checked:focus:bg-sq-dark-background';
|
|
5029
|
-
const checkboxClasses = `tw:
|
|
5030
|
-
const radioClasses = `tw:
|
|
5029
|
+
const checkboxClasses = `tw:rounded ${baseClasses$5}`;
|
|
5030
|
+
const radioClasses = `tw:rounded-full ${baseClasses$5}`;
|
|
5031
5031
|
/**
|
|
5032
5032
|
* Checkbox and Radio Box Component.
|
|
5033
5033
|
*/
|
|
@@ -14587,7 +14587,7 @@ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
|
14587
14587
|
const Dialog = Root$4;
|
|
14588
14588
|
const DialogPortal = Portal$1;
|
|
14589
14589
|
const DialogClose = Close;
|
|
14590
|
-
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (jsxRuntime.jsxs(DialogPortal, { children: [jsxRuntime.jsx("div", { className: "tw:select-none tw:fixed tw:w-full tw:h-full tw:opacity-50 tw:inset-0 tw:z-[1009] tw:bg-sq-dark-background\n tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fade-out-0\n tw:data-[state=open]:fade-in-0 " }), jsxRuntime.jsxs(Content$2, { ref: ref, className: `tw:fixed tw:left-[50%] tw:top-0 tw:my-6 tw:translate-x-[-50%] tw:z-[1010] tw:grid
|
|
14590
|
+
const DialogContent = React.forwardRef(({ className, 'aria-describedby': ariaDescribedBy, children, ...props }, ref) => (jsxRuntime.jsxs(DialogPortal, { children: [jsxRuntime.jsx("div", { className: "tw:select-none tw:fixed tw:w-full tw:h-full tw:opacity-50 tw:inset-0 tw:z-[1009] tw:bg-sq-dark-background\n tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fade-out-0\n tw:data-[state=open]:fade-in-0 " }), jsxRuntime.jsxs(Content$2, { ref: ref, "aria-describedby": ariaDescribedBy, className: `tw:fixed tw:left-[50%] tw:top-0 tw:my-6 tw:translate-x-[-50%] tw:z-[1010] tw:grid
|
|
14591
14591
|
tw:gap-4 tw:border tw:bg-sq-white tw:dark:bg-sq-dark-background tw:shadow-lg tw:duration-200
|
|
14592
14592
|
tw:rounded-lg ${className}`, ...props, children: [jsxRuntime.jsx(DialogTitle$1, { className: "tw:hidden" }), children] })] })));
|
|
14593
14593
|
DialogContent.displayName = Content$2.displayName;
|
|
@@ -14599,7 +14599,7 @@ const DialogTitle = React.forwardRef((props, ref) => jsxRuntime.jsx(Title, { ref
|
|
|
14599
14599
|
DialogTitle.displayName = Title.displayName;
|
|
14600
14600
|
const DialogDescription = React.forwardRef((props, ref) => jsxRuntime.jsx(Description, { ref: ref, ...props }));
|
|
14601
14601
|
DialogDescription.displayName = Description.displayName;
|
|
14602
|
-
const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, subtitle, children, open = false, onClose, customButton = false, customButtonLabel = 'Back', onClickCustomButton, submitButtonLabel = 'Submit', cancelButtonLabel = 'Cancel', disableSubmitButton = false, stopPropagationSubmitButton = false, onSubmit, isTitleEditable = false, onTitleChanged, inputExtraClassNames, hideCloseIcon = false, size = 'xl', titleIconPosition = 'left', hideFooterButtons = false, hideSubmitButton = false, hideCancelButton = false, testId = 'modal', modalFooter, dialogClassName, titlePlaceholder, titleRequired, titleError, submitButtonTooltip, cancelButtonTooltip, disableCustomButton, customHeader, middleFooterSection = jsxRuntime.jsx(jsxRuntime.Fragment, {}), customButtonVariant = 'outline', submitButtonVariant = 'theme', keepFocusInsideModal = true, onPointerDownOutside, onInteractOutside, }) => {
|
|
14602
|
+
const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, subtitle, children, open = false, onClose, customButton = false, customButtonLabel = 'Back', onClickCustomButton, submitButtonLabel = 'Submit', cancelButtonLabel = 'Cancel', disableSubmitButton = false, stopPropagationSubmitButton = false, onSubmit, isTitleEditable = false, onTitleChanged, inputExtraClassNames, hideCloseIcon = false, size = 'xl', titleIconPosition = 'left', hideFooterButtons = false, hideSubmitButton = false, hideCancelButton = false, testId = 'modal', modalFooter, dialogClassName, titlePlaceholder, titleRequired, titleError, submitButtonTooltip, cancelButtonTooltip, disableCustomButton, customHeader, middleFooterSection = jsxRuntime.jsx(jsxRuntime.Fragment, {}), customButtonVariant = 'outline', submitButtonVariant = 'theme', keepFocusInsideModal = true, onPointerDownOutside, onInteractOutside, ariaDescribedBy, }) => {
|
|
14603
14603
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
14604
14604
|
// the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
|
|
14605
14605
|
React.useEffect(() => {
|
|
@@ -14637,7 +14637,7 @@ const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, sub
|
|
|
14637
14637
|
}
|
|
14638
14638
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [titleIcon && titleIconPosition === 'left' ? jsxRuntime.jsx("div", { className: "tw:flex tw:mr-2", children: titleIconElement }) : jsxRuntime.jsx(jsxRuntime.Fragment, {}), jsxRuntime.jsx(DialogTitle, { asChild: true, children: isTitleEditable ? (jsxRuntime.jsxs("div", { className: "tw:flex tw:w-full tw:items-center", children: [jsxRuntime.jsx(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }), titleError && jsxRuntime.jsx("p", { className: "tw:text-sq-danger tw:min-w-fit tw:pl-2 tw:mb-0", children: titleError })] })) : (customHeader ?? (jsxRuntime.jsxs("div", { "data-testid": "modalTitle", className: "modal-title", children: [jsxRuntime.jsxs("div", { className: "tw:flex tw:items-center", children: [jsxRuntime.jsx("h3", { children: title }), titleSuffixLabel && jsxRuntime.jsx("span", { className: "tw:text-xl tw:pl-0.5", children: titleSuffixLabel })] }), subtitle && (jsxRuntime.jsx("div", { className: "tw:italic tw:text-sm tw:text-left tw:mt-1", "data-testid": "modal-subtitle", children: subtitle }))] }))) }), titleIcon && titleIconPosition === 'right' ? jsxRuntime.jsx("div", { className: "tw:flex tw:ml-4", children: titleIconElement }) : jsxRuntime.jsx(jsxRuntime.Fragment, {})] }));
|
|
14639
14639
|
};
|
|
14640
|
-
return open ? (jsxRuntime.jsx(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal, children: jsxRuntime.jsxs(DialogContent, { onPointerDownOutside: (e) => (onPointerDownOutside ? onPointerDownOutside(e) : e.preventDefault()), onInteractOutside: (e) => (onInteractOutside ? onInteractOutside(e) : e.preventDefault()), "data-testid": testId, className: classNames(`modalContent tw:w-full tw:border-none tw:shadow-none tw:dark:text-sq-dark-text tw:gap-0!`, {
|
|
14640
|
+
return open ? (jsxRuntime.jsx(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal, children: jsxRuntime.jsxs(DialogContent, { onPointerDownOutside: (e) => (onPointerDownOutside ? onPointerDownOutside(e) : e.preventDefault()), onInteractOutside: (e) => (onInteractOutside ? onInteractOutside(e) : e.preventDefault()), "data-testid": testId, "aria-describedby": ariaDescribedBy, className: classNames(`modalContent tw:w-full tw:border-none tw:shadow-none tw:dark:text-sq-dark-text tw:gap-0!`, {
|
|
14641
14641
|
'tw:max-w-xs': size === 'xs',
|
|
14642
14642
|
'tw:max-w-sm': size === 'sm',
|
|
14643
14643
|
'tw:max-w-md': size === 'md',
|
|
@@ -16705,7 +16705,7 @@ const Alert = ({ children, dismissible = true, onClose, show = true, variant, te
|
|
|
16705
16705
|
theme: `${lightTheme$1} ${darkTheme$1}`,
|
|
16706
16706
|
formulaError: 'tw:text-red-800 tw:bg-red-200 tw:rounded-[0.25rem]!',
|
|
16707
16707
|
danger: 'tw:text-sq-text-color tw:bg-sq-danger',
|
|
16708
|
-
warning: 'tw:bg-sq-bg-warning tw:text-sq-text-color',
|
|
16708
|
+
warning: 'tw:bg-sq-bg-warning tw:text-sq-text-color tw:dark:text-sq-multi-gray-dark',
|
|
16709
16709
|
gray: 'tw:bg-sq-hover-gray tw:text-sq-text-color tw:dark:bg-sq-tools-background-dark tw:dark:text-sq-text-color-dark',
|
|
16710
16710
|
};
|
|
16711
16711
|
const appliedBorderTheme = {
|
|
@@ -16741,8 +16741,8 @@ const SvgIcon = ({ onClick, icon, color, type = 'default', extraClassNames, view
|
|
|
16741
16741
|
const appliedClassNames = `${onClick ? 'tw:cursor-pointer' : ''} ${extraClassNames} tw:focus:outline-none tw:focus-visible:outline-none
|
|
16742
16742
|
tw:outline-none`;
|
|
16743
16743
|
const tooltipData = getQTipData(tooltipProps);
|
|
16744
|
-
const appliedType = type === 'default' ? 'currentColor' : '
|
|
16745
|
-
return (jsxRuntime.jsx("div", { onClick: onClick, ...tooltipData, className: `svgContainer ${appliedClassNames}`, children: jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: `tw:sq-icon tw:dark:text-sq-white`, viewBox: viewBox, fill: color ? color : appliedType, "data-testid": testId, children: jsxRuntime.jsx("path", { d: getSvgIconPath(icon) }) }) }));
|
|
16744
|
+
const appliedType = type === 'default' ? 'currentColor' : 'var(--theme-icon)';
|
|
16745
|
+
return (jsxRuntime.jsx("div", { onClick: onClick, ...tooltipData, className: `svgContainer ${appliedClassNames}`, children: jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: `tw:text-sq-theme-icon tw:dark:text-sq-white`, viewBox: viewBox, fill: color ? color : appliedType, "data-testid": testId, children: jsxRuntime.jsx("path", { d: getSvgIconPath(icon) }) }) }));
|
|
16746
16746
|
};
|
|
16747
16747
|
|
|
16748
16748
|
const SeeqActionDropdownItem = (item) => {
|
|
@@ -16880,8 +16880,7 @@ function formatErrorMessage(message, errorCode) {
|
|
|
16880
16880
|
|
|
16881
16881
|
let warning = () => { };
|
|
16882
16882
|
let invariant = () => { };
|
|
16883
|
-
if (
|
|
16884
|
-
process.env?.NODE_ENV !== "production") {
|
|
16883
|
+
if (process.env.NODE_ENV !== "production") {
|
|
16885
16884
|
warning = (check, message, errorCode) => {
|
|
16886
16885
|
if (!check && typeof console !== "undefined") {
|
|
16887
16886
|
console.warn(formatErrorMessage(message, errorCode));
|
|
@@ -17337,17 +17336,6 @@ const isCSSVariableToken = (value) => {
|
|
|
17337
17336
|
return singleCssVariableRegex.test(value.split("/*")[0].trim());
|
|
17338
17337
|
};
|
|
17339
17338
|
const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
|
|
17340
|
-
/**
|
|
17341
|
-
* Check if a value contains a CSS variable anywhere (e.g. inside calc()).
|
|
17342
|
-
* Unlike isCSSVariableToken which checks if the value IS a var() token,
|
|
17343
|
-
* this checks if the value CONTAINS var() somewhere in the string.
|
|
17344
|
-
*/
|
|
17345
|
-
function containsCSSVariable(value) {
|
|
17346
|
-
if (typeof value !== "string")
|
|
17347
|
-
return false;
|
|
17348
|
-
// Strip comments to avoid false positives
|
|
17349
|
-
return value.split("/*")[0].includes("var(--");
|
|
17350
|
-
}
|
|
17351
17339
|
|
|
17352
17340
|
const number = {
|
|
17353
17341
|
test: (v) => typeof v === "number",
|
|
@@ -19145,12 +19133,6 @@ class NativeAnimation extends WithPromise {
|
|
|
19145
19133
|
super();
|
|
19146
19134
|
this.finishedTime = null;
|
|
19147
19135
|
this.isStopped = false;
|
|
19148
|
-
/**
|
|
19149
|
-
* Tracks a manually-set start time that takes precedence over WAAPI's
|
|
19150
|
-
* dynamic startTime. This is cleared when play() or time setter is called,
|
|
19151
|
-
* allowing WAAPI to take over timing.
|
|
19152
|
-
*/
|
|
19153
|
-
this.manualStartTime = null;
|
|
19154
19136
|
if (!options)
|
|
19155
19137
|
return;
|
|
19156
19138
|
const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
|
|
@@ -19186,7 +19168,6 @@ class NativeAnimation extends WithPromise {
|
|
|
19186
19168
|
play() {
|
|
19187
19169
|
if (this.isStopped)
|
|
19188
19170
|
return;
|
|
19189
|
-
this.manualStartTime = null;
|
|
19190
19171
|
this.animation.play();
|
|
19191
19172
|
if (this.state === "finished") {
|
|
19192
19173
|
this.updateFinished();
|
|
@@ -19250,7 +19231,6 @@ class NativeAnimation extends WithPromise {
|
|
|
19250
19231
|
return millisecondsToSeconds(Number(this.animation.currentTime) || 0);
|
|
19251
19232
|
}
|
|
19252
19233
|
set time(newTime) {
|
|
19253
|
-
this.manualStartTime = null;
|
|
19254
19234
|
this.finishedTime = null;
|
|
19255
19235
|
this.animation.currentTime = secondsToMilliseconds(newTime);
|
|
19256
19236
|
}
|
|
@@ -19273,10 +19253,10 @@ class NativeAnimation extends WithPromise {
|
|
|
19273
19253
|
: this.animation.playState;
|
|
19274
19254
|
}
|
|
19275
19255
|
get startTime() {
|
|
19276
|
-
return
|
|
19256
|
+
return Number(this.animation.startTime);
|
|
19277
19257
|
}
|
|
19278
19258
|
set startTime(newStartTime) {
|
|
19279
|
-
this.
|
|
19259
|
+
this.animation.startTime = newStartTime;
|
|
19280
19260
|
}
|
|
19281
19261
|
/**
|
|
19282
19262
|
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
@@ -19338,7 +19318,7 @@ class NativeAnimationExtended extends NativeAnimation {
|
|
|
19338
19318
|
*/
|
|
19339
19319
|
replaceTransitionType(options);
|
|
19340
19320
|
super(options);
|
|
19341
|
-
if (options.startTime
|
|
19321
|
+
if (options.startTime) {
|
|
19342
19322
|
this.startTime = options.startTime;
|
|
19343
19323
|
}
|
|
19344
19324
|
this.options = options;
|
|
@@ -19346,7 +19326,7 @@ class NativeAnimationExtended extends NativeAnimation {
|
|
|
19346
19326
|
/**
|
|
19347
19327
|
* WAAPI doesn't natively have any interruption capabilities.
|
|
19348
19328
|
*
|
|
19349
|
-
* Rather than read
|
|
19329
|
+
* Rather than read commited styles back out of the DOM, we can
|
|
19350
19330
|
* create a renderless JS animation and sample it twice to calculate
|
|
19351
19331
|
* its current value, "previous" value, and therefore allow
|
|
19352
19332
|
* Motion to calculate velocity for any subsequent animation.
|
|
@@ -19363,14 +19343,8 @@ class NativeAnimationExtended extends NativeAnimation {
|
|
|
19363
19343
|
...options,
|
|
19364
19344
|
autoplay: false,
|
|
19365
19345
|
});
|
|
19366
|
-
|
|
19367
|
-
|
|
19368
|
-
* Under CPU load, WAAPI's currentTime may not reflect actual
|
|
19369
|
-
* elapsed time, causing incorrect sampling and visual jumps.
|
|
19370
|
-
*/
|
|
19371
|
-
const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);
|
|
19372
|
-
const delta = clamp$1(0, sampleDelta, sampleTime - sampleDelta);
|
|
19373
|
-
motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta);
|
|
19346
|
+
const sampleTime = secondsToMilliseconds(this.finishedTime ?? this.time);
|
|
19347
|
+
motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
|
|
19374
19348
|
sampleAnimation.stop();
|
|
19375
19349
|
}
|
|
19376
19350
|
}
|
|
@@ -19548,7 +19522,7 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
19548
19522
|
* progress, which would feel snappier.
|
|
19549
19523
|
*
|
|
19550
19524
|
* However, if there's a delay (main thread work) between the creation of
|
|
19551
|
-
* the animation and the first
|
|
19525
|
+
* the animation and the first commited frame, we prefer to use resolvedAt
|
|
19552
19526
|
* to avoid a sudden jump into the animation.
|
|
19553
19527
|
*/
|
|
19554
19528
|
const startTime = sync
|
|
@@ -19817,36 +19791,17 @@ const numberValueTypes = {
|
|
|
19817
19791
|
right: px,
|
|
19818
19792
|
bottom: px,
|
|
19819
19793
|
left: px,
|
|
19820
|
-
inset: px,
|
|
19821
|
-
insetBlock: px,
|
|
19822
|
-
insetBlockStart: px,
|
|
19823
|
-
insetBlockEnd: px,
|
|
19824
|
-
insetInline: px,
|
|
19825
|
-
insetInlineStart: px,
|
|
19826
|
-
insetInlineEnd: px,
|
|
19827
19794
|
// Spacing props
|
|
19828
19795
|
padding: px,
|
|
19829
19796
|
paddingTop: px,
|
|
19830
19797
|
paddingRight: px,
|
|
19831
19798
|
paddingBottom: px,
|
|
19832
19799
|
paddingLeft: px,
|
|
19833
|
-
paddingBlock: px,
|
|
19834
|
-
paddingBlockStart: px,
|
|
19835
|
-
paddingBlockEnd: px,
|
|
19836
|
-
paddingInline: px,
|
|
19837
|
-
paddingInlineStart: px,
|
|
19838
|
-
paddingInlineEnd: px,
|
|
19839
19800
|
margin: px,
|
|
19840
19801
|
marginTop: px,
|
|
19841
19802
|
marginRight: px,
|
|
19842
19803
|
marginBottom: px,
|
|
19843
19804
|
marginLeft: px,
|
|
19844
|
-
marginBlock: px,
|
|
19845
|
-
marginBlockStart: px,
|
|
19846
|
-
marginBlockEnd: px,
|
|
19847
|
-
marginInline: px,
|
|
19848
|
-
marginInlineStart: px,
|
|
19849
|
-
marginInlineEnd: px,
|
|
19850
19805
|
// Misc
|
|
19851
19806
|
backgroundPositionX: px,
|
|
19852
19807
|
backgroundPositionY: px,
|
|
@@ -19964,16 +19919,6 @@ class DOMKeyframesResolver extends KeyframeResolver {
|
|
|
19964
19919
|
const [origin, target] = unresolvedKeyframes;
|
|
19965
19920
|
const originType = findDimensionValueType(origin);
|
|
19966
19921
|
const targetType = findDimensionValueType(target);
|
|
19967
|
-
/**
|
|
19968
|
-
* If one keyframe contains embedded CSS variables (e.g. in calc()) and the other
|
|
19969
|
-
* doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.
|
|
19970
|
-
*/
|
|
19971
|
-
const originHasVar = containsCSSVariable(origin);
|
|
19972
|
-
const targetHasVar = containsCSSVariable(target);
|
|
19973
|
-
if (originHasVar !== targetHasVar && positionalValues[name]) {
|
|
19974
|
-
this.needsMeasurement = true;
|
|
19975
|
-
return;
|
|
19976
|
-
}
|
|
19977
19922
|
/**
|
|
19978
19923
|
* Either we don't recognise these value types or we can animate between them.
|
|
19979
19924
|
*/
|
|
@@ -20508,24 +20453,16 @@ const isPrimaryPointer = (event) => {
|
|
|
20508
20453
|
}
|
|
20509
20454
|
};
|
|
20510
20455
|
|
|
20511
|
-
const
|
|
20456
|
+
const focusableElements = new Set([
|
|
20512
20457
|
"BUTTON",
|
|
20513
20458
|
"INPUT",
|
|
20514
20459
|
"SELECT",
|
|
20515
20460
|
"TEXTAREA",
|
|
20516
20461
|
"A",
|
|
20517
20462
|
]);
|
|
20518
|
-
/**
|
|
20519
|
-
* Checks if an element is an interactive form element that should prevent
|
|
20520
|
-
* drag gestures from starting when clicked.
|
|
20521
|
-
*
|
|
20522
|
-
* This specifically targets form controls, buttons, and links - not just any
|
|
20523
|
-
* element with tabIndex, since motion elements with tap handlers automatically
|
|
20524
|
-
* get tabIndex=0 for keyboard accessibility.
|
|
20525
|
-
*/
|
|
20526
20463
|
function isElementKeyboardAccessible(element) {
|
|
20527
|
-
return (
|
|
20528
|
-
element.
|
|
20464
|
+
return (focusableElements.has(element.tagName) ||
|
|
20465
|
+
element.tabIndex !== -1);
|
|
20529
20466
|
}
|
|
20530
20467
|
|
|
20531
20468
|
const isPressing = new WeakSet();
|