@mittwald/flow-react-components 0.2.0-alpha.651 → 0.2.0-alpha.652
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 +3464 -3464
- package/dist/css/all.css +1 -1
- package/dist/js/components/src/components/ContextMenu/ContextMenu.mjs +22 -13
- package/dist/js/components/src/components/ContextMenu/ContextMenu.mjs.map +1 -1
- package/dist/js/components/src/components/ContextMenu/ContextMenu.module.scss.mjs +4 -2
- package/dist/js/components/src/components/ContextMenu/ContextMenu.module.scss.mjs.map +1 -1
- package/dist/types/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -58,21 +58,30 @@ const ContextMenu = flowComponent("ContextMenu", (props) => {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
-
return /* @__PURE__ */ jsx(
|
|
62
|
-
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
Popover,
|
|
63
63
|
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
...rest,
|
|
65
|
+
className: styles.popover,
|
|
66
|
+
controller: overlayController,
|
|
67
|
+
isDialogContent: false,
|
|
68
|
+
children: /* @__PURE__ */ jsx(OverlayContextProvider, { type: "ContextMenu", controller: overlayController, children: /* @__PURE__ */ jsx(
|
|
69
|
+
ContextMenuContentView,
|
|
70
|
+
{
|
|
71
|
+
className: styles.contextMenu,
|
|
72
|
+
onAction,
|
|
73
|
+
selectionMode: getAriaSelectionMode(selectionMode),
|
|
74
|
+
selectedKeys,
|
|
75
|
+
defaultSelectedKeys,
|
|
76
|
+
disabledKeys,
|
|
77
|
+
onSelectionChange,
|
|
78
|
+
renderEmptyState,
|
|
79
|
+
ref,
|
|
80
|
+
children: /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children: /* @__PURE__ */ jsx(Action, { closeOverlay: getCloseOverlayType(selectionMode), children }) })
|
|
81
|
+
}
|
|
82
|
+
) })
|
|
74
83
|
}
|
|
75
|
-
)
|
|
84
|
+
);
|
|
76
85
|
});
|
|
77
86
|
|
|
78
87
|
export { ContextMenu, ContextMenu as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.mjs","sources":["../../../../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import { Action } from \"@/components/Action\";\nimport type { ContextMenuSelectionMode } from \"@/components/ContextMenu/lib\";\nimport {\n getAriaSelectionMode,\n getCloseOverlayType,\n getMenuItemSelectionVariant,\n} from \"@/components/ContextMenu/lib\";\nimport type { MenuItemProps } from \"@/components/MenuItem\";\nimport { Popover, type PopoverProps } from \"@/components/Popover/Popover\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport { OverlayContextProvider } from \"@/lib/controller/overlay/OverlayContextProvider\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport ContextMenuContentView from \"@/views/ContextMenuContentView\";\nimport type * as Aria from \"react-aria-components\";\nimport styles from \"./ContextMenu.module.scss\";\n\nexport interface ContextMenuProps\n extends\n Omit<PopoverProps, \"withTip\">,\n Pick<\n Aria.MenuProps<MenuItemProps>,\n | \"onAction\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"disabledKeys\"\n | \"renderEmptyState\"\n >,\n FlowComponentProps {\n /** The type of selection that is allowed in the context menu. */\n selectionMode?: ContextMenuSelectionMode;\n /** Sets the context menu to a fixed width. */\n width?: string | number;\n}\n\n/** @flr-generate all */\nexport const ContextMenu = flowComponent(\"ContextMenu\", (props) => {\n const {\n children,\n onAction,\n selectionMode,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n renderEmptyState,\n ref,\n controller: overlayControllerFromProps,\n ...rest\n } = props;\n\n const overlayControllerFromContext = useOverlayController(\"ContextMenu\", {\n reuseControllerFromContext: true,\n });\n\n const overlayController =\n overlayControllerFromProps ?? overlayControllerFromContext;\n\n const selectionVariant = getMenuItemSelectionVariant(selectionMode);\n\n const propsContext: PropsContext = {\n MenuItem: {\n selectionVariant,\n Avatar: {\n size: \"l\",\n },\n },\n\n Section: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n renderContextMenuSection: true,\n },\n\n ContextMenuSection: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n },\n };\n\n return (\n <Popover
|
|
1
|
+
{"version":3,"file":"ContextMenu.mjs","sources":["../../../../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import { Action } from \"@/components/Action\";\nimport type { ContextMenuSelectionMode } from \"@/components/ContextMenu/lib\";\nimport {\n getAriaSelectionMode,\n getCloseOverlayType,\n getMenuItemSelectionVariant,\n} from \"@/components/ContextMenu/lib\";\nimport type { MenuItemProps } from \"@/components/MenuItem\";\nimport { Popover, type PopoverProps } from \"@/components/Popover/Popover\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport { OverlayContextProvider } from \"@/lib/controller/overlay/OverlayContextProvider\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport ContextMenuContentView from \"@/views/ContextMenuContentView\";\nimport type * as Aria from \"react-aria-components\";\nimport styles from \"./ContextMenu.module.scss\";\n\nexport interface ContextMenuProps\n extends\n Omit<PopoverProps, \"withTip\">,\n Pick<\n Aria.MenuProps<MenuItemProps>,\n | \"onAction\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"disabledKeys\"\n | \"renderEmptyState\"\n >,\n FlowComponentProps {\n /** The type of selection that is allowed in the context menu. */\n selectionMode?: ContextMenuSelectionMode;\n /** Sets the context menu to a fixed width. */\n width?: string | number;\n}\n\n/** @flr-generate all */\nexport const ContextMenu = flowComponent(\"ContextMenu\", (props) => {\n const {\n children,\n onAction,\n selectionMode,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n renderEmptyState,\n ref,\n controller: overlayControllerFromProps,\n ...rest\n } = props;\n\n const overlayControllerFromContext = useOverlayController(\"ContextMenu\", {\n reuseControllerFromContext: true,\n });\n\n const overlayController =\n overlayControllerFromProps ?? overlayControllerFromContext;\n\n const selectionVariant = getMenuItemSelectionVariant(selectionMode);\n\n const propsContext: PropsContext = {\n MenuItem: {\n selectionVariant,\n Avatar: {\n size: \"l\",\n },\n },\n\n Section: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n renderContextMenuSection: true,\n },\n\n ContextMenuSection: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n },\n };\n\n return (\n <Popover\n {...rest}\n className={styles.popover}\n controller={overlayController}\n isDialogContent={false}\n >\n <OverlayContextProvider type=\"ContextMenu\" controller={overlayController}>\n <ContextMenuContentView\n className={styles.contextMenu}\n onAction={onAction}\n selectionMode={getAriaSelectionMode(selectionMode)}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n disabledKeys={disabledKeys}\n onSelectionChange={onSelectionChange}\n renderEmptyState={renderEmptyState}\n ref={ref}\n >\n <PropsContextProvider props={propsContext}>\n <Action closeOverlay={getCloseOverlayType(selectionMode)}>\n {children}\n </Action>\n </PropsContextProvider>\n </ContextMenuContentView>\n </OverlayContextProvider>\n </Popover>\n );\n});\n\nexport default ContextMenu;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuCO,MAAM,WAAA,GAAc,aAAA,CAAc,aAAA,EAAe,CAAC,KAAA,KAAU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A;AAAA,UACA,aAAA,EAAe,qBAAqB,aAAa,CAAA;AAAA,UACjD,YAAA;AAAA,UACA,mBAAA;AAAA,UACA,YAAA;AAAA,UACA,iBAAA;AAAA,UACA,gBAAA;AAAA,UACA,GAAA;AAAA,UAEA,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,YAAA,EAAc,mBAAA,CAAoB,aAAa,CAAA,EACpD,QAAA,EACH,CAAA,EACF;AAAA;AAAA,OACF,EACF;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
const contextMenu = "flow--context-menu";
|
|
4
4
|
const section = "flow--context-menu--section";
|
|
5
|
+
const popover = "flow--context-menu--popover";
|
|
5
6
|
const styles = {
|
|
6
7
|
contextMenu: contextMenu,
|
|
7
|
-
section: section
|
|
8
|
+
section: section,
|
|
9
|
+
popover: popover
|
|
8
10
|
};
|
|
9
11
|
|
|
10
|
-
export { contextMenu, styles as default, section };
|
|
12
|
+
export { contextMenu, styles as default, popover, section };
|
|
11
13
|
//# sourceMappingURL=ContextMenu.module.scss.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextMenu.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAM7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAO/E,OAAO,KAAK,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAGnD,MAAM,WAAW,gBACf,SACE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,EAC7B,IAAI,CACF,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAC3B,UAAU,GACV,cAAc,GACd,qBAAqB,GACrB,mBAAmB,GACnB,cAAc,GACd,kBAAkB,CACrB,EACD,kBAAkB;IACpB,iEAAiE;IACjE,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,wBAAwB;AACxB,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAM7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAO/E,OAAO,KAAK,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAGnD,MAAM,WAAW,gBACf,SACE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,EAC7B,IAAI,CACF,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAC3B,UAAU,GACV,cAAc,GACd,qBAAqB,GACrB,mBAAmB,GACnB,cAAc,GACd,kBAAkB,CACrB,EACD,kBAAkB;IACpB,iEAAiE;IACjE,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,wBAAwB;AACxB,eAAO,MAAM,WAAW,qGA8EtB,CAAC;AAEH,eAAe,WAAW,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.652",
|
|
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.652",
|
|
62
62
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
63
63
|
"@react-aria/form": "^3.1.3",
|
|
64
64
|
"@react-aria/live-announcer": "^3.4.4",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@faker-js/faker": "^10.2.0",
|
|
104
104
|
"@internationalized/date": "^3.10.1",
|
|
105
105
|
"@mittwald/flow-core": "",
|
|
106
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
106
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.652",
|
|
107
107
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
108
108
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
109
109
|
"@mittwald/typescript-config": "",
|
|
@@ -172,5 +172,5 @@
|
|
|
172
172
|
"optional": true
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
|
-
"gitHead": "
|
|
175
|
+
"gitHead": "8b12ea068fab21bb5cd35945665f7e7a2c3e4bba"
|
|
176
176
|
}
|