@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,281 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { DomComponent, DomProps } from "..";
|
|
3
|
+
import "./feedback.css";
|
|
4
|
+
/**
|
|
5
|
+
* Range of values of a determinate progress indicator.
|
|
6
|
+
*/
|
|
7
|
+
export interface ProgressRange {
|
|
8
|
+
/**
|
|
9
|
+
* Value at which the indicator is empty.
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue `0`
|
|
12
|
+
*/
|
|
13
|
+
min?: number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Value at which the indicator is complete.
|
|
16
|
+
*
|
|
17
|
+
* A maximum less than {@link ProgressRange.min | `min`} is raised to `min`.
|
|
18
|
+
*
|
|
19
|
+
* @defaultValue `1`
|
|
20
|
+
*/
|
|
21
|
+
max?: number | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Properties common to all progress indicators.
|
|
25
|
+
*/
|
|
26
|
+
export type ProgressIndicatorProps = DomProps<HTMLDivElement, Omit<JSX.HTMLAttributes<HTMLDivElement>, "aria-disabled" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "role">> & ProgressRange & {
|
|
27
|
+
/**
|
|
28
|
+
* Current value, within the {@link ProgressRange | range}.
|
|
29
|
+
*
|
|
30
|
+
* The indicator is determinate while a value is supplied; the value is clamped into the range
|
|
31
|
+
* and exposed as `aria-valuenow`. Without a value, the indicator is indeterminate and omits
|
|
32
|
+
* `aria-valuenow`, as the ARIA `progressbar` role requires. A non-finite value shows the
|
|
33
|
+
* indicator empty.
|
|
34
|
+
*/
|
|
35
|
+
value?: number | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Indicator is indeterminate, whether or not a value is supplied.
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue `false`
|
|
40
|
+
*/
|
|
41
|
+
indeterminate?: boolean | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Indicator color.
|
|
44
|
+
*
|
|
45
|
+
* The indicator and stop indicator are painted with the fill color of the respective color
|
|
46
|
+
* role. When omitted, the `cw-Feedback-progress-indicatorColor` design role applies.
|
|
47
|
+
*/
|
|
48
|
+
color?: "error" | "primary" | "secondary" | "surface" | "tertiary" | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Accessible name of the indicator.
|
|
51
|
+
*
|
|
52
|
+
* A progress indicator requires an accessible name. Supply this, or `attr:aria-labelledby`
|
|
53
|
+
* referencing a visible label, describing the process whose progress is indicated.
|
|
54
|
+
*/
|
|
55
|
+
label?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* {@link LinearProgressIndicator} component properties.
|
|
59
|
+
*/
|
|
60
|
+
export type LinearProgressIndicatorProps = ProgressIndicatorProps & {
|
|
61
|
+
/**
|
|
62
|
+
* Thickness of the indicator and its track, in CSS pixels.
|
|
63
|
+
*
|
|
64
|
+
* @defaultValue `4`
|
|
65
|
+
*/
|
|
66
|
+
size?: number | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Gap between the indicator and the track, in CSS pixels.
|
|
69
|
+
*
|
|
70
|
+
* The visible gap excludes the round ends of the indicator and the track.
|
|
71
|
+
*
|
|
72
|
+
* @defaultValue `4`
|
|
73
|
+
*/
|
|
74
|
+
gapSize?: number | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Diameter of the stop indicator at the end of the track, in CSS pixels.
|
|
77
|
+
*
|
|
78
|
+
* This overrides the `cw-Feedback-progress-stopSize` design role. The stop indicator is never
|
|
79
|
+
* larger than the track thickness.
|
|
80
|
+
*/
|
|
81
|
+
stopSize?: number | undefined;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* {@link LinearWavyProgressIndicator} component properties.
|
|
85
|
+
*/
|
|
86
|
+
export type LinearWavyProgressIndicatorProps = LinearProgressIndicatorProps & {
|
|
87
|
+
/**
|
|
88
|
+
* Amplitude of the wave, from `0`, a flat line, to `1`, the full wave height.
|
|
89
|
+
*
|
|
90
|
+
* When omitted, an indeterminate indicator is fully wavy, and a determinate indicator is flat
|
|
91
|
+
* up to 10 % and from 95 % of its range, and fully wavy in between. Amplitude changes animate.
|
|
92
|
+
*/
|
|
93
|
+
amplitude?: number | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Length of a wave, in CSS pixels.
|
|
96
|
+
*
|
|
97
|
+
* @defaultValue `40` for a determinate and `20` for an indeterminate indicator
|
|
98
|
+
*/
|
|
99
|
+
wavelength?: number | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Speed at which the wave travels towards the start of the indicator, in CSS pixels per
|
|
102
|
+
* second. `0` keeps the wave still.
|
|
103
|
+
*
|
|
104
|
+
* @defaultValue one wavelength per second
|
|
105
|
+
*/
|
|
106
|
+
waveSpeed?: number | undefined;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* {@link CircularProgressIndicator} component properties.
|
|
110
|
+
*/
|
|
111
|
+
export type CircularProgressIndicatorProps = ProgressIndicatorProps & {
|
|
112
|
+
/**
|
|
113
|
+
* Diameter of the indicator, in CSS pixels.
|
|
114
|
+
*
|
|
115
|
+
* @defaultValue `40`
|
|
116
|
+
*/
|
|
117
|
+
size?: number | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Stroke width of the indicator and its track, in CSS pixels.
|
|
120
|
+
*
|
|
121
|
+
* @defaultValue `4`
|
|
122
|
+
*/
|
|
123
|
+
strokeWidth?: number | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Gap between the indicator and the track, in CSS pixels.
|
|
126
|
+
*
|
|
127
|
+
* The visible gap excludes the round ends of the indicator and the track.
|
|
128
|
+
*
|
|
129
|
+
* @defaultValue `4`
|
|
130
|
+
*/
|
|
131
|
+
gapSize?: number | undefined;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* {@link CircularWavyProgressIndicator} component properties.
|
|
135
|
+
*/
|
|
136
|
+
export type CircularWavyProgressIndicatorProps = CircularProgressIndicatorProps & {
|
|
137
|
+
/**
|
|
138
|
+
* Amplitude of the wave, from `0`, a circle, to `1`, the full wave height.
|
|
139
|
+
*
|
|
140
|
+
* When omitted, an indeterminate indicator is fully wavy, and a determinate indicator is
|
|
141
|
+
* circular up to 10 % and from 95 % of its range, and fully wavy in between. Amplitude changes
|
|
142
|
+
* animate.
|
|
143
|
+
*/
|
|
144
|
+
amplitude?: number | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Length of a wave along the circle, in CSS pixels.
|
|
147
|
+
*
|
|
148
|
+
* The circle holds a whole number of waves, at least five, so the actual wavelength is
|
|
149
|
+
* rounded to fit the circumference.
|
|
150
|
+
*
|
|
151
|
+
* @defaultValue `15`
|
|
152
|
+
*/
|
|
153
|
+
wavelength?: number | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* Speed at which the wave travels around the circle, in CSS pixels per second. `0` keeps the
|
|
156
|
+
* wave still.
|
|
157
|
+
*
|
|
158
|
+
* @defaultValue one wavelength per second
|
|
159
|
+
*/
|
|
160
|
+
waveSpeed?: number | undefined;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Material 3 linear progress indicator.
|
|
164
|
+
*
|
|
165
|
+
* A linear progress indicator shows the progress of a process along a horizontal track, or, when
|
|
166
|
+
* indeterminate, that a process is running. Its track ends with a stop indicator while
|
|
167
|
+
* determinate, and is separated from the indicator by a gap. In a right-to-left context, the
|
|
168
|
+
* indicator progresses from the right.
|
|
169
|
+
*
|
|
170
|
+
* Value changes animate with the `cw-Feedback-progress-motion` spring, the non-bouncy spring
|
|
171
|
+
* Compose recommends for progress (`ProgressIndicatorDefaults.ProgressAnimationSpec`); the gap
|
|
172
|
+
* and the track follow the animated indicator. Indeterminate motion follows Compose's two-line
|
|
173
|
+
* cycle, pauses while the indicator is outside of the viewport, and stops at a still frame when
|
|
174
|
+
* reduced motion is preferred.
|
|
175
|
+
*
|
|
176
|
+
* # States
|
|
177
|
+
*
|
|
178
|
+
* The indicator is determinate while {@link ProgressIndicatorProps.value | `props.value`} is
|
|
179
|
+
* supplied and {@link ProgressIndicatorProps.indeterminate | `props.indeterminate`} is not
|
|
180
|
+
* `true`. The `cw-Progress-determinate` or `cw-Progress-indeterminate` CSS class is added to the
|
|
181
|
+
* root element accordingly.
|
|
182
|
+
*
|
|
183
|
+
* # Design
|
|
184
|
+
*
|
|
185
|
+
* Colors, the stop indicator, the default width, and value motion are controlled through the
|
|
186
|
+
* `progress` roles of the [`cw-Feedback`](./feedback.yaml) design attribute. Thickness and the
|
|
187
|
+
* gap are controlled through {@link LinearProgressIndicatorProps.size | `props.size`} and
|
|
188
|
+
* {@link LinearProgressIndicatorProps.gapSize | `props.gapSize`}.
|
|
189
|
+
*
|
|
190
|
+
* # Accessibility
|
|
191
|
+
*
|
|
192
|
+
* The root element has the `progressbar` role, exposes its range through `aria-valuemin` and
|
|
193
|
+
* `aria-valuemax`, and its value through `aria-valuenow` while determinate. Name it with
|
|
194
|
+
* {@link ProgressIndicatorProps.label | `props.label`}.
|
|
195
|
+
*
|
|
196
|
+
* @param props - component properties
|
|
197
|
+
* @returns rendered element
|
|
198
|
+
*/
|
|
199
|
+
export declare const LinearProgressIndicator: DomComponent<LinearProgressIndicatorProps>;
|
|
200
|
+
/**
|
|
201
|
+
* Material 3 Expressive linear wavy progress indicator.
|
|
202
|
+
*
|
|
203
|
+
* A linear wavy indicator draws its indicator as a wave travelling along a flat track, towards
|
|
204
|
+
* the start of the indicator. A determinate indicator flattens near the start and the end of its
|
|
205
|
+
* range; amplitude changes animate as `WavyProgressIndicator.kt` does, with the standard easing
|
|
206
|
+
* while the wave grows and the emphasized accelerate easing while it flattens. The wave pauses
|
|
207
|
+
* while flat or outside of the viewport, and stops when reduced motion is preferred. Otherwise, it
|
|
208
|
+
* behaves as a {@link LinearProgressIndicator}.
|
|
209
|
+
*
|
|
210
|
+
* # Design
|
|
211
|
+
*
|
|
212
|
+
* The container is `LinearProgressIndicatorTokens.WaveHeight` (10px) tall for the default
|
|
213
|
+
* thickness, leaving room for the 3px wave amplitude above and below the stroke. Colors, the
|
|
214
|
+
* stop indicator, the default width, and value motion are controlled through the `progress`
|
|
215
|
+
* roles of the [`cw-Feedback`](./feedback.yaml) design attribute.
|
|
216
|
+
*
|
|
217
|
+
* The wave is generated for the measured width of the indicator, in its own CSS pixels, so that
|
|
218
|
+
* transforms of ancestors do not distort it. The server renders the wave for the default width.
|
|
219
|
+
*
|
|
220
|
+
* @param props - component properties
|
|
221
|
+
* @returns rendered element
|
|
222
|
+
*/
|
|
223
|
+
export declare const LinearWavyProgressIndicator: DomComponent<LinearWavyProgressIndicatorProps>;
|
|
224
|
+
/**
|
|
225
|
+
* Material 3 circular progress indicator.
|
|
226
|
+
*
|
|
227
|
+
* A circular progress indicator shows the progress of a process along a circular track starting
|
|
228
|
+
* at 12 o'clock, or, when indeterminate, that a process is running. The indicator is separated
|
|
229
|
+
* from the track by a gap; an indeterminate indicator has no visible track, as
|
|
230
|
+
* `ProgressIndicatorDefaults.circularIndeterminateTrackColor` is transparent.
|
|
231
|
+
*
|
|
232
|
+
* Value changes animate with the `cw-Feedback-progress-motion` spring. Indeterminate motion
|
|
233
|
+
* follows Compose's six-second cycle of rotations and sweeps, pauses while the indicator is
|
|
234
|
+
* outside of the viewport, and stops at a still half circle when reduced motion is preferred.
|
|
235
|
+
*
|
|
236
|
+
* # States
|
|
237
|
+
*
|
|
238
|
+
* The indicator is determinate while {@link ProgressIndicatorProps.value | `props.value`} is
|
|
239
|
+
* supplied and {@link ProgressIndicatorProps.indeterminate | `props.indeterminate`} is not
|
|
240
|
+
* `true`. The `cw-Progress-determinate` or `cw-Progress-indeterminate` CSS class is added to the
|
|
241
|
+
* root element accordingly.
|
|
242
|
+
*
|
|
243
|
+
* # Design
|
|
244
|
+
*
|
|
245
|
+
* Colors and value motion are controlled through the `progress` roles of the
|
|
246
|
+
* [`cw-Feedback`](./feedback.yaml) design attribute. Size, stroke width, and the gap are
|
|
247
|
+
* controlled through {@link CircularProgressIndicatorProps.size | `props.size`},
|
|
248
|
+
* {@link CircularProgressIndicatorProps.strokeWidth | `props.strokeWidth`}, and
|
|
249
|
+
* {@link CircularProgressIndicatorProps.gapSize | `props.gapSize`}.
|
|
250
|
+
*
|
|
251
|
+
* # Accessibility
|
|
252
|
+
*
|
|
253
|
+
* The root element has the `progressbar` role, exposes its range through `aria-valuemin` and
|
|
254
|
+
* `aria-valuemax`, and its value through `aria-valuenow` while determinate. Name it with
|
|
255
|
+
* {@link ProgressIndicatorProps.label | `props.label`}.
|
|
256
|
+
*
|
|
257
|
+
* @param props - component properties
|
|
258
|
+
* @returns rendered element
|
|
259
|
+
*/
|
|
260
|
+
export declare const CircularProgressIndicator: DomComponent<CircularProgressIndicatorProps>;
|
|
261
|
+
/**
|
|
262
|
+
* Material 3 Expressive circular wavy progress indicator.
|
|
263
|
+
*
|
|
264
|
+
* A circular wavy indicator draws its indicator as a wave travelling around a circular track. A
|
|
265
|
+
* determinate indicator is circular near the start and the end of its range; amplitude changes
|
|
266
|
+
* animate as `WavyProgressIndicator.kt` does. The wave pauses while circular or outside of the
|
|
267
|
+
* viewport, and stops when reduced motion is preferred. Otherwise, it behaves as a
|
|
268
|
+
* {@link CircularProgressIndicator}, with a visible track while indeterminate.
|
|
269
|
+
*
|
|
270
|
+
* # Design
|
|
271
|
+
*
|
|
272
|
+
* The indicator is `CircularProgressIndicatorTokens.WaveSize` (48px) wide by default. The wave is
|
|
273
|
+
* the morph between a circle and a rounded star of as many points as wavelengths fit the
|
|
274
|
+
* circumference, as in `CircularWavyProgressModifiers.kt`. Colors and value motion are
|
|
275
|
+
* controlled through the `progress` roles of the [`cw-Feedback`](./feedback.yaml) design
|
|
276
|
+
* attribute.
|
|
277
|
+
*
|
|
278
|
+
* @param props - component properties
|
|
279
|
+
* @returns rendered element
|
|
280
|
+
*/
|
|
281
|
+
export declare const CircularWavyProgressIndicator: DomComponent<CircularWavyProgressIndicatorProps>;
|
|
@@ -0,0 +1,398 @@
|
|
|
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 "./feedback.css";
|
|
6
|
+
/**
|
|
7
|
+
* Reason a snackbar was dismissed.
|
|
8
|
+
*
|
|
9
|
+
* | Reason | Source |
|
|
10
|
+
* | --------------- | --------------------------------------------------------------- |
|
|
11
|
+
* | `"action"` | The action was activated, without cancelling its click. |
|
|
12
|
+
* | `"dismiss"` | The dismiss button was activated. |
|
|
13
|
+
* | `"escape"` | Escape was pressed while focus was within the snackbar. |
|
|
14
|
+
* | `"programmatic"`| {@link SnackbarController.dismiss} or a {@link SnackbarQueue}. |
|
|
15
|
+
* | `"replacement"` | The {@link SnackbarProps.request | request} was replaced. |
|
|
16
|
+
* | `"timeout"` | The {@link SnackbarProps.duration | duration} elapsed. |
|
|
17
|
+
*/
|
|
18
|
+
export type SnackbarDismissReason = "action" | "dismiss" | "escape" | "programmatic" | "replacement" | "timeout";
|
|
19
|
+
/**
|
|
20
|
+
* Function notified of the dismissal of a snackbar.
|
|
21
|
+
*
|
|
22
|
+
* @param reason - source of the dismissal
|
|
23
|
+
* @param event - event which requested the dismissal, if any
|
|
24
|
+
* @param controller - controller of the dismissed snackbar
|
|
25
|
+
*/
|
|
26
|
+
export type SnackbarDismissHandler = (reason: SnackbarDismissReason, event?: Event, controller?: SnackbarController) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Function handling the activation of a snackbar action.
|
|
29
|
+
*
|
|
30
|
+
* @param event - click activating the action; cancel it to keep the snackbar open
|
|
31
|
+
* @param controller - controller of the snackbar
|
|
32
|
+
*/
|
|
33
|
+
export type SnackbarActionHandler = (event: MouseEvent, controller: SnackbarController) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Snackbar presented by a {@link SnackbarQueue}.
|
|
36
|
+
*/
|
|
37
|
+
export interface SnackbarRequest {
|
|
38
|
+
/**
|
|
39
|
+
* Identifier of the request, generated when omitted.
|
|
40
|
+
*/
|
|
41
|
+
readonly id?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Message.
|
|
44
|
+
*/
|
|
45
|
+
readonly message: JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* Label of the action, if any.
|
|
48
|
+
*/
|
|
49
|
+
readonly actionLabel?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Content of the action, superseding {@link SnackbarRequest.actionLabel}.
|
|
52
|
+
*/
|
|
53
|
+
readonly action?: JSX.Element;
|
|
54
|
+
/**
|
|
55
|
+
* Function handling the activation of the action.
|
|
56
|
+
*/
|
|
57
|
+
readonly onAction?: SnackbarActionHandler | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Time before the snackbar is dismissed, in milliseconds; `0` keeps it open.
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue `4000` without an action, and `0` with one
|
|
62
|
+
*/
|
|
63
|
+
readonly duration?: number | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Pause the duration while the snackbar is hovered or focused.
|
|
66
|
+
*
|
|
67
|
+
* @defaultValue `true`
|
|
68
|
+
*/
|
|
69
|
+
readonly pauseOnHover?: boolean | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Show a button dismissing the snackbar.
|
|
72
|
+
*
|
|
73
|
+
* @defaultValue `false`
|
|
74
|
+
*/
|
|
75
|
+
readonly dismissible?: boolean | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Accessible name of the dismiss button.
|
|
78
|
+
*
|
|
79
|
+
* @defaultValue `"Dismiss"`
|
|
80
|
+
*/
|
|
81
|
+
readonly dismissLabel?: string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Place the action below the message, for a long action label.
|
|
84
|
+
*
|
|
85
|
+
* @defaultValue `false`
|
|
86
|
+
*/
|
|
87
|
+
readonly actionOnNewLine?: boolean | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Key identifying duplicates: a request is not enqueued while another request with the same
|
|
90
|
+
* key, or the same id when no key is supplied, is current or pending.
|
|
91
|
+
*/
|
|
92
|
+
readonly dedupeKey?: string | undefined;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* {@link Snackbar} component properties.
|
|
96
|
+
*/
|
|
97
|
+
export type SnackbarProps = DomProps<HTMLDivElement, Omit<JSX.HTMLAttributes<HTMLDivElement>, "aria-atomic" | "aria-live" | "role">> & {
|
|
98
|
+
/**
|
|
99
|
+
* Message, superseding nested children.
|
|
100
|
+
*/
|
|
101
|
+
message?: JSX.Element;
|
|
102
|
+
/**
|
|
103
|
+
* Request whose message and options are presented, superseding the respective properties.
|
|
104
|
+
*
|
|
105
|
+
* Replacing the request reports the dismissal of the previous request with the
|
|
106
|
+
* `"replacement"` reason, and opens an uncontrolled snackbar again.
|
|
107
|
+
*/
|
|
108
|
+
request?: SnackbarRequest | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Snackbar is open.
|
|
111
|
+
*
|
|
112
|
+
* Supplying this property, including as `undefined`, controls the snackbar: dismissal is then
|
|
113
|
+
* requested through {@link SnackbarProps.onOpenChange | `onOpenChange`}, and the snackbar
|
|
114
|
+
* remains open until this property is `false`. Omit it to let the snackbar close itself.
|
|
115
|
+
*
|
|
116
|
+
* @defaultValue `true`
|
|
117
|
+
*/
|
|
118
|
+
open?: boolean | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Function notified of a request to close the snackbar.
|
|
121
|
+
*
|
|
122
|
+
* @param open - requested visibility, always `false`
|
|
123
|
+
* @param event - event which requested the dismissal, if any
|
|
124
|
+
* @param reason - source of the dismissal
|
|
125
|
+
*/
|
|
126
|
+
onOpenChange?: ((open: boolean, event?: Event, reason?: SnackbarDismissReason) => void) | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Label of the action, if any.
|
|
129
|
+
*/
|
|
130
|
+
actionLabel?: string | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Content of the action, superseding {@link SnackbarProps.actionLabel | `actionLabel`}.
|
|
133
|
+
*/
|
|
134
|
+
action?: JSX.Element;
|
|
135
|
+
/**
|
|
136
|
+
* Function handling the activation of the action, before the snackbar is dismissed.
|
|
137
|
+
*
|
|
138
|
+
* Cancel the click with `event.preventDefault()` to keep the snackbar open.
|
|
139
|
+
*/
|
|
140
|
+
onAction?: SnackbarActionHandler | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* Time before the snackbar is dismissed, in milliseconds; `0` keeps it open.
|
|
143
|
+
*
|
|
144
|
+
* As `SnackbarHostState.showSnackbar()` does, a snackbar with an action stays open by default,
|
|
145
|
+
* so that every user can reach its action. Make such a snackbar
|
|
146
|
+
* {@link SnackbarProps.dismissible | dismissible}.
|
|
147
|
+
*
|
|
148
|
+
* A change of the resolved duration, including through an action being added or removed,
|
|
149
|
+
* restarts the timing of an open snackbar.
|
|
150
|
+
*
|
|
151
|
+
* @defaultValue `4000` without an action (`SnackbarDuration.Short`), and `0` with one
|
|
152
|
+
* (`SnackbarDuration.Indefinite`)
|
|
153
|
+
*/
|
|
154
|
+
duration?: number | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Pause the duration while the snackbar is hovered or focused.
|
|
157
|
+
*
|
|
158
|
+
* @defaultValue `true`
|
|
159
|
+
*/
|
|
160
|
+
pauseOnHover?: boolean | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* Show a button dismissing the snackbar.
|
|
163
|
+
*
|
|
164
|
+
* @defaultValue `false`
|
|
165
|
+
*/
|
|
166
|
+
dismissible?: boolean | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* Accessible name of the dismiss button.
|
|
169
|
+
*
|
|
170
|
+
* @defaultValue `"Dismiss"`
|
|
171
|
+
*/
|
|
172
|
+
dismissLabel?: string | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Place the action below the message, for a long action label (`Snackbar.kt`
|
|
175
|
+
* `actionOnNewLine`).
|
|
176
|
+
*
|
|
177
|
+
* @defaultValue `false`
|
|
178
|
+
*/
|
|
179
|
+
actionOnNewLine?: boolean | undefined;
|
|
180
|
+
/**
|
|
181
|
+
* Function notified of the dismissal of the snackbar, or the replacement of its request.
|
|
182
|
+
*
|
|
183
|
+
* The function is invoked once per dismissal, after
|
|
184
|
+
* {@link SnackbarProps.onOpenChange | `onOpenChange`}. An uncontrolled snackbar is then
|
|
185
|
+
* closing, while a controlled snackbar remains open until its `open` property is `false`.
|
|
186
|
+
*/
|
|
187
|
+
onDismiss?: SnackbarDismissHandler | undefined;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* {@link SnackbarHost} component properties.
|
|
191
|
+
*/
|
|
192
|
+
export type SnackbarHostProps = DomProps<HTMLDivElement, Omit<JSX.HTMLAttributes<HTMLDivElement>, "role">> & {
|
|
193
|
+
/**
|
|
194
|
+
* Queue whose current request is presented.
|
|
195
|
+
*/
|
|
196
|
+
queue: SnackbarQueue;
|
|
197
|
+
/**
|
|
198
|
+
* Position of the presented snackbars in the viewport.
|
|
199
|
+
*
|
|
200
|
+
* @defaultValue `"bottom"`
|
|
201
|
+
*/
|
|
202
|
+
position?: "bottom" | "bottom-end" | "bottom-start" | "top" | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* Function notified of the dismissal of a presented snackbar.
|
|
205
|
+
*/
|
|
206
|
+
onDismiss?: SnackbarDismissHandler | undefined;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Function notified of a change of a {@link SnackbarQueue}.
|
|
210
|
+
*
|
|
211
|
+
* @param reason - reason of the dismissal of a request, if a request was dismissed
|
|
212
|
+
* @param id - id of the dismissed request, if a request was dismissed
|
|
213
|
+
*/
|
|
214
|
+
type SnackbarQueueListener = (reason?: SnackbarDismissReason, id?: string) => void;
|
|
215
|
+
/**
|
|
216
|
+
* First-in, first-out queue of snackbar requests.
|
|
217
|
+
*
|
|
218
|
+
* A {@link SnackbarHost} presents the current request of a queue, and the presented snackbar
|
|
219
|
+
* dismisses it, which advances the queue. The queue owns no timers: the presented snackbar times
|
|
220
|
+
* its own request.
|
|
221
|
+
*/
|
|
222
|
+
export declare class SnackbarQueue {
|
|
223
|
+
#private;
|
|
224
|
+
/**
|
|
225
|
+
* Construct an empty queue.
|
|
226
|
+
*/
|
|
227
|
+
constructor();
|
|
228
|
+
/**
|
|
229
|
+
* Current request, or `null` while the queue is empty.
|
|
230
|
+
*
|
|
231
|
+
* @remarks
|
|
232
|
+
* This is **not** reactive; see {@link SnackbarQueue.subscribe}.
|
|
233
|
+
*/
|
|
234
|
+
get current(): SnackbarRequest | null;
|
|
235
|
+
/**
|
|
236
|
+
* Number of requests waiting behind the {@link SnackbarQueue.current | current} request.
|
|
237
|
+
*
|
|
238
|
+
* @remarks
|
|
239
|
+
* This is **not** reactive; see {@link SnackbarQueue.subscribe}.
|
|
240
|
+
*/
|
|
241
|
+
get pendingCount(): number;
|
|
242
|
+
/**
|
|
243
|
+
* Subscribe to changes of the current and pending requests.
|
|
244
|
+
*
|
|
245
|
+
* The listener is invoked synchronously after each change, with the reason and id of a
|
|
246
|
+
* dismissed request, if a request was dismissed. It is not invoked upon subscription; read
|
|
247
|
+
* {@link SnackbarQueue.current} for the current request.
|
|
248
|
+
*
|
|
249
|
+
* @param listener - function notified of changes
|
|
250
|
+
* @returns function which removes the subscription
|
|
251
|
+
*/
|
|
252
|
+
subscribe(listener: SnackbarQueueListener): () => void;
|
|
253
|
+
/**
|
|
254
|
+
* Enqueue a request.
|
|
255
|
+
*
|
|
256
|
+
* A request with the same {@link SnackbarRequest.dedupeKey | key}, or the same id when no key
|
|
257
|
+
* is supplied, as the current or a pending request is not enqueued.
|
|
258
|
+
*
|
|
259
|
+
* @param request - request to enqueue
|
|
260
|
+
* @returns id of the enqueued request, or of its current or pending duplicate
|
|
261
|
+
*/
|
|
262
|
+
enqueue(request: SnackbarRequest): string;
|
|
263
|
+
/**
|
|
264
|
+
* Enqueue a message.
|
|
265
|
+
*
|
|
266
|
+
* Duplicates are handled as for a request.
|
|
267
|
+
*
|
|
268
|
+
* @param message - message
|
|
269
|
+
* @param options - options of the request
|
|
270
|
+
* @returns id of the enqueued request, or of its current or pending duplicate
|
|
271
|
+
*/
|
|
272
|
+
enqueue(message: JSX.Element, options?: Omit<SnackbarRequest, "message">): string;
|
|
273
|
+
/**
|
|
274
|
+
* Dismiss a request, advancing the queue when the current request is dismissed.
|
|
275
|
+
*
|
|
276
|
+
* @param id - id of the request to dismiss; the current request when omitted
|
|
277
|
+
* @param reason - reason notified to subscribers
|
|
278
|
+
* @returns `true` if, and only if, a request was dismissed
|
|
279
|
+
*/
|
|
280
|
+
dismiss(id?: string, reason?: SnackbarDismissReason): boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Dismiss every request.
|
|
283
|
+
*
|
|
284
|
+
* Subscribers are notified once, with the `"programmatic"` reason and the id of the current
|
|
285
|
+
* request, if any.
|
|
286
|
+
*/
|
|
287
|
+
clear(): void;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Create an empty snackbar queue.
|
|
291
|
+
*
|
|
292
|
+
* @returns new queue
|
|
293
|
+
*/
|
|
294
|
+
export declare function createSnackbarQueue(): SnackbarQueue;
|
|
295
|
+
/**
|
|
296
|
+
* Client-side controller of a {@link Snackbar}.
|
|
297
|
+
*
|
|
298
|
+
* The controller times the snackbar, pausing while it is hovered or focused, and requests its
|
|
299
|
+
* dismissal through the respective callbacks.
|
|
300
|
+
*/
|
|
301
|
+
export declare class SnackbarController extends DomController<SnackbarProps> {
|
|
302
|
+
#private;
|
|
303
|
+
/**
|
|
304
|
+
* Construct a new controller.
|
|
305
|
+
*
|
|
306
|
+
* @param props - component properties
|
|
307
|
+
*/
|
|
308
|
+
constructor(props: SnackbarProps);
|
|
309
|
+
protected applyComponentProps(): void;
|
|
310
|
+
/**
|
|
311
|
+
* Request the dismissal of the snackbar.
|
|
312
|
+
*
|
|
313
|
+
* An uncontrolled snackbar closes. A controlled snackbar stops timing and requests closure
|
|
314
|
+
* through {@link SnackbarProps.onOpenChange}. Further requests are ignored until the snackbar
|
|
315
|
+
* opens again.
|
|
316
|
+
*
|
|
317
|
+
* @param event - event requesting the dismissal, if any
|
|
318
|
+
* @param reason - source of the dismissal
|
|
319
|
+
*/
|
|
320
|
+
dismiss(event?: Event, reason?: SnackbarDismissReason): void;
|
|
321
|
+
protected onStyleElementChanged(curr: StyleElement | null): void;
|
|
322
|
+
protected onControllerCleanup(): void;
|
|
323
|
+
protected render(children: JSX.Element): JSX.Element;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Material 3 snackbar.
|
|
327
|
+
*
|
|
328
|
+
* A snackbar briefly shows a message about a process, with an optional action and dismiss
|
|
329
|
+
* button. It is dismissed after its {@link SnackbarProps.duration | duration}, which pauses
|
|
330
|
+
* while the snackbar is hovered or focused, by its action or dismiss button, or by Escape while
|
|
331
|
+
* focus is within it. A snackbar with an action stays open until dismissed, as Compose's
|
|
332
|
+
* `SnackbarHostState` does. Present a series of messages through a {@link SnackbarHost}.
|
|
333
|
+
*
|
|
334
|
+
* Opening fades the snackbar in with the fast effects spring while scaling it from 0.8 with the
|
|
335
|
+
* fast spatial spring, and closing reverses this motion (`SnackbarHost.kt`).
|
|
336
|
+
*
|
|
337
|
+
* # States
|
|
338
|
+
*
|
|
339
|
+
* An open snackbar has the `cw-Snackbar-open` CSS class. A closed snackbar is `hidden` and `inert`,
|
|
340
|
+
* and is no longer rendered once its exit motion finishes.
|
|
341
|
+
*
|
|
342
|
+
* # Design
|
|
343
|
+
*
|
|
344
|
+
* Design is controlled through the `snackbar` roles of the [`cw-Feedback`](./feedback.yaml)
|
|
345
|
+
* design attribute (`SnackbarTokens`): an inverse surface container with an extra small shape
|
|
346
|
+
* and level 3 elevation, up to 600px wide, 48px tall for a line and 68px for two. The action is
|
|
347
|
+
* a small text button in the inverse primary color, and the dismiss button a small icon button.
|
|
348
|
+
* {@link SnackbarProps.actionOnNewLine | `props.actionOnNewLine`} places a long action below the
|
|
349
|
+
* message.
|
|
350
|
+
*
|
|
351
|
+
* # Accessibility
|
|
352
|
+
*
|
|
353
|
+
* Opening a snackbar announces its message and action through a polite `status` live region,
|
|
354
|
+
* shared by the snackbars of a document, which exists before the announcement.
|
|
355
|
+
*
|
|
356
|
+
* @param props - component properties
|
|
357
|
+
* @returns rendered element
|
|
358
|
+
*/
|
|
359
|
+
export declare const Snackbar: DomComponent<SnackbarProps>;
|
|
360
|
+
/**
|
|
361
|
+
* Client-side controller of a {@link SnackbarHost}.
|
|
362
|
+
*
|
|
363
|
+
* The host renders a snackbar for each request presented, and keeps the snackbar of a dismissed
|
|
364
|
+
* request until its exit motion finishes.
|
|
365
|
+
*/
|
|
366
|
+
export declare class SnackbarHostController extends DomController<SnackbarHostProps> {
|
|
367
|
+
#private;
|
|
368
|
+
/**
|
|
369
|
+
* Construct a new controller.
|
|
370
|
+
*
|
|
371
|
+
* @param props - component properties
|
|
372
|
+
*/
|
|
373
|
+
constructor(props: SnackbarHostProps);
|
|
374
|
+
protected applyComponentProps(): void;
|
|
375
|
+
protected onControllerCleanup(): void;
|
|
376
|
+
protected render(): JSX.Element;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Material 3 snackbar host.
|
|
380
|
+
*
|
|
381
|
+
* A snackbar host presents the current request of a {@link SnackbarQueue} as a {@link Snackbar},
|
|
382
|
+
* fixed to the bottom or the top of the viewport. Requests are presented in order, one at a
|
|
383
|
+
* time: the snackbar of a dismissed request fades out while the next one fades in, in the same
|
|
384
|
+
* place (`SnackbarHost.kt` `FadeInFadeOutWithScale`). Dismissing a request through the queue
|
|
385
|
+
* dismisses its snackbar.
|
|
386
|
+
*
|
|
387
|
+
* The host does not render nested children; content of the page belongs outside of the host.
|
|
388
|
+
*
|
|
389
|
+
* # Design
|
|
390
|
+
*
|
|
391
|
+
* Snackbars are 12px from the edges of the viewport (`Snackbar.kt`), centered or aligned by
|
|
392
|
+
* {@link SnackbarHostProps.position | `props.position`}.
|
|
393
|
+
*
|
|
394
|
+
* @param props - component properties
|
|
395
|
+
* @returns rendered element
|
|
396
|
+
*/
|
|
397
|
+
export declare const SnackbarHost: DomComponent<SnackbarHostProps>;
|
|
398
|
+
export {};
|