@pg-labs-incubator/cobweb 0.0.0-stage → 0.0.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 (320) hide show
  1. package/LICENSE +163 -0
  2. package/README.md +82 -2
  3. package/package.json +112 -3
  4. package/src/action/action.yaml +291 -0
  5. package/src/action/button-group.yaml +56 -0
  6. package/src/action/button.yaml +239 -0
  7. package/src/action/split-button.yaml +87 -0
  8. package/src/color/color.yaml +181 -0
  9. package/src/color/palette.yaml +147 -0
  10. package/src/container/card.yaml +170 -0
  11. package/src/container/corner-radius.yaml +50 -0
  12. package/src/container/elevation.yaml +19 -0
  13. package/src/design.yaml +41 -0
  14. package/src/feedback/feedback.yaml +225 -0
  15. package/src/icon/icon-font.yaml +28 -0
  16. package/src/icon/icon.yaml +31 -0
  17. package/src/input/date-picker.yaml +144 -0
  18. package/src/input/date-range-input.yaml +162 -0
  19. package/src/input/range-slider.yaml +161 -0
  20. package/src/input/select.yaml +230 -0
  21. package/src/input/slider.yaml +172 -0
  22. package/src/input/text-field.yaml +240 -0
  23. package/src/input/time-picker.yaml +220 -0
  24. package/src/motion/motion.yaml +371 -0
  25. package/src/navigation/app-bar.yaml +147 -0
  26. package/src/navigation/navigation.yaml +339 -0
  27. package/src/navigation/scroll.yaml +23 -0
  28. package/src/navigation/search.yaml +112 -0
  29. package/src/navigation/tabs.yaml +144 -0
  30. package/src/navigation/toolbar.yaml +130 -0
  31. package/src/selection/checkbox.yaml +162 -0
  32. package/src/selection/chip.yaml +219 -0
  33. package/src/selection/radio.yaml +125 -0
  34. package/src/selection/segmented-group.yaml +11 -0
  35. package/src/selection/segmented.yaml +69 -0
  36. package/src/selection/switch.yaml +209 -0
  37. package/src/spacing/measurement.yaml +80 -0
  38. package/src/state/state.yaml +38 -0
  39. package/src/surface/surface.yaml +483 -0
  40. package/src/text/line-height.yaml +144 -0
  41. package/src/text/typeface.yaml +31 -0
  42. package/src/text/typescale.yaml +726 -0
  43. package/target/esbuild/action/action.css +1 -0
  44. package/target/esbuild/action/base.jsx +1 -0
  45. package/target/esbuild/action/button.jsx +17 -0
  46. package/target/esbuild/action/fab-menu-context.jsx +1 -0
  47. package/target/esbuild/action/fab-menu.jsx +15 -0
  48. package/target/esbuild/action/fab.jsx +7 -0
  49. package/target/esbuild/action/group.jsx +22 -0
  50. package/target/esbuild/action/icon-button.jsx +5 -0
  51. package/target/esbuild/action/index.jsx +1 -0
  52. package/target/esbuild/action/split-button.jsx +12 -0
  53. package/target/esbuild/color/contrast.jsx +1 -0
  54. package/target/esbuild/color/dynamic.jsx +1 -0
  55. package/target/esbuild/color/hct.jsx +1 -0
  56. package/target/esbuild/color/index.css +1 -0
  57. package/target/esbuild/color/index.jsx +1 -0
  58. package/target/esbuild/color/palette.jsx +1 -0
  59. package/target/esbuild/color/scheme.jsx +1 -0
  60. package/target/esbuild/color/temperature.jsx +1 -0
  61. package/target/esbuild/container/card.css +1 -0
  62. package/target/esbuild/container/card.jsx +1 -0
  63. package/target/esbuild/container/elevation-shadow.css +1 -0
  64. package/target/esbuild/container/elevation-shadow.jsx +1 -0
  65. package/target/esbuild/container/index.jsx +1 -0
  66. package/target/esbuild/dom/client.jsx +1 -0
  67. package/target/esbuild/dom/index.jsx +1 -0
  68. package/target/esbuild/dom/server.jsx +1 -0
  69. package/target/esbuild/dom/types.jsx +1 -0
  70. package/target/esbuild/feedback/badge.jsx +15 -0
  71. package/target/esbuild/feedback/feedback.css +1 -0
  72. package/target/esbuild/feedback/focus.jsx +1 -0
  73. package/target/esbuild/feedback/index.jsx +1 -0
  74. package/target/esbuild/feedback/loading.jsx +7 -0
  75. package/target/esbuild/feedback/observe.jsx +1 -0
  76. package/target/esbuild/feedback/progress.jsx +35 -0
  77. package/target/esbuild/feedback/snackbar.jsx +23 -0
  78. package/target/esbuild/feedback/tooltip.jsx +24 -0
  79. package/target/esbuild/icon/icon.css +1 -0
  80. package/target/esbuild/icon/icon.jsx +1 -0
  81. package/target/esbuild/icon/index.jsx +1 -0
  82. package/target/esbuild/index.css +1 -0
  83. package/target/esbuild/index.jsx +1 -0
  84. package/target/esbuild/input/autocomplete.jsx +5 -0
  85. package/target/esbuild/input/base.jsx +4 -0
  86. package/target/esbuild/input/date-picker.css +1 -0
  87. package/target/esbuild/input/date-picker.jsx +104 -0
  88. package/target/esbuild/input/date-range-input.css +1 -0
  89. package/target/esbuild/input/date-time.jsx +21 -0
  90. package/target/esbuild/input/index.css +1 -0
  91. package/target/esbuild/input/index.jsx +1 -0
  92. package/target/esbuild/input/paired-input.jsx +1 -0
  93. package/target/esbuild/input/picker-dialog.css +1 -0
  94. package/target/esbuild/input/picker-dialog.jsx +14 -0
  95. package/target/esbuild/input/select.css +1 -0
  96. package/target/esbuild/input/select.jsx +63 -0
  97. package/target/esbuild/input/slider.css +1 -0
  98. package/target/esbuild/input/slider.jsx +51 -0
  99. package/target/esbuild/input/text-field.css +1 -0
  100. package/target/esbuild/input/text-field.jsx +67 -0
  101. package/target/esbuild/input/time-picker.css +1 -0
  102. package/target/esbuild/input/time-picker.jsx +29 -0
  103. package/target/esbuild/motion/frame.jsx +1 -0
  104. package/target/esbuild/motion/index.css +1 -0
  105. package/target/esbuild/motion/index.jsx +1 -0
  106. package/target/esbuild/motion/material.jsx +1 -0
  107. package/target/esbuild/motion/motion.jsx +1 -0
  108. package/target/esbuild/motion/spring.jsx +1 -0
  109. package/target/esbuild/motion/transition.css +1 -0
  110. package/target/esbuild/motion/transition.jsx +1 -0
  111. package/target/esbuild/motion/velocity.jsx +1 -0
  112. package/target/esbuild/navigation/app-bar.jsx +51 -0
  113. package/target/esbuild/navigation/base.jsx +1 -0
  114. package/target/esbuild/navigation/drawer.jsx +25 -0
  115. package/target/esbuild/navigation/index.jsx +1 -0
  116. package/target/esbuild/navigation/navigation.css +1 -0
  117. package/target/esbuild/navigation/navigation.jsx +29 -0
  118. package/target/esbuild/navigation/scroll.jsx +1 -0
  119. package/target/esbuild/navigation/search.jsx +29 -0
  120. package/target/esbuild/navigation/tabs.jsx +7 -0
  121. package/target/esbuild/navigation/toolbar.jsx +23 -0
  122. package/target/esbuild/selection/base.jsx +1 -0
  123. package/target/esbuild/selection/checkbox.jsx +14 -0
  124. package/target/esbuild/selection/chip.jsx +23 -0
  125. package/target/esbuild/selection/index.jsx +1 -0
  126. package/target/esbuild/selection/radio.jsx +9 -0
  127. package/target/esbuild/selection/segmented.jsx +15 -0
  128. package/target/esbuild/selection/selection.css +1 -0
  129. package/target/esbuild/selection/switch.jsx +14 -0
  130. package/target/esbuild/shape/corner-rounding.jsx +1 -0
  131. package/target/esbuild/shape/cubic.jsx +1 -0
  132. package/target/esbuild/shape/index.jsx +1 -0
  133. package/target/esbuild/shape/material-shapes.jsx +1 -0
  134. package/target/esbuild/shape/morph.jsx +1 -0
  135. package/target/esbuild/shape/path.jsx +1 -0
  136. package/target/esbuild/shape/point.jsx +1 -0
  137. package/target/esbuild/shape/rounded-polygon.jsx +1 -0
  138. package/target/esbuild/shape/shapes.jsx +1 -0
  139. package/target/esbuild/spacing/index.jsx +1 -0
  140. package/target/esbuild/state/component.css +1 -0
  141. package/target/esbuild/state/component.jsx +1 -0
  142. package/target/esbuild/state/controller.jsx +1 -0
  143. package/target/esbuild/state/index.jsx +1 -0
  144. package/target/esbuild/state/ripple.jsx +1 -0
  145. package/target/esbuild/state/state.jsx +1 -0
  146. package/target/esbuild/state/style.jsx +1 -0
  147. package/target/esbuild/surface/carousel-layout.jsx +1 -0
  148. package/target/esbuild/surface/carousel.css +1 -0
  149. package/target/esbuild/surface/carousel.jsx +10 -0
  150. package/target/esbuild/surface/dialog.jsx +35 -0
  151. package/target/esbuild/surface/divider.jsx +1 -0
  152. package/target/esbuild/surface/drag.jsx +1 -0
  153. package/target/esbuild/surface/gestures.css +1 -0
  154. package/target/esbuild/surface/gestures.jsx +7 -0
  155. package/target/esbuild/surface/index.css +1 -0
  156. package/target/esbuild/surface/index.jsx +1 -0
  157. package/target/esbuild/surface/interactive.jsx +1 -0
  158. package/target/esbuild/surface/list-patterns.jsx +26 -0
  159. package/target/esbuild/surface/list.css +1 -0
  160. package/target/esbuild/surface/list.jsx +9 -0
  161. package/target/esbuild/surface/menu.css +1 -0
  162. package/target/esbuild/surface/menu.jsx +12 -0
  163. package/target/esbuild/surface/scaffold.jsx +47 -0
  164. package/target/esbuild/surface/sheet.jsx +21 -0
  165. package/target/esbuild/surface/side-sheet.jsx +17 -0
  166. package/target/esbuild/surface/slots.jsx +1 -0
  167. package/target/esbuild/surface/surface.css +1 -0
  168. package/target/esbuild/surface/surface.jsx +1 -0
  169. package/target/esbuild/text/index.css +1 -0
  170. package/target/esbuild/text/index.jsx +1 -0
  171. package/target/esbuild/text/text.css +1 -0
  172. package/target/esbuild/text/text.jsx +3 -0
  173. package/target/esbuild/text/typography.css +1 -0
  174. package/target/esbuild/text/typography.jsx +1 -0
  175. package/target/esbuild/util/box-side.jsx +1 -0
  176. package/target/esbuild/util/debug.jsx +1 -0
  177. package/target/esbuild/util/dom.jsx +1 -0
  178. package/target/esbuild/util/event.jsx +1 -0
  179. package/target/esbuild/util/index.jsx +1 -0
  180. package/target/esbuild/util/preconditions.jsx +1 -0
  181. package/target/esbuild/util/reactive.jsx +1 -0
  182. package/target/tsc/action/action.css.d.ts +3 -0
  183. package/target/tsc/action/base.d.ts +211 -0
  184. package/target/tsc/action/button.d.ts +126 -0
  185. package/target/tsc/action/fab-menu-context.d.ts +16 -0
  186. package/target/tsc/action/fab-menu.d.ts +112 -0
  187. package/target/tsc/action/fab.d.ts +98 -0
  188. package/target/tsc/action/group.d.ts +166 -0
  189. package/target/tsc/action/icon-button.d.ts +79 -0
  190. package/target/tsc/action/index.d.ts +24 -0
  191. package/target/tsc/action/split-button.d.ts +78 -0
  192. package/target/tsc/color/contrast.d.ts +48 -0
  193. package/target/tsc/color/dynamic.d.ts +203 -0
  194. package/target/tsc/color/hct.d.ts +114 -0
  195. package/target/tsc/color/index.css.d.ts +3 -0
  196. package/target/tsc/color/index.d.ts +23 -0
  197. package/target/tsc/color/palette.d.ts +30 -0
  198. package/target/tsc/color/scheme.d.ts +446 -0
  199. package/target/tsc/color/temperature.d.ts +24 -0
  200. package/target/tsc/container/card.css.d.ts +3 -0
  201. package/target/tsc/container/card.d.ts +110 -0
  202. package/target/tsc/container/elevation-shadow.css.d.ts +3 -0
  203. package/target/tsc/container/elevation-shadow.d.ts +23 -0
  204. package/target/tsc/container/index.d.ts +44 -0
  205. package/target/tsc/dom/client.d.ts +387 -0
  206. package/target/tsc/dom/index.d.ts +93 -0
  207. package/target/tsc/dom/server.d.ts +65 -0
  208. package/target/tsc/dom/types.d.ts +134 -0
  209. package/target/tsc/feedback/badge.d.ts +116 -0
  210. package/target/tsc/feedback/feedback.css.d.ts +3 -0
  211. package/target/tsc/feedback/focus.d.ts +20 -0
  212. package/target/tsc/feedback/index.d.ts +17 -0
  213. package/target/tsc/feedback/loading.d.ts +194 -0
  214. package/target/tsc/feedback/observe.d.ts +75 -0
  215. package/target/tsc/feedback/progress.d.ts +281 -0
  216. package/target/tsc/feedback/snackbar.d.ts +398 -0
  217. package/target/tsc/feedback/tooltip.d.ts +326 -0
  218. package/target/tsc/icon/icon.css.d.ts +3 -0
  219. package/target/tsc/icon/icon.d.ts +69 -0
  220. package/target/tsc/icon/index.d.ts +13 -0
  221. package/target/tsc/index.css.d.ts +3 -0
  222. package/target/tsc/index.d.ts +7 -0
  223. package/target/tsc/input/autocomplete.d.ts +119 -0
  224. package/target/tsc/input/base.d.ts +282 -0
  225. package/target/tsc/input/date-picker.css.d.ts +3 -0
  226. package/target/tsc/input/date-picker.d.ts +351 -0
  227. package/target/tsc/input/date-range-input.css.d.ts +3 -0
  228. package/target/tsc/input/date-time.d.ts +171 -0
  229. package/target/tsc/input/index.css.d.ts +3 -0
  230. package/target/tsc/input/index.d.ts +27 -0
  231. package/target/tsc/input/paired-input.d.ts +435 -0
  232. package/target/tsc/input/picker-dialog.css.d.ts +3 -0
  233. package/target/tsc/input/picker-dialog.d.ts +84 -0
  234. package/target/tsc/input/select.css.d.ts +3 -0
  235. package/target/tsc/input/select.d.ts +267 -0
  236. package/target/tsc/input/slider.css.d.ts +3 -0
  237. package/target/tsc/input/slider.d.ts +372 -0
  238. package/target/tsc/input/text-field.css.d.ts +3 -0
  239. package/target/tsc/input/text-field.d.ts +415 -0
  240. package/target/tsc/input/time-picker.css.d.ts +3 -0
  241. package/target/tsc/input/time-picker.d.ts +212 -0
  242. package/target/tsc/motion/frame.d.ts +36 -0
  243. package/target/tsc/motion/index.css.d.ts +3 -0
  244. package/target/tsc/motion/index.d.ts +34 -0
  245. package/target/tsc/motion/material.d.ts +110 -0
  246. package/target/tsc/motion/motion.d.ts +235 -0
  247. package/target/tsc/motion/spring.d.ts +223 -0
  248. package/target/tsc/motion/transition.css.d.ts +3 -0
  249. package/target/tsc/motion/transition.d.ts +597 -0
  250. package/target/tsc/motion/velocity.d.ts +54 -0
  251. package/target/tsc/navigation/app-bar.d.ts +473 -0
  252. package/target/tsc/navigation/base.d.ts +331 -0
  253. package/target/tsc/navigation/drawer.d.ts +301 -0
  254. package/target/tsc/navigation/index.d.ts +25 -0
  255. package/target/tsc/navigation/navigation.css.d.ts +3 -0
  256. package/target/tsc/navigation/navigation.d.ts +537 -0
  257. package/target/tsc/navigation/scroll.d.ts +218 -0
  258. package/target/tsc/navigation/search.d.ts +332 -0
  259. package/target/tsc/navigation/tabs.d.ts +497 -0
  260. package/target/tsc/navigation/toolbar.d.ts +248 -0
  261. package/target/tsc/selection/base.d.ts +100 -0
  262. package/target/tsc/selection/checkbox.d.ts +194 -0
  263. package/target/tsc/selection/chip.d.ts +358 -0
  264. package/target/tsc/selection/index.d.ts +21 -0
  265. package/target/tsc/selection/radio.d.ts +198 -0
  266. package/target/tsc/selection/segmented.d.ts +333 -0
  267. package/target/tsc/selection/selection.css.d.ts +3 -0
  268. package/target/tsc/selection/switch.d.ts +165 -0
  269. package/target/tsc/shape/corner-rounding.d.ts +36 -0
  270. package/target/tsc/shape/cubic.d.ts +215 -0
  271. package/target/tsc/shape/index.d.ts +35 -0
  272. package/target/tsc/shape/material-shapes.d.ts +176 -0
  273. package/target/tsc/shape/morph.d.ts +91 -0
  274. package/target/tsc/shape/path.d.ts +177 -0
  275. package/target/tsc/shape/point.d.ts +165 -0
  276. package/target/tsc/shape/rounded-polygon.d.ts +289 -0
  277. package/target/tsc/shape/shapes.d.ts +76 -0
  278. package/target/tsc/spacing/index.d.ts +19 -0
  279. package/target/tsc/state/component.css.d.ts +3 -0
  280. package/target/tsc/state/component.d.ts +276 -0
  281. package/target/tsc/state/controller.d.ts +257 -0
  282. package/target/tsc/state/index.d.ts +19 -0
  283. package/target/tsc/state/ripple.d.ts +50 -0
  284. package/target/tsc/state/state.d.ts +129 -0
  285. package/target/tsc/state/style.d.ts +22 -0
  286. package/target/tsc/surface/carousel-layout.d.ts +212 -0
  287. package/target/tsc/surface/carousel.css.d.ts +3 -0
  288. package/target/tsc/surface/carousel.d.ts +231 -0
  289. package/target/tsc/surface/dialog.d.ts +582 -0
  290. package/target/tsc/surface/divider.d.ts +92 -0
  291. package/target/tsc/surface/drag.d.ts +92 -0
  292. package/target/tsc/surface/gestures.css.d.ts +3 -0
  293. package/target/tsc/surface/gestures.d.ts +292 -0
  294. package/target/tsc/surface/index.css.d.ts +3 -0
  295. package/target/tsc/surface/index.d.ts +29 -0
  296. package/target/tsc/surface/interactive.d.ts +22 -0
  297. package/target/tsc/surface/list-patterns.d.ts +384 -0
  298. package/target/tsc/surface/list.css.d.ts +3 -0
  299. package/target/tsc/surface/list.d.ts +340 -0
  300. package/target/tsc/surface/menu.css.d.ts +3 -0
  301. package/target/tsc/surface/menu.d.ts +590 -0
  302. package/target/tsc/surface/scaffold.d.ts +337 -0
  303. package/target/tsc/surface/sheet.d.ts +384 -0
  304. package/target/tsc/surface/side-sheet.d.ts +183 -0
  305. package/target/tsc/surface/slots.d.ts +21 -0
  306. package/target/tsc/surface/surface.css.d.ts +3 -0
  307. package/target/tsc/surface/surface.d.ts +192 -0
  308. package/target/tsc/text/index.css.d.ts +3 -0
  309. package/target/tsc/text/index.d.ts +18 -0
  310. package/target/tsc/text/text.css.d.ts +3 -0
  311. package/target/tsc/text/text.d.ts +94 -0
  312. package/target/tsc/text/typography.css.d.ts +3 -0
  313. package/target/tsc/text/typography.d.ts +82 -0
  314. package/target/tsc/util/box-side.d.ts +76 -0
  315. package/target/tsc/util/debug.d.ts +20 -0
  316. package/target/tsc/util/dom.d.ts +35 -0
  317. package/target/tsc/util/event.d.ts +93 -0
  318. package/target/tsc/util/index.d.ts +12 -0
  319. package/target/tsc/util/preconditions.d.ts +79 -0
  320. package/target/tsc/util/reactive.d.ts +36 -0
@@ -0,0 +1,282 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomController } from "../dom/client";
3
+ /**
4
+ * Cleanup function returned by {@link observeFormReset}.
5
+ *
6
+ * Invoking the cleanup stops observing form resets. The cleanup is idempotent.
7
+ */
8
+ export type FormResetObserverCleanup = () => void;
9
+ /**
10
+ * Material input container variants.
11
+ *
12
+ * | Variant | Container |
13
+ * | --- | --- |
14
+ * | `"filled"` | Tinted container with an active indicator along its bottom edge. |
15
+ * | `"outlined"` | Transparent container enclosed by an outline, the label floating in a notch. |
16
+ */
17
+ export type InputVariant = "filled" | "outlined";
18
+ /**
19
+ * Orientation supported by range controls.
20
+ */
21
+ export type InputOrientation = "horizontal" | "vertical";
22
+ /**
23
+ * Content accepted by an input slot.
24
+ *
25
+ * Slots render any JSX content. `undefined`, `null`, booleans and the empty string render nothing
26
+ * and are treated as an absent slot.
27
+ */
28
+ export type InputSlot = JSX.Element;
29
+ /**
30
+ * Value-change callback for input components and pickers.
31
+ *
32
+ * Controlled components notify the parent of the requested value; uncontrolled components also
33
+ * invoke this callback. The component determines when its native or internal state is updated.
34
+ *
35
+ * @typeParam T - value reported by the component
36
+ * @param value - requested or newly edited value
37
+ * @param event - originating input, selection, or pointer event
38
+ */
39
+ export type InputValueChangeHandler<T> = (value: T, event: Event) => void;
40
+ /**
41
+ * Common visual and accessible slots for a field-like component.
42
+ */
43
+ export interface InputFieldSlots {
44
+ /**
45
+ * Field label.
46
+ *
47
+ * Children are used as a fallback label.
48
+ */
49
+ label?: InputSlot;
50
+ /**
51
+ * Supporting text shown below the container.
52
+ *
53
+ * Error text, when present, replaces the supporting text.
54
+ */
55
+ supportingText?: InputSlot;
56
+ /**
57
+ * Alias for {@link InputFieldSlots.supportingText}.
58
+ */
59
+ helperText?: InputSlot;
60
+ /**
61
+ * Error text shown below the container.
62
+ *
63
+ * Error text marks the field invalid.
64
+ */
65
+ errorText?: InputSlot;
66
+ /**
67
+ * Error text, or `true` to mark the field invalid without text.
68
+ *
69
+ * This is an alias for {@link InputFieldSlots.errorText} which additionally accepts the
70
+ * boolean form used by Material components.
71
+ */
72
+ error?: InputSlot;
73
+ /**
74
+ * Content placed immediately before the editable text.
75
+ */
76
+ prefix?: InputSlot;
77
+ /**
78
+ * Content placed immediately after the editable text.
79
+ */
80
+ suffix?: InputSlot;
81
+ /**
82
+ * Leading icon or content.
83
+ */
84
+ leading?: InputSlot;
85
+ /**
86
+ * Alias for {@link InputFieldSlots.leading}.
87
+ */
88
+ leadingIcon?: InputSlot;
89
+ /**
90
+ * Trailing icon or content.
91
+ */
92
+ trailing?: InputSlot;
93
+ /**
94
+ * Alias for {@link InputFieldSlots.trailing}.
95
+ */
96
+ trailingIcon?: InputSlot;
97
+ }
98
+ /**
99
+ * Element properties of a field, split between its container and its native control.
100
+ *
101
+ * @see {@link splitInputElementProps}
102
+ */
103
+ export interface InputElementPropsSplit {
104
+ /**
105
+ * Styling properties (`class`, `classList` and `style`) applied to the container element.
106
+ */
107
+ containerProps: Record<string, unknown>;
108
+ /**
109
+ * Remaining attribute and event properties applied to the native control.
110
+ */
111
+ elementProps: Record<string, unknown>;
112
+ /**
113
+ * Nested children, if any.
114
+ */
115
+ children: JSX.Element | undefined;
116
+ }
117
+ /**
118
+ * Split namespaced element properties between a field container and its native control.
119
+ *
120
+ * Styling properties (`class`, `classList` and `style`) belong to the container; children are
121
+ * returned separately; every other property belongs to the native control. Properties are read
122
+ * lazily, when the returned objects are read, so that a server renderer reads `children` only
123
+ * after it created the elements they are nested in, keeping hydration keys in document order.
124
+ *
125
+ * @param elemProps - element properties of a server-rendered field
126
+ * @returns split properties
127
+ */
128
+ export declare function splitInputElementProps(elemProps: object): InputElementPropsSplit;
129
+ /**
130
+ * Return the first slot of a set of aliases which renders content.
131
+ *
132
+ * Arguments are evaluated by the caller; pass resolved slot values rather than JSX getters which
133
+ * should only be read once.
134
+ *
135
+ * @param slots - slot aliases, in precedence order
136
+ * @returns first slot rendering content, or `undefined`
137
+ */
138
+ export declare function firstInputSlot(...slots: Array<InputSlot | undefined>): InputSlot | undefined;
139
+ /**
140
+ * Return the first slot of a set of aliases which renders content, reading aliases lazily.
141
+ *
142
+ * Slot properties are JSX getters which construct their content on every read. Unlike {@link
143
+ * firstInputSlot}, an alias is only read when every preceding alias is empty.
144
+ *
145
+ * @param aliases - slot alias getters, in precedence order
146
+ * @returns first slot rendering content, or `undefined`
147
+ */
148
+ export declare function firstInputSlotOf(...aliases: Array<() => InputSlot | undefined>): InputSlot | undefined;
149
+ /**
150
+ * Resolve the error of a field, reading each error slot at most once.
151
+ *
152
+ * @param props - field slots
153
+ * @returns error text, `true` for an error without text, or `undefined` when there is no error
154
+ */
155
+ export declare function inputErrorOf(props: InputFieldSlots): InputSlot | true | undefined;
156
+ /**
157
+ * Resolve the supporting slot of a field from its resolved error.
158
+ *
159
+ * Error text takes precedence over supporting text. Supporting slots are read only when the field
160
+ * has no error text.
161
+ *
162
+ * @param props - field slots
163
+ * @param error - field error resolved by {@link inputErrorOf}
164
+ * @returns supporting slot, or `undefined`
165
+ */
166
+ export declare function supportingSlotOf(props: InputFieldSlots, error: InputSlot | true | undefined): InputSlot | undefined;
167
+ /**
168
+ * Join element ids into an id reference list, such as the value of `aria-describedby`.
169
+ *
170
+ * @param ids - ids, or `undefined` for an absent reference
171
+ * @returns space-separated id references, or `undefined` when there are none
172
+ */
173
+ export declare function idReferencesOf(...ids: Array<string | undefined>): string | undefined;
174
+ /**
175
+ * Return the slot rendered as supporting text.
176
+ *
177
+ * Error text takes precedence over supporting text.
178
+ *
179
+ * @param props - field slots
180
+ * @returns supporting slot, or `undefined`
181
+ */
182
+ export declare function supportingSlot(props: InputFieldSlots): InputSlot | undefined;
183
+ /**
184
+ * Test whether a field shows an error.
185
+ *
186
+ * A field shows an error when it has error text or when {@link InputFieldSlots.error} is `true`.
187
+ *
188
+ * @param props - field slots
189
+ * @returns `true` if, and only if, the field shows an error
190
+ */
191
+ export declare function hasInputError(props: InputFieldSlots): boolean;
192
+ /**
193
+ * Label of a field, rendered once into its floating label and drawn again by its copies.
194
+ *
195
+ * @see {@link createFieldLabel}
196
+ */
197
+ export interface FieldLabel {
198
+ /**
199
+ * Pass the content of the floating label through, so that the copies draw it.
200
+ *
201
+ * The floating label inserts the label slot through this function, where it nests the slot.
202
+ *
203
+ * @param slot - label slot content
204
+ * @returns `slot`
205
+ */
206
+ content(slot: InputSlot | undefined): InputSlot | undefined;
207
+ /**
208
+ * Render the copies of the floating label, after it.
209
+ *
210
+ * @param label - function returning the floating label element, which the client observes;
211
+ * the server, which renders no element, omits it
212
+ * @returns label copies, in document order
213
+ */
214
+ copies(label?: () => HTMLElement | null): JSX.Element;
215
+ }
216
+ /**
217
+ * Create the label of a field, rendered once into its floating label and drawn again by its
218
+ * copies.
219
+ *
220
+ * Besides its floating label, which names the native control, a field renders copies of the label
221
+ * after it, hidden from assistive technology and inert, which carry its motion and show it at
222
+ * rest. A node is in one place at a time: were each copy to render the label slot, a node cached
223
+ * by the author, rather than constructed on every read, would move into the last copy and leave
224
+ * the native control without a name. Only the floating label therefore renders the slot, read
225
+ * once where the floating label nests it, and keeps the nodes of the slot; the copies draw its
226
+ * content. The server evaluates each property once ({@link
227
+ * ../dom/server#defineServerDomComponent}), so that the client, reading the slot once too, creates
228
+ * the elements the server rendered. Cloning only the nodes the floating label holds would instead
229
+ * depend on the order in which the floating label and its copies are updated, and would still
230
+ * construct other content once for each copy.
231
+ *
232
+ * The server renders the content of the floating label into each copy, repeating the hydration
233
+ * keys of its elements, which hydration claims in the floating label, the first in the document.
234
+ * The client renders clones of the content into the copies, which follow the content and the
235
+ * changes within its nodes; while hydrating, the copies keep the nodes the server rendered.
236
+ *
237
+ * @param component - CSS class of the field root, which prefixes the classes of the copies
238
+ * @returns field label
239
+ */
240
+ export declare function createFieldLabel(component: "cw-Select" | "cw-TextField"): FieldLabel;
241
+ /**
242
+ * Observe the inline size of the floating label of a field, publishing it on the field root.
243
+ *
244
+ * An outlined field cuts the notch of its outline from the label progress and the inline size of
245
+ * its floating label (`text-field.css`). The floating label is laid out in the legend, which the
246
+ * notch sizes; the moving copy at the floating size, rendered by {@link createFieldLabel}, is
247
+ * laid out alike outside of the legend, and is observed instead. Layout ignores the transform of
248
+ * the copy, so the observer reports a size when the text, font or available width of the label
249
+ * change, and never while the label moves. A field observes its label whatever its variant,
250
+ * which may change.
251
+ *
252
+ * The controller publishes the size as a private custom property of the field root, once
253
+ * measured. It is never rendered, so that the server and the client render the same markup;
254
+ * until it is published, the notch of an outlined field fits its floating label unless the label
255
+ * rests in the container.
256
+ *
257
+ * @param controller - field controller
258
+ * @param component - CSS class of the field root, which prefixes the classes of the copies
259
+ * @returns cleanup function, which stops observing the label
260
+ */
261
+ export declare function observeLabelInlineSize(controller: Pick<DomController, "setStyle" | "styleElement">, component: "cw-Select" | "cw-TextField"): () => void;
262
+ /**
263
+ * Observe the native reset of the form owning an input control.
264
+ *
265
+ * The callback runs *after* the browser restored native control values of a non-canceled reset,
266
+ * once per reset. Form ownership is resolved when the reset is dispatched, so the observation
267
+ * follows controls moved between forms of the same document or shadow root, and changes of their
268
+ * `form` attribute. The observed root is resolved when the observation starts; a control moved to
269
+ * another document or shadow root is followed after the next reset in its previous root, so
270
+ * components observe again after they are mounted. Forms outside of any document are observed
271
+ * directly.
272
+ *
273
+ * Observation costs one capture-phase listener per observed root and no work until a form is
274
+ * reset.
275
+ *
276
+ * @param element - native control or an element contained by its owning form
277
+ * @param callback - callback invoked after a non-canceled native reset
278
+ * @param onRootChanged - optional callback invoked after the element is found in another
279
+ * document or shadow root
280
+ * @returns cleanup function
281
+ */
282
+ export declare function observeFormReset(element: HTMLElement, callback: () => void, onRootChanged?: () => void): FormResetObserverCleanup;
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: MPL-2.0
2
+
3
+ export {};
@@ -0,0 +1,351 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomComponent, DomProps } from "..";
3
+ import type { InputValueChangeHandler } from "./base";
4
+ import "./date-picker.css";
5
+ /**
6
+ * ISO dates selected by a {@link DateRangePicker}; an empty end date represents a pending range.
7
+ */
8
+ export type DatePickerRange = readonly [start: string, end: string];
9
+ /**
10
+ * Translatable texts of the calendar pickers.
11
+ *
12
+ * Dates, months, years and weekdays are formatted for {@link DatePickerBaseProps.locale}. Error
13
+ * texts contain placeholders in braces, which are replaced as documented per entry.
14
+ */
15
+ export interface DatePickerLabels {
16
+ /**
17
+ * Title of a single-date picker in calendar mode.
18
+ *
19
+ * @defaultValue `"Select date"`
20
+ */
21
+ selectDate: string;
22
+ /**
23
+ * Title of a range picker in calendar mode.
24
+ *
25
+ * @defaultValue `"Select dates"`
26
+ */
27
+ selectRange: string;
28
+ /**
29
+ * Title of a single-date picker in input mode.
30
+ *
31
+ * @defaultValue `"Enter date"`
32
+ */
33
+ enterDate: string;
34
+ /**
35
+ * Title of a range picker in input mode.
36
+ *
37
+ * @defaultValue `"Enter dates"`
38
+ */
39
+ enterRange: string;
40
+ /**
41
+ * Headline of a single-date picker without a selection, in calendar mode.
42
+ *
43
+ * @defaultValue `"Selected date"`
44
+ */
45
+ selectedDate: string;
46
+ /**
47
+ * Headline of a single-date picker without a selection, in input mode.
48
+ *
49
+ * @defaultValue `"Entered date"`
50
+ */
51
+ enteredDate: string;
52
+ /**
53
+ * Label of the date field of a single-date picker in input mode.
54
+ *
55
+ * @defaultValue `"Date"`
56
+ */
57
+ date: string;
58
+ /**
59
+ * Headline placeholder and field label of a range start.
60
+ *
61
+ * @defaultValue `"Start date"`
62
+ */
63
+ startDate: string;
64
+ /**
65
+ * Headline placeholder and field label of a range end.
66
+ *
67
+ * @defaultValue `"End date"`
68
+ */
69
+ endDate: string;
70
+ /**
71
+ * Accessible label of the previous-month action.
72
+ *
73
+ * @defaultValue `"Previous month"`
74
+ */
75
+ previousMonth: string;
76
+ /**
77
+ * Accessible label of the next-month action.
78
+ *
79
+ * @defaultValue `"Next month"`
80
+ */
81
+ nextMonth: string;
82
+ /**
83
+ * Accessible label of the previous-year action of a docked picker.
84
+ *
85
+ * @defaultValue `"Previous year"`
86
+ */
87
+ previousYear: string;
88
+ /**
89
+ * Accessible label of the next-year action of a docked picker.
90
+ *
91
+ * @defaultValue `"Next year"`
92
+ */
93
+ nextYear: string;
94
+ /**
95
+ * Accessible label of the month list of a docked picker, and description of its menu button.
96
+ *
97
+ * @defaultValue `"Month"`
98
+ */
99
+ month: string;
100
+ /**
101
+ * Accessible label of the year grid or list, and description of a docked year menu button.
102
+ *
103
+ * @defaultValue `"Year"`
104
+ */
105
+ year: string;
106
+ /**
107
+ * Description of the year toggle while days are shown.
108
+ *
109
+ * @defaultValue `"Switch to selecting a year"`
110
+ */
111
+ yearSelection: string;
112
+ /**
113
+ * Description of the year toggle while years are shown.
114
+ *
115
+ * @defaultValue `"Switch to selecting a day"`
116
+ */
117
+ daySelection: string;
118
+ /**
119
+ * Accessible label of the action switching to input mode.
120
+ *
121
+ * @defaultValue `"Switch to date input"`
122
+ */
123
+ switchToInput: string;
124
+ /**
125
+ * Accessible label of the action switching to calendar mode.
126
+ *
127
+ * @defaultValue `"Switch to calendar"`
128
+ */
129
+ switchToCalendar: string;
130
+ /**
131
+ * Error of a typed date that is not a date; `{pattern}` is the locale's pattern, such as
132
+ * "MM/DD/YYYY".
133
+ *
134
+ * @defaultValue `"Date does not match expected pattern: {pattern}"`
135
+ */
136
+ invalidPattern: string;
137
+ /**
138
+ * Error of a typed date outside the calendar's years; `{start}` and `{end}` are its first and
139
+ * last year.
140
+ *
141
+ * @defaultValue `"Date out of expected year range {start} - {end}"`
142
+ */
143
+ invalidYearRange: string;
144
+ /**
145
+ * Error of a typed date which cannot be selected; `{date}` is the typed date.
146
+ *
147
+ * @defaultValue `"Date not allowed: {date}"`
148
+ */
149
+ notAllowed: string;
150
+ /**
151
+ * Error of a typed range whose end precedes its start.
152
+ *
153
+ * @defaultValue `"Invalid date range input"`
154
+ */
155
+ invalidRange: string;
156
+ }
157
+ /**
158
+ * Properties shared by the Material calendar pickers.
159
+ */
160
+ export type DatePickerBaseProps = DomProps<HTMLDivElement, JSX.HTMLAttributes<HTMLDivElement>> & {
161
+ /**
162
+ * Locale of the Gregorian calendar texts and numerals, and of the pattern of typed dates.
163
+ *
164
+ * @defaultValue `"en-US"`
165
+ */
166
+ locale?: string;
167
+ /**
168
+ * First weekday, where Sunday is `0`.
169
+ *
170
+ * @defaultValue first weekday of the region of {@link DatePickerBaseProps.locale}, or of its
171
+ * `fw` Unicode extension
172
+ */
173
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
174
+ /**
175
+ * Earliest selectable ISO date.
176
+ *
177
+ * @defaultValue `"1900-01-01"`
178
+ */
179
+ min?: string;
180
+ /**
181
+ * Latest selectable ISO date.
182
+ *
183
+ * @defaultValue `"2100-12-31"`
184
+ */
185
+ max?: string;
186
+ /**
187
+ * Initial visible month in `YYYY-MM` form.
188
+ *
189
+ * @remarks
190
+ * This is read once; changing it does not navigate an existing picker.
191
+ *
192
+ * @defaultValue month of the selected date, or of today without a selection
193
+ */
194
+ defaultMonth?: string;
195
+ /**
196
+ * ISO date marked as today.
197
+ *
198
+ * Supply the same date on the server and client to preserve hydration across time zones or
199
+ * midnight.
200
+ *
201
+ * @remarks
202
+ * This is read once when the picker is created and is **not** reactive.
203
+ *
204
+ * @defaultValue local calendar date when the picker is created
205
+ */
206
+ today?: string;
207
+ /**
208
+ * Initial calendar or text input mode.
209
+ *
210
+ * @defaultValue `"calendar"`
211
+ */
212
+ defaultDisplayMode?: "calendar" | "input";
213
+ /**
214
+ * Layout of a range calendar: a continuous vertical list of months, or one month at a time.
215
+ *
216
+ * @defaultValue `"continuous"`
217
+ */
218
+ rangeLayout?: "continuous" | "paged";
219
+ /**
220
+ * Modal pickers show a headline with the selection and a mode toggle. Docked pickers attach to
221
+ * a text field: they show month and year menus with adjacent-month days and no headline.
222
+ *
223
+ * @defaultValue `"modal"`
224
+ */
225
+ presentation?: "modal" | "docked";
226
+ /**
227
+ * Disable every control and the form values.
228
+ *
229
+ * @defaultValue `false`
230
+ */
231
+ disabled?: boolean;
232
+ /**
233
+ * Allow browsing while preventing selection changes.
234
+ *
235
+ * @defaultValue `false`
236
+ */
237
+ readOnly?: boolean;
238
+ /**
239
+ * Form field name. Ranges submit two values with this name, in start, end order.
240
+ */
241
+ name?: string;
242
+ /**
243
+ * Id of the form receiving the selection values.
244
+ */
245
+ form?: string;
246
+ /**
247
+ * Predicate rejecting dates which cannot be selected.
248
+ *
249
+ * @param date - Gregorian calendar date in `YYYY-MM-DD` form
250
+ * @returns `true` if, and only if, `date` cannot be selected
251
+ */
252
+ isDateDisabled?: (date: string) => boolean;
253
+ /**
254
+ * Translations of the picker texts.
255
+ */
256
+ labels?: Partial<DatePickerLabels>;
257
+ };
258
+ /**
259
+ * {@link DatePicker} component properties.
260
+ */
261
+ export type DatePickerProps = DatePickerBaseProps & {
262
+ /**
263
+ * Current controlled ISO date, or an empty string without a selection.
264
+ *
265
+ * Supplying this property, including `undefined`, selects controlled mode at construction.
266
+ * Handle {@link DatePickerProps.onChange} and update this property to accept a date.
267
+ */
268
+ value?: string;
269
+ /**
270
+ * Initial ISO date of an uncontrolled picker.
271
+ */
272
+ defaultValue?: string;
273
+ /**
274
+ * Notify the parent after a date is chosen.
275
+ */
276
+ onChange?: InputValueChangeHandler<string>;
277
+ };
278
+ /**
279
+ * {@link DateRangePicker} component properties.
280
+ */
281
+ export type DateRangePickerProps = DatePickerBaseProps & {
282
+ /**
283
+ * Current controlled ISO date pair; an empty end date represents a pending range.
284
+ *
285
+ * Supplying this property, including `undefined`, selects controlled mode at construction.
286
+ * Handle {@link DateRangePickerProps.onChange} to accept each chosen endpoint.
287
+ */
288
+ value?: DatePickerRange;
289
+ /**
290
+ * Initial ISO date pair of an uncontrolled picker.
291
+ */
292
+ defaultValue?: DatePickerRange;
293
+ /**
294
+ * Notify the parent after each endpoint is chosen, including a pending `[start, ""]` range.
295
+ */
296
+ onChange?: InputValueChangeHandler<DatePickerRange>;
297
+ };
298
+ /**
299
+ * Material 3 date picker.
300
+ *
301
+ * Date pickers select a date from a calendar or a text field. ISO values use the Gregorian
302
+ * calendar in UTC, so selection, bounds and month changes do not depend on time zones or
303
+ * daylight-saving transitions. Compose with a {@link ./picker-dialog#PickerDialog | picker
304
+ * dialog} for a modal or docked picker with confirmation.
305
+ *
306
+ * # States
307
+ *
308
+ * The days form a grid of focusable cells: arrows move by day and week, Home and End to the week
309
+ * bounds, Page Up and Page Down by month (with Shift, by year), and Enter or Space chooses the
310
+ * focused date. Disabled dates are skipped. `disabled` disables every control; `readOnly` allows
311
+ * browsing only. Clicks and keys are also ignored while the native controls of the picker match
312
+ * `:disabled`, as within a disabled `fieldset`. A modal picker switches between calendar and text
313
+ * input mode, whose fields take the digits of a date in the order of
314
+ * {@link DatePickerBaseProps.locale}, as Compose `DateInput` does, and validate complete dates
315
+ * against the bounds and {@link DatePickerBaseProps.isDateDisabled}.
316
+ *
317
+ * # Design
318
+ *
319
+ * Picker design is controlled through the [`cw-DatePicker`](./date-picker.yaml) component design
320
+ * attribute, with a `docked` theme. The root receives `cw-DatePicker-docked` and
321
+ * `cw-DatePicker-disabled`; date cells receive `cw-DatePicker-selected`, `cw-DatePicker-today`
322
+ * and, in ranges, `cw-DatePicker-inRange`, `cw-DatePicker-rangeStart` and
323
+ * `cw-DatePicker-rangeEnd`.
324
+ *
325
+ * # Elements
326
+ *
327
+ * A modal picker shows a header with its title, the selection headline and the mode toggle above
328
+ * a divider, then the month navigation and the month grid, or the year grid while it is open. A
329
+ * docked picker shows month and year menus instead, and the days of adjacent months. Hidden
330
+ * inputs submit the selection under {@link DatePickerBaseProps.name}.
331
+ *
332
+ * @param props - component properties
333
+ * @returns rendered component elements
334
+ */
335
+ export declare const DatePicker: DomComponent<DatePickerProps>;
336
+ /**
337
+ * Material 3 date range picker.
338
+ *
339
+ * Range pickers select a start and an end date: the first chosen date starts a range, a later
340
+ * date completes it, and an earlier date starts a new range (Compose `DateRangePicker`). Modal
341
+ * range pickers scroll a continuous list of months unless
342
+ * {@link DatePickerBaseProps.rangeLayout} is `"paged"`. Both dates submit under
343
+ * {@link DatePickerBaseProps.name}, in start, end order.
344
+ *
345
+ * See {@link DatePicker} for states, design and elements; range cells are filled between the
346
+ * endpoints.
347
+ *
348
+ * @param props - component properties
349
+ * @returns rendered component elements
350
+ */
351
+ export declare const DateRangePicker: DomComponent<DateRangePickerProps>;
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: MPL-2.0
2
+
3
+ export {};