@dxos/react-ui 0.7.5-labs.a279d8c → 0.7.5-labs.c0e040f
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 +81 -86
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +82 -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 +81 -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 +5 -9
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +1 -2
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts +2 -0
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +5 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +6 -1
- package/dist/types/src/components/Clipboard/index.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/Dialog.d.ts +4 -2
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts +3 -1
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +1 -1
- 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 +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +2 -6
- package/dist/types/src/components/Menus/DropdownMenu.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/tsconfig.tsbuildinfo +1 -1
- package/package.json +42 -42
- package/src/components/Avatars/Avatar.tsx +5 -13
- package/src/components/Buttons/IconButton.tsx +4 -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/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/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,15 @@ 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)(({ tooltipPortal = true, tooltipZIndex: zIndex, tooltipSide, suppressNextTooltip, ...props }, forwardedRef) => {
|
|
809
806
|
const [triggerTooltipOpen, setTriggerTooltipOpen] = (0, import_react16.useState)(false);
|
|
810
|
-
const content = /* @__PURE__ */ import_react16.default.createElement(Tooltip.Content,
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
807
|
+
const content = /* @__PURE__ */ import_react16.default.createElement(Tooltip.Content, {
|
|
808
|
+
...zIndex && {
|
|
809
|
+
style: {
|
|
810
|
+
zIndex
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
side: tooltipSide
|
|
814
814
|
}, props.label, /* @__PURE__ */ import_react16.default.createElement(Tooltip.Arrow, null));
|
|
815
815
|
return /* @__PURE__ */ import_react16.default.createElement(Tooltip.Root, {
|
|
816
816
|
open: triggerTooltipOpen,
|
|
@@ -1003,7 +1003,7 @@ var CopyButtonIconOnly = ({ value, classNames, iconProps, variant, ...props }) =
|
|
|
1003
1003
|
const { t } = useTranslation("os");
|
|
1004
1004
|
const { textValue, setTextValue } = useClipboard();
|
|
1005
1005
|
const isCopied = textValue === value;
|
|
1006
|
-
const label = isCopied ? t("copy success label") : t("copy label");
|
|
1006
|
+
const label = isCopied ? t("copy success label") : props.label ?? t("copy label");
|
|
1007
1007
|
const [open, setOpen] = (0, import_react22.useState)(false);
|
|
1008
1008
|
return /* @__PURE__ */ import_react22.default.createElement(Tooltip.Root, {
|
|
1009
1009
|
delayDuration: 1500,
|
|
@@ -1078,13 +1078,13 @@ var DialogOverlay = /* @__PURE__ */ (0, import_react26.forwardRef)(({ classNames
|
|
|
1078
1078
|
}, children));
|
|
1079
1079
|
});
|
|
1080
1080
|
DialogOverlay.displayName = DIALOG_OVERLAY_NAME;
|
|
1081
|
-
var DialogContent = /* @__PURE__ */ (0, import_react26.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
1081
|
+
var DialogContent = /* @__PURE__ */ (0, import_react26.forwardRef)(({ classNames, children, inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
1082
1082
|
const { tx } = useThemeContext();
|
|
1083
1083
|
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
1084
1084
|
return /* @__PURE__ */ import_react26.default.createElement(import_react_dialog.DialogContent, {
|
|
1085
1085
|
...props,
|
|
1086
1086
|
className: tx("dialog.content", "dialog", {
|
|
1087
|
-
inOverlayLayout
|
|
1087
|
+
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
1088
1088
|
}, classNames),
|
|
1089
1089
|
ref: forwardedRef
|
|
1090
1090
|
}, children);
|
|
@@ -1749,7 +1749,7 @@ var Switch = /* @__PURE__ */ (0, import_react30.forwardRef)(({ __inputScope, che
|
|
|
1749
1749
|
const { id, validationValence, descriptionId, errorMessageId } = (0, import_react_input.useInputContext)(import_react_input.INPUT_NAME, __inputScope);
|
|
1750
1750
|
return /* @__PURE__ */ import_react30.default.createElement("input", {
|
|
1751
1751
|
type: "checkbox",
|
|
1752
|
-
className: "
|
|
1752
|
+
className: "dx-checkbox--switch dx-focus-ring",
|
|
1753
1753
|
checked,
|
|
1754
1754
|
onChange: (event) => {
|
|
1755
1755
|
onCheckedChange(event.target.checked);
|
|
@@ -1783,8 +1783,8 @@ var edgeToOrientationMap = {
|
|
|
1783
1783
|
right: "vertical"
|
|
1784
1784
|
};
|
|
1785
1785
|
var orientationStyles = {
|
|
1786
|
-
horizontal: "h-[--line-thickness] left-[--terminal-radius] right-
|
|
1787
|
-
vertical: "w-[--line-thickness] top-[--terminal-radius] bottom-
|
|
1786
|
+
horizontal: "h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]",
|
|
1787
|
+
vertical: "w-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]"
|
|
1788
1788
|
};
|
|
1789
1789
|
var edgeStyles = {
|
|
1790
1790
|
top: "top-[--line-offset] before:top-[--offset-terminal]",
|
|
@@ -1795,17 +1795,17 @@ var edgeStyles = {
|
|
|
1795
1795
|
var strokeSize = 2;
|
|
1796
1796
|
var terminalSize = 8;
|
|
1797
1797
|
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
1798
|
-
var ListDropIndicator = ({ edge, gap = 0 }) => {
|
|
1799
|
-
const lineOffset = `calc(-0.5 * (${gap}px + ${strokeSize}px))`;
|
|
1798
|
+
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
1800
1799
|
const orientation = edgeToOrientationMap[edge];
|
|
1801
1800
|
return /* @__PURE__ */ import_react33.default.createElement("div", {
|
|
1802
1801
|
role: "none",
|
|
1803
1802
|
style: {
|
|
1804
1803
|
"--line-thickness": `${strokeSize}px`,
|
|
1805
|
-
"--line-offset":
|
|
1804
|
+
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
1805
|
+
"--line-inset": `${lineInset}px`,
|
|
1806
1806
|
"--terminal-size": `${terminalSize}px`,
|
|
1807
1807
|
"--terminal-radius": `${terminalSize / 2}px`,
|
|
1808
|
-
"--
|
|
1808
|
+
"--terminal-inset": `${terminalInset}px`,
|
|
1809
1809
|
"--offset-terminal": `${offsetToAlignTerminalWithLine}px`
|
|
1810
1810
|
},
|
|
1811
1811
|
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 +2195,62 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2195
2195
|
};
|
|
2196
2196
|
var [MainProvider, useMainContext] = (0, import_react_context7.createContext)(MAIN_NAME, {
|
|
2197
2197
|
resizing: false,
|
|
2198
|
-
|
|
2199
|
-
|
|
2198
|
+
navigationSidebarState: "closed",
|
|
2199
|
+
setNavigationSidebarState: (nextState) => {
|
|
2200
2200
|
import_log.log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2201
2201
|
F: __dxlog_file,
|
|
2202
|
-
L:
|
|
2202
|
+
L: 81,
|
|
2203
2203
|
S: void 0,
|
|
2204
2204
|
C: (f, a) => f(...a)
|
|
2205
2205
|
});
|
|
2206
2206
|
},
|
|
2207
|
-
|
|
2208
|
-
|
|
2207
|
+
complementarySidebarState: "closed",
|
|
2208
|
+
setComplementarySidebarState: (nextState) => {
|
|
2209
2209
|
import_log.log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2210
2210
|
F: __dxlog_file,
|
|
2211
|
-
L:
|
|
2211
|
+
L: 86,
|
|
2212
2212
|
S: void 0,
|
|
2213
2213
|
C: (f, a) => f(...a)
|
|
2214
2214
|
});
|
|
2215
2215
|
}
|
|
2216
2216
|
});
|
|
2217
2217
|
var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
2218
|
-
const {
|
|
2218
|
+
const { setNavigationSidebarState, navigationSidebarState, setComplementarySidebarState, complementarySidebarState } = useMainContext(consumerName);
|
|
2219
2219
|
return {
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
toggleNavigationSidebar: (0, import_react37.useCallback)(() =>
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
]),
|
|
2226
|
-
openNavigationSidebar: (0, import_react37.useCallback)(() => setNavigationSidebarOpen(true), [
|
|
2227
|
-
setNavigationSidebarOpen
|
|
2220
|
+
navigationSidebarState,
|
|
2221
|
+
setNavigationSidebarState,
|
|
2222
|
+
toggleNavigationSidebar: (0, import_react37.useCallback)(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2223
|
+
navigationSidebarState,
|
|
2224
|
+
setNavigationSidebarState
|
|
2228
2225
|
]),
|
|
2229
|
-
|
|
2230
|
-
|
|
2226
|
+
openNavigationSidebar: (0, import_react37.useCallback)(() => setNavigationSidebarState("expanded"), []),
|
|
2227
|
+
collapseNavigationSidebar: (0, import_react37.useCallback)(() => setNavigationSidebarState("collapsed"), []),
|
|
2228
|
+
closeNavigationSidebar: (0, import_react37.useCallback)(() => setNavigationSidebarState("closed"), []),
|
|
2229
|
+
complementarySidebarState,
|
|
2230
|
+
setComplementarySidebarState,
|
|
2231
|
+
toggleComplementarySidebar: (0, import_react37.useCallback)(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2232
|
+
complementarySidebarState,
|
|
2233
|
+
setComplementarySidebarState
|
|
2231
2234
|
]),
|
|
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
|
-
])
|
|
2235
|
+
openComplementarySidebar: (0, import_react37.useCallback)(() => setComplementarySidebarState("expanded"), []),
|
|
2236
|
+
collapseComplementarySidebar: (0, import_react37.useCallback)(() => setComplementarySidebarState("collapsed"), []),
|
|
2237
|
+
closeComplementarySidebar: (0, import_react37.useCallback)(() => setComplementarySidebarState("closed"), [])
|
|
2244
2238
|
};
|
|
2245
2239
|
};
|
|
2246
2240
|
var resizeDebounce = 3e3;
|
|
2247
|
-
var MainRoot = ({
|
|
2241
|
+
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
2248
2242
|
const [isLg] = (0, import_react_hooks5.useMediaQuery)("lg", {
|
|
2249
2243
|
ssr: false
|
|
2250
2244
|
});
|
|
2251
|
-
const [
|
|
2252
|
-
prop:
|
|
2253
|
-
defaultProp:
|
|
2254
|
-
onChange:
|
|
2245
|
+
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = (0, import_react_use_controllable_state4.useControllableState)({
|
|
2246
|
+
prop: propsNavigationSidebarState,
|
|
2247
|
+
defaultProp: defaultNavigationSidebarState,
|
|
2248
|
+
onChange: onNavigationSidebarStateChange
|
|
2255
2249
|
});
|
|
2256
|
-
const [
|
|
2257
|
-
prop:
|
|
2258
|
-
defaultProp:
|
|
2259
|
-
onChange:
|
|
2250
|
+
const [complementarySidebarState = isLg ? "expanded" : "collapsed", setComplementarySidebarState] = (0, import_react_use_controllable_state4.useControllableState)({
|
|
2251
|
+
prop: propsComplementarySidebarState,
|
|
2252
|
+
defaultProp: defaultComplementarySidebarState,
|
|
2253
|
+
onChange: onComplementarySidebarStateChange
|
|
2260
2254
|
});
|
|
2261
2255
|
const [resizing, setResizing] = (0, import_react37.useState)(false);
|
|
2262
2256
|
const resizeInterval = (0, import_react37.useRef)(null);
|
|
@@ -2278,10 +2272,10 @@ var MainRoot = ({ navigationSidebarOpen: propsNavigationSidebarOpen, defaultNavi
|
|
|
2278
2272
|
]);
|
|
2279
2273
|
return /* @__PURE__ */ import_react37.default.createElement(MainProvider, {
|
|
2280
2274
|
...props,
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2275
|
+
navigationSidebarState,
|
|
2276
|
+
setNavigationSidebarState,
|
|
2277
|
+
complementarySidebarState,
|
|
2278
|
+
setComplementarySidebarState,
|
|
2285
2279
|
resizing
|
|
2286
2280
|
}, children);
|
|
2287
2281
|
};
|
|
@@ -2289,7 +2283,7 @@ MainRoot.displayName = MAIN_ROOT_NAME;
|
|
|
2289
2283
|
var handleOpenAutoFocus = (event) => {
|
|
2290
2284
|
!document.body.hasAttribute("data-is-keyboard") && event.preventDefault();
|
|
2291
2285
|
};
|
|
2292
|
-
var MainSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames, children, swipeToDismiss, onOpenAutoFocus,
|
|
2286
|
+
var MainSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, ...props }, forwardedRef) => {
|
|
2293
2287
|
const [isLg] = (0, import_react_hooks5.useMediaQuery)("lg", {
|
|
2294
2288
|
ssr: false
|
|
2295
2289
|
});
|
|
@@ -2297,7 +2291,7 @@ var MainSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames,
|
|
|
2297
2291
|
const ref = (0, import_react_hooks5.useForwardedRef)(forwardedRef);
|
|
2298
2292
|
const noopRef = (0, import_react37.useRef)(null);
|
|
2299
2293
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2300
|
-
onDismiss: () =>
|
|
2294
|
+
onDismiss: () => onStateChange?.("closed")
|
|
2301
2295
|
});
|
|
2302
2296
|
const handleKeyDown = (0, import_react37.useCallback)((event) => {
|
|
2303
2297
|
if (event.key === "Escape") {
|
|
@@ -2309,7 +2303,7 @@ var MainSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames,
|
|
|
2309
2303
|
]);
|
|
2310
2304
|
const Root5 = isLg ? import_react_primitive9.Primitive.div : import_react_dialog2.DialogContent;
|
|
2311
2305
|
return /* @__PURE__ */ import_react37.default.createElement(import_react_dialog2.Root, {
|
|
2312
|
-
open,
|
|
2306
|
+
open: state !== "closed",
|
|
2313
2307
|
modal: false
|
|
2314
2308
|
}, /* @__PURE__ */ import_react37.default.createElement(Root5, {
|
|
2315
2309
|
...!isLg && {
|
|
@@ -2319,24 +2313,24 @@ var MainSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames,
|
|
|
2319
2313
|
},
|
|
2320
2314
|
...props,
|
|
2321
2315
|
"data-side": side === "inline-end" ? "ie" : "is",
|
|
2322
|
-
"data-state":
|
|
2316
|
+
"data-state": state,
|
|
2323
2317
|
"data-resizing": resizing ? "true" : "false",
|
|
2324
2318
|
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
2325
2319
|
onKeyDown: handleKeyDown,
|
|
2326
|
-
|
|
2320
|
+
...state === "closed" && {
|
|
2327
2321
|
inert: "true"
|
|
2328
2322
|
},
|
|
2329
2323
|
ref
|
|
2330
2324
|
}, children));
|
|
2331
2325
|
});
|
|
2332
2326
|
var MainNavigationSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)((props, forwardedRef) => {
|
|
2333
|
-
const {
|
|
2327
|
+
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
2334
2328
|
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
2335
2329
|
return /* @__PURE__ */ import_react37.default.createElement(MainSidebar, {
|
|
2336
2330
|
...mover,
|
|
2337
2331
|
...props,
|
|
2338
|
-
|
|
2339
|
-
|
|
2332
|
+
state: navigationSidebarState,
|
|
2333
|
+
onStateChange: setNavigationSidebarState,
|
|
2340
2334
|
resizing,
|
|
2341
2335
|
side: "inline-start",
|
|
2342
2336
|
ref: forwardedRef
|
|
@@ -2344,13 +2338,13 @@ var MainNavigationSidebar = /* @__PURE__ */ (0, import_react37.forwardRef)((prop
|
|
|
2344
2338
|
});
|
|
2345
2339
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2346
2340
|
var MainComplementarySidebar = /* @__PURE__ */ (0, import_react37.forwardRef)((props, forwardedRef) => {
|
|
2347
|
-
const {
|
|
2341
|
+
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
2348
2342
|
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
2349
2343
|
return /* @__PURE__ */ import_react37.default.createElement(MainSidebar, {
|
|
2350
2344
|
...mover,
|
|
2351
2345
|
...props,
|
|
2352
|
-
|
|
2353
|
-
|
|
2346
|
+
state: complementarySidebarState,
|
|
2347
|
+
onStateChange: setComplementarySidebarState,
|
|
2354
2348
|
resizing,
|
|
2355
2349
|
side: "inline-end",
|
|
2356
2350
|
ref: forwardedRef
|
|
@@ -2358,7 +2352,7 @@ var MainComplementarySidebar = /* @__PURE__ */ (0, import_react37.forwardRef)((p
|
|
|
2358
2352
|
});
|
|
2359
2353
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2360
2354
|
var MainContent = /* @__PURE__ */ (0, import_react37.forwardRef)(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
2361
|
-
const {
|
|
2355
|
+
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2362
2356
|
const { tx } = useThemeContext();
|
|
2363
2357
|
const Root5 = asChild ? import_react_slot10.Slot : role ? "div" : "main";
|
|
2364
2358
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
@@ -2368,8 +2362,8 @@ var MainContent = /* @__PURE__ */ (0, import_react37.forwardRef)(({ asChild, cla
|
|
|
2368
2362
|
...mover
|
|
2369
2363
|
},
|
|
2370
2364
|
...props,
|
|
2371
|
-
"data-sidebar-inline-start-state":
|
|
2372
|
-
"data-sidebar-inline-end-state":
|
|
2365
|
+
"data-sidebar-inline-start-state": navigationSidebarState,
|
|
2366
|
+
"data-sidebar-inline-end-state": complementarySidebarState,
|
|
2373
2367
|
className: tx("main.content", "main", {
|
|
2374
2368
|
bounce,
|
|
2375
2369
|
handlesFocus
|
|
@@ -2382,20 +2376,20 @@ var MainOverlay = /* @__PURE__ */ (0, import_react37.forwardRef)(({ classNames,
|
|
|
2382
2376
|
const [isLg] = (0, import_react_hooks5.useMediaQuery)("lg", {
|
|
2383
2377
|
ssr: false
|
|
2384
2378
|
});
|
|
2385
|
-
const {
|
|
2379
|
+
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2386
2380
|
const { tx } = useThemeContext();
|
|
2387
2381
|
return /* @__PURE__ */ import_react37.default.createElement("div", {
|
|
2388
2382
|
onClick: () => {
|
|
2389
|
-
|
|
2390
|
-
|
|
2383
|
+
setNavigationSidebarState("collapsed");
|
|
2384
|
+
setComplementarySidebarState("collapsed");
|
|
2391
2385
|
},
|
|
2392
2386
|
...props,
|
|
2393
2387
|
className: tx("main.overlay", "main__overlay", {
|
|
2394
2388
|
isLg,
|
|
2395
|
-
inlineStartSidebarOpen:
|
|
2396
|
-
inlineEndSidebarOpen:
|
|
2389
|
+
inlineStartSidebarOpen: navigationSidebarState,
|
|
2390
|
+
inlineEndSidebarOpen: complementarySidebarState
|
|
2397
2391
|
}, classNames),
|
|
2398
|
-
"data-state":
|
|
2392
|
+
"data-state": navigationSidebarState === "expanded" || complementarySidebarState === "expanded" ? "open" : "closed",
|
|
2399
2393
|
"aria-hidden": "true",
|
|
2400
2394
|
ref: forwardedRef
|
|
2401
2395
|
});
|
|
@@ -2973,14 +2967,15 @@ var Separator4 = /* @__PURE__ */ (0, import_react45.forwardRef)(({ classNames, o
|
|
|
2973
2967
|
ref: forwardedRef
|
|
2974
2968
|
});
|
|
2975
2969
|
});
|
|
2976
|
-
var Tag = /* @__PURE__ */ (0, import_react46.forwardRef)(({ asChild, palette, classNames, ...props }, forwardedRef) => {
|
|
2970
|
+
var Tag = /* @__PURE__ */ (0, import_react46.forwardRef)(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
2977
2971
|
const { tx } = useThemeContext();
|
|
2978
2972
|
const Root5 = asChild ? import_react_slot13.Slot : import_react_primitive12.Primitive.span;
|
|
2979
2973
|
return /* @__PURE__ */ import_react46.default.createElement(Root5, {
|
|
2980
2974
|
...props,
|
|
2981
|
-
className: tx("tag.root", "tag", {
|
|
2975
|
+
className: tx("tag.root", "dx-tag", {
|
|
2982
2976
|
palette
|
|
2983
2977
|
}, classNames),
|
|
2978
|
+
"data-hue": palette,
|
|
2984
2979
|
ref: forwardedRef
|
|
2985
2980
|
});
|
|
2986
2981
|
});
|
|
@@ -3212,6 +3207,7 @@ var Toolbar = {
|
|
|
3212
3207
|
useDropdownMenuContext,
|
|
3213
3208
|
useDropdownMenuMenuScope,
|
|
3214
3209
|
useElevationContext,
|
|
3210
|
+
useLandmarkMover,
|
|
3215
3211
|
useListContext,
|
|
3216
3212
|
useListItemContext,
|
|
3217
3213
|
useMainContext,
|