@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.
@@ -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: "translateX(100%)",
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
- transform: "translateY(100%)",
65
+ willChange: "transform, opacity",
66
+ transform: "translate3d(0, 100%, 0)",
66
67
  opacity: 0,
67
68
  selectors: {
68
69
  [`${enterActive} &, ${enterDone} &`]: {
69
- transform: "translateY(0)",
70
+ transform: "translate3d(0, 0, 0)",
70
71
  opacity: 1,
71
72
  },
72
73
  [`${exitActive} &, ${exitDone} &`]: {
73
- transform: "translateY(100%)",
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: "translateX(100%)",
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: {
@@ -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
- ? `translateX(-${OFFSET_PX_CUPERTINO / 16}rem)`
26
- : `translateY(-${OFFSET_PX_ANDROID / 16}rem)`;
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 = `translateX(${dx}px)`;
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 = `translateX(${
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 = `translateX(${
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 { default as AppScreen } from "./components/AppScreen";
3
- export { default as BottomSheet } from "./components/BottomSheet";
4
- export { default as Modal } from "./components/Modal";
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";