@dxos/react-ui 0.8.4-main.422d1c7879 → 0.8.4-main.4f23b4e393
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/{chunk-OCVRIJCH.mjs → chunk-BDBC6H6V.mjs} +1 -1
- package/dist/lib/browser/{chunk-OCVRIJCH.mjs.map → chunk-BDBC6H6V.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +71 -85
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -7
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/translations.mjs +18 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QUD5P3RU.mjs → chunk-3JSJK2ZY.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-QUD5P3RU.mjs.map → chunk-3JSJK2ZY.mjs.map} +2 -2
- package/dist/lib/node-esm/index.mjs +71 -85
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -7
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/translations.mjs +20 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/Button.stories.d.ts +1 -1
- package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.d.ts +1 -0
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/Toggle.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/ToggleGroup.d.ts +2 -2
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts +2 -2
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.d.ts +13 -16
- package/dist/types/src/components/Card/Card.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.stories.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts +17 -17
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts +16 -16
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorFallback.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorFallback.stories.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ThrowError.d.ts.map +1 -1
- package/dist/types/src/components/Focus/Focus.d.ts +2 -2
- package/dist/types/src/components/Focus/Focus.stories.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts +1 -0
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -1
- package/dist/types/src/components/Image/Image.d.ts.map +1 -1
- package/dist/types/src/components/Image/Image.stories.d.ts +2 -2
- package/dist/types/src/components/Image/Image.stories.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +12 -15
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts +2 -2
- package/dist/types/src/components/List/List.stories.d.ts +1 -1
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/ListDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/List/Tree.d.ts +2 -2
- package/dist/types/src/components/List/Tree.d.ts.map +1 -1
- package/dist/types/src/components/List/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/TreeDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.d.ts +1 -1
- package/dist/types/src/components/List/Treegrid.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts +7 -3
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/useSwipeToDismiss.d.ts.map +1 -1
- package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/ContextMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.d.ts +11 -3
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.d.ts +1 -1
- package/dist/types/src/components/Message/Message.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +10 -2
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +2 -2
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +2 -2
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +11 -3
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Splitter/Splitter.d.ts +3 -3
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +54 -55
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +4 -4
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -5
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/generics.stories.d.ts +1 -1
- package/dist/types/src/exemplars/generics.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/slot.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/tabster.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/virtualizer.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useIconHref.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeArea.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeCollisionPadding.d.ts.map +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Column/Column.d.ts +4 -4
- package/dist/types/src/primitives/Column/Column.d.ts.map +1 -1
- package/dist/types/src/primitives/Column/Column.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Container/Container.d.ts +1 -1
- package/dist/types/src/primitives/Container/Container.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Flex/Flex.d.ts +1 -1
- package/dist/types/src/primitives/Flex/Flex.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Grid/Grid.d.ts +1 -1
- package/dist/types/src/primitives/Grid/Grid.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Panel/Panel.d.ts +4 -4
- package/dist/types/src/primitives/Panel/Panel.d.ts.map +1 -1
- package/dist/types/src/primitives/Panel/Panel.stories.d.ts.map +1 -1
- package/dist/types/src/testing/Loading.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/usePx.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -17
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +1 -1
- package/src/components/Button/IconButton.stories.tsx +1 -1
- package/src/components/Button/IconButton.tsx +3 -2
- package/src/components/Card/Card.stories.tsx +3 -3
- package/src/components/Card/Card.tsx +25 -16
- package/src/components/Clipboard/CopyButton.tsx +2 -2
- package/src/components/Icon/Icon.tsx +10 -3
- package/src/components/Image/Image.tsx +15 -5
- package/src/components/List/List.stories.tsx +1 -1
- package/src/components/List/List.tsx +1 -1
- package/src/components/List/ListDropIndicator.tsx +0 -1
- package/src/components/List/Tree.stories.tsx +1 -1
- package/src/components/Message/Message.stories.tsx +1 -1
- package/src/components/Message/Message.tsx +24 -7
- package/src/components/ScrollArea/ScrollArea.stories.tsx +1 -5
- package/src/components/ScrollContainer/ScrollContainer.tsx +1 -3
- package/src/components/ThemeProvider/index.ts +1 -1
- package/src/components/Toolbar/Toolbar.tsx +2 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/exemplars/slot.stories.tsx +2 -4
- package/src/exemplars/virtualizer.stories.tsx +0 -1
- package/src/testing/decorators/withLayout.tsx +6 -16
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
useThemeContext,
|
|
19
19
|
useTooltipContext,
|
|
20
20
|
useTranslation
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3JSJK2ZY.mjs";
|
|
22
22
|
|
|
23
23
|
// src/index.ts
|
|
24
24
|
import { Trans } from "react-i18next";
|
|
@@ -26,7 +26,7 @@ export * from "@dxos/react-hooks";
|
|
|
26
26
|
export * from "@dxos/ui-types";
|
|
27
27
|
|
|
28
28
|
// src/components/ThemeProvider/index.ts
|
|
29
|
-
import { isLabel, toLocalizedString } from "@dxos/ui-types";
|
|
29
|
+
import { isLabel, toLocalizedString } from "@dxos/ui-types/translations";
|
|
30
30
|
|
|
31
31
|
// src/hooks/useDensityContext.ts
|
|
32
32
|
import { useContext } from "react";
|
|
@@ -198,12 +198,19 @@ import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
|
198
198
|
import React4, { forwardRef as forwardRef4 } from "react";
|
|
199
199
|
|
|
200
200
|
// src/components/Icon/Icon.tsx
|
|
201
|
-
import React2, { forwardRef as forwardRef2, memo } from "react";
|
|
202
|
-
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({
|
|
201
|
+
import React2, { forwardRef as forwardRef2, memo, useMemo as useMemo3 } from "react";
|
|
202
|
+
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ classNames, icon, size, synchronized, style, ...props }, forwardedRef) => {
|
|
203
203
|
const { tx } = useThemeContext();
|
|
204
|
+
const spinDelay = useMemo3(() => synchronized ? `${-(Date.now() % 1e3)}ms` : void 0, [
|
|
205
|
+
synchronized
|
|
206
|
+
]);
|
|
204
207
|
const href = useIconHref(icon);
|
|
205
208
|
return /* @__PURE__ */ React2.createElement("svg", {
|
|
206
209
|
...props,
|
|
210
|
+
style: {
|
|
211
|
+
...style,
|
|
212
|
+
animationDelay: spinDelay
|
|
213
|
+
},
|
|
207
214
|
className: tx("icon.root", {
|
|
208
215
|
size
|
|
209
216
|
}, classNames),
|
|
@@ -374,12 +381,13 @@ var IconOnlyButton = /* @__PURE__ */ forwardRef6(({ noTooltip, tooltipSide, ...p
|
|
|
374
381
|
ref: forwardedRef
|
|
375
382
|
}));
|
|
376
383
|
});
|
|
377
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size, icon, iconOnly, iconEnd, iconClassNames, label, caretDown, noTooltip: _, classNames, ...props }, forwardedRef) => {
|
|
384
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size, icon, iconOnly, square, iconEnd, iconClassNames, label, caretDown, noTooltip: _, classNames, ...props }, forwardedRef) => {
|
|
378
385
|
const { tx } = useThemeContext();
|
|
379
386
|
return /* @__PURE__ */ React6.createElement(Button, {
|
|
380
387
|
...props,
|
|
381
388
|
classNames: tx("iconButton.root", {
|
|
382
|
-
iconOnly
|
|
389
|
+
iconOnly,
|
|
390
|
+
square
|
|
383
391
|
}, classNames),
|
|
384
392
|
ref: forwardedRef
|
|
385
393
|
}, icon && !iconEnd && /* @__PURE__ */ React6.createElement(Icon, {
|
|
@@ -459,7 +467,7 @@ var ToggleGroupIconItem = /* @__PURE__ */ forwardRef8(({ variant, label, icon, s
|
|
|
459
467
|
import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
460
468
|
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
461
469
|
import DOMPurify from "dompurify";
|
|
462
|
-
import React19, { createContext as createContext3, forwardRef as forwardRef13, useContext as useContext3, useMemo as
|
|
470
|
+
import React19, { createContext as createContext3, forwardRef as forwardRef13, useContext as useContext3, useMemo as useMemo5 } from "react";
|
|
463
471
|
import { composable as composable3, composableProps as composableProps7, iconSize, mx as mx6, slottable as slottable6 } from "@dxos/ui-theme";
|
|
464
472
|
|
|
465
473
|
// src/primitives/Column/Column.tsx
|
|
@@ -771,7 +779,9 @@ var extractDominantColor = (canvas, img, { sampleSize = 64, contrast = 0.95 }) =
|
|
|
771
779
|
const green = pixels[i + 1];
|
|
772
780
|
const blue = pixels[i + 2];
|
|
773
781
|
const alpha = pixels[i + 3];
|
|
774
|
-
if (alpha === 0)
|
|
782
|
+
if (alpha === 0) {
|
|
783
|
+
continue;
|
|
784
|
+
}
|
|
775
785
|
const max = Math.max(red, green, blue);
|
|
776
786
|
const min = Math.min(red, green, blue);
|
|
777
787
|
const saturation = max === 0 ? 0 : (max - min) / max;
|
|
@@ -799,15 +809,23 @@ var isTransparent = (pixels, sampleSize, threshold = 0.5) => {
|
|
|
799
809
|
const edgePixels = sampleSize * 4 - 4;
|
|
800
810
|
for (let x = 0; x < sampleSize; x++) {
|
|
801
811
|
const topIndex = x * 4;
|
|
802
|
-
if (pixels[topIndex + 3] === 0)
|
|
812
|
+
if (pixels[topIndex + 3] === 0) {
|
|
813
|
+
edgeTransparentPixels++;
|
|
814
|
+
}
|
|
803
815
|
const bottomIndex = ((sampleSize - 1) * sampleSize + x) * 4;
|
|
804
|
-
if (pixels[bottomIndex + 3] === 0)
|
|
816
|
+
if (pixels[bottomIndex + 3] === 0) {
|
|
817
|
+
edgeTransparentPixels++;
|
|
818
|
+
}
|
|
805
819
|
}
|
|
806
820
|
for (let y = 1; y < sampleSize - 1; y++) {
|
|
807
821
|
const leftIndex = y * sampleSize * 4;
|
|
808
|
-
if (pixels[leftIndex + 3] === 0)
|
|
822
|
+
if (pixels[leftIndex + 3] === 0) {
|
|
823
|
+
edgeTransparentPixels++;
|
|
824
|
+
}
|
|
809
825
|
const rightIndex = (y * sampleSize + sampleSize - 1) * 4;
|
|
810
|
-
if (pixels[rightIndex + 3] === 0)
|
|
826
|
+
if (pixels[rightIndex + 3] === 0) {
|
|
827
|
+
edgeTransparentPixels++;
|
|
828
|
+
}
|
|
811
829
|
}
|
|
812
830
|
return edgeTransparentPixels / edgePixels > threshold;
|
|
813
831
|
};
|
|
@@ -819,20 +837,7 @@ import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
|
819
837
|
import React18, { forwardRef as forwardRef12 } from "react";
|
|
820
838
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
821
839
|
import { composable as composable2, composableProps as composableProps6, slottable as slottable5 } from "@dxos/ui-theme";
|
|
822
|
-
|
|
823
|
-
// src/translations.ts
|
|
824
|
-
var translationKey = "@dxos/react-ui";
|
|
825
|
-
var translations = [
|
|
826
|
-
{
|
|
827
|
-
"en-US": {
|
|
828
|
-
[translationKey]: {
|
|
829
|
-
"toolbar-menu.label": "Action menu",
|
|
830
|
-
"toolbar-drag-handle.label": "Drag to rearrange",
|
|
831
|
-
"toolbar-close.label": "Close"
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
];
|
|
840
|
+
import { translationKey } from "#translations";
|
|
836
841
|
|
|
837
842
|
// src/components/Menu/ContextMenu.tsx
|
|
838
843
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
@@ -932,7 +937,7 @@ import { createMenuScope } from "@radix-ui/react-menu";
|
|
|
932
937
|
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
933
938
|
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
934
939
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
935
|
-
import React16, { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect2, useMemo as
|
|
940
|
+
import React16, { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2 } from "react";
|
|
936
941
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
937
942
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
938
943
|
createMenuScope
|
|
@@ -1063,7 +1068,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef10((props, forwardedRef) =>
|
|
|
1063
1068
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1064
1069
|
const hasInteractedOutsideRef = useRef2(false);
|
|
1065
1070
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1066
|
-
const computedCollisionBoundary =
|
|
1071
|
+
const computedCollisionBoundary = useMemo4(() => {
|
|
1067
1072
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
1068
1073
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
1069
1074
|
closestBoundary,
|
|
@@ -1490,23 +1495,23 @@ var Toolbar = {
|
|
|
1490
1495
|
// src/components/Card/Card.tsx
|
|
1491
1496
|
var CardContext = /* @__PURE__ */ createContext3({});
|
|
1492
1497
|
var CARD_ROOT_NAME = "Card.Root";
|
|
1493
|
-
var CardRoot =
|
|
1498
|
+
var CardRoot = composable3(({ children, id, role, border = true, fullWidth, density, ...props }, forwardedRef) => {
|
|
1494
1499
|
const { className, ...rest } = composableProps7(props);
|
|
1495
|
-
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1496
1500
|
const { tx } = useThemeContext();
|
|
1497
|
-
return /* @__PURE__ */ React19.createElement(
|
|
1501
|
+
return /* @__PURE__ */ React19.createElement(Column.Root, {
|
|
1502
|
+
asChild: true,
|
|
1503
|
+
gutter: density === "coarse" ? "lg" : "md",
|
|
1504
|
+
classNames: tx("card.root", {
|
|
1505
|
+
border,
|
|
1506
|
+
fullWidth
|
|
1507
|
+
}, className),
|
|
1508
|
+
role: role ?? "group"
|
|
1509
|
+
}, /* @__PURE__ */ React19.createElement("div", {
|
|
1498
1510
|
...rest,
|
|
1499
1511
|
...id && {
|
|
1500
1512
|
"data-object-id": id
|
|
1501
1513
|
},
|
|
1502
|
-
role: role ?? "group",
|
|
1503
|
-
className: tx("card.root", {
|
|
1504
|
-
border,
|
|
1505
|
-
fullWidth
|
|
1506
|
-
}, className),
|
|
1507
1514
|
ref: forwardedRef
|
|
1508
|
-
}, /* @__PURE__ */ React19.createElement(Column.Root, {
|
|
1509
|
-
gutter: density === "coarse" ? "lg" : "md"
|
|
1510
1515
|
}, children));
|
|
1511
1516
|
});
|
|
1512
1517
|
CardRoot.displayName = CARD_ROOT_NAME;
|
|
@@ -1570,7 +1575,6 @@ var CardIconBlock = /* @__PURE__ */ forwardRef13(({ classNames, children, paddin
|
|
|
1570
1575
|
const { tx } = useThemeContext();
|
|
1571
1576
|
return /* @__PURE__ */ React19.createElement("div", {
|
|
1572
1577
|
...props,
|
|
1573
|
-
role: "none",
|
|
1574
1578
|
className: tx("card.icon-block", {
|
|
1575
1579
|
padding
|
|
1576
1580
|
}, classNames),
|
|
@@ -1670,12 +1674,11 @@ CardText.displayName = CARD_TEXT_NAME;
|
|
|
1670
1674
|
var CARD_HTML_NAME = "Card.Html";
|
|
1671
1675
|
var CardHtml = ({ html, variant = "default", ...props }) => {
|
|
1672
1676
|
const { tx } = useThemeContext();
|
|
1673
|
-
const sanitized =
|
|
1677
|
+
const sanitized = useMemo5(() => DOMPurify.sanitize(html), [
|
|
1674
1678
|
html
|
|
1675
1679
|
]);
|
|
1676
1680
|
return /* @__PURE__ */ React19.createElement("div", {
|
|
1677
1681
|
...props,
|
|
1678
|
-
role: "none",
|
|
1679
1682
|
className: tx("card.text", {
|
|
1680
1683
|
variant
|
|
1681
1684
|
}),
|
|
@@ -1692,7 +1695,6 @@ var CardPoster = (props) => {
|
|
|
1692
1695
|
const aspect = props.aspect === "auto" ? "aspect-auto" : "aspect-video";
|
|
1693
1696
|
if (props.image) {
|
|
1694
1697
|
return /* @__PURE__ */ React19.createElement("div", {
|
|
1695
|
-
role: "none",
|
|
1696
1698
|
className: "col-span-full"
|
|
1697
1699
|
}, /* @__PURE__ */ React19.createElement(Image, {
|
|
1698
1700
|
classNames: [
|
|
@@ -1823,7 +1825,6 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1823
1825
|
onClick: () => setTextValue(value),
|
|
1824
1826
|
"data-testid": "copy-invitation"
|
|
1825
1827
|
}, /* @__PURE__ */ React21.createElement("div", {
|
|
1826
|
-
role: "none",
|
|
1827
1828
|
className: mx7("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
1828
1829
|
}, /* @__PURE__ */ React21.createElement("span", {
|
|
1829
1830
|
className: "px-1"
|
|
@@ -1831,7 +1832,6 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1831
1832
|
icon: "ph--copy--regular",
|
|
1832
1833
|
size
|
|
1833
1834
|
})), /* @__PURE__ */ React21.createElement("div", {
|
|
1834
|
-
role: "none",
|
|
1835
1835
|
className: mx7("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
1836
1836
|
}, /* @__PURE__ */ React21.createElement("span", {
|
|
1837
1837
|
className: "px-1"
|
|
@@ -2475,7 +2475,6 @@ var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
|
2475
2475
|
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
2476
2476
|
const orientation = edgeToOrientationMap[edge];
|
|
2477
2477
|
return /* @__PURE__ */ React27.createElement("div", {
|
|
2478
|
-
role: "none",
|
|
2479
2478
|
style: {
|
|
2480
2479
|
"--line-thickness": `${strokeSize}px`,
|
|
2481
2480
|
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
@@ -2521,7 +2520,6 @@ var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
|
2521
2520
|
const density = useDensityContext();
|
|
2522
2521
|
const { tx } = useThemeContext();
|
|
2523
2522
|
return /* @__PURE__ */ React28.createElement("div", {
|
|
2524
|
-
role: "none",
|
|
2525
2523
|
...props,
|
|
2526
2524
|
className: tx("list.item.openTrigger", {
|
|
2527
2525
|
density
|
|
@@ -2923,21 +2921,11 @@ var [MainProvider, useMainContext] = createContext8(MAIN_NAME, {
|
|
|
2923
2921
|
resizing: false,
|
|
2924
2922
|
navigationSidebarState: "closed",
|
|
2925
2923
|
setNavigationSidebarState: (_nextState) => {
|
|
2926
|
-
log.warn("Not initialized", void 0, {
|
|
2927
|
-
F: __dxlog_file,
|
|
2928
|
-
L: 110,
|
|
2929
|
-
S: void 0,
|
|
2930
|
-
C: (f, a) => f(...a)
|
|
2931
|
-
});
|
|
2924
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 67, S: void 0 });
|
|
2932
2925
|
},
|
|
2933
2926
|
complementarySidebarState: "closed",
|
|
2934
2927
|
setComplementarySidebarState: (_nextState) => {
|
|
2935
|
-
log.warn("Not initialized", void 0, {
|
|
2936
|
-
F: __dxlog_file,
|
|
2937
|
-
L: 115,
|
|
2938
|
-
S: void 0,
|
|
2939
|
-
C: (f, a) => f(...a)
|
|
2940
|
-
});
|
|
2928
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 71, S: void 0 });
|
|
2941
2929
|
}
|
|
2942
2930
|
});
|
|
2943
2931
|
var useSidebars = (consumerName) => {
|
|
@@ -3126,7 +3114,9 @@ import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
|
3126
3114
|
import { Primitive as Primitive18 } from "@radix-ui/react-primitive";
|
|
3127
3115
|
import { Slot as Slot18 } from "@radix-ui/react-slot";
|
|
3128
3116
|
import React33, { forwardRef as forwardRef21 } from "react";
|
|
3117
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
3129
3118
|
import { useId as useId3 } from "@dxos/react-hooks";
|
|
3119
|
+
import { translationKey as translationKey2 } from "#translations";
|
|
3130
3120
|
var messageIcons = {
|
|
3131
3121
|
success: "ph--check-circle--duotone",
|
|
3132
3122
|
info: "ph--info--duotone",
|
|
@@ -3160,24 +3150,30 @@ var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence = "neutral",
|
|
|
3160
3150
|
});
|
|
3161
3151
|
MessageRoot.displayName = MESSAGE_NAME;
|
|
3162
3152
|
var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
3163
|
-
var MessageTitle = /* @__PURE__ */ forwardRef21(({
|
|
3153
|
+
var MessageTitle = /* @__PURE__ */ forwardRef21(({ classNames, children, icon: iconProp, onClose }, forwardedRef) => {
|
|
3154
|
+
const { t } = useTranslation4(translationKey2);
|
|
3164
3155
|
const { tx } = useThemeContext();
|
|
3165
3156
|
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3166
|
-
const Comp = asChild ? Slot18 : Primitive18.h2;
|
|
3167
3157
|
const icon = iconProp ?? messageIcons[valence];
|
|
3168
|
-
return /* @__PURE__ */ React33.createElement(
|
|
3169
|
-
...props,
|
|
3158
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
3170
3159
|
className: tx("message.header", {}, classNames),
|
|
3171
3160
|
id: titleId,
|
|
3172
3161
|
ref: forwardedRef
|
|
3173
|
-
},
|
|
3174
|
-
icon,
|
|
3175
|
-
classNames: tx("message.icon", {
|
|
3162
|
+
}, icon && /* @__PURE__ */ React33.createElement("div", {
|
|
3163
|
+
className: tx("message.icon", {
|
|
3176
3164
|
valence
|
|
3177
3165
|
})
|
|
3178
|
-
}
|
|
3166
|
+
}, /* @__PURE__ */ React33.createElement(Icon, {
|
|
3167
|
+
icon
|
|
3168
|
+
})), /* @__PURE__ */ React33.createElement("h2", {
|
|
3179
3169
|
className: tx("message.title", {}, classNames)
|
|
3180
|
-
}, children)
|
|
3170
|
+
}, children), onClose && /* @__PURE__ */ React33.createElement(IconButton, {
|
|
3171
|
+
variant: "ghost",
|
|
3172
|
+
icon: "ph--x--regular",
|
|
3173
|
+
iconOnly: true,
|
|
3174
|
+
label: t("toolbar-close.label"),
|
|
3175
|
+
onClick: onClose
|
|
3176
|
+
}));
|
|
3181
3177
|
});
|
|
3182
3178
|
MessageTitle.displayName = MESSAGE_TITLE_NAME;
|
|
3183
3179
|
var MESSAGE_CONTENT_NAME = "MessageContent";
|
|
@@ -3216,7 +3212,7 @@ import { Primitive as Primitive19 } from "@radix-ui/react-primitive";
|
|
|
3216
3212
|
import { Slot as Slot19 } from "@radix-ui/react-slot";
|
|
3217
3213
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
3218
3214
|
import { hideOthers } from "aria-hidden";
|
|
3219
|
-
import React34, { forwardRef as forwardRef22, useCallback as useCallback10, useEffect as useEffect6, useMemo as
|
|
3215
|
+
import React34, { forwardRef as forwardRef22, useCallback as useCallback10, useEffect as useEffect6, useMemo as useMemo6, useRef as useRef5, useState as useState9 } from "react";
|
|
3220
3216
|
import { RemoveScroll } from "react-remove-scroll";
|
|
3221
3217
|
var POPOVER_NAME = "Popover";
|
|
3222
3218
|
var [createPopoverContext, createPopoverScope] = createContextScope3(POPOVER_NAME, [
|
|
@@ -3431,7 +3427,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3431
3427
|
const elevation = useElevationContext();
|
|
3432
3428
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3433
3429
|
useFocusGuards();
|
|
3434
|
-
const computedCollisionBoundary =
|
|
3430
|
+
const computedCollisionBoundary = useMemo6(() => {
|
|
3435
3431
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
3436
3432
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
3437
3433
|
closestBoundary,
|
|
@@ -3566,7 +3562,7 @@ var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0,
|
|
|
3566
3562
|
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
3567
3563
|
import { Primitive as Primitive20 } from "@radix-ui/react-primitive";
|
|
3568
3564
|
import { Slot as Slot20 } from "@radix-ui/react-slot";
|
|
3569
|
-
import React36, { useMemo as
|
|
3565
|
+
import React36, { useMemo as useMemo7 } from "react";
|
|
3570
3566
|
import { composableProps as composableProps12, scrollbar, slottable as slottable9 } from "@dxos/ui-theme";
|
|
3571
3567
|
var SCROLLAREA_NAME = "ScrollArea";
|
|
3572
3568
|
var [ScrollAreaProvider, useScrollAreaContext] = createContext10(SCROLLAREA_NAME);
|
|
@@ -3575,7 +3571,7 @@ var ScrollAreaRoot = slottable9(({ children, asChild, orientation = "vertical",
|
|
|
3575
3571
|
const { tx } = useThemeContext();
|
|
3576
3572
|
const { className, ...rest } = composableProps12(props);
|
|
3577
3573
|
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3578
|
-
const options =
|
|
3574
|
+
const options = useMemo7(() => ({
|
|
3579
3575
|
orientation,
|
|
3580
3576
|
autoHide,
|
|
3581
3577
|
centered,
|
|
@@ -3624,7 +3620,7 @@ var ScrollArea = {
|
|
|
3624
3620
|
|
|
3625
3621
|
// src/components/ScrollContainer/ScrollContainer.tsx
|
|
3626
3622
|
import { createContext as createContext11 } from "@radix-ui/react-context";
|
|
3627
|
-
import React37, { forwardRef as forwardRef24, useCallback as useCallback11, useEffect as useEffect7, useImperativeHandle, useMemo as
|
|
3623
|
+
import React37, { forwardRef as forwardRef24, useCallback as useCallback11, useEffect as useEffect7, useImperativeHandle, useMemo as useMemo8, useRef as useRef6, useState as useState10 } from "react";
|
|
3628
3624
|
import { addEventListener as addEventListener2, combine } from "@dxos/async";
|
|
3629
3625
|
import { invariant } from "@dxos/invariant";
|
|
3630
3626
|
import { useMergeRefs } from "@dxos/react-hooks";
|
|
@@ -3661,20 +3657,12 @@ var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorPr
|
|
|
3661
3657
|
}, [
|
|
3662
3658
|
behaviorProp
|
|
3663
3659
|
]);
|
|
3664
|
-
const controller =
|
|
3660
|
+
const controller = useMemo8(() => ({
|
|
3665
3661
|
get viewport() {
|
|
3666
3662
|
return scrollerRef.current;
|
|
3667
3663
|
},
|
|
3668
3664
|
scrollToTop: () => {
|
|
3669
|
-
invariant(scrollerRef.current, void 0, {
|
|
3670
|
-
F: __dxlog_file2,
|
|
3671
|
-
L: 108,
|
|
3672
|
-
S: void 0,
|
|
3673
|
-
A: [
|
|
3674
|
-
"scrollerRef.current",
|
|
3675
|
-
""
|
|
3676
|
-
]
|
|
3677
|
-
});
|
|
3665
|
+
invariant(scrollerRef.current, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 54, S: void 0, A: ["scrollerRef.current", ""] });
|
|
3678
3666
|
scrollerRef.current.scrollTo({
|
|
3679
3667
|
top: 0,
|
|
3680
3668
|
behavior: "smooth"
|
|
@@ -3785,13 +3773,12 @@ var FADE_NAME = "ScrollContainer.Fade";
|
|
|
3785
3773
|
var Fade = () => {
|
|
3786
3774
|
const { overflow } = useScrollContainerContext(FADE_NAME);
|
|
3787
3775
|
return /* @__PURE__ */ React37.createElement("div", {
|
|
3788
|
-
role: "none",
|
|
3789
3776
|
"data-visible": overflow,
|
|
3790
3777
|
className: mx9(
|
|
3791
3778
|
// NOTE: Gradients may not be visible with dark reader extensions.
|
|
3792
3779
|
"z-10 absolute top-0 inset-x-0 h-24 w-full",
|
|
3793
3780
|
'opacity-0 duration-200 transition-opacity data-[visible="true"]:opacity-100',
|
|
3794
|
-
"bg-gradient-to-b from-(--surface
|
|
3781
|
+
"bg-gradient-to-b from-(--color-base-surface) to-transparent pointer-events-none"
|
|
3795
3782
|
)
|
|
3796
3783
|
});
|
|
3797
3784
|
};
|
|
@@ -3800,7 +3787,6 @@ var SCROLL_DOWN_BUTTON_NAME = "ScrollContainer.ScrollDownButton";
|
|
|
3800
3787
|
var ScrollDownButton = ({ classNames }) => {
|
|
3801
3788
|
const { pinned, controller } = useScrollContainerContext(SCROLL_DOWN_BUTTON_NAME);
|
|
3802
3789
|
return /* @__PURE__ */ React37.createElement("div", {
|
|
3803
|
-
role: "none",
|
|
3804
3790
|
className: mx9("absolute bottom-2 right-4 opacity-100 transition-opacity duration-300", pinned && "opacity-0", classNames)
|
|
3805
3791
|
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
3806
3792
|
variant: "primary",
|