@stackflow/plugin-basic-ui 1.14.1 → 1.15.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.
- package/dist/components/AppBar.d.ts +1 -0
- package/dist/components/AppBar.d.ts.map +1 -1
- package/dist/components/AppScreen.d.ts +1 -0
- package/dist/components/AppScreen.d.ts.map +1 -1
- package/dist/components/BottomSheet.d.ts +1 -0
- package/dist/components/BottomSheet.d.ts.map +1 -1
- package/dist/components/Modal.d.ts +1 -0
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -20
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +42 -22
- package/dist/index.mjs.map +3 -3
- package/package.json +5 -4
- package/src/components/AppBar.tsx +12 -6
- package/src/components/AppScreen.tsx +13 -6
- package/src/components/BottomSheet.tsx +11 -6
- package/src/components/Modal.tsx +11 -6
- package/src/index.ts +2 -2
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
useZIndexBase,
|
|
12
12
|
} from "@stackflow/react-ui-core";
|
|
13
13
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
14
|
+
import clsx from "clsx";
|
|
14
15
|
import { createContext, useContext, useMemo, useRef } from "react";
|
|
15
16
|
import { useGlobalOptions } from "../basicUIPlugin";
|
|
16
17
|
import type { GlobalVars } from "../basicUIPlugin.css";
|
|
@@ -48,6 +49,7 @@ export type AppScreenProps = Partial<
|
|
|
48
49
|
preventSwipeBack?: boolean;
|
|
49
50
|
CUPERTINO_ONLY_modalPresentationStyle?: "fullScreen";
|
|
50
51
|
ANDROID_ONLY_activityEnterStyle?: "slideInLeft";
|
|
52
|
+
className?: string;
|
|
51
53
|
children: React.ReactNode;
|
|
52
54
|
};
|
|
53
55
|
const AppScreen: React.FC<AppScreenProps> = ({
|
|
@@ -58,6 +60,7 @@ const AppScreen: React.FC<AppScreenProps> = ({
|
|
|
58
60
|
preventSwipeBack,
|
|
59
61
|
CUPERTINO_ONLY_modalPresentationStyle,
|
|
60
62
|
ANDROID_ONLY_activityEnterStyle,
|
|
63
|
+
className,
|
|
61
64
|
children,
|
|
62
65
|
}) => {
|
|
63
66
|
const globalOptions = useGlobalOptions();
|
|
@@ -231,12 +234,16 @@ const AppScreen: React.FC<AppScreenProps> = ({
|
|
|
231
234
|
>
|
|
232
235
|
<div
|
|
233
236
|
ref={appScreenRef}
|
|
234
|
-
className={
|
|
235
|
-
|
|
236
|
-
transitionState
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
237
|
+
className={clsx(
|
|
238
|
+
css.appScreen({
|
|
239
|
+
transitionState:
|
|
240
|
+
transitionState === "enter-done" ||
|
|
241
|
+
transitionState === "exit-done"
|
|
242
|
+
? transitionState
|
|
243
|
+
: lazyTransitionState,
|
|
244
|
+
}),
|
|
245
|
+
className,
|
|
246
|
+
)}
|
|
240
247
|
style={assignInlineVars(
|
|
241
248
|
compactMap({
|
|
242
249
|
[globalVars.backgroundColor]: backgroundColor,
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { useActions } from "@stackflow/react";
|
|
2
|
-
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
3
|
-
import { useRef } from "react";
|
|
4
|
-
|
|
5
2
|
import {
|
|
6
3
|
useLazy,
|
|
7
4
|
useNullableActivity,
|
|
@@ -9,6 +6,9 @@ import {
|
|
|
9
6
|
useStyleEffect,
|
|
10
7
|
useZIndexBase,
|
|
11
8
|
} from "@stackflow/react-ui-core";
|
|
9
|
+
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
10
|
+
import clsx from "clsx";
|
|
11
|
+
import { useRef } from "react";
|
|
12
12
|
import type { GlobalVars } from "../basicUIPlugin.css";
|
|
13
13
|
import { globalVars } from "../basicUIPlugin.css";
|
|
14
14
|
import { compactMap } from "../utils";
|
|
@@ -21,6 +21,7 @@ export type BottomSheetProps = Partial<
|
|
|
21
21
|
paperRef?: React.Ref<HTMLDivElement>;
|
|
22
22
|
onOutsideClick?: React.MouseEventHandler;
|
|
23
23
|
children: React.ReactNode;
|
|
24
|
+
className?: string;
|
|
24
25
|
};
|
|
25
26
|
const BottomSheet: React.FC<BottomSheetProps> = ({
|
|
26
27
|
borderRadius = "1rem",
|
|
@@ -30,6 +31,7 @@ const BottomSheet: React.FC<BottomSheetProps> = ({
|
|
|
30
31
|
paperRef,
|
|
31
32
|
onOutsideClick,
|
|
32
33
|
children,
|
|
34
|
+
className,
|
|
33
35
|
}) => {
|
|
34
36
|
const activity = useNullableActivity();
|
|
35
37
|
const { pop } = useActions();
|
|
@@ -80,9 +82,12 @@ const BottomSheet: React.FC<BottomSheetProps> = ({
|
|
|
80
82
|
|
|
81
83
|
return (
|
|
82
84
|
<div
|
|
83
|
-
className={
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
className={clsx(
|
|
86
|
+
css.container({
|
|
87
|
+
transitionState: useLazy(transitionState),
|
|
88
|
+
}),
|
|
89
|
+
className,
|
|
90
|
+
)}
|
|
86
91
|
ref={containerRef}
|
|
87
92
|
style={assignInlineVars(
|
|
88
93
|
compactMap({
|
package/src/components/Modal.tsx
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { useActions } from "@stackflow/react";
|
|
2
|
-
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
3
|
-
import { useRef } from "react";
|
|
4
|
-
|
|
5
2
|
import {
|
|
6
3
|
useLazy,
|
|
7
4
|
useNullableActivity,
|
|
@@ -9,6 +6,9 @@ import {
|
|
|
9
6
|
useStyleEffect,
|
|
10
7
|
useZIndexBase,
|
|
11
8
|
} from "@stackflow/react-ui-core";
|
|
9
|
+
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
10
|
+
import clsx from "clsx";
|
|
11
|
+
import { useRef } from "react";
|
|
12
12
|
import type { GlobalVars } from "../basicUIPlugin.css";
|
|
13
13
|
import { globalVars } from "../basicUIPlugin.css";
|
|
14
14
|
import { compactMap } from "../utils";
|
|
@@ -20,6 +20,7 @@ export type ModalProps = Partial<
|
|
|
20
20
|
Partial<GlobalVars["modal"]> & {
|
|
21
21
|
onOutsideClick?: React.MouseEventHandler;
|
|
22
22
|
children: React.ReactNode;
|
|
23
|
+
className?: string;
|
|
23
24
|
};
|
|
24
25
|
const Modal: React.FC<ModalProps> = ({
|
|
25
26
|
backgroundColor,
|
|
@@ -29,6 +30,7 @@ const Modal: React.FC<ModalProps> = ({
|
|
|
29
30
|
maxWidth,
|
|
30
31
|
onOutsideClick,
|
|
31
32
|
children,
|
|
33
|
+
className,
|
|
32
34
|
}) => {
|
|
33
35
|
const activity = useNullableActivity();
|
|
34
36
|
const { pop } = useActions();
|
|
@@ -79,9 +81,12 @@ const Modal: React.FC<ModalProps> = ({
|
|
|
79
81
|
|
|
80
82
|
return (
|
|
81
83
|
<div
|
|
82
|
-
className={
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
className={clsx(
|
|
85
|
+
css.container({
|
|
86
|
+
transitionState: useLazy(transitionState),
|
|
87
|
+
}),
|
|
88
|
+
className,
|
|
89
|
+
)}
|
|
85
90
|
ref={containerRef}
|
|
86
91
|
style={assignInlineVars(
|
|
87
92
|
compactMap({
|
package/src/index.ts
CHANGED
|
@@ -2,15 +2,15 @@ export { IconBack, IconClose } from "./assets";
|
|
|
2
2
|
export { basicUIPlugin } from "./basicUIPlugin";
|
|
3
3
|
export { globalVars as cssVars } from "./basicUIPlugin.css";
|
|
4
4
|
export {
|
|
5
|
-
default as AppScreen,
|
|
6
5
|
AppScreenContext,
|
|
7
6
|
AppScreenProps,
|
|
7
|
+
default as AppScreen,
|
|
8
8
|
useAppScreen,
|
|
9
9
|
} from "./components/AppScreen";
|
|
10
10
|
export { vars as appScreenVars } from "./components/AppScreen.css";
|
|
11
11
|
export {
|
|
12
|
-
default as BottomSheet,
|
|
13
12
|
BottomSheetProps,
|
|
13
|
+
default as BottomSheet,
|
|
14
14
|
} from "./components/BottomSheet";
|
|
15
15
|
export { vars as bottomSheetVars } from "./components/BottomSheet.css";
|
|
16
16
|
export { default as Modal, ModalProps } from "./components/Modal";
|