@react-types/shared 3.0.0-nightly-641446f65-240905

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/src/index.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ export * from './dom';
14
+ export * from './inputs';
15
+ export * from './selection';
16
+ export * from './dnd';
17
+ export * from './collections';
18
+ export * from './removable';
19
+ export * from './events';
20
+ export * from './dna';
21
+ export * from './style';
22
+ export * from './refs';
23
+ export * from './labelable';
24
+ export * from './orientation';
25
+ export * from './locale';
26
+ export * from './key';
@@ -0,0 +1,117 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {ReactNode} from 'react';
14
+
15
+ export type ValidationState = 'valid' | 'invalid';
16
+
17
+ export type ValidationError = string | string[];
18
+ export type ValidationErrors = Record<string, ValidationError>;
19
+ export type ValidationFunction<T> = (value: T) => ValidationError | true | null | undefined;
20
+
21
+ export interface Validation<T = unknown> {
22
+ /** Whether user input is required on the input before form submission. */
23
+ isRequired?: boolean,
24
+ /** Whether the input value is invalid. */
25
+ isInvalid?: boolean,
26
+ /** @deprecated Use `isInvalid` instead. */
27
+ validationState?: ValidationState,
28
+ /**
29
+ * Whether to use native HTML form validation to prevent form submission
30
+ * when the value is missing or invalid, or mark the field as required
31
+ * or invalid via ARIA.
32
+ * @default 'aria'
33
+ */
34
+ validationBehavior?: 'aria' | 'native',
35
+ /**
36
+ * A function that returns an error message if a given value is invalid.
37
+ * Validation errors are displayed to the user when the form is submitted
38
+ * if `validationBehavior="native"`. For realtime validation, use the `isInvalid`
39
+ * prop instead.
40
+ */
41
+ validate?: (value: T) => ValidationError | true | null | undefined
42
+ }
43
+
44
+ export interface ValidationResult {
45
+ /** Whether the input value is invalid. */
46
+ isInvalid: boolean,
47
+ /** The current error messages for the input if it is invalid, otherwise an empty array. */
48
+ validationErrors: string[],
49
+ /** The native validation details for the input. */
50
+ validationDetails: ValidityState
51
+ }
52
+
53
+ export interface SpectrumFieldValidation<T> extends Omit<Validation<T>, 'isInvalid' | 'validationState'> {
54
+ /** Whether the input should display its "valid" or "invalid" visual styling. */
55
+ validationState?: ValidationState
56
+ }
57
+
58
+ export interface InputBase {
59
+ /** Whether the input is disabled. */
60
+ isDisabled?: boolean,
61
+ /** Whether the input can be selected but not changed by the user. */
62
+ isReadOnly?: boolean
63
+ }
64
+
65
+ export interface ValueBase<T, C = T> {
66
+ /** The current value (controlled). */
67
+ value?: T,
68
+ /** The default value (uncontrolled). */
69
+ defaultValue?: T,
70
+ /** Handler that is called when the value changes. */
71
+ onChange?: (value: C) => void
72
+ }
73
+
74
+ export interface TextInputBase {
75
+ /** Temporary text that occupies the text input when it is empty. */
76
+ placeholder?: string
77
+ }
78
+
79
+ export interface SpectrumTextInputBase {
80
+ /**
81
+ * Temporary text that occupies the text input when it is empty.
82
+ * Please use help text instead.
83
+ * @deprecated
84
+ **/
85
+ placeholder?: string
86
+ }
87
+
88
+ export interface RangeValue<T> {
89
+ /** The start value of the range. */
90
+ start: T,
91
+ /** The end value of the range. */
92
+ end: T
93
+ }
94
+
95
+ export interface RangeInputBase<T> {
96
+ /** The smallest value allowed for the input. */
97
+ minValue?: T,
98
+ /** The largest value allowed for the input. */
99
+ maxValue?: T,
100
+ /** The amount that the input value changes with each increment or decrement "tick". */
101
+ step?: T // ??
102
+ }
103
+
104
+ export interface HelpTextProps {
105
+ /** A description for the field. Provides a hint such as specific requirements for what to choose. */
106
+ description?: ReactNode,
107
+ /** An error message for the field. */
108
+ errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode)
109
+ }
110
+
111
+ // Spectrum specific types. Extends `Validation` so that the `validationState` prop is available.
112
+ export interface SpectrumHelpTextProps extends HelpTextProps {
113
+ /** Whether the description is displayed with lighter text. */
114
+ isDisabled?: boolean,
115
+ /** Whether an error icon is rendered. */
116
+ showErrorIcon?: boolean
117
+ }
package/src/key.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Copyright 2023 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ export type Key = string | number;
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {ReactNode} from 'react';
14
+
15
+ export type LabelPosition = 'top' | 'side';
16
+ export type Alignment = 'start' | 'end';
17
+ export type NecessityIndicator = 'icon' | 'label';
18
+
19
+ export interface LabelableProps {
20
+ /** The content to display as the label. */
21
+ label?: ReactNode
22
+ }
23
+
24
+ export interface SpectrumLabelableProps extends LabelableProps {
25
+ /**
26
+ * The label's overall position relative to the element it is labeling.
27
+ * @default 'top'
28
+ */
29
+ labelPosition?: LabelPosition,
30
+ /**
31
+ * The label's horizontal alignment relative to the element it is labeling.
32
+ * @default 'start'
33
+ */
34
+ labelAlign?: Alignment,
35
+ /**
36
+ * Whether the required state should be shown as an icon or text.
37
+ * @default 'icon'
38
+ */
39
+ necessityIndicator?: NecessityIndicator,
40
+ /**
41
+ * Whether the label is labeling a required field or group.
42
+ */
43
+ isRequired?: boolean,
44
+ /**
45
+ * A ContextualHelp element to place next to the label.
46
+ */
47
+ contextualHelp?: ReactNode
48
+ }
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ export type Direction = 'ltr' | 'rtl';
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ export type Orientation = 'horizontal' | 'vertical';
package/src/refs.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {ReactElement, Ref, RefAttributes} from 'react';
14
+
15
+ export interface DOMRefValue<T extends HTMLElement = HTMLElement> {
16
+ UNSAFE_getDOMNode(): T
17
+ }
18
+
19
+ export interface FocusableRefValue<T extends HTMLElement = HTMLElement, D extends HTMLElement = T> extends DOMRefValue<D> {
20
+ focus(): void
21
+ }
22
+
23
+ export type DOMRef<T extends HTMLElement = HTMLElement> = Ref<DOMRefValue<T>>;
24
+ export type FocusableRef<T extends HTMLElement = HTMLElement> = Ref<FocusableRefValue<T>>;
25
+
26
+ export interface RefObject<T> {
27
+ current: T
28
+ }
29
+
30
+ // Override forwardRef types so generics work.
31
+ declare function forwardRef<T, P = {}>(
32
+ render: (props: P, ref: Ref<T>) => ReactElement | null
33
+ ): (props: P & RefAttributes<T>) => ReactElement | null;
34
+
35
+ export type forwardRefType = typeof forwardRef;
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {SyntheticEvent} from 'react';
14
+
15
+ export interface Removable<T, R> {
16
+ isRemovable?: boolean,
17
+ onRemove?: (value: T, event?: SyntheticEvent) => R
18
+ }
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {Key} from '@react-types/shared';
14
+
15
+ export interface SingleSelection {
16
+ /** Whether the collection allows empty selection. */
17
+ disallowEmptySelection?: boolean,
18
+ /** The currently selected key in the collection (controlled). */
19
+ selectedKey?: Key | null,
20
+ /** The initial selected key in the collection (uncontrolled). */
21
+ defaultSelectedKey?: Key,
22
+ /** Handler that is called when the selection changes. */
23
+ onSelectionChange?: (key: Key) => void
24
+ }
25
+
26
+ export type SelectionMode = 'none' | 'single' | 'multiple';
27
+ export type SelectionBehavior = 'toggle' | 'replace';
28
+ export type Selection = 'all' | Set<Key>;
29
+ export interface MultipleSelection {
30
+ /** The type of selection that is allowed in the collection. */
31
+ selectionMode?: SelectionMode,
32
+ /** Whether the collection allows empty selection. */
33
+ disallowEmptySelection?: boolean,
34
+ /** The currently selected keys in the collection (controlled). */
35
+ selectedKeys?: 'all' | Iterable<Key>,
36
+ /** The initial selected keys in the collection (uncontrolled). */
37
+ defaultSelectedKeys?: 'all' | Iterable<Key>,
38
+ /** Handler that is called when the selection changes. */
39
+ onSelectionChange?: (keys: Selection) => void,
40
+ /** The currently disabled keys in the collection (controlled). */
41
+ disabledKeys?: Iterable<Key>
42
+ }
43
+
44
+ export interface SpectrumSelectionProps {
45
+ /** How selection should be displayed. */
46
+ selectionStyle?: 'checkbox' | 'highlight'
47
+ }
48
+
49
+ export type FocusStrategy = 'first' | 'last';
50
+ export type DisabledBehavior = 'selection' | 'all';
package/src/style.d.ts ADDED
@@ -0,0 +1,263 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {BackgroundColorValue, BackgroundColorValueV6, BorderColorValue, BorderColorValueV6, BorderRadiusValue, BorderSizeValue, DimensionValue} from './dna';
14
+ import {CSSProperties} from 'react';
15
+
16
+ type ResponsiveProp<T> = {
17
+ base?: T,
18
+ S?: T,
19
+ M?: T,
20
+ L?: T,
21
+ [custom: string]: T | undefined
22
+ }
23
+ type Responsive<T> = T | ResponsiveProp<T>
24
+
25
+ export interface StyleProps {
26
+ // For backward compatibility!
27
+ /** Sets the CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. Only use as a **last resort**. Use style props instead. */
28
+ UNSAFE_className?: string,
29
+ /** Sets inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. Only use as a **last resort**. Use style props instead. */
30
+ UNSAFE_style?: CSSProperties,
31
+
32
+ /** The margin for all four sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin). */
33
+ margin?: Responsive<DimensionValue>,
34
+ /** The margin for the logical start side of the element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline-start). */
35
+ marginStart?: Responsive<DimensionValue>,
36
+ /** The margin for the logical end side of an element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline-end). */
37
+ marginEnd?: Responsive<DimensionValue>,
38
+ // /** The margin for the left side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left). Consider using `marginStart` instead for RTL support. */
39
+ // marginLeft?: Responsive<DimensionValue>,
40
+ // /** The margin for the right side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left). Consider using `marginEnd` instead for RTL support. */
41
+ // marginRight?: Responsive<DimensionValue>,
42
+ /** The margin for the top side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top). */
43
+ marginTop?: Responsive<DimensionValue>,
44
+ /** The margin for the bottom side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom). */
45
+ marginBottom?: Responsive<DimensionValue>,
46
+ /** The margin for both the left and right sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin). */
47
+ marginX?: Responsive<DimensionValue>,
48
+ /** The margin for both the top and bottom sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin). */
49
+ marginY?: Responsive<DimensionValue>,
50
+
51
+ /** The width of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/width). */
52
+ width?: Responsive<DimensionValue>,
53
+ /** The height of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/height). */
54
+ height?: Responsive<DimensionValue>,
55
+ /** The minimum width of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/min-width). */
56
+ minWidth?: Responsive<DimensionValue>,
57
+ /** The minimum height of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/min-height). */
58
+ minHeight?: Responsive<DimensionValue>,
59
+ /** The maximum width of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/max-width). */
60
+ maxWidth?: Responsive<DimensionValue>,
61
+ /** The maximum height of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/max-height). */
62
+ maxHeight?: Responsive<DimensionValue>,
63
+
64
+ /** When used in a flex layout, specifies how the element will grow or shrink to fit the space available. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex). */
65
+ flex?: Responsive<string | number | boolean>,
66
+ /** When used in a flex layout, specifies how the element will grow to fit the space available. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow). */
67
+ flexGrow?: Responsive<number>,
68
+ /** When used in a flex layout, specifies how the element will shrink to fit the space available. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink). */
69
+ flexShrink?: Responsive<number>,
70
+ /** When used in a flex layout, specifies the initial main size of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis). */
71
+ flexBasis?: Responsive<number | string>,
72
+ /** Specifies how the element is justified inside a flex or grid container. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self). */
73
+ justifySelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'center' | 'left' | 'right' | 'stretch'>, // ...
74
+ /** Overrides the `alignItems` property of a flex or grid container. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self). */
75
+ alignSelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'center' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'stretch'>,
76
+ /** The layout order for the element within a flex or grid container. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/order). */
77
+ order?: Responsive<number>,
78
+
79
+ /** When used in a grid layout, specifies the named grid area that the element should be placed in within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area). */
80
+ gridArea?: Responsive<string>,
81
+ /** When used in a grid layout, specifies the column the element should be placed in within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column). */
82
+ gridColumn?: Responsive<string>,
83
+ /** When used in a grid layout, specifies the row the element should be placed in within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row). */
84
+ gridRow?: Responsive<string>,
85
+ /** When used in a grid layout, specifies the starting column to span within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start). */
86
+ gridColumnStart?: Responsive<string>,
87
+ /** When used in a grid layout, specifies the ending column to span within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end). */
88
+ gridColumnEnd?: Responsive<string>,
89
+ /** When used in a grid layout, specifies the starting row to span within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start). */
90
+ gridRowStart?: Responsive<string>,
91
+ /** When used in a grid layout, specifies the ending row to span within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end). */
92
+ gridRowEnd?: Responsive<string>,
93
+
94
+ /** Specifies how the element is positioned. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/position). */
95
+ position?: Responsive<'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'>,
96
+ /** The stacking order for the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/z-index). */
97
+ zIndex?: Responsive<number>,
98
+ /** The top position for the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/top). */
99
+ top?: Responsive<DimensionValue>,
100
+ /** The bottom position for the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/bottom). */
101
+ bottom?: Responsive<DimensionValue>,
102
+ /** The logical start position for the element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-start). */
103
+ start?: Responsive<DimensionValue>,
104
+ /** The logical end position for the element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-end). */
105
+ end?: Responsive<DimensionValue>,
106
+ /** The left position for the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/left). Consider using `start` instead for RTL support. */
107
+ left?: Responsive<DimensionValue>,
108
+ /** The right position for the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/right). Consider using `start` instead for RTL support. */
109
+ right?: Responsive<DimensionValue>,
110
+
111
+ /** Hides the element. */
112
+ isHidden?: Responsive<boolean>
113
+ }
114
+
115
+ export type ColorVersion = 5 | 6;
116
+ type BackgroundColor = {
117
+ 5: BackgroundColorValue,
118
+ 6: BackgroundColorValueV6
119
+ };
120
+
121
+ type BorderColor = {
122
+ 5: BorderColorValue,
123
+ 6: BorderColorValueV6
124
+ }
125
+
126
+ // These support more properties than specific Spectrum components
127
+ // but still based on spectrum global/alias variables.
128
+ export interface ViewStyleProps<C extends ColorVersion> extends StyleProps {
129
+ /**
130
+ * The Spectrum color token version number.
131
+ * @default 5
132
+ */
133
+ colorVersion?: C,
134
+
135
+ /** The background color for the element. */
136
+ backgroundColor?: Responsive<BackgroundColor[C]>,
137
+
138
+ /** The width of the element's border on all four sides. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width). */
139
+ borderWidth?: Responsive<BorderSizeValue>,
140
+ /** The width of the border on the logical start side, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start-width). */
141
+ borderStartWidth?: Responsive<BorderSizeValue>,
142
+ /** The width of the border on the logical end side, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end-width). */
143
+ borderEndWidth?: Responsive<BorderSizeValue>,
144
+ // borderLeftWidth?: BorderSizeValue,
145
+ // borderRightWidth?: BorderSizeValue,
146
+ /** The width of the top border. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-width). */
147
+ borderTopWidth?: Responsive<BorderSizeValue>,
148
+ /** The width of the bottom border. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-width). */
149
+ borderBottomWidth?: Responsive<BorderSizeValue>,
150
+ /** The width of the left and right borders. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width). */
151
+ borderXWidth?: Responsive<BorderSizeValue>,
152
+ /** The width of the top and bottom borders. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width). */
153
+ borderYWidth?: Responsive<BorderSizeValue>,
154
+
155
+ /** The color of the element's border on all four sides. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color). */
156
+ borderColor?: Responsive<BorderColor[C]>,
157
+ /** The color of the border on the logical start side, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start-color). */
158
+ borderStartColor?: Responsive<BorderColor[C]>,
159
+ /** The color of the border on the logical end side, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end-color). */
160
+ borderEndColor?: Responsive<BorderColor[C]>,
161
+ // borderLeftColor?: BorderColorValue,
162
+ // borderRightColor?: BorderColorValue,
163
+ /** The color of the top border. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-color). */
164
+ borderTopColor?: Responsive<BorderColor[C]>,
165
+ /** The color of the bottom border. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-color). */
166
+ borderBottomColor?: Responsive<BorderColor[C]>,
167
+ /** The color of the left and right borders. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color). */
168
+ borderXColor?: Responsive<BorderColor[C]>,
169
+ /** The color of the top and bottom borders. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width). */
170
+ borderYColor?: Responsive<BorderColor[C]>,
171
+
172
+ /** The border radius on all four sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius). */
173
+ borderRadius?: Responsive<BorderRadiusValue>,
174
+ /** The border radius for the top start corner of the element, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-start-start-radius). */
175
+ borderTopStartRadius?: Responsive<BorderRadiusValue>,
176
+ /** The border radius for the top end corner of the element, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-start-end-radius). */
177
+ borderTopEndRadius?: Responsive<BorderRadiusValue>,
178
+ /** The border radius for the bottom start corner of the element, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-end-start-radius). */
179
+ borderBottomStartRadius?: Responsive<BorderRadiusValue>,
180
+ /** The border radius for the bottom end corner of the element, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-end-end-radius). */
181
+ borderBottomEndRadius?: Responsive<BorderRadiusValue>,
182
+ // borderTopLeftRadius?: BorderRadiusValue,
183
+ // borderTopRightRadius?: BorderRadiusValue,
184
+ // borderBottomLeftRadius?: BorderRadiusValue,
185
+ // borderBottomRightRadius?: BorderRadiusValue,
186
+
187
+ /** The padding for all four sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding). */
188
+ padding?: Responsive<DimensionValue>,
189
+ /** The padding for the logical start side of the element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline-start). */
190
+ paddingStart?: Responsive<DimensionValue>,
191
+ /** The padding for the logical end side of an element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline-end). */
192
+ paddingEnd?: Responsive<DimensionValue>,
193
+ // paddingLeft?: Responsive<DimensionValue>,
194
+ // paddingRight?: Responsive<DimensionValue>,
195
+ /** The padding for the top side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top). */
196
+ paddingTop?: Responsive<DimensionValue>,
197
+ /** The padding for the bottom side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom). */
198
+ paddingBottom?: Responsive<DimensionValue>,
199
+ /** The padding for both the left and right sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding). */
200
+ paddingX?: Responsive<DimensionValue>,
201
+ /** The padding for both the top and bottom sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding). */
202
+ paddingY?: Responsive<DimensionValue>,
203
+
204
+ /** Species what to do when the element's content is too long to fit its size. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/overflow). */
205
+ overflow?: Responsive<string>
206
+ // ...
207
+ // shadows?
208
+ // transforms?
209
+ }
210
+
211
+ export interface BoxAlignmentStyleProps {
212
+ /**
213
+ * The distribution of space around items along the main axis. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content).
214
+ * @default 'stretch'
215
+ */
216
+ justifyContent?: Responsive<'start' | 'end' | 'center' | 'left' | 'right' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center'>,
217
+ /**
218
+ * The distribution of space around child items along the cross axis. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-content).
219
+ * @default 'start'
220
+ */
221
+ alignContent?: Responsive<'start' | 'end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center'>,
222
+ /**
223
+ * The alignment of children within their container. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items).
224
+ * @default 'stretch'
225
+ */
226
+ alignItems?: Responsive<'start' | 'end' | 'center' | 'stretch' | 'self-start' | 'self-end' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center'>,
227
+ /** The space to display between both rows and columns. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/gap). */
228
+ gap?: Responsive<DimensionValue>,
229
+ /** The space to display between columns. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap). */
230
+ columnGap?: Responsive<DimensionValue>,
231
+ /** The space to display between rows. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap). */
232
+ rowGap?: Responsive<DimensionValue>
233
+ }
234
+
235
+ export interface FlexStyleProps extends BoxAlignmentStyleProps, StyleProps {
236
+ /**
237
+ * The direction in which to layout children. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction).
238
+ * @default 'row'
239
+ */
240
+ direction?: Responsive<'row' | 'column' | 'row-reverse' | 'column-reverse'>,
241
+ /**
242
+ * Whether to wrap items onto multiple lines. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap).
243
+ * @default false
244
+ */
245
+ wrap?: Responsive<boolean | 'wrap' | 'nowrap' | 'wrap-reverse'>
246
+ }
247
+
248
+ export interface GridStyleProps extends BoxAlignmentStyleProps, StyleProps {
249
+ /** Defines named grid areas. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas). */
250
+ areas?: Responsive<string[]>,
251
+ /** Defines the sizes of each row in the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows). */
252
+ rows?: Responsive<string | DimensionValue[]>,
253
+ /** Defines the sizes of each column in the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns). */
254
+ columns?: Responsive<string | DimensionValue[]>,
255
+ /** Defines the size of implicitly generated columns. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns). */
256
+ autoColumns?: Responsive<DimensionValue>,
257
+ /** Defines the size of implicitly generated rows. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows). */
258
+ autoRows?: Responsive<DimensionValue>,
259
+ /** Controls how auto-placed items are flowed into the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow). */
260
+ autoFlow?: Responsive<'row' | 'column' | 'row dense' | 'column dense'>,
261
+ /** Defines the default `justifySelf` for all items in the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items). */
262
+ justifyItems?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'center' | 'left' | 'right' | 'stretch' | 'self-start' | 'self-end' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center' | 'legacy right' | 'legacy left' | 'legacy center'>
263
+ }