@prestack/thread-ui 0.1.1 → 0.1.2

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 (343) hide show
  1. package/CHANGELOG.md +174 -0
  2. package/dist/ui/animations/anm_appear.d.ts +8 -8
  3. package/dist/ui/animations/anm_blur_in.d.ts +12 -12
  4. package/dist/ui/animations/anm_blur_out.d.ts +12 -12
  5. package/dist/ui/animations/anm_dismiss.d.ts +12 -12
  6. package/dist/ui/animations/anm_drop.d.ts +12 -12
  7. package/dist/ui/animations/anm_fall.d.ts +12 -12
  8. package/dist/ui/animations/anm_flash.d.ts +9 -9
  9. package/dist/ui/animations/anm_glow.d.ts +8 -8
  10. package/dist/ui/animations/anm_lift.d.ts +8 -8
  11. package/dist/ui/animations/anm_nudge.d.ts +8 -8
  12. package/dist/ui/animations/anm_pop_in.d.ts +16 -16
  13. package/dist/ui/animations/anm_pop_out.d.ts +16 -16
  14. package/dist/ui/animations/anm_press.d.ts +9 -9
  15. package/dist/ui/animations/anm_pulse.d.ts +10 -10
  16. package/dist/ui/animations/anm_rise.d.ts +12 -12
  17. package/dist/ui/animations/anm_shake.d.ts +11 -11
  18. package/dist/ui/animations/anm_slide_in_left.d.ts +12 -12
  19. package/dist/ui/animations/anm_slide_in_right.d.ts +12 -12
  20. package/dist/ui/animations/anm_slide_out_left.d.ts +12 -12
  21. package/dist/ui/animations/anm_slide_out_right.d.ts +12 -12
  22. package/dist/ui/animations/anm_spin.d.ts +8 -8
  23. package/dist/ui/animations/anm_swell.d.ts +8 -8
  24. package/dist/ui/animations/anm_wobble.d.ts +13 -13
  25. package/dist/ui/animations/anm_zoom_in.d.ts +12 -12
  26. package/dist/ui/animations/anm_zoom_out.d.ts +12 -12
  27. package/dist/ui/animations.d.ts +8 -8
  28. package/dist/ui/animations.js +4 -4
  29. package/dist/ui/animations.ts +1 -1
  30. package/dist/ui/attach.js +22 -78
  31. package/dist/ui/attach.ts +8 -66
  32. package/dist/ui/charts.d.ts +0 -3
  33. package/dist/ui/charts.js +3 -7
  34. package/dist/ui/charts.tsx +0 -4
  35. package/dist/ui/checked.d.ts +1 -1
  36. package/dist/ui/checked.ts +1 -1
  37. package/dist/ui/collector.js +1 -1
  38. package/dist/ui/collector.ts +1 -1
  39. package/dist/ui/compositions.d.ts +9 -3
  40. package/dist/ui/compositions.js +9 -158
  41. package/dist/ui/compositions.ts +6 -170
  42. package/dist/ui/content.js +4 -7
  43. package/dist/ui/content.tsx +4 -15
  44. package/dist/ui/controls.js +1 -1
  45. package/dist/ui/door.d.ts +1 -1
  46. package/dist/ui/elements/accordion.d.ts +2 -1
  47. package/dist/ui/elements/accordion.js +4 -4
  48. package/dist/ui/elements/accordion.tsx +2 -1
  49. package/dist/ui/elements/aspect-ratio.d.ts +2 -1
  50. package/dist/ui/elements/aspect-ratio.js +1 -1
  51. package/dist/ui/elements/aspect-ratio.tsx +2 -1
  52. package/dist/ui/elements/avatar.d.ts +2 -1
  53. package/dist/ui/elements/avatar.js +3 -3
  54. package/dist/ui/elements/avatar.tsx +2 -1
  55. package/dist/ui/elements/badge.d.ts +2 -1
  56. package/dist/ui/elements/badge.js +3 -3
  57. package/dist/ui/elements/badge.tsx +2 -1
  58. package/dist/ui/elements/bars.d.ts +2 -1
  59. package/dist/ui/elements/bars.js +5 -5
  60. package/dist/ui/elements/bars.tsx +2 -1
  61. package/dist/ui/elements/bars.works.js +3 -3
  62. package/dist/ui/elements/box.d.ts +2 -1
  63. package/dist/ui/elements/box.js +1 -1
  64. package/dist/ui/elements/box.tsx +2 -1
  65. package/dist/ui/elements/breadcrumb.d.ts +2 -1
  66. package/dist/ui/elements/breadcrumb.js +5 -5
  67. package/dist/ui/elements/breadcrumb.tsx +2 -1
  68. package/dist/ui/elements/breadcrumb.works.js +1 -1
  69. package/dist/ui/elements/button.d.ts +2 -1
  70. package/dist/ui/elements/button.js +3 -3
  71. package/dist/ui/elements/button.tsx +2 -1
  72. package/dist/ui/elements/button.works.js +2 -2
  73. package/dist/ui/elements/column.d.ts +2 -1
  74. package/dist/ui/elements/column.js +1 -1
  75. package/dist/ui/elements/column.tsx +2 -1
  76. package/dist/ui/elements/consent.d.ts +2 -1
  77. package/dist/ui/elements/consent.js +10 -10
  78. package/dist/ui/elements/consent.tsx +2 -1
  79. package/dist/ui/elements/consent.works.js +1 -1
  80. package/dist/ui/elements/donut.d.ts +2 -1
  81. package/dist/ui/elements/donut.js +4 -4
  82. package/dist/ui/elements/donut.tsx +2 -1
  83. package/dist/ui/elements/donut.works.js +2 -2
  84. package/dist/ui/elements/each.d.ts +2 -1
  85. package/dist/ui/elements/each.js +3 -3
  86. package/dist/ui/elements/each.tsx +2 -1
  87. package/dist/ui/elements/each.works.js +2 -2
  88. package/dist/ui/elements/empty.d.ts +2 -1
  89. package/dist/ui/elements/empty.js +2 -2
  90. package/dist/ui/elements/empty.tsx +2 -1
  91. package/dist/ui/elements/field.d.ts +2 -1
  92. package/dist/ui/elements/field.js +3 -3
  93. package/dist/ui/elements/field.tsx +2 -1
  94. package/dist/ui/elements/field.works.js +1 -1
  95. package/dist/ui/elements/funnel.d.ts +2 -1
  96. package/dist/ui/elements/funnel.js +5 -5
  97. package/dist/ui/elements/funnel.tsx +2 -1
  98. package/dist/ui/elements/funnel.works.js +3 -3
  99. package/dist/ui/elements/gauge.d.ts +2 -1
  100. package/dist/ui/elements/gauge.js +3 -3
  101. package/dist/ui/elements/gauge.tsx +2 -1
  102. package/dist/ui/elements/gauge.works.js +1 -1
  103. package/dist/ui/elements/glyph.d.ts +2 -1
  104. package/dist/ui/elements/glyph.js +3 -3
  105. package/dist/ui/elements/glyph.tsx +2 -1
  106. package/dist/ui/elements/glyph.works.js +1 -1
  107. package/dist/ui/elements/grid.d.ts +2 -1
  108. package/dist/ui/elements/grid.js +1 -1
  109. package/dist/ui/elements/grid.tsx +2 -1
  110. package/dist/ui/elements/heatmap.d.ts +2 -1
  111. package/dist/ui/elements/heatmap.js +5 -5
  112. package/dist/ui/elements/heatmap.tsx +2 -1
  113. package/dist/ui/elements/heatmap.works.js +1 -1
  114. package/dist/ui/elements/hit-box.d.ts +2 -1
  115. package/dist/ui/elements/hit-box.js +2 -2
  116. package/dist/ui/elements/hit-box.tsx +2 -1
  117. package/dist/ui/elements/hit-box.works.d.ts +2 -2
  118. package/dist/ui/elements/hit-box.works.js +5 -5
  119. package/dist/ui/elements/hit-box.works.tsx +2 -1
  120. package/dist/ui/elements/image.d.ts +2 -1
  121. package/dist/ui/elements/image.js +2 -2
  122. package/dist/ui/elements/image.tsx +2 -1
  123. package/dist/ui/elements/line-chart.d.ts +2 -1
  124. package/dist/ui/elements/line-chart.js +4 -4
  125. package/dist/ui/elements/line-chart.tsx +2 -1
  126. package/dist/ui/elements/line-chart.works.js +2 -2
  127. package/dist/ui/elements/link.d.ts +2 -1
  128. package/dist/ui/elements/link.js +3 -3
  129. package/dist/ui/elements/link.tsx +2 -1
  130. package/dist/ui/elements/link.works.js +1 -1
  131. package/dist/ui/elements/media.d.ts +2 -1
  132. package/dist/ui/elements/media.js +2 -2
  133. package/dist/ui/elements/media.tsx +2 -1
  134. package/dist/ui/elements/menu.d.ts +2 -1
  135. package/dist/ui/elements/menu.js +5 -5
  136. package/dist/ui/elements/menu.tsx +2 -1
  137. package/dist/ui/elements/menu.works.d.ts +2 -1
  138. package/dist/ui/elements/menu.works.js +5 -5
  139. package/dist/ui/elements/menu.works.tsx +2 -1
  140. package/dist/ui/elements/money.d.ts +3 -1
  141. package/dist/ui/elements/money.js +10 -5
  142. package/dist/ui/elements/money.tsx +12 -3
  143. package/dist/ui/elements/money.works.js +1 -1
  144. package/dist/ui/elements/pagination.d.ts +2 -1
  145. package/dist/ui/elements/pagination.js +5 -5
  146. package/dist/ui/elements/pagination.tsx +2 -1
  147. package/dist/ui/elements/progress.d.ts +2 -1
  148. package/dist/ui/elements/progress.js +3 -3
  149. package/dist/ui/elements/progress.tsx +2 -1
  150. package/dist/ui/elements/radio-group.d.ts +2 -1
  151. package/dist/ui/elements/radio-group.js +4 -4
  152. package/dist/ui/elements/radio-group.tsx +2 -1
  153. package/dist/ui/elements/radio-group.works.js +1 -1
  154. package/dist/ui/elements/row.d.ts +2 -1
  155. package/dist/ui/elements/row.js +1 -1
  156. package/dist/ui/elements/row.tsx +2 -1
  157. package/dist/ui/elements/scatter.d.ts +2 -1
  158. package/dist/ui/elements/scatter.js +3 -3
  159. package/dist/ui/elements/scatter.tsx +2 -1
  160. package/dist/ui/elements/scatter.works.js +1 -1
  161. package/dist/ui/elements/select.d.ts +2 -1
  162. package/dist/ui/elements/select.js +4 -4
  163. package/dist/ui/elements/select.tsx +2 -1
  164. package/dist/ui/elements/separator.d.ts +2 -1
  165. package/dist/ui/elements/separator.js +2 -2
  166. package/dist/ui/elements/separator.tsx +2 -1
  167. package/dist/ui/elements/skeleton.d.ts +2 -1
  168. package/dist/ui/elements/skeleton.js +2 -2
  169. package/dist/ui/elements/skeleton.tsx +2 -1
  170. package/dist/ui/elements/slider.d.ts +2 -1
  171. package/dist/ui/elements/slider.js +3 -3
  172. package/dist/ui/elements/slider.tsx +2 -1
  173. package/dist/ui/elements/sparkline.d.ts +2 -1
  174. package/dist/ui/elements/sparkline.js +3 -3
  175. package/dist/ui/elements/sparkline.tsx +2 -1
  176. package/dist/ui/elements/sparkline.works.js +1 -1
  177. package/dist/ui/elements/spinner.d.ts +2 -1
  178. package/dist/ui/elements/spinner.js +2 -2
  179. package/dist/ui/elements/spinner.tsx +2 -1
  180. package/dist/ui/elements/stack.d.ts +2 -1
  181. package/dist/ui/elements/stack.js +1 -1
  182. package/dist/ui/elements/stack.tsx +2 -1
  183. package/dist/ui/elements/stat.d.ts +2 -1
  184. package/dist/ui/elements/stat.js +3 -3
  185. package/dist/ui/elements/stat.tsx +2 -1
  186. package/dist/ui/elements/stat.works.js +1 -1
  187. package/dist/ui/elements/surface.d.ts +2 -1
  188. package/dist/ui/elements/surface.js +2 -2
  189. package/dist/ui/elements/surface.tsx +2 -1
  190. package/dist/ui/elements/surface.works.js +1 -1
  191. package/dist/ui/elements/table.d.ts +2 -1
  192. package/dist/ui/elements/table.js +4 -4
  193. package/dist/ui/elements/table.tsx +2 -1
  194. package/dist/ui/elements/table.works.js +1 -1
  195. package/dist/ui/elements/tabs.d.ts +2 -1
  196. package/dist/ui/elements/tabs.js +4 -4
  197. package/dist/ui/elements/tabs.tsx +2 -1
  198. package/dist/ui/elements/tabs.works.js +1 -1
  199. package/dist/ui/elements/text.d.ts +2 -1
  200. package/dist/ui/elements/text.js +2 -2
  201. package/dist/ui/elements/text.tsx +2 -1
  202. package/dist/ui/elements/textarea.d.ts +2 -1
  203. package/dist/ui/elements/textarea.js +4 -4
  204. package/dist/ui/elements/textarea.tsx +2 -1
  205. package/dist/ui/elements/time.d.ts +3 -1
  206. package/dist/ui/elements/time.js +7 -4
  207. package/dist/ui/elements/time.tsx +9 -2
  208. package/dist/ui/elements/time.works.d.ts +1 -0
  209. package/dist/ui/elements/time.works.js +7 -3
  210. package/dist/ui/elements/time.works.ts +6 -2
  211. package/dist/ui/elements/toggle.d.ts +2 -1
  212. package/dist/ui/elements/toggle.js +3 -3
  213. package/dist/ui/elements/toggle.tsx +2 -1
  214. package/dist/ui/elements/tooltip.d.ts +2 -1
  215. package/dist/ui/elements/tooltip.js +2 -2
  216. package/dist/ui/elements/tooltip.tsx +2 -1
  217. package/dist/ui/elements/tooltip.works.js +2 -2
  218. package/dist/ui/elements/value.d.ts +3 -1
  219. package/dist/ui/elements/value.js +10 -5
  220. package/dist/ui/elements/value.tsx +12 -3
  221. package/dist/ui/elements/value.works.js +1 -1
  222. package/dist/ui/elements.d.ts +15 -11
  223. package/dist/ui/elements.js +6 -6
  224. package/dist/ui/elements.ts +7 -7
  225. package/dist/ui/fonts.d.ts +1 -1
  226. package/dist/ui/fonts.js +1 -1
  227. package/dist/ui/generators/dev.d.ts +1 -2
  228. package/dist/ui/generators/dev.js +33 -37
  229. package/dist/ui/generators/dev.ts +30 -37
  230. package/dist/ui/generators/elements.d.ts +1 -0
  231. package/dist/ui/generators/elements.js +11 -9
  232. package/dist/ui/generators/elements.ts +12 -9
  233. package/dist/ui/generators/i18n.js +6 -23
  234. package/dist/ui/generators/i18n.ts +1 -18
  235. package/dist/ui/generators/icons.js +5 -14
  236. package/dist/ui/generators/icons.ts +1 -10
  237. package/dist/ui/generators/react.js +4 -5
  238. package/dist/ui/generators/react.ts +2 -3
  239. package/dist/ui/generators/routes.js +66 -51
  240. package/dist/ui/generators/routes.ts +67 -46
  241. package/dist/ui/generators/show.js +9 -6
  242. package/dist/ui/generators/show.ts +4 -2
  243. package/dist/ui/generators/styles.js +12 -16
  244. package/dist/ui/generators/styles.ts +1 -5
  245. package/dist/ui/generators/variants.js +3 -3
  246. package/dist/ui/generators/variants.ts +1 -1
  247. package/dist/ui/i18n/catalogs/en.js +1 -1
  248. package/dist/ui/i18n/format.js +1 -1
  249. package/dist/ui/i18n/translator.js +2 -2
  250. package/dist/ui/material.d.ts +11 -11
  251. package/dist/ui/material.js +1 -1
  252. package/dist/ui/materials/mat_bordered.d.ts +13 -13
  253. package/dist/ui/materials/mat_bordered.js +1 -1
  254. package/dist/ui/materials/mat_ceramic.d.ts +13 -13
  255. package/dist/ui/materials/mat_ceramic.js +1 -1
  256. package/dist/ui/materials/mat_clay.d.ts +13 -13
  257. package/dist/ui/materials/mat_clay.js +1 -1
  258. package/dist/ui/materials/mat_elevated.d.ts +13 -13
  259. package/dist/ui/materials/mat_elevated.js +1 -1
  260. package/dist/ui/materials/mat_flat.d.ts +25 -25
  261. package/dist/ui/materials/mat_flat.js +1 -1
  262. package/dist/ui/materials/mat_glass.d.ts +17 -17
  263. package/dist/ui/materials/mat_glass.js +1 -1
  264. package/dist/ui/materials/mat_lit.d.ts +13 -13
  265. package/dist/ui/materials/mat_lit.js +1 -1
  266. package/dist/ui/materials/mat_moulded.d.ts +9 -9
  267. package/dist/ui/materials/mat_moulded.js +1 -1
  268. package/dist/ui/materials.d.ts +30 -30
  269. package/dist/ui/materials.js +3 -3
  270. package/dist/ui/materials.ts +1 -1
  271. package/dist/ui/modes.d.ts +2 -2
  272. package/dist/ui/presented.js +5 -5
  273. package/dist/ui/provider.d.ts +3 -0
  274. package/dist/ui/provider.js +9 -10
  275. package/dist/ui/provider.tsx +7 -5
  276. package/dist/ui/screens.js +6 -6
  277. package/dist/ui/screens.ts +1 -1
  278. package/dist/ui/scroll-lock.js +1 -1
  279. package/dist/ui/series.js +1 -1
  280. package/dist/ui/styleguide.js +1 -1
  281. package/dist/ui/tokens.d.ts +2 -2
  282. package/dist/ui/tokens.js +3 -3
  283. package/dist/ui/tokens.ts +1 -1
  284. package/dist/ui/validators.js +1 -1
  285. package/dist/ui/variant.d.ts +37 -37
  286. package/dist/ui/variant.js +2 -2
  287. package/dist/ui/variants/var_avatar-round.d.ts +13 -13
  288. package/dist/ui/variants/var_avatar-round.js +1 -1
  289. package/dist/ui/variants/var_bubble-me.d.ts +12 -12
  290. package/dist/ui/variants/var_bubble-me.js +1 -1
  291. package/dist/ui/variants/var_bubble-them.d.ts +10 -10
  292. package/dist/ui/variants/var_bubble-them.js +1 -1
  293. package/dist/ui/variants/var_button-border.d.ts +61 -61
  294. package/dist/ui/variants/var_button-border.js +1 -1
  295. package/dist/ui/variants/var_button-cta.d.ts +61 -61
  296. package/dist/ui/variants/var_button-cta.js +1 -1
  297. package/dist/ui/variants/var_button-destructive-ghost.d.ts +59 -59
  298. package/dist/ui/variants/var_button-destructive-ghost.js +1 -1
  299. package/dist/ui/variants/var_button-destructive.d.ts +61 -61
  300. package/dist/ui/variants/var_button-destructive.js +1 -1
  301. package/dist/ui/variants/var_button-fill.d.ts +61 -61
  302. package/dist/ui/variants/var_button-fill.js +1 -1
  303. package/dist/ui/variants/var_button-ghost.d.ts +59 -59
  304. package/dist/ui/variants/var_button-ghost.js +1 -1
  305. package/dist/ui/variants/var_button-glass.d.ts +40 -40
  306. package/dist/ui/variants/var_button-glass.js +1 -1
  307. package/dist/ui/variants/var_button-normal.d.ts +61 -61
  308. package/dist/ui/variants/var_button-normal.js +1 -1
  309. package/dist/ui/variants/var_button-quiet.d.ts +63 -63
  310. package/dist/ui/variants/var_button-quiet.js +1 -1
  311. package/dist/ui/variants/var_card.d.ts +17 -17
  312. package/dist/ui/variants/var_card.js +1 -1
  313. package/dist/ui/variants/var_chip.d.ts +10 -10
  314. package/dist/ui/variants/var_chip.js +1 -1
  315. package/dist/ui/variants/var_choice.d.ts +15 -15
  316. package/dist/ui/variants/var_choice.js +1 -1
  317. package/dist/ui/variants/var_framed.d.ts +5 -5
  318. package/dist/ui/variants/var_framed.js +1 -1
  319. package/dist/ui/variants/var_glyph-plain.d.ts +7 -7
  320. package/dist/ui/variants/var_glyph-plain.js +1 -1
  321. package/dist/ui/variants/var_input.d.ts +30 -30
  322. package/dist/ui/variants/var_input.js +1 -1
  323. package/dist/ui/variants/var_link-inline.d.ts +17 -17
  324. package/dist/ui/variants/var_link-inline.js +1 -1
  325. package/dist/ui/variants/var_list-row.d.ts +22 -22
  326. package/dist/ui/variants/var_list-row.js +1 -1
  327. package/dist/ui/variants/var_rule.d.ts +5 -5
  328. package/dist/ui/variants/var_rule.js +1 -1
  329. package/dist/ui/variants/var_skeleton-block.d.ts +9 -9
  330. package/dist/ui/variants/var_skeleton-block.js +1 -1
  331. package/dist/ui/variants/var_spinner-turning.d.ts +9 -9
  332. package/dist/ui/variants/var_spinner-turning.js +1 -1
  333. package/dist/ui/variants/var_stat-tile.d.ts +10 -10
  334. package/dist/ui/variants/var_stat-tile.js +1 -1
  335. package/dist/ui/variants/var_tab-bar.d.ts +14 -14
  336. package/dist/ui/variants/var_tab-bar.js +1 -1
  337. package/dist/ui/variants/var_tap-target.d.ts +11 -11
  338. package/dist/ui/variants/var_tap-target.js +1 -1
  339. package/dist/ui/variants.d.ts +88 -88
  340. package/dist/ui/wrappers.d.ts +7 -6
  341. package/dist/ui/wrappers.js +16 -14
  342. package/dist/ui/wrappers.tsx +21 -18
  343. package/package.json +2 -2
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { roleClass } from "../fonts.js";
4
- import { element, useSurface } from "../wrappers.js";
5
- import { shown } from "./stat.works.js";
3
+ import { roleClass } from '../fonts.js';
4
+ import { element, useSurface } from '../wrappers.js';
5
+ import { shown } from './stat.works.js';
6
6
  export const Stat = element('Stat', (props, className) => {
7
7
  const surface = useSurface({ className: roleClass(undefined, className),
8
8
  invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
@@ -3,6 +3,7 @@
3
3
  import type { MessageKey } from '../content.tsx'
4
4
  import { roleClass } from '../fonts.ts'
5
5
 
6
+ import type { Dispatching } from '../checked.ts'
6
7
  import { type Element, element, useSurface } from '../wrappers.tsx'
7
8
  import { shown } from './stat.works.ts'
8
9
 
@@ -12,7 +13,7 @@ export interface StatProps {
12
13
  readonly value?: unknown
13
14
  readonly compare?: number
14
15
  readonly format?: string
15
- readonly dispatch?: string
16
+ readonly dispatch?: keyof Dispatching
16
17
  readonly input?: Readonly<Record<string, unknown>>
17
18
  readonly invokeOn?: 'press' | 'shown'
18
19
  }
@@ -1,4 +1,4 @@
1
- import { formatValue } from "../validators.js";
1
+ import { formatValue } from '../validators.js';
2
2
  export function shown(props, _surface) {
3
3
  const current = typeof props.value === 'number' ? props.value : Number(props.value ?? 0);
4
4
  const against = props.compare;
@@ -1,8 +1,9 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { Dispatching } from '../checked.ts';
2
3
  import { type Element } from '../wrappers.tsx';
3
4
  export interface SurfaceProps {
4
5
  readonly children: ReactNode;
5
- readonly dispatch?: string;
6
+ readonly dispatch?: keyof Dispatching;
6
7
  readonly input?: Readonly<Record<string, unknown>>;
7
8
  readonly invokeOn?: 'press' | 'shown';
8
9
  }
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { element, useSurface } from "../wrappers.js";
4
- import { uses } from "./surface.works.js";
3
+ import { element, useSurface } from '../wrappers.js';
4
+ import { uses } from './surface.works.js';
5
5
  export const Surface = element('Surface', (props, className) => {
6
6
  const kept = uses(props);
7
7
  const surface = useSurface({ className,
@@ -2,13 +2,14 @@
2
2
 
3
3
  import type { ReactNode } from 'react'
4
4
 
5
+ import type { Dispatching } from '../checked.ts'
5
6
  import { type Element, element, useSurface } from '../wrappers.tsx'
6
7
  import { uses } from './surface.works.ts'
7
8
 
8
9
 
9
10
  export interface SurfaceProps {
10
11
  readonly children: ReactNode
11
- readonly dispatch?: string
12
+ readonly dispatch?: keyof Dispatching
12
13
  readonly input?: Readonly<Record<string, unknown>>
13
14
  readonly invokeOn?: 'press' | 'shown'
14
15
  }
@@ -1,4 +1,4 @@
1
- import { useVisibility } from "../wrappers.js";
1
+ import { useVisibility } from '../wrappers.js';
2
2
  export function uses(_props) {
3
3
  return { on: { ref: useVisibility(true) } };
4
4
  }
@@ -1,12 +1,13 @@
1
1
  import type { MessageKey } from '../content.tsx';
2
2
  import type { Row } from '../charts.tsx';
3
+ import type { Dispatching } from '../checked.ts';
3
4
  import { type Element } from '../wrappers.tsx';
4
5
  export interface TableProps {
5
6
  readonly rows: readonly Row[];
6
7
  readonly columns: readonly Row[];
7
8
  readonly by: string;
8
9
  readonly titleKey?: MessageKey;
9
- readonly dispatch?: string;
10
+ readonly dispatch?: keyof Dispatching;
10
11
  readonly input?: Readonly<Record<string, unknown>>;
11
12
  readonly invokeOn?: 'press' | 'shown';
12
13
  }
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { roleClass } from "../fonts.js";
4
- import { element, useSurface } from "../wrappers.js";
5
- import { Each } from "../elements/each.js";
6
- import { shown, heading, uses } from "./table.works.js";
3
+ import { roleClass } from '../fonts.js';
4
+ import { element, useSurface } from '../wrappers.js';
5
+ import { Each } from '../elements/each.js';
6
+ import { shown, heading, uses } from './table.works.js';
7
7
  export const Table = element('Table', (props, className) => {
8
8
  const kept = uses(props);
9
9
  const surface = useSurface({ className: roleClass(undefined, className),
@@ -4,6 +4,7 @@ import type { MessageKey } from '../content.tsx'
4
4
  import type { Row } from '../charts.tsx'
5
5
  import { roleClass } from '../fonts.ts'
6
6
 
7
+ import type { Dispatching } from '../checked.ts'
7
8
  import { type Element, element, useSurface } from '../wrappers.tsx'
8
9
  import { Each } from '../elements/each.tsx'
9
10
  import { shown, heading, uses } from './table.works.ts'
@@ -14,7 +15,7 @@ export interface TableProps {
14
15
  readonly columns: readonly Row[]
15
16
  readonly by: string
16
17
  readonly titleKey?: MessageKey
17
- readonly dispatch?: string
18
+ readonly dispatch?: keyof Dispatching
18
19
  readonly input?: Readonly<Record<string, unknown>>
19
20
  readonly invokeOn?: 'press' | 'shown'
20
21
  }
@@ -1,4 +1,4 @@
1
- import { formatValue } from "../validators.js";
1
+ import { formatValue } from '../validators.js';
2
2
  export function uses(props) {
3
3
  return props.rows.length === 0 ? { holds: ['empty'] } : {};
4
4
  }
@@ -1,11 +1,12 @@
1
1
  import type { TabItem } from '../disclosure.tsx';
2
+ import type { Dispatching } from '../checked.ts';
2
3
  import { type Element } from '../wrappers.tsx';
3
4
  export interface TabsProps {
4
5
  readonly items: readonly TabItem[];
5
6
  readonly initial?: string;
6
7
  readonly onChange?: (said: string) => void;
7
8
  readonly orientation?: string;
8
- readonly dispatch?: string;
9
+ readonly dispatch?: keyof Dispatching;
9
10
  readonly input?: Readonly<Record<string, unknown>>;
10
11
  readonly invokeOn?: 'press' | 'shown';
11
12
  }
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { roleClass } from "../fonts.js";
4
- import { element, useSurface } from "../wrappers.js";
5
- import { Each } from "../elements/each.js";
6
- import { shown, strip, tab, panel, opened, uses } from "./tabs.works.js";
3
+ import { roleClass } from '../fonts.js';
4
+ import { element, useSurface } from '../wrappers.js';
5
+ import { Each } from '../elements/each.js';
6
+ import { shown, strip, tab, panel, opened, uses } from './tabs.works.js';
7
7
  export const Tabs = element('Tabs', (props, className) => {
8
8
  const kept = uses(props);
9
9
  const surface = useSurface({ className: roleClass(undefined, className),
@@ -4,6 +4,7 @@ import type { MessageKey } from '../content.tsx'
4
4
  import { roleClass } from '../fonts.ts'
5
5
  import type { TabItem } from '../disclosure.tsx'
6
6
 
7
+ import type { Dispatching } from '../checked.ts'
7
8
  import { type Element, element, useSurface } from '../wrappers.tsx'
8
9
  import { Each } from '../elements/each.tsx'
9
10
  import { shown, strip, tab, panel, opened, uses } from './tabs.works.ts'
@@ -14,7 +15,7 @@ export interface TabsProps {
14
15
  readonly initial?: string
15
16
  readonly onChange?: (said: string) => void
16
17
  readonly orientation?: string
17
- readonly dispatch?: string
18
+ readonly dispatch?: keyof Dispatching
18
19
  readonly input?: Readonly<Record<string, unknown>>
19
20
  readonly invokeOn?: 'press' | 'shown'
20
21
  }
@@ -1,5 +1,5 @@
1
1
  import { useId, useRef, useState } from 'react';
2
- import { ITEM_ATTR, useRovingFocus } from "../roving-focus.js";
2
+ import { ITEM_ATTR, useRovingFocus } from '../roving-focus.js';
3
3
  export function uses(props) {
4
4
  const list = useRef(null);
5
5
  const base = useId();
@@ -1,12 +1,13 @@
1
1
  import type { MessageKey } from '../content.tsx';
2
2
  import { type FontRoleId } from '../fonts.ts';
3
+ import type { Dispatching } from '../checked.ts';
3
4
  import { type Element } from '../wrappers.tsx';
4
5
  export interface TextProps {
5
6
  readonly k: MessageKey;
6
7
  readonly with?: Readonly<Record<string, unknown>>;
7
8
  readonly is?: FontRoleId;
8
9
  readonly announce?: 'alert' | 'status';
9
- readonly dispatch?: string;
10
+ readonly dispatch?: keyof Dispatching;
10
11
  readonly input?: Readonly<Record<string, unknown>>;
11
12
  readonly invokeOn?: 'press' | 'shown';
12
13
  }
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { roleClass } from "../fonts.js";
4
- import { element, useSurface } from "../wrappers.js";
3
+ import { roleClass } from '../fonts.js';
4
+ import { element, useSurface } from '../wrappers.js';
5
5
  export const Text = element('Text', (props, className) => {
6
6
  const surface = useSurface({ className: roleClass(props.is, className),
7
7
  invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
@@ -3,6 +3,7 @@
3
3
  import type { MessageKey } from '../content.tsx'
4
4
  import { roleClass, type FontRoleId } from '../fonts.ts'
5
5
 
6
+ import type { Dispatching } from '../checked.ts'
6
7
  import { type Element, element, useSurface } from '../wrappers.tsx'
7
8
 
8
9
 
@@ -11,7 +12,7 @@ export interface TextProps {
11
12
  readonly with?: Readonly<Record<string, unknown>>
12
13
  readonly is?: FontRoleId
13
14
  readonly announce?: 'alert' | 'status'
14
- readonly dispatch?: string
15
+ readonly dispatch?: keyof Dispatching
15
16
  readonly input?: Readonly<Record<string, unknown>>
16
17
  readonly invokeOn?: 'press' | 'shown'
17
18
  }
@@ -1,4 +1,5 @@
1
1
  import type { MessageKey } from '../content.tsx';
2
+ import type { Dispatching } from '../checked.ts';
2
3
  import { type Element } from '../wrappers.tsx';
3
4
  export interface TextareaProps {
4
5
  readonly labelKey: MessageKey;
@@ -7,7 +8,7 @@ export interface TextareaProps {
7
8
  readonly onValue?: (said: string) => void;
8
9
  readonly validator?: string;
9
10
  readonly rows?: number;
10
- readonly dispatch?: string;
11
+ readonly dispatch?: keyof Dispatching;
11
12
  readonly input?: Readonly<Record<string, unknown>>;
12
13
  readonly invokeOn?: 'press' | 'shown';
13
14
  }
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { roleClass } from "../fonts.js";
4
- import { element, useSurface } from "../wrappers.js";
5
- import { limited } from "../validators.js";
6
- import { does } from "./textarea.works.js";
3
+ import { roleClass } from '../fonts.js';
4
+ import { element, useSurface } from '../wrappers.js';
5
+ import { limited } from '../validators.js';
6
+ import { does } from './textarea.works.js';
7
7
  export const Textarea = element('Textarea', (props, className) => {
8
8
  const surface = useSurface({ className: roleClass(undefined, className),
9
9
  invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
@@ -3,6 +3,7 @@
3
3
  import type { MessageKey } from '../content.tsx'
4
4
  import { roleClass } from '../fonts.ts'
5
5
 
6
+ import type { Dispatching } from '../checked.ts'
6
7
  import { type Element, element, useSurface } from '../wrappers.tsx'
7
8
  import { limited } from '../validators.ts'
8
9
  import { does } from './textarea.works.ts'
@@ -15,7 +16,7 @@ export interface TextareaProps {
15
16
  readonly onValue?: (said: string) => void
16
17
  readonly validator?: string
17
18
  readonly rows?: number
18
- readonly dispatch?: string
19
+ readonly dispatch?: keyof Dispatching
19
20
  readonly input?: Readonly<Record<string, unknown>>
20
21
  readonly invokeOn?: 'press' | 'shown'
21
22
  }
@@ -1,10 +1,12 @@
1
1
  import { type FontRoleId } from '../fonts.ts';
2
+ import type { Dispatching } from '../checked.ts';
2
3
  import { type Element } from '../wrappers.tsx';
3
4
  export interface TimeProps {
4
5
  readonly value?: unknown;
5
6
  readonly relative?: boolean;
6
7
  readonly is?: FontRoleId;
7
- readonly dispatch?: string;
8
+ readonly invalid?: boolean;
9
+ readonly dispatch?: keyof Dispatching;
8
10
  readonly input?: Readonly<Record<string, unknown>>;
9
11
  readonly invokeOn?: 'press' | 'shown';
10
12
  }
@@ -1,14 +1,17 @@
1
1
  'use client';
2
- import { roleClass } from "../fonts.js";
3
- import { element, useSurface } from "../wrappers.js";
4
- import { shows, uses } from "./time.works.js";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { roleClass } from '../fonts.js';
4
+ import { element, useSurface } from '../wrappers.js';
5
+ import { shows, uses } from './time.works.js';
5
6
  export const Time = element('Time', (props, className) => {
6
7
  const kept = uses(props);
7
8
  const surface = useSurface({ className: roleClass(props.is, className),
8
9
  invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
9
10
  holds: [
11
+ ...(props.invalid === true ? ['invalid'] : []),
10
12
  ...(kept.holds ?? []),
11
13
  ],
14
+ raises: ['invalid'],
12
15
  ...(kept.animates === undefined ? {} : { animates: kept.animates }), });
13
- return (shows(props, surface, kept));
16
+ return (_jsx("span", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, ...(kept.on ?? {}), children: shows(props, surface, kept) }));
14
17
  }, 'e-time', {});
@@ -1,7 +1,9 @@
1
1
  'use client'
2
2
 
3
+ import type { MessageKey } from '../content.tsx'
3
4
  import { roleClass, type FontRoleId } from '../fonts.ts'
4
5
 
6
+ import type { Dispatching } from '../checked.ts'
5
7
  import { type Element, element, useSurface } from '../wrappers.tsx'
6
8
  import { shows, uses } from './time.works.ts'
7
9
 
@@ -10,7 +12,8 @@ export interface TimeProps {
10
12
  readonly value?: unknown
11
13
  readonly relative?: boolean
12
14
  readonly is?: FontRoleId
13
- readonly dispatch?: string
15
+ readonly invalid?: boolean
16
+ readonly dispatch?: keyof Dispatching
14
17
  readonly input?: Readonly<Record<string, unknown>>
15
18
  readonly invokeOn?: 'press' | 'shown'
16
19
  }
@@ -22,11 +25,15 @@ export const Time: Element<'Time', TimeProps> = element(
22
25
  const surface = useSurface({ className: roleClass(props.is, className),
23
26
  invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
24
27
  holds: [
28
+ ...(props.invalid === true ? ['invalid' as const] : []),
25
29
  ...(kept.holds ?? []),
26
30
  ],
31
+ raises: ['invalid' as const],
27
32
  ...(kept.animates === undefined ? {} : { animates: kept.animates }), })
28
33
  return (
29
- shows(props, surface, kept)
34
+ <span className={surface.className} {...surface.marks} {...surface.invokes} {...surface.a11y} {...(kept.on ?? {})}>
35
+ {shows(props, surface, kept)}
36
+ </span>
30
37
  )
31
38
  },
32
39
  'e-time',
@@ -4,6 +4,7 @@ import type { TimeProps } from './time.tsx';
4
4
  export declare function uses(props: TimeProps): {
5
5
  readonly holds?: readonly string[];
6
6
  readonly animates?: boolean;
7
+ readonly on?: Readonly<Record<string, unknown>>;
7
8
  readonly at: number | undefined;
8
9
  };
9
10
  export declare function shows(props: TimeProps, surface: Surface, kept: {
@@ -1,12 +1,16 @@
1
1
  import { useCallback, useSyncExternalStore } from 'react';
2
- import { renderValue } from "../content.js";
3
- import { useUi } from "../wrappers.js";
2
+ import { renderValue } from '../content.js';
3
+ import { runValidator } from '../validators.js';
4
+ import { useUi } from '../wrappers.js';
4
5
  const NO_CLOCK_YET = () => undefined;
5
6
  export function uses(props) {
6
7
  const { now, ticker } = useUi();
7
8
  const subscribe = useCallback((onChange) => (props.relative === true && ticker !== undefined ? ticker.subscribe(onChange) : () => undefined), [props.relative, ticker]);
8
9
  const read = useCallback(() => now?.(), [now]);
9
- return { at: useSyncExternalStore(subscribe, read, NO_CLOCK_YET) };
10
+ const at = useSyncExternalStore(subscribe, read, NO_CLOCK_YET);
11
+ const { relative, value } = props;
12
+ const { ok } = runValidator(relative === true ? 'relativeTime' : 'datetime', value, relative === true ? { now: at } : {});
13
+ return ok ? { at } : { at, holds: ['invalid'] };
10
14
  }
11
15
  export function shows(props, surface, kept) {
12
16
  if (props.relative !== true || kept.at === undefined) {
@@ -1,20 +1,24 @@
1
1
  import { useCallback, useSyncExternalStore, type ReactNode } from 'react'
2
2
 
3
3
  import { renderValue } from '../content.tsx'
4
+ import { runValidator } from '../validators.ts'
4
5
  import type { Surface } from '../door.ts'
5
6
  import { useUi } from '../wrappers.tsx'
6
7
  import type { TimeProps } from './time.tsx'
7
8
 
8
9
  const NO_CLOCK_YET = (): number | undefined => undefined
9
10
 
10
- export function uses(props: TimeProps): { readonly holds?: readonly string[]; readonly animates?: boolean; readonly at: number | undefined } {
11
+ export function uses(props: TimeProps): { readonly holds?: readonly string[]; readonly animates?: boolean; readonly on?: Readonly<Record<string, unknown>>; readonly at: number | undefined } {
11
12
  const { now, ticker } = useUi()
12
13
  const subscribe = useCallback(
13
14
  (onChange: () => void) => (props.relative === true && ticker !== undefined ? ticker.subscribe(onChange) : () => undefined),
14
15
  [props.relative, ticker],
15
16
  )
16
17
  const read = useCallback(() => now?.(), [now])
17
- return { at: useSyncExternalStore(subscribe, read, NO_CLOCK_YET) }
18
+ const at = useSyncExternalStore(subscribe, read, NO_CLOCK_YET)
19
+ const { relative, value } = props
20
+ const { ok } = runValidator(relative === true ? 'relativeTime' : 'datetime', value, relative === true ? { now: at } : {})
21
+ return ok ? { at } : { at, holds: ['invalid'] }
18
22
  }
19
23
 
20
24
  export function shows(props: TimeProps, surface: Surface, kept: { readonly at: number | undefined }): ReactNode {
@@ -1,10 +1,11 @@
1
1
  import type { MessageKey } from '../content.tsx';
2
+ import type { Dispatching } from '../checked.ts';
2
3
  import { type Element } from '../wrappers.tsx';
3
4
  export interface ToggleProps {
4
5
  readonly labelKey: MessageKey;
5
6
  readonly on?: boolean;
6
7
  readonly onToggle?: (said: boolean) => void;
7
- readonly dispatch?: string;
8
+ readonly dispatch?: keyof Dispatching;
8
9
  readonly input?: Readonly<Record<string, unknown>>;
9
10
  readonly invokeOn?: 'press' | 'shown';
10
11
  }
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { roleClass } from "../fonts.js";
4
- import { element, useSurface } from "../wrappers.js";
5
- import { does } from "./toggle.works.js";
3
+ import { roleClass } from '../fonts.js';
4
+ import { element, useSurface } from '../wrappers.js';
5
+ import { does } from './toggle.works.js';
6
6
  export const Toggle = element('Toggle', (props, className) => {
7
7
  const surface = useSurface({ className: roleClass(undefined, className),
8
8
  invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
@@ -3,6 +3,7 @@
3
3
  import type { MessageKey } from '../content.tsx'
4
4
  import { roleClass } from '../fonts.ts'
5
5
 
6
+ import type { Dispatching } from '../checked.ts'
6
7
  import { type Element, element, useSurface } from '../wrappers.tsx'
7
8
  import { does } from './toggle.works.ts'
8
9
 
@@ -11,7 +12,7 @@ export interface ToggleProps {
11
12
  readonly labelKey: MessageKey
12
13
  readonly on?: boolean
13
14
  readonly onToggle?: (said: boolean) => void
14
- readonly dispatch?: string
15
+ readonly dispatch?: keyof Dispatching
15
16
  readonly input?: Readonly<Record<string, unknown>>
16
17
  readonly invokeOn?: 'press' | 'shown'
17
18
  }
@@ -1,11 +1,12 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { MessageKey } from '../content.tsx';
3
+ import type { Dispatching } from '../checked.ts';
3
4
  import { type Element } from '../wrappers.tsx';
4
5
  export interface TooltipProps {
5
6
  readonly children: ReactNode;
6
7
  readonly labelKey: MessageKey;
7
8
  readonly side?: string;
8
- readonly dispatch?: string;
9
+ readonly dispatch?: keyof Dispatching;
9
10
  readonly input?: Readonly<Record<string, unknown>>;
10
11
  readonly invokeOn?: 'press' | 'shown';
11
12
  }
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { element, useSurface } from "../wrappers.js";
4
- import { measured, bubble, showing, uses } from "./tooltip.works.js";
3
+ import { element, useSurface } from '../wrappers.js';
4
+ import { measured, bubble, showing, uses } from './tooltip.works.js';
5
5
  export const Tooltip = element('Tooltip', (props, className) => {
6
6
  const kept = uses(props);
7
7
  const surface = useSurface({ className,
@@ -3,6 +3,7 @@
3
3
  import type { ReactNode } from 'react'
4
4
  import type { MessageKey } from '../content.tsx'
5
5
 
6
+ import type { Dispatching } from '../checked.ts'
6
7
  import { type Element, element, useSurface } from '../wrappers.tsx'
7
8
  import { measured, bubble, showing, uses } from './tooltip.works.ts'
8
9
 
@@ -11,7 +12,7 @@ export interface TooltipProps {
11
12
  readonly children: ReactNode
12
13
  readonly labelKey: MessageKey
13
14
  readonly side?: string
14
- readonly dispatch?: string
15
+ readonly dispatch?: keyof Dispatching
15
16
  readonly input?: Readonly<Record<string, unknown>>
16
17
  readonly invokeOn?: 'press' | 'shown'
17
18
  }
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
- import { useDismissLayer } from "../dismiss-layer.js";
3
- import { positionOf } from "../positioning.js";
2
+ import { useDismissLayer } from '../dismiss-layer.js';
3
+ import { positionOf } from '../positioning.js';
4
4
  export function uses(props) {
5
5
  const trigger = useRef(null);
6
6
  const layer = useRef(null);
@@ -1,11 +1,13 @@
1
1
  import { type FontRoleId } from '../fonts.ts';
2
+ import type { Dispatching } from '../checked.ts';
2
3
  import { type Element } from '../wrappers.tsx';
3
4
  export interface ValueProps {
4
5
  readonly validator: string;
5
6
  readonly value?: unknown;
6
7
  readonly context?: Readonly<Record<string, unknown>>;
7
8
  readonly is?: FontRoleId;
8
- readonly dispatch?: string;
9
+ readonly invalid?: boolean;
10
+ readonly dispatch?: keyof Dispatching;
9
11
  readonly input?: Readonly<Record<string, unknown>>;
10
12
  readonly invokeOn?: 'press' | 'shown';
11
13
  }
@@ -1,9 +1,14 @@
1
1
  'use client';
2
- import { roleClass } from "../fonts.js";
3
- import { element, useSurface } from "../wrappers.js";
4
- import { shows } from "./value.works.js";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { roleClass } from '../fonts.js';
4
+ import { element, useSurface } from '../wrappers.js';
5
+ import { shows } from './value.works.js';
5
6
  export const Value = element('Value', (props, className) => {
6
7
  const surface = useSurface({ className: roleClass(props.is, className),
7
- invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
8
- return (shows(props, surface));
8
+ invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
9
+ holds: [
10
+ ...(props.invalid === true ? ['invalid'] : []),
11
+ ],
12
+ raises: ['invalid'], });
13
+ return (_jsx("span", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, children: shows(props, surface) }));
9
14
  }, 'e-value', {});
@@ -1,7 +1,9 @@
1
1
  'use client'
2
2
 
3
+ import type { MessageKey } from '../content.tsx'
3
4
  import { roleClass, type FontRoleId } from '../fonts.ts'
4
5
 
6
+ import type { Dispatching } from '../checked.ts'
5
7
  import { type Element, element, useSurface } from '../wrappers.tsx'
6
8
  import { shows } from './value.works.ts'
7
9
 
@@ -11,7 +13,8 @@ export interface ValueProps {
11
13
  readonly value?: unknown
12
14
  readonly context?: Readonly<Record<string, unknown>>
13
15
  readonly is?: FontRoleId
14
- readonly dispatch?: string
16
+ readonly invalid?: boolean
17
+ readonly dispatch?: keyof Dispatching
15
18
  readonly input?: Readonly<Record<string, unknown>>
16
19
  readonly invokeOn?: 'press' | 'shown'
17
20
  }
@@ -20,9 +23,15 @@ export const Value: Element<'Value', ValueProps> = element(
20
23
  'Value',
21
24
  (props: ValueProps, className) => {
22
25
  const surface = useSurface({ className: roleClass(props.is, className),
23
- invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, })
26
+ invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
27
+ holds: [
28
+ ...(props.invalid === true ? ['invalid' as const] : []),
29
+ ],
30
+ raises: ['invalid' as const], })
24
31
  return (
25
- shows(props, surface)
32
+ <span className={surface.className} {...surface.marks} {...surface.invokes} {...surface.a11y}>
33
+ {shows(props, surface)}
34
+ </span>
26
35
  )
27
36
  },
28
37
  'e-value',
@@ -1,4 +1,4 @@
1
- import { renderValue } from "../content.js";
1
+ import { renderValue } from '../content.js';
2
2
  export function shows(props, surface) {
3
3
  return renderValue({ validator: props.validator, value: props.value, ...(props.context === undefined ? {} : { context: props.context }) }, surface);
4
4
  }