@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,248 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { DomComponent, StyleElement } from "..";
|
|
3
|
+
import type { NavigationElementProps, NavigationOrientation } from "./base";
|
|
4
|
+
import { DomController } from "../dom/client";
|
|
5
|
+
import "../container/elevation-shadow.css";
|
|
6
|
+
import "./navigation.css";
|
|
7
|
+
/**
|
|
8
|
+
* Direction in which a toolbar exits the screen while content scrolls forward.
|
|
9
|
+
*/
|
|
10
|
+
export type FloatingToolbarExitDirection = "bottom" | "top" | "start" | "end";
|
|
11
|
+
/**
|
|
12
|
+
* Properties of floating and docked toolbars.
|
|
13
|
+
*
|
|
14
|
+
* Use {@link FloatingToolbarItem} for toolbar actions when server-rendered and hydrated markup
|
|
15
|
+
* must share the initial roving tab stop. Other actionable descendants, such as `IconButton`, are
|
|
16
|
+
* supported as well; their roving tab stops are assigned on the client.
|
|
17
|
+
*/
|
|
18
|
+
export type FloatingToolbarProps = NavigationElementProps<HTMLDivElement> & {
|
|
19
|
+
/**
|
|
20
|
+
* Color treatment: standard surface colors or vibrant primary-container colors.
|
|
21
|
+
*
|
|
22
|
+
* Standard icon buttons take the content color of the toolbar. Their toggles, and filled
|
|
23
|
+
* toggle buttons, have no container of their own while unselected, and take these colors:
|
|
24
|
+
*
|
|
25
|
+
* | Design | Unselected content | Selected container | Selected content |
|
|
26
|
+
* | ---------- | -------------------- | ------------------- | ---------------------- |
|
|
27
|
+
* | `standard` | on-surface-variant | secondary-container | on-secondary-container |
|
|
28
|
+
* | `vibrant` | on-primary-container | surface-container | on-surface |
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue `"standard"`
|
|
31
|
+
*/
|
|
32
|
+
design?: "standard" | "vibrant" | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Attach the toolbar to the bottom edge of the screen, as a docked toolbar.
|
|
35
|
+
*
|
|
36
|
+
* @defaultValue `false`; {@link DockedToolbar} defaults to `true`.
|
|
37
|
+
*/
|
|
38
|
+
docked?: boolean | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Toolbar orientation. Docked toolbars are horizontal.
|
|
41
|
+
*
|
|
42
|
+
* @defaultValue `"horizontal"`; {@link VerticalFloatingToolbar} defaults to `"vertical"`.
|
|
43
|
+
*/
|
|
44
|
+
orientation?: NavigationOrientation | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Show the leading and trailing content of a floating toolbar.
|
|
47
|
+
*
|
|
48
|
+
* Collapsing hides {@link FloatingToolbarProps.leadingContent} and
|
|
49
|
+
* {@link FloatingToolbarProps.trailingContent}; with a
|
|
50
|
+
* {@link FloatingToolbarProps.floatingActionButton}, the whole toolbar collapses into the
|
|
51
|
+
* button, which grows from the 56px baseline FAB size to the 80px medium FAB size while its
|
|
52
|
+
* icon keeps its size.
|
|
53
|
+
*
|
|
54
|
+
* @defaultValue `true`
|
|
55
|
+
*/
|
|
56
|
+
expanded?: boolean | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Content before the main content, hidden while the floating toolbar is collapsed.
|
|
59
|
+
*/
|
|
60
|
+
leadingContent?: JSX.Element;
|
|
61
|
+
/**
|
|
62
|
+
* Content after the main content, hidden while the floating toolbar is collapsed.
|
|
63
|
+
*/
|
|
64
|
+
trailingContent?: JSX.Element;
|
|
65
|
+
/**
|
|
66
|
+
* Floating action button paired with a floating toolbar.
|
|
67
|
+
*
|
|
68
|
+
* Use a primary-container FAB with the standard design and a tertiary-container FAB with the
|
|
69
|
+
* vibrant design. The toolbar sizes a {@link ../action#FAB | FAB} as Compose does, within the
|
|
70
|
+
* space of the 56px button, beyond which the 80px button of a collapsed toolbar extends toward
|
|
71
|
+
* the container. The button is part of the toolbar's keyboard navigation.
|
|
72
|
+
*/
|
|
73
|
+
floatingActionButton?: JSX.Element;
|
|
74
|
+
/**
|
|
75
|
+
* Side of the toolbar on which the floating action button is placed: the inline start or end
|
|
76
|
+
* of a horizontal toolbar, or the top or bottom of a vertical toolbar.
|
|
77
|
+
*
|
|
78
|
+
* @defaultValue `"end"`
|
|
79
|
+
*/
|
|
80
|
+
floatingActionButtonPosition?: "start" | "end" | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Move the toolbar off the screen while content scrolls forward and back as soon as content
|
|
83
|
+
* scrolls back, as Compose's `FloatingToolbarDefaults.exitAlwaysScrollBehavior`.
|
|
84
|
+
*
|
|
85
|
+
* While the toolbar is moved, even partially, it is inert and cannot be focused.
|
|
86
|
+
*/
|
|
87
|
+
scrollBehavior?: "exitAlways" | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Id of the scroll container followed by {@link FloatingToolbarProps.scrollBehavior}, resolved
|
|
90
|
+
* in the toolbar's document or shadow root.
|
|
91
|
+
*
|
|
92
|
+
* @defaultValue The document scrolling element
|
|
93
|
+
*/
|
|
94
|
+
scrollTarget?: string | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Direction in which a floating toolbar exits with
|
|
97
|
+
* {@link FloatingToolbarProps.scrollBehavior}. Docked toolbars exit toward the bottom edge.
|
|
98
|
+
*
|
|
99
|
+
* @defaultValue `"bottom"` for horizontal and `"end"` for vertical toolbars
|
|
100
|
+
*/
|
|
101
|
+
exitDirection?: FloatingToolbarExitDirection | undefined;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Properties of an unstyled native toolbar button.
|
|
105
|
+
*
|
|
106
|
+
* {@link FloatingToolbarItem} provides matching initial server and client roving tab stops, not
|
|
107
|
+
* the visual or interaction-state styling of `Button` or `IconButton`.
|
|
108
|
+
*/
|
|
109
|
+
export type FloatingToolbarItemProps = NavigationElementProps<HTMLButtonElement> & {
|
|
110
|
+
/**
|
|
111
|
+
* Disable the native button and exclude it from keyboard navigation.
|
|
112
|
+
*
|
|
113
|
+
* @defaultValue `false`
|
|
114
|
+
*/
|
|
115
|
+
disabled?: boolean | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Tab index of a standalone button.
|
|
118
|
+
*
|
|
119
|
+
* Within a toolbar, the toolbar manages `0` and `-1`; values below `-1` exclude this button
|
|
120
|
+
* from the initial server-rendered tab-stop claim and from keyboard navigation.
|
|
121
|
+
*
|
|
122
|
+
* @defaultValue The first enabled item receives `0`; later items receive `-1`.
|
|
123
|
+
*/
|
|
124
|
+
tabIndex?: number | undefined;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Unstyled native toolbar button with deterministic server and client roving tab stops.
|
|
128
|
+
*
|
|
129
|
+
* This semantic helper does not apply Material button styling or interaction states. Styled
|
|
130
|
+
* native action descendants, such as `Button` or `IconButton`, can be placed directly in a toolbar
|
|
131
|
+
* instead; their roving tab stops are assigned on the client.
|
|
132
|
+
*
|
|
133
|
+
* @param props - component properties
|
|
134
|
+
* @returns rendered element
|
|
135
|
+
*/
|
|
136
|
+
export declare const FloatingToolbarItem: DomComponent<FloatingToolbarItemProps>;
|
|
137
|
+
/**
|
|
138
|
+
* Client controller of toolbar layout, roving focus, collapse, and exit-on-scroll.
|
|
139
|
+
*
|
|
140
|
+
* The toolbar implements the APG toolbar pattern: one actionable descendant is in the tab order,
|
|
141
|
+
* arrow keys along the orientation move focus with wrapping, and Home and End move to the first
|
|
142
|
+
* and last item. Horizontal arrows follow the text direction. Disabled, hidden, inert, and
|
|
143
|
+
* CSS-hidden descendants are skipped, and authored tab indices are restored when items leave the
|
|
144
|
+
* toolbar or the toolbar is disposed.
|
|
145
|
+
*/
|
|
146
|
+
export declare class FloatingToolbarController extends DomController<FloatingToolbarProps> {
|
|
147
|
+
#private;
|
|
148
|
+
/**
|
|
149
|
+
* Construct a new `FloatingToolbarController`.
|
|
150
|
+
*
|
|
151
|
+
* @param props - component properties
|
|
152
|
+
* @param defaultOrientation - orientation used when {@link FloatingToolbarProps.orientation} is
|
|
153
|
+
* omitted
|
|
154
|
+
*/
|
|
155
|
+
constructor(props: FloatingToolbarProps, defaultOrientation?: NavigationOrientation);
|
|
156
|
+
/**
|
|
157
|
+
* Apply local properties to component state and styling.
|
|
158
|
+
*
|
|
159
|
+
* @see {@link ../dom/client#DomController.applyComponentProps}
|
|
160
|
+
*/
|
|
161
|
+
protected applyComponentProps(): void;
|
|
162
|
+
/**
|
|
163
|
+
* Bind listeners, the descendant observer, and the exit state to the toolbar element.
|
|
164
|
+
*
|
|
165
|
+
* Toolbars render a static element, so this runs once, when the toolbar is rendered.
|
|
166
|
+
*
|
|
167
|
+
* @param curr - new style element, or `null` when absent
|
|
168
|
+
* @see {@link ../dom/client#DomController.onStyleElementChanged}
|
|
169
|
+
*/
|
|
170
|
+
protected onStyleElementChanged(curr: StyleElement | null): void;
|
|
171
|
+
/**
|
|
172
|
+
* Restore authored tab indices and release observers when the controller is disposed.
|
|
173
|
+
*
|
|
174
|
+
* @see {@link ../dom/client#DomController.onControllerCleanup}
|
|
175
|
+
*/
|
|
176
|
+
protected onControllerCleanup(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Render the static toolbar structure and insert its slots.
|
|
179
|
+
*
|
|
180
|
+
* @param children - nested component children, possibly an accessor
|
|
181
|
+
* @returns rendered component elements
|
|
182
|
+
* @see {@link ../dom/client#DomController.render}
|
|
183
|
+
*/
|
|
184
|
+
protected render(children: JSX.Element): JSX.Element;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Material 3 Expressive floating toolbar.
|
|
188
|
+
*
|
|
189
|
+
* Floating toolbars float above content and hold actions for the current page: icon buttons,
|
|
190
|
+
* buttons, and other controls, optionally framed by collapsible leading and trailing content and
|
|
191
|
+
* paired with a floating action button. Toolbars use the `toolbar` role and APG keyboard
|
|
192
|
+
* navigation; label them with `attr:aria-label`. Position the toolbar, for example with fixed
|
|
193
|
+
* positioning 16px from the screen edge (Compose `FloatingToolbarDefaults.ScreenOffset`).
|
|
194
|
+
*
|
|
195
|
+
* # States
|
|
196
|
+
*
|
|
197
|
+
* Collapsing ({@link FloatingToolbarProps.expanded}) hides the leading and trailing content, or
|
|
198
|
+
* with a floating action button the whole toolbar, with the fast spatial spring
|
|
199
|
+
* (Compose `FloatingToolbarDefaults.animationSpec`). With the `exitAlways`
|
|
200
|
+
* {@link FloatingToolbarProps.scrollBehavior | scroll behavior}, the toolbar moves off the screen
|
|
201
|
+
* as content scrolls forward and snaps with the default effects spring.
|
|
202
|
+
*
|
|
203
|
+
* # Design
|
|
204
|
+
*
|
|
205
|
+
* Toolbar design is controlled through the [`cw-FloatingToolbar`](./toolbar.yaml) component design
|
|
206
|
+
* attribute. The toolbar has the `cw-FloatingToolbar` class, the
|
|
207
|
+
* `data-cw-toolbar-design="standard|vibrant"` attribute, and
|
|
208
|
+
* `data-cw-floating-toolbar-expanded="true|false"`.
|
|
209
|
+
*
|
|
210
|
+
* # Elements
|
|
211
|
+
*
|
|
212
|
+
* | Element | Description |
|
|
213
|
+
* | ------- | ----------- |
|
|
214
|
+
* | `.cw-FloatingToolbar-container` | Visual container: color, full shape, and elevation. |
|
|
215
|
+
* | `.cw-FloatingToolbar-leading`, `.cw-FloatingToolbar-trailing` | Collapsible content. |
|
|
216
|
+
* | `.cw-FloatingToolbar-fab` | Paired floating action button. |
|
|
217
|
+
*
|
|
218
|
+
* @param props - component properties
|
|
219
|
+
* @returns rendered element
|
|
220
|
+
*/
|
|
221
|
+
export declare const FloatingToolbar: DomComponent<FloatingToolbarProps>;
|
|
222
|
+
/**
|
|
223
|
+
* Horizontal {@link FloatingToolbar}.
|
|
224
|
+
*
|
|
225
|
+
* @param props - component properties
|
|
226
|
+
* @returns rendered element
|
|
227
|
+
*/
|
|
228
|
+
export declare const HorizontalFloatingToolbar: DomComponent<FloatingToolbarProps>;
|
|
229
|
+
/**
|
|
230
|
+
* Vertical {@link FloatingToolbar}.
|
|
231
|
+
*
|
|
232
|
+
* @param props - component properties
|
|
233
|
+
* @returns rendered element
|
|
234
|
+
*/
|
|
235
|
+
export declare const VerticalFloatingToolbar: DomComponent<FloatingToolbarProps>;
|
|
236
|
+
/**
|
|
237
|
+
* Material 3 Expressive docked toolbar.
|
|
238
|
+
*
|
|
239
|
+
* Docked toolbars span the bottom edge of the screen and distribute their actions across it; they
|
|
240
|
+
* replace the {@link ./app-bar#BottomAppBar | bottom app bar} in Material 3 Expressive. The
|
|
241
|
+
* `exitAlways` {@link FloatingToolbarProps.scrollBehavior | scroll behavior} hides the toolbar
|
|
242
|
+
* toward the bottom edge and snaps with the fast spatial spring of Compose's flexible bottom app
|
|
243
|
+
* bar. The toolbar has the `cw-FloatingToolbar` and `cw-DockedToolbar` classes.
|
|
244
|
+
*
|
|
245
|
+
* @param props - component properties
|
|
246
|
+
* @returns rendered element
|
|
247
|
+
*/
|
|
248
|
+
export declare const DockedToolbar: DomComponent<FloatingToolbarProps>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { DomProps, ElementDomProps } from "..";
|
|
3
|
+
/**
|
|
4
|
+
* State-change callback for controlled and uncontrolled selection components.
|
|
5
|
+
*
|
|
6
|
+
* Controlled components request that the parent update their selected or checked property.
|
|
7
|
+
* Callbacks which need only the state may omit the event parameter. When several callback aliases
|
|
8
|
+
* refer to the same function, the component invokes that function only once per notification.
|
|
9
|
+
*
|
|
10
|
+
* @param selected - requested or newly selected state
|
|
11
|
+
* @param event - originating interaction event
|
|
12
|
+
*/
|
|
13
|
+
export type SelectionChangeHandler = (selected: boolean, event: Event) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Native element through which a selection component participates in a form.
|
|
16
|
+
*/
|
|
17
|
+
export type FormAssociatedSelectionElement = HTMLButtonElement | HTMLInputElement;
|
|
18
|
+
/**
|
|
19
|
+
* Interaction states enabled for an enabled selection component.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SELECTION_INTERACTION_STATES: number;
|
|
22
|
+
/**
|
|
23
|
+
* Root node which dispatches the non-composed events of the nodes it contains.
|
|
24
|
+
*
|
|
25
|
+
* Events such as `change` and `reset` are not composed, so a node inside a shadow tree is
|
|
26
|
+
* observed through its shadow root rather than through the document.
|
|
27
|
+
*/
|
|
28
|
+
export type EventRoot = Document | ShadowRoot;
|
|
29
|
+
/**
|
|
30
|
+
* Element properties of a container, as split by {@link splitContainerElementProps}.
|
|
31
|
+
*/
|
|
32
|
+
export type ContainerElementProps = Pick<JSX.HTMLAttributes<HTMLElement>, "class" | "classList" | "style">;
|
|
33
|
+
/**
|
|
34
|
+
* Split the properties supplied to a server renderer for a component whose style element is a
|
|
35
|
+
* container and whose function element is a native control nested within it.
|
|
36
|
+
*
|
|
37
|
+
* `defineServerDomComponent` removes the `attr:` and `event:` namespaces before invoking the
|
|
38
|
+
* renderer. The DOM controller applies these properties to the function element on the client,
|
|
39
|
+
* so the server renderer must put them on the native control as well to retain hydration parity.
|
|
40
|
+
*
|
|
41
|
+
* Properties are copied with their descriptors, so lazily evaluated properties are not read.
|
|
42
|
+
* `children` is omitted: the renderer must read it where the children are nested, *after*
|
|
43
|
+
* creating the container, as the client renders slots after their parent element.
|
|
44
|
+
*
|
|
45
|
+
* @typeParam P - component properties type
|
|
46
|
+
* @param elemProps - element properties received by the server renderer
|
|
47
|
+
* @returns tuple of the container's styling properties and the function element's properties
|
|
48
|
+
*/
|
|
49
|
+
export declare function splitContainerElementProps<P extends DomProps>(elemProps: ElementDomProps<P>): [containerProps: ContainerElementProps, functionProps: Record<string, unknown>];
|
|
50
|
+
/**
|
|
51
|
+
* Invoke selection callbacks, invoking a callback registered under several aliases only once.
|
|
52
|
+
*
|
|
53
|
+
* Callbacks run in the order of `handlers`; `undefined` entries are skipped.
|
|
54
|
+
*
|
|
55
|
+
* @param handlers - callbacks to invoke, in invocation order
|
|
56
|
+
* @param selected - requested or newly selected state
|
|
57
|
+
* @param event - originating interaction event
|
|
58
|
+
*/
|
|
59
|
+
export declare function notifySelectionChange(handlers: readonly (SelectionChangeHandler | undefined)[], selected: boolean, event: Event): void;
|
|
60
|
+
/**
|
|
61
|
+
* Update the form attributes shared by native selection controls.
|
|
62
|
+
*
|
|
63
|
+
* Attributes are assigned through `setAttribute`, the controller's attribute writer, so that they
|
|
64
|
+
* survive function element replacement. The `disabled` property is also assigned directly, since
|
|
65
|
+
* a control which has already participated in a form reads the property. The `tabindex`
|
|
66
|
+
* attribute is updated only when `props` has a `tabIndex` key, so a control whose tab order is
|
|
67
|
+
* owned elsewhere omits the key.
|
|
68
|
+
*
|
|
69
|
+
* @param elem - native control to update
|
|
70
|
+
* @param props - form attribute values
|
|
71
|
+
* @param setAttribute - controller attribute writer
|
|
72
|
+
*/
|
|
73
|
+
export declare function applyNativeSelectionAttributes(elem: FormAssociatedSelectionElement, props: {
|
|
74
|
+
readonly disabled?: boolean | undefined;
|
|
75
|
+
readonly name?: string | undefined;
|
|
76
|
+
readonly required?: boolean | undefined;
|
|
77
|
+
readonly tabIndex?: number | undefined;
|
|
78
|
+
readonly value?: string | undefined;
|
|
79
|
+
}, setAttribute: (name: string, value?: boolean | number | string) => void): void;
|
|
80
|
+
/**
|
|
81
|
+
* Resolve the root which dispatches the non-composed events of a node.
|
|
82
|
+
*
|
|
83
|
+
* @param node - node to resolve the root of
|
|
84
|
+
* @returns document or shadow root containing `node`, or `undefined` if `node` is not connected
|
|
85
|
+
*/
|
|
86
|
+
export declare function eventRootOf(node: Node): EventRoot | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Observe resets of the form owning a native selection control.
|
|
89
|
+
*
|
|
90
|
+
* One capture listener is installed per document or shadow root and shared by its controls. When
|
|
91
|
+
* a form is reset, the callbacks of the controls owned by the form *at the time of the reset* run
|
|
92
|
+
* after the user agent has restored the form's controls, unless the reset is cancelled. A
|
|
93
|
+
* control must be connected when it is registered; moving a registered control into another
|
|
94
|
+
* document or shadow root ends the observation.
|
|
95
|
+
*
|
|
96
|
+
* @param elem - connected native control
|
|
97
|
+
* @param onReset - callback invoked after the control's form is reset
|
|
98
|
+
* @returns function which ends the observation
|
|
99
|
+
*/
|
|
100
|
+
export declare function observeFormReset(elem: FormAssociatedSelectionElement, onReset: () => void): () => void;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { DomProps, FunctionElement } from "..";
|
|
3
|
+
import type { InteractableComponent } from "../state";
|
|
4
|
+
import type { SelectionChangeHandler } from "./base";
|
|
5
|
+
import { InteractableController } from "../state/controller";
|
|
6
|
+
import "./selection.css";
|
|
7
|
+
/**
|
|
8
|
+
* State displayed by a {@link Checkbox}.
|
|
9
|
+
*/
|
|
10
|
+
export type CheckboxState = "checked" | "indeterminate" | "unchecked";
|
|
11
|
+
/**
|
|
12
|
+
* {@link Checkbox} component properties.
|
|
13
|
+
*/
|
|
14
|
+
export type CheckboxProps = DomProps<HTMLInputElement, Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "checked" | "defaultChecked" | "disabled" | "name" | "required" | "tabIndex" | "type" | "value">> & {
|
|
15
|
+
/**
|
|
16
|
+
* Checkbox is checked.
|
|
17
|
+
*
|
|
18
|
+
* The checkbox is controlled when this property is present, even when its value is
|
|
19
|
+
* `undefined`. A controlled checkbox reports user changes through {@link
|
|
20
|
+
* CheckboxProps.onChange | `onChange`} and displays the requested state only after the parent
|
|
21
|
+
* updates this property. Omit the property for an uncontrolled checkbox.
|
|
22
|
+
*/
|
|
23
|
+
checked?: boolean | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Initial checked state of an uncontrolled checkbox.
|
|
26
|
+
*
|
|
27
|
+
* This is also the state restored when the checkbox's form is reset.
|
|
28
|
+
*
|
|
29
|
+
* @defaultValue `false`
|
|
30
|
+
* @remarks
|
|
31
|
+
* This is read once.
|
|
32
|
+
*/
|
|
33
|
+
defaultChecked?: boolean | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Checkbox is indeterminate.
|
|
36
|
+
*
|
|
37
|
+
* The indeterminate state is controlled when this property is present. It is applied to the
|
|
38
|
+
* native `indeterminate` property, which takes visual and accessible precedence over the
|
|
39
|
+
* checked state. User activation clears the native indeterminate state of an uncontrolled
|
|
40
|
+
* checkbox; a controlled checkbox keeps it until the parent updates this property.
|
|
41
|
+
*/
|
|
42
|
+
indeterminate?: boolean | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Initial indeterminate state of an uncontrolled checkbox.
|
|
45
|
+
*
|
|
46
|
+
* This is also the indeterminate state restored when the checkbox's form is reset.
|
|
47
|
+
*
|
|
48
|
+
* @defaultValue `false`
|
|
49
|
+
* @remarks
|
|
50
|
+
* This is read once.
|
|
51
|
+
*/
|
|
52
|
+
defaultIndeterminate?: boolean | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Checkbox is disabled.
|
|
55
|
+
*
|
|
56
|
+
* A disabled checkbox cannot be activated or focused and does not submit a value.
|
|
57
|
+
*
|
|
58
|
+
* @defaultValue `false`
|
|
59
|
+
*/
|
|
60
|
+
disabled?: boolean | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Checkbox shows an error.
|
|
63
|
+
*
|
|
64
|
+
* When `true`, the error design roles are applied and the native control is marked with
|
|
65
|
+
* `aria-invalid="true"`, unless `attr:aria-invalid` is supplied.
|
|
66
|
+
*
|
|
67
|
+
* @defaultValue `false`
|
|
68
|
+
*/
|
|
69
|
+
error?: boolean | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Name under which the checkbox submits its value.
|
|
72
|
+
*/
|
|
73
|
+
name?: string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Value submitted while the checkbox is checked.
|
|
76
|
+
*
|
|
77
|
+
* @defaultValue `"on"`
|
|
78
|
+
*/
|
|
79
|
+
value?: string | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Checkbox must be checked for its form to be submitted.
|
|
82
|
+
*
|
|
83
|
+
* @defaultValue `false`
|
|
84
|
+
*/
|
|
85
|
+
required?: boolean | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Sequential focus index of the native control.
|
|
88
|
+
*/
|
|
89
|
+
tabIndex?: number | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Handle a change of the checked state requested by the user.
|
|
92
|
+
*
|
|
93
|
+
* Runs for controlled and uncontrolled checkboxes, with the requested checked state. A
|
|
94
|
+
* controlled checkbox accepts the request only when the parent updates {@link
|
|
95
|
+
* CheckboxProps.checked | `checked`}. Distinct `onChange` and `onCheckedChange` callbacks run
|
|
96
|
+
* in that order; one function supplied to both runs once.
|
|
97
|
+
*
|
|
98
|
+
* @see {@link ./base#SelectionChangeHandler}
|
|
99
|
+
*/
|
|
100
|
+
onChange?: SelectionChangeHandler | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Alias of {@link CheckboxProps.onChange | `onChange`}, matching Compose's naming.
|
|
103
|
+
*/
|
|
104
|
+
onCheckedChange?: SelectionChangeHandler | undefined;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Client controller of a {@link Checkbox}.
|
|
108
|
+
*
|
|
109
|
+
* The native checkbox owns the checked and indeterminate states of an uncontrolled checkbox. For
|
|
110
|
+
* a controlled checkbox, the controller restores the native states after each user change and
|
|
111
|
+
* form reset until the parent updates the controlling properties.
|
|
112
|
+
*/
|
|
113
|
+
export declare class CheckboxController extends InteractableController<CheckboxProps> {
|
|
114
|
+
#private;
|
|
115
|
+
/**
|
|
116
|
+
* Construct a new `CheckboxController`.
|
|
117
|
+
*
|
|
118
|
+
* @param props - component properties
|
|
119
|
+
*/
|
|
120
|
+
constructor(props: CheckboxProps);
|
|
121
|
+
/**
|
|
122
|
+
* State displayed by the native checkbox.
|
|
123
|
+
*
|
|
124
|
+
* @returns displayed state, `"unchecked"` while no native checkbox is rendered
|
|
125
|
+
*/
|
|
126
|
+
get state(): CheckboxState;
|
|
127
|
+
/**
|
|
128
|
+
* Apply local properties to component state and styling.
|
|
129
|
+
*
|
|
130
|
+
* @see {@link ../dom/client#DomController.applyComponentProps}
|
|
131
|
+
*/
|
|
132
|
+
protected applyComponentProps(): void;
|
|
133
|
+
/**
|
|
134
|
+
* Handle function element replacement before the controller reference is updated.
|
|
135
|
+
*
|
|
136
|
+
* The function-element getter still exposes the previous element during this hook.
|
|
137
|
+
*
|
|
138
|
+
* @param curr - new function element, or `null` when absent
|
|
139
|
+
* @see {@link ../dom/client#DomController.onFunctionElementChanged}
|
|
140
|
+
*/
|
|
141
|
+
protected onFunctionElementChanged(curr: FunctionElement<CheckboxProps> | null): void;
|
|
142
|
+
/**
|
|
143
|
+
* Render the component's element tree.
|
|
144
|
+
*
|
|
145
|
+
* The label slot inserts `children` without resolving it, so nested control flow updates in
|
|
146
|
+
* place.
|
|
147
|
+
*
|
|
148
|
+
* @param children - label content, possibly an accessor
|
|
149
|
+
* @param funcRef - callback receiving the native checkbox
|
|
150
|
+
* @returns rendered label element
|
|
151
|
+
* @see {@link ../dom/client#DomController.render}
|
|
152
|
+
*/
|
|
153
|
+
protected render(children: JSX.Element, funcRef?: (elem: HTMLInputElement) => void): JSX.Element;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Material 3 checkbox backed by a form-associated native checkbox.
|
|
157
|
+
*
|
|
158
|
+
* Checkboxes let users select one or more items from a list, or turn an item on or off. The
|
|
159
|
+
* checkbox is controlled when {@link CheckboxProps.checked | `checked`} is present; otherwise the
|
|
160
|
+
* native checkbox owns the checked state, starting from {@link CheckboxProps.defaultChecked |
|
|
161
|
+
* `defaultChecked`}. The indeterminate state is controlled the same way through
|
|
162
|
+
* `indeterminate` and `defaultIndeterminate`, and is exposed through the native `indeterminate`
|
|
163
|
+
* property. Children form the label; a checkbox without children needs `attr:aria-label`.
|
|
164
|
+
*
|
|
165
|
+
* # States
|
|
166
|
+
*
|
|
167
|
+
* The checkbox enters the focus, hover, and press interaction states while enabled. A pointer or
|
|
168
|
+
* keyboard activation anywhere on the label toggles the native checkbox, which covers the whole
|
|
169
|
+
* component; interactive label content, such as a link, remains clickable. Form resets restore
|
|
170
|
+
* `defaultChecked` and `defaultIndeterminate` of an uncontrolled checkbox, and the requested
|
|
171
|
+
* states of a controlled one.
|
|
172
|
+
*
|
|
173
|
+
* # Design
|
|
174
|
+
*
|
|
175
|
+
* Design is controlled through the [`cw-Checkbox`](./checkbox.yaml) component design attribute.
|
|
176
|
+
* The style element receives `cw-Checkbox-checked` or `cw-Checkbox-indeterminate` while
|
|
177
|
+
* selected, `cw-Checkbox-disabled` while disabled, `cw-Checkbox-error` while showing an error,
|
|
178
|
+
* and `cw-Checkbox-<state>` for interaction states. The 40px state layer is centered on the box
|
|
179
|
+
* at the start of the 48px target. Marks are drawn with the default spatial spring, and box
|
|
180
|
+
* colors use the default effects spring when selecting and the fast effects spring when
|
|
181
|
+
* clearing, as in Compose.
|
|
182
|
+
*
|
|
183
|
+
* # Elements
|
|
184
|
+
*
|
|
185
|
+
* | Element | Description |
|
|
186
|
+
* | --- | --- |
|
|
187
|
+
* | `label.cw-Checkbox` | Style element and label. |
|
|
188
|
+
* | `input.cw-Checkbox-input` | Function element; a native checkbox covering the label. |
|
|
189
|
+
* | `.cw-Checkbox-box` | Box containing the check and indeterminate marks. |
|
|
190
|
+
*
|
|
191
|
+
* @param props - component properties
|
|
192
|
+
* @returns rendered label element
|
|
193
|
+
*/
|
|
194
|
+
export declare const Checkbox: InteractableComponent<CheckboxProps>;
|