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