@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,65 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomComponent } from "./client";
3
+ import type { DomProps } from "./types";
4
+ /**
5
+ * Pick properties not defined by standard DOM component {@link DomProps | properties}.
6
+ *
7
+ * This evaluates to an object of properties, defined in `P`, which are not defined by {@link
8
+ * DomProps}.
9
+ *
10
+ * @typeParam P - component properties type
11
+ */
12
+ export type PickLocalDomProps<P extends DomProps> = Omit<P, keyof (P extends DomProps<infer E, infer A> ? DomProps<E, A> : DomProps)>;
13
+ /**
14
+ * DOM element properties.
15
+ *
16
+ * This evaluates to an object of properties which can be applied directly to an element by
17
+ * SolidJS, compatible with `P`.
18
+ *
19
+ * @typeParam P - component {@link DomProps | properties} type
20
+ * @see {@link RenderServerDom}
21
+ */
22
+ export type ElementDomProps<P extends DomProps> = P extends DomProps<infer _E, infer A> ? A : JSX.DOMAttributes<Element>;
23
+ /**
24
+ * Function which renders elements of a DOM {@link ./client#DomComponent | component} in a server
25
+ * environment.
26
+ *
27
+ * This is invoked by a {@link ./index#defineDomComponent | defined} DOM component when an
28
+ * instance of the component is constructed, in a server environment. This function is invoked
29
+ * with {@link ElementDomProps | element} and {@link PickLocalDomProps | local} properties {@link
30
+ * solid-js#splitProps | split} from the properties the component instance is constructed with,
31
+ * respectively. See {@link defineServerDomComponent} for how these properties are evaluated.
32
+ *
33
+ * @typeParam P - component {@link DomProps | properties} type
34
+ * @param elemProps - properties which must be applied to the rendered element
35
+ * @param localProps - properties local to the component
36
+ * @returns rendered element
37
+ * @see {@link ./index#defineDomComponent}
38
+ */
39
+ export type RenderServerDom<P extends DomProps> = (elemProps: ElementDomProps<P>, localProps: PickLocalDomProps<P>) => JSX.Element;
40
+ /**
41
+ * Define a new server-side DOM {@link ./client#DomComponent | component}.
42
+ *
43
+ * The element and local properties the render function is invoked with are evaluated lazily:
44
+ * each property is read from the component properties, in an {@link solid-js#untrack |
45
+ * untracked} context, when the render function first reads it, and is retained for subsequent
46
+ * reads, so that a property is evaluated at most once. Properties may be assigned, which
47
+ * replaces their value. `boolean` values of attributes, namespaced under `attr:`, are resolved
48
+ * as they are by the client controller.
49
+ *
50
+ * Lazy evaluation lets the server render elements in the order the client renders them, which
51
+ * hydration depends on: each rendered element, including the elements of nested components, is
52
+ * identified by the order in which it is created. The client controller creates the elements of
53
+ * slot properties, such as `children`, only when inserting them into the element they are
54
+ * nested within, *after* creating that element. Thus, a render function must not read a slot
55
+ * property before it creates the element the slot is nested within. For example, destructuring
56
+ * `elemProps` with a rest element, such as `const { children, ...rest } = elemProps`, reads
57
+ * every property, including `children`, *before* any element is created. A render function
58
+ * should instead spread `elemProps` onto the element, as in `<div {...elemProps} />`, or read
59
+ * `elemProps.children` where the children are nested.
60
+ *
61
+ * @typeParam P - component properties type
62
+ * @param renderSupp - render function supplier
63
+ * @returns resulting component
64
+ */
65
+ export declare function defineServerDomComponent<P extends DomProps>(renderSupp: () => RenderServerDom<P>): DomComponent<P>;
@@ -0,0 +1,134 @@
1
+ import type { Accessor, JSX } from "solid-js";
2
+ /**
3
+ * Union of renderable DOM element tags.
4
+ */
5
+ export type DomTag = keyof JSX.IntrinsicElements;
6
+ /**
7
+ * Pick DOM element attributes.
8
+ *
9
+ * This evaluates to an object which contains only properties of `T` which evaluate to DOM
10
+ * attributes.
11
+ *
12
+ * @typeParam T - DOM attributes type
13
+ */
14
+ export type PickDomAttributes<T extends JSX.DOMAttributes<any> = JSX.DOMAttributes<unknown>> = Omit<T, "children" | "class" | "innerHTML" | "innerText" | "style" | "textContent" | (keyof JSX.AttrAttributes) | (keyof JSX.BoolAttributes) | (keyof JSX.CustomAttributes<unknown>) | (keyof JSX.CustomEventHandlersCamelCase<unknown>) | (keyof JSX.CustomEventHandlersLowerCase<unknown>) | (keyof JSX.CustomEventHandlersNamespaced<unknown>) | (keyof JSX.OnAttributes<unknown>) | (keyof JSX.OnCaptureAttributes<unknown>) | (keyof JSX.PropAttributes)>;
15
+ /**
16
+ * Native event handler properties for a component's function element.
17
+ *
18
+ * Use the `event:` namespace, for example `event:click`. Multiword event names accept both
19
+ * `event:keyDown` and `event:keydown`. Handler parameters retain the event and current-target
20
+ * types of the corresponding Solid DOM handler. The callback value is captured at construction
21
+ * and is **not** reactive; a captured callback can still read current signals when invoked.
22
+ *
23
+ * @typeParam E - function element type
24
+ * @see {@link DomProps}
25
+ */
26
+ export type DomEventHandlerProps<E extends Element> = {
27
+ /**
28
+ * Event handlers attached to function element.
29
+ *
30
+ * @remarks
31
+ * These properties are **not** reactive.
32
+ */
33
+ readonly [K in keyof JSX.CustomEventHandlersCamelCase<unknown> as K extends `on${infer Name}` ? `event:${Uncapitalize<Name> | Lowercase<Name>}` : never]: JSX.CustomEventHandlersCamelCase<E>[K];
34
+ };
35
+ /**
36
+ * DOM element attribute properties.
37
+ *
38
+ * This evaluates to an object whose keys are equal to DOM attribute keys defined by `A`,
39
+ * namespaced under `attr`, and values equal to the respective DOM attribute. For example, the
40
+ * `aria-hidden` attribute is recognized as `attr:aria-hidden`.
41
+ *
42
+ * @typeParam A - function element DOM attributes type
43
+ * @see {@link DomProps}
44
+ */
45
+ export type DomAttributes<A extends JSX.DOMAttributes<any>> = {
46
+ [K in keyof PickDomAttributes<A> as K extends string ? `attr:${K}` : never]?: Extract<A[K], boolean | string | number | undefined> | undefined;
47
+ };
48
+ /**
49
+ * Base DOM {@link ./client#DomComponent | component} properties.
50
+ *
51
+ * Unlike standard SolidJS component properties, the {@link BaseDomProps."class" | `class`} and
52
+ * {@link BaseDomProps.ref | `ref`} properties are **not** reactive.
53
+ *
54
+ * @typeParam E - function element type
55
+ * @see {@link DomProps}
56
+ */
57
+ export interface BaseDomProps<E extends Element> {
58
+ /**
59
+ * CSS class applied to style element.
60
+ *
61
+ * @remarks
62
+ * This is **not** reactive.
63
+ */
64
+ readonly class?: string;
65
+ /**
66
+ * Conditional CSS classes applied to style element.
67
+ */
68
+ classList?: Record<string, boolean | undefined> | undefined;
69
+ /**
70
+ * CSS property style mapping applied to style element.
71
+ */
72
+ style?: JSX.CSSProperties | undefined;
73
+ /**
74
+ * Children nested within the component's element tree.
75
+ *
76
+ * The component determines placement and may resolve an accessor reactively. See individual
77
+ * component slot properties for precedence between named content and children.
78
+ */
79
+ children?: Accessor<JSX.Element> | JSX.Element;
80
+ /**
81
+ * Reference to function element.
82
+ *
83
+ * @remarks
84
+ * This is **not** reactive.
85
+ */
86
+ readonly ref?: E | ((elem: E) => void);
87
+ }
88
+ /**
89
+ * DOM {@link ./client#DomComponent | component} properties.
90
+ *
91
+ * Cobweb distinguishes the style element returned by a component from its function element,
92
+ * which receives native attributes, listeners, and `ref`. These can be the same element.
93
+ *
94
+ * | Property | Target and behavior |
95
+ * | --- | --- |
96
+ * | `attr:<name>` | Native attribute on the function element, such as `attr:aria-label`. |
97
+ * | `event:<name>` | Native event handler on the function element; captured at construction. |
98
+ * | `class` | Whitespace-separated style-element classes; captured at construction. |
99
+ * | `classList` | Conditional style-element classes. |
100
+ * | `style` | Style-element `JSX.CSSProperties` object; CSS strings are not supported. |
101
+ * | `ref` | Function-element reference or callback; the supplied callback is not reactive. |
102
+ *
103
+ * Attributes are assigned the values {@link ../util#attributeValueOf} resolves, on both client
104
+ * and server. For example, `attr:aria-expanded={false}` assigns `"false"`, while
105
+ * `attr:hidden={false}` removes the attribute.
106
+ *
107
+ * Solid's generic `onClick`, `on:click`, and `onCapture:click` properties are not part of this
108
+ * type. Individual components may expose local callbacks, including the distinct interaction
109
+ * `onClick` callback supplied by {@link ../state/component#InteractableProps}. Use `event:click`
110
+ * for a native click listener and consult the component's callback contract for cancellation.
111
+ *
112
+ * @typeParam E - function element type
113
+ * @typeParam A - function element attributes type
114
+ * @see {@link ./client#DomComponent}
115
+ */
116
+ export type DomProps<E extends Element = any, A extends JSX.DOMAttributes<E> = JSX.DOMAttributes<E>> = (BaseDomProps<E> & DomAttributes<A> & DomEventHandlerProps<E>);
117
+ /**
118
+ * Evaluate to function element type from component {@link DomProps | properties}.
119
+ *
120
+ * @typeParam P - component properties type
121
+ */
122
+ export type FunctionElement<P extends DomProps> = P extends DomProps<infer E, infer _A> ? E : Element;
123
+ /**
124
+ * DOM {@link ./client#DomComponent | component} style element.
125
+ */
126
+ export type StyleElement = HTMLElement | MathMLElement | SVGElement;
127
+ /**
128
+ * Convert DOM {@link DomEventHandlerProps | component} event handler property to an element
129
+ * property key.
130
+ *
131
+ * @param name - component event handler property key
132
+ * @returns element event handler property key
133
+ */
134
+ export declare function elementPropsKeyOfEvent(name: `event:${string}`): keyof JSX.CustomEventHandlersCamelCase<unknown>;
@@ -0,0 +1,116 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomComponent, DomProps } from "..";
3
+ import "./feedback.css";
4
+ /**
5
+ * {@link Badge} component properties.
6
+ */
7
+ export type BadgeProps = DomProps<HTMLSpanElement, JSX.HTMLAttributes<HTMLSpanElement>> & {
8
+ /**
9
+ * Number or short text shown by the badge.
10
+ *
11
+ * A badge without content is a small dot, as is a {@link BadgeProps.small | small} badge.
12
+ */
13
+ value?: number | string | undefined;
14
+ /**
15
+ * Greatest number shown; a greater number is shown as this number followed by `+`.
16
+ */
17
+ max?: number | undefined;
18
+ /**
19
+ * Badge is a small dot, without content.
20
+ *
21
+ * @defaultValue `false`
22
+ */
23
+ small?: boolean | undefined;
24
+ /**
25
+ * Badge color.
26
+ *
27
+ * The badge is filled with the fill color of the respective color role, and its content with
28
+ * the on-fill color. When omitted, the `cw-Feedback-badge` design roles apply, which follow the
29
+ * error color role.
30
+ */
31
+ color?: "error" | "primary" | "secondary" | "surface" | "tertiary" | undefined;
32
+ };
33
+ /**
34
+ * {@link BadgedBox} component properties.
35
+ */
36
+ export type BadgedBoxProps = DomProps<HTMLSpanElement, JSX.HTMLAttributes<HTMLSpanElement>> & {
37
+ /**
38
+ * Badge shown over the content, usually a {@link Badge}.
39
+ *
40
+ * When omitted, a badge is shown with the {@link BadgedBoxProps.value | value},
41
+ * {@link BadgedBoxProps.max | max}, {@link BadgedBoxProps.small | small}, and
42
+ * {@link BadgedBoxProps.color | color} properties, while a value is supplied or the badge is
43
+ * small.
44
+ */
45
+ badge?: JSX.Element;
46
+ /**
47
+ * Number or short text shown by the badge, when {@link BadgedBoxProps.badge | badge} is
48
+ * omitted.
49
+ */
50
+ value?: number | string | undefined;
51
+ /**
52
+ * Greatest number shown by the badge, when {@link BadgedBoxProps.badge | badge} is omitted.
53
+ */
54
+ max?: number | undefined;
55
+ /**
56
+ * Badge is a small dot, when {@link BadgedBoxProps.badge | badge} is omitted.
57
+ *
58
+ * @defaultValue `false`
59
+ */
60
+ small?: boolean | undefined;
61
+ /**
62
+ * Badge color, when {@link BadgedBoxProps.badge | badge} is omitted.
63
+ */
64
+ color?: BadgeProps["color"];
65
+ };
66
+ /**
67
+ * Material 3 badge.
68
+ *
69
+ * A badge shows a count or a short status over the corner of an icon or a navigation item,
70
+ * usually through a {@link BadgedBox}. A badge without content is a small dot. A number greater
71
+ * than {@link BadgeProps.max | `props.max`} is shown as the maximum followed by `+`.
72
+ *
73
+ * # Design
74
+ *
75
+ * Design is controlled through the `badge` roles of the [`cw-Feedback`](./feedback.yaml) design
76
+ * attribute: a large badge is at least 16px tall and wide, with label-small text, and a small
77
+ * badge is a 6px dot (`BadgeTokens`). {@link BadgeProps.color | `props.color`} selects another
78
+ * color role. The `cw-Badge-small` CSS class is added to a small badge.
79
+ *
80
+ * # Accessibility
81
+ *
82
+ * As in Compose, a badge has no semantics of its own: its text is read as part of the content,
83
+ * and a {@link BadgedBox} describes its anchor with it. A badge without text is hidden from
84
+ * assistive technology, unless `attr:aria-label` names it, which makes it an image. A badge
85
+ * whose changes should be announced, such as a count of new messages, is a live region: add
86
+ * `attr:role="status"`.
87
+ *
88
+ * @param props - component properties
89
+ * @returns rendered element
90
+ */
91
+ export declare const Badge: DomComponent<BadgeProps>;
92
+ /**
93
+ * Material 3 badged box.
94
+ *
95
+ * A badged box shows a badge over the top end corner of its content, such as an icon or an icon
96
+ * button (`Badge.kt` `BadgedBox`). Supply a badge through {@link BadgedBoxProps.badge |
97
+ * `props.badge`}, or let the box render one from {@link BadgedBoxProps.value | `props.value`} and
98
+ * the related properties.
99
+ *
100
+ * # Design
101
+ *
102
+ * A large badge starts 12px inside the end edge of the content and overlaps its top edge by
103
+ * 14px; a small badge is inside the top end corner, 6px from the end edge. These offsets are the
104
+ * `badge` roles of the [`cw-Feedback`](./feedback.yaml) design attribute.
105
+ *
106
+ * # Accessibility
107
+ *
108
+ * The badge describes the first focusable element of the content, if any, through
109
+ * `aria-describedby`, so that focusing an icon button also conveys its count. Descriptions
110
+ * authored on that element are retained. As the content changes, the badge describes the element
111
+ * then focusable instead.
112
+ *
113
+ * @param props - component properties
114
+ * @returns rendered element
115
+ */
116
+ export declare const BadgedBox: DomComponent<BadgedBoxProps>;
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: MPL-2.0
2
+
3
+ export {};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Selectors of the elements which can receive keyboard focus.
3
+ *
4
+ * Disabled controls, hidden inputs, and elements removed from the sequential focus navigation
5
+ * order are excluded.
6
+ */
7
+ export declare const FOCUSABLE_SELECTORS: readonly string[];
8
+ /**
9
+ * Determine whether focus is within an element.
10
+ *
11
+ * The focused element is read from the root of `elem`, its document or its shadow root. The
12
+ * `activeElement` of a document is the outermost shadow host while focus is within a shadow root,
13
+ * which no element of that shadow tree contains, whereas the `activeElement` of a root is
14
+ * retargeted to the tree of that root (HTML `DocumentOrShadowRoot.activeElement`), so that focus
15
+ * within a shadow root nested in `elem` is also within `elem`.
16
+ *
17
+ * @param elem - element to test
18
+ * @returns `true` if, and only if, the focused element is `elem` or a descendant of `elem`
19
+ */
20
+ export declare function isFocusWithin(elem: Element): boolean;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Material 3 feedback components: badges, progress and loading indicators, snackbars, and
3
+ * tooltips.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ export type { BadgeProps, BadgedBoxProps } from "./badge";
8
+ export type { ContainedLoadingIndicatorProps, LoadingIndicatorProps } from "./loading";
9
+ export type { CircularProgressIndicatorProps, CircularWavyProgressIndicatorProps, LinearProgressIndicatorProps, LinearWavyProgressIndicatorProps, ProgressIndicatorProps, ProgressRange } from "./progress";
10
+ export type { SnackbarActionHandler, SnackbarDismissHandler, SnackbarDismissReason, SnackbarHostProps, SnackbarProps, SnackbarRequest } from "./snackbar";
11
+ export type { PlainTooltipProps, RichTooltipProps, TooltipBaseProps, TooltipPlacement, TooltipTriggerContext, TooltipTriggerFactory } from "./tooltip";
12
+ export { Badge, BadgedBox } from "./badge";
13
+ export { ContainedLoadingIndicator, ContainedLoadingIndicatorController, LoadingIndicator, LoadingIndicatorController } from "./loading";
14
+ export { CircularProgressIndicator, CircularWavyProgressIndicator, LinearProgressIndicator, LinearWavyProgressIndicator } from "./progress";
15
+ export { Snackbar, SnackbarController, SnackbarHost, SnackbarHostController, SnackbarQueue, createSnackbarQueue } from "./snackbar";
16
+ export { PlainTooltip, PlainTooltipController, RichTooltip, RichTooltipController, TooltipController } from "./tooltip";
17
+ import "./feedback.css";
@@ -0,0 +1,194 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomComponent, DomProps, StyleElement } from "..";
3
+ import type { RoundedPolygon } from "../shape";
4
+ import { DomController } from "../dom/client";
5
+ import "./feedback.css";
6
+ /**
7
+ * {@link LoadingIndicator} component properties.
8
+ */
9
+ export type LoadingIndicatorProps = DomProps<HTMLDivElement, Omit<JSX.HTMLAttributes<HTMLDivElement>, "aria-valuemax" | "aria-valuemin" | "aria-valuenow">> & {
10
+ /**
11
+ * Accessible name of the indicator.
12
+ *
13
+ * An `attr:aria-label` property takes precedence whenever supplied, including as `undefined`.
14
+ *
15
+ * @defaultValue `"Loading"`
16
+ */
17
+ label?: string | undefined;
18
+ /**
19
+ * Shapes the indicator morphs between, at least two.
20
+ *
21
+ * An indeterminate indicator morphs through the shapes in a loop; a determinate indicator
22
+ * morphs from the first to the last shape as its value progresses. Shapes are normalized,
23
+ * and their morphs are built when first used and shared by every indicator using the same
24
+ * array.
25
+ *
26
+ * @defaultValue `LoadingIndicatorDefaults.IndeterminateIndicatorPolygons` (seven Material
27
+ * shapes, from `SoftBurst` to `Oval`) while indeterminate, and
28
+ * `LoadingIndicatorDefaults.DeterminateIndicatorPolygons` (a rotated `Circle` and `SoftBurst`)
29
+ * while determinate
30
+ * @throws {@link Error} fewer than two shapes are supplied
31
+ */
32
+ polygons?: readonly RoundedPolygon[] | undefined;
33
+ /**
34
+ * Width and height of the indicator, in CSS pixels.
35
+ *
36
+ * This overrides the `cw-Feedback-loading-size` design role. The active shape spans 38/48
37
+ * of the size.
38
+ */
39
+ size?: number | undefined;
40
+ /**
41
+ * Indicator color.
42
+ *
43
+ * The shape is painted with the fill color of the respective color role. When omitted, the
44
+ * `cw-Feedback-loading-color` design role, or for a contained indicator the
45
+ * `cw-Feedback-loading-containedColor` role, applies.
46
+ */
47
+ color?: "error" | "primary" | "secondary" | "surface" | "tertiary" | undefined;
48
+ /**
49
+ * Indeterminate motion is paused.
50
+ *
51
+ * This lets an application provide the means to pause moving content that WCAG 2.2.2 (Pause,
52
+ * Stop, Hide) requires when the indicator is shown alongside other content for a long time.
53
+ * The indicator keeps its semantics and its current shape.
54
+ *
55
+ * @defaultValue `false`
56
+ */
57
+ paused?: boolean | undefined;
58
+ /**
59
+ * Current value, within the range from {@link LoadingIndicatorProps.min | `min`} to {@link
60
+ * LoadingIndicatorProps.max | `max`}.
61
+ *
62
+ * The indicator is determinate while a value is supplied; the value is clamped into the range
63
+ * and exposed as `aria-valuenow`. Value changes animate.
64
+ */
65
+ value?: number | undefined;
66
+ /**
67
+ * Value at which a determinate indicator shows its first shape.
68
+ *
69
+ * @defaultValue `0`
70
+ */
71
+ min?: number | undefined;
72
+ /**
73
+ * Value at which a determinate indicator shows its last shape.
74
+ *
75
+ * @defaultValue `1`
76
+ */
77
+ max?: number | undefined;
78
+ /**
79
+ * Indicator is indeterminate, whether or not a value is supplied.
80
+ *
81
+ * @defaultValue `false`
82
+ */
83
+ indeterminate?: boolean | undefined;
84
+ };
85
+ /**
86
+ * {@link ContainedLoadingIndicator} component properties.
87
+ */
88
+ export type ContainedLoadingIndicatorProps = LoadingIndicatorProps & {
89
+ /**
90
+ * Container color.
91
+ *
92
+ * A color role name paints the container with the container color of the role, and the
93
+ * indicator with the matching on-container color; any other value is a CSS color. When
94
+ * omitted, the `cw-Feedback-loading-containerColor` design role applies.
95
+ */
96
+ containerColor?: string | undefined;
97
+ /**
98
+ * Container corner radius, as CSS pixels or a CSS `border-radius` value.
99
+ *
100
+ * When omitted, the `cw-Feedback-loading-containerShape` design role applies.
101
+ */
102
+ containerShape?: number | string | undefined;
103
+ };
104
+ /**
105
+ * Client-side controller of a {@link LoadingIndicator} and a {@link ContainedLoadingIndicator}.
106
+ *
107
+ * Indeterminate motion and determinate value springs are driven by the shared motion frames of
108
+ * the indicator's window. Each frame writes the rotation to the rotation group alone, and samples
109
+ * the shape only when the frame shows another morph or progress, writing it only when its path
110
+ * data or transform changed, so a settled shape costs no path updates. Indeterminate motion runs
111
+ * only while the indicator is visible, not {@link LoadingIndicatorProps.paused | paused}, and
112
+ * reduced motion is not preferred; it resumes where it stopped.
113
+ *
114
+ * @typeParam P - component properties type
115
+ */
116
+ export declare class LoadingIndicatorController<P extends LoadingIndicatorProps = LoadingIndicatorProps> extends DomController<P> {
117
+ #private;
118
+ /**
119
+ * Construct a new controller.
120
+ *
121
+ * @param props - component properties
122
+ * @param contained - indicator is contained
123
+ */
124
+ constructor(props: P, contained?: boolean);
125
+ protected applyComponentProps(): void;
126
+ protected onStyleElementChanged(curr: StyleElement | null): void;
127
+ protected onControllerCleanup(): void;
128
+ protected render(): JSX.Element;
129
+ }
130
+ /**
131
+ * Material 3 Expressive loading indicator.
132
+ *
133
+ * A loading indicator shows that content is loading, by morphing a shape through a sequence of
134
+ * Material shapes while rotating it, as `LoadingIndicator.kt` does. A determinate indicator
135
+ * instead morphs from its first to its last shape, and rotates half a turn counter-clockwise, as
136
+ * its value progresses; value changes animate with the non-bouncy spring Compose recommends for
137
+ * progress (`ProgressIndicatorDefaults.ProgressAnimationSpec`).
138
+ *
139
+ * Indeterminate motion runs while the indicator is visible and not
140
+ * {@link LoadingIndicatorProps.paused | paused}, and stops at its current frame when reduced
141
+ * motion is preferred.
142
+ *
143
+ * # States
144
+ *
145
+ * The indicator is determinate while {@link LoadingIndicatorProps.value | `props.value`} is
146
+ * supplied and {@link LoadingIndicatorProps.indeterminate | `props.indeterminate`} is not `true`.
147
+ * The `cw-LoadingIndicator-determinate` or `cw-LoadingIndicator-indeterminate` CSS class is added
148
+ * to the root element accordingly.
149
+ *
150
+ * # Design
151
+ *
152
+ * Size and colors are controlled through the `loading` roles of the
153
+ * [`cw-Feedback`](./feedback.yaml) design attribute. The active shape spans 38/48 of the
154
+ * indicator, reduced so that it remains within the indicator in any rotation.
155
+ *
156
+ * # Accessibility
157
+ *
158
+ * The root element has the `progressbar` role, named "Loading" unless
159
+ * {@link LoadingIndicatorProps.label | `props.label`} or `attr:aria-label` supplies a name, and
160
+ * exposes its range and value while determinate.
161
+ *
162
+ * @param props - component properties
163
+ * @returns rendered element
164
+ */
165
+ export declare const LoadingIndicator: DomComponent<LoadingIndicatorProps>;
166
+ /**
167
+ * Client-side controller of a {@link ContainedLoadingIndicator}.
168
+ */
169
+ export declare class ContainedLoadingIndicatorController extends LoadingIndicatorController<ContainedLoadingIndicatorProps> {
170
+ /**
171
+ * Construct a new controller.
172
+ *
173
+ * @param props - component properties
174
+ */
175
+ constructor(props: ContainedLoadingIndicatorProps);
176
+ protected applyComponentProps(): void;
177
+ }
178
+ /**
179
+ * Material 3 Expressive contained loading indicator.
180
+ *
181
+ * A contained loading indicator is a {@link LoadingIndicator} on a container, for loading content
182
+ * over other content, such as a pull to refresh indicator.
183
+ *
184
+ * # Design
185
+ *
186
+ * The container color, shape, and the color of the indicator on it are controlled through the
187
+ * `loading` roles of the [`cw-Feedback`](./feedback.yaml) design attribute, or through
188
+ * {@link ContainedLoadingIndicatorProps.containerColor | `props.containerColor`} and
189
+ * {@link ContainedLoadingIndicatorProps.containerShape | `props.containerShape`}.
190
+ *
191
+ * @param props - component properties
192
+ * @returns rendered element
193
+ */
194
+ export declare const ContainedLoadingIndicator: DomComponent<ContainedLoadingIndicatorProps>;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Function notified of a change of an observed element.
3
+ *
4
+ * @typeParam T - type of the observed value
5
+ * @param value - observed value
6
+ */
7
+ type ObservationListener<T> = (value: T) => void;
8
+ /**
9
+ * Invoke a function once the exit motion of an element finishes.
10
+ *
11
+ * The exit motion consists of the running transitions of the opacity and the scale of the element.
12
+ * The function is invoked at once if there is none, and otherwise once each has finished or has
13
+ * been canceled.
14
+ *
15
+ * @param elem - element whose exit motion to wait for
16
+ * @param action - function to invoke
17
+ */
18
+ export declare function whenExitMotionFinished(elem: Element, action: () => void): void;
19
+ /**
20
+ * Invoke a function with the window of an element, once the element belongs to a document with a
21
+ * window.
22
+ *
23
+ * An element rendered from a template belongs to the inert document of the template until it is
24
+ * inserted into a document, which Solid does after the element is rendered, within the same task.
25
+ * The function is invoked at once for an element of a document with a window, and otherwise once
26
+ * the microtasks of the current task run, if the element was inserted by then.
27
+ *
28
+ * @param elem - element whose window to wait for
29
+ * @param action - function invoked with the window of the element
30
+ */
31
+ export declare function whenInDocument(elem: Element, action: (view: Window) => void): void;
32
+ /**
33
+ * Observe whether an element intersects the viewport of its document.
34
+ *
35
+ * All elements of a window share one `IntersectionObserver`, constructed from the element's own
36
+ * window, so that an element rendered into another frame is observed by that frame. The listener
37
+ * is first invoked asynchronously with the current state, then whenever the element enters or
38
+ * leaves the viewport, including when it is removed from its document.
39
+ *
40
+ * @param elem - element to observe
41
+ * @param listener - function invoked with `true` if, and only if, the element is visible
42
+ * @returns function which stops observing `elem`, or `undefined` if the element's window does not
43
+ * support intersection observers
44
+ */
45
+ export declare function observeVisibility(elem: Element, listener: ObservationListener<boolean>): (() => void) | undefined;
46
+ /**
47
+ * Observe the inline size of an element's content box.
48
+ *
49
+ * All elements of a window share one `ResizeObserver`, constructed from the element's own window.
50
+ * The size is the layout size, in the element's own CSS pixels: transforms and zoom applied by
51
+ * ancestors, such as the scale of an entering dialog, do not change it. The listener is first
52
+ * invoked asynchronously with the current size, then whenever the size changes.
53
+ *
54
+ * @param elem - element to observe
55
+ * @param listener - function invoked with the inline size of the element's content box
56
+ * @returns function which stops observing `elem`, or `undefined` if the element's window does not
57
+ * support resize observers
58
+ */
59
+ export declare function observeInlineSize(elem: Element, listener: ObservationListener<number>): (() => void) | undefined;
60
+ /**
61
+ * Observe mutations of an element and its subtree.
62
+ *
63
+ * All elements of a window share one `MutationObserver`, constructed from the element's own
64
+ * window. The listener is invoked once per batch of mutation records within the element, after
65
+ * the mutations. An element observed within another observed element notifies only its own
66
+ * listener of its mutations.
67
+ *
68
+ * @param elem - element to observe
69
+ * @param options - mutations to observe
70
+ * @param listener - function invoked after mutations
71
+ * @returns function which stops observing `elem`, or `undefined` if the element's window does not
72
+ * support mutation observers
73
+ */
74
+ export declare function observeMutations(elem: Element, options: MutationObserverInit, listener: ObservationListener<void>): (() => void) | undefined;
75
+ export {};