@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/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 eco-system with their own plugins and add-ons without having to worry about creating a cohesive Seeq UX
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/>Checkout 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!
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-disabled-gray',
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-dark tw:dark:border-sq-icon-dark',
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:form-checkbox tw:rounded ${baseClasses$5}`;
5010
- const radioClasses = `tw:form-radio tw:rounded-full ${baseClasses$5}`;
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
  */
@@ -14157,8 +14157,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
14157
14157
  },
14158
14158
  placeholder: () => placeholderStyles,
14159
14159
  container: ({ selectProps }) => {
14160
- const containerBorderStyles = selectProps?.menuIsOpen ? 'tw:rounded-t-md' : 'tw:rounded-md';
14161
- return `${textStyles} ${extraClassNames} ${containerBorderStyles} tw:pointer-events-auto!`;
14160
+ return `${textStyles} ${extraClassNames} tw:pointer-events-auto!`;
14162
14161
  },
14163
14162
  input: () => textStyles + ' specSelectInput',
14164
14163
  menuList: () => menuListStyles,
@@ -14567,7 +14566,7 @@ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
14567
14566
  const Dialog = Root$4;
14568
14567
  const DialogPortal = Portal$1;
14569
14568
  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
14569
+ 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
14570
  tw:gap-4 tw:border tw:bg-sq-white tw:dark:bg-sq-dark-background tw:shadow-lg tw:duration-200
14572
14571
  tw:rounded-lg ${className}`, ...props, children: [jsx$1(DialogTitle$1, { className: "tw:hidden" }), children] })] })));
14573
14572
  DialogContent.displayName = Content$2.displayName;
@@ -14579,7 +14578,7 @@ const DialogTitle = React__default.forwardRef((props, ref) => jsx$1(Title, { ref
14579
14578
  DialogTitle.displayName = Title.displayName;
14580
14579
  const DialogDescription = React__default.forwardRef((props, ref) => jsx$1(Description, { ref: ref, ...props }));
14581
14580
  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, }) => {
14581
+ 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
14582
  const [isLoading, setIsLoading] = useState(false);
14584
14583
  // the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
14585
14584
  useEffect(() => {
@@ -14617,7 +14616,7 @@ const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, sub
14617
14616
  }
14618
14617
  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
14618
  };
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!`, {
14619
+ 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
14620
  'tw:max-w-xs': size === 'xs',
14622
14621
  'tw:max-w-sm': size === 'sm',
14623
14622
  'tw:max-w-md': size === 'md',
@@ -16685,7 +16684,7 @@ const Alert = ({ children, dismissible = true, onClose, show = true, variant, te
16685
16684
  theme: `${lightTheme$1} ${darkTheme$1}`,
16686
16685
  formulaError: 'tw:text-red-800 tw:bg-red-200 tw:rounded-[0.25rem]!',
16687
16686
  danger: 'tw:text-sq-text-color tw:bg-sq-danger',
16688
- warning: 'tw:bg-sq-bg-warning tw:text-sq-text-color',
16687
+ warning: 'tw:bg-sq-bg-warning tw:text-sq-text-color tw:dark:text-sq-multi-gray-dark',
16689
16688
  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
16689
  };
16691
16690
  const appliedBorderTheme = {
@@ -16721,8 +16720,8 @@ const SvgIcon = ({ onClick, icon, color, type = 'default', extraClassNames, view
16721
16720
  const appliedClassNames = `${onClick ? 'tw:cursor-pointer' : ''} ${extraClassNames} tw:focus:outline-none tw:focus-visible:outline-none
16722
16721
  tw:outline-none`;
16723
16722
  const tooltipData = getQTipData(tooltipProps);
16724
- const appliedType = type === 'default' ? 'currentColor' : 'rgb(var(--sq-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:sq-icon tw:dark:text-sq-white`, viewBox: viewBox, fill: color ? color : appliedType, "data-testid": testId, children: jsx$1("path", { d: getSvgIconPath(icon) }) }) }));
16723
+ const appliedType = type === 'default' ? 'currentColor' : 'var(--theme-icon)';
16724
+ 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
16725
  };
16727
16726
 
16728
16727
  const SeeqActionDropdownItem = (item) => {
@@ -16787,20 +16786,30 @@ const borderColorClasses = [
16787
16786
  'tw:focus:border-sq-theme-dark',
16788
16787
  'tw:active:border-sq-theme-dark',
16789
16788
  ].join(' ');
16790
- const fieldBorderRadius = 'tw:rounded-l-md tw:rounded-r-none';
16791
- const fieldClasses = 'tw:leading-normal tw:outline-none tw:py-1 tw:px-3' + 'tw:p-1 tw:border-solid tw:border';
16789
+ const fieldClasses = 'tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:p-1 tw:border-solid tw:border';
16792
16790
  const darkTheme = 'tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-disabled-gray';
16793
16791
  const lightTheme = 'tw:text-sq-text-color tw:disabled:text-sq-darkish-gray';
16794
16792
  /**
16795
16793
  * InputGroup.
16796
16794
  */
16797
16795
  const InputGroup = React__default.forwardRef((props, ref) => {
16798
- 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;
16796
+ 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;
16799
16797
  const tooltipData = getQTipData(tooltipProps);
16800
16798
  const appliedClasses = `${baseClasses$1} ${extraClassNames}`;
16801
- const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
16802
16799
  const elementsToAppend = append.filter(Boolean);
16803
- return (jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsx$1("div", { "data-testid": testId, className: `tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${fieldAppliedClasses}`, children: field })) : (jsx$1(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) => {
16800
+ const effectiveInputGroup = inputGroup ?? (elementsToAppend.length > 0 ? 'left' : undefined);
16801
+ const fieldBorderRadius = effectiveInputGroup === 'left'
16802
+ ? 'tw:rounded-l-md tw:rounded-r-none'
16803
+ : effectiveInputGroup === 'right'
16804
+ ? 'tw:rounded-r-md tw:rounded-l-none'
16805
+ : 'tw:rounded-md';
16806
+ const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
16807
+ // Only pass inputGroup to React components (not DOM elements like div, span, etc.)
16808
+ const isReactComponent = React__default.isValidElement(field) && typeof field.type !== 'string';
16809
+ const fieldWithInputGroup = isReactComponent
16810
+ ? React__default.cloneElement(field, { inputGroup: effectiveInputGroup })
16811
+ : field;
16812
+ return (jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsx$1("div", { "data-testid": testId, className: `tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${fieldAppliedClasses}`, children: fieldWithInputGroup })) : (jsx$1(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) => {
16804
16813
  return item?.variant === 'button' ? (jsx$1(Button, { extraClassNames: `$
16805
16814
  index ? 'tw:-ml-px' : 'tw:ml-0'
16806
16815
  } tw:focus:z-40 tw:focus:border tw:rounded-none tw:last:rounded-r-md`, ...item.buttonProps }, index)) : (jsx$1("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));
@@ -16860,8 +16869,7 @@ function formatErrorMessage(message, errorCode) {
16860
16869
 
16861
16870
  let warning = () => { };
16862
16871
  let invariant = () => { };
16863
- if (typeof process !== "undefined" &&
16864
- process.env?.NODE_ENV !== "production") {
16872
+ if (process.env.NODE_ENV !== "production") {
16865
16873
  warning = (check, message, errorCode) => {
16866
16874
  if (!check && typeof console !== "undefined") {
16867
16875
  console.warn(formatErrorMessage(message, errorCode));
@@ -17317,17 +17325,6 @@ const isCSSVariableToken = (value) => {
17317
17325
  return singleCssVariableRegex.test(value.split("/*")[0].trim());
17318
17326
  };
17319
17327
  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
17328
 
17332
17329
  const number = {
17333
17330
  test: (v) => typeof v === "number",
@@ -19125,12 +19122,6 @@ class NativeAnimation extends WithPromise {
19125
19122
  super();
19126
19123
  this.finishedTime = null;
19127
19124
  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
19125
  if (!options)
19135
19126
  return;
19136
19127
  const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
@@ -19166,7 +19157,6 @@ class NativeAnimation extends WithPromise {
19166
19157
  play() {
19167
19158
  if (this.isStopped)
19168
19159
  return;
19169
- this.manualStartTime = null;
19170
19160
  this.animation.play();
19171
19161
  if (this.state === "finished") {
19172
19162
  this.updateFinished();
@@ -19230,7 +19220,6 @@ class NativeAnimation extends WithPromise {
19230
19220
  return millisecondsToSeconds(Number(this.animation.currentTime) || 0);
19231
19221
  }
19232
19222
  set time(newTime) {
19233
- this.manualStartTime = null;
19234
19223
  this.finishedTime = null;
19235
19224
  this.animation.currentTime = secondsToMilliseconds(newTime);
19236
19225
  }
@@ -19253,10 +19242,10 @@ class NativeAnimation extends WithPromise {
19253
19242
  : this.animation.playState;
19254
19243
  }
19255
19244
  get startTime() {
19256
- return this.manualStartTime ?? Number(this.animation.startTime);
19245
+ return Number(this.animation.startTime);
19257
19246
  }
19258
19247
  set startTime(newStartTime) {
19259
- this.manualStartTime = this.animation.startTime = newStartTime;
19248
+ this.animation.startTime = newStartTime;
19260
19249
  }
19261
19250
  /**
19262
19251
  * Attaches a timeline to the animation, for instance the `ScrollTimeline`.
@@ -19318,7 +19307,7 @@ class NativeAnimationExtended extends NativeAnimation {
19318
19307
  */
19319
19308
  replaceTransitionType(options);
19320
19309
  super(options);
19321
- if (options.startTime !== undefined) {
19310
+ if (options.startTime) {
19322
19311
  this.startTime = options.startTime;
19323
19312
  }
19324
19313
  this.options = options;
@@ -19326,7 +19315,7 @@ class NativeAnimationExtended extends NativeAnimation {
19326
19315
  /**
19327
19316
  * WAAPI doesn't natively have any interruption capabilities.
19328
19317
  *
19329
- * Rather than read committed styles back out of the DOM, we can
19318
+ * Rather than read commited styles back out of the DOM, we can
19330
19319
  * create a renderless JS animation and sample it twice to calculate
19331
19320
  * its current value, "previous" value, and therefore allow
19332
19321
  * Motion to calculate velocity for any subsequent animation.
@@ -19343,14 +19332,8 @@ class NativeAnimationExtended extends NativeAnimation {
19343
19332
  ...options,
19344
19333
  autoplay: false,
19345
19334
  });
19346
- /**
19347
- * Use wall-clock elapsed time for sampling.
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);
19335
+ const sampleTime = secondsToMilliseconds(this.finishedTime ?? this.time);
19336
+ motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
19354
19337
  sampleAnimation.stop();
19355
19338
  }
19356
19339
  }
@@ -19528,7 +19511,7 @@ class AsyncMotionValueAnimation extends WithPromise {
19528
19511
  * progress, which would feel snappier.
19529
19512
  *
19530
19513
  * However, if there's a delay (main thread work) between the creation of
19531
- * the animation and the first committed frame, we prefer to use resolvedAt
19514
+ * the animation and the first commited frame, we prefer to use resolvedAt
19532
19515
  * to avoid a sudden jump into the animation.
19533
19516
  */
19534
19517
  const startTime = sync
@@ -19797,36 +19780,17 @@ const numberValueTypes = {
19797
19780
  right: px,
19798
19781
  bottom: px,
19799
19782
  left: px,
19800
- inset: px,
19801
- insetBlock: px,
19802
- insetBlockStart: px,
19803
- insetBlockEnd: px,
19804
- insetInline: px,
19805
- insetInlineStart: px,
19806
- insetInlineEnd: px,
19807
19783
  // Spacing props
19808
19784
  padding: px,
19809
19785
  paddingTop: px,
19810
19786
  paddingRight: px,
19811
19787
  paddingBottom: px,
19812
19788
  paddingLeft: px,
19813
- paddingBlock: px,
19814
- paddingBlockStart: px,
19815
- paddingBlockEnd: px,
19816
- paddingInline: px,
19817
- paddingInlineStart: px,
19818
- paddingInlineEnd: px,
19819
19789
  margin: px,
19820
19790
  marginTop: px,
19821
19791
  marginRight: px,
19822
19792
  marginBottom: px,
19823
19793
  marginLeft: px,
19824
- marginBlock: px,
19825
- marginBlockStart: px,
19826
- marginBlockEnd: px,
19827
- marginInline: px,
19828
- marginInlineStart: px,
19829
- marginInlineEnd: px,
19830
19794
  // Misc
19831
19795
  backgroundPositionX: px,
19832
19796
  backgroundPositionY: px,
@@ -19944,16 +19908,6 @@ class DOMKeyframesResolver extends KeyframeResolver {
19944
19908
  const [origin, target] = unresolvedKeyframes;
19945
19909
  const originType = findDimensionValueType(origin);
19946
19910
  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
19911
  /**
19958
19912
  * Either we don't recognise these value types or we can animate between them.
19959
19913
  */
@@ -20488,24 +20442,16 @@ const isPrimaryPointer = (event) => {
20488
20442
  }
20489
20443
  };
20490
20444
 
20491
- const interactiveElements = new Set([
20445
+ const focusableElements = new Set([
20492
20446
  "BUTTON",
20493
20447
  "INPUT",
20494
20448
  "SELECT",
20495
20449
  "TEXTAREA",
20496
20450
  "A",
20497
20451
  ]);
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
20452
  function isElementKeyboardAccessible(element) {
20507
- return (interactiveElements.has(element.tagName) ||
20508
- element.isContentEditable === true);
20453
+ return (focusableElements.has(element.tagName) ||
20454
+ element.tabIndex !== -1);
20509
20455
  }
20510
20456
 
20511
20457
  const isPressing = new WeakSet();