@jobber/components 6.116.5 → 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 +8 -6
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",
|
|
@@ -453,16 +453,18 @@
|
|
|
453
453
|
},
|
|
454
454
|
"scripts": {
|
|
455
455
|
"build": "npm run build:pre && rollup --config && npm run build:post",
|
|
456
|
-
"build:pre": "PREBUILD_CSS=true rollup --config && cp dist/styles.css ./styles.css.backup && npm run clean",
|
|
456
|
+
"build:pre": "npm run css:types:build && PREBUILD_CSS=true rollup --config && cp dist/styles.css ./styles.css.backup && npm run clean",
|
|
457
457
|
"build:post": "mv ./styles.css.backup dist/styles.css",
|
|
458
458
|
"bootstrap": "npm run clean; npm run build",
|
|
459
459
|
"clean": "rm -rf dist/* tsconfig.rollup.tsbuildinfo",
|
|
460
|
+
"css:types:watch": "tcm -w -p \"**/*.module.css\" src",
|
|
461
|
+
"css:types:build": "tcm -p \"**/*.module.css\" src",
|
|
460
462
|
"entryPoints:build": "ts-node --project ../../tsconfig.bin.json ../../scripts/entryPoints.ts",
|
|
461
463
|
"entryPoints:clean": "npm run entryPoints:build clean",
|
|
462
464
|
"prepack": "npm run entryPoints:build",
|
|
463
465
|
"postpack": "npm run entryPoints:clean",
|
|
464
|
-
"watch": "rollup -c rollup.config.mjs --watch",
|
|
465
|
-
"storybook": "storybook dev -p 6007 --disable-telemetry",
|
|
466
|
+
"watch": "concurrently -k -n rollup,css -c yellow,magenta \"rollup -c rollup.config.mjs --watch\" \"npm run css:types:watch\"",
|
|
467
|
+
"storybook": "concurrently -k -n storybook,css -c blue,magenta \"storybook dev -p 6007 --disable-telemetry\" \"npm run css:types:watch\"",
|
|
466
468
|
"storybook:build": "storybook build --disable-telemetry"
|
|
467
469
|
},
|
|
468
470
|
"files": [
|
|
@@ -516,7 +518,7 @@
|
|
|
516
518
|
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
517
519
|
"rollup-plugin-postcss": "^4.0.2",
|
|
518
520
|
"storybook": "9.1.19",
|
|
519
|
-
"typed-css-modules": "^0.
|
|
521
|
+
"typed-css-modules": "^0.9.1"
|
|
520
522
|
},
|
|
521
523
|
"peerDependencies": {
|
|
522
524
|
"@apollo/client": "^3",
|
|
@@ -539,5 +541,5 @@
|
|
|
539
541
|
"> 1%",
|
|
540
542
|
"IE 10"
|
|
541
543
|
],
|
|
542
|
-
"gitHead": "
|
|
544
|
+
"gitHead": "9e6be14fefe016c5d2cebae54d087531dac6e248"
|
|
543
545
|
}
|