@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
@@ -77,6 +77,37 @@ function merge(...parts) {
77
77
  // ---------- Mali (the styled default) is the base every family starts from ----------
78
78
  const MALI = merge({
79
79
  light: {
80
+ // Titles (card, dialog, drawer, panel, fieldset, alert, empty state, result, error page): the body font unless a
81
+ // theme sets $heading-font-family / semantic.headingFontFamily, e.g. Kanit titles over IBM Plex Sans Thai text.
82
+ 'heading-font-family': v('font-family'),
83
+ // Components new in release 1. They follow the card, field and tag tokens, so every preset styles them.
84
+ 'stat-gap': '0.875rem',
85
+ 'stat-icon-size': '2.75rem',
86
+ 'stat-label-size': '0.875rem',
87
+ 'stat-value-size': '1.75rem',
88
+ 'stat-value-weight': '700',
89
+ 'descriptions-gap': '0.75rem 1.5rem',
90
+ 'descriptions-label-color': v('text-muted'),
91
+ 'descriptions-label-weight': '400',
92
+ 'descriptions-label-width': '9rem',
93
+ 'descriptions-bordered-label-bg': v('hover-bg'),
94
+ 'signature-height': '12rem',
95
+ 'signature-ink': v('text'),
96
+ 'signature-line': v('border'),
97
+ 'chat-height': '32rem',
98
+ 'chat-bubble-radius': '1.125rem',
99
+ 'chat-bubble-bg': v('hover-bg'),
100
+ 'chat-bubble-color': v('text'),
101
+ 'chat-mine-bg': v('primary-color'),
102
+ 'chat-mine-color': v('primary-contrast'),
103
+ 'chat-meta-color': v('text-muted'),
104
+ 'chat-gap': '0.25rem',
105
+ 'scheduler-hour-height': '3rem',
106
+ 'scheduler-border': v('border'),
107
+ 'scheduler-today-bg': 'color-mix(in srgb, var(--wu-primary-color) 7%, transparent)',
108
+ 'scheduler-event-bg': 'color-mix(in srgb, var(--wu-primary-color) 14%, var(--wu-card-bg))',
109
+ 'scheduler-event-color': v('primary-soft-text'),
110
+ 'scheduler-event-bar': v('primary-color'),
80
111
  'primary-color': p(500),
81
112
  'primary-hover': p(600),
82
113
  'primary-active': p(700),
@@ -186,6 +217,9 @@ const MALI = merge({
186
217
  'tag-padding-x': '0.5rem',
187
218
  'tag-gap': '0.25rem',
188
219
  'tag-fill': '0%',
220
+ // The soft look is the tag's colour at this strength over whatever is behind it, so it shows on white cards and
221
+ // grey pages alike (a fixed pale shade nearly vanished on a grey page).
222
+ 'tag-soft-mix': '14%',
189
223
  'badge-size': '1.5rem',
190
224
  'badge-font-size': '0.75rem',
191
225
  'badge-font-weight': '700',
@@ -1729,6 +1763,14 @@ const WIRA = merge(MALI, severities([600, 700, 800, 50, 800], [400, 300, 200, 40
1729
1763
  'spinner-color-2': v('primary-color'),
1730
1764
  'spinner-color-3': v('primary-color'),
1731
1765
  'spinner-color-4': v('primary-color'),
1766
+ // A lighter, current look: table heads without a band, in quiet text; the chosen menu item a soft tint of the
1767
+ // primary colour rather than a solid bar.
1768
+ 'table-head-bg': 'transparent',
1769
+ 'table-head-color': v('text-muted'),
1770
+ 'table-head-weight': '500',
1771
+ 'table-head-hover-bg': v('hover-bg'),
1772
+ 'aside-menu-item-active-bg': 'color-mix(in srgb, var(--wu-primary-color) 12%, transparent)',
1773
+ 'aside-menu-item-active-color': v('primary-color'),
1732
1774
  },
1733
1775
  dark: {
1734
1776
  'primary-soft': mix(p(400), 16, s(800)),
@@ -124,6 +124,10 @@ function setTokens(set, s950) {
124
124
  const f = sem.fontFamily;
125
125
  t.light['font-family'] = /[,'"]/.test(f) ? f : `'${f}', sans-serif`;
126
126
  }
127
+ if (sem.headingFontFamily !== undefined) {
128
+ const f = sem.headingFontFamily;
129
+ t.light['heading-font-family'] = /[,'"]/.test(f) ? f : `'${f}', sans-serif`;
130
+ }
127
131
  if (sem.fontSize !== undefined) {
128
132
  if (typeof sem.fontSize === 'number')
129
133
  (0, tokens_1.mergeTokens)(t, (0, tokens_1.fontTokens)({ fontSize: sem.fontSize }));
@@ -151,8 +155,29 @@ function setTokens(set, s950) {
151
155
  if (v !== undefined)
152
156
  (0, tokens_1.mergeTokens)(t, (0, tokens_1.componentValue)(spec, v));
153
157
  }
158
+ const raw = set.tokens || {};
159
+ for (const name of Object.keys(raw)) {
160
+ if (!knownToken(name))
161
+ throw new Error(`wiraui: unknown token ${name} (write the name without --wu-, e.g. 'table-header-bg')`);
162
+ t.light[name] = String(raw[name]);
163
+ }
154
164
  return t;
155
165
  }
166
+ let tokenNames = null;
167
+ /** Every token some preset defines, so a misspelt name in `tokens` is caught instead of silently doing nothing. */
168
+ function knownToken(name) {
169
+ if (!tokenNames) {
170
+ tokenNames = new Set();
171
+ for (const id of Object.keys(catalog_1.PRESETS)) {
172
+ const t = (0, tokens_1.computeTokens)((0, config_1.defaults)(id));
173
+ for (const k of Object.keys(t.light))
174
+ tokenNames.add(k);
175
+ for (const k of Object.keys(t.dark))
176
+ tokenNames.add(k);
177
+ }
178
+ }
179
+ return tokenNames.has(name);
180
+ }
156
181
  /**
157
182
  * Only the tokens an override set touches; derived tokens follow through `var()`.
158
183
  * With `scheme: 'dark'` (Sayan, Ratri, sila-dark-*) the dark values are the only values.
@@ -325,6 +325,39 @@ exports.TH_LOCALE = {
325
325
  characters: '{0} ตัวอักษร',
326
326
  content: 'เนื้อหา',
327
327
  },
328
+ chat: {
329
+ placeholder: 'พิมพ์ข้อความ',
330
+ send: 'ส่ง',
331
+ attach: 'แนบไฟล์',
332
+ removeFile: 'เอาไฟล์ออก',
333
+ typing: '{name} กำลังพิมพ์',
334
+ typingMany: '{count} คนกำลังพิมพ์',
335
+ read: 'อ่านแล้ว',
336
+ readBy: 'อ่านแล้ว {count}',
337
+ today: 'วันนี้',
338
+ yesterday: 'เมื่อวาน',
339
+ closed: 'ปิดการสนทนาแล้ว',
340
+ emptyTitle: 'ยังไม่มีข้อความ',
341
+ emptyDescription: 'เริ่มพิมพ์ข้อความด้านล่าง',
342
+ loadMore: 'ดูข้อความก่อนหน้า',
343
+ failed: 'ส่งไม่สำเร็จ',
344
+ retry: 'ส่งอีกครั้ง',
345
+ newMessages: 'ข้อความใหม่',
346
+ messages: 'ข้อความ',
347
+ },
348
+ signaturePad: { label: 'ช่องเซ็นชื่อ', hint: 'เซ็นชื่อในกรอบนี้', clear: 'ล้าง', undo: 'ย้อนกลับ' },
349
+ scheduler: {
350
+ today: 'วันนี้',
351
+ previous: 'ก่อนหน้า',
352
+ next: 'ถัดไป',
353
+ day: 'วัน',
354
+ week: 'สัปดาห์',
355
+ month: 'เดือน',
356
+ allDay: 'ทั้งวัน',
357
+ more: 'อีก {count} รายการ',
358
+ noEvents: 'ไม่มีนัดหมาย',
359
+ },
360
+ stat: { up: 'เพิ่มขึ้น', down: 'ลดลง', same: 'เท่าเดิม' },
328
361
  };
329
362
  exports.EN_LOCALE = {
330
363
  code: 'en',
@@ -650,5 +683,38 @@ exports.EN_LOCALE = {
650
683
  characters: '{0} characters',
651
684
  content: 'Content',
652
685
  },
686
+ chat: {
687
+ placeholder: 'Type a message',
688
+ send: 'Send',
689
+ attach: 'Attach files',
690
+ removeFile: 'Remove file',
691
+ typing: '{name} is typing',
692
+ typingMany: '{count} people are typing',
693
+ read: 'Read',
694
+ readBy: 'Read by {count}',
695
+ today: 'Today',
696
+ yesterday: 'Yesterday',
697
+ closed: 'This conversation is closed',
698
+ emptyTitle: 'No messages yet',
699
+ emptyDescription: 'Start typing below',
700
+ loadMore: 'Earlier messages',
701
+ failed: 'Not sent',
702
+ retry: 'Send again',
703
+ newMessages: 'New messages',
704
+ messages: 'Messages',
705
+ },
706
+ signaturePad: { label: 'Signature', hint: 'Sign in the box', clear: 'Clear', undo: 'Undo' },
707
+ scheduler: {
708
+ today: 'Today',
709
+ previous: 'Previous',
710
+ next: 'Next',
711
+ day: 'Day',
712
+ week: 'Week',
713
+ month: 'Month',
714
+ allDay: 'All day',
715
+ more: '+{count} more',
716
+ noEvents: 'No events',
717
+ },
718
+ stat: { up: 'Up', down: 'Down', same: 'No change' },
653
719
  };
654
720
  exports.LOCALES = { th: exports.TH_LOCALE, en: exports.EN_LOCALE };
@@ -119,7 +119,9 @@ function ngAdd(options) {
119
119
  }
120
120
  }
121
121
  const [locale, calendar] = options.locale === 'en' ? ['en', 'gregorian'] : options.locale === 'th-gregorian' ? ['th', 'gregorian'] : ['th', 'buddhist'];
122
- const provider = `provideWiraUI({ overrides: wiraOverrides, locale: '${locale}', calendar: '${calendar}', darkMode: '${options.darkMode}' })`;
122
+ // --font=none: the app brings its own font files, so the theme must not fetch any from Google either.
123
+ const fonts = options.font === 'none' ? ", fonts: 'none'" : '';
124
+ const provider = `provideWiraUI({ overrides: wiraOverrides, locale: '${locale}', calendar: '${calendar}', darkMode: '${options.darkMode}'${fonts} })`;
123
125
  done.push(structure === 'module' ? addToModule(tree, project, themeDir, provider) : addToStandalone(tree, project, themeDir, provider));
124
126
  if (options.font !== 'none')
125
127
  done.push(addFont(tree, project, fontChoice || config.fontFamily));
@@ -27,6 +27,15 @@ export declare class WuSelectButton implements ControlValueAccessor {
27
27
  readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
28
28
  /** `small` or `large` (also `sm` / `lg`). */
29
29
  readonly size: import("@angular/core").InputSignal<WuSize | undefined>;
30
+ /**
31
+ * `'chips'`: each option its own pill with space around it, for filters with many options (and a count in the item
32
+ * template): rows wrap cleanly instead of breaking a joined bar. Default: the joined bar.
33
+ */
34
+ readonly variant: import("@angular/core").InputSignal<"default" | "chips" | "cards" | null | undefined>;
35
+ /** `variant="cards"`: the option field with the card's icon class. Default `'icon'`. */
36
+ readonly optionIcon: import("@angular/core").InputSignal<string>;
37
+ /** `variant="cards"`: the option field with the line under the title. Default `'description'`. */
38
+ readonly optionDescription: import("@angular/core").InputSignal<string>;
30
39
  readonly sizeKey: import("@angular/core").Signal<"sm" | "lg" | null>;
31
40
  readonly ariaLabelledBy: import("@angular/core").InputSignal<string | undefined>;
32
41
  readonly onChange: import("@angular/core").OutputEmitterRef<WuSelectButtonChangeEvent>;
@@ -45,6 +54,8 @@ export declare class WuSelectButton implements ControlValueAccessor {
45
54
  readonly classes: import("@angular/core").Signal<string>;
46
55
  readonly baseClasses: import("@angular/core").Signal<string>;
47
56
  constructor();
57
+ iconOf(option: unknown): string;
58
+ descriptionOf(option: unknown): string;
48
59
  labelOf(option: unknown): string;
49
60
  isOptionDisabled(option: unknown): boolean;
50
61
  isSelected(option: unknown): boolean;
@@ -55,5 +66,5 @@ export declare class WuSelectButton implements ControlValueAccessor {
55
66
  registerOnTouched(fn: () => void): void;
56
67
  setDisabledState(disabled: boolean): void;
57
68
  static ɵfac: i0.ɵɵFactoryDeclaration<WuSelectButton, never>;
58
- static ɵcmp: i0.ɵɵComponentDeclaration<WuSelectButton, "wu-selectbutton, wu-selectButton, wu-select-button", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "allowEmpty": { "alias": "allowEmpty"; "required": false; "isSignal": true; }; "unselectable": { "alias": "unselectable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "onChange": "onChange"; "onOptionClick": "onOptionClick"; }, ["slotTemplates", "itemRef"], never, true, never>;
69
+ static ɵcmp: i0.ɵɵComponentDeclaration<WuSelectButton, "wu-selectbutton, wu-selectButton, wu-select-button", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "allowEmpty": { "alias": "allowEmpty"; "required": false; "isSignal": true; }; "unselectable": { "alias": "unselectable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "optionIcon": { "alias": "optionIcon"; "required": false; "isSignal": true; }; "optionDescription": { "alias": "optionDescription"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; }, { "onChange": "onChange"; "onOptionClick": "onOptionClick"; }, ["slotTemplates", "itemRef"], never, true, never>;
59
70
  }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@wirabyte/ui/signaturepad" />
5
+ export * from './public-api';
@@ -0,0 +1,2 @@
1
+ export * from './signaturepad.component';
2
+ export * from './signaturepad.module';
@@ -0,0 +1,98 @@
1
+ import { AfterViewInit, EventEmitter, OnDestroy } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * A box to sign in, for forms: `<wu-signature-pad [(ngModel)]="signature">`. Draw with a mouse, a pen (pressure makes
6
+ * the line thicker) or a finger. The value is a PNG data URL of the drawing (`null` while empty), so it can be shown in
7
+ * an `<img>` or sent as it is; a data URL written into the control is drawn back. Clear and undo buttons sit in the
8
+ * corner, a line shows where to sign, and the drawing survives the box being resized.
9
+ */
10
+ export declare class WuSignaturePad implements AfterViewInit, ControlValueAccessor, OnDestroy {
11
+ /** Height of the box in px. Default: the theme's (`--wu-signature-height`, 12rem). */
12
+ height?: number | string | null;
13
+ /** Ink colour. Default: the theme's text colour. */
14
+ penColor?: string | null;
15
+ /** Line width in px at normal pressure. Default 2.5. */
16
+ set penWidth(v: unknown);
17
+ get penWidth(): number;
18
+ /** A background painted into the exported PNG, e.g. `'#ffffff'` for documents. Default: transparent. */
19
+ exportBackground?: string | null;
20
+ /** The text inside the empty box. Default: the locale's "Sign in the box". */
21
+ placeholder?: string | null;
22
+ /** `false` hides the line to sign on. */
23
+ set showGuide(v: unknown);
24
+ get showGuide(): boolean;
25
+ /** `false` hides the clear and undo buttons (call `clear()` / `undo()` yourself). */
26
+ set showButtons(v: unknown);
27
+ get showButtons(): boolean;
28
+ set disabled(v: unknown);
29
+ get disabled(): boolean;
30
+ set invalid(v: unknown);
31
+ get invalid(): boolean;
32
+ ariaLabel?: string | null;
33
+ styleClass?: string | null;
34
+ style?: Record<string, any> | string | null;
35
+ /** A stroke began. */
36
+ readonly onBegin: EventEmitter<PointerEvent>;
37
+ /** A stroke ended; the value has been updated. */
38
+ readonly onEnd: EventEmitter<string | null>;
39
+ readonly onClear: EventEmitter<void>;
40
+ private canvasRef;
41
+ /** True while nothing is drawn. */
42
+ empty: boolean;
43
+ private strokes;
44
+ private current;
45
+ /** A drawing that came in as a value; strokes are drawn over it. */
46
+ private base;
47
+ private _penWidth;
48
+ private _guide;
49
+ private _buttons;
50
+ private _disabled;
51
+ private _invalid;
52
+ private formDisabled;
53
+ private width;
54
+ private observer?;
55
+ private onChange;
56
+ private onTouched;
57
+ private readonly cdr;
58
+ private readonly zone;
59
+ private readonly config;
60
+ private readonly i18n;
61
+ constructor();
62
+ ngAfterViewInit(): void;
63
+ ngOnDestroy(): void;
64
+ get t(): {
65
+ label: string;
66
+ hint: string;
67
+ clear: string;
68
+ undo: string;
69
+ } | undefined;
70
+ get rootClass(): string;
71
+ get rootStyle(): Record<string, any>;
72
+ get hint(): string;
73
+ /** Removes the whole drawing. */
74
+ clear(): void;
75
+ /** Removes the last stroke. */
76
+ undo(): void;
77
+ /** The drawing as a data URL (`'image/png'` by default), or `null` while empty. */
78
+ toDataURL(type?: string, quality?: number): string | null;
79
+ down(event: PointerEvent): void;
80
+ move(event: PointerEvent): void;
81
+ up(): void;
82
+ private point;
83
+ /** Sizes the bitmap to the box at the screen's pixel density, then draws everything again. */
84
+ private fit;
85
+ private redraw;
86
+ /** A smooth line through the points (quadratic curves through the midpoints), thicker where the pen pressed harder. */
87
+ private drawStroke;
88
+ /** Updates the form value; `(onEnd)` only when a stroke finished, not on undo or clear. */
89
+ private commit;
90
+ private get canvas();
91
+ private get ctx();
92
+ writeValue(value: unknown): void;
93
+ registerOnChange(fn: (value: string | null) => void): void;
94
+ registerOnTouched(fn: () => void): void;
95
+ setDisabledState(disabled: boolean): void;
96
+ static ɵfac: i0.ɵɵFactoryDeclaration<WuSignaturePad, never>;
97
+ static ɵcmp: i0.ɵɵComponentDeclaration<WuSignaturePad, "wu-signature-pad, wu-signaturePad, wu-signature", never, { "height": { "alias": "height"; "required": false; }; "penColor": { "alias": "penColor"; "required": false; }; "penWidth": { "alias": "penWidth"; "required": false; }; "exportBackground": { "alias": "exportBackground"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "showGuide": { "alias": "showGuide"; "required": false; }; "showButtons": { "alias": "showButtons"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "style": { "alias": "style"; "required": false; }; }, { "onBegin": "onBegin"; "onEnd": "onEnd"; "onClear": "onClear"; }, never, never, true, never>;
98
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./signaturepad.component";
3
+ /** For NgModule apps. Standalone apps can import `WuSignaturePad` directly. */
4
+ export declare class WuSignaturePadModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<WuSignaturePadModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<WuSignaturePadModule, never, [typeof i1.WuSignaturePad], [typeof i1.WuSignaturePad]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<WuSignaturePadModule>;
8
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@wirabyte/ui/stat" />
5
+ export * from './public-api';
@@ -0,0 +1,2 @@
1
+ export * from './stat.component';
2
+ export * from './stat.module';
@@ -0,0 +1,61 @@
1
+ import { EventEmitter, OnDestroy } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export type WuStatSeverity = 'primary' | 'secondary' | 'success' | 'info' | 'warn' | 'danger' | 'help' | 'contrast';
4
+ /**
5
+ * A number to watch: `<wu-stat label="Ticket ที่เปิดอยู่" [value]="12" icon="wi wi-ticket" severity="info" [trend]="8"
6
+ * trendLabel="จากเดือนก่อน">`. An icon in a soft tile of its colour, the label, the value in large figures, and under
7
+ * it the trend (▲ green when up is good, ▼ red; `trendGood="down"` for counts that should fall) and a hint. With
8
+ * `clickable` the whole card is a button that emits `(onClick)`. Anything inside the tag goes under the figures, such as
9
+ * a sparkline.
10
+ */
11
+ export declare class WuStat implements OnDestroy {
12
+ label?: string | null;
13
+ /** The figure. Numbers are shown with thousands separators in the app's language; strings as they are. */
14
+ value?: number | string | null;
15
+ /** Text right after the value, smaller: `'฿'` before needs `prefix`, `'ครั้ง'` after goes here. */
16
+ unit?: string | null;
17
+ prefix?: string | null;
18
+ /** Icon class: `'wi wi-ticket'`. */
19
+ icon?: string | null;
20
+ /** Colour of the icon tile. Default `'primary'`. */
21
+ severity: WuStatSeverity | null | undefined;
22
+ /** A muted line under the value: `'จาก 40 รายการ'`. */
23
+ hint?: string | null;
24
+ /** Change since the last period. A number gets a sign and `trendSuffix`; a string is shown as it is. */
25
+ trend?: number | string | null;
26
+ trendSuffix: string | null | undefined;
27
+ /** Which direction is good news: `'up'` (default) or `'down'` (complaints, open tickets, costs). */
28
+ trendGood: 'up' | 'down' | null | undefined;
29
+ /** Words after the trend: `'จากเดือนก่อน'`. */
30
+ trendLabel?: string | null;
31
+ /** The whole card becomes a button that emits `(onClick)`. */
32
+ set clickable(v: unknown);
33
+ get clickable(): boolean;
34
+ /** Shows a placeholder shimmer instead of the figures while the number loads. */
35
+ set loading(v: unknown);
36
+ get loading(): boolean;
37
+ ariaLabel?: string | null;
38
+ styleClass?: string | null;
39
+ style?: Record<string, any> | string | null;
40
+ readonly onClick: EventEmitter<MouseEvent>;
41
+ private _clickable;
42
+ private _loading;
43
+ private readonly config;
44
+ private readonly i18n;
45
+ constructor();
46
+ ngOnDestroy(): void;
47
+ get rootClass(): string;
48
+ get rootStyle(): Record<string, any> | null;
49
+ get valueText(): string;
50
+ get hasTrend(): boolean;
51
+ /** `up`, `down` or `same`, from the sign of a numeric trend (a string trend reads its leading + or -). */
52
+ get direction(): 'up' | 'down' | 'same';
53
+ get trendClass(): string;
54
+ get trendText(): string;
55
+ /** What a screen reader says before the trend figure. */
56
+ get trendWords(): string;
57
+ click(event: MouseEvent): void;
58
+ private get numberLocale();
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<WuStat, never>;
60
+ static ɵcmp: i0.ɵɵComponentDeclaration<WuStat, "wu-stat", never, { "label": { "alias": "label"; "required": false; }; "value": { "alias": "value"; "required": false; }; "unit": { "alias": "unit"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "severity": { "alias": "severity"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "trend": { "alias": "trend"; "required": false; }; "trendSuffix": { "alias": "trendSuffix"; "required": false; }; "trendGood": { "alias": "trendGood"; "required": false; }; "trendLabel": { "alias": "trendLabel"; "required": false; }; "clickable": { "alias": "clickable"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "style": { "alias": "style"; "required": false; }; }, { "onClick": "onClick"; }, never, ["*"], true, never>;
61
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./stat.component";
3
+ /** For NgModule apps. Standalone apps can import `WuStat` directly. */
4
+ export declare class WuStatModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<WuStatModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<WuStatModule, never, [typeof i1.WuStat], [typeof i1.WuStat]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<WuStatModule>;
8
+ }
@@ -16,6 +16,9 @@ export declare class WuTextarea implements AfterViewInit, DoCheck, OnDestroy {
16
16
  private readonly el;
17
17
  private readonly ngControl;
18
18
  private sub?;
19
+ private observer?;
20
+ private width;
21
+ private frame;
19
22
  constructor();
20
23
  ngAfterViewInit(): void;
21
24
  ngDoCheck(): void;