@moni-labs/moni-ui 0.3.0 → 0.3.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.
Files changed (251) hide show
  1. package/custom-elements.json +5230 -1007
  2. package/dist/components/_base/moni-element.d.ts +16 -9
  3. package/dist/components/_base/moni-element.d.ts.map +1 -1
  4. package/dist/components/_base/moni-element.js +63 -9
  5. package/dist/components/index.js +2 -2
  6. package/dist/components/loading-shapes.d.ts +19 -0
  7. package/dist/components/loading-shapes.d.ts.map +1 -1
  8. package/dist/components/loading-shapes.js +19 -0
  9. package/dist/components/moni-app-bar.d.ts +72 -62
  10. package/dist/components/moni-app-bar.d.ts.map +1 -1
  11. package/dist/components/moni-app-bar.js +72 -62
  12. package/dist/components/moni-badge.d.ts +64 -65
  13. package/dist/components/moni-badge.d.ts.map +1 -1
  14. package/dist/components/moni-badge.js +64 -66
  15. package/dist/components/moni-bottom-sheet.d.ts +129 -61
  16. package/dist/components/moni-bottom-sheet.d.ts.map +1 -1
  17. package/dist/components/moni-bottom-sheet.js +217 -131
  18. package/dist/components/moni-button-group.d.ts +107 -29
  19. package/dist/components/moni-button-group.d.ts.map +1 -1
  20. package/dist/components/moni-button-group.js +107 -29
  21. package/dist/components/moni-button-segment.d.ts +53 -12
  22. package/dist/components/moni-button-segment.d.ts.map +1 -1
  23. package/dist/components/moni-button-segment.js +53 -12
  24. package/dist/components/moni-button.d.ts +116 -38
  25. package/dist/components/moni-button.d.ts.map +1 -1
  26. package/dist/components/moni-button.js +128 -38
  27. package/dist/components/moni-card.d.ts +68 -50
  28. package/dist/components/moni-card.d.ts.map +1 -1
  29. package/dist/components/moni-card.js +68 -50
  30. package/dist/components/moni-carousel.d.ts +484 -53
  31. package/dist/components/moni-carousel.d.ts.map +1 -1
  32. package/dist/components/moni-carousel.js +1024 -245
  33. package/dist/components/moni-checkbox.d.ts +49 -46
  34. package/dist/components/moni-checkbox.d.ts.map +1 -1
  35. package/dist/components/moni-checkbox.js +55 -48
  36. package/dist/components/moni-chip.d.ts +100 -33
  37. package/dist/components/moni-chip.d.ts.map +1 -1
  38. package/dist/components/moni-chip.js +104 -34
  39. package/dist/components/moni-color-field.d.ts +99 -24
  40. package/dist/components/moni-color-field.d.ts.map +1 -1
  41. package/dist/components/moni-color-field.js +99 -24
  42. package/dist/components/moni-context-menu.d.ts +72 -26
  43. package/dist/components/moni-context-menu.d.ts.map +1 -1
  44. package/dist/components/moni-context-menu.js +76 -30
  45. package/dist/components/moni-dialog.d.ts +84 -59
  46. package/dist/components/moni-dialog.d.ts.map +1 -1
  47. package/dist/components/moni-dialog.js +105 -58
  48. package/dist/components/moni-divider.d.ts +39 -27
  49. package/dist/components/moni-divider.d.ts.map +1 -1
  50. package/dist/components/moni-divider.js +42 -30
  51. package/dist/components/moni-expansion.d.ts +32 -22
  52. package/dist/components/moni-expansion.d.ts.map +1 -1
  53. package/dist/components/moni-expansion.js +32 -22
  54. package/dist/components/moni-fab-menu.d.ts +61 -23
  55. package/dist/components/moni-fab-menu.d.ts.map +1 -1
  56. package/dist/components/moni-fab-menu.js +69 -31
  57. package/dist/components/moni-fab.d.ts +86 -28
  58. package/dist/components/moni-fab.d.ts.map +1 -1
  59. package/dist/components/moni-fab.js +92 -34
  60. package/dist/components/moni-file-field.d.ts +118 -30
  61. package/dist/components/moni-file-field.d.ts.map +1 -1
  62. package/dist/components/moni-file-field.js +118 -30
  63. package/dist/components/moni-icon.d.ts +40 -35
  64. package/dist/components/moni-icon.d.ts.map +1 -1
  65. package/dist/components/moni-icon.js +43 -38
  66. package/dist/components/moni-list-item.d.ts +46 -33
  67. package/dist/components/moni-list-item.d.ts.map +1 -1
  68. package/dist/components/moni-list-item.js +61 -41
  69. package/dist/components/moni-list.d.ts +30 -20
  70. package/dist/components/moni-list.d.ts.map +1 -1
  71. package/dist/components/moni-list.js +36 -21
  72. package/dist/components/moni-loading-indicator.d.ts +54 -22
  73. package/dist/components/moni-loading-indicator.d.ts.map +1 -1
  74. package/dist/components/moni-loading-indicator.js +54 -22
  75. package/dist/components/moni-menu-item.d.ts +23 -16
  76. package/dist/components/moni-menu-item.d.ts.map +1 -1
  77. package/dist/components/moni-menu-item.js +23 -16
  78. package/dist/components/moni-menu.d.ts +81 -28
  79. package/dist/components/moni-menu.d.ts.map +1 -1
  80. package/dist/components/moni-menu.js +81 -30
  81. package/dist/components/moni-morph-modal.d.ts +141 -0
  82. package/dist/components/moni-morph-modal.d.ts.map +1 -1
  83. package/dist/components/moni-morph-modal.js +295 -58
  84. package/dist/components/moni-nav-item.d.ts +59 -29
  85. package/dist/components/moni-nav-item.d.ts.map +1 -1
  86. package/dist/components/moni-nav-item.js +59 -29
  87. package/dist/components/moni-nav.d.ts +94 -35
  88. package/dist/components/moni-nav.d.ts.map +1 -1
  89. package/dist/components/moni-nav.js +94 -35
  90. package/dist/components/moni-progress.d.ts +99 -55
  91. package/dist/components/moni-progress.d.ts.map +1 -1
  92. package/dist/components/moni-progress.js +99 -55
  93. package/dist/components/moni-radio.d.ts +62 -50
  94. package/dist/components/moni-radio.d.ts.map +1 -1
  95. package/dist/components/moni-radio.js +65 -52
  96. package/dist/components/moni-ripple.d.ts +74 -59
  97. package/dist/components/moni-ripple.d.ts.map +1 -1
  98. package/dist/components/moni-ripple.js +74 -59
  99. package/dist/components/moni-segmented-button.d.ts +91 -16
  100. package/dist/components/moni-segmented-button.d.ts.map +1 -1
  101. package/dist/components/moni-segmented-button.js +94 -17
  102. package/dist/components/moni-select-option.d.ts +30 -23
  103. package/dist/components/moni-select-option.d.ts.map +1 -1
  104. package/dist/components/moni-select-option.js +30 -23
  105. package/dist/components/moni-select.d.ts +300 -35
  106. package/dist/components/moni-select.d.ts.map +1 -1
  107. package/dist/components/moni-select.js +323 -39
  108. package/dist/components/moni-side-sheet.d.ts +94 -32
  109. package/dist/components/moni-side-sheet.d.ts.map +1 -1
  110. package/dist/components/moni-side-sheet.js +94 -32
  111. package/dist/components/moni-slider.d.ts +152 -41
  112. package/dist/components/moni-slider.d.ts.map +1 -1
  113. package/dist/components/moni-slider.js +154 -42
  114. package/dist/components/moni-snackbar.d.ts +53 -43
  115. package/dist/components/moni-snackbar.d.ts.map +1 -1
  116. package/dist/components/moni-snackbar.js +53 -43
  117. package/dist/components/moni-split-button.d.ts +63 -18
  118. package/dist/components/moni-split-button.d.ts.map +1 -1
  119. package/dist/components/moni-split-button.js +63 -18
  120. package/dist/components/moni-step.d.ts +36 -24
  121. package/dist/components/moni-step.d.ts.map +1 -1
  122. package/dist/components/moni-step.js +41 -29
  123. package/dist/components/moni-stepper.d.ts +64 -27
  124. package/dist/components/moni-stepper.d.ts.map +1 -1
  125. package/dist/components/moni-stepper.js +72 -34
  126. package/dist/components/moni-switch.d.ts +57 -46
  127. package/dist/components/moni-switch.d.ts.map +1 -1
  128. package/dist/components/moni-switch.js +59 -47
  129. package/dist/components/moni-tab.d.ts +26 -18
  130. package/dist/components/moni-tab.d.ts.map +1 -1
  131. package/dist/components/moni-tab.js +29 -21
  132. package/dist/components/moni-tabs.d.ts +34 -28
  133. package/dist/components/moni-tabs.d.ts.map +1 -1
  134. package/dist/components/moni-tabs.js +34 -28
  135. package/dist/components/moni-text-field.d.ts +139 -29
  136. package/dist/components/moni-text-field.d.ts.map +1 -1
  137. package/dist/components/moni-text-field.js +157 -31
  138. package/dist/components/moni-textarea.d.ts +127 -29
  139. package/dist/components/moni-textarea.d.ts.map +1 -1
  140. package/dist/components/moni-textarea.js +131 -32
  141. package/dist/components/moni-time-picker.d.ts +114 -24
  142. package/dist/components/moni-time-picker.d.ts.map +1 -1
  143. package/dist/components/moni-time-picker.js +127 -33
  144. package/dist/components/moni-toolbar.d.ts +37 -23
  145. package/dist/components/moni-toolbar.d.ts.map +1 -1
  146. package/dist/components/moni-toolbar.js +37 -23
  147. package/dist/components/moni-tooltip.d.ts +100 -36
  148. package/dist/components/moni-tooltip.d.ts.map +1 -1
  149. package/dist/components/moni-tooltip.js +104 -40
  150. package/dist/components/moni-typography.d.ts +68 -30
  151. package/dist/components/moni-typography.d.ts.map +1 -1
  152. package/dist/components/moni-typography.js +70 -32
  153. package/dist/styles/tokens.css +7 -7
  154. package/dist/types/events.d.ts +17 -0
  155. package/dist/types/events.d.ts.map +1 -0
  156. package/dist/types/events.js +1 -0
  157. package/dist/utils/event-emitter.d.ts +13 -0
  158. package/dist/utils/event-emitter.d.ts.map +1 -0
  159. package/dist/utils/event-emitter.js +13 -0
  160. package/package.json +2 -1
  161. package/src/components/_base/moni-element.ts +73 -9
  162. package/src/components/index.ts +2 -2
  163. package/src/components/loading-shapes.ts +19 -0
  164. package/src/components/moni-app-bar.test.ts +10 -10
  165. package/src/components/moni-app-bar.ts +72 -62
  166. package/src/components/moni-badge.ts +64 -66
  167. package/src/components/moni-bottom-sheet.test.ts +39 -45
  168. package/src/components/moni-bottom-sheet.ts +222 -131
  169. package/src/components/moni-button-group.test.ts +14 -14
  170. package/src/components/moni-button-group.ts +107 -29
  171. package/src/components/moni-button-segment.ts +53 -12
  172. package/src/components/moni-button.test.ts +28 -26
  173. package/src/components/moni-button.ts +139 -39
  174. package/src/components/moni-card.test.ts +6 -6
  175. package/src/components/moni-card.ts +70 -50
  176. package/src/components/moni-carousel.test.ts +12 -12
  177. package/src/components/moni-carousel.ts +1129 -269
  178. package/src/components/moni-checkbox.test.ts +7 -7
  179. package/src/components/moni-checkbox.ts +62 -48
  180. package/src/components/moni-chip.test.ts +17 -17
  181. package/src/components/moni-chip.ts +112 -34
  182. package/src/components/moni-color-field.test.ts +5 -5
  183. package/src/components/moni-color-field.ts +108 -24
  184. package/src/components/moni-context-menu.test.ts +11 -11
  185. package/src/components/moni-context-menu.ts +76 -30
  186. package/src/components/moni-dialog.ts +108 -59
  187. package/src/components/moni-divider.test.ts +4 -4
  188. package/src/components/moni-divider.ts +42 -30
  189. package/src/components/moni-expansion.ts +32 -22
  190. package/src/components/moni-fab-menu.test.ts +11 -11
  191. package/src/components/moni-fab-menu.ts +69 -31
  192. package/src/components/moni-fab.test.ts +16 -16
  193. package/src/components/moni-fab.ts +100 -34
  194. package/src/components/moni-file-field.test.ts +8 -8
  195. package/src/components/moni-file-field.ts +132 -30
  196. package/src/components/moni-icon.test.ts +11 -11
  197. package/src/components/moni-icon.ts +43 -38
  198. package/src/components/moni-list-item.test.ts +10 -10
  199. package/src/components/moni-list-item.ts +61 -41
  200. package/src/components/moni-list.ts +37 -21
  201. package/src/components/moni-loading-indicator.test.ts +3 -3
  202. package/src/components/moni-loading-indicator.ts +54 -22
  203. package/src/components/moni-menu-item.ts +23 -16
  204. package/src/components/moni-menu.test.ts +7 -7
  205. package/src/components/moni-menu.ts +87 -30
  206. package/src/components/moni-morph-modal.test.ts +18 -17
  207. package/src/components/moni-morph-modal.ts +327 -60
  208. package/src/components/moni-nav-item.ts +59 -29
  209. package/src/components/moni-nav.test.ts +11 -11
  210. package/src/components/moni-nav.ts +94 -35
  211. package/src/components/moni-progress.test.ts +9 -9
  212. package/src/components/moni-progress.ts +100 -56
  213. package/src/components/moni-radio.test.ts +8 -8
  214. package/src/components/moni-radio.ts +71 -51
  215. package/src/components/moni-ripple.ts +74 -59
  216. package/src/components/moni-segmented-button.test.ts +4 -4
  217. package/src/components/moni-segmented-button.ts +94 -17
  218. package/src/components/moni-select-option.ts +30 -23
  219. package/src/components/moni-select.test.ts +11 -11
  220. package/src/components/moni-select.ts +361 -50
  221. package/src/components/moni-side-sheet.test.ts +7 -7
  222. package/src/components/moni-side-sheet.ts +94 -32
  223. package/src/components/moni-slider.test.ts +7 -7
  224. package/src/components/moni-slider.ts +165 -42
  225. package/src/components/moni-snackbar.test.ts +8 -8
  226. package/src/components/moni-snackbar.ts +53 -43
  227. package/src/components/moni-split-button.ts +63 -18
  228. package/src/components/moni-step.test.ts +7 -7
  229. package/src/components/moni-step.ts +41 -29
  230. package/src/components/moni-stepper.test.ts +7 -7
  231. package/src/components/moni-stepper.ts +72 -34
  232. package/src/components/moni-switch.test.ts +12 -12
  233. package/src/components/moni-switch.ts +66 -47
  234. package/src/components/moni-tab.test.ts +5 -5
  235. package/src/components/moni-tab.ts +29 -21
  236. package/src/components/moni-tabs.ts +34 -28
  237. package/src/components/moni-text-field.test.ts +13 -13
  238. package/src/components/moni-text-field.ts +181 -30
  239. package/src/components/moni-textarea.test.ts +17 -17
  240. package/src/components/moni-textarea.ts +155 -31
  241. package/src/components/moni-time-picker.test.ts +5 -5
  242. package/src/components/moni-time-picker.ts +128 -33
  243. package/src/components/moni-toolbar.test.ts +8 -8
  244. package/src/components/moni-toolbar.ts +37 -23
  245. package/src/components/moni-tooltip.test.ts +15 -15
  246. package/src/components/moni-tooltip.ts +107 -40
  247. package/src/components/moni-typography.test.ts +10 -10
  248. package/src/components/moni-typography.ts +73 -32
  249. package/src/styles/tokens.css +7 -7
  250. package/src/types/events.ts +17 -0
  251. package/src/utils/event-emitter.ts +26 -0
@@ -8,76 +8,154 @@ import { MoniElement } from './_base/index.js';
8
8
  import './moni-icon.js';
9
9
  import './moni-progress.js';
10
10
  /**
11
- * Material Design 3 Button component.
11
+ * Componente Material Design 3 Button.
12
12
  *
13
- * Buttons allow users to take actions and make choices with a single tap.
14
- * This component provides all M3 button variants, sizes, and shape morphing
15
- * capabilities (e.g. morphing to a pill shape on press or toggle).
13
+ * Los botones permiten a los usuarios realizar acciones y hacer elecciones con un solo toque.
14
+ * Este componente proporciona todas las variantes de botones de M3, tamaños y capacidades
15
+ * de transformación de formas (ej. cambiar a una forma de píldora al presionar o alternar).
16
16
  *
17
- * **M3 spec reference:** `m3-docs/components/buttons/specs.md`
17
+ * **Referencia de la especificación M3:** `m3-docs/components/buttons/specs.md`
18
18
  *
19
- * **Variants:**
20
- * - `filled` (default) — High emphasis. Use for primary actions.
21
- * - `tonal` — Medium emphasis. Secondary actions that still need to stand out.
22
- * - `elevated` — Medium emphasis with shadow. Used when sitting on patterned backgrounds.
23
- * - `outlined` — Medium emphasis, no fill. Secondary or tertiary actions.
24
- * - `text` — Low emphasis. Tertiary actions (e.g. dialog cancel button).
19
+ * **Variantes:**
20
+ * - `filled` (por defecto) — Énfasis alto. Úsalo para acciones principales.
21
+ * - `tonal` — Énfasis medio. Acciones secundarias que aún necesitan destacar.
22
+ * - `elevated` — Énfasis medio con sombra. Úsalo al sentarse sobre fondos con patrones.
23
+ * - `outlined` — Énfasis medio, sin relleno. Acciones secundarias o terciarias.
24
+ * - `text` — Énfasis bajo. Acciones terciarias (ej. botón de cancelar diálogo).
25
25
  *
26
- * **Shape morphing (M3 Expressive feature):**
27
- * - On press (active state): Round and square buttons morph to a slightly squarer
28
- * "pressed" shape with specific M3 corner radii (e.g. XS/S 8dp, M 12dp).
29
- * - On toggle (`active` attribute): The resting shape flips (e.g. roundsquare).
26
+ * **Transformación de forma (Característica M3 Expressive):**
27
+ * - Al presionar (estado activo): Los botones redondos y cuadrados se transforman a una forma
28
+ * "presionada" ligeramente más cuadrada con radios de esquina específicos de M3 (ej. XS/S 8dp, M 12dp).
29
+ * - Al alternar (atributo `active`): La forma de reposo se invierte (ej. redondocuadrado).
30
30
  *
31
- * **Rendering as a link:**
32
- * When the `href` attribute is provided, the component internally renders as
33
- * an `<a>` element instead of a `<button>`, allowing native routing and
34
- * middle-click (open in new tab) behaviors while maintaining button visuals.
31
+ * **Renderizando como un enlace:**
32
+ * Cuando se proporciona el atributo `href`, el componente se renderiza internamente como
33
+ * un elemento `<a>` en lugar de un `<button>`, permitiendo enrutamiento nativo y comportamientos
34
+ * de clic central (abrir en nueva pestaña) mientras mantiene los visuales del botón.
35
35
  *
36
36
  * @example
37
37
  * ```html
38
- * <!-- Primary filled button -->
39
- * <moni-button icon="add">Create new</moni-button>
38
+ * <!-- Botón primario relleno -->
39
+ * <moni-button icon="add">Crear nuevo</moni-button>
40
40
  *
41
- * <!-- Outlined button -->
42
- * <moni-button variant="outlined">Cancel</moni-button>
41
+ * <!-- Botón contorneado -->
42
+ * <moni-button variant="outlined">Cancelar</moni-button>
43
43
  *
44
- * <!-- Toggle button (toggles active state on click) -->
45
- * <moni-button icon="favorite" active>Like</moni-button>
44
+ * <!-- Botón de alternar (alterna estado activo al hacer clic) -->
45
+ * <moni-button icon="favorite" active>Me gusta</moni-button>
46
46
  *
47
- * <!-- Link button -->
48
- * <moni-button href="/settings" icon="settings">Settings</moni-button>
47
+ * <!-- Botón enlace -->
48
+ * <moni-button href="/settings" icon="settings">Ajustes</moni-button>
49
49
  * ```
50
50
  *
51
- * @slot default - The button label text.
52
- * @slot icon - Optional override for the leading icon.
53
- * @slot icon-trailing - Optional override for the trailing icon.
51
+ * @slot default - El texto de la etiqueta del botón.
52
+ * @slot icon - Sobrescritura opcional para el icono inicial (leading).
53
+ * @slot icon-trailing - Sobrescritura opcional para el icono final (trailing).
54
54
  *
55
- * @csspart button - The inner `<button>` or `<a>` element.
56
- * @csspart icon - The leading icon container.
57
- * @csspart label - The label container.
58
- * @csspart trailing-icon - The trailing icon container.
55
+ * @csspart button - El elemento interno `<button>` o `<a>`.
56
+ * @csspart icon - El contenedor del icono inicial.
57
+ * @csspart label - El contenedor de la etiqueta.
58
+ * @csspart trailing-icon - El contenedor del icono final.
59
59
  */
60
60
  export declare class MoniButton extends MoniElement {
61
61
  private static _deprecationWarned;
62
- variant: 'filled' | 'tonal' | 'outlined' | 'text' | 'fill' | 'elevated';
63
62
  /**
64
- * M3 Expressive sizes: xsmall, small, medium, large, xlarge.
65
- * `extra` is a Moni legacy alias for `xlarge`, deprecated in v0.3.1; will
66
- * be removed in v1.0. See `m3-docs/components/buttons/overview.md` § Sizes.
63
+ * Variante visual del botón.
64
+ * @type {'filled' | 'tonal' | 'outlined' | 'text' | 'fill' | 'elevated'}
65
+ * @default 'filled'
66
+ */
67
+ variant: 'filled' | 'tonal' | 'outlined' | 'text' | 'fill' | 'elevated' | 'error';
68
+ /**
69
+ * Tamaños de M3 Expressive: xsmall, small, medium, large, xlarge.
70
+ * `extra` es un alias heredado de Moni para `xlarge`, obsoleto en v0.3.1; se
71
+ * eliminará en v1.0. Ver `m3-docs/components/buttons/overview.md` § Sizes.
72
+ * @type {'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'extra'}
73
+ * @default 'medium'
67
74
  */
68
75
  size: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'extra';
76
+ /**
77
+ * Forma de las esquinas del botón.
78
+ * @type {'round' | 'no-round' | 'square' | 'circle' | 'left-round' | 'right-round' | 'top-round' | 'bottom-round' | 'left-round-flat' | 'right-round-flat' | 'top-round-flat' | 'bottom-round-flat' | 'inner-round'}
79
+ * @default 'round'
80
+ */
69
81
  shape: 'round' | 'no-round' | 'square' | 'circle' | 'left-round' | 'right-round' | 'top-round' | 'bottom-round' | 'left-round-flat' | 'right-round-flat' | 'top-round-flat' | 'bottom-round-flat' | 'inner-round';
82
+ /**
83
+ * Deshabilita el botón.
84
+ * @type {boolean}
85
+ */
70
86
  disabled: boolean;
87
+ /**
88
+ * Si es verdadero, muestra un indicador de carga y deshabilita el botón.
89
+ * @type {boolean}
90
+ */
71
91
  loading: boolean;
92
+ /**
93
+ * Si es verdadero, establece el botón a un estado activo/seleccionado.
94
+ * @type {boolean}
95
+ */
72
96
  active: boolean;
97
+ /**
98
+ * Nombre del icono inicial (Material Symbols).
99
+ * @type {string}
100
+ */
73
101
  icon: string;
102
+ /**
103
+ * Nombre del icono final (Material Symbols).
104
+ * @type {string}
105
+ */
74
106
  iconTrailing: string;
107
+ /**
108
+ * Tipo nativo del botón (cuando se renderiza como un `<button>`).
109
+ * @type {'button' | 'submit' | 'reset'}
110
+ * @default 'button'
111
+ */
75
112
  type: 'button' | 'submit' | 'reset';
113
+ /**
114
+ * Si está establecido, renderiza el botón como un elemento `<a>` con esta URL.
115
+ * @type {string}
116
+ */
76
117
  href: string;
118
+ /**
119
+ * Atributo target para los botones tipo enlace.
120
+ * @type {string}
121
+ */
77
122
  target: string;
78
123
  connectedCallback(): void;
79
124
  static styles: import("lit").CSSResult[];
125
+ /**
126
+ * Intercepta los clicks en botones tipo enlace (`href="..."`).
127
+ * Si el botón está desactivado (`disabled`), previene agresivamente
128
+ * tanto la navegación por defecto del navegador como la burbuja de eventos.
129
+ */
80
130
  private handleLinkClick;
131
+ /**
132
+ * Assembles the button's Shadow DOM structure for each Lit render cycle.
133
+ *
134
+ * **Variant → CSS class mapping:**
135
+ * | `variant` | CSS class | Visual result |
136
+ * |--------------|---------------|-----------------------------|
137
+ * | `'filled'` | `''` (empty) | Primary filled button |
138
+ * | `'outlined'` | `'border'` | Outlined/stroked button |
139
+ * | `'tonal'` | `'fill'` | Secondary container fill |
140
+ * | `'text'` | `'transparent'` | Ghost/text button |
141
+ * | `'elevated'` | `'elevated'` | Tonal surface + shadow |
142
+ *
143
+ * **Shape morphing:**
144
+ * When `active=true`, the button inverts its corner-radius shape to create
145
+ * a micro-animation where clicking "morphs" the shape (round → square, etc.).
146
+ * This is used in toggle-button patterns (e.g., a nav-item that morphs to
147
+ * indicate the current page).
148
+ *
149
+ * **Icon resolution priority:**
150
+ * 1. `loading=true` → renders a `<moni-progress>` spinner (hides label at 50% opacity).
151
+ * 2. `icon` attribute → renders a `<moni-icon>` in the leading icon slot.
152
+ * 3. Otherwise → renders the `icon` named slot for slotted content.
153
+ *
154
+ * **Link vs. button:**
155
+ * When `href` is set, the root element is an `<a>` tag (with disabled click
156
+ * guard) for proper browser navigation semantics. Otherwise it's a `<button>`
157
+ * with `type="button"` to prevent accidental form submission.
158
+ */
81
159
  render(): import("lit").TemplateResult<1>;
82
160
  }
83
161
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"moni-button.d.ts","sourceRoot":"","sources":["../../src/components/moni-button.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AACxB,OAAO,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBACa,UAAW,SAAQ,WAAW;IAC1C,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAS;IAG1C,OAAO,EACJ,QAAQ,GACR,OAAO,GACP,UAAU,GACV,MAAM,GACN,MAAM,GACN,UAAU,CAAY;IACzB;;;;OAIG;IAEH,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAE9E,KAAK,EACF,OAAO,GACP,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,aAAa,GACb,WAAW,GACX,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,mBAAmB,GACnB,aAAa,CAAW;IACiB,QAAQ,UAAS;IACjB,OAAO,UAAS;IAChB,MAAM,UAAS;IAC9B,IAAI,SAAM;IACkB,YAAY,SAAM;IAE3E,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAY;IAClB,IAAI,SAAM;IACV,MAAM,SAAM;IAEhC,iBAAiB,IAAI,IAAI;IAalC,OAAgB,MAAM,4BA6fpB;IAEF,OAAO,CAAC,eAAe;IAOd,MAAM;CAiFf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,UAAU,CAAC;KAC1B;CACD;AAED,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"moni-button.d.ts","sourceRoot":"","sources":["../../src/components/moni-button.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AACxB,OAAO,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBACa,UAAW,SAAQ,WAAW;IAC1C,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAS;IAE1C;;;;OAIG;IAEH,OAAO,EACJ,QAAQ,GACR,OAAO,GACP,UAAU,GACV,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,CAAY;IAEtB;;;;;;OAMG;IAEH,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAE9E;;;;OAIG;IAEH,KAAK,EACF,OAAO,GACP,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,aAAa,GACb,WAAW,GACX,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,mBAAmB,GACnB,aAAa,CAAW;IAE3B;;;OAGG;IACyC,QAAQ,UAAS;IAE7D;;;OAGG;IACyC,OAAO,UAAS;IAE5D;;;OAGG;IACyC,MAAM,UAAS;IAE3D;;;OAGG;IAC0B,IAAI,SAAM;IAEvC;;;OAGG;IACsD,YAAY,SAAM;IAE3E;;;;OAIG;IAEH,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAY;IAE/C;;;OAGG;IAC0B,IAAI,SAAM;IAEvC;;;OAGG;IAC0B,MAAM,SAAM;IAEhC,iBAAiB,IAAI,IAAI;IAalC,OAAgB,MAAM,4BAugBpB;IAEF;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAOvB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACM,MAAM;CAkFf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,UAAU,CAAC;KAC1B;CACD;AAED,eAAe,UAAU,CAAC"}
@@ -18,73 +18,118 @@ import { MoniElement, sharedStyles } from './_base/index.js';
18
18
  import './moni-icon.js';
19
19
  import './moni-progress.js';
20
20
  /**
21
- * Material Design 3 Button component.
21
+ * Componente Material Design 3 Button.
22
22
  *
23
- * Buttons allow users to take actions and make choices with a single tap.
24
- * This component provides all M3 button variants, sizes, and shape morphing
25
- * capabilities (e.g. morphing to a pill shape on press or toggle).
23
+ * Los botones permiten a los usuarios realizar acciones y hacer elecciones con un solo toque.
24
+ * Este componente proporciona todas las variantes de botones de M3, tamaños y capacidades
25
+ * de transformación de formas (ej. cambiar a una forma de píldora al presionar o alternar).
26
26
  *
27
- * **M3 spec reference:** `m3-docs/components/buttons/specs.md`
27
+ * **Referencia de la especificación M3:** `m3-docs/components/buttons/specs.md`
28
28
  *
29
- * **Variants:**
30
- * - `filled` (default) — High emphasis. Use for primary actions.
31
- * - `tonal` — Medium emphasis. Secondary actions that still need to stand out.
32
- * - `elevated` — Medium emphasis with shadow. Used when sitting on patterned backgrounds.
33
- * - `outlined` — Medium emphasis, no fill. Secondary or tertiary actions.
34
- * - `text` — Low emphasis. Tertiary actions (e.g. dialog cancel button).
29
+ * **Variantes:**
30
+ * - `filled` (por defecto) — Énfasis alto. Úsalo para acciones principales.
31
+ * - `tonal` — Énfasis medio. Acciones secundarias que aún necesitan destacar.
32
+ * - `elevated` — Énfasis medio con sombra. Úsalo al sentarse sobre fondos con patrones.
33
+ * - `outlined` — Énfasis medio, sin relleno. Acciones secundarias o terciarias.
34
+ * - `text` — Énfasis bajo. Acciones terciarias (ej. botón de cancelar diálogo).
35
35
  *
36
- * **Shape morphing (M3 Expressive feature):**
37
- * - On press (active state): Round and square buttons morph to a slightly squarer
38
- * "pressed" shape with specific M3 corner radii (e.g. XS/S 8dp, M 12dp).
39
- * - On toggle (`active` attribute): The resting shape flips (e.g. roundsquare).
36
+ * **Transformación de forma (Característica M3 Expressive):**
37
+ * - Al presionar (estado activo): Los botones redondos y cuadrados se transforman a una forma
38
+ * "presionada" ligeramente más cuadrada con radios de esquina específicos de M3 (ej. XS/S 8dp, M 12dp).
39
+ * - Al alternar (atributo `active`): La forma de reposo se invierte (ej. redondocuadrado).
40
40
  *
41
- * **Rendering as a link:**
42
- * When the `href` attribute is provided, the component internally renders as
43
- * an `<a>` element instead of a `<button>`, allowing native routing and
44
- * middle-click (open in new tab) behaviors while maintaining button visuals.
41
+ * **Renderizando como un enlace:**
42
+ * Cuando se proporciona el atributo `href`, el componente se renderiza internamente como
43
+ * un elemento `<a>` en lugar de un `<button>`, permitiendo enrutamiento nativo y comportamientos
44
+ * de clic central (abrir en nueva pestaña) mientras mantiene los visuales del botón.
45
45
  *
46
46
  * @example
47
47
  * ```html
48
- * <!-- Primary filled button -->
49
- * <moni-button icon="add">Create new</moni-button>
48
+ * <!-- Botón primario relleno -->
49
+ * <moni-button icon="add">Crear nuevo</moni-button>
50
50
  *
51
- * <!-- Outlined button -->
52
- * <moni-button variant="outlined">Cancel</moni-button>
51
+ * <!-- Botón contorneado -->
52
+ * <moni-button variant="outlined">Cancelar</moni-button>
53
53
  *
54
- * <!-- Toggle button (toggles active state on click) -->
55
- * <moni-button icon="favorite" active>Like</moni-button>
54
+ * <!-- Botón de alternar (alterna estado activo al hacer clic) -->
55
+ * <moni-button icon="favorite" active>Me gusta</moni-button>
56
56
  *
57
- * <!-- Link button -->
58
- * <moni-button href="/settings" icon="settings">Settings</moni-button>
57
+ * <!-- Botón enlace -->
58
+ * <moni-button href="/settings" icon="settings">Ajustes</moni-button>
59
59
  * ```
60
60
  *
61
- * @slot default - The button label text.
62
- * @slot icon - Optional override for the leading icon.
63
- * @slot icon-trailing - Optional override for the trailing icon.
61
+ * @slot default - El texto de la etiqueta del botón.
62
+ * @slot icon - Sobrescritura opcional para el icono inicial (leading).
63
+ * @slot icon-trailing - Sobrescritura opcional para el icono final (trailing).
64
64
  *
65
- * @csspart button - The inner `<button>` or `<a>` element.
66
- * @csspart icon - The leading icon container.
67
- * @csspart label - The label container.
68
- * @csspart trailing-icon - The trailing icon container.
65
+ * @csspart button - El elemento interno `<button>` o `<a>`.
66
+ * @csspart icon - El contenedor del icono inicial.
67
+ * @csspart label - El contenedor de la etiqueta.
68
+ * @csspart trailing-icon - El contenedor del icono final.
69
69
  */
70
70
  let MoniButton = class MoniButton extends MoniElement {
71
71
  constructor() {
72
72
  super(...arguments);
73
+ /**
74
+ * Variante visual del botón.
75
+ * @type {'filled' | 'tonal' | 'outlined' | 'text' | 'fill' | 'elevated'}
76
+ * @default 'filled'
77
+ */
73
78
  this.variant = 'filled';
74
79
  /**
75
- * M3 Expressive sizes: xsmall, small, medium, large, xlarge.
76
- * `extra` is a Moni legacy alias for `xlarge`, deprecated in v0.3.1; will
77
- * be removed in v1.0. See `m3-docs/components/buttons/overview.md` § Sizes.
80
+ * Tamaños de M3 Expressive: xsmall, small, medium, large, xlarge.
81
+ * `extra` es un alias heredado de Moni para `xlarge`, obsoleto en v0.3.1; se
82
+ * eliminará en v1.0. Ver `m3-docs/components/buttons/overview.md` § Sizes.
83
+ * @type {'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'extra'}
84
+ * @default 'medium'
78
85
  */
79
86
  this.size = 'medium';
87
+ /**
88
+ * Forma de las esquinas del botón.
89
+ * @type {'round' | 'no-round' | 'square' | 'circle' | 'left-round' | 'right-round' | 'top-round' | 'bottom-round' | 'left-round-flat' | 'right-round-flat' | 'top-round-flat' | 'bottom-round-flat' | 'inner-round'}
90
+ * @default 'round'
91
+ */
80
92
  this.shape = 'round';
93
+ /**
94
+ * Deshabilita el botón.
95
+ * @type {boolean}
96
+ */
81
97
  this.disabled = false;
98
+ /**
99
+ * Si es verdadero, muestra un indicador de carga y deshabilita el botón.
100
+ * @type {boolean}
101
+ */
82
102
  this.loading = false;
103
+ /**
104
+ * Si es verdadero, establece el botón a un estado activo/seleccionado.
105
+ * @type {boolean}
106
+ */
83
107
  this.active = false;
108
+ /**
109
+ * Nombre del icono inicial (Material Symbols).
110
+ * @type {string}
111
+ */
84
112
  this.icon = '';
113
+ /**
114
+ * Nombre del icono final (Material Symbols).
115
+ * @type {string}
116
+ */
85
117
  this.iconTrailing = '';
118
+ /**
119
+ * Tipo nativo del botón (cuando se renderiza como un `<button>`).
120
+ * @type {'button' | 'submit' | 'reset'}
121
+ * @default 'button'
122
+ */
86
123
  this.type = 'button';
124
+ /**
125
+ * Si está establecido, renderiza el botón como un elemento `<a>` con esta URL.
126
+ * @type {string}
127
+ */
87
128
  this.href = '';
129
+ /**
130
+ * Atributo target para los botones tipo enlace.
131
+ * @type {string}
132
+ */
88
133
  this.target = '';
89
134
  }
90
135
  static { MoniButton_1 = this; }
@@ -179,7 +224,7 @@ let MoniButton = class MoniButton extends MoniElement {
179
224
  /* Square keeps horizontal padding (like a normal button) but
180
225
  drops border-radius. Only the circle removes all padding. */
181
226
  .button.circle {
182
- padding: 0;
227
+ padding: 0 !important;
183
228
  border-radius: 50%;
184
229
  inline-size: 2.5rem;
185
230
  aspect-ratio: 1;
@@ -510,6 +555,16 @@ let MoniButton = class MoniButton extends MoniElement {
510
555
  color: var(--primary);
511
556
  box-shadow: var(--elevate1);
512
557
  }
558
+ .button.error {
559
+ background-color: var(--error);
560
+ color: var(--on-error);
561
+ }
562
+ .button.error:hover:not(:disabled) {
563
+ background-image: linear-gradient(color-mix(in srgb, currentColor 8%, transparent), color-mix(in srgb, currentColor 8%, transparent));
564
+ }
565
+ .button.error:focus-visible {
566
+ outline-color: var(--error);
567
+ }
513
568
 
514
569
  /* Disabled / active */
515
570
  .button:disabled,
@@ -610,12 +665,45 @@ let MoniButton = class MoniButton extends MoniElement {
610
665
  }
611
666
  `
612
667
  ]; }
668
+ /**
669
+ * Intercepta los clicks en botones tipo enlace (`href="..."`).
670
+ * Si el botón está desactivado (`disabled`), previene agresivamente
671
+ * tanto la navegación por defecto del navegador como la burbuja de eventos.
672
+ */
613
673
  handleLinkClick(e) {
614
674
  if (this.disabled) {
615
675
  e.preventDefault();
616
676
  e.stopPropagation();
617
677
  }
618
678
  }
679
+ /**
680
+ * Assembles the button's Shadow DOM structure for each Lit render cycle.
681
+ *
682
+ * **Variant → CSS class mapping:**
683
+ * | `variant` | CSS class | Visual result |
684
+ * |--------------|---------------|-----------------------------|
685
+ * | `'filled'` | `''` (empty) | Primary filled button |
686
+ * | `'outlined'` | `'border'` | Outlined/stroked button |
687
+ * | `'tonal'` | `'fill'` | Secondary container fill |
688
+ * | `'text'` | `'transparent'` | Ghost/text button |
689
+ * | `'elevated'` | `'elevated'` | Tonal surface + shadow |
690
+ *
691
+ * **Shape morphing:**
692
+ * When `active=true`, the button inverts its corner-radius shape to create
693
+ * a micro-animation where clicking "morphs" the shape (round → square, etc.).
694
+ * This is used in toggle-button patterns (e.g., a nav-item that morphs to
695
+ * indicate the current page).
696
+ *
697
+ * **Icon resolution priority:**
698
+ * 1. `loading=true` → renders a `<moni-progress>` spinner (hides label at 50% opacity).
699
+ * 2. `icon` attribute → renders a `<moni-icon>` in the leading icon slot.
700
+ * 3. Otherwise → renders the `icon` named slot for slotted content.
701
+ *
702
+ * **Link vs. button:**
703
+ * When `href` is set, the root element is an `<a>` tag (with disabled click
704
+ * guard) for proper browser navigation semantics. Otherwise it's a `<button>`
705
+ * with `type="button"` to prevent accidental form submission.
706
+ */
619
707
  render() {
620
708
  let variantClass = '';
621
709
  if (this.variant === 'outlined')
@@ -626,6 +714,8 @@ let MoniButton = class MoniButton extends MoniElement {
626
714
  variantClass = 'transparent';
627
715
  else if (this.variant === 'elevated')
628
716
  variantClass = 'elevated';
717
+ else if (this.variant === 'error')
718
+ variantClass = 'error';
629
719
  let activeShape = this.shape;
630
720
  if (this.active) {
631
721
  if (this.shape === 'round')
@@ -6,97 +6,115 @@
6
6
  */
7
7
  import { MoniElement } from './_base/index.js';
8
8
  /**
9
- * Material Design 3 Card component.
9
+ * Componente Material Design 3 Card.
10
10
  *
11
- * Cards display content and actions about a single subject. They are
12
- * container surfaces that group related information together, making it
13
- * easy for users to scan and interact with collections of related data.
11
+ * Las tarjetas muestran contenido y acciones sobre un solo sujeto. Son
12
+ * superficies contenedoras que agrupan información relacionada junta, haciendo
13
+ * fácil para los usuarios escanear e interactuar con colecciones de datos relacionados.
14
14
  *
15
- * **M3 spec reference:** `m3-docs/components/cards/specs.md`
15
+ * **Referencia de la especificación M3:** `m3-docs/components/cards/specs.md`
16
16
  *
17
- * **Variants:**
18
- * - `elevated` (default) — `surface-container-low` background + `--elevate1` shadow.
19
- * Best for collections where the card needs visual separation from a
20
- * patterned or colored background. Gains shadow on hover/drag.
21
- * - `filled` — `surface-container-highest` background, no shadow.
22
- * Lowest emphasis; use when cards sit directly on the main background surface.
23
- * - `outlined` — `surface` background + 1dp `outline-variant` stroke.
24
- * Highest structural emphasis without casting a shadow. Best on solid backgrounds.
17
+ * **Variantes:**
18
+ * - `elevated` (por defecto) — Fondo `surface-container-low` + sombra `--elevate1`.
19
+ * Mejor para colecciones donde la tarjeta necesita separación visual de un
20
+ * fondo con patrones o de color. Gana sombra al pasar el ratón/arrastrar.
21
+ * - `filled` — Fondo `surface-container-highest`, sin sombra.
22
+ * Énfasis más bajo; úsalo cuando las tarjetas se asientan directamente sobre la superficie del fondo principal.
23
+ * - `outlined` — Fondo `surface` + trazo `outline-variant` 1dp.
24
+ * Énfasis estructural más alto sin proyectar una sombra. Mejor en fondos sólidos.
25
25
  *
26
- * **M3 measurements:**
27
- * - Container corner radius: 12dp.
28
- * - Horizontal content padding: 16dp.
29
- * - Gap between cards in a collection: max 8dp.
30
- * - Headline text alignment: start.
26
+ * **Medidas M3:**
27
+ * - Radio de esquina del contenedor: 12dp.
28
+ * - Relleno de contenido horizontal: 16dp.
29
+ * - Espacio entre tarjetas en una colección: máx. 8dp.
30
+ * - Alineación de texto del titular: inicio.
31
31
  *
32
- * **Interactive cards:**
33
- * When `clickable=true`, the card renders M3 state layer overlays on hover,
34
- * focus, and press via the `::before` pseudo-element. The consumer must handle
35
- * the `click` event to implement navigation or selection logic.
32
+ * **Tarjetas interactivas:**
33
+ * Cuando `clickable=true`, la tarjeta renderiza capas de estado M3 (hover,
34
+ * focus, press) a través del pseudo-elemento `::before`. El consumidor debe manejar
35
+ * el evento `click` para implementar la lógica de navegación o selección.
36
36
  *
37
37
  * @example
38
38
  * ```html
39
39
  * <moni-card variant="outlined" clickable>
40
- * <img slot="media" src="photo.jpg" alt="Card image" />
41
- * <h3 slot="headline">Card Title</h3>
42
- * <p slot="supporting">Supporting text that describes the card topic.</p>
40
+ * <img slot="media" src="photo.jpg" alt="Imagen de la tarjeta" />
41
+ * <h3 slot="headline">Título de Tarjeta</h3>
42
+ * <p slot="supporting">Texto de soporte que describe el tema de la tarjeta.</p>
43
43
  * <div slot="actions">
44
- * <moni-button variant="text">Cancel</moni-button>
45
- * <moni-button>Confirm</moni-button>
44
+ * <moni-button variant="text">Cancelar</moni-button>
45
+ * <moni-button>Confirmar</moni-button>
46
46
  * </div>
47
47
  * </moni-card>
48
48
  * ```
49
49
  *
50
- * @slot media - An image, video, or icon at the top of the card.
51
- * @slot default - Primary body content (replaces all named slots if used).
52
- * @slot headline - H3-equivalent title text.
53
- * @slot subhead - Secondary title below the headline.
54
- * @slot supporting - Descriptive supporting body text.
55
- * @slot actions - Action buttons row at the bottom of the card.
50
+ * @slot media - Una imagen, video, o icono en la parte superior de la tarjeta.
51
+ * @slot default - Contenido del cuerpo principal (reemplaza todos los slots con nombre si se usa).
52
+ * @slot headline - Texto de título equivalente a H3.
53
+ * @slot subhead - Título secundario debajo del titular.
54
+ * @slot supporting - Texto de soporte descriptivo del cuerpo.
55
+ * @slot actions - Fila de botones de acción en la parte inferior de la tarjeta.
56
56
  *
57
- * @csspart card - The outer card container.
58
- * @csspart media - The media area wrapper.
59
- * @csspart content - The content wrapper.
60
- * @csspart actions - The actions row wrapper.
57
+ * @csspart card - El contenedor exterior de la tarjeta.
58
+ * @csspart media - El contenedor del área de medios.
59
+ * @csspart content - El contenedor de contenido.
60
+ * @csspart actions - El contenedor de la fila de acciones.
61
61
  */
62
62
  export declare class MoniCard extends MoniElement {
63
63
  /**
64
- * Visual variant of the card.
64
+ * Variante visual de la tarjeta.
65
65
  *
66
- * - `'elevated'` (default) — Surface-low background + elevation shadow.
67
- * - `'filled'` — Surface-highest background, no shadow.
68
- * - `'outlined'` — Surface background + outline-variant stroke.
66
+ * - `'elevated'` (por defecto) — Fondo Surface-low + sombra de elevación.
67
+ * - `'filled'` — Fondo Surface-highest, sin sombra.
68
+ * - `'outlined'` — Fondo Surface + trazo outline-variant.
69
69
  *
70
70
  * @default 'elevated'
71
71
  */
72
72
  variant: 'elevated' | 'filled' | 'outlined';
73
73
  /**
74
- * When `true`, applies M3 state layer overlays (hover, focus, pressed)
75
- * to communicate interactivity. The card background shifts slightly on hover.
74
+ * Cuando es `true`, aplica capas de estado M3 (hover, focus, pressed)
75
+ * para comunicar interactividad. El fondo de la tarjeta cambia ligeramente en hover.
76
76
  *
77
- * Use when the card itself is a clickable navigation or selection target.
77
+ * Úsalo cuando la tarjeta en es un objetivo de navegación o selección clicable.
78
78
  *
79
79
  * @default false
80
80
  */
81
81
  clickable: boolean;
82
82
  /**
83
- * When `true`, applies `--elevate3` box-shadow to simulate the M3 "dragged"
84
- * state as specified in the M3 card interaction spec.
83
+ * Cuando es `true`, aplica box-shadow `--elevate3` para simular el estado "arrastrado"
84
+ * M3 según lo especificado en la especificación de interacción de tarjetas M3.
85
85
  *
86
- * Consumers should toggle this attribute based on the drag state of the card
87
- * (e.g. via a drag-and-drop library callback).
86
+ * Los consumidores deben alternar este atributo basado en el estado de arrastre de la tarjeta
87
+ * (ej. a través de un callback de biblioteca drag-and-drop).
88
88
  *
89
89
  * @default false
90
90
  */
91
91
  draggable: boolean;
92
92
  /**
93
- * When `true`, the card renders at 50% opacity with `cursor: not-allowed`,
94
- * signaling that the card and its actions are unavailable.
93
+ * Cuando es `true`, la tarjeta se renderiza con opacidad del 50% con `cursor: not-allowed`,
94
+ * indicando que la tarjeta y sus acciones no están disponibles.
95
95
  *
96
96
  * @default false
97
97
  */
98
98
  disabled: boolean;
99
99
  static styles: import("lit").CSSResult[];
100
+ /**
101
+ * Renderiza el contenedor de la tarjeta como un `<section>` con envoltorio interactivo opcional.
102
+ *
103
+ * **¿Por qué `<section>`?**
104
+ * Las tarjetas representan una unidad distintiva y cohesiva de contenido. Usar `<section>` da
105
+ * a los lectores de pantalla un punto de referencia ARIA implícito para que puedan navegar entre tarjetas.
106
+ *
107
+ * **Tarjetas interactivas (`clickable=true`):**
108
+ * Cuando es `clickable`, toda la superficie de la tarjeta se convierte en un `<button>` que envuelve
109
+ * all slots, giving the card keyboard focus and `click` semantics. A
110
+ * `<moni-ripple>` is rendered as the first child to provide the M3 touch feedback.
111
+ *
112
+ * **Slot zones:**
113
+ * - `[slot="media"]` — image or video area at the card's leading edge.
114
+ * - `[slot="header"]` — title and supporting text row.
115
+ * - Default slot — the card's main content body.
116
+ * - `[slot="footer"]` — action buttons row at the trailing edge.
117
+ */
100
118
  render(): import("lit").TemplateResult<1>;
101
119
  }
102
120
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"moni-card.d.ts","sourceRoot":"","sources":["../../src/components/moni-card.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,qBACa,QAAS,SAAQ,WAAW;IACxC;;;;;;;;OAQG;IAEH,OAAO,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAc;IAEzD;;;;;;;OAOG;IACyC,SAAS,UAAS;IAE9D;;;;;;;;OAQG;IACyC,SAAS,UAAS;IAE9D;;;;;OAKG;IACyC,QAAQ,UAAS;IAE7D,OAAgB,MAAM,4BAmIpB;IAEO,MAAM;CAiBf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"moni-card.d.ts","sourceRoot":"","sources":["../../src/components/moni-card.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,qBACa,QAAS,SAAQ,WAAW;IACxC;;;;;;;;OAQG;IAEH,OAAO,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAc;IAEzD;;;;;;;OAOG;IACyC,SAAS,UAAS;IAE9D;;;;;;;;OAQG;IACyC,SAAS,UAAS;IAE9D;;;;;OAKG;IACyC,QAAQ,UAAS;IAI7D,OAAgB,MAAM,4BAmIpB;IAEF;;;;;;;;;;;;;;;;;OAiBG;IACM,MAAM;CAiBf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD;AAED,eAAe,QAAQ,CAAC"}