@wistia/ui 0.15.3 → 0.15.5-beta.07e00e61.68f1236

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.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.15.3
3
+ * @license @wistia/ui v0.15.5-beta.07e00e61.68f1236
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -9780,12 +9780,12 @@ var Form = (0, import_react36.forwardRef)(
9780
9780
  ref,
9781
9781
  $fullWidth: fullWidth,
9782
9782
  alignItems: fullWidth ? "stretch" : "flex-start",
9783
- as: StyledForm,
9784
9783
  gap: "space-05",
9785
9784
  id,
9786
9785
  onBlur: handleBlur2,
9787
9786
  onReset: handleReset,
9788
9787
  onSubmit: handleSubmit,
9788
+ renderAs: StyledForm,
9789
9789
  children
9790
9790
  }
9791
9791
  ) })
@@ -12830,12 +12830,15 @@ var Combobox2 = ({
12830
12830
  onSearchValueChange,
12831
12831
  displayValues = defaultDisplayValues,
12832
12832
  children,
12833
+ flipPopover = true,
12833
12834
  fullWidth = true
12834
12835
  }) => {
12836
+ const [isOpen, setIsOpen] = (0, import_react54.useState)(false);
12835
12837
  const [isPending, startTransition] = (0, import_react54.useTransition)();
12836
12838
  const [wrapperWidth, setWrapperWidth] = (0, import_react54.useState)("auto");
12837
12839
  const comboboxWrapperRef = (0, import_react54.useRef)(null);
12838
12840
  const options = (0, import_react54.useMemo)(() => extractOptions(children), [children]);
12841
+ const isMultiSelect = (0, import_type_guards37.isArray)(value);
12839
12842
  (0, import_react54.useEffect)(() => {
12840
12843
  const comboboxWrapper = comboboxWrapperRef.current;
12841
12844
  if (comboboxWrapper) {
@@ -12856,7 +12859,7 @@ var Combobox2 = ({
12856
12859
  onChange("");
12857
12860
  return;
12858
12861
  }
12859
- onChange(typeof value === "string" ? "" : value.filter((val) => val !== valueToRemove));
12862
+ onChange((0, import_type_guards37.isString)(value) ? "" : value.filter((val) => val !== valueToRemove));
12860
12863
  };
12861
12864
  const matches = (0, import_react54.useMemo)(() => {
12862
12865
  return (0, import_match_sorter.matchSorter)(Object.keys(options), searchValue);
@@ -12864,13 +12867,16 @@ var Combobox2 = ({
12864
12867
  return /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
12865
12868
  Ariakit.ComboboxProvider,
12866
12869
  {
12870
+ open: isOpen,
12867
12871
  selectedValue: value,
12872
+ setOpen: setIsOpen,
12868
12873
  setSelectedValue: onChange,
12869
12874
  setValue: (nextValue) => {
12870
12875
  startTransition(() => {
12871
12876
  onSearchValueChange(nextValue);
12872
12877
  });
12873
12878
  },
12879
+ value: !isOpen && !isMultiSelect ? value : searchValue,
12874
12880
  children: [
12875
12881
  /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
12876
12882
  ComboboxWrapper,
@@ -12878,7 +12884,7 @@ var Combobox2 = ({
12878
12884
  ref: comboboxWrapperRef,
12879
12885
  $fullWidth: fullWidth,
12880
12886
  children: [
12881
- displayValues(value, handleRemoveValue),
12887
+ isMultiSelect ? displayValues(value, handleRemoveValue) : null,
12882
12888
  /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
12883
12889
  ComboboxInput,
12884
12890
  {
@@ -12893,7 +12899,9 @@ var Combobox2 = ({
12893
12899
  ComboboxPopover2,
12894
12900
  {
12895
12901
  "aria-busy": isPending,
12902
+ flip: flipPopover,
12896
12903
  gutter: 8,
12904
+ onClose: () => onSearchValueChange(""),
12897
12905
  sameWidth: false,
12898
12906
  style: {
12899
12907
  width: wrapperWidth