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