@stackflow/plugin-basic-ui 1.9.2-canary.0 → 1.9.2
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/basicUIPlugin.css.d.ts +13 -0
- package/dist/basicUIPlugin.css.d.ts.map +1 -1
- package/dist/basicUIPlugin.d.ts.map +1 -1
- package/dist/components/AppBar.css.d.ts +1 -9
- package/dist/components/AppBar.css.d.ts.map +1 -1
- package/dist/components/AppScreen.css.d.ts +2 -2
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/useLazy.d.ts +1 -0
- package/dist/hooks/useMaxWidth.d.ts +7 -0
- package/dist/hooks/useMounted.d.ts +1 -0
- package/dist/hooks/useNullableActivity.d.ts +2 -0
- package/dist/hooks/useStyleEffect.d.ts +10 -0
- package/dist/hooks/useStyleEffectHide.d.ts +4 -0
- package/dist/hooks/useStyleEffectOffset.d.ts +8 -0
- package/dist/hooks/useStyleEffectSwipeBack.d.ts +9 -0
- package/dist/index.css +73 -28
- package/dist/index.css.map +3 -3
- package/dist/index.js +81 -82
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +59 -60
- package/dist/index.mjs.map +4 -4
- package/dist/utils/last.d.ts +1 -0
- package/dist/utils/listenOnce.d.ts +1 -0
- package/dist/utils/listenResize.d.ts +1 -0
- package/dist/utils/noop.d.ts +1 -0
- package/dist/utils/requestNextFrame.d.ts +1 -0
- package/package.json +4 -4
- package/src/basicUIPlugin.css.ts +24 -0
- package/src/basicUIPlugin.tsx +34 -35
- package/src/components/AppBar.css.ts +36 -39
- package/src/components/AppScreen.css.ts +10 -10
- package/dist/components/RootStyles.d.ts +0 -8
- package/dist/components/RootStyles.d.ts.map +0 -1
- package/src/components/RootStyles.ts +0 -27
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { style } from "@vanilla-extract/css";
|
|
2
2
|
import { recipe } from "@vanilla-extract/recipes";
|
|
3
3
|
|
|
4
|
-
import { globalVars } from "../basicUIPlugin.css";
|
|
4
|
+
import { android, cupertino, globalVars } from "../basicUIPlugin.css";
|
|
5
5
|
import { f } from "../styles";
|
|
6
6
|
import {
|
|
7
7
|
background,
|
|
@@ -40,18 +40,17 @@ export const appBar = recipe({
|
|
|
40
40
|
zIndex: vars.zIndexes.appBar,
|
|
41
41
|
transition: transitions(appBarCommonTransition),
|
|
42
42
|
selectors: {
|
|
43
|
-
|
|
43
|
+
[`${cupertino} &`]: {
|
|
44
44
|
position: "absolute",
|
|
45
45
|
},
|
|
46
|
-
[
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
":root[data-stackflow-plugin-basic-ui-theme=android] &": {
|
|
46
|
+
[`${cupertino} ${exitActive} &`]: {
|
|
47
|
+
transform: "translate3d(100%, 0, 0)",
|
|
48
|
+
transition: transitions({
|
|
49
|
+
...appBarCommonTransition,
|
|
50
|
+
transform: "0s",
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
53
|
+
[`${android} &`]: {
|
|
55
54
|
opacity: 0,
|
|
56
55
|
transform: "translate3d(0, 10rem, 0)",
|
|
57
56
|
transition: transitions({
|
|
@@ -61,8 +60,8 @@ export const appBar = recipe({
|
|
|
61
60
|
}),
|
|
62
61
|
},
|
|
63
62
|
[`
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
${android} ${enterActive} &,
|
|
64
|
+
${android} ${enterDone} &
|
|
66
65
|
`]: {
|
|
67
66
|
opacity: 1,
|
|
68
67
|
transform: "translate3d(0, 0, 0)",
|
|
@@ -79,7 +78,7 @@ export const appBar = recipe({
|
|
|
79
78
|
modalPresentationStyle: {
|
|
80
79
|
fullScreen: {
|
|
81
80
|
selectors: {
|
|
82
|
-
|
|
81
|
+
[`${cupertino} &`]: {
|
|
83
82
|
transform: "translate3d(0, 100vh, 0)",
|
|
84
83
|
transition: transitions({
|
|
85
84
|
...appBarCommonTransition,
|
|
@@ -88,38 +87,36 @@ export const appBar = recipe({
|
|
|
88
87
|
}),
|
|
89
88
|
},
|
|
90
89
|
[`
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
${cupertino} ${enterActive} &,
|
|
91
|
+
${cupertino} ${enterDone} &
|
|
93
92
|
`]: {
|
|
94
93
|
transform: "translate3d(0, 0, 0)",
|
|
95
94
|
},
|
|
96
|
-
[
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
95
|
+
[`${cupertino} ${exitActive} &`]: {
|
|
96
|
+
transform: "translate3d(0, 100vh, 0)",
|
|
97
|
+
transition: transitions({
|
|
98
|
+
...appBarCommonTransition,
|
|
99
|
+
transform: vars.transitionDuration,
|
|
100
|
+
opacity: vars.transitionDuration,
|
|
101
|
+
}),
|
|
102
|
+
},
|
|
105
103
|
},
|
|
106
104
|
},
|
|
107
105
|
},
|
|
108
106
|
activityEnterStyle: {
|
|
109
107
|
slideInLeft: {
|
|
110
108
|
selectors: {
|
|
111
|
-
|
|
109
|
+
[`${android} &`]: {
|
|
112
110
|
opacity: 1,
|
|
113
111
|
transform: "translate3d(0, 0, 0)",
|
|
114
112
|
},
|
|
115
|
-
[
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
},
|
|
113
|
+
[`${android} ${exitActive} &`]: {
|
|
114
|
+
transform: "translate3d(100%, 0, 0)",
|
|
115
|
+
transition: transitions({
|
|
116
|
+
...appBarCommonTransition,
|
|
117
|
+
transform: "0s",
|
|
118
|
+
}),
|
|
119
|
+
},
|
|
123
120
|
},
|
|
124
121
|
},
|
|
125
122
|
},
|
|
@@ -192,7 +189,7 @@ export const centerMain = recipe({
|
|
|
192
189
|
color: globalVars.appBar.textColorTransitionDuration,
|
|
193
190
|
}),
|
|
194
191
|
selectors: {
|
|
195
|
-
|
|
192
|
+
[`${android} &`]: {
|
|
196
193
|
width: "100%",
|
|
197
194
|
justifyContent: "flex-start",
|
|
198
195
|
paddingLeft: "1rem",
|
|
@@ -201,7 +198,7 @@ export const centerMain = recipe({
|
|
|
201
198
|
fontWeight: "bold",
|
|
202
199
|
boxSizing: "border-box",
|
|
203
200
|
},
|
|
204
|
-
|
|
201
|
+
[`${cupertino} &`]: {
|
|
205
202
|
position: "absolute",
|
|
206
203
|
display: "flex",
|
|
207
204
|
alignItems: "center",
|
|
@@ -224,7 +221,7 @@ export const centerMain = recipe({
|
|
|
224
221
|
hasLeft: {
|
|
225
222
|
true: {
|
|
226
223
|
selectors: {
|
|
227
|
-
|
|
224
|
+
[`${android} &`]: {
|
|
228
225
|
paddingLeft: "0.375rem",
|
|
229
226
|
},
|
|
230
227
|
},
|
|
@@ -246,7 +243,7 @@ export const centerMainEdge = style([
|
|
|
246
243
|
display: "none",
|
|
247
244
|
width: vars.appBar.center.mainWidth,
|
|
248
245
|
selectors: {
|
|
249
|
-
|
|
246
|
+
[`${cupertino} &`]: {
|
|
250
247
|
display: "block",
|
|
251
248
|
},
|
|
252
249
|
},
|
|
@@ -276,7 +273,7 @@ export const right = style([
|
|
|
276
273
|
display: "none",
|
|
277
274
|
},
|
|
278
275
|
selectors: {
|
|
279
|
-
|
|
276
|
+
[`${android} &`]: {
|
|
280
277
|
padding: "0 0.5rem 0 0",
|
|
281
278
|
},
|
|
282
279
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createThemeContract, style } from "@vanilla-extract/css";
|
|
2
2
|
import { recipe } from "@vanilla-extract/recipes";
|
|
3
3
|
|
|
4
|
-
import { globalVars } from "../basicUIPlugin.css";
|
|
4
|
+
import { android, cupertino, globalVars } from "../basicUIPlugin.css";
|
|
5
5
|
import { f } from "../styles";
|
|
6
6
|
|
|
7
7
|
export const vars = createThemeContract({
|
|
@@ -59,7 +59,7 @@ export const dim = style([
|
|
|
59
59
|
opacity: 0,
|
|
60
60
|
zIndex: vars.zIndexes.dim,
|
|
61
61
|
selectors: {
|
|
62
|
-
|
|
62
|
+
[`${android} &`]: {
|
|
63
63
|
height: "10rem",
|
|
64
64
|
background: `linear-gradient(${globalVars.dimBackgroundColor}, rgba(0, 0, 0, 0))`,
|
|
65
65
|
},
|
|
@@ -92,22 +92,22 @@ export const paper = recipe({
|
|
|
92
92
|
},
|
|
93
93
|
zIndex: vars.zIndexes.paper,
|
|
94
94
|
selectors: {
|
|
95
|
-
|
|
95
|
+
[`${cupertino} &`]: {
|
|
96
96
|
transform: "translate3d(100%, 0, 0)",
|
|
97
97
|
},
|
|
98
98
|
[`
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
${cupertino} ${enterActive} &,
|
|
100
|
+
${cupertino} ${enterDone} &
|
|
101
101
|
`]: {
|
|
102
102
|
transform: "translate3d(0, 0, 0)",
|
|
103
103
|
},
|
|
104
|
-
|
|
104
|
+
[`${android} &`]: {
|
|
105
105
|
opacity: 0,
|
|
106
106
|
transform: "translate3d(0, 10rem, 0)",
|
|
107
107
|
},
|
|
108
108
|
[`
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
${android} ${enterActive} &,
|
|
110
|
+
${android} ${enterDone} &
|
|
111
111
|
`]: {
|
|
112
112
|
opacity: 1,
|
|
113
113
|
transform: "translate3d(0, 0, 0)",
|
|
@@ -146,7 +146,7 @@ export const paper = recipe({
|
|
|
146
146
|
modalPresentationStyle: {
|
|
147
147
|
fullScreen: {
|
|
148
148
|
selectors: {
|
|
149
|
-
|
|
149
|
+
[`${cupertino} &`]: {
|
|
150
150
|
transform: "translate3d(0, 100%, 0)",
|
|
151
151
|
},
|
|
152
152
|
},
|
|
@@ -155,7 +155,7 @@ export const paper = recipe({
|
|
|
155
155
|
activityEnterStyle: {
|
|
156
156
|
slideInLeft: {
|
|
157
157
|
selectors: {
|
|
158
|
-
|
|
158
|
+
[`${android} &`]: {
|
|
159
159
|
transform: "translate3d(50%, 0, 0)",
|
|
160
160
|
},
|
|
161
161
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RootStyles.d.ts","sourceRoot":"","sources":["../../src/components/RootStyles.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B,MAAM,EAAE;QACN,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KAC1C,CAAC;CACH,CAAC;AACF,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,eAAe,QAkB5D"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { useLayoutEffect } from "react";
|
|
2
|
-
|
|
3
|
-
export type RootStylesProps = {
|
|
4
|
-
theme: "android" | "cupertino";
|
|
5
|
-
styles: {
|
|
6
|
-
[cssVarName: string]: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export function RootStyles({ theme, styles }: RootStylesProps) {
|
|
10
|
-
useLayoutEffect(() => {
|
|
11
|
-
const root = document.querySelector(":root") as HTMLHtmlElement;
|
|
12
|
-
|
|
13
|
-
if (!root) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
for (const [key, value] of Object.entries(styles)) {
|
|
18
|
-
if (value) {
|
|
19
|
-
root.style.setProperty(key, value);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
root.dataset.stackflowPluginBasicUiTheme = theme;
|
|
24
|
-
}, [styles, theme]);
|
|
25
|
-
|
|
26
|
-
return null;
|
|
27
|
-
}
|