@mittwald/flow-react-components 0.2.0-alpha.505 → 0.2.0-alpha.506
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/CHANGELOG.md +6 -0
- package/dist/assets/doc-properties.json +4187 -4168
- package/dist/js/components/src/components/Overlay/Overlay.mjs +1 -1
- package/dist/js/components/src/components/Overlay/Overlay.mjs.map +1 -1
- package/dist/js/components/src/lib/propsContext/components/ClearPropsContext.mjs +9 -3
- package/dist/js/components/src/lib/propsContext/components/ClearPropsContext.mjs.map +1 -1
- package/dist/js/components/src/lib/propsContext/propsContext.mjs +2 -2
- package/dist/js/components/src/lib/propsContext/propsContext.mjs.map +1 -1
- package/dist/types/lib/propsContext/components/ClearPropsContext.d.ts +4 -1
- package/dist/types/lib/propsContext/components/ClearPropsContext.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -25,7 +25,7 @@ const Overlay = (props) => {
|
|
|
25
25
|
const controller = controllerFromProps ?? controllerFromContext;
|
|
26
26
|
const isOpen = controller.useIsOpen();
|
|
27
27
|
const rootClassName = clsx(styles.overlay, className);
|
|
28
|
-
return /* @__PURE__ */ jsx(ClearPropsContextView, { children: /* @__PURE__ */ jsx(
|
|
28
|
+
return /* @__PURE__ */ jsx(ClearPropsContextView, { keep: overlayType, children: /* @__PURE__ */ jsx(
|
|
29
29
|
OverlayContentView,
|
|
30
30
|
{
|
|
31
31
|
onOpenChange: (isOpen2) => controller.setOpen(isOpen2),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.mjs","sources":["../../../../../../src/components/Overlay/Overlay.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref } from \"react\";\nimport styles from \"./Overlay.module.scss\";\nimport clsx from \"clsx\";\nimport type { OverlayController } from \"@/lib/controller\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport OverlayContextProvider from \"@/lib/controller/overlay/OverlayContextProvider\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport OverlayContentView from \"@/views/OverlayContentView\";\nimport ClearPropsContextView from \"@/views/ClearPropsContextView\";\n\nexport interface OverlayProps extends PropsWithChildren, PropsWithClassName {\n ref?: Ref<HTMLDivElement>;\n /** The controller to control the overlay state. */\n controller?: OverlayController;\n /** Whether the overlay can be closed by clicking outside of it. */\n isDismissable?: boolean;\n /** Whether the overlay is a modal or a light box. */\n overlayType?: \"Modal\" | \"LightBox\";\n}\n\nexport const Overlay: FC<OverlayProps> = (props) => {\n const {\n controller: controllerFromProps,\n children,\n isDismissable = true,\n className,\n overlayType = \"Modal\",\n ref,\n } = props;\n\n const controllerFromContext = useOverlayController(overlayType, {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const isOpen = controller.useIsOpen();\n\n const rootClassName = clsx(styles.overlay, className);\n\n return (\n <ClearPropsContextView>\n <OverlayContentView\n onOpenChange={(isOpen) => controller.setOpen(isOpen)}\n isOpen={isOpen}\n ref={ref}\n isDismissable={isDismissable}\n className={rootClassName}\n >\n <OverlayContextProvider type=\"Modal\" controller={controller}>\n {isOpen && children}\n </OverlayContextProvider>\n </OverlayContentView>\n </ClearPropsContextView>\n );\n};\n\nexport default Overlay;\n"],"names":["isOpen"],"mappings":";;;;;;;;;;AAoBa,MAAA,OAAA,GAA4B,CAAC,KAAU,KAAA;AAClD,EAAM,MAAA;AAAA,IACJ,UAAY,EAAA,mBAAA;AAAA,IACZ,QAAA;AAAA,IACA,aAAgB,GAAA,IAAA;AAAA,IAChB,SAAA;AAAA,IACA,WAAc,GAAA,OAAA;AAAA,IACd;AAAA,GACE,GAAA,KAAA;AAEJ,EAAM,MAAA,qBAAA,GAAwB,qBAAqB,WAAa,EAAA;AAAA,IAC9D,0BAA4B,EAAA;AAAA,GAC7B,CAAA;AAED,EAAA,MAAM,aAAa,mBAAuB,IAAA,qBAAA;AAE1C,EAAM,MAAA,MAAA,GAAS,WAAW,SAAU,EAAA;AAEpC,EAAA,MAAM,aAAgB,GAAA,IAAA,CAAK,MAAO,CAAA,OAAA,EAAS,SAAS,CAAA;AAEpD,
|
|
1
|
+
{"version":3,"file":"Overlay.mjs","sources":["../../../../../../src/components/Overlay/Overlay.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref } from \"react\";\nimport styles from \"./Overlay.module.scss\";\nimport clsx from \"clsx\";\nimport type { OverlayController } from \"@/lib/controller\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport OverlayContextProvider from \"@/lib/controller/overlay/OverlayContextProvider\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport OverlayContentView from \"@/views/OverlayContentView\";\nimport ClearPropsContextView from \"@/views/ClearPropsContextView\";\n\nexport interface OverlayProps extends PropsWithChildren, PropsWithClassName {\n ref?: Ref<HTMLDivElement>;\n /** The controller to control the overlay state. */\n controller?: OverlayController;\n /** Whether the overlay can be closed by clicking outside of it. */\n isDismissable?: boolean;\n /** Whether the overlay is a modal or a light box. */\n overlayType?: \"Modal\" | \"LightBox\";\n}\n\nexport const Overlay: FC<OverlayProps> = (props) => {\n const {\n controller: controllerFromProps,\n children,\n isDismissable = true,\n className,\n overlayType = \"Modal\",\n ref,\n } = props;\n\n const controllerFromContext = useOverlayController(overlayType, {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const isOpen = controller.useIsOpen();\n\n const rootClassName = clsx(styles.overlay, className);\n\n return (\n <ClearPropsContextView keep={overlayType}>\n <OverlayContentView\n onOpenChange={(isOpen) => controller.setOpen(isOpen)}\n isOpen={isOpen}\n ref={ref}\n isDismissable={isDismissable}\n className={rootClassName}\n >\n <OverlayContextProvider type=\"Modal\" controller={controller}>\n {isOpen && children}\n </OverlayContextProvider>\n </OverlayContentView>\n </ClearPropsContextView>\n );\n};\n\nexport default Overlay;\n"],"names":["isOpen"],"mappings":";;;;;;;;;;AAoBa,MAAA,OAAA,GAA4B,CAAC,KAAU,KAAA;AAClD,EAAM,MAAA;AAAA,IACJ,UAAY,EAAA,mBAAA;AAAA,IACZ,QAAA;AAAA,IACA,aAAgB,GAAA,IAAA;AAAA,IAChB,SAAA;AAAA,IACA,WAAc,GAAA,OAAA;AAAA,IACd;AAAA,GACE,GAAA,KAAA;AAEJ,EAAM,MAAA,qBAAA,GAAwB,qBAAqB,WAAa,EAAA;AAAA,IAC9D,0BAA4B,EAAA;AAAA,GAC7B,CAAA;AAED,EAAA,MAAM,aAAa,mBAAuB,IAAA,qBAAA;AAE1C,EAAM,MAAA,MAAA,GAAS,WAAW,SAAU,EAAA;AAEpC,EAAA,MAAM,aAAgB,GAAA,IAAA,CAAK,MAAO,CAAA,OAAA,EAAS,SAAS,CAAA;AAEpD,EACE,uBAAA,GAAA,CAAC,qBAAsB,EAAA,EAAA,IAAA,EAAM,WAC3B,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,YAAc,EAAA,CAACA,OAAW,KAAA,UAAA,CAAW,QAAQA,OAAM,CAAA;AAAA,MACnD,MAAA;AAAA,MACA,GAAA;AAAA,MACA,aAAA;AAAA,MACA,SAAW,EAAA,aAAA;AAAA,MAEX,8BAAC,sBAAuB,EAAA,EAAA,IAAA,EAAK,OAAQ,EAAA,UAAA,EAClC,oBAAU,QACb,EAAA;AAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import {
|
|
4
|
+
import { usePropsContext, PropsContextProvider } from '../propsContext.mjs';
|
|
5
5
|
import { PropsContextLevelProvider } from '../inherit/PropsContextLevelProvider.mjs';
|
|
6
|
+
import { useMemo } from 'react';
|
|
6
7
|
|
|
7
8
|
const ClearPropsContext = (props) => {
|
|
8
|
-
const { children } = props;
|
|
9
|
-
|
|
9
|
+
const { children, keep } = props;
|
|
10
|
+
const parentPropsContext = usePropsContext();
|
|
11
|
+
const withKeptComponentProps = useMemo(
|
|
12
|
+
() => (keep ? parentPropsContext[keep] : void 0) ?? {},
|
|
13
|
+
[keep, parentPropsContext]
|
|
14
|
+
);
|
|
15
|
+
return /* @__PURE__ */ jsx(PropsContextLevelProvider, { mode: "reset", children: /* @__PURE__ */ jsx(PropsContextProvider, { value: withKeptComponentProps, children }) });
|
|
10
16
|
};
|
|
11
17
|
|
|
12
18
|
export { ClearPropsContext, ClearPropsContext as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearPropsContext.mjs","sources":["../../../../../../../src/lib/propsContext/components/ClearPropsContext.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ClearPropsContext.mjs","sources":["../../../../../../../src/lib/propsContext/components/ClearPropsContext.tsx"],"sourcesContent":["import {\n PropsContextProvider,\n usePropsContext,\n} from \"@/lib/propsContext/propsContext\";\nimport { PropsContextLevelProvider } from \"@/lib/propsContext/inherit/PropsContextLevelProvider\";\nimport { useMemo, type FC, type PropsWithChildren } from \"react\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\nimport type { PropsContext } from \"@/index/internal\";\n\nexport interface ClearPropsContextProps extends PropsWithChildren {\n keep?: FlowComponentName;\n}\n\n/** @flr-generate all */\nexport const ClearPropsContext: FC<ClearPropsContextProps> = (props) => {\n const { children, keep } = props;\n\n const parentPropsContext = usePropsContext();\n\n const withKeptComponentProps: PropsContext = useMemo(\n () => (keep ? parentPropsContext[keep] : undefined) ?? {},\n [keep, parentPropsContext],\n );\n\n return (\n <PropsContextLevelProvider mode=\"reset\">\n <PropsContextProvider value={withKeptComponentProps}>\n {children}\n </PropsContextProvider>\n </PropsContextLevelProvider>\n );\n};\n\nexport default ClearPropsContext;\n"],"names":[],"mappings":";;;;;AAca,MAAA,iBAAA,GAAgD,CAAC,KAAU,KAAA;AACtE,EAAM,MAAA,EAAE,QAAU,EAAA,IAAA,EAAS,GAAA,KAAA;AAE3B,EAAA,MAAM,qBAAqB,eAAgB,EAAA;AAE3C,EAAA,MAAM,sBAAuC,GAAA,OAAA;AAAA,IAC3C,OAAO,IAAO,GAAA,kBAAA,CAAmB,IAAI,CAAA,GAAI,WAAc,EAAC;AAAA,IACxD,CAAC,MAAM,kBAAkB;AAAA,GAC3B;AAEA,EACE,uBAAA,GAAA,CAAC,6BAA0B,IAAK,EAAA,OAAA,EAC9B,8BAAC,oBAAqB,EAAA,EAAA,KAAA,EAAO,sBAC1B,EAAA,QAAA,EACH,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { createContext, useContext } from 'react';
|
|
4
4
|
|
|
5
5
|
const propsContext = createContext({});
|
|
6
|
-
propsContext.Provider;
|
|
6
|
+
const PropsContextProvider = propsContext.Provider;
|
|
7
7
|
const usePropsContext = () => useContext(propsContext);
|
|
8
8
|
const useComponentPropsContext = (component) => usePropsContext()[component];
|
|
9
9
|
|
|
10
|
-
export { propsContext, useComponentPropsContext, usePropsContext };
|
|
10
|
+
export { PropsContextProvider, propsContext, useComponentPropsContext, usePropsContext };
|
|
11
11
|
//# sourceMappingURL=propsContext.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propsContext.mjs","sources":["../../../../../../src/lib/propsContext/propsContext.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type {\n ComponentPropsContext,\n PropsContext,\n} from \"@/lib/propsContext/types\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\n\nexport const propsContext = createContext<PropsContext>({});\n\nexport const PropsContextProvider = propsContext.Provider;\n\nexport const usePropsContext = (): PropsContext => useContext(propsContext);\n\nexport const useComponentPropsContext = <C extends FlowComponentName>(\n component: C,\n) => usePropsContext()[component] as ComponentPropsContext<C> | undefined;\n"],"names":[],"mappings":";;AAOa,MAAA,YAAA,GAAe,aAA4B,CAAA,EAAE;
|
|
1
|
+
{"version":3,"file":"propsContext.mjs","sources":["../../../../../../src/lib/propsContext/propsContext.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type {\n ComponentPropsContext,\n PropsContext,\n} from \"@/lib/propsContext/types\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\n\nexport const propsContext = createContext<PropsContext>({});\n\nexport const PropsContextProvider = propsContext.Provider;\n\nexport const usePropsContext = (): PropsContext => useContext(propsContext);\n\nexport const useComponentPropsContext = <C extends FlowComponentName>(\n component: C,\n) => usePropsContext()[component] as ComponentPropsContext<C> | undefined;\n"],"names":[],"mappings":";;AAOa,MAAA,YAAA,GAAe,aAA4B,CAAA,EAAE;AAEnD,MAAM,uBAAuB,YAAa,CAAA;AAEpC,MAAA,eAAA,GAAkB,MAAoB,UAAA,CAAW,YAAY;AAEnE,MAAM,wBAA2B,GAAA,CACtC,SACG,KAAA,eAAA,GAAkB,SAAS;;;;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
|
|
2
|
+
import { FlowComponentName } from '../../../components/propTypes';
|
|
3
|
+
export interface ClearPropsContextProps extends PropsWithChildren {
|
|
4
|
+
keep?: FlowComponentName;
|
|
5
|
+
}
|
|
3
6
|
/** @flr-generate all */
|
|
4
7
|
export declare const ClearPropsContext: FC<ClearPropsContextProps>;
|
|
5
8
|
export default ClearPropsContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearPropsContext.d.ts","sourceRoot":"","sources":["../../../../../src/lib/propsContext/components/ClearPropsContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClearPropsContext.d.ts","sourceRoot":"","sources":["../../../../../src/lib/propsContext/components/ClearPropsContext.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAW,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED,wBAAwB;AACxB,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAiBxD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.506",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@internationalized/string-compiler": "^3.2.6",
|
|
60
60
|
"@mittwald/password-tools-js": "3.0.0-alpha.18",
|
|
61
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
61
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.506",
|
|
62
62
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
63
63
|
"@react-aria/form": "^3.1.1",
|
|
64
64
|
"@react-aria/live-announcer": "^3.4.4",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@faker-js/faker": "^9.9.0",
|
|
102
102
|
"@internationalized/date": "^3.9.0",
|
|
103
103
|
"@mittwald/flow-core": "",
|
|
104
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
104
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.506",
|
|
105
105
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
106
106
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.3",
|
|
107
107
|
"@mittwald/typescript-config": "",
|
|
@@ -174,5 +174,5 @@
|
|
|
174
174
|
"optional": true
|
|
175
175
|
}
|
|
176
176
|
},
|
|
177
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "6544b75164111bdba8f349c341d985badfd952b9"
|
|
178
178
|
}
|