@multiplatform.one/backoffice 7.80.0 → 7.81.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/cjs/chrome/BackofficeAwesomebar.cjs +25 -27
- package/dist/cjs/chrome/BackofficeAwesomebar.native.js +27 -29
- package/dist/cjs/chrome/BackofficeAwesomebar.native.js.map +1 -1
- package/dist/cjs/chrome/CommandPalette.cjs +1 -1
- package/dist/cjs/chrome/CommandPalette.native.js +1 -1
- package/dist/cjs/chrome/CommandPalette.native.js.map +1 -1
- package/dist/cjs/chrome/UserMenu.cjs +1 -1
- package/dist/cjs/chrome/UserMenu.native.js +1 -1
- package/dist/cjs/chrome/UserMenu.native.js.map +1 -1
- package/dist/cjs/chrome/help-about-dialog.cjs +1 -1
- package/dist/cjs/chrome/help-about-dialog.native.js +1 -1
- package/dist/cjs/chrome/help-about-dialog.native.js.map +1 -1
- package/dist/cjs/chrome/help-shortcuts-dialog.cjs +1 -1
- package/dist/cjs/chrome/help-shortcuts-dialog.native.js +1 -1
- package/dist/cjs/chrome/help-shortcuts-dialog.native.js.map +1 -1
- package/dist/cjs/i18n/en.cjs +1 -0
- package/dist/cjs/i18n/en.native.js +1 -0
- package/dist/cjs/i18n/en.native.js.map +1 -1
- package/dist/cjs/shell/BackofficeShell.cjs +12 -22
- package/dist/cjs/shell/BackofficeShell.native.js +18 -27
- package/dist/cjs/shell/BackofficeShell.native.js.map +1 -1
- package/dist/cjs/shell/WorkspaceSidebar.cjs +3 -1
- package/dist/cjs/shell/WorkspaceSidebar.native.js +3 -1
- package/dist/cjs/shell/WorkspaceSidebar.native.js.map +1 -1
- package/dist/esm/chrome/BackofficeAwesomebar.mjs +26 -28
- package/dist/esm/chrome/BackofficeAwesomebar.mjs.map +1 -1
- package/dist/esm/chrome/BackofficeAwesomebar.native.js +28 -30
- package/dist/esm/chrome/BackofficeAwesomebar.native.js.map +1 -1
- package/dist/esm/chrome/CommandPalette.mjs +2 -2
- package/dist/esm/chrome/CommandPalette.mjs.map +1 -1
- package/dist/esm/chrome/CommandPalette.native.js +2 -2
- package/dist/esm/chrome/CommandPalette.native.js.map +1 -1
- package/dist/esm/chrome/UserMenu.mjs +2 -2
- package/dist/esm/chrome/UserMenu.mjs.map +1 -1
- package/dist/esm/chrome/UserMenu.native.js +2 -2
- package/dist/esm/chrome/UserMenu.native.js.map +1 -1
- package/dist/esm/chrome/help-about-dialog.mjs +2 -2
- package/dist/esm/chrome/help-about-dialog.mjs.map +1 -1
- package/dist/esm/chrome/help-about-dialog.native.js +2 -2
- package/dist/esm/chrome/help-about-dialog.native.js.map +1 -1
- package/dist/esm/chrome/help-shortcuts-dialog.mjs +2 -2
- package/dist/esm/chrome/help-shortcuts-dialog.mjs.map +1 -1
- package/dist/esm/chrome/help-shortcuts-dialog.native.js +2 -2
- package/dist/esm/chrome/help-shortcuts-dialog.native.js.map +1 -1
- package/dist/esm/i18n/en.mjs +1 -0
- package/dist/esm/i18n/en.mjs.map +1 -1
- package/dist/esm/i18n/en.native.js +1 -0
- package/dist/esm/i18n/en.native.js.map +1 -1
- package/dist/esm/shell/BackofficeShell.mjs +14 -24
- package/dist/esm/shell/BackofficeShell.mjs.map +1 -1
- package/dist/esm/shell/BackofficeShell.native.js +20 -29
- package/dist/esm/shell/BackofficeShell.native.js.map +1 -1
- package/dist/esm/shell/WorkspaceSidebar.mjs +3 -1
- package/dist/esm/shell/WorkspaceSidebar.mjs.map +1 -1
- package/dist/esm/shell/WorkspaceSidebar.native.js +3 -1
- package/dist/esm/shell/WorkspaceSidebar.native.js.map +1 -1
- package/dist/jsx/chrome/BackofficeAwesomebar.mjs +26 -28
- package/dist/jsx/chrome/BackofficeAwesomebar.mjs.map +1 -1
- package/dist/jsx/chrome/BackofficeAwesomebar.native.js +27 -29
- package/dist/jsx/chrome/BackofficeAwesomebar.native.js.map +1 -1
- package/dist/jsx/chrome/CommandPalette.mjs +2 -2
- package/dist/jsx/chrome/CommandPalette.mjs.map +1 -1
- package/dist/jsx/chrome/CommandPalette.native.js +1 -1
- package/dist/jsx/chrome/CommandPalette.native.js.map +1 -1
- package/dist/jsx/chrome/UserMenu.mjs +2 -2
- package/dist/jsx/chrome/UserMenu.mjs.map +1 -1
- package/dist/jsx/chrome/UserMenu.native.js +1 -1
- package/dist/jsx/chrome/UserMenu.native.js.map +1 -1
- package/dist/jsx/chrome/help-about-dialog.mjs +2 -2
- package/dist/jsx/chrome/help-about-dialog.mjs.map +1 -1
- package/dist/jsx/chrome/help-about-dialog.native.js +1 -1
- package/dist/jsx/chrome/help-about-dialog.native.js.map +1 -1
- package/dist/jsx/chrome/help-shortcuts-dialog.mjs +2 -2
- package/dist/jsx/chrome/help-shortcuts-dialog.mjs.map +1 -1
- package/dist/jsx/chrome/help-shortcuts-dialog.native.js +1 -1
- package/dist/jsx/chrome/help-shortcuts-dialog.native.js.map +1 -1
- package/dist/jsx/i18n/en.mjs +1 -0
- package/dist/jsx/i18n/en.mjs.map +1 -1
- package/dist/jsx/i18n/en.native.js +1 -0
- package/dist/jsx/i18n/en.native.js.map +1 -1
- package/dist/jsx/shell/BackofficeShell.mjs +14 -24
- package/dist/jsx/shell/BackofficeShell.mjs.map +1 -1
- package/dist/jsx/shell/BackofficeShell.native.js +18 -27
- package/dist/jsx/shell/BackofficeShell.native.js.map +1 -1
- package/dist/jsx/shell/WorkspaceSidebar.mjs +3 -1
- package/dist/jsx/shell/WorkspaceSidebar.mjs.map +1 -1
- package/dist/jsx/shell/WorkspaceSidebar.native.js +3 -1
- package/dist/jsx/shell/WorkspaceSidebar.native.js.map +1 -1
- package/package.json +12 -12
- package/src/chrome/BackofficeAwesomebar.tsx +36 -27
- package/src/chrome/CommandPalette.tsx +2 -1
- package/src/chrome/UserMenu.tsx +2 -2
- package/src/chrome/help-about-dialog.tsx +2 -2
- package/src/chrome/help-shortcuts-dialog.tsx +2 -2
- package/src/i18n/en.ts +1 -0
- package/src/shell/AllDoctypes.stories.tsx +29 -7
- package/src/shell/BackofficeShell.sheet.spec.tsx +191 -0
- package/src/shell/BackofficeShell.tsx +22 -39
- package/src/shell/WorkspaceSidebar.tsx +4 -0
- package/types/chrome/BackofficeAwesomebar.d.ts.map +1 -1
- package/types/chrome/CommandPalette.d.ts.map +1 -1
- package/types/i18n/en.d.ts +1 -0
- package/types/i18n/en.d.ts.map +1 -1
- package/types/shell/BackofficeShell.d.ts.map +1 -1
- package/types/shell/WorkspaceSidebar.d.ts +3 -1
- package/types/shell/WorkspaceSidebar.d.ts.map +1 -1
|
@@ -110,7 +110,8 @@ function WorkspaceSidebar(param) {
|
|
|
110
110
|
onNavigate,
|
|
111
111
|
width = WORKSPACE_SIDEBAR_WIDTH,
|
|
112
112
|
divider = true,
|
|
113
|
-
footer
|
|
113
|
+
footer,
|
|
114
|
+
hug
|
|
114
115
|
} = param;
|
|
115
116
|
var {
|
|
116
117
|
t
|
|
@@ -182,6 +183,7 @@ function WorkspaceSidebar(param) {
|
|
|
182
183
|
width,
|
|
183
184
|
divider,
|
|
184
185
|
footer,
|
|
186
|
+
hug,
|
|
185
187
|
"aria-label": t("shell.navigation", "Navigation"),
|
|
186
188
|
testID: "backoffice-workspace-nav"
|
|
187
189
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","WorkspaceSidebar_exports","WORKSPACE_SIDEBAR_WIDTH","WorkspaceSidebar","module","exports","import_jsx_runtime","require","import_components","import_theme","import_react","import_react2","import_react_i18next","import_BackofficeProvider","import_i18n","import_useWorkspaces","import_workspaceIcons","workspaceItem","workspace","depth","paths","activePath","onNavigate","path","IconComponent","workspaceIcon","icon","active","jsx","NavIcon","Icon","label","title","onPress","flattenTree","roots","childrenByParent","arguments","length","items","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","push","children","err","return","param","_knobProps_controlIcon","knobProps","useResolvedKnobs","size","Number","controlIcon","width","weight","divider","footer","t","useTranslation","BACKOFFICE_I18N_NAMESPACE","useBackofficePaths","views","useBackofficeCapabilities","privateWorkspaces","publicRoots","isLoading","useWorkspaces","sections","useMemo","result","map"],"sources":["../../../src/shell/WorkspaceSidebar.tsx"],"sourcesContent":[null],"mappings":"AAcA;;AAAA,IACEA,SAAA,GAAAC,MAAA,CAAAC,cAAA;AAAA,IACAC,gBAAA,GAAAF,MAAA,CAAAG,wBAAA;AAAA,IAAAC,iBAGK,GAAAJ,MAAA,CAAAK,mBAAA;AACP,IAAAC,YAAS,GAAAN,MAAA,CAAAO,SAAwB,CAAAC,cAAA;AACjC,IAAAC,QAAS,GAAAA,CAAAC,MAAA,EAAAC,GAA4C;EACrD,SAASC,IAAA,IAAAD,GAAA,EACTZ,SAAS,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAsB,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAC/B;AACA,IAAAC,WAAS,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA,KAAiC;EAE1C,IAAAF,IAAS,WAAAA,IAAA,KAAwC,mBAAAA,IAAA;IACjD,KAAS,IAAAG,GAAA,IAAAhB,iBAAqB,CAAAa,IAAA,
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","WorkspaceSidebar_exports","WORKSPACE_SIDEBAR_WIDTH","WorkspaceSidebar","module","exports","import_jsx_runtime","require","import_components","import_theme","import_react","import_react2","import_react_i18next","import_BackofficeProvider","import_i18n","import_useWorkspaces","import_workspaceIcons","workspaceItem","workspace","depth","paths","activePath","onNavigate","path","IconComponent","workspaceIcon","icon","active","jsx","NavIcon","Icon","label","title","onPress","flattenTree","roots","childrenByParent","arguments","length","items","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","push","children","err","return","param","_knobProps_controlIcon","knobProps","useResolvedKnobs","size","Number","controlIcon","width","weight","divider","footer","hug","t","useTranslation","BACKOFFICE_I18N_NAMESPACE","useBackofficePaths","views","useBackofficeCapabilities","privateWorkspaces","publicRoots","isLoading","useWorkspaces","sections","useMemo","result","map"],"sources":["../../../src/shell/WorkspaceSidebar.tsx"],"sourcesContent":[null],"mappings":"AAcA;;AAAA,IACEA,SAAA,GAAAC,MAAA,CAAAC,cAAA;AAAA,IACAC,gBAAA,GAAAF,MAAA,CAAAG,wBAAA;AAAA,IAAAC,iBAGK,GAAAJ,MAAA,CAAAK,mBAAA;AACP,IAAAC,YAAS,GAAAN,MAAA,CAAAO,SAAwB,CAAAC,cAAA;AACjC,IAAAC,QAAS,GAAAA,CAAAC,MAAA,EAAAC,GAA4C;EACrD,SAASC,IAAA,IAAAD,GAAA,EACTZ,SAAS,CAAAW,MAAA,EAAAE,IAAA;IAAAC,GAAsB,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAC/B;AACA,IAAAC,WAAS,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA,KAAiC;EAE1C,IAAAF,IAAS,WAAAA,IAAA,KAAwC,mBAAAA,IAAA;IACjD,KAAS,IAAAG,GAAA,IAAAhB,iBAAqB,CAAAa,IAAA,GA6Bf,KAAAX,YAAA,CAAAe,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,EA3BFnB,SAAA,CAAAiB,EAAA,EAAAI,GAAA;MAAAP,GAA0B,EAAAA,CAAA,KAAAI,IAAA,CAAAG,GAAA;MAAAN,UAAA,IAAAK,IAAA,GAAAjB,gBAAA,CAAAe,IAAA,EA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AiC,CAAA;QACA1B,KAAA,EAAAL,WAAA,CAAAsC,WAAA,EAAApC,gBAAA,EAAAhB,KAAA,EAAAC,UAAA,EAAAC,UAAA;MACA;IAAA;IAC8C,IAC9CuD,MAAO,CAAAvC,MAAA,QAAAuC,MAAA;MAAA,GAAAA,MAAA;MACT7C,KAAA;IAEJ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/backoffice",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.81.0",
|
|
4
4
|
"description": "Embeddable Frappe desk recreation (backoffice) for the multiplatform.one stack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"backoffice",
|
|
@@ -71,21 +71,21 @@
|
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@multiplatform.one/components": "^7.
|
|
75
|
-
"@multiplatform.one/forms": "^7.
|
|
76
|
-
"@multiplatform.one/frappe": "^7.
|
|
77
|
-
"@multiplatform.one/frappe-ui": "^7.
|
|
78
|
-
"@multiplatform.one/i18n": "^7.
|
|
79
|
-
"@multiplatform.one/platform": "^7.
|
|
80
|
-
"@multiplatform.one/store": "^7.
|
|
81
|
-
"@multiplatform.one/table": "^7.
|
|
82
|
-
"@multiplatform.one/theme": "^7.
|
|
74
|
+
"@multiplatform.one/components": "^7.81.0",
|
|
75
|
+
"@multiplatform.one/forms": "^7.81.0",
|
|
76
|
+
"@multiplatform.one/frappe": "^7.81.0",
|
|
77
|
+
"@multiplatform.one/frappe-ui": "^7.81.0",
|
|
78
|
+
"@multiplatform.one/i18n": "^7.81.0",
|
|
79
|
+
"@multiplatform.one/platform": "^7.81.0",
|
|
80
|
+
"@multiplatform.one/store": "^7.81.0",
|
|
81
|
+
"@multiplatform.one/table": "^7.81.0",
|
|
82
|
+
"@multiplatform.one/theme": "^7.81.0",
|
|
83
83
|
"@phosphor-icons/react": "^2.1.10",
|
|
84
84
|
"tamagui": "2.7.6"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@multiplatform.one/config": "7.
|
|
88
|
-
"@multiplatform.one/test-utils": "7.
|
|
87
|
+
"@multiplatform.one/config": "7.81.0",
|
|
88
|
+
"@multiplatform.one/test-utils": "7.81.0",
|
|
89
89
|
"@tamagui/build": "2.7.6",
|
|
90
90
|
"@testing-library/react": "^16.3.3",
|
|
91
91
|
"@types/react-dom": "^19.2.3",
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
// The navbar search affordance for the backoffice desk chrome. Since MOD-01
|
|
2
2
|
// the results surface is a first-class command palette (CommandPalette):
|
|
3
|
-
// this component renders the TRIGGER
|
|
4
|
-
//
|
|
5
|
-
// shortcuts (Mod+K / Mod+G, chrome/shortcuts.ts) land here through
|
|
3
|
+
// this component renders the TRIGGER and mounts the palette. The shell's
|
|
4
|
+
// global shortcuts (Mod+K / Mod+G, chrome/shortcuts.ts) land here through
|
|
6
5
|
// `focusRef` and open the same palette.
|
|
7
6
|
//
|
|
7
|
+
// The trigger is an icon button at every width (LC-176, LC-260), never a
|
|
8
|
+
// field: a surface carries one search field, and that is the page's, scoped
|
|
9
|
+
// to what is on screen (FZ-8649). The shortcut rides the tooltip.
|
|
10
|
+
//
|
|
8
11
|
// The old input-anchored dropdown (unusable at phone widths — clamped to the
|
|
9
12
|
// ~110px input) is gone; the palette presents as a centered overlay ≥sm and
|
|
10
13
|
// a full-height sheet <sm, both fed by one section model
|
|
11
14
|
// (chrome/command-palette-model.ts).
|
|
12
15
|
import { MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
13
|
-
import { Kbd, Text, isWeb, themed } from "@multiplatform.one/components";
|
|
16
|
+
import { Kbd, Text, Tooltip, XStack, isWeb, themed } from "@multiplatform.one/components";
|
|
14
17
|
import { Button } from "@multiplatform.one/forms";
|
|
15
18
|
import { useLayoutSizeClass, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
16
19
|
import type { Ref } from "react";
|
|
@@ -43,31 +46,37 @@ export function BackofficeAwesomebar({ focusRef }: BackofficeAwesomebarProps = {
|
|
|
43
46
|
const label = t("awesomebar.triggerLabel", "Search");
|
|
44
47
|
const showShortcutHint = isWeb && !isCompact;
|
|
45
48
|
|
|
49
|
+
const trigger = (
|
|
50
|
+
<Button
|
|
51
|
+
chromeless
|
|
52
|
+
size={knobProps.sizeToken}
|
|
53
|
+
flexShrink={0}
|
|
54
|
+
icon={SearchGlyph}
|
|
55
|
+
aria-label={label}
|
|
56
|
+
aria-haspopup="dialog"
|
|
57
|
+
aria-expanded={open}
|
|
58
|
+
aria-keyshortcuts={showShortcutHint ? "Meta+K Control+K" : undefined}
|
|
59
|
+
onPress={() => setOpen(true)}
|
|
60
|
+
data-testid="backoffice-awesomebar"
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
|
|
46
64
|
return (
|
|
47
65
|
<>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
data-testid="backoffice-awesomebar"
|
|
63
|
-
>
|
|
64
|
-
{!isCompact && (
|
|
65
|
-
<Text flex={1} minWidth={0} numberOfLines={1} textAlign="left" color="$color10">
|
|
66
|
-
{label}
|
|
67
|
-
</Text>
|
|
68
|
-
)}
|
|
69
|
-
{showShortcutHint && <Kbd keys="Mod+K" aria-hidden />}
|
|
70
|
-
</Button>
|
|
66
|
+
{showShortcutHint ? (
|
|
67
|
+
<Tooltip
|
|
68
|
+
content={
|
|
69
|
+
<XStack alignItems="center" gap="$2">
|
|
70
|
+
<Text>{label}</Text>
|
|
71
|
+
<Kbd keys="Mod+K" aria-hidden />
|
|
72
|
+
</XStack>
|
|
73
|
+
}
|
|
74
|
+
>
|
|
75
|
+
{trigger}
|
|
76
|
+
</Tooltip>
|
|
77
|
+
) : (
|
|
78
|
+
trigger
|
|
79
|
+
)}
|
|
71
80
|
<CommandPalette open={open} onOpenChange={setOpen} />
|
|
72
81
|
</>
|
|
73
82
|
);
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
menuRowFrame,
|
|
37
37
|
useLayoutSizeClass,
|
|
38
38
|
useResolvedKnobs,
|
|
39
|
+
overlayScrim,
|
|
39
40
|
} from "@multiplatform.one/theme";
|
|
40
41
|
import type { ComponentProps, ReactNode, RefObject } from "react";
|
|
41
42
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -342,7 +343,7 @@ function CommandPaletteSurface({ open, onOpenChange }: CommandPaletteProps) {
|
|
|
342
343
|
<Dialog.Portal justifyContent="flex-start" alignItems="center" paddingTop={topOffset}>
|
|
343
344
|
<Dialog.Overlay
|
|
344
345
|
key="overlay"
|
|
345
|
-
backgroundColor=
|
|
346
|
+
backgroundColor={overlayScrim}
|
|
346
347
|
{...transitionProps(knobProps.motion.scrim)}
|
|
347
348
|
enterStyle={{ opacity: 0 }}
|
|
348
349
|
exitStyle={{ opacity: 0 }}
|
package/src/chrome/UserMenu.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "@multiplatform.one/components";
|
|
15
15
|
import { Button } from "@multiplatform.one/forms";
|
|
16
16
|
import { useFrappeConfig } from "@multiplatform.one/frappe-ui";
|
|
17
|
-
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
17
|
+
import { useResolvedKnobs, overlayScrim } from "@multiplatform.one/theme";
|
|
18
18
|
import { openUrl } from "@multiplatform.one/platform";
|
|
19
19
|
import {
|
|
20
20
|
ArrowClockwiseIcon,
|
|
@@ -128,7 +128,7 @@ export function UserMenu({ defaultOpen }: UserMenuProps = {}) {
|
|
|
128
128
|
const errorDialog = actionError ? (
|
|
129
129
|
<Dialog modal open onOpenChange={setActionError}>
|
|
130
130
|
<Dialog.Portal>
|
|
131
|
-
<Dialog.Overlay backgroundColor=
|
|
131
|
+
<Dialog.Overlay backgroundColor={overlayScrim} />
|
|
132
132
|
<DialogContent>
|
|
133
133
|
<OverlayHeader
|
|
134
134
|
title={
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "@multiplatform.one/components";
|
|
19
19
|
import { useEffect, useState } from "react";
|
|
20
20
|
import { useTranslation } from "react-i18next";
|
|
21
|
-
import { sizeRecipeEscape } from "@multiplatform.one/theme";
|
|
21
|
+
import { sizeRecipeEscape, overlayScrim } from "@multiplatform.one/theme";
|
|
22
22
|
import { BACKOFFICE_I18N_NAMESPACE } from "../i18n";
|
|
23
23
|
import { useFrappeApp } from "../shared/useFrappeApp";
|
|
24
24
|
|
|
@@ -75,7 +75,7 @@ export function HelpAboutDialog({ open, onOpenChange }: HelpAboutDialogProps) {
|
|
|
75
75
|
return (
|
|
76
76
|
<Dialog modal open={open} onOpenChange={onOpenChange}>
|
|
77
77
|
<Dialog.Portal>
|
|
78
|
-
<Dialog.Overlay key="overlay" backgroundColor=
|
|
78
|
+
<Dialog.Overlay key="overlay" backgroundColor={overlayScrim} />
|
|
79
79
|
<DialogContent
|
|
80
80
|
key="content"
|
|
81
81
|
width={sizeRecipeEscape(
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
YStack,
|
|
16
16
|
OverlayHeader,
|
|
17
17
|
} from "@multiplatform.one/components";
|
|
18
|
-
import { sizeRecipeEscape } from "@multiplatform.one/theme";
|
|
18
|
+
import { sizeRecipeEscape, overlayScrim } from "@multiplatform.one/theme";
|
|
19
19
|
import { useTranslation } from "react-i18next";
|
|
20
20
|
import { BACKOFFICE_I18N_NAMESPACE } from "../i18n";
|
|
21
21
|
|
|
@@ -82,7 +82,7 @@ export function HelpShortcutsDialog({ open, onOpenChange }: HelpShortcutsDialogP
|
|
|
82
82
|
return (
|
|
83
83
|
<Dialog modal open={open} onOpenChange={onOpenChange}>
|
|
84
84
|
<Dialog.Portal>
|
|
85
|
-
<Dialog.Overlay key="overlay" backgroundColor=
|
|
85
|
+
<Dialog.Overlay key="overlay" backgroundColor={overlayScrim} />
|
|
86
86
|
<DialogContent
|
|
87
87
|
key="content"
|
|
88
88
|
width={sizeRecipeEscape(
|
package/src/i18n/en.ts
CHANGED
|
@@ -82,15 +82,17 @@ const workspace = (name: string, icon: string, sequence: number) => ({
|
|
|
82
82
|
quick_lists: [],
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
const
|
|
85
|
+
const fourWorkspaces = [
|
|
86
|
+
workspace("Pokemon", "dashboard", 1),
|
|
87
|
+
workspace("Users", "users", 2),
|
|
88
|
+
workspace("Website", "website", 3),
|
|
89
|
+
workspace("Tools", "tool", 4),
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
const makeFixtures = (workspaces = fourWorkspaces) =>
|
|
86
93
|
new InMemoryFixtureProvider({
|
|
87
94
|
DocType: doctypeRows.map((row) => ({ ...row, doctype: "DocType" }) as FrappeDocData),
|
|
88
|
-
Workspace: [
|
|
89
|
-
workspace("Pokemon", "dashboard", 1),
|
|
90
|
-
workspace("Users", "users", 2),
|
|
91
|
-
workspace("Website", "website", 3),
|
|
92
|
-
workspace("Tools", "tool", 4),
|
|
93
|
-
] as unknown as FrappeDocData[],
|
|
95
|
+
Workspace: workspaces as unknown as FrappeDocData[],
|
|
94
96
|
"Notification Log": [],
|
|
95
97
|
});
|
|
96
98
|
|
|
@@ -151,6 +153,26 @@ export const PickedInCode = () => (
|
|
|
151
153
|
);
|
|
152
154
|
PickedInCode.storyName = "Picked in code";
|
|
153
155
|
|
|
156
|
+
// FZ-8649: at 390 the nav sheet hugs four rows; with thirty it stops at the
|
|
157
|
+
// large detent and scrolls.
|
|
158
|
+
export const LongSidebar = () => (
|
|
159
|
+
<Frame>
|
|
160
|
+
<Desk
|
|
161
|
+
frappe={{
|
|
162
|
+
baseURL: MOCK_HOST,
|
|
163
|
+
fixtures: makeFixtures(
|
|
164
|
+
Array.from({ length: 30 }, (_, index) =>
|
|
165
|
+
workspace(`Workspace ${index + 1}`, "tool", index + 1),
|
|
166
|
+
),
|
|
167
|
+
),
|
|
168
|
+
}}
|
|
169
|
+
path="/all-doctypes"
|
|
170
|
+
chrome="full"
|
|
171
|
+
/>
|
|
172
|
+
</Frame>
|
|
173
|
+
);
|
|
174
|
+
LongSidebar.storyName = "Long sidebar";
|
|
175
|
+
|
|
154
176
|
export const SignedOut = () => (
|
|
155
177
|
<Frame>
|
|
156
178
|
<BackofficeProvider
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// FZ-8649: the shell's phone nav sheet hugs its rows and closes from a bare ✕
|
|
2
|
+
// (LC-111, LC-176), and a wide shell adds no search field of its own, so a
|
|
3
|
+
// surface carries the page's one field and the palette sits behind a glyph.
|
|
4
|
+
import React, { type ComponentProps } from "react";
|
|
5
|
+
import { InMemoryFixtureProvider, type FrappeDocData } from "@multiplatform.one/frappe";
|
|
6
|
+
import { SearchInput } from "@multiplatform.one/forms";
|
|
7
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
8
|
+
import { cleanup, fireEvent, screen, waitFor, within } from "@testing-library/react";
|
|
9
|
+
import {
|
|
10
|
+
boldPreset,
|
|
11
|
+
consolePreset,
|
|
12
|
+
defaultPreset,
|
|
13
|
+
densePreset,
|
|
14
|
+
heroPreset,
|
|
15
|
+
Preset,
|
|
16
|
+
registerPreset,
|
|
17
|
+
roomyPreset,
|
|
18
|
+
storefrontPreset,
|
|
19
|
+
type LayoutSizeClass,
|
|
20
|
+
} from "@multiplatform.one/theme";
|
|
21
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
22
|
+
import type { SheetModal } from "@multiplatform.one/components";
|
|
23
|
+
import { BackofficeProvider } from "../config/BackofficeProvider";
|
|
24
|
+
import { createMemoryNavigator } from "../navigation/navigator";
|
|
25
|
+
import { BackofficeShell } from "./BackofficeShell";
|
|
26
|
+
|
|
27
|
+
const layout = vi.hoisted(() => ({ size: "expanded" as LayoutSizeClass }));
|
|
28
|
+
vi.mock("@multiplatform.one/theme", async (original) => ({
|
|
29
|
+
...(await original<typeof import("@multiplatform.one/theme")>()),
|
|
30
|
+
useLayoutSizeClass: () => layout.size,
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
const sheet = vi.hoisted(() => ({ props: undefined as Record<string, unknown> | undefined }));
|
|
34
|
+
vi.mock("@multiplatform.one/components", async (original) => {
|
|
35
|
+
const actual = await original<typeof import("@multiplatform.one/components")>();
|
|
36
|
+
return {
|
|
37
|
+
...actual,
|
|
38
|
+
SheetModal: (props: ComponentProps<typeof SheetModal>) => {
|
|
39
|
+
sheet.props = props as unknown as Record<string, unknown>;
|
|
40
|
+
return <actual.SheetModal {...props} />;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const presets = {
|
|
46
|
+
default: defaultPreset,
|
|
47
|
+
bold: boldPreset,
|
|
48
|
+
hero: heroPreset,
|
|
49
|
+
dense: densePreset,
|
|
50
|
+
roomy: roomyPreset,
|
|
51
|
+
console: consolePreset,
|
|
52
|
+
storefront: storefrontPreset,
|
|
53
|
+
};
|
|
54
|
+
for (const [name, preset] of Object.entries(presets)) registerPreset(name, preset);
|
|
55
|
+
|
|
56
|
+
let host = 0;
|
|
57
|
+
|
|
58
|
+
const workspace = (name: string, sequence: number) =>
|
|
59
|
+
({
|
|
60
|
+
name,
|
|
61
|
+
doctype: "Workspace",
|
|
62
|
+
label: name,
|
|
63
|
+
title: name,
|
|
64
|
+
icon: "tool",
|
|
65
|
+
module: "Core",
|
|
66
|
+
parent_page: "",
|
|
67
|
+
public: 1,
|
|
68
|
+
for_user: "",
|
|
69
|
+
sequence_id: sequence,
|
|
70
|
+
is_hidden: 0,
|
|
71
|
+
content: "[]",
|
|
72
|
+
shortcuts: [],
|
|
73
|
+
links: [],
|
|
74
|
+
charts: [],
|
|
75
|
+
}) as FrappeDocData;
|
|
76
|
+
|
|
77
|
+
function renderShell(body: React.ReactNode = <div>page body</div>, preset = "default") {
|
|
78
|
+
return renderWithProviders(
|
|
79
|
+
<Preset preset={preset}>
|
|
80
|
+
<BackofficeProvider
|
|
81
|
+
frappe={{
|
|
82
|
+
baseURL: `https://backoffice-shell-sheet-${++host}.spec.test`,
|
|
83
|
+
fixtures: new InMemoryFixtureProvider({
|
|
84
|
+
Workspace: ["Pokemon", "Users", "Website", "Tools"].map(workspace),
|
|
85
|
+
DocType: [],
|
|
86
|
+
}),
|
|
87
|
+
}}
|
|
88
|
+
navigation={createMemoryNavigator("/backoffice")}
|
|
89
|
+
>
|
|
90
|
+
<BackofficeShell>{body}</BackofficeShell>
|
|
91
|
+
</BackofficeProvider>
|
|
92
|
+
</Preset>,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function openSheet() {
|
|
97
|
+
fireEvent.click(screen.getByRole("button", { name: "Toggle sidebar" }));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const restFill = (element: Element) =>
|
|
101
|
+
Array.from(element.classList).filter(
|
|
102
|
+
(name) => name.startsWith("_bg-") && !/0(hover|active|focus|press)/.test(name),
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
afterEach(() => {
|
|
106
|
+
cleanup();
|
|
107
|
+
layout.size = "expanded";
|
|
108
|
+
sheet.props = undefined;
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
describe("the phone nav sheet (LC-111)", () => {
|
|
112
|
+
it("is as tall as its rows: no percent detent and no filled body", async () => {
|
|
113
|
+
layout.size = "compact";
|
|
114
|
+
renderShell();
|
|
115
|
+
openSheet();
|
|
116
|
+
const drawer = await screen.findAllByTestId("backoffice-sidebar-drawer");
|
|
117
|
+
for (const name of ["Pokemon", "Users", "Website", "Tools"]) {
|
|
118
|
+
await waitFor(() => expect(within(drawer[0]!).getByText(name)).toBeTruthy());
|
|
119
|
+
}
|
|
120
|
+
expect(sheet.props?.snapPoint).toBeUndefined();
|
|
121
|
+
expect(sheet.props?.fill).toBeFalsy();
|
|
122
|
+
expect(sheet.props?.scrollable).toBe(true);
|
|
123
|
+
const nav = within(drawer[0]!).getByTestId("backoffice-workspace-nav");
|
|
124
|
+
expect(nav.className).not.toContain("_fg-1");
|
|
125
|
+
expect(drawer[0]!.className).not.toContain("_fg-1");
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it("closes from its own ✕, and the banner keeps the hamburger under the scrim", async () => {
|
|
129
|
+
layout.size = "compact";
|
|
130
|
+
renderShell();
|
|
131
|
+
const toggle = screen.getByRole("button", { name: "Toggle sidebar" });
|
|
132
|
+
const hamburger = toggle.querySelector("svg")?.innerHTML;
|
|
133
|
+
openSheet();
|
|
134
|
+
const close = (await screen.findAllByRole("button", { name: "Close sidebar" }))[0]!;
|
|
135
|
+
expect(toggle.querySelector("svg")?.innerHTML).toBe(hamburger);
|
|
136
|
+
fireEvent.click(close);
|
|
137
|
+
await waitFor(() => expect(toggle.getAttribute("aria-expanded")).toBe("false"));
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
describe("the sheet's ✕ (LC-176)", () => {
|
|
142
|
+
it.each(Object.keys(presets))("%s: a bare tinted glyph, no plate at rest", async (preset) => {
|
|
143
|
+
layout.size = "compact";
|
|
144
|
+
renderShell(undefined, preset);
|
|
145
|
+
openSheet();
|
|
146
|
+
const close = (await screen.findAllByRole("button", { name: "Close sidebar" }))[0]!;
|
|
147
|
+
const bar = screen.getByRole("button", { name: "Toggle sidebar" });
|
|
148
|
+
expect(close.getAttribute("data-mp-icon-button")).toBe("glyph");
|
|
149
|
+
expect(close.textContent).toBe("");
|
|
150
|
+
expect(restFill(close)).toEqual(restFill(bar));
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
describe("the page ground", () => {
|
|
155
|
+
it.each(["compact", "expanded"] as const)(
|
|
156
|
+
"%s: the routed region paints the page ground, so a host's own ground never shows as a band",
|
|
157
|
+
(size) => {
|
|
158
|
+
layout.size = size;
|
|
159
|
+
renderShell();
|
|
160
|
+
const main = screen.getByRole("main");
|
|
161
|
+
expect(restFill(main)).toEqual(["_bg-background"]);
|
|
162
|
+
},
|
|
163
|
+
);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
describe("one search field per surface", () => {
|
|
167
|
+
it("adds no field at 1440: the page's field is the only one", () => {
|
|
168
|
+
renderShell(<SearchInput defaultValue="" aria-label="Search DocTypes" />);
|
|
169
|
+
expect(document.querySelectorAll("input")).toHaveLength(1);
|
|
170
|
+
expect(screen.getByLabelText("Search DocTypes")).toBeTruthy();
|
|
171
|
+
const banner = screen.getByRole("banner");
|
|
172
|
+
expect(banner.querySelector("input")).toBeNull();
|
|
173
|
+
expect(banner.textContent).not.toContain("Search");
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it("keeps the palette behind an icon button, the same at every width", async () => {
|
|
177
|
+
renderShell();
|
|
178
|
+
const search = screen.getByTestId("backoffice-awesomebar");
|
|
179
|
+
expect(search.getAttribute("data-mp-icon-button")).toBe("glyph");
|
|
180
|
+
expect(search.textContent).toBe("");
|
|
181
|
+
expect(search.getAttribute("aria-keyshortcuts")).toBe("Meta+K Control+K");
|
|
182
|
+
fireEvent.click(search);
|
|
183
|
+
expect(await screen.findByPlaceholderText(/Search/)).toBeTruthy();
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it("opens the palette from the keyboard", async () => {
|
|
187
|
+
renderShell();
|
|
188
|
+
fireEvent.keyDown(document, { key: "k", metaKey: true });
|
|
189
|
+
expect(await screen.findByPlaceholderText(/Search/)).toBeTruthy();
|
|
190
|
+
});
|
|
191
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Backoffice desk chrome: top navbar (app title → home,
|
|
3
|
-
* notifications / help / user menus) and the left
|
|
4
|
-
* the routed content.
|
|
2
|
+
* Backoffice desk chrome: top navbar (app title → home, then the search glyph,
|
|
3
|
+
* notifications / help / user menus at the trailing edge) and the left
|
|
4
|
+
* workspace sidebar around the routed content.
|
|
5
5
|
*
|
|
6
6
|
* Router-free by design — navigation and the active path come from the
|
|
7
7
|
* BackofficeProvider's navigator (explicit `activePath`/`onNavigate` props
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* fill (LC-71); the shell paints no rail chrome of its own.
|
|
26
26
|
*/
|
|
27
27
|
import {
|
|
28
|
+
OverlayHeader,
|
|
28
29
|
ScrollView,
|
|
29
30
|
Separator,
|
|
30
31
|
SheetModal,
|
|
@@ -37,12 +38,7 @@ import {
|
|
|
37
38
|
} from "@multiplatform.one/components";
|
|
38
39
|
import { Button } from "@multiplatform.one/forms";
|
|
39
40
|
import * as componentsBarrel from "@multiplatform.one/components";
|
|
40
|
-
import {
|
|
41
|
-
sizeRecipeEscape,
|
|
42
|
-
Surface,
|
|
43
|
-
useLayoutSizeClass,
|
|
44
|
-
useResolvedKnobs,
|
|
45
|
-
} from "@multiplatform.one/theme";
|
|
41
|
+
import { Surface, useLayoutSizeClass, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
46
42
|
import { CaretDownIcon, CaretRightIcon, ListIcon, XIcon } from "@phosphor-icons/react";
|
|
47
43
|
import type React from "react";
|
|
48
44
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -188,7 +184,7 @@ export function BackofficeShell({ children, activePath, onNavigate, title }: Bac
|
|
|
188
184
|
<Button
|
|
189
185
|
chromeless
|
|
190
186
|
size={knobProps.sizeToken}
|
|
191
|
-
icon={sidebarOpen ? CloseGlyph : MenuGlyph}
|
|
187
|
+
icon={sidebarOpen && !isNarrow ? CloseGlyph : MenuGlyph}
|
|
192
188
|
aria-label={t("shell.toggleSidebar", "Toggle sidebar")}
|
|
193
189
|
aria-expanded={sidebarOpen}
|
|
194
190
|
onPress={() => setSidebarOpen((open) => !open)}
|
|
@@ -251,24 +247,8 @@ export function BackofficeShell({ children, activePath, onNavigate, title }: Bac
|
|
|
251
247
|
)}
|
|
252
248
|
</Button>
|
|
253
249
|
|
|
254
|
-
{/*
|
|
255
|
-
|
|
256
|
-
{!isNarrow && (
|
|
257
|
-
<XStack flex={1} flexShrink={0} minWidth={0} justifyContent="center">
|
|
258
|
-
{capabilities.awesomebar.enabled && (
|
|
259
|
-
<XStack
|
|
260
|
-
flex={1}
|
|
261
|
-
maxWidth={sizeRecipeEscape(
|
|
262
|
-
560,
|
|
263
|
-
"awesomebar: caps the centred search field in the banner",
|
|
264
|
-
)}
|
|
265
|
-
minWidth={0}
|
|
266
|
-
>
|
|
267
|
-
<BackofficeAwesomebar focusRef={awesomebarRef} />
|
|
268
|
-
</XStack>
|
|
269
|
-
)}
|
|
270
|
-
</XStack>
|
|
271
|
-
)}
|
|
250
|
+
{/* The spacer keeps the right chrome pinned to the trailing edge. */}
|
|
251
|
+
{!isNarrow && <XStack flex={1} minWidth={0} />}
|
|
272
252
|
|
|
273
253
|
{/* Right chrome: the page's own action (LC-128, FZ-7974) leads the
|
|
274
254
|
shell's global controls. */}
|
|
@@ -283,9 +263,7 @@ export function BackofficeShell({ children, activePath, onNavigate, title }: Bac
|
|
|
283
263
|
{topBarSlot.action}
|
|
284
264
|
</XStack>
|
|
285
265
|
) : null}
|
|
286
|
-
{
|
|
287
|
-
<BackofficeAwesomebar focusRef={awesomebarRef} />
|
|
288
|
-
)}
|
|
266
|
+
{capabilities.awesomebar.enabled && <BackofficeAwesomebar focusRef={awesomebarRef} />}
|
|
289
267
|
{capabilities.notifications.enabled && <NotificationsButton />}
|
|
290
268
|
{capabilities.help.enabled && !isNarrow && <HelpMenu />}
|
|
291
269
|
{capabilities.userMenu.enabled && <UserMenu />}
|
|
@@ -343,27 +321,31 @@ export function BackofficeShell({ children, activePath, onNavigate, title }: Bac
|
|
|
343
321
|
|
|
344
322
|
{/* Narrow: the nav opens as a bottom sheet off the hamburger
|
|
345
323
|
(phones take sheets, not side drawers), titled with the desk name
|
|
346
|
-
the compact banner gives up to the surface title.
|
|
347
|
-
|
|
324
|
+
the compact banner gives up to the surface title. The sheet is as
|
|
325
|
+
tall as its rows, up to the large detent, then scrolls (LC-111).
|
|
326
|
+
SheetModal owns Escape and scrim dismissal. */}
|
|
348
327
|
{sidebarEnabled && isNarrow && (
|
|
349
328
|
<SheetModal
|
|
350
329
|
open={sidebarOpen}
|
|
351
330
|
onOpenChange={setSidebarOpen}
|
|
352
|
-
|
|
353
|
-
fill
|
|
331
|
+
scrollable
|
|
354
332
|
header={
|
|
355
|
-
<
|
|
356
|
-
{deskTitle}
|
|
357
|
-
|
|
333
|
+
<OverlayHeader
|
|
334
|
+
title={deskTitle}
|
|
335
|
+
onClose={() => setSidebarOpen(false)}
|
|
336
|
+
closeLabel={t("shell.closeSidebar", "Close sidebar")}
|
|
337
|
+
testID="backoffice-sidebar-sheet-header"
|
|
338
|
+
/>
|
|
358
339
|
}
|
|
359
340
|
>
|
|
360
|
-
<YStack
|
|
341
|
+
<YStack width="100%" data-testid="backoffice-sidebar-drawer">
|
|
361
342
|
<WorkspaceSidebar
|
|
362
343
|
activePath={resolvedActivePath}
|
|
363
344
|
onNavigate={handleNavigate}
|
|
364
345
|
width="100%"
|
|
365
346
|
divider={false}
|
|
366
347
|
footer={sidebarFooter}
|
|
348
|
+
hug
|
|
367
349
|
/>
|
|
368
350
|
</YStack>
|
|
369
351
|
</SheetModal>
|
|
@@ -378,6 +360,7 @@ export function BackofficeShell({ children, activePath, onNavigate, title }: Bac
|
|
|
378
360
|
minWidth={0}
|
|
379
361
|
minHeight={0}
|
|
380
362
|
overflow="hidden"
|
|
363
|
+
backgroundColor="$background"
|
|
381
364
|
>
|
|
382
365
|
{children}
|
|
383
366
|
</YStack>
|
|
@@ -41,6 +41,8 @@ export interface WorkspaceSidebarProps {
|
|
|
41
41
|
divider?: boolean;
|
|
42
42
|
/** Pinned under the workspaces in the rail (page panel, host footer). */
|
|
43
43
|
footer?: ReactNode;
|
|
44
|
+
/** Height of the rows, not the column's: the nav in a content-sized sheet. */
|
|
45
|
+
hug?: boolean;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
function workspaceItem(
|
|
@@ -102,6 +104,7 @@ export function WorkspaceSidebar({
|
|
|
102
104
|
width = WORKSPACE_SIDEBAR_WIDTH,
|
|
103
105
|
divider = true,
|
|
104
106
|
footer,
|
|
107
|
+
hug,
|
|
105
108
|
}: WorkspaceSidebarProps) {
|
|
106
109
|
const { t } = useTranslation(BACKOFFICE_I18N_NAMESPACE);
|
|
107
110
|
const paths = useBackofficePaths();
|
|
@@ -169,6 +172,7 @@ export function WorkspaceSidebar({
|
|
|
169
172
|
width={width}
|
|
170
173
|
divider={divider}
|
|
171
174
|
footer={footer}
|
|
175
|
+
hug={hug}
|
|
172
176
|
aria-label={t("shell.navigation", "Navigation")}
|
|
173
177
|
testID="backoffice-workspace-nav"
|
|
174
178
|
/>
|