@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.
@@ -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
- ":root[data-stackflow-plugin-basic-ui-theme=cupertino] &": {
43
+ [`${cupertino} &`]: {
44
44
  position: "absolute",
45
45
  },
46
- [`:root[data-stackflow-plugin-basic-ui-theme=cupertino] ${exitActive} &`]:
47
- {
48
- transform: "translate3d(100%, 0, 0)",
49
- transition: transitions({
50
- ...appBarCommonTransition,
51
- transform: "0s",
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
- :root[data-stackflow-plugin-basic-ui-theme=android] ${enterActive} &,
65
- :root[data-stackflow-plugin-basic-ui-theme=android] ${enterDone} &
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
- ":root[data-stackflow-plugin-basic-ui-theme=cupertino] &": {
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
- :root[data-stackflow-plugin-basic-ui-theme=cupertino] ${enterActive} &,
92
- :root[data-stackflow-plugin-basic-ui-theme=cupertino] ${enterDone} &
90
+ ${cupertino} ${enterActive} &,
91
+ ${cupertino} ${enterDone} &
93
92
  `]: {
94
93
  transform: "translate3d(0, 0, 0)",
95
94
  },
96
- [`:root[data-stackflow-plugin-basic-ui-theme=cupertino] ${exitActive} &`]:
97
- {
98
- transform: "translate3d(0, 100vh, 0)",
99
- transition: transitions({
100
- ...appBarCommonTransition,
101
- transform: vars.transitionDuration,
102
- opacity: vars.transitionDuration,
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
- ":root[data-stackflow-plugin-basic-ui-theme=android] &": {
109
+ [`${android} &`]: {
112
110
  opacity: 1,
113
111
  transform: "translate3d(0, 0, 0)",
114
112
  },
115
- [`:root[data-stackflow-plugin-basic-ui-theme=android] ${exitActive} &`]:
116
- {
117
- transform: "translate3d(100%, 0, 0)",
118
- transition: transitions({
119
- ...appBarCommonTransition,
120
- transform: "0s",
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
- ":root[data-stackflow-plugin-basic-ui-theme=android] &": {
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
- ":root[data-stackflow-plugin-basic-ui-theme=cupertino] &": {
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
- ":root[data-stackflow-plugin-basic-ui-theme=android] &": {
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
- ":root[data-stackflow-plugin-basic-ui-theme=cupertino] &": {
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
- ":root[data-stackflow-plugin-basic-ui-theme=android] &": {
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
- ":root[data-stackflow-plugin-basic-ui-theme=android] &": {
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
- ":root[data-stackflow-plugin-basic-ui-theme=cupertino] &": {
95
+ [`${cupertino} &`]: {
96
96
  transform: "translate3d(100%, 0, 0)",
97
97
  },
98
98
  [`
99
- :root[data-stackflow-plugin-basic-ui-theme=cupertino] ${enterActive} &,
100
- :root[data-stackflow-plugin-basic-ui-theme=cupertino] ${enterDone} &
99
+ ${cupertino} ${enterActive} &,
100
+ ${cupertino} ${enterDone} &
101
101
  `]: {
102
102
  transform: "translate3d(0, 0, 0)",
103
103
  },
104
- ":root[data-stackflow-plugin-basic-ui-theme=android] &": {
104
+ [`${android} &`]: {
105
105
  opacity: 0,
106
106
  transform: "translate3d(0, 10rem, 0)",
107
107
  },
108
108
  [`
109
- :root[data-stackflow-plugin-basic-ui-theme=android] ${enterActive} &,
110
- :root[data-stackflow-plugin-basic-ui-theme=android] ${enterDone} &
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
- ":root[data-stackflow-plugin-basic-ui-theme=cupertino] &": {
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
- ":root[data-stackflow-plugin-basic-ui-theme=android] &": {
158
+ [`${android} &`]: {
159
159
  transform: "translate3d(50%, 0, 0)",
160
160
  },
161
161
  },
@@ -1,8 +0,0 @@
1
- export type RootStylesProps = {
2
- theme: "android" | "cupertino";
3
- styles: {
4
- [cssVarName: string]: string | undefined;
5
- };
6
- };
7
- export declare function RootStyles({ theme, styles }: RootStylesProps): null;
8
- //# sourceMappingURL=RootStyles.d.ts.map
@@ -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
- }