@producteca/producteca-ui-kit 1.78.2 → 1.79.0

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.
@@ -9,7 +9,7 @@ export interface PickChannelModalChannel {
9
9
  }
10
10
  export interface PickChannelModalProps {
11
11
  open: boolean;
12
- fitContent: boolean;
12
+ fitContent?: boolean;
13
13
  channels: PickChannelModalChannel[];
14
14
  onClose?: () => void;
15
15
  titleProps?: ModalTitleProps;
@@ -8615,7 +8615,7 @@ function createSvgIcon(path, displayName) {
8615
8615
  const CloseRoundedIcon = createSvgIcon(/* @__PURE__ */ jsx$1("path", {
8616
8616
  d: "M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"
8617
8617
  }), "CloseRounded");
8618
- function compact(array) {
8618
+ function compact$1(array) {
8619
8619
  var index2 = -1, length2 = array == null ? 0 : array.length, resIndex = 0, result = [];
8620
8620
  while (++index2 < length2) {
8621
8621
  var value = array[index2];
@@ -8625,8 +8625,8 @@ function compact(array) {
8625
8625
  }
8626
8626
  return result;
8627
8627
  }
8628
- var compact_1 = compact;
8629
- const compact$1 = /* @__PURE__ */ getDefaultExportFromCjs(compact_1);
8628
+ var compact_1 = compact$1;
8629
+ const compact$2 = /* @__PURE__ */ getDefaultExportFromCjs(compact_1);
8630
8630
  function arrayPush$3(array, values2) {
8631
8631
  var index2 = -1, length2 = values2.length, offset2 = array.length;
8632
8632
  while (++index2 < length2) {
@@ -10029,7 +10029,7 @@ const getColor = (category, shade) => {
10029
10029
  };
10030
10030
  const allColors = flatMap$1(
10031
10031
  Colors,
10032
- (shades, category) => compact$1(
10032
+ (shades, category) => compact$2(
10033
10033
  map$2(shades, (color2, shade) => color2 ? { title: `${category} ${shade}`, color: color2 } : null)
10034
10034
  )
10035
10035
  );
@@ -67538,6 +67538,7 @@ const Maintenance = ({
67538
67538
  ] }) });
67539
67539
  const modal$1 = "pickChannelModal-module_modal_YGDD7";
67540
67540
  const body = "pickChannelModal-module_body_X7L60";
67541
+ const compact = "pickChannelModal-module_compact_hD7b-";
67541
67542
  const sections = "pickChannelModal-module_sections_VGJ6N";
67542
67543
  const section = "pickChannelModal-module_section_BklUc";
67543
67544
  const section__title = "pickChannelModal-module_section__title_fBRgI";
@@ -67545,6 +67546,7 @@ const section__description = "pickChannelModal-module_section__description_Pgidd
67545
67546
  const styles$g = {
67546
67547
  modal: modal$1,
67547
67548
  body,
67549
+ compact,
67548
67550
  sections,
67549
67551
  section,
67550
67552
  section__title,
@@ -67739,11 +67741,12 @@ const productecaStrategy = {
67739
67741
  clientId: 1,
67740
67742
  iconUrl: "https://imagesproducteca.blob.core.windows.net/producteca/isologo-producteca.svg"
67741
67743
  };
67744
+ const COMPACT_CARD_THRESHOLD = 6;
67742
67745
  const PickChannelModalBase = ({
67743
67746
  open,
67744
67747
  onClose,
67745
67748
  channels,
67746
- fitContent = true,
67749
+ fitContent,
67747
67750
  generalEditionTitle,
67748
67751
  channelEditionTitle,
67749
67752
  generalEditionDescription,
@@ -67752,21 +67755,35 @@ const PickChannelModalBase = ({
67752
67755
  onSelectChannel = () => {
67753
67756
  },
67754
67757
  titleProps = { title: locale("pickChannelModal.title") }
67755
- }) => /* @__PURE__ */ jsxs(Modal2, { open, onClose, size: "md", fitContent, className: styles$g["modal"], children: [
67756
- /* @__PURE__ */ jsx$1(Modal2.Title, { ...titleProps }),
67757
- /* @__PURE__ */ jsx$1(Modal2.Body, { className: styles$g["body"], children: /* @__PURE__ */ jsxs("div", { className: styles$g["sections"], children: [
67758
- showGeneralEdition && /* @__PURE__ */ jsxs("section", { className: styles$g["section"], children: [
67759
- generalEditionTitle && /* @__PURE__ */ jsx$1("h3", { className: styles$g["section__title"], children: generalEditionTitle }),
67760
- generalEditionDescription && /* @__PURE__ */ jsx$1("p", { className: styles$g["section__description"], children: generalEditionDescription }),
67761
- /* @__PURE__ */ jsx$1("div", { className: styles$g["cards-grid"], children: /* @__PURE__ */ jsx$1(ChannelCard, { channel: productecaStrategy, onSelect: onSelectChannel }) })
67762
- ] }),
67763
- /* @__PURE__ */ jsxs("section", { className: styles$g["section"], children: [
67764
- channelEditionTitle && /* @__PURE__ */ jsx$1("h3", { className: styles$g["section__title"], children: channelEditionTitle }),
67765
- channelEditionDescription && /* @__PURE__ */ jsx$1("p", { className: styles$g["section__description"], children: channelEditionDescription }),
67766
- /* @__PURE__ */ jsx$1("div", { className: styles$g["cards-grid"], children: (channels || []).map((channel) => /* @__PURE__ */ jsx$1(ChannelCard, { channel, onSelect: onSelectChannel }, channel.clientId)) })
67767
- ] })
67768
- ] }) })
67769
- ] });
67758
+ }) => {
67759
+ const cardCount = (channels?.length ?? 0) + (showGeneralEdition ? 1 : 0);
67760
+ const isCompact = !fitContent && cardCount <= COMPACT_CARD_THRESHOLD;
67761
+ return /* @__PURE__ */ jsxs(
67762
+ Modal2,
67763
+ {
67764
+ open,
67765
+ onClose,
67766
+ size: "md",
67767
+ fitContent,
67768
+ className: clsx(styles$g["modal"], { [styles$g["compact"]]: isCompact }),
67769
+ children: [
67770
+ /* @__PURE__ */ jsx$1(Modal2.Title, { ...titleProps }),
67771
+ /* @__PURE__ */ jsx$1(Modal2.Body, { className: styles$g["body"], children: /* @__PURE__ */ jsxs("div", { className: styles$g["sections"], children: [
67772
+ showGeneralEdition && /* @__PURE__ */ jsxs("section", { className: styles$g["section"], children: [
67773
+ generalEditionTitle && /* @__PURE__ */ jsx$1("h3", { className: styles$g["section__title"], children: generalEditionTitle }),
67774
+ generalEditionDescription && /* @__PURE__ */ jsx$1("p", { className: styles$g["section__description"], children: generalEditionDescription }),
67775
+ /* @__PURE__ */ jsx$1("div", { className: styles$g["cards-grid"], children: /* @__PURE__ */ jsx$1(ChannelCard, { channel: productecaStrategy, onSelect: onSelectChannel }) })
67776
+ ] }),
67777
+ /* @__PURE__ */ jsxs("section", { className: styles$g["section"], children: [
67778
+ channelEditionTitle && /* @__PURE__ */ jsx$1("h3", { className: styles$g["section__title"], children: channelEditionTitle }),
67779
+ channelEditionDescription && /* @__PURE__ */ jsx$1("p", { className: styles$g["section__description"], children: channelEditionDescription }),
67780
+ /* @__PURE__ */ jsx$1("div", { className: styles$g["cards-grid"], children: (channels || []).map((channel) => /* @__PURE__ */ jsx$1(ChannelCard, { channel, onSelect: onSelectChannel }, channel.clientId)) })
67781
+ ] })
67782
+ ] }) })
67783
+ ]
67784
+ }
67785
+ );
67786
+ };
67770
67787
  const PickChannelModal = withDebugHandlers(PickChannelModalBase, "PickChannelModal");
67771
67788
  function getLinearProgressUtilityClass(slot) {
67772
67789
  return generateUtilityClass("MuiLinearProgress", slot);