@producteca/producteca-ui-kit 1.78.0 → 1.78.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.
@@ -1,5 +1,5 @@
1
1
  import { PickChannelModalChannel, PickChannelModalProps } from './pickChannelModal.types';
2
2
 
3
3
  export declare const productecaStrategy: PickChannelModalChannel;
4
- export declare const PickChannelModal: ({ open, onClose, channels, generalEditionDescription, channelEditionDescription, showGeneralEdition, onSelectChannel, titleProps, generalEditionTitle, channelEditionTitle, }: PickChannelModalProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const PickChannelModal: ({ open, onClose, channels, fitContent, generalEditionTitle, channelEditionTitle, generalEditionDescription, channelEditionDescription, showGeneralEdition, onSelectChannel, titleProps, }: PickChannelModalProps) => import("react/jsx-runtime").JSX.Element;
5
5
  export default PickChannelModal;
@@ -2,4 +2,5 @@ import { PickChannelModalProps, PickChannelModalChannel } from './pickChannelMod
2
2
 
3
3
  export declare const sampleChannels: PickChannelModalChannel[];
4
4
  export declare const manyChannels: PickChannelModalChannel[];
5
+ export declare const channelsWithDisabled: PickChannelModalChannel[];
5
6
  export declare const renderInteractive: (args: PickChannelModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,9 +4,12 @@ export interface PickChannelModalChannel {
4
4
  clientId: string | number;
5
5
  iconUrl: string;
6
6
  name?: string;
7
+ disabled?: boolean;
8
+ tooltipMessage?: string;
7
9
  }
8
10
  export interface PickChannelModalProps {
9
11
  open: boolean;
12
+ fitContent: boolean;
10
13
  channels: PickChannelModalChannel[];
11
14
  onClose?: () => void;
12
15
  titleProps?: ModalTitleProps;
@@ -39,13 +39,14 @@ export declare const headerSectionExample = "\n## Uso del componente\n\nEl compo
39
39
  export declare const iconWithIdentifierExample = "\n## Uso del componente\n\nEl componente `IconWithIdentifier` muestra un \u00EDcono junto a un texto (por ejemplo un ID o c\u00F3digo).\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<IconWithIdentifier\n icon={<Image src=\"/flag.png\" />}\n text=\"#ID8765\"\n showDivider\n/>\n```\n";
40
40
  export declare const linkWithIconExample = "\n## Uso del componente\n\nEl componente `LinkWithIcon` muestra un enlace con un \u00EDcono a la izquierda.\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<LinkWithIcon\n text=\"Historial de cambios\"\n icon={<CustomIcon><History /></CustomIcon>}\n onClick={() => navigate('/history')}\n/>\n```\n";
41
41
  export declare const conditionalOperatorExample = "\n## Uso del componente\n\nEl componente `ConditionalOperator` permite elegir entre operador l\u00F3gico \"Y\" u \"O\" para filtrar o combinar condiciones.\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<ConditionalOperator\n value=\"or\"\n options={[{ value: 'and', label: 'Y' }, { value: 'or', label: 'O' }]}\n onChange={(event) => setOperator(event.target.value)}\n/>\n```\n";
42
- export declare const pickChannelModalExample = "\n## Uso del componente\n\nEl componente `PickChannelModal` muestra un modal con una grilla de canales seleccionables. Recibe el listado `channels` con `{ clientId, iconUrl, name? }`. Opcionalmente, mediante `showGeneralEdition`, agrega una secci\u00F3n superior con la opci\u00F3n Producteca (exportada como `productecaStrategy`) para editar atributos generales \u2014 se comporta como un canal m\u00E1s y se notifica por el mismo `onSelectChannel`. El header acepta cualquier `ModalTitleProps` v\u00EDa `titleProps` (`title`, `icon`, `subtitle`, `helpArticleUrl`, `helpTooltip`).\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<PickChannelModal\n open={open}\n channels={channels}\n showGeneralEdition\n titleProps={{\n title: 'Editar atributos',\n icon: <InfoIcon />,\n subtitle: 'Eleg\u00ED el canal a editar',\n helpArticleUrl: 'https://help.producteca.com/articles/pick-channel',\n }}\n onSelectChannel={(channel) => handleChannelSelected(channel)}\n onClose={() => setOpen(false)}\n/>\n```\n";
42
+ export declare const pickChannelModalExample = "\n## Uso del componente\n\nEl componente `PickChannelModal` muestra un modal con una grilla de canales seleccionables. Recibe el listado `channels` con `{ clientId, iconUrl, name?, disabled?, tooltipMessage? }`. Un canal con `disabled` se muestra atenuado y no dispara `onSelectChannel` al clickearlo; `tooltipMessage` agrega un tooltip a la card, visible al pasar el mouse. Opcionalmente, mediante `showGeneralEdition`, agrega una secci\u00F3n superior con la opci\u00F3n Producteca (exportada como `productecaStrategy`) para editar atributos generales \u2014 se comporta como un canal m\u00E1s y se notifica por el mismo `onSelectChannel`. El header acepta cualquier `ModalTitleProps` v\u00EDa `titleProps` (`title`, `icon`, `subtitle`, `helpArticleUrl`, `helpTooltip`).\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<PickChannelModal\n open={open}\n channels={channels}\n showGeneralEdition\n titleProps={{\n title: 'Editar atributos',\n icon: <InfoIcon />,\n subtitle: 'Eleg\u00ED el canal a editar',\n helpArticleUrl: 'https://help.producteca.com/articles/pick-channel',\n }}\n onSelectChannel={(channel) => handleChannelSelected(channel)}\n onClose={() => setOpen(false)}\n/>\n```\n";
43
43
  export declare const pickChannelModalDefault = "\nEstado por defecto con `showGeneralEdition` activado. Se muestra la secci\u00F3n de edici\u00F3n general con la card de Producteca y la secci\u00F3n de canales. Clickear cualquier card invoca `onSelectChannel` con el objeto del canal seleccionado.\n";
44
44
  export declare const pickChannelModalWithoutGeneralEdition = "\nVariante sin la secci\u00F3n de edici\u00F3n general \u2014 solo se renderizan las cards recibidas por `channels`. \u00DAtil cuando el flujo no necesita editar atributos gen\u00E9ricos a nivel Producteca.\n";
45
45
  export declare const pickChannelModalCustomTexts = "\nDemuestra c\u00F3mo overridear todos los textos visibles (`title`, `generalEditionTitle`, `generalEditionDescription`, `channelEditionTitle`, `channelEditionDescription`) cuando los defaults no encajan con el contexto del producto.\n";
46
46
  export declare const pickChannelModalWithFullTitle = "\nHeader con todas las `ModalTitleProps` configuradas: `title`, `subtitle`, `icon` (icono al lado del t\u00EDtulo) y `helpArticleUrl` + `helpTooltip` (que renderizan el \u00EDcono de ayuda con tooltip a la derecha). \u00DAtil cuando el modal necesita contextualizar la acci\u00F3n o linkear a documentaci\u00F3n.\n";
47
47
  export declare const pickChannelModalScrollableContent = "\nMuestra el modal con una gran cantidad de canales para verificar que el contenido scrollea internamente cuando supera la altura m\u00E1xima del modal (`85vh`). El header se mantiene fijo y solo la grilla de cards se desplaza.\n";
48
48
  export declare const pickChannelModalWithoutText = "\nSin `channelEditionTitle` ni `channelEditionDescription` (ni los textos de edici\u00F3n general): los `<h3>` y `<p>` no se renderizan y la grilla de cards queda sin margen superior. Verifica el render condicional de los textos opcionales y el margen condicional del grid.\n";
49
+ export declare const pickChannelModalWithDisabledChannel = "\nUno de los canales se pasa con `disabled` y `tooltipMessage`: la card se muestra atenuada, no dispara `onSelectChannel` al clickearla y expone un tooltip explicando el motivo al pasar el mouse.\n";
49
50
  export declare const emptyStateExample = "\n## Uso del componente\n\nEl componente `EmptyState` muestra un estado vac\u00EDo con mensaje, \u00EDcono opcional y acci\u00F3n (por ejemplo \"Agregar\").\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<EmptyState\n message=\"No hay resultados\"\n actionLabel=\"Agregar\"\n onAction={() => openCreate()}\n/>\n```\n";
50
51
  export declare const asyncContentExample = "\n## Uso del componente\n\nEl componente `AsyncContent` maneja los estados de una operaci\u00F3n as\u00EDncrona deriv\u00E1ndolos de las props `isLoading`, `error` y `empty`. La prioridad es: `isLoading` \u2192 `error.value` \u2192 `empty.items` vac\u00EDo \u2192 `success`. Muestra el contenido solo en `success`.\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<AsyncContent\n isLoading={isLoading}\n error={{\n value: hasError,\n text: 'Ocurri\u00F3 un error',\n actionText: 'Reintentar',\n onClick: () => refetch(),\n }}\n empty={{\n items,\n text: 'No hay datos',\n }}\n>\n <div>Contenido cuando hay datos disponibles</div>\n</AsyncContent>\n```\n";
51
52
  export declare const tooltipExample = "\n## Uso del componente\n\nLos componentes de tooltip (`WithTooltip`, `WithOverflowTooltip`) muestran un mensaje al hacer hover o click. `WithOverflowTooltip` solo muestra el tooltip cuando el contenido se desborda.\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<WithTooltip content=\"Texto del tooltip\" placement=\"top\">\n <span>Hover sobre m\u00ED</span>\n</WithTooltip>\n```\n\n### Solo si hay overflow:\n\n```tsx\n<WithOverflowTooltip maxWidth=\"200px\">\n <span>Texto que puede truncarse...</span>\n</WithOverflowTooltip>\n```\n";
@@ -217,6 +217,7 @@ declare const _default: {
217
217
  withFullTitle: string;
218
218
  scrollableContent: string;
219
219
  withoutText: string;
220
+ withDisabledChannel: string;
220
221
  };
221
222
  copyButton: {
222
223
  example: string;
@@ -404,6 +405,7 @@ declare const _default: {
404
405
  channelEditionDescription: string;
405
406
  channelName: string;
406
407
  openModal: string;
408
+ disabledChannelTooltip: string;
407
409
  fullTitle: {
408
410
  title: string;
409
411
  subtitle: string;
@@ -19709,7 +19709,7 @@ El componente \`ConditionalOperator\` permite elegir entre operador lógico "Y"
19709
19709
  const pickChannelModalExample = `
19710
19710
  ## Uso del componente
19711
19711
 
19712
- El componente \`PickChannelModal\` muestra un modal con una grilla de canales seleccionables. Recibe el listado \`channels\` con \`{ clientId, iconUrl, name? }\`. Opcionalmente, mediante \`showGeneralEdition\`, agrega una sección superior con la opción Producteca (exportada como \`productecaStrategy\`) para editar atributos generales — se comporta como un canal más y se notifica por el mismo \`onSelectChannel\`. El header acepta cualquier \`ModalTitleProps\` vía \`titleProps\` (\`title\`, \`icon\`, \`subtitle\`, \`helpArticleUrl\`, \`helpTooltip\`).
19712
+ El componente \`PickChannelModal\` muestra un modal con una grilla de canales seleccionables. Recibe el listado \`channels\` con \`{ clientId, iconUrl, name?, disabled?, tooltipMessage? }\`. Un canal con \`disabled\` se muestra atenuado y no dispara \`onSelectChannel\` al clickearlo; \`tooltipMessage\` agrega un tooltip a la card, visible al pasar el mouse. Opcionalmente, mediante \`showGeneralEdition\`, agrega una sección superior con la opción Producteca (exportada como \`productecaStrategy\`) para editar atributos generales — se comporta como un canal más y se notifica por el mismo \`onSelectChannel\`. El header acepta cualquier \`ModalTitleProps\` vía \`titleProps\` (\`title\`, \`icon\`, \`subtitle\`, \`helpArticleUrl\`, \`helpTooltip\`).
19713
19713
 
19714
19714
  ### Ejemplo básico:
19715
19715
 
@@ -19747,6 +19747,9 @@ Muestra el modal con una gran cantidad de canales para verificar que el contenid
19747
19747
  const pickChannelModalWithoutText = `
19748
19748
  Sin \`channelEditionTitle\` ni \`channelEditionDescription\` (ni los textos de edición general): los \`<h3>\` y \`<p>\` no se renderizan y la grilla de cards queda sin margen superior. Verifica el render condicional de los textos opcionales y el margen condicional del grid.
19749
19749
  `;
19750
+ const pickChannelModalWithDisabledChannel = `
19751
+ Uno de los canales se pasa con \`disabled\` y \`tooltipMessage\`: la card se muestra atenuada, no dispara \`onSelectChannel\` al clickearla y expone un tooltip explicando el motivo al pasar el mouse.
19752
+ `;
19750
19753
  const emptyStateExample = `
19751
19754
  ## Uso del componente
19752
19755
 
@@ -20162,7 +20165,8 @@ const es$3 = {
20162
20165
  customTexts: pickChannelModalCustomTexts,
20163
20166
  withFullTitle: pickChannelModalWithFullTitle,
20164
20167
  scrollableContent: pickChannelModalScrollableContent,
20165
- withoutText: pickChannelModalWithoutText
20168
+ withoutText: pickChannelModalWithoutText,
20169
+ withDisabledChannel: pickChannelModalWithDisabledChannel
20166
20170
  },
20167
20171
  copyButton: {
20168
20172
  example: copyButtonExample
@@ -20350,6 +20354,7 @@ const es$3 = {
20350
20354
  channelEditionDescription: "Edita los atributos específicos y obligatorios según la categoría del canal",
20351
20355
  channelName: "Cuenta {{number}}",
20352
20356
  openModal: "Abrir selector de canales",
20357
+ disabledChannelTooltip: "Este canal está deshabilitado. Pasa el mouse para más información.",
20353
20358
  fullTitle: {
20354
20359
  title: "Editar atributos del producto",
20355
20360
  subtitle: "Seleccioná en qué canal querés editar los atributos",
@@ -67717,15 +67722,19 @@ const ChannelIcon = ({ iconUrl, name }) => /* @__PURE__ */ jsx$1(
67717
67722
  sx: { height: "36px", maxHeight: "36px", maxWidth: "128px", width: "128px" }
67718
67723
  }
67719
67724
  );
67720
- const ChannelCard = ({ channel, onSelect }) => /* @__PURE__ */ jsx$1(
67721
- Card,
67722
- {
67723
- description: channel.name,
67724
- sx: { width: "200px", height: "88px" },
67725
- onClick: () => onSelect(channel),
67726
- icon: /* @__PURE__ */ jsx$1(ChannelIcon, { iconUrl: channel.iconUrl, name: channel.name })
67727
- }
67728
- );
67725
+ const ChannelCard = ({ channel, onSelect }) => {
67726
+ const { name, iconUrl, disabled: disabled2, tooltipMessage } = channel;
67727
+ return /* @__PURE__ */ jsx$1(WithTooltip, { content: tooltipMessage, shouldShowTooltip: !!tooltipMessage, children: /* @__PURE__ */ jsx$1("div", { children: /* @__PURE__ */ jsx$1(
67728
+ Card,
67729
+ {
67730
+ disabled: disabled2,
67731
+ description: name,
67732
+ sx: { width: "200px", height: "88px" },
67733
+ onClick: () => !disabled2 && onSelect(channel),
67734
+ icon: /* @__PURE__ */ jsx$1(ChannelIcon, { iconUrl, name })
67735
+ }
67736
+ ) }) });
67737
+ };
67729
67738
  const productecaStrategy = {
67730
67739
  clientId: 1,
67731
67740
  iconUrl: "https://imagesproducteca.blob.core.windows.net/producteca/isologo-producteca.svg"
@@ -67734,15 +67743,16 @@ const PickChannelModalBase = ({
67734
67743
  open,
67735
67744
  onClose,
67736
67745
  channels,
67746
+ fitContent = true,
67747
+ generalEditionTitle,
67748
+ channelEditionTitle,
67737
67749
  generalEditionDescription,
67738
67750
  channelEditionDescription,
67739
67751
  showGeneralEdition = false,
67740
67752
  onSelectChannel = () => {
67741
67753
  },
67742
- titleProps = { title: locale("pickChannelModal.title") },
67743
- generalEditionTitle,
67744
- channelEditionTitle
67745
- }) => /* @__PURE__ */ jsxs(Modal2, { open, onClose, size: "md", fitContent: true, className: styles$g["modal"], children: [
67754
+ titleProps = { title: locale("pickChannelModal.title") }
67755
+ }) => /* @__PURE__ */ jsxs(Modal2, { open, onClose, size: "md", fitContent, className: styles$g["modal"], children: [
67746
67756
  /* @__PURE__ */ jsx$1(Modal2.Title, { ...titleProps }),
67747
67757
  /* @__PURE__ */ jsx$1(Modal2.Body, { className: styles$g["body"], children: /* @__PURE__ */ jsxs("div", { className: styles$g["sections"], children: [
67748
67758
  showGeneralEdition && /* @__PURE__ */ jsxs("section", { className: styles$g["section"], children: [