@mittwald/flow-react-components 1.5.20 → 1.5.21
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.
|
@@ -6,7 +6,7 @@ import React, { Suspense, useEffect, useLayoutEffect, useState } from "react";
|
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useIsSSR } from "react-aria";
|
|
8
8
|
//#region src/components/Activity/Activity.tsx
|
|
9
|
-
var isActivitySupported =
|
|
9
|
+
var isActivitySupported = "Activity" in React;
|
|
10
10
|
var CustomActivity = (props) => {
|
|
11
11
|
const { children, isActive = true } = props;
|
|
12
12
|
return /* @__PURE__ */ jsxs(Suspense, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Activity.mjs","names":[],"sources":["../../../../../../../src/components/Activity/Activity.tsx"],"sourcesContent":["import SuspenseTrigger from \"@/components/SuspenseTrigger\";\nimport React, { useEffect, useLayoutEffect, useState } from \"react\";\nimport { type FC, type PropsWithChildren } from \"react\";\nimport { Suspense } from \"react\";\nimport { useIsSSR } from \"react-aria\";\nimport {\n ActivityContextProvider,\n useIsActivityActive,\n} from \"@/components/Activity/context\";\n\nexport interface ActivityProps extends PropsWithChildren {\n isActive?: boolean;\n inactiveDelay?: number;\n /** @internal */\n forceCustomActivity?: boolean;\n}\n\nconst isActivitySupported =
|
|
1
|
+
{"version":3,"file":"Activity.mjs","names":[],"sources":["../../../../../../../src/components/Activity/Activity.tsx"],"sourcesContent":["import SuspenseTrigger from \"@/components/SuspenseTrigger\";\nimport React, { useEffect, useLayoutEffect, useState } from \"react\";\nimport { type FC, type PropsWithChildren } from \"react\";\nimport { Suspense } from \"react\";\nimport { useIsSSR } from \"react-aria\";\nimport {\n ActivityContextProvider,\n useIsActivityActive,\n} from \"@/components/Activity/context\";\n\nexport interface ActivityProps extends PropsWithChildren {\n isActive?: boolean;\n inactiveDelay?: number;\n /** @internal */\n forceCustomActivity?: boolean;\n}\n\nconst isActivitySupported = \"Activity\" in React;\n\nconst CustomActivity: FC<ActivityProps> = (props) => {\n const { children, isActive: isActive = true } = props;\n\n return (\n <Suspense fallback={null}>\n <SuspenseTrigger show={!isActive} />\n {children}\n </Suspense>\n );\n};\n\nexport const Activity: FC<ActivityProps> = (props) => {\n const {\n isActive: isActiveFromProps = true,\n inactiveDelay,\n forceCustomActivity = false,\n children,\n } = props;\n\n const [isActiveState, setIsActiveState] = useState(isActiveFromProps);\n const isSsr = useIsSSR();\n const isParentActive = useIsActivityActive();\n\n useEffect(() => {\n if (!inactiveDelay) {\n return;\n }\n\n if (isActiveFromProps) {\n setIsActiveState(true);\n } else {\n const timeout = setTimeout(() => {\n setIsActiveState(false);\n }, inactiveDelay);\n\n return () => {\n clearTimeout(timeout);\n };\n }\n }, [isActiveFromProps, inactiveDelay]);\n\n const isActive = inactiveDelay ? isActiveState : isActiveFromProps;\n\n /*\n * A hidden subtree keeps rendering, but React commits none of those renders —\n * that holds for React's own `Activity` as much as for the suspended one. Its\n * inline DOM is hidden along with it, yet anything it portalled elsewhere\n * stays on screen, frozen at the last commit: the open Select popover of the\n * tab you just left. So hide one commit after deactivating, which is the\n * commit the subtree needs to unmount its overlays. Setting the state from a\n * layout effect keeps that intermediate commit off the screen.\n */\n const [isHiddenState, setIsHiddenState] = useState(!isActive);\n\n useLayoutEffect(() => {\n setIsHiddenState(!isActive);\n }, [isActive]);\n\n const isHidden = isHiddenState && !isActive;\n\n if (isSsr) {\n return isActive ? children : null;\n }\n\n const content = (\n <ActivityContextProvider value={isParentActive && isActive}>\n {children}\n </ActivityContextProvider>\n );\n\n if (isActivitySupported && !forceCustomActivity) {\n return (\n <React.Activity mode={isHidden ? \"hidden\" : \"visible\"}>\n {content}\n </React.Activity>\n );\n }\n\n return <CustomActivity isActive={!isHidden}>{content}</CustomActivity>;\n};\n\nexport default Activity;\n"],"mappings":";;;;;;;;AAiBA,IAAM,sBAAsB,cAAc;AAE1C,IAAM,kBAAqC,UAAU;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description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://flow.mittwald.de",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"@internationalized/string-compiler": "^3.4.1",
|
|
85
85
|
"@lezer/common": "^1.5.2",
|
|
86
86
|
"@lezer/highlight": "^1.2.3",
|
|
87
|
-
"@mittwald/flow-icons": "^1.5.
|
|
87
|
+
"@mittwald/flow-icons": "^1.5.21",
|
|
88
88
|
"@mittwald/password-tools-js": "^3.0.0",
|
|
89
|
-
"@mittwald/react-tunnel": "^1.5.
|
|
89
|
+
"@mittwald/react-tunnel": "^1.5.21",
|
|
90
90
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
91
91
|
"@react-aria/form": "^3.2.1",
|
|
92
92
|
"@react-aria/i18n": "^3.13.1",
|
|
@@ -139,13 +139,13 @@
|
|
|
139
139
|
"@internationalized/date": "^3.12.3",
|
|
140
140
|
"@lezer/generator": "^1.8.0",
|
|
141
141
|
"@lezer/lr": "^1.4.10",
|
|
142
|
-
"@mittwald/flow-components-base": "1.5.
|
|
143
|
-
"@mittwald/flow-core": "1.5.
|
|
144
|
-
"@mittwald/flow-design-tokens": "1.5.
|
|
145
|
-
"@mittwald/flow-icons-base": "1.5.
|
|
142
|
+
"@mittwald/flow-components-base": "1.5.21",
|
|
143
|
+
"@mittwald/flow-core": "1.5.21",
|
|
144
|
+
"@mittwald/flow-design-tokens": "1.5.21",
|
|
145
|
+
"@mittwald/flow-icons-base": "1.5.21",
|
|
146
146
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
147
147
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
148
|
-
"@mittwald/typescript-config": "1.5.
|
|
148
|
+
"@mittwald/typescript-config": "1.5.21",
|
|
149
149
|
"@nx/storybook": "^22.7.6",
|
|
150
150
|
"@storybook/addon-a11y": "^10.5.10",
|
|
151
151
|
"@storybook/addon-actions": "^9.0.8",
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
},
|
|
200
200
|
"peerDependencies": {
|
|
201
201
|
"@internationalized/date": "^3.12.2",
|
|
202
|
-
"@mittwald/flow-icons-pro": "1.5.
|
|
202
|
+
"@mittwald/flow-icons-pro": "1.5.21",
|
|
203
203
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
204
204
|
"next": "^16.2.3",
|
|
205
205
|
"react": "^19.2.0",
|
|
@@ -223,5 +223,5 @@
|
|
|
223
223
|
"browserslist": [
|
|
224
224
|
"baseline widely available"
|
|
225
225
|
],
|
|
226
|
-
"gitHead": "
|
|
226
|
+
"gitHead": "c518ebae81be68a8ef2663f86025eb4216584ae5"
|
|
227
227
|
}
|