@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-typography.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
7
+
1
8
  import { css, nothing } from 'lit';
2
9
  import { customElement, property } from 'lit/decorators.js';
3
10
  import { unsafeStatic, html as staticHtml } from 'lit/static-html.js';
4
11
  import { MoniElement, sharedStyles } from './_base/index.js';
5
12
 
6
13
  /**
7
- * Material 3 Typography (`m3-docs/components/`).
14
+ * Material Design 3 Typography component.
15
+ *
16
+ * A specialized text component that enforces the M3 type scale. It ensures
17
+ * typography is consistent, accessible, and correctly styled across the
18
+ * application without requiring manual CSS classes.
19
+ *
20
+ * **M3 spec reference:** `m3-docs/components/typography/specs.md`
21
+ *
22
+ * **Type Scale Categories:**
23
+ * - `display`: The largest text on the screen, reserved for short, important
24
+ * text or numerals. Works best on large screens. (Renders `<h1>` by default).
25
+ * - `headline`: High-emphasis text for primary page/section headers.
26
+ * (Renders `<h2>` by default).
27
+ * - `title`: Medium-emphasis text used for dialog headers or smaller section
28
+ * titles. (Renders `<h3>` by default).
29
+ * - `body`: Standard paragraph text used for long-form content.
30
+ * (Renders `<p>` by default).
31
+ * - `label`: Small, utilitarian text used for buttons, captions, and form
32
+ * elements. (Renders `<label>` by default).
33
+ *
34
+ * Each category supports three sizes: `large`, `medium`, and `small`.
8
35
  *
9
- * Renders a single piece of text using the M3 type scale. The component
10
- * chooses both the semantic tag and the typography class based on the
11
- * `variant` attribute. Consumers can override the tag via `as`.
36
+ * **Semantic Tags:**
37
+ * The component automatically selects an appropriate HTML semantic tag based on
38
+ * the variant. You can explicitly override this by setting the `as` attribute
39
+ * (e.g., to render a `headline` style but using a `<span>` tag for SEO or
40
+ * structural reasons).
12
41
  *
13
- * M3 type scale (5 categories, 3 sizes each):
14
- * - **display**: largest text, used for marketing or hero content.
15
- * - **headline**: page-level headings (H1 equivalent).
16
- * - **title**: section headings, dialog titles.
17
- * - **body**: paragraph text.
18
- * - **label**: button text, captions.
42
+ * @example
43
+ * ```html
44
+ * <!-- Renders an <h1> with display-large styles -->
45
+ * <moni-typography variant="display" size="large">Hero Text</moni-typography>
19
46
  *
20
- * Each category has `large`, `medium`, and `small` sizes (per M3 spec).
47
+ * <!-- Renders a <p> with body-medium styles -->
48
+ * <moni-typography variant="body">Standard paragraph text.</moni-typography>
21
49
  *
22
- * Attributes:
23
- * - variant: display | headline | title | body | label (default body)
24
- * - size: large | medium | small (default medium)
25
- * - as: override the rendered tag (e.g. "span", "p", "label")
50
+ * <!-- Overriding the semantic tag -->
51
+ * <moni-typography variant="title" as="span">Inline title</moni-typography>
52
+ * ```
26
53
  *
27
- * Slots:
28
- * - default: text content (falls back to `text` attribute if empty)
54
+ * @slot default - The text content to display.
29
55
  */
30
56
  @customElement('moni-typography')
31
57
  export class MoniTypography extends MoniElement {
package/src/index.ts CHANGED
@@ -1,7 +1,56 @@
1
+ /**
2
+ * @file index.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
7
+
8
+ /**
9
+ * @module @moni-labs/moni-ui
10
+ *
11
+ * Main entry point for the Moni UI component library.
12
+ *
13
+ * **What this file does:**
14
+ * 1. **Side-effect import** — `import './components/index.js'` triggers the
15
+ * auto-registration of every `<moni-*>` custom element with the browser's
16
+ * Custom Element registry. This must happen before any component is rendered
17
+ * in the DOM.
18
+ * 2. **Re-exports** — All component classes, utilities, and TypeScript types
19
+ * are re-exported so consumers get a single import path:
20
+ *
21
+ * ```ts
22
+ * import {
23
+ * MoniButton,
24
+ * getThemeEngine,
25
+ * generateScheme,
26
+ * type ColorScheme
27
+ * } from '@moni-labs/moni-ui';
28
+ * ```
29
+ *
30
+ * **Import strategies:**
31
+ * - **Full bundle** (this file): imports and registers ALL components at once.
32
+ * Best for SPAs that use many components.
33
+ * - **Tree-shaken per-component**: import individual files from
34
+ * `@moni-labs/moni-ui/components/moni-button.js` etc. to let bundlers
35
+ * include only what is used. Better for apps that use a small subset.
36
+ *
37
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry Custom Element Registry}
38
+ */
39
+
40
+ // ─────────────────────────────────────────────────────────────────────────────
1
41
  // Auto-register all Moni UI Web Components
42
+ // ─────────────────────────────────────────────────────────────────────────────
43
+ // This import has side effects: it calls customElements.define() for every
44
+ // <moni-*> element. Bundlers must NOT tree-shake this import.
2
45
  import './components/index.js';
3
46
 
4
- // Web Components (visual-only)
47
+ // ─────────────────────────────────────────────────────────────────────────────
48
+ // Web Component class exports
49
+ // ─────────────────────────────────────────────────────────────────────────────
50
+ // Exporting the class enables TypeScript consumers to:
51
+ // - Subclass components for customization.
52
+ // - Use the class in type narrowing (instanceof MoniButton).
53
+ // - Access static members and properties programmatically.
5
54
  export {
6
55
  MoniBadge,
7
56
  MoniBottomSheet,
@@ -45,8 +94,17 @@ export {
45
94
  MoniShape,
46
95
  } from './components/index.js';
47
96
 
48
- // Utils
97
+ // ─────────────────────────────────────────────────────────────────────────────
98
+ // Utility exports
99
+ // ─────────────────────────────────────────────────────────────────────────────
100
+
101
+ /**
102
+ * Theme engine singleton factory.
103
+ * @see {@link getThemeEngine} for full documentation.
104
+ */
49
105
  export { getThemeEngine, resetThemeEngine } from './utils/theme.svelte.js';
106
+
107
+ /** TypeScript types for theme engine configuration. */
50
108
  export type {
51
109
  ThemeSettings,
52
110
  ThemeMode,
@@ -54,6 +112,11 @@ export type {
54
112
  ThemeRadius,
55
113
  ThemeFont
56
114
  } from './utils/theme.svelte.js';
115
+
116
+ /**
117
+ * Color generation and application utilities.
118
+ * @see utils/color.ts for full documentation.
119
+ */
57
120
  export {
58
121
  generateScheme,
59
122
  applySchemeToDocument,
@@ -61,5 +124,6 @@ export {
61
124
  hexToHsl,
62
125
  hslToHex
63
126
  } from './utils/color.js';
64
- export type { ColorScheme, ContrastLevel } from './utils/color.js';
65
127
 
128
+ /** TypeScript types for the color system. */
129
+ export type { ColorScheme, ContrastLevel } from './utils/color.js';
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @file styles/tailwind.css
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
7
+
8
+ @import 'tailwindcss';
9
+
10
+ @theme {
11
+ /* ─── Material Design 3 Expressive tokens integration ─── */
12
+ --color-primary: var(--moni-primary);
13
+ --color-on-primary: var(--moni-on-primary);
14
+ --color-primary-container: var(--moni-primary-container);
15
+ --color-on-primary-container: var(--moni-on-primary-container);
16
+
17
+ --color-secondary: var(--moni-secondary);
18
+ --color-on-secondary: var(--moni-on-secondary);
19
+ --color-secondary-container: var(--moni-secondary-container);
20
+ --color-on-secondary-container: var(--moni-on-secondary-container);
21
+
22
+ --color-tertiary: var(--moni-tertiary);
23
+ --color-on-tertiary: var(--moni-on-tertiary);
24
+ --color-tertiary-container: var(--moni-tertiary-container);
25
+ --color-on-tertiary-container: var(--moni-on-tertiary-container);
26
+
27
+ --color-error: var(--moni-error);
28
+ --color-on-error: var(--moni-on-error);
29
+ --color-error-container: var(--moni-error-container);
30
+ --color-on-error-container: var(--moni-on-error-container);
31
+
32
+ --color-background: var(--moni-background);
33
+ --color-on-background: var(--moni-on-background);
34
+ --color-surface: var(--moni-surface);
35
+ --color-on-surface: var(--moni-on-surface);
36
+ --color-surface-variant: var(--moni-surface-variant);
37
+ --color-on-surface-variant: var(--moni-on-surface-variant);
38
+
39
+ --color-outline: var(--moni-outline);
40
+ --color-outline-variant: var(--moni-outline-variant);
41
+
42
+ --color-surface-container-lowest: var(--moni-surface-container-lowest);
43
+ --color-surface-container-low: var(--moni-surface-container-low);
44
+ --color-surface-container: var(--moni-surface-container);
45
+ --color-surface-container-high: var(--moni-surface-container-high);
46
+ --color-surface-container-highest: var(--moni-surface-container-highest);
47
+
48
+ --color-inverse-surface: var(--moni-inverse-surface);
49
+ --color-inverse-on-surface: var(--moni-inverse-on-surface);
50
+ --color-inverse-primary: var(--moni-inverse-primary);
51
+
52
+ /* ─── Typography ─── */
53
+ --font-sans: var(--moni-font-sans, 'Geist', system-ui, -apple-system, sans-serif);
54
+ --font-serif: var(--moni-font-title, 'Instrument Serif', Georgia, serif);
55
+ --font-mono: 'Geist Mono', 'Fira Code', monospace;
56
+ --font-brand: var(--moni-font-sans, 'Geist', system-ui, sans-serif);
57
+ --font-title: var(--moni-font-title, 'Instrument Serif', Georgia, serif);
58
+ --font-icon: var(--moni-font-icon, 'Material Symbols Rounded');
59
+
60
+ /* ─── Radius scale ─── */
61
+ --radius-base: var(--moni-radius-base, 12px);
62
+ --radius-sm: calc(var(--moni-radius-base, 12px) * 0.5);
63
+ --radius-md: var(--moni-radius-base, 12px);
64
+ --radius-lg: calc(var(--moni-radius-base, 12px) * 1.5);
65
+ --radius-xl: calc(var(--moni-radius-base, 12px) * 2);
66
+ --radius-full: 9999px;
67
+ }
@@ -1,46 +1,51 @@
1
- @import 'tailwindcss';
2
-
3
- @theme {
4
- /* ─── Material Design 3 Expressive tokens ─── */
5
- --color-primary: var(--md-sys-color-primary);
6
- --color-on-primary: var(--md-sys-color-on-primary);
7
- --color-primary-container: var(--md-sys-color-primary-container);
8
- --color-on-primary-container: var(--md-sys-color-on-primary-container);
9
-
10
- --color-secondary: var(--md-sys-color-secondary);
11
- --color-on-secondary: var(--md-sys-color-on-secondary);
12
- --color-secondary-container: var(--md-sys-color-secondary-container);
13
- --color-on-secondary-container: var(--md-sys-color-on-secondary-container);
14
-
15
- --color-tertiary: var(--md-sys-color-tertiary);
16
- --color-on-tertiary: var(--md-sys-color-on-tertiary);
17
- --color-tertiary-container: var(--md-sys-color-tertiary-container);
18
- --color-on-tertiary-container: var(--md-sys-color-on-tertiary-container);
19
-
20
- --color-error: var(--md-sys-color-error);
21
- --color-on-error: var(--md-sys-color-on-error);
22
- --color-error-container: var(--md-sys-color-error-container);
23
- --color-on-error-container: var(--md-sys-color-on-error-container);
24
-
25
- --color-background: var(--md-sys-color-background);
26
- --color-on-background: var(--md-sys-color-on-background);
27
- --color-surface: var(--md-sys-color-surface);
28
- --color-on-surface: var(--md-sys-color-on-surface);
29
- --color-surface-variant: var(--md-sys-color-surface-variant);
30
- --color-on-surface-variant: var(--md-sys-color-on-surface-variant);
31
-
32
- --color-outline: var(--md-sys-color-outline);
33
- --color-outline-variant: var(--md-sys-color-outline-variant);
34
-
35
- --color-surface-container-lowest: var(--md-sys-color-surface-container-lowest);
36
- --color-surface-container-low: var(--md-sys-color-surface-container-low);
37
- --color-surface-container: var(--md-sys-color-surface-container);
38
- --color-surface-container-high: var(--md-sys-color-surface-container-high);
39
- --color-surface-container-highest: var(--md-sys-color-surface-container-highest);
40
-
41
- --color-inverse-surface: var(--md-sys-color-inverse-surface);
42
- --color-inverse-on-surface: var(--md-sys-color-inverse-on-surface);
43
- --color-inverse-primary: var(--md-sys-color-inverse-primary);
1
+ /**
2
+ * @file styles/tokens.css
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
7
+
8
+ :root {
9
+ /* ─── Moni Design System core prefixed tokens ─── */
10
+ --moni-primary: var(--md-sys-color-primary, #6750a4);
11
+ --moni-on-primary: var(--md-sys-color-on-primary, #ffffff);
12
+ --moni-primary-container: var(--md-sys-color-primary-container, #eaddff);
13
+ --moni-on-primary-container: var(--md-sys-color-on-primary-container, #21005d);
14
+
15
+ --moni-secondary: var(--md-sys-color-secondary, #625b71);
16
+ --moni-on-secondary: var(--md-sys-color-on-secondary, #ffffff);
17
+ --moni-secondary-container: var(--md-sys-color-secondary-container, #e8def8);
18
+ --moni-on-secondary-container: var(--md-sys-color-on-secondary-container, #1d192b);
19
+
20
+ --moni-tertiary: var(--md-sys-color-tertiary, #7d5260);
21
+ --moni-on-tertiary: var(--md-sys-color-on-tertiary, #ffffff);
22
+ --moni-tertiary-container: var(--md-sys-color-tertiary-container, #ffd8e4);
23
+ --moni-on-tertiary-container: var(--md-sys-color-on-tertiary-container, #31111d);
24
+
25
+ --moni-error: var(--md-sys-color-error, #b3261e);
26
+ --moni-on-error: var(--md-sys-color-on-error, #ffffff);
27
+ --moni-error-container: var(--md-sys-color-error-container, #f9dedc);
28
+ --moni-on-error-container: var(--md-sys-color-on-error-container, #410e0b);
29
+
30
+ --moni-background: var(--md-sys-color-background, #fef7ff);
31
+ --moni-on-background: var(--md-sys-color-on-background, #1d1b20);
32
+ --moni-surface: var(--md-sys-color-surface, #fef7ff);
33
+ --moni-on-surface: var(--md-sys-color-on-surface, #1d1b20);
34
+ --moni-surface-variant: var(--md-sys-color-surface-variant, #e7e0ec);
35
+ --moni-on-surface-variant: var(--md-sys-color-on-surface-variant, #49454f);
36
+
37
+ --moni-outline: var(--md-sys-color-outline, #79747e);
38
+ --moni-outline-variant: var(--md-sys-color-outline-variant, #cac4d0);
39
+
40
+ --moni-surface-container-lowest: var(--md-sys-color-surface-container-lowest, #ffffff);
41
+ --moni-surface-container-low: var(--md-sys-color-surface-container-low, #f7f2fa);
42
+ --moni-surface-container: var(--md-sys-color-surface-container, #f3edf7);
43
+ --moni-surface-container-high: var(--md-sys-color-surface-container-high, #ece6f0);
44
+ --moni-surface-container-highest: var(--md-sys-color-surface-container-highest, #e6e1e5);
45
+
46
+ --moni-inverse-surface: var(--md-sys-color-inverse-surface, #313033);
47
+ --moni-inverse-on-surface: var(--md-sys-color-inverse-on-surface, #f4f0f4);
48
+ --moni-inverse-primary: var(--md-sys-color-inverse-primary, #d0bcff);
44
49
 
45
50
  /* ─── Semantic Moni tokens ─── */
46
51
  --color-success: #16a34a;
@@ -126,65 +131,72 @@
126
131
  --moni-grain-opacity: var(--moni-grain-opacity, 0.03);
127
132
 
128
133
  /* ─── Legacy Moni tokens (fallback durante la migración) ─── */
129
- --color-brand-bg: var(--md-sys-color-background);
130
- --color-brand-surface: var(--md-sys-color-surface);
131
- --color-brand-primary: var(--md-sys-color-on-surface);
132
- --color-brand-muted: var(--md-sys-color-on-surface-variant);
133
- --color-brand-border: var(--md-sys-color-outline-variant);
134
- --color-brand-accent: var(--md-sys-color-primary);
135
-
136
- --color-admin-bg: var(--md-sys-color-background);
137
- --color-admin-surface: var(--md-sys-color-surface);
138
- --color-admin-sidebar: var(--md-sys-color-inverse-surface);
139
- --color-admin-sidebar-fg: var(--md-sys-color-inverse-on-surface);
140
- --color-admin-sidebar-muted: var(--md-sys-color-inverse-on-surface);
141
- --color-admin-accent: var(--md-sys-color-primary);
142
- --color-admin-accent-soft: var(--md-sys-color-primary-container);
143
- --color-admin-text: var(--md-sys-color-on-surface);
134
+ --color-brand-bg: var(--moni-background);
135
+ --color-brand-surface: var(--moni-surface);
136
+ --color-brand-primary: var(--moni-on-surface);
137
+ --color-brand-muted: var(--moni-on-surface-variant);
138
+ --color-brand-border: var(--moni-outline-variant);
139
+ --color-brand-accent: var(--moni-primary);
140
+
141
+ --color-admin-bg: var(--moni-background);
142
+ --color-admin-surface: var(--moni-surface);
143
+ --color-admin-sidebar: var(--moni-inverse-surface);
144
+ --color-admin-sidebar-fg: var(--moni-inverse-on-surface);
145
+ --color-admin-sidebar-muted: var(--moni-inverse-on-surface);
146
+ --color-admin-accent: var(--moni-primary);
147
+ --color-admin-accent-soft: var(--moni-primary-container);
148
+ --color-admin-text: var(--moni-on-surface);
144
149
  --color-admin-success: var(--color-success);
145
150
  --color-admin-warn: var(--color-warning);
146
151
  --color-admin-danger: var(--color-danger);
147
152
  --color-admin-info: var(--color-info);
148
- }
149
153
 
150
- :root {
151
- --primary: var(--md-sys-color-primary);
152
- --on-primary: var(--md-sys-color-on-primary);
153
- --primary-container: var(--md-sys-color-primary-container);
154
- --on-primary-container: var(--md-sys-color-on-primary-container);
155
-
156
- --secondary: var(--md-sys-color-secondary);
157
- --on-secondary: var(--md-sys-color-on-secondary);
158
- --secondary-container: var(--md-sys-color-secondary-container);
159
- --on-secondary-container: var(--md-sys-color-on-secondary-container);
160
-
161
- --tertiary: var(--md-sys-color-tertiary);
162
- --on-tertiary: var(--md-sys-color-on-tertiary);
163
- --tertiary-container: var(--md-sys-color-tertiary-container);
164
- --on-tertiary-container: var(--md-sys-color-on-tertiary-container);
165
-
166
- --error: var(--md-sys-color-error);
167
- --on-error: var(--md-sys-color-on-error);
168
- --error-container: var(--md-sys-color-error-container);
169
- --on-error-container: var(--md-sys-color-on-error-container);
170
-
171
- --background: var(--md-sys-color-background);
172
- --on-background: var(--md-sys-color-on-background);
173
- --surface: var(--md-sys-color-surface);
174
- --on-surface: var(--md-sys-color-on-surface);
175
- --surface-variant: var(--md-sys-color-surface-variant);
176
- --on-surface-variant: var(--md-sys-color-on-surface-variant);
177
-
178
- --outline: var(--md-sys-color-outline);
179
- --outline-variant: var(--md-sys-color-outline-variant);
180
-
181
- --surface-container-lowest: var(--md-sys-color-surface-container-lowest);
182
- --surface-container-low: var(--md-sys-color-surface-container-low);
183
- --surface-container: var(--md-sys-color-surface-container);
184
- --surface-container-high: var(--md-sys-color-surface-container-high);
185
- --surface-container-highest: var(--md-sys-color-surface-container-highest);
186
-
187
- --inverse-surface: var(--md-sys-color-inverse-surface);
188
- --inverse-on-surface: var(--md-sys-color-inverse-on-surface);
189
- --inverse-primary: var(--md-sys-color-inverse-primary);
154
+ /* ─── CSS compatibility aliases for Light DOM / external styling ─── */
155
+ --color-primary: var(--moni-primary);
156
+ --color-on-primary: var(--moni-on-primary);
157
+ --color-primary-container: var(--moni-primary-container);
158
+ --color-on-primary-container: var(--moni-on-primary-container);
159
+
160
+ --color-secondary: var(--moni-secondary);
161
+ --color-on-secondary: var(--moni-on-secondary);
162
+ --color-secondary-container: var(--moni-secondary-container);
163
+ --color-on-secondary-container: var(--moni-on-secondary-container);
164
+
165
+ --color-tertiary: var(--moni-tertiary);
166
+ --color-on-tertiary: var(--moni-on-tertiary);
167
+ --color-tertiary-container: var(--moni-tertiary-container);
168
+ --color-on-tertiary-container: var(--moni-on-tertiary-container);
169
+
170
+ --color-error: var(--moni-error);
171
+ --color-on-error: var(--moni-on-error);
172
+ --color-error-container: var(--moni-error-container);
173
+ --color-on-error-container: var(--moni-on-error-container);
174
+
175
+ --color-background: var(--moni-background);
176
+ --color-on-background: var(--moni-on-background);
177
+ --color-surface: var(--moni-surface);
178
+ --color-on-surface: var(--moni-on-surface);
179
+ --color-surface-variant: var(--moni-surface-variant);
180
+ --color-on-surface-variant: var(--moni-on-surface-variant);
181
+
182
+ --color-outline: var(--moni-outline);
183
+ --color-outline-variant: var(--moni-outline-variant);
184
+
185
+ --color-surface-container-lowest: var(--moni-surface-container-lowest);
186
+ --color-surface-container-low: var(--moni-surface-container-low);
187
+ --color-surface-container: var(--moni-surface-container);
188
+ --color-surface-container-high: var(--moni-surface-container-high);
189
+ --color-surface-container-highest: var(--moni-surface-container-highest);
190
+
191
+ --color-inverse-surface: var(--moni-inverse-surface);
192
+ --color-inverse-on-surface: var(--moni-inverse-on-surface);
193
+ --color-inverse-primary: var(--moni-inverse-primary);
194
+
195
+ /* Deprecated global variables fallback (can be disabled if conflicting) */
196
+ --primary: var(--moni-primary);
197
+ --on-primary: var(--moni-on-primary);
198
+ --background: var(--moni-background);
199
+ --surface: var(--moni-surface);
200
+ --on-surface: var(--moni-on-surface);
201
+ --outline: var(--moni-outline);
190
202
  }
@@ -1,7 +1,69 @@
1
- // Minimal type declarations for Svelte 5 runes used in non-Svelte TS files.
2
- // These allow the project to type-check without requiring the Svelte compiler in the TS pipeline.
1
+ /**
2
+ * @file types/svelte-runes.d.ts
3
+ * @package @moni-labs/moni-ui
4
+ * @license MIT
5
+ * @contributors Moni Labs & Contributors
6
+ */
3
7
 
8
+ /**
9
+ * Minimal ambient type declarations for Svelte 5 compiler runes.
10
+ *
11
+ * Svelte 5 introduces "runes" — special compiler-recognized global functions
12
+ * (`$state`, `$derived`, `$effect`, `$props`) that are transformed at build
13
+ * time by the Svelte compiler. Outside the Svelte compiler pipeline (e.g.
14
+ * when TypeScript checks `.ts` files that use runes, like `theme.svelte.ts`),
15
+ * these globals are not declared, causing `tsc` to emit "Cannot find name '$state'"
16
+ * errors.
17
+ *
18
+ * This file declares them as simple pass-through generics so TypeScript is
19
+ * satisfied without requiring the Svelte compiler to be part of the `tsc`
20
+ * type-check pipeline.
21
+ *
22
+ * **Important:** These declarations reflect the type signatures of the runes,
23
+ * not their full runtime behavior. They are intentionally minimal — just enough
24
+ * to pass `tsc --noEmit`. The real reactive behavior is provided by the Svelte
25
+ * compiler at build time.
26
+ *
27
+ * @see {@link https://svelte.dev/docs/svelte/what-are-runes Svelte 5 Runes}
28
+ */
29
+
30
+ /**
31
+ * Declares a reactive state variable.
32
+ * At runtime, reading or writing `value` triggers Svelte's fine-grained reactivity.
33
+ * For TypeScript checking outside the compiler, typed as a plain value.
34
+ *
35
+ * @template T - The type of the state value.
36
+ * @param initial - The initial value of the state.
37
+ * @returns A reactive reference to the value (typed as `T` for TS purposes).
38
+ */
4
39
  declare const $state: <T>(initial: T) => T;
40
+
41
+ /**
42
+ * Declares a derived (computed) value that updates whenever its dependencies change.
43
+ * The function `fn` is re-run automatically by Svelte when any reactive state
44
+ * it reads changes.
45
+ *
46
+ * @template T - The type of the derived value.
47
+ * @param fn - A function that computes the derived value.
48
+ * @returns The computed value (typed as `T` for TS purposes).
49
+ */
5
50
  declare const $derived: <T>(fn: () => T) => T;
51
+
52
+ /**
53
+ * Declares a reactive side effect that re-runs when its reactive dependencies change.
54
+ * The returned cleanup function (if any) is called before the effect re-runs and
55
+ * when the component is destroyed.
56
+ *
57
+ * @param fn - The effect function. May return a cleanup function.
58
+ */
6
59
  declare const $effect: (fn: () => void | (() => void)) => void;
60
+
61
+ /**
62
+ * Declares the props of a Svelte 5 component as a reactive object.
63
+ * Used inside `<script>` blocks to destructure incoming properties with
64
+ * full TypeScript type support.
65
+ *
66
+ * @template T - The shape of the component's props. Defaults to `Record<string, unknown>`.
67
+ * @returns The component's props object.
68
+ */
7
69
  declare const $props: <T = Record<string, unknown>>() => T;