@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,31 +1,57 @@
1
+ /**
2
+ * @file components/moni-button-group.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 button group. Organizes `moni-button` or `moni-icon-button`
4
- * components in a row.
5
- *
6
- * **`variant="connected"`** is the Material Design 3 Expressive replacement
7
- * for the deprecated `moni-segmented-button` (see
8
- * `m3-docs/components/segmented-buttons/overview.md` § M3 Expressive update).
9
- * In connected mode, segments share borders via propagated `shape` values
10
- * (`left-round-flat`, `no-round`, `right-round-flat` for a gap-less row), and
11
- * the group manages single/multi-select toggle state. This is the
12
- * **only Moni component that intentionally uses `@click` listeners** —
13
- * toggle behavior is essential to the M3 connected button group semantics.
14
- *
15
- * Accessibility:
16
- * - The host renders `role="group"` (configurable via `role` attribute).
17
- * - `aria-label` / `aria-labelledby` should be set by the consumer to
18
- * identify the group to assistive technology.
19
- *
20
- * Attributes:
21
- * - variant: standard (default) | connected
22
- * - size: small | medium (default) | large | extra
23
- * - multi: boolean (default false) — multiple toggles allowed
24
- * - gap: custom gap space (e.g. "8px" or "1rem"); in `connected`
25
- * variant the default is 0.125rem (2dp) per M3 spec
26
- * - role: ARIA role override (default "group")
27
- * - label: aria-label for the group
28
- * - labelled-by: aria-labelledby reference
9
+ * Material Design 3 Button Group component.
10
+ *
11
+ * Organizes multiple `<moni-button>` or `<moni-icon-button>` components
12
+ * into a single row.
13
+ *
14
+ * **Variants:**
15
+ * - `standard` (default) A simple flex row with a gap between buttons.
16
+ * - `connected` — The M3 Expressive replacement for segmented buttons. In this
17
+ * mode, buttons share borders and form a single continuous pill shape. The
18
+ * group manages the single/multi-select toggle state of its children.
19
+ *
20
+ * **`connected` variant details:**
21
+ * - **Shape propagation:** The group automatically propagates M3 shape classes
22
+ * (`left-round-flat`, `no-round`, `right-round-flat`) to its children so
23
+ * they interlock seamlessly.
24
+ * - **Toggle management:** The group listens to child clicks and toggles their
25
+ * `active` attributes. When `multi=false` (default), only one button can be
26
+ * active at a time (radio button behavior). When `multi=true`, multiple buttons
27
+ * can be active (checkbox behavior).
28
+ * - **Event propagation:** Fires a `'change'` event when the selection changes.
29
+ *
30
+ * **Accessibility:**
31
+ * - Renders with `role="group"` (can be overridden to `toolbar` or `radiogroup`).
32
+ * - Consumers should provide an `aria-label` or `aria-labelledby` attribute
33
+ * to identify the group's purpose to assistive technologies.
34
+ *
35
+ * @fires change - Fired when a button is clicked in `connected` mode and the
36
+ * selection state updates.
37
+ *
38
+ * @example
39
+ * ```html
40
+ * <!-- Connected single-select group -->
41
+ * <moni-button-group variant="connected" label="Alignment">
42
+ * <moni-button icon="format_align_left" active></moni-button>
43
+ * <moni-button icon="format_align_center"></moni-button>
44
+ * <moni-button icon="format_align_right"></moni-button>
45
+ * </moni-button-group>
46
+ *
47
+ * <!-- Standard button row -->
48
+ * <moni-button-group gap="1rem">
49
+ * <moni-button variant="text">Cancel</moni-button>
50
+ * <moni-button>Save</moni-button>
51
+ * </moni-button-group>
52
+ * ```
53
+ *
54
+ * @slot default - The `<moni-button>` elements that make up the group.
29
55
  */
30
56
  export declare class MoniButtonGroup extends MoniElement {
31
57
  variant: 'standard' | 'connected';
@@ -44,7 +70,7 @@ export declare class MoniButtonGroup extends MoniElement {
44
70
  private handlePointerDown;
45
71
  private handlePointerUp;
46
72
  private handleClick;
47
- render(): import("lit-html").TemplateResult<1>;
73
+ render(): import("lit").TemplateResult<1>;
48
74
  }
49
75
  declare global {
50
76
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"moni-button-group.d.ts","sourceRoot":"","sources":["../../src/components/moni-button-group.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBACa,eAAgB,SAAQ,WAAW;IAE/C,OAAO,EAAE,UAAU,GAAG,WAAW,CAAc;IAG/C,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAG9E,KAAK,UAAS;IAGd,GAAG,SAAM;IAGT,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,YAAY,CAAW;IAGnD,KAAK,SAAM;IAGX,UAAU,SAAM;IAGhB,OAAO,CAAC,cAAc,CAAiB;IAEvC,OAAgB,MAAM,4BAuCpB;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;IA0CtB,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,WAAW;IA2CV,MAAM;CAyBf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,eAAe,CAAC;KACrC;CACD;AAED,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"moni-button-group.d.ts","sourceRoot":"","sources":["../../src/components/moni-button-group.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,qBACa,eAAgB,SAAQ,WAAW;IAE/C,OAAO,EAAE,UAAU,GAAG,WAAW,CAAc;IAG/C,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAG9E,KAAK,UAAS;IAGd,GAAG,SAAM;IAGT,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,YAAY,CAAW;IAGnD,KAAK,SAAM;IAGX,UAAU,SAAM;IAGhB,OAAO,CAAC,cAAc,CAAiB;IAEvC,OAAgB,MAAM,4BAuCpB;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;IA0CtB,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,WAAW;IA2CV,MAAM;CAyBf;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-button-group.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,32 +14,52 @@ import { html, css, nothing } 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 button group. Organizes `moni-button` or `moni-icon-button`
12
- * components in a row.
17
+ * Material Design 3 Button Group component.
18
+ *
19
+ * Organizes multiple `<moni-button>` or `<moni-icon-button>` components
20
+ * into a single row.
21
+ *
22
+ * **Variants:**
23
+ * - `standard` (default) — A simple flex row with a gap between buttons.
24
+ * - `connected` — The M3 Expressive replacement for segmented buttons. In this
25
+ * mode, buttons share borders and form a single continuous pill shape. The
26
+ * group manages the single/multi-select toggle state of its children.
27
+ *
28
+ * **`connected` variant details:**
29
+ * - **Shape propagation:** The group automatically propagates M3 shape classes
30
+ * (`left-round-flat`, `no-round`, `right-round-flat`) to its children so
31
+ * they interlock seamlessly.
32
+ * - **Toggle management:** The group listens to child clicks and toggles their
33
+ * `active` attributes. When `multi=false` (default), only one button can be
34
+ * active at a time (radio button behavior). When `multi=true`, multiple buttons
35
+ * can be active (checkbox behavior).
36
+ * - **Event propagation:** Fires a `'change'` event when the selection changes.
37
+ *
38
+ * **Accessibility:**
39
+ * - Renders with `role="group"` (can be overridden to `toolbar` or `radiogroup`).
40
+ * - Consumers should provide an `aria-label` or `aria-labelledby` attribute
41
+ * to identify the group's purpose to assistive technologies.
42
+ *
43
+ * @fires change - Fired when a button is clicked in `connected` mode and the
44
+ * selection state updates.
13
45
  *
14
- * **`variant="connected"`** is the Material Design 3 Expressive replacement
15
- * for the deprecated `moni-segmented-button` (see
16
- * `m3-docs/components/segmented-buttons/overview.md` § M3 Expressive update).
17
- * In connected mode, segments share borders via propagated `shape` values
18
- * (`left-round-flat`, `no-round`, `right-round-flat` for a gap-less row), and
19
- * the group manages single/multi-select toggle state. This is the
20
- * **only Moni component that intentionally uses `@click` listeners** —
21
- * toggle behavior is essential to the M3 connected button group semantics.
46
+ * @example
47
+ * ```html
48
+ * <!-- Connected single-select group -->
49
+ * <moni-button-group variant="connected" label="Alignment">
50
+ * <moni-button icon="format_align_left" active></moni-button>
51
+ * <moni-button icon="format_align_center"></moni-button>
52
+ * <moni-button icon="format_align_right"></moni-button>
53
+ * </moni-button-group>
22
54
  *
23
- * Accessibility:
24
- * - The host renders `role="group"` (configurable via `role` attribute).
25
- * - `aria-label` / `aria-labelledby` should be set by the consumer to
26
- * identify the group to assistive technology.
55
+ * <!-- Standard button row -->
56
+ * <moni-button-group gap="1rem">
57
+ * <moni-button variant="text">Cancel</moni-button>
58
+ * <moni-button>Save</moni-button>
59
+ * </moni-button-group>
60
+ * ```
27
61
  *
28
- * Attributes:
29
- * - variant: standard (default) | connected
30
- * - size: small | medium (default) | large | extra
31
- * - multi: boolean (default false) — multiple toggles allowed
32
- * - gap: custom gap space (e.g. "8px" or "1rem"); in `connected`
33
- * variant the default is 0.125rem (2dp) per M3 spec
34
- * - role: ARIA role override (default "group")
35
- * - label: aria-label for the group
36
- * - labelled-by: aria-labelledby reference
62
+ * @slot default - The `<moni-button>` elements that make up the group.
37
63
  */
38
64
  let MoniButtonGroup = class MoniButtonGroup extends MoniElement {
39
65
  constructor() {
@@ -1,14 +1,34 @@
1
+ /**
2
+ * @file components/moni-button-segment.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
- * A selectable segment button designed to be grouped inside a `moni-segmented-button`.
10
+ * Material Design 3 Segmented Button component (Legacy).
11
+ *
12
+ * **Deprecation Notice:** The M3 spec (`m3-docs/components/segmented-buttons/overview.md`)
13
+ * has replaced the bespoke segmented button component with standard buttons arranged
14
+ * in a "connected" group. Please use `<moni-button-group variant="connected">`
15
+ * containing standard `<moni-button>` elements instead of this component.
16
+ *
17
+ * This component remains for backwards compatibility but will be removed in a
18
+ * future major release. It renders a single segment within a `<moni-segmented-button>`.
19
+ *
20
+ * @deprecated Use `<moni-button-group variant="connected">` instead.
21
+ *
22
+ * @example
23
+ * ```html
24
+ * <!-- Legacy usage (not recommended) -->
25
+ * <moni-segmented-button>
26
+ * <moni-button-segment value="day" checked>Day</moni-button-segment>
27
+ * <moni-button-segment value="week">Week</moni-button-segment>
28
+ * </moni-segmented-button>
29
+ * ```
5
30
  *
6
- * Attributes:
7
- * - value: The value of the segment (default "on")
8
- * - checked: Whether the segment is checked/selected
9
- * - disabled: Whether the segment is disabled
10
- * - position: Automatically set by the parent (first | middle | last | solo)
11
- * - hide-check: Hides the checkmark when selected
31
+ * @slot default - The segment label text.
12
32
  */
13
33
  export declare class MoniButtonSegment extends MoniElement {
14
34
  value: string;
@@ -18,7 +38,7 @@ export declare class MoniButtonSegment extends MoniElement {
18
38
  position: 'first' | 'middle' | 'last' | 'solo';
19
39
  hideCheck: boolean;
20
40
  static styles: import("lit").CSSResult[];
21
- render(): import("lit-html").TemplateResult<1>;
41
+ render(): import("lit").TemplateResult<1>;
22
42
  }
23
43
  declare global {
24
44
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"moni-button-segment.d.ts","sourceRoot":"","sources":["../../src/components/moni-button-segment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;GASG;AACH,qBACa,iBAAkB,SAAQ,WAAW;IAEjD,KAAK,SAAQ;IAGb,OAAO,UAAS;IAGhB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAG9E,QAAQ,UAAS;IAGjB,QAAQ,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAU;IAGxD,SAAS,UAAS;IAElB,OAAgB,MAAM,4BA0OpB;IAEO,MAAM;CAWf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,qBAAqB,EAAE,iBAAiB,CAAC;KACzC;CACD;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"moni-button-segment.d.ts","sourceRoot":"","sources":["../../src/components/moni-button-segment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,iBAAkB,SAAQ,WAAW;IAEjD,KAAK,SAAQ;IAGb,OAAO,UAAS;IAGhB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAY;IAG9E,QAAQ,UAAS;IAGjB,QAAQ,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAU;IAGxD,SAAS,UAAS;IAElB,OAAgB,MAAM,4BA0OpB;IAEO,MAAM;CAWf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,qBAAqB,EAAE,iBAAiB,CAAC;KACzC;CACD;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @file components/moni-button-segment.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,14 +15,28 @@ 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
- * A selectable segment button designed to be grouped inside a `moni-segmented-button`.
18
+ * Material Design 3 Segmented Button component (Legacy).
19
+ *
20
+ * **Deprecation Notice:** The M3 spec (`m3-docs/components/segmented-buttons/overview.md`)
21
+ * has replaced the bespoke segmented button component with standard buttons arranged
22
+ * in a "connected" group. Please use `<moni-button-group variant="connected">`
23
+ * containing standard `<moni-button>` elements instead of this component.
24
+ *
25
+ * This component remains for backwards compatibility but will be removed in a
26
+ * future major release. It renders a single segment within a `<moni-segmented-button>`.
27
+ *
28
+ * @deprecated Use `<moni-button-group variant="connected">` instead.
29
+ *
30
+ * @example
31
+ * ```html
32
+ * <!-- Legacy usage (not recommended) -->
33
+ * <moni-segmented-button>
34
+ * <moni-button-segment value="day" checked>Day</moni-button-segment>
35
+ * <moni-button-segment value="week">Week</moni-button-segment>
36
+ * </moni-segmented-button>
37
+ * ```
13
38
  *
14
- * Attributes:
15
- * - value: The value of the segment (default "on")
16
- * - checked: Whether the segment is checked/selected
17
- * - disabled: Whether the segment is disabled
18
- * - position: Automatically set by the parent (first | middle | last | solo)
19
- * - hide-check: Hides the checkmark when selected
39
+ * @slot default - The segment label text.
20
40
  */
21
41
  let MoniButtonSegment = class MoniButtonSegment extends MoniElement {
22
42
  constructor() {
@@ -1,42 +1,61 @@
1
+ /**
2
+ * @file components/moni-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
  import './moni-icon.js';
3
9
  import './moni-progress.js';
4
10
  /**
5
- * Visual-only button. Renders a native `<button>` styled per Material 3 Expressive.
11
+ * Material Design 3 Button component.
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).
16
+ *
17
+ * **M3 spec reference:** `m3-docs/components/buttons/specs.md`
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).
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. round ↔ square).
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.
35
+ *
36
+ * @example
37
+ * ```html
38
+ * <!-- Primary filled button -->
39
+ * <moni-button icon="add">Create new</moni-button>
40
+ *
41
+ * <!-- Outlined button -->
42
+ * <moni-button variant="outlined">Cancel</moni-button>
6
43
  *
7
- * **Shape morph on press** (`m3-docs/components/buttons/specs.md` § Shape morph):
8
- * round and square buttons both morph to the same pressed shape, with per-size
9
- * corner radii: XS 8dp, S 8dp, M 12dp, L 16dp, XL 16dp. The per-size rules
10
- * `.button.{xsmall,small,large,xlarge,extra}:active` override the default
11
- * `:active` rule by specificity (0,4,0 vs 0,3,0).
44
+ * <!-- Toggle button (toggles active state on click) -->
45
+ * <moni-button icon="favorite" active>Like</moni-button>
12
46
  *
13
- * **Shape morph on selected** (toggle): when `active` is true, the resting
14
- * shape flips (round ↔ square). See `render()`.
47
+ * <!-- Link button -->
48
+ * <moni-button href="/settings" icon="settings">Settings</moni-button>
49
+ * ```
15
50
  *
16
- * Attributes:
17
- * - variant: filled (default) | tonal | elevated | outlined | text | fill
18
- * - size: xsmall | small | medium (default) | large | xlarge
19
- * (legacy `extra` alias for `xlarge`, deprecated in v0.3.0)
20
- * - shape: round (default) | square | circle | no-round
21
- * | left-round | right-round | top-round | bottom-round
22
- * | left-round-flat | right-round-flat | top-round-flat
23
- * | bottom-round-flat | inner-round
24
- * (the `-flat` and `inner-round` shapes are Moni brand
25
- * extensions; not part of M3 — see WEB_COMPONENT_GUIDELINES.md)
26
- * - disabled: present → native disabled
27
- * - loading: present → shows an indeterminate circular progress
28
- * - active: present → toggle (selection) state; applies shape morph
29
- * (round↔square) and variant-specific color swap
30
- * - icon: Material Symbols name to prepend
31
- * - icon-trailing: Material Symbols name to append
32
- * - type: button (default) | submit | reset
33
- * - href: present → renders as `<a>` instead of `<button>`
34
- * - target: for `<a>` rendering
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.
35
54
  *
36
- * Slots:
37
- * - default: button label
38
- * - icon: optional override for the leading icon
39
- * - icon-trailing: optional override for the trailing icon
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.
40
59
  */
41
60
  export declare class MoniButton extends MoniElement {
42
61
  private static _deprecationWarned;
@@ -59,7 +78,7 @@ export declare class MoniButton extends MoniElement {
59
78
  connectedCallback(): void;
60
79
  static styles: import("lit").CSSResult[];
61
80
  private handleLinkClick;
62
- render(): import("lit-html").TemplateResult<1>;
81
+ render(): import("lit").TemplateResult<1>;
63
82
  }
64
83
  declare global {
65
84
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"moni-button.d.ts","sourceRoot":"","sources":["../../src/components/moni-button.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AACxB,OAAO,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;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;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,3 +1,9 @@
1
+ /**
2
+ * @file components/moni-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);
@@ -12,41 +18,54 @@ import { MoniElement, sharedStyles } from './_base/index.js';
12
18
  import './moni-icon.js';
13
19
  import './moni-progress.js';
14
20
  /**
15
- * Visual-only button. Renders a native `<button>` styled per Material 3 Expressive.
21
+ * Material Design 3 Button component.
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).
26
+ *
27
+ * **M3 spec reference:** `m3-docs/components/buttons/specs.md`
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).
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. round ↔ square).
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.
45
+ *
46
+ * @example
47
+ * ```html
48
+ * <!-- Primary filled button -->
49
+ * <moni-button icon="add">Create new</moni-button>
50
+ *
51
+ * <!-- Outlined button -->
52
+ * <moni-button variant="outlined">Cancel</moni-button>
16
53
  *
17
- * **Shape morph on press** (`m3-docs/components/buttons/specs.md` § Shape morph):
18
- * round and square buttons both morph to the same pressed shape, with per-size
19
- * corner radii: XS 8dp, S 8dp, M 12dp, L 16dp, XL 16dp. The per-size rules
20
- * `.button.{xsmall,small,large,xlarge,extra}:active` override the default
21
- * `:active` rule by specificity (0,4,0 vs 0,3,0).
54
+ * <!-- Toggle button (toggles active state on click) -->
55
+ * <moni-button icon="favorite" active>Like</moni-button>
22
56
  *
23
- * **Shape morph on selected** (toggle): when `active` is true, the resting
24
- * shape flips (round ↔ square). See `render()`.
57
+ * <!-- Link button -->
58
+ * <moni-button href="/settings" icon="settings">Settings</moni-button>
59
+ * ```
25
60
  *
26
- * Attributes:
27
- * - variant: filled (default) | tonal | elevated | outlined | text | fill
28
- * - size: xsmall | small | medium (default) | large | xlarge
29
- * (legacy `extra` alias for `xlarge`, deprecated in v0.3.0)
30
- * - shape: round (default) | square | circle | no-round
31
- * | left-round | right-round | top-round | bottom-round
32
- * | left-round-flat | right-round-flat | top-round-flat
33
- * | bottom-round-flat | inner-round
34
- * (the `-flat` and `inner-round` shapes are Moni brand
35
- * extensions; not part of M3 — see WEB_COMPONENT_GUIDELINES.md)
36
- * - disabled: present → native disabled
37
- * - loading: present → shows an indeterminate circular progress
38
- * - active: present → toggle (selection) state; applies shape morph
39
- * (round↔square) and variant-specific color swap
40
- * - icon: Material Symbols name to prepend
41
- * - icon-trailing: Material Symbols name to append
42
- * - type: button (default) | submit | reset
43
- * - href: present → renders as `<a>` instead of `<button>`
44
- * - target: for `<a>` rendering
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.
45
64
  *
46
- * Slots:
47
- * - default: button label
48
- * - icon: optional override for the leading icon
49
- * - icon-trailing: optional override for the trailing icon
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.
50
69
  */
51
70
  let MoniButton = class MoniButton extends MoniElement {
52
71
  constructor() {
@@ -1,43 +1,103 @@
1
+ /**
2
+ * @file components/moni-card.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
- * Material 3 Card (`m3-docs/components/cards/specs.md`).
4
- *
5
- * Cards display content and actions on a single subject. Three variants:
6
- * - **elevated**: surface-container-low background + elevation 1 shadow.
7
- * Default for collections where the card needs separation from a
8
- * patterned background.
9
- * - **filled**: surface-container-highest background, no shadow.
10
- * Lowest emphasis; use when cards sit directly on the background.
11
- * - **outlined**: surface background + outline-variant 1dp stroke.
12
- * Highest emphasis without shadow; good on solid color backgrounds.
13
- *
14
- * M3 measurements:
15
- * - Container corner radius: **12dp**.
16
- * - Left/right padding: **16dp**.
17
- * - Padding between cards in a collection: max **8dp**.
18
- * - Headline text alignment: **start**.
19
- *
20
- * Slots:
21
- * - media: image or video at the top of the card.
22
- * - default: primary content (headline, subhead, supporting text).
23
- * - headline: shortcut for the H3-equivalent title (semantic).
24
- * - subhead: secondary title slot.
25
- * - supporting: supporting text slot.
26
- * - actions: action buttons row at the bottom of the card.
27
- *
28
- * Attributes:
29
- * - variant: elevated (default) | filled | outlined
30
- * - clickable: present → apply hover/focus/pressed state layers
31
- * - draggable: present → apply dragged state elevation (3)
32
- * - disabled: present → reduced opacity + cursor not-allowed
9
+ * Material Design 3 Card component.
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.
14
+ *
15
+ * **M3 spec reference:** `m3-docs/components/cards/specs.md`
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.
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.
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.
36
+ *
37
+ * @example
38
+ * ```html
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>
43
+ * <div slot="actions">
44
+ * <moni-button variant="text">Cancel</moni-button>
45
+ * <moni-button>Confirm</moni-button>
46
+ * </div>
47
+ * </moni-card>
48
+ * ```
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.
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.
33
61
  */
34
62
  export declare class MoniCard extends MoniElement {
63
+ /**
64
+ * Visual variant of the card.
65
+ *
66
+ * - `'elevated'` (default) — Surface-low background + elevation shadow.
67
+ * - `'filled'` — Surface-highest background, no shadow.
68
+ * - `'outlined'` — Surface background + outline-variant stroke.
69
+ *
70
+ * @default 'elevated'
71
+ */
35
72
  variant: 'elevated' | 'filled' | 'outlined';
73
+ /**
74
+ * When `true`, applies M3 state layer overlays (hover, focus, pressed)
75
+ * to communicate interactivity. The card background shifts slightly on hover.
76
+ *
77
+ * Use when the card itself is a clickable navigation or selection target.
78
+ *
79
+ * @default false
80
+ */
36
81
  clickable: boolean;
82
+ /**
83
+ * When `true`, applies `--elevate3` box-shadow to simulate the M3 "dragged"
84
+ * state as specified in the M3 card interaction spec.
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).
88
+ *
89
+ * @default false
90
+ */
37
91
  draggable: boolean;
92
+ /**
93
+ * When `true`, the card renders at 50% opacity with `cursor: not-allowed`,
94
+ * signaling that the card and its actions are unavailable.
95
+ *
96
+ * @default false
97
+ */
38
98
  disabled: boolean;
39
99
  static styles: import("lit").CSSResult[];
40
- render(): import("lit-html").TemplateResult<1>;
100
+ render(): import("lit").TemplateResult<1>;
41
101
  }
42
102
  declare global {
43
103
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"moni-card.d.ts","sourceRoot":"","sources":["../../src/components/moni-card.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBACa,QAAS,SAAQ,WAAW;IAExC,OAAO,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAc;IACb,SAAS,UAAS;IAClB,SAAS,UAAS;IAClB,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;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"}