@stackflow/plugin-basic-ui 0.21.4-alpha.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/IconBack.d.ts +1 -1
- package/dist/assets/IconClose.d.ts +1 -1
- package/dist/basicUIPlugin.d.ts +2 -2
- package/dist/components/AppBar.d.ts +3 -3
- package/dist/components/AppScreen.d.ts +2 -2
- package/dist/components/BottomSheet.d.ts +1 -1
- package/dist/components/Modal.d.ts +1 -1
- package/dist/hooks/useMaxWidth.d.ts +1 -1
- package/dist/hooks/useStyleEffect.d.ts +1 -1
- package/dist/hooks/useStyleEffectHide.d.ts +1 -1
- package/dist/index.css +9 -5
- package/dist/index.css.map +3 -3
- package/dist/index.js +311 -254
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +289 -226
- package/dist/index.mjs.map +3 -3
- package/dist/theme.css.d.ts +1 -0
- package/package.json +5 -5
- package/src/assets/IconBack.tsx +0 -2
- package/src/assets/IconClose.tsx +0 -2
- package/src/basicUIPlugin.tsx +5 -1
- package/src/components/AppBar.tsx +2 -2
- package/src/components/AppScreen.tsx +6 -3
- package/src/components/BottomSheet.tsx +2 -2
- package/src/components/Modal.tsx +2 -2
- package/src/hooks/useMaxWidth.ts +0 -1
- package/src/hooks/useStyleEffect.ts +0 -1
- package/src/hooks/useStyleEffectHide.ts +0 -2
- package/src/hooks/useStyleEffectOffset.ts +2 -1
- package/src/hooks/useStyleEffectSwipeBack.ts +4 -4
- package/src/theme.css.ts +3 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
2
|
|
|
3
|
+
import { globalVars } from "../theme.css";
|
|
3
4
|
import { listenOnce, noop } from "../utils";
|
|
4
5
|
import { useStyleEffect } from "./useStyleEffect";
|
|
5
6
|
import { OFFSET_PX_CUPERTINO } from "./useStyleEffectOffset";
|
|
@@ -101,19 +102,18 @@ export function useStyleEffectSwipeBack({
|
|
|
101
102
|
return new Promise((resolve) => {
|
|
102
103
|
requestAnimationFrame(() => {
|
|
103
104
|
$dim.style.opacity = `${swiped ? 0 : 1}`;
|
|
104
|
-
$dim.style.transition =
|
|
105
|
+
$dim.style.transition = globalVars.transitionDuration;
|
|
105
106
|
|
|
106
107
|
$paper.style.overflowY = "hidden";
|
|
107
108
|
$paper.style.transform = `translateX(${swiped ? "100%" : "0"})`;
|
|
108
|
-
$paper.style.transition =
|
|
109
|
-
"var(--stackflow-transition-duration)";
|
|
109
|
+
$paper.style.transition = globalVars.transitionDuration;
|
|
110
110
|
|
|
111
111
|
refs.forEach((ref) => {
|
|
112
112
|
if (!ref.current) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
ref.current.style.transition =
|
|
116
|
+
ref.current.style.transition = globalVars.transitionDuration;
|
|
117
117
|
ref.current.style.transform = `translate3d(${
|
|
118
118
|
swiped ? "0" : `-${OFFSET_PX_CUPERTINO / 16}rem`
|
|
119
119
|
}, 0, 0)`;
|
package/src/theme.css.ts
CHANGED
|
@@ -9,6 +9,7 @@ export const globalVars = createGlobalThemeContract(
|
|
|
9
9
|
{
|
|
10
10
|
backgroundColor: "background-color",
|
|
11
11
|
dimBackgroundColor: "dim-background-color",
|
|
12
|
+
transitionDuration: "transition-duration",
|
|
12
13
|
appBar: {
|
|
13
14
|
borderColor: "app-bar-border-color",
|
|
14
15
|
borderSize: "app-bar-border-size",
|
|
@@ -36,11 +37,12 @@ export type GlobalVars = InferVars<typeof globalVars>;
|
|
|
36
37
|
const defaultVars = {
|
|
37
38
|
backgroundColor: "#fff",
|
|
38
39
|
dimBackgroundColor: "rgba(0, 0, 0, 0.15)",
|
|
40
|
+
transitionDuration: "0ms",
|
|
39
41
|
appBar: {
|
|
40
42
|
borderColor: "rgba(0, 0, 0, 0.07)",
|
|
41
43
|
borderSize: "1px",
|
|
42
44
|
height: "3.5rem",
|
|
43
|
-
heightTransitionDuration: "
|
|
45
|
+
heightTransitionDuration: "0ms",
|
|
44
46
|
minHeight: "3.5rem",
|
|
45
47
|
iconColor: "#212124",
|
|
46
48
|
textColor: "#212124",
|