@stackflow/plugin-basic-ui 0.20.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppScreen.d.ts +7 -1
- package/dist/components/BottomSheet.d.ts +1 -1
- package/dist/components/Modal.d.ts +1 -1
- package/dist/index.css +25 -20
- package/dist/index.css.map +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +25 -7
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +26 -8
- package/dist/index.mjs.map +3 -3
- package/package.json +2 -2
- package/src/components/AppBar.css.ts +5 -4
- package/src/components/AppScreen.css.ts +9 -7
- package/src/components/AppScreen.tsx +64 -42
- package/src/components/BottomSheet.css.ts +5 -4
- package/src/components/BottomSheet.tsx +1 -1
- package/src/components/Modal.css.ts +2 -1
- package/src/components/Modal.tsx +1 -1
- package/src/hooks/useStyleEffectOffset.ts +2 -2
- package/src/hooks/useStyleEffectSwipeBack.ts +5 -5
- package/src/index.ts +11 -3
|
@@ -20,7 +20,7 @@ export const enterActive = style({});
|
|
|
20
20
|
export const enterDone = style({});
|
|
21
21
|
export const exitActive = style({});
|
|
22
22
|
export const exitDone = style({
|
|
23
|
-
transform: "
|
|
23
|
+
transform: "translate3d(100%, 0, 0)",
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
export const container = recipe({
|
|
@@ -62,15 +62,16 @@ export const paper = style([
|
|
|
62
62
|
backgroundColor: globalVars.backgroundColor,
|
|
63
63
|
width: "100%",
|
|
64
64
|
borderRadius: `${globalVars.bottomSheet.borderRadius} ${globalVars.bottomSheet.borderRadius} 0 0`,
|
|
65
|
-
|
|
65
|
+
willChange: "transform, opacity",
|
|
66
|
+
transform: "translate3d(0, 100%, 0)",
|
|
66
67
|
opacity: 0,
|
|
67
68
|
selectors: {
|
|
68
69
|
[`${enterActive} &, ${enterDone} &`]: {
|
|
69
|
-
transform: "
|
|
70
|
+
transform: "translate3d(0, 0, 0)",
|
|
70
71
|
opacity: 1,
|
|
71
72
|
},
|
|
72
73
|
[`${exitActive} &, ${exitDone} &`]: {
|
|
73
|
-
transform: "
|
|
74
|
+
transform: "translate3d(0, 100%, 0)",
|
|
74
75
|
opacity: 0,
|
|
75
76
|
},
|
|
76
77
|
},
|
|
@@ -10,7 +10,7 @@ import { globalVars } from "../theme.css";
|
|
|
10
10
|
import { compactMap } from "../utils";
|
|
11
11
|
import * as css from "./BottomSheet.css";
|
|
12
12
|
|
|
13
|
-
type BottomSheetProps = Partial<
|
|
13
|
+
export type BottomSheetProps = Partial<
|
|
14
14
|
Pick<GlobalVars, "backgroundColor" | "dimBackgroundColor">
|
|
15
15
|
> &
|
|
16
16
|
Partial<GlobalVars["bottomSheet"]> & {
|
|
@@ -20,7 +20,7 @@ export const enterActive = style({});
|
|
|
20
20
|
export const enterDone = style({});
|
|
21
21
|
export const exitActive = style({});
|
|
22
22
|
export const exitDone = style({
|
|
23
|
-
transform: "
|
|
23
|
+
transform: "translate3d(100%, 0, 0)",
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
export const container = recipe({
|
|
@@ -66,6 +66,7 @@ export const paper = style([
|
|
|
66
66
|
boxShadow:
|
|
67
67
|
"0px 0.625rem 2.375rem rgba(0, 0, 0, 0.15), 0px .5625rem 2.875rem rgba(0, 0, 0, 0.12), 0px .3125rem .9375rem rgba(0, 0, 0, 0.1)",
|
|
68
68
|
borderRadius: globalVars.modal.borderRadius,
|
|
69
|
+
willChange: "transform, opacity",
|
|
69
70
|
transform: "scale(1.1)",
|
|
70
71
|
opacity: 0,
|
|
71
72
|
selectors: {
|
package/src/components/Modal.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import { globalVars } from "../theme.css";
|
|
|
10
10
|
import { compactMap } from "../utils";
|
|
11
11
|
import * as css from "./Modal.css";
|
|
12
12
|
|
|
13
|
-
type ModalProps = Partial<
|
|
13
|
+
export type ModalProps = Partial<
|
|
14
14
|
Pick<GlobalVars, "backgroundColor" | "dimBackgroundColor">
|
|
15
15
|
> &
|
|
16
16
|
Partial<GlobalVars["modal"]> & {
|
|
@@ -22,8 +22,8 @@ export function useStyleEffectOffset({
|
|
|
22
22
|
? ({ activityTransitionState, refs }) => {
|
|
23
23
|
const transform =
|
|
24
24
|
theme === "cupertino"
|
|
25
|
-
? `
|
|
26
|
-
: `
|
|
25
|
+
? `translate3d(-${OFFSET_PX_CUPERTINO / 16}rem, 0, 0)`
|
|
26
|
+
: `translate3d(0, -${OFFSET_PX_ANDROID / 16}rem, 0)`;
|
|
27
27
|
|
|
28
28
|
const cleanup = () => {
|
|
29
29
|
requestNextFrame(() => {
|
|
@@ -72,7 +72,7 @@ export function useStyleEffectSwipeBack({
|
|
|
72
72
|
$dim.style.transition = "0s";
|
|
73
73
|
|
|
74
74
|
$paper.style.overflowY = "hidden";
|
|
75
|
-
$paper.style.transform = `
|
|
75
|
+
$paper.style.transform = `translate3d(${dx}px, 0, 0)`;
|
|
76
76
|
$paper.style.transition = "0s";
|
|
77
77
|
|
|
78
78
|
refs.forEach((ref) => {
|
|
@@ -80,9 +80,9 @@ export function useStyleEffectSwipeBack({
|
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
ref.current.style.transform = `
|
|
83
|
+
ref.current.style.transform = `translate3d(${
|
|
84
84
|
-1 * (1 - p) * OFFSET_PX_CUPERTINO
|
|
85
|
-
}px)`;
|
|
85
|
+
}px, 0, 0)`;
|
|
86
86
|
ref.current.style.transition = "0s";
|
|
87
87
|
|
|
88
88
|
if (ref.current.parentElement?.style.display === "none") {
|
|
@@ -112,9 +112,9 @@ export function useStyleEffectSwipeBack({
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
ref.current.style.transition = `var(--stackflow-transition-duration)`;
|
|
115
|
-
ref.current.style.transform = `
|
|
115
|
+
ref.current.style.transform = `translate3d(${
|
|
116
116
|
swiped ? "0" : `-${OFFSET_PX_CUPERTINO / 16}rem`
|
|
117
|
-
})`;
|
|
117
|
+
}, 0, 0)`;
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
const _cachedRefs = [...cachedRefs];
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export { basicUIPlugin } from "./basicUIPlugin";
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export {
|
|
3
|
+
default as AppScreen,
|
|
4
|
+
AppScreenContext,
|
|
5
|
+
AppScreenProps,
|
|
6
|
+
useAppScreen,
|
|
7
|
+
} from "./components/AppScreen";
|
|
8
|
+
export {
|
|
9
|
+
default as BottomSheet,
|
|
10
|
+
BottomSheetProps,
|
|
11
|
+
} from "./components/BottomSheet";
|
|
12
|
+
export { default as Modal, ModalProps } from "./components/Modal";
|
|
5
13
|
export { globalVars as cssVars } from "./theme.css";
|