@indico-data/design-system 3.17.0 → 3.18.0

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.
@@ -1,2 +1,2 @@
1
1
  import { FloatUIProps } from './types';
2
- export declare function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal, portalOptions, floatingOptions, className, hover, onOpenChange, }: FloatUIProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal, portalOptions, floatingOptions, className, hover, onOpenChange, disableAutoUpdate, }: FloatUIProps): import("react/jsx-runtime").JSX.Element;
@@ -22,4 +22,6 @@ export type FloatUIProps = {
22
22
  hover?: boolean;
23
23
  /** Callback function to be called when the FloatUI is opened or closed. */
24
24
  onOpenChange?: (isOpen: boolean) => void;
25
+ /** If true, disables automatic position updates when the reference element moves (e.g., due to layout shifts). Defaults to false. */
26
+ disableAutoUpdate?: boolean;
25
27
  };
package/lib/index.d.ts CHANGED
@@ -762,9 +762,11 @@ type FloatUIProps = {
762
762
  hover?: boolean;
763
763
  /** Callback function to be called when the FloatUI is opened or closed. */
764
764
  onOpenChange?: (isOpen: boolean) => void;
765
+ /** If true, disables automatic position updates when the reference element moves (e.g., due to layout shifts). Defaults to false. */
766
+ disableAutoUpdate?: boolean;
765
767
  };
766
768
 
767
- declare function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal, portalOptions, floatingOptions, className, hover, onOpenChange, }: FloatUIProps): react_jsx_runtime.JSX.Element;
769
+ declare function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal, portalOptions, floatingOptions, className, hover, onOpenChange, disableAutoUpdate, }: FloatUIProps): react_jsx_runtime.JSX.Element;
768
770
 
769
771
  type MenuProps = {
770
772
  children: React$1.ReactNode;
package/lib/index.esm.js CHANGED
@@ -13845,8 +13845,8 @@ const defaultOptions$1 = {
13845
13845
  placement: 'bottom-start',
13846
13846
  middleware: [offset$2(5), flip$2(), shift$2()],
13847
13847
  };
13848
- function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal = false, portalOptions = {}, floatingOptions = defaultOptions$1, className, hover = false, onOpenChange, }) {
13849
- var _a;
13848
+ function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal = false, portalOptions = {}, floatingOptions = defaultOptions$1, className, hover = false, onOpenChange, disableAutoUpdate = false, }) {
13849
+ var _a, _b;
13850
13850
  const [internalIsOpen, setInternalIsOpen] = useState(false);
13851
13851
  // Determine whether the component is controlled or uncontrolled
13852
13852
  const isControlled = controlledIsOpen !== undefined && controlledSetIsOpen !== undefined;
@@ -13866,7 +13866,9 @@ function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: con
13866
13866
  const { refs, floatingStyles, context } = useFloating(Object.assign(Object.assign({}, floatingOptions), { open: isOpen, onOpenChange: (isOpen) => {
13867
13867
  setIsOpen(isOpen);
13868
13868
  onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpen);
13869
- }, elements: {
13869
+ }, whileElementsMounted: disableAutoUpdate
13870
+ ? undefined
13871
+ : ((_b = floatingOptions.whileElementsMounted) !== null && _b !== void 0 ? _b : autoUpdate$1), elements: {
13870
13872
  reference: referenceElement,
13871
13873
  } }));
13872
13874
  // Can't call hooks conditionally so this enabled option is needed.