@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/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Seeq qomponents are a collection of UI components, including a Button, a TextFie
|
|
|
8
8
|
React component (more coming soon!)
|
|
9
9
|
|
|
10
10
|
These components are used by Seeq's application and are made publicly available for Developers who want to expand
|
|
11
|
-
the Seeq
|
|
11
|
+
the Seeq ecosystem with their own plugins and add-ons without having to worry about creating a cohesive Seeq UX
|
|
12
12
|
experience. Every component comes fully styled (and with dark mode support).
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
@@ -29,8 +29,8 @@ yarn add @seeqdev/qomponents
|
|
|
29
29
|
|
|
30
30
|
## Getting started with Seeq qomponents
|
|
31
31
|
|
|
32
|
-
Prefer a more complete example? <br/>
|
|
33
|
-
It includes a ready
|
|
32
|
+
Prefer a more complete example? <br/>Check out the example folder provided.
|
|
33
|
+
It includes a ready-to-run example application. Start with the readme in the example folder to get up and running!
|
|
34
34
|
|
|
35
35
|
Here is an example of a basic app using the `Button` component:
|
|
36
36
|
|
|
@@ -49,8 +49,6 @@ To make sure all styles are properly applied be sure to include the qomponents c
|
|
|
49
49
|
@import '@seeqdev/qomponents/dist/styles.css';
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
**Note:** The styles.css file already includes the icon font definitions, so you don't need to manually add `@font-face` declarations.
|
|
53
|
-
|
|
54
52
|
<b>A note on CSS:</b> Seeq's qomponents come fully styled and ready to use. While it is tempting to use the
|
|
55
53
|
available <i>extraClassNames</i> property to provide yet additional styling we strongly advise you to use this
|
|
56
54
|
property to provide only width, margins and padding. This will ensure for a smooth upgrade experience when
|
package/dist/index.esm.js
CHANGED
|
@@ -66,7 +66,7 @@ const colorClassesThemeDark = {
|
|
|
66
66
|
'dark-gray': 'tw:text-sq-fairly-dark-gray',
|
|
67
67
|
'warning': '',
|
|
68
68
|
'darkish-gray': 'tw:text-sq-darkish-gray',
|
|
69
|
-
'gray': 'tw:dark:text-sq-dark-
|
|
69
|
+
'gray': 'tw:dark:text-sq-fairly-dark-gray',
|
|
70
70
|
'color': '',
|
|
71
71
|
'info': 'tw:dark:text-sq-theme-link',
|
|
72
72
|
'text': 'tw:dark:text-sq-dark-text',
|
|
@@ -134,7 +134,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
134
134
|
'outline': 'tw:bg-white tw:border-sq-disabled-gray',
|
|
135
135
|
'theme': 'tw:bg-sq-theme-dark tw:border-sq-theme-dark',
|
|
136
136
|
'danger': '',
|
|
137
|
-
'theme-light': 'tw:bg-sq-icon',
|
|
137
|
+
'theme-light': 'tw:bg-sq-theme-icon',
|
|
138
138
|
'no-border': '',
|
|
139
139
|
'warning': '',
|
|
140
140
|
};
|
|
@@ -142,7 +142,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
142
142
|
'outline': 'tw:dark:bg-sq-dark-background tw:dark:border-sq-dark-disabled-gray',
|
|
143
143
|
'theme': 'tw:dark:bg-sq-theme-dark tw:dark:border-sq-theme-dark',
|
|
144
144
|
'danger': '',
|
|
145
|
-
'theme-light': 'tw:dark:bg-sq-icon
|
|
145
|
+
'theme-light': 'tw:dark:bg-sq-theme-icon tw:dark:border-sq-theme-icon',
|
|
146
146
|
'no-border': '',
|
|
147
147
|
'warning': '',
|
|
148
148
|
};
|
|
@@ -4946,7 +4946,7 @@ const sizeClasses = {
|
|
|
4946
4946
|
* Textfield.
|
|
4947
4947
|
*/
|
|
4948
4948
|
const TextField = React__default.forwardRef((props, ref) => {
|
|
4949
|
-
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;
|
|
4949
|
+
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;
|
|
4950
4950
|
const internalRef = useRef(null);
|
|
4951
4951
|
const mergedRef = useMergedRef(ref, internalRef);
|
|
4952
4952
|
const [cursor, setCursor] = useState(null);
|
|
@@ -4996,7 +4996,7 @@ const TextField = React__default.forwardRef((props, ref) => {
|
|
|
4996
4996
|
inputLenghtProp.maxLength = maxLength;
|
|
4997
4997
|
if (minLength)
|
|
4998
4998
|
inputLenghtProp.minLength = minLength;
|
|
4999
|
-
return (jsxs(Fragment, { children: [jsx$1("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 && jsx$1("div", { className: "tw:text-sq-danger tw:text-xs tw:mt-1", children: errorText })] }));
|
|
4999
|
+
return (jsxs(Fragment, { children: [jsx$1("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 && jsx$1("div", { className: "tw:text-sq-danger tw:text-xs tw:mt-1", children: errorText })] }));
|
|
5000
5000
|
});
|
|
5001
5001
|
|
|
5002
5002
|
const alignment = 'tw:flex';
|
|
@@ -5006,8 +5006,8 @@ const baseClasses$5 = 'tw:appearance-none tw:border tw:h-3.5 tw:w-3.5 tw:focus:r
|
|
|
5006
5006
|
' tw:checked:text-white tw:checked:border-sq-text-color tw:checked:hover:border-sq-theme-dark' +
|
|
5007
5007
|
' tw:checked:active:border-sq-theme-darker tw:checked:focus:border-sq-theme-dark tw:disabled:border-sq-disabled-gray' +
|
|
5008
5008
|
' tw:dark:disabled:border-sq-fairly-dark-gray tw:dark:checked:focus:bg-sq-dark-background';
|
|
5009
|
-
const checkboxClasses = `tw:
|
|
5010
|
-
const radioClasses = `tw:
|
|
5009
|
+
const checkboxClasses = `tw:rounded ${baseClasses$5}`;
|
|
5010
|
+
const radioClasses = `tw:rounded-full ${baseClasses$5}`;
|
|
5011
5011
|
/**
|
|
5012
5012
|
* Checkbox and Radio Box Component.
|
|
5013
5013
|
*/
|
|
@@ -14567,7 +14567,7 @@ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
|
14567
14567
|
const Dialog = Root$4;
|
|
14568
14568
|
const DialogPortal = Portal$1;
|
|
14569
14569
|
const DialogClose = Close;
|
|
14570
|
-
const DialogContent = React__default.forwardRef(({ className, children, ...props }, ref) => (jsxs(DialogPortal, { children: [jsx$1("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 " }), 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
|
|
14570
|
+
const DialogContent = React__default.forwardRef(({ className, 'aria-describedby': ariaDescribedBy, children, ...props }, ref) => (jsxs(DialogPortal, { children: [jsx$1("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 " }), 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
|
|
14571
14571
|
tw:gap-4 tw:border tw:bg-sq-white tw:dark:bg-sq-dark-background tw:shadow-lg tw:duration-200
|
|
14572
14572
|
tw:rounded-lg ${className}`, ...props, children: [jsx$1(DialogTitle$1, { className: "tw:hidden" }), children] })] })));
|
|
14573
14573
|
DialogContent.displayName = Content$2.displayName;
|
|
@@ -14579,7 +14579,7 @@ const DialogTitle = React__default.forwardRef((props, ref) => jsx$1(Title, { ref
|
|
|
14579
14579
|
DialogTitle.displayName = Title.displayName;
|
|
14580
14580
|
const DialogDescription = React__default.forwardRef((props, ref) => jsx$1(Description, { ref: ref, ...props }));
|
|
14581
14581
|
DialogDescription.displayName = Description.displayName;
|
|
14582
|
-
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 = jsx$1(Fragment, {}), customButtonVariant = 'outline', submitButtonVariant = 'theme', keepFocusInsideModal = true, onPointerDownOutside, onInteractOutside, }) => {
|
|
14582
|
+
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 = jsx$1(Fragment, {}), customButtonVariant = 'outline', submitButtonVariant = 'theme', keepFocusInsideModal = true, onPointerDownOutside, onInteractOutside, ariaDescribedBy, }) => {
|
|
14583
14583
|
const [isLoading, setIsLoading] = useState(false);
|
|
14584
14584
|
// the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
|
|
14585
14585
|
useEffect(() => {
|
|
@@ -14617,7 +14617,7 @@ const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, sub
|
|
|
14617
14617
|
}
|
|
14618
14618
|
return (jsxs(Fragment, { children: [titleIcon && titleIconPosition === 'left' ? jsx$1("div", { className: "tw:flex tw:mr-2", children: titleIconElement }) : jsx$1(Fragment, {}), jsx$1(DialogTitle, { asChild: true, children: isTitleEditable ? (jsxs("div", { className: "tw:flex tw:w-full tw:items-center", children: [jsx$1(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }), titleError && jsx$1("p", { className: "tw:text-sq-danger tw:min-w-fit tw:pl-2 tw:mb-0", children: titleError })] })) : (customHeader ?? (jsxs("div", { "data-testid": "modalTitle", className: "modal-title", children: [jsxs("div", { className: "tw:flex tw:items-center", children: [jsx$1("h3", { children: title }), titleSuffixLabel && jsx$1("span", { className: "tw:text-xl tw:pl-0.5", children: titleSuffixLabel })] }), subtitle && (jsx$1("div", { className: "tw:italic tw:text-sm tw:text-left tw:mt-1", "data-testid": "modal-subtitle", children: subtitle }))] }))) }), titleIcon && titleIconPosition === 'right' ? jsx$1("div", { className: "tw:flex tw:ml-4", children: titleIconElement }) : jsx$1(Fragment, {})] }));
|
|
14619
14619
|
};
|
|
14620
|
-
return open ? (jsx$1(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal, children: 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!`, {
|
|
14620
|
+
return open ? (jsx$1(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal, children: 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!`, {
|
|
14621
14621
|
'tw:max-w-xs': size === 'xs',
|
|
14622
14622
|
'tw:max-w-sm': size === 'sm',
|
|
14623
14623
|
'tw:max-w-md': size === 'md',
|
|
@@ -16685,7 +16685,7 @@ const Alert = ({ children, dismissible = true, onClose, show = true, variant, te
|
|
|
16685
16685
|
theme: `${lightTheme$1} ${darkTheme$1}`,
|
|
16686
16686
|
formulaError: 'tw:text-red-800 tw:bg-red-200 tw:rounded-[0.25rem]!',
|
|
16687
16687
|
danger: 'tw:text-sq-text-color tw:bg-sq-danger',
|
|
16688
|
-
warning: 'tw:bg-sq-bg-warning tw:text-sq-text-color',
|
|
16688
|
+
warning: 'tw:bg-sq-bg-warning tw:text-sq-text-color tw:dark:text-sq-multi-gray-dark',
|
|
16689
16689
|
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',
|
|
16690
16690
|
};
|
|
16691
16691
|
const appliedBorderTheme = {
|
|
@@ -16721,8 +16721,8 @@ const SvgIcon = ({ onClick, icon, color, type = 'default', extraClassNames, view
|
|
|
16721
16721
|
const appliedClassNames = `${onClick ? 'tw:cursor-pointer' : ''} ${extraClassNames} tw:focus:outline-none tw:focus-visible:outline-none
|
|
16722
16722
|
tw:outline-none`;
|
|
16723
16723
|
const tooltipData = getQTipData(tooltipProps);
|
|
16724
|
-
const appliedType = type === 'default' ? 'currentColor' : '
|
|
16725
|
-
return (jsx$1("div", { onClick: onClick, ...tooltipData, className: `svgContainer ${appliedClassNames}`, children: jsx$1("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: jsx$1("path", { d: getSvgIconPath(icon) }) }) }));
|
|
16724
|
+
const appliedType = type === 'default' ? 'currentColor' : 'var(--theme-icon)';
|
|
16725
|
+
return (jsx$1("div", { onClick: onClick, ...tooltipData, className: `svgContainer ${appliedClassNames}`, children: jsx$1("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: jsx$1("path", { d: getSvgIconPath(icon) }) }) }));
|
|
16726
16726
|
};
|
|
16727
16727
|
|
|
16728
16728
|
const SeeqActionDropdownItem = (item) => {
|
|
@@ -16860,8 +16860,7 @@ function formatErrorMessage(message, errorCode) {
|
|
|
16860
16860
|
|
|
16861
16861
|
let warning = () => { };
|
|
16862
16862
|
let invariant = () => { };
|
|
16863
|
-
if (
|
|
16864
|
-
process.env?.NODE_ENV !== "production") {
|
|
16863
|
+
if (process.env.NODE_ENV !== "production") {
|
|
16865
16864
|
warning = (check, message, errorCode) => {
|
|
16866
16865
|
if (!check && typeof console !== "undefined") {
|
|
16867
16866
|
console.warn(formatErrorMessage(message, errorCode));
|
|
@@ -17317,17 +17316,6 @@ const isCSSVariableToken = (value) => {
|
|
|
17317
17316
|
return singleCssVariableRegex.test(value.split("/*")[0].trim());
|
|
17318
17317
|
};
|
|
17319
17318
|
const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
|
|
17320
|
-
/**
|
|
17321
|
-
* Check if a value contains a CSS variable anywhere (e.g. inside calc()).
|
|
17322
|
-
* Unlike isCSSVariableToken which checks if the value IS a var() token,
|
|
17323
|
-
* this checks if the value CONTAINS var() somewhere in the string.
|
|
17324
|
-
*/
|
|
17325
|
-
function containsCSSVariable(value) {
|
|
17326
|
-
if (typeof value !== "string")
|
|
17327
|
-
return false;
|
|
17328
|
-
// Strip comments to avoid false positives
|
|
17329
|
-
return value.split("/*")[0].includes("var(--");
|
|
17330
|
-
}
|
|
17331
17319
|
|
|
17332
17320
|
const number = {
|
|
17333
17321
|
test: (v) => typeof v === "number",
|
|
@@ -19125,12 +19113,6 @@ class NativeAnimation extends WithPromise {
|
|
|
19125
19113
|
super();
|
|
19126
19114
|
this.finishedTime = null;
|
|
19127
19115
|
this.isStopped = false;
|
|
19128
|
-
/**
|
|
19129
|
-
* Tracks a manually-set start time that takes precedence over WAAPI's
|
|
19130
|
-
* dynamic startTime. This is cleared when play() or time setter is called,
|
|
19131
|
-
* allowing WAAPI to take over timing.
|
|
19132
|
-
*/
|
|
19133
|
-
this.manualStartTime = null;
|
|
19134
19116
|
if (!options)
|
|
19135
19117
|
return;
|
|
19136
19118
|
const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
|
|
@@ -19166,7 +19148,6 @@ class NativeAnimation extends WithPromise {
|
|
|
19166
19148
|
play() {
|
|
19167
19149
|
if (this.isStopped)
|
|
19168
19150
|
return;
|
|
19169
|
-
this.manualStartTime = null;
|
|
19170
19151
|
this.animation.play();
|
|
19171
19152
|
if (this.state === "finished") {
|
|
19172
19153
|
this.updateFinished();
|
|
@@ -19230,7 +19211,6 @@ class NativeAnimation extends WithPromise {
|
|
|
19230
19211
|
return millisecondsToSeconds(Number(this.animation.currentTime) || 0);
|
|
19231
19212
|
}
|
|
19232
19213
|
set time(newTime) {
|
|
19233
|
-
this.manualStartTime = null;
|
|
19234
19214
|
this.finishedTime = null;
|
|
19235
19215
|
this.animation.currentTime = secondsToMilliseconds(newTime);
|
|
19236
19216
|
}
|
|
@@ -19253,10 +19233,10 @@ class NativeAnimation extends WithPromise {
|
|
|
19253
19233
|
: this.animation.playState;
|
|
19254
19234
|
}
|
|
19255
19235
|
get startTime() {
|
|
19256
|
-
return
|
|
19236
|
+
return Number(this.animation.startTime);
|
|
19257
19237
|
}
|
|
19258
19238
|
set startTime(newStartTime) {
|
|
19259
|
-
this.
|
|
19239
|
+
this.animation.startTime = newStartTime;
|
|
19260
19240
|
}
|
|
19261
19241
|
/**
|
|
19262
19242
|
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
@@ -19318,7 +19298,7 @@ class NativeAnimationExtended extends NativeAnimation {
|
|
|
19318
19298
|
*/
|
|
19319
19299
|
replaceTransitionType(options);
|
|
19320
19300
|
super(options);
|
|
19321
|
-
if (options.startTime
|
|
19301
|
+
if (options.startTime) {
|
|
19322
19302
|
this.startTime = options.startTime;
|
|
19323
19303
|
}
|
|
19324
19304
|
this.options = options;
|
|
@@ -19326,7 +19306,7 @@ class NativeAnimationExtended extends NativeAnimation {
|
|
|
19326
19306
|
/**
|
|
19327
19307
|
* WAAPI doesn't natively have any interruption capabilities.
|
|
19328
19308
|
*
|
|
19329
|
-
* Rather than read
|
|
19309
|
+
* Rather than read commited styles back out of the DOM, we can
|
|
19330
19310
|
* create a renderless JS animation and sample it twice to calculate
|
|
19331
19311
|
* its current value, "previous" value, and therefore allow
|
|
19332
19312
|
* Motion to calculate velocity for any subsequent animation.
|
|
@@ -19343,14 +19323,8 @@ class NativeAnimationExtended extends NativeAnimation {
|
|
|
19343
19323
|
...options,
|
|
19344
19324
|
autoplay: false,
|
|
19345
19325
|
});
|
|
19346
|
-
|
|
19347
|
-
|
|
19348
|
-
* Under CPU load, WAAPI's currentTime may not reflect actual
|
|
19349
|
-
* elapsed time, causing incorrect sampling and visual jumps.
|
|
19350
|
-
*/
|
|
19351
|
-
const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);
|
|
19352
|
-
const delta = clamp$1(0, sampleDelta, sampleTime - sampleDelta);
|
|
19353
|
-
motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta);
|
|
19326
|
+
const sampleTime = secondsToMilliseconds(this.finishedTime ?? this.time);
|
|
19327
|
+
motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
|
|
19354
19328
|
sampleAnimation.stop();
|
|
19355
19329
|
}
|
|
19356
19330
|
}
|
|
@@ -19528,7 +19502,7 @@ class AsyncMotionValueAnimation extends WithPromise {
|
|
|
19528
19502
|
* progress, which would feel snappier.
|
|
19529
19503
|
*
|
|
19530
19504
|
* However, if there's a delay (main thread work) between the creation of
|
|
19531
|
-
* the animation and the first
|
|
19505
|
+
* the animation and the first commited frame, we prefer to use resolvedAt
|
|
19532
19506
|
* to avoid a sudden jump into the animation.
|
|
19533
19507
|
*/
|
|
19534
19508
|
const startTime = sync
|
|
@@ -19797,36 +19771,17 @@ const numberValueTypes = {
|
|
|
19797
19771
|
right: px,
|
|
19798
19772
|
bottom: px,
|
|
19799
19773
|
left: px,
|
|
19800
|
-
inset: px,
|
|
19801
|
-
insetBlock: px,
|
|
19802
|
-
insetBlockStart: px,
|
|
19803
|
-
insetBlockEnd: px,
|
|
19804
|
-
insetInline: px,
|
|
19805
|
-
insetInlineStart: px,
|
|
19806
|
-
insetInlineEnd: px,
|
|
19807
19774
|
// Spacing props
|
|
19808
19775
|
padding: px,
|
|
19809
19776
|
paddingTop: px,
|
|
19810
19777
|
paddingRight: px,
|
|
19811
19778
|
paddingBottom: px,
|
|
19812
19779
|
paddingLeft: px,
|
|
19813
|
-
paddingBlock: px,
|
|
19814
|
-
paddingBlockStart: px,
|
|
19815
|
-
paddingBlockEnd: px,
|
|
19816
|
-
paddingInline: px,
|
|
19817
|
-
paddingInlineStart: px,
|
|
19818
|
-
paddingInlineEnd: px,
|
|
19819
19780
|
margin: px,
|
|
19820
19781
|
marginTop: px,
|
|
19821
19782
|
marginRight: px,
|
|
19822
19783
|
marginBottom: px,
|
|
19823
19784
|
marginLeft: px,
|
|
19824
|
-
marginBlock: px,
|
|
19825
|
-
marginBlockStart: px,
|
|
19826
|
-
marginBlockEnd: px,
|
|
19827
|
-
marginInline: px,
|
|
19828
|
-
marginInlineStart: px,
|
|
19829
|
-
marginInlineEnd: px,
|
|
19830
19785
|
// Misc
|
|
19831
19786
|
backgroundPositionX: px,
|
|
19832
19787
|
backgroundPositionY: px,
|
|
@@ -19944,16 +19899,6 @@ class DOMKeyframesResolver extends KeyframeResolver {
|
|
|
19944
19899
|
const [origin, target] = unresolvedKeyframes;
|
|
19945
19900
|
const originType = findDimensionValueType(origin);
|
|
19946
19901
|
const targetType = findDimensionValueType(target);
|
|
19947
|
-
/**
|
|
19948
|
-
* If one keyframe contains embedded CSS variables (e.g. in calc()) and the other
|
|
19949
|
-
* doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.
|
|
19950
|
-
*/
|
|
19951
|
-
const originHasVar = containsCSSVariable(origin);
|
|
19952
|
-
const targetHasVar = containsCSSVariable(target);
|
|
19953
|
-
if (originHasVar !== targetHasVar && positionalValues[name]) {
|
|
19954
|
-
this.needsMeasurement = true;
|
|
19955
|
-
return;
|
|
19956
|
-
}
|
|
19957
19902
|
/**
|
|
19958
19903
|
* Either we don't recognise these value types or we can animate between them.
|
|
19959
19904
|
*/
|
|
@@ -20488,24 +20433,16 @@ const isPrimaryPointer = (event) => {
|
|
|
20488
20433
|
}
|
|
20489
20434
|
};
|
|
20490
20435
|
|
|
20491
|
-
const
|
|
20436
|
+
const focusableElements = new Set([
|
|
20492
20437
|
"BUTTON",
|
|
20493
20438
|
"INPUT",
|
|
20494
20439
|
"SELECT",
|
|
20495
20440
|
"TEXTAREA",
|
|
20496
20441
|
"A",
|
|
20497
20442
|
]);
|
|
20498
|
-
/**
|
|
20499
|
-
* Checks if an element is an interactive form element that should prevent
|
|
20500
|
-
* drag gestures from starting when clicked.
|
|
20501
|
-
*
|
|
20502
|
-
* This specifically targets form controls, buttons, and links - not just any
|
|
20503
|
-
* element with tabIndex, since motion elements with tap handlers automatically
|
|
20504
|
-
* get tabIndex=0 for keyboard accessibility.
|
|
20505
|
-
*/
|
|
20506
20443
|
function isElementKeyboardAccessible(element) {
|
|
20507
|
-
return (
|
|
20508
|
-
element.
|
|
20444
|
+
return (focusableElements.has(element.tagName) ||
|
|
20445
|
+
element.tabIndex !== -1);
|
|
20509
20446
|
}
|
|
20510
20447
|
|
|
20511
20448
|
const isPressing = new WeakSet();
|