@ceed/ads 1.19.0-next.1 → 1.19.0-next.2

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
@@ -443,11 +443,6 @@ var itemHeightMap = {
443
443
  md: { default: 36, secondary: 55 },
444
444
  lg: { default: 44, secondary: 65 }
445
445
  };
446
- var optionPaddingMap = {
447
- sm: { px: "8px", py: "3px" },
448
- md: { px: "12px", py: "4px" },
449
- lg: { px: "16px", py: "6px" }
450
- };
451
446
  var AutocompleteListBox = import_react6.default.forwardRef((props, ref) => {
452
447
  const {
453
448
  anchorEl,
@@ -492,7 +487,7 @@ var AutocompleteListBox = import_react6.default.forwardRef((props, ref) => {
492
487
  virtualizer.measure();
493
488
  }
494
489
  }, [open, virtualizer]);
495
- return /* @__PURE__ */ import_react6.default.createElement(AutocompletePopper, { ref, anchorEl, open, modifiers }, /* @__PURE__ */ import_react6.default.createElement(import_joy10.AutocompleteListbox, { ...innerProps }, /* @__PURE__ */ import_react6.default.createElement("div", { ref: parentRef, style: { overflow: "auto" } }, /* @__PURE__ */ import_react6.default.createElement(
490
+ return /* @__PURE__ */ import_react6.default.createElement(AutocompletePopper, { ref, anchorEl, open, modifiers }, /* @__PURE__ */ import_react6.default.createElement(import_joy10.AutocompleteListbox, { ...innerProps, size: fontSize }, /* @__PURE__ */ import_react6.default.createElement("div", { ref: parentRef, style: { overflow: "auto" } }, /* @__PURE__ */ import_react6.default.createElement(
496
491
  "div",
497
492
  {
498
493
  style: {
@@ -549,6 +544,12 @@ var AutocompleteTagDelete = (0, import_joy10.styled)(IconButton_default, {
549
544
  minHeight: autocompleteDeleteSize[size],
550
545
  borderRadius: "50%"
551
546
  }));
547
+ var autocompleteFilterOptions = (0, import_base.createFilterOptions)({
548
+ stringify: (option) => {
549
+ return option.secondaryText ? `${option.label} ${option.secondaryText}` : option.label;
550
+ }
551
+ });
552
+ var getOptionLabel = (option) => `${option.label ?? ""}`;
552
553
  function Autocomplete(props) {
553
554
  const {
554
555
  label,
@@ -624,6 +625,14 @@ function Autocomplete(props) {
624
625
  () => applySize(value?.endDecorator || props.endDecorator),
625
626
  [value, applySize, props.endDecorator]
626
627
  );
628
+ const slotProps = (0, import_react6.useMemo)(
629
+ () => ({
630
+ listbox: {
631
+ hasSecondaryText: options.some((opt) => opt.secondaryText)
632
+ }
633
+ }),
634
+ [options]
635
+ );
627
636
  const handleChange = (0, import_react6.useCallback)(
628
637
  (event, value2) => {
629
638
  const newValue = value2;
@@ -654,7 +663,7 @@ function Autocomplete(props) {
654
663
  disabled,
655
664
  startDecorator,
656
665
  endDecorator,
657
- getOptionLabel: (option) => `${option.label ?? ""}`,
666
+ getOptionLabel,
658
667
  renderTags: (tags, getTagProps) => tags.map((tag, index) => {
659
668
  const { onClick, ...rest } = getTagProps({ index });
660
669
  return applySize(
@@ -666,18 +675,9 @@ function Autocomplete(props) {
666
675
  slots: {
667
676
  listbox: AutocompleteListBox
668
677
  },
669
- slotProps: {
670
- listbox: {
671
- hasSecondaryText: options.some((opt) => opt.secondaryText)
672
- }
673
- },
674
- filterOptions: (0, import_base.createFilterOptions)({
675
- stringify: (option) => {
676
- const opt = option;
677
- return opt.secondaryText ? `${opt.label} ${opt.secondaryText}` : opt.label;
678
- }
679
- }),
680
- renderOption: (props2, option) => /* @__PURE__ */ import_react6.default.createElement(import_joy10.AutocompleteOption, { ...props2, sx: optionPaddingMap[size ?? "md"] }, option.startDecorator && /* @__PURE__ */ import_react6.default.createElement(
678
+ slotProps,
679
+ filterOptions: autocompleteFilterOptions,
680
+ renderOption: (props2, option) => /* @__PURE__ */ import_react6.default.createElement(import_joy10.AutocompleteOption, { ...props2 }, option.startDecorator && /* @__PURE__ */ import_react6.default.createElement(
681
681
  import_joy10.ListItemDecorator,
682
682
  {
683
683
  sx: (theme) => ({
package/dist/index.js CHANGED
@@ -347,11 +347,6 @@ var itemHeightMap = {
347
347
  md: { default: 36, secondary: 55 },
348
348
  lg: { default: 44, secondary: 65 }
349
349
  };
350
- var optionPaddingMap = {
351
- sm: { px: "8px", py: "3px" },
352
- md: { px: "12px", py: "4px" },
353
- lg: { px: "16px", py: "6px" }
354
- };
355
350
  var AutocompleteListBox = React5.forwardRef((props, ref) => {
356
351
  const {
357
352
  anchorEl,
@@ -396,7 +391,7 @@ var AutocompleteListBox = React5.forwardRef((props, ref) => {
396
391
  virtualizer.measure();
397
392
  }
398
393
  }, [open, virtualizer]);
399
- return /* @__PURE__ */ React5.createElement(AutocompletePopper, { ref, anchorEl, open, modifiers }, /* @__PURE__ */ React5.createElement(JoyAutocompleteListbox, { ...innerProps }, /* @__PURE__ */ React5.createElement("div", { ref: parentRef, style: { overflow: "auto" } }, /* @__PURE__ */ React5.createElement(
394
+ return /* @__PURE__ */ React5.createElement(AutocompletePopper, { ref, anchorEl, open, modifiers }, /* @__PURE__ */ React5.createElement(JoyAutocompleteListbox, { ...innerProps, size: fontSize }, /* @__PURE__ */ React5.createElement("div", { ref: parentRef, style: { overflow: "auto" } }, /* @__PURE__ */ React5.createElement(
400
395
  "div",
401
396
  {
402
397
  style: {
@@ -453,6 +448,12 @@ var AutocompleteTagDelete = styled3(IconButton_default, {
453
448
  minHeight: autocompleteDeleteSize[size],
454
449
  borderRadius: "50%"
455
450
  }));
451
+ var autocompleteFilterOptions = createFilterOptions({
452
+ stringify: (option) => {
453
+ return option.secondaryText ? `${option.label} ${option.secondaryText}` : option.label;
454
+ }
455
+ });
456
+ var getOptionLabel = (option) => `${option.label ?? ""}`;
456
457
  function Autocomplete(props) {
457
458
  const {
458
459
  label,
@@ -528,6 +529,14 @@ function Autocomplete(props) {
528
529
  () => applySize(value?.endDecorator || props.endDecorator),
529
530
  [value, applySize, props.endDecorator]
530
531
  );
532
+ const slotProps = useMemo(
533
+ () => ({
534
+ listbox: {
535
+ hasSecondaryText: options.some((opt) => opt.secondaryText)
536
+ }
537
+ }),
538
+ [options]
539
+ );
531
540
  const handleChange = useCallback2(
532
541
  (event, value2) => {
533
542
  const newValue = value2;
@@ -558,7 +567,7 @@ function Autocomplete(props) {
558
567
  disabled,
559
568
  startDecorator,
560
569
  endDecorator,
561
- getOptionLabel: (option) => `${option.label ?? ""}`,
570
+ getOptionLabel,
562
571
  renderTags: (tags, getTagProps) => tags.map((tag, index) => {
563
572
  const { onClick, ...rest } = getTagProps({ index });
564
573
  return applySize(
@@ -570,18 +579,9 @@ function Autocomplete(props) {
570
579
  slots: {
571
580
  listbox: AutocompleteListBox
572
581
  },
573
- slotProps: {
574
- listbox: {
575
- hasSecondaryText: options.some((opt) => opt.secondaryText)
576
- }
577
- },
578
- filterOptions: createFilterOptions({
579
- stringify: (option) => {
580
- const opt = option;
581
- return opt.secondaryText ? `${opt.label} ${opt.secondaryText}` : opt.label;
582
- }
583
- }),
584
- renderOption: (props2, option) => /* @__PURE__ */ React5.createElement(JoyAutocompleteOption, { ...props2, sx: optionPaddingMap[size ?? "md"] }, option.startDecorator && /* @__PURE__ */ React5.createElement(
582
+ slotProps,
583
+ filterOptions: autocompleteFilterOptions,
584
+ renderOption: (props2, option) => /* @__PURE__ */ React5.createElement(JoyAutocompleteOption, { ...props2 }, option.startDecorator && /* @__PURE__ */ React5.createElement(
585
585
  ListItemDecorator,
586
586
  {
587
587
  sx: (theme) => ({