@rubenpazch/description-list 0.1.0 → 0.2.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/README.md CHANGED
@@ -17,15 +17,16 @@ npm install @rubenpazch/description-list
17
17
 
18
18
  Pares etiqueta/valor de solo lectura (`<dl>`): resumen de un registro.
19
19
 
20
- | Prop | Tipo | Req. | Por defecto | Descripción |
21
- | ------------ | ------------------- | ---- | ------------ | ----------------------------------------------------------------- |
22
- | `items` | `DescriptionItem[]` | sí | | |
23
- | `className` | `string` | | | |
24
- | `columns` | `1 \| 2 \| 3` | | `2` | Columnas en pantallas anchas (en móvil siempre 1). Por defecto 2. |
25
- | `emptyText` | `ReactNode` | | `Sin datos.` | Texto si no hay ningún dato. |
26
- | `emptyValue` | `ReactNode` | | `—` | Qué mostrar si un valor está vacío. |
27
- | `footnote` | `ReactNode` | | | Nota al pie (fuente de los datos, aclaraciones). |
28
- | `title` | `ReactNode` | | | Título opcional sobre la lista. |
20
+ | Prop | Tipo | Req. | Por defecto | Descripción |
21
+ | ------------ | ----------------------------- | ---- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
22
+ | `items` | `DescriptionItem[]` | sí | | |
23
+ | `className` | `string` | | | |
24
+ | `columns` | `1 \| 2 \| 3` | | `2` | Columnas en pantallas anchas (en móvil siempre 1). Por defecto 2. |
25
+ | `emptyText` | `ReactNode` | | | Texto si no hay ningún dato. |
26
+ | `emptyValue` | `ReactNode` | | `—` | Qué mostrar si un valor está vacío. |
27
+ | `footnote` | `ReactNode` | | | Nota al pie (fuente de los datos, aclaraciones). |
28
+ | `labels` | `Partial<{ empty: string; }>` | | | Textos de la interfaz. Por defecto, los del idioma activo (`UiLocaleProvider`); también se cambian para toda la app con su prop `messages`. |
29
+ | `title` | `ReactNode` | | | Título opcional sobre la lista. |
29
30
 
30
31
  Tipos: `DescriptionItem`, `DescriptionListProps`.
31
32
 
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { type UiMessages } from "@rubenpazch/shared";
2
3
  export interface DescriptionItem {
3
4
  /** Etiqueta: "Remitente", "Fecha de ingreso". */
4
5
  label: React.ReactNode;
@@ -22,7 +23,12 @@ export interface DescriptionListProps {
22
23
  /** Nota al pie (fuente de los datos, aclaraciones). */
23
24
  footnote?: React.ReactNode;
24
25
  className?: string;
26
+ /**
27
+ * Textos de la interfaz. Por defecto, los del idioma activo (`UiLocaleProvider`);
28
+ * también se cambian para toda la app con su prop `messages`.
29
+ */
30
+ labels?: Partial<UiMessages["descriptionList"]>;
25
31
  }
26
32
  /** Pares etiqueta/valor de solo lectura (`<dl>`): resumen de un registro. */
27
- export default function DescriptionList({ items, title, columns, emptyValue, emptyText, footnote, className, }: DescriptionListProps): React.JSX.Element;
33
+ export default function DescriptionList({ items, title, columns, emptyValue, emptyText, footnote, className, labels, }: DescriptionListProps): React.JSX.Element;
28
34
  //# sourceMappingURL=DescriptionList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DescriptionList.d.ts","sourceRoot":"","sources":["../src/DescriptionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,gEAAgE;IAChE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,sCAAsC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,wEAAwE;IACxE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,mCAAmC;IACnC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,6EAA6E;AAC7E,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,KAAK,EACL,KAAK,EACL,OAAW,EACX,UAAgB,EAChB,SAAwB,EACxB,QAAQ,EACR,SAAS,GACV,EAAE,oBAAoB,qBA8BtB"}
1
+ {"version":3,"file":"DescriptionList.d.ts","sourceRoot":"","sources":["../src/DescriptionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGpE,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,gEAAgE;IAChE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,sCAAsC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,wEAAwE;IACxE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,mCAAmC;IACnC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;CACjD;AAMD,6EAA6E;AAC7E,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,KAAK,EACL,KAAK,EACL,OAAW,EACX,UAAgB,EAChB,SAAS,EACT,QAAQ,EACR,SAAS,EACT,MAAM,GACP,EAAE,oBAAoB,qBA+BtB"}
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime");var i={wrapper:"DescriptionList-module_wrapper__vsJV5",title:"DescriptionList-module_title__q33V9",list:"DescriptionList-module_list__EGDQC",cols2:"DescriptionList-module_cols2__uRkpK",cols3:"DescriptionList-module_cols3__qAkyu",item:"DescriptionList-module_item__X4XEW",full:"DescriptionList-module_full__EYw0V",label:"DescriptionList-module_label__6FxWe",value:"DescriptionList-module_value__AXC0B",highlight:"DescriptionList-module_highlight__yuPI3",missing:"DescriptionList-module_missing__b8EZA",empty:"DescriptionList-module_empty__iD-Ej",footnote:"DescriptionList-module_footnote__hQhVr"};!function(e,i){void 0===i&&(i={});var t=i.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".DescriptionList-module_wrapper__vsJV5 {\n font-family: var(--lb-font-sans);\n}\n\n.DescriptionList-module_title__q33V9 {\n margin: 0 0 var(--lb-space-3);\n font-size: var(--lb-font-size-sm);\n font-weight: var(--lb-font-weight-semibold);\n color: var(--lb-color-foreground);\n}\n\n.DescriptionList-module_list__EGDQC {\n display: grid;\n grid-template-columns: 1fr;\n gap: var(--lb-space-3) var(--lb-space-6);\n margin: 0;\n}\n\n@media (min-width: 640px) {\n .DescriptionList-module_cols2__uRkpK {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .DescriptionList-module_cols3__qAkyu {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n}\n\n.DescriptionList-module_item__X4XEW {\n min-width: 0;\n}\n\n.DescriptionList-module_full__EYw0V {\n grid-column: 1 / -1;\n}\n\n.DescriptionList-module_label__6FxWe {\n font-size: var(--lb-font-size-xs);\n font-weight: var(--lb-font-weight-medium);\n color: var(--lb-color-muted-foreground);\n text-transform: uppercase;\n letter-spacing: 0.03em;\n}\n\n.DescriptionList-module_value__AXC0B {\n margin: var(--lb-space-1) 0 0;\n font-size: var(--lb-font-size-sm);\n color: var(--lb-color-foreground);\n overflow-wrap: anywhere;\n}\n\n.DescriptionList-module_highlight__yuPI3 {\n font-weight: var(--lb-font-weight-semibold);\n color: var(--lb-color-primary-strong, var(--lb-color-primary));\n}\n\n.DescriptionList-module_missing__b8EZA {\n color: var(--lb-color-muted-foreground);\n}\n\n.DescriptionList-module_empty__iD-Ej,\n.DescriptionList-module_footnote__hQhVr {\n margin: 0;\n font-size: var(--lb-font-size-xs);\n color: var(--lb-color-muted-foreground);\n}\n\n.DescriptionList-module_footnote__hQhVr {\n margin-top: var(--lb-space-3);\n}\n");const t=(...e)=>e.filter(Boolean).join(" "),n=e=>null==e||""===e;module.exports=function({items:o,title:l,columns:s=2,emptyValue:r="—",emptyText:a="Sin datos.",footnote:m,className:c}){return e.jsxs("section",{className:t(i.wrapper,c),children:[l&&e.jsx("h3",{className:i.title,children:l}),0===o.length?e.jsx("p",{className:i.empty,children:a}):e.jsx("dl",{className:t(i.list,i[`cols${s}`]),children:o.map((o,l)=>e.jsxs("div",{className:t(i.item,o.fullWidth&&i.full),children:[e.jsx("dt",{className:i.label,children:o.label}),e.jsx("dd",{className:t(i.value,o.highlight&&i.highlight,n(o.value)&&i.missing),children:n(o.value)?r:o.value})]},l))}),m&&e.jsx("p",{className:i.footnote,children:m})]})};
1
+ "use strict";var e=require("react/jsx-runtime"),i=require("@rubenpazch/shared");var t={wrapper:"DescriptionList-module_wrapper__vsJV5",title:"DescriptionList-module_title__q33V9",list:"DescriptionList-module_list__EGDQC",cols2:"DescriptionList-module_cols2__uRkpK",cols3:"DescriptionList-module_cols3__qAkyu",item:"DescriptionList-module_item__X4XEW",full:"DescriptionList-module_full__EYw0V",label:"DescriptionList-module_label__6FxWe",value:"DescriptionList-module_value__AXC0B",highlight:"DescriptionList-module_highlight__yuPI3",missing:"DescriptionList-module_missing__b8EZA",empty:"DescriptionList-module_empty__iD-Ej",footnote:"DescriptionList-module_footnote__hQhVr"};!function(e,i){void 0===i&&(i={});var t=i.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".DescriptionList-module_wrapper__vsJV5 {\n font-family: var(--lb-font-sans);\n}\n\n.DescriptionList-module_title__q33V9 {\n margin: 0 0 var(--lb-space-3);\n font-size: var(--lb-font-size-sm);\n font-weight: var(--lb-font-weight-semibold);\n color: var(--lb-color-foreground);\n}\n\n.DescriptionList-module_list__EGDQC {\n display: grid;\n grid-template-columns: 1fr;\n gap: var(--lb-space-3) var(--lb-space-6);\n margin: 0;\n}\n\n@media (min-width: 640px) {\n .DescriptionList-module_cols2__uRkpK {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .DescriptionList-module_cols3__qAkyu {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n}\n\n.DescriptionList-module_item__X4XEW {\n min-width: 0;\n}\n\n.DescriptionList-module_full__EYw0V {\n grid-column: 1 / -1;\n}\n\n.DescriptionList-module_label__6FxWe {\n font-size: var(--lb-font-size-xs);\n font-weight: var(--lb-font-weight-medium);\n color: var(--lb-color-muted-foreground);\n text-transform: uppercase;\n letter-spacing: 0.03em;\n}\n\n.DescriptionList-module_value__AXC0B {\n margin: var(--lb-space-1) 0 0;\n font-size: var(--lb-font-size-sm);\n color: var(--lb-color-foreground);\n overflow-wrap: anywhere;\n}\n\n.DescriptionList-module_highlight__yuPI3 {\n font-weight: var(--lb-font-weight-semibold);\n color: var(--lb-color-primary-strong, var(--lb-color-primary));\n}\n\n.DescriptionList-module_missing__b8EZA {\n color: var(--lb-color-muted-foreground);\n}\n\n.DescriptionList-module_empty__iD-Ej,\n.DescriptionList-module_footnote__hQhVr {\n margin: 0;\n font-size: var(--lb-font-size-xs);\n color: var(--lb-color-muted-foreground);\n}\n\n.DescriptionList-module_footnote__hQhVr {\n margin-top: var(--lb-space-3);\n}\n");const n=(...e)=>e.filter(Boolean).join(" "),o=e=>null==e||""===e;module.exports=function({items:s,title:l,columns:r=2,emptyValue:a="—",emptyText:m,footnote:c,className:d,labels:_}){const u=i.useUiMessages("descriptionList",_);return e.jsxs("section",{className:n(t.wrapper,d),children:[l&&e.jsx("h3",{className:t.title,children:l}),0===s.length?e.jsx("p",{className:t.empty,children:m??u.empty}):e.jsx("dl",{className:n(t.list,t[`cols${r}`]),children:s.map((i,s)=>e.jsxs("div",{className:n(t.item,i.fullWidth&&t.full),children:[e.jsx("dt",{className:t.label,children:i.label}),e.jsx("dd",{className:n(t.value,i.highlight&&t.highlight,o(i.value)&&t.missing),children:o(i.value)?a:i.value})]},s))}),c&&e.jsx("p",{className:t.footnote,children:c})]})};
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/DescriptionList.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React from \"react\";\nimport styles from \"./DescriptionList.module.css\";\n\nexport interface DescriptionItem {\n /** Etiqueta: \"Remitente\", \"Fecha de ingreso\". */\n label: React.ReactNode;\n /** Valor. Vacío (null, undefined o \"\") muestra `emptyValue`. */\n value?: React.ReactNode;\n /** Resalta el valor (p. ej. un dato importante o inferido). */\n highlight?: boolean;\n /** Ocupa toda la fila (textos largos: asunto, observaciones). */\n fullWidth?: boolean;\n}\n\nexport interface DescriptionListProps {\n items: DescriptionItem[];\n /** Título opcional sobre la lista. */\n title?: React.ReactNode;\n /** Columnas en pantallas anchas (en móvil siempre 1). Por defecto 2. */\n columns?: 1 | 2 | 3;\n /** Qué mostrar si un valor está vacío. */\n emptyValue?: React.ReactNode;\n /** Texto si no hay ningún dato. */\n emptyText?: React.ReactNode;\n /** Nota al pie (fuente de los datos, aclaraciones). */\n footnote?: React.ReactNode;\n className?: string;\n}\n\nconst cx = (...c: Array<string | false | undefined>) =>\n c.filter(Boolean).join(\" \");\nconst vacio = (v: React.ReactNode) => v === null || v === undefined || v === \"\";\n\n/** Pares etiqueta/valor de solo lectura (`<dl>`): resumen de un registro. */\nexport default function DescriptionList({\n items,\n title,\n columns = 2,\n emptyValue = \"—\",\n emptyText = \"Sin datos.\",\n footnote,\n className,\n}: DescriptionListProps) {\n return (\n <section className={cx(styles.wrapper, className)}>\n {title && <h3 className={styles.title}>{title}</h3>}\n {items.length === 0 ? (\n <p className={styles.empty}>{emptyText}</p>\n ) : (\n <dl className={cx(styles.list, styles[`cols${columns}`])}>\n {items.map((item, i) => (\n <div\n key={i}\n className={cx(styles.item, item.fullWidth && styles.full)}\n >\n <dt className={styles.label}>{item.label}</dt>\n <dd\n className={cx(\n styles.value,\n item.highlight && styles.highlight,\n vacio(item.value) && styles.missing,\n )}\n >\n {vacio(item.value) ? emptyValue : item.value}\n </dd>\n </div>\n ))}\n </dl>\n )}\n {footnote && <p className={styles.footnote}>{footnote}</p>}\n </section>\n );\n}\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","cx","c","filter","Boolean","join","vacio","v","items","title","columns","emptyValue","emptyText","footnote","className","_jsxs","styles","wrapper","children","_jsx","length","empty","list","map","item","i","fullWidth","full","label","value","highlight","missing"],"mappings":"qoBAAA,SAAqBA,EAAKC,YACnBA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,+sDCIA,MAAMe,EAAK,IAAIC,IACbA,EAAEC,OAAOC,SAASC,KAAK,KACnBC,EAASC,GAAuBA,SAAuC,KAANA,iBAGzD,UAA0BC,MACtCA,EAAKC,MACLA,EAAKC,QACLA,EAAU,EAACC,WACXA,EAAa,IAAGC,UAChBA,EAAY,aAAYC,SACxBA,EAAQC,UACRA,IAEA,OACEC,EAAAA,KAAA,UAAA,CAASD,UAAWb,EAAGe,EAAOC,QAASH,GAAUI,SAAA,CAC9CT,GAASU,EAAAA,IAAA,KAAA,CAAIL,UAAWE,EAAOP,MAAKS,SAAGT,IACtB,IAAjBD,EAAMY,OACLD,EAAAA,IAAA,IAAA,CAAGL,UAAWE,EAAOK,MAAKH,SAAGN,IAE7BO,EAAAA,IAAA,KAAA,CAAIL,UAAWb,EAAGe,EAAOM,KAAMN,EAAO,OAAON,MAAWQ,SACrDV,EAAMe,IAAI,CAACC,EAAMC,IAChBV,EAAAA,KAAA,MAAA,CAEED,UAAWb,EAAGe,EAAOQ,KAAMA,EAAKE,WAAaV,EAAOW,MAAKT,SAAA,CAEzDC,EAAAA,UAAIL,UAAWE,EAAOY,MAAKV,SAAGM,EAAKI,QACnCT,EAAAA,IAAA,KAAA,CACEL,UAAWb,EACTe,EAAOa,MACPL,EAAKM,WAAad,EAAOc,UACzBxB,EAAMkB,EAAKK,QAAUb,EAAOe,SAC7Bb,SAEAZ,EAAMkB,EAAKK,OAASlB,EAAaa,EAAKK,UAXpCJ,MAiBZZ,GAAYM,EAAAA,IAAA,IAAA,CAAGL,UAAWE,EAAOH,SAAQK,SAAGL,MAGnD","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/DescriptionList.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React from \"react\";\nimport { useUiMessages, type UiMessages } from \"@rubenpazch/shared\";\nimport styles from \"./DescriptionList.module.css\";\n\nexport interface DescriptionItem {\n /** Etiqueta: \"Remitente\", \"Fecha de ingreso\". */\n label: React.ReactNode;\n /** Valor. Vacío (null, undefined o \"\") muestra `emptyValue`. */\n value?: React.ReactNode;\n /** Resalta el valor (p. ej. un dato importante o inferido). */\n highlight?: boolean;\n /** Ocupa toda la fila (textos largos: asunto, observaciones). */\n fullWidth?: boolean;\n}\n\nexport interface DescriptionListProps {\n items: DescriptionItem[];\n /** Título opcional sobre la lista. */\n title?: React.ReactNode;\n /** Columnas en pantallas anchas (en móvil siempre 1). Por defecto 2. */\n columns?: 1 | 2 | 3;\n /** Qué mostrar si un valor está vacío. */\n emptyValue?: React.ReactNode;\n /** Texto si no hay ningún dato. */\n emptyText?: React.ReactNode;\n /** Nota al pie (fuente de los datos, aclaraciones). */\n footnote?: React.ReactNode;\n className?: string;\n /**\n * Textos de la interfaz. Por defecto, los del idioma activo (`UiLocaleProvider`);\n * también se cambian para toda la app con su prop `messages`.\n */\n labels?: Partial<UiMessages[\"descriptionList\"]>;\n}\n\nconst cx = (...c: Array<string | false | undefined>) =>\n c.filter(Boolean).join(\" \");\nconst vacio = (v: React.ReactNode) => v === null || v === undefined || v === \"\";\n\n/** Pares etiqueta/valor de solo lectura (`<dl>`): resumen de un registro. */\nexport default function DescriptionList({\n items,\n title,\n columns = 2,\n emptyValue = \"—\",\n emptyText,\n footnote,\n className,\n labels,\n}: DescriptionListProps) {\n const t = useUiMessages(\"descriptionList\", labels);\n return (\n <section className={cx(styles.wrapper, className)}>\n {title && <h3 className={styles.title}>{title}</h3>}\n {items.length === 0 ? (\n <p className={styles.empty}>{emptyText ?? t.empty}</p>\n ) : (\n <dl className={cx(styles.list, styles[`cols${columns}`])}>\n {items.map((item, i) => (\n <div\n key={i}\n className={cx(styles.item, item.fullWidth && styles.full)}\n >\n <dt className={styles.label}>{item.label}</dt>\n <dd\n className={cx(\n styles.value,\n item.highlight && styles.highlight,\n vacio(item.value) && styles.missing,\n )}\n >\n {vacio(item.value) ? emptyValue : item.value}\n </dd>\n </div>\n ))}\n </dl>\n )}\n {footnote && <p className={styles.footnote}>{footnote}</p>}\n </section>\n );\n}\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","cx","c","filter","Boolean","join","vacio","v","items","title","columns","emptyValue","emptyText","footnote","className","labels","t","useUiMessages","_jsxs","styles","wrapper","children","_jsx","length","empty","list","map","item","i","fullWidth","full","label","value","highlight","missing"],"mappings":"qqBAAA,SAAqBA,EAAKC,YACnBA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,+sDCUA,MAAMe,EAAK,IAAIC,IACbA,EAAEC,OAAOC,SAASC,KAAK,KACnBC,EAASC,GAAuBA,SAAuC,KAANA,iBAGzD,UAA0BC,MACtCA,EAAKC,MACLA,EAAKC,QACLA,EAAU,EAACC,WACXA,EAAa,IAAGC,UAChBA,EAASC,SACTA,EAAQC,UACRA,EAASC,OACTA,IAEA,MAAMC,EAAIC,EAAAA,cAAc,kBAAmBF,GAC3C,OACEG,EAAAA,KAAA,UAAA,CAASJ,UAAWb,EAAGkB,EAAOC,QAASN,GAAUO,SAAA,CAC9CZ,GAASa,EAAAA,IAAA,KAAA,CAAIR,UAAWK,EAAOV,MAAKY,SAAGZ,IACtB,IAAjBD,EAAMe,OACLD,EAAAA,SAAGR,UAAWK,EAAOK,eAAQZ,GAAaI,EAAEQ,QAE5CF,EAAAA,IAAA,KAAA,CAAIR,UAAWb,EAAGkB,EAAOM,KAAMN,EAAO,OAAOT,eAC1CF,EAAMkB,IAAI,CAACC,EAAMC,IAChBV,EAAAA,KAAA,MAAA,CAEEJ,UAAWb,EAAGkB,EAAOQ,KAAMA,EAAKE,WAAaV,EAAOW,MAAKT,SAAA,CAEzDC,MAAA,KAAA,CAAIR,UAAWK,EAAOY,eAAQJ,EAAKI,QACnCT,EAAAA,IAAA,KAAA,CACER,UAAWb,EACTkB,EAAOa,MACPL,EAAKM,WAAad,EAAOc,UACzB3B,EAAMqB,EAAKK,QAAUb,EAAOe,kBAG7B5B,EAAMqB,EAAKK,OAASrB,EAAagB,EAAKK,UAXpCJ,MAiBZf,GAAYS,EAAAA,IAAA,IAAA,CAAGR,UAAWK,EAAON,SAAQQ,SAAGR,MAGnD","x_google_ignoreList":[0]}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { UiMessages } from '@rubenpazch/shared';
2
3
 
3
4
  interface DescriptionItem {
4
5
  /** Etiqueta: "Remitente", "Fecha de ingreso". */
@@ -23,9 +24,14 @@ interface DescriptionListProps {
23
24
  /** Nota al pie (fuente de los datos, aclaraciones). */
24
25
  footnote?: React.ReactNode;
25
26
  className?: string;
27
+ /**
28
+ * Textos de la interfaz. Por defecto, los del idioma activo (`UiLocaleProvider`);
29
+ * también se cambian para toda la app con su prop `messages`.
30
+ */
31
+ labels?: Partial<UiMessages["descriptionList"]>;
26
32
  }
27
33
  /** Pares etiqueta/valor de solo lectura (`<dl>`): resumen de un registro. */
28
- declare function DescriptionList({ items, title, columns, emptyValue, emptyText, footnote, className, }: DescriptionListProps): React.JSX.Element;
34
+ declare function DescriptionList({ items, title, columns, emptyValue, emptyText, footnote, className, labels, }: DescriptionListProps): React.JSX.Element;
29
35
 
30
36
  export { DescriptionList as default };
31
37
  export type { DescriptionItem, DescriptionListProps };
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as i}from"react/jsx-runtime";var t={wrapper:"DescriptionList-module_wrapper__vsJV5",title:"DescriptionList-module_title__q33V9",list:"DescriptionList-module_list__EGDQC",cols2:"DescriptionList-module_cols2__uRkpK",cols3:"DescriptionList-module_cols3__qAkyu",item:"DescriptionList-module_item__X4XEW",full:"DescriptionList-module_full__EYw0V",label:"DescriptionList-module_label__6FxWe",value:"DescriptionList-module_value__AXC0B",highlight:"DescriptionList-module_highlight__yuPI3",missing:"DescriptionList-module_missing__b8EZA",empty:"DescriptionList-module_empty__iD-Ej",footnote:"DescriptionList-module_footnote__hQhVr"};!function(e,i){void 0===i&&(i={});var t=i.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".DescriptionList-module_wrapper__vsJV5 {\n font-family: var(--lb-font-sans);\n}\n\n.DescriptionList-module_title__q33V9 {\n margin: 0 0 var(--lb-space-3);\n font-size: var(--lb-font-size-sm);\n font-weight: var(--lb-font-weight-semibold);\n color: var(--lb-color-foreground);\n}\n\n.DescriptionList-module_list__EGDQC {\n display: grid;\n grid-template-columns: 1fr;\n gap: var(--lb-space-3) var(--lb-space-6);\n margin: 0;\n}\n\n@media (min-width: 640px) {\n .DescriptionList-module_cols2__uRkpK {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .DescriptionList-module_cols3__qAkyu {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n}\n\n.DescriptionList-module_item__X4XEW {\n min-width: 0;\n}\n\n.DescriptionList-module_full__EYw0V {\n grid-column: 1 / -1;\n}\n\n.DescriptionList-module_label__6FxWe {\n font-size: var(--lb-font-size-xs);\n font-weight: var(--lb-font-weight-medium);\n color: var(--lb-color-muted-foreground);\n text-transform: uppercase;\n letter-spacing: 0.03em;\n}\n\n.DescriptionList-module_value__AXC0B {\n margin: var(--lb-space-1) 0 0;\n font-size: var(--lb-font-size-sm);\n color: var(--lb-color-foreground);\n overflow-wrap: anywhere;\n}\n\n.DescriptionList-module_highlight__yuPI3 {\n font-weight: var(--lb-font-weight-semibold);\n color: var(--lb-color-primary-strong, var(--lb-color-primary));\n}\n\n.DescriptionList-module_missing__b8EZA {\n color: var(--lb-color-muted-foreground);\n}\n\n.DescriptionList-module_empty__iD-Ej,\n.DescriptionList-module_footnote__hQhVr {\n margin: 0;\n font-size: var(--lb-font-size-xs);\n color: var(--lb-color-muted-foreground);\n}\n\n.DescriptionList-module_footnote__hQhVr {\n margin-top: var(--lb-space-3);\n}\n");const n=(...e)=>e.filter(Boolean).join(" "),o=e=>null==e||""===e;function l({items:l,title:s,columns:r=2,emptyValue:a="—",emptyText:m="Sin datos.",footnote:c,className:_}){return e("section",{className:n(t.wrapper,_),children:[s&&i("h3",{className:t.title,children:s}),0===l.length?i("p",{className:t.empty,children:m}):i("dl",{className:n(t.list,t[`cols${r}`]),children:l.map((l,s)=>e("div",{className:n(t.item,l.fullWidth&&t.full),children:[i("dt",{className:t.label,children:l.label}),i("dd",{className:n(t.value,l.highlight&&t.highlight,o(l.value)&&t.missing),children:o(l.value)?a:l.value})]},s))}),c&&i("p",{className:t.footnote,children:c})]})}export{l as default};
1
+ import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useUiMessages as t}from"@rubenpazch/shared";var n={wrapper:"DescriptionList-module_wrapper__vsJV5",title:"DescriptionList-module_title__q33V9",list:"DescriptionList-module_list__EGDQC",cols2:"DescriptionList-module_cols2__uRkpK",cols3:"DescriptionList-module_cols3__qAkyu",item:"DescriptionList-module_item__X4XEW",full:"DescriptionList-module_full__EYw0V",label:"DescriptionList-module_label__6FxWe",value:"DescriptionList-module_value__AXC0B",highlight:"DescriptionList-module_highlight__yuPI3",missing:"DescriptionList-module_missing__b8EZA",empty:"DescriptionList-module_empty__iD-Ej",footnote:"DescriptionList-module_footnote__hQhVr"};!function(e,i){void 0===i&&(i={});var t=i.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".DescriptionList-module_wrapper__vsJV5 {\n font-family: var(--lb-font-sans);\n}\n\n.DescriptionList-module_title__q33V9 {\n margin: 0 0 var(--lb-space-3);\n font-size: var(--lb-font-size-sm);\n font-weight: var(--lb-font-weight-semibold);\n color: var(--lb-color-foreground);\n}\n\n.DescriptionList-module_list__EGDQC {\n display: grid;\n grid-template-columns: 1fr;\n gap: var(--lb-space-3) var(--lb-space-6);\n margin: 0;\n}\n\n@media (min-width: 640px) {\n .DescriptionList-module_cols2__uRkpK {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .DescriptionList-module_cols3__qAkyu {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n}\n\n.DescriptionList-module_item__X4XEW {\n min-width: 0;\n}\n\n.DescriptionList-module_full__EYw0V {\n grid-column: 1 / -1;\n}\n\n.DescriptionList-module_label__6FxWe {\n font-size: var(--lb-font-size-xs);\n font-weight: var(--lb-font-weight-medium);\n color: var(--lb-color-muted-foreground);\n text-transform: uppercase;\n letter-spacing: 0.03em;\n}\n\n.DescriptionList-module_value__AXC0B {\n margin: var(--lb-space-1) 0 0;\n font-size: var(--lb-font-size-sm);\n color: var(--lb-color-foreground);\n overflow-wrap: anywhere;\n}\n\n.DescriptionList-module_highlight__yuPI3 {\n font-weight: var(--lb-font-weight-semibold);\n color: var(--lb-color-primary-strong, var(--lb-color-primary));\n}\n\n.DescriptionList-module_missing__b8EZA {\n color: var(--lb-color-muted-foreground);\n}\n\n.DescriptionList-module_empty__iD-Ej,\n.DescriptionList-module_footnote__hQhVr {\n margin: 0;\n font-size: var(--lb-font-size-xs);\n color: var(--lb-color-muted-foreground);\n}\n\n.DescriptionList-module_footnote__hQhVr {\n margin-top: var(--lb-space-3);\n}\n");const o=(...e)=>e.filter(Boolean).join(" "),l=e=>null==e||""===e;function s({items:s,title:r,columns:a=2,emptyValue:m="—",emptyText:c,footnote:d,className:_,labels:p}){const u=t("descriptionList",p);return e("section",{className:o(n.wrapper,_),children:[r&&i("h3",{className:n.title,children:r}),0===s.length?i("p",{className:n.empty,children:c??u.empty}):i("dl",{className:o(n.list,n[`cols${a}`]),children:s.map((t,s)=>e("div",{className:o(n.item,t.fullWidth&&n.full),children:[i("dt",{className:n.label,children:t.label}),i("dd",{className:o(n.value,t.highlight&&n.highlight,l(t.value)&&n.missing),children:l(t.value)?m:t.value})]},s))}),d&&i("p",{className:n.footnote,children:d})]})}export{s as default};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/DescriptionList.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React from \"react\";\nimport styles from \"./DescriptionList.module.css\";\n\nexport interface DescriptionItem {\n /** Etiqueta: \"Remitente\", \"Fecha de ingreso\". */\n label: React.ReactNode;\n /** Valor. Vacío (null, undefined o \"\") muestra `emptyValue`. */\n value?: React.ReactNode;\n /** Resalta el valor (p. ej. un dato importante o inferido). */\n highlight?: boolean;\n /** Ocupa toda la fila (textos largos: asunto, observaciones). */\n fullWidth?: boolean;\n}\n\nexport interface DescriptionListProps {\n items: DescriptionItem[];\n /** Título opcional sobre la lista. */\n title?: React.ReactNode;\n /** Columnas en pantallas anchas (en móvil siempre 1). Por defecto 2. */\n columns?: 1 | 2 | 3;\n /** Qué mostrar si un valor está vacío. */\n emptyValue?: React.ReactNode;\n /** Texto si no hay ningún dato. */\n emptyText?: React.ReactNode;\n /** Nota al pie (fuente de los datos, aclaraciones). */\n footnote?: React.ReactNode;\n className?: string;\n}\n\nconst cx = (...c: Array<string | false | undefined>) =>\n c.filter(Boolean).join(\" \");\nconst vacio = (v: React.ReactNode) => v === null || v === undefined || v === \"\";\n\n/** Pares etiqueta/valor de solo lectura (`<dl>`): resumen de un registro. */\nexport default function DescriptionList({\n items,\n title,\n columns = 2,\n emptyValue = \"—\",\n emptyText = \"Sin datos.\",\n footnote,\n className,\n}: DescriptionListProps) {\n return (\n <section className={cx(styles.wrapper, className)}>\n {title && <h3 className={styles.title}>{title}</h3>}\n {items.length === 0 ? (\n <p className={styles.empty}>{emptyText}</p>\n ) : (\n <dl className={cx(styles.list, styles[`cols${columns}`])}>\n {items.map((item, i) => (\n <div\n key={i}\n className={cx(styles.item, item.fullWidth && styles.full)}\n >\n <dt className={styles.label}>{item.label}</dt>\n <dd\n className={cx(\n styles.value,\n item.highlight && styles.highlight,\n vacio(item.value) && styles.missing,\n )}\n >\n {vacio(item.value) ? emptyValue : item.value}\n </dd>\n </div>\n ))}\n </dl>\n )}\n {footnote && <p className={styles.footnote}>{footnote}</p>}\n </section>\n );\n}\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","cx","c","filter","Boolean","join","vacio","v","DescriptionList","items","title","columns","emptyValue","emptyText","footnote","className","_jsxs","styles","wrapper","children","_jsx","length","empty","list","map","item","i","fullWidth","full","label","value","highlight","missing"],"mappings":"uoBAAA,SAAqBA,EAAKC,YACnBA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,+sDCIA,MAAMe,EAAK,IAAIC,IACbA,EAAEC,OAAOC,SAASC,KAAK,KACnBC,EAASC,GAAuBA,SAAuC,KAANA,EAGzD,SAAUC,GAAgBC,MACtCA,EAAKC,MACLA,EAAKC,QACLA,EAAU,EAACC,WACXA,EAAa,IAAGC,UAChBA,EAAY,aAAYC,SACxBA,EAAQC,UACRA,IAEA,OACEC,EAAA,UAAA,CAASD,UAAWd,EAAGgB,EAAOC,QAASH,GAAUI,SAAA,CAC9CT,GAASU,EAAA,KAAA,CAAIL,UAAWE,EAAOP,MAAKS,SAAGT,IACtB,IAAjBD,EAAMY,OACLD,EAAA,IAAA,CAAGL,UAAWE,EAAOK,MAAKH,SAAGN,IAE7BO,EAAA,KAAA,CAAIL,UAAWd,EAAGgB,EAAOM,KAAMN,EAAO,OAAON,MAAWQ,SACrDV,EAAMe,IAAI,CAACC,EAAMC,IAChBV,EAAA,MAAA,CAEED,UAAWd,EAAGgB,EAAOQ,KAAMA,EAAKE,WAAaV,EAAOW,MAAKT,SAAA,CAEzDC,QAAIL,UAAWE,EAAOY,MAAKV,SAAGM,EAAKI,QACnCT,EAAA,KAAA,CACEL,UAAWd,EACTgB,EAAOa,MACPL,EAAKM,WAAad,EAAOc,UACzBzB,EAAMmB,EAAKK,QAAUb,EAAOe,SAC7Bb,SAEAb,EAAMmB,EAAKK,OAASlB,EAAaa,EAAKK,UAXpCJ,MAiBZZ,GAAYM,EAAA,IAAA,CAAGL,UAAWE,EAAOH,SAAQK,SAAGL,MAGnD","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/DescriptionList.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React from \"react\";\nimport { useUiMessages, type UiMessages } from \"@rubenpazch/shared\";\nimport styles from \"./DescriptionList.module.css\";\n\nexport interface DescriptionItem {\n /** Etiqueta: \"Remitente\", \"Fecha de ingreso\". */\n label: React.ReactNode;\n /** Valor. Vacío (null, undefined o \"\") muestra `emptyValue`. */\n value?: React.ReactNode;\n /** Resalta el valor (p. ej. un dato importante o inferido). */\n highlight?: boolean;\n /** Ocupa toda la fila (textos largos: asunto, observaciones). */\n fullWidth?: boolean;\n}\n\nexport interface DescriptionListProps {\n items: DescriptionItem[];\n /** Título opcional sobre la lista. */\n title?: React.ReactNode;\n /** Columnas en pantallas anchas (en móvil siempre 1). Por defecto 2. */\n columns?: 1 | 2 | 3;\n /** Qué mostrar si un valor está vacío. */\n emptyValue?: React.ReactNode;\n /** Texto si no hay ningún dato. */\n emptyText?: React.ReactNode;\n /** Nota al pie (fuente de los datos, aclaraciones). */\n footnote?: React.ReactNode;\n className?: string;\n /**\n * Textos de la interfaz. Por defecto, los del idioma activo (`UiLocaleProvider`);\n * también se cambian para toda la app con su prop `messages`.\n */\n labels?: Partial<UiMessages[\"descriptionList\"]>;\n}\n\nconst cx = (...c: Array<string | false | undefined>) =>\n c.filter(Boolean).join(\" \");\nconst vacio = (v: React.ReactNode) => v === null || v === undefined || v === \"\";\n\n/** Pares etiqueta/valor de solo lectura (`<dl>`): resumen de un registro. */\nexport default function DescriptionList({\n items,\n title,\n columns = 2,\n emptyValue = \"—\",\n emptyText,\n footnote,\n className,\n labels,\n}: DescriptionListProps) {\n const t = useUiMessages(\"descriptionList\", labels);\n return (\n <section className={cx(styles.wrapper, className)}>\n {title && <h3 className={styles.title}>{title}</h3>}\n {items.length === 0 ? (\n <p className={styles.empty}>{emptyText ?? t.empty}</p>\n ) : (\n <dl className={cx(styles.list, styles[`cols${columns}`])}>\n {items.map((item, i) => (\n <div\n key={i}\n className={cx(styles.item, item.fullWidth && styles.full)}\n >\n <dt className={styles.label}>{item.label}</dt>\n <dd\n className={cx(\n styles.value,\n item.highlight && styles.highlight,\n vacio(item.value) && styles.missing,\n )}\n >\n {vacio(item.value) ? emptyValue : item.value}\n </dd>\n </div>\n ))}\n </dl>\n )}\n {footnote && <p className={styles.footnote}>{footnote}</p>}\n </section>\n );\n}\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","cx","c","filter","Boolean","join","vacio","v","DescriptionList","items","title","columns","emptyValue","emptyText","footnote","className","labels","t","useUiMessages","_jsxs","styles","wrapper","children","_jsx","length","empty","list","map","item","i","fullWidth","full","label","value","highlight","missing"],"mappings":"0rBAAA,SAAqBA,EAAKC,YACnBA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,+sDCUA,MAAMe,EAAK,IAAIC,IACbA,EAAEC,OAAOC,SAASC,KAAK,KACnBC,EAASC,GAAuBA,SAAuC,KAANA,EAGzD,SAAUC,GAAgBC,MACtCA,EAAKC,MACLA,EAAKC,QACLA,EAAU,EAACC,WACXA,EAAa,IAAGC,UAChBA,EAASC,SACTA,EAAQC,UACRA,EAASC,OACTA,IAEA,MAAMC,EAAIC,EAAc,kBAAmBF,GAC3C,OACEG,EAAA,UAAA,CAASJ,UAAWd,EAAGmB,EAAOC,QAASN,GAAUO,SAAA,CAC9CZ,GAASa,EAAA,KAAA,CAAIR,UAAWK,EAAOV,MAAKY,SAAGZ,IACtB,IAAjBD,EAAMe,OACLD,OAAGR,UAAWK,EAAOK,eAAQZ,GAAaI,EAAEQ,QAE5CF,EAAA,KAAA,CAAIR,UAAWd,EAAGmB,EAAOM,KAAMN,EAAO,OAAOT,eAC1CF,EAAMkB,IAAI,CAACC,EAAMC,IAChBV,EAAA,MAAA,CAEEJ,UAAWd,EAAGmB,EAAOQ,KAAMA,EAAKE,WAAaV,EAAOW,MAAKT,SAAA,CAEzDC,EAAA,KAAA,CAAIR,UAAWK,EAAOY,eAAQJ,EAAKI,QACnCT,EAAA,KAAA,CACER,UAAWd,EACTmB,EAAOa,MACPL,EAAKM,WAAad,EAAOc,UACzB5B,EAAMsB,EAAKK,QAAUb,EAAOe,kBAG7B7B,EAAMsB,EAAKK,OAASrB,EAAagB,EAAKK,UAXpCJ,MAiBZf,GAAYS,EAAA,IAAA,CAAGR,UAAWK,EAAON,SAAQQ,SAAGR,MAGnD","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubenpazch/description-list",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Lista de pares etiqueta/valor (resumen de datos)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,7 +29,9 @@
29
29
  "react-dom": "^19.2.3",
30
30
  "@rubenpazch/tokens": "0.5.0"
31
31
  },
32
- "dependencies": {},
32
+ "dependencies": {
33
+ "@rubenpazch/shared": "5.5.0"
34
+ },
33
35
  "devDependencies": {
34
36
  "@rollup/plugin-commonjs": "^29.0.3",
35
37
  "@rollup/plugin-node-resolve": "^16.0.3",
@@ -56,8 +58,8 @@
56
58
  "typescript": "^6.0.3",
57
59
  "@rubenpazch/eslint-config": "4.0.0",
58
60
  "@rubenpazch/typescript-config": "3.0.0",
59
- "@rubenpazch/badge": "0.1.2",
60
- "@rubenpazch/button": "6.2.3"
61
+ "@rubenpazch/badge": "0.1.4",
62
+ "@rubenpazch/button": "6.2.7"
61
63
  },
62
64
  "publishConfig": {
63
65
  "access": "public"