@multiplatform.one/forms 7.46.0 → 7.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Button/index.cjs +14 -3
- package/dist/cjs/Button/index.native.js +18 -7
- package/dist/cjs/Button/index.native.js.map +1 -1
- package/dist/cjs/ErrorSummary.cjs +1 -1
- package/dist/cjs/ErrorSummary.native.js +1 -1
- package/dist/cjs/ErrorSummary.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/PanelPortal.cjs +1 -1
- package/dist/cjs/FloatingPanel/index.cjs +13 -4
- package/dist/cjs/FloatingPanel/index.native.js +9 -2
- package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/trailingAction.cjs +59 -0
- package/dist/cjs/FloatingPanel/trailingAction.native.js +64 -0
- package/dist/cjs/FloatingPanel/trailingAction.native.js.map +1 -0
- package/dist/cjs/FormGrid.cjs +1 -0
- package/dist/cjs/FormGrid.native.js +1 -0
- package/dist/cjs/FormGrid.native.js.map +1 -1
- package/dist/cjs/InputParts/PasswordReveal.cjs +96 -0
- package/dist/cjs/InputParts/PasswordReveal.native.js +104 -0
- package/dist/cjs/InputParts/PasswordReveal.native.js.map +1 -0
- package/dist/cjs/InputParts/index.cjs +95 -5
- package/dist/cjs/InputParts/index.native.js +99 -5
- package/dist/cjs/InputParts/index.native.js.map +1 -1
- package/dist/cjs/fields/ColorPicker/index.cjs +8 -17
- package/dist/cjs/fields/ColorPicker/index.native.js +9 -18
- package/dist/cjs/fields/ColorPicker/index.native.js.map +1 -1
- package/dist/cjs/fields/Combobox/index.cjs +28 -44
- package/dist/cjs/fields/Combobox/index.native.js +30 -45
- package/dist/cjs/fields/Combobox/index.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/Calendar.cjs +3 -4
- package/dist/cjs/fields/DatePicker/Calendar.native.js +3 -4
- package/dist/cjs/fields/DatePicker/Calendar.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/parts.cjs +5 -9
- package/dist/cjs/fields/DatePicker/parts.native.js +5 -9
- package/dist/cjs/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/cjs/fields/Duration/durationMath.cjs +1 -1
- package/dist/cjs/fields/Duration/durationMath.native.js +1 -1
- package/dist/cjs/fields/Duration/durationMath.native.js.map +1 -1
- package/dist/cjs/fields/Duration/index.cjs +100 -90
- package/dist/cjs/fields/Duration/index.native.js +108 -98
- package/dist/cjs/fields/Duration/index.native.js.map +1 -1
- package/dist/cjs/fields/FileUpload/index.cjs +134 -24
- package/dist/cjs/fields/FileUpload/index.native.js +149 -34
- package/dist/cjs/fields/FileUpload/index.native.js.map +1 -1
- package/dist/cjs/fields/Geolocation/GeolocationMap.cjs +2 -1
- package/dist/cjs/fields/Geolocation/GeolocationMap.native.js +3 -2
- package/dist/cjs/fields/Geolocation/GeolocationMap.native.js.map +1 -1
- package/dist/cjs/fields/Geolocation/index.cjs +10 -8
- package/dist/cjs/fields/Geolocation/index.native.js +10 -8
- package/dist/cjs/fields/Geolocation/index.native.js.map +1 -1
- package/dist/cjs/fields/Icon/index.cjs +6 -13
- package/dist/cjs/fields/Icon/index.native.js +6 -13
- package/dist/cjs/fields/Icon/index.native.js.map +1 -1
- package/dist/cjs/fields/ImageField/index.cjs +5 -5
- package/dist/cjs/fields/ImageField/index.native.js +5 -5
- package/dist/cjs/fields/ImageField/index.native.js.map +1 -1
- package/dist/cjs/fields/Input/index.cjs +27 -21
- package/dist/cjs/fields/Input/index.native.js +28 -21
- package/dist/cjs/fields/Input/index.native.js.map +1 -1
- package/dist/cjs/fields/MentionInput/index.cjs +7 -8
- package/dist/cjs/fields/MentionInput/index.native.js +7 -8
- package/dist/cjs/fields/MentionInput/index.native.js.map +1 -1
- package/dist/cjs/fields/OTPInput/index.cjs +1 -1
- package/dist/cjs/fields/OTPInput/index.native.js +1 -1
- package/dist/cjs/fields/OTPInput/index.native.js.map +1 -1
- package/dist/cjs/fields/PhoneInput/index.cjs +3 -3
- package/dist/cjs/fields/PhoneInput/index.native.js +3 -3
- package/dist/cjs/fields/PhoneInput/index.native.js.map +1 -1
- package/dist/cjs/fields/RadioGroup/index.cjs +1 -0
- package/dist/cjs/fields/RadioGroup/index.native.js +1 -0
- package/dist/cjs/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/cjs/fields/SearchInput/index.cjs +4 -48
- package/dist/cjs/fields/SearchInput/index.native.js +4 -46
- package/dist/cjs/fields/SearchInput/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/index.cjs +14 -12
- package/dist/cjs/fields/Select/index.native.js +14 -12
- package/dist/cjs/fields/Select/index.native.js.map +1 -1
- package/dist/cjs/fields/Signature/index.cjs +1 -1
- package/dist/cjs/fields/Signature/index.native.js +1 -1
- package/dist/cjs/fields/Signature/index.native.js.map +1 -1
- package/dist/cjs/fields/Slider/index.cjs +1 -1
- package/dist/cjs/fields/Slider/index.native.js +1 -1
- package/dist/cjs/fields/Slider/index.native.js.map +1 -1
- package/dist/cjs/fields/TimePicker/parts.cjs +5 -9
- package/dist/cjs/fields/TimePicker/parts.native.js +5 -9
- package/dist/cjs/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/cjs/fields/TimeRangeScrubber/index.cjs +14 -9
- package/dist/cjs/fields/TimeRangeScrubber/index.native.js +14 -9
- package/dist/cjs/fields/TimeRangeScrubber/index.native.js.map +1 -1
- package/dist/cjs/fields/ToggleGroup/index.cjs +1 -1
- package/dist/cjs/fields/ToggleGroup/index.native.js +1 -1
- package/dist/cjs/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.cjs +5 -5
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.native.js +5 -5
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/cjs/hooks/useFocusManagement.cjs +3 -2
- package/dist/cjs/hooks/useFocusManagement.native.js +3 -2
- package/dist/cjs/hooks/useFocusManagement.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -0
- package/dist/cjs/index.native.js +7 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/focusManagement.cjs +1 -1
- package/dist/cjs/shared/focusManagement.native.js +1 -1
- package/dist/cjs/shared/panelPortal.cjs +1 -1
- package/dist/cjs/shared/panelPortal.native.js +1 -1
- package/dist/cjs/shared/panelPortal.native.js.map +1 -1
- package/dist/cjs/shared/useDragScroll.cjs +2 -2
- package/dist/cjs/shared/useDragScroll.native.js +2 -2
- package/dist/cjs/shared/useDragScroll.native.js.map +1 -1
- package/dist/esm/Button/index.mjs +17 -6
- package/dist/esm/Button/index.mjs.map +1 -1
- package/dist/esm/Button/index.native.js +21 -10
- package/dist/esm/Button/index.native.js.map +1 -1
- package/dist/esm/ErrorSummary.mjs +2 -2
- package/dist/esm/ErrorSummary.mjs.map +1 -1
- package/dist/esm/ErrorSummary.native.js +2 -2
- package/dist/esm/ErrorSummary.native.js.map +1 -1
- package/dist/esm/FloatingPanel/PanelPortal.mjs +1 -1
- package/dist/esm/FloatingPanel/PanelPortal.mjs.map +1 -1
- package/dist/esm/FloatingPanel/index.mjs +13 -4
- package/dist/esm/FloatingPanel/index.mjs.map +1 -1
- package/dist/esm/FloatingPanel/index.native.js +9 -2
- package/dist/esm/FloatingPanel/index.native.js.map +1 -1
- package/dist/esm/FloatingPanel/trailingAction.mjs +33 -0
- package/dist/esm/FloatingPanel/trailingAction.mjs.map +1 -0
- package/dist/esm/FloatingPanel/trailingAction.native.js +35 -0
- package/dist/esm/FloatingPanel/trailingAction.native.js.map +1 -0
- package/dist/esm/FormGrid.mjs +1 -0
- package/dist/esm/FormGrid.mjs.map +1 -1
- package/dist/esm/FormGrid.native.js +1 -0
- package/dist/esm/FormGrid.native.js.map +1 -1
- package/dist/esm/InputParts/PasswordReveal.mjs +68 -0
- package/dist/esm/InputParts/PasswordReveal.mjs.map +1 -0
- package/dist/esm/InputParts/PasswordReveal.native.js +73 -0
- package/dist/esm/InputParts/PasswordReveal.native.js.map +1 -0
- package/dist/esm/InputParts/index.mjs +97 -8
- package/dist/esm/InputParts/index.mjs.map +1 -1
- package/dist/esm/InputParts/index.native.js +101 -8
- package/dist/esm/InputParts/index.native.js.map +1 -1
- package/dist/esm/fields/ColorPicker/index.mjs +8 -17
- package/dist/esm/fields/ColorPicker/index.mjs.map +1 -1
- package/dist/esm/fields/ColorPicker/index.native.js +9 -18
- package/dist/esm/fields/ColorPicker/index.native.js.map +1 -1
- package/dist/esm/fields/Combobox/index.mjs +29 -45
- package/dist/esm/fields/Combobox/index.mjs.map +1 -1
- package/dist/esm/fields/Combobox/index.native.js +31 -46
- package/dist/esm/fields/Combobox/index.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/Calendar.mjs +4 -5
- package/dist/esm/fields/DatePicker/Calendar.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/Calendar.native.js +4 -5
- package/dist/esm/fields/DatePicker/Calendar.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/parts.mjs +5 -9
- package/dist/esm/fields/DatePicker/parts.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/parts.native.js +5 -9
- package/dist/esm/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/esm/fields/Duration/durationMath.mjs +1 -1
- package/dist/esm/fields/Duration/durationMath.mjs.map +1 -1
- package/dist/esm/fields/Duration/durationMath.native.js +1 -1
- package/dist/esm/fields/Duration/index.mjs +100 -90
- package/dist/esm/fields/Duration/index.mjs.map +1 -1
- package/dist/esm/fields/Duration/index.native.js +108 -98
- package/dist/esm/fields/Duration/index.native.js.map +1 -1
- package/dist/esm/fields/FileUpload/index.mjs +135 -25
- package/dist/esm/fields/FileUpload/index.mjs.map +1 -1
- package/dist/esm/fields/FileUpload/index.native.js +150 -35
- package/dist/esm/fields/FileUpload/index.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/GeolocationMap.mjs +2 -1
- package/dist/esm/fields/Geolocation/GeolocationMap.mjs.map +1 -1
- package/dist/esm/fields/Geolocation/GeolocationMap.native.js +2 -1
- package/dist/esm/fields/Geolocation/GeolocationMap.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/index.mjs +13 -11
- package/dist/esm/fields/Geolocation/index.mjs.map +1 -1
- package/dist/esm/fields/Geolocation/index.native.js +13 -11
- package/dist/esm/fields/Geolocation/index.native.js.map +1 -1
- package/dist/esm/fields/Icon/index.mjs +8 -15
- package/dist/esm/fields/Icon/index.mjs.map +1 -1
- package/dist/esm/fields/Icon/index.native.js +8 -15
- package/dist/esm/fields/Icon/index.native.js.map +1 -1
- package/dist/esm/fields/ImageField/index.mjs +7 -7
- package/dist/esm/fields/ImageField/index.mjs.map +1 -1
- package/dist/esm/fields/ImageField/index.native.js +7 -7
- package/dist/esm/fields/ImageField/index.native.js.map +1 -1
- package/dist/esm/fields/Input/index.mjs +28 -22
- package/dist/esm/fields/Input/index.mjs.map +1 -1
- package/dist/esm/fields/Input/index.native.js +29 -22
- package/dist/esm/fields/Input/index.native.js.map +1 -1
- package/dist/esm/fields/MentionInput/index.mjs +13 -14
- package/dist/esm/fields/MentionInput/index.mjs.map +1 -1
- package/dist/esm/fields/MentionInput/index.native.js +13 -14
- package/dist/esm/fields/MentionInput/index.native.js.map +1 -1
- package/dist/esm/fields/OTPInput/index.mjs +2 -2
- package/dist/esm/fields/OTPInput/index.mjs.map +1 -1
- package/dist/esm/fields/OTPInput/index.native.js +2 -2
- package/dist/esm/fields/OTPInput/index.native.js.map +1 -1
- package/dist/esm/fields/PhoneInput/index.mjs +5 -5
- package/dist/esm/fields/PhoneInput/index.mjs.map +1 -1
- package/dist/esm/fields/PhoneInput/index.native.js +5 -5
- package/dist/esm/fields/PhoneInput/index.native.js.map +1 -1
- package/dist/esm/fields/RadioGroup/index.mjs +1 -0
- package/dist/esm/fields/RadioGroup/index.mjs.map +1 -1
- package/dist/esm/fields/RadioGroup/index.native.js +1 -0
- package/dist/esm/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/esm/fields/SearchInput/index.mjs +5 -49
- package/dist/esm/fields/SearchInput/index.mjs.map +1 -1
- package/dist/esm/fields/SearchInput/index.native.js +5 -47
- package/dist/esm/fields/SearchInput/index.native.js.map +1 -1
- package/dist/esm/fields/Select/index.mjs +15 -13
- package/dist/esm/fields/Select/index.mjs.map +1 -1
- package/dist/esm/fields/Select/index.native.js +15 -13
- package/dist/esm/fields/Select/index.native.js.map +1 -1
- package/dist/esm/fields/Signature/index.mjs +2 -2
- package/dist/esm/fields/Signature/index.mjs.map +1 -1
- package/dist/esm/fields/Signature/index.native.js +2 -2
- package/dist/esm/fields/Signature/index.native.js.map +1 -1
- package/dist/esm/fields/Slider/index.mjs +2 -2
- package/dist/esm/fields/Slider/index.mjs.map +1 -1
- package/dist/esm/fields/Slider/index.native.js +2 -2
- package/dist/esm/fields/Slider/index.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/parts.mjs +5 -9
- package/dist/esm/fields/TimePicker/parts.mjs.map +1 -1
- package/dist/esm/fields/TimePicker/parts.native.js +5 -9
- package/dist/esm/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/esm/fields/TimeRangeScrubber/index.mjs +20 -15
- package/dist/esm/fields/TimeRangeScrubber/index.mjs.map +1 -1
- package/dist/esm/fields/TimeRangeScrubber/index.native.js +20 -15
- package/dist/esm/fields/TimeRangeScrubber/index.native.js.map +1 -1
- package/dist/esm/fields/ToggleGroup/index.mjs +3 -3
- package/dist/esm/fields/ToggleGroup/index.mjs.map +1 -1
- package/dist/esm/fields/ToggleGroup/index.native.js +3 -3
- package/dist/esm/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.mjs +2 -2
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.mjs.map +1 -1
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js +2 -2
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/esm/hooks/useFocusManagement.mjs +3 -2
- package/dist/esm/hooks/useFocusManagement.mjs.map +1 -1
- package/dist/esm/hooks/useFocusManagement.native.js +3 -2
- package/dist/esm/hooks/useFocusManagement.native.js.map +1 -1
- package/dist/esm/index.mjs +3 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +3 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/shared/focusManagement.mjs +1 -1
- package/dist/esm/shared/focusManagement.mjs.map +1 -1
- package/dist/esm/shared/focusManagement.native.js +1 -1
- package/dist/esm/shared/panelPortal.mjs +1 -1
- package/dist/esm/shared/panelPortal.mjs.map +1 -1
- package/dist/esm/shared/panelPortal.native.js +1 -1
- package/dist/esm/shared/panelPortal.native.js.map +1 -1
- package/dist/esm/shared/useDragScroll.mjs +2 -2
- package/dist/esm/shared/useDragScroll.mjs.map +1 -1
- package/dist/esm/shared/useDragScroll.native.js +2 -2
- package/dist/esm/shared/useDragScroll.native.js.map +1 -1
- package/dist/jsx/Button/index.mjs +17 -6
- package/dist/jsx/Button/index.mjs.map +1 -1
- package/dist/jsx/Button/index.native.js +18 -7
- package/dist/jsx/Button/index.native.js.map +1 -1
- package/dist/jsx/ErrorSummary.mjs +2 -2
- package/dist/jsx/ErrorSummary.mjs.map +1 -1
- package/dist/jsx/ErrorSummary.native.js +1 -1
- package/dist/jsx/ErrorSummary.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/PanelPortal.mjs +1 -1
- package/dist/jsx/FloatingPanel/PanelPortal.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/index.mjs +13 -4
- package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/index.native.js +9 -2
- package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/trailingAction.mjs +33 -0
- package/dist/jsx/FloatingPanel/trailingAction.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/trailingAction.native.js +64 -0
- package/dist/jsx/FloatingPanel/trailingAction.native.js.map +1 -0
- package/dist/jsx/FormGrid.mjs +1 -0
- package/dist/jsx/FormGrid.mjs.map +1 -1
- package/dist/jsx/FormGrid.native.js +1 -0
- package/dist/jsx/FormGrid.native.js.map +1 -1
- package/dist/jsx/InputParts/PasswordReveal.mjs +68 -0
- package/dist/jsx/InputParts/PasswordReveal.mjs.map +1 -0
- package/dist/jsx/InputParts/PasswordReveal.native.js +104 -0
- package/dist/jsx/InputParts/PasswordReveal.native.js.map +1 -0
- package/dist/jsx/InputParts/index.mjs +97 -8
- package/dist/jsx/InputParts/index.mjs.map +1 -1
- package/dist/jsx/InputParts/index.native.js +99 -5
- package/dist/jsx/InputParts/index.native.js.map +1 -1
- package/dist/jsx/fields/ColorPicker/index.mjs +8 -17
- package/dist/jsx/fields/ColorPicker/index.mjs.map +1 -1
- package/dist/jsx/fields/ColorPicker/index.native.js +9 -18
- package/dist/jsx/fields/ColorPicker/index.native.js.map +1 -1
- package/dist/jsx/fields/Combobox/index.mjs +29 -45
- package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
- package/dist/jsx/fields/Combobox/index.native.js +30 -45
- package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/Calendar.mjs +4 -5
- package/dist/jsx/fields/DatePicker/Calendar.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/Calendar.native.js +3 -4
- package/dist/jsx/fields/DatePicker/Calendar.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/parts.mjs +5 -9
- package/dist/jsx/fields/DatePicker/parts.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/parts.native.js +5 -9
- package/dist/jsx/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/jsx/fields/Duration/durationMath.mjs +1 -1
- package/dist/jsx/fields/Duration/durationMath.mjs.map +1 -1
- package/dist/jsx/fields/Duration/durationMath.native.js +1 -1
- package/dist/jsx/fields/Duration/durationMath.native.js.map +1 -1
- package/dist/jsx/fields/Duration/index.mjs +100 -90
- package/dist/jsx/fields/Duration/index.mjs.map +1 -1
- package/dist/jsx/fields/Duration/index.native.js +108 -98
- package/dist/jsx/fields/Duration/index.native.js.map +1 -1
- package/dist/jsx/fields/FileUpload/index.mjs +135 -25
- package/dist/jsx/fields/FileUpload/index.mjs.map +1 -1
- package/dist/jsx/fields/FileUpload/index.native.js +149 -34
- package/dist/jsx/fields/FileUpload/index.native.js.map +1 -1
- package/dist/jsx/fields/Geolocation/GeolocationMap.mjs +2 -1
- package/dist/jsx/fields/Geolocation/GeolocationMap.mjs.map +1 -1
- package/dist/jsx/fields/Geolocation/GeolocationMap.native.js +3 -2
- package/dist/jsx/fields/Geolocation/GeolocationMap.native.js.map +1 -1
- package/dist/jsx/fields/Geolocation/index.mjs +13 -11
- package/dist/jsx/fields/Geolocation/index.mjs.map +1 -1
- package/dist/jsx/fields/Geolocation/index.native.js +10 -8
- package/dist/jsx/fields/Geolocation/index.native.js.map +1 -1
- package/dist/jsx/fields/Icon/index.mjs +8 -15
- package/dist/jsx/fields/Icon/index.mjs.map +1 -1
- package/dist/jsx/fields/Icon/index.native.js +6 -13
- package/dist/jsx/fields/Icon/index.native.js.map +1 -1
- package/dist/jsx/fields/ImageField/index.mjs +7 -7
- package/dist/jsx/fields/ImageField/index.mjs.map +1 -1
- package/dist/jsx/fields/ImageField/index.native.js +5 -5
- package/dist/jsx/fields/ImageField/index.native.js.map +1 -1
- package/dist/jsx/fields/Input/index.mjs +28 -22
- package/dist/jsx/fields/Input/index.mjs.map +1 -1
- package/dist/jsx/fields/Input/index.native.js +28 -21
- package/dist/jsx/fields/Input/index.native.js.map +1 -1
- package/dist/jsx/fields/MentionInput/index.mjs +13 -14
- package/dist/jsx/fields/MentionInput/index.mjs.map +1 -1
- package/dist/jsx/fields/MentionInput/index.native.js +7 -8
- package/dist/jsx/fields/MentionInput/index.native.js.map +1 -1
- package/dist/jsx/fields/OTPInput/index.mjs +2 -2
- package/dist/jsx/fields/OTPInput/index.mjs.map +1 -1
- package/dist/jsx/fields/OTPInput/index.native.js +1 -1
- package/dist/jsx/fields/OTPInput/index.native.js.map +1 -1
- package/dist/jsx/fields/PhoneInput/index.mjs +5 -5
- package/dist/jsx/fields/PhoneInput/index.mjs.map +1 -1
- package/dist/jsx/fields/PhoneInput/index.native.js +3 -3
- package/dist/jsx/fields/PhoneInput/index.native.js.map +1 -1
- package/dist/jsx/fields/RadioGroup/index.mjs +1 -0
- package/dist/jsx/fields/RadioGroup/index.mjs.map +1 -1
- package/dist/jsx/fields/RadioGroup/index.native.js +1 -0
- package/dist/jsx/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/jsx/fields/SearchInput/index.mjs +5 -49
- package/dist/jsx/fields/SearchInput/index.mjs.map +1 -1
- package/dist/jsx/fields/SearchInput/index.native.js +4 -46
- package/dist/jsx/fields/SearchInput/index.native.js.map +1 -1
- package/dist/jsx/fields/Select/index.mjs +15 -13
- package/dist/jsx/fields/Select/index.mjs.map +1 -1
- package/dist/jsx/fields/Select/index.native.js +14 -12
- package/dist/jsx/fields/Select/index.native.js.map +1 -1
- package/dist/jsx/fields/Signature/index.mjs +2 -2
- package/dist/jsx/fields/Signature/index.mjs.map +1 -1
- package/dist/jsx/fields/Signature/index.native.js +1 -1
- package/dist/jsx/fields/Signature/index.native.js.map +1 -1
- package/dist/jsx/fields/Slider/index.mjs +2 -2
- package/dist/jsx/fields/Slider/index.mjs.map +1 -1
- package/dist/jsx/fields/Slider/index.native.js +1 -1
- package/dist/jsx/fields/Slider/index.native.js.map +1 -1
- package/dist/jsx/fields/TimePicker/parts.mjs +5 -9
- package/dist/jsx/fields/TimePicker/parts.mjs.map +1 -1
- package/dist/jsx/fields/TimePicker/parts.native.js +5 -9
- package/dist/jsx/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/jsx/fields/TimeRangeScrubber/index.mjs +20 -15
- package/dist/jsx/fields/TimeRangeScrubber/index.mjs.map +1 -1
- package/dist/jsx/fields/TimeRangeScrubber/index.native.js +14 -9
- package/dist/jsx/fields/TimeRangeScrubber/index.native.js.map +1 -1
- package/dist/jsx/fields/ToggleGroup/index.mjs +3 -3
- package/dist/jsx/fields/ToggleGroup/index.mjs.map +1 -1
- package/dist/jsx/fields/ToggleGroup/index.native.js +1 -1
- package/dist/jsx/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.mjs +2 -2
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.mjs.map +1 -1
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.native.js +5 -5
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/jsx/hooks/useFocusManagement.mjs +3 -2
- package/dist/jsx/hooks/useFocusManagement.mjs.map +1 -1
- package/dist/jsx/hooks/useFocusManagement.native.js +3 -2
- package/dist/jsx/hooks/useFocusManagement.native.js.map +1 -1
- package/dist/jsx/index.js +3 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +3 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +7 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/focusManagement.mjs +1 -1
- package/dist/jsx/shared/focusManagement.mjs.map +1 -1
- package/dist/jsx/shared/focusManagement.native.js +1 -1
- package/dist/jsx/shared/focusManagement.native.js.map +1 -1
- package/dist/jsx/shared/panelPortal.mjs +1 -1
- package/dist/jsx/shared/panelPortal.mjs.map +1 -1
- package/dist/jsx/shared/panelPortal.native.js +1 -1
- package/dist/jsx/shared/panelPortal.native.js.map +1 -1
- package/dist/jsx/shared/useDragScroll.mjs +2 -2
- package/dist/jsx/shared/useDragScroll.mjs.map +1 -1
- package/dist/jsx/shared/useDragScroll.native.js +2 -2
- package/dist/jsx/shared/useDragScroll.native.js.map +1 -1
- package/package.json +8 -8
- package/src/AdaptivePopup/AdaptivePopup.stories.tsx +2 -1
- package/src/Button/Button.borderLadder.spec.tsx +32 -7
- package/src/Button/Button.edge.spec.tsx +68 -0
- package/src/Button/Button.stories.tsx +2 -1
- package/src/Button/index.tsx +37 -11
- package/src/Chip/Chip.stories.tsx +2 -1
- package/src/ContextualSaveBar/ContextualSaveBar.stories.tsx +2 -1
- package/src/ContextualSaveBar/UnsavedChangesDialog.stories.tsx +2 -1
- package/src/ControlGroup/ControlGroup.stories.tsx +2 -1
- package/src/DescriptionList/DescriptionList.stories.tsx +2 -1
- package/src/ErrorSummary.stories.tsx +2 -1
- package/src/ErrorSummary.tsx +2 -2
- package/src/FieldDisplay/FieldDisplay.stories.tsx +2 -1
- package/src/FieldLayout.stories.tsx +2 -2
- package/src/FloatingPanel/FloatingPanel.stories.tsx +2 -2
- package/src/FloatingPanel/PanelPortal.tsx +1 -0
- package/src/FloatingPanel/index.native.tsx +4 -2
- package/src/FloatingPanel/index.tsx +14 -4
- package/src/FloatingPanel/trailingAction.tsx +37 -0
- package/src/Form/Form.stories.tsx +2 -1
- package/src/FormGrid.stories.tsx +2 -1
- package/src/FormGrid.tsx +1 -0
- package/src/FormsIntegration.stories.tsx +4 -18
- package/src/InputParts/InputParts.stories.tsx +11 -11
- package/src/InputParts/PasswordReveal.tsx +94 -0
- package/src/InputParts/index.tsx +144 -2
- package/src/InputParts/inputPartsStories.spec.tsx +3 -1
- package/src/Skeleton/Skeleton.stories.tsx +2 -2
- package/src/Spinner/Spinner.stories.tsx +2 -2
- package/src/Wheel/Wheel.stories.tsx +2 -2
- package/src/fieldTrailingAction.spec.tsx +188 -0
- package/src/fields/Barcode/Barcode.stories.tsx +2 -1
- package/src/fields/Barcode/BarcodePreview.stories.tsx +2 -1
- package/src/fields/Checkbox/Checkbox.stories.tsx +3 -1
- package/src/fields/Checkbox/CheckboxGroup.stories.tsx +2 -2
- package/src/fields/Checkbox/Checkboxes.stories.tsx +2 -1
- package/src/fields/ColorPicker/PresetSwatches.stories.tsx +2 -1
- package/src/fields/ColorPicker/index.tsx +6 -12
- package/src/fields/Combobox/Combobox.stories.tsx +2 -1
- package/src/fields/Combobox/index.tsx +39 -41
- package/src/fields/DatePicker/Calendar.stories.tsx +2 -1
- package/src/fields/DatePicker/Calendar.tsx +4 -5
- package/src/fields/DatePicker/DatePicker.spec.tsx +2 -2
- package/src/fields/DatePicker/DatePicker.stories.tsx +2 -1
- package/src/fields/DatePicker/DateRangePicker.stories.tsx +2 -1
- package/src/fields/DatePicker/DatetimePicker.stories.tsx +2 -1
- package/src/fields/DatePicker/MonthPicker.stories.tsx +2 -1
- package/src/fields/DatePicker/MultiDatePicker.spec.tsx +1 -1
- package/src/fields/DatePicker/MultiDatePicker.stories.tsx +2 -1
- package/src/fields/DatePicker/parts.tsx +6 -10
- package/src/fields/Duration/Duration.spec.tsx +25 -1
- package/src/fields/Duration/Duration.stories.tsx +6 -1
- package/src/fields/Duration/durationMath.spec.ts +2 -2
- package/src/fields/Duration/durationMath.ts +1 -1
- package/src/fields/Duration/index.tsx +91 -70
- package/src/fields/FileUpload/FileUpload.spec.tsx +86 -3
- package/src/fields/FileUpload/FileUpload.stories.tsx +15 -0
- package/src/fields/FileUpload/index.tsx +170 -50
- package/src/fields/Geolocation/Geolocation.stories.tsx +2 -1
- package/src/fields/Geolocation/GeolocationMap.native.tsx +2 -1
- package/src/fields/Geolocation/GeolocationMap.tsx +2 -1
- package/src/fields/Geolocation/index.tsx +39 -16
- package/src/fields/Icon/index.tsx +9 -15
- package/src/fields/ImageField/index.tsx +9 -8
- package/src/fields/Input/Input.stories.tsx +39 -1
- package/src/fields/Input/index.tsx +45 -25
- package/src/fields/MentionInput/index.tsx +17 -18
- package/src/fields/OTPInput/OtpInput.stories.tsx +2 -1
- package/src/fields/OTPInput/index.tsx +2 -2
- package/src/fields/PhoneInput/PhoneInput.stories.tsx +2 -1
- package/src/fields/PhoneInput/index.tsx +10 -6
- package/src/fields/Progress/Progress.stories.tsx +2 -1
- package/src/fields/RadioGroup/RadioGroup.stories.tsx +3 -2
- package/src/fields/RadioGroup/index.tsx +1 -0
- package/src/fields/Rating/Rating.stories.tsx +2 -1
- package/src/fields/SearchInput/SearchInput.stories.tsx +2 -1
- package/src/fields/SearchInput/index.tsx +8 -45
- package/src/fields/Select/Select.stories.tsx +2 -2
- package/src/fields/Select/index.tsx +18 -12
- package/src/fields/Signature/Signature.stories.tsx +2 -1
- package/src/fields/Signature/index.tsx +6 -1
- package/src/fields/Slider/Slider.stories.tsx +2 -1
- package/src/fields/Slider/index.tsx +6 -2
- package/src/fields/Stepper/Stepper.stories.tsx +2 -1
- package/src/fields/Switch/Switch.stories.tsx +3 -1
- package/src/fields/TextArea/TextArea.stories.tsx +2 -1
- package/src/fields/TimePicker/TimePicker.stories.tsx +2 -1
- package/src/fields/TimePicker/parts.tsx +6 -10
- package/src/fields/TimeRangeScrubber/index.tsx +20 -18
- package/src/fields/ToggleGroup/ToggleGroup.stories.tsx +2 -8
- package/src/fields/ToggleGroup/index.tsx +10 -4
- package/src/fields/nativeDateTime/OsDateTimeSheet.tsx +2 -2
- package/src/fields/pickerActivation.spec.tsx +7 -3
- package/src/hooks/useFocusManagement.ts +3 -2
- package/src/index.ts +9 -0
- package/src/shared/focusManagement.ts +1 -1
- package/src/shared/panelPortal.ts +2 -1
- package/src/shared/useDragScroll.ts +2 -2
- package/types/Button/index.d.ts +9 -1
- package/types/Button/index.d.ts.map +1 -1
- package/types/FloatingPanel/PanelPortal.d.ts.map +1 -1
- package/types/FloatingPanel/index.d.ts.map +1 -1
- package/types/FloatingPanel/index.native.d.ts.map +1 -1
- package/types/FloatingPanel/trailingAction.d.ts +16 -0
- package/types/FloatingPanel/trailingAction.d.ts.map +1 -0
- package/types/InputParts/PasswordReveal.d.ts +28 -0
- package/types/InputParts/PasswordReveal.d.ts.map +1 -0
- package/types/InputParts/index.d.ts +34 -2
- package/types/InputParts/index.d.ts.map +1 -1
- package/types/fields/Checkbox/index.d.ts +4 -4
- package/types/fields/ColorPicker/index.d.ts.map +1 -1
- package/types/fields/Combobox/index.d.ts.map +1 -1
- package/types/fields/DatePicker/Calendar.d.ts.map +1 -1
- package/types/fields/DatePicker/parts.d.ts.map +1 -1
- package/types/fields/Duration/index.d.ts.map +1 -1
- package/types/fields/FileUpload/index.d.ts +1 -0
- package/types/fields/FileUpload/index.d.ts.map +1 -1
- package/types/fields/Geolocation/GeolocationMap.d.ts.map +1 -1
- package/types/fields/Geolocation/GeolocationMap.native.d.ts.map +1 -1
- package/types/fields/Geolocation/index.d.ts.map +1 -1
- package/types/fields/Icon/index.d.ts.map +1 -1
- package/types/fields/ImageField/index.d.ts.map +1 -1
- package/types/fields/Input/index.d.ts +9 -3
- package/types/fields/Input/index.d.ts.map +1 -1
- package/types/fields/MentionInput/index.d.ts.map +1 -1
- package/types/fields/PhoneInput/index.d.ts.map +1 -1
- package/types/fields/RadioGroup/index.d.ts +2 -2
- 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/TimePicker/parts.d.ts.map +1 -1
- package/types/fields/TimeRangeScrubber/index.d.ts.map +1 -1
- package/types/fields/ToggleGroup/index.d.ts +1 -1
- package/types/fields/ToggleGroup/index.d.ts.map +1 -1
- package/types/hooks/useFocusManagement.d.ts.map +1 -1
- package/types/index.d.ts +4 -0
- package/types/index.d.ts.map +1 -1
- package/types/shared/panelPortal.d.ts.map +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
edgeColorAt,
|
|
2
3
|
ensureFocusVisibleRing,
|
|
3
4
|
pressTargetHitSlop,
|
|
4
5
|
sizeTokenStep,
|
|
@@ -6,12 +7,13 @@ import {
|
|
|
6
7
|
useGlyphColor,
|
|
7
8
|
useTouchSurface,
|
|
8
9
|
type KnobProps,
|
|
10
|
+
Text,
|
|
9
11
|
} from "@multiplatform.one/theme";
|
|
10
12
|
import { MagnifyingGlassIcon, MapPinIcon, NavigationArrowIcon, XIcon } from "@phosphor-icons/react";
|
|
11
13
|
import type { KeyboardEvent, MutableRefObject, ReactNode } from "react";
|
|
12
14
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
13
15
|
import type { LabelProps, SizeTokens } from "tamagui";
|
|
14
|
-
import { ScrollView, Spinner, Text, View, XStack, YStack, isWeb } from "tamagui";
|
|
16
|
+
import { ScrollView, Spinner, Text as TamaguiText, View, XStack, YStack, isWeb } from "tamagui";
|
|
15
17
|
import { AdaptivePopup } from "../../AdaptivePopup";
|
|
16
18
|
import { Button } from "../../Button";
|
|
17
19
|
import { Field, FieldLayout } from "../../fieldLayout";
|
|
@@ -217,9 +219,9 @@ function CoordinatesPanel({
|
|
|
217
219
|
return (
|
|
218
220
|
<YStack testID="geolocation-coords-panel" gap="$3" minWidth={260} {...knobProps.panelPadding}>
|
|
219
221
|
<YStack gap="$1">
|
|
220
|
-
<
|
|
222
|
+
<TamaguiText fontSize="$1" {...knobProps.body} color={formCommonColors.muted}>
|
|
221
223
|
{t("Lat")}
|
|
222
|
-
</
|
|
224
|
+
</TamaguiText>
|
|
223
225
|
<InputParts size={knobProps.sizeToken}>
|
|
224
226
|
<InputParts.Box>
|
|
225
227
|
<InputParts.Area
|
|
@@ -236,9 +238,9 @@ function CoordinatesPanel({
|
|
|
236
238
|
</InputParts>
|
|
237
239
|
</YStack>
|
|
238
240
|
<YStack gap="$1">
|
|
239
|
-
<
|
|
241
|
+
<TamaguiText fontSize="$1" {...knobProps.body} color={formCommonColors.muted}>
|
|
240
242
|
{t("Lng")}
|
|
241
|
-
</
|
|
243
|
+
</TamaguiText>
|
|
242
244
|
<InputParts size={knobProps.sizeToken}>
|
|
243
245
|
<InputParts.Box>
|
|
244
246
|
<InputParts.Area
|
|
@@ -557,9 +559,14 @@ function GeoMapSurface({
|
|
|
557
559
|
paddingHorizontal="$2"
|
|
558
560
|
hitSlop={pressTargetHitSlop(COORD_LINE_HEIGHT)}
|
|
559
561
|
>
|
|
560
|
-
<
|
|
562
|
+
<TamaguiText
|
|
563
|
+
fontFamily="$mono"
|
|
564
|
+
fontSize={12}
|
|
565
|
+
lineHeight={22}
|
|
566
|
+
color={formCommonColors.muted}
|
|
567
|
+
>
|
|
561
568
|
{hasValue ? formatCoordPair(mapLat, mapLng) : t("Enter coordinates")}
|
|
562
|
-
</
|
|
569
|
+
</TamaguiText>
|
|
563
570
|
</XStack>
|
|
564
571
|
) : (
|
|
565
572
|
<FloatingPanel
|
|
@@ -593,9 +600,14 @@ function GeoMapSurface({
|
|
|
593
600
|
}
|
|
594
601
|
: {})}
|
|
595
602
|
>
|
|
596
|
-
<
|
|
603
|
+
<TamaguiText
|
|
604
|
+
fontFamily="$mono"
|
|
605
|
+
fontSize={12}
|
|
606
|
+
lineHeight={22}
|
|
607
|
+
color={formCommonColors.muted}
|
|
608
|
+
>
|
|
597
609
|
{hasValue ? formatCoordPair(mapLat, mapLng) : t("Enter coordinates")}
|
|
598
|
-
</
|
|
610
|
+
</TamaguiText>
|
|
599
611
|
</XStack>
|
|
600
612
|
}
|
|
601
613
|
>
|
|
@@ -619,7 +631,11 @@ function GeoMapSurface({
|
|
|
619
631
|
{...knobProps.borderRadius}
|
|
620
632
|
{...knobProps.inputSurface}
|
|
621
633
|
borderRadius={cappedRadius}
|
|
622
|
-
borderColor={
|
|
634
|
+
borderColor={
|
|
635
|
+
hasError
|
|
636
|
+
? formCommonColors.error
|
|
637
|
+
: edgeColorAt(formInputColors.border.base, knobProps.borderWidthStop)
|
|
638
|
+
}
|
|
623
639
|
overflow="hidden"
|
|
624
640
|
height={mapHeight}
|
|
625
641
|
position="relative"
|
|
@@ -661,9 +677,9 @@ function GeoMapSurface({
|
|
|
661
677
|
justifyContent="center"
|
|
662
678
|
pointerEvents="none"
|
|
663
679
|
>
|
|
664
|
-
<
|
|
680
|
+
<TamaguiText {...knobProps.body} color={formCommonColors.muted}>
|
|
665
681
|
{t("No location set")}
|
|
666
|
-
</
|
|
682
|
+
</TamaguiText>
|
|
667
683
|
</YStack>
|
|
668
684
|
) : null}
|
|
669
685
|
</YStack>
|
|
@@ -674,14 +690,14 @@ function GeoMapSurface({
|
|
|
674
690
|
role="alert"
|
|
675
691
|
{...knobProps.borderRadius}
|
|
676
692
|
{...knobProps.inputSurface}
|
|
677
|
-
borderColor={formInputColors.border.base}
|
|
693
|
+
borderColor={edgeColorAt(formInputColors.border.base, knobProps.borderWidthStop)}
|
|
678
694
|
padding="$3"
|
|
679
695
|
gap="$2"
|
|
680
696
|
alignItems="center"
|
|
681
697
|
>
|
|
682
|
-
<
|
|
698
|
+
<TamaguiText {...knobProps.body} color={formCommonColors.error} textAlign="center">
|
|
683
699
|
{locateError}
|
|
684
|
-
</
|
|
700
|
+
</TamaguiText>
|
|
685
701
|
<XStack gap="$2">
|
|
686
702
|
<Button size="$2" onPress={onRetryLocate} aria-label={t("Retry location")}>
|
|
687
703
|
{t("Retry")}
|
|
@@ -1084,7 +1100,14 @@ export function Geolocation({
|
|
|
1084
1100
|
if (!resultsOpen || shouldUseSheet) return;
|
|
1085
1101
|
const onDoc = (event: MouseEvent) => {
|
|
1086
1102
|
const root = searchRootRef.current;
|
|
1087
|
-
if (
|
|
1103
|
+
if (
|
|
1104
|
+
root &&
|
|
1105
|
+
typeof Node !== "undefined" &&
|
|
1106
|
+
event.target instanceof Node &&
|
|
1107
|
+
root.contains(event.target)
|
|
1108
|
+
) {
|
|
1109
|
+
return;
|
|
1110
|
+
}
|
|
1088
1111
|
closeSearch(false);
|
|
1089
1112
|
};
|
|
1090
1113
|
const onKey = (event: globalThis.KeyboardEvent) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { DeepKeys, DeepValue } from "@tanstack/form-core";
|
|
2
2
|
import { MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
3
3
|
import { Pressable as RNPressable } from "react-native";
|
|
4
|
-
import { ensureFocusVisibleRing, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
4
|
+
import { ensureFocusVisibleRing, useResolvedKnobs, Text } from "@multiplatform.one/theme";
|
|
5
5
|
import { useCallback, useEffect, useMemo, useRef, useState, type ComponentRef } from "react";
|
|
6
|
-
import { Text, View, XStack, YStack, isWeb, useProps } from "tamagui";
|
|
6
|
+
import { Text as TamaguiText, View, XStack, YStack, isWeb, useProps } from "tamagui";
|
|
7
7
|
import { Field, FieldLayout } from "../../fieldLayout";
|
|
8
8
|
import type { FormFieldProps } from "../../fieldLayout";
|
|
9
9
|
import { Input as InputParts } from "../../InputParts";
|
|
@@ -280,20 +280,14 @@ function IconControl({
|
|
|
280
280
|
) : undefined;
|
|
281
281
|
const nativeClear =
|
|
282
282
|
!isWeb && showClear ? (
|
|
283
|
-
<InputParts.
|
|
283
|
+
<InputParts.Action
|
|
284
284
|
testID="icon-clear-native"
|
|
285
|
-
|
|
286
|
-
accessibilityLabel={t("Clear icon")}
|
|
285
|
+
label={t("Clear icon")}
|
|
287
286
|
disabled={disabled}
|
|
288
|
-
onPress={
|
|
289
|
-
e.stopPropagation();
|
|
290
|
-
handleClear();
|
|
291
|
-
}}
|
|
287
|
+
onPress={handleClear}
|
|
292
288
|
>
|
|
293
|
-
<
|
|
294
|
-
|
|
295
|
-
</InputParts.Icon>
|
|
296
|
-
</InputParts.Button>
|
|
289
|
+
<DrawnIcon name="x" />
|
|
290
|
+
</InputParts.Action>
|
|
297
291
|
) : undefined;
|
|
298
292
|
|
|
299
293
|
return (
|
|
@@ -358,7 +352,7 @@ function IconControl({
|
|
|
358
352
|
>
|
|
359
353
|
{/* Outside InputParts.Icon, so the colour is passed here. */}
|
|
360
354
|
<DrawnIcon name={name} size={16} color={cellInk} />
|
|
361
|
-
<
|
|
355
|
+
<TamaguiText
|
|
362
356
|
fontFamily="$mono"
|
|
363
357
|
fontSize={11}
|
|
364
358
|
// $color10 measures 3.95-4.36:1, under the 4.5:1 AA floor
|
|
@@ -367,7 +361,7 @@ function IconControl({
|
|
|
367
361
|
numberOfLines={1}
|
|
368
362
|
>
|
|
369
363
|
{name}
|
|
370
|
-
</
|
|
364
|
+
</TamaguiText>
|
|
371
365
|
</YStack>
|
|
372
366
|
</View>
|
|
373
367
|
);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* the borderRadius fragment, never clampRadiusForControl / containerRadius.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { transitionProps } from "@multiplatform.one/theme";
|
|
12
|
+
import { edgeColorAt, transitionProps, Text } from "@multiplatform.one/theme";
|
|
13
13
|
import { ImageSquareIcon, XIcon } from "@phosphor-icons/react";
|
|
14
14
|
import {
|
|
15
15
|
ensureFocusVisibleRing,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import type { DragEvent, ReactNode } from "react";
|
|
22
22
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
23
23
|
import type { LabelProps, SizeTokens } from "tamagui";
|
|
24
|
-
import { Image, Text, View, YStack, isWeb, styled } from "tamagui";
|
|
24
|
+
import { Image, Text as TamaguiText, View, YStack, isWeb, styled } from "tamagui";
|
|
25
25
|
import { Button } from "../../Button";
|
|
26
26
|
import { Field, FieldLayout, useFieldA11y, useFieldDescribedBy } from "../../fieldLayout";
|
|
27
27
|
import { Skeleton } from "../../Skeleton";
|
|
@@ -166,7 +166,7 @@ function ImageControl({
|
|
|
166
166
|
|
|
167
167
|
useEffect(() => {
|
|
168
168
|
setBroken(false);
|
|
169
|
-
if (!
|
|
169
|
+
if (!isWeb || typeof File === "undefined" || !(currentValue instanceof File)) {
|
|
170
170
|
setPreviewUrl(null);
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
@@ -178,11 +178,12 @@ function ImageControl({
|
|
|
178
178
|
const displayUrl =
|
|
179
179
|
typeof currentValue === "string" && currentValue
|
|
180
180
|
? currentValue
|
|
181
|
-
: currentValue instanceof File
|
|
181
|
+
: typeof File !== "undefined" && currentValue instanceof File
|
|
182
182
|
? previewUrl
|
|
183
183
|
: null;
|
|
184
184
|
const hasValue =
|
|
185
|
-
|
|
185
|
+
(typeof File !== "undefined" && currentValue instanceof File) ||
|
|
186
|
+
(typeof currentValue === "string" && !!currentValue);
|
|
186
187
|
const hasPreview = !!displayUrl && !broken;
|
|
187
188
|
const minEdge = Math.min(imageWidth, imageHeight);
|
|
188
189
|
const caption = placeholder === undefined ? t("Add image") : placeholder;
|
|
@@ -310,7 +311,7 @@ function ImageControl({
|
|
|
310
311
|
? errorProp
|
|
311
312
|
? formCommonColors.error
|
|
312
313
|
: formCommonColors.text
|
|
313
|
-
: formInputColors.border.base;
|
|
314
|
+
: edgeColorAt(formInputColors.border.base, knobProps.borderWidthStop);
|
|
314
315
|
const altText =
|
|
315
316
|
typeof label === "string" && label ? label : fieldA11y?.label || t("Selected image");
|
|
316
317
|
const emptyName =
|
|
@@ -385,14 +386,14 @@ function ImageControl({
|
|
|
385
386
|
<View alignItems="center" justifyContent="center" gap="$1" padding="$1">
|
|
386
387
|
<ImageSquareIcon size={iconSize} color="var(--color11)" />
|
|
387
388
|
{showCaption ? (
|
|
388
|
-
<
|
|
389
|
+
<TamaguiText
|
|
389
390
|
{...knobProps.body}
|
|
390
391
|
color={formCommonColors.muted}
|
|
391
392
|
textAlign="center"
|
|
392
393
|
numberOfLines={2}
|
|
393
394
|
>
|
|
394
395
|
{hasValue && broken ? t("Image failed to load") : caption}
|
|
395
|
-
</
|
|
396
|
+
</TamaguiText>
|
|
396
397
|
) : hasValue && broken ? (
|
|
397
398
|
<Text color={formCommonColors.muted} textAlign="center" fontSize="$1">
|
|
398
399
|
{t("Image failed to load")}
|
|
@@ -4,10 +4,11 @@ import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
|
4
4
|
import { MagnifyingGlassIcon, XIcon } from "@phosphor-icons/react";
|
|
5
5
|
import { useForm } from "@tanstack/react-form";
|
|
6
6
|
import { useState } from "react";
|
|
7
|
-
import { Input as TamaguiInput,
|
|
7
|
+
import { Input as TamaguiInput, XStack, YStack } from "tamagui";
|
|
8
8
|
import { Button } from "../../Button";
|
|
9
9
|
import { Form } from "../../Form";
|
|
10
10
|
import { Input } from "./index";
|
|
11
|
+
import { Paragraph } from "@multiplatform.one/theme";
|
|
11
12
|
|
|
12
13
|
const meta: Meta<typeof Input> = {
|
|
13
14
|
title: "Forms/Input",
|
|
@@ -132,6 +133,43 @@ export const Copy: Story = {
|
|
|
132
133
|
},
|
|
133
134
|
};
|
|
134
135
|
|
|
136
|
+
/**
|
|
137
|
+
* LC-149 FIELD-TRAILING-ACTION: a masked field carries its show/hide toggle
|
|
138
|
+
* inside, as the trailing action. Eye / eye-slash, "Show password" /
|
|
139
|
+
* "Hide password", 44pt press target.
|
|
140
|
+
*/
|
|
141
|
+
export const Password: Story = {
|
|
142
|
+
args: {
|
|
143
|
+
label: "Password",
|
|
144
|
+
secureTextEntry: true,
|
|
145
|
+
defaultValue: "correct horse",
|
|
146
|
+
placeholder: "Create a password",
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* LC-149: one trailing slot per field. An action (reveal, copy) owns it, so
|
|
152
|
+
* an error shows as the red border and the message; the in-field error glyph
|
|
153
|
+
* appears only when the slot is empty.
|
|
154
|
+
*/
|
|
155
|
+
export const TrailingActions: Story = {
|
|
156
|
+
render: () => (
|
|
157
|
+
<YStack gap="$4" maxWidth={400}>
|
|
158
|
+
<Input label="Password" secureTextEntry defaultValue="hunter22" />
|
|
159
|
+
<Input
|
|
160
|
+
label="Password with error"
|
|
161
|
+
secureTextEntry
|
|
162
|
+
required
|
|
163
|
+
error="Password must be at least 8 characters"
|
|
164
|
+
defaultValue="short"
|
|
165
|
+
/>
|
|
166
|
+
<Input label="Confirm password" secureTextEntry required error="Passwords do not match" />
|
|
167
|
+
<Input label="API token" readOnly copy value="mpo_live_4f2a9c81e0b3" />
|
|
168
|
+
<Input label="Name" required error="Enter your name" />
|
|
169
|
+
</YStack>
|
|
170
|
+
),
|
|
171
|
+
};
|
|
172
|
+
|
|
135
173
|
export const Chromeless: Story = {
|
|
136
174
|
args: {
|
|
137
175
|
label: "Toolbar search",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTouchSurface } from "@multiplatform.one/theme";
|
|
2
2
|
import type { ComponentProps, ReactElement, ReactNode } from "react";
|
|
3
|
-
import { useCallback, useRef } from "react";
|
|
3
|
+
import { useCallback, useRef, useState } from "react";
|
|
4
4
|
import { writeToClipboard } from "@multiplatform.one/platform";
|
|
5
5
|
import { MIN_PRESS_TARGET, pressTargetHitSlop } from "@multiplatform.one/theme";
|
|
6
6
|
import { ClipboardIcon, WarningCircleIcon } from "@phosphor-icons/react";
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
useResolvedValidators,
|
|
25
25
|
} from "../../shared/utils";
|
|
26
26
|
import { Input as InputParts, useForwardFocus } from "../../InputParts";
|
|
27
|
+
import { PasswordReveal, usePasswordReveal } from "../../InputParts/PasswordReveal";
|
|
27
28
|
import type { AnyFormApi, LinkResolver } from "../../types";
|
|
28
29
|
import { LinkCell } from "../../utils/LinkCell";
|
|
29
30
|
import { getFormSubmission } from "../../Form/submissionController";
|
|
@@ -63,6 +64,11 @@ export interface InputProps {
|
|
|
63
64
|
onChangeText?: (text: string) => void;
|
|
64
65
|
onBlur?: (...args: any[]) => void;
|
|
65
66
|
secureTextEntry?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* LC-149: a masked field (`secureTextEntry`, here or in `inputProps`)
|
|
69
|
+
* carries a show/hide toggle in its trailing slot. `false` drops it.
|
|
70
|
+
*/
|
|
71
|
+
reveal?: boolean;
|
|
66
72
|
placeholder?: string;
|
|
67
73
|
multiline?: boolean;
|
|
68
74
|
maxLength?: number;
|
|
@@ -120,7 +126,8 @@ export function Input({
|
|
|
120
126
|
onChange,
|
|
121
127
|
onChangeText,
|
|
122
128
|
onBlur,
|
|
123
|
-
secureTextEntry,
|
|
129
|
+
secureTextEntry: secureTextEntryProp,
|
|
130
|
+
reveal = true,
|
|
124
131
|
placeholder,
|
|
125
132
|
multiline,
|
|
126
133
|
maxLength,
|
|
@@ -148,6 +155,18 @@ export function Input({
|
|
|
148
155
|
});
|
|
149
156
|
const inputRef = useRef<TamaguiElement>(null);
|
|
150
157
|
const focusTrigger = useForwardFocus(inputRef);
|
|
158
|
+
const masked =
|
|
159
|
+
secureTextEntryProp ??
|
|
160
|
+
(inputProps as { secureTextEntry?: boolean } | undefined)?.secureTextEntry;
|
|
161
|
+
const revealable = Boolean(masked && reveal && !copy && !readOnly && !children && !skeleton);
|
|
162
|
+
const [revealText, setRevealText] = useState(String(value ?? defaultValue ?? ""));
|
|
163
|
+
const passwordReveal = usePasswordReveal({
|
|
164
|
+
inputRef,
|
|
165
|
+
id,
|
|
166
|
+
text: value !== undefined ? String(value ?? "") : revealText,
|
|
167
|
+
});
|
|
168
|
+
const secureTextEntry =
|
|
169
|
+
masked === undefined ? undefined : Boolean(masked) && !(revealable && passwordReveal.revealed);
|
|
151
170
|
|
|
152
171
|
const resolvedValidators = useResolvedValidators(required, validators, label, name);
|
|
153
172
|
|
|
@@ -269,6 +288,9 @@ export function Input({
|
|
|
269
288
|
const copyText = String(inputValue ?? "");
|
|
270
289
|
// Empty omits the cap so the field stays one tab stop (LC-49).
|
|
271
290
|
const showCopy = Boolean(copy && copyText);
|
|
291
|
+
// LC-149: one trailing slot. An action owns it, so the error glyph steps
|
|
292
|
+
// aside and the red border plus the message carry the error.
|
|
293
|
+
const trailingAction = showCopy || revealable;
|
|
272
294
|
const activateCopy = () => {
|
|
273
295
|
if (disabled) return;
|
|
274
296
|
void handleCopy(copyText);
|
|
@@ -280,7 +302,7 @@ export function Input({
|
|
|
280
302
|
// LC-40: the Box owns the disabled chrome treatment (read-only renders
|
|
281
303
|
// its own branch below and never dims).
|
|
282
304
|
disabled={disabled}
|
|
283
|
-
{...(
|
|
305
|
+
{...(trailingAction ? { paddingInlineEnd: 0 } : undefined)}
|
|
284
306
|
{...chromelessProps}
|
|
285
307
|
>
|
|
286
308
|
{leftIcon && (
|
|
@@ -351,37 +373,30 @@ export function Input({
|
|
|
351
373
|
onChange={onChange}
|
|
352
374
|
onChangeText={(text) => {
|
|
353
375
|
if (disabled) return;
|
|
376
|
+
if (revealable) setRevealText(text);
|
|
354
377
|
handleChange?.(text);
|
|
355
378
|
onChangeText?.(text);
|
|
356
379
|
}}
|
|
357
380
|
/>
|
|
358
381
|
)}
|
|
359
382
|
{showCopy ? (
|
|
360
|
-
<InputParts.
|
|
361
|
-
glyphRing
|
|
383
|
+
<InputParts.Action
|
|
362
384
|
size={resolvedSize}
|
|
363
|
-
type="button"
|
|
364
385
|
disabled={disabled}
|
|
365
386
|
tabIndex={disabled ? -1 : 0}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
hitSlop={belowFloor ? pressTargetHitSlop(visualHeight) : undefined}
|
|
369
|
-
onPress={disabled ? undefined : activateCopy}
|
|
370
|
-
onKeyDown={
|
|
371
|
-
((e: KeyboardEvent) => {
|
|
372
|
-
if (disabled) return;
|
|
373
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
374
|
-
e.preventDefault();
|
|
375
|
-
e.stopPropagation();
|
|
376
|
-
activateCopy();
|
|
377
|
-
}
|
|
378
|
-
}) as unknown as () => void
|
|
379
|
-
}
|
|
387
|
+
label={COPY_LABEL}
|
|
388
|
+
onPress={activateCopy}
|
|
380
389
|
>
|
|
381
|
-
<
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
390
|
+
<ClipboardIcon />
|
|
391
|
+
</InputParts.Action>
|
|
392
|
+
) : revealable ? (
|
|
393
|
+
<PasswordReveal
|
|
394
|
+
revealed={passwordReveal.revealed}
|
|
395
|
+
onToggle={passwordReveal.toggle}
|
|
396
|
+
controls={id}
|
|
397
|
+
disabled={disabled}
|
|
398
|
+
size={resolvedSize}
|
|
399
|
+
/>
|
|
385
400
|
) : rightIcon ? (
|
|
386
401
|
<InputParts.Icon
|
|
387
402
|
adornment="trailing"
|
|
@@ -392,7 +407,11 @@ export function Input({
|
|
|
392
407
|
) : hasError ? (
|
|
393
408
|
// M3 / Polaris / Spectrum: in-field error glyph (color is not the
|
|
394
409
|
// only channel). Omitted when the consumer owns the trailing slot.
|
|
395
|
-
<InputParts.Icon
|
|
410
|
+
<InputParts.Icon
|
|
411
|
+
adornment="trailing"
|
|
412
|
+
color={formCommonColors.error}
|
|
413
|
+
data-field-error-glyph=""
|
|
414
|
+
>
|
|
396
415
|
<WarningCircleIcon aria-hidden />
|
|
397
416
|
</InputParts.Icon>
|
|
398
417
|
) : null}
|
|
@@ -453,6 +472,7 @@ Input.Box = InputParts.Box;
|
|
|
453
472
|
Input.Area = InputParts.Area;
|
|
454
473
|
Input.Section = InputParts.Section;
|
|
455
474
|
Input.Button = InputParts.Button;
|
|
475
|
+
Input.Action = InputParts.Action;
|
|
456
476
|
Input.Info = InputParts.Info;
|
|
457
477
|
Input.Meta = InputParts.Meta;
|
|
458
478
|
Input.Label = InputParts.Label;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useTouchSurface } from "@multiplatform.one/theme";
|
|
1
|
+
import { useTouchSurface, Text } from "@multiplatform.one/theme";
|
|
2
2
|
import type { Validator } from "../../types";
|
|
3
3
|
|
|
4
4
|
import type { DeepKeys, DeepValue } from "@tanstack/form-core";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type ReactNode,
|
|
13
13
|
} from "react";
|
|
14
14
|
import { useProps, type GetProps, type SizeTokens } from "tamagui";
|
|
15
|
-
import { Avatar, Text, XStack, YStack, isWeb, styled } from "tamagui";
|
|
15
|
+
import { Avatar, Text as TamaguiText, XStack, YStack, isWeb, styled } from "tamagui";
|
|
16
16
|
import { useDismiss, useInteractions } from "@floating-ui/react";
|
|
17
17
|
import {
|
|
18
18
|
ensureFocusVisibleRing,
|
|
@@ -187,7 +187,7 @@ const MEDIA_SLOT_FALLBACK = 32;
|
|
|
187
187
|
|
|
188
188
|
const SLUG_ID = /^[A-Za-z][\w.-]*$/;
|
|
189
189
|
|
|
190
|
-
type MentionTextProps = GetProps<typeof
|
|
190
|
+
type MentionTextProps = GetProps<typeof TamaguiText>;
|
|
191
191
|
|
|
192
192
|
/** GitHub/Slack: bold the query hit inside the suggestion label. */
|
|
193
193
|
function MentionMatchText({
|
|
@@ -197,20 +197,20 @@ function MentionMatchText({
|
|
|
197
197
|
}: MentionTextProps & { text: string; query: string }) {
|
|
198
198
|
const needle = query.trim();
|
|
199
199
|
if (!needle) {
|
|
200
|
-
return <
|
|
200
|
+
return <TamaguiText {...rest}>{text}</TamaguiText>;
|
|
201
201
|
}
|
|
202
202
|
const idx = text.toLowerCase().indexOf(needle.toLowerCase());
|
|
203
203
|
if (idx < 0) {
|
|
204
|
-
return <
|
|
204
|
+
return <TamaguiText {...rest}>{text}</TamaguiText>;
|
|
205
205
|
}
|
|
206
206
|
return (
|
|
207
|
-
<
|
|
207
|
+
<TamaguiText {...rest}>
|
|
208
208
|
{text.slice(0, idx)}
|
|
209
|
-
<
|
|
209
|
+
<TamaguiText {...rest} fontWeight="700">
|
|
210
210
|
{text.slice(idx, idx + needle.length)}
|
|
211
|
-
</
|
|
211
|
+
</TamaguiText>
|
|
212
212
|
{text.slice(idx + needle.length)}
|
|
213
|
-
</
|
|
213
|
+
</TamaguiText>
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
|
|
@@ -394,6 +394,7 @@ export function MentionInput<
|
|
|
394
394
|
});
|
|
395
395
|
|
|
396
396
|
const dismiss = useDismiss(panel.context, {
|
|
397
|
+
enabled: isWeb,
|
|
397
398
|
outsidePressEvent: "click",
|
|
398
399
|
ancestorScroll: false,
|
|
399
400
|
});
|
|
@@ -435,7 +436,7 @@ export function MentionInput<
|
|
|
435
436
|
| { textarea?: HTMLTextAreaElement; _textarea?: HTMLTextAreaElement }
|
|
436
437
|
| HTMLElement
|
|
437
438
|
| null;
|
|
438
|
-
if (!current) return null;
|
|
439
|
+
if (!current || typeof HTMLTextAreaElement === "undefined") return null;
|
|
439
440
|
if (current instanceof HTMLTextAreaElement) return current;
|
|
440
441
|
if ("textarea" in current && current.textarea instanceof HTMLTextAreaElement) {
|
|
441
442
|
return current.textarea;
|
|
@@ -443,11 +444,9 @@ export function MentionInput<
|
|
|
443
444
|
if ("_textarea" in current && current._textarea instanceof HTMLTextAreaElement) {
|
|
444
445
|
return current._textarea;
|
|
445
446
|
}
|
|
446
|
-
if (current instanceof HTMLElement)
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
}
|
|
450
|
-
return null;
|
|
447
|
+
if (typeof HTMLElement === "undefined" || !(current instanceof HTMLElement)) return null;
|
|
448
|
+
const nested = current.querySelector("textarea");
|
|
449
|
+
return nested instanceof HTMLTextAreaElement ? nested : null;
|
|
451
450
|
}, []);
|
|
452
451
|
|
|
453
452
|
const handleTextChange = useCallback(
|
|
@@ -776,7 +775,7 @@ export function MentionInput<
|
|
|
776
775
|
});
|
|
777
776
|
|
|
778
777
|
useLayoutEffect(() => {
|
|
779
|
-
if (!triggerActive) return;
|
|
778
|
+
if (!triggerActive || !isWeb) return;
|
|
780
779
|
const rect = getCaretClientRect();
|
|
781
780
|
panel.refs.setReference({ getBoundingClientRect: () => rect });
|
|
782
781
|
panel.update();
|
|
@@ -907,13 +906,13 @@ export function MentionInput<
|
|
|
907
906
|
})
|
|
908
907
|
: triggerActive && (
|
|
909
908
|
<YStack paddingHorizontal="$3" paddingVertical="$2" role="status" aria-live="polite">
|
|
910
|
-
<
|
|
909
|
+
<TamaguiText
|
|
911
910
|
fontSize={helperFontSizeMap[knobProps.sizeToken as string] ?? "$2"}
|
|
912
911
|
color={formCommonColors.muted}
|
|
913
912
|
{...knobProps.body}
|
|
914
913
|
>
|
|
915
914
|
{t("No matches")}
|
|
916
|
-
</
|
|
915
|
+
</TamaguiText>
|
|
917
916
|
</YStack>
|
|
918
917
|
)}
|
|
919
918
|
<ScrollArrow
|
|
@@ -3,11 +3,12 @@ import { action } from "@multiplatform.one/storybook";
|
|
|
3
3
|
import { DataTable, type DataTableColumn } from "@multiplatform.one/table";
|
|
4
4
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
5
5
|
import { useForm } from "@tanstack/react-form";
|
|
6
|
-
import {
|
|
6
|
+
import { YStack } from "tamagui";
|
|
7
7
|
import { Button } from "../../Button";
|
|
8
8
|
import { Input } from "../Input";
|
|
9
9
|
import { Form } from "../../Form";
|
|
10
10
|
import { OTPInput } from "./index";
|
|
11
|
+
import { Text } from "@multiplatform.one/theme";
|
|
11
12
|
|
|
12
13
|
const meta: Meta<typeof OTPInput> = {
|
|
13
14
|
title: "Forms/OTPInput",
|
|
@@ -2,7 +2,7 @@ import { useTouchSurface } from "@multiplatform.one/theme";
|
|
|
2
2
|
import type { Validator } from "../../types";
|
|
3
3
|
|
|
4
4
|
import type { DeepKeys, DeepValue } from "@tanstack/form-core";
|
|
5
|
-
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
5
|
+
import { edgeColorAt, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
6
6
|
import {
|
|
7
7
|
type ClipboardEvent,
|
|
8
8
|
type ComponentProps,
|
|
@@ -234,7 +234,7 @@ const OTPDigitInput = memo(function OTPDigitInput({
|
|
|
234
234
|
? formCommonColors.error
|
|
235
235
|
: value
|
|
236
236
|
? formControlColors.boundary
|
|
237
|
-
: formInputColors.border.base;
|
|
237
|
+
: edgeColorAt(formInputColors.border.base, knobProps.borderWidthStop);
|
|
238
238
|
const firstCell = digitIndex === 0;
|
|
239
239
|
|
|
240
240
|
return (
|
|
@@ -3,10 +3,11 @@ import { action } from "@multiplatform.one/storybook";
|
|
|
3
3
|
import { DataTable, type DataTableColumn } from "@multiplatform.one/table";
|
|
4
4
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
5
5
|
import { useForm } from "@tanstack/react-form";
|
|
6
|
-
import {
|
|
6
|
+
import { YStack } from "tamagui";
|
|
7
7
|
import { Button } from "../../Button";
|
|
8
8
|
import { Form } from "../../Form";
|
|
9
9
|
import { PhoneInput } from "./index";
|
|
10
|
+
import { Text } from "@multiplatform.one/theme";
|
|
10
11
|
|
|
11
12
|
const meta: Meta<typeof PhoneInput> = {
|
|
12
13
|
title: "Forms/PhoneInput",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useTouchSurface } from "@multiplatform.one/theme";
|
|
1
|
+
import { useTouchSurface, Text } from "@multiplatform.one/theme";
|
|
2
2
|
import { CaretDownIcon, GlobeIcon } from "@phosphor-icons/react";
|
|
3
3
|
import { ensureCompositeFocusRing, useGlyphColor } from "@multiplatform.one/theme";
|
|
4
4
|
import type { DeepKeys, DeepValue } from "@tanstack/form-core";
|
|
@@ -6,7 +6,7 @@ import type { ComponentProps, FocusEventHandler, ReactNode } from "react";
|
|
|
6
6
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import type { TamaguiElement } from "tamagui";
|
|
8
8
|
import { isWeb, useProps } from "tamagui";
|
|
9
|
-
import { Input, Text, View, XStack } from "tamagui";
|
|
9
|
+
import { Input, Text as TamaguiText, View, XStack } from "tamagui";
|
|
10
10
|
import { Skeleton } from "../../Skeleton";
|
|
11
11
|
import { Field, FieldLayout } from "../../fieldLayout";
|
|
12
12
|
import type { SimpleFieldApi, Validator } from "../../types";
|
|
@@ -271,7 +271,9 @@ export function PhoneInput<
|
|
|
271
271
|
const host =
|
|
272
272
|
node && typeof node.setSelectionRange === "function"
|
|
273
273
|
? node
|
|
274
|
-
: typeof document !== "undefined" &&
|
|
274
|
+
: typeof document !== "undefined" &&
|
|
275
|
+
typeof HTMLInputElement !== "undefined" &&
|
|
276
|
+
document.activeElement instanceof HTMLInputElement
|
|
275
277
|
? document.activeElement
|
|
276
278
|
: null;
|
|
277
279
|
if (host && typeof host.setSelectionRange === "function") {
|
|
@@ -284,7 +286,9 @@ export function PhoneInput<
|
|
|
284
286
|
const handlePhoneChange = (text: string) => {
|
|
285
287
|
if (disabled || readOnly) return;
|
|
286
288
|
const el =
|
|
287
|
-
typeof document !== "undefined" &&
|
|
289
|
+
typeof document !== "undefined" &&
|
|
290
|
+
typeof HTMLInputElement !== "undefined" &&
|
|
291
|
+
document.activeElement instanceof HTMLInputElement
|
|
288
292
|
? document.activeElement
|
|
289
293
|
: null;
|
|
290
294
|
const caret = el?.selectionStart ?? text.length;
|
|
@@ -366,7 +370,7 @@ export function PhoneInput<
|
|
|
366
370
|
<GlobeIcon />
|
|
367
371
|
</InputParts.Icon>
|
|
368
372
|
)}
|
|
369
|
-
<
|
|
373
|
+
<TamaguiText
|
|
370
374
|
data-testid="phone-dial"
|
|
371
375
|
data-text-class="T-VALUE"
|
|
372
376
|
fontFamily={knobProps.body.fontFamily}
|
|
@@ -376,7 +380,7 @@ export function PhoneInput<
|
|
|
376
380
|
userSelect="none"
|
|
377
381
|
>
|
|
378
382
|
+{dialOf(code)}
|
|
379
|
-
</
|
|
383
|
+
</TamaguiText>
|
|
380
384
|
{inTableCell ? null : <CaretDownIcon size={caretSize} color={glyphColor} />}
|
|
381
385
|
</XStack>
|
|
382
386
|
);
|