@dxos/react-ui 0.8.4-main.f9ba587 → 0.8.4-main.fffef41
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-T6YPS45E.mjs → chunk-N5GDJTT2.mjs} +704 -373
- package/dist/lib/browser/chunk-N5GDJTT2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +11 -1
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +57 -30
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-TYVQJ4KW.mjs → chunk-SP7VQH72.mjs} +704 -373
- package/dist/lib/node-esm/chunk-SP7VQH72.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +11 -1
- package/dist/lib/node-esm/index.mjs.map +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +57 -30
- 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/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 +3 -1
- 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 +26 -23
- 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 +3 -3
- package/src/components/{Buttons → Button}/Button.stories.tsx +10 -11
- package/src/components/{Buttons → Button}/IconButton.stories.tsx +11 -8
- package/src/components/{Buttons → Button}/IconButton.tsx +16 -14
- package/src/components/Button/Toggle.stories.tsx +37 -0
- package/src/components/{Buttons → Button}/ToggleGroup.stories.tsx +13 -10
- package/src/components/{Buttons → Button}/ToggleGroup.tsx +17 -4
- package/src/components/Clipboard/ClipboardProvider.tsx +1 -1
- package/src/components/Clipboard/CopyButton.tsx +4 -3
- 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 +22 -20
- package/src/components/{Lists → List}/List.tsx +15 -16
- 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 -9
- 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 +21 -19
- 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/useSafeCollisionPadding.ts +1 -1
- package/src/hooks/useVisualViewport.ts +4 -4
- package/src/playground/Controls.stories.tsx +20 -17
- 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 +3 -1
- package/src/util/usePx.ts +61 -0
- package/dist/lib/browser/chunk-T6YPS45E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TYVQJ4KW.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/components/Buttons/Toggle.stories.tsx +0 -33
- package/src/testing/decorators/withTheme.ts +0 -22
- /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,
|
|
@@ -269,23 +269,44 @@ var Avatar = {
|
|
|
269
269
|
};
|
|
270
270
|
|
|
271
271
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
272
|
-
import { useSignals as
|
|
273
|
-
import { Dot } from "@phosphor-icons/react";
|
|
272
|
+
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
274
273
|
import { Primitive as Primitive4 } from "@radix-ui/react-primitive";
|
|
275
274
|
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
276
|
-
import
|
|
275
|
+
import React6, { forwardRef as forwardRef5 } from "react";
|
|
277
276
|
|
|
278
|
-
// src/components/
|
|
277
|
+
// src/components/Icon/Icon.tsx
|
|
279
278
|
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
279
|
+
import React4, { forwardRef as forwardRef3, memo } from "react";
|
|
280
|
+
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef3(({ icon, classNames, size = 4, ...props }, forwardedRef) => {
|
|
281
|
+
var _effect = _useSignals4();
|
|
282
|
+
try {
|
|
283
|
+
const { tx } = useThemeContext();
|
|
284
|
+
const href = useIconHref(icon);
|
|
285
|
+
return /* @__PURE__ */ React4.createElement("svg", {
|
|
286
|
+
...props,
|
|
287
|
+
className: tx("icon.root", "icon", {
|
|
288
|
+
size
|
|
289
|
+
}, classNames),
|
|
290
|
+
ref: forwardedRef
|
|
291
|
+
}, /* @__PURE__ */ React4.createElement("use", {
|
|
292
|
+
href
|
|
293
|
+
}));
|
|
294
|
+
} finally {
|
|
295
|
+
_effect.f();
|
|
296
|
+
}
|
|
297
|
+
}));
|
|
298
|
+
|
|
299
|
+
// src/components/Link/Link.tsx
|
|
300
|
+
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
280
301
|
import { Primitive as Primitive3 } from "@radix-ui/react-primitive";
|
|
281
302
|
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
282
|
-
import
|
|
283
|
-
var Link = /* @__PURE__ */
|
|
284
|
-
var _effect =
|
|
303
|
+
import React5, { forwardRef as forwardRef4 } from "react";
|
|
304
|
+
var Link = /* @__PURE__ */ forwardRef4(({ asChild, variant, classNames, ...props }, forwardedRef) => {
|
|
305
|
+
var _effect = _useSignals5();
|
|
285
306
|
try {
|
|
286
307
|
const { tx } = useThemeContext();
|
|
287
|
-
const
|
|
288
|
-
return /* @__PURE__ */
|
|
308
|
+
const Root8 = asChild ? Slot3 : Primitive3.a;
|
|
309
|
+
return /* @__PURE__ */ React5.createElement(Root8, {
|
|
289
310
|
...props,
|
|
290
311
|
className: tx("link.root", "link", {
|
|
291
312
|
variant
|
|
@@ -298,12 +319,12 @@ var Link = /* @__PURE__ */ forwardRef3(({ asChild, variant, classNames, ...props
|
|
|
298
319
|
});
|
|
299
320
|
|
|
300
321
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
301
|
-
var BreadcrumbRoot = /* @__PURE__ */
|
|
302
|
-
var _effect =
|
|
322
|
+
var BreadcrumbRoot = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
323
|
+
var _effect = _useSignals6();
|
|
303
324
|
try {
|
|
304
325
|
const { tx } = useThemeContext();
|
|
305
|
-
const
|
|
306
|
-
return /* @__PURE__ */
|
|
326
|
+
const Root8 = asChild ? Slot4 : Primitive4.div;
|
|
327
|
+
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
307
328
|
role: "navigation",
|
|
308
329
|
...props,
|
|
309
330
|
className: tx("breadcrumb.root", "breadcrumb", {}, classNames),
|
|
@@ -313,12 +334,12 @@ var BreadcrumbRoot = /* @__PURE__ */ forwardRef4(({ asChild, classNames, ...prop
|
|
|
313
334
|
_effect.f();
|
|
314
335
|
}
|
|
315
336
|
});
|
|
316
|
-
var BreadcrumbList = /* @__PURE__ */
|
|
317
|
-
var _effect =
|
|
337
|
+
var BreadcrumbList = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
338
|
+
var _effect = _useSignals6();
|
|
318
339
|
try {
|
|
319
340
|
const { tx } = useThemeContext();
|
|
320
|
-
const
|
|
321
|
-
return /* @__PURE__ */
|
|
341
|
+
const Root8 = asChild ? Slot4 : Primitive4.ol;
|
|
342
|
+
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
322
343
|
role: "list",
|
|
323
344
|
...props,
|
|
324
345
|
className: tx("breadcrumb.list", "breadcrumb__list", {}, classNames),
|
|
@@ -328,12 +349,12 @@ var BreadcrumbList = /* @__PURE__ */ forwardRef4(({ asChild, classNames, ...prop
|
|
|
328
349
|
_effect.f();
|
|
329
350
|
}
|
|
330
351
|
});
|
|
331
|
-
var BreadcrumbListItem = /* @__PURE__ */
|
|
332
|
-
var _effect =
|
|
352
|
+
var BreadcrumbListItem = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
353
|
+
var _effect = _useSignals6();
|
|
333
354
|
try {
|
|
334
355
|
const { tx } = useThemeContext();
|
|
335
|
-
const
|
|
336
|
-
return /* @__PURE__ */
|
|
356
|
+
const Root8 = asChild ? Slot4 : Primitive4.li;
|
|
357
|
+
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
337
358
|
role: "listitem",
|
|
338
359
|
...props,
|
|
339
360
|
className: tx("breadcrumb.listItem", "breadcrumb__list__item", {}, classNames),
|
|
@@ -343,11 +364,11 @@ var BreadcrumbListItem = /* @__PURE__ */ forwardRef4(({ asChild, classNames, ...
|
|
|
343
364
|
_effect.f();
|
|
344
365
|
}
|
|
345
366
|
});
|
|
346
|
-
var BreadcrumbLink = /* @__PURE__ */
|
|
347
|
-
var _effect =
|
|
367
|
+
var BreadcrumbLink = /* @__PURE__ */ forwardRef5(({ asChild, ...props }, forwardedRef) => {
|
|
368
|
+
var _effect = _useSignals6();
|
|
348
369
|
try {
|
|
349
|
-
const
|
|
350
|
-
return /* @__PURE__ */
|
|
370
|
+
const Root8 = asChild ? Slot4 : Link;
|
|
371
|
+
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
351
372
|
...props,
|
|
352
373
|
ref: forwardedRef
|
|
353
374
|
});
|
|
@@ -355,12 +376,12 @@ var BreadcrumbLink = /* @__PURE__ */ forwardRef4(({ asChild, ...props }, forward
|
|
|
355
376
|
_effect.f();
|
|
356
377
|
}
|
|
357
378
|
});
|
|
358
|
-
var BreadcrumbCurrent = /* @__PURE__ */
|
|
359
|
-
var _effect =
|
|
379
|
+
var BreadcrumbCurrent = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
380
|
+
var _effect = _useSignals6();
|
|
360
381
|
try {
|
|
361
382
|
const { tx } = useThemeContext();
|
|
362
|
-
const
|
|
363
|
-
return /* @__PURE__ */
|
|
383
|
+
const Root8 = asChild ? Slot4 : "h1";
|
|
384
|
+
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
364
385
|
...props,
|
|
365
386
|
"aria-current": "page",
|
|
366
387
|
className: tx("breadcrumb.current", "breadcrumb__item__heading--current", {}, classNames),
|
|
@@ -371,16 +392,16 @@ var BreadcrumbCurrent = /* @__PURE__ */ forwardRef4(({ asChild, classNames, ...p
|
|
|
371
392
|
}
|
|
372
393
|
});
|
|
373
394
|
var BreadcrumbSeparator = ({ children, classNames, ...props }) => {
|
|
374
|
-
var _effect =
|
|
395
|
+
var _effect = _useSignals6();
|
|
375
396
|
try {
|
|
376
397
|
const { tx } = useThemeContext();
|
|
377
|
-
return /* @__PURE__ */
|
|
398
|
+
return /* @__PURE__ */ React6.createElement(Primitive4.span, {
|
|
378
399
|
role: "separator",
|
|
379
400
|
"aria-hidden": "true",
|
|
380
401
|
...props,
|
|
381
402
|
className: tx("breadcrumb.separator", "breadcrumb__separator", {}, classNames)
|
|
382
|
-
}, children ?? /* @__PURE__ */
|
|
383
|
-
|
|
403
|
+
}, children ?? /* @__PURE__ */ React6.createElement(Icon, {
|
|
404
|
+
icon: "ph--dot--bold"
|
|
384
405
|
}));
|
|
385
406
|
} finally {
|
|
386
407
|
_effect.f();
|
|
@@ -395,26 +416,26 @@ var Breadcrumb = {
|
|
|
395
416
|
Separator: BreadcrumbSeparator
|
|
396
417
|
};
|
|
397
418
|
|
|
398
|
-
// src/components/
|
|
399
|
-
import { useSignals as
|
|
419
|
+
// src/components/Button/Button.tsx
|
|
420
|
+
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
400
421
|
import { createContext as createContext3 } from "@radix-ui/react-context";
|
|
401
422
|
import { Primitive as Primitive5 } from "@radix-ui/react-primitive";
|
|
402
423
|
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
403
|
-
import
|
|
424
|
+
import React7, { forwardRef as forwardRef6, memo as memo2 } from "react";
|
|
404
425
|
var BUTTON_GROUP_NAME = "ButtonGroup";
|
|
405
426
|
var BUTTON_NAME = "Button";
|
|
406
427
|
var [ButtonGroupProvider, useButtonGroupContext] = createContext3(BUTTON_GROUP_NAME, {
|
|
407
428
|
inGroup: false
|
|
408
429
|
});
|
|
409
|
-
var Button = /* @__PURE__ */
|
|
410
|
-
var _effect =
|
|
430
|
+
var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef6(({ classNames, children, density: propsDensity, elevation: propsElevation, variant = "default", asChild, ...props }, ref) => {
|
|
431
|
+
var _effect = _useSignals7();
|
|
411
432
|
try {
|
|
412
433
|
const { inGroup } = useButtonGroupContext(BUTTON_NAME);
|
|
413
434
|
const { tx } = useThemeContext();
|
|
414
435
|
const elevation = useElevationContext(propsElevation);
|
|
415
436
|
const density = useDensityContext(propsDensity);
|
|
416
|
-
const
|
|
417
|
-
return /* @__PURE__ */
|
|
437
|
+
const Root8 = asChild ? Slot5 : Primitive5.button;
|
|
438
|
+
return /* @__PURE__ */ React7.createElement(Root8, {
|
|
418
439
|
ref,
|
|
419
440
|
...props,
|
|
420
441
|
"data-variant": variant,
|
|
@@ -436,20 +457,20 @@ var Button = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef5(({ classNames, chi
|
|
|
436
457
|
}
|
|
437
458
|
}));
|
|
438
459
|
Button.displayName = BUTTON_NAME;
|
|
439
|
-
var ButtonGroup = /* @__PURE__ */
|
|
440
|
-
var _effect =
|
|
460
|
+
var ButtonGroup = /* @__PURE__ */ forwardRef6(({ children, elevation: propsElevation, classNames, asChild, ...props }, forwardedRef) => {
|
|
461
|
+
var _effect = _useSignals7();
|
|
441
462
|
try {
|
|
442
463
|
const { tx } = useThemeContext();
|
|
443
464
|
const elevation = useElevationContext(propsElevation);
|
|
444
|
-
const
|
|
445
|
-
return /* @__PURE__ */
|
|
465
|
+
const Root8 = asChild ? Slot5 : Primitive5.div;
|
|
466
|
+
return /* @__PURE__ */ React7.createElement(Root8, {
|
|
446
467
|
role: "none",
|
|
447
468
|
...props,
|
|
448
469
|
className: tx("button.group", "button-group", {
|
|
449
470
|
elevation
|
|
450
471
|
}, classNames),
|
|
451
472
|
ref: forwardedRef
|
|
452
|
-
}, /* @__PURE__ */
|
|
473
|
+
}, /* @__PURE__ */ React7.createElement(ButtonGroupProvider, {
|
|
453
474
|
inGroup: true
|
|
454
475
|
}, children));
|
|
455
476
|
} finally {
|
|
@@ -458,32 +479,10 @@ var ButtonGroup = /* @__PURE__ */ forwardRef5(({ children, elevation: propsEleva
|
|
|
458
479
|
});
|
|
459
480
|
ButtonGroup.displayName = BUTTON_GROUP_NAME;
|
|
460
481
|
|
|
461
|
-
// src/components/
|
|
482
|
+
// src/components/Button/IconButton.tsx
|
|
462
483
|
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
463
484
|
import React9, { forwardRef as forwardRef8 } from "react";
|
|
464
485
|
|
|
465
|
-
// src/components/Icon/Icon.tsx
|
|
466
|
-
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
467
|
-
import React7, { forwardRef as forwardRef6, memo as memo2 } from "react";
|
|
468
|
-
var Icon = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef6(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
469
|
-
var _effect = _useSignals7();
|
|
470
|
-
try {
|
|
471
|
-
const { tx } = useThemeContext();
|
|
472
|
-
const href = useIconHref(icon);
|
|
473
|
-
return /* @__PURE__ */ React7.createElement("svg", {
|
|
474
|
-
...props,
|
|
475
|
-
className: tx("icon.root", "icon", {
|
|
476
|
-
size
|
|
477
|
-
}, classNames),
|
|
478
|
-
ref: forwardedRef
|
|
479
|
-
}, /* @__PURE__ */ React7.createElement("use", {
|
|
480
|
-
href
|
|
481
|
-
}));
|
|
482
|
-
} finally {
|
|
483
|
-
_effect.f();
|
|
484
|
-
}
|
|
485
|
-
}));
|
|
486
|
-
|
|
487
486
|
// src/components/Tooltip/Tooltip.tsx
|
|
488
487
|
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
489
488
|
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
@@ -1107,8 +1106,22 @@ var Tooltip = {
|
|
|
1107
1106
|
Trigger: TooltipTrigger
|
|
1108
1107
|
};
|
|
1109
1108
|
|
|
1110
|
-
// src/components/
|
|
1111
|
-
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) => {
|
|
1112
1125
|
var _effect = _useSignals9();
|
|
1113
1126
|
try {
|
|
1114
1127
|
if (noTooltip) {
|
|
@@ -1129,7 +1142,7 @@ var IconOnlyButton = /* @__PURE__ */ forwardRef8(({ noTooltip, tooltipPortal = t
|
|
|
1129
1142
|
_effect.f();
|
|
1130
1143
|
}
|
|
1131
1144
|
});
|
|
1132
|
-
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) => {
|
|
1133
1146
|
var _effect = _useSignals9();
|
|
1134
1147
|
try {
|
|
1135
1148
|
const { tx } = useThemeContext();
|
|
@@ -1139,7 +1152,7 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size, iconOnly, la
|
|
|
1139
1152
|
iconOnly
|
|
1140
1153
|
}, classNames),
|
|
1141
1154
|
ref: forwardedRef
|
|
1142
|
-
}, /* @__PURE__ */ React9.createElement(Icon, {
|
|
1155
|
+
}, icon && /* @__PURE__ */ React9.createElement(Icon, {
|
|
1143
1156
|
icon,
|
|
1144
1157
|
size,
|
|
1145
1158
|
classNames: iconClassNames
|
|
@@ -1153,22 +1166,8 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size, iconOnly, la
|
|
|
1153
1166
|
_effect.f();
|
|
1154
1167
|
}
|
|
1155
1168
|
});
|
|
1156
|
-
var IconButton = /* @__PURE__ */ forwardRef8((props, forwardedRef) => {
|
|
1157
|
-
var _effect = _useSignals9();
|
|
1158
|
-
try {
|
|
1159
|
-
return props.iconOnly ? /* @__PURE__ */ React9.createElement(IconOnlyButton, {
|
|
1160
|
-
...props,
|
|
1161
|
-
ref: forwardedRef
|
|
1162
|
-
}) : /* @__PURE__ */ React9.createElement(LabelledIconButton, {
|
|
1163
|
-
...props,
|
|
1164
|
-
ref: forwardedRef
|
|
1165
|
-
});
|
|
1166
|
-
} finally {
|
|
1167
|
-
_effect.f();
|
|
1168
|
-
}
|
|
1169
|
-
});
|
|
1170
1169
|
|
|
1171
|
-
// src/components/
|
|
1170
|
+
// src/components/Button/Toggle.tsx
|
|
1172
1171
|
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
1173
1172
|
import { Toggle as TogglePrimitive } from "@radix-ui/react-toggle";
|
|
1174
1173
|
import React10, { forwardRef as forwardRef9 } from "react";
|
|
@@ -1189,9 +1188,9 @@ var Toggle = /* @__PURE__ */ forwardRef9(({ defaultPressed, pressed, onPressedCh
|
|
|
1189
1188
|
}
|
|
1190
1189
|
});
|
|
1191
1190
|
|
|
1192
|
-
// src/components/
|
|
1191
|
+
// src/components/Button/ToggleGroup.tsx
|
|
1193
1192
|
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
1194
|
-
import {
|
|
1193
|
+
import { ToggleGroupItem as ToggleGroupItemPrimitive, ToggleGroup as ToggleGroupPrimitive } from "@radix-ui/react-toggle-group";
|
|
1195
1194
|
import React11, { forwardRef as forwardRef10 } from "react";
|
|
1196
1195
|
var ToggleGroup = /* @__PURE__ */ forwardRef10(({ classNames, children, ...props }, forwardedRef) => {
|
|
1197
1196
|
var _effect = _useSignals11();
|
|
@@ -1226,6 +1225,26 @@ var ToggleGroupItem = /* @__PURE__ */ forwardRef10(({ variant, elevation, densit
|
|
|
1226
1225
|
_effect.f();
|
|
1227
1226
|
}
|
|
1228
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
|
+
});
|
|
1229
1248
|
|
|
1230
1249
|
// src/components/Clipboard/ClipboardProvider.tsx
|
|
1231
1250
|
import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
|
|
@@ -1258,18 +1277,103 @@ var ClipboardProvider = ({ children }) => {
|
|
|
1258
1277
|
// src/components/Clipboard/CopyButton.tsx
|
|
1259
1278
|
import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
|
|
1260
1279
|
import React16 from "react";
|
|
1261
|
-
import { mx as
|
|
1280
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
1262
1281
|
|
|
1263
1282
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
1264
1283
|
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1265
1284
|
import { createKeyborg } from "keyborg";
|
|
1266
|
-
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
|
+
};
|
|
1267
1329
|
|
|
1268
1330
|
// src/util/hasIosKeyboard.ts
|
|
1269
1331
|
var hasIosKeyboard = () => {
|
|
1270
1332
|
return !!navigator.userAgent.match(/iP(ad|od|hone).+Safari/);
|
|
1271
1333
|
};
|
|
1272
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
|
+
|
|
1273
1377
|
// src/components/DensityProvider/DensityProvider.tsx
|
|
1274
1378
|
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1275
1379
|
import React13, { createContext as createContext5 } from "react";
|
|
@@ -1313,7 +1417,7 @@ var ThemeContext = /* @__PURE__ */ createContext7(void 0);
|
|
|
1313
1417
|
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", ...rest }) => {
|
|
1314
1418
|
var _effect = _useSignals15();
|
|
1315
1419
|
try {
|
|
1316
|
-
|
|
1420
|
+
useEffect4(() => {
|
|
1317
1421
|
if (document.defaultView) {
|
|
1318
1422
|
const kb = createKeyborg(document.defaultView);
|
|
1319
1423
|
kb.subscribe(handleInputModalityChange);
|
|
@@ -1321,7 +1425,7 @@ var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx
|
|
|
1321
1425
|
}
|
|
1322
1426
|
}, []);
|
|
1323
1427
|
const safeAreaPadding = useSafeArea();
|
|
1324
|
-
const contextValue =
|
|
1428
|
+
const contextValue = useMemo3(() => ({
|
|
1325
1429
|
tx,
|
|
1326
1430
|
themeMode,
|
|
1327
1431
|
hasIosKeyboard: hasIosKeyboard(),
|
|
@@ -1374,7 +1478,7 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1374
1478
|
"data-testid": "copy-invitation"
|
|
1375
1479
|
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1376
1480
|
role: "none",
|
|
1377
|
-
className:
|
|
1481
|
+
className: mx3("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
1378
1482
|
}, /* @__PURE__ */ React16.createElement("span", {
|
|
1379
1483
|
className: "pli-1"
|
|
1380
1484
|
}, t("copy label")), /* @__PURE__ */ React16.createElement(Icon, {
|
|
@@ -1382,7 +1486,7 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1382
1486
|
size
|
|
1383
1487
|
})), /* @__PURE__ */ React16.createElement("div", {
|
|
1384
1488
|
role: "none",
|
|
1385
|
-
className:
|
|
1489
|
+
className: mx3("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
1386
1490
|
}, /* @__PURE__ */ React16.createElement("span", {
|
|
1387
1491
|
className: "pli-1"
|
|
1388
1492
|
}, t("copy success label")), /* @__PURE__ */ React16.createElement(Icon, {
|
|
@@ -1426,10 +1530,10 @@ var Clipboard = {
|
|
|
1426
1530
|
Provider: ClipboardProvider
|
|
1427
1531
|
};
|
|
1428
1532
|
|
|
1429
|
-
// src/components/
|
|
1533
|
+
// src/components/Dialog/Dialog.tsx
|
|
1430
1534
|
import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
|
|
1431
1535
|
import { createContext as createContext8 } from "@radix-ui/react-context";
|
|
1432
|
-
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";
|
|
1433
1537
|
import React17, { forwardRef as forwardRef11 } from "react";
|
|
1434
1538
|
var DialogRoot = (props) => {
|
|
1435
1539
|
var _effect = _useSignals17();
|
|
@@ -1525,9 +1629,9 @@ var Dialog = {
|
|
|
1525
1629
|
Close: DialogClose
|
|
1526
1630
|
};
|
|
1527
1631
|
|
|
1528
|
-
// src/components/
|
|
1632
|
+
// src/components/Dialog/AlertDialog.tsx
|
|
1529
1633
|
import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
|
|
1530
|
-
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";
|
|
1531
1635
|
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
1532
1636
|
import React18, { forwardRef as forwardRef12 } from "react";
|
|
1533
1637
|
var AlertDialogRoot = (props) => {
|
|
@@ -1629,9 +1733,9 @@ var AlertDialog = {
|
|
|
1629
1733
|
import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
|
|
1630
1734
|
import { Root as CheckboxPrimitive } from "@radix-ui/react-checkbox";
|
|
1631
1735
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
1632
|
-
import React19, { forwardRef as forwardRef13, useCallback as
|
|
1633
|
-
import {
|
|
1634
|
-
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";
|
|
1635
1739
|
var Label = /* @__PURE__ */ forwardRef13(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1636
1740
|
var _effect = _useSignals19();
|
|
1637
1741
|
try {
|
|
@@ -1701,7 +1805,7 @@ var PinInput = /* @__PURE__ */ forwardRef13(({ density: propsDensity, elevation:
|
|
|
1701
1805
|
const { tx } = useThemeContext();
|
|
1702
1806
|
const density = useDensityContext(propsDensity);
|
|
1703
1807
|
const elevation = useElevationContext(propsElevation);
|
|
1704
|
-
const segmentClassName =
|
|
1808
|
+
const segmentClassName = useCallback6(({ focused, validationValence }) => tx("input.input", "input--pin-segment", {
|
|
1705
1809
|
variant: "static",
|
|
1706
1810
|
focused,
|
|
1707
1811
|
disabled: props.disabled,
|
|
@@ -1783,7 +1887,7 @@ var TextArea = /* @__PURE__ */ forwardRef13(({ __inputScope, classNames, density
|
|
|
1783
1887
|
_effect.f();
|
|
1784
1888
|
}
|
|
1785
1889
|
});
|
|
1786
|
-
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) => {
|
|
1787
1891
|
var _effect = _useSignals19();
|
|
1788
1892
|
try {
|
|
1789
1893
|
const [checked, onCheckedChange] = useControllableState2({
|
|
@@ -1829,7 +1933,7 @@ var Switch = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked
|
|
|
1829
1933
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1830
1934
|
return /* @__PURE__ */ React19.createElement("input", {
|
|
1831
1935
|
type: "checkbox",
|
|
1832
|
-
className:
|
|
1936
|
+
className: mx4("dx-checkbox--switch dx-focus-ring", classNames),
|
|
1833
1937
|
checked,
|
|
1834
1938
|
onChange: (event) => {
|
|
1835
1939
|
onCheckedChange(event.target.checked);
|
|
@@ -1860,14 +1964,13 @@ var Input = {
|
|
|
1860
1964
|
DescriptionAndValidation
|
|
1861
1965
|
};
|
|
1862
1966
|
|
|
1863
|
-
// src/components/
|
|
1967
|
+
// src/components/List/List.tsx
|
|
1864
1968
|
import { useSignals as _useSignals21 } from "@preact-signals/safe-react/tracking";
|
|
1865
|
-
import { CaretDown, CaretRight } from "@phosphor-icons/react";
|
|
1866
1969
|
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
1867
1970
|
import React21, { forwardRef as forwardRef14 } from "react";
|
|
1868
|
-
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";
|
|
1869
1972
|
|
|
1870
|
-
// src/components/
|
|
1973
|
+
// src/components/List/ListDropIndicator.tsx
|
|
1871
1974
|
import { useSignals as _useSignals20 } from "@preact-signals/safe-react/tracking";
|
|
1872
1975
|
import React20 from "react";
|
|
1873
1976
|
var edgeToOrientationMap = {
|
|
@@ -1878,7 +1981,7 @@ var edgeToOrientationMap = {
|
|
|
1878
1981
|
};
|
|
1879
1982
|
var orientationStyles = {
|
|
1880
1983
|
horizontal: "h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]",
|
|
1881
|
-
vertical: "
|
|
1984
|
+
vertical: "is-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]"
|
|
1882
1985
|
};
|
|
1883
1986
|
var edgeStyles = {
|
|
1884
1987
|
top: "top-[--line-offset] before:top-[--offset-terminal]",
|
|
@@ -1911,7 +2014,7 @@ var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineIns
|
|
|
1911
2014
|
}
|
|
1912
2015
|
};
|
|
1913
2016
|
|
|
1914
|
-
// src/components/
|
|
2017
|
+
// src/components/List/List.tsx
|
|
1915
2018
|
var List = /* @__PURE__ */ forwardRef14(({ classNames, children, ...props }, forwardedRef) => {
|
|
1916
2019
|
var _effect = _useSignals21();
|
|
1917
2020
|
try {
|
|
@@ -1931,10 +2034,10 @@ var List = /* @__PURE__ */ forwardRef14(({ classNames, children, ...props }, for
|
|
|
1931
2034
|
var ListItemEndcap = /* @__PURE__ */ forwardRef14(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
1932
2035
|
var _effect = _useSignals21();
|
|
1933
2036
|
try {
|
|
1934
|
-
const
|
|
2037
|
+
const Root8 = asChild ? Slot6 : "div";
|
|
1935
2038
|
const density = useDensityContext();
|
|
1936
2039
|
const { tx } = useThemeContext();
|
|
1937
|
-
return /* @__PURE__ */ React21.createElement(
|
|
2040
|
+
return /* @__PURE__ */ React21.createElement(Root8, {
|
|
1938
2041
|
...!asChild && {
|
|
1939
2042
|
role: "none"
|
|
1940
2043
|
},
|
|
@@ -1986,16 +2089,16 @@ var ListItemOpenTrigger = /* @__PURE__ */ forwardRef14(({ __listItemScope, class
|
|
|
1986
2089
|
const { tx } = useThemeContext();
|
|
1987
2090
|
const density = useDensityContext();
|
|
1988
2091
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
1989
|
-
const Icon3 = open ? CaretDown : CaretRight;
|
|
1990
2092
|
return /* @__PURE__ */ React21.createElement(ListPrimitiveItemOpenTrigger, {
|
|
1991
2093
|
...props,
|
|
1992
2094
|
className: tx("list.item.openTrigger", "list__listItem__openTrigger", {
|
|
1993
2095
|
density
|
|
1994
2096
|
}, classNames),
|
|
1995
2097
|
ref: forwardedRef
|
|
1996
|
-
}, children || /* @__PURE__ */ React21.createElement(
|
|
1997
|
-
|
|
1998
|
-
|
|
2098
|
+
}, children || /* @__PURE__ */ React21.createElement(Icon, {
|
|
2099
|
+
size: 3,
|
|
2100
|
+
icon: open ? "ph--caret-down--bold" : "ph--caret-right--bold",
|
|
2101
|
+
classNames: tx("list.item.openTriggerIcon", "list__listItem__openTrigger__icon", {})
|
|
1999
2102
|
}));
|
|
2000
2103
|
} finally {
|
|
2001
2104
|
_effect.f();
|
|
@@ -2028,11 +2131,11 @@ var ListItem = {
|
|
|
2028
2131
|
DropIndicator: ListDropIndicator
|
|
2029
2132
|
};
|
|
2030
2133
|
|
|
2031
|
-
// src/components/
|
|
2134
|
+
// src/components/List/Tree.tsx
|
|
2032
2135
|
import { useSignals as _useSignals23 } from "@preact-signals/safe-react/tracking";
|
|
2033
2136
|
import React23, { forwardRef as forwardRef15 } from "react";
|
|
2034
2137
|
|
|
2035
|
-
// src/components/
|
|
2138
|
+
// src/components/List/TreeDropIndicator.tsx
|
|
2036
2139
|
import { useSignals as _useSignals22 } from "@preact-signals/safe-react/tracking";
|
|
2037
2140
|
import React22 from "react";
|
|
2038
2141
|
var edgeToOrientationMap2 = {
|
|
@@ -2083,7 +2186,7 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
2083
2186
|
}
|
|
2084
2187
|
};
|
|
2085
2188
|
|
|
2086
|
-
// src/components/
|
|
2189
|
+
// src/components/List/Tree.tsx
|
|
2087
2190
|
var TreeRoot = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
2088
2191
|
var _effect = _useSignals23();
|
|
2089
2192
|
try {
|
|
@@ -2137,14 +2240,14 @@ var TreeItem = {
|
|
|
2137
2240
|
DropIndicator: TreeDropIndicator
|
|
2138
2241
|
};
|
|
2139
2242
|
|
|
2140
|
-
// src/components/
|
|
2243
|
+
// src/components/List/Treegrid.tsx
|
|
2141
2244
|
import { useSignals as _useSignals24 } from "@preact-signals/safe-react/tracking";
|
|
2142
|
-
import {
|
|
2245
|
+
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
2143
2246
|
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
2144
2247
|
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
2145
2248
|
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
2146
2249
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
2147
|
-
import React24, { forwardRef as forwardRef16 } from "react";
|
|
2250
|
+
import React24, { forwardRef as forwardRef16, useCallback as useCallback7 } from "react";
|
|
2148
2251
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2149
2252
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
2150
2253
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
@@ -2154,15 +2257,44 @@ var TreegridRoot = /* @__PURE__ */ forwardRef16(({ asChild, classNames, children
|
|
|
2154
2257
|
var _effect = _useSignals24();
|
|
2155
2258
|
try {
|
|
2156
2259
|
const { tx } = useThemeContext();
|
|
2157
|
-
const
|
|
2158
|
-
const
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
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, {
|
|
2164
2296
|
role: "treegrid",
|
|
2165
|
-
|
|
2297
|
+
onKeyDown: handleKeyDown,
|
|
2166
2298
|
...props,
|
|
2167
2299
|
className: tx("treegrid.root", "treegrid", {}, classNames),
|
|
2168
2300
|
style: {
|
|
@@ -2179,7 +2311,7 @@ var TreegridRow = /* @__PURE__ */ forwardRef16(({ __treegridRowScope, asChild, c
|
|
|
2179
2311
|
var _effect = _useSignals24();
|
|
2180
2312
|
try {
|
|
2181
2313
|
const { tx } = useThemeContext();
|
|
2182
|
-
const
|
|
2314
|
+
const Root8 = asChild ? Slot7 : Primitive7.div;
|
|
2183
2315
|
const pathParts = id.split(PATH_SEPARATOR);
|
|
2184
2316
|
const level = pathParts.length - 1;
|
|
2185
2317
|
const [open, onOpenChange] = useControllableState3({
|
|
@@ -2187,20 +2319,11 @@ var TreegridRow = /* @__PURE__ */ forwardRef16(({ __treegridRowScope, asChild, c
|
|
|
2187
2319
|
onChange: propsOnOpenChange,
|
|
2188
2320
|
defaultProp: defaultOpen
|
|
2189
2321
|
});
|
|
2190
|
-
const focusableGroupAttrs = useFocusableGroup({
|
|
2191
|
-
tabBehavior: "limited"
|
|
2192
|
-
});
|
|
2193
|
-
const arrowGroupAttrs = useArrowNavigationGroup({
|
|
2194
|
-
axis: "horizontal",
|
|
2195
|
-
tabbable: false,
|
|
2196
|
-
circular: false,
|
|
2197
|
-
memorizeCurrent: false
|
|
2198
|
-
});
|
|
2199
2322
|
return /* @__PURE__ */ React24.createElement(TreegridRowProvider, {
|
|
2200
2323
|
open,
|
|
2201
2324
|
onOpenChange,
|
|
2202
2325
|
scope: __treegridRowScope
|
|
2203
|
-
}, /* @__PURE__ */ React24.createElement(
|
|
2326
|
+
}, /* @__PURE__ */ React24.createElement(Root8, {
|
|
2204
2327
|
role: "row",
|
|
2205
2328
|
"aria-level": level,
|
|
2206
2329
|
className: tx("treegrid.row", "treegrid__row", {
|
|
@@ -2210,16 +2333,10 @@ var TreegridRow = /* @__PURE__ */ forwardRef16(({ __treegridRowScope, asChild, c
|
|
|
2210
2333
|
"aria-expanded": open,
|
|
2211
2334
|
"aria-owns": parentOf
|
|
2212
2335
|
},
|
|
2213
|
-
tabIndex: 0,
|
|
2214
|
-
...focusableGroupAttrs,
|
|
2215
2336
|
...props,
|
|
2216
2337
|
id,
|
|
2217
2338
|
ref: forwardedRef
|
|
2218
|
-
},
|
|
2219
|
-
role: "none",
|
|
2220
|
-
className: "contents",
|
|
2221
|
-
...arrowGroupAttrs
|
|
2222
|
-
}, children)));
|
|
2339
|
+
}, children));
|
|
2223
2340
|
} finally {
|
|
2224
2341
|
_effect.f();
|
|
2225
2342
|
}
|
|
@@ -2252,17 +2369,18 @@ var Treegrid = {
|
|
|
2252
2369
|
|
|
2253
2370
|
// src/components/Main/Main.tsx
|
|
2254
2371
|
import { useSignals as _useSignals25 } from "@preact-signals/safe-react/tracking";
|
|
2372
|
+
import { useFocusableGroup } from "@fluentui/react-tabster";
|
|
2255
2373
|
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
2256
|
-
import {
|
|
2374
|
+
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
2257
2375
|
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
2258
2376
|
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
2259
2377
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2260
|
-
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";
|
|
2261
2379
|
import { log } from "@dxos/log";
|
|
2262
|
-
import {
|
|
2380
|
+
import { useForwardedRef, useMediaQuery } from "@dxos/react-hooks";
|
|
2263
2381
|
|
|
2264
2382
|
// src/components/Main/useSwipeToDismiss.ts
|
|
2265
|
-
import { useCallback as
|
|
2383
|
+
import { useCallback as useCallback8, useEffect as useEffect5, useState as useState7 } from "react";
|
|
2266
2384
|
var useSwipeToDismiss = (ref, {
|
|
2267
2385
|
onDismiss,
|
|
2268
2386
|
dismissThreshold = 64,
|
|
@@ -2271,22 +2389,22 @@ var useSwipeToDismiss = (ref, {
|
|
|
2271
2389
|
/* side = 'inline-start' */
|
|
2272
2390
|
}) => {
|
|
2273
2391
|
const $root = ref.current;
|
|
2274
|
-
const [motionState, setMotionState] =
|
|
2275
|
-
const [gestureStartX, setGestureStartX] =
|
|
2276
|
-
const setIdle =
|
|
2392
|
+
const [motionState, setMotionState] = useState7(0);
|
|
2393
|
+
const [gestureStartX, setGestureStartX] = useState7(0);
|
|
2394
|
+
const setIdle = useCallback8(() => {
|
|
2277
2395
|
setMotionState(0);
|
|
2278
2396
|
$root?.style.removeProperty("inset-inline-start");
|
|
2279
2397
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
2280
2398
|
}, [
|
|
2281
2399
|
$root
|
|
2282
2400
|
]);
|
|
2283
|
-
const setFollowing =
|
|
2401
|
+
const setFollowing = useCallback8(() => {
|
|
2284
2402
|
setMotionState(2);
|
|
2285
2403
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
2286
2404
|
}, [
|
|
2287
2405
|
$root
|
|
2288
2406
|
]);
|
|
2289
|
-
const handlePointerDown =
|
|
2407
|
+
const handlePointerDown = useCallback8(({ screenX }) => {
|
|
2290
2408
|
if (motionState === 0) {
|
|
2291
2409
|
setMotionState(1);
|
|
2292
2410
|
setGestureStartX(screenX);
|
|
@@ -2294,7 +2412,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2294
2412
|
}, [
|
|
2295
2413
|
motionState
|
|
2296
2414
|
]);
|
|
2297
|
-
const handlePointerMove =
|
|
2415
|
+
const handlePointerMove = useCallback8(({ screenX }) => {
|
|
2298
2416
|
if ($root) {
|
|
2299
2417
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2300
2418
|
switch (motionState) {
|
|
@@ -2318,12 +2436,12 @@ var useSwipeToDismiss = (ref, {
|
|
|
2318
2436
|
motionState,
|
|
2319
2437
|
gestureStartX
|
|
2320
2438
|
]);
|
|
2321
|
-
const handlePointerUp =
|
|
2439
|
+
const handlePointerUp = useCallback8(() => {
|
|
2322
2440
|
setIdle();
|
|
2323
2441
|
}, [
|
|
2324
2442
|
setIdle
|
|
2325
2443
|
]);
|
|
2326
|
-
|
|
2444
|
+
useEffect5(() => {
|
|
2327
2445
|
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
2328
2446
|
return () => {
|
|
2329
2447
|
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
@@ -2332,7 +2450,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2332
2450
|
$root,
|
|
2333
2451
|
handlePointerDown
|
|
2334
2452
|
]);
|
|
2335
|
-
|
|
2453
|
+
useEffect5(() => {
|
|
2336
2454
|
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
2337
2455
|
return () => {
|
|
2338
2456
|
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
@@ -2341,7 +2459,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2341
2459
|
$root,
|
|
2342
2460
|
handlePointerMove
|
|
2343
2461
|
]);
|
|
2344
|
-
|
|
2462
|
+
useEffect5(() => {
|
|
2345
2463
|
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
2346
2464
|
return () => {
|
|
2347
2465
|
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
@@ -2354,14 +2472,14 @@ var useSwipeToDismiss = (ref, {
|
|
|
2354
2472
|
|
|
2355
2473
|
// src/components/Main/Main.tsx
|
|
2356
2474
|
var __dxlog_file = "/__w/dxos/dxos/packages/ui/react-ui/src/components/Main/Main.tsx";
|
|
2475
|
+
var MAIN_NAME = "Main";
|
|
2357
2476
|
var MAIN_ROOT_NAME = "MainRoot";
|
|
2358
2477
|
var NAVIGATION_SIDEBAR_NAME = "NavigationSidebar";
|
|
2359
2478
|
var COMPLEMENTARY_SIDEBAR_NAME = "ComplementarySidebar";
|
|
2360
|
-
var MAIN_NAME = "Main";
|
|
2361
2479
|
var GENERIC_CONSUMER_NAME = "GenericConsumer";
|
|
2362
2480
|
var landmarkAttr = "data-main-landmark";
|
|
2363
2481
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2364
|
-
const handleKeyDown =
|
|
2482
|
+
const handleKeyDown = useCallback9((event) => {
|
|
2365
2483
|
const target = event.target;
|
|
2366
2484
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2367
2485
|
event.preventDefault();
|
|
@@ -2375,12 +2493,12 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2375
2493
|
}, [
|
|
2376
2494
|
propsOnKeyDown
|
|
2377
2495
|
]);
|
|
2378
|
-
const focusableGroupAttrs =
|
|
2496
|
+
const focusableGroupAttrs = useFocusableGroup({
|
|
2379
2497
|
tabBehavior: "limited",
|
|
2380
2498
|
ignoreDefaultKeydown: {
|
|
2381
2499
|
Tab: true
|
|
2382
2500
|
}
|
|
2383
|
-
};
|
|
2501
|
+
});
|
|
2384
2502
|
return {
|
|
2385
2503
|
onKeyDown: handleKeyDown,
|
|
2386
2504
|
[landmarkAttr]: landmark,
|
|
@@ -2391,19 +2509,19 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2391
2509
|
var [MainProvider, useMainContext] = createContext10(MAIN_NAME, {
|
|
2392
2510
|
resizing: false,
|
|
2393
2511
|
navigationSidebarState: "closed",
|
|
2394
|
-
setNavigationSidebarState: (
|
|
2512
|
+
setNavigationSidebarState: (_nextState) => {
|
|
2395
2513
|
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2396
2514
|
F: __dxlog_file,
|
|
2397
|
-
L:
|
|
2515
|
+
L: 92,
|
|
2398
2516
|
S: void 0,
|
|
2399
2517
|
C: (f, a) => f(...a)
|
|
2400
2518
|
});
|
|
2401
2519
|
},
|
|
2402
2520
|
complementarySidebarState: "closed",
|
|
2403
|
-
setComplementarySidebarState: (
|
|
2521
|
+
setComplementarySidebarState: (_nextState) => {
|
|
2404
2522
|
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2405
2523
|
F: __dxlog_file,
|
|
2406
|
-
L:
|
|
2524
|
+
L: 97,
|
|
2407
2525
|
S: void 0,
|
|
2408
2526
|
C: (f, a) => f(...a)
|
|
2409
2527
|
});
|
|
@@ -2414,31 +2532,29 @@ var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
|
2414
2532
|
return {
|
|
2415
2533
|
navigationSidebarState,
|
|
2416
2534
|
setNavigationSidebarState,
|
|
2417
|
-
toggleNavigationSidebar:
|
|
2535
|
+
toggleNavigationSidebar: useCallback9(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2418
2536
|
navigationSidebarState,
|
|
2419
2537
|
setNavigationSidebarState
|
|
2420
2538
|
]),
|
|
2421
|
-
openNavigationSidebar:
|
|
2422
|
-
collapseNavigationSidebar:
|
|
2423
|
-
closeNavigationSidebar:
|
|
2539
|
+
openNavigationSidebar: useCallback9(() => setNavigationSidebarState("expanded"), []),
|
|
2540
|
+
collapseNavigationSidebar: useCallback9(() => setNavigationSidebarState("collapsed"), []),
|
|
2541
|
+
closeNavigationSidebar: useCallback9(() => setNavigationSidebarState("closed"), []),
|
|
2424
2542
|
complementarySidebarState,
|
|
2425
2543
|
setComplementarySidebarState,
|
|
2426
|
-
toggleComplementarySidebar:
|
|
2544
|
+
toggleComplementarySidebar: useCallback9(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2427
2545
|
complementarySidebarState,
|
|
2428
2546
|
setComplementarySidebarState
|
|
2429
2547
|
]),
|
|
2430
|
-
openComplementarySidebar:
|
|
2431
|
-
collapseComplementarySidebar:
|
|
2432
|
-
closeComplementarySidebar:
|
|
2548
|
+
openComplementarySidebar: useCallback9(() => setComplementarySidebarState("expanded"), []),
|
|
2549
|
+
collapseComplementarySidebar: useCallback9(() => setComplementarySidebarState("collapsed"), []),
|
|
2550
|
+
closeComplementarySidebar: useCallback9(() => setComplementarySidebarState("closed"), [])
|
|
2433
2551
|
};
|
|
2434
2552
|
};
|
|
2435
2553
|
var resizeDebounce = 3e3;
|
|
2436
2554
|
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
2437
2555
|
var _effect = _useSignals25();
|
|
2438
2556
|
try {
|
|
2439
|
-
const [isLg] = useMediaQuery("lg"
|
|
2440
|
-
ssr: false
|
|
2441
|
-
});
|
|
2557
|
+
const [isLg] = useMediaQuery("lg");
|
|
2442
2558
|
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = useControllableState4({
|
|
2443
2559
|
prop: propsNavigationSidebarState,
|
|
2444
2560
|
defaultProp: defaultNavigationSidebarState,
|
|
@@ -2449,9 +2565,9 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2449
2565
|
defaultProp: defaultComplementarySidebarState,
|
|
2450
2566
|
onChange: onComplementarySidebarStateChange
|
|
2451
2567
|
});
|
|
2452
|
-
const [resizing, setResizing] =
|
|
2568
|
+
const [resizing, setResizing] = useState8(false);
|
|
2453
2569
|
const resizeInterval = useRef2(null);
|
|
2454
|
-
const handleResize =
|
|
2570
|
+
const handleResize = useCallback9(() => {
|
|
2455
2571
|
setResizing(true);
|
|
2456
2572
|
if (resizeInterval.current) {
|
|
2457
2573
|
clearTimeout(resizeInterval.current);
|
|
@@ -2461,7 +2577,7 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2461
2577
|
resizeInterval.current = null;
|
|
2462
2578
|
}, resizeDebounce);
|
|
2463
2579
|
}, []);
|
|
2464
|
-
|
|
2580
|
+
useEffect6(() => {
|
|
2465
2581
|
window.addEventListener("resize", handleResize);
|
|
2466
2582
|
return () => window.removeEventListener("resize", handleResize);
|
|
2467
2583
|
}, [
|
|
@@ -2486,9 +2602,7 @@ var handleOpenAutoFocus = (event) => {
|
|
|
2486
2602
|
var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
2487
2603
|
var _effect = _useSignals25();
|
|
2488
2604
|
try {
|
|
2489
|
-
const [isLg] = useMediaQuery("lg"
|
|
2490
|
-
ssr: false
|
|
2491
|
-
});
|
|
2605
|
+
const [isLg] = useMediaQuery("lg");
|
|
2492
2606
|
const { tx } = useThemeContext();
|
|
2493
2607
|
const { t } = useTranslation();
|
|
2494
2608
|
const ref = useForwardedRef(forwardedRef);
|
|
@@ -2496,22 +2610,25 @@ var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToD
|
|
|
2496
2610
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2497
2611
|
onDismiss: () => onStateChange?.("closed")
|
|
2498
2612
|
});
|
|
2499
|
-
const handleKeyDown =
|
|
2500
|
-
|
|
2501
|
-
|
|
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();
|
|
2502
2619
|
}
|
|
2503
2620
|
props.onKeyDown?.(event);
|
|
2504
2621
|
}, [
|
|
2505
2622
|
props.onKeyDown
|
|
2506
2623
|
]);
|
|
2507
|
-
const
|
|
2624
|
+
const Root8 = isLg ? Primitive8.div : DialogContent2;
|
|
2508
2625
|
return /* @__PURE__ */ React25.createElement(DialogRoot2, {
|
|
2509
2626
|
open: state !== "closed",
|
|
2510
2627
|
"aria-label": toLocalizedString(label, t),
|
|
2511
2628
|
modal: false
|
|
2512
2629
|
}, !isLg && /* @__PURE__ */ React25.createElement(DialogTitle2, {
|
|
2513
2630
|
className: "sr-only"
|
|
2514
|
-
}, toLocalizedString(label, t)), /* @__PURE__ */ React25.createElement(
|
|
2631
|
+
}, toLocalizedString(label, t)), /* @__PURE__ */ React25.createElement(Root8, {
|
|
2515
2632
|
...!isLg && {
|
|
2516
2633
|
forceMount: true,
|
|
2517
2634
|
tabIndex: -1,
|
|
@@ -2522,9 +2639,9 @@ var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToD
|
|
|
2522
2639
|
"data-state": state,
|
|
2523
2640
|
"data-resizing": resizing ? "true" : "false",
|
|
2524
2641
|
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
2525
|
-
|
|
2642
|
+
onKeyDownCapture: handleKeyDown,
|
|
2526
2643
|
...state === "closed" && {
|
|
2527
|
-
inert:
|
|
2644
|
+
inert: true
|
|
2528
2645
|
},
|
|
2529
2646
|
ref
|
|
2530
2647
|
}, children));
|
|
@@ -2575,9 +2692,9 @@ var MainContent = /* @__PURE__ */ forwardRef17(({ asChild, classNames, bounce, h
|
|
|
2575
2692
|
try {
|
|
2576
2693
|
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2577
2694
|
const { tx } = useThemeContext();
|
|
2578
|
-
const
|
|
2695
|
+
const Root8 = asChild ? Slot8 : role ? "div" : "main";
|
|
2579
2696
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
2580
|
-
return /* @__PURE__ */ React25.createElement(
|
|
2697
|
+
return /* @__PURE__ */ React25.createElement(Root8, {
|
|
2581
2698
|
role,
|
|
2582
2699
|
...handlesFocus && {
|
|
2583
2700
|
...mover
|
|
@@ -2600,9 +2717,7 @@ MainContent.displayName = MAIN_NAME;
|
|
|
2600
2717
|
var MainOverlay = /* @__PURE__ */ forwardRef17(({ classNames, ...props }, forwardedRef) => {
|
|
2601
2718
|
var _effect = _useSignals25();
|
|
2602
2719
|
try {
|
|
2603
|
-
const [isLg] = useMediaQuery("lg"
|
|
2604
|
-
ssr: false
|
|
2605
|
-
});
|
|
2720
|
+
const [isLg] = useMediaQuery("lg");
|
|
2606
2721
|
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2607
2722
|
const { tx } = useThemeContext();
|
|
2608
2723
|
return /* @__PURE__ */ React25.createElement("div", {
|
|
@@ -2640,7 +2755,7 @@ import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
|
2640
2755
|
import React26, { forwardRef as forwardRef18 } from "react";
|
|
2641
2756
|
|
|
2642
2757
|
// src/hooks/useSafeCollisionPadding.ts
|
|
2643
|
-
import { useMemo as
|
|
2758
|
+
import { useMemo as useMemo4 } from "react";
|
|
2644
2759
|
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
2645
2760
|
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
2646
2761
|
var safePadding = (propsPadding, safePadding2, side) => {
|
|
@@ -2648,7 +2763,7 @@ var safePadding = (propsPadding, safePadding2, side) => {
|
|
|
2648
2763
|
};
|
|
2649
2764
|
var useSafeCollisionPadding = (collisionPadding) => {
|
|
2650
2765
|
const { safeAreaPadding } = useThemeContext();
|
|
2651
|
-
return
|
|
2766
|
+
return useMemo4(() => ({
|
|
2652
2767
|
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
2653
2768
|
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
2654
2769
|
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
@@ -2671,6 +2786,7 @@ var ContextMenuContent = /* @__PURE__ */ forwardRef18(({ classNames, children, c
|
|
|
2671
2786
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2672
2787
|
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Content, {
|
|
2673
2788
|
...props,
|
|
2789
|
+
"data-arrow-keys": "up down",
|
|
2674
2790
|
collisionPadding: safeCollisionPadding,
|
|
2675
2791
|
className: tx("menu.content", "menu", {
|
|
2676
2792
|
elevation
|
|
@@ -2685,8 +2801,8 @@ var ContextMenuViewport = /* @__PURE__ */ forwardRef18(({ classNames, asChild, c
|
|
|
2685
2801
|
var _effect = _useSignals26();
|
|
2686
2802
|
try {
|
|
2687
2803
|
const { tx } = useThemeContext();
|
|
2688
|
-
const
|
|
2689
|
-
return /* @__PURE__ */ React26.createElement(
|
|
2804
|
+
const Root8 = asChild ? Slot9 : Primitive9.div;
|
|
2805
|
+
return /* @__PURE__ */ React26.createElement(Root8, {
|
|
2690
2806
|
...props,
|
|
2691
2807
|
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
2692
2808
|
ref: forwardedRef
|
|
@@ -2788,7 +2904,7 @@ import { createMenuScope } from "@radix-ui/react-menu";
|
|
|
2788
2904
|
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
2789
2905
|
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
2790
2906
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
2791
|
-
import React27, {
|
|
2907
|
+
import React27, { forwardRef as forwardRef19, useCallback as useCallback10, useEffect as useEffect7, useMemo as useMemo5, useRef as useRef3 } from "react";
|
|
2792
2908
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
2793
2909
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope3(DROPDOWN_MENU_NAME, [
|
|
2794
2910
|
createMenuScope
|
|
@@ -2813,7 +2929,7 @@ var DropdownMenuRoot = (props) => {
|
|
|
2813
2929
|
contentId: useId3(),
|
|
2814
2930
|
open,
|
|
2815
2931
|
onOpenChange: setOpen,
|
|
2816
|
-
onOpenToggle:
|
|
2932
|
+
onOpenToggle: useCallback10(() => setOpen((prevOpen) => !prevOpen), [
|
|
2817
2933
|
setOpen
|
|
2818
2934
|
]),
|
|
2819
2935
|
modal
|
|
@@ -2850,6 +2966,7 @@ var DropdownMenuTrigger = /* @__PURE__ */ forwardRef19((props, forwardedRef) =>
|
|
|
2850
2966
|
disabled,
|
|
2851
2967
|
...triggerProps,
|
|
2852
2968
|
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
2969
|
+
"data-arrow-keys": "down",
|
|
2853
2970
|
onPointerDown: composeEventHandlers2(props.onPointerDown, (event) => {
|
|
2854
2971
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
2855
2972
|
context.onOpenToggle();
|
|
@@ -2892,7 +3009,7 @@ var DropdownMenuVirtualTrigger = (props) => {
|
|
|
2892
3009
|
const { __scopeDropdownMenu, virtualRef } = props;
|
|
2893
3010
|
const context = useDropdownMenuContext(VIRTUAL_TRIGGER_NAME, __scopeDropdownMenu);
|
|
2894
3011
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2895
|
-
|
|
3012
|
+
useEffect7(() => {
|
|
2896
3013
|
if (virtualRef.current) {
|
|
2897
3014
|
context.triggerRef.current = virtualRef.current;
|
|
2898
3015
|
}
|
|
@@ -2925,8 +3042,8 @@ var DropdownMenuViewport = /* @__PURE__ */ forwardRef19(({ classNames, asChild,
|
|
|
2925
3042
|
var _effect = _useSignals27();
|
|
2926
3043
|
try {
|
|
2927
3044
|
const { tx } = useThemeContext();
|
|
2928
|
-
const
|
|
2929
|
-
return /* @__PURE__ */ React27.createElement(
|
|
3045
|
+
const Root8 = asChild ? Slot10 : Primitive10.div;
|
|
3046
|
+
return /* @__PURE__ */ React27.createElement(Root8, {
|
|
2930
3047
|
...props,
|
|
2931
3048
|
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
2932
3049
|
ref: forwardedRef
|
|
@@ -2939,18 +3056,35 @@ var CONTENT_NAME2 = "DropdownMenuContent";
|
|
|
2939
3056
|
var DropdownMenuContent = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2940
3057
|
var _effect = _useSignals27();
|
|
2941
3058
|
try {
|
|
2942
|
-
const { __scopeDropdownMenu, classNames, collisionPadding = 8, ...contentProps } = props;
|
|
3059
|
+
const { __scopeDropdownMenu, classNames, collisionPadding = 8, collisionBoundary, ...contentProps } = props;
|
|
2943
3060
|
const { tx } = useThemeContext();
|
|
2944
3061
|
const context = useDropdownMenuContext(CONTENT_NAME2, __scopeDropdownMenu);
|
|
2945
3062
|
const elevation = useElevationContext();
|
|
2946
3063
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2947
3064
|
const hasInteractedOutsideRef = useRef3(false);
|
|
2948
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
|
+
]);
|
|
2949
3082
|
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Content, {
|
|
2950
3083
|
id: context.contentId,
|
|
2951
3084
|
"aria-labelledby": context.triggerId,
|
|
2952
3085
|
...menuScope,
|
|
2953
3086
|
...contentProps,
|
|
3087
|
+
collisionBoundary: computedCollisionBoundary,
|
|
2954
3088
|
collisionPadding: safeCollisionPadding,
|
|
2955
3089
|
ref: forwardedRef,
|
|
2956
3090
|
onCloseAutoFocus: composeEventHandlers2(props.onCloseAutoFocus, (event) => {
|
|
@@ -2968,6 +3102,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef19((props, forwardedRef) =>
|
|
|
2968
3102
|
hasInteractedOutsideRef.current = true;
|
|
2969
3103
|
}
|
|
2970
3104
|
}),
|
|
3105
|
+
"data-arrow-keys": "up down",
|
|
2971
3106
|
className: tx("menu.content", "menu", {
|
|
2972
3107
|
elevation
|
|
2973
3108
|
}, classNames),
|
|
@@ -3078,11 +3213,13 @@ var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
|
3078
3213
|
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3079
3214
|
var _effect = _useSignals27();
|
|
3080
3215
|
try {
|
|
3081
|
-
const { __scopeDropdownMenu, ...
|
|
3216
|
+
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
3082
3217
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3083
|
-
|
|
3218
|
+
const { tx } = useThemeContext();
|
|
3219
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Item, {
|
|
3084
3220
|
...menuScope,
|
|
3085
|
-
...
|
|
3221
|
+
...itemProps,
|
|
3222
|
+
className: tx("menu.item", "menu__item", {}, classNames),
|
|
3086
3223
|
ref: forwardedRef
|
|
3087
3224
|
});
|
|
3088
3225
|
} finally {
|
|
@@ -3249,12 +3386,12 @@ var MessageRoot = /* @__PURE__ */ forwardRef20(({ asChild, valence = "neutral",
|
|
|
3249
3386
|
const titleId = useId4("message__title", propsTitleId);
|
|
3250
3387
|
const descriptionId = useId4("message__description", propsDescriptionId);
|
|
3251
3388
|
const elevation = useElevationContext(propsElevation);
|
|
3252
|
-
const
|
|
3389
|
+
const Root8 = asChild ? Slot11 : Primitive11.div;
|
|
3253
3390
|
return /* @__PURE__ */ React28.createElement(MessageProvider, {
|
|
3254
3391
|
titleId,
|
|
3255
3392
|
descriptionId,
|
|
3256
3393
|
valence
|
|
3257
|
-
}, /* @__PURE__ */ React28.createElement(
|
|
3394
|
+
}, /* @__PURE__ */ React28.createElement(Root8, {
|
|
3258
3395
|
role: valence === "neutral" ? "paragraph" : "alert",
|
|
3259
3396
|
...props,
|
|
3260
3397
|
className: tx("message.root", "message", {
|
|
@@ -3276,8 +3413,8 @@ var MessageTitle = /* @__PURE__ */ forwardRef20(({ asChild, classNames, children
|
|
|
3276
3413
|
try {
|
|
3277
3414
|
const { tx } = useThemeContext();
|
|
3278
3415
|
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3279
|
-
const
|
|
3280
|
-
return /* @__PURE__ */ React28.createElement(
|
|
3416
|
+
const Root8 = asChild ? Slot11 : Primitive11.h2;
|
|
3417
|
+
return /* @__PURE__ */ React28.createElement(Root8, {
|
|
3281
3418
|
...props,
|
|
3282
3419
|
className: tx("message.title", "message__title", {}, classNames),
|
|
3283
3420
|
id: titleId,
|
|
@@ -3300,8 +3437,8 @@ var MessageContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, childr
|
|
|
3300
3437
|
try {
|
|
3301
3438
|
const { tx } = useThemeContext();
|
|
3302
3439
|
const { descriptionId } = useMessageContext(MESSAGE_BODY_NAME);
|
|
3303
|
-
const
|
|
3304
|
-
return /* @__PURE__ */ React28.createElement(
|
|
3440
|
+
const Root8 = asChild ? Slot11 : Primitive11.p;
|
|
3441
|
+
return /* @__PURE__ */ React28.createElement(Root8, {
|
|
3305
3442
|
...props,
|
|
3306
3443
|
className: tx("message.content", "message__content", {}, classNames),
|
|
3307
3444
|
id: descriptionId,
|
|
@@ -3336,7 +3473,7 @@ import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
|
3336
3473
|
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
3337
3474
|
import { useControllableState as useControllableState6 } from "@radix-ui/react-use-controllable-state";
|
|
3338
3475
|
import { hideOthers } from "aria-hidden";
|
|
3339
|
-
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";
|
|
3340
3477
|
import { RemoveScroll } from "react-remove-scroll";
|
|
3341
3478
|
var POPOVER_NAME = "Popover";
|
|
3342
3479
|
var [createPopoverContext, createPopoverScope] = createContextScope4(POPOVER_NAME, [
|
|
@@ -3350,7 +3487,7 @@ var PopoverRoot = (props) => {
|
|
|
3350
3487
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
3351
3488
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3352
3489
|
const triggerRef = useRef4(null);
|
|
3353
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
3490
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState9(false);
|
|
3354
3491
|
const [open = false, setOpen] = useControllableState6({
|
|
3355
3492
|
prop: openProp,
|
|
3356
3493
|
defaultProp: defaultOpen,
|
|
@@ -3362,12 +3499,12 @@ var PopoverRoot = (props) => {
|
|
|
3362
3499
|
triggerRef,
|
|
3363
3500
|
open,
|
|
3364
3501
|
onOpenChange: setOpen,
|
|
3365
|
-
onOpenToggle:
|
|
3502
|
+
onOpenToggle: useCallback11(() => setOpen((prevOpen) => !prevOpen), [
|
|
3366
3503
|
setOpen
|
|
3367
3504
|
]),
|
|
3368
3505
|
hasCustomAnchor,
|
|
3369
|
-
onCustomAnchorAdd:
|
|
3370
|
-
onCustomAnchorRemove:
|
|
3506
|
+
onCustomAnchorAdd: useCallback11(() => setHasCustomAnchor(true), []),
|
|
3507
|
+
onCustomAnchorRemove: useCallback11(() => setHasCustomAnchor(false), []),
|
|
3371
3508
|
modal
|
|
3372
3509
|
}, children));
|
|
3373
3510
|
} finally {
|
|
@@ -3383,7 +3520,7 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
|
3383
3520
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
3384
3521
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3385
3522
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
3386
|
-
|
|
3523
|
+
useEffect8(() => {
|
|
3387
3524
|
onCustomAnchorAdd();
|
|
3388
3525
|
return () => onCustomAnchorRemove();
|
|
3389
3526
|
}, [
|
|
@@ -3434,7 +3571,7 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
3434
3571
|
const { __scopePopover, virtualRef } = props;
|
|
3435
3572
|
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
3436
3573
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3437
|
-
|
|
3574
|
+
useEffect8(() => {
|
|
3438
3575
|
if (virtualRef.current) {
|
|
3439
3576
|
context.triggerRef.current = virtualRef.current;
|
|
3440
3577
|
}
|
|
@@ -3499,7 +3636,7 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef21((props, forwardedRef) =>
|
|
|
3499
3636
|
const contentRef = useRef4(null);
|
|
3500
3637
|
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
3501
3638
|
const isRightClickOutsideRef = useRef4(false);
|
|
3502
|
-
|
|
3639
|
+
useEffect8(() => {
|
|
3503
3640
|
const content = contentRef.current;
|
|
3504
3641
|
if (content) {
|
|
3505
3642
|
return hideOthers(content);
|
|
@@ -3586,13 +3723,29 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef21((props, forwardedRef)
|
|
|
3586
3723
|
var PopoverContentImpl = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3587
3724
|
var _effect = _useSignals29();
|
|
3588
3725
|
try {
|
|
3589
|
-
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;
|
|
3590
3727
|
const context = usePopoverContext(CONTENT_NAME3, __scopePopover);
|
|
3591
3728
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3592
3729
|
const { tx } = useThemeContext();
|
|
3593
3730
|
const elevation = useElevationContext();
|
|
3594
3731
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3595
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
|
+
]);
|
|
3596
3749
|
return /* @__PURE__ */ React29.createElement(FocusScope, {
|
|
3597
3750
|
asChild: true,
|
|
3598
3751
|
loop: true,
|
|
@@ -3614,13 +3767,14 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
|
3614
3767
|
...popperScope,
|
|
3615
3768
|
...contentProps,
|
|
3616
3769
|
collisionPadding: safeCollisionPadding,
|
|
3770
|
+
collisionBoundary: computedCollisionBoundary,
|
|
3617
3771
|
className: tx("popover.content", "popover", {
|
|
3618
3772
|
elevation
|
|
3619
3773
|
}, classNames),
|
|
3620
3774
|
ref: forwardedRef,
|
|
3621
3775
|
style: {
|
|
3622
3776
|
...contentProps.style,
|
|
3623
|
-
//
|
|
3777
|
+
// Re-namespace exposed content custom properties.
|
|
3624
3778
|
...{
|
|
3625
3779
|
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3626
3780
|
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
@@ -3673,8 +3827,8 @@ var PopoverViewport = /* @__PURE__ */ forwardRef21(({ classNames, asChild, const
|
|
|
3673
3827
|
var _effect = _useSignals29();
|
|
3674
3828
|
try {
|
|
3675
3829
|
const { tx } = useThemeContext();
|
|
3676
|
-
const
|
|
3677
|
-
return /* @__PURE__ */ React29.createElement(
|
|
3830
|
+
const Root8 = asChild ? Slot12 : Primitive12.div;
|
|
3831
|
+
return /* @__PURE__ */ React29.createElement(Root8, {
|
|
3678
3832
|
...props,
|
|
3679
3833
|
className: tx("popover.viewport", "popover__viewport", {
|
|
3680
3834
|
constrainInline,
|
|
@@ -3733,7 +3887,7 @@ var Status = /* @__PURE__ */ forwardRef22(({ classNames, children, progress = 0,
|
|
|
3733
3887
|
|
|
3734
3888
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
3735
3889
|
import { useSignals as _useSignals31 } from "@preact-signals/safe-react/tracking";
|
|
3736
|
-
import {
|
|
3890
|
+
import { Corner as ScrollAreaPrimitiveCorner, Root as ScrollAreaPrimitiveRoot, Scrollbar as ScrollAreaPrimitiveScrollbar, Thumb as ScrollAreaPrimitiveThumb, Viewport as ScrollAreaPrimitiveViewport } from "@radix-ui/react-scroll-area";
|
|
3737
3891
|
import React31, { forwardRef as forwardRef23 } from "react";
|
|
3738
3892
|
var ScrollAreaRoot = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
3739
3893
|
var _effect = _useSignals31();
|
|
@@ -3809,45 +3963,206 @@ var ScrollArea = {
|
|
|
3809
3963
|
Corner: ScrollAreaCorner
|
|
3810
3964
|
};
|
|
3811
3965
|
|
|
3812
|
-
// src/components/
|
|
3966
|
+
// src/components/ScrollContainer/ScrollContainer.tsx
|
|
3813
3967
|
import { useSignals as _useSignals32 } from "@preact-signals/safe-react/tracking";
|
|
3814
|
-
import {
|
|
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";
|
|
3815
4130
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3816
|
-
import
|
|
4131
|
+
import React33, { forwardRef as forwardRef25 } from "react";
|
|
3817
4132
|
var SelectRoot = SelectPrimitive.Root;
|
|
3818
4133
|
var SelectTrigger = SelectPrimitive.Trigger;
|
|
3819
4134
|
var SelectValue = SelectPrimitive.Value;
|
|
3820
4135
|
var SelectIcon = SelectPrimitive.Icon;
|
|
3821
4136
|
var SelectPortal = SelectPrimitive.Portal;
|
|
3822
|
-
var SelectTriggerButton = /* @__PURE__ */
|
|
3823
|
-
var _effect =
|
|
4137
|
+
var SelectTriggerButton = /* @__PURE__ */ forwardRef25(({ children, placeholder, ...props }, forwardedRef) => {
|
|
4138
|
+
var _effect = _useSignals33();
|
|
3824
4139
|
try {
|
|
3825
|
-
|
|
3826
|
-
return /* @__PURE__ */ React32.createElement(SelectPrimitive.Trigger, {
|
|
4140
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Trigger, {
|
|
3827
4141
|
asChild: true,
|
|
3828
4142
|
ref: forwardedRef
|
|
3829
|
-
}, /* @__PURE__ */
|
|
4143
|
+
}, /* @__PURE__ */ React33.createElement(Button, props, /* @__PURE__ */ React33.createElement(SelectPrimitive.Value, {
|
|
3830
4144
|
placeholder
|
|
3831
|
-
}, children), /* @__PURE__ */
|
|
3832
|
-
className: "
|
|
3833
|
-
}), /* @__PURE__ */
|
|
4145
|
+
}, children), /* @__PURE__ */ React33.createElement("span", {
|
|
4146
|
+
className: "is-1 flex-1"
|
|
4147
|
+
}), /* @__PURE__ */ React33.createElement(SelectPrimitive.Icon, {
|
|
3834
4148
|
asChild: true
|
|
3835
|
-
}, /* @__PURE__ */
|
|
3836
|
-
|
|
3837
|
-
|
|
4149
|
+
}, /* @__PURE__ */ React33.createElement(Icon, {
|
|
4150
|
+
size: 3,
|
|
4151
|
+
icon: "ph--caret-down--bold"
|
|
3838
4152
|
}))));
|
|
3839
4153
|
} finally {
|
|
3840
4154
|
_effect.f();
|
|
3841
4155
|
}
|
|
3842
4156
|
});
|
|
3843
|
-
var SelectContent = /* @__PURE__ */
|
|
3844
|
-
var _effect =
|
|
4157
|
+
var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
4158
|
+
var _effect = _useSignals33();
|
|
3845
4159
|
try {
|
|
3846
4160
|
const { tx } = useThemeContext();
|
|
3847
4161
|
const elevation = useElevationContext();
|
|
3848
4162
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3849
|
-
return /* @__PURE__ */
|
|
4163
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Content, {
|
|
3850
4164
|
...props,
|
|
4165
|
+
"data-arrow-keys": "up down",
|
|
3851
4166
|
collisionPadding: safeCollisionPadding,
|
|
3852
4167
|
className: tx("select.content", "select__content", {
|
|
3853
4168
|
elevation
|
|
@@ -3859,41 +4174,43 @@ var SelectContent = /* @__PURE__ */ forwardRef24(({ classNames, children, collis
|
|
|
3859
4174
|
_effect.f();
|
|
3860
4175
|
}
|
|
3861
4176
|
});
|
|
3862
|
-
var SelectScrollUpButton2 = /* @__PURE__ */
|
|
3863
|
-
var _effect =
|
|
4177
|
+
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4178
|
+
var _effect = _useSignals33();
|
|
3864
4179
|
try {
|
|
3865
4180
|
const { tx } = useThemeContext();
|
|
3866
|
-
return /* @__PURE__ */
|
|
4181
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
3867
4182
|
...props,
|
|
3868
4183
|
className: tx("select.scrollButton", "select__scroll-button--up", {}, classNames),
|
|
3869
4184
|
ref: forwardedRef
|
|
3870
|
-
}, children ?? /* @__PURE__ */
|
|
3871
|
-
|
|
4185
|
+
}, children ?? /* @__PURE__ */ React33.createElement(Icon, {
|
|
4186
|
+
size: 3,
|
|
4187
|
+
icon: "ph--caret-up--bold"
|
|
3872
4188
|
}));
|
|
3873
4189
|
} finally {
|
|
3874
4190
|
_effect.f();
|
|
3875
4191
|
}
|
|
3876
4192
|
});
|
|
3877
|
-
var SelectScrollDownButton2 = /* @__PURE__ */
|
|
3878
|
-
var _effect =
|
|
4193
|
+
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4194
|
+
var _effect = _useSignals33();
|
|
3879
4195
|
try {
|
|
3880
4196
|
const { tx } = useThemeContext();
|
|
3881
|
-
return /* @__PURE__ */
|
|
4197
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
3882
4198
|
...props,
|
|
3883
4199
|
className: tx("select.scrollButton", "select__scroll-button--down", {}, classNames),
|
|
3884
4200
|
ref: forwardedRef
|
|
3885
|
-
}, children ?? /* @__PURE__ */
|
|
3886
|
-
|
|
4201
|
+
}, children ?? /* @__PURE__ */ React33.createElement(Icon, {
|
|
4202
|
+
size: 3,
|
|
4203
|
+
icon: "ph--caret-down--bold"
|
|
3887
4204
|
}));
|
|
3888
4205
|
} finally {
|
|
3889
4206
|
_effect.f();
|
|
3890
4207
|
}
|
|
3891
4208
|
});
|
|
3892
|
-
var SelectViewport2 = /* @__PURE__ */
|
|
3893
|
-
var _effect =
|
|
4209
|
+
var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4210
|
+
var _effect = _useSignals33();
|
|
3894
4211
|
try {
|
|
3895
4212
|
const { tx } = useThemeContext();
|
|
3896
|
-
return /* @__PURE__ */
|
|
4213
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectViewport, {
|
|
3897
4214
|
...props,
|
|
3898
4215
|
className: tx("select.viewport", "select__viewport", {}, classNames),
|
|
3899
4216
|
ref: forwardedRef
|
|
@@ -3902,11 +4219,11 @@ var SelectViewport2 = /* @__PURE__ */ forwardRef24(({ classNames, asChild, child
|
|
|
3902
4219
|
_effect.f();
|
|
3903
4220
|
}
|
|
3904
4221
|
});
|
|
3905
|
-
var SelectItem = /* @__PURE__ */
|
|
3906
|
-
var _effect =
|
|
4222
|
+
var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
4223
|
+
var _effect = _useSignals33();
|
|
3907
4224
|
try {
|
|
3908
4225
|
const { tx } = useThemeContext();
|
|
3909
|
-
return /* @__PURE__ */
|
|
4226
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Item, {
|
|
3910
4227
|
...props,
|
|
3911
4228
|
className: tx("select.item", "option", {}, classNames),
|
|
3912
4229
|
ref: forwardedRef
|
|
@@ -3916,11 +4233,11 @@ var SelectItem = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, forward
|
|
|
3916
4233
|
}
|
|
3917
4234
|
});
|
|
3918
4235
|
var SelectItemText = SelectPrimitive.ItemText;
|
|
3919
|
-
var SelectItemIndicator = /* @__PURE__ */
|
|
3920
|
-
var _effect =
|
|
4236
|
+
var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4237
|
+
var _effect = _useSignals33();
|
|
3921
4238
|
try {
|
|
3922
4239
|
const { tx } = useThemeContext();
|
|
3923
|
-
return /* @__PURE__ */
|
|
4240
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.ItemIndicator, {
|
|
3924
4241
|
...props,
|
|
3925
4242
|
className: tx("select.itemIndicator", "option__indicator", {}, classNames),
|
|
3926
4243
|
ref: forwardedRef
|
|
@@ -3929,17 +4246,17 @@ var SelectItemIndicator = /* @__PURE__ */ forwardRef24(({ classNames, children,
|
|
|
3929
4246
|
_effect.f();
|
|
3930
4247
|
}
|
|
3931
4248
|
});
|
|
3932
|
-
var SelectOption = /* @__PURE__ */
|
|
3933
|
-
var _effect =
|
|
4249
|
+
var SelectOption = /* @__PURE__ */ forwardRef25(({ children, classNames, ...props }, forwardedRef) => {
|
|
4250
|
+
var _effect = _useSignals33();
|
|
3934
4251
|
try {
|
|
3935
4252
|
const { tx } = useThemeContext();
|
|
3936
|
-
return /* @__PURE__ */
|
|
4253
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Item, {
|
|
3937
4254
|
...props,
|
|
3938
4255
|
className: tx("select.item", "option", {}, classNames),
|
|
3939
4256
|
ref: forwardedRef
|
|
3940
|
-
}, /* @__PURE__ */
|
|
3941
|
-
className: "grow
|
|
3942
|
-
}), /* @__PURE__ */
|
|
4257
|
+
}, /* @__PURE__ */ React33.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ React33.createElement("span", {
|
|
4258
|
+
className: "grow is-1"
|
|
4259
|
+
}), /* @__PURE__ */ React33.createElement(Icon, {
|
|
3943
4260
|
icon: "ph--check--regular"
|
|
3944
4261
|
}));
|
|
3945
4262
|
} finally {
|
|
@@ -3948,11 +4265,11 @@ var SelectOption = /* @__PURE__ */ forwardRef24(({ children, classNames, ...prop
|
|
|
3948
4265
|
});
|
|
3949
4266
|
var SelectGroup = SelectPrimitive.Group;
|
|
3950
4267
|
var SelectLabel = SelectPrimitive.Label;
|
|
3951
|
-
var SelectSeparator = /* @__PURE__ */
|
|
3952
|
-
var _effect =
|
|
4268
|
+
var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
4269
|
+
var _effect = _useSignals33();
|
|
3953
4270
|
try {
|
|
3954
4271
|
const { tx } = useThemeContext();
|
|
3955
|
-
return /* @__PURE__ */
|
|
4272
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Separator, {
|
|
3956
4273
|
...props,
|
|
3957
4274
|
className: tx("select.separator", "select__separator", {}, classNames),
|
|
3958
4275
|
ref: forwardedRef
|
|
@@ -3961,11 +4278,11 @@ var SelectSeparator = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, fo
|
|
|
3961
4278
|
_effect.f();
|
|
3962
4279
|
}
|
|
3963
4280
|
});
|
|
3964
|
-
var SelectArrow = /* @__PURE__ */
|
|
3965
|
-
var _effect =
|
|
4281
|
+
var SelectArrow = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
4282
|
+
var _effect = _useSignals33();
|
|
3966
4283
|
try {
|
|
3967
4284
|
const { tx } = useThemeContext();
|
|
3968
|
-
return /* @__PURE__ */
|
|
4285
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Arrow, {
|
|
3969
4286
|
...props,
|
|
3970
4287
|
className: tx("select.arrow", "select__arrow", {}, classNames),
|
|
3971
4288
|
ref: forwardedRef
|
|
@@ -3996,14 +4313,14 @@ var Select = {
|
|
|
3996
4313
|
};
|
|
3997
4314
|
|
|
3998
4315
|
// src/components/Separator/Separator.tsx
|
|
3999
|
-
import { useSignals as
|
|
4316
|
+
import { useSignals as _useSignals34 } from "@preact-signals/safe-react/tracking";
|
|
4000
4317
|
import { Separator as SeparatorPrimitive } from "@radix-ui/react-separator";
|
|
4001
|
-
import
|
|
4002
|
-
var Separator4 = /* @__PURE__ */
|
|
4003
|
-
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();
|
|
4004
4321
|
try {
|
|
4005
4322
|
const { tx } = useThemeContext();
|
|
4006
|
-
return /* @__PURE__ */
|
|
4323
|
+
return /* @__PURE__ */ React34.createElement(SeparatorPrimitive, {
|
|
4007
4324
|
orientation,
|
|
4008
4325
|
...props,
|
|
4009
4326
|
className: tx("separator.root", "separator", {
|
|
@@ -4018,16 +4335,16 @@ var Separator4 = /* @__PURE__ */ forwardRef25(({ classNames, orientation = "hori
|
|
|
4018
4335
|
});
|
|
4019
4336
|
|
|
4020
4337
|
// src/components/Tag/Tag.tsx
|
|
4021
|
-
import { useSignals as
|
|
4338
|
+
import { useSignals as _useSignals35 } from "@preact-signals/safe-react/tracking";
|
|
4022
4339
|
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
4023
4340
|
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
4024
|
-
import
|
|
4025
|
-
var Tag = /* @__PURE__ */
|
|
4026
|
-
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();
|
|
4027
4344
|
try {
|
|
4028
4345
|
const { tx } = useThemeContext();
|
|
4029
|
-
const
|
|
4030
|
-
return /* @__PURE__ */
|
|
4346
|
+
const Root8 = asChild ? Slot13 : Primitive13.span;
|
|
4347
|
+
return /* @__PURE__ */ React35.createElement(Root8, {
|
|
4031
4348
|
...props,
|
|
4032
4349
|
className: tx("tag.root", "dx-tag", {
|
|
4033
4350
|
palette
|
|
@@ -4041,17 +4358,17 @@ var Tag = /* @__PURE__ */ forwardRef26(({ asChild, palette = "neutral", classNam
|
|
|
4041
4358
|
});
|
|
4042
4359
|
|
|
4043
4360
|
// src/components/Toast/Toast.tsx
|
|
4044
|
-
import { useSignals as
|
|
4361
|
+
import { useSignals as _useSignals36 } from "@preact-signals/safe-react/tracking";
|
|
4045
4362
|
import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
|
|
4046
4363
|
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
4047
|
-
import {
|
|
4048
|
-
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";
|
|
4049
4366
|
var ToastProvider = ToastProviderPrimitive;
|
|
4050
|
-
var ToastViewport = /* @__PURE__ */
|
|
4051
|
-
var _effect =
|
|
4367
|
+
var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forwardedRef) => {
|
|
4368
|
+
var _effect = _useSignals36();
|
|
4052
4369
|
try {
|
|
4053
4370
|
const { tx } = useThemeContext();
|
|
4054
|
-
return /* @__PURE__ */
|
|
4371
|
+
return /* @__PURE__ */ React36.createElement(ToastViewportPrimitive, {
|
|
4055
4372
|
className: tx("toast.viewport", "toast-viewport", {}, classNames),
|
|
4056
4373
|
ref: forwardedRef
|
|
4057
4374
|
});
|
|
@@ -4059,27 +4376,27 @@ var ToastViewport = /* @__PURE__ */ forwardRef27(({ classNames, ...props }, forw
|
|
|
4059
4376
|
_effect.f();
|
|
4060
4377
|
}
|
|
4061
4378
|
});
|
|
4062
|
-
var ToastRoot = /* @__PURE__ */
|
|
4063
|
-
var _effect =
|
|
4379
|
+
var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
4380
|
+
var _effect = _useSignals36();
|
|
4064
4381
|
try {
|
|
4065
4382
|
const { tx } = useThemeContext();
|
|
4066
|
-
return /* @__PURE__ */
|
|
4383
|
+
return /* @__PURE__ */ React36.createElement(ToastRootPrimitive, {
|
|
4067
4384
|
...props,
|
|
4068
4385
|
className: tx("toast.root", "toast", {}, classNames),
|
|
4069
4386
|
ref: forwardedRef
|
|
4070
|
-
}, /* @__PURE__ */
|
|
4387
|
+
}, /* @__PURE__ */ React36.createElement(ElevationProvider, {
|
|
4071
4388
|
elevation: "toast"
|
|
4072
4389
|
}, children));
|
|
4073
4390
|
} finally {
|
|
4074
4391
|
_effect.f();
|
|
4075
4392
|
}
|
|
4076
4393
|
});
|
|
4077
|
-
var ToastBody = /* @__PURE__ */
|
|
4078
|
-
var _effect =
|
|
4394
|
+
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4395
|
+
var _effect = _useSignals36();
|
|
4079
4396
|
try {
|
|
4080
4397
|
const { tx } = useThemeContext();
|
|
4081
|
-
const
|
|
4082
|
-
return /* @__PURE__ */
|
|
4398
|
+
const Root8 = asChild ? Slot14 : Primitive14.div;
|
|
4399
|
+
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4083
4400
|
...props,
|
|
4084
4401
|
className: tx("toast.body", "toast__body", {}, classNames),
|
|
4085
4402
|
ref: forwardedRef
|
|
@@ -4088,12 +4405,12 @@ var ToastBody = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...props },
|
|
|
4088
4405
|
_effect.f();
|
|
4089
4406
|
}
|
|
4090
4407
|
});
|
|
4091
|
-
var ToastTitle = /* @__PURE__ */
|
|
4092
|
-
var _effect =
|
|
4408
|
+
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4409
|
+
var _effect = _useSignals36();
|
|
4093
4410
|
try {
|
|
4094
4411
|
const { tx } = useThemeContext();
|
|
4095
|
-
const
|
|
4096
|
-
return /* @__PURE__ */
|
|
4412
|
+
const Root8 = asChild ? Slot14 : ToastTitlePrimitive;
|
|
4413
|
+
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4097
4414
|
...props,
|
|
4098
4415
|
className: tx("toast.title", "toast__title", {}, classNames),
|
|
4099
4416
|
ref: forwardedRef
|
|
@@ -4102,12 +4419,12 @@ var ToastTitle = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...props }
|
|
|
4102
4419
|
_effect.f();
|
|
4103
4420
|
}
|
|
4104
4421
|
});
|
|
4105
|
-
var ToastDescription = /* @__PURE__ */
|
|
4106
|
-
var _effect =
|
|
4422
|
+
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4423
|
+
var _effect = _useSignals36();
|
|
4107
4424
|
try {
|
|
4108
4425
|
const { tx } = useThemeContext();
|
|
4109
|
-
const
|
|
4110
|
-
return /* @__PURE__ */
|
|
4426
|
+
const Root8 = asChild ? Slot14 : ToastDescriptionPrimitive;
|
|
4427
|
+
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4111
4428
|
...props,
|
|
4112
4429
|
className: tx("toast.description", "toast__description", {}, classNames),
|
|
4113
4430
|
ref: forwardedRef
|
|
@@ -4116,12 +4433,12 @@ var ToastDescription = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...p
|
|
|
4116
4433
|
_effect.f();
|
|
4117
4434
|
}
|
|
4118
4435
|
});
|
|
4119
|
-
var ToastActions = /* @__PURE__ */
|
|
4120
|
-
var _effect =
|
|
4436
|
+
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4437
|
+
var _effect = _useSignals36();
|
|
4121
4438
|
try {
|
|
4122
4439
|
const { tx } = useThemeContext();
|
|
4123
|
-
const
|
|
4124
|
-
return /* @__PURE__ */
|
|
4440
|
+
const Root8 = asChild ? Slot14 : Primitive14.div;
|
|
4441
|
+
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4125
4442
|
...props,
|
|
4126
4443
|
className: tx("toast.actions", "toast__actions", {}, classNames),
|
|
4127
4444
|
ref: forwardedRef
|
|
@@ -4145,30 +4462,39 @@ var Toast = {
|
|
|
4145
4462
|
};
|
|
4146
4463
|
|
|
4147
4464
|
// src/components/Toolbar/Toolbar.tsx
|
|
4148
|
-
import { useSignals as
|
|
4465
|
+
import { useSignals as _useSignals37 } from "@preact-signals/safe-react/tracking";
|
|
4149
4466
|
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
4150
|
-
import
|
|
4151
|
-
var ToolbarRoot = /* @__PURE__ */
|
|
4152
|
-
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();
|
|
4153
4470
|
try {
|
|
4154
4471
|
const { tx } = useThemeContext();
|
|
4155
|
-
|
|
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, {
|
|
4156
4480
|
...props,
|
|
4481
|
+
"data-arrow-keys": props.orientation === "vertical" ? "up down" : "left right",
|
|
4157
4482
|
className: tx("toolbar.root", "toolbar", {
|
|
4158
|
-
layoutManaged
|
|
4483
|
+
layoutManaged,
|
|
4484
|
+
disabled
|
|
4159
4485
|
}, classNames),
|
|
4160
4486
|
ref: forwardedRef
|
|
4161
|
-
}, children);
|
|
4487
|
+
}, /* @__PURE__ */ React37.createElement(InnerRoot, innerRootProps, children));
|
|
4162
4488
|
} finally {
|
|
4163
4489
|
_effect.f();
|
|
4164
4490
|
}
|
|
4165
4491
|
});
|
|
4166
|
-
var ToolbarButton = /* @__PURE__ */
|
|
4167
|
-
var _effect =
|
|
4492
|
+
var ToolbarButton = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4493
|
+
var _effect = _useSignals37();
|
|
4168
4494
|
try {
|
|
4169
|
-
return /* @__PURE__ */
|
|
4495
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
4170
4496
|
asChild: true
|
|
4171
|
-
}, /* @__PURE__ */
|
|
4497
|
+
}, /* @__PURE__ */ React37.createElement(Button, {
|
|
4172
4498
|
...props,
|
|
4173
4499
|
ref: forwardedRef
|
|
4174
4500
|
}));
|
|
@@ -4176,12 +4502,12 @@ var ToolbarButton = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
4176
4502
|
_effect.f();
|
|
4177
4503
|
}
|
|
4178
4504
|
});
|
|
4179
|
-
var ToolbarIconButton = /* @__PURE__ */
|
|
4180
|
-
var _effect =
|
|
4505
|
+
var ToolbarIconButton = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4506
|
+
var _effect = _useSignals37();
|
|
4181
4507
|
try {
|
|
4182
|
-
return /* @__PURE__ */
|
|
4508
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
4183
4509
|
asChild: true
|
|
4184
|
-
}, /* @__PURE__ */
|
|
4510
|
+
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
4185
4511
|
...props,
|
|
4186
4512
|
ref: forwardedRef
|
|
4187
4513
|
}));
|
|
@@ -4189,12 +4515,12 @@ var ToolbarIconButton = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
4189
4515
|
_effect.f();
|
|
4190
4516
|
}
|
|
4191
4517
|
});
|
|
4192
|
-
var ToolbarToggle = /* @__PURE__ */
|
|
4193
|
-
var _effect =
|
|
4518
|
+
var ToolbarToggle = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4519
|
+
var _effect = _useSignals37();
|
|
4194
4520
|
try {
|
|
4195
|
-
return /* @__PURE__ */
|
|
4521
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
4196
4522
|
asChild: true
|
|
4197
|
-
}, /* @__PURE__ */
|
|
4523
|
+
}, /* @__PURE__ */ React37.createElement(Toggle, {
|
|
4198
4524
|
...props,
|
|
4199
4525
|
ref: forwardedRef
|
|
4200
4526
|
}));
|
|
@@ -4202,12 +4528,12 @@ var ToolbarToggle = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
4202
4528
|
_effect.f();
|
|
4203
4529
|
}
|
|
4204
4530
|
});
|
|
4205
|
-
var ToolbarLink = /* @__PURE__ */
|
|
4206
|
-
var _effect =
|
|
4531
|
+
var ToolbarLink = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4532
|
+
var _effect = _useSignals37();
|
|
4207
4533
|
try {
|
|
4208
|
-
return /* @__PURE__ */
|
|
4534
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Link, {
|
|
4209
4535
|
asChild: true
|
|
4210
|
-
}, /* @__PURE__ */
|
|
4536
|
+
}, /* @__PURE__ */ React37.createElement(Link, {
|
|
4211
4537
|
...props,
|
|
4212
4538
|
ref: forwardedRef
|
|
4213
4539
|
}));
|
|
@@ -4215,13 +4541,13 @@ var ToolbarLink = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
4215
4541
|
_effect.f();
|
|
4216
4542
|
}
|
|
4217
4543
|
});
|
|
4218
|
-
var ToolbarToggleGroup2 = /* @__PURE__ */
|
|
4219
|
-
var _effect =
|
|
4544
|
+
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef29(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
4545
|
+
var _effect = _useSignals37();
|
|
4220
4546
|
try {
|
|
4221
|
-
return /* @__PURE__ */
|
|
4547
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
4222
4548
|
...props,
|
|
4223
4549
|
asChild: true
|
|
4224
|
-
}, /* @__PURE__ */
|
|
4550
|
+
}, /* @__PURE__ */ React37.createElement(ButtonGroup, {
|
|
4225
4551
|
classNames,
|
|
4226
4552
|
children,
|
|
4227
4553
|
elevation,
|
|
@@ -4231,13 +4557,13 @@ var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef28(({ classNames, children,
|
|
|
4231
4557
|
_effect.f();
|
|
4232
4558
|
}
|
|
4233
4559
|
});
|
|
4234
|
-
var ToolbarToggleGroupItem = /* @__PURE__ */
|
|
4235
|
-
var _effect =
|
|
4560
|
+
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef29(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
4561
|
+
var _effect = _useSignals37();
|
|
4236
4562
|
try {
|
|
4237
|
-
return /* @__PURE__ */
|
|
4563
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
4238
4564
|
...props,
|
|
4239
4565
|
asChild: true
|
|
4240
|
-
}, /* @__PURE__ */
|
|
4566
|
+
}, /* @__PURE__ */ React37.createElement(Button, {
|
|
4241
4567
|
variant,
|
|
4242
4568
|
density,
|
|
4243
4569
|
elevation,
|
|
@@ -4249,13 +4575,13 @@ var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef28(({ variant, density, e
|
|
|
4249
4575
|
_effect.f();
|
|
4250
4576
|
}
|
|
4251
4577
|
});
|
|
4252
|
-
var ToolbarToggleGroupIconItem = /* @__PURE__ */
|
|
4253
|
-
var _effect =
|
|
4578
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef29(({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
4579
|
+
var _effect = _useSignals37();
|
|
4254
4580
|
try {
|
|
4255
|
-
return /* @__PURE__ */
|
|
4581
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
4256
4582
|
...props,
|
|
4257
4583
|
asChild: true
|
|
4258
|
-
}, /* @__PURE__ */
|
|
4584
|
+
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
4259
4585
|
variant,
|
|
4260
4586
|
density,
|
|
4261
4587
|
elevation,
|
|
@@ -4269,15 +4595,15 @@ var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef28(({ variant, densit
|
|
|
4269
4595
|
_effect.f();
|
|
4270
4596
|
}
|
|
4271
4597
|
});
|
|
4272
|
-
var ToolbarSeparator = /* @__PURE__ */
|
|
4273
|
-
var _effect =
|
|
4598
|
+
var ToolbarSeparator = /* @__PURE__ */ forwardRef29(({ variant = "line", ...props }, forwardedRef) => {
|
|
4599
|
+
var _effect = _useSignals37();
|
|
4274
4600
|
try {
|
|
4275
|
-
return variant === "line" ? /* @__PURE__ */
|
|
4601
|
+
return variant === "line" ? /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Separator, {
|
|
4276
4602
|
asChild: true
|
|
4277
|
-
}, /* @__PURE__ */
|
|
4603
|
+
}, /* @__PURE__ */ React37.createElement(Separator4, {
|
|
4278
4604
|
...props,
|
|
4279
4605
|
ref: forwardedRef
|
|
4280
|
-
})) : /* @__PURE__ */
|
|
4606
|
+
})) : /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Separator, {
|
|
4281
4607
|
className: "grow",
|
|
4282
4608
|
ref: forwardedRef
|
|
4283
4609
|
});
|
|
@@ -4318,13 +4644,13 @@ export {
|
|
|
4318
4644
|
AnchoredOverflow,
|
|
4319
4645
|
useAvatarContext,
|
|
4320
4646
|
Avatar,
|
|
4647
|
+
Icon,
|
|
4321
4648
|
Link,
|
|
4322
4649
|
Breadcrumb,
|
|
4323
4650
|
BUTTON_GROUP_NAME,
|
|
4324
4651
|
useButtonGroupContext,
|
|
4325
4652
|
Button,
|
|
4326
4653
|
ButtonGroup,
|
|
4327
|
-
Icon,
|
|
4328
4654
|
createTooltipScope,
|
|
4329
4655
|
useTooltipContext,
|
|
4330
4656
|
Tooltip,
|
|
@@ -4332,8 +4658,11 @@ export {
|
|
|
4332
4658
|
Toggle,
|
|
4333
4659
|
ToggleGroup,
|
|
4334
4660
|
ToggleGroupItem,
|
|
4661
|
+
ToggleGroupIconItem,
|
|
4335
4662
|
useClipboard,
|
|
4663
|
+
Domino,
|
|
4336
4664
|
hasIosKeyboard,
|
|
4665
|
+
usePx,
|
|
4337
4666
|
DensityContext,
|
|
4338
4667
|
DensityProvider,
|
|
4339
4668
|
ElevationContext,
|
|
@@ -4344,8 +4673,8 @@ export {
|
|
|
4344
4673
|
Dialog,
|
|
4345
4674
|
AlertDialog,
|
|
4346
4675
|
Input,
|
|
4347
|
-
LIST_NAME,
|
|
4348
4676
|
LIST_ITEM_NAME,
|
|
4677
|
+
LIST_NAME,
|
|
4349
4678
|
useListContext,
|
|
4350
4679
|
useListItemContext,
|
|
4351
4680
|
List,
|
|
@@ -4369,10 +4698,12 @@ export {
|
|
|
4369
4698
|
Popover,
|
|
4370
4699
|
Status,
|
|
4371
4700
|
ScrollArea,
|
|
4701
|
+
useScrollContainerContext,
|
|
4702
|
+
ScrollContainer,
|
|
4372
4703
|
Select,
|
|
4373
4704
|
Separator4 as Separator,
|
|
4374
4705
|
Tag,
|
|
4375
4706
|
Toast,
|
|
4376
4707
|
Toolbar
|
|
4377
4708
|
};
|
|
4378
|
-
//# sourceMappingURL=chunk-
|
|
4709
|
+
//# sourceMappingURL=chunk-SP7VQH72.mjs.map
|