@pg-labs-incubator/cobweb 0.0.0-stage → 0.0.1

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 +111 -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 +320 -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 +580 -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,580 @@
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 "./surface.css";
6
+ /**
7
+ * Reason a dialog was requested to open or close.
8
+ *
9
+ * | Reason | Request |
10
+ * | ---------------- | -------------------------------------------------------------------- |
11
+ * | `"backdrop"` | the modal backdrop (scrim) was activated |
12
+ * | `"cancel"` | a close request, such as Escape, was not cancelled by `onCancel` |
13
+ * | `"close"` | the native dialog closed itself, e.g. `<form method="dialog">` |
14
+ * | `"confirm"` | the confirming action was activated |
15
+ * | `"dismiss"` | a dismissing control or gesture, e.g. a cancel action or drag handle |
16
+ * | `"programmatic"` | a controller method or a controlled `open` change |
17
+ */
18
+ export type DialogCloseReason = "backdrop" | "cancel" | "close" | "confirm" | "dismiss" | "programmatic";
19
+ /**
20
+ * Notify the parent that a dialog open-state change was requested.
21
+ *
22
+ * @param open - requested open state
23
+ * @param event - originating event, if any
24
+ * @param reason - reason for the request, when available
25
+ */
26
+ export type DialogOpenChangeHandler = (open: boolean, event?: Event, reason?: DialogCloseReason) => void;
27
+ /**
28
+ * Properties accepted by {@link Dialog}.
29
+ */
30
+ export type DialogProps = DomProps<HTMLDialogElement, Omit<JSX.HTMLAttributes<HTMLDialogElement>, "open" | "role" | "aria-modal" | "tabindex" | "tabIndex">> & {
31
+ /**
32
+ * Controlled open state.
33
+ *
34
+ * Supplying this property, even as `undefined`, makes the open state controlled: user and
35
+ * programmatic requests invoke {@link DialogProps.onOpenChange | `onOpenChange`}, and the
36
+ * dialog changes only when the parent updates this property.
37
+ */
38
+ open?: boolean | undefined;
39
+ /**
40
+ * Initial open state of an uncontrolled dialog.
41
+ *
42
+ * @remarks
43
+ * This is **not** reactive.
44
+ *
45
+ * @defaultValue `false`
46
+ */
47
+ defaultOpen?: boolean | undefined;
48
+ /**
49
+ * Dialog is modal.
50
+ *
51
+ * A modal dialog opens with `showModal()`: it is placed in the top layer above a scrim, the
52
+ * rest of the document is inert, and Tab wraps within the dialog. A nonmodal dialog opens with
53
+ * `show()`.
54
+ *
55
+ * @defaultValue `true`
56
+ */
57
+ modal?: boolean | undefined;
58
+ /**
59
+ * Accessible dialog role.
60
+ *
61
+ * @defaultValue `"dialog"`
62
+ */
63
+ role?: "dialog" | "alertdialog" | undefined;
64
+ /**
65
+ * Accessible name used when neither `aria-label` nor `aria-labelledby` is supplied.
66
+ *
67
+ * @defaultValue `"Dialog"`
68
+ */
69
+ label?: string | undefined;
70
+ /**
71
+ * Restore focus to the element which was focused before the dialog opened.
72
+ *
73
+ * Focus is restored when the dialog closes while it, or nothing, has focus; focus which the
74
+ * user moved elsewhere stays where it is. For a modal dialog, the value is read when the dialog
75
+ * opens, since the browser's own modal close steps restore focus: `false` then opens the dialog
76
+ * without a previously focused element to return to.
77
+ *
78
+ * @defaultValue `true`
79
+ */
80
+ returnFocus?: boolean | undefined;
81
+ /**
82
+ * CSS selector or element to focus after opening.
83
+ *
84
+ * When omitted, or when the target cannot be focused, the first `autofocus` element, the first
85
+ * focusable element, or the dialog itself is focused.
86
+ */
87
+ initialFocus?: string | HTMLElement | undefined;
88
+ /**
89
+ * Close when the backdrop (scrim) of a modal dialog is activated.
90
+ *
91
+ * The backdrop counts as activated only when the pointer is both pressed and released on it,
92
+ * so a text selection which ends on the backdrop does not close the dialog.
93
+ *
94
+ * @defaultValue `true`
95
+ */
96
+ closeOnBackdrop?: boolean | undefined;
97
+ /**
98
+ * Sequential focus index of the dialog element itself.
99
+ */
100
+ tabIndex?: number | undefined;
101
+ /**
102
+ * Handle a user or programmatic request to change the open state.
103
+ *
104
+ * Invoked for controlled and uncontrolled dialogs; an uncontrolled dialog has already applied
105
+ * the change when this is invoked.
106
+ */
107
+ onOpenChange?: DialogOpenChangeHandler | undefined;
108
+ /**
109
+ * Handle the native dialog `close` event.
110
+ *
111
+ * Close events caused by the dialog switching between modal and nonmodal presentation are not
112
+ * reported.
113
+ *
114
+ * @param event - native close event
115
+ */
116
+ onClose?: ((event: Event) => void) | undefined;
117
+ /**
118
+ * Handle a close request, such as Escape.
119
+ *
120
+ * Call `event.preventDefault()` to keep the dialog open; otherwise, closure is requested with
121
+ * the `"cancel"` reason.
122
+ *
123
+ * @param event - cancel event
124
+ */
125
+ onCancel?: ((event: Event) => void) | undefined;
126
+ };
127
+ /**
128
+ * Properties accepted by {@link AlertDialog}.
129
+ */
130
+ export type AlertDialogProps = DialogProps & {
131
+ /**
132
+ * Hero icon shown above the headline, which is then centered.
133
+ */
134
+ icon?: JSX.Element;
135
+ /**
136
+ * Headline, which also names the dialog when no `aria-label`, `aria-labelledby`, or `label`
137
+ * is supplied.
138
+ */
139
+ title?: JSX.Element;
140
+ /**
141
+ * Supporting text, which describes the dialog. Children are used when omitted.
142
+ */
143
+ text?: JSX.Element;
144
+ /**
145
+ * Alias for {@link AlertDialogProps.text | `text`}.
146
+ */
147
+ supportingText?: JSX.Element;
148
+ /**
149
+ * Content of the confirming action.
150
+ *
151
+ * @defaultValue `"OK"`
152
+ */
153
+ confirmLabel?: JSX.Element;
154
+ /**
155
+ * Content of the dismissing action.
156
+ *
157
+ * @defaultValue `"Cancel"`
158
+ */
159
+ dismissLabel?: JSX.Element;
160
+ /**
161
+ * Show the dismissing action.
162
+ *
163
+ * @defaultValue `true`
164
+ */
165
+ showDismiss?: boolean | undefined;
166
+ /**
167
+ * Handle activation of the confirming action before closure is requested.
168
+ *
169
+ * Call `event.preventDefault()` to keep the dialog open.
170
+ *
171
+ * @param event - click event
172
+ */
173
+ onConfirm?: ((event: Event) => void) | undefined;
174
+ /**
175
+ * Handle activation of the dismissing action before closure is requested.
176
+ *
177
+ * Call `event.preventDefault()` to keep the dialog open.
178
+ *
179
+ * @param event - click event
180
+ */
181
+ onDismiss?: ((event: Event) => void) | undefined;
182
+ };
183
+ /**
184
+ * Properties accepted by {@link FullScreenDialog}.
185
+ */
186
+ export type FullScreenDialogProps = Omit<DialogProps, "closeOnBackdrop" | "modal" | "role"> & {
187
+ /**
188
+ * Headline, which also names the dialog when no `aria-label`, `aria-labelledby`, or `label`
189
+ * is supplied.
190
+ */
191
+ title?: JSX.Element;
192
+ /**
193
+ * Content of the confirming header action. The action is omitted when this is omitted.
194
+ */
195
+ confirmLabel?: JSX.Element;
196
+ /**
197
+ * Accessible name of the close action.
198
+ *
199
+ * @defaultValue `"Close"`
200
+ */
201
+ closeLabel?: string | undefined;
202
+ /**
203
+ * Icon of the close action. A close glyph is used when omitted.
204
+ */
205
+ closeIcon?: JSX.Element;
206
+ /**
207
+ * Handle activation of the confirming action before closure is requested.
208
+ *
209
+ * Call `event.preventDefault()` to keep the dialog open.
210
+ *
211
+ * @param event - click event
212
+ */
213
+ onConfirm?: ((event: Event) => void) | undefined;
214
+ /**
215
+ * Handle activation of the close action before closure is requested.
216
+ *
217
+ * Call `event.preventDefault()` to keep the dialog open.
218
+ *
219
+ * @param event - click event
220
+ */
221
+ onDismiss?: ((event: Event) => void) | undefined;
222
+ };
223
+ /**
224
+ * Determine the focused element of the document or shadow root containing a node.
225
+ *
226
+ * @param node - node in the document or shadow root
227
+ * @returns focused element, or `null` when no element has focus
228
+ */
229
+ export declare function activeElementOf(node: Node): HTMLElement | null;
230
+ /**
231
+ * Client controller of a native `<dialog>`.
232
+ *
233
+ * The controller owns the open state, the native modal or nonmodal presentation, focus placement
234
+ * and restoration, close requests, and the accessible naming of the dialog element. It uses
235
+ * element-local listeners and native dialog events, so multiple dialogs can coexist without
236
+ * document-level listeners. Subclasses render their own anatomy and may veto or reinterpret user
237
+ * dismissal through {@link DialogController.allowDismiss | `allowDismiss`} and {@link
238
+ * DialogController.requestDismiss | `requestDismiss`}.
239
+ *
240
+ * # States
241
+ *
242
+ * | Method | Uncontrolled | Controlled |
243
+ * | ---------------------------------------- | --------------------- | ------------------- |
244
+ * | {@link DialogController.open | `open`} | opens, then notifies | asks `onOpenChange` |
245
+ * | {@link DialogController.close | `close`} | closes, then notifies | asks `onOpenChange` |
246
+ *
247
+ * While the dialog is open, the `<css>-open` class is applied, where `<css>` is the public CSS
248
+ * class name the controller is constructed with.
249
+ *
250
+ * @typeParam P - component properties type
251
+ */
252
+ export declare class DialogController<P extends DialogProps = DialogProps> extends DomController<P> {
253
+ #private;
254
+ /**
255
+ * Construct a new `DialogController`.
256
+ *
257
+ * @param props - component properties
258
+ * @param cssClassName - public CSS class name of the component
259
+ */
260
+ constructor(props: P, cssClassName?: string);
261
+ /**
262
+ * Default ARIA role, used when no role is supplied.
263
+ *
264
+ * @returns default role
265
+ */
266
+ protected defaultRole(): "dialog" | "alertdialog";
267
+ /**
268
+ * Default accessible name, used when no naming attribute or labelling element applies.
269
+ *
270
+ * @returns accessible name, or `undefined` for none
271
+ */
272
+ protected defaultLabel(): string | undefined;
273
+ /**
274
+ * Identifier of the element which names the dialog by default.
275
+ *
276
+ * An authored `aria-label` or `aria-labelledby` takes precedence.
277
+ *
278
+ * @returns element identifier, or `undefined` for none
279
+ */
280
+ protected defaultLabelledBy(): string | undefined;
281
+ /**
282
+ * Identifier of the element which describes the dialog by default.
283
+ *
284
+ * An authored `aria-describedby` takes precedence.
285
+ *
286
+ * @returns element identifier, or `undefined` for none
287
+ */
288
+ protected defaultDescribedBy(): string | undefined;
289
+ /**
290
+ * Test whether a user dismissal may close the dialog.
291
+ *
292
+ * Programmatic closure through {@link DialogController.close | `close`} is never vetoed.
293
+ *
294
+ * @param _reason - dismissal reason
295
+ * @param _event - originating event, if any
296
+ * @returns `true` if, and only if, the dismissal is allowed
297
+ */
298
+ protected allowDismiss(_reason: DialogCloseReason, _event: Event | undefined): boolean;
299
+ /**
300
+ * Request closure for a user dismissal, such as Escape or a backdrop activation.
301
+ *
302
+ * The base implementation closes the dialog when {@link DialogController.allowDismiss |
303
+ * `allowDismiss`} allows it.
304
+ *
305
+ * @param reason - dismissal reason
306
+ * @param event - originating event, if any
307
+ */
308
+ protected requestDismiss(reason: DialogCloseReason, event: Event | undefined): void;
309
+ /**
310
+ * Handle a change of the applied open state, *before* the native dialog is shown or closed.
311
+ *
312
+ * @param _open - applied open state
313
+ */
314
+ protected onOpenStateChanged(_open: boolean): void;
315
+ /**
316
+ * Handle the presentation of the native dialog, once it was shown with its current modality.
317
+ *
318
+ * This is invoked whenever the dialog is presented: after it opens, after its modality
319
+ * changes, and when it is presented once hydrated or connected.
320
+ */
321
+ protected onShown(): void;
322
+ /**
323
+ * Test whether the dialog is open.
324
+ *
325
+ * @returns `true` if, and only if, the dialog is open
326
+ */
327
+ isOpen(): boolean;
328
+ /**
329
+ * Request that the dialog open.
330
+ *
331
+ * A controlled dialog requests the change through `onOpenChange` and waits for the parent to
332
+ * update `open`; an uncontrolled dialog opens, then notifies `onOpenChange`.
333
+ */
334
+ open(): void;
335
+ /**
336
+ * Request that the dialog close.
337
+ *
338
+ * A controlled dialog requests the change through `onOpenChange` and stays open until the
339
+ * parent updates `open`; an uncontrolled dialog closes, then notifies `onOpenChange`.
340
+ *
341
+ * @param reason - close reason
342
+ * @param event - originating event, if any
343
+ */
344
+ close(reason?: DialogCloseReason, event?: Event): void;
345
+ /**
346
+ * Request the opposite of the current open state.
347
+ *
348
+ * @see {@link DialogController.open}
349
+ * @see {@link DialogController.close}
350
+ */
351
+ toggle(): void;
352
+ /**
353
+ * Apply local properties to component state and styling.
354
+ *
355
+ * @see {@link ../dom/client#DomController.applyComponentProps}
356
+ */
357
+ protected applyComponentProps(): void;
358
+ /**
359
+ * Handle style element replacement before the controller reference is updated.
360
+ *
361
+ * The style-element getter still exposes the previous element during this hook.
362
+ *
363
+ * @param curr - new style element, or `null` when absent
364
+ * @see {@link ../dom/client#DomController.onStyleElementChanged}
365
+ */
366
+ protected onStyleElementChanged(curr: StyleElement | null): void;
367
+ /**
368
+ * Render the component's element tree.
369
+ *
370
+ * @param children - nested component children, possibly an accessor
371
+ * @returns rendered component elements
372
+ * @see {@link ../dom/client#DomController.render}
373
+ */
374
+ protected render(children: JSX.Element): JSX.Element;
375
+ /**
376
+ * Close the dialog and release its listeners when the controller is disposed.
377
+ *
378
+ * @see {@link ../dom/client#DomController.onControllerCleanup}
379
+ */
380
+ protected onControllerCleanup(): void;
381
+ }
382
+ /**
383
+ * Native modal or nonmodal dialog container.
384
+ *
385
+ * A dialog places its children on a Material dialog container: the `dialogColor`, `dialogShape`,
386
+ * `dialogElevation`, and `dialogPadding` roles, between the minimum and maximum dialog widths, and
387
+ * within the viewport margin. A modal dialog uses the browser top layer above a scrim; Escape and
388
+ * backdrop activation request closure, and focus returns to its opener. For the Material basic
389
+ * dialog anatomy, use {@link AlertDialog}; for a full-screen dialog, use {@link FullScreenDialog}.
390
+ *
391
+ * # Motion
392
+ *
393
+ * Opening fades the container in on the default effects spring and scales it up from 80% on the
394
+ * default spatial spring, as MDC's `m3_motion_fade_enter`; closing fades it out on the fast
395
+ * effects spring, as `m3_motion_fade_exit`. The scrim fades on the same effects springs.
396
+ *
397
+ * # Design
398
+ *
399
+ * Dialog design is controlled through the `dialog*` roles of the [`cw-Surface`](./surface.yaml)
400
+ * design attribute. The `cw-Dialog-open` class is applied while the dialog is open.
401
+ *
402
+ * @param props - component properties
403
+ * @returns rendered component elements
404
+ */
405
+ export declare const Dialog: DomComponent<DialogProps>;
406
+ /**
407
+ * Client controller of an {@link AlertDialog}.
408
+ */
409
+ export declare class AlertDialogController extends DialogController<AlertDialogProps> {
410
+ #private;
411
+ /**
412
+ * Construct a new `AlertDialogController`.
413
+ *
414
+ * @param props - component properties
415
+ */
416
+ constructor(props: AlertDialogProps);
417
+ /**
418
+ * Default ARIA role, used when no role is supplied.
419
+ *
420
+ * @returns `"alertdialog"`
421
+ */
422
+ protected defaultRole(): "dialog" | "alertdialog";
423
+ /**
424
+ * Default accessible name, used when no naming attribute applies.
425
+ *
426
+ * A `label` takes precedence over the headline.
427
+ *
428
+ * @returns accessible name, or `undefined` when the headline names the dialog
429
+ */
430
+ protected defaultLabel(): string | undefined;
431
+ /**
432
+ * Identifier of the headline, which names the dialog unless a `label` is supplied.
433
+ *
434
+ * @returns headline identifier, or `undefined` without a headline or with a `label`
435
+ */
436
+ protected defaultLabelledBy(): string | undefined;
437
+ /**
438
+ * Identifier of the supporting text, which describes the dialog.
439
+ *
440
+ * @returns supporting text identifier
441
+ */
442
+ protected defaultDescribedBy(): string | undefined;
443
+ /**
444
+ * Apply local properties to component state and styling.
445
+ *
446
+ * @see {@link ../dom/client#DomController.applyComponentProps}
447
+ */
448
+ protected applyComponentProps(): void;
449
+ /**
450
+ * Handle style element replacement before the controller reference is updated.
451
+ *
452
+ * The style-element getter still exposes the previous element during this hook.
453
+ *
454
+ * @param curr - new style element, or `null` when absent
455
+ * @see {@link ../dom/client#DomController.onStyleElementChanged}
456
+ */
457
+ protected onStyleElementChanged(curr: StyleElement | null): void;
458
+ /**
459
+ * Render the component's element tree.
460
+ *
461
+ * The icon, headline, supporting text, and action labels are reactive slots.
462
+ *
463
+ * @param children - nested component children, possibly an accessor
464
+ * @returns rendered component elements
465
+ * @see {@link ../dom/client#DomController.render}
466
+ */
467
+ protected render(children: JSX.Element): JSX.Element;
468
+ /**
469
+ * Release the action listener when the controller is disposed.
470
+ *
471
+ * @see {@link ../dom/client#DomController.onControllerCleanup}
472
+ */
473
+ protected onControllerCleanup(): void;
474
+ }
475
+ /**
476
+ * Material basic dialog.
477
+ *
478
+ * An alert dialog presents an optional hero icon, a headline, supporting text, and dismissing and
479
+ * confirming text buttons on the {@link Dialog} container. The headline names the dialog and the
480
+ * supporting text describes it. The anatomy and spacing follow Compose `AlertDialog`: with an
481
+ * icon, the headline is centered below it. Supporting text which does not fit scrolls between the
482
+ * fixed headline and actions, and dividers mark scrolled-away content, as material-web dialogs.
483
+ *
484
+ * Activating an action invokes `onConfirm` or `onDismiss`, then requests closure with the
485
+ * `"confirm"` or `"dismiss"` reason unless the callback called `event.preventDefault()`. Initial
486
+ * focus goes to the dismissing action, the least destructive choice.
487
+ *
488
+ * # Design
489
+ *
490
+ * Alert dialog design is controlled through the `dialog*` roles of the
491
+ * [`cw-Surface`](./surface.yaml) design attribute; the headline uses the headline-small
492
+ * typescale, the supporting text body-medium, and the actions are `text` buttons. The
493
+ * `cw-AlertDialog-noDismiss` class is applied while the dismissing action is hidden.
494
+ *
495
+ * @param props - component properties
496
+ * @returns rendered component elements
497
+ */
498
+ export declare const AlertDialog: DomComponent<AlertDialogProps>;
499
+ /**
500
+ * Client controller of a {@link FullScreenDialog}.
501
+ */
502
+ export declare class FullScreenDialogController extends DialogController<FullScreenDialogProps> {
503
+ #private;
504
+ /**
505
+ * Construct a new `FullScreenDialogController`.
506
+ *
507
+ * @param props - component properties
508
+ */
509
+ constructor(props: FullScreenDialogProps);
510
+ /**
511
+ * Default accessible name, used when no naming attribute applies.
512
+ *
513
+ * A `label` takes precedence over the headline.
514
+ *
515
+ * @returns accessible name, or `undefined` when the headline names the dialog
516
+ */
517
+ protected defaultLabel(): string | undefined;
518
+ /**
519
+ * Identifier of the headline, which names the dialog unless a `label` is supplied.
520
+ *
521
+ * @returns headline identifier, or `undefined` without a headline or with a `label`
522
+ */
523
+ protected defaultLabelledBy(): string | undefined;
524
+ /**
525
+ * Apply local properties to component state and styling.
526
+ *
527
+ * @see {@link ../dom/client#DomController.applyComponentProps}
528
+ */
529
+ protected applyComponentProps(): void;
530
+ /**
531
+ * Handle style element replacement before the controller reference is updated.
532
+ *
533
+ * The style-element getter still exposes the previous element during this hook.
534
+ *
535
+ * @param curr - new style element, or `null` when absent
536
+ * @see {@link ../dom/client#DomController.onStyleElementChanged}
537
+ */
538
+ protected onStyleElementChanged(curr: StyleElement | null): void;
539
+ /**
540
+ * Render the component's element tree.
541
+ *
542
+ * The headline, close icon, and action label are reactive slots.
543
+ *
544
+ * @param children - nested component children, possibly an accessor
545
+ * @returns rendered component elements
546
+ * @see {@link ../dom/client#DomController.render}
547
+ */
548
+ protected render(children: JSX.Element): JSX.Element;
549
+ /**
550
+ * Release the action and scroll listeners when the controller is disposed.
551
+ *
552
+ * @see {@link ../dom/client#DomController.onControllerCleanup}
553
+ */
554
+ protected onControllerCleanup(): void;
555
+ }
556
+ /**
557
+ * Material full-screen dialog.
558
+ *
559
+ * A full-screen dialog covers the viewport with a header, which holds a close icon button, the
560
+ * headline, and an optional confirming text button, above scrolling content. Material recommends
561
+ * full-screen dialogs for compact windows; {@link ./scaffold#createWindowSizeClass} tells them
562
+ * apart. The dialog is always modal; Escape and the close action request closure.
563
+ *
564
+ * # Motion
565
+ *
566
+ * Opening slides the dialog up from the bottom edge on the slow spatial spring, the full-screen
567
+ * speed; closing slides it down on the fast effects spring, which does not overshoot.
568
+ *
569
+ * # Design
570
+ *
571
+ * Full-screen dialog design is controlled through the `fullScreenDialog*` roles of the
572
+ * [`cw-Surface`](./surface.yaml) design attribute, after `md.comp.full-screen-dialog`: a surface
573
+ * container without corner rounding, a 56px header with a title-large headline, and a header which
574
+ * takes the scrolled color and elevation while the content is scrolled. The
575
+ * `cw-FullScreenDialog-scrolled` class is applied while the content is scrolled.
576
+ *
577
+ * @param props - component properties
578
+ * @returns rendered component elements
579
+ */
580
+ export declare const FullScreenDialog: DomComponent<FullScreenDialogProps>;
@@ -0,0 +1,92 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { DomComponent, DomProps } from "..";
3
+ import { DomController } from "../dom/client";
4
+ import "./surface.css";
5
+ /**
6
+ * Divider orientation.
7
+ */
8
+ export type DividerOrientation = "horizontal" | "vertical";
9
+ /**
10
+ * Properties accepted by {@link Divider}.
11
+ */
12
+ export type DividerProps = DomProps<HTMLDivElement, Omit<JSX.HTMLAttributes<HTMLDivElement>, "role" | "aria-orientation">> & {
13
+ /**
14
+ * Divider orientation.
15
+ *
16
+ * @defaultValue `"horizontal"`
17
+ */
18
+ orientation?: DividerOrientation | undefined;
19
+ /**
20
+ * Alias for `orientation="vertical"`, which takes precedence when `true`.
21
+ *
22
+ * @defaultValue `false`
23
+ */
24
+ vertical?: boolean | undefined;
25
+ /**
26
+ * Logical edges the divider is inset from.
27
+ *
28
+ * Material's full-width divider is `"none"`, its inset divider is `"start"`, and its
29
+ * middle-inset divider is `"both"`. A horizontal divider is inset along the inline axis and a
30
+ * vertical divider along the block axis, each by the `dividerInset` role.
31
+ *
32
+ * @defaultValue `"none"`
33
+ */
34
+ inset?: "none" | "start" | "end" | "both" | undefined;
35
+ /**
36
+ * Divider separates content semantically.
37
+ *
38
+ * When `true`, the divider has the `separator` role, with `aria-orientation` when vertical;
39
+ * otherwise, it is decorative and hidden from assistive technology semantics.
40
+ *
41
+ * @defaultValue `true`
42
+ */
43
+ semantic?: boolean | undefined;
44
+ /**
45
+ * Divider thickness, in CSS pixels or as a CSS length.
46
+ *
47
+ * When omitted, the `dividerThickness` role applies.
48
+ */
49
+ thickness?: number | string | undefined;
50
+ };
51
+ /**
52
+ * Client controller of a {@link Divider}.
53
+ */
54
+ export declare class DividerController extends DomController<DividerProps> {
55
+ #private;
56
+ /**
57
+ * Construct a new `DividerController`.
58
+ *
59
+ * @param props - component properties
60
+ */
61
+ constructor(props: DividerProps);
62
+ /**
63
+ * Apply local properties to component state and styling.
64
+ *
65
+ * @see {@link ../dom/client#DomController.applyComponentProps}
66
+ */
67
+ protected applyComponentProps(): void;
68
+ /**
69
+ * Render the component's element tree.
70
+ *
71
+ * @param children - nested component children, possibly an accessor
72
+ * @returns rendered component elements
73
+ * @see {@link ../dom/client#DomController.render}
74
+ */
75
+ protected render(children: JSX.Element): JSX.Element;
76
+ }
77
+ /**
78
+ * Material divider.
79
+ *
80
+ * A divider is a thin line which groups content in lists and containers. It draws a single
81
+ * logical border, so it remains visible in forced-colors mode, and it follows the writing
82
+ * direction for its inset edges.
83
+ *
84
+ * # Design
85
+ *
86
+ * Divider design is controlled through the `dividerColor`, `dividerThickness`, and `dividerInset`
87
+ * roles of the [`cw-Surface`](./surface.yaml) design attribute.
88
+ *
89
+ * @param props - component properties
90
+ * @returns rendered component elements
91
+ */
92
+ export declare const Divider: DomComponent<DividerProps>;