@seed-design/stackflow 0.0.1-alpha-20250210081704 → 0.0.1-rc.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.
- package/lib/components/AppBar/AppBar.d.ts +3 -3
- package/lib/components/AppScreen/AppScreen.d.ts +2 -2
- package/lib/index.js +10 -10
- package/lib/index.js.map +2 -2
- package/lib/index.mjs +3 -3
- package/lib/index.mjs.map +1 -1
- package/package.json +4 -5
- package/src/components/AppBar/AppBar.tsx +2 -2
- package/src/components/AppScreen/AppScreen.tsx +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type PrimitiveProps } from "@seed-design/react-primitive";
|
|
2
|
-
import { type AppBarVariantProps } from "@seed-design/
|
|
2
|
+
import { type AppBarVariantProps } from "@seed-design/css/recipes/app-bar";
|
|
3
3
|
import { AppBar as AppBarPrimitive } from "../../primitive";
|
|
4
|
-
import { type AppBarMainVariantProps } from "@seed-design/
|
|
4
|
+
import { type AppBarMainVariantProps } from "@seed-design/css/recipes/app-bar-main";
|
|
5
5
|
export declare const AppBarPropsProvider: ({ children, value }: {
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
-
value: Partial<import("@seed-design/
|
|
7
|
+
value: Partial<import("@seed-design/css/recipes/app-bar").AppBarVariant>;
|
|
8
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export interface AppBarProps extends AppBarVariantProps, AppBarPrimitive.RootProps {
|
|
10
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type AppScreenVariantProps } from "@seed-design/
|
|
1
|
+
import { type AppScreenVariantProps } from "@seed-design/css/recipes/app-screen";
|
|
2
2
|
import { AppScreen as AppScreenPrimitive } from "../../primitive";
|
|
3
3
|
export declare const AppScreenPropsProvider: ({ children, value }: {
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
-
value: Partial<import("@seed-design/
|
|
5
|
+
value: Partial<import("@seed-design/css/recipes/app-screen").AppScreenVariant>;
|
|
6
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export interface AppScreenRootProps extends AppScreenVariantProps, AppScreenPrimitive.RootProps {
|
|
8
8
|
}
|
package/lib/index.js
CHANGED
|
@@ -49,7 +49,7 @@ __export(index_exports, {
|
|
|
49
49
|
module.exports = __toCommonJS(index_exports);
|
|
50
50
|
|
|
51
51
|
// src/components/AppScreen/AppScreen.tsx
|
|
52
|
-
var
|
|
52
|
+
var import_app_screen = require("@seed-design/css/recipes/app-screen");
|
|
53
53
|
var import_react15 = require("react");
|
|
54
54
|
|
|
55
55
|
// src/primitive/index.tsx
|
|
@@ -636,22 +636,22 @@ function createStyleContext(recipe) {
|
|
|
636
636
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
637
637
|
var import_dom_utils6 = require("@seed-design/dom-utils");
|
|
638
638
|
var import_react_primitive4 = require("@seed-design/react-primitive");
|
|
639
|
-
var
|
|
639
|
+
var import_app_bar = require("@seed-design/css/recipes/app-bar");
|
|
640
640
|
var import_clsx2 = __toESM(require("clsx"));
|
|
641
641
|
var import_react14 = require("react");
|
|
642
|
-
var
|
|
642
|
+
var import_app_bar_main = require("@seed-design/css/recipes/app-bar-main");
|
|
643
643
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
644
|
-
var { PropsProvider, ClassNamesProvider, useProps, withContext, useClassNames } = createStyleContext(
|
|
644
|
+
var { PropsProvider, ClassNamesProvider, useProps, withContext, useClassNames } = createStyleContext(import_app_bar.appBar);
|
|
645
645
|
var {
|
|
646
646
|
PropsProvider: MainPropsProvider,
|
|
647
647
|
withProvider: withMainProvider,
|
|
648
648
|
withContext: withMainContext
|
|
649
|
-
} = createStyleContext(
|
|
649
|
+
} = createStyleContext(import_app_bar_main.appBarMain);
|
|
650
650
|
var AppBarPropsProvider = PropsProvider;
|
|
651
651
|
var AppBarRoot2 = (0, import_react14.forwardRef)((props, ref) => {
|
|
652
652
|
const contextProps = useProps();
|
|
653
|
-
const [variantProps, otherProps] =
|
|
654
|
-
const classNames = (0,
|
|
653
|
+
const [variantProps, otherProps] = import_app_bar.appBar.splitVariantProps({ ...contextProps, ...props });
|
|
654
|
+
const classNames = (0, import_app_bar.appBar)(variantProps);
|
|
655
655
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
656
656
|
MainPropsProvider,
|
|
657
657
|
{
|
|
@@ -712,14 +712,14 @@ AppBarIconButton.displayName = "IconButton";
|
|
|
712
712
|
// src/components/AppScreen/AppScreen.tsx
|
|
713
713
|
var import_dom_utils7 = require("@seed-design/dom-utils");
|
|
714
714
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
715
|
-
var { ClassNamesProvider: ClassNamesProvider2, PropsProvider: PropsProvider2, withContext: withContext2, useProps: useProps2 } = createStyleContext(
|
|
715
|
+
var { ClassNamesProvider: ClassNamesProvider2, PropsProvider: PropsProvider2, withContext: withContext2, useProps: useProps2 } = createStyleContext(import_app_screen.appScreen);
|
|
716
716
|
var AppScreenPropsProvider = PropsProvider2;
|
|
717
717
|
var AppScreenRoot2 = (0, import_react15.forwardRef)((props, ref) => {
|
|
718
718
|
var _a;
|
|
719
719
|
const contextProps = useProps2();
|
|
720
|
-
const [variantProps, otherProps] =
|
|
720
|
+
const [variantProps, otherProps] = import_app_screen.appScreen.splitVariantProps({ ...contextProps, ...props });
|
|
721
721
|
const transitionStyle = (_a = variantProps.transitionStyle) != null ? _a : variantProps.theme === "cupertino" ? "slideFromRightIOS" : "fadeFromBottomAndroid";
|
|
722
|
-
const classNames = (0,
|
|
722
|
+
const classNames = (0, import_app_screen.appScreen)({
|
|
723
723
|
...variantProps,
|
|
724
724
|
transitionStyle
|
|
725
725
|
});
|
package/lib/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/components/AppScreen/AppScreen.tsx", "../src/primitive/index.tsx", "../src/primitive/AppScreen/AppScreen.tsx", "../src/primitive/AppScreen/useAppScreen.tsx", "../src/primitive/GlobalInteraction/useSwipeBack.ts", "../src/primitive/GlobalInteraction/useGlobalInteractionContext.tsx", "../src/primitive/AppScreen/useAppScreenContext.ts", "../src/primitive/AppScreen/AppScreen.namespace.ts", "../src/primitive/AppBar/AppBar.tsx", "../src/primitive/AppBar/useAppBar.tsx", "../src/primitive/private/useElementOffset.ts", "../src/primitive/AppBar/useAppBarContext.ts", "../src/primitive/AppBar/AppBar.namespace.ts", "../src/primitive/GlobalInteraction/GlobalInteraction.tsx", "../src/primitive/GlobalInteraction/useGlobalInteraction.ts", "../src/primitive/private/useTopActivity.ts", "../src/utils/createStyleContext.tsx", "../src/components/AppBar/AppBar.tsx", "../src/plugin.tsx", "../src/components/AppBar/AppBar.namespace.ts", "../src/components/AppScreen/AppScreen.namespace.ts"],
|
|
4
|
-
"sourcesContent": ["export { seedPlugin, type SeedPluginOptions } from \"./plugin\";\n\nexport * from \"./components\";\nexport * as Primitive from \"./primitive\";\n", "import { appScreen, type AppScreenVariantProps } from \"@seed-design/recipe/appScreen\";\nimport { forwardRef, useMemo } from \"react\";\nimport { AppScreen as AppScreenPrimitive } from \"../../primitive\";\nimport { createStyleContext } from \"../../utils/createStyleContext\";\nimport { AppBarPropsProvider } from \"../AppBar/AppBar\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\n\nconst { ClassNamesProvider, PropsProvider, withContext, useProps } = createStyleContext(appScreen);\n\nexport const AppScreenPropsProvider = PropsProvider;\n\nexport interface AppScreenRootProps extends AppScreenVariantProps, AppScreenPrimitive.RootProps {}\n\nexport const AppScreenRoot = forwardRef<HTMLDivElement, AppScreenRootProps>((props, ref) => {\n const contextProps = useProps();\n const [variantProps, otherProps] = appScreen.splitVariantProps({ ...contextProps, ...props });\n\n // TODO: we have to implement conditional default in recipe; this is temporal workaround.\n const transitionStyle =\n variantProps.transitionStyle ??\n (variantProps.theme === \"cupertino\" ? \"slideFromRightIOS\" : \"fadeFromBottomAndroid\");\n\n const classNames = appScreen({\n ...variantProps,\n transitionStyle,\n });\n\n return (\n <ClassNamesProvider value={classNames}>\n <AppBarPropsProvider\n value={useMemo(\n () => ({ theme: variantProps.theme, transitionStyle }),\n [variantProps.theme, transitionStyle],\n )}\n >\n <AppScreenPrimitive.Root\n ref={ref}\n {...mergeProps({ className: classNames.root }, otherProps)}\n />\n </AppBarPropsProvider>\n </ClassNamesProvider>\n );\n});\nAppScreenRoot.displayName = \"AppScreenRoot\";\n\nexport interface AppScreenDimProps extends AppScreenPrimitive.DimProps {}\n\nexport const AppScreenDim = withContext<HTMLDivElement, AppScreenDimProps>(\n AppScreenPrimitive.Dim,\n \"dim\",\n);\n\nexport interface AppScreenEdgeProps extends AppScreenPrimitive.EdgeProps {}\n\nexport const AppScreenEdge = withContext<HTMLDivElement, AppScreenEdgeProps>(\n AppScreenPrimitive.Edge,\n \"edge\",\n);\n\nexport interface AppScreenLayerProps extends AppScreenPrimitive.LayerProps {}\n\nexport const AppScreenLayer = withContext<HTMLDivElement, AppScreenLayerProps>(\n AppScreenPrimitive.Layer,\n \"layer\",\n);\n", "export * from \"./AppScreen\";\nexport * from \"./AppBar\";\nexport * from \"./GlobalInteraction\";\n", "import { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useAppScreen, type UseAppScreenProps } from \"./useAppScreen\";\nimport { AppScreenProvider, useAppScreenContext } from \"./useAppScreenContext\";\n\nexport interface AppScreenRootProps\n extends PrimitiveProps,\n UseAppScreenProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenRoot = forwardRef<HTMLDivElement, AppScreenRootProps>((props, ref) => {\n const {\n swipeBackDisplacementRatioThreshold,\n swipeBackVelocityThreshold,\n onSwipeBackEnd,\n onSwipeBackMove,\n onSwipeBackStart,\n ...otherProps\n } = props;\n const api = useAppScreen({\n swipeBackDisplacementRatioThreshold,\n swipeBackVelocityThreshold,\n onSwipeBackEnd,\n onSwipeBackMove,\n onSwipeBackStart,\n });\n\n return (\n <AppScreenProvider value={api}>\n <Primitive.div\n ref={ref}\n data-stackflow-component-name=\"AppScreen\"\n {...mergeProps(api.activityProps, otherProps)}\n />\n </AppScreenProvider>\n );\n});\nAppScreenRoot.displayName = \"AppScreenRoot\";\n\nexport interface AppScreenDimProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenDim = forwardRef<HTMLDivElement, AppScreenDimProps>((props, ref) => {\n const { dimProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(dimProps, props)} />;\n});\nAppScreenDim.displayName = \"AppScreenDim\";\n\nexport interface AppScreenEdgeProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenEdge = forwardRef<HTMLDivElement, AppScreenEdgeProps>((props, ref) => {\n const { edgeProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(edgeProps, props)} />;\n});\nAppScreenEdge.displayName = \"AppScreenEdge\";\n\nexport interface AppScreenLayerProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenLayer = forwardRef<HTMLDivElement, AppScreenLayerProps>((props, ref) => {\n const { layerProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(layerProps, props)} />;\n});\nAppScreenLayer.displayName = \"AppScreenLayer\";\n", "import { dataAttr, elementProps } from \"@seed-design/dom-utils\";\nimport { useNullableActivity, useZIndexBase } from \"@stackflow/react-ui-core\";\nimport { useMemo } from \"react\";\nimport { type UseSwipeBackProps, useSwipeBack } from \"../GlobalInteraction/useSwipeBack\";\n\nexport interface UseAppScreenProps extends UseSwipeBackProps {}\n\nexport type UseAppScreenReturn = ReturnType<typeof useAppScreen>;\n\nexport function useAppScreen(props: UseAppScreenProps) {\n const activity = useNullableActivity();\n\n const transitionState = activity?.transitionState ?? \"enter-done\";\n\n const { activityProps, layerProps, edgeProps } = useSwipeBack(props);\n\n const zIndexBase = useZIndexBase();\n const zIndexStyle = useMemo(\n () =>\n ({\n \"--z-index-base\": zIndexBase.toString(),\n }) as React.CSSProperties,\n [zIndexBase],\n );\n\n const stateProps = useMemo(\n () => ({\n \"data-activity-is-top\": dataAttr(activity?.isTop),\n \"data-activity-is-active\": dataAttr(activity?.isActive),\n \"data-transition-state\": transitionState,\n }),\n [transitionState, activity?.isActive, activity?.isTop],\n ) as React.HTMLAttributes<HTMLElement>;\n\n return useMemo(\n () => ({\n activity,\n stateProps,\n activityProps: elementProps({\n \"data-part\": \"activity\",\n \"data-activity-type\": \"full-screen\",\n ...activityProps,\n ...stateProps,\n \"data-activity-id\": activity?.id,\n style: zIndexStyle,\n // FIXME: @stackflow/react should prevent activity.id hydration mismatch; this is temporal fix.\n suppressHydrationWarning: true,\n }),\n dimProps: elementProps({\n \"data-part\": \"dim\",\n ...stateProps,\n }),\n layerProps: elementProps({\n \"data-part\": \"layer\",\n ...stateProps,\n ...layerProps,\n }),\n edgeProps: elementProps({\n \"data-part\": \"edge\",\n \"aria-hidden\": true,\n tabIndex: -1,\n ...edgeProps,\n ...stateProps,\n }),\n }),\n [activity, zIndexStyle, stateProps, activityProps, edgeProps, layerProps],\n );\n}\n", "import { useEffect, useMemo } from \"react\";\nimport type { SwipeBackProps } from \"./useGlobalInteraction\";\nimport { useGlobalInteractionContext } from \"./useGlobalInteractionContext\";\n\nexport interface UseSwipeBackProps extends SwipeBackProps {}\n\nexport function useSwipeBack(props: UseSwipeBackProps) {\n const globalInteraction = useGlobalInteractionContext();\n const events = globalInteraction.getSwipeBackEvents(props);\n\n useEffect(() => {\n return () => {\n events.reset();\n };\n }, [events]);\n\n return useMemo(\n () => ({\n activityProps: {\n \"data-swipe-back\": \"\",\n } as React.HTMLAttributes<HTMLDivElement>,\n layerProps: {\n onTransitionEnd: (e) => {\n if (e.target === e.currentTarget) {\n events.reset();\n }\n },\n onAnimationEnd: (e) => {\n if (e.target === e.currentTarget) {\n events.reset();\n }\n },\n } as React.HTMLAttributes<HTMLDivElement>,\n edgeProps: {\n tabIndex: -1,\n onTouchStart: (e) => {\n const x0 = e.touches[0].clientX;\n const t0 = Date.now();\n events.startSwipeBack({ x0, t0 });\n },\n onTouchMove: (e) => {\n const x = e.touches[0].clientX;\n const t = Date.now();\n events.moveSwipeBack({ x, t });\n },\n onTouchEnd: () => {\n events.endSwipeBack({});\n },\n onTouchCancel: () => {\n events.endSwipeBack({});\n },\n } as React.HTMLAttributes<HTMLElement>,\n }),\n [events],\n );\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseGlobalInteractionReturn } from \"./useGlobalInteraction\";\n\nexport interface UseGlobalInteractionContext extends UseGlobalInteractionReturn {}\n\nconst GlobalInteractionContext = createContext<UseGlobalInteractionContext | null>(null);\n\nexport const GlobalInteractionProvider = GlobalInteractionContext.Provider;\n\nexport function useGlobalInteractionContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false\n ? UseGlobalInteractionContext | null\n : UseGlobalInteractionContext {\n const context = useContext(GlobalInteractionContext);\n if (!context && strict) {\n throw new Error(\"useGlobalInteractionContext must be used within a GlobalInteractionProvider\");\n }\n\n return context as UseGlobalInteractionContext;\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseAppScreenReturn } from \"./useAppScreen\";\n\nexport interface UseAppScreenContext extends UseAppScreenReturn {}\n\nconst AppScreenContext = createContext<UseAppScreenContext | null>(null);\n\nexport const AppScreenProvider = AppScreenContext.Provider;\n\nexport function useAppScreenContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false ? UseAppScreenContext | null : UseAppScreenContext {\n const context = useContext(AppScreenContext);\n if (!context && strict) {\n throw new Error(\"useAppScreenContext must be used within a AppScreen\");\n }\n\n return context as UseAppScreenContext;\n}\n", "export {\n AppScreenDim as Dim,\n AppScreenEdge as Edge,\n AppScreenLayer as Layer,\n AppScreenRoot as Root,\n type AppScreenDimProps as DimProps,\n type AppScreenEdgeProps as EdgeProps,\n type AppScreenLayerProps as LayerProps,\n type AppScreenRootProps as RootProps,\n} from \"./AppScreen\";\n", "import { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useAppBar, type UseAppBarProps } from \"./useAppBar\";\nimport { AppBarProvider, useAppBarContext } from \"./useAppBarContext\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\n\nexport interface AppBarRootProps\n extends PrimitiveProps,\n UseAppBarProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarRoot = forwardRef<HTMLDivElement, AppBarRootProps>((props, ref) => {\n const { ...otherProps } = props;\n const api = useAppBar({});\n\n return (\n <AppBarProvider value={api}>\n <Primitive.div\n ref={composeRefs(api.refs.root, ref)}\n {...mergeProps(api.rootProps, otherProps)}\n />\n </AppBarProvider>\n );\n});\nAppBarRoot.displayName = \"AppBarRoot\";\n\nexport interface AppBarLeftProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarLeft = forwardRef<HTMLDivElement, AppBarLeftProps>((props, ref) => {\n const { refs, stateProps } = useAppBarContext();\n\n return <Primitive.div ref={composeRefs(refs.left, ref)} {...mergeProps(stateProps, props)} />;\n});\nAppBarLeft.displayName = \"AppBarLeft\";\n\nexport interface AppBarRightProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarRight = forwardRef<HTMLDivElement, AppBarRightProps>((props, ref) => {\n const { refs, stateProps } = useAppBarContext();\n\n return <Primitive.div ref={composeRefs(refs.right, ref)} {...mergeProps(stateProps, props)} />;\n});\nAppBarRight.displayName = \"AppBarRight\";\n\nexport interface AppBarMainProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarMain = forwardRef<HTMLDivElement, AppBarMainProps>((props, ref) => {\n const { stateProps } = useAppBarContext();\n\n return <Primitive.div ref={ref} {...mergeProps(stateProps, props)} />;\n});\n", "import { elementProps } from \"@seed-design/dom-utils\";\nimport { useMemo, useState } from \"react\";\nimport { useAppScreenContext } from \"../AppScreen\";\nimport { useElementOffset } from \"../private/useElementOffset\";\n\n// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty for future extension\nexport interface UseAppBarProps {}\n\nexport type UseAppBarReturn = ReturnType<typeof useAppBar>;\n\nexport function useAppBar(_props: UseAppBarProps) {\n const { stateProps } = useAppScreenContext();\n\n const [root, rootRef] = useState<HTMLElement | null>(null);\n const [left, leftRef] = useState<HTMLElement | null>(null);\n const [right, rightRef] = useState<HTMLElement | null>(null);\n\n const leftOffset = useElementOffset(left);\n const rightOffset = useElementOffset(right);\n const centeredTitlePaddingX = root\n ? `${Math.max(leftOffset?.fromLeft ?? 0, rightOffset?.fromRight ?? 0)}px`\n : \"initial\";\n\n return useMemo(\n () => ({\n refs: {\n root: rootRef,\n left: leftRef,\n right: rightRef,\n },\n stateProps,\n rootProps: elementProps({\n \"data-part\": \"appBar\",\n ...stateProps,\n style: {\n \"--centered-title-padding-x\": centeredTitlePaddingX,\n } as React.CSSProperties,\n }),\n }),\n [stateProps, centeredTitlePaddingX],\n );\n}\n", "import * as React from \"react\";\n\nconst useLayoutEffect = typeof window !== \"undefined\" ? React.useLayoutEffect : React.useEffect;\n\nexport function useElementOffset(element: HTMLElement | null) {\n const [offset, setOffset] = React.useState<{ fromLeft: number; fromRight: number } | undefined>(\n undefined,\n );\n\n useLayoutEffect(() => {\n if (!element) {\n setOffset(undefined);\n return;\n }\n\n if (element) {\n // provide as early as possible\n setOffset({\n fromLeft: element.offsetLeft + element.offsetWidth,\n fromRight: (element.offsetParent ?? document.body).clientWidth - element.offsetLeft,\n });\n\n const resizeObserver = new ResizeObserver(() => {\n const fromLeft = element.offsetLeft + element.offsetWidth;\n const fromRight = (element.offsetParent ?? document.body).clientWidth - element.offsetLeft;\n\n setOffset({ fromLeft, fromRight });\n });\n\n resizeObserver.observe(element);\n\n return () => resizeObserver.unobserve(element);\n }\n }, [element]);\n\n return offset;\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseAppBarReturn } from \"./useAppBar\";\n\nexport interface UseAppBarContext extends UseAppBarReturn {}\n\nconst AppBarContext = createContext<UseAppBarContext | null>(null);\n\nexport const AppBarProvider = AppBarContext.Provider;\n\nexport function useAppBarContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false ? UseAppBarContext | null : UseAppBarContext {\n const context = useContext(AppBarContext);\n if (!context && strict) {\n throw new Error(\"useAppBarContext must be used within a AppBar\");\n }\n\n return context as UseAppBarContext;\n}\n", "export {\n AppBarRoot as Root,\n AppBarMain as Main,\n AppBarLeft as Left,\n AppBarRight as Right,\n type AppBarRootProps as RootProps,\n type AppBarMainProps as MainProps,\n type AppBarLeftProps as LeftProps,\n type AppBarRightProps as RightProps,\n} from \"./AppBar\";\n", "import { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useGlobalInteraction } from \"./useGlobalInteraction\";\nimport { GlobalInteractionProvider } from \"./useGlobalInteractionContext\";\n\nexport interface GlobalInteractionProps\n extends PrimitiveProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const GlobalInteraction = forwardRef<HTMLDivElement, GlobalInteractionProps>(\n (props, ref) => {\n const api = useGlobalInteraction();\n return (\n <GlobalInteractionProvider value={api}>\n <Primitive.div\n ref={composeRefs(api.stackRef, ref)}\n {...mergeProps(api.stackProps, props)}\n />\n </GlobalInteractionProvider>\n );\n },\n);\nGlobalInteraction.displayName = \"GlobalInteraction\";\n", "import { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport { useTopActivity } from \"../private/useTopActivity\";\n\nexport type SwipeBackState = \"idle\" | \"swiping\" | \"transitioning\";\n\nexport type UseGlobalInteractionReturn = ReturnType<typeof useGlobalInteraction>;\n\nexport interface SwipeBackContext {\n x0: number;\n t0: number;\n displacement: number;\n displacementRatio: number;\n velocity: number;\n}\n\nexport interface SwipeBackProps {\n /**\n * The threshold to determine whether the swipe back is intentional.\n * @default 0.4\n */\n swipeBackDisplacementRatioThreshold?: number;\n\n /**\n * The threshold to determine whether the swipe back is intentional.\n * @default 1\n */\n swipeBackVelocityThreshold?: number;\n\n onSwipeBackStart?: () => void;\n onSwipeBackMove?: (props: { displacement: number; displacementRatio: number }) => void;\n onSwipeBackEnd?: (props: { swiped: boolean }) => void;\n}\n\nexport interface StartSwipeBackProps {\n x0: number;\n t0: number;\n}\n\nexport interface MoveSwipeBackProps {\n x: number;\n t: number;\n}\n\n// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty for future extension\nexport interface EndSwipeBackProps {}\n\nexport function useGlobalInteraction() {\n const [swipeBackState, setSwipeBackState] = useState<SwipeBackState>(\"idle\");\n\n const swipeBackContextRef = useRef<SwipeBackContext>({\n x0: 0,\n t0: 0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n const stackRef = useRef<HTMLDivElement>(null);\n\n const setSwipeBackContext = useCallback((ctx: SwipeBackContext) => {\n swipeBackContextRef.current = ctx;\n stackRef.current?.style.setProperty(\n \"--swipe-back-displacement\",\n `${ctx.displacement.toString()}px`,\n );\n stackRef.current?.style.setProperty(\n \"--swipe-back-displacement-ratio\",\n ctx.displacementRatio.toString(),\n );\n }, []);\n\n const getSwipeBackEvents = useCallback(\n (props: SwipeBackProps) => {\n const {\n swipeBackDisplacementRatioThreshold: displacementRatioThreshold = 0.4,\n swipeBackVelocityThreshold: velocityThreshold = 1,\n } = props;\n const onSwipeStart = useCallbackRef(props.onSwipeBackStart);\n const onSwipeMove = useCallbackRef(props.onSwipeBackMove);\n const onSwipeEnd = useCallbackRef(props.onSwipeBackEnd);\n\n const startSwipeBack = useCallback(\n ({ x0, t0 }: StartSwipeBackProps) => {\n setSwipeBackContext({\n x0,\n t0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n setSwipeBackState(\"swiping\");\n\n onSwipeStart?.();\n },\n [onSwipeStart],\n );\n\n const moveSwipeBack = useCallback(\n ({ x, t }: MoveSwipeBackProps) => {\n const displacement = x - swipeBackContextRef.current.x0;\n const displacementRatio = displacement / window.innerWidth;\n const velocity = displacement / (t - swipeBackContextRef.current.t0);\n setSwipeBackContext({\n ...swipeBackContextRef.current,\n displacement,\n displacementRatio,\n velocity,\n });\n setSwipeBackState(\"swiping\");\n\n onSwipeMove?.({ displacement, displacementRatio });\n },\n [onSwipeMove],\n );\n\n const endSwipeBack = useCallback(\n (_: EndSwipeBackProps) => {\n const swiped =\n swipeBackContextRef.current.displacementRatio > displacementRatioThreshold ||\n swipeBackContextRef.current.velocity > velocityThreshold;\n\n // we intentionally do not reset context here, so that the displacement can be used for exit animation\n setSwipeBackState(\"transitioning\");\n\n onSwipeEnd?.({ swiped });\n },\n [onSwipeEnd, displacementRatioThreshold, velocityThreshold],\n );\n\n const reset = useCallback(() => {\n setSwipeBackContext({\n x0: 0,\n t0: 0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n setSwipeBackState(\"idle\");\n }, []);\n\n return useMemo(\n () => ({\n startSwipeBack,\n moveSwipeBack,\n endSwipeBack,\n reset,\n }),\n [startSwipeBack, moveSwipeBack, endSwipeBack, reset],\n );\n },\n [setSwipeBackContext],\n );\n\n const topActivity = useTopActivity();\n\n const stackProps = useMemo(\n () => ({\n \"data-swipe-back-state\": swipeBackState,\n \"data-global-transition-state\": topActivity.transitionState,\n \"data-top-activity-type\": topActivity.activityType,\n }),\n [swipeBackState, topActivity.transitionState, topActivity.activityType],\n ) as React.HTMLAttributes<HTMLElement>;\n\n return useMemo(\n () => ({\n stackRef,\n swipeBackContextRef,\n swipeBackState,\n setSwipeBackState,\n setSwipeBackContext,\n getSwipeBackEvents,\n\n stackProps,\n }),\n [swipeBackState, setSwipeBackContext, getSwipeBackEvents, stackProps],\n );\n}\n", "import { useStack } from \"@stackflow/react\";\nimport { useEffect, useState } from \"react\";\n\nexport function useTopActivity() {\n const stack = useStack();\n if (!stack) {\n throw new Error(\n \"useStack is not available in the context. Make sure you are using @stackflow/react >= 1.4.1. (https://github.com/daangn/stackflow/blob/main/integrations/react/CHANGELOG.md#141)\",\n );\n }\n\n const topId = stack.activities.find((activity) => activity.isTop)?.id;\n const topActivity = stack.activities.find((activity) => activity.isTop);\n const transitionState = topActivity?.transitionState ?? \"enter-done\";\n\n // TODO: There should be a better way to handle this. We should not rely on the DOM element to get the activity type.\n const [topEl, setTopEl] = useState<HTMLElement | null>(null);\n const activityType = topEl?.dataset[\"activityType\"];\n\n useEffect(() => {\n if (!topId) return;\n\n const el = document.querySelector<HTMLElement>(`[data-activity-id=\"${topId}\"]`);\n setTopEl(el);\n }, [topId]);\n\n return {\n transitionState,\n activityType,\n };\n}\n", "import clsx from \"clsx\";\nimport { createContext, forwardRef, useContext } from \"react\";\n\ntype Recipe<\n Props extends Record<string, string | boolean | undefined>,\n Classnames extends Record<string, string>,\n> = ((props?: Props) => Classnames) & {\n splitVariantProps: <T extends Props>(props: T) => [Props, Omit<T, keyof Props>];\n};\n\nexport function createStyleContext<\n Props extends Record<string, string | boolean | undefined>,\n Classnames extends Record<string, string>,\n>(recipe: Recipe<Props, Classnames>) {\n const ClassNamesContext = createContext<Classnames | null>(null);\n const PropsContext = createContext<Props | null>(null);\n\n const ClassNamesProvider = ({\n children,\n value,\n }: { children: React.ReactNode; value: Classnames }) => {\n return <ClassNamesContext.Provider value={value}>{children}</ClassNamesContext.Provider>;\n };\n\n const PropsProvider = ({ children, value }: { children: React.ReactNode; value: Props }) => {\n return <PropsContext.Provider value={value}>{children}</PropsContext.Provider>;\n };\n\n function useClassNames() {\n const context = useContext(ClassNamesContext);\n if (context === null) {\n throw new Error(\n \"useClassNames must be used within a ClassNamesProvider. Did you forget to wrap your component in a ClassNamesProvider?\",\n );\n }\n\n return context;\n }\n\n function useProps() {\n return useContext(PropsContext);\n }\n\n const withRootProvider = <P,>(\n Component: React.ElementType<any>,\n options?: {\n defaultProps?: Partial<P>;\n },\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P>> => {\n const { defaultProps } = options ?? {};\n\n const StyledComponent = (innerProps: any) => {\n const props = { ...(defaultProps ?? {}), ...useProps(), ...innerProps } as Props &\n React.HTMLAttributes<HTMLElement>;\n const [variantProps, otherProps] = recipe.splitVariantProps(props);\n const classNames = recipe(variantProps); // TODO: should we memoize this?\n\n return (\n <ClassNamesProvider value={classNames}>\n <Component {...otherProps} />\n </ClassNamesProvider>\n );\n };\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n\n return StyledComponent as any;\n };\n\n const withProvider = <T, P>(\n Component: React.ElementType<any>,\n slot: keyof Classnames,\n options?: {\n defaultProps?: Partial<P>;\n },\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>> => {\n const { defaultProps } = options ?? {};\n\n const StyledComponent = forwardRef<any, any>((innerProps, ref) => {\n const props = { ...(defaultProps ?? {}), ...useProps(), ...innerProps } as Props &\n React.HTMLAttributes<HTMLElement>;\n const [variantProps, otherProps] = recipe.splitVariantProps(props);\n const classNames = recipe(variantProps); // TODO: should we memoize this?\n const className = classNames[slot as keyof typeof classNames];\n\n return (\n <ClassNamesProvider value={classNames}>\n <Component ref={ref} {...otherProps} className={clsx(className, props.className)} />\n </ClassNamesProvider>\n );\n });\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n\n return StyledComponent as any;\n };\n\n const withContext = <T, P>(\n Component: React.ElementType<any>,\n slot?: keyof Classnames,\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>> => {\n const StyledComponent = forwardRef<any, React.HTMLAttributes<HTMLElement>>((props, ref) => {\n const classNames = useClassNames();\n const className = classNames?.[slot as keyof typeof classNames];\n\n return <Component ref={ref} {...props} className={clsx(className, props.className)} />;\n });\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n return StyledComponent as any;\n };\n\n return {\n ClassNamesProvider,\n PropsProvider,\n useClassNames,\n useProps,\n withRootProvider,\n withProvider,\n withContext,\n };\n}\n", "import { Slot } from \"@radix-ui/react-slot\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { type AppBarVariantProps, appBar } from \"@seed-design/recipe/appBar\";\nimport clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport { AppBar as AppBarPrimitive } from \"../../primitive\";\nimport { useAppBarContext } from \"../../primitive/AppBar/useAppBarContext\";\nimport { createStyleContext } from \"../../utils/createStyleContext\";\nimport { appBarMain, type AppBarMainVariantProps } from \"@seed-design/recipe/appBarMain\";\n\nconst { PropsProvider, ClassNamesProvider, useProps, withContext, useClassNames } =\n createStyleContext(appBar);\nconst {\n PropsProvider: MainPropsProvider,\n withProvider: withMainProvider,\n withContext: withMainContext,\n} = createStyleContext(appBarMain);\n\nexport const AppBarPropsProvider = PropsProvider;\n\nexport interface AppBarProps extends AppBarVariantProps, AppBarPrimitive.RootProps {}\n\nexport const AppBarRoot = forwardRef<HTMLDivElement, AppBarProps>((props, ref) => {\n const contextProps = useProps();\n const [variantProps, otherProps] = appBar.splitVariantProps({ ...contextProps, ...props });\n\n const classNames = appBar(variantProps);\n\n return (\n <ClassNamesProvider value={classNames}>\n <MainPropsProvider\n value={{\n theme: variantProps.theme,\n transitionStyle: variantProps.transitionStyle,\n tone: variantProps.tone,\n }}\n >\n <AppBarPrimitive.Root\n ref={ref}\n {...mergeProps({ className: classNames.root }, otherProps)}\n />\n </MainPropsProvider>\n </ClassNamesProvider>\n );\n});\nAppBarRoot.displayName = \"AppBarRoot\";\n\nexport interface AppBarLeftProps extends AppBarPrimitive.LeftProps {}\n\nexport const AppBarLeft = withContext<HTMLDivElement, AppBarLeftProps>(\n AppBarPrimitive.Left,\n \"left\",\n);\n\nexport interface AppBarRightProps extends AppBarPrimitive.RightProps {}\n\nexport const AppBarRight = withContext<HTMLDivElement, AppBarRightProps>(\n AppBarPrimitive.Right,\n \"right\",\n);\n\nexport interface AppBarMainProps extends AppBarMainVariantProps, AppBarPrimitive.MainProps {}\n\nexport const AppBarMain = withMainProvider<HTMLDivElement, AppBarMainProps>(\n AppBarPrimitive.Main,\n \"root\",\n);\n\nexport interface AppBarTitleProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {}\n\nexport const AppBarTitle = withMainContext<HTMLSpanElement, AppBarTitleProps>(\n Primitive.span,\n \"title\",\n);\n\nexport interface AppBarSubtitleProps\n extends PrimitiveProps,\n React.HTMLAttributes<HTMLSpanElement> {}\n\nexport const AppBarSubtitle = withMainContext<HTMLSpanElement, AppBarSubtitleProps>(\n Primitive.span,\n \"subtitle\",\n);\n\nexport interface AppBarIconButtonProps\n extends PrimitiveProps,\n React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AppBarIconButton = forwardRef<HTMLButtonElement, AppBarIconButtonProps>(\n ({ children, className, ...otherProps }, ref) => {\n const { stateProps } = useAppBarContext();\n const classNames = useClassNames();\n\n return (\n <Primitive.button\n ref={ref}\n type=\"button\"\n className={clsx(classNames.iconButton, className)}\n {...mergeProps(stateProps, otherProps)}\n >\n <Slot className={classNames.icon} {...stateProps}>\n {children}\n </Slot>\n </Primitive.button>\n );\n },\n);\nAppBarIconButton.displayName = \"IconButton\";\n", "import type { StackflowReactPlugin } from \"@stackflow/react\";\nimport { AppScreenPropsProvider } from \"./components/AppScreen/AppScreen\";\nimport { GlobalInteraction } from \"./primitive\";\n\nexport interface SeedPluginOptions {\n theme: \"android\" | \"cupertino\";\n}\n\nexport const seedPlugin =\n (options: SeedPluginOptions): StackflowReactPlugin =>\n () => ({\n key: \"seed-design\",\n wrapStack({ stack }) {\n return (\n <AppScreenPropsProvider value={options}>\n <GlobalInteraction>{stack.render()}</GlobalInteraction>\n </AppScreenPropsProvider>\n );\n },\n });\n", "export {\n AppBarIconButton as IconButton,\n AppBarLeft as Left,\n AppBarMain as Main,\n AppBarRight as Right,\n AppBarRoot as Root,\n AppBarSubtitle as Subtitle,\n AppBarTitle as Title,\n} from \"./AppBar\";\n\nexport type {\n AppBarIconButtonProps as IconButtonProps,\n AppBarLeftProps as LeftProps,\n AppBarMainProps as MainProps,\n AppBarRightProps as RightProps,\n AppBarProps as RootProps,\n AppBarSubtitleProps as SubtitleProps,\n AppBarTitleProps as TitleProps,\n} from \"./AppBar\";\n", "export {\n AppScreenDim as Dim,\n AppScreenEdge as Edge,\n AppScreenLayer as Layer,\n AppScreenRoot as Root,\n} from \"./AppScreen\";\n\nexport type {\n AppScreenDimProps as DimProps,\n AppScreenEdgeProps as EdgeProps,\n AppScreenLayerProps as LayerProps,\n AppScreenRootProps as RootProps,\n} from \"./AppScreen\";\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA,oBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,mBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA;AAAA,mBAAAC;AAAA,EAAA,oBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;;;ACAA,uBAAsD;AACtD,IAAAC,iBAAoC;;;ACDpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAC,oBAA2B;AAC3B,6BAA+C;AAC/C,IAAAC,gBAA2B;;;ACF3B,uBAAuC;AACvC,2BAAmD;AACnD,IAAAC,gBAAwB;;;ACFxB,IAAAC,gBAAmC;;;ACAnC,mBAA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eH;AAAA,EAC1B,4BAAmB;AAAA,EACnB;AACF;AAIO,IAAMI,iBAAgBJ;AAAA,EAC3B,4BAAmB;AAAA,EACnB;AACF;AAIO,IAAMK,kBAAiBL;AAAA,EAC5B,4BAAmB;AAAA,EACnB;AACF;;;AkBjDU,IAAAM,sBAAA;AAPH,IAAM,aACX,CAAC,YACD,OAAO;AAAA,EACL,KAAK;AAAA,EACL,UAAU,EAAE,MAAM,GAAG;AACnB,WACE,6CAAC,0BAAuB,OAAO,SAC7B,uDAAC,qBAAmB,gBAAM,OAAO,GAAE,GACrC;AAAA,EAEJ;AACF;;;ACnBF,IAAAC,4BAAA;AAAA,SAAAA,2BAAA;AAAA;AAAA,cAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,IAAAC,+BAAA;AAAA,SAAAA,8BAAA;AAAA,aAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,YAAAC;AAAA;",
|
|
4
|
+
"sourcesContent": ["export { seedPlugin, type SeedPluginOptions } from \"./plugin\";\n\nexport * from \"./components\";\nexport * as Primitive from \"./primitive\";\n", "import { appScreen, type AppScreenVariantProps } from \"@seed-design/css/recipes/app-screen\";\nimport { forwardRef, useMemo } from \"react\";\nimport { AppScreen as AppScreenPrimitive } from \"../../primitive\";\nimport { createStyleContext } from \"../../utils/createStyleContext\";\nimport { AppBarPropsProvider } from \"../AppBar/AppBar\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\n\nconst { ClassNamesProvider, PropsProvider, withContext, useProps } = createStyleContext(appScreen);\n\nexport const AppScreenPropsProvider = PropsProvider;\n\nexport interface AppScreenRootProps extends AppScreenVariantProps, AppScreenPrimitive.RootProps {}\n\nexport const AppScreenRoot = forwardRef<HTMLDivElement, AppScreenRootProps>((props, ref) => {\n const contextProps = useProps();\n const [variantProps, otherProps] = appScreen.splitVariantProps({ ...contextProps, ...props });\n\n // TODO: we have to implement conditional default in recipe; this is temporal workaround.\n const transitionStyle =\n variantProps.transitionStyle ??\n (variantProps.theme === \"cupertino\" ? \"slideFromRightIOS\" : \"fadeFromBottomAndroid\");\n\n const classNames = appScreen({\n ...variantProps,\n transitionStyle,\n });\n\n return (\n <ClassNamesProvider value={classNames}>\n <AppBarPropsProvider\n value={useMemo(\n () => ({ theme: variantProps.theme, transitionStyle }),\n [variantProps.theme, transitionStyle],\n )}\n >\n <AppScreenPrimitive.Root\n ref={ref}\n {...mergeProps({ className: classNames.root }, otherProps)}\n />\n </AppBarPropsProvider>\n </ClassNamesProvider>\n );\n});\nAppScreenRoot.displayName = \"AppScreenRoot\";\n\nexport interface AppScreenDimProps extends AppScreenPrimitive.DimProps {}\n\nexport const AppScreenDim = withContext<HTMLDivElement, AppScreenDimProps>(\n AppScreenPrimitive.Dim,\n \"dim\",\n);\n\nexport interface AppScreenEdgeProps extends AppScreenPrimitive.EdgeProps {}\n\nexport const AppScreenEdge = withContext<HTMLDivElement, AppScreenEdgeProps>(\n AppScreenPrimitive.Edge,\n \"edge\",\n);\n\nexport interface AppScreenLayerProps extends AppScreenPrimitive.LayerProps {}\n\nexport const AppScreenLayer = withContext<HTMLDivElement, AppScreenLayerProps>(\n AppScreenPrimitive.Layer,\n \"layer\",\n);\n", "export * from \"./AppScreen\";\nexport * from \"./AppBar\";\nexport * from \"./GlobalInteraction\";\n", "import { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useAppScreen, type UseAppScreenProps } from \"./useAppScreen\";\nimport { AppScreenProvider, useAppScreenContext } from \"./useAppScreenContext\";\n\nexport interface AppScreenRootProps\n extends PrimitiveProps,\n UseAppScreenProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenRoot = forwardRef<HTMLDivElement, AppScreenRootProps>((props, ref) => {\n const {\n swipeBackDisplacementRatioThreshold,\n swipeBackVelocityThreshold,\n onSwipeBackEnd,\n onSwipeBackMove,\n onSwipeBackStart,\n ...otherProps\n } = props;\n const api = useAppScreen({\n swipeBackDisplacementRatioThreshold,\n swipeBackVelocityThreshold,\n onSwipeBackEnd,\n onSwipeBackMove,\n onSwipeBackStart,\n });\n\n return (\n <AppScreenProvider value={api}>\n <Primitive.div\n ref={ref}\n data-stackflow-component-name=\"AppScreen\"\n {...mergeProps(api.activityProps, otherProps)}\n />\n </AppScreenProvider>\n );\n});\nAppScreenRoot.displayName = \"AppScreenRoot\";\n\nexport interface AppScreenDimProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenDim = forwardRef<HTMLDivElement, AppScreenDimProps>((props, ref) => {\n const { dimProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(dimProps, props)} />;\n});\nAppScreenDim.displayName = \"AppScreenDim\";\n\nexport interface AppScreenEdgeProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenEdge = forwardRef<HTMLDivElement, AppScreenEdgeProps>((props, ref) => {\n const { edgeProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(edgeProps, props)} />;\n});\nAppScreenEdge.displayName = \"AppScreenEdge\";\n\nexport interface AppScreenLayerProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenLayer = forwardRef<HTMLDivElement, AppScreenLayerProps>((props, ref) => {\n const { layerProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(layerProps, props)} />;\n});\nAppScreenLayer.displayName = \"AppScreenLayer\";\n", "import { dataAttr, elementProps } from \"@seed-design/dom-utils\";\nimport { useNullableActivity, useZIndexBase } from \"@stackflow/react-ui-core\";\nimport { useMemo } from \"react\";\nimport { type UseSwipeBackProps, useSwipeBack } from \"../GlobalInteraction/useSwipeBack\";\n\nexport interface UseAppScreenProps extends UseSwipeBackProps {}\n\nexport type UseAppScreenReturn = ReturnType<typeof useAppScreen>;\n\nexport function useAppScreen(props: UseAppScreenProps) {\n const activity = useNullableActivity();\n\n const transitionState = activity?.transitionState ?? \"enter-done\";\n\n const { activityProps, layerProps, edgeProps } = useSwipeBack(props);\n\n const zIndexBase = useZIndexBase();\n const zIndexStyle = useMemo(\n () =>\n ({\n \"--z-index-base\": zIndexBase.toString(),\n }) as React.CSSProperties,\n [zIndexBase],\n );\n\n const stateProps = useMemo(\n () => ({\n \"data-activity-is-top\": dataAttr(activity?.isTop),\n \"data-activity-is-active\": dataAttr(activity?.isActive),\n \"data-transition-state\": transitionState,\n }),\n [transitionState, activity?.isActive, activity?.isTop],\n ) as React.HTMLAttributes<HTMLElement>;\n\n return useMemo(\n () => ({\n activity,\n stateProps,\n activityProps: elementProps({\n \"data-part\": \"activity\",\n \"data-activity-type\": \"full-screen\",\n ...activityProps,\n ...stateProps,\n \"data-activity-id\": activity?.id,\n style: zIndexStyle,\n // FIXME: @stackflow/react should prevent activity.id hydration mismatch; this is temporal fix.\n suppressHydrationWarning: true,\n }),\n dimProps: elementProps({\n \"data-part\": \"dim\",\n ...stateProps,\n }),\n layerProps: elementProps({\n \"data-part\": \"layer\",\n ...stateProps,\n ...layerProps,\n }),\n edgeProps: elementProps({\n \"data-part\": \"edge\",\n \"aria-hidden\": true,\n tabIndex: -1,\n ...edgeProps,\n ...stateProps,\n }),\n }),\n [activity, zIndexStyle, stateProps, activityProps, edgeProps, layerProps],\n );\n}\n", "import { useEffect, useMemo } from \"react\";\nimport type { SwipeBackProps } from \"./useGlobalInteraction\";\nimport { useGlobalInteractionContext } from \"./useGlobalInteractionContext\";\n\nexport interface UseSwipeBackProps extends SwipeBackProps {}\n\nexport function useSwipeBack(props: UseSwipeBackProps) {\n const globalInteraction = useGlobalInteractionContext();\n const events = globalInteraction.getSwipeBackEvents(props);\n\n useEffect(() => {\n return () => {\n events.reset();\n };\n }, [events]);\n\n return useMemo(\n () => ({\n activityProps: {\n \"data-swipe-back\": \"\",\n } as React.HTMLAttributes<HTMLDivElement>,\n layerProps: {\n onTransitionEnd: (e) => {\n if (e.target === e.currentTarget) {\n events.reset();\n }\n },\n onAnimationEnd: (e) => {\n if (e.target === e.currentTarget) {\n events.reset();\n }\n },\n } as React.HTMLAttributes<HTMLDivElement>,\n edgeProps: {\n tabIndex: -1,\n onTouchStart: (e) => {\n const x0 = e.touches[0].clientX;\n const t0 = Date.now();\n events.startSwipeBack({ x0, t0 });\n },\n onTouchMove: (e) => {\n const x = e.touches[0].clientX;\n const t = Date.now();\n events.moveSwipeBack({ x, t });\n },\n onTouchEnd: () => {\n events.endSwipeBack({});\n },\n onTouchCancel: () => {\n events.endSwipeBack({});\n },\n } as React.HTMLAttributes<HTMLElement>,\n }),\n [events],\n );\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseGlobalInteractionReturn } from \"./useGlobalInteraction\";\n\nexport interface UseGlobalInteractionContext extends UseGlobalInteractionReturn {}\n\nconst GlobalInteractionContext = createContext<UseGlobalInteractionContext | null>(null);\n\nexport const GlobalInteractionProvider = GlobalInteractionContext.Provider;\n\nexport function useGlobalInteractionContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false\n ? UseGlobalInteractionContext | null\n : UseGlobalInteractionContext {\n const context = useContext(GlobalInteractionContext);\n if (!context && strict) {\n throw new Error(\"useGlobalInteractionContext must be used within a GlobalInteractionProvider\");\n }\n\n return context as UseGlobalInteractionContext;\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseAppScreenReturn } from \"./useAppScreen\";\n\nexport interface UseAppScreenContext extends UseAppScreenReturn {}\n\nconst AppScreenContext = createContext<UseAppScreenContext | null>(null);\n\nexport const AppScreenProvider = AppScreenContext.Provider;\n\nexport function useAppScreenContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false ? UseAppScreenContext | null : UseAppScreenContext {\n const context = useContext(AppScreenContext);\n if (!context && strict) {\n throw new Error(\"useAppScreenContext must be used within a AppScreen\");\n }\n\n return context as UseAppScreenContext;\n}\n", "export {\n AppScreenDim as Dim,\n AppScreenEdge as Edge,\n AppScreenLayer as Layer,\n AppScreenRoot as Root,\n type AppScreenDimProps as DimProps,\n type AppScreenEdgeProps as EdgeProps,\n type AppScreenLayerProps as LayerProps,\n type AppScreenRootProps as RootProps,\n} from \"./AppScreen\";\n", "import { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useAppBar, type UseAppBarProps } from \"./useAppBar\";\nimport { AppBarProvider, useAppBarContext } from \"./useAppBarContext\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\n\nexport interface AppBarRootProps\n extends PrimitiveProps,\n UseAppBarProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarRoot = forwardRef<HTMLDivElement, AppBarRootProps>((props, ref) => {\n const { ...otherProps } = props;\n const api = useAppBar({});\n\n return (\n <AppBarProvider value={api}>\n <Primitive.div\n ref={composeRefs(api.refs.root, ref)}\n {...mergeProps(api.rootProps, otherProps)}\n />\n </AppBarProvider>\n );\n});\nAppBarRoot.displayName = \"AppBarRoot\";\n\nexport interface AppBarLeftProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarLeft = forwardRef<HTMLDivElement, AppBarLeftProps>((props, ref) => {\n const { refs, stateProps } = useAppBarContext();\n\n return <Primitive.div ref={composeRefs(refs.left, ref)} {...mergeProps(stateProps, props)} />;\n});\nAppBarLeft.displayName = \"AppBarLeft\";\n\nexport interface AppBarRightProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarRight = forwardRef<HTMLDivElement, AppBarRightProps>((props, ref) => {\n const { refs, stateProps } = useAppBarContext();\n\n return <Primitive.div ref={composeRefs(refs.right, ref)} {...mergeProps(stateProps, props)} />;\n});\nAppBarRight.displayName = \"AppBarRight\";\n\nexport interface AppBarMainProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarMain = forwardRef<HTMLDivElement, AppBarMainProps>((props, ref) => {\n const { stateProps } = useAppBarContext();\n\n return <Primitive.div ref={ref} {...mergeProps(stateProps, props)} />;\n});\n", "import { elementProps } from \"@seed-design/dom-utils\";\nimport { useMemo, useState } from \"react\";\nimport { useAppScreenContext } from \"../AppScreen\";\nimport { useElementOffset } from \"../private/useElementOffset\";\n\n// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty for future extension\nexport interface UseAppBarProps {}\n\nexport type UseAppBarReturn = ReturnType<typeof useAppBar>;\n\nexport function useAppBar(_props: UseAppBarProps) {\n const { stateProps } = useAppScreenContext();\n\n const [root, rootRef] = useState<HTMLElement | null>(null);\n const [left, leftRef] = useState<HTMLElement | null>(null);\n const [right, rightRef] = useState<HTMLElement | null>(null);\n\n const leftOffset = useElementOffset(left);\n const rightOffset = useElementOffset(right);\n const centeredTitlePaddingX = root\n ? `${Math.max(leftOffset?.fromLeft ?? 0, rightOffset?.fromRight ?? 0)}px`\n : \"initial\";\n\n return useMemo(\n () => ({\n refs: {\n root: rootRef,\n left: leftRef,\n right: rightRef,\n },\n stateProps,\n rootProps: elementProps({\n \"data-part\": \"appBar\",\n ...stateProps,\n style: {\n \"--centered-title-padding-x\": centeredTitlePaddingX,\n } as React.CSSProperties,\n }),\n }),\n [stateProps, centeredTitlePaddingX],\n );\n}\n", "import * as React from \"react\";\n\nconst useLayoutEffect = typeof window !== \"undefined\" ? React.useLayoutEffect : React.useEffect;\n\nexport function useElementOffset(element: HTMLElement | null) {\n const [offset, setOffset] = React.useState<{ fromLeft: number; fromRight: number } | undefined>(\n undefined,\n );\n\n useLayoutEffect(() => {\n if (!element) {\n setOffset(undefined);\n return;\n }\n\n if (element) {\n // provide as early as possible\n setOffset({\n fromLeft: element.offsetLeft + element.offsetWidth,\n fromRight: (element.offsetParent ?? document.body).clientWidth - element.offsetLeft,\n });\n\n const resizeObserver = new ResizeObserver(() => {\n const fromLeft = element.offsetLeft + element.offsetWidth;\n const fromRight = (element.offsetParent ?? document.body).clientWidth - element.offsetLeft;\n\n setOffset({ fromLeft, fromRight });\n });\n\n resizeObserver.observe(element);\n\n return () => resizeObserver.unobserve(element);\n }\n }, [element]);\n\n return offset;\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseAppBarReturn } from \"./useAppBar\";\n\nexport interface UseAppBarContext extends UseAppBarReturn {}\n\nconst AppBarContext = createContext<UseAppBarContext | null>(null);\n\nexport const AppBarProvider = AppBarContext.Provider;\n\nexport function useAppBarContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false ? UseAppBarContext | null : UseAppBarContext {\n const context = useContext(AppBarContext);\n if (!context && strict) {\n throw new Error(\"useAppBarContext must be used within a AppBar\");\n }\n\n return context as UseAppBarContext;\n}\n", "export {\n AppBarRoot as Root,\n AppBarMain as Main,\n AppBarLeft as Left,\n AppBarRight as Right,\n type AppBarRootProps as RootProps,\n type AppBarMainProps as MainProps,\n type AppBarLeftProps as LeftProps,\n type AppBarRightProps as RightProps,\n} from \"./AppBar\";\n", "import { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useGlobalInteraction } from \"./useGlobalInteraction\";\nimport { GlobalInteractionProvider } from \"./useGlobalInteractionContext\";\n\nexport interface GlobalInteractionProps\n extends PrimitiveProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const GlobalInteraction = forwardRef<HTMLDivElement, GlobalInteractionProps>(\n (props, ref) => {\n const api = useGlobalInteraction();\n return (\n <GlobalInteractionProvider value={api}>\n <Primitive.div\n ref={composeRefs(api.stackRef, ref)}\n {...mergeProps(api.stackProps, props)}\n />\n </GlobalInteractionProvider>\n );\n },\n);\nGlobalInteraction.displayName = \"GlobalInteraction\";\n", "import { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport { useTopActivity } from \"../private/useTopActivity\";\n\nexport type SwipeBackState = \"idle\" | \"swiping\" | \"transitioning\";\n\nexport type UseGlobalInteractionReturn = ReturnType<typeof useGlobalInteraction>;\n\nexport interface SwipeBackContext {\n x0: number;\n t0: number;\n displacement: number;\n displacementRatio: number;\n velocity: number;\n}\n\nexport interface SwipeBackProps {\n /**\n * The threshold to determine whether the swipe back is intentional.\n * @default 0.4\n */\n swipeBackDisplacementRatioThreshold?: number;\n\n /**\n * The threshold to determine whether the swipe back is intentional.\n * @default 1\n */\n swipeBackVelocityThreshold?: number;\n\n onSwipeBackStart?: () => void;\n onSwipeBackMove?: (props: { displacement: number; displacementRatio: number }) => void;\n onSwipeBackEnd?: (props: { swiped: boolean }) => void;\n}\n\nexport interface StartSwipeBackProps {\n x0: number;\n t0: number;\n}\n\nexport interface MoveSwipeBackProps {\n x: number;\n t: number;\n}\n\n// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty for future extension\nexport interface EndSwipeBackProps {}\n\nexport function useGlobalInteraction() {\n const [swipeBackState, setSwipeBackState] = useState<SwipeBackState>(\"idle\");\n\n const swipeBackContextRef = useRef<SwipeBackContext>({\n x0: 0,\n t0: 0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n const stackRef = useRef<HTMLDivElement>(null);\n\n const setSwipeBackContext = useCallback((ctx: SwipeBackContext) => {\n swipeBackContextRef.current = ctx;\n stackRef.current?.style.setProperty(\n \"--swipe-back-displacement\",\n `${ctx.displacement.toString()}px`,\n );\n stackRef.current?.style.setProperty(\n \"--swipe-back-displacement-ratio\",\n ctx.displacementRatio.toString(),\n );\n }, []);\n\n const getSwipeBackEvents = useCallback(\n (props: SwipeBackProps) => {\n const {\n swipeBackDisplacementRatioThreshold: displacementRatioThreshold = 0.4,\n swipeBackVelocityThreshold: velocityThreshold = 1,\n } = props;\n const onSwipeStart = useCallbackRef(props.onSwipeBackStart);\n const onSwipeMove = useCallbackRef(props.onSwipeBackMove);\n const onSwipeEnd = useCallbackRef(props.onSwipeBackEnd);\n\n const startSwipeBack = useCallback(\n ({ x0, t0 }: StartSwipeBackProps) => {\n setSwipeBackContext({\n x0,\n t0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n setSwipeBackState(\"swiping\");\n\n onSwipeStart?.();\n },\n [onSwipeStart],\n );\n\n const moveSwipeBack = useCallback(\n ({ x, t }: MoveSwipeBackProps) => {\n const displacement = x - swipeBackContextRef.current.x0;\n const displacementRatio = displacement / window.innerWidth;\n const velocity = displacement / (t - swipeBackContextRef.current.t0);\n setSwipeBackContext({\n ...swipeBackContextRef.current,\n displacement,\n displacementRatio,\n velocity,\n });\n setSwipeBackState(\"swiping\");\n\n onSwipeMove?.({ displacement, displacementRatio });\n },\n [onSwipeMove],\n );\n\n const endSwipeBack = useCallback(\n (_: EndSwipeBackProps) => {\n const swiped =\n swipeBackContextRef.current.displacementRatio > displacementRatioThreshold ||\n swipeBackContextRef.current.velocity > velocityThreshold;\n\n // we intentionally do not reset context here, so that the displacement can be used for exit animation\n setSwipeBackState(\"transitioning\");\n\n onSwipeEnd?.({ swiped });\n },\n [onSwipeEnd, displacementRatioThreshold, velocityThreshold],\n );\n\n const reset = useCallback(() => {\n setSwipeBackContext({\n x0: 0,\n t0: 0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n setSwipeBackState(\"idle\");\n }, []);\n\n return useMemo(\n () => ({\n startSwipeBack,\n moveSwipeBack,\n endSwipeBack,\n reset,\n }),\n [startSwipeBack, moveSwipeBack, endSwipeBack, reset],\n );\n },\n [setSwipeBackContext],\n );\n\n const topActivity = useTopActivity();\n\n const stackProps = useMemo(\n () => ({\n \"data-swipe-back-state\": swipeBackState,\n \"data-global-transition-state\": topActivity.transitionState,\n \"data-top-activity-type\": topActivity.activityType,\n }),\n [swipeBackState, topActivity.transitionState, topActivity.activityType],\n ) as React.HTMLAttributes<HTMLElement>;\n\n return useMemo(\n () => ({\n stackRef,\n swipeBackContextRef,\n swipeBackState,\n setSwipeBackState,\n setSwipeBackContext,\n getSwipeBackEvents,\n\n stackProps,\n }),\n [swipeBackState, setSwipeBackContext, getSwipeBackEvents, stackProps],\n );\n}\n", "import { useStack } from \"@stackflow/react\";\nimport { useEffect, useState } from \"react\";\n\nexport function useTopActivity() {\n const stack = useStack();\n if (!stack) {\n throw new Error(\n \"useStack is not available in the context. Make sure you are using @stackflow/react >= 1.4.1. (https://github.com/daangn/stackflow/blob/main/integrations/react/CHANGELOG.md#141)\",\n );\n }\n\n const topId = stack.activities.find((activity) => activity.isTop)?.id;\n const topActivity = stack.activities.find((activity) => activity.isTop);\n const transitionState = topActivity?.transitionState ?? \"enter-done\";\n\n // TODO: There should be a better way to handle this. We should not rely on the DOM element to get the activity type.\n const [topEl, setTopEl] = useState<HTMLElement | null>(null);\n const activityType = topEl?.dataset[\"activityType\"];\n\n useEffect(() => {\n if (!topId) return;\n\n const el = document.querySelector<HTMLElement>(`[data-activity-id=\"${topId}\"]`);\n setTopEl(el);\n }, [topId]);\n\n return {\n transitionState,\n activityType,\n };\n}\n", "import clsx from \"clsx\";\nimport { createContext, forwardRef, useContext } from \"react\";\n\ntype Recipe<\n Props extends Record<string, string | boolean | undefined>,\n Classnames extends Record<string, string>,\n> = ((props?: Props) => Classnames) & {\n splitVariantProps: <T extends Props>(props: T) => [Props, Omit<T, keyof Props>];\n};\n\nexport function createStyleContext<\n Props extends Record<string, string | boolean | undefined>,\n Classnames extends Record<string, string>,\n>(recipe: Recipe<Props, Classnames>) {\n const ClassNamesContext = createContext<Classnames | null>(null);\n const PropsContext = createContext<Props | null>(null);\n\n const ClassNamesProvider = ({\n children,\n value,\n }: { children: React.ReactNode; value: Classnames }) => {\n return <ClassNamesContext.Provider value={value}>{children}</ClassNamesContext.Provider>;\n };\n\n const PropsProvider = ({ children, value }: { children: React.ReactNode; value: Props }) => {\n return <PropsContext.Provider value={value}>{children}</PropsContext.Provider>;\n };\n\n function useClassNames() {\n const context = useContext(ClassNamesContext);\n if (context === null) {\n throw new Error(\n \"useClassNames must be used within a ClassNamesProvider. Did you forget to wrap your component in a ClassNamesProvider?\",\n );\n }\n\n return context;\n }\n\n function useProps() {\n return useContext(PropsContext);\n }\n\n const withRootProvider = <P,>(\n Component: React.ElementType<any>,\n options?: {\n defaultProps?: Partial<P>;\n },\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P>> => {\n const { defaultProps } = options ?? {};\n\n const StyledComponent = (innerProps: any) => {\n const props = { ...(defaultProps ?? {}), ...useProps(), ...innerProps } as Props &\n React.HTMLAttributes<HTMLElement>;\n const [variantProps, otherProps] = recipe.splitVariantProps(props);\n const classNames = recipe(variantProps); // TODO: should we memoize this?\n\n return (\n <ClassNamesProvider value={classNames}>\n <Component {...otherProps} />\n </ClassNamesProvider>\n );\n };\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n\n return StyledComponent as any;\n };\n\n const withProvider = <T, P>(\n Component: React.ElementType<any>,\n slot: keyof Classnames,\n options?: {\n defaultProps?: Partial<P>;\n },\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>> => {\n const { defaultProps } = options ?? {};\n\n const StyledComponent = forwardRef<any, any>((innerProps, ref) => {\n const props = { ...(defaultProps ?? {}), ...useProps(), ...innerProps } as Props &\n React.HTMLAttributes<HTMLElement>;\n const [variantProps, otherProps] = recipe.splitVariantProps(props);\n const classNames = recipe(variantProps); // TODO: should we memoize this?\n const className = classNames[slot as keyof typeof classNames];\n\n return (\n <ClassNamesProvider value={classNames}>\n <Component ref={ref} {...otherProps} className={clsx(className, props.className)} />\n </ClassNamesProvider>\n );\n });\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n\n return StyledComponent as any;\n };\n\n const withContext = <T, P>(\n Component: React.ElementType<any>,\n slot?: keyof Classnames,\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>> => {\n const StyledComponent = forwardRef<any, React.HTMLAttributes<HTMLElement>>((props, ref) => {\n const classNames = useClassNames();\n const className = classNames?.[slot as keyof typeof classNames];\n\n return <Component ref={ref} {...props} className={clsx(className, props.className)} />;\n });\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n return StyledComponent as any;\n };\n\n return {\n ClassNamesProvider,\n PropsProvider,\n useClassNames,\n useProps,\n withRootProvider,\n withProvider,\n withContext,\n };\n}\n", "import { Slot } from \"@radix-ui/react-slot\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { type AppBarVariantProps, appBar } from \"@seed-design/css/recipes/app-bar\";\nimport clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport { AppBar as AppBarPrimitive } from \"../../primitive\";\nimport { useAppBarContext } from \"../../primitive/AppBar/useAppBarContext\";\nimport { createStyleContext } from \"../../utils/createStyleContext\";\nimport { appBarMain, type AppBarMainVariantProps } from \"@seed-design/css/recipes/app-bar-main\";\n\nconst { PropsProvider, ClassNamesProvider, useProps, withContext, useClassNames } =\n createStyleContext(appBar);\nconst {\n PropsProvider: MainPropsProvider,\n withProvider: withMainProvider,\n withContext: withMainContext,\n} = createStyleContext(appBarMain);\n\nexport const AppBarPropsProvider = PropsProvider;\n\nexport interface AppBarProps extends AppBarVariantProps, AppBarPrimitive.RootProps {}\n\nexport const AppBarRoot = forwardRef<HTMLDivElement, AppBarProps>((props, ref) => {\n const contextProps = useProps();\n const [variantProps, otherProps] = appBar.splitVariantProps({ ...contextProps, ...props });\n\n const classNames = appBar(variantProps);\n\n return (\n <ClassNamesProvider value={classNames}>\n <MainPropsProvider\n value={{\n theme: variantProps.theme,\n transitionStyle: variantProps.transitionStyle,\n tone: variantProps.tone,\n }}\n >\n <AppBarPrimitive.Root\n ref={ref}\n {...mergeProps({ className: classNames.root }, otherProps)}\n />\n </MainPropsProvider>\n </ClassNamesProvider>\n );\n});\nAppBarRoot.displayName = \"AppBarRoot\";\n\nexport interface AppBarLeftProps extends AppBarPrimitive.LeftProps {}\n\nexport const AppBarLeft = withContext<HTMLDivElement, AppBarLeftProps>(\n AppBarPrimitive.Left,\n \"left\",\n);\n\nexport interface AppBarRightProps extends AppBarPrimitive.RightProps {}\n\nexport const AppBarRight = withContext<HTMLDivElement, AppBarRightProps>(\n AppBarPrimitive.Right,\n \"right\",\n);\n\nexport interface AppBarMainProps extends AppBarMainVariantProps, AppBarPrimitive.MainProps {}\n\nexport const AppBarMain = withMainProvider<HTMLDivElement, AppBarMainProps>(\n AppBarPrimitive.Main,\n \"root\",\n);\n\nexport interface AppBarTitleProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {}\n\nexport const AppBarTitle = withMainContext<HTMLSpanElement, AppBarTitleProps>(\n Primitive.span,\n \"title\",\n);\n\nexport interface AppBarSubtitleProps\n extends PrimitiveProps,\n React.HTMLAttributes<HTMLSpanElement> {}\n\nexport const AppBarSubtitle = withMainContext<HTMLSpanElement, AppBarSubtitleProps>(\n Primitive.span,\n \"subtitle\",\n);\n\nexport interface AppBarIconButtonProps\n extends PrimitiveProps,\n React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AppBarIconButton = forwardRef<HTMLButtonElement, AppBarIconButtonProps>(\n ({ children, className, ...otherProps }, ref) => {\n const { stateProps } = useAppBarContext();\n const classNames = useClassNames();\n\n return (\n <Primitive.button\n ref={ref}\n type=\"button\"\n className={clsx(classNames.iconButton, className)}\n {...mergeProps(stateProps, otherProps)}\n >\n <Slot className={classNames.icon} {...stateProps}>\n {children}\n </Slot>\n </Primitive.button>\n );\n },\n);\nAppBarIconButton.displayName = \"IconButton\";\n", "import type { StackflowReactPlugin } from \"@stackflow/react\";\nimport { AppScreenPropsProvider } from \"./components/AppScreen/AppScreen\";\nimport { GlobalInteraction } from \"./primitive\";\n\nexport interface SeedPluginOptions {\n theme: \"android\" | \"cupertino\";\n}\n\nexport const seedPlugin =\n (options: SeedPluginOptions): StackflowReactPlugin =>\n () => ({\n key: \"seed-design\",\n wrapStack({ stack }) {\n return (\n <AppScreenPropsProvider value={options}>\n <GlobalInteraction>{stack.render()}</GlobalInteraction>\n </AppScreenPropsProvider>\n );\n },\n });\n", "export {\n AppBarIconButton as IconButton,\n AppBarLeft as Left,\n AppBarMain as Main,\n AppBarRight as Right,\n AppBarRoot as Root,\n AppBarSubtitle as Subtitle,\n AppBarTitle as Title,\n} from \"./AppBar\";\n\nexport type {\n AppBarIconButtonProps as IconButtonProps,\n AppBarLeftProps as LeftProps,\n AppBarMainProps as MainProps,\n AppBarRightProps as RightProps,\n AppBarProps as RootProps,\n AppBarSubtitleProps as SubtitleProps,\n AppBarTitleProps as TitleProps,\n} from \"./AppBar\";\n", "export {\n AppScreenDim as Dim,\n AppScreenEdge as Edge,\n AppScreenLayer as Layer,\n AppScreenRoot as Root,\n} from \"./AppScreen\";\n\nexport type {\n AppScreenDimProps as DimProps,\n AppScreenEdgeProps as EdgeProps,\n AppScreenLayerProps as LayerProps,\n AppScreenRootProps as RootProps,\n} from \"./AppScreen\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA,oBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,mBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA;AAAA,mBAAAC;AAAA,EAAA,oBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;;;ACAA,wBAAsD;AACtD,IAAAC,iBAAoC;;;ACDpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAC,oBAA2B;AAC3B,6BAA+C;AAC/C,IAAAC,gBAA2B;;;ACF3B,uBAAuC;AACvC,2BAA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AAA,EACF,GACF;AAEJ,CAAC;AACDI,eAAc,cAAc;AAIrB,IAAMC,gBAAeH;AAAA,EAC1B,4BAAmB;AAAA,EACnB;AACF;AAIO,IAAMI,iBAAgBJ;AAAA,EAC3B,4BAAmB;AAAA,EACnB;AACF;AAIO,IAAMK,kBAAiBL;AAAA,EAC5B,4BAAmB;AAAA,EACnB;AACF;;;AkBjDU,IAAAM,sBAAA;AAPH,IAAM,aACX,CAAC,YACD,OAAO;AAAA,EACL,KAAK;AAAA,EACL,UAAU,EAAE,MAAM,GAAG;AACnB,WACE,6CAAC,0BAAuB,OAAO,SAC7B,uDAAC,qBAAmB,gBAAM,OAAO,GAAE,GACrC;AAAA,EAEJ;AACF;;;ACnBF,IAAAC,4BAAA;AAAA,SAAAA,2BAAA;AAAA;AAAA,cAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,IAAAC,+BAAA;AAAA,SAAAA,8BAAA;AAAA,aAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,YAAAC;AAAA;",
|
|
6
6
|
"names": ["AppBar_namespace_exports", "AppBarLeft", "AppBarMain", "AppBarRight", "AppBarRoot", "AppScreen_namespace_exports", "AppScreenDim", "AppScreenEdge", "AppScreenLayer", "AppScreenRoot", "import_react", "import_dom_utils", "import_react", "import_react", "import_react", "import_react", "import_react_primitive", "import_react", "import_dom_utils", "import_react", "useLayoutEffect", "_a", "import_react", "import_dom_utils", "import_jsx_runtime", "import_react_compose_refs", "import_dom_utils", "import_react_primitive", "import_react", "import_react", "import_react", "import_jsx_runtime", "import_react", "import_jsx_runtime", "ClassNamesProvider", "PropsProvider", "useClassNames", "useProps", "clsx", "withContext", "import_dom_utils", "import_react_primitive", "import_clsx", "import_react", "import_jsx_runtime", "AppBarRoot", "AppBarLeft", "AppBarRight", "AppBarMain", "clsx", "import_dom_utils", "import_jsx_runtime", "ClassNamesProvider", "PropsProvider", "withContext", "useProps", "AppScreenRoot", "AppScreenDim", "AppScreenEdge", "AppScreenLayer", "import_jsx_runtime", "AppBar_namespace_exports", "AppBarLeft", "AppBarMain", "AppBarRight", "AppBarRoot", "AppScreen_namespace_exports", "AppScreenDim", "AppScreenEdge", "AppScreenLayer", "AppScreenRoot"]
|
|
7
7
|
}
|
package/lib/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// src/components/AppScreen/AppScreen.tsx
|
|
8
|
-
import { appScreen } from "@seed-design/
|
|
8
|
+
import { appScreen } from "@seed-design/css/recipes/app-screen";
|
|
9
9
|
import { forwardRef as forwardRef6, useMemo as useMemo5 } from "react";
|
|
10
10
|
|
|
11
11
|
// src/primitive/index.tsx
|
|
@@ -592,10 +592,10 @@ function createStyleContext(recipe) {
|
|
|
592
592
|
import { Slot } from "@radix-ui/react-slot";
|
|
593
593
|
import { mergeProps as mergeProps4 } from "@seed-design/dom-utils";
|
|
594
594
|
import { Primitive as Primitive4 } from "@seed-design/react-primitive";
|
|
595
|
-
import { appBar } from "@seed-design/
|
|
595
|
+
import { appBar } from "@seed-design/css/recipes/app-bar";
|
|
596
596
|
import clsx2 from "clsx";
|
|
597
597
|
import { forwardRef as forwardRef5 } from "react";
|
|
598
|
-
import { appBarMain } from "@seed-design/
|
|
598
|
+
import { appBarMain } from "@seed-design/css/recipes/app-bar-main";
|
|
599
599
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
600
600
|
var { PropsProvider, ClassNamesProvider, useProps, withContext, useClassNames } = createStyleContext(appBar);
|
|
601
601
|
var {
|
package/lib/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/components/AppScreen/AppScreen.tsx", "../src/primitive/index.tsx", "../src/primitive/AppScreen/AppScreen.tsx", "../src/primitive/AppScreen/useAppScreen.tsx", "../src/primitive/GlobalInteraction/useSwipeBack.ts", "../src/primitive/GlobalInteraction/useGlobalInteractionContext.tsx", "../src/primitive/AppScreen/useAppScreenContext.ts", "../src/primitive/AppScreen/AppScreen.namespace.ts", "../src/primitive/AppBar/AppBar.tsx", "../src/primitive/AppBar/useAppBar.tsx", "../src/primitive/private/useElementOffset.ts", "../src/primitive/AppBar/useAppBarContext.ts", "../src/primitive/AppBar/AppBar.namespace.ts", "../src/primitive/GlobalInteraction/GlobalInteraction.tsx", "../src/primitive/GlobalInteraction/useGlobalInteraction.ts", "../src/primitive/private/useTopActivity.ts", "../src/utils/createStyleContext.tsx", "../src/components/AppBar/AppBar.tsx", "../src/plugin.tsx", "../src/components/AppBar/AppBar.namespace.ts", "../src/components/AppScreen/AppScreen.namespace.ts"],
|
|
4
|
-
"sourcesContent": ["import { appScreen, type AppScreenVariantProps } from \"@seed-design/recipe/appScreen\";\nimport { forwardRef, useMemo } from \"react\";\nimport { AppScreen as AppScreenPrimitive } from \"../../primitive\";\nimport { createStyleContext } from \"../../utils/createStyleContext\";\nimport { AppBarPropsProvider } from \"../AppBar/AppBar\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\n\nconst { ClassNamesProvider, PropsProvider, withContext, useProps } = createStyleContext(appScreen);\n\nexport const AppScreenPropsProvider = PropsProvider;\n\nexport interface AppScreenRootProps extends AppScreenVariantProps, AppScreenPrimitive.RootProps {}\n\nexport const AppScreenRoot = forwardRef<HTMLDivElement, AppScreenRootProps>((props, ref) => {\n const contextProps = useProps();\n const [variantProps, otherProps] = appScreen.splitVariantProps({ ...contextProps, ...props });\n\n // TODO: we have to implement conditional default in recipe; this is temporal workaround.\n const transitionStyle =\n variantProps.transitionStyle ??\n (variantProps.theme === \"cupertino\" ? \"slideFromRightIOS\" : \"fadeFromBottomAndroid\");\n\n const classNames = appScreen({\n ...variantProps,\n transitionStyle,\n });\n\n return (\n <ClassNamesProvider value={classNames}>\n <AppBarPropsProvider\n value={useMemo(\n () => ({ theme: variantProps.theme, transitionStyle }),\n [variantProps.theme, transitionStyle],\n )}\n >\n <AppScreenPrimitive.Root\n ref={ref}\n {...mergeProps({ className: classNames.root }, otherProps)}\n />\n </AppBarPropsProvider>\n </ClassNamesProvider>\n );\n});\nAppScreenRoot.displayName = \"AppScreenRoot\";\n\nexport interface AppScreenDimProps extends AppScreenPrimitive.DimProps {}\n\nexport const AppScreenDim = withContext<HTMLDivElement, AppScreenDimProps>(\n AppScreenPrimitive.Dim,\n \"dim\",\n);\n\nexport interface AppScreenEdgeProps extends AppScreenPrimitive.EdgeProps {}\n\nexport const AppScreenEdge = withContext<HTMLDivElement, AppScreenEdgeProps>(\n AppScreenPrimitive.Edge,\n \"edge\",\n);\n\nexport interface AppScreenLayerProps extends AppScreenPrimitive.LayerProps {}\n\nexport const AppScreenLayer = withContext<HTMLDivElement, AppScreenLayerProps>(\n AppScreenPrimitive.Layer,\n \"layer\",\n);\n", "export * from \"./AppScreen\";\nexport * from \"./AppBar\";\nexport * from \"./GlobalInteraction\";\n", "import { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useAppScreen, type UseAppScreenProps } from \"./useAppScreen\";\nimport { AppScreenProvider, useAppScreenContext } from \"./useAppScreenContext\";\n\nexport interface AppScreenRootProps\n extends PrimitiveProps,\n UseAppScreenProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenRoot = forwardRef<HTMLDivElement, AppScreenRootProps>((props, ref) => {\n const {\n swipeBackDisplacementRatioThreshold,\n swipeBackVelocityThreshold,\n onSwipeBackEnd,\n onSwipeBackMove,\n onSwipeBackStart,\n ...otherProps\n } = props;\n const api = useAppScreen({\n swipeBackDisplacementRatioThreshold,\n swipeBackVelocityThreshold,\n onSwipeBackEnd,\n onSwipeBackMove,\n onSwipeBackStart,\n });\n\n return (\n <AppScreenProvider value={api}>\n <Primitive.div\n ref={ref}\n data-stackflow-component-name=\"AppScreen\"\n {...mergeProps(api.activityProps, otherProps)}\n />\n </AppScreenProvider>\n );\n});\nAppScreenRoot.displayName = \"AppScreenRoot\";\n\nexport interface AppScreenDimProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenDim = forwardRef<HTMLDivElement, AppScreenDimProps>((props, ref) => {\n const { dimProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(dimProps, props)} />;\n});\nAppScreenDim.displayName = \"AppScreenDim\";\n\nexport interface AppScreenEdgeProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenEdge = forwardRef<HTMLDivElement, AppScreenEdgeProps>((props, ref) => {\n const { edgeProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(edgeProps, props)} />;\n});\nAppScreenEdge.displayName = \"AppScreenEdge\";\n\nexport interface AppScreenLayerProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenLayer = forwardRef<HTMLDivElement, AppScreenLayerProps>((props, ref) => {\n const { layerProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(layerProps, props)} />;\n});\nAppScreenLayer.displayName = \"AppScreenLayer\";\n", "import { dataAttr, elementProps } from \"@seed-design/dom-utils\";\nimport { useNullableActivity, useZIndexBase } from \"@stackflow/react-ui-core\";\nimport { useMemo } from \"react\";\nimport { type UseSwipeBackProps, useSwipeBack } from \"../GlobalInteraction/useSwipeBack\";\n\nexport interface UseAppScreenProps extends UseSwipeBackProps {}\n\nexport type UseAppScreenReturn = ReturnType<typeof useAppScreen>;\n\nexport function useAppScreen(props: UseAppScreenProps) {\n const activity = useNullableActivity();\n\n const transitionState = activity?.transitionState ?? \"enter-done\";\n\n const { activityProps, layerProps, edgeProps } = useSwipeBack(props);\n\n const zIndexBase = useZIndexBase();\n const zIndexStyle = useMemo(\n () =>\n ({\n \"--z-index-base\": zIndexBase.toString(),\n }) as React.CSSProperties,\n [zIndexBase],\n );\n\n const stateProps = useMemo(\n () => ({\n \"data-activity-is-top\": dataAttr(activity?.isTop),\n \"data-activity-is-active\": dataAttr(activity?.isActive),\n \"data-transition-state\": transitionState,\n }),\n [transitionState, activity?.isActive, activity?.isTop],\n ) as React.HTMLAttributes<HTMLElement>;\n\n return useMemo(\n () => ({\n activity,\n stateProps,\n activityProps: elementProps({\n \"data-part\": \"activity\",\n \"data-activity-type\": \"full-screen\",\n ...activityProps,\n ...stateProps,\n \"data-activity-id\": activity?.id,\n style: zIndexStyle,\n // FIXME: @stackflow/react should prevent activity.id hydration mismatch; this is temporal fix.\n suppressHydrationWarning: true,\n }),\n dimProps: elementProps({\n \"data-part\": \"dim\",\n ...stateProps,\n }),\n layerProps: elementProps({\n \"data-part\": \"layer\",\n ...stateProps,\n ...layerProps,\n }),\n edgeProps: elementProps({\n \"data-part\": \"edge\",\n \"aria-hidden\": true,\n tabIndex: -1,\n ...edgeProps,\n ...stateProps,\n }),\n }),\n [activity, zIndexStyle, stateProps, activityProps, edgeProps, layerProps],\n );\n}\n", "import { useEffect, useMemo } from \"react\";\nimport type { SwipeBackProps } from \"./useGlobalInteraction\";\nimport { useGlobalInteractionContext } from \"./useGlobalInteractionContext\";\n\nexport interface UseSwipeBackProps extends SwipeBackProps {}\n\nexport function useSwipeBack(props: UseSwipeBackProps) {\n const globalInteraction = useGlobalInteractionContext();\n const events = globalInteraction.getSwipeBackEvents(props);\n\n useEffect(() => {\n return () => {\n events.reset();\n };\n }, [events]);\n\n return useMemo(\n () => ({\n activityProps: {\n \"data-swipe-back\": \"\",\n } as React.HTMLAttributes<HTMLDivElement>,\n layerProps: {\n onTransitionEnd: (e) => {\n if (e.target === e.currentTarget) {\n events.reset();\n }\n },\n onAnimationEnd: (e) => {\n if (e.target === e.currentTarget) {\n events.reset();\n }\n },\n } as React.HTMLAttributes<HTMLDivElement>,\n edgeProps: {\n tabIndex: -1,\n onTouchStart: (e) => {\n const x0 = e.touches[0].clientX;\n const t0 = Date.now();\n events.startSwipeBack({ x0, t0 });\n },\n onTouchMove: (e) => {\n const x = e.touches[0].clientX;\n const t = Date.now();\n events.moveSwipeBack({ x, t });\n },\n onTouchEnd: () => {\n events.endSwipeBack({});\n },\n onTouchCancel: () => {\n events.endSwipeBack({});\n },\n } as React.HTMLAttributes<HTMLElement>,\n }),\n [events],\n );\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseGlobalInteractionReturn } from \"./useGlobalInteraction\";\n\nexport interface UseGlobalInteractionContext extends UseGlobalInteractionReturn {}\n\nconst GlobalInteractionContext = createContext<UseGlobalInteractionContext | null>(null);\n\nexport const GlobalInteractionProvider = GlobalInteractionContext.Provider;\n\nexport function useGlobalInteractionContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false\n ? UseGlobalInteractionContext | null\n : UseGlobalInteractionContext {\n const context = useContext(GlobalInteractionContext);\n if (!context && strict) {\n throw new Error(\"useGlobalInteractionContext must be used within a GlobalInteractionProvider\");\n }\n\n return context as UseGlobalInteractionContext;\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseAppScreenReturn } from \"./useAppScreen\";\n\nexport interface UseAppScreenContext extends UseAppScreenReturn {}\n\nconst AppScreenContext = createContext<UseAppScreenContext | null>(null);\n\nexport const AppScreenProvider = AppScreenContext.Provider;\n\nexport function useAppScreenContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false ? UseAppScreenContext | null : UseAppScreenContext {\n const context = useContext(AppScreenContext);\n if (!context && strict) {\n throw new Error(\"useAppScreenContext must be used within a AppScreen\");\n }\n\n return context as UseAppScreenContext;\n}\n", "export {\n AppScreenDim as Dim,\n AppScreenEdge as Edge,\n AppScreenLayer as Layer,\n AppScreenRoot as Root,\n type AppScreenDimProps as DimProps,\n type AppScreenEdgeProps as EdgeProps,\n type AppScreenLayerProps as LayerProps,\n type AppScreenRootProps as RootProps,\n} from \"./AppScreen\";\n", "import { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useAppBar, type UseAppBarProps } from \"./useAppBar\";\nimport { AppBarProvider, useAppBarContext } from \"./useAppBarContext\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\n\nexport interface AppBarRootProps\n extends PrimitiveProps,\n UseAppBarProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarRoot = forwardRef<HTMLDivElement, AppBarRootProps>((props, ref) => {\n const { ...otherProps } = props;\n const api = useAppBar({});\n\n return (\n <AppBarProvider value={api}>\n <Primitive.div\n ref={composeRefs(api.refs.root, ref)}\n {...mergeProps(api.rootProps, otherProps)}\n />\n </AppBarProvider>\n );\n});\nAppBarRoot.displayName = \"AppBarRoot\";\n\nexport interface AppBarLeftProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarLeft = forwardRef<HTMLDivElement, AppBarLeftProps>((props, ref) => {\n const { refs, stateProps } = useAppBarContext();\n\n return <Primitive.div ref={composeRefs(refs.left, ref)} {...mergeProps(stateProps, props)} />;\n});\nAppBarLeft.displayName = \"AppBarLeft\";\n\nexport interface AppBarRightProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarRight = forwardRef<HTMLDivElement, AppBarRightProps>((props, ref) => {\n const { refs, stateProps } = useAppBarContext();\n\n return <Primitive.div ref={composeRefs(refs.right, ref)} {...mergeProps(stateProps, props)} />;\n});\nAppBarRight.displayName = \"AppBarRight\";\n\nexport interface AppBarMainProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarMain = forwardRef<HTMLDivElement, AppBarMainProps>((props, ref) => {\n const { stateProps } = useAppBarContext();\n\n return <Primitive.div ref={ref} {...mergeProps(stateProps, props)} />;\n});\n", "import { elementProps } from \"@seed-design/dom-utils\";\nimport { useMemo, useState } from \"react\";\nimport { useAppScreenContext } from \"../AppScreen\";\nimport { useElementOffset } from \"../private/useElementOffset\";\n\n// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty for future extension\nexport interface UseAppBarProps {}\n\nexport type UseAppBarReturn = ReturnType<typeof useAppBar>;\n\nexport function useAppBar(_props: UseAppBarProps) {\n const { stateProps } = useAppScreenContext();\n\n const [root, rootRef] = useState<HTMLElement | null>(null);\n const [left, leftRef] = useState<HTMLElement | null>(null);\n const [right, rightRef] = useState<HTMLElement | null>(null);\n\n const leftOffset = useElementOffset(left);\n const rightOffset = useElementOffset(right);\n const centeredTitlePaddingX = root\n ? `${Math.max(leftOffset?.fromLeft ?? 0, rightOffset?.fromRight ?? 0)}px`\n : \"initial\";\n\n return useMemo(\n () => ({\n refs: {\n root: rootRef,\n left: leftRef,\n right: rightRef,\n },\n stateProps,\n rootProps: elementProps({\n \"data-part\": \"appBar\",\n ...stateProps,\n style: {\n \"--centered-title-padding-x\": centeredTitlePaddingX,\n } as React.CSSProperties,\n }),\n }),\n [stateProps, centeredTitlePaddingX],\n );\n}\n", "import * as React from \"react\";\n\nconst useLayoutEffect = typeof window !== \"undefined\" ? React.useLayoutEffect : React.useEffect;\n\nexport function useElementOffset(element: HTMLElement | null) {\n const [offset, setOffset] = React.useState<{ fromLeft: number; fromRight: number } | undefined>(\n undefined,\n );\n\n useLayoutEffect(() => {\n if (!element) {\n setOffset(undefined);\n return;\n }\n\n if (element) {\n // provide as early as possible\n setOffset({\n fromLeft: element.offsetLeft + element.offsetWidth,\n fromRight: (element.offsetParent ?? document.body).clientWidth - element.offsetLeft,\n });\n\n const resizeObserver = new ResizeObserver(() => {\n const fromLeft = element.offsetLeft + element.offsetWidth;\n const fromRight = (element.offsetParent ?? document.body).clientWidth - element.offsetLeft;\n\n setOffset({ fromLeft, fromRight });\n });\n\n resizeObserver.observe(element);\n\n return () => resizeObserver.unobserve(element);\n }\n }, [element]);\n\n return offset;\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseAppBarReturn } from \"./useAppBar\";\n\nexport interface UseAppBarContext extends UseAppBarReturn {}\n\nconst AppBarContext = createContext<UseAppBarContext | null>(null);\n\nexport const AppBarProvider = AppBarContext.Provider;\n\nexport function useAppBarContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false ? UseAppBarContext | null : UseAppBarContext {\n const context = useContext(AppBarContext);\n if (!context && strict) {\n throw new Error(\"useAppBarContext must be used within a AppBar\");\n }\n\n return context as UseAppBarContext;\n}\n", "export {\n AppBarRoot as Root,\n AppBarMain as Main,\n AppBarLeft as Left,\n AppBarRight as Right,\n type AppBarRootProps as RootProps,\n type AppBarMainProps as MainProps,\n type AppBarLeftProps as LeftProps,\n type AppBarRightProps as RightProps,\n} from \"./AppBar\";\n", "import { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useGlobalInteraction } from \"./useGlobalInteraction\";\nimport { GlobalInteractionProvider } from \"./useGlobalInteractionContext\";\n\nexport interface GlobalInteractionProps\n extends PrimitiveProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const GlobalInteraction = forwardRef<HTMLDivElement, GlobalInteractionProps>(\n (props, ref) => {\n const api = useGlobalInteraction();\n return (\n <GlobalInteractionProvider value={api}>\n <Primitive.div\n ref={composeRefs(api.stackRef, ref)}\n {...mergeProps(api.stackProps, props)}\n />\n </GlobalInteractionProvider>\n );\n },\n);\nGlobalInteraction.displayName = \"GlobalInteraction\";\n", "import { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport { useTopActivity } from \"../private/useTopActivity\";\n\nexport type SwipeBackState = \"idle\" | \"swiping\" | \"transitioning\";\n\nexport type UseGlobalInteractionReturn = ReturnType<typeof useGlobalInteraction>;\n\nexport interface SwipeBackContext {\n x0: number;\n t0: number;\n displacement: number;\n displacementRatio: number;\n velocity: number;\n}\n\nexport interface SwipeBackProps {\n /**\n * The threshold to determine whether the swipe back is intentional.\n * @default 0.4\n */\n swipeBackDisplacementRatioThreshold?: number;\n\n /**\n * The threshold to determine whether the swipe back is intentional.\n * @default 1\n */\n swipeBackVelocityThreshold?: number;\n\n onSwipeBackStart?: () => void;\n onSwipeBackMove?: (props: { displacement: number; displacementRatio: number }) => void;\n onSwipeBackEnd?: (props: { swiped: boolean }) => void;\n}\n\nexport interface StartSwipeBackProps {\n x0: number;\n t0: number;\n}\n\nexport interface MoveSwipeBackProps {\n x: number;\n t: number;\n}\n\n// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty for future extension\nexport interface EndSwipeBackProps {}\n\nexport function useGlobalInteraction() {\n const [swipeBackState, setSwipeBackState] = useState<SwipeBackState>(\"idle\");\n\n const swipeBackContextRef = useRef<SwipeBackContext>({\n x0: 0,\n t0: 0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n const stackRef = useRef<HTMLDivElement>(null);\n\n const setSwipeBackContext = useCallback((ctx: SwipeBackContext) => {\n swipeBackContextRef.current = ctx;\n stackRef.current?.style.setProperty(\n \"--swipe-back-displacement\",\n `${ctx.displacement.toString()}px`,\n );\n stackRef.current?.style.setProperty(\n \"--swipe-back-displacement-ratio\",\n ctx.displacementRatio.toString(),\n );\n }, []);\n\n const getSwipeBackEvents = useCallback(\n (props: SwipeBackProps) => {\n const {\n swipeBackDisplacementRatioThreshold: displacementRatioThreshold = 0.4,\n swipeBackVelocityThreshold: velocityThreshold = 1,\n } = props;\n const onSwipeStart = useCallbackRef(props.onSwipeBackStart);\n const onSwipeMove = useCallbackRef(props.onSwipeBackMove);\n const onSwipeEnd = useCallbackRef(props.onSwipeBackEnd);\n\n const startSwipeBack = useCallback(\n ({ x0, t0 }: StartSwipeBackProps) => {\n setSwipeBackContext({\n x0,\n t0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n setSwipeBackState(\"swiping\");\n\n onSwipeStart?.();\n },\n [onSwipeStart],\n );\n\n const moveSwipeBack = useCallback(\n ({ x, t }: MoveSwipeBackProps) => {\n const displacement = x - swipeBackContextRef.current.x0;\n const displacementRatio = displacement / window.innerWidth;\n const velocity = displacement / (t - swipeBackContextRef.current.t0);\n setSwipeBackContext({\n ...swipeBackContextRef.current,\n displacement,\n displacementRatio,\n velocity,\n });\n setSwipeBackState(\"swiping\");\n\n onSwipeMove?.({ displacement, displacementRatio });\n },\n [onSwipeMove],\n );\n\n const endSwipeBack = useCallback(\n (_: EndSwipeBackProps) => {\n const swiped =\n swipeBackContextRef.current.displacementRatio > displacementRatioThreshold ||\n swipeBackContextRef.current.velocity > velocityThreshold;\n\n // we intentionally do not reset context here, so that the displacement can be used for exit animation\n setSwipeBackState(\"transitioning\");\n\n onSwipeEnd?.({ swiped });\n },\n [onSwipeEnd, displacementRatioThreshold, velocityThreshold],\n );\n\n const reset = useCallback(() => {\n setSwipeBackContext({\n x0: 0,\n t0: 0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n setSwipeBackState(\"idle\");\n }, []);\n\n return useMemo(\n () => ({\n startSwipeBack,\n moveSwipeBack,\n endSwipeBack,\n reset,\n }),\n [startSwipeBack, moveSwipeBack, endSwipeBack, reset],\n );\n },\n [setSwipeBackContext],\n );\n\n const topActivity = useTopActivity();\n\n const stackProps = useMemo(\n () => ({\n \"data-swipe-back-state\": swipeBackState,\n \"data-global-transition-state\": topActivity.transitionState,\n \"data-top-activity-type\": topActivity.activityType,\n }),\n [swipeBackState, topActivity.transitionState, topActivity.activityType],\n ) as React.HTMLAttributes<HTMLElement>;\n\n return useMemo(\n () => ({\n stackRef,\n swipeBackContextRef,\n swipeBackState,\n setSwipeBackState,\n setSwipeBackContext,\n getSwipeBackEvents,\n\n stackProps,\n }),\n [swipeBackState, setSwipeBackContext, getSwipeBackEvents, stackProps],\n );\n}\n", "import { useStack } from \"@stackflow/react\";\nimport { useEffect, useState } from \"react\";\n\nexport function useTopActivity() {\n const stack = useStack();\n if (!stack) {\n throw new Error(\n \"useStack is not available in the context. Make sure you are using @stackflow/react >= 1.4.1. (https://github.com/daangn/stackflow/blob/main/integrations/react/CHANGELOG.md#141)\",\n );\n }\n\n const topId = stack.activities.find((activity) => activity.isTop)?.id;\n const topActivity = stack.activities.find((activity) => activity.isTop);\n const transitionState = topActivity?.transitionState ?? \"enter-done\";\n\n // TODO: There should be a better way to handle this. We should not rely on the DOM element to get the activity type.\n const [topEl, setTopEl] = useState<HTMLElement | null>(null);\n const activityType = topEl?.dataset[\"activityType\"];\n\n useEffect(() => {\n if (!topId) return;\n\n const el = document.querySelector<HTMLElement>(`[data-activity-id=\"${topId}\"]`);\n setTopEl(el);\n }, [topId]);\n\n return {\n transitionState,\n activityType,\n };\n}\n", "import clsx from \"clsx\";\nimport { createContext, forwardRef, useContext } from \"react\";\n\ntype Recipe<\n Props extends Record<string, string | boolean | undefined>,\n Classnames extends Record<string, string>,\n> = ((props?: Props) => Classnames) & {\n splitVariantProps: <T extends Props>(props: T) => [Props, Omit<T, keyof Props>];\n};\n\nexport function createStyleContext<\n Props extends Record<string, string | boolean | undefined>,\n Classnames extends Record<string, string>,\n>(recipe: Recipe<Props, Classnames>) {\n const ClassNamesContext = createContext<Classnames | null>(null);\n const PropsContext = createContext<Props | null>(null);\n\n const ClassNamesProvider = ({\n children,\n value,\n }: { children: React.ReactNode; value: Classnames }) => {\n return <ClassNamesContext.Provider value={value}>{children}</ClassNamesContext.Provider>;\n };\n\n const PropsProvider = ({ children, value }: { children: React.ReactNode; value: Props }) => {\n return <PropsContext.Provider value={value}>{children}</PropsContext.Provider>;\n };\n\n function useClassNames() {\n const context = useContext(ClassNamesContext);\n if (context === null) {\n throw new Error(\n \"useClassNames must be used within a ClassNamesProvider. Did you forget to wrap your component in a ClassNamesProvider?\",\n );\n }\n\n return context;\n }\n\n function useProps() {\n return useContext(PropsContext);\n }\n\n const withRootProvider = <P,>(\n Component: React.ElementType<any>,\n options?: {\n defaultProps?: Partial<P>;\n },\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P>> => {\n const { defaultProps } = options ?? {};\n\n const StyledComponent = (innerProps: any) => {\n const props = { ...(defaultProps ?? {}), ...useProps(), ...innerProps } as Props &\n React.HTMLAttributes<HTMLElement>;\n const [variantProps, otherProps] = recipe.splitVariantProps(props);\n const classNames = recipe(variantProps); // TODO: should we memoize this?\n\n return (\n <ClassNamesProvider value={classNames}>\n <Component {...otherProps} />\n </ClassNamesProvider>\n );\n };\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n\n return StyledComponent as any;\n };\n\n const withProvider = <T, P>(\n Component: React.ElementType<any>,\n slot: keyof Classnames,\n options?: {\n defaultProps?: Partial<P>;\n },\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>> => {\n const { defaultProps } = options ?? {};\n\n const StyledComponent = forwardRef<any, any>((innerProps, ref) => {\n const props = { ...(defaultProps ?? {}), ...useProps(), ...innerProps } as Props &\n React.HTMLAttributes<HTMLElement>;\n const [variantProps, otherProps] = recipe.splitVariantProps(props);\n const classNames = recipe(variantProps); // TODO: should we memoize this?\n const className = classNames[slot as keyof typeof classNames];\n\n return (\n <ClassNamesProvider value={classNames}>\n <Component ref={ref} {...otherProps} className={clsx(className, props.className)} />\n </ClassNamesProvider>\n );\n });\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n\n return StyledComponent as any;\n };\n\n const withContext = <T, P>(\n Component: React.ElementType<any>,\n slot?: keyof Classnames,\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>> => {\n const StyledComponent = forwardRef<any, React.HTMLAttributes<HTMLElement>>((props, ref) => {\n const classNames = useClassNames();\n const className = classNames?.[slot as keyof typeof classNames];\n\n return <Component ref={ref} {...props} className={clsx(className, props.className)} />;\n });\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n return StyledComponent as any;\n };\n\n return {\n ClassNamesProvider,\n PropsProvider,\n useClassNames,\n useProps,\n withRootProvider,\n withProvider,\n withContext,\n };\n}\n", "import { Slot } from \"@radix-ui/react-slot\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { type AppBarVariantProps, appBar } from \"@seed-design/recipe/appBar\";\nimport clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport { AppBar as AppBarPrimitive } from \"../../primitive\";\nimport { useAppBarContext } from \"../../primitive/AppBar/useAppBarContext\";\nimport { createStyleContext } from \"../../utils/createStyleContext\";\nimport { appBarMain, type AppBarMainVariantProps } from \"@seed-design/recipe/appBarMain\";\n\nconst { PropsProvider, ClassNamesProvider, useProps, withContext, useClassNames } =\n createStyleContext(appBar);\nconst {\n PropsProvider: MainPropsProvider,\n withProvider: withMainProvider,\n withContext: withMainContext,\n} = createStyleContext(appBarMain);\n\nexport const AppBarPropsProvider = PropsProvider;\n\nexport interface AppBarProps extends AppBarVariantProps, AppBarPrimitive.RootProps {}\n\nexport const AppBarRoot = forwardRef<HTMLDivElement, AppBarProps>((props, ref) => {\n const contextProps = useProps();\n const [variantProps, otherProps] = appBar.splitVariantProps({ ...contextProps, ...props });\n\n const classNames = appBar(variantProps);\n\n return (\n <ClassNamesProvider value={classNames}>\n <MainPropsProvider\n value={{\n theme: variantProps.theme,\n transitionStyle: variantProps.transitionStyle,\n tone: variantProps.tone,\n }}\n >\n <AppBarPrimitive.Root\n ref={ref}\n {...mergeProps({ className: classNames.root }, otherProps)}\n />\n </MainPropsProvider>\n </ClassNamesProvider>\n );\n});\nAppBarRoot.displayName = \"AppBarRoot\";\n\nexport interface AppBarLeftProps extends AppBarPrimitive.LeftProps {}\n\nexport const AppBarLeft = withContext<HTMLDivElement, AppBarLeftProps>(\n AppBarPrimitive.Left,\n \"left\",\n);\n\nexport interface AppBarRightProps extends AppBarPrimitive.RightProps {}\n\nexport const AppBarRight = withContext<HTMLDivElement, AppBarRightProps>(\n AppBarPrimitive.Right,\n \"right\",\n);\n\nexport interface AppBarMainProps extends AppBarMainVariantProps, AppBarPrimitive.MainProps {}\n\nexport const AppBarMain = withMainProvider<HTMLDivElement, AppBarMainProps>(\n AppBarPrimitive.Main,\n \"root\",\n);\n\nexport interface AppBarTitleProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {}\n\nexport const AppBarTitle = withMainContext<HTMLSpanElement, AppBarTitleProps>(\n Primitive.span,\n \"title\",\n);\n\nexport interface AppBarSubtitleProps\n extends PrimitiveProps,\n React.HTMLAttributes<HTMLSpanElement> {}\n\nexport const AppBarSubtitle = withMainContext<HTMLSpanElement, AppBarSubtitleProps>(\n Primitive.span,\n \"subtitle\",\n);\n\nexport interface AppBarIconButtonProps\n extends PrimitiveProps,\n React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AppBarIconButton = forwardRef<HTMLButtonElement, AppBarIconButtonProps>(\n ({ children, className, ...otherProps }, ref) => {\n const { stateProps } = useAppBarContext();\n const classNames = useClassNames();\n\n return (\n <Primitive.button\n ref={ref}\n type=\"button\"\n className={clsx(classNames.iconButton, className)}\n {...mergeProps(stateProps, otherProps)}\n >\n <Slot className={classNames.icon} {...stateProps}>\n {children}\n </Slot>\n </Primitive.button>\n );\n },\n);\nAppBarIconButton.displayName = \"IconButton\";\n", "import type { StackflowReactPlugin } from \"@stackflow/react\";\nimport { AppScreenPropsProvider } from \"./components/AppScreen/AppScreen\";\nimport { GlobalInteraction } from \"./primitive\";\n\nexport interface SeedPluginOptions {\n theme: \"android\" | \"cupertino\";\n}\n\nexport const seedPlugin =\n (options: SeedPluginOptions): StackflowReactPlugin =>\n () => ({\n key: \"seed-design\",\n wrapStack({ stack }) {\n return (\n <AppScreenPropsProvider value={options}>\n <GlobalInteraction>{stack.render()}</GlobalInteraction>\n </AppScreenPropsProvider>\n );\n },\n });\n", "export {\n AppBarIconButton as IconButton,\n AppBarLeft as Left,\n AppBarMain as Main,\n AppBarRight as Right,\n AppBarRoot as Root,\n AppBarSubtitle as Subtitle,\n AppBarTitle as Title,\n} from \"./AppBar\";\n\nexport type {\n AppBarIconButtonProps as IconButtonProps,\n AppBarLeftProps as LeftProps,\n AppBarMainProps as MainProps,\n AppBarRightProps as RightProps,\n AppBarProps as RootProps,\n AppBarSubtitleProps as SubtitleProps,\n AppBarTitleProps as TitleProps,\n} from \"./AppBar\";\n", "export {\n AppScreenDim as Dim,\n AppScreenEdge as Edge,\n AppScreenLayer as Layer,\n AppScreenRoot as Root,\n} from \"./AppScreen\";\n\nexport type {\n AppScreenDimProps as DimProps,\n AppScreenEdgeProps as EdgeProps,\n AppScreenLayerProps as LayerProps,\n AppScreenRootProps as RootProps,\n} from \"./AppScreen\";\n"],
|
|
4
|
+
"sourcesContent": ["import { appScreen, type AppScreenVariantProps } from \"@seed-design/css/recipes/app-screen\";\nimport { forwardRef, useMemo } from \"react\";\nimport { AppScreen as AppScreenPrimitive } from \"../../primitive\";\nimport { createStyleContext } from \"../../utils/createStyleContext\";\nimport { AppBarPropsProvider } from \"../AppBar/AppBar\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\n\nconst { ClassNamesProvider, PropsProvider, withContext, useProps } = createStyleContext(appScreen);\n\nexport const AppScreenPropsProvider = PropsProvider;\n\nexport interface AppScreenRootProps extends AppScreenVariantProps, AppScreenPrimitive.RootProps {}\n\nexport const AppScreenRoot = forwardRef<HTMLDivElement, AppScreenRootProps>((props, ref) => {\n const contextProps = useProps();\n const [variantProps, otherProps] = appScreen.splitVariantProps({ ...contextProps, ...props });\n\n // TODO: we have to implement conditional default in recipe; this is temporal workaround.\n const transitionStyle =\n variantProps.transitionStyle ??\n (variantProps.theme === \"cupertino\" ? \"slideFromRightIOS\" : \"fadeFromBottomAndroid\");\n\n const classNames = appScreen({\n ...variantProps,\n transitionStyle,\n });\n\n return (\n <ClassNamesProvider value={classNames}>\n <AppBarPropsProvider\n value={useMemo(\n () => ({ theme: variantProps.theme, transitionStyle }),\n [variantProps.theme, transitionStyle],\n )}\n >\n <AppScreenPrimitive.Root\n ref={ref}\n {...mergeProps({ className: classNames.root }, otherProps)}\n />\n </AppBarPropsProvider>\n </ClassNamesProvider>\n );\n});\nAppScreenRoot.displayName = \"AppScreenRoot\";\n\nexport interface AppScreenDimProps extends AppScreenPrimitive.DimProps {}\n\nexport const AppScreenDim = withContext<HTMLDivElement, AppScreenDimProps>(\n AppScreenPrimitive.Dim,\n \"dim\",\n);\n\nexport interface AppScreenEdgeProps extends AppScreenPrimitive.EdgeProps {}\n\nexport const AppScreenEdge = withContext<HTMLDivElement, AppScreenEdgeProps>(\n AppScreenPrimitive.Edge,\n \"edge\",\n);\n\nexport interface AppScreenLayerProps extends AppScreenPrimitive.LayerProps {}\n\nexport const AppScreenLayer = withContext<HTMLDivElement, AppScreenLayerProps>(\n AppScreenPrimitive.Layer,\n \"layer\",\n);\n", "export * from \"./AppScreen\";\nexport * from \"./AppBar\";\nexport * from \"./GlobalInteraction\";\n", "import { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useAppScreen, type UseAppScreenProps } from \"./useAppScreen\";\nimport { AppScreenProvider, useAppScreenContext } from \"./useAppScreenContext\";\n\nexport interface AppScreenRootProps\n extends PrimitiveProps,\n UseAppScreenProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenRoot = forwardRef<HTMLDivElement, AppScreenRootProps>((props, ref) => {\n const {\n swipeBackDisplacementRatioThreshold,\n swipeBackVelocityThreshold,\n onSwipeBackEnd,\n onSwipeBackMove,\n onSwipeBackStart,\n ...otherProps\n } = props;\n const api = useAppScreen({\n swipeBackDisplacementRatioThreshold,\n swipeBackVelocityThreshold,\n onSwipeBackEnd,\n onSwipeBackMove,\n onSwipeBackStart,\n });\n\n return (\n <AppScreenProvider value={api}>\n <Primitive.div\n ref={ref}\n data-stackflow-component-name=\"AppScreen\"\n {...mergeProps(api.activityProps, otherProps)}\n />\n </AppScreenProvider>\n );\n});\nAppScreenRoot.displayName = \"AppScreenRoot\";\n\nexport interface AppScreenDimProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenDim = forwardRef<HTMLDivElement, AppScreenDimProps>((props, ref) => {\n const { dimProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(dimProps, props)} />;\n});\nAppScreenDim.displayName = \"AppScreenDim\";\n\nexport interface AppScreenEdgeProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenEdge = forwardRef<HTMLDivElement, AppScreenEdgeProps>((props, ref) => {\n const { edgeProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(edgeProps, props)} />;\n});\nAppScreenEdge.displayName = \"AppScreenEdge\";\n\nexport interface AppScreenLayerProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppScreenLayer = forwardRef<HTMLDivElement, AppScreenLayerProps>((props, ref) => {\n const { layerProps } = useAppScreenContext();\n\n return <Primitive.div ref={ref} {...mergeProps(layerProps, props)} />;\n});\nAppScreenLayer.displayName = \"AppScreenLayer\";\n", "import { dataAttr, elementProps } from \"@seed-design/dom-utils\";\nimport { useNullableActivity, useZIndexBase } from \"@stackflow/react-ui-core\";\nimport { useMemo } from \"react\";\nimport { type UseSwipeBackProps, useSwipeBack } from \"../GlobalInteraction/useSwipeBack\";\n\nexport interface UseAppScreenProps extends UseSwipeBackProps {}\n\nexport type UseAppScreenReturn = ReturnType<typeof useAppScreen>;\n\nexport function useAppScreen(props: UseAppScreenProps) {\n const activity = useNullableActivity();\n\n const transitionState = activity?.transitionState ?? \"enter-done\";\n\n const { activityProps, layerProps, edgeProps } = useSwipeBack(props);\n\n const zIndexBase = useZIndexBase();\n const zIndexStyle = useMemo(\n () =>\n ({\n \"--z-index-base\": zIndexBase.toString(),\n }) as React.CSSProperties,\n [zIndexBase],\n );\n\n const stateProps = useMemo(\n () => ({\n \"data-activity-is-top\": dataAttr(activity?.isTop),\n \"data-activity-is-active\": dataAttr(activity?.isActive),\n \"data-transition-state\": transitionState,\n }),\n [transitionState, activity?.isActive, activity?.isTop],\n ) as React.HTMLAttributes<HTMLElement>;\n\n return useMemo(\n () => ({\n activity,\n stateProps,\n activityProps: elementProps({\n \"data-part\": \"activity\",\n \"data-activity-type\": \"full-screen\",\n ...activityProps,\n ...stateProps,\n \"data-activity-id\": activity?.id,\n style: zIndexStyle,\n // FIXME: @stackflow/react should prevent activity.id hydration mismatch; this is temporal fix.\n suppressHydrationWarning: true,\n }),\n dimProps: elementProps({\n \"data-part\": \"dim\",\n ...stateProps,\n }),\n layerProps: elementProps({\n \"data-part\": \"layer\",\n ...stateProps,\n ...layerProps,\n }),\n edgeProps: elementProps({\n \"data-part\": \"edge\",\n \"aria-hidden\": true,\n tabIndex: -1,\n ...edgeProps,\n ...stateProps,\n }),\n }),\n [activity, zIndexStyle, stateProps, activityProps, edgeProps, layerProps],\n );\n}\n", "import { useEffect, useMemo } from \"react\";\nimport type { SwipeBackProps } from \"./useGlobalInteraction\";\nimport { useGlobalInteractionContext } from \"./useGlobalInteractionContext\";\n\nexport interface UseSwipeBackProps extends SwipeBackProps {}\n\nexport function useSwipeBack(props: UseSwipeBackProps) {\n const globalInteraction = useGlobalInteractionContext();\n const events = globalInteraction.getSwipeBackEvents(props);\n\n useEffect(() => {\n return () => {\n events.reset();\n };\n }, [events]);\n\n return useMemo(\n () => ({\n activityProps: {\n \"data-swipe-back\": \"\",\n } as React.HTMLAttributes<HTMLDivElement>,\n layerProps: {\n onTransitionEnd: (e) => {\n if (e.target === e.currentTarget) {\n events.reset();\n }\n },\n onAnimationEnd: (e) => {\n if (e.target === e.currentTarget) {\n events.reset();\n }\n },\n } as React.HTMLAttributes<HTMLDivElement>,\n edgeProps: {\n tabIndex: -1,\n onTouchStart: (e) => {\n const x0 = e.touches[0].clientX;\n const t0 = Date.now();\n events.startSwipeBack({ x0, t0 });\n },\n onTouchMove: (e) => {\n const x = e.touches[0].clientX;\n const t = Date.now();\n events.moveSwipeBack({ x, t });\n },\n onTouchEnd: () => {\n events.endSwipeBack({});\n },\n onTouchCancel: () => {\n events.endSwipeBack({});\n },\n } as React.HTMLAttributes<HTMLElement>,\n }),\n [events],\n );\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseGlobalInteractionReturn } from \"./useGlobalInteraction\";\n\nexport interface UseGlobalInteractionContext extends UseGlobalInteractionReturn {}\n\nconst GlobalInteractionContext = createContext<UseGlobalInteractionContext | null>(null);\n\nexport const GlobalInteractionProvider = GlobalInteractionContext.Provider;\n\nexport function useGlobalInteractionContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false\n ? UseGlobalInteractionContext | null\n : UseGlobalInteractionContext {\n const context = useContext(GlobalInteractionContext);\n if (!context && strict) {\n throw new Error(\"useGlobalInteractionContext must be used within a GlobalInteractionProvider\");\n }\n\n return context as UseGlobalInteractionContext;\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseAppScreenReturn } from \"./useAppScreen\";\n\nexport interface UseAppScreenContext extends UseAppScreenReturn {}\n\nconst AppScreenContext = createContext<UseAppScreenContext | null>(null);\n\nexport const AppScreenProvider = AppScreenContext.Provider;\n\nexport function useAppScreenContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false ? UseAppScreenContext | null : UseAppScreenContext {\n const context = useContext(AppScreenContext);\n if (!context && strict) {\n throw new Error(\"useAppScreenContext must be used within a AppScreen\");\n }\n\n return context as UseAppScreenContext;\n}\n", "export {\n AppScreenDim as Dim,\n AppScreenEdge as Edge,\n AppScreenLayer as Layer,\n AppScreenRoot as Root,\n type AppScreenDimProps as DimProps,\n type AppScreenEdgeProps as EdgeProps,\n type AppScreenLayerProps as LayerProps,\n type AppScreenRootProps as RootProps,\n} from \"./AppScreen\";\n", "import { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useAppBar, type UseAppBarProps } from \"./useAppBar\";\nimport { AppBarProvider, useAppBarContext } from \"./useAppBarContext\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\n\nexport interface AppBarRootProps\n extends PrimitiveProps,\n UseAppBarProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarRoot = forwardRef<HTMLDivElement, AppBarRootProps>((props, ref) => {\n const { ...otherProps } = props;\n const api = useAppBar({});\n\n return (\n <AppBarProvider value={api}>\n <Primitive.div\n ref={composeRefs(api.refs.root, ref)}\n {...mergeProps(api.rootProps, otherProps)}\n />\n </AppBarProvider>\n );\n});\nAppBarRoot.displayName = \"AppBarRoot\";\n\nexport interface AppBarLeftProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarLeft = forwardRef<HTMLDivElement, AppBarLeftProps>((props, ref) => {\n const { refs, stateProps } = useAppBarContext();\n\n return <Primitive.div ref={composeRefs(refs.left, ref)} {...mergeProps(stateProps, props)} />;\n});\nAppBarLeft.displayName = \"AppBarLeft\";\n\nexport interface AppBarRightProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarRight = forwardRef<HTMLDivElement, AppBarRightProps>((props, ref) => {\n const { refs, stateProps } = useAppBarContext();\n\n return <Primitive.div ref={composeRefs(refs.right, ref)} {...mergeProps(stateProps, props)} />;\n});\nAppBarRight.displayName = \"AppBarRight\";\n\nexport interface AppBarMainProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}\n\nexport const AppBarMain = forwardRef<HTMLDivElement, AppBarMainProps>((props, ref) => {\n const { stateProps } = useAppBarContext();\n\n return <Primitive.div ref={ref} {...mergeProps(stateProps, props)} />;\n});\n", "import { elementProps } from \"@seed-design/dom-utils\";\nimport { useMemo, useState } from \"react\";\nimport { useAppScreenContext } from \"../AppScreen\";\nimport { useElementOffset } from \"../private/useElementOffset\";\n\n// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty for future extension\nexport interface UseAppBarProps {}\n\nexport type UseAppBarReturn = ReturnType<typeof useAppBar>;\n\nexport function useAppBar(_props: UseAppBarProps) {\n const { stateProps } = useAppScreenContext();\n\n const [root, rootRef] = useState<HTMLElement | null>(null);\n const [left, leftRef] = useState<HTMLElement | null>(null);\n const [right, rightRef] = useState<HTMLElement | null>(null);\n\n const leftOffset = useElementOffset(left);\n const rightOffset = useElementOffset(right);\n const centeredTitlePaddingX = root\n ? `${Math.max(leftOffset?.fromLeft ?? 0, rightOffset?.fromRight ?? 0)}px`\n : \"initial\";\n\n return useMemo(\n () => ({\n refs: {\n root: rootRef,\n left: leftRef,\n right: rightRef,\n },\n stateProps,\n rootProps: elementProps({\n \"data-part\": \"appBar\",\n ...stateProps,\n style: {\n \"--centered-title-padding-x\": centeredTitlePaddingX,\n } as React.CSSProperties,\n }),\n }),\n [stateProps, centeredTitlePaddingX],\n );\n}\n", "import * as React from \"react\";\n\nconst useLayoutEffect = typeof window !== \"undefined\" ? React.useLayoutEffect : React.useEffect;\n\nexport function useElementOffset(element: HTMLElement | null) {\n const [offset, setOffset] = React.useState<{ fromLeft: number; fromRight: number } | undefined>(\n undefined,\n );\n\n useLayoutEffect(() => {\n if (!element) {\n setOffset(undefined);\n return;\n }\n\n if (element) {\n // provide as early as possible\n setOffset({\n fromLeft: element.offsetLeft + element.offsetWidth,\n fromRight: (element.offsetParent ?? document.body).clientWidth - element.offsetLeft,\n });\n\n const resizeObserver = new ResizeObserver(() => {\n const fromLeft = element.offsetLeft + element.offsetWidth;\n const fromRight = (element.offsetParent ?? document.body).clientWidth - element.offsetLeft;\n\n setOffset({ fromLeft, fromRight });\n });\n\n resizeObserver.observe(element);\n\n return () => resizeObserver.unobserve(element);\n }\n }, [element]);\n\n return offset;\n}\n", "import { createContext, useContext } from \"react\";\nimport type { UseAppBarReturn } from \"./useAppBar\";\n\nexport interface UseAppBarContext extends UseAppBarReturn {}\n\nconst AppBarContext = createContext<UseAppBarContext | null>(null);\n\nexport const AppBarProvider = AppBarContext.Provider;\n\nexport function useAppBarContext<T extends boolean | undefined = true>({\n strict = true,\n}: { strict?: T } = {}): T extends false ? UseAppBarContext | null : UseAppBarContext {\n const context = useContext(AppBarContext);\n if (!context && strict) {\n throw new Error(\"useAppBarContext must be used within a AppBar\");\n }\n\n return context as UseAppBarContext;\n}\n", "export {\n AppBarRoot as Root,\n AppBarMain as Main,\n AppBarLeft as Left,\n AppBarRight as Right,\n type AppBarRootProps as RootProps,\n type AppBarMainProps as MainProps,\n type AppBarLeftProps as LeftProps,\n type AppBarRightProps as RightProps,\n} from \"./AppBar\";\n", "import { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { forwardRef } from \"react\";\nimport { useGlobalInteraction } from \"./useGlobalInteraction\";\nimport { GlobalInteractionProvider } from \"./useGlobalInteractionContext\";\n\nexport interface GlobalInteractionProps\n extends PrimitiveProps,\n React.HTMLAttributes<HTMLDivElement> {}\n\nexport const GlobalInteraction = forwardRef<HTMLDivElement, GlobalInteractionProps>(\n (props, ref) => {\n const api = useGlobalInteraction();\n return (\n <GlobalInteractionProvider value={api}>\n <Primitive.div\n ref={composeRefs(api.stackRef, ref)}\n {...mergeProps(api.stackProps, props)}\n />\n </GlobalInteractionProvider>\n );\n },\n);\nGlobalInteraction.displayName = \"GlobalInteraction\";\n", "import { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport { useTopActivity } from \"../private/useTopActivity\";\n\nexport type SwipeBackState = \"idle\" | \"swiping\" | \"transitioning\";\n\nexport type UseGlobalInteractionReturn = ReturnType<typeof useGlobalInteraction>;\n\nexport interface SwipeBackContext {\n x0: number;\n t0: number;\n displacement: number;\n displacementRatio: number;\n velocity: number;\n}\n\nexport interface SwipeBackProps {\n /**\n * The threshold to determine whether the swipe back is intentional.\n * @default 0.4\n */\n swipeBackDisplacementRatioThreshold?: number;\n\n /**\n * The threshold to determine whether the swipe back is intentional.\n * @default 1\n */\n swipeBackVelocityThreshold?: number;\n\n onSwipeBackStart?: () => void;\n onSwipeBackMove?: (props: { displacement: number; displacementRatio: number }) => void;\n onSwipeBackEnd?: (props: { swiped: boolean }) => void;\n}\n\nexport interface StartSwipeBackProps {\n x0: number;\n t0: number;\n}\n\nexport interface MoveSwipeBackProps {\n x: number;\n t: number;\n}\n\n// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty for future extension\nexport interface EndSwipeBackProps {}\n\nexport function useGlobalInteraction() {\n const [swipeBackState, setSwipeBackState] = useState<SwipeBackState>(\"idle\");\n\n const swipeBackContextRef = useRef<SwipeBackContext>({\n x0: 0,\n t0: 0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n const stackRef = useRef<HTMLDivElement>(null);\n\n const setSwipeBackContext = useCallback((ctx: SwipeBackContext) => {\n swipeBackContextRef.current = ctx;\n stackRef.current?.style.setProperty(\n \"--swipe-back-displacement\",\n `${ctx.displacement.toString()}px`,\n );\n stackRef.current?.style.setProperty(\n \"--swipe-back-displacement-ratio\",\n ctx.displacementRatio.toString(),\n );\n }, []);\n\n const getSwipeBackEvents = useCallback(\n (props: SwipeBackProps) => {\n const {\n swipeBackDisplacementRatioThreshold: displacementRatioThreshold = 0.4,\n swipeBackVelocityThreshold: velocityThreshold = 1,\n } = props;\n const onSwipeStart = useCallbackRef(props.onSwipeBackStart);\n const onSwipeMove = useCallbackRef(props.onSwipeBackMove);\n const onSwipeEnd = useCallbackRef(props.onSwipeBackEnd);\n\n const startSwipeBack = useCallback(\n ({ x0, t0 }: StartSwipeBackProps) => {\n setSwipeBackContext({\n x0,\n t0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n setSwipeBackState(\"swiping\");\n\n onSwipeStart?.();\n },\n [onSwipeStart],\n );\n\n const moveSwipeBack = useCallback(\n ({ x, t }: MoveSwipeBackProps) => {\n const displacement = x - swipeBackContextRef.current.x0;\n const displacementRatio = displacement / window.innerWidth;\n const velocity = displacement / (t - swipeBackContextRef.current.t0);\n setSwipeBackContext({\n ...swipeBackContextRef.current,\n displacement,\n displacementRatio,\n velocity,\n });\n setSwipeBackState(\"swiping\");\n\n onSwipeMove?.({ displacement, displacementRatio });\n },\n [onSwipeMove],\n );\n\n const endSwipeBack = useCallback(\n (_: EndSwipeBackProps) => {\n const swiped =\n swipeBackContextRef.current.displacementRatio > displacementRatioThreshold ||\n swipeBackContextRef.current.velocity > velocityThreshold;\n\n // we intentionally do not reset context here, so that the displacement can be used for exit animation\n setSwipeBackState(\"transitioning\");\n\n onSwipeEnd?.({ swiped });\n },\n [onSwipeEnd, displacementRatioThreshold, velocityThreshold],\n );\n\n const reset = useCallback(() => {\n setSwipeBackContext({\n x0: 0,\n t0: 0,\n displacement: 0,\n displacementRatio: 0,\n velocity: 0,\n });\n setSwipeBackState(\"idle\");\n }, []);\n\n return useMemo(\n () => ({\n startSwipeBack,\n moveSwipeBack,\n endSwipeBack,\n reset,\n }),\n [startSwipeBack, moveSwipeBack, endSwipeBack, reset],\n );\n },\n [setSwipeBackContext],\n );\n\n const topActivity = useTopActivity();\n\n const stackProps = useMemo(\n () => ({\n \"data-swipe-back-state\": swipeBackState,\n \"data-global-transition-state\": topActivity.transitionState,\n \"data-top-activity-type\": topActivity.activityType,\n }),\n [swipeBackState, topActivity.transitionState, topActivity.activityType],\n ) as React.HTMLAttributes<HTMLElement>;\n\n return useMemo(\n () => ({\n stackRef,\n swipeBackContextRef,\n swipeBackState,\n setSwipeBackState,\n setSwipeBackContext,\n getSwipeBackEvents,\n\n stackProps,\n }),\n [swipeBackState, setSwipeBackContext, getSwipeBackEvents, stackProps],\n );\n}\n", "import { useStack } from \"@stackflow/react\";\nimport { useEffect, useState } from \"react\";\n\nexport function useTopActivity() {\n const stack = useStack();\n if (!stack) {\n throw new Error(\n \"useStack is not available in the context. Make sure you are using @stackflow/react >= 1.4.1. (https://github.com/daangn/stackflow/blob/main/integrations/react/CHANGELOG.md#141)\",\n );\n }\n\n const topId = stack.activities.find((activity) => activity.isTop)?.id;\n const topActivity = stack.activities.find((activity) => activity.isTop);\n const transitionState = topActivity?.transitionState ?? \"enter-done\";\n\n // TODO: There should be a better way to handle this. We should not rely on the DOM element to get the activity type.\n const [topEl, setTopEl] = useState<HTMLElement | null>(null);\n const activityType = topEl?.dataset[\"activityType\"];\n\n useEffect(() => {\n if (!topId) return;\n\n const el = document.querySelector<HTMLElement>(`[data-activity-id=\"${topId}\"]`);\n setTopEl(el);\n }, [topId]);\n\n return {\n transitionState,\n activityType,\n };\n}\n", "import clsx from \"clsx\";\nimport { createContext, forwardRef, useContext } from \"react\";\n\ntype Recipe<\n Props extends Record<string, string | boolean | undefined>,\n Classnames extends Record<string, string>,\n> = ((props?: Props) => Classnames) & {\n splitVariantProps: <T extends Props>(props: T) => [Props, Omit<T, keyof Props>];\n};\n\nexport function createStyleContext<\n Props extends Record<string, string | boolean | undefined>,\n Classnames extends Record<string, string>,\n>(recipe: Recipe<Props, Classnames>) {\n const ClassNamesContext = createContext<Classnames | null>(null);\n const PropsContext = createContext<Props | null>(null);\n\n const ClassNamesProvider = ({\n children,\n value,\n }: { children: React.ReactNode; value: Classnames }) => {\n return <ClassNamesContext.Provider value={value}>{children}</ClassNamesContext.Provider>;\n };\n\n const PropsProvider = ({ children, value }: { children: React.ReactNode; value: Props }) => {\n return <PropsContext.Provider value={value}>{children}</PropsContext.Provider>;\n };\n\n function useClassNames() {\n const context = useContext(ClassNamesContext);\n if (context === null) {\n throw new Error(\n \"useClassNames must be used within a ClassNamesProvider. Did you forget to wrap your component in a ClassNamesProvider?\",\n );\n }\n\n return context;\n }\n\n function useProps() {\n return useContext(PropsContext);\n }\n\n const withRootProvider = <P,>(\n Component: React.ElementType<any>,\n options?: {\n defaultProps?: Partial<P>;\n },\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P>> => {\n const { defaultProps } = options ?? {};\n\n const StyledComponent = (innerProps: any) => {\n const props = { ...(defaultProps ?? {}), ...useProps(), ...innerProps } as Props &\n React.HTMLAttributes<HTMLElement>;\n const [variantProps, otherProps] = recipe.splitVariantProps(props);\n const classNames = recipe(variantProps); // TODO: should we memoize this?\n\n return (\n <ClassNamesProvider value={classNames}>\n <Component {...otherProps} />\n </ClassNamesProvider>\n );\n };\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n\n return StyledComponent as any;\n };\n\n const withProvider = <T, P>(\n Component: React.ElementType<any>,\n slot: keyof Classnames,\n options?: {\n defaultProps?: Partial<P>;\n },\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>> => {\n const { defaultProps } = options ?? {};\n\n const StyledComponent = forwardRef<any, any>((innerProps, ref) => {\n const props = { ...(defaultProps ?? {}), ...useProps(), ...innerProps } as Props &\n React.HTMLAttributes<HTMLElement>;\n const [variantProps, otherProps] = recipe.splitVariantProps(props);\n const classNames = recipe(variantProps); // TODO: should we memoize this?\n const className = classNames[slot as keyof typeof classNames];\n\n return (\n <ClassNamesProvider value={classNames}>\n <Component ref={ref} {...otherProps} className={clsx(className, props.className)} />\n </ClassNamesProvider>\n );\n });\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n\n return StyledComponent as any;\n };\n\n const withContext = <T, P>(\n Component: React.ElementType<any>,\n slot?: keyof Classnames,\n ): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>> => {\n const StyledComponent = forwardRef<any, React.HTMLAttributes<HTMLElement>>((props, ref) => {\n const classNames = useClassNames();\n const className = classNames?.[slot as keyof typeof classNames];\n\n return <Component ref={ref} {...props} className={clsx(className, props.className)} />;\n });\n\n // @ts-ignore\n StyledComponent.displayName = Component.displayName || Component.name;\n return StyledComponent as any;\n };\n\n return {\n ClassNamesProvider,\n PropsProvider,\n useClassNames,\n useProps,\n withRootProvider,\n withProvider,\n withContext,\n };\n}\n", "import { Slot } from \"@radix-ui/react-slot\";\nimport { mergeProps } from \"@seed-design/dom-utils\";\nimport { Primitive, type PrimitiveProps } from \"@seed-design/react-primitive\";\nimport { type AppBarVariantProps, appBar } from \"@seed-design/css/recipes/app-bar\";\nimport clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport { AppBar as AppBarPrimitive } from \"../../primitive\";\nimport { useAppBarContext } from \"../../primitive/AppBar/useAppBarContext\";\nimport { createStyleContext } from \"../../utils/createStyleContext\";\nimport { appBarMain, type AppBarMainVariantProps } from \"@seed-design/css/recipes/app-bar-main\";\n\nconst { PropsProvider, ClassNamesProvider, useProps, withContext, useClassNames } =\n createStyleContext(appBar);\nconst {\n PropsProvider: MainPropsProvider,\n withProvider: withMainProvider,\n withContext: withMainContext,\n} = createStyleContext(appBarMain);\n\nexport const AppBarPropsProvider = PropsProvider;\n\nexport interface AppBarProps extends AppBarVariantProps, AppBarPrimitive.RootProps {}\n\nexport const AppBarRoot = forwardRef<HTMLDivElement, AppBarProps>((props, ref) => {\n const contextProps = useProps();\n const [variantProps, otherProps] = appBar.splitVariantProps({ ...contextProps, ...props });\n\n const classNames = appBar(variantProps);\n\n return (\n <ClassNamesProvider value={classNames}>\n <MainPropsProvider\n value={{\n theme: variantProps.theme,\n transitionStyle: variantProps.transitionStyle,\n tone: variantProps.tone,\n }}\n >\n <AppBarPrimitive.Root\n ref={ref}\n {...mergeProps({ className: classNames.root }, otherProps)}\n />\n </MainPropsProvider>\n </ClassNamesProvider>\n );\n});\nAppBarRoot.displayName = \"AppBarRoot\";\n\nexport interface AppBarLeftProps extends AppBarPrimitive.LeftProps {}\n\nexport const AppBarLeft = withContext<HTMLDivElement, AppBarLeftProps>(\n AppBarPrimitive.Left,\n \"left\",\n);\n\nexport interface AppBarRightProps extends AppBarPrimitive.RightProps {}\n\nexport const AppBarRight = withContext<HTMLDivElement, AppBarRightProps>(\n AppBarPrimitive.Right,\n \"right\",\n);\n\nexport interface AppBarMainProps extends AppBarMainVariantProps, AppBarPrimitive.MainProps {}\n\nexport const AppBarMain = withMainProvider<HTMLDivElement, AppBarMainProps>(\n AppBarPrimitive.Main,\n \"root\",\n);\n\nexport interface AppBarTitleProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {}\n\nexport const AppBarTitle = withMainContext<HTMLSpanElement, AppBarTitleProps>(\n Primitive.span,\n \"title\",\n);\n\nexport interface AppBarSubtitleProps\n extends PrimitiveProps,\n React.HTMLAttributes<HTMLSpanElement> {}\n\nexport const AppBarSubtitle = withMainContext<HTMLSpanElement, AppBarSubtitleProps>(\n Primitive.span,\n \"subtitle\",\n);\n\nexport interface AppBarIconButtonProps\n extends PrimitiveProps,\n React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AppBarIconButton = forwardRef<HTMLButtonElement, AppBarIconButtonProps>(\n ({ children, className, ...otherProps }, ref) => {\n const { stateProps } = useAppBarContext();\n const classNames = useClassNames();\n\n return (\n <Primitive.button\n ref={ref}\n type=\"button\"\n className={clsx(classNames.iconButton, className)}\n {...mergeProps(stateProps, otherProps)}\n >\n <Slot className={classNames.icon} {...stateProps}>\n {children}\n </Slot>\n </Primitive.button>\n );\n },\n);\nAppBarIconButton.displayName = \"IconButton\";\n", "import type { StackflowReactPlugin } from \"@stackflow/react\";\nimport { AppScreenPropsProvider } from \"./components/AppScreen/AppScreen\";\nimport { GlobalInteraction } from \"./primitive\";\n\nexport interface SeedPluginOptions {\n theme: \"android\" | \"cupertino\";\n}\n\nexport const seedPlugin =\n (options: SeedPluginOptions): StackflowReactPlugin =>\n () => ({\n key: \"seed-design\",\n wrapStack({ stack }) {\n return (\n <AppScreenPropsProvider value={options}>\n <GlobalInteraction>{stack.render()}</GlobalInteraction>\n </AppScreenPropsProvider>\n );\n },\n });\n", "export {\n AppBarIconButton as IconButton,\n AppBarLeft as Left,\n AppBarMain as Main,\n AppBarRight as Right,\n AppBarRoot as Root,\n AppBarSubtitle as Subtitle,\n AppBarTitle as Title,\n} from \"./AppBar\";\n\nexport type {\n AppBarIconButtonProps as IconButtonProps,\n AppBarLeftProps as LeftProps,\n AppBarMainProps as MainProps,\n AppBarRightProps as RightProps,\n AppBarProps as RootProps,\n AppBarSubtitleProps as SubtitleProps,\n AppBarTitleProps as TitleProps,\n} from \"./AppBar\";\n", "export {\n AppScreenDim as Dim,\n AppScreenEdge as Edge,\n AppScreenLayer as Layer,\n AppScreenRoot as Root,\n} from \"./AppScreen\";\n\nexport type {\n AppScreenDimProps as DimProps,\n AppScreenEdgeProps as EdgeProps,\n AppScreenLayerProps as LayerProps,\n AppScreenRootProps as RootProps,\n} from \"./AppScreen\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;AAAA,SAAS,iBAA6C;AACtD,SAAS,cAAAA,aAAY,WAAAC,gBAAe;;;ACDpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAsC;AAC/C,SAAS,kBAAkB;;;ACF3B,SAAS,UAAU,oBAAoB;AACvC,SAAS,qBAAqB,qBAAqB;AACnD,SAAS,WAAAC,gBAAe;;;ACFxB,SAAS,WAAW,eAAe;;;ACAnC,SAAS,eAAe,kBAAkB;AAK1C,IAAM,2BAA2B,cAAkD,IAAI;AAEhF,IAAM,4BAA4B,yBAAyB;AAE3D,SAAS,4BAAkE;AAAA,EAChF,SAAS;AACX,IAAoB,CAAC,GAEW;AAC9B,QAAM,UAAU,WAAW,wBAAwB;AACnD,MAAI,CAAC,WAAW,QAAQ;AACtB,UAAM,IAAI,MAAM,6EAA6E;AAAA,EAC/F;AAEA,SAAO;AACT;;;ADdO,SAAS,aAAa,OAA0B;AACrD,QAAM,oBAAoB,4BAA4B;AACtD,QAAM,SAAS,kBAAkB,mBAAmB,KAAK;AAEzD,YAAU,MAAM;AACd,WAAO,MAAM;AACX,aAAO,MAAM;AAAA,IACf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4BAAmB;AAAA,EACnB;AACF;AAIO,IAAMO,kBAAiBP;AAAA,EAC5B,4BAAmB;AAAA,EACnB;AACF;;;AkBjDU,gBAAAQ,YAAA;AAPH,IAAM,aACX,CAAC,YACD,OAAO;AAAA,EACL,KAAK;AAAA,EACL,UAAU,EAAE,MAAM,GAAG;AACnB,WACE,gBAAAA,KAAC,0BAAuB,OAAO,SAC7B,0BAAAA,KAAC,qBAAmB,gBAAM,OAAO,GAAE,GACrC;AAAA,EAEJ;AACF;;;ACnBF,IAAAC,4BAAA;AAAA,SAAAA,2BAAA;AAAA;AAAA,cAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,IAAAC,+BAAA;AAAA,SAAAA,8BAAA;AAAA,aAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,YAAAC;AAAA;",
|
|
6
6
|
"names": ["forwardRef", "useMemo", "useMemo", "useMemo", "createContext", "useContext", "Primitive", "forwardRef", "elementProps", "useMemo", "useState", "useLayoutEffect", "_a", "useState", "useMemo", "elementProps", "createContext", "useContext", "mergeProps", "jsx", "forwardRef", "Primitive", "composeRefs", "mergeProps", "Primitive", "forwardRef", "useMemo", "useState", "useEffect", "useState", "useState", "useMemo", "jsx", "forwardRef", "Primitive", "composeRefs", "mergeProps", "createContext", "forwardRef", "useContext", "jsx", "ClassNamesProvider", "PropsProvider", "useClassNames", "useProps", "withContext", "mergeProps", "Primitive", "clsx", "forwardRef", "jsx", "AppBarRoot", "forwardRef", "mergeProps", "AppBarLeft", "AppBarRight", "AppBarMain", "Primitive", "clsx", "mergeProps", "jsx", "ClassNamesProvider", "PropsProvider", "withContext", "useProps", "AppScreenRoot", "forwardRef", "useMemo", "AppScreenDim", "AppScreenEdge", "AppScreenLayer", "jsx", "AppBar_namespace_exports", "AppBarLeft", "AppBarMain", "AppBarRight", "AppBarRoot", "AppScreen_namespace_exports", "AppScreenDim", "AppScreenEdge", "AppScreenLayer", "AppScreenRoot"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/stackflow",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-rc.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"src"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
"prepack": "bun run build",
|
|
25
24
|
"clean": "rm -rf lib",
|
|
26
25
|
"build": "bun build.mjs && tsc"
|
|
27
26
|
},
|
|
@@ -29,8 +28,8 @@
|
|
|
29
28
|
"@radix-ui/react-compose-refs": "^1.1.1",
|
|
30
29
|
"@radix-ui/react-slot": "^1.1.1",
|
|
31
30
|
"@radix-ui/react-use-callback-ref": "^1.1.0",
|
|
32
|
-
"@seed-design/dom-utils": "0.0.0
|
|
33
|
-
"@seed-design/react-primitive": "0.0.1-
|
|
31
|
+
"@seed-design/dom-utils": "0.0.1-rc.0",
|
|
32
|
+
"@seed-design/react-primitive": "0.0.1-rc.0",
|
|
34
33
|
"clsx": "^2.1.1"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
"esbuild": "^0.25.0"
|
|
39
38
|
},
|
|
40
39
|
"peerDependencies": {
|
|
41
|
-
"@seed-design/
|
|
40
|
+
"@seed-design/css": "0.0.1-rc.1",
|
|
42
41
|
"@stackflow/react": ">=1.4.1",
|
|
43
42
|
"@stackflow/react-ui-core": ">=1.2.1",
|
|
44
43
|
"react": ">=18.0.0",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Slot } from "@radix-ui/react-slot";
|
|
2
2
|
import { mergeProps } from "@seed-design/dom-utils";
|
|
3
3
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
4
|
-
import { type AppBarVariantProps, appBar } from "@seed-design/
|
|
4
|
+
import { type AppBarVariantProps, appBar } from "@seed-design/css/recipes/app-bar";
|
|
5
5
|
import clsx from "clsx";
|
|
6
6
|
import { forwardRef } from "react";
|
|
7
7
|
import { AppBar as AppBarPrimitive } from "../../primitive";
|
|
8
8
|
import { useAppBarContext } from "../../primitive/AppBar/useAppBarContext";
|
|
9
9
|
import { createStyleContext } from "../../utils/createStyleContext";
|
|
10
|
-
import { appBarMain, type AppBarMainVariantProps } from "@seed-design/
|
|
10
|
+
import { appBarMain, type AppBarMainVariantProps } from "@seed-design/css/recipes/app-bar-main";
|
|
11
11
|
|
|
12
12
|
const { PropsProvider, ClassNamesProvider, useProps, withContext, useClassNames } =
|
|
13
13
|
createStyleContext(appBar);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { appScreen, type AppScreenVariantProps } from "@seed-design/
|
|
1
|
+
import { appScreen, type AppScreenVariantProps } from "@seed-design/css/recipes/app-screen";
|
|
2
2
|
import { forwardRef, useMemo } from "react";
|
|
3
3
|
import { AppScreen as AppScreenPrimitive } from "../../primitive";
|
|
4
4
|
import { createStyleContext } from "../../utils/createStyleContext";
|