@xds/react 0.0.0-stage → 0.1.0
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 +21 -0
- package/README.md +19 -2
- package/dist/Accordion.d.ts +20 -0
- package/dist/Accordion.js +39 -0
- package/dist/Avatar.d.ts +9 -0
- package/dist/Avatar.js +10 -0
- package/dist/AvatarStack.d.ts +8 -0
- package/dist/AvatarStack.js +10 -0
- package/dist/Badge.d.ts +13 -0
- package/dist/Badge.js +9 -0
- package/dist/Banner.d.ts +23 -0
- package/dist/Banner.js +10 -0
- package/dist/Button.d.ts +14 -0
- package/dist/Button.js +31 -0
- package/dist/Card.d.ts +18 -0
- package/dist/Card.js +14 -0
- package/dist/Checkbox.d.ts +10 -0
- package/dist/Checkbox.js +5 -0
- package/dist/Chip.d.ts +12 -0
- package/dist/Chip.js +7 -0
- package/dist/ChipBar.d.ts +12 -0
- package/dist/ChipBar.js +5 -0
- package/dist/CountBadge.d.ts +12 -0
- package/dist/CountBadge.js +11 -0
- package/dist/DatePicker.d.ts +20 -0
- package/dist/DatePicker.js +33 -0
- package/dist/DateRangePicker.d.ts +24 -0
- package/dist/DateRangePicker.js +48 -0
- package/dist/Defaults.d.ts +17 -0
- package/dist/Defaults.js +13 -0
- package/dist/Dialog.d.ts +20 -0
- package/dist/Dialog.js +33 -0
- package/dist/Divider.d.ts +4 -0
- package/dist/Divider.js +5 -0
- package/dist/EmptyState.d.ts +12 -0
- package/dist/EmptyState.js +6 -0
- package/dist/Icon.d.ts +9 -0
- package/dist/Icon.js +9 -0
- package/dist/IconButton.d.ts +12 -0
- package/dist/IconButton.js +24 -0
- package/dist/ListRow.d.ts +21 -0
- package/dist/ListRow.js +15 -0
- package/dist/MediaCard.d.ts +20 -0
- package/dist/MediaCard.js +17 -0
- package/dist/Menu.d.ts +18 -0
- package/dist/Menu.js +68 -0
- package/dist/ProgressBar.d.ts +8 -0
- package/dist/ProgressBar.js +6 -0
- package/dist/RadioGroup.d.ts +15 -0
- package/dist/RadioGroup.js +15 -0
- package/dist/SearchField.d.ts +15 -0
- package/dist/SearchField.js +20 -0
- package/dist/SectionHeader.d.ts +14 -0
- package/dist/SectionHeader.js +8 -0
- package/dist/SegmentedControl.d.ts +12 -0
- package/dist/SegmentedControl.js +7 -0
- package/dist/Select.d.ts +18 -0
- package/dist/Select.js +66 -0
- package/dist/Sidebar.d.ts +21 -0
- package/dist/Sidebar.js +27 -0
- package/dist/Skeleton.d.ts +11 -0
- package/dist/Skeleton.js +8 -0
- package/dist/Slider.d.ts +13 -0
- package/dist/Slider.js +44 -0
- package/dist/Spinner.d.ts +9 -0
- package/dist/Spinner.js +8 -0
- package/dist/Switch.d.ts +13 -0
- package/dist/Switch.js +5 -0
- package/dist/Tabs.d.ts +14 -0
- package/dist/Tabs.js +21 -0
- package/dist/Text.d.ts +10 -0
- package/dist/Text.js +8 -0
- package/dist/TextField.d.ts +22 -0
- package/dist/TextField.js +30 -0
- package/dist/Thumbnail.d.ts +9 -0
- package/dist/Thumbnail.js +13 -0
- package/dist/Toast.d.ts +14 -0
- package/dist/Toast.js +33 -0
- package/dist/Tooltip.d.ts +26 -0
- package/dist/Tooltip.js +32 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +39 -0
- package/dist/modal-popover.d.ts +7 -0
- package/dist/modal-popover.js +15 -0
- package/dist/picture.d.ts +11 -0
- package/dist/picture.js +21 -0
- package/dist/portal.d.ts +9 -0
- package/dist/portal.js +7 -0
- package/dist/presence.d.ts +6 -0
- package/dist/presence.js +13 -0
- package/dist/preview.d.ts +6 -0
- package/dist/preview.js +82 -0
- package/dist/root.d.ts +12 -0
- package/dist/root.js +0 -0
- package/dist/trigger.d.ts +17 -0
- package/dist/trigger.js +14 -0
- package/package.json +61 -4
- package/page.css +20 -0
- package/styles.css +3252 -0
- package/tailwind.css +2665 -0
package/dist/Slider.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SliderBaseProps } from "@xds/core";
|
|
2
|
+
import type { RootProps } from "./root.ts";
|
|
3
|
+
export type SliderProps = SliderBaseProps & RootProps & {
|
|
4
|
+
onChange: (value: number) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Picks a number in a range by dragging the thumb, or by pressing the track where it should
|
|
8
|
+
* go. The values snap to `step`.
|
|
9
|
+
*
|
|
10
|
+
* It is a slider named by its label with its value, minimum and maximum, and each arrow key
|
|
11
|
+
* moves it one step.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Slider({ label, value, onChange, min, max, step, disabled, showValue, className, style, }: SliderProps): import("react").JSX.Element;
|
package/dist/Slider.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classes, focusThumbOnPress, sliderArrowValue, sliderPageSize, sliderValueText, } from "@xds/core";
|
|
3
|
+
import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
|
|
4
|
+
import * as slider from "@zag-js/slider";
|
|
5
|
+
import { useId, useRef } from "react";
|
|
6
|
+
export function Slider({ label, value, onChange, min = 0, max = 100, step = 1, disabled = false, showValue = false, className, style, }) {
|
|
7
|
+
const pageSize = sliderPageSize({ min, max, step });
|
|
8
|
+
const service = useMachine(slider.machine, {
|
|
9
|
+
id: useId(),
|
|
10
|
+
value: [value],
|
|
11
|
+
onValueChange: (details) => onChange(details.value[0] ?? min),
|
|
12
|
+
min,
|
|
13
|
+
max,
|
|
14
|
+
step,
|
|
15
|
+
largeStep: pageSize,
|
|
16
|
+
disabled,
|
|
17
|
+
thumbAlignment: "center",
|
|
18
|
+
getAriaValueText: (details) => sliderValueText(details.value),
|
|
19
|
+
});
|
|
20
|
+
const api = slider.connect(service, normalizeProps);
|
|
21
|
+
const thumbElement = useRef(null);
|
|
22
|
+
const thumb = mergeProps(api.getThumbProps({ index: 0 }), {
|
|
23
|
+
onKeyDown: (event) => {
|
|
24
|
+
if (disabled)
|
|
25
|
+
return;
|
|
26
|
+
const next = sliderArrowValue(event, {
|
|
27
|
+
value: api.value[0] ?? min,
|
|
28
|
+
min,
|
|
29
|
+
max,
|
|
30
|
+
step,
|
|
31
|
+
pageSize,
|
|
32
|
+
});
|
|
33
|
+
if (next !== undefined)
|
|
34
|
+
api.setThumbValue(0, next);
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
const control = mergeProps(api.getControlProps(), {
|
|
38
|
+
onPointerDown: (event) => {
|
|
39
|
+
if (!disabled)
|
|
40
|
+
focusThumbOnPress(event, thumbElement.current);
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return (_jsxs("div", { ...mergeProps(api.getRootProps(), { className: classes("xds-slider", className), style }), role: "group", "aria-labelledby": api.getLabelProps().id, children: [_jsx("label", { ...api.getLabelProps(), className: "xds-slider__label", children: label }), showValue && (_jsx("output", { ...api.getValueTextProps(), "aria-live": "off", className: "xds-slider__output", children: sliderValueText(api.value[0] ?? value) })), _jsxs("div", { ...control, className: "xds-slider__control", children: [_jsx("div", { ...api.getTrackProps(), className: "xds-slider__track", children: _jsx("div", { ...api.getRangeProps(), className: "xds-slider__range" }) }), _jsx("div", { ...thumb, ref: thumbElement, className: "xds-slider__thumb", children: _jsx("input", { ...api.getHiddenInputProps({ index: 0 }) }) })] })] }));
|
|
44
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SpinnerBaseProps } from "@xds/core";
|
|
2
|
+
import type { RootProps } from "./root.ts";
|
|
3
|
+
export type SpinnerProps = SpinnerBaseProps & RootProps;
|
|
4
|
+
/**
|
|
5
|
+
* Says that something is in progress and how long is unknown. Takes the color of the text around
|
|
6
|
+
* it. With `label` it is announced; without one it is decoration next to text that already says
|
|
7
|
+
* what is happening.
|
|
8
|
+
*/
|
|
9
|
+
export declare function Spinner(props: SpinnerProps): import("react").JSX.Element;
|
package/dist/Spinner.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classes, rootPart, spinnerClass } from "@xds/core";
|
|
3
|
+
import { useDefaults } from "./Defaults.js";
|
|
4
|
+
export function Spinner(props) {
|
|
5
|
+
const defaults = useDefaults("Spinner");
|
|
6
|
+
const { size = defaults.size, label, className, style } = props;
|
|
7
|
+
return (_jsx("span", { className: classes(rootPart("Spinner"), "inline-flex shrink-0", className), style: style, ...(label ? { role: "status", "aria-label": label } : { "aria-hidden": true }), children: _jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", className: spinnerClass(size), children: [_jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "3", opacity: "0.25" }), _jsx("path", { d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" })] }) }));
|
|
8
|
+
}
|
package/dist/Switch.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SwitchBaseProps } from "@xds/core";
|
|
2
|
+
import type { RootProps } from "./root.ts";
|
|
3
|
+
export type SwitchProps = SwitchBaseProps & RootProps & {
|
|
4
|
+
onChange: (checked: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Turns a setting on or off, and takes effect at once. For a choice that is applied later,
|
|
8
|
+
* with a form, use a Checkbox.
|
|
9
|
+
*
|
|
10
|
+
* It is a native checkbox with the switch role, so the keyboard, forms and screen readers
|
|
11
|
+
* treat it as one. The input is hidden and the track is drawn beside it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Switch({ checked, onChange, label, disabled, className, style, ...aria }: SwitchProps): import("react").JSX.Element;
|
package/dist/Switch.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classes, rootPart, switchClass, switchLabelClass, switchThumbClass, switchTrackClass, } from "@xds/core";
|
|
3
|
+
export function Switch({ checked, onChange, label, disabled = false, className, style, ...aria }) {
|
|
4
|
+
return (_jsxs("label", { className: classes(rootPart("Switch"), switchClass, className), style: style, children: [_jsx("input", { ...aria, type: "checkbox", role: "switch", "aria-checked": checked, className: "peer sr-only", checked: checked, disabled: disabled, onChange: (event) => onChange(event.target.checked) }), _jsx("span", { className: switchTrackClass, children: _jsx("span", { className: switchThumbClass }) }), label && _jsx("span", { className: switchLabelClass, children: label })] }));
|
|
5
|
+
}
|
package/dist/Tabs.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type TabsBaseProps } from "@xds/core";
|
|
2
|
+
import type { RootProps } from "./root.ts";
|
|
3
|
+
export type TabsProps<Value extends string> = TabsBaseProps<Value> & RootProps & {
|
|
4
|
+
onChange: (value: Value) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Switches between views inside one screen. For two to four short modes a SegmentedControl is
|
|
8
|
+
* lighter; tabs are for more items, longer labels, or a row that may have to scroll.
|
|
9
|
+
*
|
|
10
|
+
* The selected tab is underlined as well as darker, so the choice does not depend on color.
|
|
11
|
+
* This is only the row: the app shows the view that matches `value`. The arrow keys move
|
|
12
|
+
* between tabs.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Tabs<Value extends string>({ items, value, onChange, label, fullWidth, className, style, }: TabsProps<Value>): import("react").JSX.Element;
|
package/dist/Tabs.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classes, tabStopIndex, tabsClass } from "@xds/core";
|
|
3
|
+
import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
|
|
4
|
+
import * as tabs from "@zag-js/tabs";
|
|
5
|
+
import { useId } from "react";
|
|
6
|
+
import { Icon } from "./Icon.js";
|
|
7
|
+
export function Tabs({ items, value, onChange, label, fullWidth = false, className, style, }) {
|
|
8
|
+
const service = useMachine(tabs.machine, {
|
|
9
|
+
id: useId(),
|
|
10
|
+
value,
|
|
11
|
+
onValueChange: (details) => onChange(details.value),
|
|
12
|
+
});
|
|
13
|
+
const api = tabs.connect(service, normalizeProps);
|
|
14
|
+
return (_jsx("div", { ...mergeProps(api.getRootProps(), {
|
|
15
|
+
className: classes(tabsClass(fullWidth), className),
|
|
16
|
+
style,
|
|
17
|
+
}), children: _jsxs("div", { ...api.getListProps(), "aria-label": label, className: "xds-tabs__list", children: [items.map((item) => {
|
|
18
|
+
const trigger = api.getTriggerProps({ value: item.value });
|
|
19
|
+
return (_jsxs("button", { ...trigger, tabIndex: tabStopIndex(api.focusedValue, item.value, trigger.tabIndex), "aria-controls": undefined, type: "button", className: "xds-tabs__tab", children: [item.icon && _jsx(Icon, { name: item.icon, size: "sm" }), item.label] }, item.value));
|
|
20
|
+
}), _jsx("div", { ...api.getIndicatorProps(), className: "xds-tabs__indicator" })] }) }));
|
|
21
|
+
}
|
package/dist/Text.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TextBaseProps } from "@xds/core";
|
|
2
|
+
import type { ElementType, ReactNode } from "react";
|
|
3
|
+
import type { RootProps } from "./root.ts";
|
|
4
|
+
export type { TextTone, TextVariant } from "@xds/core";
|
|
5
|
+
export type TextProps = TextBaseProps & RootProps & {
|
|
6
|
+
/** The element to render. Pick it for the document outline (`h1`, `h2`, `p`), not for looks. */
|
|
7
|
+
as?: ElementType;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare function Text(props: TextProps): import("react").JSX.Element;
|
package/dist/Text.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classes, rootPart, textClass } from "@xds/core";
|
|
3
|
+
import { useDefaults } from "./Defaults.js";
|
|
4
|
+
export function Text(props) {
|
|
5
|
+
const defaults = useDefaults("Text");
|
|
6
|
+
const { variant = defaults.variant, tone = defaults.tone, as: Element = "p", className, style, children, } = props;
|
|
7
|
+
return (_jsx(Element, { className: classes(rootPart("Text"), textClass({ variant, tone }), className), style: style, children: children }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type TextFieldBaseProps } from "@xds/core";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import type { RootProps } from "./root.ts";
|
|
4
|
+
export type TextFieldProps = TextFieldBaseProps & RootProps & {
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Inside the box, in front of the text: an icon, a unit. It takes the placeholder's color
|
|
8
|
+
* unless it sets its own.
|
|
9
|
+
*/
|
|
10
|
+
leading?: ReactNode;
|
|
11
|
+
/** Inside the box, after the text: an icon, a unit, a small button. */
|
|
12
|
+
trailing?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A labelled text field, of one line or several. The label, the description and the error
|
|
16
|
+
* message are tied to the input for assistive technology, and the error is announced when it
|
|
17
|
+
* appears.
|
|
18
|
+
*
|
|
19
|
+
* An invalid field blocks its form from being submitted, so `error` has to be cleared as soon as
|
|
20
|
+
* the person edits the value.
|
|
21
|
+
*/
|
|
22
|
+
export declare function TextField({ label, value, onChange, description, error, placeholder, leading, trailing, multiline, rows, maxLength, name, type, inputMode, autoComplete, autoFocus, required, disabled, className, style, }: TextFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classes } from "@xds/core";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
export function TextField({ label, value, onChange, description, error, placeholder, leading, trailing, multiline = false, rows = 3, maxLength, name, type = "text", inputMode, autoComplete, autoFocus = false, required = false, disabled = false, className, style, }) {
|
|
5
|
+
const id = useId();
|
|
6
|
+
const descriptionId = `${id}-description`;
|
|
7
|
+
const errorId = `${id}-error`;
|
|
8
|
+
const invalid = error !== undefined;
|
|
9
|
+
const grouped = leading != null || trailing != null;
|
|
10
|
+
const shared = {
|
|
11
|
+
id,
|
|
12
|
+
className: grouped
|
|
13
|
+
? "xds-text-field__input"
|
|
14
|
+
: "xds-text-field__input xds-text-field__control",
|
|
15
|
+
value,
|
|
16
|
+
placeholder,
|
|
17
|
+
name,
|
|
18
|
+
maxLength,
|
|
19
|
+
inputMode,
|
|
20
|
+
autoComplete,
|
|
21
|
+
autoFocus,
|
|
22
|
+
required,
|
|
23
|
+
disabled,
|
|
24
|
+
"aria-invalid": invalid || undefined,
|
|
25
|
+
"aria-errormessage": invalid ? errorId : undefined,
|
|
26
|
+
"aria-describedby": invalid ? errorId : description ? descriptionId : undefined,
|
|
27
|
+
};
|
|
28
|
+
const field = multiline ? (_jsx("textarea", { ...shared, rows: rows, onChange: (event) => onChange(event.currentTarget.value) })) : (_jsx("input", { ...shared, type: type, onChange: (event) => onChange(event.currentTarget.value) }));
|
|
29
|
+
return (_jsxs("div", { className: classes("xds-text-field", className), style: style, children: [_jsx("label", { htmlFor: id, className: "xds-text-field__label", children: label }), grouped ? (_jsxs("div", { className: "xds-text-field__control xds-text-field__group", children: [leading != null && (_jsx("span", { className: "xds-text-field__slot xds-text-field__slot--leading", children: leading })), field, trailing != null && (_jsx("span", { className: "xds-text-field__slot xds-text-field__slot--trailing", children: trailing }))] })) : (field), _jsxs("div", { className: "xds-text-field__footer", children: [!invalid && description && (_jsx("span", { id: descriptionId, className: "xds-text-field__description", children: description })), _jsx("span", { id: errorId, className: "xds-text-field__error", "aria-live": "polite", children: error }), maxLength !== undefined && (_jsxs("span", { className: "ms-auto shrink-0 text-xds-footnote text-xds-text-secondary tabular-nums", children: [value.length, "/", maxLength] }))] })] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ThumbnailBaseProps } from "@xds/core";
|
|
2
|
+
import type { RootProps } from "./root.ts";
|
|
3
|
+
export type { ThumbnailRatio } from "@xds/core";
|
|
4
|
+
export type ThumbnailProps = ThumbnailBaseProps & RootProps;
|
|
5
|
+
/**
|
|
6
|
+
* A picture in a fixed shape, for a video, an article or a product. It fills the width it is
|
|
7
|
+
* given and takes its height from `ratio`, and crops the picture to fill it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function Thumbnail(props: ThumbnailProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classes, pictureClass, rootPart, THUMBNAIL_PARTS, thumbnailBadgeClass, thumbnailClass, thumbnailWatched, } from "@xds/core";
|
|
3
|
+
import { Badge } from "./Badge.js";
|
|
4
|
+
import { useDefaults } from "./Defaults.js";
|
|
5
|
+
import { Icon } from "./Icon.js";
|
|
6
|
+
import { usePicture } from "./picture.js";
|
|
7
|
+
export function Thumbnail(props) {
|
|
8
|
+
const defaults = useDefaults("Thumbnail");
|
|
9
|
+
const { src, alt, ratio = defaults.ratio, badge, progress, className, style } = props;
|
|
10
|
+
const picture = usePicture(src);
|
|
11
|
+
const watched = thumbnailWatched(progress);
|
|
12
|
+
return (_jsxs("span", { className: classes(rootPart("Thumbnail"), thumbnailClass(ratio), className), style: style, children: [_jsxs("span", { className: THUMBNAIL_PARTS.placeholder, ...(alt ? { role: "img", "aria-label": alt } : { "aria-hidden": true }), children: [picture.loaded !== true && _jsx(Icon, { name: "image", size: "lg" }), src && picture.loaded !== false && (_jsx("img", { src: src, alt: "", "aria-hidden": "true", className: pictureClass(picture.loaded === true), ref: picture.ref, onLoad: picture.onLoad, onError: picture.onError }))] }), badge && (_jsx("span", { className: thumbnailBadgeClass(watched), children: _jsx(Badge, { tone: "overlay", children: badge }) })), watched > 0 && (_jsx("span", { "aria-hidden": "true", className: THUMBNAIL_PARTS.track, children: _jsx("span", { className: THUMBNAIL_PARTS.fill, style: { width: `${watched * 100}%` } }) }))] }));
|
|
13
|
+
}
|
package/dist/Toast.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ToastBaseProps } from "@xds/core";
|
|
2
|
+
import type { RootProps } from "./root.ts";
|
|
3
|
+
export type ToastProps = ToastBaseProps & RootProps & {
|
|
4
|
+
/** Called when the time is up and after the action. Set `open` to false in it. */
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* A short message about what just happened, which leaves on its own. It sits at the bottom
|
|
9
|
+
* center of the window, above everything else, and is announced politely without taking
|
|
10
|
+
* focus. The time does not run while the pointer is over it or focus is inside it.
|
|
11
|
+
*
|
|
12
|
+
* Do not put the only way to do something in a toast: it is gone in a few seconds.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Toast({ open, onClose, message, action, duration, className, style, }: ToastProps): import("react").JSX.Element;
|
package/dist/Toast.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { motion } from "@xds/tokens";
|
|
3
|
+
import { classes, rootPart, TOAST_PARTS } from "@xds/core";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
export function Toast({ open, onClose, message, action, duration = motion.duration.toast, className, style, }) {
|
|
6
|
+
const region = useRef(null);
|
|
7
|
+
const [hovered, setHovered] = useState(false);
|
|
8
|
+
const [focused, setFocused] = useState(false);
|
|
9
|
+
const held = hovered || focused;
|
|
10
|
+
const close = useRef(onClose);
|
|
11
|
+
close.current = onClose;
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const element = region.current;
|
|
14
|
+
if (!element?.showPopover)
|
|
15
|
+
return;
|
|
16
|
+
element.showPopover();
|
|
17
|
+
return () => element.hidePopover();
|
|
18
|
+
}, []);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!open) {
|
|
21
|
+
setHovered(false);
|
|
22
|
+
setFocused(false);
|
|
23
|
+
}
|
|
24
|
+
if (!open || held || duration <= 0)
|
|
25
|
+
return;
|
|
26
|
+
const timer = setTimeout(() => close.current(), duration);
|
|
27
|
+
return () => clearTimeout(timer);
|
|
28
|
+
}, [open, held, duration]);
|
|
29
|
+
return (_jsx("div", { ref: region, role: "status", popover: "manual", className: TOAST_PARTS.region, children: open && (_jsxs("div", { onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), onFocus: () => setFocused(true), onBlur: () => setFocused(false), className: classes(rootPart("Toast"), TOAST_PARTS.toast, className), style: style, children: [_jsx("span", { className: TOAST_PARTS.message, children: message }), action && (_jsx("button", { type: "button", onClick: () => {
|
|
30
|
+
action.onPress();
|
|
31
|
+
onClose();
|
|
32
|
+
}, className: TOAST_PARTS.action, children: action.label }))] })) }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type TooltipBaseProps } from "@xds/core";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import type { RootProps } from "./root.ts";
|
|
4
|
+
/** `className` and `style` are for the tooltip, not for the control it describes. */
|
|
5
|
+
export type TooltipProps = TooltipBaseProps & RootProps & {
|
|
6
|
+
/** The control it describes: a Button or an IconButton. */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Names a control when the pointer rests on it or the keyboard focuses it. It appears after a
|
|
11
|
+
* short wait under a pointer and at once on keyboard focus, and goes when the pointer leaves,
|
|
12
|
+
* focus leaves, or Escape is pressed.
|
|
13
|
+
*
|
|
14
|
+
* It describes the control and is not its name: an IconButton still needs its `label`. It
|
|
15
|
+
* never holds anything pressable, and touch input has no hover, so nothing may depend on it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Tooltip({ label, shortcut, placement, className, style, children, }: TooltipProps): import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* A Tooltip at the end edge of its control instead of above or below it: a collapsed Sidebar
|
|
20
|
+
* names its icons on the side of the content, where they do not cover their neighbours. Only
|
|
21
|
+
* for this package's own components: the index does not export it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function TooltipBeside({ label, children }: {
|
|
24
|
+
label: string;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}): import("react").JSX.Element;
|
package/dist/Tooltip.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { motion, space } from "@xds/tokens";
|
|
3
|
+
import { classes, tooltipEndSide } from "@xds/core";
|
|
4
|
+
import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
|
|
5
|
+
import * as tooltip from "@zag-js/tooltip";
|
|
6
|
+
import { useId, useRef } from "react";
|
|
7
|
+
import { Portal } from "./portal.js";
|
|
8
|
+
import { usePresence } from "./presence.js";
|
|
9
|
+
import { TriggerContext, useProvideTrigger } from "./trigger.js";
|
|
10
|
+
export function Tooltip({ label, shortcut, placement = "top", className, style, children, }) {
|
|
11
|
+
return (_jsx(Overlay, { label: label, shortcut: shortcut, placement: placement, className: className, style: style, children: children }));
|
|
12
|
+
}
|
|
13
|
+
export function TooltipBeside({ label, children }) {
|
|
14
|
+
return (_jsx(Overlay, { label: label, placement: tooltipEndSide(), children: children }));
|
|
15
|
+
}
|
|
16
|
+
function Overlay({ label, shortcut, placement, className, style, children, }) {
|
|
17
|
+
const service = useMachine(tooltip.machine, {
|
|
18
|
+
id: useId(),
|
|
19
|
+
openDelay: motion.duration.tooltipDelay,
|
|
20
|
+
closeDelay: 0,
|
|
21
|
+
closeOnScroll: false,
|
|
22
|
+
positioning: { placement, gutter: space[1] },
|
|
23
|
+
});
|
|
24
|
+
const api = tooltip.connect(service, normalizeProps);
|
|
25
|
+
const trigger = useProvideTrigger(api.getTriggerProps());
|
|
26
|
+
const content = useRef(null);
|
|
27
|
+
const present = usePresence(api.open, () => [content.current]);
|
|
28
|
+
return (_jsxs(_Fragment, { children: [_jsx(TriggerContext, { value: trigger, children: children }), present && (_jsx(Portal, { children: _jsx(TriggerContext, { value: null, children: _jsx("div", { ...api.getPositionerProps(), className: "xds-tooltip__positioner", children: _jsxs("div", { ...mergeProps(api.getContentProps(), {
|
|
29
|
+
className: classes("xds-tooltip", className),
|
|
30
|
+
style,
|
|
31
|
+
}), ref: content, hidden: false, children: [label, shortcut && _jsx("kbd", { className: "xds-tooltip__shortcut", children: shortcut })] }) }) }) }))] }));
|
|
32
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { Accordion, type AccordionItem, type AccordionProps } from "./Accordion.tsx";
|
|
2
|
+
export { Avatar, type AvatarProps, type AvatarSize } from "./Avatar.tsx";
|
|
3
|
+
export { AvatarStack, type AvatarStackProps } from "./AvatarStack.tsx";
|
|
4
|
+
export { Badge, type BadgeProps, type BadgeTone } from "./Badge.tsx";
|
|
5
|
+
export { Banner, type BannerProps, type BannerTone } from "./Banner.tsx";
|
|
6
|
+
export { Button, type ButtonProps, type ButtonVariant, type ControlSize } from "./Button.tsx";
|
|
7
|
+
export { Card, type CardProps } from "./Card.tsx";
|
|
8
|
+
export { Checkbox, type CheckboxProps } from "./Checkbox.tsx";
|
|
9
|
+
export { Chip, type ChipProps } from "./Chip.tsx";
|
|
10
|
+
export { ChipBar, type ChipBarProps } from "./ChipBar.tsx";
|
|
11
|
+
export { CountBadge, type CountBadgeProps } from "./CountBadge.tsx";
|
|
12
|
+
export { DatePicker, type DatePickerProps, type IsoDate } from "./DatePicker.tsx";
|
|
13
|
+
export { type DateRange, DateRangePicker, type DateRangePickerProps } from "./DateRangePicker.tsx";
|
|
14
|
+
export { type ComponentDefaults, Defaults, type DefaultsProps } from "./Defaults.tsx";
|
|
15
|
+
export { Dialog, type DialogProps } from "./Dialog.tsx";
|
|
16
|
+
export { Divider, type DividerProps } from "./Divider.tsx";
|
|
17
|
+
export { EmptyState, type EmptyStateProps } from "./EmptyState.tsx";
|
|
18
|
+
export { Icon, type IconName, type IconProps, type IconSize } from "./Icon.tsx";
|
|
19
|
+
export { IconButton, type IconButtonProps } from "./IconButton.tsx";
|
|
20
|
+
export { ListRow, type ListRowProps } from "./ListRow.tsx";
|
|
21
|
+
export { MediaCard, type MediaCardProps } from "./MediaCard.tsx";
|
|
22
|
+
export { Menu, type MenuItem, type MenuProps } from "./Menu.tsx";
|
|
23
|
+
export { ProgressBar, type ProgressBarProps } from "./ProgressBar.tsx";
|
|
24
|
+
export { RadioGroup, type RadioGroupProps, type RadioOption } from "./RadioGroup.tsx";
|
|
25
|
+
export { SearchField, type SearchFieldProps } from "./SearchField.tsx";
|
|
26
|
+
export { SectionHeader, type SectionHeaderProps } from "./SectionHeader.tsx";
|
|
27
|
+
export { SegmentedControl, type SegmentedControlProps } from "./SegmentedControl.tsx";
|
|
28
|
+
export { Select, type SelectOption, type SelectProps } from "./Select.tsx";
|
|
29
|
+
export { Sidebar, type SidebarItem, type SidebarProps, type SidebarSection } from "./Sidebar.tsx";
|
|
30
|
+
export { Skeleton, type SkeletonProps } from "./Skeleton.tsx";
|
|
31
|
+
export { Slider, type SliderProps } from "./Slider.tsx";
|
|
32
|
+
export { Spinner, type SpinnerProps } from "./Spinner.tsx";
|
|
33
|
+
export { Switch, type SwitchProps } from "./Switch.tsx";
|
|
34
|
+
export { Tabs, type TabsProps } from "./Tabs.tsx";
|
|
35
|
+
export { Text, type TextProps, type TextTone, type TextVariant } from "./Text.tsx";
|
|
36
|
+
export { TextField, type TextFieldProps } from "./TextField.tsx";
|
|
37
|
+
export { Thumbnail, type ThumbnailProps, type ThumbnailRatio } from "./Thumbnail.tsx";
|
|
38
|
+
export { Toast, type ToastProps } from "./Toast.tsx";
|
|
39
|
+
export { Tooltip, type TooltipProps } from "./Tooltip.tsx";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { Accordion } from "./Accordion.js";
|
|
2
|
+
export { Avatar } from "./Avatar.js";
|
|
3
|
+
export { AvatarStack } from "./AvatarStack.js";
|
|
4
|
+
export { Badge } from "./Badge.js";
|
|
5
|
+
export { Banner } from "./Banner.js";
|
|
6
|
+
export { Button } from "./Button.js";
|
|
7
|
+
export { Card } from "./Card.js";
|
|
8
|
+
export { Checkbox } from "./Checkbox.js";
|
|
9
|
+
export { Chip } from "./Chip.js";
|
|
10
|
+
export { ChipBar } from "./ChipBar.js";
|
|
11
|
+
export { CountBadge } from "./CountBadge.js";
|
|
12
|
+
export { DatePicker } from "./DatePicker.js";
|
|
13
|
+
export { DateRangePicker } from "./DateRangePicker.js";
|
|
14
|
+
export { Defaults } from "./Defaults.js";
|
|
15
|
+
export { Dialog } from "./Dialog.js";
|
|
16
|
+
export { Divider } from "./Divider.js";
|
|
17
|
+
export { EmptyState } from "./EmptyState.js";
|
|
18
|
+
export { Icon } from "./Icon.js";
|
|
19
|
+
export { IconButton } from "./IconButton.js";
|
|
20
|
+
export { ListRow } from "./ListRow.js";
|
|
21
|
+
export { MediaCard } from "./MediaCard.js";
|
|
22
|
+
export { Menu } from "./Menu.js";
|
|
23
|
+
export { ProgressBar } from "./ProgressBar.js";
|
|
24
|
+
export { RadioGroup } from "./RadioGroup.js";
|
|
25
|
+
export { SearchField } from "./SearchField.js";
|
|
26
|
+
export { SectionHeader } from "./SectionHeader.js";
|
|
27
|
+
export { SegmentedControl } from "./SegmentedControl.js";
|
|
28
|
+
export { Select } from "./Select.js";
|
|
29
|
+
export { Sidebar } from "./Sidebar.js";
|
|
30
|
+
export { Skeleton } from "./Skeleton.js";
|
|
31
|
+
export { Slider } from "./Slider.js";
|
|
32
|
+
export { Spinner } from "./Spinner.js";
|
|
33
|
+
export { Switch } from "./Switch.js";
|
|
34
|
+
export { Tabs } from "./Tabs.js";
|
|
35
|
+
export { Text } from "./Text.js";
|
|
36
|
+
export { TextField } from "./TextField.js";
|
|
37
|
+
export { Thumbnail } from "./Thumbnail.js";
|
|
38
|
+
export { Toast } from "./Toast.js";
|
|
39
|
+
export { Tooltip } from "./Tooltip.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Makes an open Menu or Select list modal while `open` is true: the rest of the page is hidden
|
|
3
|
+
* from assistive technology, so a screen reader's cursor stays in the popup, where the focus is
|
|
4
|
+
* held too, and the page does not scroll. The popup's underlay keeps the pointer off the page.
|
|
5
|
+
* Zag does all of this around a dialog, but not around a menu or a select.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useModalPopover(open: boolean, popup: () => HTMLElement | null): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ariaHidden } from "@zag-js/aria-hidden";
|
|
2
|
+
import { preventBodyScroll } from "@zag-js/remove-scroll";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
export function useModalPopover(open, popup) {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
if (!open)
|
|
7
|
+
return;
|
|
8
|
+
const unlock = preventBodyScroll(document);
|
|
9
|
+
const reveal = ariaHidden(() => [popup()], { defer: true });
|
|
10
|
+
return () => {
|
|
11
|
+
reveal();
|
|
12
|
+
unlock();
|
|
13
|
+
};
|
|
14
|
+
}, [open]);
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Follows the loading of the picture at `src`. `loaded` is undefined while it loads, then true
|
|
3
|
+
* or false. The result is remembered with the address it belongs to, so a new `src` starts
|
|
4
|
+
* over without an effect. Pass the rest to the `<img>`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePicture(src: string | undefined): {
|
|
7
|
+
loaded: boolean | undefined;
|
|
8
|
+
ref: (image: HTMLImageElement | null) => void;
|
|
9
|
+
onLoad: () => void;
|
|
10
|
+
onError: () => void;
|
|
11
|
+
};
|
package/dist/picture.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
export function usePicture(src) {
|
|
3
|
+
const [picture, setPicture] = useState();
|
|
4
|
+
const loaded = picture !== undefined && picture.src === src ? picture.loaded : undefined;
|
|
5
|
+
return {
|
|
6
|
+
loaded,
|
|
7
|
+
ref: (image) => {
|
|
8
|
+
if (src && image?.complete && image.naturalWidth > 0 && loaded === undefined) {
|
|
9
|
+
setPicture({ src, loaded: true });
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
onLoad: () => {
|
|
13
|
+
if (src)
|
|
14
|
+
setPicture({ src, loaded: true });
|
|
15
|
+
},
|
|
16
|
+
onError: () => {
|
|
17
|
+
if (src)
|
|
18
|
+
setPicture({ src, loaded: false });
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
package/dist/portal.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Renders `children` at the end of the body, where an overlay is above the page. A page
|
|
4
|
+
* rendered by a server has no body to render into, and the render that hydrates it must match
|
|
5
|
+
* the server's, so there the overlay comes in the render after.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Portal({ children }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react").ReactPortal | null;
|
package/dist/portal.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
const subscribe = () => () => { };
|
|
4
|
+
export function Portal({ children }) {
|
|
5
|
+
const client = useSyncExternalStore(subscribe, () => true, () => false);
|
|
6
|
+
return client ? createPortal(children, document.body) : null;
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether an overlay is on the page: from when it opens until the exit animation that its
|
|
3
|
+
* stylesheet starts on `[data-state="closed"]` has finished. Zag hides a closed part at once.
|
|
4
|
+
* `parts` returns the elements that animate; it is read once the closed state is rendered.
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePresence(open: boolean, parts: () => readonly (Element | null | undefined)[]): boolean;
|
package/dist/presence.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { afterAnimations } from "@xds/core";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
export function usePresence(open, parts) {
|
|
4
|
+
const [exited, setExited] = useState(!open);
|
|
5
|
+
if (open && exited)
|
|
6
|
+
setExited(false);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (open)
|
|
9
|
+
return;
|
|
10
|
+
return afterAnimations(parts(), () => setExited(true));
|
|
11
|
+
}, [open]);
|
|
12
|
+
return open || !exited;
|
|
13
|
+
}
|
package/dist/preview.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { isNode, resolve, } from "@xds/core/preview";
|
|
2
|
+
import { createElement, Fragment, useEffect, useState, } from "react";
|
|
3
|
+
import { Accordion, Avatar, AvatarStack, Badge, Banner, Button, Card, Checkbox, Chip, ChipBar, CountBadge, DatePicker, DateRangePicker, Defaults, Dialog, Divider, EmptyState, Icon, IconButton, ListRow, MediaCard, Menu, ProgressBar, RadioGroup, SearchField, SectionHeader, SegmentedControl, Select, Sidebar, Skeleton, Slider, Spinner, Switch, Tabs, Text, TextField, Thumbnail, Toast, Tooltip, } from "./index.js";
|
|
4
|
+
export { designPreview } from "@xds/core/preview";
|
|
5
|
+
const COMPONENTS = {
|
|
6
|
+
Accordion,
|
|
7
|
+
Avatar,
|
|
8
|
+
AvatarStack,
|
|
9
|
+
Badge,
|
|
10
|
+
Banner,
|
|
11
|
+
Button,
|
|
12
|
+
Card,
|
|
13
|
+
Checkbox,
|
|
14
|
+
Chip,
|
|
15
|
+
ChipBar,
|
|
16
|
+
CountBadge,
|
|
17
|
+
DatePicker,
|
|
18
|
+
DateRangePicker,
|
|
19
|
+
Defaults,
|
|
20
|
+
Dialog,
|
|
21
|
+
Divider,
|
|
22
|
+
EmptyState,
|
|
23
|
+
Icon,
|
|
24
|
+
IconButton,
|
|
25
|
+
ListRow,
|
|
26
|
+
MediaCard,
|
|
27
|
+
Menu,
|
|
28
|
+
ProgressBar,
|
|
29
|
+
RadioGroup,
|
|
30
|
+
SearchField,
|
|
31
|
+
SectionHeader,
|
|
32
|
+
SegmentedControl,
|
|
33
|
+
Select,
|
|
34
|
+
Sidebar,
|
|
35
|
+
Skeleton,
|
|
36
|
+
Slider,
|
|
37
|
+
Spinner,
|
|
38
|
+
Switch,
|
|
39
|
+
Tabs,
|
|
40
|
+
Text,
|
|
41
|
+
TextField,
|
|
42
|
+
Thumbnail,
|
|
43
|
+
Toast,
|
|
44
|
+
Tooltip,
|
|
45
|
+
};
|
|
46
|
+
const _lacking = {};
|
|
47
|
+
const camel = (name) => name.startsWith("--")
|
|
48
|
+
? name
|
|
49
|
+
: name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
50
|
+
export function Preview({ screen }) {
|
|
51
|
+
const [state, setState] = useState(screen.state);
|
|
52
|
+
useEffect(() => screen.mount?.(), [screen]);
|
|
53
|
+
const host = {
|
|
54
|
+
state,
|
|
55
|
+
set: (patch) => setState((current) => ({ ...current, ...patch })),
|
|
56
|
+
draw: (slot) => {
|
|
57
|
+
if (Array.isArray(slot))
|
|
58
|
+
return createElement(Fragment, null, ...slot.map(host.draw));
|
|
59
|
+
if (typeof slot === "function")
|
|
60
|
+
return slot(state);
|
|
61
|
+
if (!isNode(slot))
|
|
62
|
+
return slot;
|
|
63
|
+
if (slot.kind === "show")
|
|
64
|
+
return host.draw(slot.when(state) ? slot.children : slot.fallback);
|
|
65
|
+
const props = {};
|
|
66
|
+
for (const [key, value] of Object.entries(slot.props)) {
|
|
67
|
+
if (key === "class")
|
|
68
|
+
props.className = resolve(value, key, host);
|
|
69
|
+
else if (key === "style") {
|
|
70
|
+
props.style = Object.fromEntries(Object.entries(value).map(([name, css]) => [camel(name), css]));
|
|
71
|
+
}
|
|
72
|
+
else
|
|
73
|
+
props[key] = resolve(value, key, host);
|
|
74
|
+
}
|
|
75
|
+
const type = slot.kind === "element"
|
|
76
|
+
? slot.tag
|
|
77
|
+
: COMPONENTS[slot.name];
|
|
78
|
+
return createElement(type, props, ...slot.children.map(host.draw));
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
return host.draw(screen.root);
|
|
82
|
+
}
|