@react-spectrum/s2 3.0.0-nightly-cc08a8dbc-250210 → 3.0.0-nightly-56da82e3e-250212
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/dist/Accordion.cjs.map +1 -1
- package/dist/Accordion.css.map +1 -1
- package/dist/Accordion.mjs.map +1 -1
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/ActionMenu.cjs.map +1 -1
- package/dist/ActionMenu.mjs.map +1 -1
- package/dist/Avatar.cjs.map +1 -1
- package/dist/Avatar.css.map +1 -1
- package/dist/Avatar.mjs.map +1 -1
- package/dist/AvatarGroup.cjs.map +1 -1
- package/dist/AvatarGroup.css.map +1 -1
- package/dist/AvatarGroup.mjs.map +1 -1
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs.map +1 -1
- package/dist/ButtonGroup.css.map +1 -1
- package/dist/ButtonGroup.mjs.map +1 -1
- package/dist/CardView.cjs.map +1 -1
- package/dist/CardView.css.map +1 -1
- package/dist/CardView.mjs.map +1 -1
- package/dist/Checkbox.cjs.map +1 -1
- package/dist/Checkbox.css.map +1 -1
- package/dist/Checkbox.mjs.map +1 -1
- package/dist/CheckboxGroup.cjs.map +1 -1
- package/dist/CheckboxGroup.css.map +1 -1
- package/dist/CheckboxGroup.mjs.map +1 -1
- package/dist/CloseButton.cjs.map +1 -1
- package/dist/CloseButton.css.map +1 -1
- package/dist/CloseButton.mjs.map +1 -1
- package/dist/ColorArea.cjs.map +1 -1
- package/dist/ColorArea.css.map +1 -1
- package/dist/ColorArea.mjs.map +1 -1
- package/dist/ColorField.cjs.map +1 -1
- package/dist/ColorField.css.map +1 -1
- package/dist/ColorField.mjs.map +1 -1
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs.map +1 -1
- package/dist/ColorSwatch.css.map +1 -1
- package/dist/ColorSwatch.mjs.map +1 -1
- package/dist/ColorWheel.cjs.map +1 -1
- package/dist/ColorWheel.css.map +1 -1
- package/dist/ColorWheel.mjs.map +1 -1
- package/dist/Content.cjs.map +1 -1
- package/dist/Content.mjs.map +1 -1
- package/dist/ContextualHelp.cjs.map +1 -1
- package/dist/ContextualHelp.css.map +1 -1
- package/dist/ContextualHelp.mjs.map +1 -1
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/Divider.cjs.map +1 -1
- package/dist/Divider.css.map +1 -1
- package/dist/Divider.mjs.map +1 -1
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs.map +1 -1
- package/dist/Form.css.map +1 -1
- package/dist/Form.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs.map +1 -1
- package/dist/IllustratedMessage.css.map +1 -1
- package/dist/IllustratedMessage.mjs.map +1 -1
- package/dist/Image.cjs.map +1 -1
- package/dist/Image.css.map +1 -1
- package/dist/Image.mjs.map +1 -1
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.css.map +1 -1
- package/dist/Link.mjs.map +1 -1
- package/dist/Menu.cjs +1 -0
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +4 -0
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +1 -0
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs.map +1 -1
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs +1 -0
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +4 -0
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +1 -0
- package/dist/Picker.mjs.map +1 -1
- package/dist/ProgressBar.cjs.map +1 -1
- package/dist/ProgressBar.css.map +1 -1
- package/dist/ProgressBar.mjs.map +1 -1
- package/dist/ProgressCircle.cjs.map +1 -1
- package/dist/ProgressCircle.css.map +1 -1
- package/dist/ProgressCircle.mjs.map +1 -1
- package/dist/RadioGroup.cjs.map +1 -1
- package/dist/RadioGroup.css.map +1 -1
- package/dist/RadioGroup.mjs.map +1 -1
- package/dist/RangeSlider.cjs.map +1 -1
- package/dist/RangeSlider.mjs.map +1 -1
- package/dist/SearchField.cjs.map +1 -1
- package/dist/SearchField.css.map +1 -1
- package/dist/SearchField.mjs.map +1 -1
- package/dist/SegmentedControl.cjs.map +1 -1
- package/dist/SegmentedControl.css.map +1 -1
- package/dist/SegmentedControl.mjs.map +1 -1
- package/dist/Slider.cjs.map +1 -1
- package/dist/Slider.css.map +1 -1
- package/dist/Slider.mjs.map +1 -1
- package/dist/StatusLight.cjs.map +1 -1
- package/dist/StatusLight.css.map +1 -1
- package/dist/StatusLight.mjs.map +1 -1
- package/dist/Switch.cjs.map +1 -1
- package/dist/Switch.css.map +1 -1
- package/dist/Switch.mjs.map +1 -1
- package/dist/TableView.cjs.map +1 -1
- package/dist/TableView.css.map +1 -1
- package/dist/TableView.mjs.map +1 -1
- package/dist/Tabs.cjs +5 -17
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +4 -28
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +5 -17
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs.map +1 -1
- package/dist/ToggleButton.cjs.map +1 -1
- package/dist/ToggleButton.css.map +1 -1
- package/dist/ToggleButton.mjs.map +1 -1
- package/dist/ToggleButtonGroup.cjs.map +1 -1
- package/dist/ToggleButtonGroup.mjs.map +1 -1
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/TreeView.cjs +32 -10
- package/dist/TreeView.cjs.map +1 -1
- package/dist/TreeView.css +46 -26
- package/dist/TreeView.css.map +1 -1
- package/dist/TreeView.mjs +32 -10
- package/dist/TreeView.mjs.map +1 -1
- package/dist/types.d.ts +73 -71
- package/dist/types.d.ts.map +1 -1
- package/icons/Icon.cjs.map +1 -1
- package/icons/Icon.mjs.map +1 -1
- package/icons/Skeleton.cjs.map +1 -1
- package/icons/Skeleton.css.map +1 -1
- package/icons/Skeleton.mjs.map +1 -1
- package/package.json +21 -21
- package/src/Accordion.tsx +1 -1
- package/src/ActionButton.tsx +2 -2
- package/src/ActionMenu.tsx +1 -1
- package/src/Avatar.tsx +1 -1
- package/src/AvatarGroup.tsx +1 -1
- package/src/Breadcrumbs.tsx +4 -4
- package/src/Button.tsx +4 -4
- package/src/ButtonGroup.tsx +1 -1
- package/src/CardView.tsx +1 -1
- package/src/Checkbox.tsx +1 -1
- package/src/CheckboxGroup.tsx +2 -2
- package/src/CloseButton.tsx +1 -1
- package/src/ColorArea.tsx +1 -1
- package/src/ColorField.tsx +1 -1
- package/src/ColorSlider.tsx +1 -1
- package/src/ColorSwatch.tsx +1 -1
- package/src/ColorWheel.tsx +1 -1
- package/src/Content.tsx +7 -7
- package/src/ContextualHelp.tsx +2 -2
- package/src/Disclosure.tsx +1 -1
- package/src/Divider.tsx +1 -1
- package/src/DropZone.tsx +2 -2
- package/src/Field.tsx +1 -1
- package/src/Form.tsx +2 -2
- package/src/Icon.tsx +2 -2
- package/src/IllustratedMessage.tsx +1 -1
- package/src/Image.tsx +1 -1
- package/src/Link.tsx +2 -2
- package/src/Menu.tsx +4 -3
- package/src/Meter.tsx +1 -1
- package/src/NumberField.tsx +1 -1
- package/src/Picker.tsx +2 -1
- package/src/ProgressBar.tsx +1 -1
- package/src/ProgressCircle.tsx +1 -1
- package/src/RadioGroup.tsx +2 -2
- package/src/RangeSlider.tsx +1 -1
- package/src/SearchField.tsx +1 -1
- package/src/SegmentedControl.tsx +2 -2
- package/src/Skeleton.tsx +1 -1
- package/src/Slider.tsx +1 -1
- package/src/StatusLight.tsx +2 -2
- package/src/Switch.tsx +1 -1
- package/src/TableView.tsx +1 -1
- package/src/Tabs.tsx +16 -16
- package/src/TagGroup.tsx +2 -2
- package/src/TextField.tsx +2 -2
- package/src/ToggleButton.tsx +2 -2
- package/src/ToggleButtonGroup.tsx +1 -1
- package/src/Tooltip.tsx +3 -3
- package/src/TreeView.tsx +33 -12
package/src/ButtonGroup.tsx
CHANGED
|
@@ -57,7 +57,7 @@ interface ButtonGroupContextValue extends Partial<ButtonGroupProps> {
|
|
|
57
57
|
isHidden?: boolean
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export const ButtonGroupContext = createContext<ContextValue<ButtonGroupContextValue
|
|
60
|
+
export const ButtonGroupContext = createContext<ContextValue<Partial<ButtonGroupContextValue>, DOMRefValue<HTMLDivElement>>>({});
|
|
61
61
|
|
|
62
62
|
const buttongroup = style<ButtonGroupStyleProps>({
|
|
63
63
|
display: 'inline-flex',
|
package/src/CardView.tsx
CHANGED
|
@@ -531,7 +531,7 @@ const cardViewStyles = style({
|
|
|
531
531
|
outlineOffset: -2
|
|
532
532
|
}, getAllowedOverrides({height: true}));
|
|
533
533
|
|
|
534
|
-
export const CardViewContext = createContext<ContextValue<CardViewProps<any
|
|
534
|
+
export const CardViewContext = createContext<ContextValue<Partial<CardViewProps<any>>, DOMRefValue<HTMLDivElement>>>(null);
|
|
535
535
|
|
|
536
536
|
export const CardView = /*#__PURE__*/ (forwardRef as forwardRefType)(function CardView<T extends object>(props: CardViewProps<T>, ref: DOMRef<HTMLDivElement>) {
|
|
537
537
|
[props, ref] = useSpectrumContextProps(props, ref, CardViewContext);
|
package/src/Checkbox.tsx
CHANGED
|
@@ -41,7 +41,7 @@ export interface CheckboxProps extends Omit<AriaCheckboxProps, 'className' | 'st
|
|
|
41
41
|
children?: ReactNode
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export const CheckboxContext = createContext<ContextValue<CheckboxProps
|
|
44
|
+
export const CheckboxContext = createContext<ContextValue<Partial<CheckboxProps>, FocusableRefValue<HTMLLabelElement>>>(null);
|
|
45
45
|
|
|
46
46
|
const wrapper = style({
|
|
47
47
|
display: 'flex',
|
package/src/CheckboxGroup.tsx
CHANGED
|
@@ -41,7 +41,7 @@ export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'classN
|
|
|
41
41
|
/**
|
|
42
42
|
* The Checkboxes contained within the CheckboxGroup.
|
|
43
43
|
*/
|
|
44
|
-
children
|
|
44
|
+
children: ReactNode,
|
|
45
45
|
/**
|
|
46
46
|
* By default, checkboxes are not emphasized (gray).
|
|
47
47
|
* The emphasized (blue) version provides visual prominence.
|
|
@@ -49,7 +49,7 @@ export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'classN
|
|
|
49
49
|
isEmphasized?: boolean
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export const CheckboxGroupContext = createContext<ContextValue<CheckboxGroupProps
|
|
52
|
+
export const CheckboxGroupContext = createContext<ContextValue<Partial<CheckboxGroupProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* A CheckboxGroup allows users to select one or more items from a list of choices.
|
package/src/CloseButton.tsx
CHANGED
|
@@ -79,7 +79,7 @@ const styles = style({
|
|
|
79
79
|
}
|
|
80
80
|
}, getAllowedOverrides());
|
|
81
81
|
|
|
82
|
-
export const CloseButtonContext = createContext<ContextValue<CloseButtonProps
|
|
82
|
+
export const CloseButtonContext = createContext<ContextValue<Partial<CloseButtonProps>, FocusableRefValue<HTMLButtonElement>>>(null);
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* A CloseButton allows a user to dismiss a dialog.
|
package/src/ColorArea.tsx
CHANGED
|
@@ -25,7 +25,7 @@ import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
|
25
25
|
|
|
26
26
|
export interface ColorAreaProps extends Omit<AriaColorAreaProps, 'children' | 'className' | 'style'>, StyleProps {}
|
|
27
27
|
|
|
28
|
-
export const ColorAreaContext = createContext<ContextValue<ColorAreaProps
|
|
28
|
+
export const ColorAreaContext = createContext<ContextValue<Partial<ColorAreaProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* A ColorArea allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.
|
package/src/ColorField.tsx
CHANGED
|
@@ -34,7 +34,7 @@ export interface ColorFieldProps extends Omit<AriaColorFieldProps, 'children' |
|
|
|
34
34
|
size?: 'S' | 'M' | 'L' | 'XL'
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export const ColorFieldContext = createContext<ContextValue<ColorFieldProps
|
|
37
|
+
export const ColorFieldContext = createContext<ContextValue<Partial<ColorFieldProps>, TextFieldRef>>(null);
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* A color field allows users to edit a hex color or individual color channel value.
|
package/src/ColorSlider.tsx
CHANGED
|
@@ -31,7 +31,7 @@ export interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children'
|
|
|
31
31
|
label?: string
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export const ColorSliderContext = createContext<ContextValue<ColorSliderProps
|
|
34
|
+
export const ColorSliderContext = createContext<ContextValue<Partial<ColorSliderProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* A ColorSlider allows users to adjust an individual channel of a color value.
|
package/src/ColorSwatch.tsx
CHANGED
|
@@ -43,7 +43,7 @@ interface SpectrumColorSwatchContextValue extends Pick<ColorSwatchProps, 'size'
|
|
|
43
43
|
useWrapper: (swatch: ReactElement, color: Color, rounding: ColorSwatchProps['rounding']) => JSX.Element
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export const ColorSwatchContext = createContext<ContextValue<ColorSwatchProps
|
|
46
|
+
export const ColorSwatchContext = createContext<ContextValue<Partial<ColorSwatchProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
47
47
|
export const InternalColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(null);
|
|
48
48
|
|
|
49
49
|
/**
|
package/src/ColorWheel.tsx
CHANGED
|
@@ -31,7 +31,7 @@ export interface ColorWheelProps extends Omit<AriaColorWheelProps, 'children' |
|
|
|
31
31
|
size?: number
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export const ColorWheelContext = createContext<ContextValue<ColorWheelProps
|
|
34
|
+
export const ColorWheelContext = createContext<ContextValue<Partial<ColorWheelProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* A ColorWheel allows users to adjust the hue of an HSL or HSB color value on a circular track.
|
package/src/Content.tsx
CHANGED
|
@@ -21,7 +21,7 @@ import {useIsSkeleton, useSkeletonText} from './Skeleton';
|
|
|
21
21
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
22
22
|
|
|
23
23
|
interface ContentProps extends UnsafeStyles, SlotProps {
|
|
24
|
-
children
|
|
24
|
+
children: ReactNode,
|
|
25
25
|
styles?: StyleString,
|
|
26
26
|
isHidden?: boolean,
|
|
27
27
|
id?: string
|
|
@@ -31,7 +31,7 @@ interface HeadingProps extends ContentProps {
|
|
|
31
31
|
level?: number
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export const HeadingContext = createContext<ContextValue<HeadingProps
|
|
34
|
+
export const HeadingContext = createContext<ContextValue<Partial<HeadingProps>, DOMRefValue<HTMLHeadingElement>>>(null);
|
|
35
35
|
|
|
36
36
|
export const Heading = forwardRef(// Wrapper around RAC Heading to unmount when hidden.
|
|
37
37
|
function Heading(props: HeadingProps, ref: DOMRef<HTMLHeadingElement>) {
|
|
@@ -52,7 +52,7 @@ function Heading(props: HeadingProps, ref: DOMRef<HTMLHeadingElement>) {
|
|
|
52
52
|
);
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
export const HeaderContext = createContext<ContextValue<ContentProps
|
|
55
|
+
export const HeaderContext = createContext<ContextValue<Partial<ContentProps>, DOMRefValue<HTMLElement>>>(null);
|
|
56
56
|
|
|
57
57
|
export const Header = forwardRef(function Header(props: ContentProps, ref: DOMRef) {
|
|
58
58
|
[props, ref] = useSpectrumContextProps(props, ref, HeaderContext);
|
|
@@ -72,7 +72,7 @@ export const Header = forwardRef(function Header(props: ContentProps, ref: DOMRe
|
|
|
72
72
|
);
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
export const ContentContext = createContext<ContextValue<ContentProps
|
|
75
|
+
export const ContentContext = createContext<ContextValue<Partial<ContentProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
76
76
|
|
|
77
77
|
export const Content = forwardRef(function Content(props: ContentProps, ref: DOMRef<HTMLDivElement>) {
|
|
78
78
|
[props, ref] = useSpectrumContextProps(props, ref, ContentContext);
|
|
@@ -91,7 +91,7 @@ export const Content = forwardRef(function Content(props: ContentProps, ref: DOM
|
|
|
91
91
|
);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
-
export const TextContext = createContext<ContextValue<ContentProps
|
|
94
|
+
export const TextContext = createContext<ContextValue<Partial<ContentProps>, DOMRefValue>>(null);
|
|
95
95
|
|
|
96
96
|
export const Text = forwardRef(function Text(props: ContentProps, ref: DOMRef) {
|
|
97
97
|
[props, ref] = useSpectrumContextProps(props, ref, TextContext);
|
|
@@ -125,7 +125,7 @@ export const Text = forwardRef(function Text(props: ContentProps, ref: DOMRef) {
|
|
|
125
125
|
return text;
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
export const KeyboardContext = createContext<ContextValue<ContentProps
|
|
128
|
+
export const KeyboardContext = createContext<ContextValue<Partial<ContentProps>, DOMRefValue>>({});
|
|
129
129
|
|
|
130
130
|
export const Keyboard = forwardRef(function Keyboard(props: ContentProps, ref: DOMRef) {
|
|
131
131
|
[props, ref] = useSpectrumContextProps(props, ref, KeyboardContext);
|
|
@@ -144,7 +144,7 @@ export const Keyboard = forwardRef(function Keyboard(props: ContentProps, ref: D
|
|
|
144
144
|
);
|
|
145
145
|
});
|
|
146
146
|
|
|
147
|
-
export const FooterContext = createContext<ContextValue<ContentProps
|
|
147
|
+
export const FooterContext = createContext<ContextValue<Partial<ContentProps>, DOMRefValue>>({});
|
|
148
148
|
|
|
149
149
|
export const Footer = forwardRef(function Footer(props: ContentProps, ref: DOMRef) {
|
|
150
150
|
[props, ref] = useSpectrumContextProps(props, ref, FooterContext);
|
package/src/ContextualHelp.tsx
CHANGED
|
@@ -30,7 +30,7 @@ export interface ContextualHelpProps extends
|
|
|
30
30
|
Pick<PopoverDialogProps, 'shouldFlip' | 'offset' | 'crossOffset' | 'placement' | 'containerPadding'>,
|
|
31
31
|
ContextualHelpStyleProps, StyleProps, DOMProps, AriaLabelingProps {
|
|
32
32
|
/** Contents of the Contextual Help popover. */
|
|
33
|
-
children
|
|
33
|
+
children: ReactNode,
|
|
34
34
|
/**
|
|
35
35
|
* The size of the ActionButton.
|
|
36
36
|
*
|
|
@@ -46,7 +46,7 @@ const popover = style({
|
|
|
46
46
|
padding: 24
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
export const ContextualHelpContext = createContext<ContextValue<ContextualHelpProps
|
|
49
|
+
export const ContextualHelpContext = createContext<ContextValue<Partial<ContextualHelpProps>, FocusableRefValue<HTMLButtonElement>>>(null);
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Contextual help shows a user extra information about the state of an adjacent component, or a total view.
|
package/src/Disclosure.tsx
CHANGED
|
@@ -39,7 +39,7 @@ export interface DisclosureProps extends Omit<RACDisclosureProps, 'className' |
|
|
|
39
39
|
children: ReactNode
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export const DisclosureContext = createContext<ContextValue<
|
|
42
|
+
export const DisclosureContext = createContext<ContextValue<Partial<DisclosureProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
43
43
|
|
|
44
44
|
const disclosure = style({
|
|
45
45
|
color: 'heading',
|
package/src/Divider.tsx
CHANGED
|
@@ -40,7 +40,7 @@ interface DividerSpectrumProps {
|
|
|
40
40
|
// TODO: allow overriding height (only when orientation is vertical)??
|
|
41
41
|
export interface DividerProps extends DividerSpectrumProps, Omit<RACSeparatorProps, 'className' | 'style' | 'elementType'>, StyleProps {}
|
|
42
42
|
|
|
43
|
-
export const DividerContext = createContext<ContextValue<DividerProps
|
|
43
|
+
export const DividerContext = createContext<ContextValue<Partial<DividerProps>, DOMRefValue>>(null);
|
|
44
44
|
|
|
45
45
|
export const divider = style<DividerSpectrumProps & {isStaticColor: boolean}>({
|
|
46
46
|
...staticColor(),
|
package/src/DropZone.tsx
CHANGED
|
@@ -26,7 +26,7 @@ export interface DropZoneProps extends Omit<RACDropZoneProps, 'className' | 'sty
|
|
|
26
26
|
/** Spectrum-defined styles, returned by the `style()` macro. */
|
|
27
27
|
styles?: StylesPropWithHeight,
|
|
28
28
|
/** The content to display in the drop zone. */
|
|
29
|
-
children
|
|
29
|
+
children: ReactNode,
|
|
30
30
|
/** Whether the drop zone has been filled. */
|
|
31
31
|
isFilled?: boolean,
|
|
32
32
|
/** The message to replace the default banner message that is shown when the drop zone is filled. */
|
|
@@ -39,7 +39,7 @@ export interface DropZoneProps extends Omit<RACDropZoneProps, 'className' | 'sty
|
|
|
39
39
|
size?: 'S' | 'M' | 'L'
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export const DropZoneContext = createContext<ContextValue<DropZoneProps
|
|
42
|
+
export const DropZoneContext = createContext<ContextValue<Partial<DropZoneProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
43
43
|
|
|
44
44
|
const dropzone = style<DropZoneRenderProps>({
|
|
45
45
|
display: 'flex',
|
package/src/Field.tsx
CHANGED
|
@@ -151,7 +151,7 @@ export const FieldLabel = forwardRef(function FieldLabel(props: FieldLabelProps,
|
|
|
151
151
|
|
|
152
152
|
interface FieldGroupProps extends Omit<GroupProps, 'className' | 'style' | 'children'>, UnsafeStyles {
|
|
153
153
|
size?: 'S' | 'M' | 'L' | 'XL',
|
|
154
|
-
children
|
|
154
|
+
children: ReactNode,
|
|
155
155
|
styles?: StyleString
|
|
156
156
|
}
|
|
157
157
|
|
package/src/Form.tsx
CHANGED
|
@@ -31,10 +31,10 @@ interface FormStyleProps extends Omit<SpectrumLabelableProps, 'label' | 'context
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export interface FormProps extends FormStyleProps, Omit<RACFormProps, 'className' | 'style' | 'children'>, StyleProps {
|
|
34
|
-
children
|
|
34
|
+
children: ReactNode
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export const FormContext = createContext<FormStyleProps | null
|
|
37
|
+
export const FormContext = createContext<Partial<FormStyleProps | null>>(null);
|
|
38
38
|
export function useFormProps<T extends FormStyleProps>(props: T): T {
|
|
39
39
|
let ctx = useContext(FormContext);
|
|
40
40
|
let isSkeleton = useIsSkeleton();
|
package/src/Icon.tsx
CHANGED
|
@@ -31,8 +31,8 @@ export interface IllustrationContextValue extends IconContextValue {
|
|
|
31
31
|
size?: 'S' | 'M' | 'L'
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export const IconContext = createContext<ContextValue<IconContextValue
|
|
35
|
-
export const IllustrationContext = createContext<ContextValue<IllustrationContextValue
|
|
34
|
+
export const IconContext = createContext<ContextValue<Partial<IconContextValue>, SVGElement>>({});
|
|
35
|
+
export const IllustrationContext = createContext<ContextValue<Partial<IllustrationContextValue>, SVGElement>>({});
|
|
36
36
|
|
|
37
37
|
export function createIcon(Component: ComponentType<SVGProps<SVGSVGElement>>, context: Context<ContextValue<IconContextValue, SVGElement>> = IconContext): FunctionComponent<IconProps> {
|
|
38
38
|
return (props: IconProps) => {
|
|
@@ -155,7 +155,7 @@ interface IllustratedMessageContextProps extends Partial<S2SpectrumIllustratedMe
|
|
|
155
155
|
isDropTarget?: boolean
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
export const IllustratedMessageContext = createContext<ContextValue<IllustratedMessageContextProps
|
|
158
|
+
export const IllustratedMessageContext = createContext<ContextValue<Partial<IllustratedMessageContextProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
161
|
* An IllustratedMessage displays an illustration and a message, usually
|
package/src/Image.tsx
CHANGED
|
@@ -57,7 +57,7 @@ interface ImageContextValue extends ImageProps {
|
|
|
57
57
|
hidden?: boolean
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export const ImageContext = createContext<ContextValue<ImageContextValue
|
|
60
|
+
export const ImageContext = createContext<ContextValue<Partial<ImageContextValue>, HTMLDivElement>>(null);
|
|
61
61
|
|
|
62
62
|
type ImageState = 'loading' | 'loaded' | 'revealed' | 'error';
|
|
63
63
|
interface State {
|
package/src/Link.tsx
CHANGED
|
@@ -35,10 +35,10 @@ interface LinkStyleProps {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export interface LinkProps extends Omit<RACLinkProps, 'isDisabled' | 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, LinkStyleProps {
|
|
38
|
-
children
|
|
38
|
+
children: ReactNode
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export const LinkContext = createContext<ContextValue<LinkProps
|
|
41
|
+
export const LinkContext = createContext<ContextValue<Partial<LinkProps>, FocusableRefValue<HTMLAnchorElement>>>(null);
|
|
42
42
|
|
|
43
43
|
const link = style<LinkRenderProps & LinkStyleProps & {isSkeleton: boolean, isStaticColor: boolean}>({
|
|
44
44
|
...focusRing(),
|
package/src/Menu.tsx
CHANGED
|
@@ -82,12 +82,12 @@ export interface MenuProps<T> extends Omit<AriaMenuProps<T>, 'children' | 'style
|
|
|
82
82
|
/**
|
|
83
83
|
* The contents of the collection.
|
|
84
84
|
*/
|
|
85
|
-
children
|
|
85
|
+
children: ReactNode | ((item: T) => ReactNode),
|
|
86
86
|
/** Hides the default link out icons on menu items that open links in a new tab. */
|
|
87
87
|
hideLinkOutIcon?: boolean
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export const MenuContext = createContext<ContextValue<MenuProps<any
|
|
90
|
+
export const MenuContext = createContext<ContextValue<Partial<MenuProps<any>>, DOMRefValue<HTMLDivElement>>>(null);
|
|
91
91
|
|
|
92
92
|
const menuItemGrid = {
|
|
93
93
|
size: {
|
|
@@ -115,7 +115,8 @@ export let menu = style({
|
|
|
115
115
|
isPopover: 8
|
|
116
116
|
},
|
|
117
117
|
fontFamily: 'sans',
|
|
118
|
-
fontSize: 'control'
|
|
118
|
+
fontSize: 'control',
|
|
119
|
+
gridAutoRows: 'min-content'
|
|
119
120
|
}, getAllowedOverrides());
|
|
120
121
|
|
|
121
122
|
export let section = style({
|
package/src/Meter.tsx
CHANGED
|
@@ -53,7 +53,7 @@ export interface MeterProps extends Omit<AriaMeterProps, 'children' | 'className
|
|
|
53
53
|
label?: ReactNode
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export const MeterContext = createContext<ContextValue<MeterProps
|
|
56
|
+
export const MeterContext = createContext<ContextValue<Partial<MeterProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
57
57
|
|
|
58
58
|
const wrapper = style({
|
|
59
59
|
...bar()
|
package/src/NumberField.tsx
CHANGED
|
@@ -54,7 +54,7 @@ export interface NumberFieldProps extends
|
|
|
54
54
|
size?: 'S' | 'M' | 'L' | 'XL'
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
export const NumberFieldContext = createContext<ContextValue<NumberFieldProps
|
|
57
|
+
export const NumberFieldContext = createContext<ContextValue<Partial<NumberFieldProps>, TextFieldRef>>(null);
|
|
58
58
|
|
|
59
59
|
const inputButton = style({
|
|
60
60
|
display: 'flex',
|
package/src/Picker.tsx
CHANGED
package/src/ProgressBar.tsx
CHANGED
|
@@ -55,7 +55,7 @@ export interface ProgressBarProps extends Omit<AriaProgressBarProps, 'children'
|
|
|
55
55
|
label?: ReactNode
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export const ProgressBarContext = createContext<ContextValue<ProgressBarProps
|
|
58
|
+
export const ProgressBarContext = createContext<ContextValue<Partial<ProgressBarProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
59
59
|
|
|
60
60
|
const indeterminateLTR = keyframes(`
|
|
61
61
|
0% {
|
package/src/ProgressCircle.tsx
CHANGED
|
@@ -34,7 +34,7 @@ export interface ProgressCircleStyleProps {
|
|
|
34
34
|
isIndeterminate?: boolean
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export const ProgressCircleContext = createContext<ContextValue<ProgressCircleProps
|
|
37
|
+
export const ProgressCircleContext = createContext<ContextValue<Partial<ProgressCircleProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
38
38
|
|
|
39
39
|
// Double check the types passed to each style, may not need all for each
|
|
40
40
|
const wrapper = style<ProgressCircleStyleProps>({
|
package/src/RadioGroup.tsx
CHANGED
|
@@ -28,7 +28,7 @@ export interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'className' |
|
|
|
28
28
|
/**
|
|
29
29
|
* The Radios contained within the RadioGroup.
|
|
30
30
|
*/
|
|
31
|
-
children
|
|
31
|
+
children: ReactNode,
|
|
32
32
|
/**
|
|
33
33
|
* The size of the RadioGroup.
|
|
34
34
|
*
|
|
@@ -47,7 +47,7 @@ export interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'className' |
|
|
|
47
47
|
isEmphasized?: boolean
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export const RadioGroupContext = createContext<ContextValue<RadioGroupProps
|
|
50
|
+
export const RadioGroupContext = createContext<ContextValue<Partial<RadioGroupProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Radio groups allow users to select a single option from a list of mutually exclusive options.
|
package/src/RangeSlider.tsx
CHANGED
|
@@ -37,7 +37,7 @@ export interface RangeSliderProps extends Omit<SliderBaseProps<RangeValue<number
|
|
|
37
37
|
endName?: string
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export const RangeSliderContext = createContext<ContextValue<RangeSliderProps
|
|
40
|
+
export const RangeSliderContext = createContext<ContextValue<Partial<RangeSliderProps>, FocusableRefValue<HTMLDivElement>>>(null);
|
|
41
41
|
|
|
42
42
|
export const RangeSlider = /*#__PURE__*/ forwardRef(function RangeSlider(props: RangeSliderProps, ref: FocusableRef<HTMLDivElement>) {
|
|
43
43
|
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');
|
package/src/SearchField.tsx
CHANGED
|
@@ -40,7 +40,7 @@ export interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'className'
|
|
|
40
40
|
size?: 'S' | 'M' | 'L' | 'XL'
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export const SearchFieldContext = createContext<ContextValue<SearchFieldProps
|
|
43
|
+
export const SearchFieldContext = createContext<ContextValue<Partial<SearchFieldProps>, TextFieldRef>>(null);
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* A SearchField is a text field designed for searches.
|
package/src/SegmentedControl.tsx
CHANGED
|
@@ -52,7 +52,7 @@ export interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps
|
|
|
52
52
|
isDisabled?: boolean
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export const SegmentedControlContext = createContext<ContextValue<SegmentedControlProps
|
|
55
|
+
export const SegmentedControlContext = createContext<ContextValue<Partial<SegmentedControlProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
56
56
|
|
|
57
57
|
const segmentedControl = style({
|
|
58
58
|
display: 'flex',
|
|
@@ -143,7 +143,7 @@ interface InternalSegmentedControlContextProps {
|
|
|
143
143
|
interface DefaultSelectionTrackProps {
|
|
144
144
|
defaultValue?: Key | null,
|
|
145
145
|
value?: Key | null,
|
|
146
|
-
children
|
|
146
|
+
children: ReactNode,
|
|
147
147
|
prevRef: RefObject<DOMRect | null>,
|
|
148
148
|
currentSelectedRef: RefObject<HTMLDivElement | null>,
|
|
149
149
|
isJustified?: boolean
|
package/src/Skeleton.tsx
CHANGED
package/src/Slider.tsx
CHANGED
|
@@ -66,7 +66,7 @@ export interface SliderProps extends Omit<SliderBaseProps<number>, 'children'>,
|
|
|
66
66
|
fillOffset?: number
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export const SliderContext = createContext<ContextValue<SliderProps
|
|
69
|
+
export const SliderContext = createContext<ContextValue<Partial<SliderProps>, FocusableRefValue<HTMLDivElement>>>(null);
|
|
70
70
|
|
|
71
71
|
const slider = style({
|
|
72
72
|
font: 'control',
|
package/src/StatusLight.tsx
CHANGED
|
@@ -40,7 +40,7 @@ export interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaL
|
|
|
40
40
|
/**
|
|
41
41
|
* The content to display as the label.
|
|
42
42
|
*/
|
|
43
|
-
children
|
|
43
|
+
children: ReactNode,
|
|
44
44
|
/**
|
|
45
45
|
* An accessibility role for the status light. Should be set when the status
|
|
46
46
|
* can change at runtime, and no more than one status light will update simultaneously.
|
|
@@ -49,7 +49,7 @@ export interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaL
|
|
|
49
49
|
role?: 'status'
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export const StatusLightContext = createContext<ContextValue<StatusLightProps
|
|
52
|
+
export const StatusLightContext = createContext<ContextValue<Partial<StatusLightProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
53
53
|
|
|
54
54
|
const wrapper = style<StatusLightStyleProps>({
|
|
55
55
|
display: 'flex',
|
package/src/Switch.tsx
CHANGED
|
@@ -45,7 +45,7 @@ export interface SwitchProps extends Omit<AriaSwitchProps, 'className' | 'style'
|
|
|
45
45
|
children?: ReactNode
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export const SwitchContext = createContext<ContextValue<SwitchProps
|
|
48
|
+
export const SwitchContext = createContext<ContextValue<Partial<SwitchProps>, FocusableRefValue<HTMLLabelElement>>>(null);
|
|
49
49
|
|
|
50
50
|
const wrapper = style({
|
|
51
51
|
display: 'flex',
|
package/src/TableView.tsx
CHANGED
|
@@ -256,7 +256,7 @@ export class S2TableLayout<T> extends UNSTABLE_TableLayout<T> {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
export const TableContext = createContext<ContextValue<TableViewProps
|
|
259
|
+
export const TableContext = createContext<ContextValue<Partial<TableViewProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
260
260
|
|
|
261
261
|
/**
|
|
262
262
|
* Tables are containers for displaying information. They allow users to quickly scan, sort, compare, and take action on large amounts of data.
|
package/src/Tabs.tsx
CHANGED
|
@@ -31,11 +31,11 @@ import {createContext, forwardRef, ReactNode, useCallback, useContext, useEffect
|
|
|
31
31
|
import {focusRing, size, style} from '../style' with {type: 'macro'};
|
|
32
32
|
import {getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};
|
|
33
33
|
import {IconContext} from './Icon';
|
|
34
|
+
import {inertValue, useEffectEvent, useId, useLabels, useLayoutEffect, useResizeObserver} from '@react-aria/utils';
|
|
34
35
|
import {Picker, PickerItem} from './TabsPicker';
|
|
35
36
|
import {Text, TextContext} from './Content';
|
|
36
37
|
import {useControlledState} from '@react-stately/utils';
|
|
37
38
|
import {useDOMRef} from '@react-spectrum/utils';
|
|
38
|
-
import {useEffectEvent, useId, useLabels, useLayoutEffect, useResizeObserver} from '@react-aria/utils';
|
|
39
39
|
import {useHasTabbableChild} from '@react-aria/focus';
|
|
40
40
|
import {useLocale} from '@react-aria/i18n';
|
|
41
41
|
import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
@@ -44,7 +44,7 @@ export interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style' | '
|
|
|
44
44
|
/** Spectrum-defined styles, returned by the `style()` macro. */
|
|
45
45
|
styles?: StylesPropWithHeight,
|
|
46
46
|
/** The content to display in the tabs. */
|
|
47
|
-
children
|
|
47
|
+
children: ReactNode,
|
|
48
48
|
/**
|
|
49
49
|
* The amount of space between the tabs.
|
|
50
50
|
* @default 'regular'
|
|
@@ -63,17 +63,20 @@ export interface TabProps extends Omit<AriaTabProps, 'children' | 'style' | 'cla
|
|
|
63
63
|
children: ReactNode
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export interface TabListProps<T> extends Omit<AriaTabListProps<T>, 'style' | 'className' | 'aria-label' | 'aria-labelledby'>, StyleProps {
|
|
66
|
+
export interface TabListProps<T> extends Omit<AriaTabListProps<T>, 'style' | 'className' | 'aria-label' | 'aria-labelledby'>, StyleProps {
|
|
67
|
+
/** The content to display in the tablist. */
|
|
68
|
+
children: ReactNode | ((item: T) => ReactNode)
|
|
69
|
+
}
|
|
67
70
|
|
|
68
71
|
export interface TabPanelProps extends Omit<AriaTabPanelProps, 'children' | 'style' | 'className'>, UnsafeStyles {
|
|
69
72
|
/** Spectrum-defined styles, returned by the `style()` macro. */
|
|
70
73
|
styles?: StylesPropWithHeight,
|
|
71
74
|
/** The content to display in the tab panels. */
|
|
72
|
-
children
|
|
75
|
+
children: ReactNode
|
|
73
76
|
}
|
|
74
77
|
|
|
75
|
-
export const TabsContext = createContext<ContextValue<TabsProps
|
|
76
|
-
const InternalTabsContext = createContext<TabsProps
|
|
78
|
+
export const TabsContext = createContext<ContextValue<Partial<TabsProps>, DOMRefValue<HTMLDivElement>>>(null);
|
|
79
|
+
const InternalTabsContext = createContext<Partial<TabsProps>>({});
|
|
77
80
|
const CollapseContext = createContext({
|
|
78
81
|
showTabs: true,
|
|
79
82
|
menuId: '',
|
|
@@ -346,7 +349,8 @@ const tab = style({
|
|
|
346
349
|
labelBehavior: {
|
|
347
350
|
hide: size(6)
|
|
348
351
|
}
|
|
349
|
-
}
|
|
352
|
+
},
|
|
353
|
+
disableTapHighlight: true
|
|
350
354
|
}, getAllowedOverrides());
|
|
351
355
|
|
|
352
356
|
const icon = style({
|
|
@@ -409,17 +413,12 @@ export function Tab(props: TabProps) {
|
|
|
409
413
|
|
|
410
414
|
const tabPanel = style({
|
|
411
415
|
...focusRing(),
|
|
412
|
-
display: 'flex',
|
|
413
416
|
marginTop: 4,
|
|
414
|
-
marginX: -4,
|
|
415
|
-
paddingX: 4,
|
|
416
417
|
color: 'gray-800',
|
|
417
418
|
flexGrow: 1,
|
|
418
|
-
flexShrink: 1,
|
|
419
419
|
flexBasis: '[0%]',
|
|
420
420
|
minHeight: 0,
|
|
421
|
-
minWidth: 0
|
|
422
|
-
overflow: 'auto'
|
|
421
|
+
minWidth: 0
|
|
423
422
|
}, getAllowedOverrides({height: true}));
|
|
424
423
|
|
|
425
424
|
export function TabPanel(props: TabPanelProps) {
|
|
@@ -489,7 +488,7 @@ let HiddenTabs = function (props: {
|
|
|
489
488
|
return (
|
|
490
489
|
<div
|
|
491
490
|
// @ts-ignore
|
|
492
|
-
inert=
|
|
491
|
+
inert={inertValue(true)}
|
|
493
492
|
ref={listRef}
|
|
494
493
|
className={style({
|
|
495
494
|
display: '[inherit]',
|
|
@@ -518,7 +517,7 @@ let HiddenTabs = function (props: {
|
|
|
518
517
|
);
|
|
519
518
|
};
|
|
520
519
|
|
|
521
|
-
let TabsMenu = (props: {valueId: string, items: Array<Node<any>>, onSelectionChange: TabsProps['onSelectionChange']} & TabsProps) => {
|
|
520
|
+
let TabsMenu = (props: {valueId: string, items: Array<Node<any>>, onSelectionChange: TabsProps['onSelectionChange']} & Omit<TabsProps, 'children'>) => {
|
|
522
521
|
let {id, items, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, valueId} = props;
|
|
523
522
|
let {density, onSelectionChange, selectedKey, isDisabled, disabledKeys, labelBehavior} = useContext(InternalTabsContext);
|
|
524
523
|
let state = useContext(TabListStateContext);
|
|
@@ -613,7 +612,8 @@ let CollapsingTabs = ({collection, containerRef, ...props}: {collection: Collect
|
|
|
613
612
|
}
|
|
614
613
|
}, [collection.size, updateOverflow]);
|
|
615
614
|
|
|
616
|
-
|
|
615
|
+
// start with null so that the first render won't have a flicker
|
|
616
|
+
let prevOrientation = useRef<Orientation | null>(null);
|
|
617
617
|
useLayoutEffect(() => {
|
|
618
618
|
if (collection.size > 0 && prevOrientation.current !== orientation) {
|
|
619
619
|
updateOverflow();
|
package/src/TagGroup.tsx
CHANGED
|
@@ -52,7 +52,7 @@ import {useSpectrumContextProps} from './useSpectrumContextProps';
|
|
|
52
52
|
// Get types from RSP and extend those?
|
|
53
53
|
export interface TagProps extends Omit<AriaTagProps, 'children' | 'style' | 'className'> {
|
|
54
54
|
/** The children of the tag. */
|
|
55
|
-
children
|
|
55
|
+
children: ReactNode
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children' | 'style' | 'className'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'>, Omit<SpectrumLabelableProps, 'isRequired' | 'necessityIndicator'>, StyleProps, Omit<HelpTextProps, 'errorMessage'> {
|
|
@@ -80,7 +80,7 @@ export interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children' | '
|
|
|
80
80
|
onGroupAction?: () => void
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export const TagGroupContext = createContext<ContextValue<TagGroupProps<any
|
|
83
|
+
export const TagGroupContext = createContext<ContextValue<Partial<TagGroupProps<any>>, DOMRefValue<HTMLDivElement>>>(null);
|
|
84
84
|
|
|
85
85
|
const helpTextStyles = style({
|
|
86
86
|
gridArea: 'helptext',
|