@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,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primary pointing device is hovering over style element.
|
|
3
|
+
*
|
|
4
|
+
* A component enters into the hover state while the non-touch pointing device is hovering over
|
|
5
|
+
* the *style* element of the component. This state is **never** entered into when the pointing
|
|
6
|
+
* device is a touch device.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link InteractionState}
|
|
9
|
+
*/
|
|
10
|
+
export declare const HoverState = 1;
|
|
11
|
+
/**
|
|
12
|
+
* User-agent focus is on function element.
|
|
13
|
+
*
|
|
14
|
+
* A component enters into the focus state while the user-agent has focus on the function element
|
|
15
|
+
* of the component.
|
|
16
|
+
*
|
|
17
|
+
* @see {@link InteractionState}
|
|
18
|
+
*/
|
|
19
|
+
export declare const FocusState = 2;
|
|
20
|
+
/**
|
|
21
|
+
* Style or function element is being pressed.
|
|
22
|
+
*
|
|
23
|
+
* A component enters into the press state when the primary pointing device, or synthetic click,
|
|
24
|
+
* occurs on the style or function element.
|
|
25
|
+
*
|
|
26
|
+
* @see {@link InteractionState}
|
|
27
|
+
*/
|
|
28
|
+
export declare const PressState = 4;
|
|
29
|
+
/**
|
|
30
|
+
* Style or function element is being dragged.
|
|
31
|
+
*
|
|
32
|
+
* A component enters into the drag state when the primary pointing device presses down on the
|
|
33
|
+
* style or function element, of the respective component, *and* the primary pointing device is
|
|
34
|
+
* moved. After the first press and move combination, this state is active for as long as the
|
|
35
|
+
* pointing device is being pressed down on the element.
|
|
36
|
+
*
|
|
37
|
+
* @see {@link InteractionState}
|
|
38
|
+
*/
|
|
39
|
+
export declare const DragState = 8;
|
|
40
|
+
/**
|
|
41
|
+
* Union of interaction states.
|
|
42
|
+
*
|
|
43
|
+
* Interaction states are entered into and exited from based on user input. These states apply
|
|
44
|
+
* styling based on their precedence, determined by the numerical value of the respective state.
|
|
45
|
+
*
|
|
46
|
+
* Styling applied for states is exclusive, based on precedence. For example, if a component
|
|
47
|
+
* enters into the {@link FocusState | focus} state, followed by entry into {@link DragState |
|
|
48
|
+
* drag} state, while both focus and drag states are active for the component, only styling for
|
|
49
|
+
* the drag state is applied to the component. The press state is the exception: a press is shown
|
|
50
|
+
* by a ripple painted above the state layer, so while the press state has the highest precedence,
|
|
51
|
+
* styling for the highest-precedence state below it, such as the hover state, remains applied.
|
|
52
|
+
*
|
|
53
|
+
* | State | Precedence |
|
|
54
|
+
* | ------------------ | ---------- |
|
|
55
|
+
* | {@link HoverState} | `0` |
|
|
56
|
+
* | {@link FocusState} | `1` |
|
|
57
|
+
* | {@link PressState} | `2` |
|
|
58
|
+
* | {@link DragState} | `3` |
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* State values are numerical values that may be bitwise OR'ed together to form a *set* of states.
|
|
62
|
+
*/
|
|
63
|
+
export type InteractionState = typeof DragState | typeof FocusState | typeof HoverState | typeof PressState;
|
|
64
|
+
/**
|
|
65
|
+
* Union of interaction {@link InteractionState | state} names.
|
|
66
|
+
*
|
|
67
|
+
* @see {@link nameOfInteractionState}
|
|
68
|
+
*/
|
|
69
|
+
export type InteractionStateName = "drag" | "focus" | "hover" | "press";
|
|
70
|
+
/**
|
|
71
|
+
* Test whether a `number` is an interaction {@link InteractionState | state}.
|
|
72
|
+
*
|
|
73
|
+
* @param val - `number` to test
|
|
74
|
+
* @returns `true` if, and only if, `val` is an interaction state
|
|
75
|
+
* @see {@link isInteractionStateMask}
|
|
76
|
+
*/
|
|
77
|
+
export declare function isInteractionState(val: number): val is InteractionState;
|
|
78
|
+
/**
|
|
79
|
+
* Test whether a `number` is a mask of interaction {@link InteractionState | states}.
|
|
80
|
+
*
|
|
81
|
+
* @param mask - `number` to test
|
|
82
|
+
* @returns `true` if, and only if, `mask` is `0` or a mask of interaction states
|
|
83
|
+
* @see {@link isInteractionState}
|
|
84
|
+
*/
|
|
85
|
+
export declare function isInteractionStateMask(mask: number): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Retrieve {@link InteractionStateName | name} of an interaction {@link InteractionState | state}.
|
|
88
|
+
*
|
|
89
|
+
* @param state - state to retrieve name of
|
|
90
|
+
* @returns name of `state`
|
|
91
|
+
*/
|
|
92
|
+
export declare function nameOfInteractionState(state: InteractionState): InteractionStateName;
|
|
93
|
+
/**
|
|
94
|
+
* Retrieve lowest, in terms of precedence, interaction {@link InteractionState | state} set in a
|
|
95
|
+
* mask.
|
|
96
|
+
*
|
|
97
|
+
* @param mask - mask to retrieve lowest state of
|
|
98
|
+
* @returns lowest state set in `mask` or `undefined` if `mask` is `0`
|
|
99
|
+
*/
|
|
100
|
+
export declare function lowestInteractionStateOf(mask: number): InteractionState | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Retrieve highest, in terms of precedence, interaction {@link InteractionState | state} set in a
|
|
103
|
+
* mask.
|
|
104
|
+
*
|
|
105
|
+
* @param mask - mask to retrieve highest state of
|
|
106
|
+
* @returns highest state set in `mask` or `undefined` if `mask` is `0`
|
|
107
|
+
*/
|
|
108
|
+
export declare function highestInteractionStateOf(mask: number): InteractionState | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Retrieve next higher, in terms of precedence, interaction {@link InteractionState | state} set
|
|
111
|
+
* in a mask, from another state.
|
|
112
|
+
*
|
|
113
|
+
* @param mask - state mask
|
|
114
|
+
* @param from - state to retrieve next higher state from
|
|
115
|
+
* @returns next state, within `mask`, with precedence greater than `from` or `undefined` if there
|
|
116
|
+
* is no state within `mask` with a precedence greater than `from`
|
|
117
|
+
*/
|
|
118
|
+
export declare function nextInteractionStateOf(mask: number, from: InteractionState): InteractionState | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Stream interaction {@link InteractionState | states} set within a mask, in order of precedence.
|
|
121
|
+
*
|
|
122
|
+
* This yields each state set in `mask`, in order of precedence. For example, if `mask` has both
|
|
123
|
+
* {@link FocusState | focus} and {@link HoverState | hover} set, this will yield hover before
|
|
124
|
+
* focus.
|
|
125
|
+
*
|
|
126
|
+
* @param mask - mask to stream states of
|
|
127
|
+
* @returns state generator
|
|
128
|
+
*/
|
|
129
|
+
export declare function streamInteractionStates(mask: number): Generator<InteractionState, undefined, boolean | undefined>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pseudo-element, of style element, in which the state-layer is rendered.
|
|
3
|
+
*/
|
|
4
|
+
export declare const STATE_LAYER_PSEUDO_ELEMENT = "::before";
|
|
5
|
+
/**
|
|
6
|
+
* Class applied to style element of an interactable component.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CSS_CLASS_INTERACTABLE = "cw-interactable";
|
|
9
|
+
/**
|
|
10
|
+
* Class which renders state-layer within a style element.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CSS_CLASS_STATE_LAYER = "_cw-interactable-stateLayer";
|
|
13
|
+
/**
|
|
14
|
+
* Class which renders a focus indicator within state-layer.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CSS_CLASS_FOCUS_INDICATOR = "_cw-interactable-focusIndicator";
|
|
17
|
+
/**
|
|
18
|
+
* Class which paints the press ripples of a state-layer, while a ripple is painted.
|
|
19
|
+
*
|
|
20
|
+
* @see {@link ./ripple#applyRipple}
|
|
21
|
+
*/
|
|
22
|
+
export declare const CSS_CLASS_RIPPLE = "_cw-interactable-ripple";
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Material carousel arrangement.
|
|
3
|
+
*
|
|
4
|
+
* | Arrangement | Items |
|
|
5
|
+
* | ---------------------------------- | --------------------------------------------------- |
|
|
6
|
+
* | `"multi-browse"` | Large items, followed by a medium and a small item. |
|
|
7
|
+
* | `"hero"` | One large item, followed by a small item. |
|
|
8
|
+
* | `"center-aligned-hero"` | One large item, between two small items. |
|
|
9
|
+
* | `"uncontained"` | Items of the preferred size, the last one cut off. |
|
|
10
|
+
* | `"uncontained-multi-aspect-ratio"` | Items of their own aspect ratios, without keylines. |
|
|
11
|
+
* | `"full-screen"` | One item filling the container, without keylines. |
|
|
12
|
+
*/
|
|
13
|
+
export type CarouselLayout = "multi-browse" | "hero" | "center-aligned-hero" | "uncontained" | "uncontained-multi-aspect-ratio" | "full-screen";
|
|
14
|
+
/**
|
|
15
|
+
* Keyline of a carousel.
|
|
16
|
+
*
|
|
17
|
+
* This is a position along the scrolling axis, and the size an item centered on it shows.
|
|
18
|
+
*/
|
|
19
|
+
export interface CarouselKeyline {
|
|
20
|
+
/**
|
|
21
|
+
* Size, in pixels, of item centered on keyline.
|
|
22
|
+
*/
|
|
23
|
+
readonly size: number;
|
|
24
|
+
/**
|
|
25
|
+
* Drawn position, in pixels, of item center.
|
|
26
|
+
*/
|
|
27
|
+
readonly offset: number;
|
|
28
|
+
/**
|
|
29
|
+
* Position of keyline in unmasked layout.
|
|
30
|
+
*
|
|
31
|
+
* In the unmasked layout, consecutive keylines are one focal item size and one item spacing
|
|
32
|
+
* apart. Item centers of that layout are compared against this.
|
|
33
|
+
*/
|
|
34
|
+
readonly unadjustedOffset: number;
|
|
35
|
+
/**
|
|
36
|
+
* Keyline belongs to focal run.
|
|
37
|
+
*
|
|
38
|
+
* The focal run is the run of largest keylines, where items are not masked.
|
|
39
|
+
*/
|
|
40
|
+
readonly focal: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Keyline is an anchor.
|
|
43
|
+
*
|
|
44
|
+
* Anchors are the two outermost keylines, where items leave the container.
|
|
45
|
+
*/
|
|
46
|
+
readonly anchor: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Keyline is pivot of its list.
|
|
49
|
+
*
|
|
50
|
+
* The pivot is the keyline from whose position its list is laid out.
|
|
51
|
+
*/
|
|
52
|
+
readonly pivot: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Overhang, in pixels, of item past container edge.
|
|
55
|
+
*
|
|
56
|
+
* This is the distance by which an item centered on the keyline extends past one container
|
|
57
|
+
* edge, or `0`. An item past both edges reports its overhang at the start.
|
|
58
|
+
*/
|
|
59
|
+
readonly cutoff: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* List of keylines, in order along scrolling axis.
|
|
63
|
+
*/
|
|
64
|
+
type KeylineList = readonly CarouselKeyline[];
|
|
65
|
+
/**
|
|
66
|
+
* Keylines of an arrangement in a container.
|
|
67
|
+
*/
|
|
68
|
+
export interface CarouselStrategy {
|
|
69
|
+
/**
|
|
70
|
+
* Container size, in pixels.
|
|
71
|
+
*/
|
|
72
|
+
readonly availableSpace: number;
|
|
73
|
+
/**
|
|
74
|
+
* Focal item size, in pixels.
|
|
75
|
+
*/
|
|
76
|
+
readonly itemSize: number;
|
|
77
|
+
/**
|
|
78
|
+
* Space between items, in pixels.
|
|
79
|
+
*/
|
|
80
|
+
readonly itemSpacing: number;
|
|
81
|
+
/**
|
|
82
|
+
* Keylines while scrolled away from both ends.
|
|
83
|
+
*/
|
|
84
|
+
readonly defaultKeylines: KeylineList;
|
|
85
|
+
/**
|
|
86
|
+
* Keyline steps towards container start.
|
|
87
|
+
*
|
|
88
|
+
* This lists the keylines from {@link CarouselStrategy.defaultKeylines | `defaultKeylines`}
|
|
89
|
+
* itself to the keylines at the scroll start, each step moving the focal keylines further
|
|
90
|
+
* towards the container start.
|
|
91
|
+
*/
|
|
92
|
+
readonly startSteps: readonly KeylineList[];
|
|
93
|
+
/**
|
|
94
|
+
* Keyline steps towards container end.
|
|
95
|
+
*
|
|
96
|
+
* This lists the keylines from {@link CarouselStrategy.defaultKeylines | `defaultKeylines`}
|
|
97
|
+
* itself to the keylines at the scroll end, each step moving the focal keylines further
|
|
98
|
+
* towards the container end.
|
|
99
|
+
*/
|
|
100
|
+
readonly endSteps: readonly KeylineList[];
|
|
101
|
+
/**
|
|
102
|
+
* Scroll distance, in pixels, of start steps.
|
|
103
|
+
*/
|
|
104
|
+
readonly startShiftDistance: number;
|
|
105
|
+
/**
|
|
106
|
+
* Scroll distance, in pixels, of end steps.
|
|
107
|
+
*/
|
|
108
|
+
readonly endShiftDistance: number;
|
|
109
|
+
/**
|
|
110
|
+
* Progress at which each start step applies.
|
|
111
|
+
*
|
|
112
|
+
* Each point is a fraction, from `0` to `1`, of {@link CarouselStrategy.startShiftDistance |
|
|
113
|
+
* `startShiftDistance`}. This is `[0]` if that distance is `0`.
|
|
114
|
+
*/
|
|
115
|
+
readonly startShiftPoints: readonly number[];
|
|
116
|
+
/**
|
|
117
|
+
* Progress at which each end step applies.
|
|
118
|
+
*
|
|
119
|
+
* Each point is a fraction, from `0` to `1`, of {@link CarouselStrategy.endShiftDistance |
|
|
120
|
+
* `endShiftDistance`}. This is `[0]` if that distance is `0`.
|
|
121
|
+
*/
|
|
122
|
+
readonly endShiftPoints: readonly number[];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Translation and mask of an item.
|
|
126
|
+
*/
|
|
127
|
+
export interface CarouselItemPlacement {
|
|
128
|
+
/**
|
|
129
|
+
* Translation, in pixels, of item.
|
|
130
|
+
*
|
|
131
|
+
* This is the distance by which the item moves towards the container end from its place in the
|
|
132
|
+
* end-to-end layout.
|
|
133
|
+
*/
|
|
134
|
+
readonly translation: number;
|
|
135
|
+
/**
|
|
136
|
+
* Size, in pixels, of unmasked part of item.
|
|
137
|
+
*/
|
|
138
|
+
readonly maskSize: number;
|
|
139
|
+
/**
|
|
140
|
+
* Masked item intersects container.
|
|
141
|
+
*/
|
|
142
|
+
readonly visible: boolean;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Compute keyline strategy of an arrangement.
|
|
146
|
+
*
|
|
147
|
+
* @param layout - carousel arrangement
|
|
148
|
+
* @param availableSpace - container size along scrolling axis, in pixels
|
|
149
|
+
* @param preferredItemSize - preferred size of large items, in pixels, which hero arrangements
|
|
150
|
+
* ignore
|
|
151
|
+
* @param itemSpacing - space between items, in pixels
|
|
152
|
+
* @param itemCount - number of items
|
|
153
|
+
* @returns new strategy, or `undefined` if the arrangement has no keylines, no item fits, or there
|
|
154
|
+
* is no item
|
|
155
|
+
* @throws {@link RangeError} arrangement holds `2 ** 32` items or more
|
|
156
|
+
*/
|
|
157
|
+
export declare function carouselStrategy(layout: CarouselLayout, availableSpace: number, preferredItemSize: number, itemSpacing: number, itemCount: number): CarouselStrategy | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Compute largest scroll offset of a carousel.
|
|
160
|
+
*
|
|
161
|
+
* Every item is taken at the focal size.
|
|
162
|
+
*
|
|
163
|
+
* @param strategy - keyline strategy
|
|
164
|
+
* @param itemCount - number of items
|
|
165
|
+
* @returns largest scroll offset, in pixels, at least `0`
|
|
166
|
+
*/
|
|
167
|
+
export declare function carouselMaxScroll(strategy: CarouselStrategy, itemCount: number): number;
|
|
168
|
+
/**
|
|
169
|
+
* Resolve keylines at a scroll offset.
|
|
170
|
+
*
|
|
171
|
+
* Away from both ends, this is the default list of the strategy itself. Within the start or end
|
|
172
|
+
* shift distance, this interpolates the two steps around the progress through that distance.
|
|
173
|
+
*
|
|
174
|
+
* @param strategy - keyline strategy
|
|
175
|
+
* @param scrollOffset - scroll offset, in pixels from the start
|
|
176
|
+
* @param maxScrollOffset - largest scroll offset
|
|
177
|
+
* @returns keyline list, either of `strategy` or new
|
|
178
|
+
*/
|
|
179
|
+
export declare function carouselKeylinesAt(strategy: CarouselStrategy, scrollOffset: number, maxScrollOffset: number): KeylineList;
|
|
180
|
+
/**
|
|
181
|
+
* Place an item along keylines.
|
|
182
|
+
*
|
|
183
|
+
* The item's center in the end-to-end layout is located between the two keylines around it, by
|
|
184
|
+
* their unadjusted offsets, and the item takes the size and position interpolated between them.
|
|
185
|
+
* An item before the first or past the last keyline takes that keyline's size and position,
|
|
186
|
+
* moved by its distance from the keyline relative to that size.
|
|
187
|
+
*
|
|
188
|
+
* @param strategy - keyline strategy
|
|
189
|
+
* @param keylines - keylines at `scrollOffset`
|
|
190
|
+
* @param index - item index
|
|
191
|
+
* @param scrollOffset - scroll offset, in pixels from the start
|
|
192
|
+
* @returns new placement
|
|
193
|
+
* @throws {@link TypeError} `keylines` is empty
|
|
194
|
+
*/
|
|
195
|
+
export declare function placeCarouselItem(strategy: CarouselStrategy, keylines: KeylineList, index: number, scrollOffset: number): CarouselItemPlacement;
|
|
196
|
+
/**
|
|
197
|
+
* Compute rest position of an item.
|
|
198
|
+
*
|
|
199
|
+
* This is where the item's start rests when the carousel is snapped to it. The first items rest
|
|
200
|
+
* where the start steps, in reverse order, put the first focal keyline. The last items, unless
|
|
201
|
+
* every item fits in the focal run, rest where the end steps put the last focal keyline. Every
|
|
202
|
+
* other item rests at the first focal keyline of the default list.
|
|
203
|
+
*
|
|
204
|
+
* @param strategy - keyline strategy
|
|
205
|
+
* @param index - item index
|
|
206
|
+
* @param itemCount - number of items
|
|
207
|
+
* @returns position, in whole pixels from the container start
|
|
208
|
+
* @throws {@link TypeError} `index` or `itemCount` is fractional where it selects one of several
|
|
209
|
+
* steps, or both are infinite
|
|
210
|
+
*/
|
|
211
|
+
export declare function carouselSnapOffset(strategy: CarouselStrategy, index: number, itemCount: number): number;
|
|
212
|
+
export {};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { DomComponent, DomProps, StyleElement } from "..";
|
|
3
|
+
import type { CarouselLayout } from "./carousel-layout";
|
|
4
|
+
import { DomController } from "../dom/client";
|
|
5
|
+
import "./carousel.css";
|
|
6
|
+
export type { CarouselLayout } from "./carousel-layout";
|
|
7
|
+
/**
|
|
8
|
+
* Properties accepted by {@link Carousel}.
|
|
9
|
+
*/
|
|
10
|
+
export type CarouselProps = DomProps<HTMLDivElement, Omit<JSX.HTMLAttributes<HTMLDivElement>, "role" | "aria-roledescription">> & {
|
|
11
|
+
/**
|
|
12
|
+
* Controlled active item index.
|
|
13
|
+
*
|
|
14
|
+
* When supplied, the carousel requests index changes through {@link
|
|
15
|
+
* CarouselProps.onIndexChange | `onIndexChange`} and waits for the parent to update this
|
|
16
|
+
* property.
|
|
17
|
+
*/
|
|
18
|
+
index?: number | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Alias for {@link CarouselProps.index | `index`}.
|
|
21
|
+
*/
|
|
22
|
+
activeIndex?: number | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Initial active item index of an uncontrolled carousel.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue `0`
|
|
27
|
+
*/
|
|
28
|
+
defaultIndex?: number | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Material carousel arrangement.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue `"full-screen"`
|
|
33
|
+
*/
|
|
34
|
+
layout?: CarouselLayout | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Preferred size, in pixels, of large items along the scrolling axis.
|
|
37
|
+
*
|
|
38
|
+
* Multi-browse carousels adjust large items toward this size to fit medium and small items.
|
|
39
|
+
* Uncontained carousels use it as the item size; multi-aspect-ratio carousels use it as the
|
|
40
|
+
* cross-axis item size. Hero carousels size their large item to the container.
|
|
41
|
+
*
|
|
42
|
+
* @defaultValue `240`
|
|
43
|
+
*/
|
|
44
|
+
itemSize?: number | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Space between items, in pixels.
|
|
47
|
+
*
|
|
48
|
+
* @defaultValue `8`
|
|
49
|
+
*/
|
|
50
|
+
itemGap?: number | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Scrolling axis.
|
|
53
|
+
*
|
|
54
|
+
* @defaultValue `"horizontal"`
|
|
55
|
+
*/
|
|
56
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Snap items while scrolling an uncontained carousel.
|
|
59
|
+
*
|
|
60
|
+
* Other arrangements always snap, one item at a time.
|
|
61
|
+
*
|
|
62
|
+
* @defaultValue `false`
|
|
63
|
+
*/
|
|
64
|
+
snap?: boolean | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Open an alternative view of the entire collection.
|
|
67
|
+
*
|
|
68
|
+
* Supplying this callback renders a Show all action, including when directional controls
|
|
69
|
+
* are hidden. Vertical carousels should provide this alternative browsing path.
|
|
70
|
+
*
|
|
71
|
+
* @param event - activating click event
|
|
72
|
+
*/
|
|
73
|
+
onShowAll?: ((event: MouseEvent) => void) | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Label of the Show all action.
|
|
76
|
+
*
|
|
77
|
+
* @defaultValue `"Show all"`
|
|
78
|
+
*/
|
|
79
|
+
showAllLabel?: string | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Wrap previous and next navigation around the ends.
|
|
82
|
+
*
|
|
83
|
+
* @defaultValue `false`
|
|
84
|
+
*/
|
|
85
|
+
loop?: boolean | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Show the previous and next controls.
|
|
88
|
+
*
|
|
89
|
+
* @defaultValue `true`
|
|
90
|
+
*/
|
|
91
|
+
showControls?: boolean | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Number of items, used to render exact labels and control states on the server.
|
|
94
|
+
*
|
|
95
|
+
* The client counts the rendered items.
|
|
96
|
+
*/
|
|
97
|
+
itemCount?: number | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Accessible name of the carousel region.
|
|
100
|
+
*
|
|
101
|
+
* @defaultValue `"Carousel"`
|
|
102
|
+
*/
|
|
103
|
+
label?: string | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Notify the parent of an active item change.
|
|
106
|
+
*
|
|
107
|
+
* Uncontrolled carousels notify after changing. Controlled carousels request the change and
|
|
108
|
+
* keep the controlled index until the parent accepts it.
|
|
109
|
+
*
|
|
110
|
+
* @param index - new or requested active index
|
|
111
|
+
* @param event - control or keyboard event, or `undefined` when scrolling changed the index
|
|
112
|
+
*/
|
|
113
|
+
onIndexChange?: ((index: number, event?: Event) => void) | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Label of the previous control.
|
|
116
|
+
*
|
|
117
|
+
* @defaultValue `"Previous"`
|
|
118
|
+
*/
|
|
119
|
+
previousLabel?: string | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Label of the next control.
|
|
122
|
+
*
|
|
123
|
+
* @defaultValue `"Next"`
|
|
124
|
+
*/
|
|
125
|
+
nextLabel?: string | undefined;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Properties accepted by {@link CarouselItem}.
|
|
129
|
+
*/
|
|
130
|
+
export type CarouselItemProps = DomProps<HTMLDivElement, Omit<JSX.HTMLAttributes<HTMLDivElement>, "role" | "aria-roledescription">> & {
|
|
131
|
+
/**
|
|
132
|
+
* Accessible item label.
|
|
133
|
+
*
|
|
134
|
+
* @defaultValue `"Slide <n> of <count>"`
|
|
135
|
+
*/
|
|
136
|
+
label?: string | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Width-to-height ratio of the item in a multi-aspect-ratio carousel.
|
|
139
|
+
*
|
|
140
|
+
* The ratio is clamped to 9:16–16:9. Horizontal carousels share a common item height;
|
|
141
|
+
* vertical carousels share a common item width.
|
|
142
|
+
*
|
|
143
|
+
* @defaultValue `1`
|
|
144
|
+
*/
|
|
145
|
+
aspectRatio?: number | undefined;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Client controller of a {@link Carousel}.
|
|
149
|
+
*
|
|
150
|
+
* Items are laid out end-to-end in a native scroll container. User scrolling, including fling and
|
|
151
|
+
* snapping, is native; keyline arrangements snap one item at a time through CSS scroll snapping,
|
|
152
|
+
* with per-item snap margins derived from the keyline {@link ./carousel-layout#CarouselStrategy |
|
|
153
|
+
* strategy}. While scrolling, each animation frame reads the scroll offset once and writes the
|
|
154
|
+
* mask of the items near the viewport. Programmatic scrolling, from controls, keys, or a changed
|
|
155
|
+
* controlled index, is smooth unless the user prefers reduced motion.
|
|
156
|
+
*/
|
|
157
|
+
export declare class CarouselController extends DomController<CarouselProps> {
|
|
158
|
+
#private;
|
|
159
|
+
/**
|
|
160
|
+
* Construct a new `CarouselController`.
|
|
161
|
+
*
|
|
162
|
+
* @param props - component properties
|
|
163
|
+
*/
|
|
164
|
+
constructor(props: CarouselProps);
|
|
165
|
+
/**
|
|
166
|
+
* Apply local properties to component state and styling.
|
|
167
|
+
*
|
|
168
|
+
* @see {@link ../dom/client#DomController.applyComponentProps}
|
|
169
|
+
*/
|
|
170
|
+
protected applyComponentProps(): void;
|
|
171
|
+
/**
|
|
172
|
+
* Handle style element replacement before the controller reference is updated.
|
|
173
|
+
*
|
|
174
|
+
* The style-element getter still exposes the previous element during this hook.
|
|
175
|
+
*
|
|
176
|
+
* @param curr - new style element, or `null` when absent
|
|
177
|
+
* @see {@link ../dom/client#DomController.onStyleElementChanged}
|
|
178
|
+
*/
|
|
179
|
+
protected onStyleElementChanged(curr: StyleElement | null): void;
|
|
180
|
+
/**
|
|
181
|
+
* Render the component's element tree.
|
|
182
|
+
*
|
|
183
|
+
* @param children - nested component children, possibly an accessor
|
|
184
|
+
* @returns rendered component elements
|
|
185
|
+
* @see {@link ../dom/client#DomController.render}
|
|
186
|
+
*/
|
|
187
|
+
protected render(children: JSX.Element): JSX.Element;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Material carousel of full-screen, multi-browse, hero, center-aligned hero, uncontained, and
|
|
191
|
+
* multi-aspect-ratio uncontained arrangements.
|
|
192
|
+
*
|
|
193
|
+
* Items are {@link CarouselItem}s. Keyline arrangements size and mask items following the Material
|
|
194
|
+
* 3 keyline model: items shrink and translate between large, medium, and small keylines while
|
|
195
|
+
* scrolling, and snap one item at a time. Scrolling is native; keyboard users navigate with the
|
|
196
|
+
* arrow, Home, and End keys of the scrolling axis while the viewport is focused, or with the
|
|
197
|
+
* previous and next controls.
|
|
198
|
+
*
|
|
199
|
+
* # States
|
|
200
|
+
*
|
|
201
|
+
* The active item has `aria-current="true"`. Omitting {@link CarouselProps.index | `index`}
|
|
202
|
+
* enables uncontrolled state initialized by {@link CarouselProps.defaultIndex | `defaultIndex`};
|
|
203
|
+
* supplying it requires the parent to accept index requests.
|
|
204
|
+
*
|
|
205
|
+
* # Design
|
|
206
|
+
*
|
|
207
|
+
* The carousel region has the `cw-Carousel` class and `data-cw-carousel-layout`,
|
|
208
|
+
* `data-cw-carousel-orientation`, and `data-cw-carousel-snap` attributes. Items have the
|
|
209
|
+
* `cw-Carousel-slide` class; their content is masked by the inner `cw-Carousel-mask` element.
|
|
210
|
+
*
|
|
211
|
+
* @param props - component properties
|
|
212
|
+
* @returns rendered carousel
|
|
213
|
+
*/
|
|
214
|
+
export declare const Carousel: DomComponent<CarouselProps>;
|
|
215
|
+
/**
|
|
216
|
+
* One item of a {@link Carousel}.
|
|
217
|
+
*
|
|
218
|
+
* Items are `group`s with the `slide` role description. Unless labelled, an item is named after
|
|
219
|
+
* its position, such as "Slide 2 of 6".
|
|
220
|
+
*
|
|
221
|
+
* @param props - component properties
|
|
222
|
+
* @returns rendered item
|
|
223
|
+
*/
|
|
224
|
+
export declare const CarouselItem: DomComponent<CarouselItemProps>;
|
|
225
|
+
/**
|
|
226
|
+
* Alias of {@link CarouselItem}.
|
|
227
|
+
*
|
|
228
|
+
* @param props - component properties
|
|
229
|
+
* @returns rendered item
|
|
230
|
+
*/
|
|
231
|
+
export declare const CarouselSlide: DomComponent<CarouselItemProps>;
|