@lumx/react 4.25.1-alpha.0 → 4.25.1-alpha.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.
Files changed (3) hide show
  1. package/index.js +21 -15
  2. package/index.js.map +1 -1
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -18603,26 +18603,29 @@ function getOptionDisplayName(value, getOptionName, getOptionId) {
18603
18603
  }
18604
18604
 
18605
18605
  /**
18606
- * Get the selection state icons of an option. The icon is always rendered after the label.
18606
+ * Selection state icon of an option. The icon is always rendered after the label.
18607
18607
  *
18608
18608
  * - `single`: a check circle icon when selected, a blank radio icon otherwise.
18609
18609
  * - `multiple`: a checkbox icon, marked or blank.
18610
18610
  */
18611
- function getSelectionIcons(selectionType, isSelected) {
18612
- const color = isSelected ? 'primary' : undefined;
18611
+ const SelectionIcon = ({
18612
+ selectionType,
18613
+ isSelected
18614
+ }) => {
18615
+ let icon;
18613
18616
  if (selectionType === 'multiple') {
18614
- return Icon$1({
18615
- icon: isSelected ? mdiCheckboxMarked : mdiCheckboxBlankOutline,
18616
- color
18617
- });
18617
+ icon = isSelected ? mdiCheckboxMarked : mdiCheckboxBlankOutline;
18618
18618
  } else if (selectionType === 'single') {
18619
- return Icon$1({
18620
- icon: isSelected ? mdiCheckCircle : mdiRadioboxBlank,
18621
- color
18622
- });
18619
+ icon = isSelected ? mdiCheckCircle : mdiRadioboxBlank;
18620
+ } else {
18621
+ return null;
18623
18622
  }
18624
- return null;
18625
- }
18623
+ return /*#__PURE__*/jsx(Icon$1, {
18624
+ icon: icon,
18625
+ color: isSelected ? 'primary' : undefined,
18626
+ className: "lumx-combobox-option__selection-icon"
18627
+ });
18628
+ };
18626
18629
 
18627
18630
  /**
18628
18631
  * Render options as ComboboxOption elements.
@@ -18673,7 +18676,10 @@ function renderSelectOptions(props, components) {
18673
18676
  const name = getWithSelector(getOptionName || getOptionId, item) || id;
18674
18677
  const description = getOptionDescription && getWithSelector(getOptionDescription, item);
18675
18678
  const isSelected = selectedIds?.has(id) ?? false;
18676
- const after = getSelectionIcons(selectionType, isSelected);
18679
+ const after = /*#__PURE__*/jsx(SelectionIcon, {
18680
+ selectionType: selectionType,
18681
+ isSelected: isSelected
18682
+ });
18677
18683
 
18678
18684
  // Delegate to the consumer's render function when provided.
18679
18685
  // The consumer receives core-computed context and is responsible for rendering
@@ -18856,7 +18862,7 @@ function wrapRenderOption(renderOption) {
18856
18862
  isSelected: isSelected,
18857
18863
  description: description,
18858
18864
  after: /*#__PURE__*/jsxs(Fragment, {
18859
- children: [cusomAfter, after]
18865
+ children: [customAfter, after]
18860
18866
  }),
18861
18867
  children: children
18862
18868
  }, optionValue);