@multiplatform.one/forms 7.65.2 → 7.67.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/dist/cjs/FloatingPanel/RegularPanel.cjs +164 -0
- package/dist/cjs/FloatingPanel/RegularPanel.native.js +169 -0
- package/dist/cjs/FloatingPanel/RegularPanel.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/compactFace.cjs +6 -0
- package/dist/cjs/FloatingPanel/compactFace.native.js +6 -0
- package/dist/cjs/FloatingPanel/compactFace.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/containingBlock.cjs +46 -0
- package/dist/cjs/FloatingPanel/containingBlock.native.js +51 -0
- package/dist/cjs/FloatingPanel/containingBlock.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/index.cjs +2 -20
- package/dist/cjs/FloatingPanel/index.native.js +79 -45
- package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/pointAnchor.cjs +25 -0
- package/dist/cjs/FloatingPanel/pointAnchor.native.js +26 -0
- package/dist/cjs/FloatingPanel/pointAnchor.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/regularPlacement.cjs +61 -0
- package/dist/cjs/FloatingPanel/regularPlacement.native.js +65 -0
- package/dist/cjs/FloatingPanel/regularPlacement.native.js.map +1 -0
- package/dist/cjs/fields/Combobox/index.cjs +8 -10
- package/dist/cjs/fields/Combobox/index.native.js +10 -10
- package/dist/cjs/fields/Combobox/index.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/parts.cjs +1 -0
- package/dist/cjs/fields/DatePicker/parts.native.js +3 -0
- package/dist/cjs/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/cjs/fields/Input/index.cjs +5 -0
- package/dist/cjs/fields/Input/index.native.js +5 -0
- package/dist/cjs/fields/Input/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/InlineChoices.cjs +3 -2
- package/dist/cjs/fields/Select/InlineChoices.native.js +5 -2
- package/dist/cjs/fields/Select/InlineChoices.native.js.map +1 -1
- package/dist/cjs/fields/Select/SheetPickerRow.cjs +154 -0
- package/dist/cjs/fields/Select/SheetPickerRow.native.js +165 -0
- package/dist/cjs/fields/Select/SheetPickerRow.native.js.map +1 -0
- package/dist/cjs/fields/Select/index.cjs +64 -5
- package/dist/cjs/fields/Select/index.native.js +86 -27
- package/dist/cjs/fields/Select/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/shouldInlineChoices.cjs +14 -1
- package/dist/cjs/fields/Select/shouldInlineChoices.native.js +15 -1
- package/dist/cjs/fields/Select/shouldInlineChoices.native.js.map +1 -1
- package/dist/cjs/fields/Slider/index.cjs +96 -4
- package/dist/cjs/fields/Slider/index.native.js +103 -5
- package/dist/cjs/fields/Slider/index.native.js.map +1 -1
- package/dist/cjs/fields/Switch/index.cjs +71 -1
- package/dist/cjs/fields/Switch/index.native.js +72 -1
- package/dist/cjs/fields/Switch/index.native.js.map +1 -1
- package/dist/cjs/fields/TimePicker/parts.cjs +1 -0
- package/dist/cjs/fields/TimePicker/parts.native.js +1 -0
- package/dist/cjs/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/cjs/fields/ToggleGroup/index.cjs +67 -1
- package/dist/cjs/fields/ToggleGroup/index.native.js +75 -1
- package/dist/cjs/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.cjs +34 -19
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.native.js +44 -21
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/cjs/fields/nativeDateTime/sheetKeyboard.cjs +54 -0
- package/dist/cjs/fields/nativeDateTime/sheetKeyboard.native.js +57 -0
- package/dist/cjs/fields/nativeDateTime/sheetKeyboard.native.js.map +1 -0
- package/dist/cjs/index.cjs +11 -0
- package/dist/cjs/index.native.js +11 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/overlaySizeClass.cjs +42 -0
- package/dist/cjs/shared/overlaySizeClass.native.js +45 -0
- package/dist/cjs/shared/overlaySizeClass.native.js.map +1 -0
- package/dist/cjs/shared/sheetNavigation.cjs +76 -0
- package/dist/cjs/shared/sheetNavigation.native.js +129 -0
- package/dist/cjs/shared/sheetNavigation.native.js.map +1 -0
- package/dist/cjs/shared/systemControlModules.cjs +34 -0
- package/dist/cjs/shared/systemControlModules.gnome.cjs +34 -0
- package/dist/cjs/shared/systemControlModules.gnome.native.js +37 -0
- package/dist/cjs/shared/systemControlModules.gnome.native.js.map +1 -0
- package/dist/cjs/shared/systemControlModules.native.js +77 -0
- package/dist/cjs/shared/systemControlModules.native.js.map +1 -0
- package/dist/cjs/shared/systemControls.cjs +47 -0
- package/dist/cjs/shared/systemControls.native.js +51 -0
- package/dist/cjs/shared/systemControls.native.js.map +1 -0
- package/dist/esm/FloatingPanel/RegularPanel.mjs +139 -0
- package/dist/esm/FloatingPanel/RegularPanel.mjs.map +1 -0
- package/dist/esm/FloatingPanel/RegularPanel.native.js +141 -0
- package/dist/esm/FloatingPanel/RegularPanel.native.js.map +1 -0
- package/dist/esm/FloatingPanel/compactFace.mjs +5 -1
- package/dist/esm/FloatingPanel/compactFace.mjs.map +1 -1
- package/dist/esm/FloatingPanel/compactFace.native.js +5 -1
- package/dist/esm/FloatingPanel/compactFace.native.js.map +1 -1
- package/dist/esm/FloatingPanel/containingBlock.mjs +21 -0
- package/dist/esm/FloatingPanel/containingBlock.mjs.map +1 -0
- package/dist/esm/FloatingPanel/containingBlock.native.js +23 -0
- package/dist/esm/FloatingPanel/containingBlock.native.js.map +1 -0
- package/dist/esm/FloatingPanel/index.mjs +1 -19
- package/dist/esm/FloatingPanel/index.mjs.map +1 -1
- package/dist/esm/FloatingPanel/index.native.js +83 -49
- package/dist/esm/FloatingPanel/index.native.js.map +1 -1
- package/dist/esm/FloatingPanel/pointAnchor.mjs +25 -1
- package/dist/esm/FloatingPanel/pointAnchor.mjs.map +1 -1
- package/dist/esm/FloatingPanel/pointAnchor.native.js +26 -1
- package/dist/esm/FloatingPanel/pointAnchor.native.js.map +1 -1
- package/dist/esm/FloatingPanel/regularPlacement.mjs +35 -0
- package/dist/esm/FloatingPanel/regularPlacement.mjs.map +1 -0
- package/dist/esm/FloatingPanel/regularPlacement.native.js +36 -0
- package/dist/esm/FloatingPanel/regularPlacement.native.js.map +1 -0
- package/dist/esm/fields/Combobox/index.mjs +9 -11
- package/dist/esm/fields/Combobox/index.mjs.map +1 -1
- package/dist/esm/fields/Combobox/index.native.js +11 -11
- package/dist/esm/fields/Combobox/index.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/parts.mjs +1 -0
- package/dist/esm/fields/DatePicker/parts.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/parts.native.js +3 -0
- package/dist/esm/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/esm/fields/Input/index.mjs +6 -1
- package/dist/esm/fields/Input/index.mjs.map +1 -1
- package/dist/esm/fields/Input/index.native.js +6 -1
- package/dist/esm/fields/Input/index.native.js.map +1 -1
- package/dist/esm/fields/Select/InlineChoices.mjs +3 -2
- package/dist/esm/fields/Select/InlineChoices.mjs.map +1 -1
- package/dist/esm/fields/Select/InlineChoices.native.js +5 -2
- package/dist/esm/fields/Select/InlineChoices.native.js.map +1 -1
- package/dist/esm/fields/Select/SheetPickerRow.mjs +129 -0
- package/dist/esm/fields/Select/SheetPickerRow.mjs.map +1 -0
- package/dist/esm/fields/Select/SheetPickerRow.native.js +137 -0
- package/dist/esm/fields/Select/SheetPickerRow.native.js.map +1 -0
- package/dist/esm/fields/Select/index.mjs +66 -7
- package/dist/esm/fields/Select/index.mjs.map +1 -1
- package/dist/esm/fields/Select/index.native.js +88 -29
- package/dist/esm/fields/Select/index.native.js.map +1 -1
- package/dist/esm/fields/Select/shouldInlineChoices.mjs +12 -1
- package/dist/esm/fields/Select/shouldInlineChoices.mjs.map +1 -1
- package/dist/esm/fields/Select/shouldInlineChoices.native.js +13 -1
- package/dist/esm/fields/Select/shouldInlineChoices.native.js.map +1 -1
- package/dist/esm/fields/Slider/index.mjs +96 -4
- package/dist/esm/fields/Slider/index.mjs.map +1 -1
- package/dist/esm/fields/Slider/index.native.js +103 -5
- package/dist/esm/fields/Slider/index.native.js.map +1 -1
- package/dist/esm/fields/Switch/index.mjs +71 -1
- package/dist/esm/fields/Switch/index.mjs.map +1 -1
- package/dist/esm/fields/Switch/index.native.js +72 -1
- package/dist/esm/fields/Switch/index.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/parts.mjs +1 -0
- package/dist/esm/fields/TimePicker/parts.mjs.map +1 -1
- package/dist/esm/fields/TimePicker/parts.native.js +1 -0
- package/dist/esm/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/esm/fields/ToggleGroup/index.mjs +67 -1
- package/dist/esm/fields/ToggleGroup/index.mjs.map +1 -1
- package/dist/esm/fields/ToggleGroup/index.native.js +75 -1
- package/dist/esm/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.mjs +36 -21
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.mjs.map +1 -1
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js +46 -23
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/esm/fields/nativeDateTime/sheetKeyboard.mjs +21 -0
- package/dist/esm/fields/nativeDateTime/sheetKeyboard.mjs.map +1 -0
- package/dist/esm/fields/nativeDateTime/sheetKeyboard.native.js +21 -0
- package/dist/esm/fields/nativeDateTime/sheetKeyboard.native.js.map +1 -0
- 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/overlaySizeClass.mjs +14 -0
- package/dist/esm/shared/overlaySizeClass.mjs.map +1 -0
- package/dist/esm/shared/overlaySizeClass.native.js +14 -0
- package/dist/esm/shared/overlaySizeClass.native.js.map +1 -0
- package/dist/esm/shared/sheetNavigation.mjs +47 -0
- package/dist/esm/shared/sheetNavigation.mjs.map +1 -0
- package/dist/esm/shared/sheetNavigation.native.js +97 -0
- package/dist/esm/shared/sheetNavigation.native.js.map +1 -0
- package/dist/esm/shared/systemControlModules.gnome.mjs +8 -0
- package/dist/esm/shared/systemControlModules.gnome.mjs.map +1 -0
- package/dist/esm/shared/systemControlModules.gnome.native.js +8 -0
- package/dist/esm/shared/systemControlModules.gnome.native.js.map +1 -0
- package/dist/esm/shared/systemControlModules.mjs +8 -0
- package/dist/esm/shared/systemControlModules.mjs.map +1 -0
- package/dist/esm/shared/systemControlModules.native.js +47 -0
- package/dist/esm/shared/systemControlModules.native.js.map +1 -0
- package/dist/esm/shared/systemControls.mjs +19 -0
- package/dist/esm/shared/systemControls.mjs.map +1 -0
- package/dist/esm/shared/systemControls.native.js +20 -0
- package/dist/esm/shared/systemControls.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/RegularPanel.mjs +139 -0
- package/dist/jsx/FloatingPanel/RegularPanel.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/RegularPanel.native.js +169 -0
- package/dist/jsx/FloatingPanel/RegularPanel.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/compactFace.mjs +5 -1
- package/dist/jsx/FloatingPanel/compactFace.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/compactFace.native.js +6 -0
- package/dist/jsx/FloatingPanel/compactFace.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/containingBlock.mjs +21 -0
- package/dist/jsx/FloatingPanel/containingBlock.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/containingBlock.native.js +51 -0
- package/dist/jsx/FloatingPanel/containingBlock.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/index.mjs +1 -19
- package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/index.native.js +79 -45
- package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/pointAnchor.mjs +25 -1
- package/dist/jsx/FloatingPanel/pointAnchor.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/pointAnchor.native.js +26 -0
- package/dist/jsx/FloatingPanel/pointAnchor.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/regularPlacement.mjs +35 -0
- package/dist/jsx/FloatingPanel/regularPlacement.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/regularPlacement.native.js +65 -0
- package/dist/jsx/FloatingPanel/regularPlacement.native.js.map +1 -0
- package/dist/jsx/fields/Combobox/index.mjs +9 -11
- package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
- package/dist/jsx/fields/Combobox/index.native.js +10 -10
- package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/parts.mjs +1 -0
- package/dist/jsx/fields/DatePicker/parts.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/parts.native.js +3 -0
- package/dist/jsx/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/jsx/fields/Input/index.mjs +6 -1
- package/dist/jsx/fields/Input/index.mjs.map +1 -1
- package/dist/jsx/fields/Input/index.native.js +5 -0
- package/dist/jsx/fields/Input/index.native.js.map +1 -1
- package/dist/jsx/fields/Select/InlineChoices.mjs +3 -2
- package/dist/jsx/fields/Select/InlineChoices.mjs.map +1 -1
- package/dist/jsx/fields/Select/InlineChoices.native.js +5 -2
- package/dist/jsx/fields/Select/InlineChoices.native.js.map +1 -1
- package/dist/jsx/fields/Select/SheetPickerRow.mjs +129 -0
- package/dist/jsx/fields/Select/SheetPickerRow.mjs.map +1 -0
- package/dist/jsx/fields/Select/SheetPickerRow.native.js +165 -0
- package/dist/jsx/fields/Select/SheetPickerRow.native.js.map +1 -0
- package/dist/jsx/fields/Select/index.mjs +66 -7
- package/dist/jsx/fields/Select/index.mjs.map +1 -1
- package/dist/jsx/fields/Select/index.native.js +86 -27
- package/dist/jsx/fields/Select/index.native.js.map +1 -1
- package/dist/jsx/fields/Select/shouldInlineChoices.mjs +12 -1
- package/dist/jsx/fields/Select/shouldInlineChoices.mjs.map +1 -1
- package/dist/jsx/fields/Select/shouldInlineChoices.native.js +15 -1
- package/dist/jsx/fields/Select/shouldInlineChoices.native.js.map +1 -1
- package/dist/jsx/fields/Slider/index.mjs +96 -4
- package/dist/jsx/fields/Slider/index.mjs.map +1 -1
- package/dist/jsx/fields/Slider/index.native.js +103 -5
- package/dist/jsx/fields/Slider/index.native.js.map +1 -1
- package/dist/jsx/fields/Switch/index.mjs +71 -1
- package/dist/jsx/fields/Switch/index.mjs.map +1 -1
- package/dist/jsx/fields/Switch/index.native.js +72 -1
- package/dist/jsx/fields/Switch/index.native.js.map +1 -1
- package/dist/jsx/fields/TimePicker/parts.mjs +1 -0
- package/dist/jsx/fields/TimePicker/parts.mjs.map +1 -1
- package/dist/jsx/fields/TimePicker/parts.native.js +1 -0
- package/dist/jsx/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/jsx/fields/ToggleGroup/index.mjs +67 -1
- package/dist/jsx/fields/ToggleGroup/index.mjs.map +1 -1
- package/dist/jsx/fields/ToggleGroup/index.native.js +75 -1
- package/dist/jsx/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.mjs +36 -21
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.mjs.map +1 -1
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.native.js +44 -21
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/jsx/fields/nativeDateTime/sheetKeyboard.mjs +21 -0
- package/dist/jsx/fields/nativeDateTime/sheetKeyboard.mjs.map +1 -0
- package/dist/jsx/fields/nativeDateTime/sheetKeyboard.native.js +57 -0
- package/dist/jsx/fields/nativeDateTime/sheetKeyboard.native.js.map +1 -0
- 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 +11 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/overlaySizeClass.mjs +14 -0
- package/dist/jsx/shared/overlaySizeClass.mjs.map +1 -0
- package/dist/jsx/shared/overlaySizeClass.native.js +45 -0
- package/dist/jsx/shared/overlaySizeClass.native.js.map +1 -0
- package/dist/jsx/shared/sheetNavigation.mjs +47 -0
- package/dist/jsx/shared/sheetNavigation.mjs.map +1 -0
- package/dist/jsx/shared/sheetNavigation.native.js +129 -0
- package/dist/jsx/shared/sheetNavigation.native.js.map +1 -0
- package/dist/jsx/shared/systemControlModules.gnome.mjs +8 -0
- package/dist/jsx/shared/systemControlModules.gnome.mjs.map +1 -0
- package/dist/jsx/shared/systemControlModules.gnome.native.js +37 -0
- package/dist/jsx/shared/systemControlModules.gnome.native.js.map +1 -0
- package/dist/jsx/shared/systemControlModules.mjs +8 -0
- package/dist/jsx/shared/systemControlModules.mjs.map +1 -0
- package/dist/jsx/shared/systemControlModules.native.js +77 -0
- package/dist/jsx/shared/systemControlModules.native.js.map +1 -0
- package/dist/jsx/shared/systemControls.mjs +19 -0
- package/dist/jsx/shared/systemControls.mjs.map +1 -0
- package/dist/jsx/shared/systemControls.native.js +51 -0
- package/dist/jsx/shared/systemControls.native.js.map +1 -0
- package/package.json +16 -8
- package/src/FloatingPanel/FloatingPanel.menuFace.native.spec.tsx +73 -3
- package/src/FloatingPanel/FloatingPanel.regularWidth.native.spec.tsx +193 -0
- package/src/FloatingPanel/RegularPanel.tsx +159 -0
- package/src/FloatingPanel/compactFace.spec.ts +24 -1
- package/src/FloatingPanel/compactFace.ts +16 -0
- package/src/FloatingPanel/containingBlock.ts +32 -0
- package/src/FloatingPanel/index.native.tsx +80 -35
- package/src/FloatingPanel/index.tsx +1 -33
- package/src/FloatingPanel/pointAnchor.spec.ts +29 -0
- package/src/FloatingPanel/pointAnchor.ts +30 -0
- package/src/FloatingPanel/regularPlacement.spec.ts +65 -0
- package/src/FloatingPanel/regularPlacement.ts +40 -0
- package/src/fields/Combobox/Combobox.regularWidth.native.spec.tsx +94 -0
- package/src/fields/Combobox/index.tsx +11 -34
- package/src/fields/DatePicker/parts.tsx +3 -0
- package/src/fields/DatePicker/touchWeb.spec.tsx +13 -0
- package/src/fields/Input/Input.formName.spec.tsx +53 -0
- package/src/fields/Input/index.tsx +6 -1
- package/src/fields/Select/InlineChoices.tsx +6 -3
- package/src/fields/Select/SheetPickerRow.tsx +160 -0
- package/src/fields/Select/index.tsx +67 -5
- package/src/fields/Select/shouldInlineChoices.spec.ts +21 -1
- package/src/fields/Select/shouldInlineChoices.ts +26 -0
- package/src/fields/Slider/Slider.system.native.spec.tsx +168 -0
- package/src/fields/Slider/index.tsx +166 -30
- package/src/fields/Switch/Switch.system.native.spec.tsx +162 -0
- package/src/fields/Switch/index.tsx +98 -0
- package/src/fields/TimePicker/parts.tsx +1 -0
- package/src/fields/ToggleGroup/ToggleGroup.system.native.spec.tsx +192 -0
- package/src/fields/ToggleGroup/index.tsx +111 -0
- package/src/fields/nativeDateTime/OsDateTimeSheet.presentation.spec.tsx +167 -0
- package/src/fields/nativeDateTime/OsDateTimeSheet.tsx +36 -18
- package/src/fields/nativeDateTime/sheetKeyboard.spec.ts +60 -0
- package/src/fields/nativeDateTime/sheetKeyboard.ts +45 -0
- package/src/index.ts +15 -0
- package/src/shared/overlaySizeClass.spec.ts +27 -0
- package/src/shared/overlaySizeClass.ts +36 -0
- package/src/shared/sheetNavigation.ts +82 -0
- package/src/shared/systemControlModules.gnome.ts +10 -0
- package/src/shared/systemControlModules.native.spec.ts +52 -0
- package/src/shared/systemControlModules.native.ts +66 -0
- package/src/shared/systemControlModules.ts +10 -0
- package/src/shared/systemControls.ts +70 -0
- package/types/FloatingPanel/RegularPanel.d.ts +29 -0
- package/types/FloatingPanel/RegularPanel.d.ts.map +1 -0
- package/types/FloatingPanel/compactFace.d.ts +12 -0
- package/types/FloatingPanel/compactFace.d.ts.map +1 -1
- package/types/FloatingPanel/containingBlock.d.ts +14 -0
- package/types/FloatingPanel/containingBlock.d.ts.map +1 -0
- package/types/FloatingPanel/index.d.ts.map +1 -1
- package/types/FloatingPanel/index.native.d.ts +6 -1
- package/types/FloatingPanel/index.native.d.ts.map +1 -1
- package/types/FloatingPanel/pointAnchor.d.ts +12 -0
- package/types/FloatingPanel/pointAnchor.d.ts.map +1 -1
- package/types/FloatingPanel/regularPlacement.d.ts +20 -0
- package/types/FloatingPanel/regularPlacement.d.ts.map +1 -0
- package/types/fields/Combobox/index.d.ts.map +1 -1
- package/types/fields/DatePicker/parts.d.ts.map +1 -1
- package/types/fields/Input/index.d.ts.map +1 -1
- package/types/fields/Select/InlineChoices.d.ts.map +1 -1
- package/types/fields/Select/SheetPickerRow.d.ts +23 -0
- package/types/fields/Select/SheetPickerRow.d.ts.map +1 -0
- package/types/fields/Select/index.d.ts.map +1 -1
- package/types/fields/Select/shouldInlineChoices.d.ts +15 -0
- package/types/fields/Select/shouldInlineChoices.d.ts.map +1 -1
- package/types/fields/Slider/index.d.ts +7 -1
- package/types/fields/Slider/index.d.ts.map +1 -1
- package/types/fields/Switch/index.d.ts +7 -1
- package/types/fields/Switch/index.d.ts.map +1 -1
- package/types/fields/TimePicker/parts.d.ts.map +1 -1
- package/types/fields/ToggleGroup/index.d.ts +8 -1
- package/types/fields/ToggleGroup/index.d.ts.map +1 -1
- package/types/fields/nativeDateTime/OsDateTimeSheet.d.ts.map +1 -1
- package/types/fields/nativeDateTime/sheetKeyboard.d.ts +20 -0
- package/types/fields/nativeDateTime/sheetKeyboard.d.ts.map +1 -0
- package/types/index.d.ts +4 -0
- package/types/index.d.ts.map +1 -1
- package/types/shared/overlaySizeClass.d.ts +24 -0
- package/types/shared/overlaySizeClass.d.ts.map +1 -0
- package/types/shared/sheetNavigation.d.ts +31 -0
- package/types/shared/sheetNavigation.d.ts.map +1 -0
- package/types/shared/systemControlModules.d.ts +5 -0
- package/types/shared/systemControlModules.d.ts.map +1 -0
- package/types/shared/systemControlModules.gnome.d.ts +5 -0
- package/types/shared/systemControlModules.gnome.d.ts.map +1 -0
- package/types/shared/systemControlModules.native.d.ts +20 -0
- package/types/shared/systemControlModules.native.d.ts.map +1 -0
- package/types/shared/systemControls.d.ts +53 -0
- package/types/shared/systemControls.d.ts.map +1 -0
|
@@ -32,6 +32,7 @@ import { OverlayStackProvider, useInsideOverlay, useOverlayZIndex } from "../sha
|
|
|
32
32
|
import { resolveCompactFace, type CompactFace } from "./compactFace";
|
|
33
33
|
import { isNestedPanelAction, type PanelActionEvent } from "./nestedAction";
|
|
34
34
|
import { PanelPortal } from "./PanelPortal";
|
|
35
|
+
import { fixedContainingBlockOrigin } from "./containingBlock";
|
|
35
36
|
import {
|
|
36
37
|
contextMenuPoint,
|
|
37
38
|
placeOverTrigger,
|
|
@@ -246,39 +247,6 @@ function useKeyboardFocusIntoPanel(
|
|
|
246
247
|
}, [open, frameRef, keyboardOpenRef]);
|
|
247
248
|
}
|
|
248
249
|
|
|
249
|
-
/**
|
|
250
|
-
* Viewport origin of the box a `position: fixed` panel is laid out against.
|
|
251
|
-
* The top/left math is in viewport coordinates, which is only right while that
|
|
252
|
-
* box is the viewport. An ancestor with a transform, filter, perspective,
|
|
253
|
-
* paint containment or container query becomes the containing block instead.
|
|
254
|
-
* PanelPortal lifts the panel out of scroll views, but a panel hosted in a
|
|
255
|
-
* transformed dialog still lays out against that dialog. A `display: contents`
|
|
256
|
-
* node has no box, so its computed `contain` (Tamagui's theme span) is ignored.
|
|
257
|
-
*/
|
|
258
|
-
function fixedContainingBlockOrigin(element: HTMLElement): { top: number; left: number } {
|
|
259
|
-
for (let node = element.parentElement; node; node = node.parentElement) {
|
|
260
|
-
const cs = getComputedStyle(node);
|
|
261
|
-
if (cs.display === "contents") continue;
|
|
262
|
-
const set = (value: string | undefined, initial: string) => !!value && value !== initial;
|
|
263
|
-
const captures =
|
|
264
|
-
set(cs.transform, "none") ||
|
|
265
|
-
set(cs.perspective, "none") ||
|
|
266
|
-
set(cs.filter, "none") ||
|
|
267
|
-
set(cs.backdropFilter, "none") ||
|
|
268
|
-
set(cs.containerType, "normal") ||
|
|
269
|
-
/transform|perspective|filter/.test(cs.willChange) ||
|
|
270
|
-
/paint|layout|strict|content/.test(cs.contain);
|
|
271
|
-
if (captures) {
|
|
272
|
-
const rect = node.getBoundingClientRect();
|
|
273
|
-
return {
|
|
274
|
-
top: rect.top + node.clientTop - node.scrollTop,
|
|
275
|
-
left: rect.left + node.clientLeft - node.scrollLeft,
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
return { top: 0, left: 0 };
|
|
280
|
-
}
|
|
281
|
-
|
|
282
250
|
function isRtl(element?: HTMLElement | null): boolean {
|
|
283
251
|
if (!isWeb || typeof document === "undefined") return false;
|
|
284
252
|
const direction = element ? getComputedStyle(element).direction : "";
|
|
@@ -3,6 +3,7 @@ import { describe, expect, it } from "vitest";
|
|
|
3
3
|
import {
|
|
4
4
|
contextMenuPoint,
|
|
5
5
|
placeAtPoint,
|
|
6
|
+
placeBesideTrigger,
|
|
6
7
|
placeOverTrigger,
|
|
7
8
|
pointOpensUp,
|
|
8
9
|
pointPanelLeft,
|
|
@@ -219,3 +220,31 @@ describe("placeOverTrigger (FZ-7830, LC-112 where no sheet may take it)", () =>
|
|
|
219
220
|
expect(placed.left).toBe(10);
|
|
220
221
|
});
|
|
221
222
|
});
|
|
223
|
+
|
|
224
|
+
describe("placeBesideTrigger (FZ-7830 round 3, LC-262: beside the trigger, never over it)", () => {
|
|
225
|
+
const phone: PanelBounds = { top: 57, left: 10, right: 380, bottom: 800 };
|
|
226
|
+
const field = { x: 16, y: 300, width: 358, height: 44 };
|
|
227
|
+
|
|
228
|
+
it("opens under the trigger when it fits", () => {
|
|
229
|
+
const placed = placeBesideTrigger({ trigger: field, width: 200, height: 180, bounds: phone });
|
|
230
|
+
expect(placed).toEqual({ left: 16, top: 344, width: 358, maxHeight: 180, shifted: false });
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it("opens above the trigger when there is more room there, its bottom on the trigger's top", () => {
|
|
234
|
+
const low = { ...field, y: 700 };
|
|
235
|
+
const placed = placeBesideTrigger({ trigger: low, width: 200, height: 220, bounds: phone });
|
|
236
|
+
expect(placed.top + placed.maxHeight).toBe(700);
|
|
237
|
+
expect(placed.maxHeight).toBe(220);
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
it("never overlaps the trigger, scrolling what does not fit", () => {
|
|
241
|
+
for (const y of [60, 300, 500, 740]) {
|
|
242
|
+
const trigger = { ...field, y };
|
|
243
|
+
const placed = placeBesideTrigger({ trigger, width: 200, height: 2000, bounds: phone });
|
|
244
|
+
const overlaps = placed.top < y + field.height && placed.top + placed.maxHeight > y;
|
|
245
|
+
expect(overlaps, `trigger at ${y}`).toBe(false);
|
|
246
|
+
expect(placed.top).toBeGreaterThanOrEqual(phone.top);
|
|
247
|
+
expect(placed.top + placed.maxHeight).toBeLessThanOrEqual(phone.bottom);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
});
|
|
@@ -172,3 +172,33 @@ export function placeOverTrigger({
|
|
|
172
172
|
shifted: left !== wantLeft || top !== trigger.y,
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* A menu attached to its trigger (an icon trigger, or a short list inside a
|
|
178
|
+
* sheet, LC-262): under the trigger when it fits, above it when that side has
|
|
179
|
+
* more room, and never over it. What still does not fit scrolls.
|
|
180
|
+
*/
|
|
181
|
+
export function placeBesideTrigger({
|
|
182
|
+
trigger,
|
|
183
|
+
width,
|
|
184
|
+
height,
|
|
185
|
+
bounds,
|
|
186
|
+
rtl = false,
|
|
187
|
+
}: {
|
|
188
|
+
trigger: TriggerRect;
|
|
189
|
+
width: number;
|
|
190
|
+
height: number;
|
|
191
|
+
bounds: PanelBounds;
|
|
192
|
+
rtl?: boolean;
|
|
193
|
+
}): TriggerPlacement {
|
|
194
|
+
const room = Math.max(0, bounds.right - bounds.left);
|
|
195
|
+
const w = Math.min(Math.max(width, trigger.width), room);
|
|
196
|
+
const wantLeft = rtl ? trigger.x + trigger.width - w : trigger.x;
|
|
197
|
+
const left = Math.max(bounds.left, Math.min(wantLeft, bounds.right - w));
|
|
198
|
+
const below = Math.max(0, bounds.bottom - (trigger.y + trigger.height));
|
|
199
|
+
const above = Math.max(0, trigger.y - bounds.top);
|
|
200
|
+
const opensUp = height > below && above > below;
|
|
201
|
+
const maxHeight = Math.min(height, opensUp ? above : below);
|
|
202
|
+
const top = opensUp ? trigger.y - maxHeight : trigger.y + trigger.height;
|
|
203
|
+
return { left, top, width: w, maxHeight, shifted: left !== wantLeft || opensUp };
|
|
204
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { placeRegularPanel } from "./regularPlacement";
|
|
3
|
+
|
|
4
|
+
const bounds = { top: 20, left: 12, right: 808, bottom: 1160 };
|
|
5
|
+
const trigger = { x: 40, y: 300, width: 360, height: 44 };
|
|
6
|
+
|
|
7
|
+
describe("placeRegularPanel (FZ-8116)", () => {
|
|
8
|
+
it("covers the field from its top start corner (LC-105)", () => {
|
|
9
|
+
const p = placeRegularPanel({
|
|
10
|
+
trigger,
|
|
11
|
+
width: 200,
|
|
12
|
+
height: 240,
|
|
13
|
+
bounds,
|
|
14
|
+
widthMode: "at-least-trigger",
|
|
15
|
+
});
|
|
16
|
+
expect(p).toMatchObject({ left: 40, top: 300, width: 360, shifted: false });
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("is the field's width for match-trigger even when the content is wider", () => {
|
|
20
|
+
const p = placeRegularPanel({
|
|
21
|
+
trigger,
|
|
22
|
+
width: 500,
|
|
23
|
+
height: 240,
|
|
24
|
+
bounds,
|
|
25
|
+
widthMode: "match-trigger",
|
|
26
|
+
});
|
|
27
|
+
expect(p.width).toBe(360);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("is the content's width for fit-content", () => {
|
|
31
|
+
const p = placeRegularPanel({
|
|
32
|
+
trigger,
|
|
33
|
+
width: 300,
|
|
34
|
+
height: 320,
|
|
35
|
+
bounds,
|
|
36
|
+
widthMode: "fit-content",
|
|
37
|
+
});
|
|
38
|
+
expect(p).toMatchObject({ left: 40, width: 300 });
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("hangs a fit-content panel from the field's end edge in RTL", () => {
|
|
42
|
+
const p = placeRegularPanel({
|
|
43
|
+
trigger,
|
|
44
|
+
width: 300,
|
|
45
|
+
height: 320,
|
|
46
|
+
bounds,
|
|
47
|
+
widthMode: "fit-content",
|
|
48
|
+
rtl: true,
|
|
49
|
+
});
|
|
50
|
+
expect(p.left).toBe(40 + 360 - 300);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("slides up inside the bounds near the bottom of the window", () => {
|
|
54
|
+
const low = { ...trigger, y: 1080 };
|
|
55
|
+
const p = placeRegularPanel({
|
|
56
|
+
trigger: low,
|
|
57
|
+
width: 360,
|
|
58
|
+
height: 300,
|
|
59
|
+
bounds,
|
|
60
|
+
widthMode: "at-least-trigger",
|
|
61
|
+
});
|
|
62
|
+
expect(p.top + 300).toBeLessThanOrEqual(bounds.bottom);
|
|
63
|
+
expect(p.shifted).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
placeOverTrigger,
|
|
3
|
+
type PanelBounds,
|
|
4
|
+
type TriggerPlacement,
|
|
5
|
+
type TriggerRect,
|
|
6
|
+
} from "./pointAnchor";
|
|
7
|
+
import type { PanelWidthMode } from "./useFloatingPanel";
|
|
8
|
+
|
|
9
|
+
/** Height of a regular-width panel whose list fills it (`sheetFill`): a search list. */
|
|
10
|
+
export const regularFillHeight = 480;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Where a FloatingPanel opens at regular width (FZ-8116): over its field, the
|
|
14
|
+
* web float's cover-trigger placement (LC-105), at the width its `widthMode`
|
|
15
|
+
* declares. `at-least-trigger` is never narrower than the field,
|
|
16
|
+
* `match-trigger` is the field's width, `fit-content` is the content's own
|
|
17
|
+
* width from the field's start edge.
|
|
18
|
+
*/
|
|
19
|
+
export function placeRegularPanel({
|
|
20
|
+
trigger,
|
|
21
|
+
width,
|
|
22
|
+
height,
|
|
23
|
+
bounds,
|
|
24
|
+
widthMode,
|
|
25
|
+
rtl = false,
|
|
26
|
+
}: {
|
|
27
|
+
trigger: TriggerRect;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
bounds: PanelBounds;
|
|
31
|
+
widthMode: PanelWidthMode;
|
|
32
|
+
rtl?: boolean;
|
|
33
|
+
}): TriggerPlacement {
|
|
34
|
+
if (widthMode === "at-least-trigger") {
|
|
35
|
+
return placeOverTrigger({ trigger, width, height, bounds, rtl });
|
|
36
|
+
}
|
|
37
|
+
const w = widthMode === "match-trigger" ? trigger.width : width;
|
|
38
|
+
const box = { ...trigger, x: rtl ? trigger.x + trigger.width - w : trigger.x, width: w };
|
|
39
|
+
return placeOverTrigger({ trigger: box, width: w, height, bounds, rtl });
|
|
40
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-8116 (LC-266): on native the Link picker (Combobox) takes the window's
|
|
3
|
+
* size class like Select and ColorPicker do. At regular width (an iPad) it
|
|
4
|
+
* opens over its field with its search inside; at compact width (iPhone,
|
|
5
|
+
* Slide Over) it keeps the bottom sheet.
|
|
6
|
+
*/
|
|
7
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
8
|
+
import { act } from "@testing-library/react";
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
11
|
+
import { authorOptions } from "./authorOptions";
|
|
12
|
+
import { Combobox } from "./index";
|
|
13
|
+
|
|
14
|
+
const screen = vi.hoisted(() => ({ width: 820, height: 1180 }));
|
|
15
|
+
const sheetProps = vi.hoisted(() => [] as unknown[]);
|
|
16
|
+
|
|
17
|
+
vi.mock("tamagui", async (importOriginal) => ({
|
|
18
|
+
...(await importOriginal<typeof import("tamagui")>()),
|
|
19
|
+
isWeb: false,
|
|
20
|
+
}));
|
|
21
|
+
vi.mock("react-native-web", async (importOriginal) => ({
|
|
22
|
+
...(await importOriginal<typeof import("react-native")>()),
|
|
23
|
+
ActionSheetIOS: undefined,
|
|
24
|
+
Modal: ({ children, visible }: { children: ReactNode; visible: boolean }) =>
|
|
25
|
+
visible ? children : null,
|
|
26
|
+
useWindowDimensions: () => ({ ...screen, scale: 2, fontScale: 1 }),
|
|
27
|
+
}));
|
|
28
|
+
vi.mock("../../FloatingPanel", async (importOriginal) => {
|
|
29
|
+
const actual = await importOriginal<typeof import("../../FloatingPanel")>();
|
|
30
|
+
const native = await import("../../FloatingPanel/index.native");
|
|
31
|
+
return {
|
|
32
|
+
...actual,
|
|
33
|
+
FloatingPanel: (props: Parameters<typeof native.FloatingPanel>[0]) => {
|
|
34
|
+
sheetProps.push(props.sheet);
|
|
35
|
+
return <native.FloatingPanel {...props} />;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
vi.useFakeTimers();
|
|
42
|
+
sheetProps.length = 0;
|
|
43
|
+
});
|
|
44
|
+
afterEach(() => {
|
|
45
|
+
vi.restoreAllMocks();
|
|
46
|
+
vi.useRealTimers();
|
|
47
|
+
screen.width = 820;
|
|
48
|
+
screen.height = 1180;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
function tap(target: Element) {
|
|
52
|
+
act(() => {
|
|
53
|
+
target.dispatchEvent(new MouseEvent("mousedown", { bubbles: true, button: 0 }));
|
|
54
|
+
target.dispatchEvent(new MouseEvent("mouseup", { bubbles: true, button: 0 }));
|
|
55
|
+
target.dispatchEvent(new MouseEvent("click", { bubbles: true, button: 0 }));
|
|
56
|
+
});
|
|
57
|
+
act(() => {
|
|
58
|
+
vi.advanceTimersByTime(1);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function open() {
|
|
63
|
+
const view = renderWithProviders(<Combobox options={authorOptions} aria-label="Author" />);
|
|
64
|
+
tap(view.getByRole("button", { name: "Author" }));
|
|
65
|
+
return view;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const regular = () => document.querySelector('[data-testid="floating-panel-regular"]');
|
|
69
|
+
const sheet = () => document.querySelector('[data-testid="floating-panel-sheet"]');
|
|
70
|
+
|
|
71
|
+
describe("Combobox native at regular width (FZ-8116)", () => {
|
|
72
|
+
it("leaves the overlay form to the size class instead of forcing the sheet", () => {
|
|
73
|
+
renderWithProviders(<Combobox options={authorOptions} aria-label="Author" />);
|
|
74
|
+
expect(sheetProps.length).toBeGreaterThan(0);
|
|
75
|
+
expect(sheetProps.every((value) => value !== true)).toBe(true);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("opens over its field on an iPad-wide window", () => {
|
|
79
|
+
open();
|
|
80
|
+
expect(regular()).not.toBeNull();
|
|
81
|
+
expect(sheet()).toBeNull();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it.each([
|
|
85
|
+
["an iPhone", 390, 844],
|
|
86
|
+
["iPad Slide Over", 320, 1180],
|
|
87
|
+
])("keeps the bottom sheet on %s", (_name, width, height) => {
|
|
88
|
+
screen.width = width;
|
|
89
|
+
screen.height = height;
|
|
90
|
+
open();
|
|
91
|
+
expect(regular()).toBeNull();
|
|
92
|
+
expect(sheet()).not.toBeNull();
|
|
93
|
+
});
|
|
94
|
+
});
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
ensureFocusVisibleRing,
|
|
32
32
|
ensureKeyboardModalityTracking,
|
|
33
33
|
keyboardFocusRingProps,
|
|
34
|
+
menuRowChecked,
|
|
34
35
|
menuRowFrame,
|
|
35
36
|
useGlyphColor,
|
|
36
37
|
useResolvedKnobs,
|
|
@@ -87,7 +88,7 @@ const ComboboxRow = styled(View, {
|
|
|
87
88
|
focusVisibleStyle: ensureFocusVisibleRing({ outlineOffset: -2 }),
|
|
88
89
|
variants: {
|
|
89
90
|
selected: {
|
|
90
|
-
true:
|
|
91
|
+
true: menuRowChecked,
|
|
91
92
|
false: { backgroundColor: "transparent" },
|
|
92
93
|
},
|
|
93
94
|
active: {
|
|
@@ -385,24 +386,12 @@ const ComboboxItem = memo(function ComboboxItem({
|
|
|
385
386
|
{...(suppressHover
|
|
386
387
|
? {
|
|
387
388
|
hoverStyle: {
|
|
388
|
-
backgroundColor: isActive
|
|
389
|
-
? formInputColors.background.focus
|
|
390
|
-
: isSelected
|
|
391
|
-
? formInputColors.background.base
|
|
392
|
-
: "transparent",
|
|
389
|
+
backgroundColor: isActive ? formInputColors.background.focus : "transparent",
|
|
393
390
|
},
|
|
394
|
-
backgroundColor: isActive
|
|
395
|
-
? formInputColors.background.focus
|
|
396
|
-
: isSelected
|
|
397
|
-
? formInputColors.background.base
|
|
398
|
-
: undefined,
|
|
391
|
+
backgroundColor: isActive ? formInputColors.background.focus : undefined,
|
|
399
392
|
}
|
|
400
393
|
: {
|
|
401
|
-
hoverStyle: {
|
|
402
|
-
backgroundColor: isSelected
|
|
403
|
-
? formInputColors.background.base
|
|
404
|
-
: formInputColors.background.focus,
|
|
405
|
-
},
|
|
394
|
+
hoverStyle: { backgroundColor: formInputColors.background.focus },
|
|
406
395
|
})}
|
|
407
396
|
{...(option.description
|
|
408
397
|
? // Two-line rows need to grow past the size-variant height.
|
|
@@ -2211,25 +2200,11 @@ function NativeComboboxCore({
|
|
|
2211
2200
|
hoverStyle={
|
|
2212
2201
|
activeIndex != null
|
|
2213
2202
|
? {
|
|
2214
|
-
backgroundColor: active
|
|
2215
|
-
? formInputColors.background.focus
|
|
2216
|
-
: selected
|
|
2217
|
-
? formInputColors.background.base
|
|
2218
|
-
: "transparent",
|
|
2203
|
+
backgroundColor: active ? formInputColors.background.focus : "transparent",
|
|
2219
2204
|
}
|
|
2220
|
-
: {
|
|
2221
|
-
backgroundColor: selected
|
|
2222
|
-
? formInputColors.background.base
|
|
2223
|
-
: formInputColors.background.focus,
|
|
2224
|
-
}
|
|
2225
|
-
}
|
|
2226
|
-
backgroundColor={
|
|
2227
|
-
active
|
|
2228
|
-
? formInputColors.background.focus
|
|
2229
|
-
: selected
|
|
2230
|
-
? formInputColors.background.base
|
|
2231
|
-
: "transparent"
|
|
2205
|
+
: { backgroundColor: formInputColors.background.focus }
|
|
2232
2206
|
}
|
|
2207
|
+
backgroundColor={active ? formInputColors.background.focus : "transparent"}
|
|
2233
2208
|
pressStyle={{ backgroundColor: formInputColors.background.focus }}
|
|
2234
2209
|
>
|
|
2235
2210
|
{option.description ? (
|
|
@@ -2534,7 +2509,9 @@ function NativeComboboxCore({
|
|
|
2534
2509
|
<FloatingPanel
|
|
2535
2510
|
open={open}
|
|
2536
2511
|
onOpenChange={handleOpenChange}
|
|
2537
|
-
sheet
|
|
2512
|
+
// Native leaves the form to the window's size class (FZ-8116): a sheet
|
|
2513
|
+
// when compact, a panel over the field at regular width.
|
|
2514
|
+
sheet={isWeb}
|
|
2538
2515
|
// Search-driven comboboxes open the sheet tall: results stream in as
|
|
2539
2516
|
// the user types, so a content-fit sheet would open as a sliver.
|
|
2540
2517
|
sheetFill={Boolean(onSearch)}
|
|
@@ -948,6 +948,9 @@ export function DatePickerInputTrigger({
|
|
|
948
948
|
// on the closed text-field trigger.
|
|
949
949
|
elevation={undefined}
|
|
950
950
|
data-testid="date-picker-trigger"
|
|
951
|
+
// The touch input is laid absolutely over this box; without a
|
|
952
|
+
// positioning context it covers the whole page and takes every tap.
|
|
953
|
+
position={touchInput ? "relative" : undefined}
|
|
951
954
|
id={touchInput ? undefined : id}
|
|
952
955
|
onPress={isWeb && !disabled && !touchInput ? onButtonPress : undefined}
|
|
953
956
|
{...(disabled ? { opacity: 0.5, pointerEvents: "none" } : undefined)}
|
|
@@ -243,3 +243,16 @@ describe("Time on touch web (FZ-8114)", () => {
|
|
|
243
243
|
expect(result.container.querySelector('input[type="time"]')).toBeNull();
|
|
244
244
|
});
|
|
245
245
|
});
|
|
246
|
+
|
|
247
|
+
describe("the touch input stays inside its box (FZ-8114)", () => {
|
|
248
|
+
it.each([
|
|
249
|
+
["date", <DatePicker key="d" label="Due" name="due" />],
|
|
250
|
+
["datetime-local", <DatetimePicker key="dt" label="Starts" name="starts" />],
|
|
251
|
+
["time", <TimePicker key="t" label="At" name="at" />],
|
|
252
|
+
] as const)("the %s input's box is its positioning context", (type, field) => {
|
|
253
|
+
coarse = true;
|
|
254
|
+
const result = renderWithProviders(field);
|
|
255
|
+
const box = touchInput(result.container, type).parentElement as HTMLElement;
|
|
256
|
+
expect(getComputedStyle(box).position).toBe("relative");
|
|
257
|
+
});
|
|
258
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import userEvent from "@testing-library/user-event";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
4
|
+
import { Theme } from "tamagui";
|
|
5
|
+
import { Input } from "./index";
|
|
6
|
+
|
|
7
|
+
function SignIn({ scheme }: { scheme: "light" | "dark" }) {
|
|
8
|
+
return (
|
|
9
|
+
<Theme name={scheme}>
|
|
10
|
+
<form id="sign-in" action="/login" method="post">
|
|
11
|
+
<Input id="username" name="username" label="Username" labelHidden />
|
|
12
|
+
<Input id="password" name="password" label="Password" labelHidden secureTextEntry />
|
|
13
|
+
<input type="hidden" name="credentialId" value="" />
|
|
14
|
+
</form>
|
|
15
|
+
</Theme>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const field = (container: HTMLElement, id: string) =>
|
|
20
|
+
container.querySelector<HTMLInputElement>(`input#${id}`)!;
|
|
21
|
+
|
|
22
|
+
describe("Input posts under its name in a native form (FZ-8159)", () => {
|
|
23
|
+
it("keeps name through typing and a scheme change, so FormData carries both fields", async () => {
|
|
24
|
+
const user = userEvent.setup();
|
|
25
|
+
const view = renderWithProviders(<SignIn scheme="light" />);
|
|
26
|
+
const username = field(view.container, "username");
|
|
27
|
+
const password = field(view.container, "password");
|
|
28
|
+
|
|
29
|
+
await user.type(username, "ash");
|
|
30
|
+
await user.type(password, "pikachu");
|
|
31
|
+
expect(username.getAttribute("name")).toBe("username");
|
|
32
|
+
expect(password.getAttribute("name")).toBe("password");
|
|
33
|
+
|
|
34
|
+
view.rerender(<SignIn scheme="dark" />);
|
|
35
|
+
await user.type(field(view.container, "username"), "!");
|
|
36
|
+
|
|
37
|
+
const form = view.container.querySelector<HTMLFormElement>("form#sign-in")!;
|
|
38
|
+
const posted = new FormData(form);
|
|
39
|
+
expect(posted.get("username")).toBe("ash!");
|
|
40
|
+
expect(posted.get("password")).toBe("pikachu");
|
|
41
|
+
expect(posted.get("credentialId")).toBe("");
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("a read-only field still posts under its name", () => {
|
|
45
|
+
const view = renderWithProviders(
|
|
46
|
+
<form>
|
|
47
|
+
<Input id="realm" name="realm" label="Realm" readOnly value="pokemon" />
|
|
48
|
+
</form>,
|
|
49
|
+
);
|
|
50
|
+
const posted = new FormData(view.container.querySelector("form")!);
|
|
51
|
+
expect(posted.get("realm")).toBe("pokemon");
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
SizeTokens,
|
|
12
12
|
TamaguiElement,
|
|
13
13
|
} from "tamagui";
|
|
14
|
-
import { Text } from "tamagui";
|
|
14
|
+
import { Text, isWeb } from "tamagui";
|
|
15
15
|
import { Skeleton } from "../../Skeleton";
|
|
16
16
|
import { resolveFieldInputProps } from "../../fieldDefaults";
|
|
17
17
|
import { Field, FieldLayout } from "../../fieldLayout";
|
|
@@ -241,6 +241,9 @@ export function Input({
|
|
|
241
241
|
|
|
242
242
|
const areaName =
|
|
243
243
|
visibleLabel || !resolvedAriaLabel ? undefined : { "aria-label": resolvedAriaLabel };
|
|
244
|
+
// A native <form> posts the field under its name, and React DOM drops a
|
|
245
|
+
// `name` it doesn't own on every update, so the Area carries it as a prop.
|
|
246
|
+
const domName = isWeb && name ? { name } : undefined;
|
|
244
247
|
|
|
245
248
|
const handleCopy = useCallback(
|
|
246
249
|
async (text: string) => {
|
|
@@ -332,6 +335,7 @@ export function Input({
|
|
|
332
335
|
value={inputValue ?? ""}
|
|
333
336
|
readOnly
|
|
334
337
|
id={id}
|
|
338
|
+
{...domName}
|
|
335
339
|
aria-readonly="true"
|
|
336
340
|
aria-required={required || undefined}
|
|
337
341
|
aria-invalid={hasError || undefined}
|
|
@@ -364,6 +368,7 @@ export function Input({
|
|
|
364
368
|
{...(placeholder !== undefined ? { placeholder } : undefined)}
|
|
365
369
|
disabled={disabled}
|
|
366
370
|
id={id}
|
|
371
|
+
{...domName}
|
|
367
372
|
{...(handleChange || value !== undefined
|
|
368
373
|
? { value: inputValue ?? "" }
|
|
369
374
|
: { defaultValue: inputValue })}
|
|
@@ -55,6 +55,7 @@ export function InlineChoices({
|
|
|
55
55
|
const textColor = knobProps.textAccentColor;
|
|
56
56
|
const selectedIndex = options.findIndex((option) => option.value === value);
|
|
57
57
|
const tabStop = selectedIndex >= 0 ? selectedIndex : 0;
|
|
58
|
+
const glyphed = options.some((option) => option.icon != null);
|
|
58
59
|
|
|
59
60
|
const choose = (index: number) => {
|
|
60
61
|
const option = options[index];
|
|
@@ -85,9 +86,11 @@ export function InlineChoices({
|
|
|
85
86
|
borderColor={formCommonColors.divider}
|
|
86
87
|
pointerEvents="none"
|
|
87
88
|
>
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
89
|
+
{glyphed ? (
|
|
90
|
+
<View flexShrink={0} alignItems="center" justifyContent="center" minWidth={18}>
|
|
91
|
+
<IconSlot icon={option.icon} color={textColor} />
|
|
92
|
+
</View>
|
|
93
|
+
) : null}
|
|
91
94
|
<Text
|
|
92
95
|
fontFamily={knobProps.body.fontFamily}
|
|
93
96
|
fontWeight={knobProps.body.fontWeight}
|