@react-spectrum/s2 3.0.0-nightly-4b8b33a02-250211 → 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.
Files changed (210) hide show
  1. package/dist/Accordion.cjs.map +1 -1
  2. package/dist/Accordion.css.map +1 -1
  3. package/dist/Accordion.mjs.map +1 -1
  4. package/dist/ActionButton.cjs.map +1 -1
  5. package/dist/ActionButton.css.map +1 -1
  6. package/dist/ActionButton.mjs.map +1 -1
  7. package/dist/ActionMenu.cjs.map +1 -1
  8. package/dist/ActionMenu.mjs.map +1 -1
  9. package/dist/Avatar.cjs.map +1 -1
  10. package/dist/Avatar.css.map +1 -1
  11. package/dist/Avatar.mjs.map +1 -1
  12. package/dist/AvatarGroup.cjs.map +1 -1
  13. package/dist/AvatarGroup.css.map +1 -1
  14. package/dist/AvatarGroup.mjs.map +1 -1
  15. package/dist/Breadcrumbs.cjs.map +1 -1
  16. package/dist/Breadcrumbs.css.map +1 -1
  17. package/dist/Breadcrumbs.mjs.map +1 -1
  18. package/dist/Button.cjs.map +1 -1
  19. package/dist/Button.css.map +1 -1
  20. package/dist/Button.mjs.map +1 -1
  21. package/dist/ButtonGroup.cjs.map +1 -1
  22. package/dist/ButtonGroup.css.map +1 -1
  23. package/dist/ButtonGroup.mjs.map +1 -1
  24. package/dist/CardView.cjs.map +1 -1
  25. package/dist/CardView.css.map +1 -1
  26. package/dist/CardView.mjs.map +1 -1
  27. package/dist/Checkbox.cjs.map +1 -1
  28. package/dist/Checkbox.css.map +1 -1
  29. package/dist/Checkbox.mjs.map +1 -1
  30. package/dist/CheckboxGroup.cjs.map +1 -1
  31. package/dist/CheckboxGroup.css.map +1 -1
  32. package/dist/CheckboxGroup.mjs.map +1 -1
  33. package/dist/CloseButton.cjs.map +1 -1
  34. package/dist/CloseButton.css.map +1 -1
  35. package/dist/CloseButton.mjs.map +1 -1
  36. package/dist/ColorArea.cjs.map +1 -1
  37. package/dist/ColorArea.css.map +1 -1
  38. package/dist/ColorArea.mjs.map +1 -1
  39. package/dist/ColorField.cjs.map +1 -1
  40. package/dist/ColorField.css.map +1 -1
  41. package/dist/ColorField.mjs.map +1 -1
  42. package/dist/ColorSlider.cjs.map +1 -1
  43. package/dist/ColorSlider.css.map +1 -1
  44. package/dist/ColorSlider.mjs.map +1 -1
  45. package/dist/ColorSwatch.cjs.map +1 -1
  46. package/dist/ColorSwatch.css.map +1 -1
  47. package/dist/ColorSwatch.mjs.map +1 -1
  48. package/dist/ColorWheel.cjs.map +1 -1
  49. package/dist/ColorWheel.css.map +1 -1
  50. package/dist/ColorWheel.mjs.map +1 -1
  51. package/dist/Content.cjs.map +1 -1
  52. package/dist/Content.mjs.map +1 -1
  53. package/dist/ContextualHelp.cjs.map +1 -1
  54. package/dist/ContextualHelp.css.map +1 -1
  55. package/dist/ContextualHelp.mjs.map +1 -1
  56. package/dist/Disclosure.cjs.map +1 -1
  57. package/dist/Disclosure.css.map +1 -1
  58. package/dist/Disclosure.mjs.map +1 -1
  59. package/dist/Divider.cjs.map +1 -1
  60. package/dist/Divider.css.map +1 -1
  61. package/dist/Divider.mjs.map +1 -1
  62. package/dist/DropZone.cjs.map +1 -1
  63. package/dist/DropZone.css.map +1 -1
  64. package/dist/DropZone.mjs.map +1 -1
  65. package/dist/Field.cjs.map +1 -1
  66. package/dist/Field.css.map +1 -1
  67. package/dist/Field.mjs.map +1 -1
  68. package/dist/Form.cjs.map +1 -1
  69. package/dist/Form.css.map +1 -1
  70. package/dist/Form.mjs.map +1 -1
  71. package/dist/IllustratedMessage.cjs.map +1 -1
  72. package/dist/IllustratedMessage.css.map +1 -1
  73. package/dist/IllustratedMessage.mjs.map +1 -1
  74. package/dist/Image.cjs.map +1 -1
  75. package/dist/Image.css.map +1 -1
  76. package/dist/Image.mjs.map +1 -1
  77. package/dist/Link.cjs.map +1 -1
  78. package/dist/Link.css.map +1 -1
  79. package/dist/Link.mjs.map +1 -1
  80. package/dist/Menu.cjs +1 -0
  81. package/dist/Menu.cjs.map +1 -1
  82. package/dist/Menu.css +4 -0
  83. package/dist/Menu.css.map +1 -1
  84. package/dist/Menu.mjs +1 -0
  85. package/dist/Menu.mjs.map +1 -1
  86. package/dist/Meter.cjs.map +1 -1
  87. package/dist/Meter.css.map +1 -1
  88. package/dist/Meter.mjs.map +1 -1
  89. package/dist/NumberField.cjs.map +1 -1
  90. package/dist/NumberField.css.map +1 -1
  91. package/dist/NumberField.mjs.map +1 -1
  92. package/dist/Picker.cjs +1 -0
  93. package/dist/Picker.cjs.map +1 -1
  94. package/dist/Picker.css +4 -0
  95. package/dist/Picker.css.map +1 -1
  96. package/dist/Picker.mjs +1 -0
  97. package/dist/Picker.mjs.map +1 -1
  98. package/dist/ProgressBar.cjs.map +1 -1
  99. package/dist/ProgressBar.css.map +1 -1
  100. package/dist/ProgressBar.mjs.map +1 -1
  101. package/dist/ProgressCircle.cjs.map +1 -1
  102. package/dist/ProgressCircle.css.map +1 -1
  103. package/dist/ProgressCircle.mjs.map +1 -1
  104. package/dist/RadioGroup.cjs.map +1 -1
  105. package/dist/RadioGroup.css.map +1 -1
  106. package/dist/RadioGroup.mjs.map +1 -1
  107. package/dist/RangeSlider.cjs.map +1 -1
  108. package/dist/RangeSlider.mjs.map +1 -1
  109. package/dist/SearchField.cjs.map +1 -1
  110. package/dist/SearchField.css.map +1 -1
  111. package/dist/SearchField.mjs.map +1 -1
  112. package/dist/SegmentedControl.cjs.map +1 -1
  113. package/dist/SegmentedControl.css.map +1 -1
  114. package/dist/SegmentedControl.mjs.map +1 -1
  115. package/dist/Slider.cjs.map +1 -1
  116. package/dist/Slider.css.map +1 -1
  117. package/dist/Slider.mjs.map +1 -1
  118. package/dist/StatusLight.cjs.map +1 -1
  119. package/dist/StatusLight.css.map +1 -1
  120. package/dist/StatusLight.mjs.map +1 -1
  121. package/dist/Switch.cjs.map +1 -1
  122. package/dist/Switch.css.map +1 -1
  123. package/dist/Switch.mjs.map +1 -1
  124. package/dist/TableView.cjs.map +1 -1
  125. package/dist/TableView.css.map +1 -1
  126. package/dist/TableView.mjs.map +1 -1
  127. package/dist/Tabs.cjs +5 -17
  128. package/dist/Tabs.cjs.map +1 -1
  129. package/dist/Tabs.css +4 -28
  130. package/dist/Tabs.css.map +1 -1
  131. package/dist/Tabs.mjs +5 -17
  132. package/dist/Tabs.mjs.map +1 -1
  133. package/dist/TagGroup.cjs.map +1 -1
  134. package/dist/TagGroup.css.map +1 -1
  135. package/dist/TagGroup.mjs.map +1 -1
  136. package/dist/TextField.cjs.map +1 -1
  137. package/dist/TextField.css.map +1 -1
  138. package/dist/TextField.mjs.map +1 -1
  139. package/dist/ToggleButton.cjs.map +1 -1
  140. package/dist/ToggleButton.css.map +1 -1
  141. package/dist/ToggleButton.mjs.map +1 -1
  142. package/dist/ToggleButtonGroup.cjs.map +1 -1
  143. package/dist/ToggleButtonGroup.mjs.map +1 -1
  144. package/dist/Tooltip.cjs.map +1 -1
  145. package/dist/Tooltip.css.map +1 -1
  146. package/dist/Tooltip.mjs.map +1 -1
  147. package/dist/TreeView.cjs +32 -10
  148. package/dist/TreeView.cjs.map +1 -1
  149. package/dist/TreeView.css +46 -26
  150. package/dist/TreeView.css.map +1 -1
  151. package/dist/TreeView.mjs +32 -10
  152. package/dist/TreeView.mjs.map +1 -1
  153. package/dist/types.d.ts +73 -71
  154. package/dist/types.d.ts.map +1 -1
  155. package/icons/Icon.cjs.map +1 -1
  156. package/icons/Icon.mjs.map +1 -1
  157. package/icons/Skeleton.cjs.map +1 -1
  158. package/icons/Skeleton.css.map +1 -1
  159. package/icons/Skeleton.mjs.map +1 -1
  160. package/package.json +21 -21
  161. package/src/Accordion.tsx +1 -1
  162. package/src/ActionButton.tsx +2 -2
  163. package/src/ActionMenu.tsx +1 -1
  164. package/src/Avatar.tsx +1 -1
  165. package/src/AvatarGroup.tsx +1 -1
  166. package/src/Breadcrumbs.tsx +4 -4
  167. package/src/Button.tsx +4 -4
  168. package/src/ButtonGroup.tsx +1 -1
  169. package/src/CardView.tsx +1 -1
  170. package/src/Checkbox.tsx +1 -1
  171. package/src/CheckboxGroup.tsx +2 -2
  172. package/src/CloseButton.tsx +1 -1
  173. package/src/ColorArea.tsx +1 -1
  174. package/src/ColorField.tsx +1 -1
  175. package/src/ColorSlider.tsx +1 -1
  176. package/src/ColorSwatch.tsx +1 -1
  177. package/src/ColorWheel.tsx +1 -1
  178. package/src/Content.tsx +7 -7
  179. package/src/ContextualHelp.tsx +2 -2
  180. package/src/Disclosure.tsx +1 -1
  181. package/src/Divider.tsx +1 -1
  182. package/src/DropZone.tsx +2 -2
  183. package/src/Field.tsx +1 -1
  184. package/src/Form.tsx +2 -2
  185. package/src/Icon.tsx +2 -2
  186. package/src/IllustratedMessage.tsx +1 -1
  187. package/src/Image.tsx +1 -1
  188. package/src/Link.tsx +2 -2
  189. package/src/Menu.tsx +4 -3
  190. package/src/Meter.tsx +1 -1
  191. package/src/NumberField.tsx +1 -1
  192. package/src/Picker.tsx +2 -1
  193. package/src/ProgressBar.tsx +1 -1
  194. package/src/ProgressCircle.tsx +1 -1
  195. package/src/RadioGroup.tsx +2 -2
  196. package/src/RangeSlider.tsx +1 -1
  197. package/src/SearchField.tsx +1 -1
  198. package/src/SegmentedControl.tsx +2 -2
  199. package/src/Skeleton.tsx +1 -1
  200. package/src/Slider.tsx +1 -1
  201. package/src/StatusLight.tsx +2 -2
  202. package/src/Switch.tsx +1 -1
  203. package/src/TableView.tsx +1 -1
  204. package/src/Tabs.tsx +16 -16
  205. package/src/TagGroup.tsx +2 -2
  206. package/src/TextField.tsx +2 -2
  207. package/src/ToggleButton.tsx +2 -2
  208. package/src/ToggleButtonGroup.tsx +1 -1
  209. package/src/Tooltip.tsx +3 -3
  210. package/src/TreeView.tsx +33 -12
@@ -57,7 +57,7 @@ interface ButtonGroupContextValue extends Partial<ButtonGroupProps> {
57
57
  isHidden?: boolean
58
58
  }
59
59
 
60
- export const ButtonGroupContext = createContext<ContextValue<ButtonGroupContextValue, DOMRefValue<HTMLDivElement>>>({});
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>, DOMRefValue<HTMLDivElement>>>(null);
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, FocusableRefValue<HTMLLabelElement>>>(null);
44
+ export const CheckboxContext = createContext<ContextValue<Partial<CheckboxProps>, FocusableRefValue<HTMLLabelElement>>>(null);
45
45
 
46
46
  const wrapper = style({
47
47
  display: 'flex',
@@ -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?: ReactNode,
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, DOMRefValue<HTMLDivElement>>>(null);
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.
@@ -79,7 +79,7 @@ const styles = style({
79
79
  }
80
80
  }, getAllowedOverrides());
81
81
 
82
- export const CloseButtonContext = createContext<ContextValue<CloseButtonProps, FocusableRefValue<HTMLButtonElement>>>(null);
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, DOMRefValue<HTMLDivElement>>>(null);
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.
@@ -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, TextFieldRef>>(null);
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.
@@ -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, DOMRefValue<HTMLDivElement>>>(null);
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.
@@ -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, DOMRefValue<HTMLDivElement>>>(null);
46
+ export const ColorSwatchContext = createContext<ContextValue<Partial<ColorSwatchProps>, DOMRefValue<HTMLDivElement>>>(null);
47
47
  export const InternalColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(null);
48
48
 
49
49
  /**
@@ -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, DOMRefValue<HTMLDivElement>>>(null);
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?: ReactNode,
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, DOMRefValue<HTMLHeadingElement>>>(null);
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, DOMRefValue<HTMLElement>>>(null);
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, DOMRefValue<HTMLDivElement>>>(null);
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, DOMRefValue>>(null);
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, DOMRefValue>>({});
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, DOMRefValue>>({});
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);
@@ -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?: ReactNode,
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, FocusableRefValue<HTMLButtonElement>>>(null);
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.
@@ -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<Omit<DisclosureProps, 'children'>, DOMRefValue<HTMLDivElement>>>(null);
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, DOMRefValue>>(null);
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?: ReactNode,
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, DOMRefValue<HTMLDivElement>>>(null);
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?: ReactNode,
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?: ReactNode
34
+ children: ReactNode
35
35
  }
36
36
 
37
- export const FormContext = createContext<FormStyleProps | null>(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, SVGElement>>({});
35
- export const IllustrationContext = createContext<ContextValue<IllustrationContextValue, SVGElement>>({});
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, DOMRefValue<HTMLDivElement>>>(null);
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, HTMLDivElement>>(null);
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?: ReactNode
38
+ children: ReactNode
39
39
  }
40
40
 
41
- export const LinkContext = createContext<ContextValue<LinkProps, FocusableRefValue<HTMLAnchorElement>>>(null);
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?: ReactNode | ((item: T) => ReactNode),
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>, DOMRefValue<HTMLDivElement>>>(null);
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, DOMRefValue<HTMLDivElement>>>(null);
56
+ export const MeterContext = createContext<ContextValue<Partial<MeterProps>, DOMRefValue<HTMLDivElement>>>(null);
57
57
 
58
58
  const wrapper = style({
59
59
  ...bar()
@@ -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, TextFieldRef>>(null);
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
@@ -190,7 +190,8 @@ export let menu = style({
190
190
  overflow: 'auto',
191
191
  padding: 8,
192
192
  fontFamily: 'sans',
193
- fontSize: 'control'
193
+ fontSize: 'control',
194
+ gridAutoRows: 'min-content'
194
195
  });
195
196
 
196
197
  const invalidBorder = style({
@@ -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, DOMRefValue<HTMLDivElement>>>(null);
58
+ export const ProgressBarContext = createContext<ContextValue<Partial<ProgressBarProps>, DOMRefValue<HTMLDivElement>>>(null);
59
59
 
60
60
  const indeterminateLTR = keyframes(`
61
61
  0% {
@@ -34,7 +34,7 @@ export interface ProgressCircleStyleProps {
34
34
  isIndeterminate?: boolean
35
35
  }
36
36
 
37
- export const ProgressCircleContext = createContext<ContextValue<ProgressCircleProps, DOMRefValue<HTMLDivElement>>>(null);
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>({
@@ -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?: ReactNode,
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, DOMRefValue<HTMLDivElement>>>(null);
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.
@@ -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, FocusableRefValue<HTMLDivElement>>>(null);
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');
@@ -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, TextFieldRef>>(null);
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.
@@ -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, DOMRefValue<HTMLDivElement>>>(null);
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?: ReactNode,
146
+ children: ReactNode,
147
147
  prevRef: RefObject<DOMRect | null>,
148
148
  currentSelectedRef: RefObject<HTMLDivElement | null>,
149
149
  isJustified?: boolean
package/src/Skeleton.tsx CHANGED
@@ -48,7 +48,7 @@ export function useLoadingAnimation(isAnimating: boolean) {
48
48
  }
49
49
 
50
50
  export type SkeletonElement = ReactElement<{
51
- children?: ReactNode,
51
+ children: ReactNode,
52
52
  className?: string,
53
53
  ref?: Ref<HTMLElement>,
54
54
  inert?: boolean | 'true'
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, FocusableRefValue<HTMLDivElement>>>(null);
69
+ export const SliderContext = createContext<ContextValue<Partial<SliderProps>, FocusableRefValue<HTMLDivElement>>>(null);
70
70
 
71
71
  const slider = style({
72
72
  font: 'control',
@@ -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?: ReactNode,
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, DOMRefValue<HTMLDivElement>>>(null);
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, FocusableRefValue<HTMLLabelElement>>>(null);
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, DOMRefValue<HTMLDivElement>>>(null);
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?: ReactNode,
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?: ReactNode
75
+ children: ReactNode
73
76
  }
74
77
 
75
- export const TabsContext = createContext<ContextValue<TabsProps, DOMRefValue<HTMLDivElement>>>(null);
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="true"
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
- let prevOrientation = useRef(orientation);
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?: ReactNode
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>, DOMRefValue<HTMLDivElement>>>(null);
83
+ export const TagGroupContext = createContext<ContextValue<Partial<TagGroupProps<any>>, DOMRefValue<HTMLDivElement>>>(null);
84
84
 
85
85
  const helpTextStyles = style({
86
86
  gridArea: 'helptext',