@jobber/components 6.116.6 → 6.117.0
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/dist/Menu/Menu.d.ts +1 -1
- package/dist/Menu/Menu.types.d.ts +6 -0
- package/dist/Menu-cjs.js +2 -2
- package/dist/Menu-es.js +2 -2
- package/package.json +2 -2
package/dist/Menu/Menu.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare namespace Menu {
|
|
|
15
15
|
var HeaderLabel: typeof MenuHeaderLabel;
|
|
16
16
|
}
|
|
17
17
|
export declare function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }: MenuLegacyProps): React.JSX.Element;
|
|
18
|
-
declare function MenuContentComposable({ children, UNSAFE_style, UNSAFE_className, }: MenuContentComposableProps): React.JSX.Element;
|
|
18
|
+
declare function MenuContentComposable({ children, UNSAFE_style, UNSAFE_className, preferredPlacement, }: MenuContentComposableProps): React.JSX.Element;
|
|
19
19
|
declare function MenuSeparatorComposable({ UNSAFE_style, UNSAFE_className, }: MenuSeparatorComposableProps): React.JSX.Element;
|
|
20
20
|
declare function MenuSectionComposable({ children, UNSAFE_style, UNSAFE_className, ariaLabel, }: MenuSectionComposableProps): React.JSX.Element;
|
|
21
21
|
declare function MenuHeaderComposable(props: MenuHeaderComposableProps): React.JSX.Element;
|
|
@@ -2,6 +2,7 @@ import type { IconColorNames, IconNames } from "@jobber/design";
|
|
|
2
2
|
import type React from "react";
|
|
3
3
|
import type { CSSProperties, ComponentProps, ReactElement, ReactNode } from "react";
|
|
4
4
|
import type { Pressable as AriaPressable } from "react-aria-components";
|
|
5
|
+
import type { Placement } from "@react-types/overlays";
|
|
5
6
|
import type { IconProps } from "../Icon";
|
|
6
7
|
type PressableChild = ComponentProps<typeof AriaPressable>["children"];
|
|
7
8
|
export interface MenuLegacyProps extends MenuBaseProps {
|
|
@@ -167,6 +168,11 @@ export interface MenuItemIconComposableProps extends IconProps {
|
|
|
167
168
|
}
|
|
168
169
|
export interface MenuContentComposableProps extends UnsafeProps {
|
|
169
170
|
readonly children: ReactNode;
|
|
171
|
+
/**
|
|
172
|
+
* Describes the preferred placement of the Menu.
|
|
173
|
+
* @default 'bottom start'
|
|
174
|
+
*/
|
|
175
|
+
readonly preferredPlacement?: Placement;
|
|
170
176
|
}
|
|
171
177
|
export interface MenuTriggerComposableProps extends UnsafeProps {
|
|
172
178
|
/**
|
package/dist/Menu-cjs.js
CHANGED
|
@@ -8706,11 +8706,11 @@ const MenuTriggerComposable = React.forwardRef(function MenuTriggerComposable({
|
|
|
8706
8706
|
return (React.createElement($3b117e43dc0ca95d$export$27c701ed9e449e99, { "aria-label": ariaLabel },
|
|
8707
8707
|
React.createElement("div", { role: "button", className: className, ref: ref, style: UNSAFE_style }, children)));
|
|
8708
8708
|
});
|
|
8709
|
-
function MenuContentComposable({ children, UNSAFE_style, UNSAFE_className, }) {
|
|
8709
|
+
function MenuContentComposable({ children, UNSAFE_style, UNSAFE_className, preferredPlacement, }) {
|
|
8710
8710
|
const { state: animation, setState } = useMenuAnimation();
|
|
8711
8711
|
const isMobile = isMobileDevice();
|
|
8712
8712
|
return (React.createElement(React.Fragment, null,
|
|
8713
|
-
React.createElement($07b14b47974efb58$export$5b6b19405a83ff9d, { isExiting: animation === "hidden", placement: "bottom start", offset: MENU_OFFSET }, ({ placement }) => {
|
|
8713
|
+
React.createElement($07b14b47974efb58$export$5b6b19405a83ff9d, { isExiting: animation === "hidden", placement: preferredPlacement !== null && preferredPlacement !== void 0 ? preferredPlacement : "bottom start", offset: MENU_OFFSET }, ({ placement }) => {
|
|
8714
8714
|
const directionModifier = (placement === null || placement === void 0 ? void 0 : placement.includes("bottom")) ? -1 : 1;
|
|
8715
8715
|
const variants = isMobile
|
|
8716
8716
|
? {
|
package/dist/Menu-es.js
CHANGED
|
@@ -8704,11 +8704,11 @@ const MenuTriggerComposable = React__default.forwardRef(function MenuTriggerComp
|
|
|
8704
8704
|
return (React__default.createElement($3b117e43dc0ca95d$export$27c701ed9e449e99, { "aria-label": ariaLabel },
|
|
8705
8705
|
React__default.createElement("div", { role: "button", className: className, ref: ref, style: UNSAFE_style }, children)));
|
|
8706
8706
|
});
|
|
8707
|
-
function MenuContentComposable({ children, UNSAFE_style, UNSAFE_className, }) {
|
|
8707
|
+
function MenuContentComposable({ children, UNSAFE_style, UNSAFE_className, preferredPlacement, }) {
|
|
8708
8708
|
const { state: animation, setState } = useMenuAnimation();
|
|
8709
8709
|
const isMobile = isMobileDevice();
|
|
8710
8710
|
return (React__default.createElement(React__default.Fragment, null,
|
|
8711
|
-
React__default.createElement($07b14b47974efb58$export$5b6b19405a83ff9d, { isExiting: animation === "hidden", placement: "bottom start", offset: MENU_OFFSET }, ({ placement }) => {
|
|
8711
|
+
React__default.createElement($07b14b47974efb58$export$5b6b19405a83ff9d, { isExiting: animation === "hidden", placement: preferredPlacement !== null && preferredPlacement !== void 0 ? preferredPlacement : "bottom start", offset: MENU_OFFSET }, ({ placement }) => {
|
|
8712
8712
|
const directionModifier = (placement === null || placement === void 0 ? void 0 : placement.includes("bottom")) ? -1 : 1;
|
|
8713
8713
|
const variants = isMobile
|
|
8714
8714
|
? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.117.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -541,5 +541,5 @@
|
|
|
541
541
|
"> 1%",
|
|
542
542
|
"IE 10"
|
|
543
543
|
],
|
|
544
|
-
"gitHead": "
|
|
544
|
+
"gitHead": "9e6be14fefe016c5d2cebae54d087531dac6e248"
|
|
545
545
|
}
|