@indico-data/design-system 3.14.0 → 3.15.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.
package/lib/index.js CHANGED
@@ -13852,6 +13852,7 @@ const defaultOptions$1 = {
13852
13852
  middleware: [offset$2(5), flip$2(), shift$2()],
13853
13853
  };
13854
13854
  function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal = false, portalOptions = {}, floatingOptions = defaultOptions$1, className, hover = false, onOpenChange, }) {
13855
+ var _a;
13855
13856
  const [internalIsOpen, setInternalIsOpen] = React.useState(false);
13856
13857
  // Determine whether the component is controlled or uncontrolled
13857
13858
  const isControlled = controlledIsOpen !== undefined && controlledSetIsOpen !== undefined;
@@ -13867,11 +13868,12 @@ function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: con
13867
13868
  if (!React.isValidElement(trigger) || !React.isValidElement(content)) {
13868
13869
  throw new Error('Both children of FloatUI must be valid React elements.');
13869
13870
  }
13871
+ const referenceElement = ((_a = floatingOptions.elements) === null || _a === void 0 ? void 0 : _a.reference) || referenceElementRef.current;
13870
13872
  const { refs, floatingStyles, context } = useFloating(Object.assign(Object.assign({}, floatingOptions), { open: isOpen, onOpenChange: (isOpen) => {
13871
13873
  setIsOpen(isOpen);
13872
13874
  onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpen);
13873
13875
  }, elements: {
13874
- reference: referenceElementRef.current,
13876
+ reference: referenceElement,
13875
13877
  } }));
13876
13878
  // Can't call hooks conditionally so this enabled option is needed.
13877
13879
  const click = useClick(context, { enabled: !hover });