@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.
- package/lib/components/AppBar/AppBar.cjs +115 -0
- package/lib/components/AppBar/AppBar.d.ts +34 -0
- package/lib/components/AppBar/AppBar.js +103 -0
- package/lib/components/AppBar/AppBar.namespace.cjs +16 -0
- package/lib/components/AppBar/AppBar.namespace.d.ts +2 -0
- package/lib/components/AppBar/AppBar.namespace.js +1 -0
- package/lib/components/AppBar/index.cjs +18 -0
- package/lib/components/AppBar/index.d.ts +3 -0
- package/lib/components/AppBar/index.js +3 -0
- package/lib/components/AppScreen/AppScreen.cjs +68 -0
- package/lib/components/AppScreen/AppScreen.d.ts +23 -0
- package/lib/components/AppScreen/AppScreen.js +60 -0
- package/lib/components/AppScreen/AppScreen.namespace.cjs +13 -0
- package/lib/components/AppScreen/AppScreen.namespace.d.ts +2 -0
- package/lib/components/AppScreen/AppScreen.namespace.js +1 -0
- package/lib/components/AppScreen/index.cjs +15 -0
- package/lib/components/AppScreen/index.d.ts +3 -0
- package/lib/components/AppScreen/index.js +3 -0
- package/lib/components/index.cjs +26 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +6 -0
- package/lib/hooks/index.cjs +9 -0
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/useActivityZIndexBase.cjs +14 -0
- package/lib/hooks/useActivityZIndexBase.d.ts +18 -0
- package/lib/hooks/useActivityZIndexBase.js +10 -0
- package/lib/index.cjs +32 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +10 -0
- package/lib/plugin.cjs +18 -0
- package/lib/plugin.d.ts +7 -0
- package/lib/plugin.js +14 -0
- package/lib/primitive/AppBar/AppBar.cjs +44 -0
- package/lib/primitive/AppBar/AppBar.d.ts +15 -0
- package/lib/primitive/AppBar/AppBar.js +37 -0
- package/lib/primitive/AppBar/AppBar.namespace.cjs +12 -0
- package/lib/primitive/AppBar/AppBar.namespace.d.ts +1 -0
- package/lib/primitive/AppBar/AppBar.namespace.js +1 -0
- package/lib/primitive/AppBar/index.cjs +14 -0
- package/lib/primitive/AppBar/index.d.ts +2 -0
- package/lib/primitive/AppBar/index.js +3 -0
- package/lib/primitive/AppBar/useAppBar.cjs +39 -0
- package/lib/primitive/AppBar/useAppBar.d.ts +294 -0
- package/lib/primitive/AppBar/useAppBar.js +35 -0
- package/lib/primitive/AppBar/useAppBarContext.cjs +21 -0
- package/lib/primitive/AppBar/useAppBarContext.d.ts +8 -0
- package/lib/primitive/AppBar/useAppBarContext.js +16 -0
- package/lib/primitive/AppScreen/AppScreen.cjs +64 -0
- package/lib/primitive/AppScreen/AppScreen.d.ts +15 -0
- package/lib/primitive/AppScreen/AppScreen.js +57 -0
- package/lib/primitive/AppScreen/AppScreen.namespace.cjs +12 -0
- package/lib/primitive/AppScreen/AppScreen.namespace.d.ts +1 -0
- package/lib/primitive/AppScreen/AppScreen.namespace.js +1 -0
- package/lib/primitive/AppScreen/index.cjs +16 -0
- package/lib/primitive/AppScreen/index.d.ts +3 -0
- package/lib/primitive/AppScreen/index.js +4 -0
- package/lib/primitive/AppScreen/useAppScreen.cjs +66 -0
- package/lib/primitive/AppScreen/useAppScreen.d.ts +1138 -0
- package/lib/primitive/AppScreen/useAppScreen.js +62 -0
- package/lib/primitive/AppScreen/useAppScreenContext.cjs +21 -0
- package/lib/primitive/AppScreen/useAppScreenContext.d.ts +8 -0
- package/lib/primitive/AppScreen/useAppScreenContext.js +16 -0
- package/lib/primitive/GlobalInteraction/GlobalInteraction.cjs +28 -0
- package/lib/primitive/GlobalInteraction/GlobalInteraction.d.ts +5 -0
- package/lib/primitive/GlobalInteraction/GlobalInteraction.js +24 -0
- package/lib/primitive/GlobalInteraction/index.cjs +11 -0
- package/lib/primitive/GlobalInteraction/index.d.ts +2 -0
- package/lib/primitive/GlobalInteraction/index.js +2 -0
- package/lib/primitive/GlobalInteraction/useGlobalInteraction.cjs +136 -0
- package/lib/primitive/GlobalInteraction/useGlobalInteraction.d.ts +54 -0
- package/lib/primitive/GlobalInteraction/useGlobalInteraction.js +132 -0
- package/lib/primitive/GlobalInteraction/useGlobalInteractionContext.cjs +21 -0
- package/lib/primitive/GlobalInteraction/useGlobalInteractionContext.d.ts +8 -0
- package/lib/primitive/GlobalInteraction/useGlobalInteractionContext.js +16 -0
- package/lib/primitive/GlobalInteraction/useSwipeBack.cjs +58 -0
- package/lib/primitive/GlobalInteraction/useSwipeBack.d.ts +8 -0
- package/lib/primitive/GlobalInteraction/useSwipeBack.js +54 -0
- package/lib/primitive/index.cjs +27 -0
- package/lib/primitive/index.d.ts +3 -0
- package/lib/primitive/index.js +9 -0
- package/lib/primitive/private/useElementOffset.cjs +54 -0
- package/lib/primitive/private/useElementOffset.d.ts +4 -0
- package/lib/primitive/private/useElementOffset.js +31 -0
- package/lib/primitive/private/useTopActivity.cjs +34 -0
- package/lib/primitive/private/useTopActivity.d.ts +5 -0
- package/lib/primitive/private/useTopActivity.js +30 -0
- package/lib/utils/createStyleContext.cjs +77 -0
- package/lib/utils/createStyleContext.d.ts +23 -0
- package/lib/utils/createStyleContext.js +73 -0
- package/lib/utils/createWithStateProps.d.ts +10 -0
- package/lib/utils/styled.cjs +25 -0
- package/lib/utils/styled.d.ts +16 -0
- package/lib/utils/styled.js +21 -0
- package/package.json +61 -0
- package/src/components/AppBar/AppBar.namespace.ts +21 -0
- package/src/components/AppBar/AppBar.tsx +146 -0
- package/src/components/AppBar/index.ts +23 -0
- package/src/components/AppScreen/AppScreen.namespace.ts +14 -0
- package/src/components/AppScreen/AppScreen.tsx +83 -0
- package/src/components/AppScreen/index.ts +16 -0
- package/src/components/index.ts +2 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useActivityZIndexBase.ts +26 -0
- package/src/index.ts +6 -0
- package/src/plugin.tsx +27 -0
- package/src/primitive/AppBar/AppBar.namespace.ts +10 -0
- package/src/primitive/AppBar/AppBar.tsx +52 -0
- package/src/primitive/AppBar/index.ts +12 -0
- package/src/primitive/AppBar/useAppBar.tsx +42 -0
- package/src/primitive/AppBar/useAppBarContext.ts +21 -0
- package/src/primitive/AppScreen/AppScreen.namespace.ts +10 -0
- package/src/primitive/AppScreen/AppScreen.tsx +72 -0
- package/src/primitive/AppScreen/index.ts +13 -0
- package/src/primitive/AppScreen/useAppScreen.tsx +69 -0
- package/src/primitive/AppScreen/useAppScreenContext.ts +21 -0
- package/src/primitive/GlobalInteraction/GlobalInteraction.tsx +25 -0
- package/src/primitive/GlobalInteraction/index.ts +6 -0
- package/src/primitive/GlobalInteraction/useGlobalInteraction.ts +188 -0
- package/src/primitive/GlobalInteraction/useGlobalInteractionContext.tsx +21 -0
- package/src/primitive/GlobalInteraction/useSwipeBack.ts +56 -0
- package/src/primitive/index.ts +3 -0
- package/src/primitive/private/useElementOffset.ts +37 -0
- package/src/primitive/private/useTopActivity.ts +33 -0
- package/src/utils/createStyleContext.tsx +128 -0
- package/src/utils/createWithStateProps.tsx +28 -0
- package/src/utils/styled.ts +41 -0
package/lib/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { seedPlugin } from './plugin.js';
|
|
2
|
+
export { AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle } from './components/AppBar/AppBar.js';
|
|
3
|
+
import * as AppBar_namespace from './components/AppBar/AppBar.namespace.js';
|
|
4
|
+
export { AppBar_namespace as AppBar };
|
|
5
|
+
export { AppScreenDim, AppScreenEdge, AppScreenLayer, AppScreenPropsProvider, AppScreenRoot } from './components/AppScreen/AppScreen.js';
|
|
6
|
+
import * as AppScreen_namespace from './components/AppScreen/AppScreen.namespace.js';
|
|
7
|
+
export { AppScreen_namespace as AppScreen };
|
|
8
|
+
export { useActivityZIndexBase } from './hooks/useActivityZIndexBase.js';
|
|
9
|
+
import * as index from './primitive/index.js';
|
|
10
|
+
export { index as Primitive };
|
package/lib/plugin.cjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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('./components/AppScreen/AppScreen.cjs');
|
|
8
|
+
const GlobalInteraction = require('./primitive/GlobalInteraction/GlobalInteraction.cjs');
|
|
9
|
+
|
|
10
|
+
const seedPlugin = (options) => () => ({
|
|
11
|
+
key: "seed-design",
|
|
12
|
+
wrapStack({ stack, initialContext }) {
|
|
13
|
+
const resolved = typeof options === "function" ? options({ initialContext }) : options;
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AppScreen.AppScreenPropsProvider, { value: resolved, children: /* @__PURE__ */ jsxRuntime.jsx(GlobalInteraction.GlobalInteraction, { children: stack.render() }) });
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
exports.seedPlugin = seedPlugin;
|
package/lib/plugin.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StackflowReactPlugin } from '@stackflow/react';
|
|
2
|
+
export interface SeedPluginOptions {
|
|
3
|
+
theme: "android" | "cupertino";
|
|
4
|
+
}
|
|
5
|
+
export declare const seedPlugin: (options: SeedPluginOptions | ((args: {
|
|
6
|
+
initialContext?: any;
|
|
7
|
+
}) => SeedPluginOptions)) => StackflowReactPlugin;
|
package/lib/plugin.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { AppScreenPropsProvider } from './components/AppScreen/AppScreen.js';
|
|
4
|
+
import { GlobalInteraction } from './primitive/GlobalInteraction/GlobalInteraction.js';
|
|
5
|
+
|
|
6
|
+
const seedPlugin = (options) => () => ({
|
|
7
|
+
key: "seed-design",
|
|
8
|
+
wrapStack({ stack, initialContext }) {
|
|
9
|
+
const resolved = typeof options === "function" ? options({ initialContext }) : options;
|
|
10
|
+
return /* @__PURE__ */ jsx(AppScreenPropsProvider, { value: resolved, children: /* @__PURE__ */ jsx(GlobalInteraction, { children: stack.render() }) });
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { seedPlugin };
|
|
@@ -0,0 +1,44 @@
|
|
|
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 reactComposeRefs = require('@radix-ui/react-compose-refs');
|
|
8
|
+
const domUtils = require('@seed-design/dom-utils');
|
|
9
|
+
const reactPrimitive = require('@seed-design/react-primitive');
|
|
10
|
+
const React = require('react');
|
|
11
|
+
const useAppBar = require('./useAppBar.cjs');
|
|
12
|
+
const useAppBarContext = require('./useAppBarContext.cjs');
|
|
13
|
+
|
|
14
|
+
const AppBarRoot = React.forwardRef((props, ref) => {
|
|
15
|
+
const { ...otherProps } = props;
|
|
16
|
+
const api = useAppBar.useAppBar();
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(useAppBarContext.AppBarProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
|
+
reactPrimitive.Primitive.div,
|
|
19
|
+
{
|
|
20
|
+
ref: reactComposeRefs.composeRefs(api.refs.root, ref),
|
|
21
|
+
...domUtils.mergeProps(api.rootProps, otherProps)
|
|
22
|
+
}
|
|
23
|
+
) });
|
|
24
|
+
});
|
|
25
|
+
AppBarRoot.displayName = "AppBarRoot";
|
|
26
|
+
const AppBarLeft = React.forwardRef((props, ref) => {
|
|
27
|
+
const { refs, stateProps } = useAppBarContext.useAppBarContext();
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactPrimitive.Primitive.div, { ref: reactComposeRefs.composeRefs(refs.left, ref), ...domUtils.mergeProps(stateProps, props) });
|
|
29
|
+
});
|
|
30
|
+
AppBarLeft.displayName = "AppBarLeft";
|
|
31
|
+
const AppBarRight = React.forwardRef((props, ref) => {
|
|
32
|
+
const { refs, stateProps } = useAppBarContext.useAppBarContext();
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactPrimitive.Primitive.div, { ref: reactComposeRefs.composeRefs(refs.right, ref), ...domUtils.mergeProps(stateProps, props) });
|
|
34
|
+
});
|
|
35
|
+
AppBarRight.displayName = "AppBarRight";
|
|
36
|
+
const AppBarMain = React.forwardRef((props, ref) => {
|
|
37
|
+
const { stateProps } = useAppBarContext.useAppBarContext();
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactPrimitive.Primitive.div, { ref, ...domUtils.mergeProps(stateProps, props) });
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
exports.AppBarLeft = AppBarLeft;
|
|
42
|
+
exports.AppBarMain = AppBarMain;
|
|
43
|
+
exports.AppBarRight = AppBarRight;
|
|
44
|
+
exports.AppBarRoot = AppBarRoot;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
2
|
+
import { UseAppBarProps } from './useAppBar';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
export interface AppBarRootProps extends PrimitiveProps, UseAppBarProps, React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
}
|
|
6
|
+
export declare const AppBarRoot: ForwardRefExoticComponent<AppBarRootProps & RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export interface AppBarLeftProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
}
|
|
9
|
+
export declare const AppBarLeft: ForwardRefExoticComponent<AppBarLeftProps & RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export interface AppBarRightProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
}
|
|
12
|
+
export declare const AppBarRight: ForwardRefExoticComponent<AppBarRightProps & RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export interface AppBarMainProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
}
|
|
15
|
+
export declare const AppBarMain: ForwardRefExoticComponent<AppBarMainProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { composeRefs } from '@radix-ui/react-compose-refs';
|
|
4
|
+
import { mergeProps } from '@seed-design/dom-utils';
|
|
5
|
+
import { Primitive } from '@seed-design/react-primitive';
|
|
6
|
+
import { forwardRef } from 'react';
|
|
7
|
+
import { useAppBar } from './useAppBar.js';
|
|
8
|
+
import { useAppBarContext, AppBarProvider } from './useAppBarContext.js';
|
|
9
|
+
|
|
10
|
+
const AppBarRoot = forwardRef((props, ref) => {
|
|
11
|
+
const { ...otherProps } = props;
|
|
12
|
+
const api = useAppBar();
|
|
13
|
+
return /* @__PURE__ */ jsx(AppBarProvider, { value: api, children: /* @__PURE__ */ jsx(
|
|
14
|
+
Primitive.div,
|
|
15
|
+
{
|
|
16
|
+
ref: composeRefs(api.refs.root, ref),
|
|
17
|
+
...mergeProps(api.rootProps, otherProps)
|
|
18
|
+
}
|
|
19
|
+
) });
|
|
20
|
+
});
|
|
21
|
+
AppBarRoot.displayName = "AppBarRoot";
|
|
22
|
+
const AppBarLeft = forwardRef((props, ref) => {
|
|
23
|
+
const { refs, stateProps } = useAppBarContext();
|
|
24
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ref: composeRefs(refs.left, ref), ...mergeProps(stateProps, props) });
|
|
25
|
+
});
|
|
26
|
+
AppBarLeft.displayName = "AppBarLeft";
|
|
27
|
+
const AppBarRight = forwardRef((props, ref) => {
|
|
28
|
+
const { refs, stateProps } = useAppBarContext();
|
|
29
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ref: composeRefs(refs.right, ref), ...mergeProps(stateProps, props) });
|
|
30
|
+
});
|
|
31
|
+
AppBarRight.displayName = "AppBarRight";
|
|
32
|
+
const AppBarMain = forwardRef((props, ref) => {
|
|
33
|
+
const { stateProps } = useAppBarContext();
|
|
34
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ref, ...mergeProps(stateProps, props) });
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export { AppBarLeft, AppBarMain, AppBarRight, AppBarRoot };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const AppBar = require('./AppBar.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.Left = AppBar.AppBarLeft;
|
|
10
|
+
exports.Main = AppBar.AppBarMain;
|
|
11
|
+
exports.Right = AppBar.AppBarRight;
|
|
12
|
+
exports.Root = AppBar.AppBarRoot;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AppBarRoot as Root, AppBarMain as Main, AppBarLeft as Left, AppBarRight as Right, type AppBarRootProps as RootProps, type AppBarMainProps as MainProps, type AppBarLeftProps as LeftProps, type AppBarRightProps as RightProps, } from './AppBar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AppBarLeft as Left, AppBarMain as Main, AppBarRight as Right, AppBarRoot as Root } from './AppBar.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
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.AppBarLeft = AppBar.AppBarLeft;
|
|
11
|
+
exports.AppBarMain = AppBar.AppBarMain;
|
|
12
|
+
exports.AppBarRight = AppBar.AppBarRight;
|
|
13
|
+
exports.AppBarRoot = AppBar.AppBarRoot;
|
|
14
|
+
exports.AppBar = AppBar_namespace;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const domUtils = require('@seed-design/dom-utils');
|
|
7
|
+
const React = require('react');
|
|
8
|
+
const useAppScreenContext = require('../AppScreen/useAppScreenContext.cjs');
|
|
9
|
+
const useElementOffset = require('../private/useElementOffset.cjs');
|
|
10
|
+
|
|
11
|
+
function useAppBar(_props) {
|
|
12
|
+
const { stateProps } = useAppScreenContext.useAppScreenContext();
|
|
13
|
+
const [root, rootRef] = React.useState(null);
|
|
14
|
+
const [left, leftRef] = React.useState(null);
|
|
15
|
+
const [right, rightRef] = React.useState(null);
|
|
16
|
+
const leftOffset = useElementOffset.useElementOffset(left);
|
|
17
|
+
const rightOffset = useElementOffset.useElementOffset(right);
|
|
18
|
+
const centeredTitlePaddingX = root ? `${Math.max(leftOffset?.fromLeft ?? 0, rightOffset?.fromRight ?? 0)}px` : "initial";
|
|
19
|
+
return React.useMemo(
|
|
20
|
+
() => ({
|
|
21
|
+
refs: {
|
|
22
|
+
root: rootRef,
|
|
23
|
+
left: leftRef,
|
|
24
|
+
right: rightRef
|
|
25
|
+
},
|
|
26
|
+
stateProps,
|
|
27
|
+
rootProps: domUtils.elementProps({
|
|
28
|
+
"data-part": "appBar",
|
|
29
|
+
...stateProps,
|
|
30
|
+
style: {
|
|
31
|
+
"--centered-title-padding-x": centeredTitlePaddingX
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
}),
|
|
35
|
+
[stateProps, centeredTitlePaddingX]
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.useAppBar = useAppBar;
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction, HTMLAttributes, CSSProperties, AriaRole, ReactNode, ClipboardEventHandler, CompositionEventHandler, FocusEventHandler, FormEventHandler, InputEventHandler, ReactEventHandler, KeyboardEventHandler, MouseEventHandler, DragEventHandler, TouchEventHandler, PointerEventHandler, UIEventHandler, WheelEventHandler, AnimationEventHandler, ToggleEventHandler, TransitionEventHandler } from 'react';
|
|
2
|
+
export interface UseAppBarProps {
|
|
3
|
+
}
|
|
4
|
+
export type UseAppBarReturn = ReturnType<typeof useAppBar>;
|
|
5
|
+
export declare function useAppBar(_props: UseAppBarProps): {
|
|
6
|
+
refs: {
|
|
7
|
+
root: Dispatch<SetStateAction<HTMLElement | null>>;
|
|
8
|
+
left: Dispatch<SetStateAction<HTMLElement | null>>;
|
|
9
|
+
right: Dispatch<SetStateAction<HTMLElement | null>>;
|
|
10
|
+
};
|
|
11
|
+
stateProps: HTMLAttributes<HTMLElement>;
|
|
12
|
+
rootProps: {
|
|
13
|
+
slot?: string | undefined | undefined;
|
|
14
|
+
style?: CSSProperties | undefined;
|
|
15
|
+
title?: string | undefined | undefined;
|
|
16
|
+
dir?: string | undefined | undefined;
|
|
17
|
+
part?: string | undefined | undefined;
|
|
18
|
+
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
19
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
20
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
21
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
22
|
+
accessKey?: string | undefined | undefined;
|
|
23
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
24
|
+
autoFocus?: boolean | undefined | undefined;
|
|
25
|
+
className?: string | undefined | undefined;
|
|
26
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
27
|
+
contextMenu?: string | undefined | undefined;
|
|
28
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
29
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
30
|
+
hidden?: boolean | undefined | undefined;
|
|
31
|
+
id?: string | undefined | undefined;
|
|
32
|
+
lang?: string | undefined | undefined;
|
|
33
|
+
nonce?: string | undefined | undefined;
|
|
34
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
35
|
+
tabIndex?: number | undefined | undefined;
|
|
36
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
37
|
+
radioGroup?: string | undefined | undefined;
|
|
38
|
+
role?: AriaRole | undefined;
|
|
39
|
+
about?: string | undefined | undefined;
|
|
40
|
+
content?: string | undefined | undefined;
|
|
41
|
+
datatype?: string | undefined | undefined;
|
|
42
|
+
inlist?: any;
|
|
43
|
+
prefix?: string | undefined | undefined;
|
|
44
|
+
property?: string | undefined | undefined;
|
|
45
|
+
rel?: string | undefined | undefined;
|
|
46
|
+
resource?: string | undefined | undefined;
|
|
47
|
+
rev?: string | undefined | undefined;
|
|
48
|
+
typeof?: string | undefined | undefined;
|
|
49
|
+
vocab?: string | undefined | undefined;
|
|
50
|
+
autoCorrect?: string | undefined | undefined;
|
|
51
|
+
autoSave?: string | undefined | undefined;
|
|
52
|
+
color?: string | undefined | undefined;
|
|
53
|
+
itemProp?: string | undefined | undefined;
|
|
54
|
+
itemScope?: boolean | undefined | undefined;
|
|
55
|
+
itemType?: string | undefined | undefined;
|
|
56
|
+
itemID?: string | undefined | undefined;
|
|
57
|
+
itemRef?: string | undefined | undefined;
|
|
58
|
+
results?: number | undefined | undefined;
|
|
59
|
+
security?: string | undefined | undefined;
|
|
60
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
61
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined | undefined;
|
|
62
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
63
|
+
popoverTarget?: string | undefined | undefined;
|
|
64
|
+
inert?: boolean | undefined | undefined;
|
|
65
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
66
|
+
is?: string | undefined | undefined;
|
|
67
|
+
exportparts?: string | undefined | undefined;
|
|
68
|
+
"aria-activedescendant"?: string | undefined | undefined;
|
|
69
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
70
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
71
|
+
"aria-braillelabel"?: string | undefined | undefined;
|
|
72
|
+
"aria-brailleroledescription"?: string | undefined | undefined;
|
|
73
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
74
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
75
|
+
"aria-colcount"?: number | undefined | undefined;
|
|
76
|
+
"aria-colindex"?: number | undefined | undefined;
|
|
77
|
+
"aria-colindextext"?: string | undefined | undefined;
|
|
78
|
+
"aria-colspan"?: number | undefined | undefined;
|
|
79
|
+
"aria-controls"?: string | undefined | undefined;
|
|
80
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined | undefined;
|
|
81
|
+
"aria-describedby"?: string | undefined | undefined;
|
|
82
|
+
"aria-description"?: string | undefined | undefined;
|
|
83
|
+
"aria-details"?: string | undefined | undefined;
|
|
84
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
85
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
86
|
+
"aria-errormessage"?: string | undefined | undefined;
|
|
87
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
88
|
+
"aria-flowto"?: string | undefined | undefined;
|
|
89
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
90
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
|
|
91
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
92
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
93
|
+
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
94
|
+
"aria-label"?: string | undefined | undefined;
|
|
95
|
+
"aria-labelledby"?: string | undefined | undefined;
|
|
96
|
+
"aria-level"?: number | undefined | undefined;
|
|
97
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
98
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
99
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
100
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
101
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined | undefined;
|
|
102
|
+
"aria-owns"?: string | undefined | undefined;
|
|
103
|
+
"aria-placeholder"?: string | undefined | undefined;
|
|
104
|
+
"aria-posinset"?: number | undefined | undefined;
|
|
105
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
106
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
107
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
|
|
108
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
109
|
+
"aria-roledescription"?: string | undefined | undefined;
|
|
110
|
+
"aria-rowcount"?: number | undefined | undefined;
|
|
111
|
+
"aria-rowindex"?: number | undefined | undefined;
|
|
112
|
+
"aria-rowindextext"?: string | undefined | undefined;
|
|
113
|
+
"aria-rowspan"?: number | undefined | undefined;
|
|
114
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
115
|
+
"aria-setsize"?: number | undefined | undefined;
|
|
116
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
|
|
117
|
+
"aria-valuemax"?: number | undefined | undefined;
|
|
118
|
+
"aria-valuemin"?: number | undefined | undefined;
|
|
119
|
+
"aria-valuenow"?: number | undefined | undefined;
|
|
120
|
+
"aria-valuetext"?: string | undefined | undefined;
|
|
121
|
+
children?: ReactNode;
|
|
122
|
+
dangerouslySetInnerHTML?: {
|
|
123
|
+
__html: string | TrustedHTML;
|
|
124
|
+
} | undefined | undefined;
|
|
125
|
+
onCopy?: ClipboardEventHandler<HTMLElement> | undefined;
|
|
126
|
+
onCopyCapture?: ClipboardEventHandler<HTMLElement> | undefined;
|
|
127
|
+
onCut?: ClipboardEventHandler<HTMLElement> | undefined;
|
|
128
|
+
onCutCapture?: ClipboardEventHandler<HTMLElement> | undefined;
|
|
129
|
+
onPaste?: ClipboardEventHandler<HTMLElement> | undefined;
|
|
130
|
+
onPasteCapture?: ClipboardEventHandler<HTMLElement> | undefined;
|
|
131
|
+
onCompositionEnd?: CompositionEventHandler<HTMLElement> | undefined;
|
|
132
|
+
onCompositionEndCapture?: CompositionEventHandler<HTMLElement> | undefined;
|
|
133
|
+
onCompositionStart?: CompositionEventHandler<HTMLElement> | undefined;
|
|
134
|
+
onCompositionStartCapture?: CompositionEventHandler<HTMLElement> | undefined;
|
|
135
|
+
onCompositionUpdate?: CompositionEventHandler<HTMLElement> | undefined;
|
|
136
|
+
onCompositionUpdateCapture?: CompositionEventHandler<HTMLElement> | undefined;
|
|
137
|
+
onFocus?: FocusEventHandler<HTMLElement> | undefined;
|
|
138
|
+
onFocusCapture?: FocusEventHandler<HTMLElement> | undefined;
|
|
139
|
+
onBlur?: FocusEventHandler<HTMLElement> | undefined;
|
|
140
|
+
onBlurCapture?: FocusEventHandler<HTMLElement> | undefined;
|
|
141
|
+
onChange?: FormEventHandler<HTMLElement> | undefined;
|
|
142
|
+
onChangeCapture?: FormEventHandler<HTMLElement> | undefined;
|
|
143
|
+
onBeforeInput?: InputEventHandler<HTMLElement> | undefined;
|
|
144
|
+
onBeforeInputCapture?: FormEventHandler<HTMLElement> | undefined;
|
|
145
|
+
onInput?: FormEventHandler<HTMLElement> | undefined;
|
|
146
|
+
onInputCapture?: FormEventHandler<HTMLElement> | undefined;
|
|
147
|
+
onReset?: FormEventHandler<HTMLElement> | undefined;
|
|
148
|
+
onResetCapture?: FormEventHandler<HTMLElement> | undefined;
|
|
149
|
+
onSubmit?: FormEventHandler<HTMLElement> | undefined;
|
|
150
|
+
onSubmitCapture?: FormEventHandler<HTMLElement> | undefined;
|
|
151
|
+
onInvalid?: FormEventHandler<HTMLElement> | undefined;
|
|
152
|
+
onInvalidCapture?: FormEventHandler<HTMLElement> | undefined;
|
|
153
|
+
onLoad?: ReactEventHandler<HTMLElement> | undefined;
|
|
154
|
+
onLoadCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
155
|
+
onError?: ReactEventHandler<HTMLElement> | undefined;
|
|
156
|
+
onErrorCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
157
|
+
onKeyDown?: KeyboardEventHandler<HTMLElement> | undefined;
|
|
158
|
+
onKeyDownCapture?: KeyboardEventHandler<HTMLElement> | undefined;
|
|
159
|
+
onKeyPress?: KeyboardEventHandler<HTMLElement> | undefined;
|
|
160
|
+
onKeyPressCapture?: KeyboardEventHandler<HTMLElement> | undefined;
|
|
161
|
+
onKeyUp?: KeyboardEventHandler<HTMLElement> | undefined;
|
|
162
|
+
onKeyUpCapture?: KeyboardEventHandler<HTMLElement> | undefined;
|
|
163
|
+
onAbort?: ReactEventHandler<HTMLElement> | undefined;
|
|
164
|
+
onAbortCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
165
|
+
onCanPlay?: ReactEventHandler<HTMLElement> | undefined;
|
|
166
|
+
onCanPlayCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
167
|
+
onCanPlayThrough?: ReactEventHandler<HTMLElement> | undefined;
|
|
168
|
+
onCanPlayThroughCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
169
|
+
onDurationChange?: ReactEventHandler<HTMLElement> | undefined;
|
|
170
|
+
onDurationChangeCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
171
|
+
onEmptied?: ReactEventHandler<HTMLElement> | undefined;
|
|
172
|
+
onEmptiedCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
173
|
+
onEncrypted?: ReactEventHandler<HTMLElement> | undefined;
|
|
174
|
+
onEncryptedCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
175
|
+
onEnded?: ReactEventHandler<HTMLElement> | undefined;
|
|
176
|
+
onEndedCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
177
|
+
onLoadedData?: ReactEventHandler<HTMLElement> | undefined;
|
|
178
|
+
onLoadedDataCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
179
|
+
onLoadedMetadata?: ReactEventHandler<HTMLElement> | undefined;
|
|
180
|
+
onLoadedMetadataCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
181
|
+
onLoadStart?: ReactEventHandler<HTMLElement> | undefined;
|
|
182
|
+
onLoadStartCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
183
|
+
onPause?: ReactEventHandler<HTMLElement> | undefined;
|
|
184
|
+
onPauseCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
185
|
+
onPlay?: ReactEventHandler<HTMLElement> | undefined;
|
|
186
|
+
onPlayCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
187
|
+
onPlaying?: ReactEventHandler<HTMLElement> | undefined;
|
|
188
|
+
onPlayingCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
189
|
+
onProgress?: ReactEventHandler<HTMLElement> | undefined;
|
|
190
|
+
onProgressCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
191
|
+
onRateChange?: ReactEventHandler<HTMLElement> | undefined;
|
|
192
|
+
onRateChangeCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
193
|
+
onSeeked?: ReactEventHandler<HTMLElement> | undefined;
|
|
194
|
+
onSeekedCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
195
|
+
onSeeking?: ReactEventHandler<HTMLElement> | undefined;
|
|
196
|
+
onSeekingCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
197
|
+
onStalled?: ReactEventHandler<HTMLElement> | undefined;
|
|
198
|
+
onStalledCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
199
|
+
onSuspend?: ReactEventHandler<HTMLElement> | undefined;
|
|
200
|
+
onSuspendCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
201
|
+
onTimeUpdate?: ReactEventHandler<HTMLElement> | undefined;
|
|
202
|
+
onTimeUpdateCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
203
|
+
onVolumeChange?: ReactEventHandler<HTMLElement> | undefined;
|
|
204
|
+
onVolumeChangeCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
205
|
+
onWaiting?: ReactEventHandler<HTMLElement> | undefined;
|
|
206
|
+
onWaitingCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
207
|
+
onAuxClick?: MouseEventHandler<HTMLElement> | undefined;
|
|
208
|
+
onAuxClickCapture?: MouseEventHandler<HTMLElement> | undefined;
|
|
209
|
+
onClick?: MouseEventHandler<HTMLElement> | undefined;
|
|
210
|
+
onClickCapture?: MouseEventHandler<HTMLElement> | undefined;
|
|
211
|
+
onContextMenu?: MouseEventHandler<HTMLElement> | undefined;
|
|
212
|
+
onContextMenuCapture?: MouseEventHandler<HTMLElement> | undefined;
|
|
213
|
+
onDoubleClick?: MouseEventHandler<HTMLElement> | undefined;
|
|
214
|
+
onDoubleClickCapture?: MouseEventHandler<HTMLElement> | undefined;
|
|
215
|
+
onDrag?: DragEventHandler<HTMLElement> | undefined;
|
|
216
|
+
onDragCapture?: DragEventHandler<HTMLElement> | undefined;
|
|
217
|
+
onDragEnd?: DragEventHandler<HTMLElement> | undefined;
|
|
218
|
+
onDragEndCapture?: DragEventHandler<HTMLElement> | undefined;
|
|
219
|
+
onDragEnter?: DragEventHandler<HTMLElement> | undefined;
|
|
220
|
+
onDragEnterCapture?: DragEventHandler<HTMLElement> | undefined;
|
|
221
|
+
onDragExit?: DragEventHandler<HTMLElement> | undefined;
|
|
222
|
+
onDragExitCapture?: DragEventHandler<HTMLElement> | undefined;
|
|
223
|
+
onDragLeave?: DragEventHandler<HTMLElement> | undefined;
|
|
224
|
+
onDragLeaveCapture?: DragEventHandler<HTMLElement> | undefined;
|
|
225
|
+
onDragOver?: DragEventHandler<HTMLElement> | undefined;
|
|
226
|
+
onDragOverCapture?: DragEventHandler<HTMLElement> | undefined;
|
|
227
|
+
onDragStart?: DragEventHandler<HTMLElement> | undefined;
|
|
228
|
+
onDragStartCapture?: DragEventHandler<HTMLElement> | undefined;
|
|
229
|
+
onDrop?: DragEventHandler<HTMLElement> | undefined;
|
|
230
|
+
onDropCapture?: DragEventHandler<HTMLElement> | undefined;
|
|
231
|
+
onMouseDown?: MouseEventHandler<HTMLElement> | undefined;
|
|
232
|
+
onMouseDownCapture?: MouseEventHandler<HTMLElement> | undefined;
|
|
233
|
+
onMouseEnter?: MouseEventHandler<HTMLElement> | undefined;
|
|
234
|
+
onMouseLeave?: MouseEventHandler<HTMLElement> | undefined;
|
|
235
|
+
onMouseMove?: MouseEventHandler<HTMLElement> | undefined;
|
|
236
|
+
onMouseMoveCapture?: MouseEventHandler<HTMLElement> | undefined;
|
|
237
|
+
onMouseOut?: MouseEventHandler<HTMLElement> | undefined;
|
|
238
|
+
onMouseOutCapture?: MouseEventHandler<HTMLElement> | undefined;
|
|
239
|
+
onMouseOver?: MouseEventHandler<HTMLElement> | undefined;
|
|
240
|
+
onMouseOverCapture?: MouseEventHandler<HTMLElement> | undefined;
|
|
241
|
+
onMouseUp?: MouseEventHandler<HTMLElement> | undefined;
|
|
242
|
+
onMouseUpCapture?: MouseEventHandler<HTMLElement> | undefined;
|
|
243
|
+
onSelect?: ReactEventHandler<HTMLElement> | undefined;
|
|
244
|
+
onSelectCapture?: ReactEventHandler<HTMLElement> | undefined;
|
|
245
|
+
onTouchCancel?: TouchEventHandler<HTMLElement> | undefined;
|
|
246
|
+
onTouchCancelCapture?: TouchEventHandler<HTMLElement> | undefined;
|
|
247
|
+
onTouchEnd?: TouchEventHandler<HTMLElement> | undefined;
|
|
248
|
+
onTouchEndCapture?: TouchEventHandler<HTMLElement> | undefined;
|
|
249
|
+
onTouchMove?: TouchEventHandler<HTMLElement> | undefined;
|
|
250
|
+
onTouchMoveCapture?: TouchEventHandler<HTMLElement> | undefined;
|
|
251
|
+
onTouchStart?: TouchEventHandler<HTMLElement> | undefined;
|
|
252
|
+
onTouchStartCapture?: TouchEventHandler<HTMLElement> | undefined;
|
|
253
|
+
onPointerDown?: PointerEventHandler<HTMLElement> | undefined;
|
|
254
|
+
onPointerDownCapture?: PointerEventHandler<HTMLElement> | undefined;
|
|
255
|
+
onPointerMove?: PointerEventHandler<HTMLElement> | undefined;
|
|
256
|
+
onPointerMoveCapture?: PointerEventHandler<HTMLElement> | undefined;
|
|
257
|
+
onPointerUp?: PointerEventHandler<HTMLElement> | undefined;
|
|
258
|
+
onPointerUpCapture?: PointerEventHandler<HTMLElement> | undefined;
|
|
259
|
+
onPointerCancel?: PointerEventHandler<HTMLElement> | undefined;
|
|
260
|
+
onPointerCancelCapture?: PointerEventHandler<HTMLElement> | undefined;
|
|
261
|
+
onPointerEnter?: PointerEventHandler<HTMLElement> | undefined;
|
|
262
|
+
onPointerLeave?: PointerEventHandler<HTMLElement> | undefined;
|
|
263
|
+
onPointerOver?: PointerEventHandler<HTMLElement> | undefined;
|
|
264
|
+
onPointerOverCapture?: PointerEventHandler<HTMLElement> | undefined;
|
|
265
|
+
onPointerOut?: PointerEventHandler<HTMLElement> | undefined;
|
|
266
|
+
onPointerOutCapture?: PointerEventHandler<HTMLElement> | undefined;
|
|
267
|
+
onGotPointerCapture?: PointerEventHandler<HTMLElement> | undefined;
|
|
268
|
+
onGotPointerCaptureCapture?: PointerEventHandler<HTMLElement> | undefined;
|
|
269
|
+
onLostPointerCapture?: PointerEventHandler<HTMLElement> | undefined;
|
|
270
|
+
onLostPointerCaptureCapture?: PointerEventHandler<HTMLElement> | undefined;
|
|
271
|
+
onScroll?: UIEventHandler<HTMLElement> | undefined;
|
|
272
|
+
onScrollCapture?: UIEventHandler<HTMLElement> | undefined;
|
|
273
|
+
onScrollEnd?: UIEventHandler<HTMLElement> | undefined;
|
|
274
|
+
onScrollEndCapture?: UIEventHandler<HTMLElement> | undefined;
|
|
275
|
+
onWheel?: WheelEventHandler<HTMLElement> | undefined;
|
|
276
|
+
onWheelCapture?: WheelEventHandler<HTMLElement> | undefined;
|
|
277
|
+
onAnimationStart?: AnimationEventHandler<HTMLElement> | undefined;
|
|
278
|
+
onAnimationStartCapture?: AnimationEventHandler<HTMLElement> | undefined;
|
|
279
|
+
onAnimationEnd?: AnimationEventHandler<HTMLElement> | undefined;
|
|
280
|
+
onAnimationEndCapture?: AnimationEventHandler<HTMLElement> | undefined;
|
|
281
|
+
onAnimationIteration?: AnimationEventHandler<HTMLElement> | undefined;
|
|
282
|
+
onAnimationIterationCapture?: AnimationEventHandler<HTMLElement> | undefined;
|
|
283
|
+
onToggle?: ToggleEventHandler<HTMLElement> | undefined;
|
|
284
|
+
onBeforeToggle?: ToggleEventHandler<HTMLElement> | undefined;
|
|
285
|
+
onTransitionCancel?: TransitionEventHandler<HTMLElement> | undefined;
|
|
286
|
+
onTransitionCancelCapture?: TransitionEventHandler<HTMLElement> | undefined;
|
|
287
|
+
onTransitionEnd?: TransitionEventHandler<HTMLElement> | undefined;
|
|
288
|
+
onTransitionEndCapture?: TransitionEventHandler<HTMLElement> | undefined;
|
|
289
|
+
onTransitionRun?: TransitionEventHandler<HTMLElement> | undefined;
|
|
290
|
+
onTransitionRunCapture?: TransitionEventHandler<HTMLElement> | undefined;
|
|
291
|
+
onTransitionStart?: TransitionEventHandler<HTMLElement> | undefined;
|
|
292
|
+
onTransitionStartCapture?: TransitionEventHandler<HTMLElement> | undefined;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { elementProps } from '@seed-design/dom-utils';
|
|
3
|
+
import { useState, useMemo } from 'react';
|
|
4
|
+
import { useAppScreenContext } from '../AppScreen/useAppScreenContext.js';
|
|
5
|
+
import { useElementOffset } from '../private/useElementOffset.js';
|
|
6
|
+
|
|
7
|
+
function useAppBar(_props) {
|
|
8
|
+
const { stateProps } = useAppScreenContext();
|
|
9
|
+
const [root, rootRef] = useState(null);
|
|
10
|
+
const [left, leftRef] = useState(null);
|
|
11
|
+
const [right, rightRef] = useState(null);
|
|
12
|
+
const leftOffset = useElementOffset(left);
|
|
13
|
+
const rightOffset = useElementOffset(right);
|
|
14
|
+
const centeredTitlePaddingX = root ? `${Math.max(leftOffset?.fromLeft ?? 0, rightOffset?.fromRight ?? 0)}px` : "initial";
|
|
15
|
+
return useMemo(
|
|
16
|
+
() => ({
|
|
17
|
+
refs: {
|
|
18
|
+
root: rootRef,
|
|
19
|
+
left: leftRef,
|
|
20
|
+
right: rightRef
|
|
21
|
+
},
|
|
22
|
+
stateProps,
|
|
23
|
+
rootProps: elementProps({
|
|
24
|
+
"data-part": "appBar",
|
|
25
|
+
...stateProps,
|
|
26
|
+
style: {
|
|
27
|
+
"--centered-title-padding-x": centeredTitlePaddingX
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
}),
|
|
31
|
+
[stateProps, centeredTitlePaddingX]
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { useAppBar };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const React = require('react');
|
|
7
|
+
|
|
8
|
+
const AppBarContext = React.createContext(null);
|
|
9
|
+
const AppBarProvider = AppBarContext.Provider;
|
|
10
|
+
function useAppBarContext({
|
|
11
|
+
strict = true
|
|
12
|
+
} = {}) {
|
|
13
|
+
const context = React.useContext(AppBarContext);
|
|
14
|
+
if (!context && strict) {
|
|
15
|
+
throw new Error("useAppBarContext must be used within a AppBar");
|
|
16
|
+
}
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.AppBarProvider = AppBarProvider;
|
|
21
|
+
exports.useAppBarContext = useAppBarContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseAppBarReturn } from './useAppBar';
|
|
2
|
+
import { Provider } from 'react';
|
|
3
|
+
export interface UseAppBarContext extends UseAppBarReturn {
|
|
4
|
+
}
|
|
5
|
+
export declare const AppBarProvider: Provider<UseAppBarContext | null>;
|
|
6
|
+
export declare function useAppBarContext<T extends boolean | undefined = true>({ strict, }?: {
|
|
7
|
+
strict?: T;
|
|
8
|
+
}): T extends false ? UseAppBarContext | null : UseAppBarContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
|
|
4
|
+
const AppBarContext = createContext(null);
|
|
5
|
+
const AppBarProvider = AppBarContext.Provider;
|
|
6
|
+
function useAppBarContext({
|
|
7
|
+
strict = true
|
|
8
|
+
} = {}) {
|
|
9
|
+
const context = useContext(AppBarContext);
|
|
10
|
+
if (!context && strict) {
|
|
11
|
+
throw new Error("useAppBarContext must be used within a AppBar");
|
|
12
|
+
}
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { AppBarProvider, useAppBarContext };
|