@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.
@@ -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 = "var(--stackflow-transition-duration)";
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 = `var(--stackflow-transition-duration)`;
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: "275ms",
45
+ heightTransitionDuration: "0ms",
44
46
  minHeight: "3.5rem",
45
47
  iconColor: "#212124",
46
48
  textColor: "#212124",