@react-spectrum/picker 3.12.3-nightly.4230 → 3.12.3-nightly.4245

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/picker",
3
- "version": "3.12.3-nightly.4230+192e66d11",
3
+ "version": "3.12.3-nightly.4245+403ec27bf",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,29 +36,30 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/focus": "3.0.0-nightly.2519+192e66d11",
40
- "@react-aria/i18n": "3.0.0-nightly.2519+192e66d11",
41
- "@react-aria/interactions": "3.0.0-nightly.2519+192e66d11",
42
- "@react-aria/overlays": "3.0.0-nightly.2519+192e66d11",
43
- "@react-aria/select": "3.13.2-nightly.4230+192e66d11",
44
- "@react-aria/utils": "3.0.0-nightly.2519+192e66d11",
45
- "@react-spectrum/button": "3.0.0-nightly.2519+192e66d11",
46
- "@react-spectrum/label": "3.15.2-nightly.4230+192e66d11",
47
- "@react-spectrum/listbox": "3.12.2-nightly.4230+192e66d11",
48
- "@react-spectrum/overlays": "3.0.0-nightly.2519+192e66d11",
49
- "@react-spectrum/progress": "3.0.0-nightly.2519+192e66d11",
50
- "@react-spectrum/text": "3.4.8-nightly.4230+192e66d11",
51
- "@react-spectrum/utils": "3.0.0-nightly.2519+192e66d11",
52
- "@react-stately/collections": "3.0.0-nightly.2519+192e66d11",
53
- "@react-stately/select": "3.5.6-nightly.4230+192e66d11",
54
- "@react-types/overlays": "3.8.4-nightly.4230+192e66d11",
55
- "@react-types/select": "3.8.5-nightly.4230+192e66d11",
56
- "@react-types/shared": "3.0.0-nightly.2519+192e66d11",
57
- "@spectrum-icons/ui": "3.0.0-nightly.2519+192e66d11",
39
+ "@react-aria/focus": "3.0.0-nightly.2534+403ec27bf",
40
+ "@react-aria/i18n": "3.0.0-nightly.2534+403ec27bf",
41
+ "@react-aria/interactions": "3.0.0-nightly.2534+403ec27bf",
42
+ "@react-aria/overlays": "3.0.0-nightly.2534+403ec27bf",
43
+ "@react-aria/select": "3.13.2-nightly.4245+403ec27bf",
44
+ "@react-aria/utils": "3.0.0-nightly.2534+403ec27bf",
45
+ "@react-spectrum/button": "3.0.0-nightly.2534+403ec27bf",
46
+ "@react-spectrum/form": "3.0.0-nightly.2534+403ec27bf",
47
+ "@react-spectrum/label": "3.15.2-nightly.4245+403ec27bf",
48
+ "@react-spectrum/listbox": "3.12.2-nightly.4245+403ec27bf",
49
+ "@react-spectrum/overlays": "3.0.0-nightly.2534+403ec27bf",
50
+ "@react-spectrum/progress": "3.0.0-nightly.2534+403ec27bf",
51
+ "@react-spectrum/text": "3.4.8-nightly.4245+403ec27bf",
52
+ "@react-spectrum/utils": "3.0.0-nightly.2534+403ec27bf",
53
+ "@react-stately/collections": "3.0.0-nightly.2534+403ec27bf",
54
+ "@react-stately/select": "3.5.6-nightly.4245+403ec27bf",
55
+ "@react-types/overlays": "3.8.4-nightly.4245+403ec27bf",
56
+ "@react-types/select": "3.8.5-nightly.4245+403ec27bf",
57
+ "@react-types/shared": "3.0.0-nightly.2534+403ec27bf",
58
+ "@spectrum-icons/ui": "3.0.0-nightly.2534+403ec27bf",
58
59
  "@swc/helpers": "^0.5.0"
59
60
  },
60
61
  "devDependencies": {
61
- "@adobe/spectrum-css-temp": "3.0.0-nightly.2519+192e66d11"
62
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.2534+403ec27bf"
62
63
  },
63
64
  "peerDependencies": {
64
65
  "@react-spectrum/provider": "^3.1.4",
@@ -68,5 +69,5 @@
68
69
  "publishConfig": {
69
70
  "access": "public"
70
71
  },
71
- "gitHead": "192e66d11e2f49caba5194e2094bfd1534db7cda"
72
+ "gitHead": "403ec27bf8f5af6e19529b78782526f680c171ca"
72
73
  }
package/src/Picker.tsx CHANGED
@@ -36,6 +36,7 @@ import React, {ReactElement, useCallback, useRef, useState} from 'react';
36
36
  import {SpectrumPickerProps} from '@react-types/select';
37
37
  import styles from '@adobe/spectrum-css-temp/components/dropdown/vars.css';
38
38
  import {Text} from '@react-spectrum/text';
39
+ import {useFormProps} from '@react-spectrum/form';
39
40
  import {useLocalizedStringFormatter} from '@react-aria/i18n';
40
41
  import {useProvider, useProviderProps} from '@react-spectrum/provider';
41
42
  import {useSelectState} from '@react-stately/select';
@@ -43,6 +44,7 @@ import {useSelectState} from '@react-stately/select';
43
44
  function Picker<T extends object>(props: SpectrumPickerProps<T>, ref: DOMRef<HTMLDivElement>) {
44
45
  props = useSlotProps(props, 'picker');
45
46
  props = useProviderProps(props);
47
+ props = useFormProps(props);
46
48
  let stringFormatter = useLocalizedStringFormatter(intlMessages);
47
49
  let {
48
50
  autoComplete,
@@ -51,8 +53,6 @@ function Picker<T extends object>(props: SpectrumPickerProps<T>, ref: DOMRef<HTM
51
53
  align = 'start',
52
54
  shouldFlip = true,
53
55
  placeholder = stringFormatter.format('placeholder'),
54
- validationState,
55
- isInvalid = validationState === 'invalid',
56
56
  isQuiet,
57
57
  label,
58
58
  labelPosition = 'top' as LabelPosition,
@@ -77,7 +77,7 @@ function Picker<T extends object>(props: SpectrumPickerProps<T>, ref: DOMRef<HTM
77
77
  // so that the layout information can be cached even while the listbox is not mounted.
78
78
  // We also use the layout as the keyboard delegate for type to select.
79
79
  let layout = useListBoxLayout(state, isLoadingMore);
80
- let {labelProps, triggerProps, valueProps, menuProps, descriptionProps, errorMessageProps} = useSelect({
80
+ let {labelProps, triggerProps, valueProps, menuProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useSelect({
81
81
  ...props,
82
82
  'aria-describedby': (isLoadingInitial ? progressCircleId : undefined),
83
83
  keyboardDelegate: layout
@@ -241,6 +241,9 @@ function Picker<T extends object>(props: SpectrumPickerProps<T>, ref: DOMRef<HTM
241
241
  labelProps={labelProps}
242
242
  descriptionProps={descriptionProps}
243
243
  errorMessageProps={errorMessageProps}
244
+ isInvalid={isInvalid}
245
+ validationErrors={validationErrors}
246
+ validationDetails={validationDetails}
244
247
  showErrorIcon={false}
245
248
  includeNecessityIndicatorInAccessibilityName
246
249
  elementType="span">