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