@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,218 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomComponent, StyleElement } from "..";
3
+ import type { NavigationElementProps, NavigationOrientation } from "./base";
4
+ import { DomController } from "../dom/client";
5
+ import "./navigation.css";
6
+ /**
7
+ * {@link Scrollbar} component properties.
8
+ */
9
+ export type ScrollbarProps = NavigationElementProps<HTMLDivElement> & {
10
+ /**
11
+ * Id of the scrollable element controlled by this scrollbar.
12
+ *
13
+ * The element is resolved in the scrollbar's document or shadow root, including when it is
14
+ * inserted after the scrollbar.
15
+ */
16
+ controls: string;
17
+ /**
18
+ * Accessible scrollbar label.
19
+ *
20
+ * @defaultValue `"Scroll position"`
21
+ */
22
+ label?: string | undefined;
23
+ /**
24
+ * Scrollbar orientation.
25
+ *
26
+ * @defaultValue `"vertical"`
27
+ */
28
+ orientation?: NavigationOrientation | undefined;
29
+ /**
30
+ * Controlled scroll position, within `min` and `max`.
31
+ */
32
+ value?: number | undefined;
33
+ /**
34
+ * Initial scroll position of an uncontrolled scrollbar.
35
+ *
36
+ * @defaultValue `0`
37
+ */
38
+ defaultValue?: number | undefined;
39
+ /**
40
+ * Value mapped to the start of the scrollable range.
41
+ *
42
+ * @defaultValue `0`
43
+ */
44
+ min?: number | undefined;
45
+ /**
46
+ * Value mapped to the end of the scrollable range.
47
+ *
48
+ * @defaultValue `100`
49
+ */
50
+ max?: number | undefined;
51
+ /**
52
+ * Arrow-key increment, in value units.
53
+ *
54
+ * @defaultValue `10`
55
+ */
56
+ step?: number | undefined;
57
+ /**
58
+ * Disable scrollbar interaction.
59
+ *
60
+ * @defaultValue `false`
61
+ */
62
+ disabled?: boolean | undefined;
63
+ /**
64
+ * Handle a changed scroll value from interaction or from the associated scroll target.
65
+ *
66
+ * Runs before a distinct `onChange` callback; identical references run once. Uncontrolled
67
+ * state is updated first. A native scroll of the target is never reverted: with a controlled
68
+ * `value`, update the property to keep the thumb in step with the content. Cancelling this
69
+ * callback does not roll back uncontrolled state.
70
+ *
71
+ * @param value - requested value clamped to the scrollbar range
72
+ * @param event - originating keyboard, pointer, or native scroll event
73
+ */
74
+ onValueChange?: (value: number, event: Event) => void;
75
+ /**
76
+ * Alias for {@link ScrollbarProps.onValueChange}.
77
+ */
78
+ onChange?: (value: number, event: Event) => void;
79
+ };
80
+ /**
81
+ * {@link ScrollField} component properties.
82
+ */
83
+ export type ScrollFieldProps = NavigationElementProps<HTMLDivElement> & {
84
+ /**
85
+ * Scroll axis of the field.
86
+ *
87
+ * @defaultValue `"vertical"`
88
+ */
89
+ orientation?: NavigationOrientation | undefined;
90
+ };
91
+ /**
92
+ * Client controller of a semantic scrollbar bound to a scrollable element.
93
+ *
94
+ * The controller follows the target's native scrolling, maps keyboard and pointer input onto the
95
+ * target, and positions the thumb without replacing the native scroll container. Horizontal
96
+ * scrollbars follow the target's text direction: in right-to-left content, the start of the
97
+ * range is at the right edge and the arrow keys move the thumb in their visual direction.
98
+ *
99
+ * # Elements
100
+ *
101
+ * | Element | Description |
102
+ * | ------- | ----------- |
103
+ * | `div.cw-Scrollbar[role=scrollbar]` | Focusable track; its `::after` element is the thumb. |
104
+ *
105
+ * The thumb is positioned with the `--cw-Scrollbar-thumb-size` and `--cw-Scrollbar-thumb-offset`
106
+ * inline properties, in CSS pixels from the track's left or top edge.
107
+ */
108
+ export declare class ScrollbarController extends DomController<ScrollbarProps> {
109
+ #private;
110
+ /**
111
+ * Construct a new `ScrollbarController`.
112
+ *
113
+ * Range, step, orientation, and the initial value are read without tracking; later changes are
114
+ * applied by {@link ScrollbarController.applyComponentProps}.
115
+ *
116
+ * @param props - component properties
117
+ */
118
+ constructor(props: ScrollbarProps);
119
+ /**
120
+ * Apply local properties to component state and styling.
121
+ *
122
+ * @see {@link ../dom/client#DomController.applyComponentProps}
123
+ */
124
+ protected applyComponentProps(): void;
125
+ /**
126
+ * Handle style element replacement before the controller reference is updated.
127
+ *
128
+ * The scrollbar renders a static track, so this binds its listeners once. The target is
129
+ * resolved again in a microtask, after the track is inserted into its document.
130
+ *
131
+ * @param curr - new style element, or `null` when absent
132
+ * @see {@link ../dom/client#DomController.onStyleElementChanged}
133
+ */
134
+ protected onStyleElementChanged(curr: StyleElement | null): void;
135
+ /**
136
+ * Release the target binding and root observation when the controller is disposed.
137
+ *
138
+ * @see {@link ../dom/client#DomController.onControllerCleanup}
139
+ */
140
+ protected onControllerCleanup(): void;
141
+ /**
142
+ * Render the static scrollbar track.
143
+ *
144
+ * @param children - nested component children, possibly an accessor
145
+ * @returns rendered component elements
146
+ * @see {@link ../dom/client#DomController.render}
147
+ */
148
+ protected render(children: JSX.Element): JSX.Element;
149
+ }
150
+ /**
151
+ * Semantic scrollbar bound to a scrollable element.
152
+ *
153
+ * The scrollbar is a focusable `role="scrollbar"` track linked to its target through
154
+ * `aria-controls`. Arrow keys move by {@link ScrollbarProps.step | step}, Page Up and Page Down by
155
+ * one viewport, and Home and End to the range limits; pointer presses jump the thumb, and the thumb
156
+ * can be dragged. The target's own scrolling, by wheel, touch, or keyboard, moves the thumb.
157
+ *
158
+ * Material 3 does not define a scrollbar component; this is a web control styled with Material
159
+ * color and shape roles. Native scrollbars remain appropriate for most scroll containers.
160
+ *
161
+ * # Design
162
+ *
163
+ * Scrollbar design is controlled through the [`cw-Scrollbar`](./scroll.yaml) component design
164
+ * attribute. A disabled scrollbar has the `cw-Scrollbar-disabled` class.
165
+ *
166
+ * @param props - component properties
167
+ * @returns rendered element
168
+ */
169
+ export declare const Scrollbar: DomComponent<ScrollbarProps>;
170
+ /**
171
+ * Client controller of a scroll field.
172
+ */
173
+ export declare class ScrollFieldController extends DomController<ScrollFieldProps> {
174
+ /**
175
+ * Construct a new `ScrollFieldController`.
176
+ *
177
+ * @param props - component properties
178
+ */
179
+ constructor(props: ScrollFieldProps);
180
+ /**
181
+ * Apply local properties to component state and styling.
182
+ *
183
+ * @see {@link ../dom/client#DomController.applyComponentProps}
184
+ */
185
+ protected applyComponentProps(): void;
186
+ /**
187
+ * Render the static scroll container.
188
+ *
189
+ * @param children - nested component children, possibly an accessor
190
+ * @returns rendered component elements
191
+ * @see {@link ../dom/client#DomController.render}
192
+ */
193
+ protected render(children: JSX.Element): JSX.Element;
194
+ }
195
+ /**
196
+ * Scroll container which can be paired with a {@link Scrollbar}.
197
+ *
198
+ * The field scrolls along its {@link ScrollFieldProps.orientation | orientation} with native
199
+ * scrolling; give it an `attr:id` and pass that id to the scrollbar's `controls`.
200
+ *
201
+ * @param props - component properties
202
+ * @returns rendered element
203
+ */
204
+ export declare const ScrollField: DomComponent<ScrollFieldProps>;
205
+ /**
206
+ * Vertical {@link Scrollbar}, which is the scrollbar's default orientation.
207
+ */
208
+ export declare const VerticalScrollbar: typeof Scrollbar;
209
+ /**
210
+ * Horizontal {@link Scrollbar}.
211
+ *
212
+ * The orientation remains overridable for callers which use the alias as a convenience rather
213
+ * than as a strict horizontal variant.
214
+ *
215
+ * @param props - component properties
216
+ * @returns rendered element
217
+ */
218
+ export declare const HorizontalScrollbar: typeof Scrollbar;
@@ -0,0 +1,332 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomComponent, StyleElement } from "..";
3
+ import type { NavigationElementProps, NavigationOpenChangeHandler } from "./base";
4
+ import { DomController } from "../dom/client";
5
+ import "../container/elevation-shadow.css";
6
+ import "./navigation.css";
7
+ /**
8
+ * Properties of search bars and search views.
9
+ */
10
+ export type SearchBarProps = NavigationElementProps<HTMLElement> & {
11
+ /**
12
+ * Style of the expanded search view.
13
+ *
14
+ * | Design | Docked view | Full-screen view |
15
+ * | ----------- | ------------------------------------ | --------------------------------- |
16
+ * | `contained` | Results in a container below the bar | The bar keeps its shape |
17
+ * | `divided` | Bar and results in one container | A 72px header above a divider |
18
+ *
19
+ * The contained style is the Material 3 Expressive one; the divided style is the baseline one.
20
+ *
21
+ * @defaultValue `"contained"`
22
+ */
23
+ design?: "contained" | "divided" | undefined;
24
+ /**
25
+ * Expanded presentation: results below the bar, or a full-screen search view.
26
+ *
27
+ * The full-screen view is a modal dialog in the browser top layer which retains the native
28
+ * input and result nodes; it expands from the bar with a container transform.
29
+ *
30
+ * @defaultValue `"docked"`; {@link SearchView} and {@link SearchAppBar} default to
31
+ * `"fullscreen"`.
32
+ */
33
+ expansion?: "docked" | "fullscreen" | undefined;
34
+ /**
35
+ * Accessible label of the full-screen view's back button.
36
+ *
37
+ * @defaultValue `"Close search"`
38
+ */
39
+ backLabel?: string | undefined;
40
+ /**
41
+ * Controlled query text.
42
+ */
43
+ query?: string | undefined;
44
+ /**
45
+ * Initial query text of an uncontrolled search bar.
46
+ */
47
+ defaultQuery?: string | undefined;
48
+ /**
49
+ * Controlled expanded state.
50
+ */
51
+ expanded?: boolean | undefined;
52
+ /**
53
+ * Initial expanded state of an uncontrolled search bar.
54
+ */
55
+ defaultExpanded?: boolean | undefined;
56
+ /**
57
+ * Supporting text shown while the query is empty.
58
+ */
59
+ placeholder?: string | undefined;
60
+ /**
61
+ * Center the placeholder and the query text of the collapsed bar.
62
+ *
63
+ * This is the `app:textCentered` search bar attribute of Material Components for Android, one
64
+ * of its Material 3 Expressive updates, added in version 1.13.0 (first released in
65
+ * 1.13.0-alpha12). The text is centered between the leading and trailing content of the bar.
66
+ * An expanded bar edits start-aligned text, as the Material Components search view does.
67
+ *
68
+ * @defaultValue `false`
69
+ */
70
+ textCentered?: boolean | undefined;
71
+ /**
72
+ * Accessible name of the search combobox and of the full-screen view.
73
+ *
74
+ * @defaultValue `"Search"`
75
+ */
76
+ inputLabel?: string | undefined;
77
+ /**
78
+ * Form field name of the search input.
79
+ */
80
+ inputName?: string | undefined;
81
+ /**
82
+ * Id of an external form the search input belongs to.
83
+ */
84
+ inputForm?: string | undefined;
85
+ /**
86
+ * Autocomplete hint of the search input.
87
+ */
88
+ inputAutoComplete?: string | undefined;
89
+ /**
90
+ * Require a query for form submission.
91
+ */
92
+ inputRequired?: boolean | undefined;
93
+ /**
94
+ * Accessible label of the results listbox.
95
+ *
96
+ * @defaultValue `"Search results"`
97
+ */
98
+ resultsLabel?: string | undefined;
99
+ /**
100
+ * Disable the input and expansion.
101
+ */
102
+ disabled?: boolean | undefined;
103
+ /**
104
+ * Prevent query changes while keeping the input focusable.
105
+ */
106
+ readOnly?: boolean | undefined;
107
+ /**
108
+ * Expand when the input receives focus by any means.
109
+ *
110
+ * Otherwise, the bar expands when it is clicked or tapped, when text is entered, or when the
111
+ * arrow keys request results; keyboard focus alone does not open a view.
112
+ *
113
+ * @defaultValue `false`
114
+ */
115
+ openOnFocus?: boolean | undefined;
116
+ /**
117
+ * Stable id of the search input.
118
+ */
119
+ inputId?: string | undefined;
120
+ /**
121
+ * Stable id of the results listbox.
122
+ */
123
+ resultsId?: string | undefined;
124
+ /**
125
+ * Leading icon or icon button.
126
+ */
127
+ leadingIcon?: JSX.Element;
128
+ /**
129
+ * Trailing icon or icon button.
130
+ */
131
+ trailingIcon?: JSX.Element;
132
+ /**
133
+ * Trailing avatar image or element, sized to the avatar role in a 48px target.
134
+ */
135
+ avatar?: JSX.Element;
136
+ /**
137
+ * Results, made of `role="option"` elements; children are used when omitted.
138
+ *
139
+ * An option's `data-value`, or else its text, is the query selected with it.
140
+ */
141
+ results?: JSX.Element;
142
+ /**
143
+ * Handle a native query edit or an option selection.
144
+ *
145
+ * Runs before a distinct `onChange` callback; identical references run once. A controlled
146
+ * query is then restored from `query` unless the parent accepts the edit. Cancelling this
147
+ * callback does not restore an uncontrolled query.
148
+ *
149
+ * @param query - edited query or selected option value
150
+ * @param event - native input event or option activation event
151
+ */
152
+ onQueryChange?: ((query: string, event: Event) => void) | undefined;
153
+ /**
154
+ * Alias for {@link SearchBarProps.onQueryChange}.
155
+ */
156
+ onChange?: ((query: string, event: Event) => void) | undefined;
157
+ /**
158
+ * Handle a requested expanded state.
159
+ *
160
+ * With controlled `expanded`, the parent must update the property to accept the request.
161
+ */
162
+ onExpandedChange?: NavigationOpenChangeHandler | undefined;
163
+ /**
164
+ * Handle Enter submission or option selection.
165
+ *
166
+ * An option selection first invokes the query callbacks and requests collapse. Cancelling
167
+ * this callback does not undo that selection.
168
+ *
169
+ * @param query - submitted input text or selected option value
170
+ * @param event - submitting key event or option activation event
171
+ */
172
+ onSearch?: ((query: string, event: Event) => void) | undefined;
173
+ };
174
+ /**
175
+ * Properties of a {@link SearchAppBar}.
176
+ */
177
+ export type SearchAppBarProps = SearchBarProps & {
178
+ /**
179
+ * Leading navigation icon button, outside the search bar.
180
+ */
181
+ navigationIcon?: JSX.Element;
182
+ /**
183
+ * Action icon buttons, inside or outside the search bar.
184
+ */
185
+ actions?: JSX.Element;
186
+ /**
187
+ * Placement of {@link SearchAppBarProps.actions | actions}: in the bar's trailing slot, or
188
+ * after the bar.
189
+ *
190
+ * @defaultValue `"outside"`
191
+ */
192
+ actionsPlacement?: "inside" | "outside" | undefined;
193
+ /**
194
+ * Apply the on-scroll container colors.
195
+ *
196
+ * When omitted, an app bar with a {@link SearchAppBarProps.scrollBehavior} applies them while
197
+ * its content is scrolled.
198
+ */
199
+ scrolled?: boolean | undefined;
200
+ /**
201
+ * Scroll behavior following the scroll container identified by
202
+ * {@link SearchAppBarProps.scrollTarget}, as Compose's `AppBarWithSearch`: `pinned` keeps the
203
+ * bar in place, and `enterAlways` moves it off the top while content scrolls forward and back
204
+ * as soon as content scrolls back.
205
+ */
206
+ scrollBehavior?: "pinned" | "enterAlways" | undefined;
207
+ /**
208
+ * Id of the scroll container followed by {@link SearchAppBarProps.scrollBehavior}.
209
+ *
210
+ * @defaultValue The document scrolling element
211
+ */
212
+ scrollTarget?: string | undefined;
213
+ };
214
+ /**
215
+ * Root class selecting a search presentation.
216
+ */
217
+ type SearchBarClass = "cw-SearchBar" | "cw-DockedSearchBar" | "cw-SearchAppBar";
218
+ /**
219
+ * Client controller of search bars, search views, and search app bars.
220
+ *
221
+ * The input is a native `type="search"` combobox controlling a results listbox: arrow keys move
222
+ * an active descendant through visible, enabled options, Enter selects the active option or
223
+ * submits the query, and Escape collapses the results. Input-method composition keeps its keys.
224
+ * Docked results collapse when focus or a pointer press leaves the search bar. The full-screen
225
+ * view is a labelled modal dialog in the browser top layer which traps focus, returns focus when
226
+ * closed, and expands from and collapses into the bar with a container transform.
227
+ */
228
+ export declare class SearchBarController extends DomController<SearchAppBarProps> {
229
+ #private;
230
+ /**
231
+ * Construct a new `SearchBarController`.
232
+ *
233
+ * @param props - component properties
234
+ * @param baseClass - root class selecting the presentation
235
+ * @param defaultExpansion - expansion used when {@link SearchBarProps.expansion} is omitted
236
+ */
237
+ constructor(props: SearchAppBarProps, baseClass: SearchBarClass, defaultExpansion: "docked" | "fullscreen");
238
+ /**
239
+ * Apply local properties to component state and styling.
240
+ *
241
+ * @see {@link ../dom/client#DomController.applyComponentProps}
242
+ */
243
+ protected applyComponentProps(): void;
244
+ /**
245
+ * Bind listeners and observers to the rendered elements.
246
+ *
247
+ * Search bars render a static element, so this runs once, when the bar is rendered.
248
+ *
249
+ * @param curr - new style element, or `null` when absent
250
+ * @see {@link ../dom/client#DomController.onStyleElementChanged}
251
+ */
252
+ protected onStyleElementChanged(curr: StyleElement | null): void;
253
+ /**
254
+ * Close the view and release listeners and observers when the controller is disposed.
255
+ *
256
+ * @see {@link ../dom/client#DomController.onControllerCleanup}
257
+ */
258
+ protected onControllerCleanup(): void;
259
+ /**
260
+ * Render the static search structure and insert its slots.
261
+ *
262
+ * @param children - nested component children, possibly an accessor
263
+ * @returns rendered component elements
264
+ * @see {@link ../dom/client#DomController.render}
265
+ */
266
+ protected render(children: JSX.Element): JSX.Element;
267
+ }
268
+ /**
269
+ * Material search bar.
270
+ *
271
+ * The search bar is a `search` landmark holding a native search input with combobox semantics and
272
+ * a results listbox of `role="option"` elements; see {@link SearchBarController} for keyboard
273
+ * behavior. It expands to docked results below the bar, or, with
274
+ * {@link SearchBarProps.expansion | `expansion="fullscreen"`}, to a full-screen search view. Label
275
+ * the landmark with `attr:aria-label` and the input with {@link SearchBarProps.inputLabel}.
276
+ *
277
+ * # States
278
+ *
279
+ * The bar expands when clicked or tapped, when a query is typed, or when an arrow key requests
280
+ * results. Expanded bars have the `cw-SearchBar-expanded` class and
281
+ * `data-cw-search-expanded="true"`; the full-screen view is open while `data-cw-search-view` is
282
+ * set. Docked results are revealed with spatial and effects springs; the full-screen view expands
283
+ * from the bar with a container transform.
284
+ *
285
+ * # Design
286
+ *
287
+ * Search design is controlled through the [`cw-SearchBar`](./search.yaml) component design
288
+ * attribute. The {@link SearchBarProps.design | design} selects the contained or divided view.
289
+ *
290
+ * # Elements
291
+ *
292
+ * | Element | Description |
293
+ * | ------- | ----------- |
294
+ * | `.cw-SearchBar-container` | Bar and results; the full-screen view while it is open. |
295
+ * | `.cw-SearchBar-header` | Bar row: back button, leading icon, input, trailing icon, avatar. |
296
+ * | `.cw-SearchBar-results` | Results listbox. |
297
+ *
298
+ * @param props - component properties
299
+ * @returns rendered element
300
+ */
301
+ export declare const SearchBar: DomComponent<SearchBarProps>;
302
+ /**
303
+ * {@link SearchBar} expanding to docked results, with the additional `cw-DockedSearchBar` class.
304
+ *
305
+ * @param props - component properties
306
+ * @returns rendered element
307
+ */
308
+ export declare const DockedSearchBar: DomComponent<SearchBarProps>;
309
+ /**
310
+ * {@link SearchBar} expanding to a full-screen search view.
311
+ *
312
+ * @param props - component properties
313
+ * @returns rendered element
314
+ */
315
+ export declare const SearchView: DomComponent<SearchBarProps>;
316
+ /**
317
+ * Material 3 Expressive app bar with search.
318
+ *
319
+ * The app bar is a `search` landmark: an optional navigation icon, a search bar expanding to a
320
+ * full-screen search view by default, and actions inside or after the bar. Its container and the
321
+ * search field take their on-scroll colors while {@link SearchAppBarProps.scrolled} is set, or
322
+ * while content scrolls under a bar with a {@link SearchAppBarProps.scrollBehavior}; the colors
323
+ * change with the default effects spring (Compose `AppBarWithSearch`).
324
+ *
325
+ * The app bar has the `cw-SearchBar` and `cw-SearchAppBar` classes; the enter-always offset is the
326
+ * unitless `--cw-SearchAppBar-scroll-progress` property.
327
+ *
328
+ * @param props - component properties
329
+ * @returns rendered element
330
+ */
331
+ export declare const SearchAppBar: DomComponent<SearchAppBarProps>;
332
+ export {};