@homebound/beam 2.416.0-alpha.1 → 2.416.1

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
@@ -10567,23 +10567,22 @@ function TreeSelectFieldBase(props) {
10567
10567
  }));
10568
10568
  }
10569
10569
  }
10570
+ const comboBoxChildren = (0, import_react47.useCallback)(
10571
+ ([item]) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react_stately6.Item, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item))),
10572
+ [getOptionValue, getOptionLabel, getOptionMenuLabel]
10573
+ );
10570
10574
  const comboBoxProps = {
10571
10575
  ...otherProps,
10572
10576
  disabledKeys: Object.keys(disabledOptionsWithReasons),
10573
10577
  placeholder: !values || values.length === 0 ? placeholder : "",
10574
10578
  label: props.label,
10575
10579
  inputValue: fieldState.inputValue,
10576
- // where we might want to do flatmap and return diff kind of array (children ? add level prop) inside children callback - can put markup wrapper div adds padding
10577
- // so we're not doing it multiple places
10578
10580
  items: fieldState.filteredOptions,
10579
10581
  isDisabled,
10580
10582
  isReadOnly,
10581
10583
  onInputChange,
10582
10584
  onOpenChange,
10583
- children: ([item]) => (
10584
- // what we're telling it to render. look at padding here - don't have to pass down to tree option - filtered options is where we're flat mapping
10585
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react_stately6.Item, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item)))
10586
- )
10585
+ children: comboBoxChildren
10587
10586
  };
10588
10587
  const state = (0, import_react_stately6.useComboBoxState)({
10589
10588
  ...comboBoxProps,
@@ -11101,6 +11100,10 @@ function ComboBoxBase(props) {
11101
11100
  const listBoxRef = (0, import_react49.useRef)(null);
11102
11101
  const popoverRef = (0, import_react49.useRef)(null);
11103
11102
  const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
11103
+ const comboBoxChildren = (0, import_react49.useCallback)(
11104
+ (item) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react_stately7.Item, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item))),
11105
+ [getOptionValue, getOptionLabel, getOptionMenuLabel]
11106
+ );
11104
11107
  const comboBoxProps = {
11105
11108
  ...otherProps,
11106
11109
  disabledKeys: Object.keys(disabledOptionsWithReasons),
@@ -11110,7 +11113,7 @@ function ComboBoxBase(props) {
11110
11113
  isReadOnly,
11111
11114
  onInputChange,
11112
11115
  onOpenChange,
11113
- children: (item) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react_stately7.Item, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item)))
11116
+ children: comboBoxChildren
11114
11117
  };
11115
11118
  const state = (0, import_react_stately7.useComboBoxState)({
11116
11119
  ...comboBoxProps,
@@ -11310,6 +11313,10 @@ function Autocomplete(props) {
11310
11313
  ...others
11311
11314
  } = props;
11312
11315
  const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
11316
+ const comboBoxChildren = (0, import_react50.useCallback)(
11317
+ (item) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_stately8.Item, { textValue: getOptionLabel(item), children: getOptionMenuLabel ? getOptionMenuLabel(item) : getOptionLabel(item) }, getOptionValue(item)),
11318
+ [getOptionValue, getOptionLabel, getOptionMenuLabel]
11319
+ );
11313
11320
  const comboBoxProps = {
11314
11321
  isDisabled: !!disabled,
11315
11322
  disabledKeys: Object.keys(disabledOptionsWithReasons),
@@ -11318,7 +11325,7 @@ function Autocomplete(props) {
11318
11325
  items: options,
11319
11326
  // Allow the user to type in a value that is not in the list. Allows for the text to stay in the input when the user clicks away
11320
11327
  allowsCustomValue: true,
11321
- children: (item) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_stately8.Item, { textValue: getOptionLabel(item), children: getOptionMenuLabel ? getOptionMenuLabel(item) : getOptionLabel(item) }, getOptionValue(item)),
11328
+ children: comboBoxChildren,
11322
11329
  onSelectionChange: (key) => {
11323
11330
  if (key == null) return;
11324
11331
  const selectedItem = options.find((i) => getOptionValue(i) === key);