@multiplatform.one/forms 7.11.0 → 7.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/AdaptivePopup/index.cjs +0 -10
- package/dist/cjs/AdaptivePopup/index.native.js +0 -10
- package/dist/cjs/AdaptivePopup/index.native.js.map +1 -1
- package/dist/cjs/Button/index.cjs +6 -3
- package/dist/cjs/Button/index.native.js +6 -3
- package/dist/cjs/Button/index.native.js.map +1 -1
- package/dist/cjs/ContextualSaveBar/UnsavedChangesDialog.cjs +2 -11
- package/dist/cjs/ContextualSaveBar/UnsavedChangesDialog.native.js +2 -11
- package/dist/cjs/ContextualSaveBar/UnsavedChangesDialog.native.js.map +1 -1
- package/dist/cjs/ContextualSaveBar/index.cjs +12 -10
- package/dist/cjs/ContextualSaveBar/index.native.js +12 -19
- package/dist/cjs/ContextualSaveBar/index.native.js.map +1 -1
- package/dist/cjs/FieldDisplay/index.cjs +24 -12
- package/dist/cjs/FieldDisplay/index.native.js +25 -13
- package/dist/cjs/FieldDisplay/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/PanelPortal.cjs +145 -0
- package/dist/cjs/FloatingPanel/PanelPortal.native.js +43 -0
- package/dist/cjs/FloatingPanel/PanelPortal.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/index.cjs +115 -67
- package/dist/cjs/FloatingPanel/index.native.js +67 -12
- package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/useFloatingPanel.cjs +4 -2
- package/dist/cjs/FloatingPanel/useFloatingPanel.native.js +4 -2
- package/dist/cjs/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/cjs/Form/index.cjs +2 -1
- package/dist/cjs/Form/index.native.js +2 -1
- package/dist/cjs/Form/index.native.js.map +1 -1
- package/dist/cjs/Form/submissionController.cjs +74 -0
- package/dist/cjs/Form/submissionController.native.js +99 -0
- package/dist/cjs/Form/submissionController.native.js.map +1 -0
- package/dist/cjs/InputParts/index.cjs +66 -12
- package/dist/cjs/InputParts/index.native.js +72 -12
- package/dist/cjs/InputParts/index.native.js.map +1 -1
- package/dist/cjs/Wheel/index.cjs +0 -2
- package/dist/cjs/Wheel/index.native.js +0 -2
- package/dist/cjs/Wheel/index.native.js.map +1 -1
- package/dist/cjs/fields/Barcode/BarcodePreview.cjs +18 -15
- package/dist/cjs/fields/Barcode/BarcodePreview.native.js +21 -18
- package/dist/cjs/fields/Barcode/BarcodePreview.native.js.map +1 -1
- package/dist/cjs/fields/Barcode/qr.native.js +34 -34
- package/dist/cjs/fields/Checkbox/Checkbox.cjs +1 -3
- package/dist/cjs/fields/Checkbox/Checkbox.native.js +1 -3
- package/dist/cjs/fields/Checkbox/Checkbox.native.js.map +1 -1
- package/dist/cjs/fields/Checkbox/CheckboxBox.cjs +2 -3
- package/dist/cjs/fields/Checkbox/CheckboxBox.native.js +2 -3
- package/dist/cjs/fields/Checkbox/CheckboxBox.native.js.map +1 -1
- package/dist/cjs/fields/ColorPicker/index.cjs +2 -0
- package/dist/cjs/fields/ColorPicker/index.native.js +2 -0
- package/dist/cjs/fields/ColorPicker/index.native.js.map +1 -1
- package/dist/cjs/fields/ColorPicker/parts.cjs +1 -0
- package/dist/cjs/fields/ColorPicker/parts.native.js +1 -0
- package/dist/cjs/fields/ColorPicker/parts.native.js.map +1 -1
- package/dist/cjs/fields/Combobox/index.cjs +206 -200
- package/dist/cjs/fields/Combobox/index.native.js +214 -208
- package/dist/cjs/fields/Combobox/index.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/DateRangePicker.cjs +7 -7
- package/dist/cjs/fields/DatePicker/DateRangePicker.native.js +7 -7
- package/dist/cjs/fields/DatePicker/DateRangePicker.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/MultiDatePicker.cjs +6 -4
- package/dist/cjs/fields/DatePicker/MultiDatePicker.native.js +6 -4
- package/dist/cjs/fields/DatePicker/MultiDatePicker.native.js.map +1 -1
- package/dist/cjs/fields/Duration/index.cjs +5 -3
- package/dist/cjs/fields/Duration/index.native.js +5 -3
- package/dist/cjs/fields/Duration/index.native.js.map +1 -1
- package/dist/cjs/fields/FileUpload/index.cjs +10 -8
- package/dist/cjs/fields/FileUpload/index.native.js +10 -8
- package/dist/cjs/fields/FileUpload/index.native.js.map +1 -1
- package/dist/cjs/fields/FileUpload/nativePickerLoader.cjs +7 -2
- package/dist/cjs/fields/FileUpload/nativePickerLoader.native.js +7 -2
- package/dist/cjs/fields/FileUpload/nativePickerLoader.native.js.map +1 -1
- package/dist/cjs/fields/Geolocation/GeolocationMap.cjs +3 -0
- package/dist/cjs/fields/Geolocation/geocoderContext.cjs +71 -0
- package/dist/cjs/fields/Geolocation/geocoderContext.native.js +75 -0
- package/dist/cjs/fields/Geolocation/geocoderContext.native.js.map +1 -0
- package/dist/cjs/fields/Geolocation/index.cjs +72 -82
- package/dist/cjs/fields/Geolocation/index.native.js +72 -82
- package/dist/cjs/fields/Geolocation/index.native.js.map +1 -1
- package/dist/cjs/fields/Geolocation/photonGeocoder.cjs +138 -0
- package/dist/cjs/fields/Geolocation/photonGeocoder.native.js +179 -0
- package/dist/cjs/fields/Geolocation/photonGeocoder.native.js.map +1 -0
- package/dist/cjs/fields/Input/index.cjs +7 -5
- package/dist/cjs/fields/Input/index.native.js +7 -5
- package/dist/cjs/fields/Input/index.native.js.map +1 -1
- package/dist/cjs/fields/MentionInput/index.cjs +118 -112
- package/dist/cjs/fields/MentionInput/index.native.js +130 -124
- package/dist/cjs/fields/MentionInput/index.native.js.map +1 -1
- package/dist/cjs/fields/OTPInput/index.cjs +11 -8
- package/dist/cjs/fields/OTPInput/index.native.js +11 -8
- package/dist/cjs/fields/OTPInput/index.native.js.map +1 -1
- package/dist/cjs/fields/PhoneInput/index.cjs +9 -6
- package/dist/cjs/fields/PhoneInput/index.native.js +9 -6
- package/dist/cjs/fields/PhoneInput/index.native.js.map +1 -1
- package/dist/cjs/fields/PhoneInput/phone.cjs +6 -5
- package/dist/cjs/fields/PhoneInput/phone.native.js +7 -6
- package/dist/cjs/fields/PhoneInput/phone.native.js.map +1 -1
- package/dist/cjs/fields/PhoneInput/regionNames.cjs +274 -0
- package/dist/cjs/fields/PhoneInput/regionNames.native.js +277 -0
- package/dist/cjs/fields/PhoneInput/regionNames.native.js.map +1 -0
- package/dist/cjs/fields/RadioGroup/index.cjs +2 -6
- package/dist/cjs/fields/RadioGroup/index.native.js +2 -6
- package/dist/cjs/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/cjs/fields/SearchInput/index.cjs +10 -8
- package/dist/cjs/fields/SearchInput/index.native.js +10 -8
- package/dist/cjs/fields/SearchInput/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/index.cjs +20 -17
- package/dist/cjs/fields/Select/index.native.js +20 -17
- package/dist/cjs/fields/Select/index.native.js.map +1 -1
- package/dist/cjs/fields/Signature/index.cjs +10 -9
- package/dist/cjs/fields/Signature/index.native.js +10 -9
- package/dist/cjs/fields/Signature/index.native.js.map +1 -1
- package/dist/cjs/fields/Slider/index.cjs +21 -15
- package/dist/cjs/fields/Slider/index.native.js +21 -17
- package/dist/cjs/fields/Slider/index.native.js.map +1 -1
- package/dist/cjs/fields/Slider/jumpMotion.cjs +2 -2
- package/dist/cjs/fields/Slider/jumpMotion.native.js +2 -1
- package/dist/cjs/fields/Slider/jumpMotion.native.js.map +1 -1
- package/dist/cjs/fields/Stepper/index.cjs +25 -6
- package/dist/cjs/fields/Stepper/index.native.js +25 -6
- package/dist/cjs/fields/Stepper/index.native.js.map +1 -1
- package/dist/cjs/fields/Switch/footprint.cjs +54 -0
- package/dist/cjs/fields/Switch/footprint.native.js +57 -0
- package/dist/cjs/fields/Switch/footprint.native.js.map +1 -0
- package/dist/cjs/fields/Switch/index.cjs +60 -43
- package/dist/cjs/fields/Switch/index.native.js +60 -50
- package/dist/cjs/fields/Switch/index.native.js.map +1 -1
- package/dist/cjs/fields/TextArea/index.cjs +6 -3
- package/dist/cjs/fields/TextArea/index.native.js +6 -3
- package/dist/cjs/fields/TextArea/index.native.js.map +1 -1
- package/dist/cjs/fields/TimePicker/catalog.cjs +1 -0
- package/dist/cjs/fields/TimePicker/catalog.native.js +1 -0
- package/dist/cjs/fields/TimePicker/catalog.native.js.map +1 -1
- package/dist/cjs/fields/TimePicker/parts.cjs +5 -0
- package/dist/cjs/fields/TimePicker/parts.native.js +7 -0
- package/dist/cjs/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/cjs/index.cjs +12 -0
- package/dist/cjs/index.native.js +12 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/panelPortal.cjs +52 -0
- package/dist/cjs/shared/panelPortal.native.js +65 -0
- package/dist/cjs/shared/panelPortal.native.js.map +1 -0
- package/dist/cjs/shared/pressSlopProps.cjs +16 -11
- package/dist/cjs/shared/pressSlopProps.native.js +18 -12
- package/dist/cjs/shared/pressSlopProps.native.js.map +1 -1
- package/dist/cjs/shared/utils.cjs +2 -2
- package/dist/cjs/shared/utils.native.js +3 -2
- package/dist/cjs/shared/utils.native.js.map +1 -1
- package/dist/cjs/themedPrimitives.cjs +15 -2
- package/dist/cjs/themedPrimitives.native.js +16 -3
- package/dist/cjs/themedPrimitives.native.js.map +1 -1
- package/dist/esm/AdaptivePopup/index.mjs +0 -10
- package/dist/esm/AdaptivePopup/index.mjs.map +1 -1
- package/dist/esm/AdaptivePopup/index.native.js +0 -10
- package/dist/esm/AdaptivePopup/index.native.js.map +1 -1
- package/dist/esm/Button/index.mjs +6 -3
- package/dist/esm/Button/index.mjs.map +1 -1
- package/dist/esm/Button/index.native.js +6 -3
- package/dist/esm/Button/index.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/UnsavedChangesDialog.mjs +3 -12
- package/dist/esm/ContextualSaveBar/UnsavedChangesDialog.mjs.map +1 -1
- package/dist/esm/ContextualSaveBar/UnsavedChangesDialog.native.js +3 -12
- package/dist/esm/ContextualSaveBar/UnsavedChangesDialog.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/index.mjs +13 -11
- package/dist/esm/ContextualSaveBar/index.mjs.map +1 -1
- package/dist/esm/ContextualSaveBar/index.native.js +13 -20
- package/dist/esm/ContextualSaveBar/index.native.js.map +1 -1
- package/dist/esm/FieldDisplay/index.mjs +24 -12
- package/dist/esm/FieldDisplay/index.mjs.map +1 -1
- package/dist/esm/FieldDisplay/index.native.js +25 -13
- package/dist/esm/FieldDisplay/index.native.js.map +1 -1
- package/dist/esm/FloatingPanel/PanelPortal.mjs +119 -0
- package/dist/esm/FloatingPanel/PanelPortal.mjs.map +1 -0
- package/dist/esm/FloatingPanel/PanelPortal.native.js +14 -0
- package/dist/esm/FloatingPanel/PanelPortal.native.js.map +1 -0
- package/dist/esm/FloatingPanel/index.mjs +117 -69
- package/dist/esm/FloatingPanel/index.mjs.map +1 -1
- package/dist/esm/FloatingPanel/index.native.js +68 -13
- package/dist/esm/FloatingPanel/index.native.js.map +1 -1
- package/dist/esm/FloatingPanel/useFloatingPanel.mjs +4 -2
- package/dist/esm/FloatingPanel/useFloatingPanel.mjs.map +1 -1
- package/dist/esm/FloatingPanel/useFloatingPanel.native.js +4 -2
- package/dist/esm/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/esm/Form/index.mjs +2 -1
- package/dist/esm/Form/index.mjs.map +1 -1
- package/dist/esm/Form/index.native.js +2 -1
- package/dist/esm/Form/index.native.js.map +1 -1
- package/dist/esm/Form/submissionController.mjs +49 -0
- package/dist/esm/Form/submissionController.mjs.map +1 -0
- package/dist/esm/Form/submissionController.native.js +71 -0
- package/dist/esm/Form/submissionController.native.js.map +1 -0
- package/dist/esm/InputParts/index.mjs +67 -13
- package/dist/esm/InputParts/index.mjs.map +1 -1
- package/dist/esm/InputParts/index.native.js +73 -13
- package/dist/esm/InputParts/index.native.js.map +1 -1
- package/dist/esm/Wheel/index.mjs +0 -2
- package/dist/esm/Wheel/index.mjs.map +1 -1
- package/dist/esm/Wheel/index.native.js +0 -2
- package/dist/esm/Wheel/index.native.js.map +1 -1
- package/dist/esm/fields/Barcode/BarcodePreview.mjs +19 -16
- package/dist/esm/fields/Barcode/BarcodePreview.mjs.map +1 -1
- package/dist/esm/fields/Barcode/BarcodePreview.native.js +22 -19
- package/dist/esm/fields/Barcode/BarcodePreview.native.js.map +1 -1
- package/dist/esm/fields/Barcode/qr.native.js +34 -34
- package/dist/esm/fields/Checkbox/Checkbox.mjs +2 -4
- package/dist/esm/fields/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/esm/fields/Checkbox/Checkbox.native.js +2 -4
- package/dist/esm/fields/Checkbox/Checkbox.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxBox.mjs +3 -4
- package/dist/esm/fields/Checkbox/CheckboxBox.mjs.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxBox.native.js +3 -4
- package/dist/esm/fields/Checkbox/CheckboxBox.native.js.map +1 -1
- package/dist/esm/fields/ColorPicker/index.mjs +2 -0
- package/dist/esm/fields/ColorPicker/index.mjs.map +1 -1
- package/dist/esm/fields/ColorPicker/index.native.js +2 -0
- package/dist/esm/fields/ColorPicker/index.native.js.map +1 -1
- package/dist/esm/fields/ColorPicker/parts.mjs +1 -0
- package/dist/esm/fields/ColorPicker/parts.mjs.map +1 -1
- package/dist/esm/fields/ColorPicker/parts.native.js +1 -0
- package/dist/esm/fields/ColorPicker/parts.native.js.map +1 -1
- package/dist/esm/fields/Combobox/index.mjs +197 -191
- package/dist/esm/fields/Combobox/index.mjs.map +1 -1
- package/dist/esm/fields/Combobox/index.native.js +205 -199
- package/dist/esm/fields/Combobox/index.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/DateRangePicker.mjs +5 -5
- package/dist/esm/fields/DatePicker/DateRangePicker.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/DateRangePicker.native.js +5 -5
- package/dist/esm/fields/DatePicker/DateRangePicker.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/MultiDatePicker.mjs +3 -1
- package/dist/esm/fields/DatePicker/MultiDatePicker.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/MultiDatePicker.native.js +3 -1
- package/dist/esm/fields/DatePicker/MultiDatePicker.native.js.map +1 -1
- package/dist/esm/fields/Duration/index.mjs +3 -1
- package/dist/esm/fields/Duration/index.mjs.map +1 -1
- package/dist/esm/fields/Duration/index.native.js +3 -1
- package/dist/esm/fields/Duration/index.native.js.map +1 -1
- package/dist/esm/fields/FileUpload/index.mjs +5 -3
- package/dist/esm/fields/FileUpload/index.mjs.map +1 -1
- package/dist/esm/fields/FileUpload/index.native.js +5 -3
- package/dist/esm/fields/FileUpload/index.native.js.map +1 -1
- package/dist/esm/fields/FileUpload/nativePickerLoader.mjs +7 -3
- package/dist/esm/fields/FileUpload/nativePickerLoader.mjs.map +1 -1
- package/dist/esm/fields/FileUpload/nativePickerLoader.native.js +7 -3
- package/dist/esm/fields/FileUpload/nativePickerLoader.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/GeolocationMap.mjs +3 -0
- package/dist/esm/fields/Geolocation/GeolocationMap.mjs.map +1 -1
- package/dist/esm/fields/Geolocation/geocoderContext.mjs +44 -0
- package/dist/esm/fields/Geolocation/geocoderContext.mjs.map +1 -0
- package/dist/esm/fields/Geolocation/geocoderContext.native.js +45 -0
- package/dist/esm/fields/Geolocation/geocoderContext.native.js.map +1 -0
- package/dist/esm/fields/Geolocation/index.mjs +73 -83
- package/dist/esm/fields/Geolocation/index.mjs.map +1 -1
- package/dist/esm/fields/Geolocation/index.native.js +73 -83
- package/dist/esm/fields/Geolocation/index.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/photonGeocoder.mjs +112 -0
- package/dist/esm/fields/Geolocation/photonGeocoder.mjs.map +1 -0
- package/dist/esm/fields/Geolocation/photonGeocoder.native.js +150 -0
- package/dist/esm/fields/Geolocation/photonGeocoder.native.js.map +1 -0
- package/dist/esm/fields/Input/index.mjs +3 -1
- package/dist/esm/fields/Input/index.mjs.map +1 -1
- package/dist/esm/fields/Input/index.native.js +3 -1
- package/dist/esm/fields/Input/index.native.js.map +1 -1
- package/dist/esm/fields/MentionInput/index.mjs +115 -109
- package/dist/esm/fields/MentionInput/index.mjs.map +1 -1
- package/dist/esm/fields/MentionInput/index.native.js +127 -121
- package/dist/esm/fields/MentionInput/index.native.js.map +1 -1
- package/dist/esm/fields/OTPInput/index.mjs +7 -4
- package/dist/esm/fields/OTPInput/index.mjs.map +1 -1
- package/dist/esm/fields/OTPInput/index.native.js +7 -4
- package/dist/esm/fields/OTPInput/index.native.js.map +1 -1
- package/dist/esm/fields/PhoneInput/index.mjs +6 -3
- package/dist/esm/fields/PhoneInput/index.mjs.map +1 -1
- package/dist/esm/fields/PhoneInput/index.native.js +6 -3
- package/dist/esm/fields/PhoneInput/index.native.js.map +1 -1
- package/dist/esm/fields/PhoneInput/phone.mjs +6 -5
- package/dist/esm/fields/PhoneInput/phone.mjs.map +1 -1
- package/dist/esm/fields/PhoneInput/phone.native.js +7 -6
- package/dist/esm/fields/PhoneInput/phone.native.js.map +1 -1
- package/dist/esm/fields/PhoneInput/regionNames.mjs +249 -0
- package/dist/esm/fields/PhoneInput/regionNames.mjs.map +1 -0
- package/dist/esm/fields/PhoneInput/regionNames.native.js +249 -0
- package/dist/esm/fields/PhoneInput/regionNames.native.js.map +1 -0
- package/dist/esm/fields/RadioGroup/index.mjs +3 -7
- package/dist/esm/fields/RadioGroup/index.mjs.map +1 -1
- package/dist/esm/fields/RadioGroup/index.native.js +3 -7
- package/dist/esm/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/esm/fields/SearchInput/index.mjs +5 -3
- package/dist/esm/fields/SearchInput/index.mjs.map +1 -1
- package/dist/esm/fields/SearchInput/index.native.js +5 -3
- package/dist/esm/fields/SearchInput/index.native.js.map +1 -1
- package/dist/esm/fields/Select/index.mjs +10 -7
- package/dist/esm/fields/Select/index.mjs.map +1 -1
- package/dist/esm/fields/Select/index.native.js +10 -7
- package/dist/esm/fields/Select/index.native.js.map +1 -1
- package/dist/esm/fields/Signature/index.mjs +7 -6
- package/dist/esm/fields/Signature/index.mjs.map +1 -1
- package/dist/esm/fields/Signature/index.native.js +7 -6
- package/dist/esm/fields/Signature/index.native.js.map +1 -1
- package/dist/esm/fields/Slider/index.mjs +10 -4
- package/dist/esm/fields/Slider/index.mjs.map +1 -1
- package/dist/esm/fields/Slider/index.native.js +10 -6
- package/dist/esm/fields/Slider/index.native.js.map +1 -1
- package/dist/esm/fields/Slider/jumpMotion.mjs +2 -2
- package/dist/esm/fields/Slider/jumpMotion.mjs.map +1 -1
- package/dist/esm/fields/Slider/jumpMotion.native.js +2 -1
- package/dist/esm/fields/Slider/jumpMotion.native.js.map +1 -1
- package/dist/esm/fields/Stepper/index.mjs +24 -5
- package/dist/esm/fields/Stepper/index.mjs.map +1 -1
- package/dist/esm/fields/Stepper/index.native.js +24 -5
- package/dist/esm/fields/Stepper/index.native.js.map +1 -1
- package/dist/esm/fields/Switch/footprint.mjs +29 -0
- package/dist/esm/fields/Switch/footprint.mjs.map +1 -0
- package/dist/esm/fields/Switch/footprint.native.js +29 -0
- package/dist/esm/fields/Switch/footprint.native.js.map +1 -0
- package/dist/esm/fields/Switch/index.mjs +44 -27
- package/dist/esm/fields/Switch/index.mjs.map +1 -1
- package/dist/esm/fields/Switch/index.native.js +44 -34
- package/dist/esm/fields/Switch/index.native.js.map +1 -1
- package/dist/esm/fields/TextArea/index.mjs +6 -3
- package/dist/esm/fields/TextArea/index.mjs.map +1 -1
- package/dist/esm/fields/TextArea/index.native.js +6 -3
- package/dist/esm/fields/TextArea/index.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/catalog.mjs +1 -0
- package/dist/esm/fields/TimePicker/catalog.mjs.map +1 -1
- package/dist/esm/fields/TimePicker/catalog.native.js +1 -0
- package/dist/esm/fields/TimePicker/catalog.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/parts.mjs +5 -0
- package/dist/esm/fields/TimePicker/parts.mjs.map +1 -1
- package/dist/esm/fields/TimePicker/parts.native.js +7 -0
- package/dist/esm/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/esm/index.mjs +6 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +6 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/shared/panelPortal.mjs +24 -0
- package/dist/esm/shared/panelPortal.mjs.map +1 -0
- package/dist/esm/shared/panelPortal.native.js +34 -0
- package/dist/esm/shared/panelPortal.native.js.map +1 -0
- package/dist/esm/shared/pressSlopProps.mjs +16 -12
- package/dist/esm/shared/pressSlopProps.mjs.map +1 -1
- package/dist/esm/shared/pressSlopProps.native.js +18 -13
- package/dist/esm/shared/pressSlopProps.native.js.map +1 -1
- package/dist/esm/shared/utils.mjs +2 -2
- package/dist/esm/shared/utils.mjs.map +1 -1
- package/dist/esm/shared/utils.native.js +3 -2
- package/dist/esm/shared/utils.native.js.map +1 -1
- package/dist/esm/themedPrimitives.mjs +16 -3
- package/dist/esm/themedPrimitives.mjs.map +1 -1
- package/dist/esm/themedPrimitives.native.js +17 -4
- package/dist/esm/themedPrimitives.native.js.map +1 -1
- package/dist/jsx/AdaptivePopup/index.mjs +0 -10
- package/dist/jsx/AdaptivePopup/index.mjs.map +1 -1
- package/dist/jsx/AdaptivePopup/index.native.js +0 -10
- package/dist/jsx/AdaptivePopup/index.native.js.map +1 -1
- package/dist/jsx/Button/index.mjs +6 -3
- package/dist/jsx/Button/index.mjs.map +1 -1
- package/dist/jsx/Button/index.native.js +6 -3
- package/dist/jsx/Button/index.native.js.map +1 -1
- package/dist/jsx/ContextualSaveBar/UnsavedChangesDialog.mjs +3 -12
- package/dist/jsx/ContextualSaveBar/UnsavedChangesDialog.mjs.map +1 -1
- package/dist/jsx/ContextualSaveBar/UnsavedChangesDialog.native.js +2 -11
- package/dist/jsx/ContextualSaveBar/UnsavedChangesDialog.native.js.map +1 -1
- package/dist/jsx/ContextualSaveBar/index.mjs +13 -11
- package/dist/jsx/ContextualSaveBar/index.mjs.map +1 -1
- package/dist/jsx/ContextualSaveBar/index.native.js +12 -19
- package/dist/jsx/ContextualSaveBar/index.native.js.map +1 -1
- package/dist/jsx/FieldDisplay/index.mjs +24 -12
- package/dist/jsx/FieldDisplay/index.mjs.map +1 -1
- package/dist/jsx/FieldDisplay/index.native.js +25 -13
- package/dist/jsx/FieldDisplay/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/PanelPortal.mjs +119 -0
- package/dist/jsx/FloatingPanel/PanelPortal.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/PanelPortal.native.js +43 -0
- package/dist/jsx/FloatingPanel/PanelPortal.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/index.mjs +117 -69
- package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/index.native.js +67 -12
- package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/useFloatingPanel.mjs +4 -2
- package/dist/jsx/FloatingPanel/useFloatingPanel.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/useFloatingPanel.native.js +4 -2
- package/dist/jsx/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/jsx/Form/index.mjs +2 -1
- package/dist/jsx/Form/index.mjs.map +1 -1
- package/dist/jsx/Form/index.native.js +2 -1
- package/dist/jsx/Form/index.native.js.map +1 -1
- package/dist/jsx/Form/submissionController.mjs +49 -0
- package/dist/jsx/Form/submissionController.mjs.map +1 -0
- package/dist/jsx/Form/submissionController.native.js +99 -0
- package/dist/jsx/Form/submissionController.native.js.map +1 -0
- package/dist/jsx/InputParts/index.mjs +67 -13
- package/dist/jsx/InputParts/index.mjs.map +1 -1
- package/dist/jsx/InputParts/index.native.js +72 -12
- package/dist/jsx/InputParts/index.native.js.map +1 -1
- package/dist/jsx/Wheel/index.mjs +0 -2
- package/dist/jsx/Wheel/index.mjs.map +1 -1
- package/dist/jsx/Wheel/index.native.js +0 -2
- package/dist/jsx/Wheel/index.native.js.map +1 -1
- package/dist/jsx/fields/Barcode/BarcodePreview.mjs +19 -16
- package/dist/jsx/fields/Barcode/BarcodePreview.mjs.map +1 -1
- package/dist/jsx/fields/Barcode/BarcodePreview.native.js +21 -18
- package/dist/jsx/fields/Barcode/BarcodePreview.native.js.map +1 -1
- package/dist/jsx/fields/Barcode/qr.native.js +34 -34
- package/dist/jsx/fields/Checkbox/Checkbox.mjs +2 -4
- package/dist/jsx/fields/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/jsx/fields/Checkbox/Checkbox.native.js +1 -3
- package/dist/jsx/fields/Checkbox/Checkbox.native.js.map +1 -1
- package/dist/jsx/fields/Checkbox/CheckboxBox.mjs +3 -4
- package/dist/jsx/fields/Checkbox/CheckboxBox.mjs.map +1 -1
- package/dist/jsx/fields/Checkbox/CheckboxBox.native.js +2 -3
- package/dist/jsx/fields/Checkbox/CheckboxBox.native.js.map +1 -1
- package/dist/jsx/fields/ColorPicker/index.mjs +2 -0
- package/dist/jsx/fields/ColorPicker/index.mjs.map +1 -1
- package/dist/jsx/fields/ColorPicker/index.native.js +2 -0
- package/dist/jsx/fields/ColorPicker/index.native.js.map +1 -1
- package/dist/jsx/fields/ColorPicker/parts.mjs +1 -0
- package/dist/jsx/fields/ColorPicker/parts.mjs.map +1 -1
- package/dist/jsx/fields/ColorPicker/parts.native.js +1 -0
- package/dist/jsx/fields/ColorPicker/parts.native.js.map +1 -1
- package/dist/jsx/fields/Combobox/index.mjs +197 -191
- package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
- package/dist/jsx/fields/Combobox/index.native.js +214 -208
- package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/DateRangePicker.mjs +5 -5
- package/dist/jsx/fields/DatePicker/DateRangePicker.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/DateRangePicker.native.js +7 -7
- package/dist/jsx/fields/DatePicker/DateRangePicker.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/MultiDatePicker.mjs +3 -1
- package/dist/jsx/fields/DatePicker/MultiDatePicker.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/MultiDatePicker.native.js +6 -4
- package/dist/jsx/fields/DatePicker/MultiDatePicker.native.js.map +1 -1
- package/dist/jsx/fields/Duration/index.mjs +3 -1
- package/dist/jsx/fields/Duration/index.mjs.map +1 -1
- package/dist/jsx/fields/Duration/index.native.js +5 -3
- package/dist/jsx/fields/Duration/index.native.js.map +1 -1
- package/dist/jsx/fields/FileUpload/index.mjs +5 -3
- package/dist/jsx/fields/FileUpload/index.mjs.map +1 -1
- package/dist/jsx/fields/FileUpload/index.native.js +10 -8
- package/dist/jsx/fields/FileUpload/index.native.js.map +1 -1
- package/dist/jsx/fields/FileUpload/nativePickerLoader.mjs +7 -3
- package/dist/jsx/fields/FileUpload/nativePickerLoader.mjs.map +1 -1
- package/dist/jsx/fields/FileUpload/nativePickerLoader.native.js +7 -2
- package/dist/jsx/fields/FileUpload/nativePickerLoader.native.js.map +1 -1
- package/dist/jsx/fields/Geolocation/GeolocationMap.mjs +3 -0
- package/dist/jsx/fields/Geolocation/GeolocationMap.mjs.map +1 -1
- package/dist/jsx/fields/Geolocation/geocoderContext.mjs +44 -0
- package/dist/jsx/fields/Geolocation/geocoderContext.mjs.map +1 -0
- package/dist/jsx/fields/Geolocation/geocoderContext.native.js +75 -0
- package/dist/jsx/fields/Geolocation/geocoderContext.native.js.map +1 -0
- package/dist/jsx/fields/Geolocation/index.mjs +73 -83
- package/dist/jsx/fields/Geolocation/index.mjs.map +1 -1
- package/dist/jsx/fields/Geolocation/index.native.js +72 -82
- package/dist/jsx/fields/Geolocation/index.native.js.map +1 -1
- package/dist/jsx/fields/Geolocation/photonGeocoder.mjs +112 -0
- package/dist/jsx/fields/Geolocation/photonGeocoder.mjs.map +1 -0
- package/dist/jsx/fields/Geolocation/photonGeocoder.native.js +179 -0
- package/dist/jsx/fields/Geolocation/photonGeocoder.native.js.map +1 -0
- package/dist/jsx/fields/Input/index.mjs +3 -1
- package/dist/jsx/fields/Input/index.mjs.map +1 -1
- package/dist/jsx/fields/Input/index.native.js +7 -5
- package/dist/jsx/fields/Input/index.native.js.map +1 -1
- package/dist/jsx/fields/MentionInput/index.mjs +115 -109
- package/dist/jsx/fields/MentionInput/index.mjs.map +1 -1
- package/dist/jsx/fields/MentionInput/index.native.js +130 -124
- package/dist/jsx/fields/MentionInput/index.native.js.map +1 -1
- package/dist/jsx/fields/OTPInput/index.mjs +7 -4
- package/dist/jsx/fields/OTPInput/index.mjs.map +1 -1
- package/dist/jsx/fields/OTPInput/index.native.js +11 -8
- package/dist/jsx/fields/OTPInput/index.native.js.map +1 -1
- package/dist/jsx/fields/PhoneInput/index.mjs +6 -3
- package/dist/jsx/fields/PhoneInput/index.mjs.map +1 -1
- package/dist/jsx/fields/PhoneInput/index.native.js +9 -6
- package/dist/jsx/fields/PhoneInput/index.native.js.map +1 -1
- package/dist/jsx/fields/PhoneInput/phone.mjs +6 -5
- package/dist/jsx/fields/PhoneInput/phone.mjs.map +1 -1
- package/dist/jsx/fields/PhoneInput/phone.native.js +7 -6
- package/dist/jsx/fields/PhoneInput/phone.native.js.map +1 -1
- package/dist/jsx/fields/PhoneInput/regionNames.mjs +249 -0
- package/dist/jsx/fields/PhoneInput/regionNames.mjs.map +1 -0
- package/dist/jsx/fields/PhoneInput/regionNames.native.js +277 -0
- package/dist/jsx/fields/PhoneInput/regionNames.native.js.map +1 -0
- package/dist/jsx/fields/RadioGroup/index.mjs +3 -7
- package/dist/jsx/fields/RadioGroup/index.mjs.map +1 -1
- package/dist/jsx/fields/RadioGroup/index.native.js +2 -6
- package/dist/jsx/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/jsx/fields/SearchInput/index.mjs +5 -3
- package/dist/jsx/fields/SearchInput/index.mjs.map +1 -1
- package/dist/jsx/fields/SearchInput/index.native.js +10 -8
- package/dist/jsx/fields/SearchInput/index.native.js.map +1 -1
- package/dist/jsx/fields/Select/index.mjs +10 -7
- package/dist/jsx/fields/Select/index.mjs.map +1 -1
- package/dist/jsx/fields/Select/index.native.js +20 -17
- package/dist/jsx/fields/Select/index.native.js.map +1 -1
- package/dist/jsx/fields/Signature/index.mjs +7 -6
- package/dist/jsx/fields/Signature/index.mjs.map +1 -1
- package/dist/jsx/fields/Signature/index.native.js +10 -9
- package/dist/jsx/fields/Signature/index.native.js.map +1 -1
- package/dist/jsx/fields/Slider/index.mjs +10 -4
- package/dist/jsx/fields/Slider/index.mjs.map +1 -1
- package/dist/jsx/fields/Slider/index.native.js +21 -17
- package/dist/jsx/fields/Slider/index.native.js.map +1 -1
- package/dist/jsx/fields/Slider/jumpMotion.mjs +2 -2
- package/dist/jsx/fields/Slider/jumpMotion.mjs.map +1 -1
- package/dist/jsx/fields/Slider/jumpMotion.native.js +2 -1
- package/dist/jsx/fields/Slider/jumpMotion.native.js.map +1 -1
- package/dist/jsx/fields/Stepper/index.mjs +24 -5
- package/dist/jsx/fields/Stepper/index.mjs.map +1 -1
- package/dist/jsx/fields/Stepper/index.native.js +25 -6
- package/dist/jsx/fields/Stepper/index.native.js.map +1 -1
- package/dist/jsx/fields/Switch/footprint.mjs +29 -0
- package/dist/jsx/fields/Switch/footprint.mjs.map +1 -0
- package/dist/jsx/fields/Switch/footprint.native.js +57 -0
- package/dist/jsx/fields/Switch/footprint.native.js.map +1 -0
- package/dist/jsx/fields/Switch/index.mjs +44 -27
- package/dist/jsx/fields/Switch/index.mjs.map +1 -1
- package/dist/jsx/fields/Switch/index.native.js +60 -50
- package/dist/jsx/fields/Switch/index.native.js.map +1 -1
- package/dist/jsx/fields/TextArea/index.mjs +6 -3
- package/dist/jsx/fields/TextArea/index.mjs.map +1 -1
- package/dist/jsx/fields/TextArea/index.native.js +6 -3
- package/dist/jsx/fields/TextArea/index.native.js.map +1 -1
- package/dist/jsx/fields/TimePicker/catalog.mjs +1 -0
- package/dist/jsx/fields/TimePicker/catalog.mjs.map +1 -1
- package/dist/jsx/fields/TimePicker/catalog.native.js +1 -0
- package/dist/jsx/fields/TimePicker/catalog.native.js.map +1 -1
- package/dist/jsx/fields/TimePicker/parts.mjs +5 -0
- package/dist/jsx/fields/TimePicker/parts.mjs.map +1 -1
- package/dist/jsx/fields/TimePicker/parts.native.js +7 -0
- package/dist/jsx/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/jsx/index.js +6 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +6 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +12 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/panelPortal.mjs +24 -0
- package/dist/jsx/shared/panelPortal.mjs.map +1 -0
- package/dist/jsx/shared/panelPortal.native.js +65 -0
- package/dist/jsx/shared/panelPortal.native.js.map +1 -0
- package/dist/jsx/shared/pressSlopProps.mjs +16 -12
- package/dist/jsx/shared/pressSlopProps.mjs.map +1 -1
- package/dist/jsx/shared/pressSlopProps.native.js +18 -12
- package/dist/jsx/shared/pressSlopProps.native.js.map +1 -1
- package/dist/jsx/shared/utils.mjs +2 -2
- package/dist/jsx/shared/utils.mjs.map +1 -1
- package/dist/jsx/shared/utils.native.js +3 -2
- package/dist/jsx/shared/utils.native.js.map +1 -1
- package/dist/jsx/themedPrimitives.mjs +16 -3
- package/dist/jsx/themedPrimitives.mjs.map +1 -1
- package/dist/jsx/themedPrimitives.native.js +16 -3
- package/dist/jsx/themedPrimitives.native.js.map +1 -1
- package/package.json +15 -11
- package/src/AdaptivePopup/AdaptivePopup.spec.tsx +2 -3
- package/src/AdaptivePopup/index.tsx +11 -10
- package/src/Button/Button.borderLadder.spec.tsx +82 -0
- package/src/Button/Button.labelInk.spec.tsx +4 -1
- package/src/Button/Button.radiusLaw.spec.tsx +153 -0
- package/src/Button/index.tsx +6 -3
- package/src/ContextualSaveBar/ContextualSaveBar.spec.tsx +24 -0
- package/src/ContextualSaveBar/ContextualSaveBar.stories.tsx +37 -1
- package/src/ContextualSaveBar/UnsavedChangesDialog.tsx +3 -11
- package/src/ContextualSaveBar/index.tsx +17 -11
- package/src/ErrorSummary.stories.tsx +20 -11
- package/src/FieldDisplay/FieldDisplay.spec.tsx +47 -2
- package/src/FieldDisplay/index.tsx +21 -13
- package/src/FloatingPanel/FloatingPanel.detentLayout.spec.tsx +148 -0
- package/src/FloatingPanel/FloatingPanel.spec.tsx +140 -1
- package/src/FloatingPanel/FloatingPanel.stories.tsx +86 -1
- package/src/FloatingPanel/PanelPortal.native.tsx +15 -0
- package/src/FloatingPanel/PanelPortal.tsx +149 -0
- package/src/FloatingPanel/index.native.tsx +96 -19
- package/src/FloatingPanel/index.tsx +172 -86
- package/src/FloatingPanel/panelPortal.spec.tsx +142 -0
- package/src/FloatingPanel/panelWidthContract.spec.ts +17 -5
- package/src/FloatingPanel/touchRecipeHydration.spec.tsx +82 -0
- package/src/FloatingPanel/useFloatingPanel.ts +5 -2
- package/src/FloatingPanel/viewportHydration.spec.tsx +118 -0
- package/src/Form/index.tsx +2 -1
- package/src/Form/submission.spec.tsx +148 -0
- package/src/Form/submissionController.spec.ts +73 -0
- package/src/Form/submissionController.ts +59 -0
- package/src/Form/submissionDiscard.spec.tsx +41 -0
- package/src/Form/submissionPaths.spec.tsx +214 -0
- package/src/InputParts/index.tsx +48 -12
- package/src/Label/Label.stories.tsx +27 -11
- package/src/Wheel/Wheel.spec.tsx +9 -2
- package/src/Wheel/index.tsx +0 -2
- package/src/fieldFamilyStories.radius.spec.tsx +48 -0
- package/src/fields/Barcode/BarcodePreview.spec.tsx +32 -12
- package/src/fields/Barcode/BarcodePreview.stories.tsx +5 -4
- package/src/fields/Barcode/BarcodePreview.tsx +31 -25
- package/src/fields/Checkbox/Checkbox.native.spec.tsx +92 -0
- package/src/fields/Checkbox/Checkbox.stories.tsx +1 -0
- package/src/fields/Checkbox/Checkbox.tsx +2 -2
- package/src/fields/Checkbox/CheckboxBox.spec.tsx +13 -13
- package/src/fields/Checkbox/CheckboxBox.tsx +7 -1
- package/src/fields/ColorPicker/index.tsx +6 -1
- package/src/fields/ColorPicker/parts.tsx +1 -0
- package/src/fields/Combobox/Combobox.spec.tsx +85 -55
- package/src/fields/Combobox/index.tsx +259 -240
- package/src/fields/DatePicker/DateRangePicker.tsx +5 -3
- package/src/fields/DatePicker/MultiDatePicker.tsx +3 -1
- package/src/fields/Duration/index.tsx +3 -1
- package/src/fields/FileUpload/index.tsx +13 -3
- package/src/fields/FileUpload/nativePickerLoader.spec.ts +34 -0
- package/src/fields/FileUpload/nativePickerLoader.ts +11 -2
- package/src/fields/Geolocation/Geolocation.spec.tsx +165 -4
- package/src/fields/Geolocation/Geolocation.stories.tsx +110 -26
- package/src/fields/Geolocation/GeolocationMap.tsx +3 -0
- package/src/fields/Geolocation/geocoderContext.tsx +56 -0
- package/src/fields/Geolocation/index.tsx +75 -80
- package/src/fields/Geolocation/photonGeocoder.spec.ts +214 -0
- package/src/fields/Geolocation/photonGeocoder.ts +150 -0
- package/src/fields/Input/index.tsx +3 -1
- package/src/fields/MentionInput/MentionInput.spec.tsx +41 -30
- package/src/fields/MentionInput/index.tsx +128 -119
- package/src/fields/OTPInput/index.tsx +7 -4
- package/src/fields/PhoneInput/PhoneInput.spec.tsx +63 -0
- package/src/fields/PhoneInput/index.tsx +13 -8
- package/src/fields/PhoneInput/phone.native.spec.ts +32 -0
- package/src/fields/PhoneInput/phone.ts +5 -2
- package/src/fields/PhoneInput/regionNames.ts +250 -0
- package/src/fields/RadioGroup/RadioGroup.stories.tsx +4 -3
- package/src/fields/RadioGroup/index.tsx +3 -2
- package/src/fields/Rating/StarInk.native.spec.tsx +1 -1
- package/src/fields/SearchInput/index.tsx +4 -3
- package/src/fields/Select/Select.spec.tsx +36 -29
- package/src/fields/Select/index.tsx +14 -5
- package/src/fields/Signature/index.tsx +7 -3
- package/src/fields/Slider/index.tsx +14 -4
- package/src/fields/Slider/jumpMotion.ts +6 -2
- package/src/fields/Stepper/Stepper.spec.tsx +30 -0
- package/src/fields/Stepper/index.tsx +34 -4
- package/src/fields/Switch/Switch.footprint.native.spec.tsx +58 -0
- package/src/fields/Switch/Switch.footprint.spec.tsx +79 -0
- package/src/fields/Switch/Switch.radius.spec.tsx +37 -6
- package/src/fields/Switch/footprint.ts +45 -0
- package/src/fields/Switch/index.tsx +46 -49
- package/src/fields/TextArea/TextArea.spec.tsx +30 -1
- package/src/fields/TextArea/index.tsx +6 -3
- package/src/fields/TimePicker/TimePicker.native.spec.tsx +48 -0
- package/src/fields/TimePicker/catalog.tsx +1 -0
- package/src/fields/TimePicker/parts.tsx +4 -0
- package/src/fields/ToggleGroup/ToggleGroup.spec.tsx +17 -8
- package/src/fields/pickerShellPadding.spec.tsx +54 -0
- package/src/index.ts +8 -0
- package/src/shared/panelPortal.ts +36 -0
- package/src/shared/pressSlopProps.spec.ts +27 -1
- package/src/shared/pressSlopProps.ts +26 -17
- package/src/shared/utils.ts +2 -2
- package/src/themedPrimitives.tsx +16 -3
- package/types/AdaptivePopup/index.d.ts.map +1 -1
- package/types/Button/index.d.ts.map +1 -1
- package/types/ContextualSaveBar/UnsavedChangesDialog.d.ts.map +1 -1
- package/types/ContextualSaveBar/index.d.ts.map +1 -1
- package/types/FieldDisplay/index.d.ts.map +1 -1
- package/types/FloatingPanel/PanelPortal.d.ts +24 -0
- package/types/FloatingPanel/PanelPortal.d.ts.map +1 -0
- package/types/FloatingPanel/PanelPortal.native.d.ts +9 -0
- package/types/FloatingPanel/PanelPortal.native.d.ts.map +1 -0
- package/types/FloatingPanel/index.d.ts +0 -5
- package/types/FloatingPanel/index.d.ts.map +1 -1
- package/types/FloatingPanel/index.native.d.ts.map +1 -1
- package/types/FloatingPanel/useFloatingPanel.d.ts.map +1 -1
- package/types/Form/index.d.ts.map +1 -1
- package/types/Form/submissionController.d.ts +21 -0
- package/types/Form/submissionController.d.ts.map +1 -0
- package/types/InputParts/index.d.ts +34 -2
- package/types/InputParts/index.d.ts.map +1 -1
- package/types/Wheel/index.d.ts.map +1 -1
- package/types/fields/Barcode/BarcodePreview.d.ts +7 -3
- package/types/fields/Barcode/BarcodePreview.d.ts.map +1 -1
- package/types/fields/Checkbox/CheckboxBox.d.ts +5 -0
- package/types/fields/Checkbox/CheckboxBox.d.ts.map +1 -1
- package/types/fields/ColorPicker/index.d.ts.map +1 -1
- package/types/fields/ColorPicker/parts.d.ts +2 -0
- package/types/fields/ColorPicker/parts.d.ts.map +1 -1
- package/types/fields/Combobox/index.d.ts.map +1 -1
- package/types/fields/DatePicker/DateRangePicker.d.ts.map +1 -1
- package/types/fields/DatePicker/MultiDatePicker.d.ts.map +1 -1
- package/types/fields/Duration/index.d.ts.map +1 -1
- package/types/fields/FileUpload/index.d.ts.map +1 -1
- package/types/fields/FileUpload/nativePickerLoader.d.ts +8 -0
- package/types/fields/FileUpload/nativePickerLoader.d.ts.map +1 -1
- package/types/fields/Geolocation/GeolocationMap.d.ts.map +1 -1
- package/types/fields/Geolocation/geocoderContext.d.ts +24 -0
- package/types/fields/Geolocation/geocoderContext.d.ts.map +1 -0
- package/types/fields/Geolocation/index.d.ts +2 -1
- package/types/fields/Geolocation/index.d.ts.map +1 -1
- package/types/fields/Geolocation/photonGeocoder.d.ts +46 -0
- package/types/fields/Geolocation/photonGeocoder.d.ts.map +1 -0
- package/types/fields/Input/index.d.ts +19 -1
- package/types/fields/Input/index.d.ts.map +1 -1
- package/types/fields/MentionInput/index.d.ts.map +1 -1
- package/types/fields/OTPInput/index.d.ts +1 -1
- package/types/fields/OTPInput/index.d.ts.map +1 -1
- package/types/fields/PhoneInput/index.d.ts.map +1 -1
- package/types/fields/PhoneInput/phone.d.ts.map +1 -1
- package/types/fields/PhoneInput/regionNames.d.ts +2 -0
- package/types/fields/PhoneInput/regionNames.d.ts.map +1 -0
- package/types/fields/RadioGroup/index.d.ts.map +1 -1
- package/types/fields/SearchInput/index.d.ts.map +1 -1
- package/types/fields/Select/index.d.ts.map +1 -1
- package/types/fields/Signature/index.d.ts.map +1 -1
- package/types/fields/Slider/index.d.ts.map +1 -1
- package/types/fields/Slider/jumpMotion.d.ts +1 -1
- package/types/fields/Slider/jumpMotion.d.ts.map +1 -1
- package/types/fields/Stepper/index.d.ts +6 -0
- package/types/fields/Stepper/index.d.ts.map +1 -1
- package/types/fields/Switch/footprint.d.ts +12 -0
- package/types/fields/Switch/footprint.d.ts.map +1 -0
- package/types/fields/Switch/index.d.ts.map +1 -1
- package/types/fields/TextArea/index.d.ts.map +1 -1
- package/types/fields/TimePicker/catalog.d.ts.map +1 -1
- package/types/fields/TimePicker/parts.d.ts.map +1 -1
- package/types/index.d.ts +8 -0
- package/types/index.d.ts.map +1 -1
- package/types/shared/panelPortal.d.ts +13 -0
- package/types/shared/panelPortal.d.ts.map +1 -0
- package/types/shared/pressSlopProps.d.ts +9 -2
- package/types/shared/pressSlopProps.d.ts.map +1 -1
- package/types/shared/utils.d.ts +1 -1
- package/types/shared/utils.d.ts.map +1 -1
- package/types/themedPrimitives.d.ts +48 -1
- package/types/themedPrimitives.d.ts.map +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useTouchSurface } from "@multiplatform.one/theme";
|
|
1
2
|
import type { DeepKeys, DeepValue } from "@tanstack/form-core";
|
|
2
3
|
import { formatAbsoluteDate, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
3
4
|
import { type ComponentProps, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -306,6 +307,7 @@ export function MultiDatePicker<
|
|
|
306
307
|
TFormValidator extends Validator<TParentData, unknown> | undefined = undefined,
|
|
307
308
|
TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>,
|
|
308
309
|
>(props: MultiDatePickerProps<TParentData, TName, TFieldValidator, TFormValidator, TData>) {
|
|
310
|
+
const hydrationTouch = useTouchSurface();
|
|
309
311
|
const {
|
|
310
312
|
defaultValue,
|
|
311
313
|
value: valueProp,
|
|
@@ -338,7 +340,7 @@ export function MultiDatePicker<
|
|
|
338
340
|
const { resolvedForm, knobProps, id } = useFormField({ form, id: idProp, compact });
|
|
339
341
|
const resolvedValidators = useResolvedValidators(required, validators, label, name, isEmptyDates);
|
|
340
342
|
const resolvedSize = (size ?? knobProps.sizeToken) as SizeTokens;
|
|
341
|
-
const visualHeight = getFieldHeight(resolvedSize);
|
|
343
|
+
const visualHeight = getFieldHeight(resolvedSize, 1, hydrationTouch);
|
|
342
344
|
|
|
343
345
|
const initialDates = (
|
|
344
346
|
Array.isArray(valueProp) ? valueProp : Array.isArray(defaultValue) ? defaultValue : []
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useTouchSurface } from "@multiplatform.one/theme";
|
|
1
2
|
import { sizeRecipeForToken, type KnobProps } from "@multiplatform.one/theme";
|
|
2
3
|
import { ClockIcon } from "@phosphor-icons/react";
|
|
3
4
|
import type { ReactNode } from "react";
|
|
@@ -434,6 +435,7 @@ export function Duration({
|
|
|
434
435
|
skeleton,
|
|
435
436
|
compact,
|
|
436
437
|
}: DurationProps) {
|
|
438
|
+
const hydrationTouch = useTouchSurface();
|
|
437
439
|
const { resolvedForm, knobProps, id } = useFormField({
|
|
438
440
|
form: formProp,
|
|
439
441
|
id: idProp,
|
|
@@ -445,7 +447,7 @@ export function Duration({
|
|
|
445
447
|
const seconds = normalizeSeconds(isControlled ? value : internal);
|
|
446
448
|
const inTableCell = useIsInTableCell();
|
|
447
449
|
const resolvedSize = (size ?? knobProps.sizeToken) as SizeTokens;
|
|
448
|
-
const visualHeight = getFieldHeight(resolvedSize);
|
|
450
|
+
const visualHeight = getFieldHeight(resolvedSize, 1, hydrationTouch);
|
|
449
451
|
|
|
450
452
|
const handleChange = useCallback(
|
|
451
453
|
(next: number, fieldChange?: (v: any) => void) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useTouchSurface } from "@multiplatform.one/theme";
|
|
1
2
|
import { FileIcon, UploadIcon, XIcon } from "@phosphor-icons/react";
|
|
2
3
|
import type { DeepKeys, DeepValue } from "@tanstack/form-core";
|
|
3
4
|
import { type DragEvent, type ReactNode, useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -195,6 +196,7 @@ export function FileUpload<
|
|
|
195
196
|
TFormValidator extends Validator<TParentData, unknown> | undefined = undefined,
|
|
196
197
|
TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>,
|
|
197
198
|
>(props: FileUploadProps<TParentData, TName, TFieldValidator, TFormValidator, TData>) {
|
|
199
|
+
const hydrationTouch = useTouchSurface();
|
|
198
200
|
const {
|
|
199
201
|
defaultValue,
|
|
200
202
|
form,
|
|
@@ -263,7 +265,7 @@ export function FileUpload<
|
|
|
263
265
|
// frame move together per size. The corner remove disc hangs a quarter of
|
|
264
266
|
// its own nestedControl step (8 at medium) outside the tile's top-right,
|
|
265
267
|
// which is the Bento Image Picker overlap read under the house tokens.
|
|
266
|
-
const tilePx = getFieldHeight(knobProps.sizeToken as SizeTokens, 2);
|
|
268
|
+
const tilePx = getFieldHeight(knobProps.sizeToken as SizeTokens, 2, hydrationTouch);
|
|
267
269
|
const tileRemoveInset = -Math.round(knobProps.nestedControl.px / 4);
|
|
268
270
|
|
|
269
271
|
const [selectedFiles, setSelectedFiles] = useState<File[]>([]);
|
|
@@ -688,7 +690,11 @@ export function FileUpload<
|
|
|
688
690
|
|
|
689
691
|
// Render skeleton placeholder
|
|
690
692
|
if (skeleton) {
|
|
691
|
-
const minHeightPx = getFieldHeight(
|
|
693
|
+
const minHeightPx = getFieldHeight(
|
|
694
|
+
(fieldProps.size || knobProps.sizeToken) as SizeTokens,
|
|
695
|
+
5,
|
|
696
|
+
hydrationTouch,
|
|
697
|
+
);
|
|
692
698
|
return (
|
|
693
699
|
<FieldLayout id={id} label={fieldProps.label} size={fieldProps.size} knobProps={knobProps}>
|
|
694
700
|
<Skeleton variant="rounded" width="100%" height={minHeightPx} />
|
|
@@ -876,7 +882,11 @@ export function FileUpload<
|
|
|
876
882
|
// CONTRACT (boards media-01..03): the getFieldHeight floor sits on
|
|
877
883
|
// the FRAME, so the frame border-box measures 220 — hanging it on
|
|
878
884
|
// the inner stack painted 222, a number no token expresses.
|
|
879
|
-
minHeight={getFieldHeight(
|
|
885
|
+
minHeight={getFieldHeight(
|
|
886
|
+
(fieldProps.size || knobProps.sizeToken) as SizeTokens,
|
|
887
|
+
5,
|
|
888
|
+
hydrationTouch,
|
|
889
|
+
)}
|
|
880
890
|
aria-required={fieldProps.required || undefined}
|
|
881
891
|
aria-invalid={!!errorProp || undefined}
|
|
882
892
|
aria-readonly={readOnly || undefined}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { pickerNativeModules } from "./nativePickerLoader";
|
|
6
|
+
|
|
7
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
/** Every native module name a package's build asks expo-modules-core for. */
|
|
10
|
+
function registeredNativeModules(pkg: string): string[] {
|
|
11
|
+
const build = join(dirname(nodeRequire.resolve(`${pkg}/package.json`)), "build");
|
|
12
|
+
const names = new Set<string>();
|
|
13
|
+
for (const file of readdirSync(build)) {
|
|
14
|
+
if (!file.endsWith(".js")) continue;
|
|
15
|
+
const source = readFileSync(join(build, file), "utf8");
|
|
16
|
+
for (const match of source.matchAll(/require(?:Optional)?NativeModule\(\s*['"]([^'"]+)['"]/g)) {
|
|
17
|
+
names.add(match[1]!);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return [...names];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// MPO-73: the probe runs before the require, so a name the package never
|
|
24
|
+
// registers makes the picker look absent and an image-only field opens the
|
|
25
|
+
// Files browser instead of the photo library.
|
|
26
|
+
describe("native picker probes", () => {
|
|
27
|
+
it("probe the name expo-image-picker registers", () => {
|
|
28
|
+
expect(registeredNativeModules("expo-image-picker")).toContain(pickerNativeModules.image);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("probe the name expo-document-picker registers", () => {
|
|
32
|
+
expect(registeredNativeModules("expo-document-picker")).toContain(pickerNativeModules.document);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export type DocumentPickerModule = typeof import("expo-document-picker");
|
|
2
2
|
export type ImagePickerModule = typeof import("expo-image-picker");
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* The names each picker registers with expo-modules-core. expo-image-picker
|
|
6
|
+
* keeps its Exponent-era name (MPO-73).
|
|
7
|
+
*/
|
|
8
|
+
export const pickerNativeModules = {
|
|
9
|
+
document: "ExpoDocumentPicker",
|
|
10
|
+
image: "ExponentImagePicker",
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
4
13
|
let cachedDocumentPicker: DocumentPickerModule | null | undefined;
|
|
5
14
|
let cachedImagePicker: ImagePickerModule | null | undefined;
|
|
6
15
|
|
|
@@ -36,7 +45,7 @@ function hasNativeModule(name: string): boolean {
|
|
|
36
45
|
export function loadDocumentPicker(): DocumentPickerModule | null {
|
|
37
46
|
if (cachedDocumentPicker !== undefined) return cachedDocumentPicker;
|
|
38
47
|
try {
|
|
39
|
-
cachedDocumentPicker = hasNativeModule(
|
|
48
|
+
cachedDocumentPicker = hasNativeModule(pickerNativeModules.document)
|
|
40
49
|
? (require("expo-document-picker") as DocumentPickerModule)
|
|
41
50
|
: null;
|
|
42
51
|
} catch {
|
|
@@ -49,7 +58,7 @@ export function loadDocumentPicker(): DocumentPickerModule | null {
|
|
|
49
58
|
export function loadImagePicker(): ImagePickerModule | null {
|
|
50
59
|
if (cachedImagePicker !== undefined) return cachedImagePicker;
|
|
51
60
|
try {
|
|
52
|
-
cachedImagePicker = hasNativeModule(
|
|
61
|
+
cachedImagePicker = hasNativeModule(pickerNativeModules.image)
|
|
53
62
|
? (require("expo-image-picker") as ImagePickerModule)
|
|
54
63
|
: null;
|
|
55
64
|
} catch {
|
|
@@ -4,7 +4,8 @@ import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
|
4
4
|
import { Form } from "../../Form";
|
|
5
5
|
import { TableCellContext } from "../../shared/tableCellContext";
|
|
6
6
|
import { Geolocation, preflightGeolocation } from "./index";
|
|
7
|
-
import type { GeocodeResult } from "./geocoder";
|
|
7
|
+
import type { GeocodeResult, Geocoder } from "./geocoder";
|
|
8
|
+
import { GeocoderProvider } from "./geocoderContext";
|
|
8
9
|
import { Theme } from "tamagui";
|
|
9
10
|
import { NavigationArrowIcon } from "@phosphor-icons/react";
|
|
10
11
|
|
|
@@ -31,6 +32,15 @@ function searchInput(container: HTMLElement | Document = document) {
|
|
|
31
32
|
container.querySelector("[aria-label='Search for a location']")) as HTMLInputElement | null;
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
const mapControlSelector =
|
|
36
|
+
"button, input, textarea, select, [role='button'], [role='combobox'], [role='option'], [tabindex]";
|
|
37
|
+
|
|
38
|
+
function mapControls(container: HTMLElement): Element[] {
|
|
39
|
+
const map = container.querySelector("[data-testid='geolocation-map']");
|
|
40
|
+
expect(map).not.toBeNull();
|
|
41
|
+
return [...(map as HTMLElement).querySelectorAll(mapControlSelector)];
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
function typeSearch(container: HTMLElement, text: string) {
|
|
35
45
|
const input = searchInput(container);
|
|
36
46
|
expect(input).not.toBeNull();
|
|
@@ -161,6 +171,35 @@ describe("Geolocation", () => {
|
|
|
161
171
|
expect(result.container.querySelector("[data-testid='geolocation-coords-chip']")).toBeNull();
|
|
162
172
|
});
|
|
163
173
|
|
|
174
|
+
it.each([
|
|
175
|
+
["a set value", HELSINKI],
|
|
176
|
+
["the empty state", ""],
|
|
177
|
+
])("with %s, nothing interactive sits on the map; the controls live below it", (_, value) => {
|
|
178
|
+
const result = renderWithProviders(
|
|
179
|
+
<Geolocation
|
|
180
|
+
label="Location"
|
|
181
|
+
value={value}
|
|
182
|
+
geocode={mockGeocode()}
|
|
183
|
+
locationIcon={locationIcon}
|
|
184
|
+
expandIcon={<span data-testid="expand-icon" />}
|
|
185
|
+
/>,
|
|
186
|
+
);
|
|
187
|
+
expect(mapControls(result.container)).toEqual([]);
|
|
188
|
+
const map = result.container.querySelector("[data-testid='geolocation-map']") as HTMLElement;
|
|
189
|
+
const footer = result.container.querySelector(
|
|
190
|
+
"[data-testid='geolocation-map-footer']",
|
|
191
|
+
) as HTMLElement;
|
|
192
|
+
expect(footer).not.toBeNull();
|
|
193
|
+
expect(map.compareDocumentPosition(footer) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
|
194
|
+
const locate = footer.querySelector(
|
|
195
|
+
value ? "[aria-label='Locate']" : "[aria-label='Use my current location']",
|
|
196
|
+
);
|
|
197
|
+
expect(locate).not.toBeNull();
|
|
198
|
+
expect(locate?.textContent).toContain(value ? "Locate" : "Use my current location");
|
|
199
|
+
expect(footer.querySelector("[aria-label='Expand map']")).not.toBeNull();
|
|
200
|
+
expect(footer.querySelector("[data-testid='geolocation-coordline']")).not.toBeNull();
|
|
201
|
+
});
|
|
202
|
+
|
|
164
203
|
it("without an injected geocoder, search is disabled and map/manual paths stay", () => {
|
|
165
204
|
const result = renderWithProviders(
|
|
166
205
|
<Geolocation label="Location" value={HELSINKI} locationIcon={locationIcon} />,
|
|
@@ -280,6 +319,37 @@ describe("Geolocation", () => {
|
|
|
280
319
|
expect(onChange).toHaveBeenCalled();
|
|
281
320
|
});
|
|
282
321
|
|
|
322
|
+
it("after a geocoder failure the coordinate editor still commits", async () => {
|
|
323
|
+
const geocode = vi.fn().mockRejectedValue(new Error("down"));
|
|
324
|
+
const onChange = vi.fn();
|
|
325
|
+
const result = renderWithProviders(
|
|
326
|
+
<Geolocation
|
|
327
|
+
label="Location"
|
|
328
|
+
geocode={geocode}
|
|
329
|
+
onChange={onChange}
|
|
330
|
+
locationIcon={locationIcon}
|
|
331
|
+
/>,
|
|
332
|
+
);
|
|
333
|
+
typeSearch(result.container, "manner");
|
|
334
|
+
await waitFor(() => {
|
|
335
|
+
expect(document.body.textContent).toContain(
|
|
336
|
+
"Search is unavailable — check your connection",
|
|
337
|
+
);
|
|
338
|
+
});
|
|
339
|
+
fireEvent.keyDown(document, { key: "Escape" });
|
|
340
|
+
fireEvent.click(result.container.querySelector("[aria-label='Edit coordinates']") as Element);
|
|
341
|
+
const lat = await waitFor(() => {
|
|
342
|
+
const input = document.querySelector("input[aria-label='Latitude']");
|
|
343
|
+
expect(input).not.toBeNull();
|
|
344
|
+
return input as HTMLInputElement;
|
|
345
|
+
});
|
|
346
|
+
fireEvent.change(lat, { target: { value: "12.5" } });
|
|
347
|
+
await waitFor(() => {
|
|
348
|
+
expect(onChange).toHaveBeenCalledWith(JSON.stringify({ lat: 12.5, lng: 0 }));
|
|
349
|
+
});
|
|
350
|
+
expect(result.container.querySelector("[data-testid='geolocation-map']")).not.toBeNull();
|
|
351
|
+
});
|
|
352
|
+
|
|
283
353
|
it("a typed lat, lng pair offers the exact point", async () => {
|
|
284
354
|
const geocode = mockGeocode();
|
|
285
355
|
const onChange = vi.fn();
|
|
@@ -573,6 +643,55 @@ describe("Geolocation", () => {
|
|
|
573
643
|
});
|
|
574
644
|
});
|
|
575
645
|
|
|
646
|
+
describe("GeocoderProvider", () => {
|
|
647
|
+
const provided: Geocoder = {
|
|
648
|
+
geocode: mockGeocode(),
|
|
649
|
+
reverseGeocode: mockReverse(),
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
it("hands its geocoder to a field that was given none", async () => {
|
|
653
|
+
const result = renderWithProviders(
|
|
654
|
+
<GeocoderProvider geocoder={provided}>
|
|
655
|
+
<Geolocation label="Location" value={HELSINKI} locationIcon={locationIcon} />
|
|
656
|
+
</GeocoderProvider>,
|
|
657
|
+
);
|
|
658
|
+
await waitFor(() => {
|
|
659
|
+
expect(searchInput(result.container)?.value).toBe(
|
|
660
|
+
"Mannerheimintie 3, Kamppi, Helsinki, Finland",
|
|
661
|
+
);
|
|
662
|
+
});
|
|
663
|
+
expect(searchInput(result.container)?.disabled).toBe(false);
|
|
664
|
+
typeSearch(result.container, "manner");
|
|
665
|
+
await waitFor(() => {
|
|
666
|
+
expect(provided.geocode).toHaveBeenCalledWith({ query: "manner" });
|
|
667
|
+
});
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
it("loses to the field's own props, and geocoder={null} opts out", async () => {
|
|
671
|
+
const own = mockReverse({ ...mannerheim, label: "Own provider", description: undefined });
|
|
672
|
+
const result = renderWithProviders(
|
|
673
|
+
<GeocoderProvider geocoder={provided}>
|
|
674
|
+
<Geolocation
|
|
675
|
+
label="Own"
|
|
676
|
+
value={HELSINKI}
|
|
677
|
+
reverseGeocode={own}
|
|
678
|
+
locationIcon={locationIcon}
|
|
679
|
+
/>
|
|
680
|
+
<Geolocation label="None" value={HELSINKI} geocoder={null} locationIcon={locationIcon} />
|
|
681
|
+
</GeocoderProvider>,
|
|
682
|
+
);
|
|
683
|
+
const inputs = () =>
|
|
684
|
+
[
|
|
685
|
+
...result.container.querySelectorAll("[data-testid='geolocation-search']"),
|
|
686
|
+
] as HTMLInputElement[];
|
|
687
|
+
await waitFor(() => {
|
|
688
|
+
expect(inputs()[0].value).toBe("Own provider");
|
|
689
|
+
});
|
|
690
|
+
expect(inputs()[1].value).toBe("");
|
|
691
|
+
expect(inputs()[1].disabled).toBe(true);
|
|
692
|
+
});
|
|
693
|
+
});
|
|
694
|
+
|
|
576
695
|
describe("geolocation pre-flight (LC-19 CAPABILITY-PREFLIGHT)", () => {
|
|
577
696
|
afterEach(() => {
|
|
578
697
|
vi.unstubAllGlobals();
|
|
@@ -628,7 +747,7 @@ describe("Geolocation", () => {
|
|
|
628
747
|
const result = renderWithProviders(
|
|
629
748
|
<Geolocation label="Location" name="loc" locationIcon={locationIcon} />,
|
|
630
749
|
);
|
|
631
|
-
const button = result.container.querySelector("[aria-label='
|
|
750
|
+
const button = result.container.querySelector("[aria-label='Use my current location']");
|
|
632
751
|
expect(button).not.toBeNull();
|
|
633
752
|
fireEvent.click(button as Element);
|
|
634
753
|
await waitFor(() => {
|
|
@@ -650,7 +769,9 @@ describe("Geolocation", () => {
|
|
|
650
769
|
const result = renderWithProviders(
|
|
651
770
|
<Geolocation label="Location" name="loc" locationIcon={locationIcon} />,
|
|
652
771
|
);
|
|
653
|
-
fireEvent.click(
|
|
772
|
+
fireEvent.click(
|
|
773
|
+
result.container.querySelector("[aria-label='Use my current location']") as Element,
|
|
774
|
+
);
|
|
654
775
|
await waitFor(() => {
|
|
655
776
|
expect(result.container.textContent).toContain("permission denied");
|
|
656
777
|
});
|
|
@@ -681,7 +802,9 @@ describe("Geolocation", () => {
|
|
|
681
802
|
const result = renderWithProviders(
|
|
682
803
|
<Geolocation label="Location" name="loc" locationIcon={locationIcon} />,
|
|
683
804
|
);
|
|
684
|
-
fireEvent.click(
|
|
805
|
+
fireEvent.click(
|
|
806
|
+
result.container.querySelector("[aria-label='Use my current location']") as Element,
|
|
807
|
+
);
|
|
685
808
|
|
|
686
809
|
await waitFor(() => {
|
|
687
810
|
expect(
|
|
@@ -689,6 +812,7 @@ describe("Geolocation", () => {
|
|
|
689
812
|
).not.toBeNull();
|
|
690
813
|
expect(result.container.textContent).toContain("timed out");
|
|
691
814
|
});
|
|
815
|
+
expect(mapControls(result.container)).toEqual([]);
|
|
692
816
|
const retry = result.container.querySelector("[aria-label='Retry location']");
|
|
693
817
|
expect(retry).not.toBeNull();
|
|
694
818
|
expect(getCurrentPosition).toHaveBeenCalledTimes(1);
|
|
@@ -797,3 +921,40 @@ describe("Geolocation", () => {
|
|
|
797
921
|
});
|
|
798
922
|
});
|
|
799
923
|
});
|
|
924
|
+
|
|
925
|
+
describe("Geolocation search opens on intent, not on focus (MPO-360)", () => {
|
|
926
|
+
const resultsPanel = () => document.querySelector("[data-testid='geolocation-results']");
|
|
927
|
+
|
|
928
|
+
it("a focus alone, as a cell editor's focus-into-panel gives, leaves the results closed", async () => {
|
|
929
|
+
const result = renderWithProviders(
|
|
930
|
+
<Geolocation label="Location" geocode={mockGeocode()} locationIcon={locationIcon} />,
|
|
931
|
+
);
|
|
932
|
+
const input = searchInput(result.container) as HTMLInputElement;
|
|
933
|
+
input.focus();
|
|
934
|
+
fireEvent.focus(input);
|
|
935
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
936
|
+
expect(resultsPanel()).toBeNull();
|
|
937
|
+
expect(input.getAttribute("aria-expanded")).toBe("false");
|
|
938
|
+
});
|
|
939
|
+
|
|
940
|
+
it("a press on the search still opens the results with Use my current location first", async () => {
|
|
941
|
+
const result = renderWithProviders(
|
|
942
|
+
<Geolocation label="Location" geocode={mockGeocode()} locationIcon={locationIcon} />,
|
|
943
|
+
);
|
|
944
|
+
fireEvent.click(searchInput(result.container) as HTMLInputElement);
|
|
945
|
+
await waitFor(() => expect(resultsPanel()).not.toBeNull());
|
|
946
|
+
expect((resultsPanel() as HTMLElement).firstElementChild?.getAttribute("data-testid")).toBe(
|
|
947
|
+
"geolocation-use-location",
|
|
948
|
+
);
|
|
949
|
+
});
|
|
950
|
+
|
|
951
|
+
it("ArrowDown on a focused search opens the results", async () => {
|
|
952
|
+
const result = renderWithProviders(
|
|
953
|
+
<Geolocation label="Location" geocode={mockGeocode()} locationIcon={locationIcon} />,
|
|
954
|
+
);
|
|
955
|
+
const input = searchInput(result.container) as HTMLInputElement;
|
|
956
|
+
input.focus();
|
|
957
|
+
fireEvent.keyDown(input, { key: "ArrowDown" });
|
|
958
|
+
await waitFor(() => expect(resultsPanel()).not.toBeNull());
|
|
959
|
+
});
|
|
960
|
+
});
|
|
@@ -10,7 +10,9 @@ import { Form } from "../../Form";
|
|
|
10
10
|
import { TableCellContext } from "../../shared/tableCellContext";
|
|
11
11
|
import { Geolocation, type GeolocationProps } from "./index";
|
|
12
12
|
import type { GeocodeResult, Geocoder } from "./geocoder";
|
|
13
|
+
import { GeocoderProvider } from "./geocoderContext";
|
|
13
14
|
import { parseGeoValue } from "./geoValue";
|
|
15
|
+
import { createPhotonGeocoder } from "./photonGeocoder";
|
|
14
16
|
|
|
15
17
|
const meta: Meta<typeof Geolocation> = {
|
|
16
18
|
title: "Forms/Geolocation",
|
|
@@ -19,7 +21,7 @@ const meta: Meta<typeof Geolocation> = {
|
|
|
19
21
|
docs: {
|
|
20
22
|
description: {
|
|
21
23
|
component:
|
|
22
|
-
"Search-first geolocation field. Inject `geocode` / `reverseGeocode` (or a `geocoder` object)
|
|
24
|
+
"Search-first geolocation field. Inject `geocode` / `reverseGeocode` (or a `geocoder` object), or wrap an app in `GeocoderProvider`; the field supplies no provider of its own. `createPhotonGeocoder()` is a keyless opt-in adapter (the Live stories use it). The map is the output and carries no controls: coordinates, Locate and Expand sit in a row below it. LC-19 preflight gates Locate. LC-21: no Apply on the coordinate editor.",
|
|
23
25
|
},
|
|
24
26
|
},
|
|
25
27
|
},
|
|
@@ -71,7 +73,7 @@ export const Main: Story = {
|
|
|
71
73
|
export const Standalone: Story = {
|
|
72
74
|
args: {
|
|
73
75
|
label: "Location",
|
|
74
|
-
helperText: "Click the map to set a pin, or
|
|
76
|
+
helperText: "Click the map to set a pin, or edit the coordinates below it",
|
|
75
77
|
},
|
|
76
78
|
render: (args) => <Geolocation {...args} locationIcon={<NavigationArrowIcon size={16} />} />,
|
|
77
79
|
};
|
|
@@ -92,7 +94,7 @@ export const Bare: Story = {
|
|
|
92
94
|
export const Basic: Story = {
|
|
93
95
|
args: {
|
|
94
96
|
label: "Location",
|
|
95
|
-
helperText: "Click the map to set a pin, or
|
|
97
|
+
helperText: "Click the map to set a pin, or edit the coordinates below it",
|
|
96
98
|
onChange: action("onChange"),
|
|
97
99
|
},
|
|
98
100
|
render: (args) => <Geolocation {...args} locationIcon={<NavigationArrowIcon size={16} />} />,
|
|
@@ -120,7 +122,7 @@ export const Disabled: Story = {
|
|
|
120
122
|
export const WithError: Story = {
|
|
121
123
|
args: {
|
|
122
124
|
label: "Location",
|
|
123
|
-
helperText: "Click the map to set a pin, or
|
|
125
|
+
helperText: "Click the map to set a pin, or edit the coordinates below it",
|
|
124
126
|
required: true,
|
|
125
127
|
error: "Location is required",
|
|
126
128
|
onChange: action("onChange"),
|
|
@@ -217,7 +219,7 @@ export const WithExpandButton: Story = {
|
|
|
217
219
|
<YStack gap="$4" maxWidth={500}>
|
|
218
220
|
<Geolocation
|
|
219
221
|
label="Delivery Location"
|
|
220
|
-
helperText="
|
|
222
|
+
helperText="Press Expand below the map for a larger view"
|
|
221
223
|
value={value}
|
|
222
224
|
onChange={(v) => {
|
|
223
225
|
setValue(v);
|
|
@@ -274,29 +276,31 @@ export const SkeletonState: Story = {
|
|
|
274
276
|
type InTableRow = { id: string; label: string; value: { lat: number; lng: number } | "" };
|
|
275
277
|
|
|
276
278
|
/** LC-06: Geolocation stays hosted in DataTable; the cell opens a modal. */
|
|
279
|
+
function InTableExample({ geocoder }: { geocoder?: Geocoder }) {
|
|
280
|
+
const [data, setData] = useState<InTableRow[]>([
|
|
281
|
+
{ id: "1", label: "Alpha", value: { lat: 30.2672, lng: -97.7431 } },
|
|
282
|
+
{ id: "2", label: "Beta", value: { lat: 48.8566, lng: 2.3522 } },
|
|
283
|
+
{ id: "3", label: "Gamma", value: "" },
|
|
284
|
+
]);
|
|
285
|
+
const columns: DataTableColumn<InTableRow>[] = [
|
|
286
|
+
{ accessorKey: "label", header: "Row" },
|
|
287
|
+
{
|
|
288
|
+
accessorKey: "value",
|
|
289
|
+
header: "Location",
|
|
290
|
+
field: "geolocation",
|
|
291
|
+
fieldProps: { locationIcon: <NavigationArrowIcon size={16} />, geocoder },
|
|
292
|
+
},
|
|
293
|
+
];
|
|
294
|
+
return (
|
|
295
|
+
<YStack width="100%" height={320}>
|
|
296
|
+
<DataTable data={data} columns={columns} enablePagination={false} onDataChange={setData} />
|
|
297
|
+
</YStack>
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
277
301
|
export const InTable: Story = {
|
|
278
302
|
name: "In table",
|
|
279
|
-
render: () =>
|
|
280
|
-
const [data, setData] = useState<InTableRow[]>([
|
|
281
|
-
{ id: "1", label: "Alpha", value: { lat: 30.2672, lng: -97.7431 } },
|
|
282
|
-
{ id: "2", label: "Beta", value: { lat: 48.8566, lng: 2.3522 } },
|
|
283
|
-
{ id: "3", label: "Gamma", value: "" },
|
|
284
|
-
]);
|
|
285
|
-
const columns: DataTableColumn<InTableRow>[] = [
|
|
286
|
-
{ accessorKey: "label", header: "Row" },
|
|
287
|
-
{
|
|
288
|
-
accessorKey: "value",
|
|
289
|
-
header: "Location",
|
|
290
|
-
field: "geolocation",
|
|
291
|
-
fieldProps: { locationIcon: <NavigationArrowIcon size={16} /> },
|
|
292
|
-
},
|
|
293
|
-
];
|
|
294
|
-
return (
|
|
295
|
-
<YStack width="100%" height={320}>
|
|
296
|
-
<DataTable data={data} columns={columns} enablePagination={false} onDataChange={setData} />
|
|
297
|
-
</YStack>
|
|
298
|
-
);
|
|
299
|
-
},
|
|
303
|
+
render: () => <InTableExample />,
|
|
300
304
|
};
|
|
301
305
|
|
|
302
306
|
const places: GeocodeResult[] = [
|
|
@@ -347,6 +351,12 @@ export const FailedFakeProvider: Story = {
|
|
|
347
351
|
render: (args) => <FakeProviderExample {...args} />,
|
|
348
352
|
};
|
|
349
353
|
|
|
354
|
+
/** The table's cell editor with a live search: opening it must not open the results (MPO-360). */
|
|
355
|
+
export const InTableWithFakeProvider: Story = {
|
|
356
|
+
name: "In table with fake provider",
|
|
357
|
+
render: () => <InTableExample geocoder={fakeGeocoder} />,
|
|
358
|
+
};
|
|
359
|
+
|
|
350
360
|
/** Direct cell contract, independent of the table adapter's display formatter. */
|
|
351
361
|
export const CellWithFakeProvider: Story = {
|
|
352
362
|
args: {
|
|
@@ -429,3 +439,77 @@ function PendingReverseExample() {
|
|
|
429
439
|
export const PendingControlledReverse: Story = {
|
|
430
440
|
render: () => <PendingReverseExample />,
|
|
431
441
|
};
|
|
442
|
+
|
|
443
|
+
const photon = createPhotonGeocoder();
|
|
444
|
+
|
|
445
|
+
function LiveField(props: GeolocationProps) {
|
|
446
|
+
const [value, setValue] = useState(props.value ?? "");
|
|
447
|
+
return (
|
|
448
|
+
<Geolocation
|
|
449
|
+
{...props}
|
|
450
|
+
value={value}
|
|
451
|
+
onChange={(next) => {
|
|
452
|
+
setValue(next);
|
|
453
|
+
action("onChange")(next);
|
|
454
|
+
}}
|
|
455
|
+
/>
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Keyless live search through Photon (photon.komoot.io). Type a place name;
|
|
461
|
+
* the results panel lists real geocoded places. No key, no account.
|
|
462
|
+
*/
|
|
463
|
+
export const LiveKeylessSearch: Story = {
|
|
464
|
+
render: () => (
|
|
465
|
+
<GeocoderProvider geocoder={photon}>
|
|
466
|
+
<YStack gap="$4" maxWidth={500}>
|
|
467
|
+
<LiveField label="Location" expandIcon={<ArrowsOutIcon size={16} />} />
|
|
468
|
+
</YStack>
|
|
469
|
+
</GeocoderProvider>
|
|
470
|
+
),
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
/** A set value reverse-geocodes to an address, editable and read-only. */
|
|
474
|
+
export const LiveKeylessAddress: Story = {
|
|
475
|
+
render: () => (
|
|
476
|
+
<GeocoderProvider geocoder={photon}>
|
|
477
|
+
<YStack gap="$4" maxWidth={500}>
|
|
478
|
+
<LiveField label="Office" value={JSON.stringify({ lat: 60.16952, lng: 24.93545 })} />
|
|
479
|
+
<Geolocation
|
|
480
|
+
label="Office (read-only)"
|
|
481
|
+
value={JSON.stringify({ lat: 60.16952, lng: 24.93545 })}
|
|
482
|
+
readOnly
|
|
483
|
+
/>
|
|
484
|
+
</YStack>
|
|
485
|
+
</GeocoderProvider>
|
|
486
|
+
),
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
type LiveRow = { id: string; label: string; value: { lat: number; lng: number } | "" };
|
|
490
|
+
|
|
491
|
+
function LiveTable() {
|
|
492
|
+
const [data, setData] = useState<LiveRow[]>([
|
|
493
|
+
{ id: "1", label: "Austin", value: { lat: 30.2672, lng: -97.7431 } },
|
|
494
|
+
{ id: "2", label: "Paris", value: { lat: 48.8566, lng: 2.3522 } },
|
|
495
|
+
{ id: "3", label: "Empty", value: "" },
|
|
496
|
+
]);
|
|
497
|
+
const columns: DataTableColumn<LiveRow>[] = [
|
|
498
|
+
{ accessorKey: "label", header: "Row" },
|
|
499
|
+
{ accessorKey: "value", header: "Location", field: "geolocation" },
|
|
500
|
+
];
|
|
501
|
+
return (
|
|
502
|
+
<YStack width="100%" height={320}>
|
|
503
|
+
<DataTable data={data} columns={columns} enablePagination={false} onDataChange={setData} />
|
|
504
|
+
</YStack>
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/** The provider reaches fields a table renders: cell faces read as addresses. */
|
|
509
|
+
export const LiveKeylessInTable: Story = {
|
|
510
|
+
render: () => (
|
|
511
|
+
<GeocoderProvider geocoder={photon}>
|
|
512
|
+
<LiveTable />
|
|
513
|
+
</GeocoderProvider>
|
|
514
|
+
),
|
|
515
|
+
};
|
|
@@ -87,6 +87,9 @@ export function GeolocationMap({
|
|
|
87
87
|
key={`${zoom}-${tile.tx}-${tile.ty}-${Math.round(tile.left)}-${Math.round(tile.top)}`}
|
|
88
88
|
alt=""
|
|
89
89
|
draggable={false}
|
|
90
|
+
onError={(event) => {
|
|
91
|
+
event.currentTarget.style.visibility = "hidden";
|
|
92
|
+
}}
|
|
90
93
|
src={tileSrc(zoom, tile.tx, tile.ty)}
|
|
91
94
|
width={OSM_TILE_SIZE}
|
|
92
95
|
height={OSM_TILE_SIZE}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { createContext, useContext, useEffect, useState } from "react";
|
|
3
|
+
import type { Geocoder } from "./geocoder";
|
|
4
|
+
import { formatPlace } from "./geocoder";
|
|
5
|
+
|
|
6
|
+
const GeocoderContext = createContext<Geocoder | null>(null);
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Hands one geocoder to every Geolocation field below it, including fields a
|
|
10
|
+
* registry or a table renders where the app cannot reach props. A field's own
|
|
11
|
+
* `geocode` / `reverseGeocode` / `geocoder` props win, and `geocoder={null}`
|
|
12
|
+
* opts a field out. Create the geocoder once (module scope or `useMemo`), not
|
|
13
|
+
* per render.
|
|
14
|
+
*/
|
|
15
|
+
export function GeocoderProvider({
|
|
16
|
+
geocoder,
|
|
17
|
+
children,
|
|
18
|
+
}: {
|
|
19
|
+
geocoder: Geocoder | null;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
}) {
|
|
22
|
+
return <GeocoderContext.Provider value={geocoder}>{children}</GeocoderContext.Provider>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function useGeocoder(): Geocoder | null {
|
|
26
|
+
return useContext(GeocoderContext);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The provider's address for a pair, or null while it resolves, when no
|
|
31
|
+
* provider is mounted, when nothing is near, or when the lookup fails. A
|
|
32
|
+
* read-only face shows the pair until this answers.
|
|
33
|
+
*/
|
|
34
|
+
export function useReverseGeocodedLabel(pair: { lat: number; lng: number } | null): string | null {
|
|
35
|
+
const geocoder = useGeocoder();
|
|
36
|
+
const lat = pair?.lat;
|
|
37
|
+
const lng = pair?.lng;
|
|
38
|
+
const key = lat === undefined || lng === undefined ? null : `${lat},${lng}`;
|
|
39
|
+
const [resolved, setResolved] = useState<{ key: string; label: string } | null>(null);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!geocoder || lat === undefined || lng === undefined || key === null) return;
|
|
42
|
+
let live = true;
|
|
43
|
+
geocoder.reverseGeocode({ lat, lng }).then(
|
|
44
|
+
(result) => {
|
|
45
|
+
if (live) setResolved(result ? { key, label: formatPlace(result) } : null);
|
|
46
|
+
},
|
|
47
|
+
() => {
|
|
48
|
+
if (live) setResolved(null);
|
|
49
|
+
},
|
|
50
|
+
);
|
|
51
|
+
return () => {
|
|
52
|
+
live = false;
|
|
53
|
+
};
|
|
54
|
+
}, [geocoder, key, lat, lng]);
|
|
55
|
+
return resolved && resolved.key === key ? resolved.label : null;
|
|
56
|
+
}
|