@lumx/react 4.13.0-next.0 → 4.13.0-next.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/index.d.ts CHANGED
@@ -4020,6 +4020,8 @@ interface RenderOptionContext {
4020
4020
  index: number;
4021
4021
  /** Resolved option id (from `getOptionId`). Should be passed as `value` to `<Combobox.Option>`. */
4022
4022
  value: any;
4023
+ /** Resolved option name (from `getOptionName`, falling back to `getOptionId`). */
4024
+ name: string;
4023
4025
  /** Whether this option is currently selected. Should be forwarded as `isSelected`. */
4024
4026
  isSelected: boolean;
4025
4027
  /** Resolved description string (from `getOptionDescription`), if any. Should be forwarded as `description`. */
package/index.js CHANGED
@@ -16856,7 +16856,7 @@ function renderSelectOptions(props, components) {
16856
16856
  const selectedIds = selected ? new Set((Array.isArray(selected) ? selected : [selected]).map(s => getWithSelector(getOptionId, s))) : undefined;
16857
16857
  return options?.map((item, index) => {
16858
16858
  const id = getWithSelector(getOptionId || getOptionName, item);
16859
- const name = getWithSelector(getOptionName || getOptionId, item);
16859
+ const name = getWithSelector(getOptionName || getOptionId, item) || id;
16860
16860
  const description = getOptionDescription && getWithSelector(getOptionDescription, item);
16861
16861
  const isSelected = selectedIds?.has(id) ?? false;
16862
16862
 
@@ -16867,6 +16867,7 @@ function renderSelectOptions(props, components) {
16867
16867
  return renderOption(item, {
16868
16868
  index,
16869
16869
  value: id,
16870
+ name,
16870
16871
  isSelected,
16871
16872
  description
16872
16873
  });
@@ -16999,6 +17000,7 @@ SelectButton$2.className = CLASSNAME$m;
16999
17000
  * - If `renderOption` is `undefined`, returns `undefined` (no custom rendering).
17000
17001
  * - If the consumer returns a `<Combobox.Option>`, its props/children are merged with the
17001
17002
  * core-computed `value` / `isSelected` / `description` / `key`.
17003
+ * When the consumer's `<Combobox.Option>` has no children, falls back to the option `name`.
17002
17004
  * - If the consumer returns anything else, returns `null` (skips the option).
17003
17005
  *
17004
17006
  * @param renderOption Consumer-provided render function.
@@ -17010,14 +17012,15 @@ function wrapRenderOption(renderOption) {
17010
17012
  index,
17011
17013
  value: optionValue,
17012
17014
  isSelected,
17013
- description
17015
+ description,
17016
+ name
17014
17017
  }) => {
17015
17018
  const node = renderOption(option, index);
17016
17019
  if (!isComponentType(ComboboxOption)(node)) {
17017
17020
  return null;
17018
17021
  }
17019
17022
  const {
17020
- children,
17023
+ children = name,
17021
17024
  ...customProps
17022
17025
  } = node.props;
17023
17026
  return /*#__PURE__*/jsx(ComboboxOption, {