@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,384 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { DomComponent, DomProps, StyleElement } from "..";
|
|
3
|
+
import type { ListProps } from "./list";
|
|
4
|
+
import { DomController } from "../dom/client";
|
|
5
|
+
import { ListController } from "./list";
|
|
6
|
+
import "../container/elevation-shadow.css";
|
|
7
|
+
import "./surface.css";
|
|
8
|
+
import "./list.css";
|
|
9
|
+
/**
|
|
10
|
+
* Properties accepted by {@link ExpandedListItem}.
|
|
11
|
+
*/
|
|
12
|
+
export type ExpandedListItemProps = DomProps<HTMLLIElement, JSX.LiHTMLAttributes<HTMLLIElement>> & {
|
|
13
|
+
/**
|
|
14
|
+
* Summary headline.
|
|
15
|
+
*/
|
|
16
|
+
headline?: JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Leading content of the summary.
|
|
19
|
+
*/
|
|
20
|
+
leading?: JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* Supporting text beneath the headline.
|
|
23
|
+
*/
|
|
24
|
+
supportingText?: JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* Controlled disclosure state.
|
|
27
|
+
*/
|
|
28
|
+
open?: boolean | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Initial disclosure state of an uncontrolled item.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue `false`
|
|
33
|
+
*/
|
|
34
|
+
defaultOpen?: boolean | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Prevent disclosure changes.
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue `false`
|
|
39
|
+
*/
|
|
40
|
+
disabled?: boolean | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Notify the consumer of a disclosure change, or request it when controlled.
|
|
43
|
+
*
|
|
44
|
+
* A controlled item restores its `open` state unless the parent accepts the request.
|
|
45
|
+
* Cancelling the event does not restore an uncontrolled item.
|
|
46
|
+
*
|
|
47
|
+
* @param open - new or requested disclosure state
|
|
48
|
+
* @param event - native `toggle` event of the disclosure
|
|
49
|
+
*/
|
|
50
|
+
onOpenChange?: ((open: boolean, event: Event) => void) | undefined;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Client controller of an {@link ExpandedListItem}.
|
|
54
|
+
*
|
|
55
|
+
* The native disclosure toggles itself; the controller notifies each toggle, restores a toggle
|
|
56
|
+
* of a controlled item which the parent did not accept, and prevents toggling a disabled item.
|
|
57
|
+
*/
|
|
58
|
+
export declare class ExpandedListItemController extends DomController<ExpandedListItemProps> {
|
|
59
|
+
#private;
|
|
60
|
+
/**
|
|
61
|
+
* Construct a new `ExpandedListItemController`.
|
|
62
|
+
*
|
|
63
|
+
* @param props - component properties
|
|
64
|
+
*/
|
|
65
|
+
constructor(props: ExpandedListItemProps);
|
|
66
|
+
/**
|
|
67
|
+
* Apply local properties to component state and styling.
|
|
68
|
+
*
|
|
69
|
+
* @see {@link ../dom/client#DomController.applyComponentProps}
|
|
70
|
+
*/
|
|
71
|
+
protected applyComponentProps(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Handle style element replacement before the controller reference is updated.
|
|
74
|
+
*
|
|
75
|
+
* The style-element getter still exposes the previous element during this hook.
|
|
76
|
+
*
|
|
77
|
+
* @param curr - new style element, or `null` when absent
|
|
78
|
+
* @see {@link ../dom/client#DomController.onStyleElementChanged}
|
|
79
|
+
*/
|
|
80
|
+
protected onStyleElementChanged(curr: StyleElement | null): void;
|
|
81
|
+
/**
|
|
82
|
+
* Render the component's element tree.
|
|
83
|
+
*
|
|
84
|
+
* This renders the elements of the server rendering, with the current properties: the summary
|
|
85
|
+
* slots and the body are reactive, while attributes are static.
|
|
86
|
+
*
|
|
87
|
+
* @param children - nested component children, possibly an accessor
|
|
88
|
+
* @returns rendered component elements
|
|
89
|
+
* @see {@link ../dom/client#DomController.render}
|
|
90
|
+
*/
|
|
91
|
+
protected render(children: JSX.Element): JSX.Element;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* List item whose summary row discloses expanded content.
|
|
95
|
+
*
|
|
96
|
+
* The item is a native disclosure, with native keyboard and accessibility behavior. Its open
|
|
97
|
+
* state is controlled or uncontrolled.
|
|
98
|
+
*
|
|
99
|
+
* # Design
|
|
100
|
+
*
|
|
101
|
+
* The item follows the Material 3 expanded list tokens (`ExpandedListTokens.kt`): a rounded
|
|
102
|
+
* container, and a trailing Material Symbols `expand_more` icon whose container changes and which
|
|
103
|
+
* turns over while open. The icon is hidden from accessibility.
|
|
104
|
+
*
|
|
105
|
+
* @param props - component properties
|
|
106
|
+
* @returns rendered list item
|
|
107
|
+
*/
|
|
108
|
+
export declare const ExpandedListItem: DomComponent<ExpandedListItemProps>;
|
|
109
|
+
/**
|
|
110
|
+
* Properties accepted by {@link RevealListItem}.
|
|
111
|
+
*/
|
|
112
|
+
export type RevealListItemProps = DomProps<HTMLLIElement, JSX.LiHTMLAttributes<HTMLLIElement>> & {
|
|
113
|
+
/**
|
|
114
|
+
* Row headline.
|
|
115
|
+
*
|
|
116
|
+
* When omitted, children are the headline.
|
|
117
|
+
*/
|
|
118
|
+
headline?: JSX.Element;
|
|
119
|
+
/**
|
|
120
|
+
* Leading content of the row.
|
|
121
|
+
*/
|
|
122
|
+
leading?: JSX.Element;
|
|
123
|
+
/**
|
|
124
|
+
* Supporting text beneath the headline.
|
|
125
|
+
*/
|
|
126
|
+
supportingText?: JSX.Element;
|
|
127
|
+
/**
|
|
128
|
+
* Native buttons or links revealed beside the row.
|
|
129
|
+
*/
|
|
130
|
+
actions?: JSX.Element;
|
|
131
|
+
/**
|
|
132
|
+
* Controlled visibility of the actions.
|
|
133
|
+
*/
|
|
134
|
+
expanded?: boolean | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Initial visibility of the actions of an uncontrolled item.
|
|
137
|
+
*
|
|
138
|
+
* @defaultValue `false`
|
|
139
|
+
*/
|
|
140
|
+
defaultExpanded?: boolean | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* Prevent revealing and hiding the actions.
|
|
143
|
+
*
|
|
144
|
+
* @defaultValue `false`
|
|
145
|
+
*/
|
|
146
|
+
disabled?: boolean | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Accessible name of the toggle button while the actions are hidden.
|
|
149
|
+
*
|
|
150
|
+
* @defaultValue `"Show actions"`
|
|
151
|
+
*/
|
|
152
|
+
revealLabel?: string | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* Accessible name of the toggle button while the actions are revealed.
|
|
155
|
+
*
|
|
156
|
+
* @defaultValue `"Hide actions"`
|
|
157
|
+
*/
|
|
158
|
+
hideLabel?: string | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Notify the consumer of a request to reveal or hide the actions.
|
|
161
|
+
*
|
|
162
|
+
* Update a controlled `expanded` to accept the request. An uncontrolled item updates after
|
|
163
|
+
* the callback; cancelling the event does not veto the update.
|
|
164
|
+
*
|
|
165
|
+
* @param expanded - requested visibility of the actions
|
|
166
|
+
* @param event - toggle button click, Escape key, or releasing pointer event
|
|
167
|
+
*/
|
|
168
|
+
onExpandedChange?: ((expanded: boolean, event: Event) => void) | undefined;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Client controller of a {@link RevealListItem}.
|
|
172
|
+
*
|
|
173
|
+
* A primary pointer moving horizontally, past {@link GESTURE_SLOP}, captures the pointer and
|
|
174
|
+
* slides the row over its actions; vertical movement first releases the gesture to native
|
|
175
|
+
* scrolling. The row moves by transforms only, along the measured width of the actions. On
|
|
176
|
+
* release, the requested state is chosen as Compose's anchored drag does, with a positional
|
|
177
|
+
* threshold of half the width, and the row settles with a spatial spring which continues the
|
|
178
|
+
* release velocity. State changes from the toggle button, the Escape key, or properties settle
|
|
179
|
+
* the same way. Pressing the row stops it where it is, so that a drag continues from there; a
|
|
180
|
+
* press which claims no drag, such as a tap or a scroll, or which is ended by disabling the item,
|
|
181
|
+
* requests no change, and the row resumes settling at the current visibility.
|
|
182
|
+
*/
|
|
183
|
+
export declare class RevealListItemController extends DomController<RevealListItemProps> {
|
|
184
|
+
#private;
|
|
185
|
+
/**
|
|
186
|
+
* Construct a new `RevealListItemController`.
|
|
187
|
+
*
|
|
188
|
+
* @param props - component properties
|
|
189
|
+
*/
|
|
190
|
+
constructor(props: RevealListItemProps);
|
|
191
|
+
/**
|
|
192
|
+
* Apply local properties to component state and styling.
|
|
193
|
+
*
|
|
194
|
+
* @see {@link ../dom/client#DomController.applyComponentProps}
|
|
195
|
+
*/
|
|
196
|
+
protected applyComponentProps(): void;
|
|
197
|
+
/**
|
|
198
|
+
* Handle style element replacement before the controller reference is updated.
|
|
199
|
+
*
|
|
200
|
+
* The style-element getter still exposes the previous element during this hook. The
|
|
201
|
+
* identifier of server-rendered actions is kept.
|
|
202
|
+
*
|
|
203
|
+
* @param curr - new style element, or `null` when absent
|
|
204
|
+
* @see {@link ../dom/client#DomController.onStyleElementChanged}
|
|
205
|
+
*/
|
|
206
|
+
protected onStyleElementChanged(curr: StyleElement | null): void;
|
|
207
|
+
/**
|
|
208
|
+
* Render the component's element tree.
|
|
209
|
+
*
|
|
210
|
+
* This renders the elements of the server rendering, with the current properties: the row
|
|
211
|
+
* slots and the actions are reactive, while attributes are static.
|
|
212
|
+
*
|
|
213
|
+
* @param children - nested component children, possibly an accessor
|
|
214
|
+
* @returns rendered component elements
|
|
215
|
+
* @see {@link ../dom/client#DomController.render}
|
|
216
|
+
*/
|
|
217
|
+
protected render(children: JSX.Element): JSX.Element;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* List item revealing secondary actions beside its row.
|
|
221
|
+
*
|
|
222
|
+
* The toggle button reveals and hides the actions, so the gesture is an enhancement: swiping
|
|
223
|
+
* the row toward the inline start reveals them, and back hides them. The Escape key hides
|
|
224
|
+
* revealed actions. Hidden actions are inert and hidden from accessibility. Visibility is
|
|
225
|
+
* controlled or uncontrolled.
|
|
226
|
+
*
|
|
227
|
+
* # States
|
|
228
|
+
*
|
|
229
|
+
* The item has the `cw-RevealListItem-expanded` class while its actions are revealed, the
|
|
230
|
+
* `cw-RevealListItem-dragging` class while dragged, and the `cw-RevealListItem-settling` class
|
|
231
|
+
* while its row settles.
|
|
232
|
+
*
|
|
233
|
+
* # Design
|
|
234
|
+
*
|
|
235
|
+
* The item follows the Material 3 reveal list tokens (`RevealListTokens.kt`). The toggle button
|
|
236
|
+
* shows the Material Symbols `arrow_forward` icon, mirrored in a right-to-left context, which turns
|
|
237
|
+
* over while the actions are revealed. The icon is hidden from accessibility; the accessible name
|
|
238
|
+
* of the button is its {@link RevealListItemProps.revealLabel | `revealLabel`} or
|
|
239
|
+
* {@link RevealListItemProps.hideLabel | `hideLabel`}.
|
|
240
|
+
*
|
|
241
|
+
* @param props - component properties
|
|
242
|
+
* @returns rendered list item
|
|
243
|
+
*/
|
|
244
|
+
export declare const RevealListItem: DomComponent<RevealListItemProps>;
|
|
245
|
+
/**
|
|
246
|
+
* Properties accepted by {@link ReorderableList}.
|
|
247
|
+
*/
|
|
248
|
+
export type ReorderableListProps = Omit<ListProps, "selectionMode"> & {
|
|
249
|
+
/**
|
|
250
|
+
* Unique values of the rows, in rendered order.
|
|
251
|
+
*
|
|
252
|
+
* Render keyed {@link ./list#ListItem | list items} with these values.
|
|
253
|
+
*/
|
|
254
|
+
values: readonly string[];
|
|
255
|
+
/**
|
|
256
|
+
* Request an order of the rows, including the restoration of a cancelled move.
|
|
257
|
+
*
|
|
258
|
+
* The list is controlled: update `values` and the keyed rows to accept the order.
|
|
259
|
+
*
|
|
260
|
+
* @param values - requested values, in rendered order
|
|
261
|
+
* @param event - event which moved a row or cancelled the move
|
|
262
|
+
*/
|
|
263
|
+
onReorder: (values: readonly string[], event: Event) => void;
|
|
264
|
+
/**
|
|
265
|
+
* Prevent moving rows by dragging and with the keyboard.
|
|
266
|
+
*
|
|
267
|
+
* @defaultValue `false`
|
|
268
|
+
*/
|
|
269
|
+
disabled?: boolean | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* Customize the announcements of the live status region.
|
|
272
|
+
*
|
|
273
|
+
* @param value - value of the moved row
|
|
274
|
+
* @param position - one-based position in the current `values`, or `0` if the row was removed
|
|
275
|
+
* @param total - number of rows
|
|
276
|
+
* @param moving - the row is still being moved
|
|
277
|
+
* @param cancelled - the move was cancelled, and the original order requested
|
|
278
|
+
* @returns announced text
|
|
279
|
+
*/
|
|
280
|
+
announcement?: ((value: string, position: number, total: number, moving: boolean, cancelled: boolean) => string) | undefined;
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Properties accepted by {@link ReorderHandle}.
|
|
284
|
+
*/
|
|
285
|
+
export type ReorderHandleProps = DomProps<HTMLButtonElement, JSX.ButtonHTMLAttributes<HTMLButtonElement>> & {
|
|
286
|
+
/**
|
|
287
|
+
* Accessible name, which should include the name of the row.
|
|
288
|
+
*
|
|
289
|
+
* @defaultValue `"Reorder item"`
|
|
290
|
+
*/
|
|
291
|
+
label?: string | undefined;
|
|
292
|
+
/**
|
|
293
|
+
* Disable the handle.
|
|
294
|
+
*
|
|
295
|
+
* @defaultValue `false`
|
|
296
|
+
*/
|
|
297
|
+
disabled?: boolean | undefined;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Native button moving the row of a {@link ReorderableList} it is placed in.
|
|
301
|
+
*
|
|
302
|
+
* Place the handle in the trailing slot of each row. Dragging it moves the row; Space lifts and
|
|
303
|
+
* drops the row, and while lifted, the arrow, Home, and End keys move it, and Escape cancels the
|
|
304
|
+
* move. The handle is pressed while its row is lifted.
|
|
305
|
+
*
|
|
306
|
+
* The handle shows its children, or else the Material Symbols `drag_handle` icon, which is hidden
|
|
307
|
+
* from accessibility; its accessible name is its {@link ReorderHandleProps.label | `label`}.
|
|
308
|
+
*
|
|
309
|
+
* @param props - component properties
|
|
310
|
+
* @returns rendered handle
|
|
311
|
+
*/
|
|
312
|
+
export declare const ReorderHandle: DomComponent<ReorderHandleProps>;
|
|
313
|
+
/**
|
|
314
|
+
* Client controller of a {@link ReorderableList}.
|
|
315
|
+
*
|
|
316
|
+
* Rows are moved through order requests, so Solid keeps owning the row nodes. A drag from a
|
|
317
|
+
* handle lifts its row, measures the rows once, and then follows the pointer with transforms:
|
|
318
|
+
* the rows the dragged row passes move out of the way, leaving a drop zone where it would be
|
|
319
|
+
* dropped. On release, the order is requested, and the dropped row settles into its new position
|
|
320
|
+
* with a spatial spring which continues the release velocity. Pressing a handle without dragging
|
|
321
|
+
* lifts its row for keyboard moves.
|
|
322
|
+
*/
|
|
323
|
+
export declare class ReorderableListController extends ListController {
|
|
324
|
+
#private;
|
|
325
|
+
/**
|
|
326
|
+
* Construct a new `ReorderableListController`.
|
|
327
|
+
*
|
|
328
|
+
* @param props - component properties
|
|
329
|
+
*/
|
|
330
|
+
constructor(props: ReorderableListProps);
|
|
331
|
+
/**
|
|
332
|
+
* Apply local properties to component state and styling.
|
|
333
|
+
*
|
|
334
|
+
* A lifted row which is no longer rendered, or a disabled list, ends the move.
|
|
335
|
+
*
|
|
336
|
+
* @see {@link ../dom/client#DomController.applyComponentProps}
|
|
337
|
+
*/
|
|
338
|
+
protected applyComponentProps(): void;
|
|
339
|
+
/**
|
|
340
|
+
* Handle style element replacement before the controller reference is updated.
|
|
341
|
+
*
|
|
342
|
+
* The style-element getter still exposes the previous element during this hook.
|
|
343
|
+
*
|
|
344
|
+
* @param curr - new style element, or `null` when absent
|
|
345
|
+
* @see {@link ../dom/client#DomController.onStyleElementChanged}
|
|
346
|
+
*/
|
|
347
|
+
protected onStyleElementChanged(curr: StyleElement | null): void;
|
|
348
|
+
/**
|
|
349
|
+
* Render the component's element tree.
|
|
350
|
+
*
|
|
351
|
+
* @param children - nested component children, possibly an accessor
|
|
352
|
+
* @returns rendered status region and list, the list being the style element
|
|
353
|
+
* @see {@link ../dom/client#DomController.render}
|
|
354
|
+
*/
|
|
355
|
+
protected render(children: JSX.Element): JSX.Element;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Controlled list whose rows move by dragging, with a complete keyboard alternative.
|
|
359
|
+
*
|
|
360
|
+
* Render keyed {@link ./list#ListItem | list items} from {@link ReorderableListProps.values |
|
|
361
|
+
* `values`}, each with a {@link ReorderHandle} in its trailing slot, and accept requested orders
|
|
362
|
+
* in {@link ReorderableListProps.onReorder | `onReorder`}. The list never reparents the rows
|
|
363
|
+
* itself. Space on a handle lifts and drops its row; the arrow, Home, and End keys request moves,
|
|
364
|
+
* and Escape requests the original order. A live status region, rendered before the list,
|
|
365
|
+
* announces positions.
|
|
366
|
+
*
|
|
367
|
+
* # States
|
|
368
|
+
*
|
|
369
|
+
* The lifted row has the `cw-ReorderableList-moving` class and is styled as dragged, and its
|
|
370
|
+
* handle is pressed. While dragged, the list has the `cw-ReorderableList-dragging` class, and the
|
|
371
|
+
* rows the dragged row passes have the `cw-ReorderableList-shiftedUp` or
|
|
372
|
+
* `cw-ReorderableList-shiftedDown` class. A dropped row has the `cw-ReorderableList-settling`
|
|
373
|
+
* class while it settles.
|
|
374
|
+
*
|
|
375
|
+
* # Design
|
|
376
|
+
*
|
|
377
|
+
* The dragged row follows the Material 3 reorder list tokens (`ReorderListTokens.kt`) and the
|
|
378
|
+
* dragged list item tokens (`ListTokens.kt`), through the [`cw-Surface`](./surface.yaml)
|
|
379
|
+
* `listItemDragged*` and `listItemDropZoneColor` roles.
|
|
380
|
+
*
|
|
381
|
+
* @param props - component properties
|
|
382
|
+
* @returns rendered status region and list
|
|
383
|
+
*/
|
|
384
|
+
export declare const ReorderableList: DomComponent<ReorderableListProps>;
|