@dxos/react-ui 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
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 +156 -156
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +2 -2
- 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 +156 -156
- 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 +2 -2
- 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 +21 -12
- 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 +21 -19
- 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 +22 -20
- 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.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 +2 -1
- package/dist/types/src/components/Image/Image.d.ts.map +1 -1
- package/dist/types/src/components/Image/Image.stories.d.ts +3 -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 +11 -13
- package/dist/types/src/primitives/Column/Column.d.ts.map +1 -1
- package/dist/types/src/primitives/Column/Column.stories.d.ts +7 -7
- 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 -24
- package/src/components/Button/IconButton.tsx +3 -2
- package/src/components/Card/Card.tsx +20 -5
- package/src/components/Dialog/Dialog.stories.tsx +2 -2
- package/src/components/Dialog/Dialog.tsx +29 -29
- package/src/components/Image/Image.tsx +31 -8
- package/src/components/Input/Input.tsx +3 -3
- package/src/components/Message/Message.stories.tsx +1 -1
- package/src/components/Message/Message.tsx +24 -7
- package/src/components/ThemeProvider/index.ts +1 -1
- package/src/components/Toolbar/Toolbar.tsx +2 -1
- package/src/primitives/Column/AUDIT.md +105 -311
- package/src/primitives/Column/Column.stories.tsx +58 -60
- package/src/primitives/Column/Column.tsx +54 -58
- package/src/testing/decorators/withLayout.tsx +1 -1
|
@@ -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";
|
|
@@ -374,12 +374,13 @@ var IconOnlyButton = /* @__PURE__ */ forwardRef6(({ noTooltip, tooltipSide, ...p
|
|
|
374
374
|
ref: forwardedRef
|
|
375
375
|
}));
|
|
376
376
|
});
|
|
377
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size, icon, iconOnly, iconEnd, iconClassNames, label, caretDown, noTooltip: _, classNames, ...props }, forwardedRef) => {
|
|
377
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size, icon, iconOnly, square, iconEnd, iconClassNames, label, caretDown, noTooltip: _, classNames, ...props }, forwardedRef) => {
|
|
378
378
|
const { tx } = useThemeContext();
|
|
379
379
|
return /* @__PURE__ */ React6.createElement(Button, {
|
|
380
380
|
...props,
|
|
381
381
|
classNames: tx("iconButton.root", {
|
|
382
|
-
iconOnly
|
|
382
|
+
iconOnly,
|
|
383
|
+
square
|
|
383
384
|
}, classNames),
|
|
384
385
|
ref: forwardedRef
|
|
385
386
|
}, icon && !iconEnd && /* @__PURE__ */ React6.createElement(Icon, {
|
|
@@ -484,6 +485,7 @@ var ColumnRoot = slottable(({ children, asChild, role, gutter = "md", ...props }
|
|
|
484
485
|
role: role ?? "none",
|
|
485
486
|
style: {
|
|
486
487
|
"--gutter": gutterSize,
|
|
488
|
+
"--dx-col": "2 / span 1",
|
|
487
489
|
gridTemplateColumns: [
|
|
488
490
|
gutterSize,
|
|
489
491
|
"minmax(0,1fr)",
|
|
@@ -498,51 +500,47 @@ var ColumnRoot = slottable(({ children, asChild, role, gutter = "md", ...props }
|
|
|
498
500
|
});
|
|
499
501
|
ColumnRoot.displayName = COLUMN_ROOT_NAME;
|
|
500
502
|
var COLUMN_ROW_NAME = "Column.Row";
|
|
501
|
-
var ColumnRow = slottable(({ children, asChild, role,
|
|
503
|
+
var ColumnRow = slottable(({ children, asChild, role, ...props }, forwardedRef) => {
|
|
502
504
|
const { className, ...rest } = composableProps(props);
|
|
503
505
|
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
504
506
|
const { tx } = useThemeContext();
|
|
505
507
|
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
506
508
|
...rest,
|
|
507
509
|
role: role ?? "none",
|
|
508
|
-
className: tx("column.row", {
|
|
509
|
-
fullWidth,
|
|
510
|
-
center
|
|
511
|
-
}, className),
|
|
510
|
+
className: tx("column.row", {}, className),
|
|
512
511
|
ref: forwardedRef
|
|
513
512
|
}, children);
|
|
514
513
|
});
|
|
515
514
|
ColumnRow.displayName = COLUMN_ROW_NAME;
|
|
516
|
-
var
|
|
517
|
-
var
|
|
515
|
+
var COLUMN_BLEED_NAME = "Column.Bleed";
|
|
516
|
+
var ColumnBleed = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
518
517
|
const { tx } = useThemeContext();
|
|
519
518
|
const { className, ...rest } = composableProps(props);
|
|
520
519
|
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
521
520
|
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
522
521
|
...rest,
|
|
523
|
-
className: tx("column.
|
|
522
|
+
className: tx("column.bleed", {}, className),
|
|
524
523
|
ref: forwardedRef
|
|
525
524
|
}, children);
|
|
526
525
|
});
|
|
527
|
-
|
|
528
|
-
var
|
|
529
|
-
var
|
|
526
|
+
ColumnBleed.displayName = COLUMN_BLEED_NAME;
|
|
527
|
+
var COLUMN_CENTER_NAME = "Column.Center";
|
|
528
|
+
var ColumnCenter = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
530
529
|
const { tx } = useThemeContext();
|
|
531
530
|
const { className, ...rest } = composableProps(props);
|
|
532
|
-
|
|
531
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
532
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
533
533
|
...rest,
|
|
534
|
-
className: tx("column.
|
|
535
|
-
orientation: "vertical",
|
|
536
|
-
padding: true,
|
|
534
|
+
className: tx("column.center", {}, className),
|
|
537
535
|
ref: forwardedRef
|
|
538
|
-
},
|
|
536
|
+
}, children);
|
|
539
537
|
});
|
|
540
|
-
|
|
538
|
+
ColumnCenter.displayName = COLUMN_CENTER_NAME;
|
|
541
539
|
var Column = {
|
|
542
540
|
Root: ColumnRoot,
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
541
|
+
Row: ColumnRow,
|
|
542
|
+
Bleed: ColumnBleed,
|
|
543
|
+
Center: ColumnCenter
|
|
546
544
|
};
|
|
547
545
|
|
|
548
546
|
// src/primitives/Container/Container.tsx
|
|
@@ -668,7 +666,7 @@ var Panel = {
|
|
|
668
666
|
import React14, { useCallback as useCallback3, useRef, useState as useState3 } from "react";
|
|
669
667
|
import { mx as mx5 } from "@dxos/ui-theme";
|
|
670
668
|
var cache = /* @__PURE__ */ new Map();
|
|
671
|
-
var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize = 64, contrast = 0.9 }) => {
|
|
669
|
+
var Image = ({ classNames, src, alt = "", fit = "contain", crossOrigin = "anonymous", sampleSize = 64, contrast = 0.9 }) => {
|
|
672
670
|
const [crossOriginState, setCrossOriginState] = useState3(crossOrigin);
|
|
673
671
|
const [dominantColor, setDominantColor] = useState3(void 0);
|
|
674
672
|
const [imageLoaded, setImageLoaded] = useState3(false);
|
|
@@ -707,7 +705,13 @@ var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize
|
|
|
707
705
|
src
|
|
708
706
|
]);
|
|
709
707
|
return /* @__PURE__ */ React14.createElement("div", {
|
|
710
|
-
|
|
708
|
+
// `isolate` (`isolation: isolate`) creates a new stacking context so
|
|
709
|
+
// the inner <img>'s `z-10` stays scoped to this wrapper. Without it
|
|
710
|
+
// the z-10 leaks into the parent's stacking context and elevates the
|
|
711
|
+
// image above any pseudo-element rings (e.g. Focus.Item's
|
|
712
|
+
// `dx-ring-pseudo` `::after`) painted on ancestors — most visibly,
|
|
713
|
+
// the focus ring on a Card containing a Card.Poster.
|
|
714
|
+
className: mx5(`relative flex w-full justify-center overflow-hidden transition-all duration-700 isolate`, classNames),
|
|
711
715
|
style: {
|
|
712
716
|
backgroundColor: dominantColor
|
|
713
717
|
}
|
|
@@ -730,7 +734,7 @@ var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize
|
|
|
730
734
|
crossOrigin: crossOriginState,
|
|
731
735
|
onError: handleImageError,
|
|
732
736
|
onLoad: handleImageLoad,
|
|
733
|
-
className: "z-10
|
|
737
|
+
className: mx5("z-10 transition-opacity duration-500", fit === "cover" ? "w-full h-full object-cover" : "object-contain"),
|
|
734
738
|
style: {
|
|
735
739
|
opacity: imageLoaded ? 1 : 0
|
|
736
740
|
}
|
|
@@ -768,7 +772,9 @@ var extractDominantColor = (canvas, img, { sampleSize = 64, contrast = 0.95 }) =
|
|
|
768
772
|
const green = pixels[i + 1];
|
|
769
773
|
const blue = pixels[i + 2];
|
|
770
774
|
const alpha = pixels[i + 3];
|
|
771
|
-
if (alpha === 0)
|
|
775
|
+
if (alpha === 0) {
|
|
776
|
+
continue;
|
|
777
|
+
}
|
|
772
778
|
const max = Math.max(red, green, blue);
|
|
773
779
|
const min = Math.min(red, green, blue);
|
|
774
780
|
const saturation = max === 0 ? 0 : (max - min) / max;
|
|
@@ -796,15 +802,23 @@ var isTransparent = (pixels, sampleSize, threshold = 0.5) => {
|
|
|
796
802
|
const edgePixels = sampleSize * 4 - 4;
|
|
797
803
|
for (let x = 0; x < sampleSize; x++) {
|
|
798
804
|
const topIndex = x * 4;
|
|
799
|
-
if (pixels[topIndex + 3] === 0)
|
|
805
|
+
if (pixels[topIndex + 3] === 0) {
|
|
806
|
+
edgeTransparentPixels++;
|
|
807
|
+
}
|
|
800
808
|
const bottomIndex = ((sampleSize - 1) * sampleSize + x) * 4;
|
|
801
|
-
if (pixels[bottomIndex + 3] === 0)
|
|
809
|
+
if (pixels[bottomIndex + 3] === 0) {
|
|
810
|
+
edgeTransparentPixels++;
|
|
811
|
+
}
|
|
802
812
|
}
|
|
803
813
|
for (let y = 1; y < sampleSize - 1; y++) {
|
|
804
814
|
const leftIndex = y * sampleSize * 4;
|
|
805
|
-
if (pixels[leftIndex + 3] === 0)
|
|
815
|
+
if (pixels[leftIndex + 3] === 0) {
|
|
816
|
+
edgeTransparentPixels++;
|
|
817
|
+
}
|
|
806
818
|
const rightIndex = (y * sampleSize + sampleSize - 1) * 4;
|
|
807
|
-
if (pixels[rightIndex + 3] === 0)
|
|
819
|
+
if (pixels[rightIndex + 3] === 0) {
|
|
820
|
+
edgeTransparentPixels++;
|
|
821
|
+
}
|
|
808
822
|
}
|
|
809
823
|
return edgeTransparentPixels / edgePixels > threshold;
|
|
810
824
|
};
|
|
@@ -816,20 +830,7 @@ import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
|
816
830
|
import React18, { forwardRef as forwardRef12 } from "react";
|
|
817
831
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
818
832
|
import { composable as composable2, composableProps as composableProps6, slottable as slottable5 } from "@dxos/ui-theme";
|
|
819
|
-
|
|
820
|
-
// src/translations.ts
|
|
821
|
-
var translationKey = "@dxos/react-ui";
|
|
822
|
-
var translations = [
|
|
823
|
-
{
|
|
824
|
-
"en-US": {
|
|
825
|
-
[translationKey]: {
|
|
826
|
-
"toolbar-menu.label": "Action menu",
|
|
827
|
-
"toolbar-drag-handle.label": "Drag to rearrange",
|
|
828
|
-
"toolbar-close.label": "Close"
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
];
|
|
833
|
+
import { translationKey } from "#translations";
|
|
833
834
|
|
|
834
835
|
// src/components/Menu/ContextMenu.tsx
|
|
835
836
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
@@ -1503,6 +1504,7 @@ var CardRoot = slottable6(({ children, id, asChild, role, border = true, fullWid
|
|
|
1503
1504
|
}, className),
|
|
1504
1505
|
ref: forwardedRef
|
|
1505
1506
|
}, /* @__PURE__ */ React19.createElement(Column.Root, {
|
|
1507
|
+
classNames: "overflow-hidden",
|
|
1506
1508
|
gutter: density === "coarse" ? "lg" : "md"
|
|
1507
1509
|
}, children));
|
|
1508
1510
|
});
|
|
@@ -1602,10 +1604,11 @@ var CardContent = slottable6(({ children, asChild, ...props }, forwardedRef) =>
|
|
|
1602
1604
|
});
|
|
1603
1605
|
CardContent.displayName = CARD_CONTENT_NAME;
|
|
1604
1606
|
var CARD_ROW_NAME = "Card.Row";
|
|
1605
|
-
var CardRow =
|
|
1607
|
+
var CardRow = slottable6(({ children, asChild, icon, ...props }, forwardedRef) => {
|
|
1606
1608
|
const { className, ...rest } = composableProps7(props);
|
|
1609
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1607
1610
|
const { tx } = useThemeContext();
|
|
1608
|
-
return /* @__PURE__ */ React19.createElement(
|
|
1611
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1609
1612
|
...rest,
|
|
1610
1613
|
className: tx("card.row", {}, className),
|
|
1611
1614
|
ref: forwardedRef
|
|
@@ -1697,7 +1700,8 @@ var CardPoster = (props) => {
|
|
|
1697
1700
|
props.classNames
|
|
1698
1701
|
],
|
|
1699
1702
|
src: props.image,
|
|
1700
|
-
alt: props.alt
|
|
1703
|
+
alt: props.alt,
|
|
1704
|
+
fit: props.fit
|
|
1701
1705
|
}));
|
|
1702
1706
|
}
|
|
1703
1707
|
if (props.icon) {
|
|
@@ -1866,10 +1870,11 @@ var Clipboard = {
|
|
|
1866
1870
|
// src/components/Dialog/Dialog.tsx
|
|
1867
1871
|
import { createContext as createContext5 } from "@radix-ui/react-context";
|
|
1868
1872
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1873
|
+
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
1874
|
+
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
1869
1875
|
import React22, { forwardRef as forwardRef14 } from "react";
|
|
1870
1876
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
1871
|
-
import { osTranslations as osTranslations2 } from "@dxos/ui-theme";
|
|
1872
|
-
import { slottable as slottable7 } from "@dxos/ui-theme";
|
|
1877
|
+
import { composableProps as composableProps8, osTranslations as osTranslations2, slottable as slottable7 } from "@dxos/ui-theme";
|
|
1873
1878
|
var DialogRoot = (props) => /* @__PURE__ */ React22.createElement(ElevationProvider, {
|
|
1874
1879
|
elevation: "dialog"
|
|
1875
1880
|
}, /* @__PURE__ */ React22.createElement(DialogPrimitive.Root, {
|
|
@@ -1914,11 +1919,13 @@ var DialogContent = /* @__PURE__ */ forwardRef14(({ classNames, children, size =
|
|
|
1914
1919
|
}, children));
|
|
1915
1920
|
});
|
|
1916
1921
|
DialogContent.displayName = DIALOG_CONTENT_NAME;
|
|
1917
|
-
var DialogHeader =
|
|
1922
|
+
var DialogHeader = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
1923
|
+
const { className, ...rest } = composableProps8(props);
|
|
1924
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1918
1925
|
const { tx } = useThemeContext();
|
|
1919
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1920
|
-
|
|
1921
|
-
|
|
1926
|
+
return /* @__PURE__ */ React22.createElement(Comp, {
|
|
1927
|
+
...rest,
|
|
1928
|
+
className: tx("dialog.header", {}, className),
|
|
1922
1929
|
ref: forwardedRef
|
|
1923
1930
|
}, children);
|
|
1924
1931
|
});
|
|
@@ -1935,11 +1942,12 @@ var DialogCloseIconButton = /* @__PURE__ */ forwardRef14(({ label, ...props }, f
|
|
|
1935
1942
|
});
|
|
1936
1943
|
});
|
|
1937
1944
|
var DialogBody = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
1945
|
+
const { className, ...rest } = composableProps8(props);
|
|
1946
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1938
1947
|
const { tx } = useThemeContext();
|
|
1939
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1940
|
-
...
|
|
1941
|
-
|
|
1942
|
-
className: tx("dialog.body", {}),
|
|
1948
|
+
return /* @__PURE__ */ React22.createElement(Comp, {
|
|
1949
|
+
...rest,
|
|
1950
|
+
className: tx("dialog.body", {}, className),
|
|
1943
1951
|
ref: forwardedRef
|
|
1944
1952
|
}, children);
|
|
1945
1953
|
});
|
|
@@ -1963,15 +1971,15 @@ var DialogDescription = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...p
|
|
|
1963
1971
|
ref: forwardedRef
|
|
1964
1972
|
});
|
|
1965
1973
|
});
|
|
1966
|
-
var DialogActionBar =
|
|
1974
|
+
var DialogActionBar = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
1975
|
+
const { className: classNames, ...rest } = composableProps8(props);
|
|
1976
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1967
1977
|
const { tx } = useThemeContext();
|
|
1968
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1969
|
-
|
|
1970
|
-
}, /* @__PURE__ */ React22.createElement("div", {
|
|
1971
|
-
...props,
|
|
1978
|
+
return /* @__PURE__ */ React22.createElement(Comp, {
|
|
1979
|
+
...rest,
|
|
1972
1980
|
className: tx("dialog.actionbar", {}, classNames),
|
|
1973
1981
|
ref: forwardedRef
|
|
1974
|
-
}, children)
|
|
1982
|
+
}, children);
|
|
1975
1983
|
});
|
|
1976
1984
|
var DialogClose = DialogPrimitive.Close;
|
|
1977
1985
|
var Dialog = {
|
|
@@ -2150,15 +2158,15 @@ var generator = ({ error, delay }) => {
|
|
|
2150
2158
|
// src/components/Focus/Focus.tsx
|
|
2151
2159
|
import { useArrowNavigationGroup, useFocusableGroup, useMergedTabsterAttributes_unstable } from "@fluentui/react-tabster";
|
|
2152
2160
|
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
2153
|
-
import { Primitive as
|
|
2154
|
-
import { Slot as
|
|
2161
|
+
import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
|
|
2162
|
+
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
2155
2163
|
import React25, { createContext as createContext7, useCallback as useCallback6, useContext as useContext5, useRef as useRef3, useState as useState6 } from "react";
|
|
2156
|
-
import { composableProps as
|
|
2164
|
+
import { composableProps as composableProps9, slottable as slottable8 } from "@dxos/ui-theme";
|
|
2157
2165
|
var FOCUS_STATE_ATTR = "focus-state";
|
|
2158
2166
|
var FocusContext = /* @__PURE__ */ createContext7({});
|
|
2159
2167
|
var useFocus = () => useContext5(FocusContext);
|
|
2160
2168
|
var Group3 = slottable8(({ children, asChild, orientation = "vertical", border = false, ...props }, forwardedRef) => {
|
|
2161
|
-
const Comp = asChild ?
|
|
2169
|
+
const Comp = asChild ? Slot14 : Primitive14.div;
|
|
2162
2170
|
const { tx } = useThemeContext();
|
|
2163
2171
|
const rootRef = useRef3(null);
|
|
2164
2172
|
const focusableGroupAttrs = useFocusableGroup({
|
|
@@ -2178,7 +2186,7 @@ var Group3 = slottable8(({ children, asChild, orientation = "vertical", border =
|
|
|
2178
2186
|
setGroupHasFocus(false);
|
|
2179
2187
|
}
|
|
2180
2188
|
}, []);
|
|
2181
|
-
const { className, ...rest } =
|
|
2189
|
+
const { className, ...rest } = composableProps9(props);
|
|
2182
2190
|
return /* @__PURE__ */ React25.createElement(FocusContext.Provider, {
|
|
2183
2191
|
value: {
|
|
2184
2192
|
setFocus: setState,
|
|
@@ -2200,7 +2208,7 @@ var Group3 = slottable8(({ children, asChild, orientation = "vertical", border =
|
|
|
2200
2208
|
}, children));
|
|
2201
2209
|
});
|
|
2202
2210
|
var Item4 = slottable8(({ children, asChild, current, border = false, onCurrentChange, onClick, onFocus, onBlur, ...props }, forwardedRef) => {
|
|
2203
|
-
const Comp = asChild ?
|
|
2211
|
+
const Comp = asChild ? Slot14 : Primitive14.div;
|
|
2204
2212
|
const { tx } = useThemeContext();
|
|
2205
2213
|
const focusableGroupAttrs = useFocusableGroup({
|
|
2206
2214
|
ignoreDefaultKeydown: {
|
|
@@ -2235,7 +2243,7 @@ var Item4 = slottable8(({ children, asChild, current, border = false, onCurrentC
|
|
|
2235
2243
|
onBlur
|
|
2236
2244
|
]);
|
|
2237
2245
|
const isCurrent = current ?? focused;
|
|
2238
|
-
const { className, ...rest } =
|
|
2246
|
+
const { className, ...rest } = composableProps9(props);
|
|
2239
2247
|
return /* @__PURE__ */ React25.createElement(Comp, {
|
|
2240
2248
|
...rest,
|
|
2241
2249
|
tabIndex: 0,
|
|
@@ -2325,11 +2333,11 @@ var PinInput = /* @__PURE__ */ forwardRef16(({ classNames, density: propsDensity
|
|
|
2325
2333
|
ref: forwardedRef
|
|
2326
2334
|
});
|
|
2327
2335
|
});
|
|
2328
|
-
var TextInput = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density:
|
|
2336
|
+
var TextInput = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density: densityProp, elevation: elevationProp, variant, noAutoFill, ...props }, forwardedRef) => {
|
|
2329
2337
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2330
2338
|
const { tx } = useThemeContext();
|
|
2331
|
-
const density = useDensityContext(
|
|
2332
|
-
const elevation = useElevationContext(
|
|
2339
|
+
const density = useDensityContext(densityProp);
|
|
2340
|
+
const elevation = useElevationContext(elevationProp);
|
|
2333
2341
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2334
2342
|
return /* @__PURE__ */ React26.createElement(TextInputPrimitive, {
|
|
2335
2343
|
...props,
|
|
@@ -2436,11 +2444,11 @@ var Input = {
|
|
|
2436
2444
|
};
|
|
2437
2445
|
|
|
2438
2446
|
// src/components/List/List.tsx
|
|
2439
|
-
import { Primitive as
|
|
2440
|
-
import { Slot as
|
|
2447
|
+
import { Primitive as Primitive15 } from "@radix-ui/react-primitive";
|
|
2448
|
+
import { Slot as Slot15 } from "@radix-ui/react-slot";
|
|
2441
2449
|
import React28, { forwardRef as forwardRef17 } from "react";
|
|
2442
2450
|
import { LIST_ITEM_NAME, LIST_NAME, ListItemCollapsibleContent, List as ListPrimitive, ListItem as ListPrimitiveItem, ListItemHeading as ListPrimitiveItemHeading, ListItemOpenTrigger as ListPrimitiveItemOpenTrigger, useListContext, useListItemContext } from "@dxos/react-list";
|
|
2443
|
-
import { composable as composable4, composableProps as
|
|
2451
|
+
import { composable as composable4, composableProps as composableProps10 } from "@dxos/ui-theme";
|
|
2444
2452
|
|
|
2445
2453
|
// src/components/List/ListDropIndicator.tsx
|
|
2446
2454
|
import React27 from "react";
|
|
@@ -2484,7 +2492,7 @@ var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineIns
|
|
|
2484
2492
|
var List = composable4(({ children, ...props }, forwardedRef) => {
|
|
2485
2493
|
const { tx } = useThemeContext();
|
|
2486
2494
|
const density = useDensityContext(props.density);
|
|
2487
|
-
const { className, ...rest } =
|
|
2495
|
+
const { className, ...rest } = composableProps10(props);
|
|
2488
2496
|
return /* @__PURE__ */ React28.createElement(DensityProvider, {
|
|
2489
2497
|
density
|
|
2490
2498
|
}, /* @__PURE__ */ React28.createElement(ListPrimitive, {
|
|
@@ -2494,7 +2502,7 @@ var List = composable4(({ children, ...props }, forwardedRef) => {
|
|
|
2494
2502
|
}, children));
|
|
2495
2503
|
});
|
|
2496
2504
|
var ListItemEndcap = /* @__PURE__ */ forwardRef17(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
2497
|
-
const Comp = asChild ?
|
|
2505
|
+
const Comp = asChild ? Slot15 : Primitive15.div;
|
|
2498
2506
|
const density = useDensityContext();
|
|
2499
2507
|
const { tx } = useThemeContext();
|
|
2500
2508
|
return /* @__PURE__ */ React28.createElement(Comp, {
|
|
@@ -2658,11 +2666,11 @@ var TreeItem = {
|
|
|
2658
2666
|
// src/components/List/Treegrid.tsx
|
|
2659
2667
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
2660
2668
|
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
2661
|
-
import { Primitive as
|
|
2662
|
-
import { Slot as
|
|
2669
|
+
import { Primitive as Primitive16 } from "@radix-ui/react-primitive";
|
|
2670
|
+
import { Slot as Slot16 } from "@radix-ui/react-slot";
|
|
2663
2671
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
2664
2672
|
import React31, { forwardRef as forwardRef19, useCallback as useCallback7 } from "react";
|
|
2665
|
-
import { composable as composable5, composableProps as
|
|
2673
|
+
import { composable as composable5, composableProps as composableProps11 } from "@dxos/ui-theme";
|
|
2666
2674
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2667
2675
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
2668
2676
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
@@ -2670,10 +2678,10 @@ var TREEGRID_PATH_SEPARATOR = "~";
|
|
|
2670
2678
|
var TREEGRID_PARENT_OF_SEPARATOR = " ";
|
|
2671
2679
|
var TreegridRoot = composable5(({ asChild, classNames, children, style, gridTemplateColumns, onKeyDown: onKeyDownProp, ...props }, forwardedRef) => {
|
|
2672
2680
|
const { tx } = useThemeContext();
|
|
2673
|
-
const { className, role: _role, ...rest } =
|
|
2681
|
+
const { className, role: _role, ...rest } = composableProps11(props, {
|
|
2674
2682
|
classNames
|
|
2675
2683
|
});
|
|
2676
|
-
const Comp = asChild ?
|
|
2684
|
+
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
2677
2685
|
const { findFirstFocusable } = useFocusFinders();
|
|
2678
2686
|
const handleKeyDown = useCallback7((event) => {
|
|
2679
2687
|
switch (event.key) {
|
|
@@ -2723,7 +2731,7 @@ var TreegridRoot = composable5(({ asChild, classNames, children, style, gridTemp
|
|
|
2723
2731
|
});
|
|
2724
2732
|
var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
2725
2733
|
const { tx } = useThemeContext();
|
|
2726
|
-
const Comp = asChild ?
|
|
2734
|
+
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
2727
2735
|
const pathParts = id.split(TREEGRID_PATH_SEPARATOR);
|
|
2728
2736
|
const level = pathParts.length - 1;
|
|
2729
2737
|
const [open, onOpenChange] = useControllableState3({
|
|
@@ -2771,8 +2779,8 @@ var Treegrid = {
|
|
|
2771
2779
|
import { useFocusableGroup as useFocusableGroup2 } from "@fluentui/react-tabster";
|
|
2772
2780
|
import { createContext as createContext8 } from "@radix-ui/react-context";
|
|
2773
2781
|
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
2774
|
-
import { Primitive as
|
|
2775
|
-
import { Slot as
|
|
2782
|
+
import { Primitive as Primitive17 } from "@radix-ui/react-primitive";
|
|
2783
|
+
import { Slot as Slot17 } from "@radix-ui/react-slot";
|
|
2776
2784
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2777
2785
|
import React32, { forwardRef as forwardRef20, useCallback as useCallback9, useEffect as useEffect5, useRef as useRef4, useState as useState8 } from "react";
|
|
2778
2786
|
import { addEventListener } from "@dxos/async";
|
|
@@ -2914,21 +2922,11 @@ var [MainProvider, useMainContext] = createContext8(MAIN_NAME, {
|
|
|
2914
2922
|
resizing: false,
|
|
2915
2923
|
navigationSidebarState: "closed",
|
|
2916
2924
|
setNavigationSidebarState: (_nextState) => {
|
|
2917
|
-
log.warn("Not initialized", void 0, {
|
|
2918
|
-
F: __dxlog_file,
|
|
2919
|
-
L: 110,
|
|
2920
|
-
S: void 0,
|
|
2921
|
-
C: (f, a) => f(...a)
|
|
2922
|
-
});
|
|
2925
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 67, S: void 0 });
|
|
2923
2926
|
},
|
|
2924
2927
|
complementarySidebarState: "closed",
|
|
2925
2928
|
setComplementarySidebarState: (_nextState) => {
|
|
2926
|
-
log.warn("Not initialized", void 0, {
|
|
2927
|
-
F: __dxlog_file,
|
|
2928
|
-
L: 115,
|
|
2929
|
-
S: void 0,
|
|
2930
|
-
C: (f, a) => f(...a)
|
|
2931
|
-
});
|
|
2929
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 71, S: void 0 });
|
|
2932
2930
|
}
|
|
2933
2931
|
});
|
|
2934
2932
|
var useSidebars = (consumerName) => {
|
|
@@ -3029,7 +3027,7 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
3029
3027
|
}, [
|
|
3030
3028
|
props.onKeyDown
|
|
3031
3029
|
]);
|
|
3032
|
-
const Root14 = isLg ?
|
|
3030
|
+
const Root14 = isLg ? Primitive17.div : DialogContent2;
|
|
3033
3031
|
return /* @__PURE__ */ React32.createElement(DialogRoot2, {
|
|
3034
3032
|
open: state !== "closed",
|
|
3035
3033
|
"aria-label": toLocalizedString(label, t),
|
|
@@ -3085,7 +3083,7 @@ MainComplementarySidebar.displayName = COMPLEMENTARY_SIDEBAR_NAME;
|
|
|
3085
3083
|
var MainContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
3086
3084
|
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
3087
3085
|
const { tx } = useThemeContext();
|
|
3088
|
-
const Comp = asChild ?
|
|
3086
|
+
const Comp = asChild ? Slot17 : role ? Primitive17.div : "main";
|
|
3089
3087
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
3090
3088
|
return /* @__PURE__ */ React32.createElement(Comp, {
|
|
3091
3089
|
...handlesFocus && {
|
|
@@ -3114,10 +3112,12 @@ var Main = {
|
|
|
3114
3112
|
|
|
3115
3113
|
// src/components/Message/Message.tsx
|
|
3116
3114
|
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
3117
|
-
import { Primitive as
|
|
3118
|
-
import { Slot as
|
|
3115
|
+
import { Primitive as Primitive18 } from "@radix-ui/react-primitive";
|
|
3116
|
+
import { Slot as Slot18 } from "@radix-ui/react-slot";
|
|
3119
3117
|
import React33, { forwardRef as forwardRef21 } from "react";
|
|
3118
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
3120
3119
|
import { useId as useId3 } from "@dxos/react-hooks";
|
|
3120
|
+
import { translationKey as translationKey2 } from "#translations";
|
|
3121
3121
|
var messageIcons = {
|
|
3122
3122
|
success: "ph--check-circle--duotone",
|
|
3123
3123
|
info: "ph--info--duotone",
|
|
@@ -3132,7 +3132,7 @@ var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence = "neutral",
|
|
|
3132
3132
|
const titleId = useId3("message__title", propsTitleId);
|
|
3133
3133
|
const descriptionId = useId3("message__description", propsDescriptionId);
|
|
3134
3134
|
const elevation = useElevationContext(propsElevation);
|
|
3135
|
-
const Comp = asChild ?
|
|
3135
|
+
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
3136
3136
|
return /* @__PURE__ */ React33.createElement(MessageProvider, {
|
|
3137
3137
|
titleId,
|
|
3138
3138
|
descriptionId,
|
|
@@ -3151,31 +3151,39 @@ var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence = "neutral",
|
|
|
3151
3151
|
});
|
|
3152
3152
|
MessageRoot.displayName = MESSAGE_NAME;
|
|
3153
3153
|
var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
3154
|
-
var MessageTitle = /* @__PURE__ */ forwardRef21(({
|
|
3154
|
+
var MessageTitle = /* @__PURE__ */ forwardRef21(({ classNames, children, icon: iconProp, onClose }, forwardedRef) => {
|
|
3155
|
+
const { t } = useTranslation4(translationKey2);
|
|
3155
3156
|
const { tx } = useThemeContext();
|
|
3156
3157
|
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3157
|
-
const Comp = asChild ? Slot17 : Primitive17.h2;
|
|
3158
3158
|
const icon = iconProp ?? messageIcons[valence];
|
|
3159
|
-
return /* @__PURE__ */ React33.createElement(
|
|
3160
|
-
|
|
3159
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
3160
|
+
role: "none",
|
|
3161
3161
|
className: tx("message.header", {}, classNames),
|
|
3162
3162
|
id: titleId,
|
|
3163
3163
|
ref: forwardedRef
|
|
3164
|
-
},
|
|
3165
|
-
|
|
3166
|
-
|
|
3164
|
+
}, icon && /* @__PURE__ */ React33.createElement("div", {
|
|
3165
|
+
role: "none",
|
|
3166
|
+
className: tx("message.icon", {
|
|
3167
3167
|
valence
|
|
3168
3168
|
})
|
|
3169
|
-
}
|
|
3169
|
+
}, /* @__PURE__ */ React33.createElement(Icon, {
|
|
3170
|
+
icon
|
|
3171
|
+
})), /* @__PURE__ */ React33.createElement("h2", {
|
|
3170
3172
|
className: tx("message.title", {}, classNames)
|
|
3171
|
-
}, children)
|
|
3173
|
+
}, children), onClose && /* @__PURE__ */ React33.createElement(IconButton, {
|
|
3174
|
+
variant: "ghost",
|
|
3175
|
+
icon: "ph--x--regular",
|
|
3176
|
+
iconOnly: true,
|
|
3177
|
+
label: t("toolbar-close.label"),
|
|
3178
|
+
onClick: onClose
|
|
3179
|
+
}));
|
|
3172
3180
|
});
|
|
3173
3181
|
MessageTitle.displayName = MESSAGE_TITLE_NAME;
|
|
3174
3182
|
var MESSAGE_CONTENT_NAME = "MessageContent";
|
|
3175
3183
|
var MessageContent = /* @__PURE__ */ forwardRef21(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
3176
3184
|
const { tx } = useThemeContext();
|
|
3177
3185
|
const { descriptionId } = useMessageContext(MESSAGE_CONTENT_NAME);
|
|
3178
|
-
const Comp = asChild ?
|
|
3186
|
+
const Comp = asChild ? Slot18 : Primitive18.p;
|
|
3179
3187
|
return /* @__PURE__ */ React33.createElement(Comp, {
|
|
3180
3188
|
...props,
|
|
3181
3189
|
className: tx("message.content", {}, classNames),
|
|
@@ -3203,8 +3211,8 @@ import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
|
3203
3211
|
import { createPopperScope } from "@radix-ui/react-popper";
|
|
3204
3212
|
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
|
3205
3213
|
import { Presence } from "@radix-ui/react-presence";
|
|
3206
|
-
import { Primitive as
|
|
3207
|
-
import { Slot as
|
|
3214
|
+
import { Primitive as Primitive19 } from "@radix-ui/react-primitive";
|
|
3215
|
+
import { Slot as Slot19 } from "@radix-ui/react-slot";
|
|
3208
3216
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
3209
3217
|
import { hideOthers } from "aria-hidden";
|
|
3210
3218
|
import React34, { forwardRef as forwardRef22, useCallback as useCallback10, useEffect as useEffect6, useMemo as useMemo5, useRef as useRef5, useState as useState9 } from "react";
|
|
@@ -3267,7 +3275,7 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3267
3275
|
const context = usePopoverContext(TRIGGER_NAME2, __scopePopover);
|
|
3268
3276
|
const popperScope = usePopperScope(__scopePopover);
|
|
3269
3277
|
const composedTriggerRef = useComposedRefs2(forwardedRef, context.triggerRef);
|
|
3270
|
-
const Comp = asChild ?
|
|
3278
|
+
const Comp = asChild ? Slot19 : Primitive19.button;
|
|
3271
3279
|
const trigger = /* @__PURE__ */ React34.createElement(Comp, {
|
|
3272
3280
|
type: "button",
|
|
3273
3281
|
"aria-haspopup": "dialog",
|
|
@@ -3346,7 +3354,7 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) =>
|
|
|
3346
3354
|
}
|
|
3347
3355
|
}, []);
|
|
3348
3356
|
return /* @__PURE__ */ React34.createElement(RemoveScroll, {
|
|
3349
|
-
as:
|
|
3357
|
+
as: Slot19,
|
|
3350
3358
|
allowPinchZoom: true
|
|
3351
3359
|
}, /* @__PURE__ */ React34.createElement(PopoverContentImpl, {
|
|
3352
3360
|
...props,
|
|
@@ -3481,7 +3489,7 @@ var CLOSE_NAME = "PopoverClose";
|
|
|
3481
3489
|
var PopoverClose = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3482
3490
|
const { __scopePopover, ...closeProps } = props;
|
|
3483
3491
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
3484
|
-
return /* @__PURE__ */ React34.createElement(
|
|
3492
|
+
return /* @__PURE__ */ React34.createElement(Primitive19.button, {
|
|
3485
3493
|
type: "button",
|
|
3486
3494
|
...closeProps,
|
|
3487
3495
|
ref: forwardedRef,
|
|
@@ -3504,7 +3512,7 @@ var PopoverArrow = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3504
3512
|
PopoverArrow.displayName = ARROW_NAME2;
|
|
3505
3513
|
var PopoverViewport = /* @__PURE__ */ forwardRef22(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
3506
3514
|
const { tx } = useThemeContext();
|
|
3507
|
-
const Comp = asChild ?
|
|
3515
|
+
const Comp = asChild ? Slot19 : Primitive19.div;
|
|
3508
3516
|
return /* @__PURE__ */ React34.createElement(Comp, {
|
|
3509
3517
|
...props,
|
|
3510
3518
|
className: tx("popover.viewport", {
|
|
@@ -3555,17 +3563,17 @@ var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0,
|
|
|
3555
3563
|
|
|
3556
3564
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
3557
3565
|
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
3558
|
-
import { Primitive as
|
|
3559
|
-
import { Slot as
|
|
3566
|
+
import { Primitive as Primitive20 } from "@radix-ui/react-primitive";
|
|
3567
|
+
import { Slot as Slot20 } from "@radix-ui/react-slot";
|
|
3560
3568
|
import React36, { useMemo as useMemo6 } from "react";
|
|
3561
|
-
import { composableProps as
|
|
3569
|
+
import { composableProps as composableProps12, scrollbar, slottable as slottable9 } from "@dxos/ui-theme";
|
|
3562
3570
|
var SCROLLAREA_NAME = "ScrollArea";
|
|
3563
3571
|
var [ScrollAreaProvider, useScrollAreaContext] = createContext10(SCROLLAREA_NAME);
|
|
3564
3572
|
var SCROLLAREA_ROOT_NAME = "ScrollArea.Root";
|
|
3565
3573
|
var ScrollAreaRoot = slottable9(({ children, asChild, orientation = "vertical", autoHide = true, centered = false, padding = false, thin = false, snap = false, ...props }, forwardedRef) => {
|
|
3566
3574
|
const { tx } = useThemeContext();
|
|
3567
|
-
const { className, ...rest } =
|
|
3568
|
-
const Comp = asChild ?
|
|
3575
|
+
const { className, ...rest } = composableProps12(props);
|
|
3576
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3569
3577
|
const options = useMemo6(() => ({
|
|
3570
3578
|
orientation,
|
|
3571
3579
|
autoHide,
|
|
@@ -3593,9 +3601,9 @@ var ScrollAreaViewport = slottable9(({ children, asChild, ...props }, forwardedR
|
|
|
3593
3601
|
const { tx } = useThemeContext();
|
|
3594
3602
|
const options = useScrollAreaContext(SCROLLAREA_VIEWPORT_NAME);
|
|
3595
3603
|
const density = options.thin ? scrollbar.thin : scrollbar.coarse;
|
|
3596
|
-
const { className, ...rest } =
|
|
3604
|
+
const { className, ...rest } = composableProps12(props);
|
|
3597
3605
|
const { style, ...restWithoutStyle } = rest;
|
|
3598
|
-
const Comp = asChild ?
|
|
3606
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3599
3607
|
return /* @__PURE__ */ React36.createElement(Comp, {
|
|
3600
3608
|
...restWithoutStyle,
|
|
3601
3609
|
style: {
|
|
@@ -3619,7 +3627,7 @@ import React37, { forwardRef as forwardRef24, useCallback as useCallback11, useE
|
|
|
3619
3627
|
import { addEventListener as addEventListener2, combine } from "@dxos/async";
|
|
3620
3628
|
import { invariant } from "@dxos/invariant";
|
|
3621
3629
|
import { useMergeRefs } from "@dxos/react-hooks";
|
|
3622
|
-
import { composable as composable6, composableProps as
|
|
3630
|
+
import { composable as composable6, composableProps as composableProps13, slottable as slottable10 } from "@dxos/ui-theme";
|
|
3623
3631
|
import { mx as mx9 } from "@dxos/ui-theme";
|
|
3624
3632
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui/src/components/ScrollContainer/ScrollContainer.tsx";
|
|
3625
3633
|
var isBottom = (el) => {
|
|
@@ -3657,15 +3665,7 @@ var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorPr
|
|
|
3657
3665
|
return scrollerRef.current;
|
|
3658
3666
|
},
|
|
3659
3667
|
scrollToTop: () => {
|
|
3660
|
-
invariant(scrollerRef.current, void 0, {
|
|
3661
|
-
F: __dxlog_file2,
|
|
3662
|
-
L: 108,
|
|
3663
|
-
S: void 0,
|
|
3664
|
-
A: [
|
|
3665
|
-
"scrollerRef.current",
|
|
3666
|
-
""
|
|
3667
|
-
]
|
|
3668
|
-
});
|
|
3668
|
+
invariant(scrollerRef.current, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 54, S: void 0, A: ["scrollerRef.current", ""] });
|
|
3669
3669
|
scrollerRef.current.scrollTo({
|
|
3670
3670
|
top: 0,
|
|
3671
3671
|
behavior: "smooth"
|
|
@@ -3696,7 +3696,7 @@ var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorPr
|
|
|
3696
3696
|
Root10.displayName = "ScrollContainer.Root";
|
|
3697
3697
|
var Content6 = composable6(({ children, thin, padding, centered, ...props }, forwardedRef) => {
|
|
3698
3698
|
return /* @__PURE__ */ React37.createElement(ScrollArea.Root, {
|
|
3699
|
-
...
|
|
3699
|
+
...composableProps13(props, {
|
|
3700
3700
|
classNames: "relative"
|
|
3701
3701
|
}),
|
|
3702
3702
|
thin,
|
|
@@ -3728,7 +3728,7 @@ var Viewport = slottable10(({ children, asChild, ...props }, forwardedRef) => {
|
|
|
3728
3728
|
]);
|
|
3729
3729
|
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(ScrollArea.Viewport, {
|
|
3730
3730
|
asChild,
|
|
3731
|
-
...
|
|
3731
|
+
...composableProps13(props),
|
|
3732
3732
|
ref: mergedRef
|
|
3733
3733
|
}, children), /* @__PURE__ */ React37.createElement(PinEffect, {
|
|
3734
3734
|
scrollerRef
|
|
@@ -3962,10 +3962,10 @@ var Skeleton = /* @__PURE__ */ forwardRef26(({ classNames, variant = "default",
|
|
|
3962
3962
|
|
|
3963
3963
|
// src/components/Splitter/Splitter.tsx
|
|
3964
3964
|
import { createContextScope as createContextScope4 } from "@radix-ui/react-context";
|
|
3965
|
-
import { Primitive as
|
|
3966
|
-
import { Slot as
|
|
3965
|
+
import { Primitive as Primitive21 } from "@radix-ui/react-primitive";
|
|
3966
|
+
import { Slot as Slot21 } from "@radix-ui/react-slot";
|
|
3967
3967
|
import React40 from "react";
|
|
3968
|
-
import { composableProps as
|
|
3968
|
+
import { composableProps as composableProps14, slottable as slottable11 } from "@dxos/ui-theme";
|
|
3969
3969
|
var SPLITTER_NAME = "Splitter";
|
|
3970
3970
|
var [createSplitterContext, createSplitterScope] = createContextScope4(SPLITTER_NAME);
|
|
3971
3971
|
var [SplitterProvider, useSplitterContext] = createSplitterContext(SPLITTER_NAME);
|
|
@@ -3973,8 +3973,8 @@ var ROOT_NAME = "Splitter.Root";
|
|
|
3973
3973
|
var Root12 = slottable11(({ asChild, mode = "top", ratio = 0.5, transition = 250, children, ...props }, forwardedRef) => {
|
|
3974
3974
|
const { tx } = useThemeContext();
|
|
3975
3975
|
const { __scopeSplitter, ...rest } = props;
|
|
3976
|
-
const { className, ...restProps } =
|
|
3977
|
-
const Comp = asChild ?
|
|
3976
|
+
const { className, ...restProps } = composableProps14(rest);
|
|
3977
|
+
const Comp = asChild ? Slot21 : Primitive21.div;
|
|
3978
3978
|
return /* @__PURE__ */ React40.createElement(SplitterProvider, {
|
|
3979
3979
|
scope: __scopeSplitter,
|
|
3980
3980
|
mode,
|
|
@@ -3991,9 +3991,9 @@ var PANEL_NAME = "Splitter.Panel";
|
|
|
3991
3991
|
var Panel2 = slottable11(({ classNames, asChild, children, position, style, ...props }, forwardedRef) => {
|
|
3992
3992
|
const { tx } = useThemeContext();
|
|
3993
3993
|
const { __scopeSplitter, ...rest } = props;
|
|
3994
|
-
const Comp = asChild ?
|
|
3994
|
+
const Comp = asChild ? Slot21 : Primitive21.div;
|
|
3995
3995
|
const { mode, ratio = 0.5, transition } = useSplitterContext(PANEL_NAME, __scopeSplitter);
|
|
3996
|
-
const { className, ...restProps } =
|
|
3996
|
+
const { className, ...restProps } = composableProps14(rest);
|
|
3997
3997
|
const isTopPanel = position === "top";
|
|
3998
3998
|
const topOffset = isTopPanel ? "0%" : mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%`;
|
|
3999
3999
|
const height = isTopPanel ? mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%` : mode === "bottom" ? "100%" : mode === "top" ? "0%" : `${(1 - ratio) * 100}%`;
|
|
@@ -4016,12 +4016,12 @@ var Splitter = {
|
|
|
4016
4016
|
};
|
|
4017
4017
|
|
|
4018
4018
|
// src/components/Tag/Tag.tsx
|
|
4019
|
-
import { Primitive as
|
|
4020
|
-
import { Slot as
|
|
4019
|
+
import { Primitive as Primitive22 } from "@radix-ui/react-primitive";
|
|
4020
|
+
import { Slot as Slot22 } from "@radix-ui/react-slot";
|
|
4021
4021
|
import React41, { forwardRef as forwardRef27 } from "react";
|
|
4022
4022
|
var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
4023
4023
|
const { tx } = useThemeContext();
|
|
4024
|
-
const Comp = asChild ?
|
|
4024
|
+
const Comp = asChild ? Slot22 : Primitive22.span;
|
|
4025
4025
|
return /* @__PURE__ */ React41.createElement(Comp, {
|
|
4026
4026
|
...props,
|
|
4027
4027
|
className: tx("tag.root", {
|
|
@@ -4033,8 +4033,8 @@ var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNam
|
|
|
4033
4033
|
});
|
|
4034
4034
|
|
|
4035
4035
|
// src/components/Toast/Toast.tsx
|
|
4036
|
-
import { Primitive as
|
|
4037
|
-
import { Slot as
|
|
4036
|
+
import { Primitive as Primitive23 } from "@radix-ui/react-primitive";
|
|
4037
|
+
import { Slot as Slot23 } from "@radix-ui/react-slot";
|
|
4038
4038
|
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
4039
4039
|
import React42, { forwardRef as forwardRef28 } from "react";
|
|
4040
4040
|
var ToastProvider = ToastPrimitive.Provider;
|
|
@@ -4058,7 +4058,7 @@ var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }
|
|
|
4058
4058
|
});
|
|
4059
4059
|
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4060
4060
|
const { tx } = useThemeContext();
|
|
4061
|
-
const Comp = asChild ?
|
|
4061
|
+
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
4062
4062
|
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
4063
4063
|
...props,
|
|
4064
4064
|
className: tx("toast.body", {}, classNames),
|
|
@@ -4067,7 +4067,7 @@ var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props },
|
|
|
4067
4067
|
});
|
|
4068
4068
|
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4069
4069
|
const { tx } = useThemeContext();
|
|
4070
|
-
const Comp = asChild ?
|
|
4070
|
+
const Comp = asChild ? Slot23 : ToastPrimitive.Title;
|
|
4071
4071
|
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
4072
4072
|
...props,
|
|
4073
4073
|
className: tx("toast.title", {}, classNames),
|
|
@@ -4076,7 +4076,7 @@ var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }
|
|
|
4076
4076
|
});
|
|
4077
4077
|
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4078
4078
|
const { tx } = useThemeContext();
|
|
4079
|
-
const Comp = asChild ?
|
|
4079
|
+
const Comp = asChild ? Slot23 : ToastPrimitive.Description;
|
|
4080
4080
|
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
4081
4081
|
...props,
|
|
4082
4082
|
className: tx("toast.description", {}, classNames),
|
|
@@ -4085,7 +4085,7 @@ var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...p
|
|
|
4085
4085
|
});
|
|
4086
4086
|
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4087
4087
|
const { tx } = useThemeContext();
|
|
4088
|
-
const Comp = asChild ?
|
|
4088
|
+
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
4089
4089
|
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
4090
4090
|
...props,
|
|
4091
4091
|
className: tx("toast.actions", {}, classNames),
|