@phreshos/react-ui 0.1.36 → 0.1.38
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/README.md +147 -167
- package/dist/accordion.d.ts +7 -6
- package/dist/accordion.js +5 -5
- package/dist/alert-dialog.d.ts +2 -2
- package/dist/alert-dialog.js +3 -1
- package/dist/alert.d.ts +17 -0
- package/dist/alert.js +30 -0
- package/dist/app-layout.d.ts +13 -0
- package/dist/app-layout.js +84 -0
- package/dist/button.d.ts +31 -27
- package/dist/button.js +48 -40
- package/dist/calendar-layout.d.ts +9 -5
- package/dist/calendar-layout.js +67 -78
- package/dist/calendar-trigger.d.ts +4 -4
- package/dist/calendar-trigger.js +7 -29
- package/dist/calendar.d.ts +2 -2
- package/dist/calendar.js +6 -5
- package/dist/checkbox.d.ts +4 -4
- package/dist/checkbox.js +16 -6
- package/dist/color-area.d.ts +20 -0
- package/dist/color-area.js +30 -0
- package/dist/color-field.d.ts +17 -0
- package/dist/color-field.js +17 -0
- package/dist/color-picker.d.ts +24 -0
- package/dist/color-picker.js +30 -0
- package/dist/color-slider.d.ts +19 -0
- package/dist/color-slider.js +29 -0
- package/dist/color-swatch-picker.d.ts +23 -0
- package/dist/color-swatch-picker.js +36 -0
- package/dist/color-swatch.d.ts +18 -0
- package/dist/color-swatch.js +20 -0
- package/dist/combo-box.d.ts +18 -10
- package/dist/combo-box.js +43 -58
- package/dist/context-menu.d.ts +14 -10
- package/dist/context-menu.js +7 -6
- package/dist/control/color-thumb.d.ts +13 -0
- package/dist/control/color-thumb.js +33 -0
- package/dist/control/color-value.d.ts +6 -0
- package/dist/control/color-value.js +7 -0
- package/dist/control/control.d.ts +60 -0
- package/dist/control/control.js +71 -0
- package/dist/control/field-button.d.ts +13 -0
- package/dist/control/field-button.js +28 -0
- package/dist/control/field.d.ts +20 -0
- package/dist/control/field.js +34 -0
- package/dist/control/icon.d.ts +11 -0
- package/dist/control/icon.js +8 -0
- package/dist/control/item.d.ts +37 -0
- package/dist/control/item.js +57 -0
- package/dist/control/open-state.d.ts +25 -0
- package/dist/control/open-state.js +8 -0
- package/dist/control/selection-track.d.ts +39 -0
- package/dist/control/selection-track.js +122 -0
- package/dist/control/selection.d.ts +44 -0
- package/dist/{selection.js → control/selection.js} +16 -0
- package/dist/control/surface-render.d.ts +10 -0
- package/dist/control/surface-render.js +12 -0
- package/dist/control/text-control.d.ts +32 -0
- package/dist/control/text-control.js +31 -0
- package/dist/control/toggle.d.ts +32 -0
- package/dist/control/toggle.js +80 -0
- package/dist/date-control.d.ts +9 -9
- package/dist/date-control.js +31 -34
- package/dist/date-field.d.ts +7 -6
- package/dist/date-field.js +8 -6
- package/dist/date-picker.d.ts +13 -6
- package/dist/date-picker.js +9 -6
- package/dist/date-range-picker.d.ts +15 -6
- package/dist/date-range-picker.js +12 -9
- package/dist/dialog.d.ts +29 -15
- package/dist/dialog.js +37 -28
- package/dist/disclosure.d.ts +8 -7
- package/dist/disclosure.js +31 -52
- package/dist/drop-zone.d.ts +18 -0
- package/dist/drop-zone.js +32 -0
- package/dist/dropdown-menu.d.ts +11 -8
- package/dist/dropdown-menu.js +5 -4
- package/dist/fieldset.d.ts +13 -0
- package/dist/fieldset.js +26 -0
- package/dist/file-trigger.d.ts +13 -0
- package/dist/file-trigger.js +6 -0
- package/dist/flex.d.ts +1 -1
- package/dist/flex.js +5 -4
- package/dist/foundation/appearance.d.ts +83 -0
- package/dist/foundation/appearance.js +38 -0
- package/dist/{aria-direction.js → foundation/aria-direction.js} +3 -1
- package/dist/foundation/color.d.ts +61 -0
- package/dist/foundation/color.js +247 -0
- package/dist/{layout.d.ts → foundation/layout.d.ts} +6 -4
- package/dist/{layout.js → foundation/layout.js} +7 -5
- package/dist/foundation/motion-style.d.ts +9 -0
- package/dist/foundation/motion-style.js +50 -0
- package/dist/foundation/preferences.d.ts +15 -0
- package/dist/{ui-provider.d.ts → foundation/provider.d.ts} +9 -5
- package/dist/{ui-provider.js → foundation/provider.js} +18 -27
- package/dist/{radius.d.ts → foundation/radius.d.ts} +6 -3
- package/dist/foundation/radius.js +11 -0
- package/dist/foundation/spacing.d.ts +11 -0
- package/dist/foundation/spacing.js +4 -0
- package/dist/foundation/visual.d.ts +42 -0
- package/dist/{appearance-context.js → foundation/visual.js} +41 -27
- package/dist/grid.d.ts +1 -1
- package/dist/grid.js +5 -4
- package/dist/icons/main.d.ts +5 -3
- package/dist/icons/main.js +5 -3
- package/dist/input.d.ts +2 -2
- package/dist/input.js +9 -7
- package/dist/list-box.d.ts +24 -19
- package/dist/list-box.js +52 -109
- package/dist/main.d.ts +28 -17
- package/dist/main.js +22 -9
- package/dist/menu.d.ts +28 -32
- package/dist/menu.js +47 -93
- package/dist/number-field.d.ts +17 -0
- package/dist/number-field.js +28 -0
- package/dist/panel.d.ts +10 -5
- package/dist/panel.js +33 -12
- package/dist/popover.d.ts +26 -12
- package/dist/popover.js +22 -15
- package/dist/progress-bar.d.ts +8 -10
- package/dist/progress-bar.js +18 -34
- package/dist/radio.d.ts +15 -12
- package/dist/radio.js +27 -37
- package/dist/range-calendar.d.ts +5 -3
- package/dist/range-calendar.js +8 -7
- package/dist/scroll-area.d.ts +2 -2
- package/dist/scroll-area.js +10 -9
- package/dist/segmented-control.d.ts +23 -0
- package/dist/segmented-control.js +38 -0
- package/dist/select.d.ts +40 -13
- package/dist/select.js +63 -18
- package/dist/slider.d.ts +7 -3
- package/dist/slider.js +51 -50
- package/dist/spinner.d.ts +5 -8
- package/dist/spinner.js +12 -27
- package/dist/surface/grain.d.ts +12 -0
- package/dist/surface/grain.js +65 -0
- package/dist/{material-options.d.ts → surface/material-options.d.ts} +1 -2
- package/dist/{material-options.js → surface/material-options.js} +2 -2
- package/dist/surface/paint-class.d.ts +13 -0
- package/dist/surface/paint-class.js +47 -0
- package/dist/{shadow-options.d.ts → surface/shadow-options.d.ts} +13 -1
- package/dist/{shadow-options.js → surface/shadow-options.js} +17 -2
- package/dist/surface/surface.d.ts +80 -0
- package/dist/surface/surface.js +239 -0
- package/dist/switch.d.ts +4 -5
- package/dist/switch.js +17 -8
- package/dist/table.d.ts +29 -32
- package/dist/table.js +68 -106
- package/dist/tabs.d.ts +16 -15
- package/dist/tabs.js +44 -86
- package/dist/textarea.d.ts +2 -2
- package/dist/textarea.js +10 -14
- package/dist/time-field.d.ts +6 -6
- package/dist/time-field.js +8 -6
- package/dist/toolbar.d.ts +6 -4
- package/dist/toolbar.js +16 -15
- package/dist/tooltip.d.ts +17 -8
- package/dist/tooltip.js +17 -15
- package/dist/tree.d.ts +22 -27
- package/dist/tree.js +54 -99
- package/dist/window.d.ts +4 -4
- package/dist/window.js +18 -20
- package/package.json +3 -3
- package/dist/appearance-context.d.ts +0 -54
- package/dist/appearance.d.ts +0 -11
- package/dist/appearance.js +0 -11
- package/dist/color.d.ts +0 -69
- package/dist/color.js +0 -192
- package/dist/control-surface.d.ts +0 -20
- package/dist/control-surface.js +0 -11
- package/dist/control.d.ts +0 -70
- package/dist/control.js +0 -105
- package/dist/field-style.d.ts +0 -3
- package/dist/field-style.js +0 -12
- package/dist/material-paint.d.ts +0 -13
- package/dist/material-paint.js +0 -119
- package/dist/motion-style.d.ts +0 -13
- package/dist/motion-style.js +0 -75
- package/dist/preferences.d.ts +0 -12
- package/dist/radius.js +0 -11
- package/dist/readiness.d.ts +0 -37
- package/dist/readiness.js +0 -134
- package/dist/selection.d.ts +0 -18
- package/dist/spacing.d.ts +0 -8
- package/dist/spacing.js +0 -8
- package/dist/surface-edge.d.ts +0 -11
- package/dist/surface-edge.js +0 -55
- package/dist/surface.d.ts +0 -27
- package/dist/surface.js +0 -92
- package/dist/text-control.d.ts +0 -10
- package/dist/text-control.js +0 -0
- package/dist/toggle-indicator.d.ts +0 -18
- package/dist/toggle-indicator.js +0 -49
- /package/dist/{aria-direction.d.ts → foundation/aria-direction.d.ts} +0 -0
- /package/dist/{direction.d.ts → foundation/direction.d.ts} +0 -0
- /package/dist/{direction.js → foundation/direction.js} +0 -0
- /package/dist/{overlay-placement.d.ts → foundation/overlay-placement.d.ts} +0 -0
- /package/dist/{overlay-placement.js → foundation/overlay-placement.js} +0 -0
- /package/dist/{preferences.js → foundation/preferences.js} +0 -0
- /package/dist/{scale.d.ts → foundation/scale.d.ts} +0 -0
- /package/dist/{scale.js → foundation/scale.js} +0 -0
package/dist/tabs.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement, RefAttributes } from "react";
|
|
2
2
|
import type { TabListProps as AriaTabListProps, TabPanelProps as AriaTabPanelProps, TabPanelsProps as AriaTabPanelsProps, TabProps as AriaTabProps, TabsProps as AriaTabsProps } from "react-aria-components";
|
|
3
|
-
import type
|
|
4
|
-
import type { RadiusProps } from "./radius.js";
|
|
5
|
-
import type { ScaleLevel } from "./scale.js";
|
|
6
|
-
|
|
3
|
+
import { type Color } from "./foundation/color.js";
|
|
4
|
+
import type { RadiusProps } from "./foundation/radius.js";
|
|
5
|
+
import type { ScaleLevel } from "./foundation/scale.js";
|
|
6
|
+
import type { MaterialOverrides } from "./surface/material-options.js";
|
|
7
|
+
export interface TabsRootProps extends Omit<AriaTabsProps, "className" | "defaultSelectedKey" | "disabledKeys" | "isDisabled" | "onSelectionChange" | "selectedKey" | "style">, RadiusProps, MaterialOverrides {
|
|
7
8
|
readonly className?: string;
|
|
8
|
-
|
|
9
|
+
/** Paint of the raised selection. */
|
|
10
|
+
readonly color?: Color;
|
|
9
11
|
readonly defaultValue?: string;
|
|
10
12
|
readonly disabled?: boolean;
|
|
11
13
|
readonly onChange?: (value: string) => void;
|
|
@@ -13,29 +15,28 @@ export interface TabsRootProps extends Omit<AriaTabsProps, "className" | "defaul
|
|
|
13
15
|
readonly style?: CSSProperties;
|
|
14
16
|
readonly value?: string;
|
|
15
17
|
}
|
|
16
|
-
export declare const TabsRoot: import("react").ForwardRefExoticComponent<TabsRootProps & RefAttributes<HTMLDivElement>>;
|
|
17
18
|
export interface TabsListProps<T extends object = object> extends Omit<AriaTabListProps<T>, "className" | "style"> {
|
|
18
19
|
readonly className?: string;
|
|
19
20
|
readonly style?: CSSProperties;
|
|
20
21
|
}
|
|
21
22
|
export type TabsListComponent = <T extends object = object>(properties: TabsListProps<T> & RefAttributes<HTMLDivElement>) => ReactElement | null;
|
|
22
|
-
export
|
|
23
|
-
|
|
23
|
+
export interface TabsTabProps extends Omit<AriaTabProps, "className" | "id" | "isDisabled" | "render" | "style"> {
|
|
24
|
+
/** Identity shared with the corresponding Panel. */
|
|
25
|
+
readonly id: string;
|
|
24
26
|
readonly className?: string;
|
|
25
27
|
readonly disabled?: boolean;
|
|
26
|
-
readonly id: string;
|
|
27
28
|
readonly style?: CSSProperties;
|
|
28
29
|
}
|
|
29
|
-
export declare const TabsTab: import("react").ForwardRefExoticComponent<TabsTabProps & RefAttributes<HTMLDivElement>>;
|
|
30
30
|
export type TabsPanelsProps<T extends object = object> = AriaTabPanelsProps<T>;
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
readonly className?: string;
|
|
31
|
+
export interface TabsPanelProps extends Omit<AriaTabPanelProps, "className" | "id" | "style" | "shouldForceMount"> {
|
|
32
|
+
/** Identity shared with the corresponding Tab. */
|
|
34
33
|
readonly id: string;
|
|
34
|
+
readonly className?: string;
|
|
35
|
+
/** Whether the Panel stays mounted while another Tab is selected. */
|
|
36
|
+
readonly forceMount?: boolean;
|
|
35
37
|
readonly style?: CSSProperties;
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
/** Peer views with one selected tab and one corresponding panel. */
|
|
39
|
+
/** Peer views with one selected Tab and one corresponding Panel. */
|
|
39
40
|
export declare const Tabs: import("react").ForwardRefExoticComponent<TabsRootProps & RefAttributes<HTMLDivElement>> & {
|
|
40
41
|
List: TabsListComponent;
|
|
41
42
|
Tab: import("react").ForwardRefExoticComponent<TabsTabProps & RefAttributes<HTMLDivElement>>;
|
package/dist/tabs.js
CHANGED
|
@@ -1,103 +1,61 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { createContext, forwardRef, useContext,
|
|
3
|
-
import { Tab as AriaTab, TabList as AriaTabList, TabPanel as AriaTabPanel, TabPanels as AriaTabPanels, Tabs as AriaTabs } from "react-aria-components";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, forwardRef, useContext, useMemo } from "react";
|
|
3
|
+
import { Tab as AriaTab, TabList as AriaTabList, TabPanel as AriaTabPanel, TabPanels as AriaTabPanels, Tabs as AriaTabs, TabListStateContext } from "react-aria-components";
|
|
4
|
+
import { useControlMetrics } from "./control/control.js";
|
|
5
|
+
import { SelectionItemLabel, selectionItemStyle, selectionListStyle, SelectionTrack } from "./control/selection-track.js";
|
|
6
|
+
import { stringKey } from "./control/selection.js";
|
|
7
|
+
import { AriaDirectionBoundary } from "./foundation/aria-direction.js";
|
|
8
|
+
import { colorOpacity } from "./foundation/color.js";
|
|
9
|
+
import { resolveDirection, useDirection } from "./foundation/direction.js";
|
|
10
|
+
import { dimmedClass } from "./surface/surface.js";
|
|
11
|
+
const TabsStyleContext = createContext(null);
|
|
12
|
+
/** Peer views with one selected Tab and its corresponding Panel. */
|
|
13
|
+
const TabsRoot = forwardRef(function Tabs({ className, color = "default", defaultValue, disabled = false, onChange, orientation = "horizontal", material, radius, size, style, value, ...properties }, ref) {
|
|
14
|
+
const metrics = useControlMetrics(size, radius);
|
|
15
|
+
const context = useMemo(() => ({ color, material, metrics, orientation }), [color, material, metrics, orientation]);
|
|
15
16
|
const direction = resolveDirection(properties.dir, useDirection());
|
|
16
|
-
return _jsx(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
return _jsx(TabsStyleContext.Provider, { value: context, children: _jsx(AriaDirectionBoundary, { direction: direction, children: _jsx(AriaTabs, { ...properties, ...(value !== undefined ? { selectedKey: value } : {}), ...(defaultValue !== undefined ? { defaultSelectedKey: defaultValue } : {}), ref: ref, dir: direction, className: className, isDisabled: disabled, orientation: orientation, onSelectionChange: key => onChange?.(stringKey(key)), style: {
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection: orientation === "horizontal" ? "column" : "row",
|
|
20
|
+
alignItems: "stretch",
|
|
21
|
+
gap: metrics.gap,
|
|
22
|
+
minWidth: 0,
|
|
23
|
+
fontFamily: "inherit",
|
|
24
|
+
fontSize: metrics.fontSize,
|
|
25
|
+
...style
|
|
26
|
+
} }) }) });
|
|
26
27
|
});
|
|
28
|
+
/** The Tabs sit in a SelectionTrack; the selection slides to the selected Tab. */
|
|
27
29
|
const TabsListImplementation = forwardRef(function TabsList({ className, style, ...properties }, ref) {
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
gridAutoFlow: orientation === "horizontal" ? "column" : "row",
|
|
32
|
-
gridAutoColumns: orientation === "horizontal" ? "minmax(0, 1fr)" : undefined,
|
|
33
|
-
alignContent: "start",
|
|
34
|
-
alignItems: "stretch",
|
|
35
|
-
gap: Math.max(2, theme.gap / 2),
|
|
36
|
-
minWidth: 0,
|
|
37
|
-
width: orientation === "horizontal" ? "100%" : undefined,
|
|
38
|
-
boxSizing: "border-box",
|
|
39
|
-
padding: Math.max(2, theme.gap / 2),
|
|
40
|
-
borderRadius: theme.radius,
|
|
41
|
-
background: theme.paints.palette.rest.background,
|
|
42
|
-
...style
|
|
43
|
-
} });
|
|
30
|
+
const { color, material, metrics, orientation } = useTabsStyle();
|
|
31
|
+
const selectedKey = useContext(TabListStateContext)?.selectedKey;
|
|
32
|
+
return _jsx(SelectionTrack, { metrics: metrics, color: color, material: material, orientation: orientation, selectedKey: selectedKey, className: className, style: style, children: _jsx(AriaTabList, { ...properties, ref: ref, "data-selection-list": "", style: selectionListStyle(orientation) }) });
|
|
44
33
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return _jsx(AriaTab, { ...properties, ref: ref, className: className, isDisabled: disabled, style: state => ({
|
|
49
|
-
...theme.transition,
|
|
50
|
-
position: "relative",
|
|
51
|
-
zIndex: 0,
|
|
52
|
-
display: "flex",
|
|
53
|
-
alignItems: "center",
|
|
54
|
-
justifyContent: "center",
|
|
55
|
-
width: "100%",
|
|
56
|
-
minWidth: 0,
|
|
57
|
-
minHeight: theme.height,
|
|
58
|
-
paddingBlock: 0,
|
|
59
|
-
paddingInline: Math.max(8, theme.spacing),
|
|
60
|
-
boxSizing: "border-box",
|
|
61
|
-
borderRadius: theme.radius,
|
|
62
|
-
outline: state.isFocusVisible ? `1px solid ${theme.focusColor}` : "none",
|
|
63
|
-
outlineOffset: 1,
|
|
64
|
-
cursor: disabled ? "not-allowed" : "pointer",
|
|
65
|
-
opacity: disabled ? controlOpacity.disabled : 1,
|
|
66
|
-
userSelect: "none",
|
|
67
|
-
background: "transparent",
|
|
68
|
-
color: theme.paints.palette.rest.color,
|
|
69
|
-
...(orientation === "vertical" ? { justifyContent: "start" } : {}),
|
|
70
|
-
...style
|
|
71
|
-
}), children: state => _jsxs(_Fragment, { children: [state.isSelected && _jsx(Surface, { as: motion.span, "data-tabs-indicator": "", "aria-hidden": "true", initial: false, layoutId: "selection", color: theme.paints.palette.hover.background, transition: theme.motionTransition, style: {
|
|
72
|
-
position: "absolute",
|
|
73
|
-
zIndex: -1,
|
|
74
|
-
inset: 0,
|
|
75
|
-
boxSizing: "border-box",
|
|
76
|
-
borderRadius: theme.radius,
|
|
77
|
-
pointerEvents: "none"
|
|
78
|
-
} }), _jsx("span", { style: { minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: typeof children === "function" ? children(state) : children })] }) });
|
|
34
|
+
const TabsTab = forwardRef(function TabsTab({ children, className, disabled = false, style, ...properties }, ref) {
|
|
35
|
+
const { color, metrics, orientation } = useTabsStyle();
|
|
36
|
+
return _jsx(AriaTab, { ...properties, ref: ref, className: state => dimmedClass(state.isDisabled, className ?? state.defaultClassName) ?? "", isDisabled: disabled, style: state => ({ ...selectionItemStyle(metrics, color, orientation, state), ...style }), children: state => _jsx(SelectionItemLabel, { metrics: metrics, emphasized: state.isSelected || state.isHovered, children: typeof children === "function" ? children(state) : children }) });
|
|
79
37
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return _jsx(AriaTabPanel, { ...properties, ref: ref, className: className, style: state => ({
|
|
38
|
+
const TabsPanel = forwardRef(function TabsPanel({ className, forceMount, style, ...properties }, ref) {
|
|
39
|
+
const { metrics, orientation } = useTabsStyle();
|
|
40
|
+
return _jsx(AriaTabPanel, { ...properties, shouldForceMount: forceMount, ref: ref, className: className, style: state => ({
|
|
84
41
|
flex: orientation === "vertical" ? "1 1 auto" : undefined,
|
|
85
42
|
minWidth: 0,
|
|
86
|
-
|
|
43
|
+
borderRadius: metrics.radius,
|
|
44
|
+
outline: `3px solid ${state.isFocusVisible ? colorOpacity(metrics.visual.colors.primary, 0.34) : "transparent"}`,
|
|
87
45
|
outlineOffset: 1,
|
|
88
46
|
...style
|
|
89
47
|
}) });
|
|
90
48
|
});
|
|
91
|
-
function
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
49
|
+
function useTabsStyle() {
|
|
50
|
+
const context = useContext(TabsStyleContext);
|
|
51
|
+
if (context == null)
|
|
94
52
|
throw new Error("Tabs parts must be used inside Tabs");
|
|
95
|
-
return
|
|
53
|
+
return context;
|
|
96
54
|
}
|
|
97
|
-
/** Peer views with one selected
|
|
55
|
+
/** Peer views with one selected Tab and one corresponding Panel. */
|
|
98
56
|
export const Tabs = Object.assign(TabsRoot, {
|
|
99
|
-
List:
|
|
57
|
+
List: TabsListImplementation,
|
|
100
58
|
Tab: TabsTab,
|
|
101
|
-
Panels:
|
|
59
|
+
Panels: AriaTabPanels,
|
|
102
60
|
Panel: TabsPanel
|
|
103
61
|
});
|
package/dist/textarea.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TextControlProps } from "./control/text-control.js";
|
|
2
2
|
export interface TextareaProps extends Omit<TextControlProps, "type" | "pattern"> {
|
|
3
3
|
readonly rows?: number;
|
|
4
4
|
}
|
|
5
|
-
/** A labeled multiline text
|
|
5
|
+
/** A labeled multiline text field, vertically resizable without escaping its width. */
|
|
6
6
|
export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
package/dist/textarea.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { TextArea as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
minHeight: theme.height,
|
|
14
|
-
paddingBlock: Math.max(6, theme.spacing / 2),
|
|
15
|
-
resize: "vertical"
|
|
16
|
-
}) }), _jsx(FieldFeedback, { theme: theme, description: description, errorMessage: errorMessage })] });
|
|
3
|
+
import { TextArea as AriaTextArea, TextField } from "react-aria-components";
|
|
4
|
+
import { useControlMetrics } from "./control/control.js";
|
|
5
|
+
import { FieldFeedback, FieldLabel, fieldStyle } from "./control/field.js";
|
|
6
|
+
import { nativeTextStyle, TextWell } from "./control/text-control.js";
|
|
7
|
+
import MotionStyle, { textControlClass } from "./foundation/motion-style.js";
|
|
8
|
+
import { dimmedClass } from "./surface/surface.js";
|
|
9
|
+
/** A labeled multiline text field, vertically resizable without escaping its width. */
|
|
10
|
+
export const Textarea = forwardRef(function Textarea({ label, description, errorMessage, disabled, readOnly, required, invalid, size, color = "background", radius, style, className, placeholder, rows = 4, material, ...properties }, ref) {
|
|
11
|
+
const metrics = useControlMetrics(size, radius);
|
|
12
|
+
return _jsxs(TextField, { ...properties, className: dimmedClass(disabled ?? false, className), isDisabled: disabled, isReadOnly: readOnly, isRequired: required, isInvalid: invalid, style: fieldStyle(metrics, style), children: [_jsx(MotionStyle, {}), _jsx(FieldLabel, { label: label }), _jsx(AriaTextArea, { ref: ref, placeholder: placeholder, rows: rows, className: textControlClass, render: (native, state) => _jsx(TextWell, { color: color, material: material, metrics: metrics, state: state, children: _jsx("textarea", { ...native }) }), style: nativeTextStyle(metrics, true) }), _jsx(FieldFeedback, { metrics: metrics, description: description, errorMessage: errorMessage })] });
|
|
17
13
|
});
|
package/dist/time-field.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { Time } from "@internationalized/date";
|
|
2
2
|
import type { TimeFieldProps as AriaTimeFieldProps } from "react-aria-components";
|
|
3
|
-
import type
|
|
4
|
-
import type { MaterialOverrides } from "./material-options.js";
|
|
5
|
-
import type { RadiusProps } from "./radius.js";
|
|
6
|
-
import type { ShadowOverrides } from "./shadow-options.js";
|
|
3
|
+
import { type ControlOverrides, type ControlProps, type FieldProps } from "./control/control.js";
|
|
4
|
+
import type { MaterialOverrides } from "./surface/material-options.js";
|
|
5
|
+
import type { RadiusProps } from "./foundation/radius.js";
|
|
7
6
|
type TimeFieldOverrides = ControlOverrides | "isReadOnly" | "value" | "defaultValue" | "onChange" | "minValue" | "maxValue" | "placeholderValue" | "granularity" | "hourCycle" | "hideTimeZone" | "shouldForceLeadingZeros";
|
|
8
|
-
export interface TimeFieldProps extends Omit<AriaTimeFieldProps<Time>, TimeFieldOverrides>, ControlProps, FieldProps, RadiusProps, MaterialOverrides
|
|
7
|
+
export interface TimeFieldProps extends Omit<AriaTimeFieldProps<Time>, TimeFieldOverrides>, ControlProps, FieldProps, RadiusProps, MaterialOverrides {
|
|
9
8
|
readonly value?: Time | null;
|
|
10
9
|
readonly defaultValue?: Time | null;
|
|
11
10
|
readonly onChange?: (value: Time | null) => void;
|
|
@@ -14,7 +13,8 @@ export interface TimeFieldProps extends Omit<AriaTimeFieldProps<Time>, TimeField
|
|
|
14
13
|
readonly placeholderValue?: Time;
|
|
15
14
|
readonly granularity?: "hour" | "minute" | "second";
|
|
16
15
|
readonly hourCycle?: 12 | 24;
|
|
17
|
-
|
|
16
|
+
/** Whether hours, days, and months always show two digits. */
|
|
17
|
+
readonly leadingZeros?: boolean;
|
|
18
18
|
readonly readOnly?: boolean;
|
|
19
19
|
}
|
|
20
20
|
/** A locale-aware time-only field whose visible clock units are independent editable segments. */
|
package/dist/time-field.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { TimeField as AriaTimeField } from "react-aria-components";
|
|
4
|
-
import { AriaDirectionBoundary } from "./aria-direction.js";
|
|
5
|
-
import {
|
|
4
|
+
import { AriaDirectionBoundary } from "./foundation/aria-direction.js";
|
|
5
|
+
import { useControlMetrics } from "./control/control.js";
|
|
6
|
+
import { FieldFeedback, FieldLabel, fieldStyle } from "./control/field.js";
|
|
6
7
|
import { DateControl } from "./date-control.js";
|
|
7
|
-
import { resolveDirection, useDirection } from "./direction.js";
|
|
8
|
+
import { resolveDirection, useDirection } from "./foundation/direction.js";
|
|
9
|
+
import { dimmedClass } from "./surface/surface.js";
|
|
8
10
|
/** A locale-aware time-only field whose visible clock units are independent editable segments. */
|
|
9
|
-
export const TimeField = forwardRef(function TimeField({ label, description, errorMessage, disabled, readOnly, required, invalid, size, color, radius, material,
|
|
10
|
-
const
|
|
11
|
+
export const TimeField = forwardRef(function TimeField({ label, description, errorMessage, disabled, readOnly, required, invalid, size, color, radius, material, style, className, leadingZeros, ...properties }, ref) {
|
|
12
|
+
const metrics = useControlMetrics(size, radius);
|
|
11
13
|
const direction = resolveDirection(properties.dir, useDirection());
|
|
12
|
-
return _jsx(AriaDirectionBoundary, { direction: direction, children: _jsx(AriaTimeField, { ...properties, ref: ref, dir: direction, className: className, isDisabled: disabled, isReadOnly: readOnly, isRequired: required, isInvalid: invalid, style: fieldStyle(
|
|
14
|
+
return _jsx(AriaDirectionBoundary, { direction: direction, children: _jsx(AriaTimeField, { ...properties, ref: ref, dir: direction, className: dimmedClass(disabled ?? false, className), isDisabled: disabled, isReadOnly: readOnly, shouldForceLeadingZeros: leadingZeros, isRequired: required, isInvalid: invalid, style: fieldStyle(metrics, style), children: state => _jsxs(_Fragment, { children: [_jsx(FieldLabel, { label: label }), _jsx(DateControl, { disabled: state.isDisabled, invalid: state.isInvalid, material: material, color: color ?? "background", metrics: metrics }), _jsx(FieldFeedback, { metrics: metrics, description: description, errorMessage: errorMessage })] }) }) });
|
|
13
15
|
});
|
package/dist/toolbar.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, CSSProperties, ReactElement } from "react";
|
|
2
2
|
import type { GroupProps as AriaGroupProps, SeparatorProps as AriaSeparatorProps } from "react-aria-components";
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
3
|
+
import { type Color } from "./foundation/color.js";
|
|
4
|
+
import type { LayoutGap } from "./foundation/layout.js";
|
|
5
5
|
type ToolbarOrientation = "horizontal" | "vertical";
|
|
6
6
|
export interface ToolbarRootProps extends Omit<ComponentPropsWithoutRef<"div">, "className" | "color" | "role" | "style"> {
|
|
7
7
|
/** Base color inherited by toolbar-owned text and separators. */
|
|
8
|
-
readonly color?:
|
|
8
|
+
readonly color?: Color;
|
|
9
9
|
/** Space between the Toolbar's direct children. */
|
|
10
10
|
readonly gap?: LayoutGap;
|
|
11
11
|
/** Axis used both for layout and arrow-key navigation. */
|
|
@@ -17,7 +17,9 @@ export interface ToolbarRootProps extends Omit<ComponentPropsWithoutRef<"div">,
|
|
|
17
17
|
}
|
|
18
18
|
/** A labelled group of controls with orientation-aware arrow-key navigation. */
|
|
19
19
|
export declare const ToolbarRoot: import("react").ForwardRefExoticComponent<ToolbarRootProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
-
export interface ToolbarGroupProps extends Omit<AriaGroupProps, "className" | "style"> {
|
|
20
|
+
export interface ToolbarGroupProps extends Omit<AriaGroupProps, "className" | "style" | "isDisabled" | "isInvalid" | "isReadOnly"> {
|
|
21
|
+
/** Whether every control in this group is disabled. */
|
|
22
|
+
readonly disabled?: boolean;
|
|
21
23
|
/** Space between the controls in this group. */
|
|
22
24
|
readonly gap?: LayoutGap;
|
|
23
25
|
/** Native class name applied without replacing the group contract. */
|
package/dist/toolbar.js
CHANGED
|
@@ -2,18 +2,18 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext, forwardRef, useContext, useMemo, useRef } from "react";
|
|
3
3
|
import { FocusScope, mergeProps, mergeRefs, useFocusManager, useToolbar } from "react-aria";
|
|
4
4
|
import { Group as AriaGroup, Separator as AriaSeparator } from "react-aria-components";
|
|
5
|
-
import {
|
|
6
|
-
import { colorOpacity, resolveColor } from "./color.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { separatorOpacity } from "./control/field.js";
|
|
6
|
+
import { colorOpacity, resolveColor } from "./foundation/color.js";
|
|
7
|
+
import { resolveDirection, useDirection } from "./foundation/direction.js";
|
|
8
|
+
import { resolveSpacing } from "./foundation/spacing.js";
|
|
9
|
+
import { useVisual } from "./foundation/visual.js";
|
|
10
10
|
const ToolbarThemeContext = createContext(null);
|
|
11
11
|
/** A labelled group of controls with orientation-aware arrow-key navigation. */
|
|
12
12
|
export const ToolbarRoot = forwardRef(function ToolbarRoot(properties, ref) {
|
|
13
13
|
return _jsx(FocusScope, { children: _jsx(ToolbarLayout, { ...properties, ref: ref }) });
|
|
14
14
|
});
|
|
15
15
|
const ToolbarLayout = forwardRef(function ToolbarLayout({ className, color, gap = "medium", orientation = "horizontal", style, ...properties }, ref) {
|
|
16
|
-
const {
|
|
16
|
+
const { spacing, colors } = useVisual();
|
|
17
17
|
const fallbackDirection = useDirection();
|
|
18
18
|
const direction = resolveDirection(properties.dir, fallbackDirection);
|
|
19
19
|
const localRef = useRef(null);
|
|
@@ -24,13 +24,14 @@ const ToolbarLayout = forwardRef(function ToolbarLayout({ className, color, gap
|
|
|
24
24
|
orientation
|
|
25
25
|
}, localRef);
|
|
26
26
|
const { onKeyDownCapture: _localeKeyDown, ...behaviorProperties } = toolbarProps;
|
|
27
|
-
const foreground = resolveColor(color ?? "foreground
|
|
27
|
+
const foreground = resolveColor(color ?? "foreground", colors);
|
|
28
28
|
const theme = useMemo(() => ({
|
|
29
|
-
gap:
|
|
30
|
-
groupGap:
|
|
29
|
+
gap: resolveSpacing(gap, spacing),
|
|
30
|
+
groupGap: resolveSpacing("small", spacing),
|
|
31
31
|
orientation,
|
|
32
|
-
separator
|
|
33
|
-
|
|
32
|
+
// A Toolbar may carry its own text color; its separator shows it like every separator.
|
|
33
|
+
separator: colorOpacity(foreground, separatorOpacity)
|
|
34
|
+
}), [spacing, foreground, gap, orientation]);
|
|
34
35
|
return _jsx(ToolbarThemeContext.Provider, { value: theme, children: _jsx("div", { ...mergeProps(properties, behaviorProperties, {
|
|
35
36
|
onKeyDownCapture: toolbarKeyDown(focusManager, orientation, direction)
|
|
36
37
|
}), ref: mergeRefs(localRef, ref), className: className, style: {
|
|
@@ -79,14 +80,14 @@ function toolbarKeyDown(focusManager, orientation, direction) {
|
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
/** A semantic group of related controls within a Toolbar. */
|
|
82
|
-
export const ToolbarGroup = forwardRef(function ToolbarGroup({ className, gap, style, ...properties }, ref) {
|
|
83
|
+
export const ToolbarGroup = forwardRef(function ToolbarGroup({ className, disabled, gap, style, ...properties }, ref) {
|
|
83
84
|
const inherited = useToolbarTheme();
|
|
84
|
-
const {
|
|
85
|
-
return _jsx(AriaGroup, { ...properties, ref: ref, className: className, style: {
|
|
85
|
+
const { spacing } = useVisual();
|
|
86
|
+
return _jsx(AriaGroup, { ...properties, isDisabled: disabled, ref: ref, className: className, style: {
|
|
86
87
|
display: "flex",
|
|
87
88
|
flexDirection: inherited.orientation === "horizontal" ? "row" : "column",
|
|
88
89
|
alignItems: inherited.orientation === "horizontal" ? "center" : "flex-start",
|
|
89
|
-
gap: gap === undefined ? inherited.groupGap :
|
|
90
|
+
gap: gap === undefined ? inherited.groupGap : resolveSpacing(gap, spacing),
|
|
90
91
|
minWidth: 0,
|
|
91
92
|
...style
|
|
92
93
|
} });
|
package/dist/tooltip.d.ts
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import type { ComponentProps, CSSProperties, ReactNode } from "react";
|
|
2
2
|
import type { TooltipProps as AriaTooltipProps, TooltipTriggerComponentProps as AriaTooltipTriggerProps } from "react-aria-components";
|
|
3
|
-
import { type
|
|
4
|
-
import { type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { type ButtonActionProps } from "./button.js";
|
|
4
|
+
import { type AriaOverlayInternals, type OverlayRootProps } from "./control/open-state.js";
|
|
5
|
+
import { type Direction } from "./foundation/direction.js";
|
|
6
|
+
import { type SurfaceOwnProps } from "./surface/surface.js";
|
|
7
|
+
export type TooltipRootProps = OverlayRootProps & Readonly<Pick<AriaTooltipTriggerProps, "delay" | "closeDelay" | "trigger">> & Readonly<{
|
|
8
|
+
/** Whether the Tooltip is prevented from opening. */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Whether pressing the trigger closes the Tooltip. Defaults to `true`. */
|
|
11
|
+
closeOnPress?: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function TooltipRoot({ children, delay, closeDelay, trigger, disabled, closeOnPress, ...state }: TooltipRootProps): import("react").JSX.Element;
|
|
14
|
+
export type TooltipTriggerProps = ButtonActionProps;
|
|
15
|
+
export declare const TooltipTrigger: import("react").ForwardRefExoticComponent<ButtonActionProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
/** The floating Surface of a Tooltip: its placement, its own Surface, and element attributes. */
|
|
17
|
+
export interface TooltipContentProps extends Omit<AriaTooltipProps, AriaOverlayInternals | "children" | "className" | "color" | "style" | "dir">, SurfaceOwnProps {
|
|
10
18
|
readonly children?: ReactNode;
|
|
11
19
|
readonly className?: string;
|
|
20
|
+
readonly dir?: Direction;
|
|
12
21
|
readonly style?: CSSProperties;
|
|
13
22
|
}
|
|
14
23
|
export declare const TooltipContent: import("react").ForwardRefExoticComponent<TooltipContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
24
|
/** A description shown from the focus and hover state of its trigger. */
|
|
16
25
|
export declare const Tooltip: typeof TooltipRoot & {
|
|
17
|
-
Trigger: import("react").ForwardRefExoticComponent<
|
|
26
|
+
Trigger: import("react").ForwardRefExoticComponent<ButtonActionProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
18
27
|
Content: import("react").ForwardRefExoticComponent<TooltipContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
28
|
};
|
|
20
29
|
export type TooltipProps = ComponentProps<typeof TooltipRoot>;
|
package/dist/tooltip.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Tooltip as AriaTooltip, TooltipTrigger as AriaTooltipTrigger } from "react-aria-components";
|
|
4
|
-
import { useResolvedAppearance } from "./appearance-context.js";
|
|
5
4
|
import { Button } from "./button.js";
|
|
6
|
-
import { controlFontSizes } from "./control.js";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
import { controlFontSizes } from "./control/control.js";
|
|
6
|
+
import { ariaOpenState } from "./control/open-state.js";
|
|
7
|
+
import { resolveDirection, useDirection } from "./foundation/direction.js";
|
|
8
|
+
import MotionStyle, { overlayMotionClass, overlayTransition } from "./foundation/motion-style.js";
|
|
9
|
+
import { resolveDirectionalPlacement } from "./foundation/overlay-placement.js";
|
|
10
|
+
import { scale } from "./foundation/scale.js";
|
|
11
|
+
import { useVisual } from "./foundation/visual.js";
|
|
12
|
+
import { floatingShadow } from "./surface/shadow-options.js";
|
|
13
|
+
import { Surface } from "./surface/surface.js";
|
|
14
|
+
export function TooltipRoot({ children, delay, closeDelay, trigger, disabled, closeOnPress, ...state }) {
|
|
15
|
+
return _jsx(AriaTooltipTrigger, { ...ariaOpenState(state), delay: delay, closeDelay: closeDelay, trigger: trigger, isDisabled: disabled, shouldCloseOnPress: closeOnPress, children: children });
|
|
14
16
|
}
|
|
15
17
|
export const TooltipTrigger = forwardRef(function TooltipTrigger(properties, ref) {
|
|
16
18
|
return _jsx(Button, { ...properties, ref: ref });
|
|
17
19
|
});
|
|
18
|
-
export const TooltipContent = forwardRef(function TooltipContent({ children, className, color, material, radius, shadow, style, offset, placement = "top", ...
|
|
19
|
-
const
|
|
20
|
-
const inset = scale(
|
|
21
|
-
const transition = overlayTransition(
|
|
22
|
-
const direction = resolveDirection(
|
|
23
|
-
return _jsxs(_Fragment, { children: [_jsx(MotionStyle, {}), _jsx(AriaTooltip, { ...
|
|
20
|
+
export const TooltipContent = forwardRef(function TooltipContent({ children, className, color, material, radius, shadow, style, offset, placement = "top", dir, ...attributes }, ref) {
|
|
21
|
+
const visual = useVisual();
|
|
22
|
+
const inset = scale(visual.spacing, "small");
|
|
23
|
+
const transition = overlayTransition(visual);
|
|
24
|
+
const direction = resolveDirection(dir, useDirection());
|
|
25
|
+
return _jsxs(_Fragment, { children: [_jsx(MotionStyle, {}), _jsx(AriaTooltip, { ...attributes, ref: ref, dir: direction, offset: offset ?? inset, placement: resolveDirectionalPlacement(placement, direction), className: overlayMotionClass, style: transition, children: _jsx(Surface, { dir: direction, className: className, color: color ?? "foreground", material: material, radius: radius, shadow: shadow ?? floatingShadow(visual.shadow), style: {
|
|
24
26
|
boxSizing: "border-box",
|
|
25
27
|
maxWidth: "28em",
|
|
26
28
|
paddingBlock: inset,
|
package/dist/tree.d.ts
CHANGED
|
@@ -1,52 +1,47 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement, RefAttributes } from "react";
|
|
2
2
|
import { Collection as AriaCollection } from "react-aria-components";
|
|
3
3
|
import type { CollectionProps as AriaCollectionProps, TreeItemContentProps as AriaTreeItemContentProps, TreeItemProps as AriaTreeItemProps, TreeProps as AriaTreeProps } from "react-aria-components";
|
|
4
|
-
import type
|
|
5
|
-
import type
|
|
6
|
-
import type {
|
|
7
|
-
import
|
|
8
|
-
type TreeRootBaseProps<T extends object> = Omit<AriaTreeProps<T>, "className" | "defaultExpandedKeys" | "defaultSelectedKeys" | "disabledKeys" | "expandedKeys" | "onAction" | "onExpandedChange" | "onSelectionChange" | "selectedKeys" | "selectionMode" | "style"> & RadiusProps & Readonly<{
|
|
4
|
+
import { type MultipleSelectionProps, type MultipleStringSelection, type NoSelectionProps, type SingleSelectionProps } from "./control/selection.js";
|
|
5
|
+
import { type Color } from "./foundation/color.js";
|
|
6
|
+
import type { RadiusProps } from "./foundation/radius.js";
|
|
7
|
+
import type { ScaleLevel } from "./foundation/scale.js";
|
|
8
|
+
type TreeRootBaseProps<T extends object> = Omit<AriaTreeProps<T>, "className" | "defaultExpandedKeys" | "defaultSelectedKeys" | "disabledKeys" | "expandedKeys" | "onAction" | "onExpandedChange" | "onSelectionChange" | "selectedKeys" | "selectionMode" | "style" | "shouldSelectOnPressUp"> & RadiusProps & Readonly<{
|
|
9
9
|
className?: string;
|
|
10
|
-
|
|
10
|
+
/** Color laid beneath selected Items. */
|
|
11
|
+
color?: Color;
|
|
11
12
|
defaultExpanded?: readonly string[];
|
|
12
|
-
disabledValues?: readonly string[];
|
|
13
13
|
expanded?: readonly string[];
|
|
14
14
|
onExpandedChange?: (values: readonly string[]) => void;
|
|
15
|
-
|
|
15
|
+
/** Runs with the value of the Item that was activated. */
|
|
16
|
+
onAction?: (value: string) => void;
|
|
17
|
+
/** Whether an Item is selected when the press ends instead of when it starts. */
|
|
18
|
+
selectOnPressUp?: boolean;
|
|
16
19
|
size?: ScaleLevel;
|
|
17
20
|
style?: CSSProperties;
|
|
18
21
|
}>;
|
|
19
|
-
export type TreeNoSelectionProps =
|
|
20
|
-
|
|
21
|
-
value?: never;
|
|
22
|
-
defaultValue?: never;
|
|
23
|
-
onChange?: never;
|
|
24
|
-
}>;
|
|
25
|
-
export type TreeSingleSelectionProps = SingleStringSelectionProps & Readonly<{
|
|
26
|
-
selectionMode: "single";
|
|
27
|
-
}>;
|
|
22
|
+
export type TreeNoSelectionProps = NoSelectionProps;
|
|
23
|
+
export type TreeSingleSelectionProps = SingleSelectionProps;
|
|
28
24
|
export type TreeMultipleValue = MultipleStringSelection;
|
|
29
|
-
export type TreeMultipleSelectionProps =
|
|
30
|
-
selectionMode: "multiple";
|
|
31
|
-
}>;
|
|
25
|
+
export type TreeMultipleSelectionProps = MultipleSelectionProps;
|
|
32
26
|
export type TreeRootProps<T extends object = object> = TreeRootBaseProps<T> & (TreeNoSelectionProps | TreeSingleSelectionProps | TreeMultipleSelectionProps);
|
|
33
27
|
export type TreeRootComponent = <T extends object = object>(properties: TreeRootProps<T> & RefAttributes<HTMLDivElement>) => ReactElement | null;
|
|
34
|
-
export
|
|
35
|
-
|
|
28
|
+
export interface TreeItemProps<T = object> extends Omit<AriaTreeItemProps<T>, "className" | "id" | "isDisabled" | "style" | "hasChildItems" | "allowsArrowNavigation"> {
|
|
29
|
+
/** Identity of this Item within its Tree. */
|
|
30
|
+
readonly id: string;
|
|
31
|
+
/** Whether arrow keys move between cells while focus is inside this one. */
|
|
32
|
+
readonly arrowNavigation?: boolean;
|
|
33
|
+
/** Whether this Item can expand before its children have loaded. */
|
|
34
|
+
readonly expandable?: boolean;
|
|
36
35
|
readonly className?: string;
|
|
37
36
|
readonly disabled?: boolean;
|
|
38
|
-
readonly id: string;
|
|
39
37
|
readonly style?: CSSProperties;
|
|
40
38
|
}
|
|
41
39
|
export type TreeItemComponent = <T = object>(properties: TreeItemProps<T> & RefAttributes<HTMLDivElement>) => ReactElement | null;
|
|
42
|
-
export declare const TreeItem: TreeItemComponent;
|
|
43
40
|
export interface TreeContentProps extends AriaTreeItemContentProps {
|
|
44
41
|
readonly children: AriaTreeItemContentProps["children"];
|
|
45
42
|
}
|
|
46
|
-
export declare const TreeContent: import("react").ForwardRefExoticComponent<TreeContentProps & RefAttributes<Element>>;
|
|
47
43
|
export type TreeCollectionProps<T extends object = object> = AriaCollectionProps<T>;
|
|
48
|
-
|
|
49
|
-
/** Hierarchical navigation with independently controlled expansion, selection, and item actions. */
|
|
44
|
+
/** Hierarchical navigation with independently controlled expansion, selection, and actions. */
|
|
50
45
|
export declare const Tree: TreeRootComponent & {
|
|
51
46
|
Item: TreeItemComponent;
|
|
52
47
|
Content: import("react").ForwardRefExoticComponent<TreeContentProps & RefAttributes<Element>>;
|