@dxos/react-ui 0.7.5-main.9d2a38b → 0.7.5-main.e94eead
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/lib/browser/index.mjs +87 -86
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +88 -86
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +87 -86
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts +6 -10
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +12 -13
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.d.ts +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +2 -2
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts +3 -3
- package/dist/types/src/components/Buttons/Button.stories.d.ts +2 -2
- package/dist/types/src/components/Buttons/IconButton.d.ts +3 -0
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts +2 -2
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts +2 -2
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts +4 -4
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +6 -6
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts +1 -1
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +6 -3
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +8 -3
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +2 -2
- package/dist/types/src/components/Dialogs/Dialog.d.ts +4 -2
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +2 -2
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +1 -1
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +7 -7
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/List.stories.d.ts +5 -5
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts +3 -2
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Tree.stories.d.ts +3 -3
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts +1 -2
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts +2 -2
- package/dist/types/src/components/Main/Main.d.ts +35 -22
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +3 -4
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menus/ContextMenu.d.ts +6 -6
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts +8 -8
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +3 -7
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts +4 -4
- package/dist/types/src/components/Message/Message.stories.d.ts +2 -2
- package/dist/types/src/components/Popover/Popover.d.ts +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +5 -5
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +5 -5
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +7 -7
- package/dist/types/src/components/Select/Select.d.ts +9 -9
- package/dist/types/src/components/Select/Select.stories.d.ts +2 -3
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts +3 -3
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts +12 -5
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +2 -2
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +4 -4
- package/dist/types/src/components/Toast/Toast.stories.d.ts +8 -8
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +6 -6
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +12 -12
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +16 -4
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useThemeContext.d.ts +1 -1
- package/dist/types/src/hooks/useThemeContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranslationsContext.d.ts +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts +2 -3
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Typography.stories.d.ts +2 -3
- package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
- package/dist/types/src/util/ThemedClassName.d.ts +1 -1
- package/dist/types/src/util/ThemedClassName.d.ts.map +1 -1
- package/package.json +43 -42
- package/src/components/Avatars/Avatar.tsx +5 -13
- package/src/components/Buttons/IconButton.tsx +11 -3
- package/src/components/Clipboard/CopyButton.tsx +6 -2
- package/src/components/Dialogs/AlertDialog.tsx +3 -1
- package/src/components/Dialogs/Dialog.stories.tsx +1 -1
- package/src/components/Dialogs/Dialog.tsx +9 -4
- package/src/components/Icon/Icon.tsx +4 -1
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/Lists/ListDropIndicator.tsx +15 -7
- package/src/components/Main/Main.stories.tsx +1 -1
- package/src/components/Main/Main.tsx +78 -72
- package/src/components/Tag/Tag.stories.tsx +17 -31
- package/src/components/Tag/Tag.tsx +15 -6
- package/src/components/Tooltip/Tooltip.stories.tsx +13 -2
- package/src/util/ThemedClassName.ts +1 -1
package/dist/lib/node/index.cjs
CHANGED
|
@@ -87,6 +87,7 @@ __export(node_exports, {
|
|
|
87
87
|
useDropdownMenuContext: () => useDropdownMenuContext,
|
|
88
88
|
useDropdownMenuMenuScope: () => useDropdownMenuMenuScope,
|
|
89
89
|
useElevationContext: () => useElevationContext,
|
|
90
|
+
useLandmarkMover: () => useLandmarkMover,
|
|
90
91
|
useListContext: () => import_react_list.useListContext,
|
|
91
92
|
useListItemContext: () => import_react_list.useListItemContext,
|
|
92
93
|
useMainContext: () => useMainContext,
|
|
@@ -440,16 +441,12 @@ var AvatarFrame = /* @__PURE__ */ (0, import_react9.forwardRef)(({ classNames, c
|
|
|
440
441
|
y: ringGap + ringWidth,
|
|
441
442
|
rx
|
|
442
443
|
}))), variant === "circle" ? /* @__PURE__ */ import_react9.default.createElement("circle", {
|
|
443
|
-
className: hue ? tx("hue.fill", "avatar__frame__circle", {
|
|
444
|
-
hue
|
|
445
|
-
}) : "fill-[var(--surface-bg)]",
|
|
446
444
|
cx: "50%",
|
|
447
445
|
cy: "50%",
|
|
448
|
-
r
|
|
446
|
+
r,
|
|
447
|
+
fill: hue ? `var(--dx-${hue}Fill)` : "var(--surface-bg)"
|
|
449
448
|
}) : /* @__PURE__ */ import_react9.default.createElement("rect", {
|
|
450
|
-
|
|
451
|
-
hue
|
|
452
|
-
}) : "fill-[var(--surface-bg)]",
|
|
449
|
+
fill: hue ? `var(--dx-${hue}Fill)` : "var(--surface-bg)",
|
|
453
450
|
x: ringGap + ringWidth,
|
|
454
451
|
y: ringGap + ringWidth,
|
|
455
452
|
width: 2 * r,
|
|
@@ -805,12 +802,21 @@ var Tooltip = {
|
|
|
805
802
|
Arrow: TooltipArrow,
|
|
806
803
|
Content: TooltipContent
|
|
807
804
|
};
|
|
808
|
-
var IconOnlyButton = /* @__PURE__ */ (0, import_react16.forwardRef)(({ tooltipPortal = true, tooltipZIndex: zIndex, suppressNextTooltip, ...props }, forwardedRef) => {
|
|
805
|
+
var IconOnlyButton = /* @__PURE__ */ (0, import_react16.forwardRef)(({ noTooltip, tooltipPortal = true, tooltipZIndex: zIndex, tooltipSide, suppressNextTooltip, ...props }, forwardedRef) => {
|
|
809
806
|
const [triggerTooltipOpen, setTriggerTooltipOpen] = (0, import_react16.useState)(false);
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
807
|
+
if (noTooltip) {
|
|
808
|
+
return /* @__PURE__ */ import_react16.default.createElement(LabelledIconButton, {
|
|
809
|
+
...props,
|
|
810
|
+
ref: forwardedRef
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
const content = /* @__PURE__ */ import_react16.default.createElement(Tooltip.Content, {
|
|
814
|
+
...zIndex && {
|
|
815
|
+
style: {
|
|
816
|
+
zIndex
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
side: tooltipSide
|
|
814
820
|
}, props.label, /* @__PURE__ */ import_react16.default.createElement(Tooltip.Arrow, null));
|
|
815
821
|
return /* @__PURE__ */ import_react16.default.createElement(Tooltip.Root, {
|
|
816
822
|
open: triggerTooltipOpen,
|
|
@@ -1003,7 +1009,7 @@ var CopyButtonIconOnly = ({ value, classNames, iconProps, variant, ...props }) =
|
|
|
1003
1009
|
const { t } = useTranslation("os");
|
|
1004
1010
|
const { textValue, setTextValue } = useClipboard();
|
|
1005
1011
|
const isCopied = textValue === value;
|
|
1006
|
-
const label = isCopied ? t("copy success label") : t("copy label");
|
|
1012
|
+
const label = isCopied ? t("copy success label") : props.label ?? t("copy label");
|
|
1007
1013
|
const [open, setOpen] = (0, import_react22.useState)(false);
|
|
1008
1014
|
return /* @__PURE__ */ import_react22.default.createElement(Tooltip.Root, {
|
|
1009
1015
|
delayDuration: 1500,
|
|
@@ -1078,13 +1084,13 @@ var DialogOverlay = /* @__PURE__ */ (0, import_react26.forwardRef)(({ classNames
|
|
|
1078
1084
|
}, children));
|
|
1079
1085
|
});
|
|
1080
1086
|
DialogOverlay.displayName = DIALOG_OVERLAY_NAME;
|
|
1081
|
-
var DialogContent = /* @__PURE__ */ (0, import_react26.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
1087
|
+
var DialogContent = /* @__PURE__ */ (0, import_react26.forwardRef)(({ classNames, children, inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
1082
1088
|
const { tx } = useThemeContext();
|
|
1083
1089
|
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
1084
1090
|
return /* @__PURE__ */ import_react26.default.createElement(import_react_dialog.DialogContent, {
|
|
1085
1091
|
...props,
|
|
1086
1092
|
className: tx("dialog.content", "dialog", {
|
|
1087
|
-
inOverlayLayout
|
|
1093
|
+
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
1088
1094
|
}, classNames),
|
|
1089
1095
|
ref: forwardedRef
|
|
1090
1096
|
}, children);
|
|
@@ -1749,7 +1755,7 @@ var Switch = /* @__PURE__ */ (0, import_react30.forwardRef)(({ __inputScope, che
|
|
|
1749
1755
|
const { id, validationValence, descriptionId, errorMessageId } = (0, import_react_input.useInputContext)(import_react_input.INPUT_NAME, __inputScope);
|
|
1750
1756
|
return /* @__PURE__ */ import_react30.default.createElement("input", {
|
|
1751
1757
|
type: "checkbox",
|
|
1752
|
-
className: "
|
|
1758
|
+
className: "dx-checkbox--switch dx-focus-ring",
|
|
1753
1759
|
checked,
|
|
1754
1760
|
onChange: (event) => {
|
|
1755
1761
|
onCheckedChange(event.target.checked);
|
|
@@ -1783,8 +1789,8 @@ var edgeToOrientationMap = {
|
|
|
1783
1789
|
right: "vertical"
|
|
1784
1790
|
};
|
|
1785
1791
|
var orientationStyles = {
|
|
1786
|
-
horizontal: "h-[--line-thickness] left-[--terminal-radius] right-
|
|
1787
|
-
vertical: "w-[--line-thickness] top-[--terminal-radius] bottom-
|
|
1792
|
+
horizontal: "h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]",
|
|
1793
|
+
vertical: "w-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]"
|
|
1788
1794
|
};
|
|
1789
1795
|
var edgeStyles = {
|
|
1790
1796
|
top: "top-[--line-offset] before:top-[--offset-terminal]",
|
|
@@ -1795,17 +1801,17 @@ var edgeStyles = {
|
|
|
1795
1801
|
var strokeSize = 2;
|
|
1796
1802
|
var terminalSize = 8;
|
|
1797
1803
|
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
1798
|
-
var ListDropIndicator = ({ edge, gap = 0 }) => {
|
|
1799
|
-
const lineOffset = `calc(-0.5 * (${gap}px + ${strokeSize}px))`;
|
|
1804
|
+
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
1800
1805
|
const orientation = edgeToOrientationMap[edge];
|
|
1801
1806
|
return /* @__PURE__ */ import_react33.default.createElement("div", {
|
|
1802
1807
|
role: "none",
|
|
1803
1808
|
style: {
|
|
1804
1809
|
"--line-thickness": `${strokeSize}px`,
|
|
1805
|
-
"--line-offset":
|
|
1810
|
+
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
1811
|
+
"--line-inset": `${lineInset}px`,
|
|
1806
1812
|
"--terminal-size": `${terminalSize}px`,
|
|
1807
1813
|
"--terminal-radius": `${terminalSize / 2}px`,
|
|
1808
|
-
"--
|
|
1814
|
+
"--terminal-inset": `${terminalInset}px`,
|
|
1809
1815
|
"--offset-terminal": `${offsetToAlignTerminalWithLine}px`
|
|
1810
1816
|
},
|
|
1811
1817
|
className: `absolute z-10 pointer-events-none bg-accentSurface before:content-[''] before:w-[--terminal-size] before:h-[--terminal-size] box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accentSurface before:rounded-full ${orientationStyles[orientation]} ${edgeStyles[edge]}`
|
|
@@ -2195,68 +2201,62 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2195
2201
|
};
|
|
2196
2202
|
var [MainProvider, useMainContext] = (0, import_react_context7.createContext)(MAIN_NAME, {
|
|
2197
2203
|
resizing: false,
|
|
2198
|
-
|
|
2199
|
-
|
|
2204
|
+
navigationSidebarState: "closed",
|
|
2205
|
+
setNavigationSidebarState: (nextState) => {
|
|
2200
2206
|
import_log.log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2201
2207
|
F: __dxlog_file,
|
|
2202
|
-
L:
|
|
2208
|
+
L: 81,
|
|
2203
2209
|
S: void 0,
|
|
2204
2210
|
C: (f, a) => f(...a)
|
|
2205
2211
|
});
|
|
2206
2212
|
},
|
|
2207
|
-
|
|
2208
|
-
|
|
2213
|
+
complementarySidebarState: "closed",
|
|
2214
|
+
setComplementarySidebarState: (nextState) => {
|
|
2209
2215
|
import_log.log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2210
2216
|
F: __dxlog_file,
|
|
2211
|
-
L:
|
|
2217
|
+
L: 86,
|
|
2212
2218
|
S: void 0,
|
|
2213
2219
|
C: (f, a) => f(...a)
|
|
2214
2220
|
});
|
|
2215
2221
|
}
|
|
2216
2222
|
});
|
|
2217
2223
|
var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
2218
|
-
const {
|
|
2224
|
+
const { setNavigationSidebarState, navigationSidebarState, setComplementarySidebarState, complementarySidebarState } = useMainContext(consumerName);
|
|
2219
2225
|
return {
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
toggleNavigationSidebar: (0, import_react37.useCallback)(() =>
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
]),
|
|
2226
|
-
openNavigationSidebar: (0, import_react37.useCallback)(() => setNavigationSidebarOpen(true), [
|
|
2227
|
-
setNavigationSidebarOpen
|
|
2226
|
+
navigationSidebarState,
|
|
2227
|
+
setNavigationSidebarState,
|
|
2228
|
+
toggleNavigationSidebar: (0, import_react37.useCallback)(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2229
|
+
navigationSidebarState,
|
|
2230
|
+
setNavigationSidebarState
|
|
2228
2231
|
]),
|
|
2229
|
-
|
|
2230
|
-
|
|
2232
|
+
openNavigationSidebar: (0, import_react37.useCallback)(() => setNavigationSidebarState("expanded"), []),
|
|
2233
|
+
collapseNavigationSidebar: (0, import_react37.useCallback)(() => setNavigationSidebarState("collapsed"), []),
|
|
2234
|
+
closeNavigationSidebar: (0, import_react37.useCallback)(() => setNavigationSidebarState("closed"), []),
|
|
2235
|
+
complementarySidebarState,
|
|
2236
|
+
setComplementarySidebarState,
|
|
2237
|
+
toggleComplementarySidebar: (0, import_react37.useCallback)(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2238
|
+
complementarySidebarState,
|
|
2239
|
+
setComplementarySidebarState
|
|
2231
2240
|
]),
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
complementarySidebarOpen,
|
|
2236
|
-
setComplementarySidebarOpen
|
|
2237
|
-
]),
|
|
2238
|
-
openComplementarySidebar: (0, import_react37.useCallback)(() => setComplementarySidebarOpen(true), [
|
|
2239
|
-
setComplementarySidebarOpen
|
|
2240
|
-
]),
|
|
2241
|
-
closeComplementarySidebar: (0, import_react37.useCallback)(() => setComplementarySidebarOpen(false), [
|
|
2242
|
-
setComplementarySidebarOpen
|
|
2243
|
-
])
|
|
2241
|
+
openComplementarySidebar: (0, import_react37.useCallback)(() => setComplementarySidebarState("expanded"), []),
|
|
2242
|
+
collapseComplementarySidebar: (0, import_react37.useCallback)(() => setComplementarySidebarState("collapsed"), []),
|
|
2243
|
+
closeComplementarySidebar: (0, import_react37.useCallback)(() => setComplementarySidebarState("closed"), [])
|
|
2244
2244
|
};
|
|
2245
2245
|
};
|
|
2246
2246
|
var resizeDebounce = 3e3;
|
|
2247
|
-
var MainRoot = ({
|
|
2247
|
+
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
2248
2248
|
const [isLg] = (0, import_react_hooks5.useMediaQuery)("lg", {
|
|
2249
2249
|
ssr: false
|
|
2250
2250
|
});
|
|
2251
|
-
const [
|
|
2252
|
-
prop:
|
|
2253
|
-
defaultProp:
|
|
2254
|
-
onChange:
|
|
2251
|
+
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = (0, import_react_use_controllable_state4.useControllableState)({
|
|
2252
|
+
prop: propsNavigationSidebarState,
|
|
2253
|
+
defaultProp: defaultNavigationSidebarState,
|
|
2254
|
+
onChange: onNavigationSidebarStateChange
|
|
2255
2255
|
});
|
|
2256
|
-
const [
|
|
2257
|
-
prop:
|
|
2258
|
-
defaultProp:
|
|
2259
|
-
onChange:
|
|
2256
|
+
const [complementarySidebarState = isLg ? "expanded" : "collapsed", setComplementarySidebarState] = (0, import_react_use_controllable_state4.useControllableState)({
|
|
2257
|
+
prop: propsComplementarySidebarState,
|
|
2258
|
+
defaultProp: defaultComplementarySidebarState,
|
|
2259
|
+
onChange: onComplementarySidebarStateChange
|
|
2260
2260
|
});
|
|
2261
2261
|
const [resizing, setResizing] = (0, import_react37.useState)(false);
|
|
2262
2262
|
const resizeInterval = (0, import_react37.useRef)(null);
|
|
@@ -2278,10 +2278,10 @@ var MainRoot = ({ navigationSidebarOpen: propsNavigationSidebarOpen, defaultNavi
|
|
|
2278
2278
|
]);
|
|
2279
2279
|
return /* @__PURE__ */ import_react37.default.createElement(MainProvider, {
|
|
2280
2280
|
...props,
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2281
|
+
navigationSidebarState,
|
|
2282
|
+
setNavigationSidebarState,
|
|
2283
|
+
complementarySidebarState,
|
|
2284
|
+
setComplementarySidebarState,
|
|
2285
2285
|
resizing
|
|
2286
2286
|
}, children);
|
|
2287
2287
|
};
|
|
@@ -2289,7 +2289,7 @@ MainRoot.displayName = MAIN_ROOT_NAME;
|
|
|
2289
2289
|
var handleOpenAutoFocus = (event) => {
|
|
2290
2290
|
!document.body.hasAttribute("data-is-keyboard") && event.preventDefault();
|
|
2291
2291
|
};
|
|
2292
|
-
var MainSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames, children, swipeToDismiss, onOpenAutoFocus,
|
|
2292
|
+
var MainSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, ...props }, forwardedRef) => {
|
|
2293
2293
|
const [isLg] = (0, import_react_hooks5.useMediaQuery)("lg", {
|
|
2294
2294
|
ssr: false
|
|
2295
2295
|
});
|
|
@@ -2297,7 +2297,7 @@ var MainSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames,
|
|
|
2297
2297
|
const ref = (0, import_react_hooks5.useForwardedRef)(forwardedRef);
|
|
2298
2298
|
const noopRef = (0, import_react37.useRef)(null);
|
|
2299
2299
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2300
|
-
onDismiss: () =>
|
|
2300
|
+
onDismiss: () => onStateChange?.("closed")
|
|
2301
2301
|
});
|
|
2302
2302
|
const handleKeyDown = (0, import_react37.useCallback)((event) => {
|
|
2303
2303
|
if (event.key === "Escape") {
|
|
@@ -2309,7 +2309,7 @@ var MainSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames,
|
|
|
2309
2309
|
]);
|
|
2310
2310
|
const Root5 = isLg ? import_react_primitive9.Primitive.div : import_react_dialog2.DialogContent;
|
|
2311
2311
|
return /* @__PURE__ */ import_react37.default.createElement(import_react_dialog2.Root, {
|
|
2312
|
-
open,
|
|
2312
|
+
open: state !== "closed",
|
|
2313
2313
|
modal: false
|
|
2314
2314
|
}, /* @__PURE__ */ import_react37.default.createElement(Root5, {
|
|
2315
2315
|
...!isLg && {
|
|
@@ -2319,24 +2319,24 @@ var MainSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames,
|
|
|
2319
2319
|
},
|
|
2320
2320
|
...props,
|
|
2321
2321
|
"data-side": side === "inline-end" ? "ie" : "is",
|
|
2322
|
-
"data-state":
|
|
2322
|
+
"data-state": state,
|
|
2323
2323
|
"data-resizing": resizing ? "true" : "false",
|
|
2324
2324
|
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
2325
2325
|
onKeyDown: handleKeyDown,
|
|
2326
|
-
|
|
2326
|
+
...state === "closed" && {
|
|
2327
2327
|
inert: "true"
|
|
2328
2328
|
},
|
|
2329
2329
|
ref
|
|
2330
2330
|
}, children));
|
|
2331
2331
|
});
|
|
2332
2332
|
var MainNavigationSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)((props, forwardedRef) => {
|
|
2333
|
-
const {
|
|
2333
|
+
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
2334
2334
|
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
2335
2335
|
return /* @__PURE__ */ import_react37.default.createElement(MainSidebar, {
|
|
2336
2336
|
...mover,
|
|
2337
2337
|
...props,
|
|
2338
|
-
|
|
2339
|
-
|
|
2338
|
+
state: navigationSidebarState,
|
|
2339
|
+
onStateChange: setNavigationSidebarState,
|
|
2340
2340
|
resizing,
|
|
2341
2341
|
side: "inline-start",
|
|
2342
2342
|
ref: forwardedRef
|
|
@@ -2344,13 +2344,13 @@ var MainNavigationSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)((prop
|
|
|
2344
2344
|
});
|
|
2345
2345
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2346
2346
|
var MainComplementarySidebar = /* @__PURE__ */ (0, import_react37.forwardRef)((props, forwardedRef) => {
|
|
2347
|
-
const {
|
|
2347
|
+
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
2348
2348
|
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
2349
2349
|
return /* @__PURE__ */ import_react37.default.createElement(MainSidebar, {
|
|
2350
2350
|
...mover,
|
|
2351
2351
|
...props,
|
|
2352
|
-
|
|
2353
|
-
|
|
2352
|
+
state: complementarySidebarState,
|
|
2353
|
+
onStateChange: setComplementarySidebarState,
|
|
2354
2354
|
resizing,
|
|
2355
2355
|
side: "inline-end",
|
|
2356
2356
|
ref: forwardedRef
|
|
@@ -2358,7 +2358,7 @@ var MainComplementarySidebar = /* @__PURE__ */ (0, import_react37.forwardRef)((p
|
|
|
2358
2358
|
});
|
|
2359
2359
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2360
2360
|
var MainContent = /* @__PURE__ */ (0, import_react37.forwardRef)(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
2361
|
-
const {
|
|
2361
|
+
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2362
2362
|
const { tx } = useThemeContext();
|
|
2363
2363
|
const Root5 = asChild ? import_react_slot10.Slot : role ? "div" : "main";
|
|
2364
2364
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
@@ -2368,8 +2368,8 @@ var MainContent = /* @__PURE__ */ (0, import_react37.forwardRef)(({ asChild, cla
|
|
|
2368
2368
|
...mover
|
|
2369
2369
|
},
|
|
2370
2370
|
...props,
|
|
2371
|
-
"data-sidebar-inline-start-state":
|
|
2372
|
-
"data-sidebar-inline-end-state":
|
|
2371
|
+
"data-sidebar-inline-start-state": navigationSidebarState,
|
|
2372
|
+
"data-sidebar-inline-end-state": complementarySidebarState,
|
|
2373
2373
|
className: tx("main.content", "main", {
|
|
2374
2374
|
bounce,
|
|
2375
2375
|
handlesFocus
|
|
@@ -2382,20 +2382,20 @@ var MainOverlay = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames,
|
|
|
2382
2382
|
const [isLg] = (0, import_react_hooks5.useMediaQuery)("lg", {
|
|
2383
2383
|
ssr: false
|
|
2384
2384
|
});
|
|
2385
|
-
const {
|
|
2385
|
+
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2386
2386
|
const { tx } = useThemeContext();
|
|
2387
2387
|
return /* @__PURE__ */ import_react37.default.createElement("div", {
|
|
2388
2388
|
onClick: () => {
|
|
2389
|
-
|
|
2390
|
-
|
|
2389
|
+
setNavigationSidebarState("collapsed");
|
|
2390
|
+
setComplementarySidebarState("collapsed");
|
|
2391
2391
|
},
|
|
2392
2392
|
...props,
|
|
2393
2393
|
className: tx("main.overlay", "main__overlay", {
|
|
2394
2394
|
isLg,
|
|
2395
|
-
inlineStartSidebarOpen:
|
|
2396
|
-
inlineEndSidebarOpen:
|
|
2395
|
+
inlineStartSidebarOpen: navigationSidebarState,
|
|
2396
|
+
inlineEndSidebarOpen: complementarySidebarState
|
|
2397
2397
|
}, classNames),
|
|
2398
|
-
"data-state":
|
|
2398
|
+
"data-state": navigationSidebarState === "expanded" || complementarySidebarState === "expanded" ? "open" : "closed",
|
|
2399
2399
|
"aria-hidden": "true",
|
|
2400
2400
|
ref: forwardedRef
|
|
2401
2401
|
});
|
|
@@ -2973,14 +2973,15 @@ var Separator4 = /* @__PURE__ */ (0, import_react45.forwardRef)(({ classNames, o
|
|
|
2973
2973
|
ref: forwardedRef
|
|
2974
2974
|
});
|
|
2975
2975
|
});
|
|
2976
|
-
var Tag = /* @__PURE__ */ (0, import_react46.forwardRef)(({ asChild, palette, classNames, ...props }, forwardedRef) => {
|
|
2976
|
+
var Tag = /* @__PURE__ */ (0, import_react46.forwardRef)(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
2977
2977
|
const { tx } = useThemeContext();
|
|
2978
2978
|
const Root5 = asChild ? import_react_slot13.Slot : import_react_primitive12.Primitive.span;
|
|
2979
2979
|
return /* @__PURE__ */ import_react46.default.createElement(Root5, {
|
|
2980
2980
|
...props,
|
|
2981
|
-
className: tx("tag.root", "tag", {
|
|
2981
|
+
className: tx("tag.root", "dx-tag", {
|
|
2982
2982
|
palette
|
|
2983
2983
|
}, classNames),
|
|
2984
|
+
"data-hue": palette,
|
|
2984
2985
|
ref: forwardedRef
|
|
2985
2986
|
});
|
|
2986
2987
|
});
|
|
@@ -3212,6 +3213,7 @@ var Toolbar = {
|
|
|
3212
3213
|
useDropdownMenuContext,
|
|
3213
3214
|
useDropdownMenuMenuScope,
|
|
3214
3215
|
useElevationContext,
|
|
3216
|
+
useLandmarkMover,
|
|
3215
3217
|
useListContext,
|
|
3216
3218
|
useListItemContext,
|
|
3217
3219
|
useMainContext,
|