@seeqdev/qomponents 0.0.191 → 0.0.194

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/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-disabled-gray',
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-dark tw:dark:border-sq-icon-dark',
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:form-checkbox tw:rounded ${baseClasses$5}`;
5030
- const radioClasses = `tw:form-radio tw:rounded-full ${baseClasses$5}`;
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
  */
@@ -14177,8 +14177,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
14177
14177
  },
14178
14178
  placeholder: () => placeholderStyles,
14179
14179
  container: ({ selectProps }) => {
14180
- const containerBorderStyles = selectProps?.menuIsOpen ? 'tw:rounded-t-md' : 'tw:rounded-md';
14181
- return `${textStyles} ${extraClassNames} ${containerBorderStyles} tw:pointer-events-auto!`;
14180
+ return `${textStyles} ${extraClassNames} tw:pointer-events-auto!`;
14182
14181
  },
14183
14182
  input: () => textStyles + ' specSelectInput',
14184
14183
  menuList: () => menuListStyles,
@@ -14587,7 +14586,7 @@ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
14587
14586
  const Dialog = Root$4;
14588
14587
  const DialogPortal = Portal$1;
14589
14588
  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
14589
+ 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
14590
  tw:gap-4 tw:border tw:bg-sq-white tw:dark:bg-sq-dark-background tw:shadow-lg tw:duration-200
14592
14591
  tw:rounded-lg ${className}`, ...props, children: [jsxRuntime.jsx(DialogTitle$1, { className: "tw:hidden" }), children] })] })));
14593
14592
  DialogContent.displayName = Content$2.displayName;
@@ -14599,7 +14598,7 @@ const DialogTitle = React.forwardRef((props, ref) => jsxRuntime.jsx(Title, { ref
14599
14598
  DialogTitle.displayName = Title.displayName;
14600
14599
  const DialogDescription = React.forwardRef((props, ref) => jsxRuntime.jsx(Description, { ref: ref, ...props }));
14601
14600
  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, }) => {
14601
+ 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
14602
  const [isLoading, setIsLoading] = React.useState(false);
14604
14603
  // the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
14605
14604
  React.useEffect(() => {
@@ -14637,7 +14636,7 @@ const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, sub
14637
14636
  }
14638
14637
  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
14638
  };
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!`, {
14639
+ 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
14640
  'tw:max-w-xs': size === 'xs',
14642
14641
  'tw:max-w-sm': size === 'sm',
14643
14642
  'tw:max-w-md': size === 'md',
@@ -16705,7 +16704,7 @@ const Alert = ({ children, dismissible = true, onClose, show = true, variant, te
16705
16704
  theme: `${lightTheme$1} ${darkTheme$1}`,
16706
16705
  formulaError: 'tw:text-red-800 tw:bg-red-200 tw:rounded-[0.25rem]!',
16707
16706
  danger: 'tw:text-sq-text-color tw:bg-sq-danger',
16708
- warning: 'tw:bg-sq-bg-warning tw:text-sq-text-color',
16707
+ warning: 'tw:bg-sq-bg-warning tw:text-sq-text-color tw:dark:text-sq-multi-gray-dark',
16709
16708
  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
16709
  };
16711
16710
  const appliedBorderTheme = {
@@ -16741,8 +16740,8 @@ const SvgIcon = ({ onClick, icon, color, type = 'default', extraClassNames, view
16741
16740
  const appliedClassNames = `${onClick ? 'tw:cursor-pointer' : ''} ${extraClassNames} tw:focus:outline-none tw:focus-visible:outline-none
16742
16741
  tw:outline-none`;
16743
16742
  const tooltipData = getQTipData(tooltipProps);
16744
- const appliedType = type === 'default' ? 'currentColor' : 'rgb(var(--sq-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:sq-icon tw:dark:text-sq-white`, viewBox: viewBox, fill: color ? color : appliedType, "data-testid": testId, children: jsxRuntime.jsx("path", { d: getSvgIconPath(icon) }) }) }));
16743
+ const appliedType = type === 'default' ? 'currentColor' : 'var(--theme-icon)';
16744
+ 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
16745
  };
16747
16746
 
16748
16747
  const SeeqActionDropdownItem = (item) => {
@@ -16807,20 +16806,30 @@ const borderColorClasses = [
16807
16806
  'tw:focus:border-sq-theme-dark',
16808
16807
  'tw:active:border-sq-theme-dark',
16809
16808
  ].join(' ');
16810
- const fieldBorderRadius = 'tw:rounded-l-md tw:rounded-r-none';
16811
- const fieldClasses = 'tw:leading-normal tw:outline-none tw:py-1 tw:px-3' + 'tw:p-1 tw:border-solid tw:border';
16809
+ const fieldClasses = 'tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:p-1 tw:border-solid tw:border';
16812
16810
  const darkTheme = 'tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-disabled-gray';
16813
16811
  const lightTheme = 'tw:text-sq-text-color tw:disabled:text-sq-darkish-gray';
16814
16812
  /**
16815
16813
  * InputGroup.
16816
16814
  */
16817
16815
  const InputGroup = React.forwardRef((props, ref) => {
16818
- const { readonly = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, name, value, placeholder, append = [], extraClassNames = '', id, testId, showError, required, autoComplete, autoFocus, disabled, type, step, min, max, field, maxLength, minLength, ...tooltipProps } = props;
16816
+ const { readonly = false, onChange, onKeyUp, onFocus, onBlur, onKeyDown, name, value, placeholder, append = [], extraClassNames = '', id, testId, showError, required, autoComplete, autoFocus, disabled, type, step, min, max, field, maxLength, minLength, inputGroup, ...tooltipProps } = props;
16819
16817
  const tooltipData = getQTipData(tooltipProps);
16820
16818
  const appliedClasses = `${baseClasses$1} ${extraClassNames}`;
16821
- const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
16822
16819
  const elementsToAppend = append.filter(Boolean);
16823
- return (jsxRuntime.jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsxRuntime.jsx("div", { "data-testid": testId, className: `tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${fieldAppliedClasses}`, children: field })) : (jsxRuntime.jsx(TextField, { testId: testId, readonly: readonly, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, name: name, ref: ref, showError: showError, value: value, required: required, placeholder: placeholder, autoComplete: autoComplete, autoFocus: autoFocus, id: id, type: type, disabled: disabled, step: step, min: min, max: max, maxLength: maxLength, minLength: minLength, extraClassNames: `tw:flex tw:flex-1 tw:w-full tw:focus:z-30 tw:rounded-r-none tw:last:rounded-r-md ${extraClassNames}`, ...tooltipData })), elementsToAppend.map((item, index) => {
16820
+ const effectiveInputGroup = inputGroup ?? (elementsToAppend.length > 0 ? 'left' : undefined);
16821
+ const fieldBorderRadius = effectiveInputGroup === 'left'
16822
+ ? 'tw:rounded-l-md tw:rounded-r-none'
16823
+ : effectiveInputGroup === 'right'
16824
+ ? 'tw:rounded-r-md tw:rounded-l-none'
16825
+ : 'tw:rounded-md';
16826
+ const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
16827
+ // Only pass inputGroup to React components (not DOM elements like div, span, etc.)
16828
+ const isReactComponent = React.isValidElement(field) && typeof field.type !== 'string';
16829
+ const fieldWithInputGroup = isReactComponent
16830
+ ? React.cloneElement(field, { inputGroup: effectiveInputGroup })
16831
+ : field;
16832
+ return (jsxRuntime.jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsxRuntime.jsx("div", { "data-testid": testId, className: `tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${fieldAppliedClasses}`, children: fieldWithInputGroup })) : (jsxRuntime.jsx(TextField, { testId: testId, readonly: readonly, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, name: name, ref: ref, showError: showError, value: value, required: required, placeholder: placeholder, autoComplete: autoComplete, autoFocus: autoFocus, id: id, type: type, disabled: disabled, step: step, min: min, max: max, maxLength: maxLength, minLength: minLength, inputGroup: effectiveInputGroup, extraClassNames: `tw:flex tw:flex-1 tw:w-full tw:focus:z-30 ${extraClassNames}`, ...tooltipData })), elementsToAppend.map((item, index) => {
16824
16833
  return item?.variant === 'button' ? (jsxRuntime.jsx(Button, { extraClassNames: `$
16825
16834
  index ? 'tw:-ml-px' : 'tw:ml-0'
16826
16835
  } tw:focus:z-40 tw:focus:border tw:rounded-none tw:last:rounded-r-md`, ...item.buttonProps }, index)) : (jsxRuntime.jsx("div", { className: `${borderColorClasses} ${index ? 'tw:-ml-px' : 'tw:ml-0'} tw:flex tw:items-center tw:justify-center tw:rounded-none tw:last:rounded-r-md tw:active:z-30 tw:active:border tw:border`, children: item?.element }, index));
@@ -16880,8 +16889,7 @@ function formatErrorMessage(message, errorCode) {
16880
16889
 
16881
16890
  let warning = () => { };
16882
16891
  let invariant = () => { };
16883
- if (typeof process !== "undefined" &&
16884
- process.env?.NODE_ENV !== "production") {
16892
+ if (process.env.NODE_ENV !== "production") {
16885
16893
  warning = (check, message, errorCode) => {
16886
16894
  if (!check && typeof console !== "undefined") {
16887
16895
  console.warn(formatErrorMessage(message, errorCode));
@@ -17337,17 +17345,6 @@ const isCSSVariableToken = (value) => {
17337
17345
  return singleCssVariableRegex.test(value.split("/*")[0].trim());
17338
17346
  };
17339
17347
  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
17348
 
17352
17349
  const number = {
17353
17350
  test: (v) => typeof v === "number",
@@ -19145,12 +19142,6 @@ class NativeAnimation extends WithPromise {
19145
19142
  super();
19146
19143
  this.finishedTime = null;
19147
19144
  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
19145
  if (!options)
19155
19146
  return;
19156
19147
  const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
@@ -19186,7 +19177,6 @@ class NativeAnimation extends WithPromise {
19186
19177
  play() {
19187
19178
  if (this.isStopped)
19188
19179
  return;
19189
- this.manualStartTime = null;
19190
19180
  this.animation.play();
19191
19181
  if (this.state === "finished") {
19192
19182
  this.updateFinished();
@@ -19250,7 +19240,6 @@ class NativeAnimation extends WithPromise {
19250
19240
  return millisecondsToSeconds(Number(this.animation.currentTime) || 0);
19251
19241
  }
19252
19242
  set time(newTime) {
19253
- this.manualStartTime = null;
19254
19243
  this.finishedTime = null;
19255
19244
  this.animation.currentTime = secondsToMilliseconds(newTime);
19256
19245
  }
@@ -19273,10 +19262,10 @@ class NativeAnimation extends WithPromise {
19273
19262
  : this.animation.playState;
19274
19263
  }
19275
19264
  get startTime() {
19276
- return this.manualStartTime ?? Number(this.animation.startTime);
19265
+ return Number(this.animation.startTime);
19277
19266
  }
19278
19267
  set startTime(newStartTime) {
19279
- this.manualStartTime = this.animation.startTime = newStartTime;
19268
+ this.animation.startTime = newStartTime;
19280
19269
  }
19281
19270
  /**
19282
19271
  * Attaches a timeline to the animation, for instance the `ScrollTimeline`.
@@ -19338,7 +19327,7 @@ class NativeAnimationExtended extends NativeAnimation {
19338
19327
  */
19339
19328
  replaceTransitionType(options);
19340
19329
  super(options);
19341
- if (options.startTime !== undefined) {
19330
+ if (options.startTime) {
19342
19331
  this.startTime = options.startTime;
19343
19332
  }
19344
19333
  this.options = options;
@@ -19346,7 +19335,7 @@ class NativeAnimationExtended extends NativeAnimation {
19346
19335
  /**
19347
19336
  * WAAPI doesn't natively have any interruption capabilities.
19348
19337
  *
19349
- * Rather than read committed styles back out of the DOM, we can
19338
+ * Rather than read commited styles back out of the DOM, we can
19350
19339
  * create a renderless JS animation and sample it twice to calculate
19351
19340
  * its current value, "previous" value, and therefore allow
19352
19341
  * Motion to calculate velocity for any subsequent animation.
@@ -19363,14 +19352,8 @@ class NativeAnimationExtended extends NativeAnimation {
19363
19352
  ...options,
19364
19353
  autoplay: false,
19365
19354
  });
19366
- /**
19367
- * Use wall-clock elapsed time for sampling.
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);
19355
+ const sampleTime = secondsToMilliseconds(this.finishedTime ?? this.time);
19356
+ motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
19374
19357
  sampleAnimation.stop();
19375
19358
  }
19376
19359
  }
@@ -19548,7 +19531,7 @@ class AsyncMotionValueAnimation extends WithPromise {
19548
19531
  * progress, which would feel snappier.
19549
19532
  *
19550
19533
  * However, if there's a delay (main thread work) between the creation of
19551
- * the animation and the first committed frame, we prefer to use resolvedAt
19534
+ * the animation and the first commited frame, we prefer to use resolvedAt
19552
19535
  * to avoid a sudden jump into the animation.
19553
19536
  */
19554
19537
  const startTime = sync
@@ -19817,36 +19800,17 @@ const numberValueTypes = {
19817
19800
  right: px,
19818
19801
  bottom: px,
19819
19802
  left: px,
19820
- inset: px,
19821
- insetBlock: px,
19822
- insetBlockStart: px,
19823
- insetBlockEnd: px,
19824
- insetInline: px,
19825
- insetInlineStart: px,
19826
- insetInlineEnd: px,
19827
19803
  // Spacing props
19828
19804
  padding: px,
19829
19805
  paddingTop: px,
19830
19806
  paddingRight: px,
19831
19807
  paddingBottom: px,
19832
19808
  paddingLeft: px,
19833
- paddingBlock: px,
19834
- paddingBlockStart: px,
19835
- paddingBlockEnd: px,
19836
- paddingInline: px,
19837
- paddingInlineStart: px,
19838
- paddingInlineEnd: px,
19839
19809
  margin: px,
19840
19810
  marginTop: px,
19841
19811
  marginRight: px,
19842
19812
  marginBottom: px,
19843
19813
  marginLeft: px,
19844
- marginBlock: px,
19845
- marginBlockStart: px,
19846
- marginBlockEnd: px,
19847
- marginInline: px,
19848
- marginInlineStart: px,
19849
- marginInlineEnd: px,
19850
19814
  // Misc
19851
19815
  backgroundPositionX: px,
19852
19816
  backgroundPositionY: px,
@@ -19964,16 +19928,6 @@ class DOMKeyframesResolver extends KeyframeResolver {
19964
19928
  const [origin, target] = unresolvedKeyframes;
19965
19929
  const originType = findDimensionValueType(origin);
19966
19930
  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
19931
  /**
19978
19932
  * Either we don't recognise these value types or we can animate between them.
19979
19933
  */
@@ -20508,24 +20462,16 @@ const isPrimaryPointer = (event) => {
20508
20462
  }
20509
20463
  };
20510
20464
 
20511
- const interactiveElements = new Set([
20465
+ const focusableElements = new Set([
20512
20466
  "BUTTON",
20513
20467
  "INPUT",
20514
20468
  "SELECT",
20515
20469
  "TEXTAREA",
20516
20470
  "A",
20517
20471
  ]);
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
20472
  function isElementKeyboardAccessible(element) {
20527
- return (interactiveElements.has(element.tagName) ||
20528
- element.isContentEditable === true);
20473
+ return (focusableElements.has(element.tagName) ||
20474
+ element.tabIndex !== -1);
20529
20475
  }
20530
20476
 
20531
20477
  const isPressing = new WeakSet();