@seed-design/stackflow 0.0.0-alpha-20260414104312

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.
Files changed (127) hide show
  1. package/lib/components/AppBar/AppBar.cjs +115 -0
  2. package/lib/components/AppBar/AppBar.d.ts +34 -0
  3. package/lib/components/AppBar/AppBar.js +103 -0
  4. package/lib/components/AppBar/AppBar.namespace.cjs +16 -0
  5. package/lib/components/AppBar/AppBar.namespace.d.ts +2 -0
  6. package/lib/components/AppBar/AppBar.namespace.js +1 -0
  7. package/lib/components/AppBar/index.cjs +18 -0
  8. package/lib/components/AppBar/index.d.ts +3 -0
  9. package/lib/components/AppBar/index.js +3 -0
  10. package/lib/components/AppScreen/AppScreen.cjs +68 -0
  11. package/lib/components/AppScreen/AppScreen.d.ts +23 -0
  12. package/lib/components/AppScreen/AppScreen.js +60 -0
  13. package/lib/components/AppScreen/AppScreen.namespace.cjs +13 -0
  14. package/lib/components/AppScreen/AppScreen.namespace.d.ts +2 -0
  15. package/lib/components/AppScreen/AppScreen.namespace.js +1 -0
  16. package/lib/components/AppScreen/index.cjs +15 -0
  17. package/lib/components/AppScreen/index.d.ts +3 -0
  18. package/lib/components/AppScreen/index.js +3 -0
  19. package/lib/components/index.cjs +26 -0
  20. package/lib/components/index.d.ts +2 -0
  21. package/lib/components/index.js +6 -0
  22. package/lib/hooks/index.cjs +9 -0
  23. package/lib/hooks/index.d.ts +1 -0
  24. package/lib/hooks/index.js +1 -0
  25. package/lib/hooks/useActivityZIndexBase.cjs +14 -0
  26. package/lib/hooks/useActivityZIndexBase.d.ts +18 -0
  27. package/lib/hooks/useActivityZIndexBase.js +10 -0
  28. package/lib/index.cjs +32 -0
  29. package/lib/index.d.ts +4 -0
  30. package/lib/index.js +10 -0
  31. package/lib/plugin.cjs +18 -0
  32. package/lib/plugin.d.ts +7 -0
  33. package/lib/plugin.js +14 -0
  34. package/lib/primitive/AppBar/AppBar.cjs +44 -0
  35. package/lib/primitive/AppBar/AppBar.d.ts +15 -0
  36. package/lib/primitive/AppBar/AppBar.js +37 -0
  37. package/lib/primitive/AppBar/AppBar.namespace.cjs +12 -0
  38. package/lib/primitive/AppBar/AppBar.namespace.d.ts +1 -0
  39. package/lib/primitive/AppBar/AppBar.namespace.js +1 -0
  40. package/lib/primitive/AppBar/index.cjs +14 -0
  41. package/lib/primitive/AppBar/index.d.ts +2 -0
  42. package/lib/primitive/AppBar/index.js +3 -0
  43. package/lib/primitive/AppBar/useAppBar.cjs +39 -0
  44. package/lib/primitive/AppBar/useAppBar.d.ts +294 -0
  45. package/lib/primitive/AppBar/useAppBar.js +35 -0
  46. package/lib/primitive/AppBar/useAppBarContext.cjs +21 -0
  47. package/lib/primitive/AppBar/useAppBarContext.d.ts +8 -0
  48. package/lib/primitive/AppBar/useAppBarContext.js +16 -0
  49. package/lib/primitive/AppScreen/AppScreen.cjs +64 -0
  50. package/lib/primitive/AppScreen/AppScreen.d.ts +15 -0
  51. package/lib/primitive/AppScreen/AppScreen.js +57 -0
  52. package/lib/primitive/AppScreen/AppScreen.namespace.cjs +12 -0
  53. package/lib/primitive/AppScreen/AppScreen.namespace.d.ts +1 -0
  54. package/lib/primitive/AppScreen/AppScreen.namespace.js +1 -0
  55. package/lib/primitive/AppScreen/index.cjs +16 -0
  56. package/lib/primitive/AppScreen/index.d.ts +3 -0
  57. package/lib/primitive/AppScreen/index.js +4 -0
  58. package/lib/primitive/AppScreen/useAppScreen.cjs +66 -0
  59. package/lib/primitive/AppScreen/useAppScreen.d.ts +1138 -0
  60. package/lib/primitive/AppScreen/useAppScreen.js +62 -0
  61. package/lib/primitive/AppScreen/useAppScreenContext.cjs +21 -0
  62. package/lib/primitive/AppScreen/useAppScreenContext.d.ts +8 -0
  63. package/lib/primitive/AppScreen/useAppScreenContext.js +16 -0
  64. package/lib/primitive/GlobalInteraction/GlobalInteraction.cjs +28 -0
  65. package/lib/primitive/GlobalInteraction/GlobalInteraction.d.ts +5 -0
  66. package/lib/primitive/GlobalInteraction/GlobalInteraction.js +24 -0
  67. package/lib/primitive/GlobalInteraction/index.cjs +11 -0
  68. package/lib/primitive/GlobalInteraction/index.d.ts +2 -0
  69. package/lib/primitive/GlobalInteraction/index.js +2 -0
  70. package/lib/primitive/GlobalInteraction/useGlobalInteraction.cjs +136 -0
  71. package/lib/primitive/GlobalInteraction/useGlobalInteraction.d.ts +54 -0
  72. package/lib/primitive/GlobalInteraction/useGlobalInteraction.js +132 -0
  73. package/lib/primitive/GlobalInteraction/useGlobalInteractionContext.cjs +21 -0
  74. package/lib/primitive/GlobalInteraction/useGlobalInteractionContext.d.ts +8 -0
  75. package/lib/primitive/GlobalInteraction/useGlobalInteractionContext.js +16 -0
  76. package/lib/primitive/GlobalInteraction/useSwipeBack.cjs +58 -0
  77. package/lib/primitive/GlobalInteraction/useSwipeBack.d.ts +8 -0
  78. package/lib/primitive/GlobalInteraction/useSwipeBack.js +54 -0
  79. package/lib/primitive/index.cjs +27 -0
  80. package/lib/primitive/index.d.ts +3 -0
  81. package/lib/primitive/index.js +9 -0
  82. package/lib/primitive/private/useElementOffset.cjs +54 -0
  83. package/lib/primitive/private/useElementOffset.d.ts +4 -0
  84. package/lib/primitive/private/useElementOffset.js +31 -0
  85. package/lib/primitive/private/useTopActivity.cjs +34 -0
  86. package/lib/primitive/private/useTopActivity.d.ts +5 -0
  87. package/lib/primitive/private/useTopActivity.js +30 -0
  88. package/lib/utils/createStyleContext.cjs +77 -0
  89. package/lib/utils/createStyleContext.d.ts +23 -0
  90. package/lib/utils/createStyleContext.js +73 -0
  91. package/lib/utils/createWithStateProps.d.ts +10 -0
  92. package/lib/utils/styled.cjs +25 -0
  93. package/lib/utils/styled.d.ts +16 -0
  94. package/lib/utils/styled.js +21 -0
  95. package/package.json +61 -0
  96. package/src/components/AppBar/AppBar.namespace.ts +21 -0
  97. package/src/components/AppBar/AppBar.tsx +146 -0
  98. package/src/components/AppBar/index.ts +23 -0
  99. package/src/components/AppScreen/AppScreen.namespace.ts +14 -0
  100. package/src/components/AppScreen/AppScreen.tsx +83 -0
  101. package/src/components/AppScreen/index.ts +16 -0
  102. package/src/components/index.ts +2 -0
  103. package/src/hooks/index.ts +1 -0
  104. package/src/hooks/useActivityZIndexBase.ts +26 -0
  105. package/src/index.ts +6 -0
  106. package/src/plugin.tsx +27 -0
  107. package/src/primitive/AppBar/AppBar.namespace.ts +10 -0
  108. package/src/primitive/AppBar/AppBar.tsx +52 -0
  109. package/src/primitive/AppBar/index.ts +12 -0
  110. package/src/primitive/AppBar/useAppBar.tsx +42 -0
  111. package/src/primitive/AppBar/useAppBarContext.ts +21 -0
  112. package/src/primitive/AppScreen/AppScreen.namespace.ts +10 -0
  113. package/src/primitive/AppScreen/AppScreen.tsx +72 -0
  114. package/src/primitive/AppScreen/index.ts +13 -0
  115. package/src/primitive/AppScreen/useAppScreen.tsx +69 -0
  116. package/src/primitive/AppScreen/useAppScreenContext.ts +21 -0
  117. package/src/primitive/GlobalInteraction/GlobalInteraction.tsx +25 -0
  118. package/src/primitive/GlobalInteraction/index.ts +6 -0
  119. package/src/primitive/GlobalInteraction/useGlobalInteraction.ts +188 -0
  120. package/src/primitive/GlobalInteraction/useGlobalInteractionContext.tsx +21 -0
  121. package/src/primitive/GlobalInteraction/useSwipeBack.ts +56 -0
  122. package/src/primitive/index.ts +3 -0
  123. package/src/primitive/private/useElementOffset.ts +37 -0
  124. package/src/primitive/private/useTopActivity.ts +33 -0
  125. package/src/utils/createStyleContext.tsx +128 -0
  126. package/src/utils/createWithStateProps.tsx +28 -0
  127. package/src/utils/styled.ts +41 -0
@@ -0,0 +1,115 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const reactSlot = require('@radix-ui/react-slot');
8
+ const appBar = require('@seed-design/css/recipes/app-bar');
9
+ const appBarMain = require('@seed-design/css/recipes/app-bar-main');
10
+ const domUtils = require('@seed-design/dom-utils');
11
+ const reactPrimitive = require('@seed-design/react-primitive');
12
+ const clsx = require('clsx');
13
+ const React = require('react');
14
+ const AppBar = require('../../primitive/AppBar/AppBar.cjs');
15
+ const useAppBarContext = require('../../primitive/AppBar/useAppBarContext.cjs');
16
+ const createStyleContext = require('../../utils/createStyleContext.cjs');
17
+ const useTopActivity = require('../../primitive/private/useTopActivity.cjs');
18
+ const react = require('@stackflow/react');
19
+ const styled = require('../../utils/styled.cjs');
20
+
21
+ const { PropsProvider, ClassNamesProvider, useProps, withContext, useClassNames } = createStyleContext.createStyleContext(appBar.appBar);
22
+ const {
23
+ PropsProvider: MainPropsProvider,
24
+ withProvider: withMainProvider,
25
+ withContext: withMainContext
26
+ } = createStyleContext.createStyleContext(appBarMain.appBarMain);
27
+ const AppBarPropsProvider = PropsProvider;
28
+ const AppBarRoot = React.forwardRef((props, ref) => {
29
+ const { style: boxStyle, restProps: propsWithoutBoxProps } = styled.useBoxBackgroundProps(props);
30
+ const contextProps = useProps();
31
+ const [variantProps, otherProps] = appBar.appBar.splitVariantProps({
32
+ ...contextProps,
33
+ ...propsWithoutBoxProps
34
+ });
35
+ const topActivityTransitionStyle = useTopActivity.useTopActivity().transitionStyle;
36
+ const resolvedVariantProps = {
37
+ // this includes the default transitionStyle decided by theme, from contextProps or props
38
+ ...variantProps,
39
+ ...react.useActivity().isTop === false && {
40
+ transitionStyle: topActivityTransitionStyle
41
+ }
42
+ };
43
+ const classNames = appBar.appBar(resolvedVariantProps);
44
+ return /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(MainPropsProvider, { value: resolvedVariantProps, children: /* @__PURE__ */ jsxRuntime.jsx(
45
+ AppBar.AppBarRoot,
46
+ {
47
+ ref,
48
+ ...domUtils.mergeProps({ className: classNames.root, style: boxStyle }, otherProps)
49
+ }
50
+ ) }) });
51
+ });
52
+ AppBarRoot.displayName = "AppBarRoot";
53
+ const AppBarLeft = withContext(
54
+ AppBar.AppBarLeft,
55
+ "left"
56
+ );
57
+ const AppBarRight = withContext(
58
+ AppBar.AppBarRight,
59
+ "right"
60
+ );
61
+ const AppBarMain = withMainProvider(
62
+ AppBar.AppBarMain,
63
+ "root"
64
+ );
65
+ const AppBarTitle = withMainContext(
66
+ reactPrimitive.Primitive.span,
67
+ "title"
68
+ );
69
+ const AppBarSubtitle = withMainContext(
70
+ reactPrimitive.Primitive.span,
71
+ "subtitle"
72
+ );
73
+ const AppBarIconButton = React.forwardRef(
74
+ ({ children, className, ...otherProps }, ref) => {
75
+ const { stateProps } = useAppBarContext.useAppBarContext();
76
+ const classNames = useClassNames();
77
+ return /* @__PURE__ */ jsxRuntime.jsx(
78
+ reactPrimitive.Primitive.button,
79
+ {
80
+ ref,
81
+ type: "button",
82
+ className: clsx(classNames.iconButton, className),
83
+ ...domUtils.mergeProps(stateProps, otherProps),
84
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { className: classNames.icon, ...stateProps, children })
85
+ }
86
+ );
87
+ }
88
+ );
89
+ AppBarIconButton.displayName = "IconButton";
90
+ const AppBarSlot = React.forwardRef(
91
+ ({ children, className, ...otherProps }, ref) => {
92
+ const { stateProps } = useAppBarContext.useAppBarContext();
93
+ const classNames = useClassNames();
94
+ return /* @__PURE__ */ jsxRuntime.jsx(
95
+ reactSlot.Slot,
96
+ {
97
+ ref,
98
+ className: clsx(classNames.custom, className),
99
+ ...domUtils.mergeProps(stateProps, otherProps),
100
+ children
101
+ }
102
+ );
103
+ }
104
+ );
105
+ AppBarSlot.displayName = "AppBarSlot";
106
+
107
+ exports.AppBarIconButton = AppBarIconButton;
108
+ exports.AppBarLeft = AppBarLeft;
109
+ exports.AppBarMain = AppBarMain;
110
+ exports.AppBarPropsProvider = AppBarPropsProvider;
111
+ exports.AppBarRight = AppBarRight;
112
+ exports.AppBarRoot = AppBarRoot;
113
+ exports.AppBarSlot = AppBarSlot;
114
+ exports.AppBarSubtitle = AppBarSubtitle;
115
+ exports.AppBarTitle = AppBarTitle;
@@ -0,0 +1,34 @@
1
+ import { AppBarVariantProps, AppBarVariant } from '@seed-design/css/recipes/app-bar';
2
+ import { AppBarMainVariantProps } from '@seed-design/css/recipes/app-bar-main';
3
+ import { PrimitiveProps } from '@seed-design/react-primitive';
4
+ import { AppBar as AppBarPrimitive } from '../../primitive';
5
+ import { BoxBackgroundProps } from '../../utils/styled';
6
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
7
+ export declare const AppBarPropsProvider: ({ children, value }: {
8
+ children: React.ReactNode;
9
+ value: Partial< AppBarVariant>;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ export interface AppBarProps extends AppBarVariantProps, AppBarPrimitive.RootProps, BoxBackgroundProps {
12
+ }
13
+ export declare const AppBarRoot: ForwardRefExoticComponent<AppBarProps & RefAttributes<HTMLDivElement>>;
14
+ export interface AppBarLeftProps extends AppBarPrimitive.LeftProps {
15
+ }
16
+ export declare const AppBarLeft: ForwardRefExoticComponent<AppBarLeftProps & RefAttributes<HTMLDivElement>>;
17
+ export interface AppBarRightProps extends AppBarPrimitive.RightProps {
18
+ }
19
+ export declare const AppBarRight: ForwardRefExoticComponent<AppBarRightProps & RefAttributes<HTMLDivElement>>;
20
+ export interface AppBarMainProps extends AppBarMainVariantProps, AppBarPrimitive.MainProps {
21
+ }
22
+ export declare const AppBarMain: ForwardRefExoticComponent<AppBarMainProps & RefAttributes<HTMLDivElement>>;
23
+ export interface AppBarTitleProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
24
+ }
25
+ export declare const AppBarTitle: ForwardRefExoticComponent<AppBarTitleProps & RefAttributes<HTMLSpanElement>>;
26
+ export interface AppBarSubtitleProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
27
+ }
28
+ export declare const AppBarSubtitle: ForwardRefExoticComponent<AppBarSubtitleProps & RefAttributes<HTMLSpanElement>>;
29
+ export interface AppBarIconButtonProps extends PrimitiveProps, React.ButtonHTMLAttributes<HTMLButtonElement> {
30
+ }
31
+ export declare const AppBarIconButton: ForwardRefExoticComponent<AppBarIconButtonProps & RefAttributes<HTMLButtonElement>>;
32
+ export interface AppBarSlotProps extends PrimitiveProps, React.HTMLAttributes<HTMLElement> {
33
+ }
34
+ export declare const AppBarSlot: ForwardRefExoticComponent<AppBarSlotProps & RefAttributes<HTMLElement>>;
@@ -0,0 +1,103 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { Slot } from '@radix-ui/react-slot';
4
+ import { appBar } from '@seed-design/css/recipes/app-bar';
5
+ import { appBarMain } from '@seed-design/css/recipes/app-bar-main';
6
+ import { mergeProps } from '@seed-design/dom-utils';
7
+ import { Primitive } from '@seed-design/react-primitive';
8
+ import clsx from 'clsx';
9
+ import { forwardRef } from 'react';
10
+ import { AppBarLeft as AppBarLeft$1, AppBarMain as AppBarMain$1, AppBarRight as AppBarRight$1, AppBarRoot as AppBarRoot$1 } from '../../primitive/AppBar/AppBar.js';
11
+ import { useAppBarContext } from '../../primitive/AppBar/useAppBarContext.js';
12
+ import { createStyleContext } from '../../utils/createStyleContext.js';
13
+ import { useTopActivity } from '../../primitive/private/useTopActivity.js';
14
+ import { useActivity } from '@stackflow/react';
15
+ import { useBoxBackgroundProps } from '../../utils/styled.js';
16
+
17
+ const { PropsProvider, ClassNamesProvider, useProps, withContext, useClassNames } = createStyleContext(appBar);
18
+ const {
19
+ PropsProvider: MainPropsProvider,
20
+ withProvider: withMainProvider,
21
+ withContext: withMainContext
22
+ } = createStyleContext(appBarMain);
23
+ const AppBarPropsProvider = PropsProvider;
24
+ const AppBarRoot = forwardRef((props, ref) => {
25
+ const { style: boxStyle, restProps: propsWithoutBoxProps } = useBoxBackgroundProps(props);
26
+ const contextProps = useProps();
27
+ const [variantProps, otherProps] = appBar.splitVariantProps({
28
+ ...contextProps,
29
+ ...propsWithoutBoxProps
30
+ });
31
+ const topActivityTransitionStyle = useTopActivity().transitionStyle;
32
+ const resolvedVariantProps = {
33
+ // this includes the default transitionStyle decided by theme, from contextProps or props
34
+ ...variantProps,
35
+ ...useActivity().isTop === false && {
36
+ transitionStyle: topActivityTransitionStyle
37
+ }
38
+ };
39
+ const classNames = appBar(resolvedVariantProps);
40
+ return /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(MainPropsProvider, { value: resolvedVariantProps, children: /* @__PURE__ */ jsx(
41
+ AppBarRoot$1,
42
+ {
43
+ ref,
44
+ ...mergeProps({ className: classNames.root, style: boxStyle }, otherProps)
45
+ }
46
+ ) }) });
47
+ });
48
+ AppBarRoot.displayName = "AppBarRoot";
49
+ const AppBarLeft = withContext(
50
+ AppBarLeft$1,
51
+ "left"
52
+ );
53
+ const AppBarRight = withContext(
54
+ AppBarRight$1,
55
+ "right"
56
+ );
57
+ const AppBarMain = withMainProvider(
58
+ AppBarMain$1,
59
+ "root"
60
+ );
61
+ const AppBarTitle = withMainContext(
62
+ Primitive.span,
63
+ "title"
64
+ );
65
+ const AppBarSubtitle = withMainContext(
66
+ Primitive.span,
67
+ "subtitle"
68
+ );
69
+ const AppBarIconButton = forwardRef(
70
+ ({ children, className, ...otherProps }, ref) => {
71
+ const { stateProps } = useAppBarContext();
72
+ const classNames = useClassNames();
73
+ return /* @__PURE__ */ jsx(
74
+ Primitive.button,
75
+ {
76
+ ref,
77
+ type: "button",
78
+ className: clsx(classNames.iconButton, className),
79
+ ...mergeProps(stateProps, otherProps),
80
+ children: /* @__PURE__ */ jsx(Slot, { className: classNames.icon, ...stateProps, children })
81
+ }
82
+ );
83
+ }
84
+ );
85
+ AppBarIconButton.displayName = "IconButton";
86
+ const AppBarSlot = forwardRef(
87
+ ({ children, className, ...otherProps }, ref) => {
88
+ const { stateProps } = useAppBarContext();
89
+ const classNames = useClassNames();
90
+ return /* @__PURE__ */ jsx(
91
+ Slot,
92
+ {
93
+ ref,
94
+ className: clsx(classNames.custom, className),
95
+ ...mergeProps(stateProps, otherProps),
96
+ children
97
+ }
98
+ );
99
+ }
100
+ );
101
+ AppBarSlot.displayName = "AppBarSlot";
102
+
103
+ export { AppBarIconButton, AppBarLeft, AppBarMain, AppBarPropsProvider, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle };
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const AppBar = require('./AppBar.cjs');
6
+
7
+
8
+
9
+ exports.IconButton = AppBar.AppBarIconButton;
10
+ exports.Left = AppBar.AppBarLeft;
11
+ exports.Main = AppBar.AppBarMain;
12
+ exports.Right = AppBar.AppBarRight;
13
+ exports.Root = AppBar.AppBarRoot;
14
+ exports.Slot = AppBar.AppBarSlot;
15
+ exports.Subtitle = AppBar.AppBarSubtitle;
16
+ exports.Title = AppBar.AppBarTitle;
@@ -0,0 +1,2 @@
1
+ export { AppBarIconButton as IconButton, AppBarLeft as Left, AppBarMain as Main, AppBarRight as Right, AppBarRoot as Root, AppBarSlot as Slot, AppBarSubtitle as Subtitle, AppBarTitle as Title, } from './AppBar';
2
+ export type { AppBarIconButtonProps as IconButtonProps, AppBarLeftProps as LeftProps, AppBarMainProps as MainProps, AppBarRightProps as RightProps, AppBarProps as RootProps, AppBarSlotProps as SlotProps, AppBarSubtitleProps as SubtitleProps, AppBarTitleProps as TitleProps, } from './AppBar';
@@ -0,0 +1 @@
1
+ export { AppBarIconButton as IconButton, AppBarLeft as Left, AppBarMain as Main, AppBarRight as Right, AppBarRoot as Root, AppBarSlot as Slot, AppBarSubtitle as Subtitle, AppBarTitle as Title } from './AppBar.js';
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const AppBar = require('./AppBar.cjs');
6
+ const AppBar_namespace = require('./AppBar.namespace.cjs');
7
+
8
+
9
+
10
+ exports.AppBarIconButton = AppBar.AppBarIconButton;
11
+ exports.AppBarLeft = AppBar.AppBarLeft;
12
+ exports.AppBarMain = AppBar.AppBarMain;
13
+ exports.AppBarRight = AppBar.AppBarRight;
14
+ exports.AppBarRoot = AppBar.AppBarRoot;
15
+ exports.AppBarSlot = AppBar.AppBarSlot;
16
+ exports.AppBarSubtitle = AppBar.AppBarSubtitle;
17
+ exports.AppBarTitle = AppBar.AppBarTitle;
18
+ exports.AppBar = AppBar_namespace;
@@ -0,0 +1,3 @@
1
+ export { AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle, } from './AppBar';
2
+ export type { AppBarIconButtonProps, AppBarLeftProps, AppBarMainProps, AppBarProps, AppBarRightProps, AppBarSlotProps, AppBarSubtitleProps, AppBarTitleProps, } from './AppBar';
3
+ export * as AppBar from './AppBar.namespace';
@@ -0,0 +1,3 @@
1
+ export { AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle } from './AppBar.js';
2
+ import * as AppBar_namespace from './AppBar.namespace.js';
3
+ export { AppBar_namespace as AppBar };
@@ -0,0 +1,68 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const appScreen = require('@seed-design/css/recipes/app-screen');
8
+ const domUtils = require('@seed-design/dom-utils');
9
+ const React = require('react');
10
+ const AppScreen = require('../../primitive/AppScreen/AppScreen.cjs');
11
+ const createStyleContext = require('../../utils/createStyleContext.cjs');
12
+ const AppBar = require('../AppBar/AppBar.cjs');
13
+ const useTopActivity = require('../../primitive/private/useTopActivity.cjs');
14
+ const react = require('@stackflow/react');
15
+ const appBar = require('@seed-design/css/recipes/app-bar');
16
+
17
+ const { ClassNamesProvider, PropsProvider, withContext, useProps } = createStyleContext.createStyleContext(appScreen.appScreen);
18
+ const AppScreenPropsProvider = PropsProvider;
19
+ const AppScreenRoot = React.forwardRef((props, ref) => {
20
+ const contextProps = useProps();
21
+ const [variantProps, otherProps] = appScreen.appScreen.splitVariantProps({ ...contextProps, ...props });
22
+ const transitionStyle = variantProps.transitionStyle ?? (variantProps.theme === "cupertino" ? "slideFromRightIOS" : "fadeFromBottomAndroid");
23
+ const topActivityTransitionStyle = useTopActivity.useTopActivity().transitionStyle;
24
+ const classNames = appScreen.appScreen({
25
+ ...variantProps,
26
+ transitionStyle: react.useActivity().isTop ? transitionStyle : topActivityTransitionStyle
27
+ });
28
+ const [appBarVariantProps] = React.useMemo(
29
+ () => appBar.appBar.splitVariantProps(variantProps),
30
+ [variantProps]
31
+ );
32
+ return /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(
33
+ AppBar.AppBarPropsProvider,
34
+ {
35
+ value: React.useMemo(
36
+ () => ({ ...appBarVariantProps, transitionStyle }),
37
+ [appBarVariantProps, transitionStyle]
38
+ ),
39
+ children: /* @__PURE__ */ jsxRuntime.jsx(
40
+ AppScreen.AppScreenRoot,
41
+ {
42
+ ref,
43
+ "data-transition-style": transitionStyle,
44
+ ...domUtils.mergeProps({ className: classNames.root }, otherProps)
45
+ }
46
+ )
47
+ }
48
+ ) });
49
+ });
50
+ AppScreenRoot.displayName = "AppScreenRoot";
51
+ const AppScreenDim = withContext(
52
+ AppScreen.AppScreenDim,
53
+ "dim"
54
+ );
55
+ const AppScreenEdge = withContext(
56
+ AppScreen.AppScreenEdge,
57
+ "edge"
58
+ );
59
+ const AppScreenLayer = withContext(
60
+ AppScreen.AppScreenLayer,
61
+ "layer"
62
+ );
63
+
64
+ exports.AppScreenDim = AppScreenDim;
65
+ exports.AppScreenEdge = AppScreenEdge;
66
+ exports.AppScreenLayer = AppScreenLayer;
67
+ exports.AppScreenPropsProvider = AppScreenPropsProvider;
68
+ exports.AppScreenRoot = AppScreenRoot;
@@ -0,0 +1,23 @@
1
+ import { AppScreenVariantProps, AppScreenVariant } from '@seed-design/css/recipes/app-screen';
2
+ import { AppScreen as AppScreenPrimitive } from '../../primitive';
3
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
4
+ export declare const AppScreenPropsProvider: ({ children, value }: {
5
+ children: React.ReactNode;
6
+ value: Partial< AppScreenVariant>;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export interface AppScreenRootProps extends AppScreenVariantProps, AppScreenPrimitive.RootProps {
9
+ /**
10
+ * @default "layer"
11
+ */
12
+ tone?: "layer" | "transparent";
13
+ }
14
+ export declare const AppScreenRoot: ForwardRefExoticComponent<AppScreenRootProps & RefAttributes<HTMLDivElement>>;
15
+ export interface AppScreenDimProps extends AppScreenPrimitive.DimProps {
16
+ }
17
+ export declare const AppScreenDim: ForwardRefExoticComponent<AppScreenDimProps & RefAttributes<HTMLDivElement>>;
18
+ export interface AppScreenEdgeProps extends AppScreenPrimitive.EdgeProps {
19
+ }
20
+ export declare const AppScreenEdge: ForwardRefExoticComponent<AppScreenEdgeProps & RefAttributes<HTMLDivElement>>;
21
+ export interface AppScreenLayerProps extends AppScreenPrimitive.LayerProps {
22
+ }
23
+ export declare const AppScreenLayer: ForwardRefExoticComponent<AppScreenLayerProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,60 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { appScreen } from '@seed-design/css/recipes/app-screen';
4
+ import { mergeProps } from '@seed-design/dom-utils';
5
+ import { forwardRef, useMemo } from 'react';
6
+ import { AppScreenDim as AppScreenDim$1, AppScreenEdge as AppScreenEdge$1, AppScreenLayer as AppScreenLayer$1, AppScreenRoot as AppScreenRoot$1 } from '../../primitive/AppScreen/AppScreen.js';
7
+ import { createStyleContext } from '../../utils/createStyleContext.js';
8
+ import { AppBarPropsProvider } from '../AppBar/AppBar.js';
9
+ import { useTopActivity } from '../../primitive/private/useTopActivity.js';
10
+ import { useActivity } from '@stackflow/react';
11
+ import { appBar } from '@seed-design/css/recipes/app-bar';
12
+
13
+ const { ClassNamesProvider, PropsProvider, withContext, useProps } = createStyleContext(appScreen);
14
+ const AppScreenPropsProvider = PropsProvider;
15
+ const AppScreenRoot = forwardRef((props, ref) => {
16
+ const contextProps = useProps();
17
+ const [variantProps, otherProps] = appScreen.splitVariantProps({ ...contextProps, ...props });
18
+ const transitionStyle = variantProps.transitionStyle ?? (variantProps.theme === "cupertino" ? "slideFromRightIOS" : "fadeFromBottomAndroid");
19
+ const topActivityTransitionStyle = useTopActivity().transitionStyle;
20
+ const classNames = appScreen({
21
+ ...variantProps,
22
+ transitionStyle: useActivity().isTop ? transitionStyle : topActivityTransitionStyle
23
+ });
24
+ const [appBarVariantProps] = useMemo(
25
+ () => appBar.splitVariantProps(variantProps),
26
+ [variantProps]
27
+ );
28
+ return /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(
29
+ AppBarPropsProvider,
30
+ {
31
+ value: useMemo(
32
+ () => ({ ...appBarVariantProps, transitionStyle }),
33
+ [appBarVariantProps, transitionStyle]
34
+ ),
35
+ children: /* @__PURE__ */ jsx(
36
+ AppScreenRoot$1,
37
+ {
38
+ ref,
39
+ "data-transition-style": transitionStyle,
40
+ ...mergeProps({ className: classNames.root }, otherProps)
41
+ }
42
+ )
43
+ }
44
+ ) });
45
+ });
46
+ AppScreenRoot.displayName = "AppScreenRoot";
47
+ const AppScreenDim = withContext(
48
+ AppScreenDim$1,
49
+ "dim"
50
+ );
51
+ const AppScreenEdge = withContext(
52
+ AppScreenEdge$1,
53
+ "edge"
54
+ );
55
+ const AppScreenLayer = withContext(
56
+ AppScreenLayer$1,
57
+ "layer"
58
+ );
59
+
60
+ export { AppScreenDim, AppScreenEdge, AppScreenLayer, AppScreenPropsProvider, AppScreenRoot };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const AppScreen = require('./AppScreen.cjs');
6
+
7
+
8
+
9
+ exports.Dim = AppScreen.AppScreenDim;
10
+ exports.Edge = AppScreen.AppScreenEdge;
11
+ exports.Layer = AppScreen.AppScreenLayer;
12
+ exports.PropsProvider = AppScreen.AppScreenPropsProvider;
13
+ exports.Root = AppScreen.AppScreenRoot;
@@ -0,0 +1,2 @@
1
+ export { AppScreenDim as Dim, AppScreenEdge as Edge, AppScreenLayer as Layer, AppScreenRoot as Root, AppScreenPropsProvider as PropsProvider, } from './AppScreen';
2
+ export type { AppScreenDimProps as DimProps, AppScreenEdgeProps as EdgeProps, AppScreenLayerProps as LayerProps, AppScreenRootProps as RootProps, } from './AppScreen';
@@ -0,0 +1 @@
1
+ export { AppScreenDim as Dim, AppScreenEdge as Edge, AppScreenLayer as Layer, AppScreenPropsProvider as PropsProvider, AppScreenRoot as Root } from './AppScreen.js';
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const AppScreen = require('./AppScreen.cjs');
6
+ const AppScreen_namespace = require('./AppScreen.namespace.cjs');
7
+
8
+
9
+
10
+ exports.AppScreenDim = AppScreen.AppScreenDim;
11
+ exports.AppScreenEdge = AppScreen.AppScreenEdge;
12
+ exports.AppScreenLayer = AppScreen.AppScreenLayer;
13
+ exports.AppScreenPropsProvider = AppScreen.AppScreenPropsProvider;
14
+ exports.AppScreenRoot = AppScreen.AppScreenRoot;
15
+ exports.AppScreen = AppScreen_namespace;
@@ -0,0 +1,3 @@
1
+ export { AppScreenDim, AppScreenEdge, AppScreenLayer, AppScreenRoot, AppScreenPropsProvider, } from './AppScreen';
2
+ export type { AppScreenDimProps, AppScreenEdgeProps, AppScreenLayerProps, AppScreenRootProps, } from './AppScreen';
3
+ export * as AppScreen from './AppScreen.namespace';
@@ -0,0 +1,3 @@
1
+ export { AppScreenDim, AppScreenEdge, AppScreenLayer, AppScreenPropsProvider, AppScreenRoot } from './AppScreen.js';
2
+ import * as AppScreen_namespace from './AppScreen.namespace.js';
3
+ export { AppScreen_namespace as AppScreen };
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const AppBar = require('./AppBar/AppBar.cjs');
6
+ const AppBar_namespace = require('./AppBar/AppBar.namespace.cjs');
7
+ const AppScreen = require('./AppScreen/AppScreen.cjs');
8
+ const AppScreen_namespace = require('./AppScreen/AppScreen.namespace.cjs');
9
+
10
+
11
+
12
+ exports.AppBarIconButton = AppBar.AppBarIconButton;
13
+ exports.AppBarLeft = AppBar.AppBarLeft;
14
+ exports.AppBarMain = AppBar.AppBarMain;
15
+ exports.AppBarRight = AppBar.AppBarRight;
16
+ exports.AppBarRoot = AppBar.AppBarRoot;
17
+ exports.AppBarSlot = AppBar.AppBarSlot;
18
+ exports.AppBarSubtitle = AppBar.AppBarSubtitle;
19
+ exports.AppBarTitle = AppBar.AppBarTitle;
20
+ exports.AppBar = AppBar_namespace;
21
+ exports.AppScreenDim = AppScreen.AppScreenDim;
22
+ exports.AppScreenEdge = AppScreen.AppScreenEdge;
23
+ exports.AppScreenLayer = AppScreen.AppScreenLayer;
24
+ exports.AppScreenPropsProvider = AppScreen.AppScreenPropsProvider;
25
+ exports.AppScreenRoot = AppScreen.AppScreenRoot;
26
+ exports.AppScreen = AppScreen_namespace;
@@ -0,0 +1,2 @@
1
+ export * from './AppBar';
2
+ export * from './AppScreen';
@@ -0,0 +1,6 @@
1
+ export { AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle } from './AppBar/AppBar.js';
2
+ import * as AppBar_namespace from './AppBar/AppBar.namespace.js';
3
+ export { AppBar_namespace as AppBar };
4
+ export { AppScreenDim, AppScreenEdge, AppScreenLayer, AppScreenPropsProvider, AppScreenRoot } from './AppScreen/AppScreen.js';
5
+ import * as AppScreen_namespace from './AppScreen/AppScreen.namespace.js';
6
+ export { AppScreen_namespace as AppScreen };
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const useActivityZIndexBase = require('./useActivityZIndexBase.cjs');
6
+
7
+
8
+
9
+ exports.useActivityZIndexBase = useActivityZIndexBase.useActivityZIndexBase;
@@ -0,0 +1 @@
1
+ export { useActivityZIndexBase } from './useActivityZIndexBase';
@@ -0,0 +1 @@
1
+ export { useActivityZIndexBase } from './useActivityZIndexBase.js';
@@ -0,0 +1,14 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const reactUiCore = require('@stackflow/react-ui-core');
7
+
8
+ const Z_INDEX_SPACING = 5;
9
+ function useActivityZIndexBase(params) {
10
+ const activity = reactUiCore.useNullableActivity();
11
+ return ((activity?.zIndex ?? 0) + (params?.activityOffset ?? 0)) * Z_INDEX_SPACING;
12
+ }
13
+
14
+ exports.useActivityZIndexBase = useActivityZIndexBase;
@@ -0,0 +1,18 @@
1
+ interface UseActivityZIndexBaseParams {
2
+ /**
3
+ * Offset from the current activity's position in the stack.
4
+ *
5
+ * - `0` (default): Current activity's z-index base
6
+ * - `1`: Next activity's z-index base (common for overlay components)
7
+ *
8
+ * @default 0
9
+ */
10
+ activityOffset?: number;
11
+ }
12
+ /**
13
+ * Returns the base z-index which is calculated by multiplying the activity's index by 5.
14
+ * This value is used to give proper z-index values to elements of AppScreen (e.g. app-bar, dim, edge, layer). See the stylesheet of AppScreen for more details.
15
+ * This value can be provided to layerIndex of various overlay components (e.g. AlertDialog, BottomSheet, MenuSheet) to ensure correct stacking order.
16
+ */
17
+ export declare function useActivityZIndexBase(params?: UseActivityZIndexBaseParams): number;
18
+ export {};
@@ -0,0 +1,10 @@
1
+ 'use client';
2
+ import { useNullableActivity } from '@stackflow/react-ui-core';
3
+
4
+ const Z_INDEX_SPACING = 5;
5
+ function useActivityZIndexBase(params) {
6
+ const activity = useNullableActivity();
7
+ return ((activity?.zIndex ?? 0) + (params?.activityOffset ?? 0)) * Z_INDEX_SPACING;
8
+ }
9
+
10
+ export { useActivityZIndexBase };
package/lib/index.cjs ADDED
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const plugin = require('./plugin.cjs');
6
+ const AppBar = require('./components/AppBar/AppBar.cjs');
7
+ const AppBar_namespace = require('./components/AppBar/AppBar.namespace.cjs');
8
+ const AppScreen = require('./components/AppScreen/AppScreen.cjs');
9
+ const AppScreen_namespace = require('./components/AppScreen/AppScreen.namespace.cjs');
10
+ const useActivityZIndexBase = require('./hooks/useActivityZIndexBase.cjs');
11
+ const index = require('./primitive/index.cjs');
12
+
13
+
14
+
15
+ exports.seedPlugin = plugin.seedPlugin;
16
+ exports.AppBarIconButton = AppBar.AppBarIconButton;
17
+ exports.AppBarLeft = AppBar.AppBarLeft;
18
+ exports.AppBarMain = AppBar.AppBarMain;
19
+ exports.AppBarRight = AppBar.AppBarRight;
20
+ exports.AppBarRoot = AppBar.AppBarRoot;
21
+ exports.AppBarSlot = AppBar.AppBarSlot;
22
+ exports.AppBarSubtitle = AppBar.AppBarSubtitle;
23
+ exports.AppBarTitle = AppBar.AppBarTitle;
24
+ exports.AppBar = AppBar_namespace;
25
+ exports.AppScreenDim = AppScreen.AppScreenDim;
26
+ exports.AppScreenEdge = AppScreen.AppScreenEdge;
27
+ exports.AppScreenLayer = AppScreen.AppScreenLayer;
28
+ exports.AppScreenPropsProvider = AppScreen.AppScreenPropsProvider;
29
+ exports.AppScreenRoot = AppScreen.AppScreenRoot;
30
+ exports.AppScreen = AppScreen_namespace;
31
+ exports.useActivityZIndexBase = useActivityZIndexBase.useActivityZIndexBase;
32
+ exports.Primitive = index;
package/lib/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { seedPlugin, type SeedPluginOptions } from './plugin';
2
+ export * from './components';
3
+ export * from './hooks';
4
+ export * as Primitive from './primitive';