@wirabyte/ui 2.0.0-beta.0 → 2.1.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 (247) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +6 -6
  3. package/avatar/avatar.component.d.ts +4 -2
  4. package/avatar/avatar.types.d.ts +3 -0
  5. package/breadcrumb/breadcrumb.component.d.ts +3 -1
  6. package/button/button.styles.d.ts +1 -1
  7. package/chat/chat.component.d.ts +118 -0
  8. package/chat/chat.module.d.ts +8 -0
  9. package/chat/chat.types.d.ts +64 -0
  10. package/chat/index.d.ts +5 -0
  11. package/chat/public-api.d.ts +3 -0
  12. package/config/options.d.ts +13 -0
  13. package/config/theme.service.d.ts +5 -0
  14. package/config/wu-config.service.d.ts +16 -0
  15. package/core/catalog.d.ts +6 -1
  16. package/core/overrides.d.ts +7 -0
  17. package/core/thai/locale.d.ts +47 -0
  18. package/datepicker/datepicker.component.d.ts +3 -2
  19. package/descriptions/descriptions.component.d.ts +56 -0
  20. package/descriptions/descriptions.module.d.ts +8 -0
  21. package/descriptions/index.d.ts +5 -0
  22. package/descriptions/public-api.d.ts +2 -0
  23. package/esm2022/accordion/accordion.component.mjs +4 -4
  24. package/esm2022/alert/alert-dialog.component.mjs +3 -3
  25. package/esm2022/asidemenu/asidemenu.component.mjs +3 -3
  26. package/esm2022/avatar/avatar.component.mjs +11 -5
  27. package/esm2022/avatar/avatar.types.mjs +2 -2
  28. package/esm2022/breadcrumb/breadcrumb.component.mjs +5 -3
  29. package/esm2022/button/button.component.mjs +2 -2
  30. package/esm2022/button/button.styles.mjs +2 -2
  31. package/esm2022/card/card.component.mjs +8 -8
  32. package/esm2022/chat/chat.component.mjs +370 -0
  33. package/esm2022/chat/chat.module.mjs +17 -0
  34. package/esm2022/chat/chat.types.mjs +2 -0
  35. package/esm2022/chat/public-api.mjs +4 -0
  36. package/esm2022/chat/wirabyte-ui-chat.mjs +5 -0
  37. package/esm2022/config/options.mjs +1 -1
  38. package/esm2022/config/theme.service.mjs +35 -3
  39. package/esm2022/config/wu-config.service.mjs +22 -1
  40. package/esm2022/core/catalog.mjs +22 -2
  41. package/esm2022/core/families.mjs +43 -1
  42. package/esm2022/core/overrides.mjs +26 -1
  43. package/esm2022/core/thai/locale.mjs +67 -1
  44. package/esm2022/datepicker/datepicker.component.mjs +6 -5
  45. package/esm2022/descriptions/descriptions.component.mjs +112 -0
  46. package/esm2022/descriptions/descriptions.module.mjs +17 -0
  47. package/esm2022/descriptions/public-api.mjs +3 -0
  48. package/esm2022/descriptions/wirabyte-ui-descriptions.mjs +5 -0
  49. package/esm2022/dialog/dialog.component.mjs +3 -3
  50. package/esm2022/drawer/drawer.component.mjs +3 -3
  51. package/esm2022/emptystate/emptystate.component.mjs +3 -3
  52. package/esm2022/errorpage/errorpage.component.mjs +3 -3
  53. package/esm2022/fieldset/fieldset.component.mjs +4 -4
  54. package/esm2022/metergroup/metergroup.component.mjs +19 -5
  55. package/esm2022/metergroup/metergroup.types.mjs +1 -1
  56. package/esm2022/navbar/navbar.component.mjs +3 -3
  57. package/esm2022/panel/panel.component.mjs +6 -6
  58. package/esm2022/popover/popover.base.mjs +3 -3
  59. package/esm2022/result/result.component.mjs +3 -3
  60. package/esm2022/scheduler/public-api.mjs +4 -0
  61. package/esm2022/scheduler/scheduler.component.mjs +484 -0
  62. package/esm2022/scheduler/scheduler.module.mjs +17 -0
  63. package/esm2022/scheduler/scheduler.types.mjs +2 -0
  64. package/esm2022/scheduler/wirabyte-ui-scheduler.mjs +5 -0
  65. package/esm2022/selectbutton/selectbutton.component.mjs +25 -4
  66. package/esm2022/signaturepad/public-api.mjs +3 -0
  67. package/esm2022/signaturepad/signaturepad.component.mjs +289 -0
  68. package/esm2022/signaturepad/signaturepad.module.mjs +17 -0
  69. package/esm2022/signaturepad/wirabyte-ui-signaturepad.mjs +5 -0
  70. package/esm2022/sitefooter/sitefooter.component.mjs +2 -2
  71. package/esm2022/stat/public-api.mjs +3 -0
  72. package/esm2022/stat/stat.component.mjs +128 -0
  73. package/esm2022/stat/stat.module.mjs +17 -0
  74. package/esm2022/stat/wirabyte-ui-stat.mjs +5 -0
  75. package/esm2022/table/table.celleditor.mjs +4 -4
  76. package/esm2022/tabs/tabs.component.mjs +3 -3
  77. package/esm2022/tag/tag.component.mjs +2 -2
  78. package/esm2022/textarea/textarea.directive.mjs +33 -1
  79. package/esm2022/thai/thai.pipes.mjs +3 -3
  80. package/esm2022/toolbar/toolbar.component.mjs +7 -7
  81. package/fesm2022/wirabyte-ui-accordion.mjs +3 -3
  82. package/fesm2022/wirabyte-ui-accordion.mjs.map +1 -1
  83. package/fesm2022/wirabyte-ui-alert.mjs +2 -2
  84. package/fesm2022/wirabyte-ui-alert.mjs.map +1 -1
  85. package/fesm2022/wirabyte-ui-asidemenu.mjs +2 -2
  86. package/fesm2022/wirabyte-ui-asidemenu.mjs.map +1 -1
  87. package/fesm2022/wirabyte-ui-avatar.mjs +12 -5
  88. package/fesm2022/wirabyte-ui-avatar.mjs.map +1 -1
  89. package/fesm2022/wirabyte-ui-breadcrumb.mjs +4 -2
  90. package/fesm2022/wirabyte-ui-breadcrumb.mjs.map +1 -1
  91. package/fesm2022/wirabyte-ui-button.mjs +3 -3
  92. package/fesm2022/wirabyte-ui-button.mjs.map +1 -1
  93. package/fesm2022/wirabyte-ui-card.mjs +7 -7
  94. package/fesm2022/wirabyte-ui-card.mjs.map +1 -1
  95. package/fesm2022/wirabyte-ui-chat.mjs +391 -0
  96. package/fesm2022/wirabyte-ui-chat.mjs.map +1 -0
  97. package/fesm2022/wirabyte-ui-config.mjs +55 -2
  98. package/fesm2022/wirabyte-ui-config.mjs.map +1 -1
  99. package/fesm2022/wirabyte-ui-core.mjs +155 -2
  100. package/fesm2022/wirabyte-ui-core.mjs.map +1 -1
  101. package/fesm2022/wirabyte-ui-datepicker.mjs +6 -5
  102. package/fesm2022/wirabyte-ui-datepicker.mjs.map +1 -1
  103. package/fesm2022/wirabyte-ui-descriptions.mjs +133 -0
  104. package/fesm2022/wirabyte-ui-descriptions.mjs.map +1 -0
  105. package/fesm2022/wirabyte-ui-dialog.mjs +2 -2
  106. package/fesm2022/wirabyte-ui-dialog.mjs.map +1 -1
  107. package/fesm2022/wirabyte-ui-drawer.mjs +2 -2
  108. package/fesm2022/wirabyte-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/wirabyte-ui-emptystate.mjs +2 -2
  110. package/fesm2022/wirabyte-ui-emptystate.mjs.map +1 -1
  111. package/fesm2022/wirabyte-ui-errorpage.mjs +2 -2
  112. package/fesm2022/wirabyte-ui-errorpage.mjs.map +1 -1
  113. package/fesm2022/wirabyte-ui-fieldset.mjs +3 -3
  114. package/fesm2022/wirabyte-ui-fieldset.mjs.map +1 -1
  115. package/fesm2022/wirabyte-ui-metergroup.mjs +18 -4
  116. package/fesm2022/wirabyte-ui-metergroup.mjs.map +1 -1
  117. package/fesm2022/wirabyte-ui-navbar.mjs +2 -2
  118. package/fesm2022/wirabyte-ui-navbar.mjs.map +1 -1
  119. package/fesm2022/wirabyte-ui-panel.mjs +5 -5
  120. package/fesm2022/wirabyte-ui-panel.mjs.map +1 -1
  121. package/fesm2022/wirabyte-ui-popover.mjs +2 -2
  122. package/fesm2022/wirabyte-ui-popover.mjs.map +1 -1
  123. package/fesm2022/wirabyte-ui-result.mjs +2 -2
  124. package/fesm2022/wirabyte-ui-result.mjs.map +1 -1
  125. package/fesm2022/wirabyte-ui-scheduler.mjs +505 -0
  126. package/fesm2022/wirabyte-ui-scheduler.mjs.map +1 -0
  127. package/fesm2022/wirabyte-ui-selectbutton.mjs +24 -3
  128. package/fesm2022/wirabyte-ui-selectbutton.mjs.map +1 -1
  129. package/fesm2022/wirabyte-ui-signaturepad.mjs +310 -0
  130. package/fesm2022/wirabyte-ui-signaturepad.mjs.map +1 -0
  131. package/fesm2022/wirabyte-ui-sitefooter.mjs +1 -1
  132. package/fesm2022/wirabyte-ui-sitefooter.mjs.map +1 -1
  133. package/fesm2022/wirabyte-ui-stat.mjs +149 -0
  134. package/fesm2022/wirabyte-ui-stat.mjs.map +1 -0
  135. package/fesm2022/wirabyte-ui-table.mjs +3 -3
  136. package/fesm2022/wirabyte-ui-table.mjs.map +1 -1
  137. package/fesm2022/wirabyte-ui-tabs.mjs +2 -2
  138. package/fesm2022/wirabyte-ui-tabs.mjs.map +1 -1
  139. package/fesm2022/wirabyte-ui-tag.mjs +2 -2
  140. package/fesm2022/wirabyte-ui-tag.mjs.map +1 -1
  141. package/fesm2022/wirabyte-ui-textarea.mjs +32 -0
  142. package/fesm2022/wirabyte-ui-textarea.mjs.map +1 -1
  143. package/fesm2022/wirabyte-ui-thai.mjs +2 -2
  144. package/fesm2022/wirabyte-ui-thai.mjs.map +1 -1
  145. package/fesm2022/wirabyte-ui-toolbar.mjs +6 -6
  146. package/fesm2022/wirabyte-ui-toolbar.mjs.map +1 -1
  147. package/metergroup/metergroup.component.d.ts +11 -2
  148. package/metergroup/metergroup.types.d.ts +6 -0
  149. package/package.json +77 -47
  150. package/scheduler/index.d.ts +5 -0
  151. package/scheduler/public-api.d.ts +3 -0
  152. package/scheduler/scheduler.component.d.ts +143 -0
  153. package/scheduler/scheduler.module.d.ts +8 -0
  154. package/scheduler/scheduler.types.d.ts +46 -0
  155. package/schematics/core/catalog.cjs +22 -1
  156. package/schematics/core/families.cjs +42 -0
  157. package/schematics/core/overrides.cjs +25 -0
  158. package/schematics/core/thai/locale.cjs +66 -0
  159. package/schematics/ng-add/index.cjs +3 -1
  160. package/selectbutton/selectbutton.component.d.ts +12 -1
  161. package/signaturepad/index.d.ts +5 -0
  162. package/signaturepad/public-api.d.ts +2 -0
  163. package/signaturepad/signaturepad.component.d.ts +98 -0
  164. package/signaturepad/signaturepad.module.d.ts +8 -0
  165. package/stat/index.d.ts +5 -0
  166. package/stat/public-api.d.ts +2 -0
  167. package/stat/stat.component.d.ts +61 -0
  168. package/stat/stat.module.d.ts +8 -0
  169. package/textarea/textarea.directive.d.ts +3 -0
  170. package/theme/_data.scss +239 -7
  171. package/theme/_index.scss +29 -0
  172. package/themes/mali/amber.css +30 -1
  173. package/themes/mali/blue.css +30 -1
  174. package/themes/mali/cyan.css +30 -1
  175. package/themes/mali/emerald.css +30 -1
  176. package/themes/mali/fuchsia.css +30 -1
  177. package/themes/mali/green.css +30 -1
  178. package/themes/mali/indigo.css +30 -1
  179. package/themes/mali/lime.css +30 -1
  180. package/themes/mali/orange.css +30 -1
  181. package/themes/mali/pink.css +30 -1
  182. package/themes/mali/purple.css +30 -1
  183. package/themes/mali/red.css +30 -1
  184. package/themes/mali/rose.css +30 -1
  185. package/themes/mali/sky.css +30 -1
  186. package/themes/mali/teal.css +30 -1
  187. package/themes/mali/theme.css +30 -1
  188. package/themes/mali/violet.css +30 -1
  189. package/themes/mali/wira.css +30 -1
  190. package/themes/mali/yellow.css +30 -1
  191. package/themes/material/amber.css +30 -1
  192. package/themes/material/blue.css +30 -1
  193. package/themes/material/cyan.css +30 -1
  194. package/themes/material/emerald.css +30 -1
  195. package/themes/material/fuchsia.css +30 -1
  196. package/themes/material/green.css +30 -1
  197. package/themes/material/indigo.css +30 -1
  198. package/themes/material/lime.css +30 -1
  199. package/themes/material/orange.css +30 -1
  200. package/themes/material/pink.css +30 -1
  201. package/themes/material/purple.css +30 -1
  202. package/themes/material/red.css +30 -1
  203. package/themes/material/rose.css +30 -1
  204. package/themes/material/sky.css +30 -1
  205. package/themes/material/teal.css +30 -1
  206. package/themes/material/theme.css +30 -1
  207. package/themes/material/violet.css +30 -1
  208. package/themes/material/wira.css +30 -1
  209. package/themes/material/yellow.css +30 -1
  210. package/themes/phet/amber.css +30 -1
  211. package/themes/phet/blue.css +30 -1
  212. package/themes/phet/cyan.css +30 -1
  213. package/themes/phet/emerald.css +30 -1
  214. package/themes/phet/fuchsia.css +30 -1
  215. package/themes/phet/green.css +30 -1
  216. package/themes/phet/indigo.css +30 -1
  217. package/themes/phet/lime.css +30 -1
  218. package/themes/phet/orange.css +30 -1
  219. package/themes/phet/pink.css +30 -1
  220. package/themes/phet/purple.css +30 -1
  221. package/themes/phet/red.css +30 -1
  222. package/themes/phet/rose.css +30 -1
  223. package/themes/phet/sky.css +30 -1
  224. package/themes/phet/teal.css +30 -1
  225. package/themes/phet/theme.css +30 -1
  226. package/themes/phet/violet.css +30 -1
  227. package/themes/phet/wira.css +30 -1
  228. package/themes/phet/yellow.css +30 -1
  229. package/themes/sila/amber.css +30 -1
  230. package/themes/sila/blue.css +30 -1
  231. package/themes/sila/cyan.css +30 -1
  232. package/themes/sila/emerald.css +30 -1
  233. package/themes/sila/fuchsia.css +30 -1
  234. package/themes/sila/green.css +30 -1
  235. package/themes/sila/indigo.css +30 -1
  236. package/themes/sila/lime.css +30 -1
  237. package/themes/sila/orange.css +30 -1
  238. package/themes/sila/pink.css +30 -1
  239. package/themes/sila/purple.css +30 -1
  240. package/themes/sila/red.css +30 -1
  241. package/themes/sila/rose.css +30 -1
  242. package/themes/sila/sky.css +30 -1
  243. package/themes/sila/teal.css +30 -1
  244. package/themes/sila/theme.css +30 -1
  245. package/themes/sila/violet.css +30 -1
  246. package/themes/sila/wira.css +30 -1
  247. package/themes/sila/yellow.css +30 -1
@@ -133,6 +133,26 @@ const SURFACES = {
133
133
  ink: ['#f6f8fc', '#eef2f9', '#e3e8f1', '#cfd7e4', '#98a5b8', '#556274', '#334155', '#2a3a52', '#1c2839', '#0e1624', '#070b14'],
134
134
  };
135
135
  const FONTS = ['Kanit', 'Sarabun', 'Prompt', 'Noto Sans Thai', 'IBM Plex Sans Thai', 'Anuphan', 'Inter', 'Roboto'];
136
+ /** Google Fonts families the presets, ng add and the Studio use, with the weights to ask for (the API refuses weights a family lacks). */
137
+ const GOOGLE_FONT_WEIGHTS = {
138
+ ...Object.fromEntries(FONTS.map((f) => [f, ':wght@400;500;600;700'])),
139
+ 'Noto Sans Thai Looped': ':wght@400;500;600;700',
140
+ 'Noto Serif Thai': ':wght@400;500;600;700',
141
+ Taviraj: ':wght@400;500;600;700',
142
+ Trirong: ':wght@400;500;600;700',
143
+ Pridi: ':wght@400;500;600;700',
144
+ Itim: '',
145
+ };
146
+ /**
147
+ * The Google Fonts stylesheet for the first family of a CSS `font-family` value (`"'Kanit', sans-serif"`), or `null` when
148
+ * it is not a family the themes know.
149
+ */
150
+ function googleFontHref(fontFamily) {
151
+ const name = fontFamily.split(',')[0].trim().replace(/^['"]|['"]$/g, '');
152
+ if (!Object.prototype.hasOwnProperty.call(GOOGLE_FONT_WEIGHTS, name))
153
+ return null;
154
+ return `https://fonts.googleapis.com/css2?family=${name.replace(/ /g, '+')}${GOOGLE_FONT_WEIGHTS[name]}&display=swap`;
155
+ }
136
156
  /** Density multiplies every padding a preset defines (1 = the preset's own spacing). */
137
157
  const DENSITY = {
138
158
  compact: 0.8,
@@ -215,7 +235,7 @@ const PRESETS = {
215
235
  material: { ...styled, family: 'material', label: 'Material', fontFamily: 'Roboto', primary: '#10b981', surface: 'slate', semantic: MATERIAL_SEMANTIC, radius: 6, shadow: 'material', ripple: true, focusRing: 'inset' },
216
236
  phet: { ...styled, family: 'phet', label: 'Phet', primary: '#10b981', surface: 'slate', semantic: PHET_SEMANTIC, radius: 6, shadow: 'phet', ripple: false, focusRing: 'bold', transition: 0 },
217
237
  // ---- v3: WiraUI's own ----
218
- wira: { family: 'wira', label: 'Wira', primary: '#1e7ae0', surface: 'ink', semantic: SEMANTIC_DEFAULTS, fontFamily: 'Kanit', fontSize: 14, lineHeight: 1.6, radius: 6, density: 'normal', shadow: 'subtle', ripple: false, focusRing: 'ring', transition: 150, scheme: 'light' },
238
+ wira: { family: 'wira', label: 'Wira', primary: '#1e7ae0', surface: 'ink', semantic: SEMANTIC_DEFAULTS, fontFamily: 'Kanit', fontSize: 14, lineHeight: 1.6, radius: 10, density: 'normal', shadow: 'soft', ripple: false, focusRing: 'ring', transition: 150, scheme: 'light' },
219
239
  lanna: { family: 'wira', label: 'Lanna', primary: '#0d9488', surface: 'stone', semantic: SEMANTIC_DEFAULTS, fontFamily: 'Sarabun', fontSize: 15, lineHeight: 1.7, radius: 12, density: 'comfortable', shadow: 'soft', ripple: false, focusRing: 'ring', transition: 200, scheme: 'light' },
220
240
  siam: { family: 'wira', label: 'Siam', primary: '#6366f1', surface: 'gray', semantic: SEMANTIC_DEFAULTS, fontFamily: 'Prompt', fontSize: 14, lineHeight: 1.6, radius: 4, density: 'normal', shadow: 'elevated', ripple: true, focusRing: 'outline', transition: 200, scheme: 'light' },
221
241
  nakhon: { family: 'wira', label: 'Nakhon', primary: '#3b82f6', surface: 'zinc', semantic: SEMANTIC_DEFAULTS, fontFamily: 'IBM Plex Sans Thai', fontSize: 13, lineHeight: 1.55, radius: 2, density: 'compact', shadow: 'none', ripple: false, focusRing: 'outline', transition: 100, scheme: 'light' },
@@ -679,6 +699,37 @@ function merge(...parts) {
679
699
  // ---------- Mali (the styled default) is the base every family starts from ----------
680
700
  const MALI = merge({
681
701
  light: {
702
+ // Titles (card, dialog, drawer, panel, fieldset, alert, empty state, result, error page): the body font unless a
703
+ // theme sets $heading-font-family / semantic.headingFontFamily, e.g. Kanit titles over IBM Plex Sans Thai text.
704
+ 'heading-font-family': v('font-family'),
705
+ // Components new in release 1. They follow the card, field and tag tokens, so every preset styles them.
706
+ 'stat-gap': '0.875rem',
707
+ 'stat-icon-size': '2.75rem',
708
+ 'stat-label-size': '0.875rem',
709
+ 'stat-value-size': '1.75rem',
710
+ 'stat-value-weight': '700',
711
+ 'descriptions-gap': '0.75rem 1.5rem',
712
+ 'descriptions-label-color': v('text-muted'),
713
+ 'descriptions-label-weight': '400',
714
+ 'descriptions-label-width': '9rem',
715
+ 'descriptions-bordered-label-bg': v('hover-bg'),
716
+ 'signature-height': '12rem',
717
+ 'signature-ink': v('text'),
718
+ 'signature-line': v('border'),
719
+ 'chat-height': '32rem',
720
+ 'chat-bubble-radius': '1.125rem',
721
+ 'chat-bubble-bg': v('hover-bg'),
722
+ 'chat-bubble-color': v('text'),
723
+ 'chat-mine-bg': v('primary-color'),
724
+ 'chat-mine-color': v('primary-contrast'),
725
+ 'chat-meta-color': v('text-muted'),
726
+ 'chat-gap': '0.25rem',
727
+ 'scheduler-hour-height': '3rem',
728
+ 'scheduler-border': v('border'),
729
+ 'scheduler-today-bg': 'color-mix(in srgb, var(--wu-primary-color) 7%, transparent)',
730
+ 'scheduler-event-bg': 'color-mix(in srgb, var(--wu-primary-color) 14%, var(--wu-card-bg))',
731
+ 'scheduler-event-color': v('primary-soft-text'),
732
+ 'scheduler-event-bar': v('primary-color'),
682
733
  'primary-color': p(500),
683
734
  'primary-hover': p(600),
684
735
  'primary-active': p(700),
@@ -788,6 +839,9 @@ const MALI = merge({
788
839
  'tag-padding-x': '0.5rem',
789
840
  'tag-gap': '0.25rem',
790
841
  'tag-fill': '0%',
842
+ // The soft look is the tag's colour at this strength over whatever is behind it, so it shows on white cards and
843
+ // grey pages alike (a fixed pale shade nearly vanished on a grey page).
844
+ 'tag-soft-mix': '14%',
791
845
  'badge-size': '1.5rem',
792
846
  'badge-font-size': '0.75rem',
793
847
  'badge-font-weight': '700',
@@ -2331,6 +2385,14 @@ const WIRA = merge(MALI, severities([600, 700, 800, 50, 800], [400, 300, 200, 40
2331
2385
  'spinner-color-2': v('primary-color'),
2332
2386
  'spinner-color-3': v('primary-color'),
2333
2387
  'spinner-color-4': v('primary-color'),
2388
+ // A lighter, current look: table heads without a band, in quiet text; the chosen menu item a soft tint of the
2389
+ // primary colour rather than a solid bar.
2390
+ 'table-head-bg': 'transparent',
2391
+ 'table-head-color': v('text-muted'),
2392
+ 'table-head-weight': '500',
2393
+ 'table-head-hover-bg': v('hover-bg'),
2394
+ 'aside-menu-item-active-bg': 'color-mix(in srgb, var(--wu-primary-color) 12%, transparent)',
2395
+ 'aside-menu-item-active-color': v('primary-color'),
2334
2396
  },
2335
2397
  dark: {
2336
2398
  'primary-soft': mix(p(400), 16, s(800)),
@@ -2780,6 +2842,10 @@ function setTokens(set, s950) {
2780
2842
  const f = sem.fontFamily;
2781
2843
  t.light['font-family'] = /[,'"]/.test(f) ? f : `'${f}', sans-serif`;
2782
2844
  }
2845
+ if (sem.headingFontFamily !== undefined) {
2846
+ const f = sem.headingFontFamily;
2847
+ t.light['heading-font-family'] = /[,'"]/.test(f) ? f : `'${f}', sans-serif`;
2848
+ }
2783
2849
  if (sem.fontSize !== undefined) {
2784
2850
  if (typeof sem.fontSize === 'number')
2785
2851
  mergeTokens(t, fontTokens({ fontSize: sem.fontSize }));
@@ -2807,8 +2873,29 @@ function setTokens(set, s950) {
2807
2873
  if (v !== undefined)
2808
2874
  mergeTokens(t, componentValue(spec, v));
2809
2875
  }
2876
+ const raw = set.tokens || {};
2877
+ for (const name of Object.keys(raw)) {
2878
+ if (!knownToken(name))
2879
+ throw new Error(`wiraui: unknown token ${name} (write the name without --wu-, e.g. 'table-header-bg')`);
2880
+ t.light[name] = String(raw[name]);
2881
+ }
2810
2882
  return t;
2811
2883
  }
2884
+ let tokenNames = null;
2885
+ /** Every token some preset defines, so a misspelt name in `tokens` is caught instead of silently doing nothing. */
2886
+ function knownToken(name) {
2887
+ if (!tokenNames) {
2888
+ tokenNames = new Set();
2889
+ for (const id of Object.keys(PRESETS)) {
2890
+ const t = computeTokens(defaults(id));
2891
+ for (const k of Object.keys(t.light))
2892
+ tokenNames.add(k);
2893
+ for (const k of Object.keys(t.dark))
2894
+ tokenNames.add(k);
2895
+ }
2896
+ }
2897
+ return tokenNames.has(name);
2898
+ }
2812
2899
  /**
2813
2900
  * Only the tokens an override set touches; derived tokens follow through `var()`.
2814
2901
  * With `scheme: 'dark'` (Sayan, Ratri, sila-dark-*) the dark values are the only values.
@@ -3526,6 +3613,39 @@ const TH_LOCALE = {
3526
3613
  characters: '{0} ตัวอักษร',
3527
3614
  content: 'เนื้อหา',
3528
3615
  },
3616
+ chat: {
3617
+ placeholder: 'พิมพ์ข้อความ',
3618
+ send: 'ส่ง',
3619
+ attach: 'แนบไฟล์',
3620
+ removeFile: 'เอาไฟล์ออก',
3621
+ typing: '{name} กำลังพิมพ์',
3622
+ typingMany: '{count} คนกำลังพิมพ์',
3623
+ read: 'อ่านแล้ว',
3624
+ readBy: 'อ่านแล้ว {count}',
3625
+ today: 'วันนี้',
3626
+ yesterday: 'เมื่อวาน',
3627
+ closed: 'ปิดการสนทนาแล้ว',
3628
+ emptyTitle: 'ยังไม่มีข้อความ',
3629
+ emptyDescription: 'เริ่มพิมพ์ข้อความด้านล่าง',
3630
+ loadMore: 'ดูข้อความก่อนหน้า',
3631
+ failed: 'ส่งไม่สำเร็จ',
3632
+ retry: 'ส่งอีกครั้ง',
3633
+ newMessages: 'ข้อความใหม่',
3634
+ messages: 'ข้อความ',
3635
+ },
3636
+ signaturePad: { label: 'ช่องเซ็นชื่อ', hint: 'เซ็นชื่อในกรอบนี้', clear: 'ล้าง', undo: 'ย้อนกลับ' },
3637
+ scheduler: {
3638
+ today: 'วันนี้',
3639
+ previous: 'ก่อนหน้า',
3640
+ next: 'ถัดไป',
3641
+ day: 'วัน',
3642
+ week: 'สัปดาห์',
3643
+ month: 'เดือน',
3644
+ allDay: 'ทั้งวัน',
3645
+ more: 'อีก {count} รายการ',
3646
+ noEvents: 'ไม่มีนัดหมาย',
3647
+ },
3648
+ stat: { up: 'เพิ่มขึ้น', down: 'ลดลง', same: 'เท่าเดิม' },
3529
3649
  };
3530
3650
  const EN_LOCALE = {
3531
3651
  code: 'en',
@@ -3851,6 +3971,39 @@ const EN_LOCALE = {
3851
3971
  characters: '{0} characters',
3852
3972
  content: 'Content',
3853
3973
  },
3974
+ chat: {
3975
+ placeholder: 'Type a message',
3976
+ send: 'Send',
3977
+ attach: 'Attach files',
3978
+ removeFile: 'Remove file',
3979
+ typing: '{name} is typing',
3980
+ typingMany: '{count} people are typing',
3981
+ read: 'Read',
3982
+ readBy: 'Read by {count}',
3983
+ today: 'Today',
3984
+ yesterday: 'Yesterday',
3985
+ closed: 'This conversation is closed',
3986
+ emptyTitle: 'No messages yet',
3987
+ emptyDescription: 'Start typing below',
3988
+ loadMore: 'Earlier messages',
3989
+ failed: 'Not sent',
3990
+ retry: 'Send again',
3991
+ newMessages: 'New messages',
3992
+ messages: 'Messages',
3993
+ },
3994
+ signaturePad: { label: 'Signature', hint: 'Sign in the box', clear: 'Clear', undo: 'Undo' },
3995
+ scheduler: {
3996
+ today: 'Today',
3997
+ previous: 'Previous',
3998
+ next: 'Next',
3999
+ day: 'Day',
4000
+ week: 'Week',
4001
+ month: 'Month',
4002
+ allDay: 'All day',
4003
+ more: '+{count} more',
4004
+ noEvents: 'No events',
4005
+ },
4006
+ stat: { up: 'Up', down: 'Down', same: 'No change' },
3854
4007
  };
3855
4008
  const LOCALES = { th: TH_LOCALE, en: EN_LOCALE };
3856
4009
 
@@ -13363,5 +13516,5 @@ function radarModel(o, model, palette) {
13363
13516
  * Generated bundle index. Do not edit.
13364
13517
  */
13365
13518
 
13366
- export { Arun, BUDDHIST_OFFSET, CHART_PALETTE, CHART_VARIANTS, CLASSIC_THEMES, COMPONENT_TOKENS, CONFIG_MARKER, CORE_VERSION, DENSITY, DatePickerState, EDITOR_COLORS, EDITOR_FONT_SIZES, EDITOR_HIGHLIGHTS, EDITOR_TOOLBARS, EDITOR_TOOLS, EN_LOCALE, EXCEL_MIME, EditorHistory, FAMILIES, FAMILY_GENERATION, FLOW_DEFAULT_VIEWPORT, FLOW_EDGE_TYPES, FLOW_MARKER_REF, FLOW_MARKER_VIEWBOX, FLOW_TEXT_KEYS, FOCUS_STYLES, FONTS, FlowHistory, Glass, KNOB_MAX_RADIANS, KNOB_MIN_RADIANS, LANGUAGE_NAMES, LAYER_ORDER, LL, LOCALES, Lanna, ListState, MAX_CANVAS_AREA, Mali, Material, MaterialClassic, Nakhon, PALETTE_BASES, PRESETS, PRESET_IDS, PRESET_LIST, PRESET_NAMES, PRIMARY_SWATCHES, Phet, Ratri, SCALAR_FIELDS, SEMANTIC_DEFAULTS, SEMANTIC_KEYS, SHADES, SHADE_MIX, SHADOWS, STYLED_INPUTS, SURFACES, SURFACE_DARK_REF, Sayan, Siam, Sila, SilaClassic, TH_LOCALE, TINT, VERSION_CATALOG, Wira, WiraKawaii, absolutePosition, absolutePositions, acceptsFile, acceptsNumberInput, acceptsNumberText, addDays, addEdge, addMonths, alignmentGuides, apcaContrast, applyEdgeChanges, applyMatrix, applyNodeChanges, arcLine, arcPath, areaPath, arrowStep, autoPanVelocity, backgroundPattern, bahtText, bandPath, bands, barPath, base64ToFile, bestOn, boxSelection, boxStats, boxToRect, buildExcel, buildExcelSync, calendarWeeks, caretAfter, carouselClampPage, carouselFirst, carouselIsCircular, carouselLayout, carouselPageCount, carouselRepage, carouselStep, changeCount, chartHit, chartModel, chartMovesValues, chartSeriesFrom, chartSwapTypes, chartVariants, checkFile, clampCrop, clampDate, clampNumber, clampPosition, clampTimeField, clampView, clampZoom, classicDateFormat, clickSelection, collectMarkers, compareDays, compareValues, compatAliases, componentValue, computeNodeZ, computeTokens, connectionBetween, constrainViewport, contrast, countCrossings, crc32, cropArea, cropHeight, cropSizeRange, cropWidth, cropperToolbarGroups, cubicPoint, datePattern, dayNumber, daysInMonth, decimalSeparator, defaults, defineOverrides, definePreset, densityTokens, diff, diffItems, displayYear, dockScale, dragPositions, dragRoots, easeInOutCubic, edgeZIndex, editableNumber, editorCounts, editorHtmlToText, editorToolOptions, editorToolbarGroups, emptyTokens, estimateTextWidth, excelColor, excelColumnName, excelDateNumber, excelParseRange, excelParseRef, excelParts, excelRef, excelSheetFromRows, excelSheetNames, exifTransform, expandParentBox, expandRect, fillMask, filterColumns, filterGlobal, filterItems, filterListItems, filterTree, findHandle, firstIndex, fitArc, flattenMessages, flowClamp, flowDeepEqual, flowEdgeId, flowEdgeName, flowFormat, flowFromJSON, flowHistoryKey, flowNodeName, flowText, flowToJSON, flowToScreen, flowToSvg, fmt, focusTokens, fontTokens, formatChartValue, formatColor, formatDate, formatFileSize, formatMask, formatNumber, formatThaiId, formatThaiPhone, fractionDigits, from12Hour, fromBuddhistYear, fromThaiDigits, generatePalette, getBezierPath, getBoundsOfRects, getConnectedEdges, getDescendants, getEdgeCenter, getEdgeEnds, getEdgePath, getEdgePathWithRoom, getElementsToRemove, getIncomers, getIntersectingNodes, getNodesBounds, getNodesInside, getOutgoers, getSimpleBezierPath, getSmoothStepPath, getStepPath, getStepPoints, getStraightPath, getViewportForBounds, getVisibleNodeIds, growCrop, handleConnectionCount, handleIsFull, handlePoint, handlesCompatible, hasSize, hexToRgb, hsbToHex, hsbToRgb, httpErrorActions, httpErrorCode, httpErrorKind, httpErrorTextKey, imageCompareAt, imageCompareClamp, imageCompareKey, inListOrder, indexOfValue, initialCrop, interpolate, interpolateViewport, isDaySelectable, isEdge, isEdgeVisible, isEmptyEditorHtml, isFlowPosition, isHex, isImageFile, isMonthSelectable, isNode, isPalette, isPresetId, isThaiPhone, isThemeName, isThemePreset, isTypingTarget, isValidDate, isValidThaiId, isYearSelectable, keyMatches, knobClamp, knobPaths, knobSnap, knobText, knobValueAt, lastFilled, lastIndex, layoutFlow, layoutHandlePositions, layoutTree, linePath, listFilterFields, listIndexes, listSame, luminance, markerId, markerLength, markerShape, maskComplete, maskEmpty, matchLanguage, matchValue, materialTokens, menuFirst, menuFocusable, menuHasSubmenu, menuItemAt, menuKey, menuKeyPath, menuLast, menuStep, menuTypeahead, menuVisible, mergeExcelStyles, mergeTokens, minimapLayout, minimapMaskPath, minimapToFlow, mix$1 as mix, monotonePath, moveBottom, moveCrop, moveDay, moveDown, moveItemsTo, moveTop, moveUp, multiKeyHeld, nearestHandle, niceScale, niceStep, nodeDepth$1 as nodeDepth, nodeLookup, nodeRect, nodeSize, normalize, normalizeAngle, normalizeCrop, normalizeExtent, normalizeMarker, normalizeViewport, oppositePosition, optionField, orgChartIsLeaf, orgChartIsOpen, orgChartIsSelected, orgChartKey, orgChartToggleSelection, orgChartVisible, orientationMatrix, otpAccepts, otpCleanPaste, otpFill, otpTokens, otpValue, outputSize, overlapArea, overridesToTokens, padToRatio, paddingPx, pageInfo, pageLinks, pageReport, palette, panBy, panCrop, parentGrowth, parseAspectRatio, parseColor, parseDate, parseImport, parseLooseDate, parseMask, parseNumber, parseTypedDate, pastThreshold, pickLanguage, placeInOrder, pointInRect, polar, polylineMidpoint, positionVector, presetExportName, presetToTokens, presetsFor, primaryPaletteOf, primaryTokens, radiusTokens, rangeKeyValue, readExifOrientation, readTimeField, reconnectEdge, rectCenter, rectContains, rectFromPoints, rectToBox, rectsIntersect, relaxLabels, remapCrop, remapPoint, resizeBox, resizeCrop, rgbToHex, rgbToHsb, rotateOrientation, rotatedSize, roundChannel, roundCrop, roundedPolylinePath, safeEditorImage, safeEditorUrl, sameCrop, sameDay, sameFile, sameHandle, sameNode, sameValue, sameViewport, scaleLinear, screenToFlow, searchText, selectItems, selectionChanges, semanticTokens, shadowTokens, sidePoint, simplifyPolyline, snapPosition, sortNodesParentsFirst, sortRows, splitDates, splitterBasis, splitterPercent, splitterReadState, splitterResize, splitterSizes, squarify, startOfDay, stepIndex, stepNumber, surfacePalette, surfaceTokens, terminalCommandName, terminalHistoryAdd, terminalHistoryMove, terminalIsClear, thaiIdCheckDigit, thaiNumberText, themeConfig, themePreset, timeAgo, timeFieldRange, timeFormat, timeTicks, to12Hour, toBuddhistYear, toCSS, toDate, toDateValue, toJSON, toSCSS, toTSOverrides, toTSPreset, toThaiDigits, toggleTreeCheck, tokensToCss, tokensToStyle, transferItems, transitionTokens, translateKey, treeCheckStates, treeParents, typeaheadIndex, typedBefore, unmaskedValue, updateEdge, validConnection, validationMessage, viewRect, viewWindow, viewportForCenter, walkTree, weekdayOrder, wheelDeltaPx, wheelZoomFactor, wrapStep, yearPage, zipFiles, zipFilesSync, zoomAt, zoomCrop };
13519
+ export { Arun, BUDDHIST_OFFSET, CHART_PALETTE, CHART_VARIANTS, CLASSIC_THEMES, COMPONENT_TOKENS, CONFIG_MARKER, CORE_VERSION, DENSITY, DatePickerState, EDITOR_COLORS, EDITOR_FONT_SIZES, EDITOR_HIGHLIGHTS, EDITOR_TOOLBARS, EDITOR_TOOLS, EN_LOCALE, EXCEL_MIME, EditorHistory, FAMILIES, FAMILY_GENERATION, FLOW_DEFAULT_VIEWPORT, FLOW_EDGE_TYPES, FLOW_MARKER_REF, FLOW_MARKER_VIEWBOX, FLOW_TEXT_KEYS, FOCUS_STYLES, FONTS, FlowHistory, Glass, KNOB_MAX_RADIANS, KNOB_MIN_RADIANS, LANGUAGE_NAMES, LAYER_ORDER, LL, LOCALES, Lanna, ListState, MAX_CANVAS_AREA, Mali, Material, MaterialClassic, Nakhon, PALETTE_BASES, PRESETS, PRESET_IDS, PRESET_LIST, PRESET_NAMES, PRIMARY_SWATCHES, Phet, Ratri, SCALAR_FIELDS, SEMANTIC_DEFAULTS, SEMANTIC_KEYS, SHADES, SHADE_MIX, SHADOWS, STYLED_INPUTS, SURFACES, SURFACE_DARK_REF, Sayan, Siam, Sila, SilaClassic, TH_LOCALE, TINT, VERSION_CATALOG, Wira, WiraKawaii, absolutePosition, absolutePositions, acceptsFile, acceptsNumberInput, acceptsNumberText, addDays, addEdge, addMonths, alignmentGuides, apcaContrast, applyEdgeChanges, applyMatrix, applyNodeChanges, arcLine, arcPath, areaPath, arrowStep, autoPanVelocity, backgroundPattern, bahtText, bandPath, bands, barPath, base64ToFile, bestOn, boxSelection, boxStats, boxToRect, buildExcel, buildExcelSync, calendarWeeks, caretAfter, carouselClampPage, carouselFirst, carouselIsCircular, carouselLayout, carouselPageCount, carouselRepage, carouselStep, changeCount, chartHit, chartModel, chartMovesValues, chartSeriesFrom, chartSwapTypes, chartVariants, checkFile, clampCrop, clampDate, clampNumber, clampPosition, clampTimeField, clampView, clampZoom, classicDateFormat, clickSelection, collectMarkers, compareDays, compareValues, compatAliases, componentValue, computeNodeZ, computeTokens, connectionBetween, constrainViewport, contrast, countCrossings, crc32, cropArea, cropHeight, cropSizeRange, cropWidth, cropperToolbarGroups, cubicPoint, datePattern, dayNumber, daysInMonth, decimalSeparator, defaults, defineOverrides, definePreset, densityTokens, diff, diffItems, displayYear, dockScale, dragPositions, dragRoots, easeInOutCubic, edgeZIndex, editableNumber, editorCounts, editorHtmlToText, editorToolOptions, editorToolbarGroups, emptyTokens, estimateTextWidth, excelColor, excelColumnName, excelDateNumber, excelParseRange, excelParseRef, excelParts, excelRef, excelSheetFromRows, excelSheetNames, exifTransform, expandParentBox, expandRect, fillMask, filterColumns, filterGlobal, filterItems, filterListItems, filterTree, findHandle, firstIndex, fitArc, flattenMessages, flowClamp, flowDeepEqual, flowEdgeId, flowEdgeName, flowFormat, flowFromJSON, flowHistoryKey, flowNodeName, flowText, flowToJSON, flowToScreen, flowToSvg, fmt, focusTokens, fontTokens, formatChartValue, formatColor, formatDate, formatFileSize, formatMask, formatNumber, formatThaiId, formatThaiPhone, fractionDigits, from12Hour, fromBuddhistYear, fromThaiDigits, generatePalette, getBezierPath, getBoundsOfRects, getConnectedEdges, getDescendants, getEdgeCenter, getEdgeEnds, getEdgePath, getEdgePathWithRoom, getElementsToRemove, getIncomers, getIntersectingNodes, getNodesBounds, getNodesInside, getOutgoers, getSimpleBezierPath, getSmoothStepPath, getStepPath, getStepPoints, getStraightPath, getViewportForBounds, getVisibleNodeIds, googleFontHref, growCrop, handleConnectionCount, handleIsFull, handlePoint, handlesCompatible, hasSize, hexToRgb, hsbToHex, hsbToRgb, httpErrorActions, httpErrorCode, httpErrorKind, httpErrorTextKey, imageCompareAt, imageCompareClamp, imageCompareKey, inListOrder, indexOfValue, initialCrop, interpolate, interpolateViewport, isDaySelectable, isEdge, isEdgeVisible, isEmptyEditorHtml, isFlowPosition, isHex, isImageFile, isMonthSelectable, isNode, isPalette, isPresetId, isThaiPhone, isThemeName, isThemePreset, isTypingTarget, isValidDate, isValidThaiId, isYearSelectable, keyMatches, knobClamp, knobPaths, knobSnap, knobText, knobValueAt, lastFilled, lastIndex, layoutFlow, layoutHandlePositions, layoutTree, linePath, listFilterFields, listIndexes, listSame, luminance, markerId, markerLength, markerShape, maskComplete, maskEmpty, matchLanguage, matchValue, materialTokens, menuFirst, menuFocusable, menuHasSubmenu, menuItemAt, menuKey, menuKeyPath, menuLast, menuStep, menuTypeahead, menuVisible, mergeExcelStyles, mergeTokens, minimapLayout, minimapMaskPath, minimapToFlow, mix$1 as mix, monotonePath, moveBottom, moveCrop, moveDay, moveDown, moveItemsTo, moveTop, moveUp, multiKeyHeld, nearestHandle, niceScale, niceStep, nodeDepth$1 as nodeDepth, nodeLookup, nodeRect, nodeSize, normalize, normalizeAngle, normalizeCrop, normalizeExtent, normalizeMarker, normalizeViewport, oppositePosition, optionField, orgChartIsLeaf, orgChartIsOpen, orgChartIsSelected, orgChartKey, orgChartToggleSelection, orgChartVisible, orientationMatrix, otpAccepts, otpCleanPaste, otpFill, otpTokens, otpValue, outputSize, overlapArea, overridesToTokens, padToRatio, paddingPx, pageInfo, pageLinks, pageReport, palette, panBy, panCrop, parentGrowth, parseAspectRatio, parseColor, parseDate, parseImport, parseLooseDate, parseMask, parseNumber, parseTypedDate, pastThreshold, pickLanguage, placeInOrder, pointInRect, polar, polylineMidpoint, positionVector, presetExportName, presetToTokens, presetsFor, primaryPaletteOf, primaryTokens, radiusTokens, rangeKeyValue, readExifOrientation, readTimeField, reconnectEdge, rectCenter, rectContains, rectFromPoints, rectToBox, rectsIntersect, relaxLabels, remapCrop, remapPoint, resizeBox, resizeCrop, rgbToHex, rgbToHsb, rotateOrientation, rotatedSize, roundChannel, roundCrop, roundedPolylinePath, safeEditorImage, safeEditorUrl, sameCrop, sameDay, sameFile, sameHandle, sameNode, sameValue, sameViewport, scaleLinear, screenToFlow, searchText, selectItems, selectionChanges, semanticTokens, shadowTokens, sidePoint, simplifyPolyline, snapPosition, sortNodesParentsFirst, sortRows, splitDates, splitterBasis, splitterPercent, splitterReadState, splitterResize, splitterSizes, squarify, startOfDay, stepIndex, stepNumber, surfacePalette, surfaceTokens, terminalCommandName, terminalHistoryAdd, terminalHistoryMove, terminalIsClear, thaiIdCheckDigit, thaiNumberText, themeConfig, themePreset, timeAgo, timeFieldRange, timeFormat, timeTicks, to12Hour, toBuddhistYear, toCSS, toDate, toDateValue, toJSON, toSCSS, toTSOverrides, toTSPreset, toThaiDigits, toggleTreeCheck, tokensToCss, tokensToStyle, transferItems, transitionTokens, translateKey, treeCheckStates, treeParents, typeaheadIndex, typedBefore, unmaskedValue, updateEdge, validConnection, validationMessage, viewRect, viewWindow, viewportForCenter, walkTree, weekdayOrder, wheelDeltaPx, wheelZoomFactor, wrapStep, yearPage, zipFiles, zipFilesSync, zoomAt, zoomCrop };
13367
13520
  //# sourceMappingURL=wirabyte-ui-core.mjs.map