@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.
- package/LICENSE +163 -0
- package/README.md +82 -2
- package/package.json +112 -3
- package/src/action/action.yaml +291 -0
- package/src/action/button-group.yaml +56 -0
- package/src/action/button.yaml +239 -0
- package/src/action/split-button.yaml +87 -0
- package/src/color/color.yaml +181 -0
- package/src/color/palette.yaml +147 -0
- package/src/container/card.yaml +170 -0
- package/src/container/corner-radius.yaml +50 -0
- package/src/container/elevation.yaml +19 -0
- package/src/design.yaml +41 -0
- package/src/feedback/feedback.yaml +225 -0
- package/src/icon/icon-font.yaml +28 -0
- package/src/icon/icon.yaml +31 -0
- package/src/input/date-picker.yaml +144 -0
- package/src/input/date-range-input.yaml +162 -0
- package/src/input/range-slider.yaml +161 -0
- package/src/input/select.yaml +230 -0
- package/src/input/slider.yaml +172 -0
- package/src/input/text-field.yaml +240 -0
- package/src/input/time-picker.yaml +220 -0
- package/src/motion/motion.yaml +371 -0
- package/src/navigation/app-bar.yaml +147 -0
- package/src/navigation/navigation.yaml +339 -0
- package/src/navigation/scroll.yaml +23 -0
- package/src/navigation/search.yaml +112 -0
- package/src/navigation/tabs.yaml +144 -0
- package/src/navigation/toolbar.yaml +130 -0
- package/src/selection/checkbox.yaml +162 -0
- package/src/selection/chip.yaml +219 -0
- package/src/selection/radio.yaml +125 -0
- package/src/selection/segmented-group.yaml +11 -0
- package/src/selection/segmented.yaml +69 -0
- package/src/selection/switch.yaml +209 -0
- package/src/spacing/measurement.yaml +80 -0
- package/src/state/state.yaml +38 -0
- package/src/surface/surface.yaml +483 -0
- package/src/text/line-height.yaml +144 -0
- package/src/text/typeface.yaml +31 -0
- package/src/text/typescale.yaml +726 -0
- package/target/esbuild/action/action.css +1 -0
- package/target/esbuild/action/base.jsx +1 -0
- package/target/esbuild/action/button.jsx +17 -0
- package/target/esbuild/action/fab-menu-context.jsx +1 -0
- package/target/esbuild/action/fab-menu.jsx +15 -0
- package/target/esbuild/action/fab.jsx +7 -0
- package/target/esbuild/action/group.jsx +22 -0
- package/target/esbuild/action/icon-button.jsx +5 -0
- package/target/esbuild/action/index.jsx +1 -0
- package/target/esbuild/action/split-button.jsx +12 -0
- package/target/esbuild/color/contrast.jsx +1 -0
- package/target/esbuild/color/dynamic.jsx +1 -0
- package/target/esbuild/color/hct.jsx +1 -0
- package/target/esbuild/color/index.css +1 -0
- package/target/esbuild/color/index.jsx +1 -0
- package/target/esbuild/color/palette.jsx +1 -0
- package/target/esbuild/color/scheme.jsx +1 -0
- package/target/esbuild/color/temperature.jsx +1 -0
- package/target/esbuild/container/card.css +1 -0
- package/target/esbuild/container/card.jsx +1 -0
- package/target/esbuild/container/elevation-shadow.css +1 -0
- package/target/esbuild/container/elevation-shadow.jsx +1 -0
- package/target/esbuild/container/index.jsx +1 -0
- package/target/esbuild/dom/client.jsx +1 -0
- package/target/esbuild/dom/index.jsx +1 -0
- package/target/esbuild/dom/server.jsx +1 -0
- package/target/esbuild/dom/types.jsx +1 -0
- package/target/esbuild/feedback/badge.jsx +15 -0
- package/target/esbuild/feedback/feedback.css +1 -0
- package/target/esbuild/feedback/focus.jsx +1 -0
- package/target/esbuild/feedback/index.jsx +1 -0
- package/target/esbuild/feedback/loading.jsx +7 -0
- package/target/esbuild/feedback/observe.jsx +1 -0
- package/target/esbuild/feedback/progress.jsx +35 -0
- package/target/esbuild/feedback/snackbar.jsx +23 -0
- package/target/esbuild/feedback/tooltip.jsx +24 -0
- package/target/esbuild/icon/icon.css +1 -0
- package/target/esbuild/icon/icon.jsx +1 -0
- package/target/esbuild/icon/index.jsx +1 -0
- package/target/esbuild/index.css +1 -0
- package/target/esbuild/index.jsx +1 -0
- package/target/esbuild/input/autocomplete.jsx +5 -0
- package/target/esbuild/input/base.jsx +4 -0
- package/target/esbuild/input/date-picker.css +1 -0
- package/target/esbuild/input/date-picker.jsx +104 -0
- package/target/esbuild/input/date-range-input.css +1 -0
- package/target/esbuild/input/date-time.jsx +21 -0
- package/target/esbuild/input/index.css +1 -0
- package/target/esbuild/input/index.jsx +1 -0
- package/target/esbuild/input/paired-input.jsx +1 -0
- package/target/esbuild/input/picker-dialog.css +1 -0
- package/target/esbuild/input/picker-dialog.jsx +14 -0
- package/target/esbuild/input/select.css +1 -0
- package/target/esbuild/input/select.jsx +63 -0
- package/target/esbuild/input/slider.css +1 -0
- package/target/esbuild/input/slider.jsx +51 -0
- package/target/esbuild/input/text-field.css +1 -0
- package/target/esbuild/input/text-field.jsx +67 -0
- package/target/esbuild/input/time-picker.css +1 -0
- package/target/esbuild/input/time-picker.jsx +29 -0
- package/target/esbuild/motion/frame.jsx +1 -0
- package/target/esbuild/motion/index.css +1 -0
- package/target/esbuild/motion/index.jsx +1 -0
- package/target/esbuild/motion/material.jsx +1 -0
- package/target/esbuild/motion/motion.jsx +1 -0
- package/target/esbuild/motion/spring.jsx +1 -0
- package/target/esbuild/motion/transition.css +1 -0
- package/target/esbuild/motion/transition.jsx +1 -0
- package/target/esbuild/motion/velocity.jsx +1 -0
- package/target/esbuild/navigation/app-bar.jsx +51 -0
- package/target/esbuild/navigation/base.jsx +1 -0
- package/target/esbuild/navigation/drawer.jsx +25 -0
- package/target/esbuild/navigation/index.jsx +1 -0
- package/target/esbuild/navigation/navigation.css +1 -0
- package/target/esbuild/navigation/navigation.jsx +29 -0
- package/target/esbuild/navigation/scroll.jsx +1 -0
- package/target/esbuild/navigation/search.jsx +29 -0
- package/target/esbuild/navigation/tabs.jsx +7 -0
- package/target/esbuild/navigation/toolbar.jsx +23 -0
- package/target/esbuild/selection/base.jsx +1 -0
- package/target/esbuild/selection/checkbox.jsx +14 -0
- package/target/esbuild/selection/chip.jsx +23 -0
- package/target/esbuild/selection/index.jsx +1 -0
- package/target/esbuild/selection/radio.jsx +9 -0
- package/target/esbuild/selection/segmented.jsx +15 -0
- package/target/esbuild/selection/selection.css +1 -0
- package/target/esbuild/selection/switch.jsx +14 -0
- package/target/esbuild/shape/corner-rounding.jsx +1 -0
- package/target/esbuild/shape/cubic.jsx +1 -0
- package/target/esbuild/shape/index.jsx +1 -0
- package/target/esbuild/shape/material-shapes.jsx +1 -0
- package/target/esbuild/shape/morph.jsx +1 -0
- package/target/esbuild/shape/path.jsx +1 -0
- package/target/esbuild/shape/point.jsx +1 -0
- package/target/esbuild/shape/rounded-polygon.jsx +1 -0
- package/target/esbuild/shape/shapes.jsx +1 -0
- package/target/esbuild/spacing/index.jsx +1 -0
- package/target/esbuild/state/component.css +1 -0
- package/target/esbuild/state/component.jsx +1 -0
- package/target/esbuild/state/controller.jsx +1 -0
- package/target/esbuild/state/index.jsx +1 -0
- package/target/esbuild/state/ripple.jsx +1 -0
- package/target/esbuild/state/state.jsx +1 -0
- package/target/esbuild/state/style.jsx +1 -0
- package/target/esbuild/surface/carousel-layout.jsx +1 -0
- package/target/esbuild/surface/carousel.css +1 -0
- package/target/esbuild/surface/carousel.jsx +10 -0
- package/target/esbuild/surface/dialog.jsx +35 -0
- package/target/esbuild/surface/divider.jsx +1 -0
- package/target/esbuild/surface/drag.jsx +1 -0
- package/target/esbuild/surface/gestures.css +1 -0
- package/target/esbuild/surface/gestures.jsx +7 -0
- package/target/esbuild/surface/index.css +1 -0
- package/target/esbuild/surface/index.jsx +1 -0
- package/target/esbuild/surface/interactive.jsx +1 -0
- package/target/esbuild/surface/list-patterns.jsx +26 -0
- package/target/esbuild/surface/list.css +1 -0
- package/target/esbuild/surface/list.jsx +9 -0
- package/target/esbuild/surface/menu.css +1 -0
- package/target/esbuild/surface/menu.jsx +12 -0
- package/target/esbuild/surface/scaffold.jsx +47 -0
- package/target/esbuild/surface/sheet.jsx +21 -0
- package/target/esbuild/surface/side-sheet.jsx +17 -0
- package/target/esbuild/surface/slots.jsx +1 -0
- package/target/esbuild/surface/surface.css +1 -0
- package/target/esbuild/surface/surface.jsx +1 -0
- package/target/esbuild/text/index.css +1 -0
- package/target/esbuild/text/index.jsx +1 -0
- package/target/esbuild/text/text.css +1 -0
- package/target/esbuild/text/text.jsx +3 -0
- package/target/esbuild/text/typography.css +1 -0
- package/target/esbuild/text/typography.jsx +1 -0
- package/target/esbuild/util/box-side.jsx +1 -0
- package/target/esbuild/util/debug.jsx +1 -0
- package/target/esbuild/util/dom.jsx +1 -0
- package/target/esbuild/util/event.jsx +1 -0
- package/target/esbuild/util/index.jsx +1 -0
- package/target/esbuild/util/preconditions.jsx +1 -0
- package/target/esbuild/util/reactive.jsx +1 -0
- package/target/tsc/action/action.css.d.ts +3 -0
- package/target/tsc/action/base.d.ts +211 -0
- package/target/tsc/action/button.d.ts +126 -0
- package/target/tsc/action/fab-menu-context.d.ts +16 -0
- package/target/tsc/action/fab-menu.d.ts +112 -0
- package/target/tsc/action/fab.d.ts +98 -0
- package/target/tsc/action/group.d.ts +166 -0
- package/target/tsc/action/icon-button.d.ts +79 -0
- package/target/tsc/action/index.d.ts +24 -0
- package/target/tsc/action/split-button.d.ts +78 -0
- package/target/tsc/color/contrast.d.ts +48 -0
- package/target/tsc/color/dynamic.d.ts +203 -0
- package/target/tsc/color/hct.d.ts +114 -0
- package/target/tsc/color/index.css.d.ts +3 -0
- package/target/tsc/color/index.d.ts +23 -0
- package/target/tsc/color/palette.d.ts +30 -0
- package/target/tsc/color/scheme.d.ts +446 -0
- package/target/tsc/color/temperature.d.ts +24 -0
- package/target/tsc/container/card.css.d.ts +3 -0
- package/target/tsc/container/card.d.ts +110 -0
- package/target/tsc/container/elevation-shadow.css.d.ts +3 -0
- package/target/tsc/container/elevation-shadow.d.ts +23 -0
- package/target/tsc/container/index.d.ts +44 -0
- package/target/tsc/dom/client.d.ts +387 -0
- package/target/tsc/dom/index.d.ts +93 -0
- package/target/tsc/dom/server.d.ts +65 -0
- package/target/tsc/dom/types.d.ts +134 -0
- package/target/tsc/feedback/badge.d.ts +116 -0
- package/target/tsc/feedback/feedback.css.d.ts +3 -0
- package/target/tsc/feedback/focus.d.ts +20 -0
- package/target/tsc/feedback/index.d.ts +17 -0
- package/target/tsc/feedback/loading.d.ts +194 -0
- package/target/tsc/feedback/observe.d.ts +75 -0
- package/target/tsc/feedback/progress.d.ts +281 -0
- package/target/tsc/feedback/snackbar.d.ts +398 -0
- package/target/tsc/feedback/tooltip.d.ts +326 -0
- package/target/tsc/icon/icon.css.d.ts +3 -0
- package/target/tsc/icon/icon.d.ts +69 -0
- package/target/tsc/icon/index.d.ts +13 -0
- package/target/tsc/index.css.d.ts +3 -0
- package/target/tsc/index.d.ts +7 -0
- package/target/tsc/input/autocomplete.d.ts +119 -0
- package/target/tsc/input/base.d.ts +282 -0
- package/target/tsc/input/date-picker.css.d.ts +3 -0
- package/target/tsc/input/date-picker.d.ts +351 -0
- package/target/tsc/input/date-range-input.css.d.ts +3 -0
- package/target/tsc/input/date-time.d.ts +171 -0
- package/target/tsc/input/index.css.d.ts +3 -0
- package/target/tsc/input/index.d.ts +27 -0
- package/target/tsc/input/paired-input.d.ts +435 -0
- package/target/tsc/input/picker-dialog.css.d.ts +3 -0
- package/target/tsc/input/picker-dialog.d.ts +84 -0
- package/target/tsc/input/select.css.d.ts +3 -0
- package/target/tsc/input/select.d.ts +267 -0
- package/target/tsc/input/slider.css.d.ts +3 -0
- package/target/tsc/input/slider.d.ts +372 -0
- package/target/tsc/input/text-field.css.d.ts +3 -0
- package/target/tsc/input/text-field.d.ts +415 -0
- package/target/tsc/input/time-picker.css.d.ts +3 -0
- package/target/tsc/input/time-picker.d.ts +212 -0
- package/target/tsc/motion/frame.d.ts +36 -0
- package/target/tsc/motion/index.css.d.ts +3 -0
- package/target/tsc/motion/index.d.ts +34 -0
- package/target/tsc/motion/material.d.ts +110 -0
- package/target/tsc/motion/motion.d.ts +235 -0
- package/target/tsc/motion/spring.d.ts +223 -0
- package/target/tsc/motion/transition.css.d.ts +3 -0
- package/target/tsc/motion/transition.d.ts +597 -0
- package/target/tsc/motion/velocity.d.ts +54 -0
- package/target/tsc/navigation/app-bar.d.ts +473 -0
- package/target/tsc/navigation/base.d.ts +331 -0
- package/target/tsc/navigation/drawer.d.ts +301 -0
- package/target/tsc/navigation/index.d.ts +25 -0
- package/target/tsc/navigation/navigation.css.d.ts +3 -0
- package/target/tsc/navigation/navigation.d.ts +537 -0
- package/target/tsc/navigation/scroll.d.ts +218 -0
- package/target/tsc/navigation/search.d.ts +332 -0
- package/target/tsc/navigation/tabs.d.ts +497 -0
- package/target/tsc/navigation/toolbar.d.ts +248 -0
- package/target/tsc/selection/base.d.ts +100 -0
- package/target/tsc/selection/checkbox.d.ts +194 -0
- package/target/tsc/selection/chip.d.ts +358 -0
- package/target/tsc/selection/index.d.ts +21 -0
- package/target/tsc/selection/radio.d.ts +198 -0
- package/target/tsc/selection/segmented.d.ts +333 -0
- package/target/tsc/selection/selection.css.d.ts +3 -0
- package/target/tsc/selection/switch.d.ts +165 -0
- package/target/tsc/shape/corner-rounding.d.ts +36 -0
- package/target/tsc/shape/cubic.d.ts +215 -0
- package/target/tsc/shape/index.d.ts +35 -0
- package/target/tsc/shape/material-shapes.d.ts +176 -0
- package/target/tsc/shape/morph.d.ts +91 -0
- package/target/tsc/shape/path.d.ts +177 -0
- package/target/tsc/shape/point.d.ts +165 -0
- package/target/tsc/shape/rounded-polygon.d.ts +289 -0
- package/target/tsc/shape/shapes.d.ts +76 -0
- package/target/tsc/spacing/index.d.ts +19 -0
- package/target/tsc/state/component.css.d.ts +3 -0
- package/target/tsc/state/component.d.ts +276 -0
- package/target/tsc/state/controller.d.ts +257 -0
- package/target/tsc/state/index.d.ts +19 -0
- package/target/tsc/state/ripple.d.ts +50 -0
- package/target/tsc/state/state.d.ts +129 -0
- package/target/tsc/state/style.d.ts +22 -0
- package/target/tsc/surface/carousel-layout.d.ts +212 -0
- package/target/tsc/surface/carousel.css.d.ts +3 -0
- package/target/tsc/surface/carousel.d.ts +231 -0
- package/target/tsc/surface/dialog.d.ts +582 -0
- package/target/tsc/surface/divider.d.ts +92 -0
- package/target/tsc/surface/drag.d.ts +92 -0
- package/target/tsc/surface/gestures.css.d.ts +3 -0
- package/target/tsc/surface/gestures.d.ts +292 -0
- package/target/tsc/surface/index.css.d.ts +3 -0
- package/target/tsc/surface/index.d.ts +29 -0
- package/target/tsc/surface/interactive.d.ts +22 -0
- package/target/tsc/surface/list-patterns.d.ts +384 -0
- package/target/tsc/surface/list.css.d.ts +3 -0
- package/target/tsc/surface/list.d.ts +340 -0
- package/target/tsc/surface/menu.css.d.ts +3 -0
- package/target/tsc/surface/menu.d.ts +590 -0
- package/target/tsc/surface/scaffold.d.ts +337 -0
- package/target/tsc/surface/sheet.d.ts +384 -0
- package/target/tsc/surface/side-sheet.d.ts +183 -0
- package/target/tsc/surface/slots.d.ts +21 -0
- package/target/tsc/surface/surface.css.d.ts +3 -0
- package/target/tsc/surface/surface.d.ts +192 -0
- package/target/tsc/text/index.css.d.ts +3 -0
- package/target/tsc/text/index.d.ts +18 -0
- package/target/tsc/text/text.css.d.ts +3 -0
- package/target/tsc/text/text.d.ts +94 -0
- package/target/tsc/text/typography.css.d.ts +3 -0
- package/target/tsc/text/typography.d.ts +82 -0
- package/target/tsc/util/box-side.d.ts +76 -0
- package/target/tsc/util/debug.d.ts +20 -0
- package/target/tsc/util/dom.d.ts +35 -0
- package/target/tsc/util/event.d.ts +93 -0
- package/target/tsc/util/index.d.ts +12 -0
- package/target/tsc/util/preconditions.d.ts +79 -0
- package/target/tsc/util/reactive.d.ts +36 -0
|
@@ -0,0 +1,582 @@
|
|
|
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. In an engine which does not {@link
|
|
249
|
+
* supportsOverlay | support `overlay`}, the private `_<css>-closing` class is applied while a
|
|
250
|
+
* closed dialog exits with its native dialog still open.
|
|
251
|
+
*
|
|
252
|
+
* @typeParam P - component properties type
|
|
253
|
+
*/
|
|
254
|
+
export declare class DialogController<P extends DialogProps = DialogProps> extends DomController<P> {
|
|
255
|
+
#private;
|
|
256
|
+
/**
|
|
257
|
+
* Construct a new `DialogController`.
|
|
258
|
+
*
|
|
259
|
+
* @param props - component properties
|
|
260
|
+
* @param cssClassName - public CSS class name of the component
|
|
261
|
+
*/
|
|
262
|
+
constructor(props: P, cssClassName?: string);
|
|
263
|
+
/**
|
|
264
|
+
* Default ARIA role, used when no role is supplied.
|
|
265
|
+
*
|
|
266
|
+
* @returns default role
|
|
267
|
+
*/
|
|
268
|
+
protected defaultRole(): "dialog" | "alertdialog";
|
|
269
|
+
/**
|
|
270
|
+
* Default accessible name, used when no naming attribute or labelling element applies.
|
|
271
|
+
*
|
|
272
|
+
* @returns accessible name, or `undefined` for none
|
|
273
|
+
*/
|
|
274
|
+
protected defaultLabel(): string | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* Identifier of the element which names the dialog by default.
|
|
277
|
+
*
|
|
278
|
+
* An authored `aria-label` or `aria-labelledby` takes precedence.
|
|
279
|
+
*
|
|
280
|
+
* @returns element identifier, or `undefined` for none
|
|
281
|
+
*/
|
|
282
|
+
protected defaultLabelledBy(): string | undefined;
|
|
283
|
+
/**
|
|
284
|
+
* Identifier of the element which describes the dialog by default.
|
|
285
|
+
*
|
|
286
|
+
* An authored `aria-describedby` takes precedence.
|
|
287
|
+
*
|
|
288
|
+
* @returns element identifier, or `undefined` for none
|
|
289
|
+
*/
|
|
290
|
+
protected defaultDescribedBy(): string | undefined;
|
|
291
|
+
/**
|
|
292
|
+
* Test whether a user dismissal may close the dialog.
|
|
293
|
+
*
|
|
294
|
+
* Programmatic closure through {@link DialogController.close | `close`} is never vetoed.
|
|
295
|
+
*
|
|
296
|
+
* @param _reason - dismissal reason
|
|
297
|
+
* @param _event - originating event, if any
|
|
298
|
+
* @returns `true` if, and only if, the dismissal is allowed
|
|
299
|
+
*/
|
|
300
|
+
protected allowDismiss(_reason: DialogCloseReason, _event: Event | undefined): boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Request closure for a user dismissal, such as Escape or a backdrop activation.
|
|
303
|
+
*
|
|
304
|
+
* The base implementation closes the dialog when {@link DialogController.allowDismiss |
|
|
305
|
+
* `allowDismiss`} allows it.
|
|
306
|
+
*
|
|
307
|
+
* @param reason - dismissal reason
|
|
308
|
+
* @param event - originating event, if any
|
|
309
|
+
*/
|
|
310
|
+
protected requestDismiss(reason: DialogCloseReason, event: Event | undefined): void;
|
|
311
|
+
/**
|
|
312
|
+
* Handle a change of the applied open state, *before* the native dialog is shown or closed.
|
|
313
|
+
*
|
|
314
|
+
* @param _open - applied open state
|
|
315
|
+
*/
|
|
316
|
+
protected onOpenStateChanged(_open: boolean): void;
|
|
317
|
+
/**
|
|
318
|
+
* Handle the presentation of the native dialog, once it was shown with its current modality.
|
|
319
|
+
*
|
|
320
|
+
* This is invoked whenever the dialog is presented: after it opens, after its modality
|
|
321
|
+
* changes, and when it is presented once hydrated or connected.
|
|
322
|
+
*/
|
|
323
|
+
protected onShown(): void;
|
|
324
|
+
/**
|
|
325
|
+
* Test whether the dialog is open.
|
|
326
|
+
*
|
|
327
|
+
* @returns `true` if, and only if, the dialog is open
|
|
328
|
+
*/
|
|
329
|
+
isOpen(): boolean;
|
|
330
|
+
/**
|
|
331
|
+
* Request that the dialog open.
|
|
332
|
+
*
|
|
333
|
+
* A controlled dialog requests the change through `onOpenChange` and waits for the parent to
|
|
334
|
+
* update `open`; an uncontrolled dialog opens, then notifies `onOpenChange`.
|
|
335
|
+
*/
|
|
336
|
+
open(): void;
|
|
337
|
+
/**
|
|
338
|
+
* Request that the dialog close.
|
|
339
|
+
*
|
|
340
|
+
* A controlled dialog requests the change through `onOpenChange` and stays open until the
|
|
341
|
+
* parent updates `open`; an uncontrolled dialog closes, then notifies `onOpenChange`.
|
|
342
|
+
*
|
|
343
|
+
* @param reason - close reason
|
|
344
|
+
* @param event - originating event, if any
|
|
345
|
+
*/
|
|
346
|
+
close(reason?: DialogCloseReason, event?: Event): void;
|
|
347
|
+
/**
|
|
348
|
+
* Request the opposite of the current open state.
|
|
349
|
+
*
|
|
350
|
+
* @see {@link DialogController.open}
|
|
351
|
+
* @see {@link DialogController.close}
|
|
352
|
+
*/
|
|
353
|
+
toggle(): void;
|
|
354
|
+
/**
|
|
355
|
+
* Apply local properties to component state and styling.
|
|
356
|
+
*
|
|
357
|
+
* @see {@link ../dom/client#DomController.applyComponentProps}
|
|
358
|
+
*/
|
|
359
|
+
protected applyComponentProps(): void;
|
|
360
|
+
/**
|
|
361
|
+
* Handle style element replacement before the controller reference is updated.
|
|
362
|
+
*
|
|
363
|
+
* The style-element getter still exposes the previous element during this hook.
|
|
364
|
+
*
|
|
365
|
+
* @param curr - new style element, or `null` when absent
|
|
366
|
+
* @see {@link ../dom/client#DomController.onStyleElementChanged}
|
|
367
|
+
*/
|
|
368
|
+
protected onStyleElementChanged(curr: StyleElement | null): void;
|
|
369
|
+
/**
|
|
370
|
+
* Render the component's element tree.
|
|
371
|
+
*
|
|
372
|
+
* @param children - nested component children, possibly an accessor
|
|
373
|
+
* @returns rendered component elements
|
|
374
|
+
* @see {@link ../dom/client#DomController.render}
|
|
375
|
+
*/
|
|
376
|
+
protected render(children: JSX.Element): JSX.Element;
|
|
377
|
+
/**
|
|
378
|
+
* Close the dialog and release its listeners when the controller is disposed.
|
|
379
|
+
*
|
|
380
|
+
* @see {@link ../dom/client#DomController.onControllerCleanup}
|
|
381
|
+
*/
|
|
382
|
+
protected onControllerCleanup(): void;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Native modal or nonmodal dialog container.
|
|
386
|
+
*
|
|
387
|
+
* A dialog places its children on a Material dialog container: the `dialogColor`, `dialogShape`,
|
|
388
|
+
* `dialogElevation`, and `dialogPadding` roles, between the minimum and maximum dialog widths, and
|
|
389
|
+
* within the viewport margin. A modal dialog uses the browser top layer above a scrim; Escape and
|
|
390
|
+
* backdrop activation request closure, and focus returns to its opener. For the Material basic
|
|
391
|
+
* dialog anatomy, use {@link AlertDialog}; for a full-screen dialog, use {@link FullScreenDialog}.
|
|
392
|
+
*
|
|
393
|
+
* # Motion
|
|
394
|
+
*
|
|
395
|
+
* Opening fades the container in on the default effects spring and scales it up from 80% on the
|
|
396
|
+
* default spatial spring, as MDC's `m3_motion_fade_enter`; closing fades it out on the fast
|
|
397
|
+
* effects spring, as `m3_motion_fade_exit`. The scrim fades on the same effects springs.
|
|
398
|
+
*
|
|
399
|
+
* # Design
|
|
400
|
+
*
|
|
401
|
+
* Dialog design is controlled through the `dialog*` roles of the [`cw-Surface`](./surface.yaml)
|
|
402
|
+
* design attribute. The `cw-Dialog-open` class is applied while the dialog is open.
|
|
403
|
+
*
|
|
404
|
+
* @param props - component properties
|
|
405
|
+
* @returns rendered component elements
|
|
406
|
+
*/
|
|
407
|
+
export declare const Dialog: DomComponent<DialogProps>;
|
|
408
|
+
/**
|
|
409
|
+
* Client controller of an {@link AlertDialog}.
|
|
410
|
+
*/
|
|
411
|
+
export declare class AlertDialogController extends DialogController<AlertDialogProps> {
|
|
412
|
+
#private;
|
|
413
|
+
/**
|
|
414
|
+
* Construct a new `AlertDialogController`.
|
|
415
|
+
*
|
|
416
|
+
* @param props - component properties
|
|
417
|
+
*/
|
|
418
|
+
constructor(props: AlertDialogProps);
|
|
419
|
+
/**
|
|
420
|
+
* Default ARIA role, used when no role is supplied.
|
|
421
|
+
*
|
|
422
|
+
* @returns `"alertdialog"`
|
|
423
|
+
*/
|
|
424
|
+
protected defaultRole(): "dialog" | "alertdialog";
|
|
425
|
+
/**
|
|
426
|
+
* Default accessible name, used when no naming attribute applies.
|
|
427
|
+
*
|
|
428
|
+
* A `label` takes precedence over the headline.
|
|
429
|
+
*
|
|
430
|
+
* @returns accessible name, or `undefined` when the headline names the dialog
|
|
431
|
+
*/
|
|
432
|
+
protected defaultLabel(): string | undefined;
|
|
433
|
+
/**
|
|
434
|
+
* Identifier of the headline, which names the dialog unless a `label` is supplied.
|
|
435
|
+
*
|
|
436
|
+
* @returns headline identifier, or `undefined` without a headline or with a `label`
|
|
437
|
+
*/
|
|
438
|
+
protected defaultLabelledBy(): string | undefined;
|
|
439
|
+
/**
|
|
440
|
+
* Identifier of the supporting text, which describes the dialog.
|
|
441
|
+
*
|
|
442
|
+
* @returns supporting text identifier
|
|
443
|
+
*/
|
|
444
|
+
protected defaultDescribedBy(): string | undefined;
|
|
445
|
+
/**
|
|
446
|
+
* Apply local properties to component state and styling.
|
|
447
|
+
*
|
|
448
|
+
* @see {@link ../dom/client#DomController.applyComponentProps}
|
|
449
|
+
*/
|
|
450
|
+
protected applyComponentProps(): void;
|
|
451
|
+
/**
|
|
452
|
+
* Handle style element replacement before the controller reference is updated.
|
|
453
|
+
*
|
|
454
|
+
* The style-element getter still exposes the previous element during this hook.
|
|
455
|
+
*
|
|
456
|
+
* @param curr - new style element, or `null` when absent
|
|
457
|
+
* @see {@link ../dom/client#DomController.onStyleElementChanged}
|
|
458
|
+
*/
|
|
459
|
+
protected onStyleElementChanged(curr: StyleElement | null): void;
|
|
460
|
+
/**
|
|
461
|
+
* Render the component's element tree.
|
|
462
|
+
*
|
|
463
|
+
* The icon, headline, supporting text, and action labels are reactive slots.
|
|
464
|
+
*
|
|
465
|
+
* @param children - nested component children, possibly an accessor
|
|
466
|
+
* @returns rendered component elements
|
|
467
|
+
* @see {@link ../dom/client#DomController.render}
|
|
468
|
+
*/
|
|
469
|
+
protected render(children: JSX.Element): JSX.Element;
|
|
470
|
+
/**
|
|
471
|
+
* Release the action listener when the controller is disposed.
|
|
472
|
+
*
|
|
473
|
+
* @see {@link ../dom/client#DomController.onControllerCleanup}
|
|
474
|
+
*/
|
|
475
|
+
protected onControllerCleanup(): void;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Material basic dialog.
|
|
479
|
+
*
|
|
480
|
+
* An alert dialog presents an optional hero icon, a headline, supporting text, and dismissing and
|
|
481
|
+
* confirming text buttons on the {@link Dialog} container. The headline names the dialog and the
|
|
482
|
+
* supporting text describes it. The anatomy and spacing follow Compose `AlertDialog`: with an
|
|
483
|
+
* icon, the headline is centered below it. Supporting text which does not fit scrolls between the
|
|
484
|
+
* fixed headline and actions, and dividers mark scrolled-away content, as material-web dialogs.
|
|
485
|
+
*
|
|
486
|
+
* Activating an action invokes `onConfirm` or `onDismiss`, then requests closure with the
|
|
487
|
+
* `"confirm"` or `"dismiss"` reason unless the callback called `event.preventDefault()`. Initial
|
|
488
|
+
* focus goes to the dismissing action, the least destructive choice.
|
|
489
|
+
*
|
|
490
|
+
* # Design
|
|
491
|
+
*
|
|
492
|
+
* Alert dialog design is controlled through the `dialog*` roles of the
|
|
493
|
+
* [`cw-Surface`](./surface.yaml) design attribute; the headline uses the headline-small
|
|
494
|
+
* typescale, the supporting text body-medium, and the actions are `text` buttons. The
|
|
495
|
+
* `cw-AlertDialog-noDismiss` class is applied while the dismissing action is hidden.
|
|
496
|
+
*
|
|
497
|
+
* @param props - component properties
|
|
498
|
+
* @returns rendered component elements
|
|
499
|
+
*/
|
|
500
|
+
export declare const AlertDialog: DomComponent<AlertDialogProps>;
|
|
501
|
+
/**
|
|
502
|
+
* Client controller of a {@link FullScreenDialog}.
|
|
503
|
+
*/
|
|
504
|
+
export declare class FullScreenDialogController extends DialogController<FullScreenDialogProps> {
|
|
505
|
+
#private;
|
|
506
|
+
/**
|
|
507
|
+
* Construct a new `FullScreenDialogController`.
|
|
508
|
+
*
|
|
509
|
+
* @param props - component properties
|
|
510
|
+
*/
|
|
511
|
+
constructor(props: FullScreenDialogProps);
|
|
512
|
+
/**
|
|
513
|
+
* Default accessible name, used when no naming attribute applies.
|
|
514
|
+
*
|
|
515
|
+
* A `label` takes precedence over the headline.
|
|
516
|
+
*
|
|
517
|
+
* @returns accessible name, or `undefined` when the headline names the dialog
|
|
518
|
+
*/
|
|
519
|
+
protected defaultLabel(): string | undefined;
|
|
520
|
+
/**
|
|
521
|
+
* Identifier of the headline, which names the dialog unless a `label` is supplied.
|
|
522
|
+
*
|
|
523
|
+
* @returns headline identifier, or `undefined` without a headline or with a `label`
|
|
524
|
+
*/
|
|
525
|
+
protected defaultLabelledBy(): string | undefined;
|
|
526
|
+
/**
|
|
527
|
+
* Apply local properties to component state and styling.
|
|
528
|
+
*
|
|
529
|
+
* @see {@link ../dom/client#DomController.applyComponentProps}
|
|
530
|
+
*/
|
|
531
|
+
protected applyComponentProps(): void;
|
|
532
|
+
/**
|
|
533
|
+
* Handle style element replacement before the controller reference is updated.
|
|
534
|
+
*
|
|
535
|
+
* The style-element getter still exposes the previous element during this hook.
|
|
536
|
+
*
|
|
537
|
+
* @param curr - new style element, or `null` when absent
|
|
538
|
+
* @see {@link ../dom/client#DomController.onStyleElementChanged}
|
|
539
|
+
*/
|
|
540
|
+
protected onStyleElementChanged(curr: StyleElement | null): void;
|
|
541
|
+
/**
|
|
542
|
+
* Render the component's element tree.
|
|
543
|
+
*
|
|
544
|
+
* The headline, close icon, and action label are reactive slots.
|
|
545
|
+
*
|
|
546
|
+
* @param children - nested component children, possibly an accessor
|
|
547
|
+
* @returns rendered component elements
|
|
548
|
+
* @see {@link ../dom/client#DomController.render}
|
|
549
|
+
*/
|
|
550
|
+
protected render(children: JSX.Element): JSX.Element;
|
|
551
|
+
/**
|
|
552
|
+
* Release the action and scroll listeners when the controller is disposed.
|
|
553
|
+
*
|
|
554
|
+
* @see {@link ../dom/client#DomController.onControllerCleanup}
|
|
555
|
+
*/
|
|
556
|
+
protected onControllerCleanup(): void;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Material full-screen dialog.
|
|
560
|
+
*
|
|
561
|
+
* A full-screen dialog covers the viewport with a header, which holds a close icon button, the
|
|
562
|
+
* headline, and an optional confirming text button, above scrolling content. Material recommends
|
|
563
|
+
* full-screen dialogs for compact windows; {@link ./scaffold#createWindowSizeClass} tells them
|
|
564
|
+
* apart. The dialog is always modal; Escape and the close action request closure.
|
|
565
|
+
*
|
|
566
|
+
* # Motion
|
|
567
|
+
*
|
|
568
|
+
* Opening slides the dialog up from the bottom edge on the slow spatial spring, the full-screen
|
|
569
|
+
* speed; closing slides it down on the fast effects spring, which does not overshoot.
|
|
570
|
+
*
|
|
571
|
+
* # Design
|
|
572
|
+
*
|
|
573
|
+
* Full-screen dialog design is controlled through the `fullScreenDialog*` roles of the
|
|
574
|
+
* [`cw-Surface`](./surface.yaml) design attribute, after `md.comp.full-screen-dialog`: a surface
|
|
575
|
+
* container without corner rounding, a 56px header with a title-large headline, and a header which
|
|
576
|
+
* takes the scrolled color and elevation while the content is scrolled. The
|
|
577
|
+
* `cw-FullScreenDialog-scrolled` class is applied while the content is scrolled.
|
|
578
|
+
*
|
|
579
|
+
* @param props - component properties
|
|
580
|
+
* @returns rendered component elements
|
|
581
|
+
*/
|
|
582
|
+
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>;
|