@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,92 @@
1
+ /**
2
+ * Release speed, in pixels per second, from which a drag is a fling.
3
+ *
4
+ * A fling settles at the next anchor in its direction, irrespective of how far it travelled.
5
+ */
6
+ export declare const FLING_VELOCITY_THRESHOLD = 125;
7
+ /**
8
+ * Largest release velocity, in pixels per second, of a drag.
9
+ *
10
+ * @see MAXIMUM_FLING_VELOCITY in Android `ViewConfiguration`, the default of Compose's
11
+ * `ViewConfiguration.maximumFlingVelocity`
12
+ */
13
+ export declare const MAX_FLING_VELOCITY = 8000;
14
+ /**
15
+ * Time, in milliseconds, after the last pointer move from which a pointer is considered stopped.
16
+ *
17
+ * @see AssumePointerMoveStoppedMilliseconds in Compose `VelocityTracker.kt`
18
+ */
19
+ export declare const POINTER_STOPPED_MSEC = 40;
20
+ /**
21
+ * Find the anchor closest to a position, optionally searching in one direction only.
22
+ *
23
+ * If `upwards` is not `undefined`, then anchors in the other direction are infinitely far away,
24
+ * and are only found if no anchor lies in the searched direction. Of equally close anchors, the
25
+ * last one in `anchors` is found. An anchor which is `NaN` is never found.
26
+ *
27
+ * @param anchors - anchor positions, in any order
28
+ * @param position - position to search from
29
+ * @param upwards - `true` to search anchors at or above `position`, `false` to search anchors at
30
+ * or below it, or `undefined` to search both directions
31
+ * @returns position of the closest anchor, or `position` if no anchor is found
32
+ */
33
+ export declare function closestAnchorOf(anchors: readonly number[], position: number, upwards?: boolean): number;
34
+ /**
35
+ * Choose the anchor at which a released drag settles.
36
+ *
37
+ * A drag released at rest settles at the closest anchor. A fling settles at the next anchor in
38
+ * its direction. A slower release settles at the next anchor in its direction if, and only if, it
39
+ * travelled at least `threshold` from the anchor behind it; otherwise, it returns to that anchor.
40
+ *
41
+ * @param anchors - anchor positions, in any order
42
+ * @param offset - offset at release
43
+ * @param velocity - release velocity, in pixels per second, positive towards greater positions
44
+ * @param threshold - positional threshold, in pixels
45
+ * @returns position of the target anchor
46
+ * @see {@link FLING_VELOCITY_THRESHOLD}
47
+ */
48
+ export declare function settleTargetOf(anchors: readonly number[], offset: number, velocity: number, threshold: number): number;
49
+ /**
50
+ * Resolve the pointer events a pointer event coalesces.
51
+ *
52
+ * Browsers expose `getCoalescedEvents` to secure contexts only, and report no coalesced events for
53
+ * synthetic events; the event itself stands in for its coalesced events then.
54
+ *
55
+ * @param event - pointer event
56
+ * @returns coalesced events, or `event` itself when the browser does not report them
57
+ */
58
+ export declare function coalescedEventsOf(event: PointerEvent): readonly PointerEvent[];
59
+ /**
60
+ * Estimator of the release velocity of a dragging pointer along one axis.
61
+ *
62
+ * Every position of a pointer event is tracked, including the positions it coalesces. Release
63
+ * events repeat the last tracked position, so they are not tracked; a release later than {@link
64
+ * POINTER_STOPPED_MSEC} after the last move has no velocity.
65
+ *
66
+ * @see VelocityTracker.addPointerInputChange in Compose `VelocityTracker.kt`
67
+ */
68
+ export declare class DragVelocity {
69
+ #private;
70
+ /**
71
+ * Construct a new `DragVelocity`.
72
+ */
73
+ constructor();
74
+ /**
75
+ * Forget the tracked positions, before a new drag.
76
+ */
77
+ reset(): void;
78
+ /**
79
+ * Track the positions of a pointer down or move event.
80
+ *
81
+ * @param event - pointer event
82
+ * @param positionOf - read the position of the pointer along the axis
83
+ */
84
+ track(event: PointerEvent, positionOf: (sample: PointerEvent) => number): void;
85
+ /**
86
+ * Estimate the velocity of a released pointer.
87
+ *
88
+ * @param event - releasing pointer event
89
+ * @returns velocity, in pixels per second, within {@link MAX_FLING_VELOCITY}
90
+ */
91
+ release(event: PointerEvent): number;
92
+ }
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: MPL-2.0
2
+
3
+ export {};
@@ -0,0 +1,292 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomComponent, DomProps, StyleElement } from "..";
3
+ import { DomController } from "../dom/client";
4
+ import "../container/elevation-shadow.css";
5
+ import "./gestures.css";
6
+ export type { CarouselItemProps, CarouselLayout, CarouselProps } from "./carousel";
7
+ export { Carousel, CarouselController, CarouselItem, CarouselSlide } from "./carousel";
8
+ /**
9
+ * Swipe axis.
10
+ */
11
+ export type SwipeAxis = "horizontal" | "vertical";
12
+ /**
13
+ * Swipe direction passed to the dismissal callback.
14
+ *
15
+ * Horizontal directions are logical: `"start"` moves toward the start of the writing direction.
16
+ */
17
+ export type SwipeDirection = "start" | "end" | "up" | "down";
18
+ /**
19
+ * Properties accepted by {@link SwipeToDismiss}.
20
+ */
21
+ export type SwipeToDismissProps = DomProps<HTMLDivElement, Omit<JSX.HTMLAttributes<HTMLDivElement>, "role" | "aria-hidden">> & {
22
+ /**
23
+ * Gesture axis.
24
+ *
25
+ * @defaultValue `"horizontal"`
26
+ */
27
+ axis?: SwipeAxis | undefined;
28
+ /**
29
+ * Disable the gesture and the Delete key.
30
+ *
31
+ * @defaultValue `false`
32
+ */
33
+ disabled?: boolean | undefined;
34
+ /**
35
+ * Fraction of the item size a slow release must travel to dismiss.
36
+ *
37
+ * When omitted, Material's positional threshold of 56 pixels applies. Values are clamped
38
+ * between `0.05` and `1`. Flings dismiss regardless of the distance travelled.
39
+ */
40
+ threshold?: number | undefined;
41
+ /**
42
+ * Content revealed underneath the item while it moves.
43
+ */
44
+ background?: JSX.Element;
45
+ /**
46
+ * Notify the consumer of a dismissal.
47
+ *
48
+ * Called once the content has slid off after a released swipe, the Delete key, or {@link
49
+ * SwipeToDismissController.dismiss}. The item is then hidden from accessibility and inert, and
50
+ * focus inside it has moved to the next focusable element. Remove the item in this callback,
51
+ * or call {@link SwipeToDismissController.reset} to restore it.
52
+ *
53
+ * @param direction - logical horizontal or physical vertical dismissal direction
54
+ * @param event - releasing pointer event or Delete key event, or `undefined` when dismissed
55
+ * programmatically
56
+ */
57
+ onDismiss?: ((direction: SwipeDirection, event?: PointerEvent | KeyboardEvent) => void) | undefined;
58
+ /**
59
+ * Notify the consumer while the item moves.
60
+ *
61
+ * @param offset - physical offset of the item along the axis, in pixels
62
+ * @param event - moving pointer event, or `undefined` while the item settles
63
+ */
64
+ onOffsetChange?: ((offset: number, event?: PointerEvent) => void) | undefined;
65
+ };
66
+ /**
67
+ * Client controller of a {@link SwipeToDismiss} container.
68
+ *
69
+ * A primary pointer moving along the axis, past {@link GESTURE_SLOP}, captures the pointer and
70
+ * drags the content; movement across the axis first releases the gesture to native scrolling. A
71
+ * {@link ./drag#DragVelocity | velocity estimator} follows every pointer position. On release, the
72
+ * content settles at its resting or a dismissed position, chosen as Compose's anchored drag does,
73
+ * with a spatial spring seeded with the release velocity. A pointer pressed while the content
74
+ * settles catches it, without slop, and drags it from where it is.
75
+ */
76
+ export declare class SwipeToDismissController extends DomController<SwipeToDismissProps> {
77
+ #private;
78
+ /**
79
+ * Construct a new `SwipeToDismissController`.
80
+ *
81
+ * @param props - component properties
82
+ */
83
+ constructor(props: SwipeToDismissProps);
84
+ /**
85
+ * Read the current physical offset of the content along the axis.
86
+ *
87
+ * While the content settles, this is the most recently animated offset.
88
+ *
89
+ * @returns offset, in pixels
90
+ */
91
+ offset(): number;
92
+ /**
93
+ * Dismiss the item without a gesture.
94
+ *
95
+ * The content slides off in `direction`, as after a swipe, and {@link
96
+ * SwipeToDismissProps.onDismiss | `onDismiss`} is notified once it has. This has no effect on a
97
+ * disabled or already dismissed item.
98
+ *
99
+ * @param direction - dismissal direction; defaults to `"start"`, or `"up"` for a vertical axis
100
+ */
101
+ dismiss(direction?: SwipeDirection): void;
102
+ /**
103
+ * Restore the item to its resting position at once, dismissed or not.
104
+ */
105
+ reset(): void;
106
+ /**
107
+ * Apply local properties to component state and styling.
108
+ *
109
+ * @see {@link ../dom/client#DomController.applyComponentProps}
110
+ */
111
+ protected applyComponentProps(): void;
112
+ /**
113
+ * Handle style element replacement before the controller reference is updated.
114
+ *
115
+ * The style-element getter still exposes the previous element during this hook.
116
+ *
117
+ * @param curr - new style element, or `null` when absent
118
+ * @see {@link ../dom/client#DomController.onStyleElementChanged}
119
+ */
120
+ protected onStyleElementChanged(curr: StyleElement | null): void;
121
+ /**
122
+ * Render the component's element tree.
123
+ *
124
+ * This renders the elements of the server rendering, with the current properties: the
125
+ * background is a reactive slot, while attributes are static.
126
+ *
127
+ * @param children - nested component children, possibly an accessor
128
+ * @returns rendered component elements
129
+ * @see {@link ../dom/client#DomController.render}
130
+ */
131
+ protected render(children: JSX.Element): JSX.Element;
132
+ }
133
+ /**
134
+ * Container whose content is dismissed by a horizontal or vertical swipe.
135
+ *
136
+ * A released swipe settles where Material's anchored drag would: a fling of at least 125 pixels per
137
+ * second continues to the next position in its direction, and a slower release dismisses once it
138
+ * has travelled the positional threshold of 56 pixels, or the {@link SwipeToDismissProps.threshold
139
+ * | `threshold`} fraction of the item size. The content then slides off, or back, with a spatial
140
+ * spring which continues the release velocity; pressing it while it moves catches it. Once slid
141
+ * off, the content is inert and hidden from accessibility, and {@link SwipeToDismissProps.onDismiss
142
+ * | `onDismiss`} is notified.
143
+ *
144
+ * Gestures are an enhancement: the Delete key dismisses the item when focus is inside it, outside
145
+ * text fields, and {@link SwipeToDismissController.dismiss} supports a visible alternative action.
146
+ *
147
+ * # States
148
+ *
149
+ * While dragged, the container has the `cw-SwipeToDismiss-dragging` class; once dismissed, the
150
+ * `cw-SwipeToDismiss-dismissed` class. A disabled container has the `cw-SwipeToDismiss-disabled`
151
+ * class.
152
+ *
153
+ * @param props - component properties
154
+ * @returns rendered container
155
+ */
156
+ export declare const SwipeToDismiss: DomComponent<SwipeToDismissProps>;
157
+ /**
158
+ * Properties accepted by {@link PullToRefresh}.
159
+ */
160
+ export type PullToRefreshProps = DomProps<HTMLDivElement, Omit<JSX.HTMLAttributes<HTMLDivElement>, "role" | "aria-busy">> & {
161
+ /**
162
+ * Controlled refreshing state.
163
+ */
164
+ refreshing?: boolean | undefined;
165
+ /**
166
+ * Initial refreshing state of an uncontrolled region.
167
+ *
168
+ * @defaultValue `false`
169
+ */
170
+ defaultRefreshing?: boolean | undefined;
171
+ /**
172
+ * Disable pulling and the Enter key; content remains interactive.
173
+ *
174
+ * @defaultValue `false`
175
+ */
176
+ disabled?: boolean | undefined;
177
+ /**
178
+ * Accessible name of the refresh region.
179
+ *
180
+ * @defaultValue `"Pull to refresh"`
181
+ */
182
+ label?: string | undefined;
183
+ /**
184
+ * Pointer travel, in pixels, a released pull must reach to refresh.
185
+ *
186
+ * The indicator travels at half the pointer speed and reaches its resting position at the
187
+ * threshold. Values below 24 are raised to 24.
188
+ *
189
+ * @defaultValue `160`
190
+ */
191
+ threshold?: number | undefined;
192
+ /**
193
+ * Indicator content shown while pulling and refreshing.
194
+ *
195
+ * When omitted, a circular progress indicator follows the pull and turns indeterminate while
196
+ * refreshing.
197
+ */
198
+ indicator?: JSX.Element;
199
+ /**
200
+ * Sequential focus index of the refresh region.
201
+ *
202
+ * @defaultValue `0`
203
+ */
204
+ tabIndex?: number | undefined;
205
+ /**
206
+ * Start refresh work after a completed pull or the Enter key.
207
+ *
208
+ * A returned promise requests completion when it settles; returning no promise completes on the
209
+ * next microtask. Controlled refreshing state requires the parent to accept
210
+ * `onRefreshingChange(false)`. Handle refresh errors in the supplied work.
211
+ *
212
+ * @param event - pointer, touch, or keyboard event starting the request
213
+ */
214
+ onRefresh?: ((event: PointerEvent | TouchEvent | KeyboardEvent) => void | Promise<void>) | undefined;
215
+ /**
216
+ * Notify the consumer of a refreshing state change, or request one when controlled.
217
+ *
218
+ * @param refreshing - new or requested refreshing state
219
+ * @param event - triggering event, if any
220
+ */
221
+ onRefreshingChange?: ((refreshing: boolean, event?: Event) => void) | undefined;
222
+ };
223
+ /**
224
+ * Client controller of a {@link PullToRefresh} region.
225
+ *
226
+ * Mouse and pen pulls use pointer capture; touch pulls use non-passive touch events, which claim
227
+ * a downward move at the scroll origin before the user-agent starts panning. The indicator, not
228
+ * the content, follows the pull at half speed, with diminishing travel past the threshold.
229
+ */
230
+ export declare class PullToRefreshController extends DomController<PullToRefreshProps> {
231
+ #private;
232
+ /**
233
+ * Construct a new `PullToRefreshController`.
234
+ *
235
+ * @param props - component properties
236
+ */
237
+ constructor(props: PullToRefreshProps);
238
+ /**
239
+ * Complete an active uncontrolled refresh.
240
+ *
241
+ * Clears the internal refreshing state and notifies `onRefreshingChange(false)`. This method
242
+ * has no effect on a controlled refresh region; update its `refreshing` property directly.
243
+ *
244
+ * @param event - event supplied to the state-change callback, if any
245
+ */
246
+ complete(event?: Event): void;
247
+ /**
248
+ * Apply local properties to component state and styling.
249
+ *
250
+ * @see {@link ../dom/client#DomController.applyComponentProps}
251
+ */
252
+ protected applyComponentProps(): void;
253
+ /**
254
+ * Handle style element replacement before the controller reference is updated.
255
+ *
256
+ * The style-element getter still exposes the previous element during this hook.
257
+ *
258
+ * @param curr - new style element, or `null` when absent
259
+ * @see {@link ../dom/client#DomController.onStyleElementChanged}
260
+ */
261
+ protected onStyleElementChanged(curr: StyleElement | null): void;
262
+ /**
263
+ * Render the component's element tree.
264
+ *
265
+ * This renders the elements of the server rendering, with the current state: the indicator is
266
+ * a reactive slot, and the default indicator follows the pull progress, while attributes are
267
+ * static.
268
+ *
269
+ * @param children - nested component children, possibly an accessor
270
+ * @returns rendered component elements
271
+ * @see {@link ../dom/client#DomController.render}
272
+ */
273
+ protected render(children: JSX.Element): JSX.Element;
274
+ }
275
+ /**
276
+ * Region whose content refreshes after a downward pull at its scroll origin.
277
+ *
278
+ * The region scrolls natively. Pulling down from the top moves an elevated circular indicator,
279
+ * at half the pointer speed; releasing beyond the {@link PullToRefreshProps.threshold |
280
+ * threshold} starts a refresh, and the indicator rests in view while refreshing. The focused
281
+ * region refreshes with the Enter key; applications should also offer a visible refresh action.
282
+ *
283
+ * # States
284
+ *
285
+ * The region has `aria-busy="true"` and the `cw-PullToRefresh-refreshing` class while refreshing,
286
+ * the `cw-PullToRefresh-dragging` class while pulled, the `cw-PullToRefresh-at-start` class while
287
+ * scrolled to its origin, and the `cw-PullToRefresh-disabled` class while disabled.
288
+ *
289
+ * @param props - component properties
290
+ * @returns rendered region
291
+ */
292
+ export declare const PullToRefresh: DomComponent<PullToRefreshProps>;
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: MPL-2.0
2
+
3
+ export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Material 3 and Material 3 Expressive surfaces, content containers, overlays, sheets, layout
3
+ * scaffolds, and gesture primitives.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ import "./surface.css";
8
+ export type { SurfaceBaseProps, SurfaceColor, SurfaceProps } from "./surface";
9
+ export { Surface, SurfaceController } from "./surface";
10
+ export type { DividerOrientation, DividerProps } from "./divider";
11
+ export { Divider, DividerController } from "./divider";
12
+ export type { ListItemBaseProps, ListItemLeadingType, ListItemProps, ListProps, ListSelectionMode } from "./list";
13
+ export { List, ListController, ListItem, ListItemController } from "./list";
14
+ export type { ExpandedListItemProps, RevealListItemProps, ReorderableListProps, ReorderHandleProps } from "./list-patterns";
15
+ export { ExpandedListItem, ExpandedListItemController, RevealListItem, RevealListItemController, ReorderableList, ReorderableListController, ReorderHandle } from "./list-patterns";
16
+ export type { AlertDialogProps, DialogCloseReason, DialogOpenChangeHandler, DialogProps, FullScreenDialogProps } from "./dialog";
17
+ export { AlertDialog, AlertDialogController, Dialog, DialogController, FullScreenDialog, FullScreenDialogController } from "./dialog";
18
+ export type { MenuCheckboxItemProps, MenuGroupProps, MenuItemBaseProps, MenuItemProps, MenuPlacement, MenuProps, MenuRadioItemProps, MenuTriggerRenderProps, SubMenuProps } from "./menu";
19
+ export { Menu, MenuCheckboxItem, MenuCheckboxItemController, MenuController, MenuGroup, MenuGroupController, MenuItem, MenuItemController, MenuRadioItem, MenuRadioItemController, SubMenu } from "./menu";
20
+ export type { BottomSheetBaseProps, BottomSheetExpansionHandler, BottomSheetProps, ModalBottomSheetProps } from "./sheet";
21
+ export { BottomSheet, BottomSheetController, ModalBottomSheet, ModalBottomSheetController } from "./sheet";
22
+ export type { BottomSheetScaffoldProps, FabPosition, ListDetailPaneScaffoldProps, ScaffoldProps, SupportingPaneScaffoldProps, WindowSizeClass } from "./scaffold";
23
+ export { BottomSheetScaffold, ListDetailPaneScaffold, ListDetailPaneScaffoldController, Scaffold, ScaffoldController, SupportingPaneScaffold, SupportingPaneScaffoldController, createWindowSizeClass, windowSizeClassOf } from "./scaffold";
24
+ export type { SideSheetProps } from "./side-sheet";
25
+ export { ModalSideSheet, SideSheetController, StandardSideSheet } from "./side-sheet";
26
+ export type { CarouselItemProps, CarouselLayout, CarouselProps } from "./carousel";
27
+ export { Carousel, CarouselController, CarouselItem, CarouselSlide } from "./carousel";
28
+ export type { PullToRefreshProps, SwipeAxis, SwipeDirection, SwipeToDismissProps } from "./gestures";
29
+ export { PullToRefresh, PullToRefreshController, SwipeToDismiss, SwipeToDismissController } from "./gestures";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Test whether an event target is an element, without relying on the constructors of the current
3
+ * realm.
4
+ *
5
+ * @param value - event target to test
6
+ * @returns `true` if, and only if, `value` is an element node
7
+ */
8
+ export declare function isElementNode(value: EventTarget | null | undefined): value is Element;
9
+ /**
10
+ * Test whether an event target lies within an interactive descendant of a component root.
11
+ *
12
+ * The composed path, when supplied, is inspected first so that targets retargeted out of a shadow
13
+ * tree are attributed to the interactive element inside it. The ancestors of `target` up to, but
14
+ * excluding, `root` are inspected next. The root itself never counts as nested.
15
+ *
16
+ * @param target - event target element
17
+ * @param root - component root element
18
+ * @param path - composed path of the event, if available
19
+ * @returns `true` if, and only if, `target` is, or is contained by, an interactive descendant of
20
+ * `root`
21
+ */
22
+ export declare function hasNestedInteractive(target: Element, root: Element, path?: readonly EventTarget[]): boolean;