@moni-labs/moni-ui 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/README.md +52 -194
  2. package/custom-elements.json +1636 -350
  3. package/dist/actions/index.d.ts +6 -0
  4. package/dist/actions/index.d.ts.map +1 -1
  5. package/dist/actions/index.js +6 -0
  6. package/dist/components/_base/field-styles.d.ts +51 -16
  7. package/dist/components/_base/field-styles.d.ts.map +1 -1
  8. package/dist/components/_base/field-styles.js +164 -36
  9. package/dist/components/_base/index.d.ts +25 -0
  10. package/dist/components/_base/index.d.ts.map +1 -1
  11. package/dist/components/_base/index.js +25 -0
  12. package/dist/components/_base/interaction-styles.d.ts +39 -12
  13. package/dist/components/_base/interaction-styles.d.ts.map +1 -1
  14. package/dist/components/_base/interaction-styles.js +85 -33
  15. package/dist/components/_base/moni-element.d.ts +43 -8
  16. package/dist/components/_base/moni-element.d.ts.map +1 -1
  17. package/dist/components/_base/moni-element.js +43 -8
  18. package/dist/components/_base/shared-styles.d.ts +41 -17
  19. package/dist/components/_base/shared-styles.d.ts.map +1 -1
  20. package/dist/components/_base/shared-styles.js +113 -21
  21. package/dist/components/index.d.ts +6 -0
  22. package/dist/components/index.d.ts.map +1 -1
  23. package/dist/components/index.js +6 -0
  24. package/dist/components/loading-shapes.d.ts +6 -0
  25. package/dist/components/loading-shapes.d.ts.map +1 -1
  26. package/dist/components/loading-shapes.js +6 -0
  27. package/dist/components/moni-app-bar.d.ts +128 -33
  28. package/dist/components/moni-app-bar.d.ts.map +1 -1
  29. package/dist/components/moni-app-bar.js +121 -26
  30. package/dist/components/moni-badge.d.ts +122 -14
  31. package/dist/components/moni-badge.d.ts.map +1 -1
  32. package/dist/components/moni-badge.js +122 -14
  33. package/dist/components/moni-bottom-sheet.d.ts +120 -15
  34. package/dist/components/moni-bottom-sheet.d.ts.map +1 -1
  35. package/dist/components/moni-bottom-sheet.js +116 -12
  36. package/dist/components/moni-button-group.d.ts +53 -27
  37. package/dist/components/moni-button-group.d.ts.map +1 -1
  38. package/dist/components/moni-button-group.js +49 -23
  39. package/dist/components/moni-button-segment.d.ts +28 -8
  40. package/dist/components/moni-button-segment.d.ts.map +1 -1
  41. package/dist/components/moni-button-segment.js +27 -7
  42. package/dist/components/moni-button.d.ts +51 -32
  43. package/dist/components/moni-button.d.ts.map +1 -1
  44. package/dist/components/moni-button.js +50 -31
  45. package/dist/components/moni-card.d.ts +91 -31
  46. package/dist/components/moni-card.d.ts.map +1 -1
  47. package/dist/components/moni-card.js +86 -26
  48. package/dist/components/moni-carousel.d.ts +67 -17
  49. package/dist/components/moni-carousel.d.ts.map +1 -1
  50. package/dist/components/moni-carousel.js +59 -16
  51. package/dist/components/moni-checkbox.d.ts +122 -17
  52. package/dist/components/moni-checkbox.d.ts.map +1 -1
  53. package/dist/components/moni-checkbox.js +118 -14
  54. package/dist/components/moni-chip.d.ts +56 -30
  55. package/dist/components/moni-chip.d.ts.map +1 -1
  56. package/dist/components/moni-chip.js +51 -25
  57. package/dist/components/moni-color-field.d.ts +44 -6
  58. package/dist/components/moni-color-field.d.ts.map +1 -1
  59. package/dist/components/moni-color-field.js +43 -5
  60. package/dist/components/moni-context-menu.d.ts +44 -22
  61. package/dist/components/moni-context-menu.d.ts.map +1 -1
  62. package/dist/components/moni-context-menu.js +43 -21
  63. package/dist/components/moni-dialog.d.ts +107 -15
  64. package/dist/components/moni-dialog.d.ts.map +1 -1
  65. package/dist/components/moni-dialog.js +105 -14
  66. package/dist/components/moni-divider.d.ts +50 -15
  67. package/dist/components/moni-divider.d.ts.map +1 -1
  68. package/dist/components/moni-divider.js +49 -14
  69. package/dist/components/moni-expansion.d.ts +44 -8
  70. package/dist/components/moni-expansion.d.ts.map +1 -1
  71. package/dist/components/moni-expansion.js +43 -7
  72. package/dist/components/moni-fab-menu.d.ts +39 -20
  73. package/dist/components/moni-fab-menu.d.ts.map +1 -1
  74. package/dist/components/moni-fab-menu.js +38 -19
  75. package/dist/components/moni-fab.d.ts +49 -23
  76. package/dist/components/moni-fab.d.ts.map +1 -1
  77. package/dist/components/moni-fab.js +46 -20
  78. package/dist/components/moni-file-field.d.ts +54 -14
  79. package/dist/components/moni-file-field.d.ts.map +1 -1
  80. package/dist/components/moni-file-field.js +53 -13
  81. package/dist/components/moni-icon.d.ts +78 -11
  82. package/dist/components/moni-icon.d.ts.map +1 -1
  83. package/dist/components/moni-icon.js +77 -10
  84. package/dist/components/moni-list-item.d.ts +61 -30
  85. package/dist/components/moni-list-item.d.ts.map +1 -1
  86. package/dist/components/moni-list-item.js +55 -24
  87. package/dist/components/moni-list.d.ts +37 -13
  88. package/dist/components/moni-list.d.ts.map +1 -1
  89. package/dist/components/moni-list.js +36 -12
  90. package/dist/components/moni-loading-indicator.d.ts +38 -11
  91. package/dist/components/moni-loading-indicator.d.ts.map +1 -1
  92. package/dist/components/moni-loading-indicator.js +37 -10
  93. package/dist/components/moni-menu-item.d.ts +31 -8
  94. package/dist/components/moni-menu-item.d.ts.map +1 -1
  95. package/dist/components/moni-menu-item.js +30 -7
  96. package/dist/components/moni-menu.d.ts +58 -33
  97. package/dist/components/moni-menu.d.ts.map +1 -1
  98. package/dist/components/moni-menu.js +51 -26
  99. package/dist/components/moni-morph-modal.d.ts +7 -1
  100. package/dist/components/moni-morph-modal.d.ts.map +1 -1
  101. package/dist/components/moni-morph-modal.js +46 -24
  102. package/dist/components/moni-nav-item.d.ts +50 -10
  103. package/dist/components/moni-nav-item.d.ts.map +1 -1
  104. package/dist/components/moni-nav-item.js +48 -8
  105. package/dist/components/moni-nav.d.ts +57 -22
  106. package/dist/components/moni-nav.d.ts.map +1 -1
  107. package/dist/components/moni-nav.js +53 -18
  108. package/dist/components/moni-progress.d.ts +108 -20
  109. package/dist/components/moni-progress.d.ts.map +1 -1
  110. package/dist/components/moni-progress.js +104 -16
  111. package/dist/components/moni-radio.d.ts +106 -14
  112. package/dist/components/moni-radio.d.ts.map +1 -1
  113. package/dist/components/moni-radio.js +104 -13
  114. package/dist/components/moni-ripple.d.ts +121 -10
  115. package/dist/components/moni-ripple.d.ts.map +1 -1
  116. package/dist/components/moni-ripple.js +120 -9
  117. package/dist/components/moni-segmented-button.d.ts +31 -11
  118. package/dist/components/moni-segmented-button.d.ts.map +1 -1
  119. package/dist/components/moni-segmented-button.js +30 -10
  120. package/dist/components/moni-select-option.d.ts +43 -9
  121. package/dist/components/moni-select-option.d.ts.map +1 -1
  122. package/dist/components/moni-select-option.js +41 -7
  123. package/dist/components/moni-select.d.ts +59 -2
  124. package/dist/components/moni-select.d.ts.map +1 -1
  125. package/dist/components/moni-select.js +58 -1
  126. package/dist/components/moni-shape.d.ts +1 -1
  127. package/dist/components/moni-side-sheet.d.ts +56 -19
  128. package/dist/components/moni-side-sheet.d.ts.map +1 -1
  129. package/dist/components/moni-side-sheet.js +53 -16
  130. package/dist/components/moni-slider.d.ts +56 -25
  131. package/dist/components/moni-slider.d.ts.map +1 -1
  132. package/dist/components/moni-slider.js +55 -24
  133. package/dist/components/moni-snackbar.d.ts +86 -17
  134. package/dist/components/moni-snackbar.d.ts.map +1 -1
  135. package/dist/components/moni-snackbar.js +85 -16
  136. package/dist/components/moni-split-button.d.ts +38 -9
  137. package/dist/components/moni-split-button.d.ts.map +1 -1
  138. package/dist/components/moni-split-button.js +37 -8
  139. package/dist/components/moni-step.d.ts +42 -9
  140. package/dist/components/moni-step.d.ts.map +1 -1
  141. package/dist/components/moni-step.js +41 -8
  142. package/dist/components/moni-stepper.d.ts +43 -6
  143. package/dist/components/moni-stepper.d.ts.map +1 -1
  144. package/dist/components/moni-stepper.js +42 -5
  145. package/dist/components/moni-switch.d.ts +103 -16
  146. package/dist/components/moni-switch.d.ts.map +1 -1
  147. package/dist/components/moni-switch.js +99 -13
  148. package/dist/components/moni-tab.d.ts +35 -8
  149. package/dist/components/moni-tab.d.ts.map +1 -1
  150. package/dist/components/moni-tab.js +34 -7
  151. package/dist/components/moni-tabs.d.ts +51 -13
  152. package/dist/components/moni-tabs.d.ts.map +1 -1
  153. package/dist/components/moni-tabs.js +48 -10
  154. package/dist/components/moni-text-field.d.ts +55 -10
  155. package/dist/components/moni-text-field.d.ts.map +1 -1
  156. package/dist/components/moni-text-field.js +54 -9
  157. package/dist/components/moni-textarea.d.ts +51 -21
  158. package/dist/components/moni-textarea.d.ts.map +1 -1
  159. package/dist/components/moni-textarea.js +48 -18
  160. package/dist/components/moni-time-picker.d.ts +41 -11
  161. package/dist/components/moni-time-picker.d.ts.map +1 -1
  162. package/dist/components/moni-time-picker.js +40 -10
  163. package/dist/components/moni-toolbar.d.ts +43 -15
  164. package/dist/components/moni-toolbar.d.ts.map +1 -1
  165. package/dist/components/moni-toolbar.js +42 -14
  166. package/dist/components/moni-tooltip.d.ts +55 -25
  167. package/dist/components/moni-tooltip.d.ts.map +1 -1
  168. package/dist/components/moni-tooltip.js +54 -24
  169. package/dist/components/moni-typography.d.ts +43 -18
  170. package/dist/components/moni-typography.d.ts.map +1 -1
  171. package/dist/components/moni-typography.js +42 -17
  172. package/dist/index.d.ts +47 -0
  173. package/dist/index.d.ts.map +1 -1
  174. package/dist/index.js +59 -2
  175. package/dist/styles/tailwind.css +67 -0
  176. package/dist/styles/tokens.css +111 -99
  177. package/dist/utils/color.d.ts +181 -2
  178. package/dist/utils/color.d.ts.map +1 -1
  179. package/dist/utils/color.js +182 -4
  180. package/dist/utils/theme.svelte.d.ts +305 -2
  181. package/dist/utils/theme.svelte.d.ts.map +1 -1
  182. package/dist/utils/theme.svelte.js +331 -2
  183. package/dist/web-components.d.ts +28 -0
  184. package/dist/web-components.d.ts.map +1 -1
  185. package/dist/web-components.js +29 -2
  186. package/package.json +1 -1
  187. package/src/actions/index.ts +7 -0
  188. package/src/components/_base/field-styles.ts +165 -37
  189. package/src/components/_base/index.ts +27 -0
  190. package/src/components/_base/interaction-styles.ts +86 -33
  191. package/src/components/_base/moni-element.ts +44 -8
  192. package/src/components/_base/shared-styles.ts +114 -21
  193. package/src/components/index.ts +7 -0
  194. package/src/components/loading-shapes.ts +7 -0
  195. package/src/components/moni-app-bar.ts +127 -26
  196. package/src/components/moni-badge.ts +128 -14
  197. package/src/components/moni-bottom-sheet.ts +125 -13
  198. package/src/components/moni-button-group.ts +50 -23
  199. package/src/components/moni-button-segment.ts +28 -7
  200. package/src/components/moni-button.ts +51 -31
  201. package/src/components/moni-card.ts +90 -26
  202. package/src/components/moni-carousel.ts +67 -16
  203. package/src/components/moni-checkbox.ts +125 -14
  204. package/src/components/moni-chip.ts +52 -25
  205. package/src/components/moni-color-field.ts +44 -5
  206. package/src/components/moni-context-menu.ts +44 -21
  207. package/src/components/moni-dialog.ts +111 -14
  208. package/src/components/moni-divider.ts +50 -14
  209. package/src/components/moni-expansion.ts +44 -7
  210. package/src/components/moni-fab-menu.ts +39 -19
  211. package/src/components/moni-fab.ts +47 -20
  212. package/src/components/moni-file-field.ts +54 -13
  213. package/src/components/moni-icon.ts +80 -10
  214. package/src/components/moni-list-item.ts +56 -24
  215. package/src/components/moni-list.ts +37 -12
  216. package/src/components/moni-loading-indicator.ts +38 -10
  217. package/src/components/moni-menu-item.ts +31 -7
  218. package/src/components/moni-menu.ts +52 -26
  219. package/src/components/moni-morph-modal.ts +58 -24
  220. package/src/components/moni-nav-item.ts +49 -8
  221. package/src/components/moni-nav.ts +54 -18
  222. package/src/components/moni-progress.ts +109 -16
  223. package/src/components/moni-radio.ts +111 -13
  224. package/src/components/moni-ripple.ts +126 -9
  225. package/src/components/moni-segmented-button.ts +31 -10
  226. package/src/components/moni-select-option.ts +42 -7
  227. package/src/components/moni-select.ts +79 -1
  228. package/src/components/moni-side-sheet.ts +54 -16
  229. package/src/components/moni-slider.ts +56 -24
  230. package/src/components/moni-snackbar.ts +90 -16
  231. package/src/components/moni-split-button.ts +38 -8
  232. package/src/components/moni-step.ts +42 -8
  233. package/src/components/moni-stepper.ts +43 -5
  234. package/src/components/moni-switch.ts +106 -13
  235. package/src/components/moni-tab.ts +35 -7
  236. package/src/components/moni-tabs.ts +49 -10
  237. package/src/components/moni-text-field.ts +55 -9
  238. package/src/components/moni-textarea.ts +49 -18
  239. package/src/components/moni-time-picker.ts +41 -10
  240. package/src/components/moni-toolbar.ts +43 -14
  241. package/src/components/moni-tooltip.ts +55 -24
  242. package/src/components/moni-typography.ts +43 -17
  243. package/src/index.ts +67 -3
  244. package/src/styles/tailwind.css +67 -0
  245. package/src/styles/tokens.css +111 -99
  246. package/src/types/svelte-runes.d.ts +64 -2
  247. package/src/utils/color.ts +286 -5
  248. package/src/utils/theme.svelte.ts +411 -2
  249. package/src/web-components.ts +31 -2
  250. package/dist/assets/shapes/arch.svg +0 -1
  251. package/dist/assets/shapes/arrow.svg +0 -1
  252. package/dist/assets/shapes/boom.svg +0 -1
  253. package/dist/assets/shapes/burst.svg +0 -1
  254. package/dist/assets/shapes/circle.svg +0 -1
  255. package/dist/assets/shapes/clamshell.svg +0 -1
  256. package/dist/assets/shapes/diamond.svg +0 -1
  257. package/dist/assets/shapes/fan.svg +0 -1
  258. package/dist/assets/shapes/flower.svg +0 -1
  259. package/dist/assets/shapes/gem.svg +0 -1
  260. package/dist/assets/shapes/ghost-ish.svg +0 -1
  261. package/dist/assets/shapes/heart.svg +0 -1
  262. package/dist/assets/shapes/leaf-clover4.svg +0 -1
  263. package/dist/assets/shapes/leaf-clover8.svg +0 -1
  264. package/dist/assets/shapes/loading-indicator.svg +0 -1
  265. package/dist/assets/shapes/oval.svg +0 -1
  266. package/dist/assets/shapes/pentagon.svg +0 -1
  267. package/dist/assets/shapes/pill.svg +0 -1
  268. package/dist/assets/shapes/pixel-circle.svg +0 -1
  269. package/dist/assets/shapes/pixel-triangle.svg +0 -1
  270. package/dist/assets/shapes/puffy-diamond.svg +0 -1
  271. package/dist/assets/shapes/puffy.svg +0 -1
  272. package/dist/assets/shapes/semicircle.svg +0 -1
  273. package/dist/assets/shapes/sided-cookie12.svg +0 -1
  274. package/dist/assets/shapes/sided-cookie4.svg +0 -1
  275. package/dist/assets/shapes/sided-cookie6.svg +0 -1
  276. package/dist/assets/shapes/sided-cookie7.svg +0 -1
  277. package/dist/assets/shapes/sided-cookie9.svg +0 -1
  278. package/dist/assets/shapes/slanted.svg +0 -1
  279. package/dist/assets/shapes/soft-boom.svg +0 -1
  280. package/dist/assets/shapes/soft-burst.svg +0 -1
  281. package/dist/assets/shapes/square.svg +0 -1
  282. package/dist/assets/shapes/sunny.svg +0 -1
  283. package/dist/assets/shapes/triangle.svg +0 -1
  284. package/dist/assets/shapes/very-sunny.svg +0 -1
  285. package/dist/assets/shapes/wavy-circle.svg +0 -1
  286. package/dist/assets/shapes/wavy.svg +0 -1
  287. package/src/assets/shapes/arch.svg +0 -1
  288. package/src/assets/shapes/arrow.svg +0 -1
  289. package/src/assets/shapes/boom.svg +0 -1
  290. package/src/assets/shapes/burst.svg +0 -1
  291. package/src/assets/shapes/circle.svg +0 -1
  292. package/src/assets/shapes/clamshell.svg +0 -1
  293. package/src/assets/shapes/diamond.svg +0 -1
  294. package/src/assets/shapes/fan.svg +0 -1
  295. package/src/assets/shapes/flower.svg +0 -1
  296. package/src/assets/shapes/gem.svg +0 -1
  297. package/src/assets/shapes/ghost-ish.svg +0 -1
  298. package/src/assets/shapes/heart.svg +0 -1
  299. package/src/assets/shapes/leaf-clover4.svg +0 -1
  300. package/src/assets/shapes/leaf-clover8.svg +0 -1
  301. package/src/assets/shapes/loading-indicator.svg +0 -1
  302. package/src/assets/shapes/oval.svg +0 -1
  303. package/src/assets/shapes/pentagon.svg +0 -1
  304. package/src/assets/shapes/pill.svg +0 -1
  305. package/src/assets/shapes/pixel-circle.svg +0 -1
  306. package/src/assets/shapes/pixel-triangle.svg +0 -1
  307. package/src/assets/shapes/puffy-diamond.svg +0 -1
  308. package/src/assets/shapes/puffy.svg +0 -1
  309. package/src/assets/shapes/semicircle.svg +0 -1
  310. package/src/assets/shapes/sided-cookie12.svg +0 -1
  311. package/src/assets/shapes/sided-cookie4.svg +0 -1
  312. package/src/assets/shapes/sided-cookie6.svg +0 -1
  313. package/src/assets/shapes/sided-cookie7.svg +0 -1
  314. package/src/assets/shapes/sided-cookie9.svg +0 -1
  315. package/src/assets/shapes/slanted.svg +0 -1
  316. package/src/assets/shapes/soft-boom.svg +0 -1
  317. package/src/assets/shapes/soft-burst.svg +0 -1
  318. package/src/assets/shapes/square.svg +0 -1
  319. package/src/assets/shapes/sunny.svg +0 -1
  320. package/src/assets/shapes/triangle.svg +0 -1
  321. package/src/assets/shapes/very-sunny.svg +0 -1
  322. package/src/assets/shapes/wavy-circle.svg +0 -1
  323. package/src/assets/shapes/wavy.svg +0 -1
@@ -1,35 +1,104 @@
1
+ /**
2
+ * @file components/moni-snackbar.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
1
7
  import { MoniElement } from './_base/index.js';
2
8
  import './moni-icon.js';
3
9
  /**
4
- * Snackbar that faithfully ports BeerCSS's `.snackbar` styles.
10
+ * Material Design 3 Snackbar component.
11
+ *
12
+ * Snackbars provide brief messages about app processes at the bottom of the
13
+ * screen. They disappear automatically and do not require user action,
14
+ * but may contain a single optional action.
15
+ *
16
+ * **M3 spec reference:** `m3-docs/components/snackbar/specs.md`
17
+ *
18
+ * **Positioning model:**
19
+ * The snackbar uses `position: fixed` so it renders in the viewport
20
+ * regardless of which element it is placed in the DOM. The host element
21
+ * displays as `block` rather than `contents` to ensure `position: fixed`
22
+ * inside the shadow root anchors to the viewport (not to a stacking context
23
+ * created by a transformed ancestor).
24
+ *
25
+ * **Show/hide mechanism:**
26
+ * Visibility is controlled by `:host([active]) .snackbar` via CSS
27
+ * `opacity`, `visibility`, and `transform`. This mirrors BeerCSS's
28
+ * `.snackbar.active` pattern and allows CSS transition animations.
29
+ *
30
+ * **M3 text truncation:**
31
+ * The message text is clamped to `maxLines` lines with `-webkit-line-clamp`.
32
+ * The M3 spec requires a maximum of 2 lines; consumers can override this
33
+ * via the `max-lines` attribute.
5
34
  *
6
- * BeerCSS uses `.snackbar` with `position: fixed; inset: auto auto 6rem 50%;`
7
- * and `.snackbar.active` / `.snackbar:popover-open` to show it.
35
+ * @example
36
+ * ```ts
37
+ * const snackbar = document.querySelector('moni-snackbar') as MoniSnackbar;
8
38
  *
9
- * We use :host([active]) .snackbar with visibility/opacity/transform — same as BeerCSS.
10
- * The host is display:block so the fixed snackbar inside is part of the stacking context
11
- * of the document body (not clipped by any shadow root overflow).
39
+ * // Show for 3 seconds
40
+ * snackbar.text = 'Item deleted';
41
+ * snackbar.action = 'Undo';
42
+ * snackbar.active = true;
43
+ * setTimeout(() => { snackbar.active = false; }, 3000);
44
+ * ```
12
45
  *
13
- * Material 3 spec (`m3-docs/components/snackbar/specs.md`): the message text
14
- * must truncate at **2 lines** with ellipsis when too long. The container
15
- * width adapts to the screen size (full width on compact, 40% on expanded).
46
+ * @slot default - Additional content placed inside the snackbar container.
16
47
  *
17
- * Attributes:
18
- * - text: message
19
- * - action: action label (visual only)
20
- * - placement: bottom (default) | top
21
- * - active: present → visible
22
- * - max-lines: 2 (default) | number — clamp text to N lines with ellipsis
48
+ * @csspart snackbar - The inner snackbar container element.
49
+ * @csspart text - The message text element.
50
+ * @csspart action - The action button element.
23
51
  */
24
52
  export declare class MoniSnackbar extends MoniElement {
53
+ /**
54
+ * The main message text displayed in the snackbar.
55
+ *
56
+ * Clamped to `maxLines` lines. Long messages are truncated with `…`.
57
+ * Per M3 spec, keep messages short and informative (under 60 characters).
58
+ *
59
+ * @default ''
60
+ */
25
61
  text: string;
62
+ /**
63
+ * Label for the optional action button.
64
+ *
65
+ * When non-empty, renders a text button on the trailing edge of the snackbar.
66
+ * The component dispatches a `'action'` event when the action is clicked.
67
+ * This is a visual-only label — the consumer handles the action logic.
68
+ *
69
+ * @default ''
70
+ */
26
71
  action: string;
72
+ /**
73
+ * Vertical placement of the snackbar on the screen.
74
+ *
75
+ * - `'bottom'` (default) — Fixed 6rem from the bottom, centered horizontally.
76
+ * - `'top'` — Fixed 6rem from the top, centered horizontally.
77
+ *
78
+ * @default 'bottom'
79
+ */
27
80
  placement: 'bottom' | 'top';
81
+ /**
82
+ * When `true`, the snackbar is visible.
83
+ *
84
+ * Toggle this attribute to show/hide the snackbar. The CSS transition
85
+ * handles the fade-in/slide-up animation automatically.
86
+ * Consumers are responsible for implementing the auto-dismiss timer.
87
+ *
88
+ * @default false
89
+ */
28
90
  active: boolean;
29
- /** M3 spec: clamp the message text to N lines (default 2). */
91
+ /**
92
+ * Maximum number of lines of message text before it is clamped.
93
+ *
94
+ * Uses `-webkit-line-clamp` with `display: -webkit-box` for cross-browser
95
+ * multi-line truncation. The M3 spec recommends a maximum of 2 lines.
96
+ *
97
+ * @default 2
98
+ */
30
99
  maxLines: number;
31
100
  static styles: import("lit").CSSResult[];
32
- render(): import("lit-html").TemplateResult<1>;
101
+ render(): import("lit").TemplateResult<1>;
33
102
  }
34
103
  declare global {
35
104
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"moni-snackbar.d.ts","sourceRoot":"","sources":["../../src/components/moni-snackbar.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBACa,YAAa,SAAQ,WAAW;IACf,IAAI,SAAM;IACV,MAAM,SAAM;IAEzC,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAY;IACK,MAAM,UAAS;IAC3D,8DAA8D;IAE9D,QAAQ,SAAK;IAEb,OAAgB,MAAM,4BAmFpB;IAEO,MAAM;CAef;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,eAAe,EAAE,YAAY,CAAC;KAC9B;CACD;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"moni-snackbar.d.ts","sourceRoot":"","sources":["../../src/components/moni-snackbar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,qBACa,YAAa,SAAQ,WAAW;IAC5C;;;;;;;OAOG;IAC0B,IAAI,SAAM;IAEvC;;;;;;;;OAQG;IAC0B,MAAM,SAAM;IAEzC;;;;;;;OAOG;IAEH,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAY;IAEvC;;;;;;;;OAQG;IACyC,MAAM,UAAS;IAE3D;;;;;;;OAOG;IAEH,QAAQ,SAAK;IAEb,OAAgB,MAAM,4BAmFpB;IAEO,MAAM;CAef;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,eAAe,EAAE,YAAY,CAAC;KAC9B;CACD;AAED,eAAe,YAAY,CAAC"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @file components/moni-snackbar.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
1
7
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
9
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -9,34 +15,97 @@ import { customElement, property } from 'lit/decorators.js';
9
15
  import { MoniElement, sharedStyles } from './_base/index.js';
10
16
  import './moni-icon.js';
11
17
  /**
12
- * Snackbar that faithfully ports BeerCSS's `.snackbar` styles.
18
+ * Material Design 3 Snackbar component.
19
+ *
20
+ * Snackbars provide brief messages about app processes at the bottom of the
21
+ * screen. They disappear automatically and do not require user action,
22
+ * but may contain a single optional action.
23
+ *
24
+ * **M3 spec reference:** `m3-docs/components/snackbar/specs.md`
25
+ *
26
+ * **Positioning model:**
27
+ * The snackbar uses `position: fixed` so it renders in the viewport
28
+ * regardless of which element it is placed in the DOM. The host element
29
+ * displays as `block` rather than `contents` to ensure `position: fixed`
30
+ * inside the shadow root anchors to the viewport (not to a stacking context
31
+ * created by a transformed ancestor).
32
+ *
33
+ * **Show/hide mechanism:**
34
+ * Visibility is controlled by `:host([active]) .snackbar` via CSS
35
+ * `opacity`, `visibility`, and `transform`. This mirrors BeerCSS's
36
+ * `.snackbar.active` pattern and allows CSS transition animations.
37
+ *
38
+ * **M3 text truncation:**
39
+ * The message text is clamped to `maxLines` lines with `-webkit-line-clamp`.
40
+ * The M3 spec requires a maximum of 2 lines; consumers can override this
41
+ * via the `max-lines` attribute.
13
42
  *
14
- * BeerCSS uses `.snackbar` with `position: fixed; inset: auto auto 6rem 50%;`
15
- * and `.snackbar.active` / `.snackbar:popover-open` to show it.
43
+ * @example
44
+ * ```ts
45
+ * const snackbar = document.querySelector('moni-snackbar') as MoniSnackbar;
16
46
  *
17
- * We use :host([active]) .snackbar with visibility/opacity/transform — same as BeerCSS.
18
- * The host is display:block so the fixed snackbar inside is part of the stacking context
19
- * of the document body (not clipped by any shadow root overflow).
47
+ * // Show for 3 seconds
48
+ * snackbar.text = 'Item deleted';
49
+ * snackbar.action = 'Undo';
50
+ * snackbar.active = true;
51
+ * setTimeout(() => { snackbar.active = false; }, 3000);
52
+ * ```
20
53
  *
21
- * Material 3 spec (`m3-docs/components/snackbar/specs.md`): the message text
22
- * must truncate at **2 lines** with ellipsis when too long. The container
23
- * width adapts to the screen size (full width on compact, 40% on expanded).
54
+ * @slot default - Additional content placed inside the snackbar container.
24
55
  *
25
- * Attributes:
26
- * - text: message
27
- * - action: action label (visual only)
28
- * - placement: bottom (default) | top
29
- * - active: present → visible
30
- * - max-lines: 2 (default) | number — clamp text to N lines with ellipsis
56
+ * @csspart snackbar - The inner snackbar container element.
57
+ * @csspart text - The message text element.
58
+ * @csspart action - The action button element.
31
59
  */
32
60
  let MoniSnackbar = class MoniSnackbar extends MoniElement {
33
61
  constructor() {
34
62
  super(...arguments);
63
+ /**
64
+ * The main message text displayed in the snackbar.
65
+ *
66
+ * Clamped to `maxLines` lines. Long messages are truncated with `…`.
67
+ * Per M3 spec, keep messages short and informative (under 60 characters).
68
+ *
69
+ * @default ''
70
+ */
35
71
  this.text = '';
72
+ /**
73
+ * Label for the optional action button.
74
+ *
75
+ * When non-empty, renders a text button on the trailing edge of the snackbar.
76
+ * The component dispatches a `'action'` event when the action is clicked.
77
+ * This is a visual-only label — the consumer handles the action logic.
78
+ *
79
+ * @default ''
80
+ */
36
81
  this.action = '';
82
+ /**
83
+ * Vertical placement of the snackbar on the screen.
84
+ *
85
+ * - `'bottom'` (default) — Fixed 6rem from the bottom, centered horizontally.
86
+ * - `'top'` — Fixed 6rem from the top, centered horizontally.
87
+ *
88
+ * @default 'bottom'
89
+ */
37
90
  this.placement = 'bottom';
91
+ /**
92
+ * When `true`, the snackbar is visible.
93
+ *
94
+ * Toggle this attribute to show/hide the snackbar. The CSS transition
95
+ * handles the fade-in/slide-up animation automatically.
96
+ * Consumers are responsible for implementing the auto-dismiss timer.
97
+ *
98
+ * @default false
99
+ */
38
100
  this.active = false;
39
- /** M3 spec: clamp the message text to N lines (default 2). */
101
+ /**
102
+ * Maximum number of lines of message text before it is clamped.
103
+ *
104
+ * Uses `-webkit-line-clamp` with `display: -webkit-box` for cross-browser
105
+ * multi-line truncation. The M3 spec recommends a maximum of 2 lines.
106
+ *
107
+ * @default 2
108
+ */
40
109
  this.maxLines = 2;
41
110
  }
42
111
  static { this.styles = [
@@ -1,15 +1,44 @@
1
+ /**
2
+ * @file components/moni-split-button.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
1
7
  import { MoniElement } from './_base/index.js';
2
8
  /**
3
- * Visual-only split button. Combines a primary action button and a dropdown menu trigger.
9
+ * Material Design 3 Split Button component.
10
+ *
11
+ * A split button combines a primary action button with a secondary dropdown
12
+ * button. The two buttons sit flush against each other, typically sharing
13
+ * a background color and elevation, but separated by a distinct border.
14
+ *
15
+ * **Visual architecture:**
16
+ * The component acts as a layout container (`display: inline-flex`) that
17
+ * groups two standard buttons. It overrides the margins of the trailing
18
+ * button to create the "connected" look (similar to connected button groups).
19
+ *
20
+ * **Usage:**
21
+ * Consumers must provide exactly two buttons via the named slots:
22
+ * - `slot="leading-button"` — The primary action (usually text or text+icon).
23
+ * - `slot="trailing-button"` — The secondary action (usually just a dropdown icon).
24
+ *
25
+ * Both buttons should be standard `<moni-button>` or `<moni-icon-button>`
26
+ * elements configured with matching variants for a cohesive appearance.
27
+ *
28
+ * @example
29
+ * ```html
30
+ * <moni-split-button variant="filled">
31
+ * <moni-button slot="leading-button" icon="send">Send</moni-button>
32
+ * <moni-button slot="trailing-button" icon="arrow_drop_down" id="schedule-trigger"></moni-button>
33
+ * </moni-split-button>
4
34
  *
5
- * Attributes:
6
- * - variant: filled (default) | tonal | outlined | elevated
7
- * - size: small | medium (default) | large | extra
8
- * - gap: custom gap space (e.g. "8px" or "1rem")
35
+ * <moni-menu id="schedule-menu" placement="bottom">
36
+ * <moni-menu-item>Schedule send...</moni-menu-item>
37
+ * </moni-menu>
38
+ * ```
9
39
  *
10
- * Slots:
11
- * - leading-button: The main action button
12
- * - trailing-button: The menu dropdown button
40
+ * @slot leading-button - The primary action button on the left.
41
+ * @slot trailing-button - The secondary action (dropdown trigger) on the right.
13
42
  */
14
43
  export declare class MoniSplitButton extends MoniElement {
15
44
  variant: 'filled' | 'tonal' | 'outlined' | 'elevated';
@@ -22,7 +51,7 @@ export declare class MoniSplitButton extends MoniElement {
22
51
  private handleSlotChange;
23
52
  private getGapValue;
24
53
  private updateChildren;
25
- render(): import("lit-html").TemplateResult<1>;
54
+ render(): import("lit").TemplateResult<1>;
26
55
  }
27
56
  declare global {
28
57
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"moni-split-button.d.ts","sourceRoot":"","sources":["../../src/components/moni-split-button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,qBACa,eAAgB,SAAQ,WAAW;IAE/C,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAY;IAGjE,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAG9E,GAAG,SAAM;IAGT,OAAO,CAAC,eAAe,CAAiB;IAGxC,OAAO,CAAC,gBAAgB,CAAiB;IAEzC,OAAgB,MAAM,4BAoBpB;cAEiB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;IAOpF,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,cAAc;IAuBb,MAAM;CAYf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,eAAe,CAAC;KACrC;CACD;AAED,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"moni-split-button.d.ts","sourceRoot":"","sources":["../../src/components/moni-split-button.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBACa,eAAgB,SAAQ,WAAW;IAE/C,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAY;IAGjE,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAG9E,GAAG,SAAM;IAGT,OAAO,CAAC,eAAe,CAAiB;IAGxC,OAAO,CAAC,gBAAgB,CAAiB;IAEzC,OAAgB,MAAM,4BAoBpB;cAEiB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;IAOpF,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,cAAc;IAuBb,MAAM;CAYf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,eAAe,CAAC;KACrC;CACD;AAED,eAAe,eAAe,CAAC"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @file components/moni-split-button.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
1
7
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
9
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -8,16 +14,39 @@ import { html, css } from 'lit';
8
14
  import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
9
15
  import { MoniElement, sharedStyles } from './_base/index.js';
10
16
  /**
11
- * Visual-only split button. Combines a primary action button and a dropdown menu trigger.
17
+ * Material Design 3 Split Button component.
18
+ *
19
+ * A split button combines a primary action button with a secondary dropdown
20
+ * button. The two buttons sit flush against each other, typically sharing
21
+ * a background color and elevation, but separated by a distinct border.
22
+ *
23
+ * **Visual architecture:**
24
+ * The component acts as a layout container (`display: inline-flex`) that
25
+ * groups two standard buttons. It overrides the margins of the trailing
26
+ * button to create the "connected" look (similar to connected button groups).
27
+ *
28
+ * **Usage:**
29
+ * Consumers must provide exactly two buttons via the named slots:
30
+ * - `slot="leading-button"` — The primary action (usually text or text+icon).
31
+ * - `slot="trailing-button"` — The secondary action (usually just a dropdown icon).
32
+ *
33
+ * Both buttons should be standard `<moni-button>` or `<moni-icon-button>`
34
+ * elements configured with matching variants for a cohesive appearance.
35
+ *
36
+ * @example
37
+ * ```html
38
+ * <moni-split-button variant="filled">
39
+ * <moni-button slot="leading-button" icon="send">Send</moni-button>
40
+ * <moni-button slot="trailing-button" icon="arrow_drop_down" id="schedule-trigger"></moni-button>
41
+ * </moni-split-button>
12
42
  *
13
- * Attributes:
14
- * - variant: filled (default) | tonal | outlined | elevated
15
- * - size: small | medium (default) | large | extra
16
- * - gap: custom gap space (e.g. "8px" or "1rem")
43
+ * <moni-menu id="schedule-menu" placement="bottom">
44
+ * <moni-menu-item>Schedule send...</moni-menu-item>
45
+ * </moni-menu>
46
+ * ```
17
47
  *
18
- * Slots:
19
- * - leading-button: The main action button
20
- * - trailing-button: The menu dropdown button
48
+ * @slot leading-button - The primary action button on the left.
49
+ * @slot trailing-button - The secondary action (dropdown trigger) on the right.
21
50
  */
22
51
  let MoniSplitButton = class MoniSplitButton extends MoniElement {
23
52
  constructor() {
@@ -1,15 +1,48 @@
1
+ /**
2
+ * @file components/moni-step.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
1
7
  import { MoniElement } from './_base/index.js';
2
8
  import './moni-icon.js';
3
9
  /**
4
- * Visual-only step. Renders an icon/number, a title, and a description.
10
+ * Material Design 3 Step component.
11
+ *
12
+ * An individual step within a `<moni-stepper>`. Steps display progress through
13
+ * a sequence of logical and numbered operations.
14
+ *
15
+ * **M3 spec reference:** `m3-docs/components/progress-indicators/specs.md` (Stepper pattern)
16
+ *
17
+ * **Anatomy & Visuals:**
18
+ * A step renders a circular indicator containing either its sequence number
19
+ * (automatically injected by the parent stepper) or a custom icon. Below or
20
+ * beside the indicator (depending on the parent's `orientation`), it renders
21
+ * the `title` and an optional `description`.
22
+ *
23
+ * **State management:**
24
+ * The parent `<moni-stepper>` automatically calculates and injects the `index`,
25
+ * `active`, and `completed` properties based on its current state.
26
+ * - **Active:** Highlighted with the primary color, indicating the current step.
27
+ * - **Completed:** Displayed with a solid primary background and a checkmark
28
+ * icon (`completed` state overrides the numeric index).
29
+ *
30
+ * @example
31
+ * ```html
32
+ * <!-- Typically used inside a stepper -->
33
+ * <moni-stepper current="1">
34
+ * <moni-step title="Shipping" description="Enter address"></moni-step>
35
+ * <moni-step title="Payment" description="Credit card details"></moni-step>
36
+ * <moni-step title="Review" description="Confirm order"></moni-step>
37
+ * </moni-stepper>
38
+ *
39
+ * <!-- Overriding the icon -->
40
+ * <moni-step title="Done" icon="celebration"></moni-step>
41
+ * ```
5
42
  *
6
- * Attributes:
7
- * - title: step heading
8
- * - description: step secondary text
9
- * - active: present → primary color highlight
10
- * - completed: present → filled circle with check
11
- * - icon: Material Symbols name (overrides the number)
12
- * - index: numeric label (auto-set by parent stepper, optional)
43
+ * @csspart step-indicator - The circular badge containing the number/icon.
44
+ * @csspart title - The main title text.
45
+ * @csspart description - The secondary description text.
13
46
  */
14
47
  export declare class MoniStep extends MoniElement {
15
48
  title: string;
@@ -19,7 +52,7 @@ export declare class MoniStep extends MoniElement {
19
52
  icon: string;
20
53
  index: number;
21
54
  static styles: import("lit").CSSResult[];
22
- render(): import("lit-html").TemplateResult<1>;
55
+ render(): import("lit").TemplateResult<1>;
23
56
  }
24
57
  declare global {
25
58
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"moni-step.d.ts","sourceRoot":"","sources":["../../src/components/moni-step.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,qBACa,QAAS,SAAQ,WAAW;IACX,KAAK,SAAM;IACX,WAAW,SAAM;IACF,MAAM,UAAS;IACf,SAAS,UAAS;IACjC,IAAI,SAAM;IACI,KAAK,SAAK;IAErD,OAAgB,MAAM,4BAqGpB;IAEO,MAAM;CAkBf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"moni-step.d.ts","sourceRoot":"","sources":["../../src/components/moni-step.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBACa,QAAS,SAAQ,WAAW;IACX,KAAK,SAAM;IACX,WAAW,SAAM;IACF,MAAM,UAAS;IACf,SAAS,UAAS;IACjC,IAAI,SAAM;IACI,KAAK,SAAK;IAErD,OAAgB,MAAM,4BAqGpB;IAEO,MAAM;CAkBf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD;AAED,eAAe,QAAQ,CAAC"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @file components/moni-step.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
1
7
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
9
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -9,15 +15,42 @@ import { customElement, property } from 'lit/decorators.js';
9
15
  import { MoniElement, sharedStyles } from './_base/index.js';
10
16
  import './moni-icon.js';
11
17
  /**
12
- * Visual-only step. Renders an icon/number, a title, and a description.
18
+ * Material Design 3 Step component.
19
+ *
20
+ * An individual step within a `<moni-stepper>`. Steps display progress through
21
+ * a sequence of logical and numbered operations.
22
+ *
23
+ * **M3 spec reference:** `m3-docs/components/progress-indicators/specs.md` (Stepper pattern)
24
+ *
25
+ * **Anatomy & Visuals:**
26
+ * A step renders a circular indicator containing either its sequence number
27
+ * (automatically injected by the parent stepper) or a custom icon. Below or
28
+ * beside the indicator (depending on the parent's `orientation`), it renders
29
+ * the `title` and an optional `description`.
30
+ *
31
+ * **State management:**
32
+ * The parent `<moni-stepper>` automatically calculates and injects the `index`,
33
+ * `active`, and `completed` properties based on its current state.
34
+ * - **Active:** Highlighted with the primary color, indicating the current step.
35
+ * - **Completed:** Displayed with a solid primary background and a checkmark
36
+ * icon (`completed` state overrides the numeric index).
37
+ *
38
+ * @example
39
+ * ```html
40
+ * <!-- Typically used inside a stepper -->
41
+ * <moni-stepper current="1">
42
+ * <moni-step title="Shipping" description="Enter address"></moni-step>
43
+ * <moni-step title="Payment" description="Credit card details"></moni-step>
44
+ * <moni-step title="Review" description="Confirm order"></moni-step>
45
+ * </moni-stepper>
46
+ *
47
+ * <!-- Overriding the icon -->
48
+ * <moni-step title="Done" icon="celebration"></moni-step>
49
+ * ```
13
50
  *
14
- * Attributes:
15
- * - title: step heading
16
- * - description: step secondary text
17
- * - active: present → primary color highlight
18
- * - completed: present → filled circle with check
19
- * - icon: Material Symbols name (overrides the number)
20
- * - index: numeric label (auto-set by parent stepper, optional)
51
+ * @csspart step-indicator - The circular badge containing the number/icon.
52
+ * @csspart title - The main title text.
53
+ * @csspart description - The secondary description text.
21
54
  */
22
55
  let MoniStep = class MoniStep extends MoniElement {
23
56
  constructor() {
@@ -1,11 +1,48 @@
1
+ /**
2
+ * @file components/moni-stepper.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
1
7
  import { MoniElement } from './_base/index.js';
2
8
  /**
3
- * Visual-only stepper. Wraps a list of <moni-step> children, propagates the
4
- * `current` index to each child, and styles the connectors between them.
9
+ * Material Design 3 Stepper component.
10
+ *
11
+ * A container for a linear progression of `<moni-step>` elements. Steppers
12
+ * convey progress through numbered steps and indicate the user's current
13
+ * position within a flow.
14
+ *
15
+ * **M3 spec reference:** `m3-docs/components/progress-indicators/specs.md`
16
+ *
17
+ * **Orchestration:**
18
+ * This component acts as the orchestrator for its slotted `<moni-step>` children.
19
+ * Whenever the `current` property changes, or children are added/removed, the
20
+ * stepper iterates over all child steps and injects their state:
21
+ * - Assigns the sequential `index` (0-based) to each step.
22
+ * - Sets `active=true` on the step matching the `current` index.
23
+ * - Sets `completed=true` on all steps prior to the `current` index.
24
+ *
25
+ * **Visual layout:**
26
+ * The stepper manages the layout (flex row or column based on `orientation`)
27
+ * and ensures the connector lines between steps are rendered correctly via
28
+ * CSS pseudo-elements defined in the child `<moni-step>` styling.
29
+ *
30
+ * @example
31
+ * ```html
32
+ * <moni-stepper current="1" orientation="horizontal">
33
+ * <moni-step title="Step 1"></moni-step>
34
+ * <moni-step title="Step 2"></moni-step>
35
+ * <moni-step title="Step 3"></moni-step>
36
+ * </moni-stepper>
37
+ *
38
+ * <script>
39
+ * const stepper = document.querySelector('moni-stepper');
40
+ * // Move to next step
41
+ * stepper.current = 2;
42
+ * </script>
43
+ * ```
5
44
  *
6
- * Attributes:
7
- * - orientation: horizontal (default) | vertical
8
- * - current: zero-based index of the active step
45
+ * @slot default - `<moni-step>` elements.
9
46
  */
10
47
  export declare class MoniStepper extends MoniElement {
11
48
  orientation: 'horizontal' | 'vertical';
@@ -23,7 +60,7 @@ export declare class MoniStepper extends MoniElement {
23
60
  */
24
61
  private _syncSteps;
25
62
  static styles: import("lit").CSSResult[];
26
- render(): import("lit-html").TemplateResult<1>;
63
+ render(): import("lit").TemplateResult<1>;
27
64
  private _onSlotChange;
28
65
  }
29
66
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"moni-stepper.d.ts","sourceRoot":"","sources":["../../src/components/moni-stepper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAG7D;;;;;;;GAOG;AACH,qBACa,WAAY,SAAQ,WAAW;IAE3C,WAAW,EAAE,YAAY,GAAG,UAAU,CAAgB;IACX,OAAO,SAAK;IAGvD,OAAO,CAAC,MAAM,CAAc;IAEnB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAU9C;;;;;;;;OAQG;IACH,OAAO,CAAC,UAAU;IAclB,OAAgB,MAAM,4BAwBpB;IAEO,MAAM;IAMf,OAAO,CAAC,aAAa,CAGnB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,WAAW,CAAC;KAC5B;CACD;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"moni-stepper.d.ts","sourceRoot":"","sources":["../../src/components/moni-stepper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBACa,WAAY,SAAQ,WAAW;IAE3C,WAAW,EAAE,YAAY,GAAG,UAAU,CAAgB;IACX,OAAO,SAAK;IAGvD,OAAO,CAAC,MAAM,CAAc;IAEnB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAU9C;;;;;;;;OAQG;IACH,OAAO,CAAC,UAAU;IAclB,OAAgB,MAAM,4BAwBpB;IAEO,MAAM;IAMf,OAAO,CAAC,aAAa,CAGnB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,WAAW,CAAC;KAC5B;CACD;AAED,eAAe,WAAW,CAAC"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @file components/moni-stepper.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
1
7
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
9
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -8,12 +14,43 @@ import { html, css } from 'lit';
8
14
  import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
9
15
  import { MoniElement, sharedStyles } from './_base/index.js';
10
16
  /**
11
- * Visual-only stepper. Wraps a list of <moni-step> children, propagates the
12
- * `current` index to each child, and styles the connectors between them.
17
+ * Material Design 3 Stepper component.
18
+ *
19
+ * A container for a linear progression of `<moni-step>` elements. Steppers
20
+ * convey progress through numbered steps and indicate the user's current
21
+ * position within a flow.
22
+ *
23
+ * **M3 spec reference:** `m3-docs/components/progress-indicators/specs.md`
24
+ *
25
+ * **Orchestration:**
26
+ * This component acts as the orchestrator for its slotted `<moni-step>` children.
27
+ * Whenever the `current` property changes, or children are added/removed, the
28
+ * stepper iterates over all child steps and injects their state:
29
+ * - Assigns the sequential `index` (0-based) to each step.
30
+ * - Sets `active=true` on the step matching the `current` index.
31
+ * - Sets `completed=true` on all steps prior to the `current` index.
32
+ *
33
+ * **Visual layout:**
34
+ * The stepper manages the layout (flex row or column based on `orientation`)
35
+ * and ensures the connector lines between steps are rendered correctly via
36
+ * CSS pseudo-elements defined in the child `<moni-step>` styling.
37
+ *
38
+ * @example
39
+ * ```html
40
+ * <moni-stepper current="1" orientation="horizontal">
41
+ * <moni-step title="Step 1"></moni-step>
42
+ * <moni-step title="Step 2"></moni-step>
43
+ * <moni-step title="Step 3"></moni-step>
44
+ * </moni-stepper>
45
+ *
46
+ * <script>
47
+ * const stepper = document.querySelector('moni-stepper');
48
+ * // Move to next step
49
+ * stepper.current = 2;
50
+ * </script>
51
+ * ```
13
52
  *
14
- * Attributes:
15
- * - orientation: horizontal (default) | vertical
16
- * - current: zero-based index of the active step
53
+ * @slot default - `<moni-step>` elements.
17
54
  */
18
55
  let MoniStepper = class MoniStepper extends MoniElement {
19
56
  constructor() {