@multiplatform.one/forms 7.71.0 → 7.73.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/Button/circleGlyph.cjs +28 -0
- package/dist/cjs/Button/circleGlyph.native.js +31 -0
- package/dist/cjs/Button/circleGlyph.native.js.map +1 -0
- package/dist/cjs/Button/index.cjs +19 -3
- package/dist/cjs/Button/index.native.js +19 -3
- package/dist/cjs/Button/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/PanelHeader.cjs +49 -0
- package/dist/cjs/FloatingPanel/PanelHeader.native.js +53 -0
- package/dist/cjs/FloatingPanel/PanelHeader.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/echoContext.cjs +67 -0
- package/dist/cjs/FloatingPanel/echoContext.native.js +71 -0
- package/dist/cjs/FloatingPanel/echoContext.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/iconEcho.cjs +104 -0
- package/dist/cjs/FloatingPanel/iconEcho.native.js +114 -0
- package/dist/cjs/FloatingPanel/iconEcho.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/index.cjs +371 -86
- package/dist/cjs/FloatingPanel/index.native.js +164 -20
- package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/paintedBox.cjs +80 -0
- package/dist/cjs/FloatingPanel/paintedBox.native.js +85 -0
- package/dist/cjs/FloatingPanel/paintedBox.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/panelWidth.cjs +92 -0
- package/dist/cjs/FloatingPanel/panelWidth.native.js +99 -0
- package/dist/cjs/FloatingPanel/panelWidth.native.js.map +1 -0
- package/dist/cjs/FloatingPanel/pointAnchor.cjs +34 -5
- package/dist/cjs/FloatingPanel/pointAnchor.native.js +37 -8
- package/dist/cjs/FloatingPanel/pointAnchor.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/useFloatingPanel.cjs +60 -5
- package/dist/cjs/FloatingPanel/useFloatingPanel.native.js +72 -5
- package/dist/cjs/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/cjs/InputParts/index.cjs +18 -0
- package/dist/cjs/InputParts/index.native.js +19 -1
- package/dist/cjs/InputParts/index.native.js.map +1 -1
- package/dist/cjs/Wheel/NativeWheel.native.js +1 -1
- package/dist/cjs/Wheel/NativeWheel.native.js.map +1 -1
- package/dist/cjs/Wheel/index.cjs +2 -1
- package/dist/cjs/Wheel/index.native.js +4 -1
- package/dist/cjs/Wheel/index.native.js.map +1 -1
- package/dist/cjs/Wheel/wheelShared.cjs +6 -1
- package/dist/cjs/Wheel/wheelShared.native.js +7 -1
- package/dist/cjs/Wheel/wheelShared.native.js.map +1 -1
- package/dist/cjs/fields/Combobox/index.cjs +1 -0
- package/dist/cjs/fields/Combobox/index.native.js +1 -0
- package/dist/cjs/fields/Combobox/index.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/DatetimePicker.catalog.cjs +6 -30
- package/dist/cjs/fields/DatePicker/DatetimePicker.catalog.native.js +11 -34
- package/dist/cjs/fields/DatePicker/DatetimePicker.catalog.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/DatetimePicker.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/catalog.cjs +2 -28
- package/dist/cjs/fields/DatePicker/catalog.native.js +2 -30
- package/dist/cjs/fields/DatePicker/catalog.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/index.native.js.map +1 -1
- package/dist/cjs/fields/DatePicker/parts.cjs +11 -20
- package/dist/cjs/fields/DatePicker/parts.native.js +13 -22
- package/dist/cjs/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/cjs/fields/Select/index.cjs +65 -44
- package/dist/cjs/fields/Select/index.native.js +69 -47
- package/dist/cjs/fields/Select/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/shouldInlineChoices.cjs +3 -1
- package/dist/cjs/fields/Select/shouldInlineChoices.native.js +3 -1
- package/dist/cjs/fields/Select/shouldInlineChoices.native.js.map +1 -1
- package/dist/cjs/fields/TimePicker/catalog.cjs +4 -25
- package/dist/cjs/fields/TimePicker/catalog.native.js +7 -29
- package/dist/cjs/fields/TimePicker/catalog.native.js.map +1 -1
- package/dist/cjs/fields/TimePicker/index.native.js.map +1 -1
- package/dist/cjs/fields/TimePicker/parts.cjs +8 -21
- package/dist/cjs/fields/TimePicker/parts.native.js +8 -21
- package/dist/cjs/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/floatingList.cjs +13 -4
- package/dist/cjs/shared/floatingList.native.js +15 -4
- package/dist/cjs/shared/floatingList.native.js.map +1 -1
- package/dist/esm/Button/circleGlyph.mjs +3 -0
- package/dist/esm/Button/circleGlyph.mjs.map +1 -0
- package/dist/esm/Button/circleGlyph.native.js +3 -0
- package/dist/esm/Button/circleGlyph.native.js.map +1 -0
- package/dist/esm/Button/index.mjs +18 -2
- package/dist/esm/Button/index.mjs.map +1 -1
- package/dist/esm/Button/index.native.js +18 -2
- package/dist/esm/Button/index.native.js.map +1 -1
- package/dist/esm/FloatingPanel/PanelHeader.mjs +24 -0
- package/dist/esm/FloatingPanel/PanelHeader.mjs.map +1 -0
- package/dist/esm/FloatingPanel/PanelHeader.native.js +25 -0
- package/dist/esm/FloatingPanel/PanelHeader.native.js.map +1 -0
- package/dist/esm/FloatingPanel/echoContext.mjs +35 -0
- package/dist/esm/FloatingPanel/echoContext.mjs.map +1 -0
- package/dist/esm/FloatingPanel/echoContext.native.js +36 -0
- package/dist/esm/FloatingPanel/echoContext.native.js.map +1 -0
- package/dist/esm/FloatingPanel/iconEcho.mjs +77 -0
- package/dist/esm/FloatingPanel/iconEcho.mjs.map +1 -0
- package/dist/esm/FloatingPanel/iconEcho.native.js +84 -0
- package/dist/esm/FloatingPanel/iconEcho.native.js.map +1 -0
- package/dist/esm/FloatingPanel/index.mjs +373 -90
- package/dist/esm/FloatingPanel/index.mjs.map +1 -1
- package/dist/esm/FloatingPanel/index.native.js +165 -23
- package/dist/esm/FloatingPanel/index.native.js.map +1 -1
- package/dist/esm/FloatingPanel/paintedBox.mjs +52 -0
- package/dist/esm/FloatingPanel/paintedBox.mjs.map +1 -0
- package/dist/esm/FloatingPanel/paintedBox.native.js +54 -0
- package/dist/esm/FloatingPanel/paintedBox.native.js.map +1 -0
- package/dist/esm/FloatingPanel/panelWidth.mjs +63 -0
- package/dist/esm/FloatingPanel/panelWidth.mjs.map +1 -0
- package/dist/esm/FloatingPanel/panelWidth.native.js +67 -0
- package/dist/esm/FloatingPanel/panelWidth.native.js.map +1 -0
- package/dist/esm/FloatingPanel/pointAnchor.mjs +34 -5
- package/dist/esm/FloatingPanel/pointAnchor.mjs.map +1 -1
- package/dist/esm/FloatingPanel/pointAnchor.native.js +37 -8
- package/dist/esm/FloatingPanel/pointAnchor.native.js.map +1 -1
- package/dist/esm/FloatingPanel/useFloatingPanel.mjs +60 -6
- package/dist/esm/FloatingPanel/useFloatingPanel.mjs.map +1 -1
- package/dist/esm/FloatingPanel/useFloatingPanel.native.js +72 -6
- package/dist/esm/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/esm/InputParts/index.mjs +19 -1
- package/dist/esm/InputParts/index.mjs.map +1 -1
- package/dist/esm/InputParts/index.native.js +20 -2
- package/dist/esm/InputParts/index.native.js.map +1 -1
- package/dist/esm/Wheel/NativeWheel.native.js +1 -1
- package/dist/esm/Wheel/NativeWheel.native.js.map +1 -1
- package/dist/esm/Wheel/index.mjs +2 -1
- package/dist/esm/Wheel/index.mjs.map +1 -1
- package/dist/esm/Wheel/index.native.js +4 -1
- package/dist/esm/Wheel/index.native.js.map +1 -1
- package/dist/esm/Wheel/wheelShared.mjs +6 -1
- package/dist/esm/Wheel/wheelShared.mjs.map +1 -1
- package/dist/esm/Wheel/wheelShared.native.js +7 -1
- package/dist/esm/Wheel/wheelShared.native.js.map +1 -1
- package/dist/esm/fields/Combobox/index.mjs +1 -0
- package/dist/esm/fields/Combobox/index.mjs.map +1 -1
- package/dist/esm/fields/Combobox/index.native.js +1 -0
- package/dist/esm/fields/Combobox/index.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/DatetimePicker.catalog.mjs +6 -30
- package/dist/esm/fields/DatePicker/DatetimePicker.catalog.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/DatetimePicker.catalog.native.js +11 -34
- package/dist/esm/fields/DatePicker/DatetimePicker.catalog.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/DatetimePicker.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/catalog.mjs +2 -28
- package/dist/esm/fields/DatePicker/catalog.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/catalog.native.js +2 -30
- package/dist/esm/fields/DatePicker/catalog.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/index.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/parts.mjs +11 -20
- package/dist/esm/fields/DatePicker/parts.mjs.map +1 -1
- package/dist/esm/fields/DatePicker/parts.native.js +13 -22
- package/dist/esm/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/esm/fields/Select/index.mjs +66 -45
- package/dist/esm/fields/Select/index.mjs.map +1 -1
- package/dist/esm/fields/Select/index.native.js +70 -48
- package/dist/esm/fields/Select/index.native.js.map +1 -1
- package/dist/esm/fields/Select/shouldInlineChoices.mjs +3 -1
- package/dist/esm/fields/Select/shouldInlineChoices.mjs.map +1 -1
- package/dist/esm/fields/Select/shouldInlineChoices.native.js +3 -1
- package/dist/esm/fields/Select/shouldInlineChoices.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/catalog.mjs +4 -25
- package/dist/esm/fields/TimePicker/catalog.mjs.map +1 -1
- package/dist/esm/fields/TimePicker/catalog.native.js +7 -29
- package/dist/esm/fields/TimePicker/catalog.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/index.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/parts.mjs +8 -21
- package/dist/esm/fields/TimePicker/parts.mjs.map +1 -1
- package/dist/esm/fields/TimePicker/parts.native.js +8 -21
- package/dist/esm/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/shared/floatingList.mjs +14 -5
- package/dist/esm/shared/floatingList.mjs.map +1 -1
- package/dist/esm/shared/floatingList.native.js +16 -5
- package/dist/esm/shared/floatingList.native.js.map +1 -1
- package/dist/jsx/Button/circleGlyph.mjs +3 -0
- package/dist/jsx/Button/circleGlyph.mjs.map +1 -0
- package/dist/jsx/Button/circleGlyph.native.js +31 -0
- package/dist/jsx/Button/circleGlyph.native.js.map +1 -0
- package/dist/jsx/Button/index.mjs +18 -2
- package/dist/jsx/Button/index.mjs.map +1 -1
- package/dist/jsx/Button/index.native.js +19 -3
- package/dist/jsx/Button/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/PanelHeader.mjs +24 -0
- package/dist/jsx/FloatingPanel/PanelHeader.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/PanelHeader.native.js +53 -0
- package/dist/jsx/FloatingPanel/PanelHeader.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/echoContext.mjs +35 -0
- package/dist/jsx/FloatingPanel/echoContext.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/echoContext.native.js +71 -0
- package/dist/jsx/FloatingPanel/echoContext.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/iconEcho.mjs +77 -0
- package/dist/jsx/FloatingPanel/iconEcho.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/iconEcho.native.js +114 -0
- package/dist/jsx/FloatingPanel/iconEcho.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/index.mjs +373 -90
- package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/index.native.js +164 -20
- package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/paintedBox.mjs +52 -0
- package/dist/jsx/FloatingPanel/paintedBox.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/paintedBox.native.js +85 -0
- package/dist/jsx/FloatingPanel/paintedBox.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/panelWidth.mjs +63 -0
- package/dist/jsx/FloatingPanel/panelWidth.mjs.map +1 -0
- package/dist/jsx/FloatingPanel/panelWidth.native.js +99 -0
- package/dist/jsx/FloatingPanel/panelWidth.native.js.map +1 -0
- package/dist/jsx/FloatingPanel/pointAnchor.mjs +34 -5
- package/dist/jsx/FloatingPanel/pointAnchor.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/pointAnchor.native.js +37 -8
- package/dist/jsx/FloatingPanel/pointAnchor.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/useFloatingPanel.mjs +60 -6
- package/dist/jsx/FloatingPanel/useFloatingPanel.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/useFloatingPanel.native.js +72 -5
- package/dist/jsx/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/jsx/InputParts/index.mjs +19 -1
- package/dist/jsx/InputParts/index.mjs.map +1 -1
- package/dist/jsx/InputParts/index.native.js +19 -1
- package/dist/jsx/InputParts/index.native.js.map +1 -1
- package/dist/jsx/Wheel/NativeWheel.native.js +1 -1
- package/dist/jsx/Wheel/NativeWheel.native.js.map +1 -1
- package/dist/jsx/Wheel/index.mjs +2 -1
- package/dist/jsx/Wheel/index.mjs.map +1 -1
- package/dist/jsx/Wheel/index.native.js +4 -1
- package/dist/jsx/Wheel/index.native.js.map +1 -1
- package/dist/jsx/Wheel/wheelShared.mjs +6 -1
- package/dist/jsx/Wheel/wheelShared.mjs.map +1 -1
- package/dist/jsx/Wheel/wheelShared.native.js +7 -1
- package/dist/jsx/Wheel/wheelShared.native.js.map +1 -1
- package/dist/jsx/fields/Combobox/index.mjs +1 -0
- package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
- package/dist/jsx/fields/Combobox/index.native.js +1 -0
- package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.mjs +6 -30
- package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.native.js +11 -34
- package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/DatetimePicker.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/catalog.mjs +2 -28
- package/dist/jsx/fields/DatePicker/catalog.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/catalog.native.js +2 -30
- package/dist/jsx/fields/DatePicker/catalog.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/index.native.js.map +1 -1
- package/dist/jsx/fields/DatePicker/parts.mjs +11 -20
- package/dist/jsx/fields/DatePicker/parts.mjs.map +1 -1
- package/dist/jsx/fields/DatePicker/parts.native.js +13 -22
- package/dist/jsx/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/jsx/fields/Select/index.mjs +66 -45
- package/dist/jsx/fields/Select/index.mjs.map +1 -1
- package/dist/jsx/fields/Select/index.native.js +69 -47
- package/dist/jsx/fields/Select/index.native.js.map +1 -1
- package/dist/jsx/fields/Select/shouldInlineChoices.mjs +3 -1
- package/dist/jsx/fields/Select/shouldInlineChoices.mjs.map +1 -1
- package/dist/jsx/fields/Select/shouldInlineChoices.native.js +3 -1
- package/dist/jsx/fields/Select/shouldInlineChoices.native.js.map +1 -1
- package/dist/jsx/fields/TimePicker/catalog.mjs +4 -25
- package/dist/jsx/fields/TimePicker/catalog.mjs.map +1 -1
- package/dist/jsx/fields/TimePicker/catalog.native.js +7 -29
- package/dist/jsx/fields/TimePicker/catalog.native.js.map +1 -1
- package/dist/jsx/fields/TimePicker/index.native.js.map +1 -1
- package/dist/jsx/fields/TimePicker/parts.mjs +8 -21
- package/dist/jsx/fields/TimePicker/parts.mjs.map +1 -1
- package/dist/jsx/fields/TimePicker/parts.native.js +8 -21
- package/dist/jsx/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/jsx/index.js +2 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +2 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/floatingList.mjs +14 -5
- package/dist/jsx/shared/floatingList.mjs.map +1 -1
- package/dist/jsx/shared/floatingList.native.js +15 -4
- package/dist/jsx/shared/floatingList.native.js.map +1 -1
- package/package.json +8 -8
- package/src/Button/circleGlyph.ts +6 -0
- package/src/Button/index.tsx +25 -7
- package/src/FloatingPanel/FloatingPanel.echoStretch.spec.tsx +67 -0
- package/src/FloatingPanel/FloatingPanel.iconEcho.spec.tsx +297 -0
- package/src/FloatingPanel/FloatingPanel.menuFace.native.spec.tsx +280 -3
- package/src/FloatingPanel/FloatingPanel.seamlessCover.spec.tsx +237 -0
- package/src/FloatingPanel/PanelHeader.tsx +26 -0
- package/src/FloatingPanel/echoContext.ts +67 -0
- package/src/FloatingPanel/iconEcho.tsx +118 -0
- package/src/FloatingPanel/index.native.tsx +220 -12
- package/src/FloatingPanel/index.tsx +539 -109
- package/src/FloatingPanel/paintedBox.spec.ts +95 -0
- package/src/FloatingPanel/paintedBox.ts +75 -0
- package/src/FloatingPanel/panelWidth.spec.ts +158 -0
- package/src/FloatingPanel/panelWidth.ts +122 -0
- package/src/FloatingPanel/panelWidthContract.spec.ts +10 -10
- package/src/FloatingPanel/pointAnchor.spec.ts +111 -2
- package/src/FloatingPanel/pointAnchor.ts +56 -3
- package/src/FloatingPanel/useFloatingPanel.spec.tsx +124 -4
- package/src/FloatingPanel/useFloatingPanel.ts +112 -34
- package/src/InputParts/index.tsx +26 -0
- package/src/Wheel/NativeWheel.native.tsx +1 -1
- package/src/Wheel/Wheel.spec.tsx +9 -0
- package/src/Wheel/index.tsx +12 -3
- package/src/Wheel/wheelShared.ts +6 -2
- package/src/fields/Combobox/index.tsx +1 -0
- package/src/fields/DatePicker/DatePicker.stories.tsx +3 -3
- package/src/fields/DatePicker/DatetimePicker.catalog.tsx +17 -45
- package/src/fields/DatePicker/DatetimePicker.native.tsx +3 -0
- package/src/fields/DatePicker/catalog.tsx +8 -39
- package/src/fields/DatePicker/index.native.tsx +3 -0
- package/src/fields/DatePicker/parts.tsx +13 -23
- package/src/fields/DatePicker/seamlessCover.spec.tsx +180 -0
- package/src/fields/DatePicker/touchWeb.spec.tsx +109 -167
- package/src/fields/Select/Select.containingBlock.spec.tsx +191 -0
- package/src/fields/Select/Select.stories.tsx +43 -0
- package/src/fields/Select/index.tsx +109 -45
- package/src/fields/Select/shouldInlineChoices.spec.ts +13 -0
- package/src/fields/Select/shouldInlineChoices.ts +6 -0
- package/src/fields/TimePicker/catalog.tsx +12 -33
- package/src/fields/TimePicker/index.native.tsx +2 -0
- package/src/fields/TimePicker/parts.tsx +6 -20
- package/src/index.ts +3 -0
- package/src/shared/floatingList.tsx +21 -5
- package/types/Button/circleGlyph.d.ts +7 -0
- package/types/Button/circleGlyph.d.ts.map +1 -0
- package/types/Button/index.d.ts +2 -6
- package/types/Button/index.d.ts.map +1 -1
- package/types/FloatingPanel/PanelHeader.d.ts +9 -0
- package/types/FloatingPanel/PanelHeader.d.ts.map +1 -0
- package/types/FloatingPanel/echoContext.d.ts +38 -0
- package/types/FloatingPanel/echoContext.d.ts.map +1 -0
- package/types/FloatingPanel/iconEcho.d.ts +29 -0
- package/types/FloatingPanel/iconEcho.d.ts.map +1 -0
- package/types/FloatingPanel/index.d.ts +69 -0
- package/types/FloatingPanel/index.d.ts.map +1 -1
- package/types/FloatingPanel/index.native.d.ts +9 -1
- package/types/FloatingPanel/index.native.d.ts.map +1 -1
- package/types/FloatingPanel/paintedBox.d.ts +29 -0
- package/types/FloatingPanel/paintedBox.d.ts.map +1 -0
- package/types/FloatingPanel/panelWidth.d.ts +71 -0
- package/types/FloatingPanel/panelWidth.d.ts.map +1 -0
- package/types/FloatingPanel/pointAnchor.d.ts +17 -1
- package/types/FloatingPanel/pointAnchor.d.ts.map +1 -1
- package/types/FloatingPanel/useFloatingPanel.d.ts +33 -2
- package/types/FloatingPanel/useFloatingPanel.d.ts.map +1 -1
- package/types/InputParts/index.d.ts.map +1 -1
- package/types/Wheel/index.d.ts.map +1 -1
- package/types/Wheel/wheelShared.d.ts +2 -1
- package/types/Wheel/wheelShared.d.ts.map +1 -1
- package/types/fields/Combobox/index.d.ts.map +1 -1
- package/types/fields/DatePicker/DatetimePicker.catalog.d.ts +6 -0
- package/types/fields/DatePicker/DatetimePicker.catalog.d.ts.map +1 -1
- package/types/fields/DatePicker/DatetimePicker.native.d.ts +3 -0
- package/types/fields/DatePicker/DatetimePicker.native.d.ts.map +1 -1
- package/types/fields/DatePicker/catalog.d.ts +6 -0
- package/types/fields/DatePicker/catalog.d.ts.map +1 -1
- package/types/fields/DatePicker/index.native.d.ts +3 -0
- package/types/fields/DatePicker/index.native.d.ts.map +1 -1
- package/types/fields/DatePicker/parts.d.ts +5 -7
- package/types/fields/DatePicker/parts.d.ts.map +1 -1
- package/types/fields/Select/index.d.ts +8 -1
- package/types/fields/Select/index.d.ts.map +1 -1
- package/types/fields/Select/shouldInlineChoices.d.ts +5 -1
- package/types/fields/Select/shouldInlineChoices.d.ts.map +1 -1
- package/types/fields/TimePicker/catalog.d.ts +7 -1
- package/types/fields/TimePicker/catalog.d.ts.map +1 -1
- package/types/fields/TimePicker/index.native.d.ts +2 -0
- package/types/fields/TimePicker/index.native.d.ts.map +1 -1
- package/types/fields/TimePicker/parts.d.ts +1 -3
- package/types/fields/TimePicker/parts.d.ts.map +1 -1
- package/types/index.d.ts +3 -0
- package/types/index.d.ts.map +1 -1
- package/types/shared/floatingList.d.ts +5 -1
- package/types/shared/floatingList.d.ts.map +1 -1
- package/dist/cjs/shared/touchWebPicker.cjs +0 -136
- package/dist/cjs/shared/touchWebPicker.native.js +0 -154
- package/dist/cjs/shared/touchWebPicker.native.js.map +0 -1
- package/dist/esm/shared/touchWebPicker.mjs +0 -105
- package/dist/esm/shared/touchWebPicker.mjs.map +0 -1
- package/dist/esm/shared/touchWebPicker.native.js +0 -120
- package/dist/esm/shared/touchWebPicker.native.js.map +0 -1
- package/dist/jsx/shared/touchWebPicker.mjs +0 -105
- package/dist/jsx/shared/touchWebPicker.mjs.map +0 -1
- package/dist/jsx/shared/touchWebPicker.native.js +0 -154
- package/dist/jsx/shared/touchWebPicker.native.js.map +0 -1
- package/src/shared/touchWebPicker.spec.ts +0 -98
- package/src/shared/touchWebPicker.tsx +0 -158
- package/types/shared/touchWebPicker.d.ts +0 -40
- package/types/shared/touchWebPicker.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["transitionProps","useCallback","useEffect","useRef","CaretDownIcon","CaretUpIcon","useResolvedKnobs","View","FocusContext","jsx","dropdownMaxRadiusTokenNum","clampDropdownRadius","fieldRadius","startsWith","num","Number","parseInt","slice","SyncFocusToOpen","open","setFocused","useStyledContext","scrollArrowThreshold","ScrollArrow","direction","scrollRef","visible","arrowScrollDirRef","isUp","animationFrameRef","lastTimeRef","resumeTimerRef","hoveringRef","activeRef","selfScrollingRef","resumeDelay","stopLoop","current","cancelAnimationFrame","startLoop","performance","now","tick","el","elapsed","px","Math","min","max","scrollTop","scrollHeight","clientHeight","requestAnimationFrame","openTimestampRef","handlePointerEnter","wasOverOnOpen","clearTimeout","setTimeout","handlePointerLeave","onScroll","addEventListener","passive","removeEventListener","Icon","knobProps","iconSize","controlIcon","width","position","top","bottom","height","zIndex","children","String","left","right","alignItems","justifyContent","pointerEvents","opacity","motion","control","style","background","onPointerEnter","onPointerLeave","lineHeight","size"],"sources":["../../../src/shared/floatingList.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,SAAyBC,WAAA,EAAaC,SAAA,EAAWC,MAAA,
|
|
1
|
+
{"version":3,"names":["transitionProps","useCallback","useEffect","useRef","useState","CaretDownIcon","CaretUpIcon","useResolvedKnobs","View","FocusContext","jsx","dropdownMaxRadiusTokenNum","clampDropdownRadius","fieldRadius","startsWith","num","Number","parseInt","slice","SyncFocusToOpen","open","setFocused","useStyledContext","scrollArrowThreshold","ScrollArrow","direction","scrollRef","visible","arrowScrollDirRef","topOffset","bottomOffset","isUp","animationFrameRef","lastTimeRef","resumeTimerRef","hoveringRef","activeRef","selfScrollingRef","resumeDelay","stopLoop","current","cancelAnimationFrame","startLoop","performance","now","tick","el","elapsed","px","Math","min","max","scrollTop","scrollHeight","clientHeight","requestAnimationFrame","openTimestampRef","handlePointerEnter","wasOverOnOpen","clearTimeout","setTimeout","handlePointerLeave","onScroll","addEventListener","passive","removeEventListener","panelFill","setPanelFill","getComputedStyle","fill","backgroundColor","Icon","knobProps","iconSize","controlIcon","width","position","top","bottom","height","zIndex","children","String","left","right","alignItems","justifyContent","pointerEvents","opacity","motion","control","style","background","onPointerEnter","onPointerLeave","lineHeight","size"],"sources":["../../../src/shared/floatingList.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,SAAyBC,WAAA,EAAaC,SAAA,EAAWC,MAAA,EAAQC,QAAA,QAAgB;AACzE,SAASC,aAAA,EAAeC,WAAA,QAAmB;AAC3C,SAASC,gBAAA,QAAwB;AACjC,SAASC,IAAA,QAAY;AACrB,SAASC,YAAA,QAAoB;AA2LnB,SAAAC,GAAA;AAzLV,MAAMC,yBAAA,GAA4B;AAE3B,SAASC,oBAAoBC,WAAA,EAAiC;EACnE,IAAIA,WAAA,KAAgB,MAAM,OAAO;EACjC,IAAI,OAAOA,WAAA,KAAgB,YAAYA,WAAA,CAAYC,UAAA,CAAW,GAAG,GAAG;IAClE,MAAMC,GAAA,GAAMC,MAAA,CAAOC,QAAA,CAASJ,WAAA,CAAYK,KAAA,CAAM,CAAC,GAAG,EAAE;IACpD,OAAOH,GAAA,GAAMJ,y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AK9C,IAAA,GAAO,IAAI;MAChB+C,MAAA,EAAQ/C,IAAA,GAAO,SAAY;MAC1B,GAAGyC,SAAA,CAAUE,WAAA;MACdC,KAAA,EAAM;MACNU,UAAA,EAAW;MACXC,cAAA,EAAe;MACfC,aAAA,EAAe5D,OAAA,GAAU,SAAS;MAClC6D,OAAA,EAAS7D,OAAA,GAAU,IAAI;MACtB,GAAG3B,eAAA,CAAgBwE,SAAA,CAAUiB,MAAA,CAAOC,OAAO;MAG5CC,KAAA,EAAO;QACLC,UAAA,EAAY7D,IAAA,GACR,8BAA8BmC,SAAS,uBACvC,2BAA2BA,SAAS;MAC1C;MACA2B,cAAA,EAAgBlE,OAAA,GAAU8B,kBAAA,GAAqB;MAC/CqC,cAAA,EAAgBjC,kBAAA;MAEhBoB,QAAA,iBAAAvE,GAAA,CAACF,IAAA;QAAKoE,QAAA,EAAS;QAAWI,MAAA,EAAQ;QAAI,GAAGR,SAAA,CAAUE,WAAA;QAAaiB,KAAA,EAAO;UAAEI,UAAA,EAAY;QAAE;QACrFd,QAAA,iBAAAvE,GAAA,CAAC6D,IAAA;UAAKyB,IAAA,EAAMvB;QAAA,CAAU;MAAA,CACxB;IAAA,CACF;EAAA,CACF;AAEJ","ignoreList":[]}
|
|
@@ -64,7 +64,9 @@ function ScrollArrow(param) {
|
|
|
64
64
|
direction,
|
|
65
65
|
scrollRef,
|
|
66
66
|
visible,
|
|
67
|
-
arrowScrollDirRef
|
|
67
|
+
arrowScrollDirRef,
|
|
68
|
+
topOffset = 0,
|
|
69
|
+
bottomOffset = 0
|
|
68
70
|
} = param;
|
|
69
71
|
var isUp = direction === "up";
|
|
70
72
|
var animationFrameRef = (0, import_react.useRef)(0);
|
|
@@ -156,6 +158,13 @@ function ScrollArrow(param) {
|
|
|
156
158
|
handlePointerLeave();
|
|
157
159
|
};
|
|
158
160
|
}, [handlePointerLeave]);
|
|
161
|
+
var [panelFill, setPanelFill] = (0, import_react.useState)("var(--background)");
|
|
162
|
+
(0, import_react.useEffect)(function () {
|
|
163
|
+
if (!visible || typeof getComputedStyle !== "function") return;
|
|
164
|
+
var el = scrollRef.current;
|
|
165
|
+
var fill = el ? getComputedStyle(el).backgroundColor : "";
|
|
166
|
+
if (fill && fill !== "transparent" && fill !== "rgba(0, 0, 0, 0)") setPanelFill(fill);
|
|
167
|
+
}, [visible, scrollRef]);
|
|
159
168
|
var Icon = isUp ? import_react2.CaretUpIcon : import_react2.CaretDownIcon;
|
|
160
169
|
var {
|
|
161
170
|
knobProps
|
|
@@ -163,8 +172,8 @@ function ScrollArrow(param) {
|
|
|
163
172
|
var iconSize = knobProps.controlIcon.width;
|
|
164
173
|
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
165
174
|
position: "sticky",
|
|
166
|
-
top: isUp ?
|
|
167
|
-
bottom: isUp ? void 0 :
|
|
175
|
+
top: isUp ? topOffset : void 0,
|
|
176
|
+
bottom: isUp ? void 0 : bottomOffset,
|
|
168
177
|
height: 0,
|
|
169
178
|
zIndex: 2,
|
|
170
179
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
@@ -183,8 +192,10 @@ function ScrollArrow(param) {
|
|
|
183
192
|
pointerEvents: visible ? "auto" : "none",
|
|
184
193
|
opacity: visible ? 1 : 0,
|
|
185
194
|
...(0, import_theme.transitionProps)(knobProps.motion.control),
|
|
195
|
+
// The fade is the panel's own fill: an elevated dark panel is a step
|
|
196
|
+
// above the theme ground, and a ground-coloured fade read as a band.
|
|
186
197
|
style: {
|
|
187
|
-
background: isUp ?
|
|
198
|
+
background: isUp ? `linear-gradient(to bottom, ${panelFill} 40%, transparent)` : `linear-gradient(to top, ${panelFill} 40%, transparent)`
|
|
188
199
|
},
|
|
189
200
|
onPointerEnter: visible ? handlePointerEnter : void 0,
|
|
190
201
|
onPointerLeave: handlePointerLeave,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","floatingList_exports","ScrollArrow","SyncFocusToOpen","clampDropdownRadius","scrollArrowThreshold","module","exports","import_jsx_runtime","require","import_theme","import_react","import_react2","import_theme2","import_tamagui","import_InputParts","dropdownMaxRadiusTokenNum","fieldRadius","startsWith","num","Number","parseInt","slice","param","open","setFocused","FocusContext","useStyledContext","useEffect","direction","scrollRef","visible","arrowScrollDirRef","isUp","animationFrameRef","useRef","lastTimeRef","resumeTimerRef","hoveringRef","activeRef","selfScrollingRef","resumeDelay","stopLoop","useCallback","current","cancelAnimationFrame","startLoop","performance","now","tick","tick1","el","elapsed","px","Math","min","max","scrollTop","scrollHeight","clientHeight","requestAnimationFrame","openTimestampRef","handlePointerEnter","wasOverOnOpen","clearTimeout","setTimeout","handlePointerLeave","onScroll","onScroll2","addEventListener","passive","removeEventListener"],"sources":["../../../src/shared/floatingList.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAS;;AACT,IAAAA,SAAyB,GAAAC,MAAa,CAAAC,cAAW;AACjD,IAAAC,gBAAS,GAAAF,MAAe,CAAAG,wBAAmB;AAC3C,IAAAC,iBAAS,GAAAJ,MAAA,CAAAK,mBAAwB;AACjC,IAAAC,YAAS,GAAAN,MAAY,CAAAO,SAAA,CAAAC,cAAA;AACrB,IAAAC,QAAS,GAAAA,CAAAC,MAAA,EAAAC,GAAA,KAAoB;
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","floatingList_exports","ScrollArrow","SyncFocusToOpen","clampDropdownRadius","scrollArrowThreshold","module","exports","import_jsx_runtime","require","import_theme","import_react","import_react2","import_theme2","import_tamagui","import_InputParts","dropdownMaxRadiusTokenNum","fieldRadius","startsWith","num","Number","parseInt","slice","param","open","setFocused","FocusContext","useStyledContext","useEffect","direction","scrollRef","visible","arrowScrollDirRef","topOffset","bottomOffset","isUp","animationFrameRef","useRef","lastTimeRef","resumeTimerRef","hoveringRef","activeRef","selfScrollingRef","resumeDelay","stopLoop","useCallback","current","cancelAnimationFrame","startLoop","performance","now","tick","tick1","el","elapsed","px","Math","min","max","scrollTop","scrollHeight","clientHeight","requestAnimationFrame","openTimestampRef","handlePointerEnter","wasOverOnOpen","clearTimeout","setTimeout","handlePointerLeave","onScroll","onScroll2","addEventListener","passive","removeEventListener","panelFill","setPanelFill","useState","getComputedStyle","fill","backgroundColor"],"sources":["../../../src/shared/floatingList.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAS;;AACT,IAAAA,SAAyB,GAAAC,MAAa,CAAAC,cAAW;AACjD,IAAAC,gBAAS,GAAAF,MAAe,CAAAG,wBAAmB;AAC3C,IAAAC,iBAAS,GAAAJ,MAAA,CAAAK,mBAAwB;AACjC,IAAAC,YAAS,GAAAN,MAAY,CAAAO,SAAA,CAAAC,cAAA;AACrB,IAAAC,QAAS,GAAAA,CAAAC,MAAA,EAAAC,GAAA,KAAoB;EA2LnB,SAAAC,IAAA,IAAAD,GAAA,EAzLVZ,SAAM,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAA4BF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAE3B;AACL,IAAAC,WAAI,GAAAA,CAAAC,EAAA,EAAgBC,IAAM,EAAAC,MAAO,EAAAC,IAAA;EACjC,IAAIF,IAAA,IAAO,OAAAA,IAAA,KAAgB,YAAY,OAAAA,IAAY,eAAc,EAAG;IAClE,SAAMG,GAAM,IAAAhB,iBAAgB,CAAAa,IAAA,GAC5B,KAAOX,YAAM,CAAAe,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAgCF,MAAA,EAC/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AjE,YAEhB,CAAAiB,SAAA,cAAC;IAED,KAAAG,OAAA,WAAA8C,gBAAA;IAAA,IACFxB,EAAA,GAAAvB,SAAA,CAAAgB,OAAA;IAAA,IAAAgC,IAAA,GAAAzB,EAAA,GAAAwB,gBAAA,CAAAxB,EAAA,EAAA0B,eAAA;IACF,IAAAD,IAAA,IAAAA,IAAA,sBAAAA,IAAA,yBAAAH,YAAA,CAAAG,IAAA;EAEJ,I","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/forms",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.73.0",
|
|
4
4
|
"description": "Cross-platform form components with URL state management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-platform",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@floating-ui/react": "^0.27.20",
|
|
60
|
-
"@multiplatform.one/platform": "^7.
|
|
61
|
-
"@multiplatform.one/router": "^7.
|
|
62
|
-
"@multiplatform.one/table-primitives": "^7.
|
|
63
|
-
"@multiplatform.one/theme": "^7.
|
|
60
|
+
"@multiplatform.one/platform": "^7.73.0",
|
|
61
|
+
"@multiplatform.one/router": "^7.73.0",
|
|
62
|
+
"@multiplatform.one/table-primitives": "^7.73.0",
|
|
63
|
+
"@multiplatform.one/theme": "^7.73.0",
|
|
64
64
|
"@phosphor-icons/react": "^2.1.10",
|
|
65
65
|
"@tamagui/get-font-sized": "2.7.6",
|
|
66
66
|
"@tamagui/get-token": "2.7.6",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@expo/ui": "~55.0.17",
|
|
83
|
-
"@multiplatform.one/config": "7.
|
|
84
|
-
"@multiplatform.one/storybook": "7.
|
|
85
|
-
"@multiplatform.one/test-utils": "7.
|
|
83
|
+
"@multiplatform.one/config": "7.73.0",
|
|
84
|
+
"@multiplatform.one/storybook": "7.73.0",
|
|
85
|
+
"@multiplatform.one/test-utils": "7.73.0",
|
|
86
86
|
"@tamagui/build": "2.7.6",
|
|
87
87
|
"@tamagui/config": "2.7.6",
|
|
88
88
|
"@tamagui/vite-plugin": "2.7.6",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-176: a glyph on a circle the caller asked for (`circular`, `outlined`)
|
|
3
|
+
* fills this share of the circle, the iOS Settings and Contacts leading-icon
|
|
4
|
+
* ratio, never a small glyph lost in a big plate.
|
|
5
|
+
*/
|
|
6
|
+
export const ICON_BUTTON_CIRCLE_GLYPH_RATIO = 0.58;
|
package/src/Button/index.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
createElement,
|
|
8
8
|
isValidElement,
|
|
9
9
|
useCallback,
|
|
10
|
+
useEffect,
|
|
10
11
|
useId,
|
|
11
12
|
useState,
|
|
12
13
|
type ComponentType,
|
|
@@ -72,10 +73,14 @@ import { formatActionLabel } from "../actionLabel";
|
|
|
72
73
|
import { formButtonColors, formCommonColors } from "../shared/colorRamps";
|
|
73
74
|
import { warnBareDisabled, warnPositiveTabIndex, warnSizeRecipeEscape } from "../shared/devWarn";
|
|
74
75
|
import { useControlGrouped } from "../shared/groupContext";
|
|
76
|
+
import { useInPanelEcho, usePanelTriggerRadiusReporter } from "../FloatingPanel/echoContext";
|
|
75
77
|
import { loadGlassView } from "./glass";
|
|
76
78
|
import { MEDIA_PLATE_WEB_STYLE } from "./mediaPlate";
|
|
79
|
+
import { ICON_BUTTON_CIRCLE_GLYPH_RATIO } from "./circleGlyph";
|
|
77
80
|
import { useIconButtonGroupGround, useIconButtonGroupMember } from "./iconButtonGroupContext";
|
|
78
81
|
|
|
82
|
+
export { ICON_BUTTON_CIRCLE_GLYPH_RATIO };
|
|
83
|
+
|
|
79
84
|
/**
|
|
80
85
|
* Coordinated size recipe (Polaris slim/medium/large, Primer s/m/l, Linear
|
|
81
86
|
* 28/32/40, Spectrum S/M, M3 XS/S). Height, pad, type, icon, gap and radius
|
|
@@ -435,13 +440,6 @@ export function iconButtonGlyphPx(rowLinePx: number | undefined): number {
|
|
|
435
440
|
return Math.max(ICON_BUTTON_GLYPH_PX, Math.round(rowLinePx / PHOSPHOR_INK_RATIO));
|
|
436
441
|
}
|
|
437
442
|
|
|
438
|
-
/**
|
|
439
|
-
* LC-176: a glyph on a circle the caller asked for (`circular`, `outlined`)
|
|
440
|
-
* fills this share of the circle, the iOS Settings and Contacts leading-icon
|
|
441
|
-
* ratio, never a small glyph lost in a big plate.
|
|
442
|
-
*/
|
|
443
|
-
export const ICON_BUTTON_CIRCLE_GLYPH_RATIO = 0.58;
|
|
444
|
-
|
|
445
443
|
/** LC-176: an inline glyph is the text's size; Phosphor's 256 grid pads ~12%. */
|
|
446
444
|
const INLINE_GLYPH_RATIO = 1.2;
|
|
447
445
|
|
|
@@ -635,6 +633,17 @@ export function Button({
|
|
|
635
633
|
: undefined;
|
|
636
634
|
const paintedRadius = resolveControlRadius(recipe, radiusStop ?? "medium");
|
|
637
635
|
const innerGap = paintedRadius.gap;
|
|
636
|
+
// LC-112 seamless cover (FZ-8438): a native menu covering this button
|
|
637
|
+
// repeats its arc, and the button's echo inside that menu draws no chrome.
|
|
638
|
+
const inPanelEcho = useInPanelEcho();
|
|
639
|
+
const reportRadius = usePanelTriggerRadiusReporter();
|
|
640
|
+
// A circle reports no cap: the menu takes half its short side.
|
|
641
|
+
const reportedRadius = circular ? Number.POSITIVE_INFINITY : paintedRadius.radius;
|
|
642
|
+
useEffect(() => {
|
|
643
|
+
if (reportRadius && !inPanelEcho && !Number.isNaN(reportedRadius)) {
|
|
644
|
+
reportRadius(reportedRadius);
|
|
645
|
+
}
|
|
646
|
+
}, [reportRadius, inPanelEcho, reportedRadius]);
|
|
638
647
|
// The one Skeleton (forms), at the button's own recipe height.
|
|
639
648
|
const boneHeight = nested ? knobProps.nestedControl.px : recipe.height;
|
|
640
649
|
if (skeleton) {
|
|
@@ -1220,6 +1229,15 @@ export function Button({
|
|
|
1220
1229
|
height: "100%",
|
|
1221
1230
|
}
|
|
1222
1231
|
: undefined)}
|
|
1232
|
+
{...(inPanelEcho
|
|
1233
|
+
? {
|
|
1234
|
+
borderColor: "transparent",
|
|
1235
|
+
backgroundColor: "transparent",
|
|
1236
|
+
elevation: undefined,
|
|
1237
|
+
shadowColor: "transparent",
|
|
1238
|
+
shadowOpacity: 0,
|
|
1239
|
+
}
|
|
1240
|
+
: undefined)}
|
|
1223
1241
|
{...(resolvedRole ? { "data-mp-action-role": resolvedRole } : undefined)}
|
|
1224
1242
|
{...(tier ? { "data-mp-tier": tier } : undefined)}
|
|
1225
1243
|
{...(iconButton
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-112 r3 (FZ-8438): when a consumer sets `panelWidth` and the panel opens
|
|
3
|
+
* wider than its field, the field's echo grows to the panel's end edge, so
|
|
4
|
+
* the value isn't cut short above rows that show it whole. A button echo, or
|
|
5
|
+
* an unset width, keeps the trigger's box.
|
|
6
|
+
*/
|
|
7
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
8
|
+
import { placeEchoOverTrigger } from "./index";
|
|
9
|
+
|
|
10
|
+
function panel(field: boolean) {
|
|
11
|
+
const el = document.createElement("div");
|
|
12
|
+
const row = document.createElement("div");
|
|
13
|
+
row.setAttribute("data-fp-trigger-row", "");
|
|
14
|
+
row.style.width = "260px";
|
|
15
|
+
const visual = document.createElement("div");
|
|
16
|
+
const snapshot = document.createElement("div");
|
|
17
|
+
snapshot.style.width = "260px";
|
|
18
|
+
snapshot.appendChild(document.createElement(field ? "input" : "span"));
|
|
19
|
+
visual.appendChild(snapshot);
|
|
20
|
+
row.appendChild(visual);
|
|
21
|
+
el.appendChild(row);
|
|
22
|
+
document.body.appendChild(el);
|
|
23
|
+
return { el, row, snapshot };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const geometry = { triggerLeft: 16, triggerRight: 276, panelLeft: 16, panelWidth: 360 };
|
|
27
|
+
|
|
28
|
+
afterEach(() => {
|
|
29
|
+
document.body.replaceChildren();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe("placeEchoOverTrigger stretch (LC-112 r3)", () => {
|
|
33
|
+
it("a field's echo grows from the field's start edge to the panel's end", () => {
|
|
34
|
+
const { el, row, snapshot } = panel(true);
|
|
35
|
+
placeEchoOverTrigger(el, geometry, { stretch: true });
|
|
36
|
+
expect(row.style.width).toBe("360px");
|
|
37
|
+
expect(snapshot.style.width).toBe("100%");
|
|
38
|
+
expect(row.style.translate).toBe("");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("a panel slid to the start margin grows the echo only past the field's start", () => {
|
|
42
|
+
const { el, row } = panel(true);
|
|
43
|
+
placeEchoOverTrigger(el, { ...geometry, panelLeft: 10, panelWidth: 1420 }, { stretch: true });
|
|
44
|
+
expect(row.style.translate).toBe("6px 0");
|
|
45
|
+
expect(row.style.width).toBe("1414px");
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("an unset panelWidth keeps the trigger's box", () => {
|
|
49
|
+
const { el, row } = panel(true);
|
|
50
|
+
placeEchoOverTrigger(el, geometry);
|
|
51
|
+
expect(row.style.width).toBe("260px");
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("a button echo keeps its box, so a centred label never moves", () => {
|
|
55
|
+
const { el, row } = panel(false);
|
|
56
|
+
placeEchoOverTrigger(el, geometry, { stretch: true });
|
|
57
|
+
expect(row.style.width).toBe("260px");
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("a panel back at the trigger's width shrinks a stretched echo again", () => {
|
|
61
|
+
const { el, row, snapshot } = panel(true);
|
|
62
|
+
placeEchoOverTrigger(el, geometry, { stretch: true });
|
|
63
|
+
placeEchoOverTrigger(el, { ...geometry, panelWidth: 260 }, { stretch: true });
|
|
64
|
+
expect(row.style.width).toBe("260px");
|
|
65
|
+
expect(snapshot.style.width).toBe("");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LC-112 icon trigger echo (FZ-8480, Clay's rv_2607879d3bdaf9bf): a panel
|
|
3
|
+
* that covers the icon button it opened from draws that button again in its
|
|
4
|
+
* exact spot, same size and plate, as an X (Round 37: every icon trigger,
|
|
5
|
+
* the + and a menu's button alike). It closes the panel and reads "Close".
|
|
6
|
+
*/
|
|
7
|
+
import { PlusIcon, XIcon } from "@phosphor-icons/react";
|
|
8
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
9
|
+
import { fireEvent, render, waitFor, within } from "@testing-library/react";
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
import { Surface, useBarSurface } from "@multiplatform.one/theme";
|
|
12
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
13
|
+
import { Text } from "tamagui";
|
|
14
|
+
import { Button } from "../Button";
|
|
15
|
+
import { FloatingPanel } from "./index";
|
|
16
|
+
import { usePanelIconEchoBox } from "./echoContext";
|
|
17
|
+
import { PanelHeader } from "./PanelHeader";
|
|
18
|
+
import type { IconEcho } from "./iconEcho";
|
|
19
|
+
|
|
20
|
+
type Rect = { x: number; y: number; width: number; height: number };
|
|
21
|
+
|
|
22
|
+
function measure(trigger: Rect, panelWidth = 240, panelHeight = 160, surface?: Rect) {
|
|
23
|
+
const original = HTMLElement.prototype.getBoundingClientRect;
|
|
24
|
+
const rect = {
|
|
25
|
+
...trigger,
|
|
26
|
+
top: trigger.y,
|
|
27
|
+
left: trigger.x,
|
|
28
|
+
right: trigger.x + trigger.width,
|
|
29
|
+
bottom: trigger.y + trigger.height,
|
|
30
|
+
toJSON: () => ({}),
|
|
31
|
+
};
|
|
32
|
+
vi.spyOn(HTMLElement.prototype, "getBoundingClientRect").mockImplementation(
|
|
33
|
+
function (this: HTMLElement) {
|
|
34
|
+
if (this.hasAttribute("data-fp-reference")) return rect;
|
|
35
|
+
if (surface && this.hasAttribute("data-fp-cover-surface")) {
|
|
36
|
+
return {
|
|
37
|
+
...surface,
|
|
38
|
+
top: surface.y,
|
|
39
|
+
left: surface.x,
|
|
40
|
+
right: surface.x + surface.width,
|
|
41
|
+
bottom: surface.y + surface.height,
|
|
42
|
+
toJSON: () => ({}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return original.call(this);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
vi.spyOn(HTMLElement.prototype, "offsetWidth", "get").mockImplementation(
|
|
49
|
+
function (this: HTMLElement) {
|
|
50
|
+
return this.hasAttribute("data-fp-panel") ? panelWidth : 0;
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
vi.spyOn(HTMLElement.prototype, "scrollHeight", "get").mockImplementation(
|
|
54
|
+
function (this: HTMLElement) {
|
|
55
|
+
return this.hasAttribute("data-fp-panel") ? panelHeight : 0;
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function EchoBoxProbe() {
|
|
61
|
+
const box = usePanelIconEchoBox();
|
|
62
|
+
return box ? (
|
|
63
|
+
<span
|
|
64
|
+
data-testid="echo-box"
|
|
65
|
+
data-height={box.height}
|
|
66
|
+
data-left={box.left}
|
|
67
|
+
data-right={box.right}
|
|
68
|
+
/>
|
|
69
|
+
) : null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function AddPanel({ kind = "close", header = false }: { kind?: IconEcho; header?: boolean }) {
|
|
73
|
+
const [open, setOpen] = useState(false);
|
|
74
|
+
return (
|
|
75
|
+
<FloatingPanel
|
|
76
|
+
open={open}
|
|
77
|
+
onOpenChange={setOpen}
|
|
78
|
+
anchorMode="cover-trigger"
|
|
79
|
+
compactFace="menu"
|
|
80
|
+
triggerEcho={false}
|
|
81
|
+
iconEcho={kind}
|
|
82
|
+
coverAlign="auto"
|
|
83
|
+
widthMode="fit-content"
|
|
84
|
+
triggerSizing="content"
|
|
85
|
+
contentPadding="none"
|
|
86
|
+
trigger={<Button icon={PlusIcon} aria-label="Add node" />}
|
|
87
|
+
>
|
|
88
|
+
{header ? (
|
|
89
|
+
<PanelHeader>
|
|
90
|
+
<Text>Add a node</Text>
|
|
91
|
+
<EchoBoxProbe />
|
|
92
|
+
</PanelHeader>
|
|
93
|
+
) : (
|
|
94
|
+
<Text>Add a node</Text>
|
|
95
|
+
)}
|
|
96
|
+
<Button>Copy</Button>
|
|
97
|
+
</FloatingPanel>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const glyphPath = (node: Element | null | undefined) =>
|
|
102
|
+
node?.querySelector("svg path")?.getAttribute("d");
|
|
103
|
+
|
|
104
|
+
async function open(result: ReturnType<typeof renderWithProviders>) {
|
|
105
|
+
fireEvent.click(result.getByRole("button", { name: "Add node" }), { detail: 0 });
|
|
106
|
+
const panel = (await result.findByTestId("floating-panel-viewport")) as HTMLElement;
|
|
107
|
+
await waitFor(() => expect(panel.style.visibility).toBe("visible"));
|
|
108
|
+
return panel;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
afterEach(() => {
|
|
112
|
+
vi.restoreAllMocks();
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe("LC-112 icon trigger echo on the web (FZ-8480)", () => {
|
|
116
|
+
const viewportWidth = () => document.documentElement.clientWidth || window.innerWidth;
|
|
117
|
+
|
|
118
|
+
it("draws the + again as an X on the button's exact box at the panel's top trailing corner", async () => {
|
|
119
|
+
const button = { x: viewportWidth() - 16 - 44, y: 12, width: 44, height: 44 };
|
|
120
|
+
measure(button, 240);
|
|
121
|
+
const result = renderWithProviders(<AddPanel />);
|
|
122
|
+
const panel = await open(result);
|
|
123
|
+
const panelLeft = button.x + button.width - 240;
|
|
124
|
+
expect(panel.style.top).toBe(`${button.y}px`);
|
|
125
|
+
expect(panel.style.left).toBe(`${panelLeft}px`);
|
|
126
|
+
const row = panel.querySelector<HTMLElement>("[data-fp-icon-echo]") as HTMLElement;
|
|
127
|
+
expect(row.style.order).toBe("-1");
|
|
128
|
+
expect(row.style.height).toBe(`${button.height}px`);
|
|
129
|
+
// The X shares the content's first row, like a sheet's close button: it
|
|
130
|
+
// takes no height of its own.
|
|
131
|
+
expect(row.getAttribute("data-fp-icon-echo")).toBe("overlay");
|
|
132
|
+
const borderTop = parseFloat(getComputedStyle(panel).borderTopWidth) || 0;
|
|
133
|
+
expect(row.style.marginBottom).toBe(`${-(button.height - borderTop)}px`);
|
|
134
|
+
const box = row.querySelector<HTMLElement>("[data-fp-icon-echo-box]") as HTMLElement;
|
|
135
|
+
expect(box.style.width).toBe(`${button.width}px`);
|
|
136
|
+
expect(box.style.height).toBe(`${button.height}px`);
|
|
137
|
+
expect(box.style.marginLeft).toBe(`${button.x - panelLeft}px`);
|
|
138
|
+
const echo = within(panel).getByRole("button", { name: "Close" });
|
|
139
|
+
const x = render(<XIcon weight="bold" />);
|
|
140
|
+
expect(glyphPath(echo)).toBe(glyphPath(x.container));
|
|
141
|
+
x.unmount();
|
|
142
|
+
expect(glyphPath(echo)).not.toBe(glyphPath(result.getByRole("button", { name: "Add node" })));
|
|
143
|
+
expect(panel.querySelector("[data-fp-trigger-row]")).toBeNull();
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("renders the echo on the trigger's bar surface, so it keeps the bar button's plate", async () => {
|
|
147
|
+
measure({ x: 16, y: 12, width: 44, height: 44 });
|
|
148
|
+
function BarProbe({ icon: _icon, ...rest }: { icon?: unknown; [key: string]: unknown }) {
|
|
149
|
+
const bar = useBarSurface();
|
|
150
|
+
const press = rest.onPress as (() => void) | undefined;
|
|
151
|
+
return (
|
|
152
|
+
<button
|
|
153
|
+
type="button"
|
|
154
|
+
aria-label={rest["aria-label"] as string}
|
|
155
|
+
data-bar={String(bar)}
|
|
156
|
+
onClick={() => press?.()}
|
|
157
|
+
/>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
const result = renderWithProviders(
|
|
161
|
+
<Surface bar>
|
|
162
|
+
<FloatingPanel
|
|
163
|
+
open
|
|
164
|
+
onOpenChange={() => {}}
|
|
165
|
+
anchorMode="cover-trigger"
|
|
166
|
+
compactFace="menu"
|
|
167
|
+
triggerEcho={false}
|
|
168
|
+
iconEcho="close"
|
|
169
|
+
coverAlign="auto"
|
|
170
|
+
widthMode="fit-content"
|
|
171
|
+
triggerSizing="content"
|
|
172
|
+
trigger={<BarProbe icon={PlusIcon} aria-label="Add node" />}
|
|
173
|
+
>
|
|
174
|
+
<Text>Add a node</Text>
|
|
175
|
+
</FloatingPanel>
|
|
176
|
+
</Surface>,
|
|
177
|
+
);
|
|
178
|
+
const panel = (await result.findByTestId("floating-panel-viewport")) as HTMLElement;
|
|
179
|
+
expect(within(panel).getByRole("button", { name: "Close" }).getAttribute("data-bar")).toBe(
|
|
180
|
+
"true",
|
|
181
|
+
);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it("covers a grouped trigger's whole plate, only the pressed trigger showing as its X", async () => {
|
|
185
|
+
const button = { x: viewportWidth() - 16 - 44, y: 12, width: 44, height: 44 };
|
|
186
|
+
const plate = { x: button.x - 100, y: 12, width: 144, height: 44 };
|
|
187
|
+
measure(button, 120, 160, plate);
|
|
188
|
+
const result = renderWithProviders(
|
|
189
|
+
<div data-fp-cover-surface="">
|
|
190
|
+
<Button icon={PlusIcon} aria-label="Search" />
|
|
191
|
+
<AddPanel kind="menu" />
|
|
192
|
+
</div>,
|
|
193
|
+
);
|
|
194
|
+
const panel = await open(result);
|
|
195
|
+
// The plate is wider than the menu, so the menu takes the plate's width
|
|
196
|
+
// and both edges.
|
|
197
|
+
expect(panel.style.left).toBe(`${plate.x}px`);
|
|
198
|
+
expect(panel.style.top).toBe(`${plate.y}px`);
|
|
199
|
+
const row = panel.querySelector<HTMLElement>("[data-fp-icon-echo]") as HTMLElement;
|
|
200
|
+
// The band covers the whole plate; the group's other buttons are covered,
|
|
201
|
+
// not echoed.
|
|
202
|
+
expect(row.getAttribute("data-fp-icon-echo")).toBe("band");
|
|
203
|
+
expect(row.style.height).toBe(`${plate.height}px`);
|
|
204
|
+
expect(row.querySelector("[data-fp-group-echo]")).toBeNull();
|
|
205
|
+
expect(within(panel).queryByRole("button", { name: "Search" })).toBeNull();
|
|
206
|
+
const box = row.querySelector<HTMLElement>("[data-fp-icon-echo-box]") as HTMLElement;
|
|
207
|
+
expect(box.style.marginLeft).toBe(`${button.x - plate.x}px`);
|
|
208
|
+
expect(within(panel).getByRole("button", { name: "Close" })).toBeTruthy();
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it("closes the panel when the echo is pressed", async () => {
|
|
212
|
+
measure({ x: 16, y: 12, width: 44, height: 44 });
|
|
213
|
+
const result = renderWithProviders(<AddPanel />);
|
|
214
|
+
const panel = await open(result);
|
|
215
|
+
fireEvent.click(within(panel).getByRole("button", { name: "Close" }));
|
|
216
|
+
await waitFor(() => expect(result.queryByTestId("floating-panel-viewport")).toBeNull());
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it("turns a menu trigger into an X too, in its own band", async () => {
|
|
220
|
+
measure({ x: 16, y: 12, width: 44, height: 44 });
|
|
221
|
+
const result = renderWithProviders(<AddPanel kind="menu" />);
|
|
222
|
+
const panel = await open(result);
|
|
223
|
+
const echo = within(panel).getByRole("button", { name: "Close" });
|
|
224
|
+
const x = render(<XIcon weight="bold" />);
|
|
225
|
+
expect(glyphPath(echo)).toBe(glyphPath(x.container));
|
|
226
|
+
x.unmount();
|
|
227
|
+
// A menu's rows run the full width, so its X takes its own band.
|
|
228
|
+
const row = panel.querySelector<HTMLElement>("[data-fp-icon-echo]") as HTMLElement;
|
|
229
|
+
expect(row.getAttribute("data-fp-icon-echo")).toBe("band");
|
|
230
|
+
expect(row.style.marginBottom).toBe("");
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it("puts a panel header on the X's line, clear of the X", async () => {
|
|
234
|
+
const button = { x: viewportWidth() - 16 - 44, y: 12, width: 44, height: 44 };
|
|
235
|
+
measure(button, 240);
|
|
236
|
+
const result = renderWithProviders(<AddPanel header />);
|
|
237
|
+
const panel = await open(result);
|
|
238
|
+
expect(panel.querySelector("[data-fp-panel-header]")).toBeTruthy();
|
|
239
|
+
const box = await within(panel).findByTestId("echo-box");
|
|
240
|
+
// The header takes the X's height, and the X sits at the end edge, so it
|
|
241
|
+
// keeps the X's whole box clear there: from the X's start to the panel's end.
|
|
242
|
+
const panelLeft = button.x + button.width - 240;
|
|
243
|
+
expect(box.dataset.height).toBe(`${button.height}`);
|
|
244
|
+
expect(box.dataset.left).toBe("0");
|
|
245
|
+
expect(box.dataset.right).toBe(`${240 - (button.x - panelLeft)}`);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
it("keeps a content-sized trigger on a centring row's line", async () => {
|
|
249
|
+
measure({ x: 16, y: 12, width: 44, height: 44 });
|
|
250
|
+
const centred = renderWithProviders(
|
|
251
|
+
<div style={{ display: "flex", flexDirection: "row", alignItems: "center", height: 60 }}>
|
|
252
|
+
<AddPanel />
|
|
253
|
+
</div>,
|
|
254
|
+
);
|
|
255
|
+
const inRow = centred.container.querySelector<HTMLElement>(
|
|
256
|
+
"[data-fp-reference]",
|
|
257
|
+
) as HTMLElement;
|
|
258
|
+
await waitFor(() => expect(getComputedStyle(inRow).alignSelf).not.toBe("flex-start"));
|
|
259
|
+
centred.unmount();
|
|
260
|
+
const column = renderWithProviders(
|
|
261
|
+
<div style={{ display: "flex", flexDirection: "column", alignItems: "stretch" }}>
|
|
262
|
+
<AddPanel />
|
|
263
|
+
</div>,
|
|
264
|
+
);
|
|
265
|
+
const inColumn = column.container.querySelector<HTMLElement>(
|
|
266
|
+
"[data-fp-reference]",
|
|
267
|
+
) as HTMLElement;
|
|
268
|
+
expect(getComputedStyle(inColumn).alignSelf).toBe("flex-start");
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
it("comes last in the document, so a keyboard open lands on the content first", async () => {
|
|
272
|
+
measure({ x: 16, y: 12, width: 44, height: 44 });
|
|
273
|
+
const result = renderWithProviders(<AddPanel />);
|
|
274
|
+
const panel = await open(result);
|
|
275
|
+
const buttons = within(panel).getAllByRole("button");
|
|
276
|
+
expect(buttons.map((b) => b.textContent || b.getAttribute("aria-label"))).toEqual([
|
|
277
|
+
"Copy",
|
|
278
|
+
"Close",
|
|
279
|
+
]);
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it("opens up from the button's bottom edge near the bottom, the echo on the bottom row", async () => {
|
|
283
|
+
const button = { x: 16, y: window.innerHeight - 60, width: 44, height: 44 };
|
|
284
|
+
measure(button, 240, 300);
|
|
285
|
+
const result = renderWithProviders(<AddPanel />);
|
|
286
|
+
const panel = await open(result);
|
|
287
|
+
const frame = getComputedStyle(panel);
|
|
288
|
+
const borders =
|
|
289
|
+
(parseFloat(frame.borderTopWidth) || 0) + (parseFloat(frame.borderBottomWidth) || 0);
|
|
290
|
+
expect(parseFloat(panel.style.top) + 300 + borders).toBe(button.y + button.height);
|
|
291
|
+
expect(panel.style.left).toBe(`${button.x}px`);
|
|
292
|
+
const row = panel.querySelector<HTMLElement>("[data-fp-icon-echo]") as HTMLElement;
|
|
293
|
+
expect(row.style.order).toBe("1");
|
|
294
|
+
expect(panel.style.transformOrigin).toBe("bottom left");
|
|
295
|
+
expect(result.queryByTestId("floating-panel-sheet")).toBeNull();
|
|
296
|
+
});
|
|
297
|
+
});
|