@dxos/react-ui 0.8.4-main.67995b8 → 0.8.4-main.70d3990
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-2COVUP44.mjs → chunk-N5GDJTT2.mjs} +651 -317
- package/dist/lib/browser/chunk-N5GDJTT2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +12 -1
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +57 -29
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-GHXHND5V.mjs → chunk-SP7VQH72.mjs} +651 -317
- package/dist/lib/node-esm/chunk-SP7VQH72.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +12 -1
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +57 -29
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/components/Avatars/Avatar.d.ts +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +5 -31
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +5 -11
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts +8 -20
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/{Buttons → Button}/Button.d.ts +1 -1
- package/dist/types/src/components/Button/Button.d.ts.map +1 -0
- package/dist/types/src/components/Button/Button.stories.d.ts +17 -0
- package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/IconButton.d.ts +2 -3
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts +13 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/Button/Toggle.d.ts.map +1 -0
- package/dist/types/src/components/Button/Toggle.stories.d.ts +16 -0
- package/dist/types/src/components/Button/Toggle.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/ToggleGroup.d.ts +7 -8
- package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -0
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts +27 -0
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts.map +1 -0
- package/dist/types/src/components/Button/index.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/{Dialogs → Dialog}/AlertDialog.d.ts +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts +11 -0
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Dialogs → Dialog}/Dialog.d.ts +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts +25 -0
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/index.d.ts.map +1 -0
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +17 -0
- package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -0
- package/dist/types/src/components/Input/Input.d.ts +2 -4
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +10 -11
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Link/Link.stories.d.ts +8 -8
- package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/src/components/{Lists → List}/List.d.ts +2 -2
- package/dist/types/src/components/List/List.d.ts.map +1 -0
- package/dist/types/src/components/List/List.stories.d.ts +14 -0
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/ListDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/{Lists → List}/Tree.d.ts +1 -1
- package/dist/types/src/components/List/Tree.d.ts.map +1 -0
- package/dist/types/src/components/List/Tree.stories.d.ts +15 -0
- package/dist/types/src/components/List/Tree.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/TreeDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/{Lists → List}/Treegrid.d.ts +1 -1
- package/dist/types/src/components/{Lists → List}/Treegrid.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.stories.d.ts +12 -0
- package/dist/types/src/components/List/Treegrid.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/index.d.ts.map +1 -0
- package/dist/types/src/components/Main/Main.d.ts +10 -19
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +6 -7
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menus/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts +6 -44
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +8 -8
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts +6 -41
- package/dist/types/src/components/Menus/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 +7 -16
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +2 -2
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +6 -34
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +6 -32
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +37 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +18 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/ScrollContainer/index.d.ts +2 -0
- package/dist/types/src/components/ScrollContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/Select/Select.d.ts +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts +4 -9
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts +2 -8
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts +12 -12
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts +6 -44
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +12 -12
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +6 -50
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +2 -4
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +8 -61
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeArea.d.ts.map +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts +2 -2
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts +5 -9
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +12 -4
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Typography.stories.d.ts +5 -11
- package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/index.d.ts +2 -1
- package/dist/types/src/testing/decorators/index.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayout.d.ts +15 -0
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/{withSurfaceVariantsLayout.d.ts → withLayoutVariants.d.ts} +2 -2
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/withTheme.d.ts +3 -0
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/util/domino.d.ts +18 -0
- package/dist/types/src/util/domino.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +2 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/usePx.d.ts +8 -0
- package/dist/types/src/util/usePx.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -27
- package/src/components/Avatars/Avatar.stories.tsx +19 -10
- package/src/components/Avatars/Avatar.tsx +3 -3
- package/src/components/Avatars/AvatarGroup.stories.tsx +10 -6
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +17 -12
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
- package/src/components/{Buttons → Button}/Button.stories.tsx +8 -9
- package/src/components/{Buttons → Button}/IconButton.stories.tsx +11 -8
- package/src/components/{Buttons → Button}/IconButton.tsx +16 -14
- package/src/components/{Buttons → Button}/Toggle.stories.tsx +13 -9
- package/src/components/{Buttons → Button}/ToggleGroup.stories.tsx +10 -7
- package/src/components/{Buttons → Button}/ToggleGroup.tsx +17 -4
- package/src/components/Clipboard/ClipboardProvider.tsx +1 -1
- package/src/components/Clipboard/CopyButton.tsx +3 -2
- package/src/components/DensityProvider/DensityProvider.tsx +1 -1
- package/src/components/{Dialogs → Dialog}/AlertDialog.stories.tsx +15 -12
- package/src/components/{Dialogs → Dialog}/AlertDialog.tsx +13 -13
- package/src/components/{Dialogs → Dialog}/Dialog.stories.tsx +17 -15
- package/src/components/{Dialogs → Dialog}/Dialog.tsx +13 -13
- package/src/components/ElevationProvider/ElevationProvider.tsx +1 -1
- package/src/components/Icon/Icon.stories.tsx +113 -0
- package/src/components/Icon/Icon.tsx +1 -1
- package/src/components/Input/Input.stories.tsx +12 -14
- package/src/components/Input/Input.tsx +16 -16
- package/src/components/Link/Link.stories.tsx +10 -6
- package/src/components/{Lists → List}/List.stories.tsx +16 -14
- package/src/components/{Lists → List}/List.tsx +16 -12
- package/src/components/{Lists → List}/ListDropIndicator.tsx +1 -1
- package/src/components/{Lists → List}/Tree.stories.tsx +11 -8
- package/src/components/{Lists → List}/Tree.tsx +4 -3
- package/src/components/{Lists → List}/TreeDropIndicator.tsx +1 -1
- package/src/components/{Lists → List}/Treegrid.stories.tsx +12 -6
- package/src/components/{Lists → List}/Treegrid.tsx +58 -17
- package/src/components/Main/Main.stories.tsx +17 -9
- package/src/components/Main/Main.tsx +43 -28
- package/src/components/Menus/ContextMenu.stories.tsx +11 -8
- package/src/components/Menus/ContextMenu.tsx +1 -0
- package/src/components/Menus/DropdownMenu.stories.tsx +12 -9
- package/src/components/Menus/DropdownMenu.tsx +45 -16
- package/src/components/Message/Message.stories.tsx +11 -7
- package/src/components/Message/Message.tsx +1 -1
- package/src/components/Popover/Popover.stories.tsx +12 -9
- package/src/components/Popover/Popover.tsx +29 -12
- package/src/components/ScrollArea/ScrollArea.stories.tsx +12 -9
- package/src/components/ScrollArea/ScrollArea.tsx +4 -4
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +69 -0
- package/src/components/ScrollContainer/ScrollContainer.tsx +231 -0
- package/src/components/ScrollContainer/index.ts +5 -0
- package/src/components/Select/Select.stories.tsx +15 -12
- package/src/components/Select/Select.tsx +9 -8
- package/src/components/Status/Status.stories.tsx +9 -6
- package/src/components/Tag/Tag.stories.tsx +18 -9
- package/src/components/ThemeProvider/ThemeProvider.tsx +3 -2
- package/src/components/ThemeProvider/TranslationsProvider.tsx +3 -3
- package/src/components/Toast/Toast.stories.tsx +12 -9
- package/src/components/Toast/Toast.tsx +9 -9
- package/src/components/Toolbar/Toolbar.stories.tsx +14 -12
- package/src/components/Toolbar/Toolbar.tsx +20 -8
- package/src/components/Tooltip/Tooltip.stories.tsx +16 -12
- package/src/components/Tooltip/Tooltip.tsx +5 -4
- package/src/components/index.ts +4 -3
- package/src/hooks/useSafeArea.ts +3 -2
- package/src/hooks/useVisualViewport.ts +4 -4
- package/src/index.ts +1 -1
- package/src/playground/Controls.stories.tsx +12 -8
- package/src/playground/Custom.stories.tsx +13 -24
- package/src/playground/Typography.stories.tsx +8 -6
- package/src/testing/decorators/index.ts +2 -1
- package/src/testing/decorators/withLayout.tsx +56 -0
- package/src/testing/decorators/{withSurfaceVariantsLayout.tsx → withLayoutVariants.tsx} +2 -2
- package/src/testing/decorators/withTheme.tsx +31 -0
- package/src/util/domino.ts +53 -0
- package/src/util/index.ts +2 -0
- package/src/util/usePx.ts +61 -0
- package/dist/lib/browser/chunk-2COVUP44.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GHXHND5V.mjs.map +0 -7
- package/dist/types/src/components/Buttons/Button.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts +0 -12
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts +0 -22
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Toggle.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts +0 -19
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +0 -39
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/index.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +0 -43
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +0 -48
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/index.d.ts.map +0 -1
- package/dist/types/src/components/Lists/List.d.ts.map +0 -1
- package/dist/types/src/components/Lists/List.stories.d.ts +0 -37
- package/dist/types/src/components/Lists/List.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Tree.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Tree.stories.d.ts +0 -41
- package/dist/types/src/components/Lists/Tree.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts +0 -10
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/index.d.ts.map +0 -1
- package/dist/types/src/testing/decorators/withSurfaceVariantsLayout.d.ts.map +0 -1
- package/src/testing/decorators/withTheme.ts +0 -25
- /package/dist/types/src/components/{Buttons → Button}/Toggle.d.ts +0 -0
- /package/dist/types/src/components/{Buttons → Button}/index.d.ts +0 -0
- /package/dist/types/src/components/{Dialogs → Dialog}/index.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/ListDropIndicator.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/TreeDropIndicator.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/index.d.ts +0 -0
- /package/src/components/{Buttons → Button}/Button.tsx +0 -0
- /package/src/components/{Buttons → Button}/Toggle.tsx +0 -0
- /package/src/components/{Buttons → Button}/index.ts +0 -0
- /package/src/components/{Dialogs → Dialog}/index.ts +0 -0
- /package/src/components/{Lists → List}/index.ts +0 -0
|
@@ -31,7 +31,7 @@ var useIconHref = (icon) => {
|
|
|
31
31
|
|
|
32
32
|
// src/hooks/useSafeArea.ts
|
|
33
33
|
import { useCallback, useState } from "react";
|
|
34
|
-
import {
|
|
34
|
+
import { useViewportResize } from "@dxos/react-hooks";
|
|
35
35
|
var initialSafeArea = {
|
|
36
36
|
top: NaN,
|
|
37
37
|
right: NaN,
|
|
@@ -48,7 +48,7 @@ var useSafeArea = () => {
|
|
|
48
48
|
left: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-left"))
|
|
49
49
|
});
|
|
50
50
|
}, []);
|
|
51
|
-
|
|
51
|
+
useViewportResize(handleResize);
|
|
52
52
|
return padding;
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -59,7 +59,7 @@ import { useContext as useContext4 } from "react";
|
|
|
59
59
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
60
60
|
import { enUS as dtLocaleEnUs } from "date-fns/locale";
|
|
61
61
|
import i18Next from "i18next";
|
|
62
|
-
import React, {
|
|
62
|
+
import React, { Suspense, createContext, useContext as useContext3, useEffect, useState as useState2 } from "react";
|
|
63
63
|
import { initReactI18next, useTranslation as useI18NextTranslation } from "react-i18next";
|
|
64
64
|
var initialLng = "en-US";
|
|
65
65
|
var initialNs = "dxos-common";
|
|
@@ -130,7 +130,7 @@ var useTranslationsContext = () => useContext4(TranslationsContext);
|
|
|
130
130
|
|
|
131
131
|
// src/hooks/useVisualViewport.ts
|
|
132
132
|
import { useCallback as useCallback2, useState as useState3 } from "react";
|
|
133
|
-
import {
|
|
133
|
+
import { useViewportResize as useViewportResize2 } from "@dxos/react-hooks";
|
|
134
134
|
var useVisualViewport = (deps) => {
|
|
135
135
|
const [width, setWidth] = useState3(null);
|
|
136
136
|
const [height, setHeight] = useState3(null);
|
|
@@ -140,7 +140,7 @@ var useVisualViewport = (deps) => {
|
|
|
140
140
|
setHeight(window.visualViewport.height);
|
|
141
141
|
}
|
|
142
142
|
}, []);
|
|
143
|
-
|
|
143
|
+
useViewportResize2(handleResize, deps);
|
|
144
144
|
return {
|
|
145
145
|
width,
|
|
146
146
|
height
|
|
@@ -152,8 +152,8 @@ var AnchoredOverflowRoot = /* @__PURE__ */ forwardRef(({ asChild, classNames, ch
|
|
|
152
152
|
var _effect = _useSignals2();
|
|
153
153
|
try {
|
|
154
154
|
const { tx } = useThemeContext();
|
|
155
|
-
const
|
|
156
|
-
return /* @__PURE__ */ React2.createElement(
|
|
155
|
+
const Root8 = asChild ? Slot : Primitive.div;
|
|
156
|
+
return /* @__PURE__ */ React2.createElement(Root8, {
|
|
157
157
|
role: "none",
|
|
158
158
|
...props,
|
|
159
159
|
className: tx("anchoredOverflow.root", "overflow-anchored", {}, classNames),
|
|
@@ -167,8 +167,8 @@ var AnchoredOverflowAnchor = /* @__PURE__ */ forwardRef(({ asChild, classNames,
|
|
|
167
167
|
var _effect = _useSignals2();
|
|
168
168
|
try {
|
|
169
169
|
const { tx } = useThemeContext();
|
|
170
|
-
const
|
|
171
|
-
return /* @__PURE__ */ React2.createElement(
|
|
170
|
+
const Root8 = asChild ? Slot : Primitive.div;
|
|
171
|
+
return /* @__PURE__ */ React2.createElement(Root8, {
|
|
172
172
|
role: "none",
|
|
173
173
|
...props,
|
|
174
174
|
className: tx("anchoredOverflow.anchor", "overflow-anchor", {}, classNames),
|
|
@@ -228,10 +228,10 @@ var AvatarContent = /* @__PURE__ */ forwardRef2(({ icon, classNames, ...props },
|
|
|
228
228
|
var AvatarLabel = /* @__PURE__ */ forwardRef2(({ asChild, srOnly, classNames, ...props }, forwardedRef) => {
|
|
229
229
|
var _effect = _useSignals3();
|
|
230
230
|
try {
|
|
231
|
-
const
|
|
231
|
+
const Root8 = asChild ? Slot2 : Primitive2.span;
|
|
232
232
|
const { tx } = useThemeContext();
|
|
233
233
|
const { labelId } = useAvatarContext("AvatarLabel");
|
|
234
|
-
return /* @__PURE__ */ React3.createElement(
|
|
234
|
+
return /* @__PURE__ */ React3.createElement(Root8, {
|
|
235
235
|
...props,
|
|
236
236
|
id: labelId,
|
|
237
237
|
ref: forwardedRef,
|
|
@@ -246,10 +246,10 @@ var AvatarLabel = /* @__PURE__ */ forwardRef2(({ asChild, srOnly, classNames, ..
|
|
|
246
246
|
var AvatarDescription = /* @__PURE__ */ forwardRef2(({ asChild, srOnly, classNames, ...props }, forwardedRef) => {
|
|
247
247
|
var _effect = _useSignals3();
|
|
248
248
|
try {
|
|
249
|
-
const
|
|
249
|
+
const Root8 = asChild ? Slot2 : Primitive2.span;
|
|
250
250
|
const { tx } = useThemeContext();
|
|
251
251
|
const { descriptionId } = useAvatarContext("AvatarDescription");
|
|
252
|
-
return /* @__PURE__ */ React3.createElement(
|
|
252
|
+
return /* @__PURE__ */ React3.createElement(Root8, {
|
|
253
253
|
...props,
|
|
254
254
|
id: descriptionId,
|
|
255
255
|
ref: forwardedRef,
|
|
@@ -277,7 +277,7 @@ import React6, { forwardRef as forwardRef5 } from "react";
|
|
|
277
277
|
// src/components/Icon/Icon.tsx
|
|
278
278
|
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
279
279
|
import React4, { forwardRef as forwardRef3, memo } from "react";
|
|
280
|
-
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef3(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
280
|
+
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef3(({ icon, classNames, size = 4, ...props }, forwardedRef) => {
|
|
281
281
|
var _effect = _useSignals4();
|
|
282
282
|
try {
|
|
283
283
|
const { tx } = useThemeContext();
|
|
@@ -305,8 +305,8 @@ var Link = /* @__PURE__ */ forwardRef4(({ asChild, variant, classNames, ...props
|
|
|
305
305
|
var _effect = _useSignals5();
|
|
306
306
|
try {
|
|
307
307
|
const { tx } = useThemeContext();
|
|
308
|
-
const
|
|
309
|
-
return /* @__PURE__ */ React5.createElement(
|
|
308
|
+
const Root8 = asChild ? Slot3 : Primitive3.a;
|
|
309
|
+
return /* @__PURE__ */ React5.createElement(Root8, {
|
|
310
310
|
...props,
|
|
311
311
|
className: tx("link.root", "link", {
|
|
312
312
|
variant
|
|
@@ -323,8 +323,8 @@ var BreadcrumbRoot = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...prop
|
|
|
323
323
|
var _effect = _useSignals6();
|
|
324
324
|
try {
|
|
325
325
|
const { tx } = useThemeContext();
|
|
326
|
-
const
|
|
327
|
-
return /* @__PURE__ */ React6.createElement(
|
|
326
|
+
const Root8 = asChild ? Slot4 : Primitive4.div;
|
|
327
|
+
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
328
328
|
role: "navigation",
|
|
329
329
|
...props,
|
|
330
330
|
className: tx("breadcrumb.root", "breadcrumb", {}, classNames),
|
|
@@ -338,8 +338,8 @@ var BreadcrumbList = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...prop
|
|
|
338
338
|
var _effect = _useSignals6();
|
|
339
339
|
try {
|
|
340
340
|
const { tx } = useThemeContext();
|
|
341
|
-
const
|
|
342
|
-
return /* @__PURE__ */ React6.createElement(
|
|
341
|
+
const Root8 = asChild ? Slot4 : Primitive4.ol;
|
|
342
|
+
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
343
343
|
role: "list",
|
|
344
344
|
...props,
|
|
345
345
|
className: tx("breadcrumb.list", "breadcrumb__list", {}, classNames),
|
|
@@ -353,8 +353,8 @@ var BreadcrumbListItem = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...
|
|
|
353
353
|
var _effect = _useSignals6();
|
|
354
354
|
try {
|
|
355
355
|
const { tx } = useThemeContext();
|
|
356
|
-
const
|
|
357
|
-
return /* @__PURE__ */ React6.createElement(
|
|
356
|
+
const Root8 = asChild ? Slot4 : Primitive4.li;
|
|
357
|
+
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
358
358
|
role: "listitem",
|
|
359
359
|
...props,
|
|
360
360
|
className: tx("breadcrumb.listItem", "breadcrumb__list__item", {}, classNames),
|
|
@@ -367,8 +367,8 @@ var BreadcrumbListItem = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...
|
|
|
367
367
|
var BreadcrumbLink = /* @__PURE__ */ forwardRef5(({ asChild, ...props }, forwardedRef) => {
|
|
368
368
|
var _effect = _useSignals6();
|
|
369
369
|
try {
|
|
370
|
-
const
|
|
371
|
-
return /* @__PURE__ */ React6.createElement(
|
|
370
|
+
const Root8 = asChild ? Slot4 : Link;
|
|
371
|
+
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
372
372
|
...props,
|
|
373
373
|
ref: forwardedRef
|
|
374
374
|
});
|
|
@@ -380,8 +380,8 @@ var BreadcrumbCurrent = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...p
|
|
|
380
380
|
var _effect = _useSignals6();
|
|
381
381
|
try {
|
|
382
382
|
const { tx } = useThemeContext();
|
|
383
|
-
const
|
|
384
|
-
return /* @__PURE__ */ React6.createElement(
|
|
383
|
+
const Root8 = asChild ? Slot4 : "h1";
|
|
384
|
+
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
385
385
|
...props,
|
|
386
386
|
"aria-current": "page",
|
|
387
387
|
className: tx("breadcrumb.current", "breadcrumb__item__heading--current", {}, classNames),
|
|
@@ -416,7 +416,7 @@ var Breadcrumb = {
|
|
|
416
416
|
Separator: BreadcrumbSeparator
|
|
417
417
|
};
|
|
418
418
|
|
|
419
|
-
// src/components/
|
|
419
|
+
// src/components/Button/Button.tsx
|
|
420
420
|
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
421
421
|
import { createContext as createContext3 } from "@radix-ui/react-context";
|
|
422
422
|
import { Primitive as Primitive5 } from "@radix-ui/react-primitive";
|
|
@@ -434,8 +434,8 @@ var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef6(({ classNames, ch
|
|
|
434
434
|
const { tx } = useThemeContext();
|
|
435
435
|
const elevation = useElevationContext(propsElevation);
|
|
436
436
|
const density = useDensityContext(propsDensity);
|
|
437
|
-
const
|
|
438
|
-
return /* @__PURE__ */ React7.createElement(
|
|
437
|
+
const Root8 = asChild ? Slot5 : Primitive5.button;
|
|
438
|
+
return /* @__PURE__ */ React7.createElement(Root8, {
|
|
439
439
|
ref,
|
|
440
440
|
...props,
|
|
441
441
|
"data-variant": variant,
|
|
@@ -462,8 +462,8 @@ var ButtonGroup = /* @__PURE__ */ forwardRef6(({ children, elevation: propsEleva
|
|
|
462
462
|
try {
|
|
463
463
|
const { tx } = useThemeContext();
|
|
464
464
|
const elevation = useElevationContext(propsElevation);
|
|
465
|
-
const
|
|
466
|
-
return /* @__PURE__ */ React7.createElement(
|
|
465
|
+
const Root8 = asChild ? Slot5 : Primitive5.div;
|
|
466
|
+
return /* @__PURE__ */ React7.createElement(Root8, {
|
|
467
467
|
role: "none",
|
|
468
468
|
...props,
|
|
469
469
|
className: tx("button.group", "button-group", {
|
|
@@ -479,7 +479,7 @@ var ButtonGroup = /* @__PURE__ */ forwardRef6(({ children, elevation: propsEleva
|
|
|
479
479
|
});
|
|
480
480
|
ButtonGroup.displayName = BUTTON_GROUP_NAME;
|
|
481
481
|
|
|
482
|
-
// src/components/
|
|
482
|
+
// src/components/Button/IconButton.tsx
|
|
483
483
|
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
484
484
|
import React9, { forwardRef as forwardRef8 } from "react";
|
|
485
485
|
|
|
@@ -1106,8 +1106,22 @@ var Tooltip = {
|
|
|
1106
1106
|
Trigger: TooltipTrigger
|
|
1107
1107
|
};
|
|
1108
1108
|
|
|
1109
|
-
// src/components/
|
|
1110
|
-
var
|
|
1109
|
+
// src/components/Button/IconButton.tsx
|
|
1110
|
+
var IconButton = /* @__PURE__ */ forwardRef8((props, forwardedRef) => {
|
|
1111
|
+
var _effect = _useSignals9();
|
|
1112
|
+
try {
|
|
1113
|
+
return props.iconOnly ? /* @__PURE__ */ React9.createElement(IconOnlyButton, {
|
|
1114
|
+
...props,
|
|
1115
|
+
ref: forwardedRef
|
|
1116
|
+
}) : /* @__PURE__ */ React9.createElement(LabelledIconButton, {
|
|
1117
|
+
...props,
|
|
1118
|
+
ref: forwardedRef
|
|
1119
|
+
});
|
|
1120
|
+
} finally {
|
|
1121
|
+
_effect.f();
|
|
1122
|
+
}
|
|
1123
|
+
});
|
|
1124
|
+
var IconOnlyButton = /* @__PURE__ */ forwardRef8(({ noTooltip, tooltipSide, ...props }, forwardedRef) => {
|
|
1111
1125
|
var _effect = _useSignals9();
|
|
1112
1126
|
try {
|
|
1113
1127
|
if (noTooltip) {
|
|
@@ -1128,7 +1142,7 @@ var IconOnlyButton = /* @__PURE__ */ forwardRef8(({ noTooltip, tooltipPortal = t
|
|
|
1128
1142
|
_effect.f();
|
|
1129
1143
|
}
|
|
1130
1144
|
});
|
|
1131
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size, iconOnly, label, classNames, iconClassNames, caretDown, ...props }, forwardedRef) => {
|
|
1145
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size = 5, iconOnly, label, classNames, iconClassNames, caretDown, ...props }, forwardedRef) => {
|
|
1132
1146
|
var _effect = _useSignals9();
|
|
1133
1147
|
try {
|
|
1134
1148
|
const { tx } = useThemeContext();
|
|
@@ -1138,7 +1152,7 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size, iconOnly, la
|
|
|
1138
1152
|
iconOnly
|
|
1139
1153
|
}, classNames),
|
|
1140
1154
|
ref: forwardedRef
|
|
1141
|
-
}, /* @__PURE__ */ React9.createElement(Icon, {
|
|
1155
|
+
}, icon && /* @__PURE__ */ React9.createElement(Icon, {
|
|
1142
1156
|
icon,
|
|
1143
1157
|
size,
|
|
1144
1158
|
classNames: iconClassNames
|
|
@@ -1152,22 +1166,8 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size, iconOnly, la
|
|
|
1152
1166
|
_effect.f();
|
|
1153
1167
|
}
|
|
1154
1168
|
});
|
|
1155
|
-
var IconButton = /* @__PURE__ */ forwardRef8((props, forwardedRef) => {
|
|
1156
|
-
var _effect = _useSignals9();
|
|
1157
|
-
try {
|
|
1158
|
-
return props.iconOnly ? /* @__PURE__ */ React9.createElement(IconOnlyButton, {
|
|
1159
|
-
...props,
|
|
1160
|
-
ref: forwardedRef
|
|
1161
|
-
}) : /* @__PURE__ */ React9.createElement(LabelledIconButton, {
|
|
1162
|
-
...props,
|
|
1163
|
-
ref: forwardedRef
|
|
1164
|
-
});
|
|
1165
|
-
} finally {
|
|
1166
|
-
_effect.f();
|
|
1167
|
-
}
|
|
1168
|
-
});
|
|
1169
1169
|
|
|
1170
|
-
// src/components/
|
|
1170
|
+
// src/components/Button/Toggle.tsx
|
|
1171
1171
|
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
1172
1172
|
import { Toggle as TogglePrimitive } from "@radix-ui/react-toggle";
|
|
1173
1173
|
import React10, { forwardRef as forwardRef9 } from "react";
|
|
@@ -1188,9 +1188,9 @@ var Toggle = /* @__PURE__ */ forwardRef9(({ defaultPressed, pressed, onPressedCh
|
|
|
1188
1188
|
}
|
|
1189
1189
|
});
|
|
1190
1190
|
|
|
1191
|
-
// src/components/
|
|
1191
|
+
// src/components/Button/ToggleGroup.tsx
|
|
1192
1192
|
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
1193
|
-
import {
|
|
1193
|
+
import { ToggleGroupItem as ToggleGroupItemPrimitive, ToggleGroup as ToggleGroupPrimitive } from "@radix-ui/react-toggle-group";
|
|
1194
1194
|
import React11, { forwardRef as forwardRef10 } from "react";
|
|
1195
1195
|
var ToggleGroup = /* @__PURE__ */ forwardRef10(({ classNames, children, ...props }, forwardedRef) => {
|
|
1196
1196
|
var _effect = _useSignals11();
|
|
@@ -1225,6 +1225,26 @@ var ToggleGroupItem = /* @__PURE__ */ forwardRef10(({ variant, elevation, densit
|
|
|
1225
1225
|
_effect.f();
|
|
1226
1226
|
}
|
|
1227
1227
|
});
|
|
1228
|
+
var ToggleGroupIconItem = /* @__PURE__ */ forwardRef10(({ variant, label, icon, size, elevation, density, classNames, ...props }, forwardedRef) => {
|
|
1229
|
+
var _effect = _useSignals11();
|
|
1230
|
+
try {
|
|
1231
|
+
return /* @__PURE__ */ React11.createElement(ToggleGroupItemPrimitive, {
|
|
1232
|
+
...props,
|
|
1233
|
+
asChild: true
|
|
1234
|
+
}, /* @__PURE__ */ React11.createElement(IconButton, {
|
|
1235
|
+
variant,
|
|
1236
|
+
elevation,
|
|
1237
|
+
density,
|
|
1238
|
+
classNames,
|
|
1239
|
+
label,
|
|
1240
|
+
icon,
|
|
1241
|
+
size,
|
|
1242
|
+
ref: forwardedRef
|
|
1243
|
+
}));
|
|
1244
|
+
} finally {
|
|
1245
|
+
_effect.f();
|
|
1246
|
+
}
|
|
1247
|
+
});
|
|
1228
1248
|
|
|
1229
1249
|
// src/components/Clipboard/ClipboardProvider.tsx
|
|
1230
1250
|
import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
|
|
@@ -1257,18 +1277,103 @@ var ClipboardProvider = ({ children }) => {
|
|
|
1257
1277
|
// src/components/Clipboard/CopyButton.tsx
|
|
1258
1278
|
import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
|
|
1259
1279
|
import React16 from "react";
|
|
1260
|
-
import { mx as
|
|
1280
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
1261
1281
|
|
|
1262
1282
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
1263
1283
|
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1264
1284
|
import { createKeyborg } from "keyborg";
|
|
1265
|
-
import React15, { createContext as createContext7, useEffect as
|
|
1285
|
+
import React15, { createContext as createContext7, useEffect as useEffect4, useMemo as useMemo3 } from "react";
|
|
1286
|
+
|
|
1287
|
+
// src/util/domino.ts
|
|
1288
|
+
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
1289
|
+
var Domino = class _Domino {
|
|
1290
|
+
static of(tag) {
|
|
1291
|
+
return new _Domino(tag);
|
|
1292
|
+
}
|
|
1293
|
+
_el;
|
|
1294
|
+
constructor(tag) {
|
|
1295
|
+
this._el = document.createElement(tag);
|
|
1296
|
+
}
|
|
1297
|
+
classNames(...classNames) {
|
|
1298
|
+
this._el.className = mx2(classNames);
|
|
1299
|
+
return this;
|
|
1300
|
+
}
|
|
1301
|
+
text(value) {
|
|
1302
|
+
this._el.textContent = value;
|
|
1303
|
+
return this;
|
|
1304
|
+
}
|
|
1305
|
+
data(key, value) {
|
|
1306
|
+
this._el.dataset[key] = value;
|
|
1307
|
+
return this;
|
|
1308
|
+
}
|
|
1309
|
+
attributes(attr) {
|
|
1310
|
+
Object.entries(attr).filter(([_, value]) => value !== void 0).map(([key, value]) => this._el.setAttribute(key, value));
|
|
1311
|
+
return this;
|
|
1312
|
+
}
|
|
1313
|
+
style(styles) {
|
|
1314
|
+
Object.assign(this._el.style, styles);
|
|
1315
|
+
return this;
|
|
1316
|
+
}
|
|
1317
|
+
children(...children) {
|
|
1318
|
+
children.forEach((child) => this._el.appendChild(child.build()));
|
|
1319
|
+
return this;
|
|
1320
|
+
}
|
|
1321
|
+
on(event, handler) {
|
|
1322
|
+
this._el.addEventListener(event, handler);
|
|
1323
|
+
return this;
|
|
1324
|
+
}
|
|
1325
|
+
build() {
|
|
1326
|
+
return this._el;
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1266
1329
|
|
|
1267
1330
|
// src/util/hasIosKeyboard.ts
|
|
1268
1331
|
var hasIosKeyboard = () => {
|
|
1269
1332
|
return !!navigator.userAgent.match(/iP(ad|od|hone).+Safari/);
|
|
1270
1333
|
};
|
|
1271
1334
|
|
|
1335
|
+
// src/util/usePx.ts
|
|
1336
|
+
import { useCallback as useCallback5, useEffect as useEffect3, useMemo as useMemo2, useState as useState6 } from "react";
|
|
1337
|
+
var getDocumentElementFontSize = () => parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
1338
|
+
var usePx = (rem) => {
|
|
1339
|
+
const [fontSize, setFontSize] = useState6(() => {
|
|
1340
|
+
if (typeof document !== "undefined") {
|
|
1341
|
+
return getDocumentElementFontSize();
|
|
1342
|
+
}
|
|
1343
|
+
return 16;
|
|
1344
|
+
});
|
|
1345
|
+
const updateFontSize = useCallback5(() => {
|
|
1346
|
+
setFontSize(getDocumentElementFontSize());
|
|
1347
|
+
}, []);
|
|
1348
|
+
useEffect3(() => {
|
|
1349
|
+
if (typeof document === "undefined") {
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
const resizeObserver = new ResizeObserver(updateFontSize);
|
|
1353
|
+
resizeObserver.observe(document.documentElement);
|
|
1354
|
+
const mediaQueryList = window.matchMedia("all");
|
|
1355
|
+
const handleMediaChange = () => {
|
|
1356
|
+
updateFontSize();
|
|
1357
|
+
};
|
|
1358
|
+
if (mediaQueryList.addEventListener) {
|
|
1359
|
+
mediaQueryList.addEventListener("change", handleMediaChange);
|
|
1360
|
+
} else {
|
|
1361
|
+
mediaQueryList.addListener(handleMediaChange);
|
|
1362
|
+
}
|
|
1363
|
+
return () => {
|
|
1364
|
+
resizeObserver.disconnect();
|
|
1365
|
+
if (mediaQueryList.removeEventListener) {
|
|
1366
|
+
mediaQueryList.removeEventListener("change", handleMediaChange);
|
|
1367
|
+
} else {
|
|
1368
|
+
mediaQueryList.removeListener(handleMediaChange);
|
|
1369
|
+
}
|
|
1370
|
+
};
|
|
1371
|
+
}, []);
|
|
1372
|
+
return useMemo2(() => rem * fontSize, [
|
|
1373
|
+
fontSize
|
|
1374
|
+
]);
|
|
1375
|
+
};
|
|
1376
|
+
|
|
1272
1377
|
// src/components/DensityProvider/DensityProvider.tsx
|
|
1273
1378
|
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1274
1379
|
import React13, { createContext as createContext5 } from "react";
|
|
@@ -1312,7 +1417,7 @@ var ThemeContext = /* @__PURE__ */ createContext7(void 0);
|
|
|
1312
1417
|
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", ...rest }) => {
|
|
1313
1418
|
var _effect = _useSignals15();
|
|
1314
1419
|
try {
|
|
1315
|
-
|
|
1420
|
+
useEffect4(() => {
|
|
1316
1421
|
if (document.defaultView) {
|
|
1317
1422
|
const kb = createKeyborg(document.defaultView);
|
|
1318
1423
|
kb.subscribe(handleInputModalityChange);
|
|
@@ -1320,7 +1425,7 @@ var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx
|
|
|
1320
1425
|
}
|
|
1321
1426
|
}, []);
|
|
1322
1427
|
const safeAreaPadding = useSafeArea();
|
|
1323
|
-
const contextValue =
|
|
1428
|
+
const contextValue = useMemo3(() => ({
|
|
1324
1429
|
tx,
|
|
1325
1430
|
themeMode,
|
|
1326
1431
|
hasIosKeyboard: hasIosKeyboard(),
|
|
@@ -1373,7 +1478,7 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1373
1478
|
"data-testid": "copy-invitation"
|
|
1374
1479
|
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1375
1480
|
role: "none",
|
|
1376
|
-
className:
|
|
1481
|
+
className: mx3("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
1377
1482
|
}, /* @__PURE__ */ React16.createElement("span", {
|
|
1378
1483
|
className: "pli-1"
|
|
1379
1484
|
}, t("copy label")), /* @__PURE__ */ React16.createElement(Icon, {
|
|
@@ -1381,7 +1486,7 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1381
1486
|
size
|
|
1382
1487
|
})), /* @__PURE__ */ React16.createElement("div", {
|
|
1383
1488
|
role: "none",
|
|
1384
|
-
className:
|
|
1489
|
+
className: mx3("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
1385
1490
|
}, /* @__PURE__ */ React16.createElement("span", {
|
|
1386
1491
|
className: "pli-1"
|
|
1387
1492
|
}, t("copy success label")), /* @__PURE__ */ React16.createElement(Icon, {
|
|
@@ -1425,10 +1530,10 @@ var Clipboard = {
|
|
|
1425
1530
|
Provider: ClipboardProvider
|
|
1426
1531
|
};
|
|
1427
1532
|
|
|
1428
|
-
// src/components/
|
|
1533
|
+
// src/components/Dialog/Dialog.tsx
|
|
1429
1534
|
import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
|
|
1430
1535
|
import { createContext as createContext8 } from "@radix-ui/react-context";
|
|
1431
|
-
import {
|
|
1536
|
+
import { DialogClose as DialogClosePrimitive, DialogContent as DialogContentPrimitive, DialogDescription as DialogDescriptionPrimitive, DialogOverlay as DialogOverlayPrimitive, DialogPortal as DialogPortalPrimitive, Root as DialogRootPrimitive, DialogTitle as DialogTitlePrimitive, DialogTrigger as DialogTriggerPrimitive } from "@radix-ui/react-dialog";
|
|
1432
1537
|
import React17, { forwardRef as forwardRef11 } from "react";
|
|
1433
1538
|
var DialogRoot = (props) => {
|
|
1434
1539
|
var _effect = _useSignals17();
|
|
@@ -1524,9 +1629,9 @@ var Dialog = {
|
|
|
1524
1629
|
Close: DialogClose
|
|
1525
1630
|
};
|
|
1526
1631
|
|
|
1527
|
-
// src/components/
|
|
1632
|
+
// src/components/Dialog/AlertDialog.tsx
|
|
1528
1633
|
import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
|
|
1529
|
-
import {
|
|
1634
|
+
import { AlertDialogAction as AlertDialogActionPrimitive, AlertDialogCancel as AlertDialogCancelPrimitive, AlertDialogContent as AlertDialogContentPrimitive, AlertDialogDescription as AlertDialogDescriptionPrimitive, AlertDialogOverlay as AlertDialogOverlayPrimitive, AlertDialogPortal as AlertDialogPortalPrimitive, Root as AlertDialogRootPrimitive, AlertDialogTitle as AlertDialogTitlePrimitive, AlertDialogTrigger as AlertDialogTriggerPrimitive } from "@radix-ui/react-alert-dialog";
|
|
1530
1635
|
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
1531
1636
|
import React18, { forwardRef as forwardRef12 } from "react";
|
|
1532
1637
|
var AlertDialogRoot = (props) => {
|
|
@@ -1628,9 +1733,9 @@ var AlertDialog = {
|
|
|
1628
1733
|
import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
|
|
1629
1734
|
import { Root as CheckboxPrimitive } from "@radix-ui/react-checkbox";
|
|
1630
1735
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
1631
|
-
import React19, { forwardRef as forwardRef13, useCallback as
|
|
1632
|
-
import {
|
|
1633
|
-
import { mx as
|
|
1736
|
+
import React19, { forwardRef as forwardRef13, useCallback as useCallback6 } from "react";
|
|
1737
|
+
import { DescriptionAndValidation as DescriptionAndValidationPrimitive, Description as DescriptionPrimitive, INPUT_NAME, InputRoot, Label as LabelPrimitive, PinInput as PinInputPrimitive, TextArea as TextAreaPrimitive, TextInput as TextInputPrimitive, Validation as ValidationPrimitive, useInputContext } from "@dxos/react-input";
|
|
1738
|
+
import { mx as mx4 } from "@dxos/react-ui-theme";
|
|
1634
1739
|
var Label = /* @__PURE__ */ forwardRef13(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1635
1740
|
var _effect = _useSignals19();
|
|
1636
1741
|
try {
|
|
@@ -1700,7 +1805,7 @@ var PinInput = /* @__PURE__ */ forwardRef13(({ density: propsDensity, elevation:
|
|
|
1700
1805
|
const { tx } = useThemeContext();
|
|
1701
1806
|
const density = useDensityContext(propsDensity);
|
|
1702
1807
|
const elevation = useElevationContext(propsElevation);
|
|
1703
|
-
const segmentClassName =
|
|
1808
|
+
const segmentClassName = useCallback6(({ focused, validationValence }) => tx("input.input", "input--pin-segment", {
|
|
1704
1809
|
variant: "static",
|
|
1705
1810
|
focused,
|
|
1706
1811
|
disabled: props.disabled,
|
|
@@ -1782,7 +1887,7 @@ var TextArea = /* @__PURE__ */ forwardRef13(({ __inputScope, classNames, density
|
|
|
1782
1887
|
_effect.f();
|
|
1783
1888
|
}
|
|
1784
1889
|
});
|
|
1785
|
-
var Checkbox = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size,
|
|
1890
|
+
var Checkbox = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, classNames, ...props }, forwardedRef) => {
|
|
1786
1891
|
var _effect = _useSignals19();
|
|
1787
1892
|
try {
|
|
1788
1893
|
const [checked, onCheckedChange] = useControllableState2({
|
|
@@ -1828,7 +1933,7 @@ var Switch = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked
|
|
|
1828
1933
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1829
1934
|
return /* @__PURE__ */ React19.createElement("input", {
|
|
1830
1935
|
type: "checkbox",
|
|
1831
|
-
className:
|
|
1936
|
+
className: mx4("dx-checkbox--switch dx-focus-ring", classNames),
|
|
1832
1937
|
checked,
|
|
1833
1938
|
onChange: (event) => {
|
|
1834
1939
|
onCheckedChange(event.target.checked);
|
|
@@ -1859,13 +1964,13 @@ var Input = {
|
|
|
1859
1964
|
DescriptionAndValidation
|
|
1860
1965
|
};
|
|
1861
1966
|
|
|
1862
|
-
// src/components/
|
|
1967
|
+
// src/components/List/List.tsx
|
|
1863
1968
|
import { useSignals as _useSignals21 } from "@preact-signals/safe-react/tracking";
|
|
1864
1969
|
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
1865
1970
|
import React21, { forwardRef as forwardRef14 } from "react";
|
|
1866
|
-
import { List as ListPrimitive,
|
|
1971
|
+
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";
|
|
1867
1972
|
|
|
1868
|
-
// src/components/
|
|
1973
|
+
// src/components/List/ListDropIndicator.tsx
|
|
1869
1974
|
import { useSignals as _useSignals20 } from "@preact-signals/safe-react/tracking";
|
|
1870
1975
|
import React20 from "react";
|
|
1871
1976
|
var edgeToOrientationMap = {
|
|
@@ -1876,7 +1981,7 @@ var edgeToOrientationMap = {
|
|
|
1876
1981
|
};
|
|
1877
1982
|
var orientationStyles = {
|
|
1878
1983
|
horizontal: "h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]",
|
|
1879
|
-
vertical: "
|
|
1984
|
+
vertical: "is-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]"
|
|
1880
1985
|
};
|
|
1881
1986
|
var edgeStyles = {
|
|
1882
1987
|
top: "top-[--line-offset] before:top-[--offset-terminal]",
|
|
@@ -1909,7 +2014,7 @@ var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineIns
|
|
|
1909
2014
|
}
|
|
1910
2015
|
};
|
|
1911
2016
|
|
|
1912
|
-
// src/components/
|
|
2017
|
+
// src/components/List/List.tsx
|
|
1913
2018
|
var List = /* @__PURE__ */ forwardRef14(({ classNames, children, ...props }, forwardedRef) => {
|
|
1914
2019
|
var _effect = _useSignals21();
|
|
1915
2020
|
try {
|
|
@@ -1929,10 +2034,10 @@ var List = /* @__PURE__ */ forwardRef14(({ classNames, children, ...props }, for
|
|
|
1929
2034
|
var ListItemEndcap = /* @__PURE__ */ forwardRef14(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
1930
2035
|
var _effect = _useSignals21();
|
|
1931
2036
|
try {
|
|
1932
|
-
const
|
|
2037
|
+
const Root8 = asChild ? Slot6 : "div";
|
|
1933
2038
|
const density = useDensityContext();
|
|
1934
2039
|
const { tx } = useThemeContext();
|
|
1935
|
-
return /* @__PURE__ */ React21.createElement(
|
|
2040
|
+
return /* @__PURE__ */ React21.createElement(Root8, {
|
|
1936
2041
|
...!asChild && {
|
|
1937
2042
|
role: "none"
|
|
1938
2043
|
},
|
|
@@ -1984,7 +2089,6 @@ var ListItemOpenTrigger = /* @__PURE__ */ forwardRef14(({ __listItemScope, class
|
|
|
1984
2089
|
const { tx } = useThemeContext();
|
|
1985
2090
|
const density = useDensityContext();
|
|
1986
2091
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
1987
|
-
const iconName = open ? "ph--caret-down--bold" : "ph--caret-right--bold";
|
|
1988
2092
|
return /* @__PURE__ */ React21.createElement(ListPrimitiveItemOpenTrigger, {
|
|
1989
2093
|
...props,
|
|
1990
2094
|
className: tx("list.item.openTrigger", "list__listItem__openTrigger", {
|
|
@@ -1992,7 +2096,8 @@ var ListItemOpenTrigger = /* @__PURE__ */ forwardRef14(({ __listItemScope, class
|
|
|
1992
2096
|
}, classNames),
|
|
1993
2097
|
ref: forwardedRef
|
|
1994
2098
|
}, children || /* @__PURE__ */ React21.createElement(Icon, {
|
|
1995
|
-
|
|
2099
|
+
size: 3,
|
|
2100
|
+
icon: open ? "ph--caret-down--bold" : "ph--caret-right--bold",
|
|
1996
2101
|
classNames: tx("list.item.openTriggerIcon", "list__listItem__openTrigger__icon", {})
|
|
1997
2102
|
}));
|
|
1998
2103
|
} finally {
|
|
@@ -2026,11 +2131,11 @@ var ListItem = {
|
|
|
2026
2131
|
DropIndicator: ListDropIndicator
|
|
2027
2132
|
};
|
|
2028
2133
|
|
|
2029
|
-
// src/components/
|
|
2134
|
+
// src/components/List/Tree.tsx
|
|
2030
2135
|
import { useSignals as _useSignals23 } from "@preact-signals/safe-react/tracking";
|
|
2031
2136
|
import React23, { forwardRef as forwardRef15 } from "react";
|
|
2032
2137
|
|
|
2033
|
-
// src/components/
|
|
2138
|
+
// src/components/List/TreeDropIndicator.tsx
|
|
2034
2139
|
import { useSignals as _useSignals22 } from "@preact-signals/safe-react/tracking";
|
|
2035
2140
|
import React22 from "react";
|
|
2036
2141
|
var edgeToOrientationMap2 = {
|
|
@@ -2081,7 +2186,7 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
2081
2186
|
}
|
|
2082
2187
|
};
|
|
2083
2188
|
|
|
2084
|
-
// src/components/
|
|
2189
|
+
// src/components/List/Tree.tsx
|
|
2085
2190
|
var TreeRoot = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
2086
2191
|
var _effect = _useSignals23();
|
|
2087
2192
|
try {
|
|
@@ -2135,14 +2240,14 @@ var TreeItem = {
|
|
|
2135
2240
|
DropIndicator: TreeDropIndicator
|
|
2136
2241
|
};
|
|
2137
2242
|
|
|
2138
|
-
// src/components/
|
|
2243
|
+
// src/components/List/Treegrid.tsx
|
|
2139
2244
|
import { useSignals as _useSignals24 } from "@preact-signals/safe-react/tracking";
|
|
2140
|
-
import {
|
|
2245
|
+
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
2141
2246
|
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
2142
2247
|
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
2143
2248
|
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
2144
2249
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
2145
|
-
import React24, { forwardRef as forwardRef16 } from "react";
|
|
2250
|
+
import React24, { forwardRef as forwardRef16, useCallback as useCallback7 } from "react";
|
|
2146
2251
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2147
2252
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
2148
2253
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
@@ -2152,15 +2257,44 @@ var TreegridRoot = /* @__PURE__ */ forwardRef16(({ asChild, classNames, children
|
|
|
2152
2257
|
var _effect = _useSignals24();
|
|
2153
2258
|
try {
|
|
2154
2259
|
const { tx } = useThemeContext();
|
|
2155
|
-
const
|
|
2156
|
-
const
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2260
|
+
const Root8 = asChild ? Slot7 : Primitive7.div;
|
|
2261
|
+
const { findFirstFocusable } = useFocusFinders();
|
|
2262
|
+
const handleKeyDown = useCallback7((event) => {
|
|
2263
|
+
switch (event.key) {
|
|
2264
|
+
case "ArrowDown":
|
|
2265
|
+
case "ArrowUp": {
|
|
2266
|
+
const direction = event.key === "ArrowDown" ? "down" : "up";
|
|
2267
|
+
const target = event.target;
|
|
2268
|
+
const ancestorWithArrowKeys = target.closest(`[data-arrow-keys*="${direction}"], [data-arrow-keys="all"]`);
|
|
2269
|
+
if (!ancestorWithArrowKeys) {
|
|
2270
|
+
const currentRow = target.closest('[role="row"]');
|
|
2271
|
+
if (currentRow) {
|
|
2272
|
+
const treegrid = currentRow.closest('[role="treegrid"]');
|
|
2273
|
+
if (treegrid) {
|
|
2274
|
+
const rows = Array.from(treegrid.querySelectorAll('[role="row"]'));
|
|
2275
|
+
const currentIndex = rows.indexOf(currentRow);
|
|
2276
|
+
const nextIndex = direction === "down" ? currentIndex + 1 : currentIndex - 1;
|
|
2277
|
+
const targetRow = rows[nextIndex];
|
|
2278
|
+
if (targetRow) {
|
|
2279
|
+
const firstFocusable = findFirstFocusable(targetRow);
|
|
2280
|
+
if (firstFocusable) {
|
|
2281
|
+
event.preventDefault();
|
|
2282
|
+
firstFocusable.focus();
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
break;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
props.onKeyDown?.(event);
|
|
2292
|
+
}, [
|
|
2293
|
+
findFirstFocusable
|
|
2294
|
+
]);
|
|
2295
|
+
return /* @__PURE__ */ React24.createElement(Root8, {
|
|
2162
2296
|
role: "treegrid",
|
|
2163
|
-
|
|
2297
|
+
onKeyDown: handleKeyDown,
|
|
2164
2298
|
...props,
|
|
2165
2299
|
className: tx("treegrid.root", "treegrid", {}, classNames),
|
|
2166
2300
|
style: {
|
|
@@ -2177,7 +2311,7 @@ var TreegridRow = /* @__PURE__ */ forwardRef16(({ __treegridRowScope, asChild, c
|
|
|
2177
2311
|
var _effect = _useSignals24();
|
|
2178
2312
|
try {
|
|
2179
2313
|
const { tx } = useThemeContext();
|
|
2180
|
-
const
|
|
2314
|
+
const Root8 = asChild ? Slot7 : Primitive7.div;
|
|
2181
2315
|
const pathParts = id.split(PATH_SEPARATOR);
|
|
2182
2316
|
const level = pathParts.length - 1;
|
|
2183
2317
|
const [open, onOpenChange] = useControllableState3({
|
|
@@ -2185,20 +2319,11 @@ var TreegridRow = /* @__PURE__ */ forwardRef16(({ __treegridRowScope, asChild, c
|
|
|
2185
2319
|
onChange: propsOnOpenChange,
|
|
2186
2320
|
defaultProp: defaultOpen
|
|
2187
2321
|
});
|
|
2188
|
-
const focusableGroupAttrs = useFocusableGroup({
|
|
2189
|
-
tabBehavior: "limited"
|
|
2190
|
-
});
|
|
2191
|
-
const arrowGroupAttrs = useArrowNavigationGroup({
|
|
2192
|
-
axis: "horizontal",
|
|
2193
|
-
tabbable: false,
|
|
2194
|
-
circular: false,
|
|
2195
|
-
memorizeCurrent: false
|
|
2196
|
-
});
|
|
2197
2322
|
return /* @__PURE__ */ React24.createElement(TreegridRowProvider, {
|
|
2198
2323
|
open,
|
|
2199
2324
|
onOpenChange,
|
|
2200
2325
|
scope: __treegridRowScope
|
|
2201
|
-
}, /* @__PURE__ */ React24.createElement(
|
|
2326
|
+
}, /* @__PURE__ */ React24.createElement(Root8, {
|
|
2202
2327
|
role: "row",
|
|
2203
2328
|
"aria-level": level,
|
|
2204
2329
|
className: tx("treegrid.row", "treegrid__row", {
|
|
@@ -2208,16 +2333,10 @@ var TreegridRow = /* @__PURE__ */ forwardRef16(({ __treegridRowScope, asChild, c
|
|
|
2208
2333
|
"aria-expanded": open,
|
|
2209
2334
|
"aria-owns": parentOf
|
|
2210
2335
|
},
|
|
2211
|
-
tabIndex: 0,
|
|
2212
|
-
...focusableGroupAttrs,
|
|
2213
2336
|
...props,
|
|
2214
2337
|
id,
|
|
2215
2338
|
ref: forwardedRef
|
|
2216
|
-
},
|
|
2217
|
-
role: "none",
|
|
2218
|
-
className: "contents",
|
|
2219
|
-
...arrowGroupAttrs
|
|
2220
|
-
}, children)));
|
|
2339
|
+
}, children));
|
|
2221
2340
|
} finally {
|
|
2222
2341
|
_effect.f();
|
|
2223
2342
|
}
|
|
@@ -2250,17 +2369,18 @@ var Treegrid = {
|
|
|
2250
2369
|
|
|
2251
2370
|
// src/components/Main/Main.tsx
|
|
2252
2371
|
import { useSignals as _useSignals25 } from "@preact-signals/safe-react/tracking";
|
|
2372
|
+
import { useFocusableGroup } from "@fluentui/react-tabster";
|
|
2253
2373
|
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
2254
|
-
import {
|
|
2374
|
+
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
2255
2375
|
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
2256
2376
|
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
2257
2377
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2258
|
-
import React25, { forwardRef as forwardRef17, useCallback as
|
|
2378
|
+
import React25, { forwardRef as forwardRef17, useCallback as useCallback9, useEffect as useEffect6, useRef as useRef2, useState as useState8 } from "react";
|
|
2259
2379
|
import { log } from "@dxos/log";
|
|
2260
|
-
import {
|
|
2380
|
+
import { useForwardedRef, useMediaQuery } from "@dxos/react-hooks";
|
|
2261
2381
|
|
|
2262
2382
|
// src/components/Main/useSwipeToDismiss.ts
|
|
2263
|
-
import { useCallback as
|
|
2383
|
+
import { useCallback as useCallback8, useEffect as useEffect5, useState as useState7 } from "react";
|
|
2264
2384
|
var useSwipeToDismiss = (ref, {
|
|
2265
2385
|
onDismiss,
|
|
2266
2386
|
dismissThreshold = 64,
|
|
@@ -2269,22 +2389,22 @@ var useSwipeToDismiss = (ref, {
|
|
|
2269
2389
|
/* side = 'inline-start' */
|
|
2270
2390
|
}) => {
|
|
2271
2391
|
const $root = ref.current;
|
|
2272
|
-
const [motionState, setMotionState] =
|
|
2273
|
-
const [gestureStartX, setGestureStartX] =
|
|
2274
|
-
const setIdle =
|
|
2392
|
+
const [motionState, setMotionState] = useState7(0);
|
|
2393
|
+
const [gestureStartX, setGestureStartX] = useState7(0);
|
|
2394
|
+
const setIdle = useCallback8(() => {
|
|
2275
2395
|
setMotionState(0);
|
|
2276
2396
|
$root?.style.removeProperty("inset-inline-start");
|
|
2277
2397
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
2278
2398
|
}, [
|
|
2279
2399
|
$root
|
|
2280
2400
|
]);
|
|
2281
|
-
const setFollowing =
|
|
2401
|
+
const setFollowing = useCallback8(() => {
|
|
2282
2402
|
setMotionState(2);
|
|
2283
2403
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
2284
2404
|
}, [
|
|
2285
2405
|
$root
|
|
2286
2406
|
]);
|
|
2287
|
-
const handlePointerDown =
|
|
2407
|
+
const handlePointerDown = useCallback8(({ screenX }) => {
|
|
2288
2408
|
if (motionState === 0) {
|
|
2289
2409
|
setMotionState(1);
|
|
2290
2410
|
setGestureStartX(screenX);
|
|
@@ -2292,7 +2412,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2292
2412
|
}, [
|
|
2293
2413
|
motionState
|
|
2294
2414
|
]);
|
|
2295
|
-
const handlePointerMove =
|
|
2415
|
+
const handlePointerMove = useCallback8(({ screenX }) => {
|
|
2296
2416
|
if ($root) {
|
|
2297
2417
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2298
2418
|
switch (motionState) {
|
|
@@ -2316,12 +2436,12 @@ var useSwipeToDismiss = (ref, {
|
|
|
2316
2436
|
motionState,
|
|
2317
2437
|
gestureStartX
|
|
2318
2438
|
]);
|
|
2319
|
-
const handlePointerUp =
|
|
2439
|
+
const handlePointerUp = useCallback8(() => {
|
|
2320
2440
|
setIdle();
|
|
2321
2441
|
}, [
|
|
2322
2442
|
setIdle
|
|
2323
2443
|
]);
|
|
2324
|
-
|
|
2444
|
+
useEffect5(() => {
|
|
2325
2445
|
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
2326
2446
|
return () => {
|
|
2327
2447
|
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
@@ -2330,7 +2450,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2330
2450
|
$root,
|
|
2331
2451
|
handlePointerDown
|
|
2332
2452
|
]);
|
|
2333
|
-
|
|
2453
|
+
useEffect5(() => {
|
|
2334
2454
|
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
2335
2455
|
return () => {
|
|
2336
2456
|
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
@@ -2339,7 +2459,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2339
2459
|
$root,
|
|
2340
2460
|
handlePointerMove
|
|
2341
2461
|
]);
|
|
2342
|
-
|
|
2462
|
+
useEffect5(() => {
|
|
2343
2463
|
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
2344
2464
|
return () => {
|
|
2345
2465
|
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
@@ -2352,14 +2472,14 @@ var useSwipeToDismiss = (ref, {
|
|
|
2352
2472
|
|
|
2353
2473
|
// src/components/Main/Main.tsx
|
|
2354
2474
|
var __dxlog_file = "/__w/dxos/dxos/packages/ui/react-ui/src/components/Main/Main.tsx";
|
|
2475
|
+
var MAIN_NAME = "Main";
|
|
2355
2476
|
var MAIN_ROOT_NAME = "MainRoot";
|
|
2356
2477
|
var NAVIGATION_SIDEBAR_NAME = "NavigationSidebar";
|
|
2357
2478
|
var COMPLEMENTARY_SIDEBAR_NAME = "ComplementarySidebar";
|
|
2358
|
-
var MAIN_NAME = "Main";
|
|
2359
2479
|
var GENERIC_CONSUMER_NAME = "GenericConsumer";
|
|
2360
2480
|
var landmarkAttr = "data-main-landmark";
|
|
2361
2481
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2362
|
-
const handleKeyDown =
|
|
2482
|
+
const handleKeyDown = useCallback9((event) => {
|
|
2363
2483
|
const target = event.target;
|
|
2364
2484
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2365
2485
|
event.preventDefault();
|
|
@@ -2373,12 +2493,12 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2373
2493
|
}, [
|
|
2374
2494
|
propsOnKeyDown
|
|
2375
2495
|
]);
|
|
2376
|
-
const focusableGroupAttrs =
|
|
2496
|
+
const focusableGroupAttrs = useFocusableGroup({
|
|
2377
2497
|
tabBehavior: "limited",
|
|
2378
2498
|
ignoreDefaultKeydown: {
|
|
2379
2499
|
Tab: true
|
|
2380
2500
|
}
|
|
2381
|
-
};
|
|
2501
|
+
});
|
|
2382
2502
|
return {
|
|
2383
2503
|
onKeyDown: handleKeyDown,
|
|
2384
2504
|
[landmarkAttr]: landmark,
|
|
@@ -2389,19 +2509,19 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2389
2509
|
var [MainProvider, useMainContext] = createContext10(MAIN_NAME, {
|
|
2390
2510
|
resizing: false,
|
|
2391
2511
|
navigationSidebarState: "closed",
|
|
2392
|
-
setNavigationSidebarState: (
|
|
2512
|
+
setNavigationSidebarState: (_nextState) => {
|
|
2393
2513
|
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2394
2514
|
F: __dxlog_file,
|
|
2395
|
-
L:
|
|
2515
|
+
L: 92,
|
|
2396
2516
|
S: void 0,
|
|
2397
2517
|
C: (f, a) => f(...a)
|
|
2398
2518
|
});
|
|
2399
2519
|
},
|
|
2400
2520
|
complementarySidebarState: "closed",
|
|
2401
|
-
setComplementarySidebarState: (
|
|
2521
|
+
setComplementarySidebarState: (_nextState) => {
|
|
2402
2522
|
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2403
2523
|
F: __dxlog_file,
|
|
2404
|
-
L:
|
|
2524
|
+
L: 97,
|
|
2405
2525
|
S: void 0,
|
|
2406
2526
|
C: (f, a) => f(...a)
|
|
2407
2527
|
});
|
|
@@ -2412,31 +2532,29 @@ var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
|
2412
2532
|
return {
|
|
2413
2533
|
navigationSidebarState,
|
|
2414
2534
|
setNavigationSidebarState,
|
|
2415
|
-
toggleNavigationSidebar:
|
|
2535
|
+
toggleNavigationSidebar: useCallback9(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2416
2536
|
navigationSidebarState,
|
|
2417
2537
|
setNavigationSidebarState
|
|
2418
2538
|
]),
|
|
2419
|
-
openNavigationSidebar:
|
|
2420
|
-
collapseNavigationSidebar:
|
|
2421
|
-
closeNavigationSidebar:
|
|
2539
|
+
openNavigationSidebar: useCallback9(() => setNavigationSidebarState("expanded"), []),
|
|
2540
|
+
collapseNavigationSidebar: useCallback9(() => setNavigationSidebarState("collapsed"), []),
|
|
2541
|
+
closeNavigationSidebar: useCallback9(() => setNavigationSidebarState("closed"), []),
|
|
2422
2542
|
complementarySidebarState,
|
|
2423
2543
|
setComplementarySidebarState,
|
|
2424
|
-
toggleComplementarySidebar:
|
|
2544
|
+
toggleComplementarySidebar: useCallback9(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2425
2545
|
complementarySidebarState,
|
|
2426
2546
|
setComplementarySidebarState
|
|
2427
2547
|
]),
|
|
2428
|
-
openComplementarySidebar:
|
|
2429
|
-
collapseComplementarySidebar:
|
|
2430
|
-
closeComplementarySidebar:
|
|
2548
|
+
openComplementarySidebar: useCallback9(() => setComplementarySidebarState("expanded"), []),
|
|
2549
|
+
collapseComplementarySidebar: useCallback9(() => setComplementarySidebarState("collapsed"), []),
|
|
2550
|
+
closeComplementarySidebar: useCallback9(() => setComplementarySidebarState("closed"), [])
|
|
2431
2551
|
};
|
|
2432
2552
|
};
|
|
2433
2553
|
var resizeDebounce = 3e3;
|
|
2434
2554
|
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
2435
2555
|
var _effect = _useSignals25();
|
|
2436
2556
|
try {
|
|
2437
|
-
const [isLg] = useMediaQuery("lg"
|
|
2438
|
-
ssr: false
|
|
2439
|
-
});
|
|
2557
|
+
const [isLg] = useMediaQuery("lg");
|
|
2440
2558
|
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = useControllableState4({
|
|
2441
2559
|
prop: propsNavigationSidebarState,
|
|
2442
2560
|
defaultProp: defaultNavigationSidebarState,
|
|
@@ -2447,9 +2565,9 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2447
2565
|
defaultProp: defaultComplementarySidebarState,
|
|
2448
2566
|
onChange: onComplementarySidebarStateChange
|
|
2449
2567
|
});
|
|
2450
|
-
const [resizing, setResizing] =
|
|
2568
|
+
const [resizing, setResizing] = useState8(false);
|
|
2451
2569
|
const resizeInterval = useRef2(null);
|
|
2452
|
-
const handleResize =
|
|
2570
|
+
const handleResize = useCallback9(() => {
|
|
2453
2571
|
setResizing(true);
|
|
2454
2572
|
if (resizeInterval.current) {
|
|
2455
2573
|
clearTimeout(resizeInterval.current);
|
|
@@ -2459,7 +2577,7 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2459
2577
|
resizeInterval.current = null;
|
|
2460
2578
|
}, resizeDebounce);
|
|
2461
2579
|
}, []);
|
|
2462
|
-
|
|
2580
|
+
useEffect6(() => {
|
|
2463
2581
|
window.addEventListener("resize", handleResize);
|
|
2464
2582
|
return () => window.removeEventListener("resize", handleResize);
|
|
2465
2583
|
}, [
|
|
@@ -2484,9 +2602,7 @@ var handleOpenAutoFocus = (event) => {
|
|
|
2484
2602
|
var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
2485
2603
|
var _effect = _useSignals25();
|
|
2486
2604
|
try {
|
|
2487
|
-
const [isLg] = useMediaQuery("lg"
|
|
2488
|
-
ssr: false
|
|
2489
|
-
});
|
|
2605
|
+
const [isLg] = useMediaQuery("lg");
|
|
2490
2606
|
const { tx } = useThemeContext();
|
|
2491
2607
|
const { t } = useTranslation();
|
|
2492
2608
|
const ref = useForwardedRef(forwardedRef);
|
|
@@ -2494,22 +2610,25 @@ var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToD
|
|
|
2494
2610
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2495
2611
|
onDismiss: () => onStateChange?.("closed")
|
|
2496
2612
|
});
|
|
2497
|
-
const handleKeyDown =
|
|
2498
|
-
|
|
2499
|
-
|
|
2613
|
+
const handleKeyDown = useCallback9((event) => {
|
|
2614
|
+
const focusGroupParent = event.target.closest("[data-tabster]");
|
|
2615
|
+
if (event.key === "Escape" && focusGroupParent) {
|
|
2616
|
+
event.preventDefault();
|
|
2617
|
+
event.stopPropagation();
|
|
2618
|
+
focusGroupParent.focus();
|
|
2500
2619
|
}
|
|
2501
2620
|
props.onKeyDown?.(event);
|
|
2502
2621
|
}, [
|
|
2503
2622
|
props.onKeyDown
|
|
2504
2623
|
]);
|
|
2505
|
-
const
|
|
2624
|
+
const Root8 = isLg ? Primitive8.div : DialogContent2;
|
|
2506
2625
|
return /* @__PURE__ */ React25.createElement(DialogRoot2, {
|
|
2507
2626
|
open: state !== "closed",
|
|
2508
2627
|
"aria-label": toLocalizedString(label, t),
|
|
2509
2628
|
modal: false
|
|
2510
2629
|
}, !isLg && /* @__PURE__ */ React25.createElement(DialogTitle2, {
|
|
2511
2630
|
className: "sr-only"
|
|
2512
|
-
}, toLocalizedString(label, t)), /* @__PURE__ */ React25.createElement(
|
|
2631
|
+
}, toLocalizedString(label, t)), /* @__PURE__ */ React25.createElement(Root8, {
|
|
2513
2632
|
...!isLg && {
|
|
2514
2633
|
forceMount: true,
|
|
2515
2634
|
tabIndex: -1,
|
|
@@ -2520,9 +2639,9 @@ var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToD
|
|
|
2520
2639
|
"data-state": state,
|
|
2521
2640
|
"data-resizing": resizing ? "true" : "false",
|
|
2522
2641
|
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
2523
|
-
|
|
2642
|
+
onKeyDownCapture: handleKeyDown,
|
|
2524
2643
|
...state === "closed" && {
|
|
2525
|
-
inert:
|
|
2644
|
+
inert: true
|
|
2526
2645
|
},
|
|
2527
2646
|
ref
|
|
2528
2647
|
}, children));
|
|
@@ -2573,9 +2692,9 @@ var MainContent = /* @__PURE__ */ forwardRef17(({ asChild, classNames, bounce, h
|
|
|
2573
2692
|
try {
|
|
2574
2693
|
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2575
2694
|
const { tx } = useThemeContext();
|
|
2576
|
-
const
|
|
2695
|
+
const Root8 = asChild ? Slot8 : role ? "div" : "main";
|
|
2577
2696
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
2578
|
-
return /* @__PURE__ */ React25.createElement(
|
|
2697
|
+
return /* @__PURE__ */ React25.createElement(Root8, {
|
|
2579
2698
|
role,
|
|
2580
2699
|
...handlesFocus && {
|
|
2581
2700
|
...mover
|
|
@@ -2598,9 +2717,7 @@ MainContent.displayName = MAIN_NAME;
|
|
|
2598
2717
|
var MainOverlay = /* @__PURE__ */ forwardRef17(({ classNames, ...props }, forwardedRef) => {
|
|
2599
2718
|
var _effect = _useSignals25();
|
|
2600
2719
|
try {
|
|
2601
|
-
const [isLg] = useMediaQuery("lg"
|
|
2602
|
-
ssr: false
|
|
2603
|
-
});
|
|
2720
|
+
const [isLg] = useMediaQuery("lg");
|
|
2604
2721
|
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2605
2722
|
const { tx } = useThemeContext();
|
|
2606
2723
|
return /* @__PURE__ */ React25.createElement("div", {
|
|
@@ -2638,7 +2755,7 @@ import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
|
2638
2755
|
import React26, { forwardRef as forwardRef18 } from "react";
|
|
2639
2756
|
|
|
2640
2757
|
// src/hooks/useSafeCollisionPadding.ts
|
|
2641
|
-
import { useMemo as
|
|
2758
|
+
import { useMemo as useMemo4 } from "react";
|
|
2642
2759
|
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
2643
2760
|
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
2644
2761
|
var safePadding = (propsPadding, safePadding2, side) => {
|
|
@@ -2646,7 +2763,7 @@ var safePadding = (propsPadding, safePadding2, side) => {
|
|
|
2646
2763
|
};
|
|
2647
2764
|
var useSafeCollisionPadding = (collisionPadding) => {
|
|
2648
2765
|
const { safeAreaPadding } = useThemeContext();
|
|
2649
|
-
return
|
|
2766
|
+
return useMemo4(() => ({
|
|
2650
2767
|
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
2651
2768
|
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
2652
2769
|
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
@@ -2669,6 +2786,7 @@ var ContextMenuContent = /* @__PURE__ */ forwardRef18(({ classNames, children, c
|
|
|
2669
2786
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2670
2787
|
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Content, {
|
|
2671
2788
|
...props,
|
|
2789
|
+
"data-arrow-keys": "up down",
|
|
2672
2790
|
collisionPadding: safeCollisionPadding,
|
|
2673
2791
|
className: tx("menu.content", "menu", {
|
|
2674
2792
|
elevation
|
|
@@ -2683,8 +2801,8 @@ var ContextMenuViewport = /* @__PURE__ */ forwardRef18(({ classNames, asChild, c
|
|
|
2683
2801
|
var _effect = _useSignals26();
|
|
2684
2802
|
try {
|
|
2685
2803
|
const { tx } = useThemeContext();
|
|
2686
|
-
const
|
|
2687
|
-
return /* @__PURE__ */ React26.createElement(
|
|
2804
|
+
const Root8 = asChild ? Slot9 : Primitive9.div;
|
|
2805
|
+
return /* @__PURE__ */ React26.createElement(Root8, {
|
|
2688
2806
|
...props,
|
|
2689
2807
|
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
2690
2808
|
ref: forwardedRef
|
|
@@ -2786,7 +2904,7 @@ import { createMenuScope } from "@radix-ui/react-menu";
|
|
|
2786
2904
|
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
2787
2905
|
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
2788
2906
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
2789
|
-
import React27, {
|
|
2907
|
+
import React27, { forwardRef as forwardRef19, useCallback as useCallback10, useEffect as useEffect7, useMemo as useMemo5, useRef as useRef3 } from "react";
|
|
2790
2908
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
2791
2909
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope3(DROPDOWN_MENU_NAME, [
|
|
2792
2910
|
createMenuScope
|
|
@@ -2811,7 +2929,7 @@ var DropdownMenuRoot = (props) => {
|
|
|
2811
2929
|
contentId: useId3(),
|
|
2812
2930
|
open,
|
|
2813
2931
|
onOpenChange: setOpen,
|
|
2814
|
-
onOpenToggle:
|
|
2932
|
+
onOpenToggle: useCallback10(() => setOpen((prevOpen) => !prevOpen), [
|
|
2815
2933
|
setOpen
|
|
2816
2934
|
]),
|
|
2817
2935
|
modal
|
|
@@ -2848,6 +2966,7 @@ var DropdownMenuTrigger = /* @__PURE__ */ forwardRef19((props, forwardedRef) =>
|
|
|
2848
2966
|
disabled,
|
|
2849
2967
|
...triggerProps,
|
|
2850
2968
|
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
2969
|
+
"data-arrow-keys": "down",
|
|
2851
2970
|
onPointerDown: composeEventHandlers2(props.onPointerDown, (event) => {
|
|
2852
2971
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
2853
2972
|
context.onOpenToggle();
|
|
@@ -2890,7 +3009,7 @@ var DropdownMenuVirtualTrigger = (props) => {
|
|
|
2890
3009
|
const { __scopeDropdownMenu, virtualRef } = props;
|
|
2891
3010
|
const context = useDropdownMenuContext(VIRTUAL_TRIGGER_NAME, __scopeDropdownMenu);
|
|
2892
3011
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2893
|
-
|
|
3012
|
+
useEffect7(() => {
|
|
2894
3013
|
if (virtualRef.current) {
|
|
2895
3014
|
context.triggerRef.current = virtualRef.current;
|
|
2896
3015
|
}
|
|
@@ -2923,8 +3042,8 @@ var DropdownMenuViewport = /* @__PURE__ */ forwardRef19(({ classNames, asChild,
|
|
|
2923
3042
|
var _effect = _useSignals27();
|
|
2924
3043
|
try {
|
|
2925
3044
|
const { tx } = useThemeContext();
|
|
2926
|
-
const
|
|
2927
|
-
return /* @__PURE__ */ React27.createElement(
|
|
3045
|
+
const Root8 = asChild ? Slot10 : Primitive10.div;
|
|
3046
|
+
return /* @__PURE__ */ React27.createElement(Root8, {
|
|
2928
3047
|
...props,
|
|
2929
3048
|
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
2930
3049
|
ref: forwardedRef
|
|
@@ -2937,18 +3056,35 @@ var CONTENT_NAME2 = "DropdownMenuContent";
|
|
|
2937
3056
|
var DropdownMenuContent = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2938
3057
|
var _effect = _useSignals27();
|
|
2939
3058
|
try {
|
|
2940
|
-
const { __scopeDropdownMenu, classNames, collisionPadding = 8, ...contentProps } = props;
|
|
3059
|
+
const { __scopeDropdownMenu, classNames, collisionPadding = 8, collisionBoundary, ...contentProps } = props;
|
|
2941
3060
|
const { tx } = useThemeContext();
|
|
2942
3061
|
const context = useDropdownMenuContext(CONTENT_NAME2, __scopeDropdownMenu);
|
|
2943
3062
|
const elevation = useElevationContext();
|
|
2944
3063
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2945
3064
|
const hasInteractedOutsideRef = useRef3(false);
|
|
2946
3065
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3066
|
+
const computedCollisionBoundary = useMemo5(() => {
|
|
3067
|
+
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
3068
|
+
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
3069
|
+
closestBoundary,
|
|
3070
|
+
...collisionBoundary
|
|
3071
|
+
] : collisionBoundary ? [
|
|
3072
|
+
closestBoundary,
|
|
3073
|
+
collisionBoundary
|
|
3074
|
+
] : [
|
|
3075
|
+
closestBoundary
|
|
3076
|
+
] : collisionBoundary;
|
|
3077
|
+
}, [
|
|
3078
|
+
context.open,
|
|
3079
|
+
collisionBoundary,
|
|
3080
|
+
context.triggerRef.current
|
|
3081
|
+
]);
|
|
2947
3082
|
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Content, {
|
|
2948
3083
|
id: context.contentId,
|
|
2949
3084
|
"aria-labelledby": context.triggerId,
|
|
2950
3085
|
...menuScope,
|
|
2951
3086
|
...contentProps,
|
|
3087
|
+
collisionBoundary: computedCollisionBoundary,
|
|
2952
3088
|
collisionPadding: safeCollisionPadding,
|
|
2953
3089
|
ref: forwardedRef,
|
|
2954
3090
|
onCloseAutoFocus: composeEventHandlers2(props.onCloseAutoFocus, (event) => {
|
|
@@ -2966,6 +3102,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef19((props, forwardedRef) =>
|
|
|
2966
3102
|
hasInteractedOutsideRef.current = true;
|
|
2967
3103
|
}
|
|
2968
3104
|
}),
|
|
3105
|
+
"data-arrow-keys": "up down",
|
|
2969
3106
|
className: tx("menu.content", "menu", {
|
|
2970
3107
|
elevation
|
|
2971
3108
|
}, classNames),
|
|
@@ -3076,11 +3213,13 @@ var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
|
3076
3213
|
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3077
3214
|
var _effect = _useSignals27();
|
|
3078
3215
|
try {
|
|
3079
|
-
const { __scopeDropdownMenu, ...
|
|
3216
|
+
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
3080
3217
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3081
|
-
|
|
3218
|
+
const { tx } = useThemeContext();
|
|
3219
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Item, {
|
|
3082
3220
|
...menuScope,
|
|
3083
|
-
...
|
|
3221
|
+
...itemProps,
|
|
3222
|
+
className: tx("menu.item", "menu__item", {}, classNames),
|
|
3084
3223
|
ref: forwardedRef
|
|
3085
3224
|
});
|
|
3086
3225
|
} finally {
|
|
@@ -3247,12 +3386,12 @@ var MessageRoot = /* @__PURE__ */ forwardRef20(({ asChild, valence = "neutral",
|
|
|
3247
3386
|
const titleId = useId4("message__title", propsTitleId);
|
|
3248
3387
|
const descriptionId = useId4("message__description", propsDescriptionId);
|
|
3249
3388
|
const elevation = useElevationContext(propsElevation);
|
|
3250
|
-
const
|
|
3389
|
+
const Root8 = asChild ? Slot11 : Primitive11.div;
|
|
3251
3390
|
return /* @__PURE__ */ React28.createElement(MessageProvider, {
|
|
3252
3391
|
titleId,
|
|
3253
3392
|
descriptionId,
|
|
3254
3393
|
valence
|
|
3255
|
-
}, /* @__PURE__ */ React28.createElement(
|
|
3394
|
+
}, /* @__PURE__ */ React28.createElement(Root8, {
|
|
3256
3395
|
role: valence === "neutral" ? "paragraph" : "alert",
|
|
3257
3396
|
...props,
|
|
3258
3397
|
className: tx("message.root", "message", {
|
|
@@ -3274,8 +3413,8 @@ var MessageTitle = /* @__PURE__ */ forwardRef20(({ asChild, classNames, children
|
|
|
3274
3413
|
try {
|
|
3275
3414
|
const { tx } = useThemeContext();
|
|
3276
3415
|
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3277
|
-
const
|
|
3278
|
-
return /* @__PURE__ */ React28.createElement(
|
|
3416
|
+
const Root8 = asChild ? Slot11 : Primitive11.h2;
|
|
3417
|
+
return /* @__PURE__ */ React28.createElement(Root8, {
|
|
3279
3418
|
...props,
|
|
3280
3419
|
className: tx("message.title", "message__title", {}, classNames),
|
|
3281
3420
|
id: titleId,
|
|
@@ -3298,8 +3437,8 @@ var MessageContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, childr
|
|
|
3298
3437
|
try {
|
|
3299
3438
|
const { tx } = useThemeContext();
|
|
3300
3439
|
const { descriptionId } = useMessageContext(MESSAGE_BODY_NAME);
|
|
3301
|
-
const
|
|
3302
|
-
return /* @__PURE__ */ React28.createElement(
|
|
3440
|
+
const Root8 = asChild ? Slot11 : Primitive11.p;
|
|
3441
|
+
return /* @__PURE__ */ React28.createElement(Root8, {
|
|
3303
3442
|
...props,
|
|
3304
3443
|
className: tx("message.content", "message__content", {}, classNames),
|
|
3305
3444
|
id: descriptionId,
|
|
@@ -3334,7 +3473,7 @@ import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
|
3334
3473
|
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
3335
3474
|
import { useControllableState as useControllableState6 } from "@radix-ui/react-use-controllable-state";
|
|
3336
3475
|
import { hideOthers } from "aria-hidden";
|
|
3337
|
-
import React29, { forwardRef as forwardRef21,
|
|
3476
|
+
import React29, { forwardRef as forwardRef21, useCallback as useCallback11, useEffect as useEffect8, useMemo as useMemo6, useRef as useRef4, useState as useState9 } from "react";
|
|
3338
3477
|
import { RemoveScroll } from "react-remove-scroll";
|
|
3339
3478
|
var POPOVER_NAME = "Popover";
|
|
3340
3479
|
var [createPopoverContext, createPopoverScope] = createContextScope4(POPOVER_NAME, [
|
|
@@ -3348,7 +3487,7 @@ var PopoverRoot = (props) => {
|
|
|
3348
3487
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
3349
3488
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3350
3489
|
const triggerRef = useRef4(null);
|
|
3351
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
3490
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState9(false);
|
|
3352
3491
|
const [open = false, setOpen] = useControllableState6({
|
|
3353
3492
|
prop: openProp,
|
|
3354
3493
|
defaultProp: defaultOpen,
|
|
@@ -3360,12 +3499,12 @@ var PopoverRoot = (props) => {
|
|
|
3360
3499
|
triggerRef,
|
|
3361
3500
|
open,
|
|
3362
3501
|
onOpenChange: setOpen,
|
|
3363
|
-
onOpenToggle:
|
|
3502
|
+
onOpenToggle: useCallback11(() => setOpen((prevOpen) => !prevOpen), [
|
|
3364
3503
|
setOpen
|
|
3365
3504
|
]),
|
|
3366
3505
|
hasCustomAnchor,
|
|
3367
|
-
onCustomAnchorAdd:
|
|
3368
|
-
onCustomAnchorRemove:
|
|
3506
|
+
onCustomAnchorAdd: useCallback11(() => setHasCustomAnchor(true), []),
|
|
3507
|
+
onCustomAnchorRemove: useCallback11(() => setHasCustomAnchor(false), []),
|
|
3369
3508
|
modal
|
|
3370
3509
|
}, children));
|
|
3371
3510
|
} finally {
|
|
@@ -3381,7 +3520,7 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
|
3381
3520
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
3382
3521
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3383
3522
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
3384
|
-
|
|
3523
|
+
useEffect8(() => {
|
|
3385
3524
|
onCustomAnchorAdd();
|
|
3386
3525
|
return () => onCustomAnchorRemove();
|
|
3387
3526
|
}, [
|
|
@@ -3432,7 +3571,7 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
3432
3571
|
const { __scopePopover, virtualRef } = props;
|
|
3433
3572
|
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
3434
3573
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3435
|
-
|
|
3574
|
+
useEffect8(() => {
|
|
3436
3575
|
if (virtualRef.current) {
|
|
3437
3576
|
context.triggerRef.current = virtualRef.current;
|
|
3438
3577
|
}
|
|
@@ -3497,7 +3636,7 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef21((props, forwardedRef) =>
|
|
|
3497
3636
|
const contentRef = useRef4(null);
|
|
3498
3637
|
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
3499
3638
|
const isRightClickOutsideRef = useRef4(false);
|
|
3500
|
-
|
|
3639
|
+
useEffect8(() => {
|
|
3501
3640
|
const content = contentRef.current;
|
|
3502
3641
|
if (content) {
|
|
3503
3642
|
return hideOthers(content);
|
|
@@ -3584,13 +3723,29 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef21((props, forwardedRef)
|
|
|
3584
3723
|
var PopoverContentImpl = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3585
3724
|
var _effect = _useSignals29();
|
|
3586
3725
|
try {
|
|
3587
|
-
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, classNames, ...contentProps } = props;
|
|
3726
|
+
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, collisionBoundary, classNames, ...contentProps } = props;
|
|
3588
3727
|
const context = usePopoverContext(CONTENT_NAME3, __scopePopover);
|
|
3589
3728
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3590
3729
|
const { tx } = useThemeContext();
|
|
3591
3730
|
const elevation = useElevationContext();
|
|
3592
3731
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3593
3732
|
useFocusGuards();
|
|
3733
|
+
const computedCollisionBoundary = useMemo6(() => {
|
|
3734
|
+
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
3735
|
+
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
3736
|
+
closestBoundary,
|
|
3737
|
+
...collisionBoundary
|
|
3738
|
+
] : collisionBoundary ? [
|
|
3739
|
+
closestBoundary,
|
|
3740
|
+
collisionBoundary
|
|
3741
|
+
] : [
|
|
3742
|
+
closestBoundary
|
|
3743
|
+
] : collisionBoundary;
|
|
3744
|
+
}, [
|
|
3745
|
+
context.open,
|
|
3746
|
+
collisionBoundary,
|
|
3747
|
+
context.triggerRef.current
|
|
3748
|
+
]);
|
|
3594
3749
|
return /* @__PURE__ */ React29.createElement(FocusScope, {
|
|
3595
3750
|
asChild: true,
|
|
3596
3751
|
loop: true,
|
|
@@ -3612,13 +3767,14 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
|
3612
3767
|
...popperScope,
|
|
3613
3768
|
...contentProps,
|
|
3614
3769
|
collisionPadding: safeCollisionPadding,
|
|
3770
|
+
collisionBoundary: computedCollisionBoundary,
|
|
3615
3771
|
className: tx("popover.content", "popover", {
|
|
3616
3772
|
elevation
|
|
3617
3773
|
}, classNames),
|
|
3618
3774
|
ref: forwardedRef,
|
|
3619
3775
|
style: {
|
|
3620
3776
|
...contentProps.style,
|
|
3621
|
-
//
|
|
3777
|
+
// Re-namespace exposed content custom properties.
|
|
3622
3778
|
...{
|
|
3623
3779
|
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3624
3780
|
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
@@ -3671,8 +3827,8 @@ var PopoverViewport = /* @__PURE__ */ forwardRef21(({ classNames, asChild, const
|
|
|
3671
3827
|
var _effect = _useSignals29();
|
|
3672
3828
|
try {
|
|
3673
3829
|
const { tx } = useThemeContext();
|
|
3674
|
-
const
|
|
3675
|
-
return /* @__PURE__ */ React29.createElement(
|
|
3830
|
+
const Root8 = asChild ? Slot12 : Primitive12.div;
|
|
3831
|
+
return /* @__PURE__ */ React29.createElement(Root8, {
|
|
3676
3832
|
...props,
|
|
3677
3833
|
className: tx("popover.viewport", "popover__viewport", {
|
|
3678
3834
|
constrainInline,
|
|
@@ -3731,7 +3887,7 @@ var Status = /* @__PURE__ */ forwardRef22(({ classNames, children, progress = 0,
|
|
|
3731
3887
|
|
|
3732
3888
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
3733
3889
|
import { useSignals as _useSignals31 } from "@preact-signals/safe-react/tracking";
|
|
3734
|
-
import {
|
|
3890
|
+
import { Corner as ScrollAreaPrimitiveCorner, Root as ScrollAreaPrimitiveRoot, Scrollbar as ScrollAreaPrimitiveScrollbar, Thumb as ScrollAreaPrimitiveThumb, Viewport as ScrollAreaPrimitiveViewport } from "@radix-ui/react-scroll-area";
|
|
3735
3891
|
import React31, { forwardRef as forwardRef23 } from "react";
|
|
3736
3892
|
var ScrollAreaRoot = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
3737
3893
|
var _effect = _useSignals31();
|
|
@@ -3807,44 +3963,206 @@ var ScrollArea = {
|
|
|
3807
3963
|
Corner: ScrollAreaCorner
|
|
3808
3964
|
};
|
|
3809
3965
|
|
|
3810
|
-
// src/components/
|
|
3966
|
+
// src/components/ScrollContainer/ScrollContainer.tsx
|
|
3811
3967
|
import { useSignals as _useSignals32 } from "@preact-signals/safe-react/tracking";
|
|
3968
|
+
import { useState as useState10 } from "@preact-signals/safe-react/react";
|
|
3969
|
+
import { createContext as createContext12 } from "@radix-ui/react-context";
|
|
3970
|
+
import React32, { forwardRef as forwardRef24, useCallback as useCallback12, useEffect as useEffect9, useImperativeHandle, useMemo as useMemo7, useRef as useRef5 } from "react";
|
|
3971
|
+
import { addEventListener, combine } from "@dxos/async";
|
|
3972
|
+
import { invariant } from "@dxos/invariant";
|
|
3973
|
+
import { useForwardedRef as useForwardedRef2 } from "@dxos/react-hooks";
|
|
3974
|
+
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
3975
|
+
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui/src/components/ScrollContainer/ScrollContainer.tsx";
|
|
3976
|
+
var isBottom = (el) => {
|
|
3977
|
+
return !!(el && el.scrollHeight - el.scrollTop === el.clientHeight);
|
|
3978
|
+
};
|
|
3979
|
+
var [ScrollContainerProvider, useScrollContainerContext] = createContext12("ScrollContainer");
|
|
3980
|
+
var Root5 = /* @__PURE__ */ forwardRef24(({ children, classNames, pin, fade }, forwardedRef) => {
|
|
3981
|
+
var _effect = _useSignals32();
|
|
3982
|
+
try {
|
|
3983
|
+
const scrollerRef = useRef5(null);
|
|
3984
|
+
const autoScrollRef = useRef5(false);
|
|
3985
|
+
const [overflow, setOverflow] = useState10(false);
|
|
3986
|
+
const [pinned, setPinned] = useState10(pin);
|
|
3987
|
+
const timeoutRef = useRef5(void 0);
|
|
3988
|
+
const scrollToBottom = useCallback12((behavior = "instant") => {
|
|
3989
|
+
if (scrollerRef.current) {
|
|
3990
|
+
autoScrollRef.current = true;
|
|
3991
|
+
scrollerRef.current.classList.add("scrollbar-none");
|
|
3992
|
+
scrollerRef.current.scrollTo({
|
|
3993
|
+
top: scrollerRef.current.scrollHeight,
|
|
3994
|
+
behavior
|
|
3995
|
+
});
|
|
3996
|
+
clearTimeout(timeoutRef.current);
|
|
3997
|
+
if (behavior !== "instant") {
|
|
3998
|
+
timeoutRef.current = setTimeout(() => {
|
|
3999
|
+
scrollerRef.current?.classList.remove("scrollbar-none");
|
|
4000
|
+
autoScrollRef.current = false;
|
|
4001
|
+
}, 500);
|
|
4002
|
+
}
|
|
4003
|
+
setPinned(true);
|
|
4004
|
+
}
|
|
4005
|
+
}, []);
|
|
4006
|
+
const controller = useMemo7(() => ({
|
|
4007
|
+
viewport: scrollerRef.current,
|
|
4008
|
+
scrollToTop: () => {
|
|
4009
|
+
invariant(scrollerRef.current, void 0, {
|
|
4010
|
+
F: __dxlog_file2,
|
|
4011
|
+
L: 92,
|
|
4012
|
+
S: void 0,
|
|
4013
|
+
A: [
|
|
4014
|
+
"scrollerRef.current",
|
|
4015
|
+
""
|
|
4016
|
+
]
|
|
4017
|
+
});
|
|
4018
|
+
scrollerRef.current.scrollTo({
|
|
4019
|
+
top: 0,
|
|
4020
|
+
behavior: "smooth"
|
|
4021
|
+
});
|
|
4022
|
+
setPinned(false);
|
|
4023
|
+
},
|
|
4024
|
+
scrollToBottom: () => {
|
|
4025
|
+
scrollToBottom("smooth");
|
|
4026
|
+
}
|
|
4027
|
+
}), [
|
|
4028
|
+
scrollToBottom,
|
|
4029
|
+
scrollerRef.current
|
|
4030
|
+
]);
|
|
4031
|
+
useImperativeHandle(forwardedRef, () => controller, [
|
|
4032
|
+
controller
|
|
4033
|
+
]);
|
|
4034
|
+
useEffect9(() => {
|
|
4035
|
+
if (!scrollerRef.current) {
|
|
4036
|
+
return;
|
|
4037
|
+
}
|
|
4038
|
+
return combine(
|
|
4039
|
+
// Check if user scrolls.
|
|
4040
|
+
addEventListener(scrollerRef.current, "wheel", () => {
|
|
4041
|
+
setPinned(isBottom(scrollerRef.current));
|
|
4042
|
+
}),
|
|
4043
|
+
// Check if scrolls.
|
|
4044
|
+
addEventListener(scrollerRef.current, "scroll", () => {
|
|
4045
|
+
setOverflow((scrollerRef.current?.scrollTop ?? 0) > 0);
|
|
4046
|
+
})
|
|
4047
|
+
);
|
|
4048
|
+
}, []);
|
|
4049
|
+
return /* @__PURE__ */ React32.createElement(ScrollContainerProvider, {
|
|
4050
|
+
pinned,
|
|
4051
|
+
controller,
|
|
4052
|
+
scrollToBottom
|
|
4053
|
+
}, /* @__PURE__ */ React32.createElement("div", {
|
|
4054
|
+
className: "relative grid flex-1 min-bs-0 overflow-hidden"
|
|
4055
|
+
}, fade && /* @__PURE__ */ React32.createElement("div", {
|
|
4056
|
+
role: "none",
|
|
4057
|
+
"data-visible": overflow,
|
|
4058
|
+
className: mx5(
|
|
4059
|
+
// NOTE: Gradients may not be visible with dark reader extensions.
|
|
4060
|
+
"z-10 absolute block-start-0 inset-inline-0 bs-24 is-full",
|
|
4061
|
+
'opacity-0 duration-200 transition-opacity data-[visible="true"]:opacity-100',
|
|
4062
|
+
"bg-gradient-to-b from-[--surface-bg] to-transparent pointer-events-none"
|
|
4063
|
+
)
|
|
4064
|
+
}), /* @__PURE__ */ React32.createElement("div", {
|
|
4065
|
+
className: mx5("flex flex-col min-bs-0 overflow-y-auto scrollbar-thin", classNames),
|
|
4066
|
+
ref: scrollerRef
|
|
4067
|
+
}, children)));
|
|
4068
|
+
} finally {
|
|
4069
|
+
_effect.f();
|
|
4070
|
+
}
|
|
4071
|
+
});
|
|
4072
|
+
Root5.displayName = "ScrollContainer.Root";
|
|
4073
|
+
var Viewport = /* @__PURE__ */ forwardRef24(({ classNames, children, ...props }, forwardedRef) => {
|
|
4074
|
+
var _effect = _useSignals32();
|
|
4075
|
+
try {
|
|
4076
|
+
const contentRef = useForwardedRef2(forwardedRef);
|
|
4077
|
+
const { pinned, scrollToBottom } = useScrollContainerContext(Viewport.displayName);
|
|
4078
|
+
useEffect9(() => {
|
|
4079
|
+
if (!pinned || !contentRef.current) {
|
|
4080
|
+
return;
|
|
4081
|
+
}
|
|
4082
|
+
const resizeObserver = new ResizeObserver(() => scrollToBottom());
|
|
4083
|
+
scrollToBottom("instant");
|
|
4084
|
+
resizeObserver.observe(contentRef.current);
|
|
4085
|
+
return () => {
|
|
4086
|
+
resizeObserver.disconnect();
|
|
4087
|
+
};
|
|
4088
|
+
}, [
|
|
4089
|
+
pinned,
|
|
4090
|
+
scrollToBottom
|
|
4091
|
+
]);
|
|
4092
|
+
return /* @__PURE__ */ React32.createElement("div", {
|
|
4093
|
+
className: mx5("is-full", classNames),
|
|
4094
|
+
...props,
|
|
4095
|
+
ref: contentRef
|
|
4096
|
+
}, children);
|
|
4097
|
+
} finally {
|
|
4098
|
+
_effect.f();
|
|
4099
|
+
}
|
|
4100
|
+
});
|
|
4101
|
+
Viewport.displayName = "ScrollContainer.Viewport";
|
|
4102
|
+
var ScrollDownButton = ({ classNames }) => {
|
|
4103
|
+
var _effect = _useSignals32();
|
|
4104
|
+
try {
|
|
4105
|
+
const { pinned, scrollToBottom } = useScrollContainerContext(ScrollDownButton.displayName);
|
|
4106
|
+
return /* @__PURE__ */ React32.createElement("div", {
|
|
4107
|
+
role: "none",
|
|
4108
|
+
className: mx5("absolute bottom-2 right-4 opacity-100 transition-opacity duration-300", pinned && "opacity-0", classNames)
|
|
4109
|
+
}, /* @__PURE__ */ React32.createElement(IconButton, {
|
|
4110
|
+
variant: "primary",
|
|
4111
|
+
icon: "ph--arrow-down--regular",
|
|
4112
|
+
iconOnly: true,
|
|
4113
|
+
size: 4,
|
|
4114
|
+
label: "Scroll down",
|
|
4115
|
+
onClick: () => scrollToBottom()
|
|
4116
|
+
}));
|
|
4117
|
+
} finally {
|
|
4118
|
+
_effect.f();
|
|
4119
|
+
}
|
|
4120
|
+
};
|
|
4121
|
+
ScrollDownButton.displayName = "ScrollContainer.ScrollDownButton";
|
|
4122
|
+
var ScrollContainer = {
|
|
4123
|
+
Root: Root5,
|
|
4124
|
+
Viewport,
|
|
4125
|
+
ScrollDownButton
|
|
4126
|
+
};
|
|
4127
|
+
|
|
4128
|
+
// src/components/Select/Select.tsx
|
|
4129
|
+
import { useSignals as _useSignals33 } from "@preact-signals/safe-react/tracking";
|
|
3812
4130
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3813
|
-
import
|
|
4131
|
+
import React33, { forwardRef as forwardRef25 } from "react";
|
|
3814
4132
|
var SelectRoot = SelectPrimitive.Root;
|
|
3815
4133
|
var SelectTrigger = SelectPrimitive.Trigger;
|
|
3816
4134
|
var SelectValue = SelectPrimitive.Value;
|
|
3817
4135
|
var SelectIcon = SelectPrimitive.Icon;
|
|
3818
4136
|
var SelectPortal = SelectPrimitive.Portal;
|
|
3819
|
-
var SelectTriggerButton = /* @__PURE__ */
|
|
3820
|
-
var _effect =
|
|
4137
|
+
var SelectTriggerButton = /* @__PURE__ */ forwardRef25(({ children, placeholder, ...props }, forwardedRef) => {
|
|
4138
|
+
var _effect = _useSignals33();
|
|
3821
4139
|
try {
|
|
3822
|
-
|
|
3823
|
-
return /* @__PURE__ */ React32.createElement(SelectPrimitive.Trigger, {
|
|
4140
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Trigger, {
|
|
3824
4141
|
asChild: true,
|
|
3825
4142
|
ref: forwardedRef
|
|
3826
|
-
}, /* @__PURE__ */
|
|
4143
|
+
}, /* @__PURE__ */ React33.createElement(Button, props, /* @__PURE__ */ React33.createElement(SelectPrimitive.Value, {
|
|
3827
4144
|
placeholder
|
|
3828
|
-
}, children), /* @__PURE__ */
|
|
3829
|
-
className: "
|
|
3830
|
-
}), /* @__PURE__ */
|
|
4145
|
+
}, children), /* @__PURE__ */ React33.createElement("span", {
|
|
4146
|
+
className: "is-1 flex-1"
|
|
4147
|
+
}), /* @__PURE__ */ React33.createElement(SelectPrimitive.Icon, {
|
|
3831
4148
|
asChild: true
|
|
3832
|
-
}, /* @__PURE__ */
|
|
3833
|
-
|
|
3834
|
-
|
|
4149
|
+
}, /* @__PURE__ */ React33.createElement(Icon, {
|
|
4150
|
+
size: 3,
|
|
4151
|
+
icon: "ph--caret-down--bold"
|
|
3835
4152
|
}))));
|
|
3836
4153
|
} finally {
|
|
3837
4154
|
_effect.f();
|
|
3838
4155
|
}
|
|
3839
4156
|
});
|
|
3840
|
-
var SelectContent = /* @__PURE__ */
|
|
3841
|
-
var _effect =
|
|
4157
|
+
var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
4158
|
+
var _effect = _useSignals33();
|
|
3842
4159
|
try {
|
|
3843
4160
|
const { tx } = useThemeContext();
|
|
3844
4161
|
const elevation = useElevationContext();
|
|
3845
4162
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3846
|
-
return /* @__PURE__ */
|
|
4163
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Content, {
|
|
3847
4164
|
...props,
|
|
4165
|
+
"data-arrow-keys": "up down",
|
|
3848
4166
|
collisionPadding: safeCollisionPadding,
|
|
3849
4167
|
className: tx("select.content", "select__content", {
|
|
3850
4168
|
elevation
|
|
@@ -3856,41 +4174,43 @@ var SelectContent = /* @__PURE__ */ forwardRef24(({ classNames, children, collis
|
|
|
3856
4174
|
_effect.f();
|
|
3857
4175
|
}
|
|
3858
4176
|
});
|
|
3859
|
-
var SelectScrollUpButton2 = /* @__PURE__ */
|
|
3860
|
-
var _effect =
|
|
4177
|
+
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4178
|
+
var _effect = _useSignals33();
|
|
3861
4179
|
try {
|
|
3862
4180
|
const { tx } = useThemeContext();
|
|
3863
|
-
return /* @__PURE__ */
|
|
4181
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
3864
4182
|
...props,
|
|
3865
4183
|
className: tx("select.scrollButton", "select__scroll-button--up", {}, classNames),
|
|
3866
4184
|
ref: forwardedRef
|
|
3867
|
-
}, children ?? /* @__PURE__ */
|
|
4185
|
+
}, children ?? /* @__PURE__ */ React33.createElement(Icon, {
|
|
4186
|
+
size: 3,
|
|
3868
4187
|
icon: "ph--caret-up--bold"
|
|
3869
4188
|
}));
|
|
3870
4189
|
} finally {
|
|
3871
4190
|
_effect.f();
|
|
3872
4191
|
}
|
|
3873
4192
|
});
|
|
3874
|
-
var SelectScrollDownButton2 = /* @__PURE__ */
|
|
3875
|
-
var _effect =
|
|
4193
|
+
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4194
|
+
var _effect = _useSignals33();
|
|
3876
4195
|
try {
|
|
3877
4196
|
const { tx } = useThemeContext();
|
|
3878
|
-
return /* @__PURE__ */
|
|
4197
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
3879
4198
|
...props,
|
|
3880
4199
|
className: tx("select.scrollButton", "select__scroll-button--down", {}, classNames),
|
|
3881
4200
|
ref: forwardedRef
|
|
3882
|
-
}, children ?? /* @__PURE__ */
|
|
4201
|
+
}, children ?? /* @__PURE__ */ React33.createElement(Icon, {
|
|
4202
|
+
size: 3,
|
|
3883
4203
|
icon: "ph--caret-down--bold"
|
|
3884
4204
|
}));
|
|
3885
4205
|
} finally {
|
|
3886
4206
|
_effect.f();
|
|
3887
4207
|
}
|
|
3888
4208
|
});
|
|
3889
|
-
var SelectViewport2 = /* @__PURE__ */
|
|
3890
|
-
var _effect =
|
|
4209
|
+
var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4210
|
+
var _effect = _useSignals33();
|
|
3891
4211
|
try {
|
|
3892
4212
|
const { tx } = useThemeContext();
|
|
3893
|
-
return /* @__PURE__ */
|
|
4213
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectViewport, {
|
|
3894
4214
|
...props,
|
|
3895
4215
|
className: tx("select.viewport", "select__viewport", {}, classNames),
|
|
3896
4216
|
ref: forwardedRef
|
|
@@ -3899,11 +4219,11 @@ var SelectViewport2 = /* @__PURE__ */ forwardRef24(({ classNames, asChild, child
|
|
|
3899
4219
|
_effect.f();
|
|
3900
4220
|
}
|
|
3901
4221
|
});
|
|
3902
|
-
var SelectItem = /* @__PURE__ */
|
|
3903
|
-
var _effect =
|
|
4222
|
+
var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
4223
|
+
var _effect = _useSignals33();
|
|
3904
4224
|
try {
|
|
3905
4225
|
const { tx } = useThemeContext();
|
|
3906
|
-
return /* @__PURE__ */
|
|
4226
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Item, {
|
|
3907
4227
|
...props,
|
|
3908
4228
|
className: tx("select.item", "option", {}, classNames),
|
|
3909
4229
|
ref: forwardedRef
|
|
@@ -3913,11 +4233,11 @@ var SelectItem = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, forward
|
|
|
3913
4233
|
}
|
|
3914
4234
|
});
|
|
3915
4235
|
var SelectItemText = SelectPrimitive.ItemText;
|
|
3916
|
-
var SelectItemIndicator = /* @__PURE__ */
|
|
3917
|
-
var _effect =
|
|
4236
|
+
var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4237
|
+
var _effect = _useSignals33();
|
|
3918
4238
|
try {
|
|
3919
4239
|
const { tx } = useThemeContext();
|
|
3920
|
-
return /* @__PURE__ */
|
|
4240
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.ItemIndicator, {
|
|
3921
4241
|
...props,
|
|
3922
4242
|
className: tx("select.itemIndicator", "option__indicator", {}, classNames),
|
|
3923
4243
|
ref: forwardedRef
|
|
@@ -3926,17 +4246,17 @@ var SelectItemIndicator = /* @__PURE__ */ forwardRef24(({ classNames, children,
|
|
|
3926
4246
|
_effect.f();
|
|
3927
4247
|
}
|
|
3928
4248
|
});
|
|
3929
|
-
var SelectOption = /* @__PURE__ */
|
|
3930
|
-
var _effect =
|
|
4249
|
+
var SelectOption = /* @__PURE__ */ forwardRef25(({ children, classNames, ...props }, forwardedRef) => {
|
|
4250
|
+
var _effect = _useSignals33();
|
|
3931
4251
|
try {
|
|
3932
4252
|
const { tx } = useThemeContext();
|
|
3933
|
-
return /* @__PURE__ */
|
|
4253
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Item, {
|
|
3934
4254
|
...props,
|
|
3935
4255
|
className: tx("select.item", "option", {}, classNames),
|
|
3936
4256
|
ref: forwardedRef
|
|
3937
|
-
}, /* @__PURE__ */
|
|
3938
|
-
className: "grow
|
|
3939
|
-
}), /* @__PURE__ */
|
|
4257
|
+
}, /* @__PURE__ */ React33.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ React33.createElement("span", {
|
|
4258
|
+
className: "grow is-1"
|
|
4259
|
+
}), /* @__PURE__ */ React33.createElement(Icon, {
|
|
3940
4260
|
icon: "ph--check--regular"
|
|
3941
4261
|
}));
|
|
3942
4262
|
} finally {
|
|
@@ -3945,11 +4265,11 @@ var SelectOption = /* @__PURE__ */ forwardRef24(({ children, classNames, ...prop
|
|
|
3945
4265
|
});
|
|
3946
4266
|
var SelectGroup = SelectPrimitive.Group;
|
|
3947
4267
|
var SelectLabel = SelectPrimitive.Label;
|
|
3948
|
-
var SelectSeparator = /* @__PURE__ */
|
|
3949
|
-
var _effect =
|
|
4268
|
+
var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
4269
|
+
var _effect = _useSignals33();
|
|
3950
4270
|
try {
|
|
3951
4271
|
const { tx } = useThemeContext();
|
|
3952
|
-
return /* @__PURE__ */
|
|
4272
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Separator, {
|
|
3953
4273
|
...props,
|
|
3954
4274
|
className: tx("select.separator", "select__separator", {}, classNames),
|
|
3955
4275
|
ref: forwardedRef
|
|
@@ -3958,11 +4278,11 @@ var SelectSeparator = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, fo
|
|
|
3958
4278
|
_effect.f();
|
|
3959
4279
|
}
|
|
3960
4280
|
});
|
|
3961
|
-
var SelectArrow = /* @__PURE__ */
|
|
3962
|
-
var _effect =
|
|
4281
|
+
var SelectArrow = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
4282
|
+
var _effect = _useSignals33();
|
|
3963
4283
|
try {
|
|
3964
4284
|
const { tx } = useThemeContext();
|
|
3965
|
-
return /* @__PURE__ */
|
|
4285
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Arrow, {
|
|
3966
4286
|
...props,
|
|
3967
4287
|
className: tx("select.arrow", "select__arrow", {}, classNames),
|
|
3968
4288
|
ref: forwardedRef
|
|
@@ -3993,14 +4313,14 @@ var Select = {
|
|
|
3993
4313
|
};
|
|
3994
4314
|
|
|
3995
4315
|
// src/components/Separator/Separator.tsx
|
|
3996
|
-
import { useSignals as
|
|
4316
|
+
import { useSignals as _useSignals34 } from "@preact-signals/safe-react/tracking";
|
|
3997
4317
|
import { Separator as SeparatorPrimitive } from "@radix-ui/react-separator";
|
|
3998
|
-
import
|
|
3999
|
-
var Separator4 = /* @__PURE__ */
|
|
4000
|
-
var _effect =
|
|
4318
|
+
import React34, { forwardRef as forwardRef26 } from "react";
|
|
4319
|
+
var Separator4 = /* @__PURE__ */ forwardRef26(({ classNames, orientation = "horizontal", subdued, ...props }, forwardedRef) => {
|
|
4320
|
+
var _effect = _useSignals34();
|
|
4001
4321
|
try {
|
|
4002
4322
|
const { tx } = useThemeContext();
|
|
4003
|
-
return /* @__PURE__ */
|
|
4323
|
+
return /* @__PURE__ */ React34.createElement(SeparatorPrimitive, {
|
|
4004
4324
|
orientation,
|
|
4005
4325
|
...props,
|
|
4006
4326
|
className: tx("separator.root", "separator", {
|
|
@@ -4015,16 +4335,16 @@ var Separator4 = /* @__PURE__ */ forwardRef25(({ classNames, orientation = "hori
|
|
|
4015
4335
|
});
|
|
4016
4336
|
|
|
4017
4337
|
// src/components/Tag/Tag.tsx
|
|
4018
|
-
import { useSignals as
|
|
4338
|
+
import { useSignals as _useSignals35 } from "@preact-signals/safe-react/tracking";
|
|
4019
4339
|
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
4020
4340
|
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
4021
|
-
import
|
|
4022
|
-
var Tag = /* @__PURE__ */
|
|
4023
|
-
var _effect =
|
|
4341
|
+
import React35, { forwardRef as forwardRef27 } from "react";
|
|
4342
|
+
var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
4343
|
+
var _effect = _useSignals35();
|
|
4024
4344
|
try {
|
|
4025
4345
|
const { tx } = useThemeContext();
|
|
4026
|
-
const
|
|
4027
|
-
return /* @__PURE__ */
|
|
4346
|
+
const Root8 = asChild ? Slot13 : Primitive13.span;
|
|
4347
|
+
return /* @__PURE__ */ React35.createElement(Root8, {
|
|
4028
4348
|
...props,
|
|
4029
4349
|
className: tx("tag.root", "dx-tag", {
|
|
4030
4350
|
palette
|
|
@@ -4038,17 +4358,17 @@ var Tag = /* @__PURE__ */ forwardRef26(({ asChild, palette = "neutral", classNam
|
|
|
4038
4358
|
});
|
|
4039
4359
|
|
|
4040
4360
|
// src/components/Toast/Toast.tsx
|
|
4041
|
-
import { useSignals as
|
|
4361
|
+
import { useSignals as _useSignals36 } from "@preact-signals/safe-react/tracking";
|
|
4042
4362
|
import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
|
|
4043
4363
|
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
4044
|
-
import {
|
|
4045
|
-
import
|
|
4364
|
+
import { ToastAction as ToastActionPrimitive, ToastClose as ToastClosePrimitive, ToastDescription as ToastDescriptionPrimitive, ToastProvider as ToastProviderPrimitive, Root as ToastRootPrimitive, ToastTitle as ToastTitlePrimitive, ToastViewport as ToastViewportPrimitive } from "@radix-ui/react-toast";
|
|
4365
|
+
import React36, { forwardRef as forwardRef28 } from "react";
|
|
4046
4366
|
var ToastProvider = ToastProviderPrimitive;
|
|
4047
|
-
var ToastViewport = /* @__PURE__ */
|
|
4048
|
-
var _effect =
|
|
4367
|
+
var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forwardedRef) => {
|
|
4368
|
+
var _effect = _useSignals36();
|
|
4049
4369
|
try {
|
|
4050
4370
|
const { tx } = useThemeContext();
|
|
4051
|
-
return /* @__PURE__ */
|
|
4371
|
+
return /* @__PURE__ */ React36.createElement(ToastViewportPrimitive, {
|
|
4052
4372
|
className: tx("toast.viewport", "toast-viewport", {}, classNames),
|
|
4053
4373
|
ref: forwardedRef
|
|
4054
4374
|
});
|
|
@@ -4056,27 +4376,27 @@ var ToastViewport = /* @__PURE__ */ forwardRef27(({ classNames, ...props }, forw
|
|
|
4056
4376
|
_effect.f();
|
|
4057
4377
|
}
|
|
4058
4378
|
});
|
|
4059
|
-
var ToastRoot = /* @__PURE__ */
|
|
4060
|
-
var _effect =
|
|
4379
|
+
var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
4380
|
+
var _effect = _useSignals36();
|
|
4061
4381
|
try {
|
|
4062
4382
|
const { tx } = useThemeContext();
|
|
4063
|
-
return /* @__PURE__ */
|
|
4383
|
+
return /* @__PURE__ */ React36.createElement(ToastRootPrimitive, {
|
|
4064
4384
|
...props,
|
|
4065
4385
|
className: tx("toast.root", "toast", {}, classNames),
|
|
4066
4386
|
ref: forwardedRef
|
|
4067
|
-
}, /* @__PURE__ */
|
|
4387
|
+
}, /* @__PURE__ */ React36.createElement(ElevationProvider, {
|
|
4068
4388
|
elevation: "toast"
|
|
4069
4389
|
}, children));
|
|
4070
4390
|
} finally {
|
|
4071
4391
|
_effect.f();
|
|
4072
4392
|
}
|
|
4073
4393
|
});
|
|
4074
|
-
var ToastBody = /* @__PURE__ */
|
|
4075
|
-
var _effect =
|
|
4394
|
+
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4395
|
+
var _effect = _useSignals36();
|
|
4076
4396
|
try {
|
|
4077
4397
|
const { tx } = useThemeContext();
|
|
4078
|
-
const
|
|
4079
|
-
return /* @__PURE__ */
|
|
4398
|
+
const Root8 = asChild ? Slot14 : Primitive14.div;
|
|
4399
|
+
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4080
4400
|
...props,
|
|
4081
4401
|
className: tx("toast.body", "toast__body", {}, classNames),
|
|
4082
4402
|
ref: forwardedRef
|
|
@@ -4085,12 +4405,12 @@ var ToastBody = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...props },
|
|
|
4085
4405
|
_effect.f();
|
|
4086
4406
|
}
|
|
4087
4407
|
});
|
|
4088
|
-
var ToastTitle = /* @__PURE__ */
|
|
4089
|
-
var _effect =
|
|
4408
|
+
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4409
|
+
var _effect = _useSignals36();
|
|
4090
4410
|
try {
|
|
4091
4411
|
const { tx } = useThemeContext();
|
|
4092
|
-
const
|
|
4093
|
-
return /* @__PURE__ */
|
|
4412
|
+
const Root8 = asChild ? Slot14 : ToastTitlePrimitive;
|
|
4413
|
+
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4094
4414
|
...props,
|
|
4095
4415
|
className: tx("toast.title", "toast__title", {}, classNames),
|
|
4096
4416
|
ref: forwardedRef
|
|
@@ -4099,12 +4419,12 @@ var ToastTitle = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...props }
|
|
|
4099
4419
|
_effect.f();
|
|
4100
4420
|
}
|
|
4101
4421
|
});
|
|
4102
|
-
var ToastDescription = /* @__PURE__ */
|
|
4103
|
-
var _effect =
|
|
4422
|
+
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4423
|
+
var _effect = _useSignals36();
|
|
4104
4424
|
try {
|
|
4105
4425
|
const { tx } = useThemeContext();
|
|
4106
|
-
const
|
|
4107
|
-
return /* @__PURE__ */
|
|
4426
|
+
const Root8 = asChild ? Slot14 : ToastDescriptionPrimitive;
|
|
4427
|
+
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4108
4428
|
...props,
|
|
4109
4429
|
className: tx("toast.description", "toast__description", {}, classNames),
|
|
4110
4430
|
ref: forwardedRef
|
|
@@ -4113,12 +4433,12 @@ var ToastDescription = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...p
|
|
|
4113
4433
|
_effect.f();
|
|
4114
4434
|
}
|
|
4115
4435
|
});
|
|
4116
|
-
var ToastActions = /* @__PURE__ */
|
|
4117
|
-
var _effect =
|
|
4436
|
+
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4437
|
+
var _effect = _useSignals36();
|
|
4118
4438
|
try {
|
|
4119
4439
|
const { tx } = useThemeContext();
|
|
4120
|
-
const
|
|
4121
|
-
return /* @__PURE__ */
|
|
4440
|
+
const Root8 = asChild ? Slot14 : Primitive14.div;
|
|
4441
|
+
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4122
4442
|
...props,
|
|
4123
4443
|
className: tx("toast.actions", "toast__actions", {}, classNames),
|
|
4124
4444
|
ref: forwardedRef
|
|
@@ -4142,30 +4462,39 @@ var Toast = {
|
|
|
4142
4462
|
};
|
|
4143
4463
|
|
|
4144
4464
|
// src/components/Toolbar/Toolbar.tsx
|
|
4145
|
-
import { useSignals as
|
|
4465
|
+
import { useSignals as _useSignals37 } from "@preact-signals/safe-react/tracking";
|
|
4146
4466
|
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
4147
|
-
import
|
|
4148
|
-
var ToolbarRoot = /* @__PURE__ */
|
|
4149
|
-
var _effect =
|
|
4467
|
+
import React37, { Fragment, forwardRef as forwardRef29 } from "react";
|
|
4468
|
+
var ToolbarRoot = /* @__PURE__ */ forwardRef29(({ classNames, children, layoutManaged, textBlockWidth: textBlockWidthParam, disabled, ...props }, forwardedRef) => {
|
|
4469
|
+
var _effect = _useSignals37();
|
|
4150
4470
|
try {
|
|
4151
4471
|
const { tx } = useThemeContext();
|
|
4152
|
-
|
|
4472
|
+
const InnerRoot = textBlockWidthParam ? "div" : Fragment;
|
|
4473
|
+
const innerRootProps = textBlockWidthParam ? {
|
|
4474
|
+
role: "none",
|
|
4475
|
+
className: tx("toolbar.inner", "toolbar", {
|
|
4476
|
+
layoutManaged
|
|
4477
|
+
}, classNames)
|
|
4478
|
+
} : {};
|
|
4479
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Root, {
|
|
4153
4480
|
...props,
|
|
4481
|
+
"data-arrow-keys": props.orientation === "vertical" ? "up down" : "left right",
|
|
4154
4482
|
className: tx("toolbar.root", "toolbar", {
|
|
4155
|
-
layoutManaged
|
|
4483
|
+
layoutManaged,
|
|
4484
|
+
disabled
|
|
4156
4485
|
}, classNames),
|
|
4157
4486
|
ref: forwardedRef
|
|
4158
|
-
}, children);
|
|
4487
|
+
}, /* @__PURE__ */ React37.createElement(InnerRoot, innerRootProps, children));
|
|
4159
4488
|
} finally {
|
|
4160
4489
|
_effect.f();
|
|
4161
4490
|
}
|
|
4162
4491
|
});
|
|
4163
|
-
var ToolbarButton = /* @__PURE__ */
|
|
4164
|
-
var _effect =
|
|
4492
|
+
var ToolbarButton = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4493
|
+
var _effect = _useSignals37();
|
|
4165
4494
|
try {
|
|
4166
|
-
return /* @__PURE__ */
|
|
4495
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
4167
4496
|
asChild: true
|
|
4168
|
-
}, /* @__PURE__ */
|
|
4497
|
+
}, /* @__PURE__ */ React37.createElement(Button, {
|
|
4169
4498
|
...props,
|
|
4170
4499
|
ref: forwardedRef
|
|
4171
4500
|
}));
|
|
@@ -4173,12 +4502,12 @@ var ToolbarButton = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
4173
4502
|
_effect.f();
|
|
4174
4503
|
}
|
|
4175
4504
|
});
|
|
4176
|
-
var ToolbarIconButton = /* @__PURE__ */
|
|
4177
|
-
var _effect =
|
|
4505
|
+
var ToolbarIconButton = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4506
|
+
var _effect = _useSignals37();
|
|
4178
4507
|
try {
|
|
4179
|
-
return /* @__PURE__ */
|
|
4508
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
4180
4509
|
asChild: true
|
|
4181
|
-
}, /* @__PURE__ */
|
|
4510
|
+
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
4182
4511
|
...props,
|
|
4183
4512
|
ref: forwardedRef
|
|
4184
4513
|
}));
|
|
@@ -4186,12 +4515,12 @@ var ToolbarIconButton = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
4186
4515
|
_effect.f();
|
|
4187
4516
|
}
|
|
4188
4517
|
});
|
|
4189
|
-
var ToolbarToggle = /* @__PURE__ */
|
|
4190
|
-
var _effect =
|
|
4518
|
+
var ToolbarToggle = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4519
|
+
var _effect = _useSignals37();
|
|
4191
4520
|
try {
|
|
4192
|
-
return /* @__PURE__ */
|
|
4521
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
4193
4522
|
asChild: true
|
|
4194
|
-
}, /* @__PURE__ */
|
|
4523
|
+
}, /* @__PURE__ */ React37.createElement(Toggle, {
|
|
4195
4524
|
...props,
|
|
4196
4525
|
ref: forwardedRef
|
|
4197
4526
|
}));
|
|
@@ -4199,12 +4528,12 @@ var ToolbarToggle = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
4199
4528
|
_effect.f();
|
|
4200
4529
|
}
|
|
4201
4530
|
});
|
|
4202
|
-
var ToolbarLink = /* @__PURE__ */
|
|
4203
|
-
var _effect =
|
|
4531
|
+
var ToolbarLink = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4532
|
+
var _effect = _useSignals37();
|
|
4204
4533
|
try {
|
|
4205
|
-
return /* @__PURE__ */
|
|
4534
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Link, {
|
|
4206
4535
|
asChild: true
|
|
4207
|
-
}, /* @__PURE__ */
|
|
4536
|
+
}, /* @__PURE__ */ React37.createElement(Link, {
|
|
4208
4537
|
...props,
|
|
4209
4538
|
ref: forwardedRef
|
|
4210
4539
|
}));
|
|
@@ -4212,13 +4541,13 @@ var ToolbarLink = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
4212
4541
|
_effect.f();
|
|
4213
4542
|
}
|
|
4214
4543
|
});
|
|
4215
|
-
var ToolbarToggleGroup2 = /* @__PURE__ */
|
|
4216
|
-
var _effect =
|
|
4544
|
+
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef29(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
4545
|
+
var _effect = _useSignals37();
|
|
4217
4546
|
try {
|
|
4218
|
-
return /* @__PURE__ */
|
|
4547
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
4219
4548
|
...props,
|
|
4220
4549
|
asChild: true
|
|
4221
|
-
}, /* @__PURE__ */
|
|
4550
|
+
}, /* @__PURE__ */ React37.createElement(ButtonGroup, {
|
|
4222
4551
|
classNames,
|
|
4223
4552
|
children,
|
|
4224
4553
|
elevation,
|
|
@@ -4228,13 +4557,13 @@ var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef28(({ classNames, children,
|
|
|
4228
4557
|
_effect.f();
|
|
4229
4558
|
}
|
|
4230
4559
|
});
|
|
4231
|
-
var ToolbarToggleGroupItem = /* @__PURE__ */
|
|
4232
|
-
var _effect =
|
|
4560
|
+
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef29(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
4561
|
+
var _effect = _useSignals37();
|
|
4233
4562
|
try {
|
|
4234
|
-
return /* @__PURE__ */
|
|
4563
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
4235
4564
|
...props,
|
|
4236
4565
|
asChild: true
|
|
4237
|
-
}, /* @__PURE__ */
|
|
4566
|
+
}, /* @__PURE__ */ React37.createElement(Button, {
|
|
4238
4567
|
variant,
|
|
4239
4568
|
density,
|
|
4240
4569
|
elevation,
|
|
@@ -4246,13 +4575,13 @@ var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef28(({ variant, density, e
|
|
|
4246
4575
|
_effect.f();
|
|
4247
4576
|
}
|
|
4248
4577
|
});
|
|
4249
|
-
var ToolbarToggleGroupIconItem = /* @__PURE__ */
|
|
4250
|
-
var _effect =
|
|
4578
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef29(({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
4579
|
+
var _effect = _useSignals37();
|
|
4251
4580
|
try {
|
|
4252
|
-
return /* @__PURE__ */
|
|
4581
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
4253
4582
|
...props,
|
|
4254
4583
|
asChild: true
|
|
4255
|
-
}, /* @__PURE__ */
|
|
4584
|
+
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
4256
4585
|
variant,
|
|
4257
4586
|
density,
|
|
4258
4587
|
elevation,
|
|
@@ -4266,15 +4595,15 @@ var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef28(({ variant, densit
|
|
|
4266
4595
|
_effect.f();
|
|
4267
4596
|
}
|
|
4268
4597
|
});
|
|
4269
|
-
var ToolbarSeparator = /* @__PURE__ */
|
|
4270
|
-
var _effect =
|
|
4598
|
+
var ToolbarSeparator = /* @__PURE__ */ forwardRef29(({ variant = "line", ...props }, forwardedRef) => {
|
|
4599
|
+
var _effect = _useSignals37();
|
|
4271
4600
|
try {
|
|
4272
|
-
return variant === "line" ? /* @__PURE__ */
|
|
4601
|
+
return variant === "line" ? /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Separator, {
|
|
4273
4602
|
asChild: true
|
|
4274
|
-
}, /* @__PURE__ */
|
|
4603
|
+
}, /* @__PURE__ */ React37.createElement(Separator4, {
|
|
4275
4604
|
...props,
|
|
4276
4605
|
ref: forwardedRef
|
|
4277
|
-
})) : /* @__PURE__ */
|
|
4606
|
+
})) : /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Separator, {
|
|
4278
4607
|
className: "grow",
|
|
4279
4608
|
ref: forwardedRef
|
|
4280
4609
|
});
|
|
@@ -4329,8 +4658,11 @@ export {
|
|
|
4329
4658
|
Toggle,
|
|
4330
4659
|
ToggleGroup,
|
|
4331
4660
|
ToggleGroupItem,
|
|
4661
|
+
ToggleGroupIconItem,
|
|
4332
4662
|
useClipboard,
|
|
4663
|
+
Domino,
|
|
4333
4664
|
hasIosKeyboard,
|
|
4665
|
+
usePx,
|
|
4334
4666
|
DensityContext,
|
|
4335
4667
|
DensityProvider,
|
|
4336
4668
|
ElevationContext,
|
|
@@ -4341,8 +4673,8 @@ export {
|
|
|
4341
4673
|
Dialog,
|
|
4342
4674
|
AlertDialog,
|
|
4343
4675
|
Input,
|
|
4344
|
-
LIST_NAME,
|
|
4345
4676
|
LIST_ITEM_NAME,
|
|
4677
|
+
LIST_NAME,
|
|
4346
4678
|
useListContext,
|
|
4347
4679
|
useListItemContext,
|
|
4348
4680
|
List,
|
|
@@ -4366,10 +4698,12 @@ export {
|
|
|
4366
4698
|
Popover,
|
|
4367
4699
|
Status,
|
|
4368
4700
|
ScrollArea,
|
|
4701
|
+
useScrollContainerContext,
|
|
4702
|
+
ScrollContainer,
|
|
4369
4703
|
Select,
|
|
4370
4704
|
Separator4 as Separator,
|
|
4371
4705
|
Tag,
|
|
4372
4706
|
Toast,
|
|
4373
4707
|
Toolbar
|
|
4374
4708
|
};
|
|
4375
|
-
//# sourceMappingURL=chunk-
|
|
4709
|
+
//# sourceMappingURL=chunk-SP7VQH72.mjs.map
|