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