@dxos/react-ui 0.8.1 → 0.8.2-main.10c050d
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-5Y5JI6KC.mjs +4355 -0
- package/dist/lib/browser/chunk-5Y5JI6KC.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +75 -2986
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +85 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/node/chunk-KMS7RFL7.cjs +4340 -0
- package/dist/lib/node/chunk-KMS7RFL7.cjs.map +7 -0
- package/dist/lib/node/index.cjs +71 -2946
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +114 -0
- package/dist/lib/node/testing/index.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-ANVE7WX5.mjs +4357 -0
- package/dist/lib/node-esm/chunk-ANVE7WX5.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +74 -2986
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +86 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/types/src/components/Avatars/Avatar.d.ts +4 -4
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +3 -3
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +0 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts +10 -44
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts +4 -6
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts +7 -6
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +1 -4
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +2 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +2 -2
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +2 -2
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts +2 -2
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +2 -2
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +1 -1
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +33 -159
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts +1 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/useSwipeToDismiss.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +8 -2
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +15 -6
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +5 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts.map +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.stories.d.ts +2 -2
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +92 -20
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +40 -17
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useIconHref.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeCollisionPadding.d.ts.map +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +8 -0
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/index.d.ts +1 -1
- package/dist/types/src/testing/decorators/index.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/{withVariants.d.ts → withSurfaceVariantsLayout.d.ts} +2 -3
- package/dist/types/src/testing/decorators/withSurfaceVariantsLayout.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -15
- package/src/components/Avatars/Avatar.stories.tsx +27 -27
- package/src/components/Avatars/Avatar.tsx +24 -21
- package/src/components/Avatars/AvatarGroup.stories.tsx +4 -5
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +2 -2
- package/src/components/Buttons/Button.stories.tsx +20 -15
- package/src/components/Buttons/IconButton.stories.tsx +9 -10
- package/src/components/Buttons/IconButton.tsx +9 -38
- package/src/components/Buttons/Toggle.stories.tsx +2 -2
- package/src/components/Buttons/ToggleGroup.stories.tsx +3 -7
- package/src/components/Clipboard/CopyButton.tsx +22 -24
- package/src/components/Dialogs/AlertDialog.stories.tsx +4 -11
- package/src/components/Dialogs/Dialog.stories.tsx +3 -3
- package/src/components/Dialogs/Dialog.tsx +8 -4
- package/src/components/Input/Input.stories.tsx +69 -58
- package/src/components/Input/Input.tsx +1 -0
- package/src/components/Lists/Tree.stories.tsx +2 -2
- package/src/components/Lists/Treegrid.stories.tsx +12 -12
- package/src/components/Main/Main.stories.tsx +2 -2
- package/src/components/Main/Main.tsx +1 -0
- package/src/components/Menus/ContextMenu.stories.tsx +2 -2
- package/src/components/Menus/DropdownMenu.stories.tsx +2 -2
- package/src/components/Message/Message.stories.tsx +10 -4
- package/src/components/Popover/Popover.stories.tsx +2 -2
- package/src/components/Popover/Popover.tsx +8 -4
- package/src/components/ScrollArea/ScrollArea.stories.tsx +4 -4
- package/src/components/ScrollArea/ScrollArea.tsx +3 -0
- package/src/components/Select/Select.stories.tsx +2 -2
- package/src/components/Toast/Toast.stories.tsx +15 -10
- package/src/components/Toolbar/Toolbar.stories.tsx +2 -2
- package/src/components/Tooltip/Tooltip.stories.tsx +43 -18
- package/src/components/Tooltip/Tooltip.tsx +733 -58
- package/src/components/index.ts +1 -1
- package/src/playground/Controls.stories.tsx +4 -4
- package/src/playground/Custom.stories.tsx +137 -0
- package/src/playground/Typography.stories.tsx +2 -2
- package/src/testing/decorators/index.ts +1 -1
- package/src/testing/decorators/withSurfaceVariantsLayout.tsx +53 -0
- package/dist/types/src/testing/decorators/withVariants.d.ts.map +0 -1
- package/src/testing/decorators/withVariants.tsx +0 -45
|
@@ -0,0 +1,4340 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var chunk_KMS7RFL7_exports = {};
|
|
30
|
+
__export(chunk_KMS7RFL7_exports, {
|
|
31
|
+
AlertDialog: () => AlertDialog,
|
|
32
|
+
AnchoredOverflow: () => AnchoredOverflow,
|
|
33
|
+
Avatar: () => Avatar,
|
|
34
|
+
BUTTON_GROUP_NAME: () => BUTTON_GROUP_NAME,
|
|
35
|
+
Breadcrumb: () => Breadcrumb,
|
|
36
|
+
Button: () => Button,
|
|
37
|
+
ButtonGroup: () => ButtonGroup,
|
|
38
|
+
Clipboard: () => Clipboard,
|
|
39
|
+
ContextMenu: () => ContextMenu2,
|
|
40
|
+
DensityContext: () => DensityContext,
|
|
41
|
+
DensityProvider: () => DensityProvider,
|
|
42
|
+
Dialog: () => Dialog,
|
|
43
|
+
DropdownMenu: () => DropdownMenu,
|
|
44
|
+
ElevationContext: () => ElevationContext,
|
|
45
|
+
ElevationProvider: () => ElevationProvider,
|
|
46
|
+
Icon: () => Icon,
|
|
47
|
+
IconButton: () => IconButton,
|
|
48
|
+
Input: () => Input,
|
|
49
|
+
LIST_ITEM_NAME: () => import_react_list.LIST_ITEM_NAME,
|
|
50
|
+
LIST_NAME: () => import_react_list.LIST_NAME,
|
|
51
|
+
Link: () => Link,
|
|
52
|
+
List: () => List,
|
|
53
|
+
ListItem: () => ListItem,
|
|
54
|
+
Main: () => Main,
|
|
55
|
+
Message: () => Message,
|
|
56
|
+
Popover: () => Popover,
|
|
57
|
+
ScrollArea: () => ScrollArea,
|
|
58
|
+
Select: () => Select,
|
|
59
|
+
Separator: () => Separator4,
|
|
60
|
+
Status: () => Status,
|
|
61
|
+
Tag: () => Tag,
|
|
62
|
+
ThemeContext: () => ThemeContext,
|
|
63
|
+
ThemeProvider: () => ThemeProvider,
|
|
64
|
+
Toast: () => Toast,
|
|
65
|
+
Toggle: () => Toggle,
|
|
66
|
+
ToggleGroup: () => ToggleGroup,
|
|
67
|
+
ToggleGroupItem: () => ToggleGroupItem,
|
|
68
|
+
Toolbar: () => Toolbar,
|
|
69
|
+
Tooltip: () => Tooltip,
|
|
70
|
+
Tree: () => Tree,
|
|
71
|
+
TreeItem: () => TreeItem,
|
|
72
|
+
Treegrid: () => Treegrid,
|
|
73
|
+
createDropdownMenuScope: () => createDropdownMenuScope,
|
|
74
|
+
createPopoverScope: () => createPopoverScope,
|
|
75
|
+
createTooltipScope: () => createTooltipScope,
|
|
76
|
+
hasIosKeyboard: () => hasIosKeyboard,
|
|
77
|
+
initialSafeArea: () => initialSafeArea,
|
|
78
|
+
isLabel: () => isLabel,
|
|
79
|
+
toLocalizedString: () => toLocalizedString,
|
|
80
|
+
useAvatarContext: () => useAvatarContext,
|
|
81
|
+
useButtonGroupContext: () => useButtonGroupContext,
|
|
82
|
+
useClipboard: () => useClipboard,
|
|
83
|
+
useDensityContext: () => useDensityContext,
|
|
84
|
+
useDropdownMenuContext: () => useDropdownMenuContext,
|
|
85
|
+
useDropdownMenuMenuScope: () => useDropdownMenuMenuScope,
|
|
86
|
+
useElevationContext: () => useElevationContext,
|
|
87
|
+
useIconHref: () => useIconHref,
|
|
88
|
+
useLandmarkMover: () => useLandmarkMover,
|
|
89
|
+
useListContext: () => import_react_list.useListContext,
|
|
90
|
+
useListItemContext: () => import_react_list.useListItemContext,
|
|
91
|
+
useMainContext: () => useMainContext,
|
|
92
|
+
useSafeArea: () => useSafeArea,
|
|
93
|
+
useSidebars: () => useSidebars,
|
|
94
|
+
useThemeContext: () => useThemeContext,
|
|
95
|
+
useTooltipContext: () => useTooltipContext,
|
|
96
|
+
useTranslation: () => useTranslation,
|
|
97
|
+
useTranslationsContext: () => useTranslationsContext,
|
|
98
|
+
useVisualViewport: () => useVisualViewport
|
|
99
|
+
});
|
|
100
|
+
module.exports = __toCommonJS(chunk_KMS7RFL7_exports);
|
|
101
|
+
var import_react = require("react");
|
|
102
|
+
var import_tracking = require("@preact-signals/safe-react/tracking");
|
|
103
|
+
var import_react_primitive = require("@radix-ui/react-primitive");
|
|
104
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
105
|
+
var import_react2 = __toESM(require("react"));
|
|
106
|
+
var import_react3 = require("react");
|
|
107
|
+
var import_react4 = require("react");
|
|
108
|
+
var import_debug = require("@dxos/debug");
|
|
109
|
+
var import_react5 = require("react");
|
|
110
|
+
var import_react_hooks = require("@dxos/react-hooks");
|
|
111
|
+
var import_react6 = require("react");
|
|
112
|
+
var import_tracking2 = require("@preact-signals/safe-react/tracking");
|
|
113
|
+
var import_locale = require("date-fns/locale");
|
|
114
|
+
var import_i18next = __toESM(require("i18next"));
|
|
115
|
+
var import_react7 = __toESM(require("react"));
|
|
116
|
+
var import_react_i18next = require("react-i18next");
|
|
117
|
+
var import_react8 = require("react");
|
|
118
|
+
var import_react_hooks2 = require("@dxos/react-hooks");
|
|
119
|
+
var import_tracking3 = require("@preact-signals/safe-react/tracking");
|
|
120
|
+
var import_dx_avatar = require("@dxos/lit-ui/dx-avatar.pcss");
|
|
121
|
+
var import_react_context = require("@radix-ui/react-context");
|
|
122
|
+
var import_react_primitive2 = require("@radix-ui/react-primitive");
|
|
123
|
+
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
124
|
+
var import_react9 = __toESM(require("react"));
|
|
125
|
+
var import_react10 = require("@dxos/lit-ui/react");
|
|
126
|
+
var import_react_hooks3 = require("@dxos/react-hooks");
|
|
127
|
+
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
128
|
+
var import_tracking4 = require("@preact-signals/safe-react/tracking");
|
|
129
|
+
var import_react11 = require("@phosphor-icons/react");
|
|
130
|
+
var import_react_primitive3 = require("@radix-ui/react-primitive");
|
|
131
|
+
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
132
|
+
var import_react12 = __toESM(require("react"));
|
|
133
|
+
var import_tracking5 = require("@preact-signals/safe-react/tracking");
|
|
134
|
+
var import_react_primitive4 = require("@radix-ui/react-primitive");
|
|
135
|
+
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
136
|
+
var import_react13 = __toESM(require("react"));
|
|
137
|
+
var import_tracking6 = require("@preact-signals/safe-react/tracking");
|
|
138
|
+
var import_react_context2 = require("@radix-ui/react-context");
|
|
139
|
+
var import_react_primitive5 = require("@radix-ui/react-primitive");
|
|
140
|
+
var import_react_slot5 = require("@radix-ui/react-slot");
|
|
141
|
+
var import_react14 = __toESM(require("react"));
|
|
142
|
+
var import_tracking7 = require("@preact-signals/safe-react/tracking");
|
|
143
|
+
var import_react15 = __toESM(require("react"));
|
|
144
|
+
var import_tracking8 = require("@preact-signals/safe-react/tracking");
|
|
145
|
+
var import_react16 = __toESM(require("react"));
|
|
146
|
+
var import_tracking9 = require("@preact-signals/safe-react/tracking");
|
|
147
|
+
var import_primitive = require("@radix-ui/primitive");
|
|
148
|
+
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
|
149
|
+
var import_react_context3 = require("@radix-ui/react-context");
|
|
150
|
+
var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer");
|
|
151
|
+
var import_react_id = require("@radix-ui/react-id");
|
|
152
|
+
var PopperPrimitive = __toESM(require("@radix-ui/react-popper"));
|
|
153
|
+
var import_react_popper = require("@radix-ui/react-popper");
|
|
154
|
+
var import_react_portal = require("@radix-ui/react-portal");
|
|
155
|
+
var import_react_presence = require("@radix-ui/react-presence");
|
|
156
|
+
var import_react_primitive6 = require("@radix-ui/react-primitive");
|
|
157
|
+
var import_react_slot6 = require("@radix-ui/react-slot");
|
|
158
|
+
var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
|
|
159
|
+
var VisuallyHiddenPrimitive = __toESM(require("@radix-ui/react-visually-hidden"));
|
|
160
|
+
var import_react17 = __toESM(require("react"));
|
|
161
|
+
var import_tracking10 = require("@preact-signals/safe-react/tracking");
|
|
162
|
+
var import_react_toggle = require("@radix-ui/react-toggle");
|
|
163
|
+
var import_react18 = __toESM(require("react"));
|
|
164
|
+
var import_tracking11 = require("@preact-signals/safe-react/tracking");
|
|
165
|
+
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
166
|
+
var import_react19 = __toESM(require("react"));
|
|
167
|
+
var import_tracking12 = require("@preact-signals/safe-react/tracking");
|
|
168
|
+
var import_react20 = __toESM(require("react"));
|
|
169
|
+
var import_tracking13 = require("@preact-signals/safe-react/tracking");
|
|
170
|
+
var import_react21 = __toESM(require("react"));
|
|
171
|
+
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
172
|
+
var import_tracking14 = require("@preact-signals/safe-react/tracking");
|
|
173
|
+
var import_keyborg = require("keyborg");
|
|
174
|
+
var import_react22 = __toESM(require("react"));
|
|
175
|
+
var import_tracking15 = require("@preact-signals/safe-react/tracking");
|
|
176
|
+
var import_react23 = __toESM(require("react"));
|
|
177
|
+
var import_tracking16 = require("@preact-signals/safe-react/tracking");
|
|
178
|
+
var import_react24 = __toESM(require("react"));
|
|
179
|
+
var import_tracking17 = require("@preact-signals/safe-react/tracking");
|
|
180
|
+
var import_react_context4 = require("@radix-ui/react-context");
|
|
181
|
+
var import_react_dialog = require("@radix-ui/react-dialog");
|
|
182
|
+
var import_react25 = __toESM(require("react"));
|
|
183
|
+
var import_tracking18 = require("@preact-signals/safe-react/tracking");
|
|
184
|
+
var import_react_alert_dialog = require("@radix-ui/react-alert-dialog");
|
|
185
|
+
var import_react_context5 = require("@radix-ui/react-context");
|
|
186
|
+
var import_react26 = __toESM(require("react"));
|
|
187
|
+
var import_tracking19 = require("@preact-signals/safe-react/tracking");
|
|
188
|
+
var import_react_checkbox = require("@radix-ui/react-checkbox");
|
|
189
|
+
var import_react_use_controllable_state2 = require("@radix-ui/react-use-controllable-state");
|
|
190
|
+
var import_react27 = __toESM(require("react"));
|
|
191
|
+
var import_react_input = require("@dxos/react-input");
|
|
192
|
+
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
193
|
+
var import_tracking20 = require("@preact-signals/safe-react/tracking");
|
|
194
|
+
var import_react28 = require("@phosphor-icons/react");
|
|
195
|
+
var import_react_slot7 = require("@radix-ui/react-slot");
|
|
196
|
+
var import_react29 = __toESM(require("react"));
|
|
197
|
+
var import_react_list = require("@dxos/react-list");
|
|
198
|
+
var import_tracking21 = require("@preact-signals/safe-react/tracking");
|
|
199
|
+
var import_react30 = __toESM(require("react"));
|
|
200
|
+
var import_tracking22 = require("@preact-signals/safe-react/tracking");
|
|
201
|
+
var import_react31 = __toESM(require("react"));
|
|
202
|
+
var import_tracking23 = require("@preact-signals/safe-react/tracking");
|
|
203
|
+
var import_react32 = __toESM(require("react"));
|
|
204
|
+
var import_tracking24 = require("@preact-signals/safe-react/tracking");
|
|
205
|
+
var import_react_tabster = require("@fluentui/react-tabster");
|
|
206
|
+
var import_react_context6 = require("@radix-ui/react-context");
|
|
207
|
+
var import_react_primitive7 = require("@radix-ui/react-primitive");
|
|
208
|
+
var import_react_slot8 = require("@radix-ui/react-slot");
|
|
209
|
+
var import_react_use_controllable_state3 = require("@radix-ui/react-use-controllable-state");
|
|
210
|
+
var import_react33 = __toESM(require("react"));
|
|
211
|
+
var import_tracking25 = require("@preact-signals/safe-react/tracking");
|
|
212
|
+
var import_react_context7 = require("@radix-ui/react-context");
|
|
213
|
+
var import_react_dialog2 = require("@radix-ui/react-dialog");
|
|
214
|
+
var import_react_primitive8 = require("@radix-ui/react-primitive");
|
|
215
|
+
var import_react_slot9 = require("@radix-ui/react-slot");
|
|
216
|
+
var import_react_use_controllable_state4 = require("@radix-ui/react-use-controllable-state");
|
|
217
|
+
var import_react34 = __toESM(require("react"));
|
|
218
|
+
var import_log = require("@dxos/log");
|
|
219
|
+
var import_react_hooks4 = require("@dxos/react-hooks");
|
|
220
|
+
var import_react35 = require("react");
|
|
221
|
+
var import_tracking26 = require("@preact-signals/safe-react/tracking");
|
|
222
|
+
var ContextMenuPrimitive = __toESM(require("@radix-ui/react-context-menu"));
|
|
223
|
+
var import_react_primitive9 = require("@radix-ui/react-primitive");
|
|
224
|
+
var import_react_slot10 = require("@radix-ui/react-slot");
|
|
225
|
+
var import_react36 = __toESM(require("react"));
|
|
226
|
+
var import_react37 = require("react");
|
|
227
|
+
var import_tracking27 = require("@preact-signals/safe-react/tracking");
|
|
228
|
+
var import_primitive2 = require("@radix-ui/primitive");
|
|
229
|
+
var import_react_compose_refs2 = require("@radix-ui/react-compose-refs");
|
|
230
|
+
var import_react_context8 = require("@radix-ui/react-context");
|
|
231
|
+
var import_react_id2 = require("@radix-ui/react-id");
|
|
232
|
+
var MenuPrimitive = __toESM(require("@radix-ui/react-menu"));
|
|
233
|
+
var import_react_menu = require("@radix-ui/react-menu");
|
|
234
|
+
var import_react_primitive10 = require("@radix-ui/react-primitive");
|
|
235
|
+
var import_react_slot11 = require("@radix-ui/react-slot");
|
|
236
|
+
var import_react_use_controllable_state5 = require("@radix-ui/react-use-controllable-state");
|
|
237
|
+
var import_react38 = __toESM(require("react"));
|
|
238
|
+
var import_tracking28 = require("@preact-signals/safe-react/tracking");
|
|
239
|
+
var import_react_context9 = require("@radix-ui/react-context");
|
|
240
|
+
var import_react_primitive11 = require("@radix-ui/react-primitive");
|
|
241
|
+
var import_react_slot12 = require("@radix-ui/react-slot");
|
|
242
|
+
var import_react39 = __toESM(require("react"));
|
|
243
|
+
var import_react_hooks5 = require("@dxos/react-hooks");
|
|
244
|
+
var import_tracking29 = require("@preact-signals/safe-react/tracking");
|
|
245
|
+
var import_primitive3 = require("@radix-ui/primitive");
|
|
246
|
+
var import_react_compose_refs3 = require("@radix-ui/react-compose-refs");
|
|
247
|
+
var import_react_context10 = require("@radix-ui/react-context");
|
|
248
|
+
var import_react_dismissable_layer2 = require("@radix-ui/react-dismissable-layer");
|
|
249
|
+
var import_react_focus_guards = require("@radix-ui/react-focus-guards");
|
|
250
|
+
var import_react_focus_scope = require("@radix-ui/react-focus-scope");
|
|
251
|
+
var import_react_id3 = require("@radix-ui/react-id");
|
|
252
|
+
var PopperPrimitive2 = __toESM(require("@radix-ui/react-popper"));
|
|
253
|
+
var import_react_popper2 = require("@radix-ui/react-popper");
|
|
254
|
+
var import_react_portal2 = require("@radix-ui/react-portal");
|
|
255
|
+
var import_react_presence2 = require("@radix-ui/react-presence");
|
|
256
|
+
var import_react_primitive12 = require("@radix-ui/react-primitive");
|
|
257
|
+
var import_react_slot13 = require("@radix-ui/react-slot");
|
|
258
|
+
var import_react_use_controllable_state6 = require("@radix-ui/react-use-controllable-state");
|
|
259
|
+
var import_aria_hidden = require("aria-hidden");
|
|
260
|
+
var import_react40 = __toESM(require("react"));
|
|
261
|
+
var import_react_remove_scroll = require("react-remove-scroll");
|
|
262
|
+
var import_tracking30 = require("@preact-signals/safe-react/tracking");
|
|
263
|
+
var import_react41 = __toESM(require("react"));
|
|
264
|
+
var import_tracking31 = require("@preact-signals/safe-react/tracking");
|
|
265
|
+
var import_react_scroll_area = require("@radix-ui/react-scroll-area");
|
|
266
|
+
var import_react42 = __toESM(require("react"));
|
|
267
|
+
var import_tracking32 = require("@preact-signals/safe-react/tracking");
|
|
268
|
+
var import_react43 = require("@phosphor-icons/react");
|
|
269
|
+
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
270
|
+
var import_react44 = __toESM(require("react"));
|
|
271
|
+
var import_tracking33 = require("@preact-signals/safe-react/tracking");
|
|
272
|
+
var import_react_separator = require("@radix-ui/react-separator");
|
|
273
|
+
var import_react45 = __toESM(require("react"));
|
|
274
|
+
var import_tracking34 = require("@preact-signals/safe-react/tracking");
|
|
275
|
+
var import_react_primitive13 = require("@radix-ui/react-primitive");
|
|
276
|
+
var import_react_slot14 = require("@radix-ui/react-slot");
|
|
277
|
+
var import_react46 = __toESM(require("react"));
|
|
278
|
+
var import_tracking35 = require("@preact-signals/safe-react/tracking");
|
|
279
|
+
var import_react_primitive14 = require("@radix-ui/react-primitive");
|
|
280
|
+
var import_react_slot15 = require("@radix-ui/react-slot");
|
|
281
|
+
var import_react_toast = require("@radix-ui/react-toast");
|
|
282
|
+
var import_react47 = __toESM(require("react"));
|
|
283
|
+
var import_tracking36 = require("@preact-signals/safe-react/tracking");
|
|
284
|
+
var ToolbarPrimitive = __toESM(require("@radix-ui/react-toolbar"));
|
|
285
|
+
var import_react48 = __toESM(require("react"));
|
|
286
|
+
var useElevationContext = (propsElevation) => {
|
|
287
|
+
const { elevation } = (0, import_react3.useContext)(ElevationContext);
|
|
288
|
+
return propsElevation ?? elevation;
|
|
289
|
+
};
|
|
290
|
+
var useThemeContext = () => (0, import_react4.useContext)(ThemeContext) ?? (0, import_debug.raise)(new Error("Missing ThemeContext"));
|
|
291
|
+
var ICONS_URL = "/icons.svg";
|
|
292
|
+
var useIconHref = (icon) => {
|
|
293
|
+
const { noCache } = useThemeContext();
|
|
294
|
+
const url = noCache ? `${ICONS_URL}?nocache=${(/* @__PURE__ */ new Date()).getMinutes()}` : ICONS_URL;
|
|
295
|
+
return icon ? `${url}#${icon}` : void 0;
|
|
296
|
+
};
|
|
297
|
+
var initialSafeArea = {
|
|
298
|
+
top: NaN,
|
|
299
|
+
right: NaN,
|
|
300
|
+
bottom: NaN,
|
|
301
|
+
left: NaN
|
|
302
|
+
};
|
|
303
|
+
var useSafeArea = () => {
|
|
304
|
+
const [padding, setPadding] = (0, import_react5.useState)(initialSafeArea);
|
|
305
|
+
const handleResize = (0, import_react5.useCallback)(() => {
|
|
306
|
+
setPadding({
|
|
307
|
+
top: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-top")),
|
|
308
|
+
right: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-right")),
|
|
309
|
+
bottom: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-bottom")),
|
|
310
|
+
left: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-left"))
|
|
311
|
+
});
|
|
312
|
+
}, []);
|
|
313
|
+
(0, import_react_hooks.useResize)(handleResize);
|
|
314
|
+
return padding;
|
|
315
|
+
};
|
|
316
|
+
var initialLng = "en-US";
|
|
317
|
+
var initialNs = "dxos-common";
|
|
318
|
+
var initialDtLocale = import_locale.enUS;
|
|
319
|
+
var isLabel = (o) => typeof o === "string" || Array.isArray(o) && o.length === 2 && typeof o[0] === "string" && !!o[1] && typeof o[1] === "object" && "ns" in o[1] && typeof o[1].ns === "string";
|
|
320
|
+
var toLocalizedString = (label, t) => Array.isArray(label) ? t(...label) : label;
|
|
321
|
+
var resources = {
|
|
322
|
+
[initialLng]: {
|
|
323
|
+
[initialNs]: {
|
|
324
|
+
"loading translations": "Loading translations\u2026"
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
void import_i18next.default.use(import_react_i18next.initReactI18next).init({
|
|
329
|
+
resources,
|
|
330
|
+
lng: initialLng,
|
|
331
|
+
defaultNS: initialNs,
|
|
332
|
+
interpolation: {
|
|
333
|
+
escapeValue: false
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
var TranslationsContext = /* @__PURE__ */ (0, import_react7.createContext)({
|
|
337
|
+
appNs: initialNs,
|
|
338
|
+
dtLocale: initialDtLocale
|
|
339
|
+
});
|
|
340
|
+
var useTranslation = (...args) => {
|
|
341
|
+
const result = (0, import_react_i18next.useTranslation)(...args);
|
|
342
|
+
const { dtLocale } = (0, import_react7.useContext)(TranslationsContext);
|
|
343
|
+
return {
|
|
344
|
+
...result,
|
|
345
|
+
dtLocale
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
var TranslationsProvider = ({ fallback, resourceExtensions, children, appNs, dtLocale }) => {
|
|
349
|
+
var _effect = (0, import_tracking2.useSignals)();
|
|
350
|
+
try {
|
|
351
|
+
const [loaded, setLoaded] = (0, import_react7.useState)(false);
|
|
352
|
+
(0, import_react7.useEffect)(() => {
|
|
353
|
+
setLoaded(false);
|
|
354
|
+
if (resourceExtensions && resourceExtensions.length) {
|
|
355
|
+
resourceExtensions.forEach((resource) => {
|
|
356
|
+
Object.keys(resource).forEach((language) => {
|
|
357
|
+
Object.keys(resource[language]).forEach((ns) => {
|
|
358
|
+
import_i18next.default.addResourceBundle(language, ns, resource[language][ns]);
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
setLoaded(true);
|
|
364
|
+
}, [
|
|
365
|
+
resourceExtensions
|
|
366
|
+
]);
|
|
367
|
+
return /* @__PURE__ */ import_react7.default.createElement(TranslationsContext.Provider, {
|
|
368
|
+
value: {
|
|
369
|
+
appNs: appNs ?? initialNs,
|
|
370
|
+
dtLocale: dtLocale ?? initialDtLocale
|
|
371
|
+
}
|
|
372
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react7.Suspense, {
|
|
373
|
+
fallback
|
|
374
|
+
}, loaded ? children : fallback));
|
|
375
|
+
} finally {
|
|
376
|
+
_effect.f();
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
var useTranslationsContext = () => (0, import_react6.useContext)(TranslationsContext);
|
|
380
|
+
var useVisualViewport = (deps) => {
|
|
381
|
+
const [width, setWidth] = (0, import_react8.useState)(null);
|
|
382
|
+
const [height, setHeight] = (0, import_react8.useState)(null);
|
|
383
|
+
const handleResize = (0, import_react8.useCallback)(() => {
|
|
384
|
+
if (window.visualViewport) {
|
|
385
|
+
setWidth(window.visualViewport.width);
|
|
386
|
+
setHeight(window.visualViewport.height);
|
|
387
|
+
}
|
|
388
|
+
}, []);
|
|
389
|
+
(0, import_react_hooks2.useResize)(handleResize);
|
|
390
|
+
return {
|
|
391
|
+
width,
|
|
392
|
+
height
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
var AnchoredOverflowRoot = /* @__PURE__ */ (0, import_react2.forwardRef)(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
396
|
+
var _effect = (0, import_tracking.useSignals)();
|
|
397
|
+
try {
|
|
398
|
+
const { tx } = useThemeContext();
|
|
399
|
+
const Root7 = asChild ? import_react_slot.Slot : import_react_primitive.Primitive.div;
|
|
400
|
+
return /* @__PURE__ */ import_react2.default.createElement(Root7, {
|
|
401
|
+
role: "none",
|
|
402
|
+
...props,
|
|
403
|
+
className: tx("anchoredOverflow.root", "overflow-anchored", {}, classNames),
|
|
404
|
+
ref: forwardedRef
|
|
405
|
+
}, children);
|
|
406
|
+
} finally {
|
|
407
|
+
_effect.f();
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
var AnchoredOverflowAnchor = /* @__PURE__ */ (0, import_react2.forwardRef)(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
411
|
+
var _effect = (0, import_tracking.useSignals)();
|
|
412
|
+
try {
|
|
413
|
+
const { tx } = useThemeContext();
|
|
414
|
+
const Root7 = asChild ? import_react_slot.Slot : import_react_primitive.Primitive.div;
|
|
415
|
+
return /* @__PURE__ */ import_react2.default.createElement(Root7, {
|
|
416
|
+
role: "none",
|
|
417
|
+
...props,
|
|
418
|
+
className: tx("anchoredOverflow.anchor", "overflow-anchor", {}, classNames),
|
|
419
|
+
ref: forwardedRef
|
|
420
|
+
}, children);
|
|
421
|
+
} finally {
|
|
422
|
+
_effect.f();
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
var AnchoredOverflow = {
|
|
426
|
+
Root: AnchoredOverflowRoot,
|
|
427
|
+
Anchor: AnchoredOverflowAnchor
|
|
428
|
+
};
|
|
429
|
+
var AVATAR_NAME = "Avatar";
|
|
430
|
+
var [AvatarProvider, useAvatarContext] = (0, import_react_context.createContext)(AVATAR_NAME);
|
|
431
|
+
var AvatarRoot = ({ children, labelId: propsLabelId, descriptionId: propsDescriptionId }) => {
|
|
432
|
+
var _effect = (0, import_tracking3.useSignals)();
|
|
433
|
+
try {
|
|
434
|
+
const labelId = (0, import_react_hooks3.useId)("avatar__label", propsLabelId);
|
|
435
|
+
const descriptionId = (0, import_react_hooks3.useId)("avatar__description", propsDescriptionId);
|
|
436
|
+
return /* @__PURE__ */ import_react9.default.createElement(AvatarProvider, {
|
|
437
|
+
labelId,
|
|
438
|
+
descriptionId
|
|
439
|
+
}, children);
|
|
440
|
+
} finally {
|
|
441
|
+
_effect.f();
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
var AvatarContent = /* @__PURE__ */ (0, import_react9.forwardRef)(({ icon, classNames, ...props }, forwardedRef) => {
|
|
445
|
+
var _effect = (0, import_tracking3.useSignals)();
|
|
446
|
+
try {
|
|
447
|
+
const href = useIconHref(icon);
|
|
448
|
+
const { labelId, descriptionId } = useAvatarContext("AvatarContent");
|
|
449
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react10.DxAvatar, {
|
|
450
|
+
...props,
|
|
451
|
+
icon: href,
|
|
452
|
+
"aria-labelledby": labelId,
|
|
453
|
+
"aria-describedby": descriptionId,
|
|
454
|
+
rootClassName: (0, import_react_ui_theme.mx)(classNames),
|
|
455
|
+
ref: forwardedRef
|
|
456
|
+
});
|
|
457
|
+
} finally {
|
|
458
|
+
_effect.f();
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
var AvatarLabel = /* @__PURE__ */ (0, import_react9.forwardRef)(({ asChild, srOnly, classNames, ...props }, forwardedRef) => {
|
|
462
|
+
var _effect = (0, import_tracking3.useSignals)();
|
|
463
|
+
try {
|
|
464
|
+
const Root7 = asChild ? import_react_slot2.Slot : import_react_primitive2.Primitive.span;
|
|
465
|
+
const { tx } = useThemeContext();
|
|
466
|
+
const { labelId } = useAvatarContext("AvatarLabel");
|
|
467
|
+
return /* @__PURE__ */ import_react9.default.createElement(Root7, {
|
|
468
|
+
...props,
|
|
469
|
+
id: labelId,
|
|
470
|
+
ref: forwardedRef,
|
|
471
|
+
className: tx("avatar.label", "avatar__label", {
|
|
472
|
+
srOnly
|
|
473
|
+
}, classNames)
|
|
474
|
+
});
|
|
475
|
+
} finally {
|
|
476
|
+
_effect.f();
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
var AvatarDescription = /* @__PURE__ */ (0, import_react9.forwardRef)(({ asChild, srOnly, classNames, ...props }, forwardedRef) => {
|
|
480
|
+
var _effect = (0, import_tracking3.useSignals)();
|
|
481
|
+
try {
|
|
482
|
+
const Root7 = asChild ? import_react_slot2.Slot : import_react_primitive2.Primitive.span;
|
|
483
|
+
const { tx } = useThemeContext();
|
|
484
|
+
const { descriptionId } = useAvatarContext("AvatarDescription");
|
|
485
|
+
return /* @__PURE__ */ import_react9.default.createElement(Root7, {
|
|
486
|
+
...props,
|
|
487
|
+
id: descriptionId,
|
|
488
|
+
ref: forwardedRef,
|
|
489
|
+
className: tx("avatar.description", "avatar__description", {
|
|
490
|
+
srOnly
|
|
491
|
+
}, classNames)
|
|
492
|
+
});
|
|
493
|
+
} finally {
|
|
494
|
+
_effect.f();
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
var Avatar = {
|
|
498
|
+
Root: AvatarRoot,
|
|
499
|
+
Content: AvatarContent,
|
|
500
|
+
Label: AvatarLabel,
|
|
501
|
+
Description: AvatarDescription
|
|
502
|
+
};
|
|
503
|
+
var Link = /* @__PURE__ */ (0, import_react13.forwardRef)(({ asChild, variant, classNames, ...props }, forwardedRef) => {
|
|
504
|
+
var _effect = (0, import_tracking5.useSignals)();
|
|
505
|
+
try {
|
|
506
|
+
const { tx } = useThemeContext();
|
|
507
|
+
const Root7 = asChild ? import_react_slot4.Slot : import_react_primitive4.Primitive.a;
|
|
508
|
+
return /* @__PURE__ */ import_react13.default.createElement(Root7, {
|
|
509
|
+
...props,
|
|
510
|
+
className: tx("link.root", "link", {
|
|
511
|
+
variant
|
|
512
|
+
}, classNames),
|
|
513
|
+
ref: forwardedRef
|
|
514
|
+
});
|
|
515
|
+
} finally {
|
|
516
|
+
_effect.f();
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
var BreadcrumbRoot = /* @__PURE__ */ (0, import_react12.forwardRef)(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
520
|
+
var _effect = (0, import_tracking4.useSignals)();
|
|
521
|
+
try {
|
|
522
|
+
const { tx } = useThemeContext();
|
|
523
|
+
const Root7 = asChild ? import_react_slot3.Slot : import_react_primitive3.Primitive.div;
|
|
524
|
+
return /* @__PURE__ */ import_react12.default.createElement(Root7, {
|
|
525
|
+
role: "navigation",
|
|
526
|
+
...props,
|
|
527
|
+
className: tx("breadcrumb.root", "breadcrumb", {}, classNames),
|
|
528
|
+
ref: forwardedRef
|
|
529
|
+
});
|
|
530
|
+
} finally {
|
|
531
|
+
_effect.f();
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
var BreadcrumbList = /* @__PURE__ */ (0, import_react12.forwardRef)(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
535
|
+
var _effect = (0, import_tracking4.useSignals)();
|
|
536
|
+
try {
|
|
537
|
+
const { tx } = useThemeContext();
|
|
538
|
+
const Root7 = asChild ? import_react_slot3.Slot : import_react_primitive3.Primitive.ol;
|
|
539
|
+
return /* @__PURE__ */ import_react12.default.createElement(Root7, {
|
|
540
|
+
role: "list",
|
|
541
|
+
...props,
|
|
542
|
+
className: tx("breadcrumb.list", "breadcrumb__list", {}, classNames),
|
|
543
|
+
ref: forwardedRef
|
|
544
|
+
});
|
|
545
|
+
} finally {
|
|
546
|
+
_effect.f();
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
var BreadcrumbListItem = /* @__PURE__ */ (0, import_react12.forwardRef)(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
550
|
+
var _effect = (0, import_tracking4.useSignals)();
|
|
551
|
+
try {
|
|
552
|
+
const { tx } = useThemeContext();
|
|
553
|
+
const Root7 = asChild ? import_react_slot3.Slot : import_react_primitive3.Primitive.li;
|
|
554
|
+
return /* @__PURE__ */ import_react12.default.createElement(Root7, {
|
|
555
|
+
role: "listitem",
|
|
556
|
+
...props,
|
|
557
|
+
className: tx("breadcrumb.listItem", "breadcrumb__list__item", {}, classNames),
|
|
558
|
+
ref: forwardedRef
|
|
559
|
+
});
|
|
560
|
+
} finally {
|
|
561
|
+
_effect.f();
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
var BreadcrumbLink = /* @__PURE__ */ (0, import_react12.forwardRef)(({ asChild, ...props }, forwardedRef) => {
|
|
565
|
+
var _effect = (0, import_tracking4.useSignals)();
|
|
566
|
+
try {
|
|
567
|
+
const Root7 = asChild ? import_react_slot3.Slot : Link;
|
|
568
|
+
return /* @__PURE__ */ import_react12.default.createElement(Root7, {
|
|
569
|
+
...props,
|
|
570
|
+
ref: forwardedRef
|
|
571
|
+
});
|
|
572
|
+
} finally {
|
|
573
|
+
_effect.f();
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
var BreadcrumbCurrent = /* @__PURE__ */ (0, import_react12.forwardRef)(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
577
|
+
var _effect = (0, import_tracking4.useSignals)();
|
|
578
|
+
try {
|
|
579
|
+
const { tx } = useThemeContext();
|
|
580
|
+
const Root7 = asChild ? import_react_slot3.Slot : "h1";
|
|
581
|
+
return /* @__PURE__ */ import_react12.default.createElement(Root7, {
|
|
582
|
+
...props,
|
|
583
|
+
"aria-current": "page",
|
|
584
|
+
className: tx("breadcrumb.current", "breadcrumb__item__heading--current", {}, classNames),
|
|
585
|
+
ref: forwardedRef
|
|
586
|
+
});
|
|
587
|
+
} finally {
|
|
588
|
+
_effect.f();
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
var BreadcrumbSeparator = ({ children, classNames, ...props }) => {
|
|
592
|
+
var _effect = (0, import_tracking4.useSignals)();
|
|
593
|
+
try {
|
|
594
|
+
const { tx } = useThemeContext();
|
|
595
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_react_primitive3.Primitive.span, {
|
|
596
|
+
role: "separator",
|
|
597
|
+
"aria-hidden": "true",
|
|
598
|
+
...props,
|
|
599
|
+
className: tx("breadcrumb.separator", "breadcrumb__separator", {}, classNames)
|
|
600
|
+
}, children ?? /* @__PURE__ */ import_react12.default.createElement(import_react11.Dot, {
|
|
601
|
+
weight: "bold"
|
|
602
|
+
}));
|
|
603
|
+
} finally {
|
|
604
|
+
_effect.f();
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
var Breadcrumb = {
|
|
608
|
+
Root: BreadcrumbRoot,
|
|
609
|
+
List: BreadcrumbList,
|
|
610
|
+
ListItem: BreadcrumbListItem,
|
|
611
|
+
Link: BreadcrumbLink,
|
|
612
|
+
Current: BreadcrumbCurrent,
|
|
613
|
+
Separator: BreadcrumbSeparator
|
|
614
|
+
};
|
|
615
|
+
var BUTTON_GROUP_NAME = "ButtonGroup";
|
|
616
|
+
var BUTTON_NAME = "Button";
|
|
617
|
+
var [ButtonGroupProvider, useButtonGroupContext] = (0, import_react_context2.createContext)(BUTTON_GROUP_NAME, {
|
|
618
|
+
inGroup: false
|
|
619
|
+
});
|
|
620
|
+
var Button = /* @__PURE__ */ (0, import_react14.memo)(/* @__PURE__ */ (0, import_react14.forwardRef)(({ classNames, children, density: propsDensity, elevation: propsElevation, variant = "default", asChild, ...props }, ref) => {
|
|
621
|
+
var _effect = (0, import_tracking6.useSignals)();
|
|
622
|
+
try {
|
|
623
|
+
const { inGroup } = useButtonGroupContext(BUTTON_NAME);
|
|
624
|
+
const { tx } = useThemeContext();
|
|
625
|
+
const elevation = useElevationContext(propsElevation);
|
|
626
|
+
const density = useDensityContext(propsDensity);
|
|
627
|
+
const Root7 = asChild ? import_react_slot5.Slot : import_react_primitive5.Primitive.button;
|
|
628
|
+
return /* @__PURE__ */ import_react14.default.createElement(Root7, {
|
|
629
|
+
ref,
|
|
630
|
+
...props,
|
|
631
|
+
"data-variant": variant,
|
|
632
|
+
"data-density": density,
|
|
633
|
+
"data-props": inGroup ? "grouped" : "",
|
|
634
|
+
className: tx("button.root", "button", {
|
|
635
|
+
variant,
|
|
636
|
+
inGroup,
|
|
637
|
+
disabled: props.disabled,
|
|
638
|
+
density,
|
|
639
|
+
elevation
|
|
640
|
+
}, classNames),
|
|
641
|
+
...props.disabled && {
|
|
642
|
+
disabled: true
|
|
643
|
+
}
|
|
644
|
+
}, children);
|
|
645
|
+
} finally {
|
|
646
|
+
_effect.f();
|
|
647
|
+
}
|
|
648
|
+
}));
|
|
649
|
+
Button.displayName = BUTTON_NAME;
|
|
650
|
+
var ButtonGroup = /* @__PURE__ */ (0, import_react14.forwardRef)(({ children, elevation: propsElevation, classNames, asChild, ...props }, forwardedRef) => {
|
|
651
|
+
var _effect = (0, import_tracking6.useSignals)();
|
|
652
|
+
try {
|
|
653
|
+
const { tx } = useThemeContext();
|
|
654
|
+
const elevation = useElevationContext(propsElevation);
|
|
655
|
+
const Root7 = asChild ? import_react_slot5.Slot : import_react_primitive5.Primitive.div;
|
|
656
|
+
return /* @__PURE__ */ import_react14.default.createElement(Root7, {
|
|
657
|
+
role: "none",
|
|
658
|
+
...props,
|
|
659
|
+
className: tx("button.group", "button-group", {
|
|
660
|
+
elevation
|
|
661
|
+
}, classNames),
|
|
662
|
+
ref: forwardedRef
|
|
663
|
+
}, /* @__PURE__ */ import_react14.default.createElement(ButtonGroupProvider, {
|
|
664
|
+
inGroup: true
|
|
665
|
+
}, children));
|
|
666
|
+
} finally {
|
|
667
|
+
_effect.f();
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
ButtonGroup.displayName = BUTTON_GROUP_NAME;
|
|
671
|
+
var Icon = /* @__PURE__ */ (0, import_react16.memo)(/* @__PURE__ */ (0, import_react16.forwardRef)(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
672
|
+
var _effect = (0, import_tracking8.useSignals)();
|
|
673
|
+
try {
|
|
674
|
+
const { tx } = useThemeContext();
|
|
675
|
+
const href = useIconHref(icon);
|
|
676
|
+
return /* @__PURE__ */ import_react16.default.createElement("svg", {
|
|
677
|
+
...props,
|
|
678
|
+
className: tx("icon.root", "icon", {
|
|
679
|
+
size
|
|
680
|
+
}, classNames),
|
|
681
|
+
ref: forwardedRef
|
|
682
|
+
}, /* @__PURE__ */ import_react16.default.createElement("use", {
|
|
683
|
+
href
|
|
684
|
+
}));
|
|
685
|
+
} finally {
|
|
686
|
+
_effect.f();
|
|
687
|
+
}
|
|
688
|
+
}));
|
|
689
|
+
var [createTooltipContext, createTooltipScope] = (0, import_react_context3.createContextScope)("Tooltip", [
|
|
690
|
+
import_react_popper.createPopperScope
|
|
691
|
+
]);
|
|
692
|
+
var usePopperScope = (0, import_react_popper.createPopperScope)();
|
|
693
|
+
var DEFAULT_DELAY_DURATION = 700;
|
|
694
|
+
var TOOLTIP_OPEN = "tooltip.open";
|
|
695
|
+
var TOOLTIP_NAME = "Tooltip";
|
|
696
|
+
var [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME);
|
|
697
|
+
var TooltipProvider = (props) => {
|
|
698
|
+
var _effect = (0, import_tracking9.useSignals)();
|
|
699
|
+
try {
|
|
700
|
+
const { __scopeTooltip, children, open: openProp, defaultOpen = false, onOpenChange, disableHoverableContent = false, delayDuration = DEFAULT_DELAY_DURATION, skipDelayDuration = 300 } = props;
|
|
701
|
+
const isOpenDelayedRef = (0, import_react17.useRef)(true);
|
|
702
|
+
const isPointerInTransitRef = (0, import_react17.useRef)(false);
|
|
703
|
+
const skipDelayTimerRef = (0, import_react17.useRef)(0);
|
|
704
|
+
(0, import_react17.useEffect)(() => {
|
|
705
|
+
const skipDelayTimer = skipDelayTimerRef.current;
|
|
706
|
+
return () => window.clearTimeout(skipDelayTimer);
|
|
707
|
+
}, []);
|
|
708
|
+
const popperScope = usePopperScope(__scopeTooltip);
|
|
709
|
+
const [trigger, setTrigger] = (0, import_react17.useState)(null);
|
|
710
|
+
const [content, setContent] = (0, import_react17.useState)("");
|
|
711
|
+
const [side, setSide] = (0, import_react17.useState)(void 0);
|
|
712
|
+
const triggerRef = (0, import_react17.useRef)(trigger);
|
|
713
|
+
const handleTriggerChange = (0, import_react17.useCallback)((nextTrigger) => {
|
|
714
|
+
setTrigger(nextTrigger);
|
|
715
|
+
triggerRef.current = nextTrigger;
|
|
716
|
+
setContent(nextTrigger?.getAttribute("data-tooltip-content") ?? "");
|
|
717
|
+
setSide(nextTrigger?.getAttribute("data-tooltip-side") ?? void 0);
|
|
718
|
+
}, []);
|
|
719
|
+
const contentId = (0, import_react_id.useId)();
|
|
720
|
+
const openTimerRef = (0, import_react17.useRef)(0);
|
|
721
|
+
const wasOpenDelayedRef = (0, import_react17.useRef)(false);
|
|
722
|
+
const handleOpenChange = (0, import_react17.useCallback)((open2) => {
|
|
723
|
+
if (open2) {
|
|
724
|
+
window.clearTimeout(skipDelayTimerRef.current);
|
|
725
|
+
isOpenDelayedRef.current = false;
|
|
726
|
+
document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));
|
|
727
|
+
} else {
|
|
728
|
+
window.clearTimeout(skipDelayTimerRef.current);
|
|
729
|
+
skipDelayTimerRef.current = window.setTimeout(() => isOpenDelayedRef.current = true, skipDelayDuration);
|
|
730
|
+
}
|
|
731
|
+
onOpenChange?.(open2);
|
|
732
|
+
}, [
|
|
733
|
+
skipDelayDuration,
|
|
734
|
+
onOpenChange
|
|
735
|
+
]);
|
|
736
|
+
const [open = false, setOpen] = (0, import_react_use_controllable_state.useControllableState)({
|
|
737
|
+
prop: openProp,
|
|
738
|
+
defaultProp: defaultOpen,
|
|
739
|
+
onChange: handleOpenChange
|
|
740
|
+
});
|
|
741
|
+
const stateAttribute = (0, import_react17.useMemo)(() => {
|
|
742
|
+
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
|
743
|
+
}, [
|
|
744
|
+
open
|
|
745
|
+
]);
|
|
746
|
+
const handleOpen = (0, import_react17.useCallback)(() => {
|
|
747
|
+
window.clearTimeout(openTimerRef.current);
|
|
748
|
+
openTimerRef.current = 0;
|
|
749
|
+
wasOpenDelayedRef.current = false;
|
|
750
|
+
setOpen(true);
|
|
751
|
+
}, [
|
|
752
|
+
setOpen
|
|
753
|
+
]);
|
|
754
|
+
const handleClose = (0, import_react17.useCallback)(() => {
|
|
755
|
+
window.clearTimeout(openTimerRef.current);
|
|
756
|
+
openTimerRef.current = 0;
|
|
757
|
+
setOpen(false);
|
|
758
|
+
}, [
|
|
759
|
+
setOpen
|
|
760
|
+
]);
|
|
761
|
+
const handleDelayedOpen = (0, import_react17.useCallback)(() => {
|
|
762
|
+
window.clearTimeout(openTimerRef.current);
|
|
763
|
+
openTimerRef.current = window.setTimeout(() => {
|
|
764
|
+
wasOpenDelayedRef.current = true;
|
|
765
|
+
setOpen(true);
|
|
766
|
+
openTimerRef.current = 0;
|
|
767
|
+
}, delayDuration);
|
|
768
|
+
}, [
|
|
769
|
+
delayDuration,
|
|
770
|
+
setOpen
|
|
771
|
+
]);
|
|
772
|
+
(0, import_react17.useEffect)(() => {
|
|
773
|
+
return () => {
|
|
774
|
+
if (openTimerRef.current) {
|
|
775
|
+
window.clearTimeout(openTimerRef.current);
|
|
776
|
+
openTimerRef.current = 0;
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
}, []);
|
|
780
|
+
const { tx } = useThemeContext();
|
|
781
|
+
const elevation = useElevationContext();
|
|
782
|
+
return /* @__PURE__ */ import_react17.default.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ import_react17.default.createElement(TooltipContextProvider, {
|
|
783
|
+
scope: __scopeTooltip,
|
|
784
|
+
contentId,
|
|
785
|
+
open,
|
|
786
|
+
stateAttribute,
|
|
787
|
+
trigger,
|
|
788
|
+
onTriggerChange: handleTriggerChange,
|
|
789
|
+
onTriggerEnter: (0, import_react17.useCallback)(() => {
|
|
790
|
+
if (isOpenDelayedRef.current) {
|
|
791
|
+
handleDelayedOpen();
|
|
792
|
+
} else {
|
|
793
|
+
handleOpen();
|
|
794
|
+
}
|
|
795
|
+
}, [
|
|
796
|
+
isOpenDelayedRef,
|
|
797
|
+
handleDelayedOpen,
|
|
798
|
+
handleOpen
|
|
799
|
+
]),
|
|
800
|
+
onTriggerLeave: (0, import_react17.useCallback)(() => {
|
|
801
|
+
if (disableHoverableContent) {
|
|
802
|
+
handleClose();
|
|
803
|
+
} else {
|
|
804
|
+
window.clearTimeout(openTimerRef.current);
|
|
805
|
+
openTimerRef.current = 0;
|
|
806
|
+
}
|
|
807
|
+
}, [
|
|
808
|
+
handleClose,
|
|
809
|
+
disableHoverableContent
|
|
810
|
+
]),
|
|
811
|
+
onOpen: handleOpen,
|
|
812
|
+
onClose: handleClose,
|
|
813
|
+
disableHoverableContent,
|
|
814
|
+
isPointerInTransitRef,
|
|
815
|
+
onPointerInTransitChange: (0, import_react17.useCallback)((inTransit) => {
|
|
816
|
+
isPointerInTransitRef.current = inTransit;
|
|
817
|
+
}, [])
|
|
818
|
+
}, /* @__PURE__ */ import_react17.default.createElement(TooltipContent, {
|
|
819
|
+
side,
|
|
820
|
+
className: tx("tooltip.content", "tooltip", {
|
|
821
|
+
elevation
|
|
822
|
+
})
|
|
823
|
+
}, content, /* @__PURE__ */ import_react17.default.createElement(TooltipArrow, {
|
|
824
|
+
className: tx("tooltip.arrow", "tooltip__arrow")
|
|
825
|
+
})), /* @__PURE__ */ import_react17.default.createElement(TooltipVirtualTrigger, {
|
|
826
|
+
virtualRef: triggerRef
|
|
827
|
+
}), children));
|
|
828
|
+
} finally {
|
|
829
|
+
_effect.f();
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
TooltipProvider.displayName = TOOLTIP_NAME;
|
|
833
|
+
var TooltipVirtualTrigger = ({ virtualRef, __scopeTooltip }) => {
|
|
834
|
+
var _effect = (0, import_tracking9.useSignals)();
|
|
835
|
+
try {
|
|
836
|
+
const popperScope = usePopperScope(__scopeTooltip);
|
|
837
|
+
return /* @__PURE__ */ import_react17.default.createElement(PopperPrimitive.Anchor, {
|
|
838
|
+
asChild: true,
|
|
839
|
+
...popperScope,
|
|
840
|
+
virtualRef
|
|
841
|
+
});
|
|
842
|
+
} finally {
|
|
843
|
+
_effect.f();
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
var TRIGGER_NAME = "TooltipTrigger";
|
|
847
|
+
var TooltipTrigger = /* @__PURE__ */ (0, import_react17.forwardRef)((props, forwardedRef) => {
|
|
848
|
+
var _effect = (0, import_tracking9.useSignals)();
|
|
849
|
+
try {
|
|
850
|
+
const {
|
|
851
|
+
__scopeTooltip,
|
|
852
|
+
onInteract,
|
|
853
|
+
// TODO(thure): Pass `delayDuration` into the context.
|
|
854
|
+
delayDuration: _delayDuration,
|
|
855
|
+
side,
|
|
856
|
+
content,
|
|
857
|
+
...triggerProps
|
|
858
|
+
} = props;
|
|
859
|
+
const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);
|
|
860
|
+
const ref = (0, import_react17.useRef)(null);
|
|
861
|
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref);
|
|
862
|
+
const isPointerDownRef = (0, import_react17.useRef)(false);
|
|
863
|
+
const hasPointerMoveOpenedRef = (0, import_react17.useRef)(false);
|
|
864
|
+
const handlePointerUp = (0, import_react17.useCallback)(() => isPointerDownRef.current = false, []);
|
|
865
|
+
(0, import_react17.useEffect)(() => {
|
|
866
|
+
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
867
|
+
}, [
|
|
868
|
+
handlePointerUp
|
|
869
|
+
]);
|
|
870
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react_primitive6.Primitive.button, {
|
|
871
|
+
// We purposefully avoid adding `type=button` here because tooltip triggers are also
|
|
872
|
+
// commonly anchors and the anchor `type` attribute signifies MIME type.
|
|
873
|
+
"aria-describedby": context.open ? context.contentId : void 0,
|
|
874
|
+
"data-state": context.stateAttribute,
|
|
875
|
+
"data-tooltip-content": content,
|
|
876
|
+
"data-tooltip-side": side,
|
|
877
|
+
...triggerProps,
|
|
878
|
+
ref: composedRefs,
|
|
879
|
+
onPointerMove: (0, import_primitive.composeEventHandlers)(props.onPointerMove, (event) => {
|
|
880
|
+
if (event.pointerType === "touch") {
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
if (!hasPointerMoveOpenedRef.current && !context.isPointerInTransitRef.current) {
|
|
884
|
+
onInteract?.(event);
|
|
885
|
+
if (event.defaultPrevented) {
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
context.onTriggerChange(ref.current);
|
|
889
|
+
context.onTriggerEnter();
|
|
890
|
+
hasPointerMoveOpenedRef.current = true;
|
|
891
|
+
}
|
|
892
|
+
}),
|
|
893
|
+
onPointerLeave: (0, import_primitive.composeEventHandlers)(props.onPointerLeave, () => {
|
|
894
|
+
context.onTriggerLeave();
|
|
895
|
+
hasPointerMoveOpenedRef.current = false;
|
|
896
|
+
}),
|
|
897
|
+
onPointerDown: (0, import_primitive.composeEventHandlers)(props.onPointerDown, () => {
|
|
898
|
+
if (context.open) {
|
|
899
|
+
context.onClose();
|
|
900
|
+
}
|
|
901
|
+
isPointerDownRef.current = true;
|
|
902
|
+
document.addEventListener("pointerup", handlePointerUp, {
|
|
903
|
+
once: true
|
|
904
|
+
});
|
|
905
|
+
}),
|
|
906
|
+
onFocus: props.onFocus,
|
|
907
|
+
onBlur: (0, import_primitive.composeEventHandlers)(props.onBlur, context.onClose),
|
|
908
|
+
onClick: (0, import_primitive.composeEventHandlers)(props.onClick, context.onClose)
|
|
909
|
+
});
|
|
910
|
+
} finally {
|
|
911
|
+
_effect.f();
|
|
912
|
+
}
|
|
913
|
+
});
|
|
914
|
+
TooltipTrigger.displayName = TRIGGER_NAME;
|
|
915
|
+
var PORTAL_NAME = "TooltipPortal";
|
|
916
|
+
var [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {
|
|
917
|
+
forceMount: void 0
|
|
918
|
+
});
|
|
919
|
+
var TooltipPortal = (props) => {
|
|
920
|
+
var _effect = (0, import_tracking9.useSignals)();
|
|
921
|
+
try {
|
|
922
|
+
const { __scopeTooltip, forceMount, children, container } = props;
|
|
923
|
+
const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);
|
|
924
|
+
return /* @__PURE__ */ import_react17.default.createElement(PortalProvider, {
|
|
925
|
+
scope: __scopeTooltip,
|
|
926
|
+
forceMount
|
|
927
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_presence.Presence, {
|
|
928
|
+
present: forceMount || context.open
|
|
929
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_portal.Portal, {
|
|
930
|
+
asChild: true,
|
|
931
|
+
container
|
|
932
|
+
}, children)));
|
|
933
|
+
} finally {
|
|
934
|
+
_effect.f();
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
TooltipPortal.displayName = PORTAL_NAME;
|
|
938
|
+
var CONTENT_NAME = "TooltipContent";
|
|
939
|
+
var TooltipContent = /* @__PURE__ */ (0, import_react17.forwardRef)((props, forwardedRef) => {
|
|
940
|
+
var _effect = (0, import_tracking9.useSignals)();
|
|
941
|
+
try {
|
|
942
|
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);
|
|
943
|
+
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
944
|
+
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
|
945
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react_presence.Presence, {
|
|
946
|
+
present: forceMount || context.open
|
|
947
|
+
}, context.disableHoverableContent ? /* @__PURE__ */ import_react17.default.createElement(TooltipContentImpl, {
|
|
948
|
+
side,
|
|
949
|
+
...contentProps,
|
|
950
|
+
ref: forwardedRef
|
|
951
|
+
}) : /* @__PURE__ */ import_react17.default.createElement(TooltipContentHoverable, {
|
|
952
|
+
side,
|
|
953
|
+
...contentProps,
|
|
954
|
+
ref: forwardedRef
|
|
955
|
+
}));
|
|
956
|
+
} finally {
|
|
957
|
+
_effect.f();
|
|
958
|
+
}
|
|
959
|
+
});
|
|
960
|
+
var TooltipContentHoverable = /* @__PURE__ */ (0, import_react17.forwardRef)((props, forwardedRef) => {
|
|
961
|
+
var _effect = (0, import_tracking9.useSignals)();
|
|
962
|
+
try {
|
|
963
|
+
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
|
964
|
+
const ref = (0, import_react17.useRef)(null);
|
|
965
|
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref);
|
|
966
|
+
const [pointerGraceArea, setPointerGraceArea] = (0, import_react17.useState)(null);
|
|
967
|
+
const { trigger, onClose } = context;
|
|
968
|
+
const content = ref.current;
|
|
969
|
+
const { onPointerInTransitChange } = context;
|
|
970
|
+
const handleRemoveGraceArea = (0, import_react17.useCallback)(() => {
|
|
971
|
+
setPointerGraceArea(null);
|
|
972
|
+
onPointerInTransitChange(false);
|
|
973
|
+
}, [
|
|
974
|
+
onPointerInTransitChange
|
|
975
|
+
]);
|
|
976
|
+
const handleCreateGraceArea = (0, import_react17.useCallback)((event, hoverTarget) => {
|
|
977
|
+
const currentTarget = event.currentTarget;
|
|
978
|
+
const exitPoint = {
|
|
979
|
+
x: event.clientX,
|
|
980
|
+
y: event.clientY
|
|
981
|
+
};
|
|
982
|
+
const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
|
|
983
|
+
const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);
|
|
984
|
+
const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());
|
|
985
|
+
const graceArea = getHull([
|
|
986
|
+
...paddedExitPoints,
|
|
987
|
+
...hoverTargetPoints
|
|
988
|
+
]);
|
|
989
|
+
setPointerGraceArea(graceArea);
|
|
990
|
+
onPointerInTransitChange(true);
|
|
991
|
+
}, [
|
|
992
|
+
onPointerInTransitChange
|
|
993
|
+
]);
|
|
994
|
+
(0, import_react17.useEffect)(() => {
|
|
995
|
+
return () => handleRemoveGraceArea();
|
|
996
|
+
}, [
|
|
997
|
+
handleRemoveGraceArea
|
|
998
|
+
]);
|
|
999
|
+
(0, import_react17.useEffect)(() => {
|
|
1000
|
+
if (trigger && content) {
|
|
1001
|
+
const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
|
|
1002
|
+
const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
|
|
1003
|
+
trigger.addEventListener("pointerleave", handleTriggerLeave);
|
|
1004
|
+
content.addEventListener("pointerleave", handleContentLeave);
|
|
1005
|
+
return () => {
|
|
1006
|
+
trigger.removeEventListener("pointerleave", handleTriggerLeave);
|
|
1007
|
+
content.removeEventListener("pointerleave", handleContentLeave);
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
}, [
|
|
1011
|
+
trigger,
|
|
1012
|
+
content,
|
|
1013
|
+
handleCreateGraceArea,
|
|
1014
|
+
handleRemoveGraceArea
|
|
1015
|
+
]);
|
|
1016
|
+
(0, import_react17.useEffect)(() => {
|
|
1017
|
+
if (pointerGraceArea) {
|
|
1018
|
+
const handleTrackPointerGrace = (event) => {
|
|
1019
|
+
const target = event.target;
|
|
1020
|
+
const pointerPosition = {
|
|
1021
|
+
x: event.clientX,
|
|
1022
|
+
y: event.clientY
|
|
1023
|
+
};
|
|
1024
|
+
const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);
|
|
1025
|
+
const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);
|
|
1026
|
+
if (hasEnteredTarget) {
|
|
1027
|
+
handleRemoveGraceArea();
|
|
1028
|
+
} else if (isPointerOutsideGraceArea) {
|
|
1029
|
+
handleRemoveGraceArea();
|
|
1030
|
+
onClose();
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
document.addEventListener("pointermove", handleTrackPointerGrace);
|
|
1034
|
+
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
|
1035
|
+
}
|
|
1036
|
+
}, [
|
|
1037
|
+
trigger,
|
|
1038
|
+
content,
|
|
1039
|
+
pointerGraceArea,
|
|
1040
|
+
onClose,
|
|
1041
|
+
handleRemoveGraceArea
|
|
1042
|
+
]);
|
|
1043
|
+
return /* @__PURE__ */ import_react17.default.createElement(TooltipContentImpl, {
|
|
1044
|
+
...props,
|
|
1045
|
+
ref: composedRefs
|
|
1046
|
+
});
|
|
1047
|
+
} finally {
|
|
1048
|
+
_effect.f();
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, {
|
|
1052
|
+
isInside: false
|
|
1053
|
+
});
|
|
1054
|
+
var TooltipContentImpl = /* @__PURE__ */ (0, import_react17.forwardRef)((props, forwardedRef) => {
|
|
1055
|
+
var _effect = (0, import_tracking9.useSignals)();
|
|
1056
|
+
try {
|
|
1057
|
+
const { __scopeTooltip, children, "aria-label": ariaLabel, onEscapeKeyDown, onPointerDownOutside, ...contentProps } = props;
|
|
1058
|
+
const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);
|
|
1059
|
+
const popperScope = usePopperScope(__scopeTooltip);
|
|
1060
|
+
const { onClose } = context;
|
|
1061
|
+
(0, import_react17.useEffect)(() => {
|
|
1062
|
+
document.addEventListener(TOOLTIP_OPEN, onClose);
|
|
1063
|
+
return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
|
|
1064
|
+
}, [
|
|
1065
|
+
onClose
|
|
1066
|
+
]);
|
|
1067
|
+
(0, import_react17.useEffect)(() => {
|
|
1068
|
+
if (context.trigger) {
|
|
1069
|
+
const handleScroll = (event) => {
|
|
1070
|
+
const target = event.target;
|
|
1071
|
+
if (target?.contains(context.trigger)) {
|
|
1072
|
+
onClose();
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
window.addEventListener("scroll", handleScroll, {
|
|
1076
|
+
capture: true
|
|
1077
|
+
});
|
|
1078
|
+
return () => window.removeEventListener("scroll", handleScroll, {
|
|
1079
|
+
capture: true
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
}, [
|
|
1083
|
+
context.trigger,
|
|
1084
|
+
onClose
|
|
1085
|
+
]);
|
|
1086
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react_dismissable_layer.DismissableLayer, {
|
|
1087
|
+
asChild: true,
|
|
1088
|
+
disableOutsidePointerEvents: false,
|
|
1089
|
+
onEscapeKeyDown,
|
|
1090
|
+
onPointerDownOutside,
|
|
1091
|
+
onFocusOutside: (event) => event.preventDefault(),
|
|
1092
|
+
onDismiss: onClose
|
|
1093
|
+
}, /* @__PURE__ */ import_react17.default.createElement(PopperPrimitive.Content, {
|
|
1094
|
+
"data-state": context.stateAttribute,
|
|
1095
|
+
...popperScope,
|
|
1096
|
+
...contentProps,
|
|
1097
|
+
ref: forwardedRef,
|
|
1098
|
+
style: {
|
|
1099
|
+
...contentProps.style,
|
|
1100
|
+
// re-namespace exposed content custom properties
|
|
1101
|
+
...{
|
|
1102
|
+
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1103
|
+
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
1104
|
+
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
1105
|
+
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
|
1106
|
+
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_slot6.Slottable, null, children), /* @__PURE__ */ import_react17.default.createElement(VisuallyHiddenContentContextProvider, {
|
|
1110
|
+
scope: __scopeTooltip,
|
|
1111
|
+
isInside: true
|
|
1112
|
+
}, /* @__PURE__ */ import_react17.default.createElement(VisuallyHiddenPrimitive.Root, {
|
|
1113
|
+
id: context.contentId,
|
|
1114
|
+
role: "tooltip"
|
|
1115
|
+
}, ariaLabel || children))));
|
|
1116
|
+
} finally {
|
|
1117
|
+
_effect.f();
|
|
1118
|
+
}
|
|
1119
|
+
});
|
|
1120
|
+
TooltipContent.displayName = CONTENT_NAME;
|
|
1121
|
+
var ARROW_NAME = "TooltipArrow";
|
|
1122
|
+
var TooltipArrow = /* @__PURE__ */ (0, import_react17.forwardRef)((props, forwardedRef) => {
|
|
1123
|
+
var _effect = (0, import_tracking9.useSignals)();
|
|
1124
|
+
try {
|
|
1125
|
+
const { __scopeTooltip, ...arrowProps } = props;
|
|
1126
|
+
const popperScope = usePopperScope(__scopeTooltip);
|
|
1127
|
+
const visuallyHiddenContentContext = useVisuallyHiddenContentContext(ARROW_NAME, __scopeTooltip);
|
|
1128
|
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ import_react17.default.createElement(PopperPrimitive.Arrow, {
|
|
1129
|
+
...popperScope,
|
|
1130
|
+
...arrowProps,
|
|
1131
|
+
ref: forwardedRef
|
|
1132
|
+
});
|
|
1133
|
+
} finally {
|
|
1134
|
+
_effect.f();
|
|
1135
|
+
}
|
|
1136
|
+
});
|
|
1137
|
+
TooltipArrow.displayName = ARROW_NAME;
|
|
1138
|
+
var getExitSideFromRect = (point, rect) => {
|
|
1139
|
+
const top = Math.abs(rect.top - point.y);
|
|
1140
|
+
const bottom = Math.abs(rect.bottom - point.y);
|
|
1141
|
+
const right = Math.abs(rect.right - point.x);
|
|
1142
|
+
const left = Math.abs(rect.left - point.x);
|
|
1143
|
+
switch (Math.min(top, bottom, right, left)) {
|
|
1144
|
+
case left:
|
|
1145
|
+
return "left";
|
|
1146
|
+
case right:
|
|
1147
|
+
return "right";
|
|
1148
|
+
case top:
|
|
1149
|
+
return "top";
|
|
1150
|
+
case bottom:
|
|
1151
|
+
return "bottom";
|
|
1152
|
+
default:
|
|
1153
|
+
throw new Error("unreachable");
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
var getPaddedExitPoints = (exitPoint, exitSide, padding = 5) => {
|
|
1157
|
+
const paddedExitPoints = [];
|
|
1158
|
+
switch (exitSide) {
|
|
1159
|
+
case "top":
|
|
1160
|
+
paddedExitPoints.push({
|
|
1161
|
+
x: exitPoint.x - padding,
|
|
1162
|
+
y: exitPoint.y + padding
|
|
1163
|
+
}, {
|
|
1164
|
+
x: exitPoint.x + padding,
|
|
1165
|
+
y: exitPoint.y + padding
|
|
1166
|
+
});
|
|
1167
|
+
break;
|
|
1168
|
+
case "bottom":
|
|
1169
|
+
paddedExitPoints.push({
|
|
1170
|
+
x: exitPoint.x - padding,
|
|
1171
|
+
y: exitPoint.y - padding
|
|
1172
|
+
}, {
|
|
1173
|
+
x: exitPoint.x + padding,
|
|
1174
|
+
y: exitPoint.y - padding
|
|
1175
|
+
});
|
|
1176
|
+
break;
|
|
1177
|
+
case "left":
|
|
1178
|
+
paddedExitPoints.push({
|
|
1179
|
+
x: exitPoint.x + padding,
|
|
1180
|
+
y: exitPoint.y - padding
|
|
1181
|
+
}, {
|
|
1182
|
+
x: exitPoint.x + padding,
|
|
1183
|
+
y: exitPoint.y + padding
|
|
1184
|
+
});
|
|
1185
|
+
break;
|
|
1186
|
+
case "right":
|
|
1187
|
+
paddedExitPoints.push({
|
|
1188
|
+
x: exitPoint.x - padding,
|
|
1189
|
+
y: exitPoint.y - padding
|
|
1190
|
+
}, {
|
|
1191
|
+
x: exitPoint.x - padding,
|
|
1192
|
+
y: exitPoint.y + padding
|
|
1193
|
+
});
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
return paddedExitPoints;
|
|
1197
|
+
};
|
|
1198
|
+
var getPointsFromRect = (rect) => {
|
|
1199
|
+
const { top, right, bottom, left } = rect;
|
|
1200
|
+
return [
|
|
1201
|
+
{
|
|
1202
|
+
x: left,
|
|
1203
|
+
y: top
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
x: right,
|
|
1207
|
+
y: top
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
x: right,
|
|
1211
|
+
y: bottom
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
x: left,
|
|
1215
|
+
y: bottom
|
|
1216
|
+
}
|
|
1217
|
+
];
|
|
1218
|
+
};
|
|
1219
|
+
var isPointInPolygon = (point, polygon) => {
|
|
1220
|
+
const { x, y } = point;
|
|
1221
|
+
let inside = false;
|
|
1222
|
+
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
1223
|
+
const xi = polygon[i].x;
|
|
1224
|
+
const yi = polygon[i].y;
|
|
1225
|
+
const xj = polygon[j].x;
|
|
1226
|
+
const yj = polygon[j].y;
|
|
1227
|
+
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
1228
|
+
if (intersect) {
|
|
1229
|
+
inside = !inside;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
return inside;
|
|
1233
|
+
};
|
|
1234
|
+
var getHull = (points) => {
|
|
1235
|
+
const newPoints = points.slice();
|
|
1236
|
+
newPoints.sort((a, b) => {
|
|
1237
|
+
if (a.x < b.x) {
|
|
1238
|
+
return -1;
|
|
1239
|
+
} else if (a.x > b.x) {
|
|
1240
|
+
return 1;
|
|
1241
|
+
} else if (a.y < b.y) {
|
|
1242
|
+
return -1;
|
|
1243
|
+
} else if (a.y > b.y) {
|
|
1244
|
+
return 1;
|
|
1245
|
+
} else {
|
|
1246
|
+
return 0;
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
return getHullPresorted(newPoints);
|
|
1250
|
+
};
|
|
1251
|
+
var getHullPresorted = (points) => {
|
|
1252
|
+
if (points.length <= 1) {
|
|
1253
|
+
return points.slice();
|
|
1254
|
+
}
|
|
1255
|
+
const upperHull = [];
|
|
1256
|
+
for (let i = 0; i < points.length; i++) {
|
|
1257
|
+
const p = points[i];
|
|
1258
|
+
while (upperHull.length >= 2) {
|
|
1259
|
+
const q = upperHull[upperHull.length - 1];
|
|
1260
|
+
const r = upperHull[upperHull.length - 2];
|
|
1261
|
+
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) {
|
|
1262
|
+
upperHull.pop();
|
|
1263
|
+
} else {
|
|
1264
|
+
break;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
upperHull.push(p);
|
|
1268
|
+
}
|
|
1269
|
+
upperHull.pop();
|
|
1270
|
+
const lowerHull = [];
|
|
1271
|
+
for (let i = points.length - 1; i >= 0; i--) {
|
|
1272
|
+
const p = points[i];
|
|
1273
|
+
while (lowerHull.length >= 2) {
|
|
1274
|
+
const q = lowerHull[lowerHull.length - 1];
|
|
1275
|
+
const r = lowerHull[lowerHull.length - 2];
|
|
1276
|
+
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) {
|
|
1277
|
+
lowerHull.pop();
|
|
1278
|
+
} else {
|
|
1279
|
+
break;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
lowerHull.push(p);
|
|
1283
|
+
}
|
|
1284
|
+
lowerHull.pop();
|
|
1285
|
+
if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) {
|
|
1286
|
+
return upperHull;
|
|
1287
|
+
} else {
|
|
1288
|
+
return upperHull.concat(lowerHull);
|
|
1289
|
+
}
|
|
1290
|
+
};
|
|
1291
|
+
var Tooltip = {
|
|
1292
|
+
Provider: TooltipProvider,
|
|
1293
|
+
Trigger: TooltipTrigger
|
|
1294
|
+
};
|
|
1295
|
+
var IconOnlyButton = /* @__PURE__ */ (0, import_react15.forwardRef)(({ noTooltip, tooltipPortal = true, tooltipSide, ...props }, forwardedRef) => {
|
|
1296
|
+
var _effect = (0, import_tracking7.useSignals)();
|
|
1297
|
+
try {
|
|
1298
|
+
if (noTooltip) {
|
|
1299
|
+
return /* @__PURE__ */ import_react15.default.createElement(LabelledIconButton, {
|
|
1300
|
+
...props,
|
|
1301
|
+
ref: forwardedRef
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
return /* @__PURE__ */ import_react15.default.createElement(Tooltip.Trigger, {
|
|
1305
|
+
asChild: true,
|
|
1306
|
+
content: props.label,
|
|
1307
|
+
side: tooltipSide
|
|
1308
|
+
}, /* @__PURE__ */ import_react15.default.createElement(LabelledIconButton, {
|
|
1309
|
+
...props,
|
|
1310
|
+
ref: forwardedRef
|
|
1311
|
+
}));
|
|
1312
|
+
} finally {
|
|
1313
|
+
_effect.f();
|
|
1314
|
+
}
|
|
1315
|
+
});
|
|
1316
|
+
var LabelledIconButton = /* @__PURE__ */ (0, import_react15.forwardRef)(({ icon, size, iconOnly, label, classNames, iconClassNames, caretDown, ...props }, forwardedRef) => {
|
|
1317
|
+
var _effect = (0, import_tracking7.useSignals)();
|
|
1318
|
+
try {
|
|
1319
|
+
const { tx } = useThemeContext();
|
|
1320
|
+
return /* @__PURE__ */ import_react15.default.createElement(Button, {
|
|
1321
|
+
...props,
|
|
1322
|
+
classNames: tx("iconButton.root", "iconButton", {}, classNames),
|
|
1323
|
+
ref: forwardedRef
|
|
1324
|
+
}, /* @__PURE__ */ import_react15.default.createElement(Icon, {
|
|
1325
|
+
icon,
|
|
1326
|
+
size,
|
|
1327
|
+
classNames: iconClassNames
|
|
1328
|
+
}), /* @__PURE__ */ import_react15.default.createElement("span", {
|
|
1329
|
+
className: iconOnly ? "sr-only" : void 0
|
|
1330
|
+
}, label), caretDown && /* @__PURE__ */ import_react15.default.createElement(Icon, {
|
|
1331
|
+
size: 3,
|
|
1332
|
+
icon: "ph--caret-down--bold"
|
|
1333
|
+
}));
|
|
1334
|
+
} finally {
|
|
1335
|
+
_effect.f();
|
|
1336
|
+
}
|
|
1337
|
+
});
|
|
1338
|
+
var IconButton = /* @__PURE__ */ (0, import_react15.forwardRef)((props, forwardedRef) => {
|
|
1339
|
+
var _effect = (0, import_tracking7.useSignals)();
|
|
1340
|
+
try {
|
|
1341
|
+
return props.iconOnly ? /* @__PURE__ */ import_react15.default.createElement(IconOnlyButton, {
|
|
1342
|
+
...props,
|
|
1343
|
+
ref: forwardedRef
|
|
1344
|
+
}) : /* @__PURE__ */ import_react15.default.createElement(LabelledIconButton, {
|
|
1345
|
+
...props,
|
|
1346
|
+
ref: forwardedRef
|
|
1347
|
+
});
|
|
1348
|
+
} finally {
|
|
1349
|
+
_effect.f();
|
|
1350
|
+
}
|
|
1351
|
+
});
|
|
1352
|
+
var Toggle = /* @__PURE__ */ (0, import_react18.forwardRef)(({ defaultPressed, pressed, onPressedChange, ...props }, forwardedRef) => {
|
|
1353
|
+
var _effect = (0, import_tracking10.useSignals)();
|
|
1354
|
+
try {
|
|
1355
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react_toggle.Toggle, {
|
|
1356
|
+
defaultPressed,
|
|
1357
|
+
pressed,
|
|
1358
|
+
onPressedChange,
|
|
1359
|
+
asChild: true
|
|
1360
|
+
}, /* @__PURE__ */ import_react18.default.createElement(Button, {
|
|
1361
|
+
...props,
|
|
1362
|
+
ref: forwardedRef
|
|
1363
|
+
}));
|
|
1364
|
+
} finally {
|
|
1365
|
+
_effect.f();
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
var ToggleGroup = /* @__PURE__ */ (0, import_react19.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
1369
|
+
var _effect = (0, import_tracking11.useSignals)();
|
|
1370
|
+
try {
|
|
1371
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react_toggle_group.ToggleGroup, {
|
|
1372
|
+
...props,
|
|
1373
|
+
asChild: true
|
|
1374
|
+
}, /* @__PURE__ */ import_react19.default.createElement(ButtonGroup, {
|
|
1375
|
+
classNames,
|
|
1376
|
+
children,
|
|
1377
|
+
ref: forwardedRef
|
|
1378
|
+
}));
|
|
1379
|
+
} finally {
|
|
1380
|
+
_effect.f();
|
|
1381
|
+
}
|
|
1382
|
+
});
|
|
1383
|
+
var ToggleGroupItem = /* @__PURE__ */ (0, import_react19.forwardRef)(({ variant, elevation, density, classNames, children, ...props }, forwardedRef) => {
|
|
1384
|
+
var _effect = (0, import_tracking11.useSignals)();
|
|
1385
|
+
try {
|
|
1386
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react_toggle_group.ToggleGroupItem, {
|
|
1387
|
+
...props,
|
|
1388
|
+
asChild: true
|
|
1389
|
+
}, /* @__PURE__ */ import_react19.default.createElement(Button, {
|
|
1390
|
+
variant,
|
|
1391
|
+
elevation,
|
|
1392
|
+
density,
|
|
1393
|
+
classNames,
|
|
1394
|
+
children,
|
|
1395
|
+
ref: forwardedRef
|
|
1396
|
+
}));
|
|
1397
|
+
} finally {
|
|
1398
|
+
_effect.f();
|
|
1399
|
+
}
|
|
1400
|
+
});
|
|
1401
|
+
var ClipboardContext = /* @__PURE__ */ (0, import_react20.createContext)({
|
|
1402
|
+
textValue: "",
|
|
1403
|
+
setTextValue: async (_) => {
|
|
1404
|
+
}
|
|
1405
|
+
});
|
|
1406
|
+
var useClipboard = () => (0, import_react20.useContext)(ClipboardContext);
|
|
1407
|
+
var ClipboardProvider = ({ children }) => {
|
|
1408
|
+
var _effect = (0, import_tracking12.useSignals)();
|
|
1409
|
+
try {
|
|
1410
|
+
const [textValue, setInternalTextValue] = (0, import_react20.useState)("");
|
|
1411
|
+
const setTextValue = (0, import_react20.useCallback)(async (nextValue) => {
|
|
1412
|
+
await navigator.clipboard.writeText(nextValue);
|
|
1413
|
+
return setInternalTextValue(nextValue);
|
|
1414
|
+
}, []);
|
|
1415
|
+
return /* @__PURE__ */ import_react20.default.createElement(ClipboardContext.Provider, {
|
|
1416
|
+
value: {
|
|
1417
|
+
textValue,
|
|
1418
|
+
setTextValue
|
|
1419
|
+
}
|
|
1420
|
+
}, children);
|
|
1421
|
+
} finally {
|
|
1422
|
+
_effect.f();
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
var hasIosKeyboard = () => {
|
|
1426
|
+
return !!navigator.userAgent.match(/iP(ad|od|hone).+Safari/);
|
|
1427
|
+
};
|
|
1428
|
+
var DensityContext = /* @__PURE__ */ (0, import_react23.createContext)({
|
|
1429
|
+
density: "fine"
|
|
1430
|
+
});
|
|
1431
|
+
var DensityProvider = ({ density, children }) => {
|
|
1432
|
+
var _effect = (0, import_tracking15.useSignals)();
|
|
1433
|
+
try {
|
|
1434
|
+
return /* @__PURE__ */ import_react23.default.createElement(DensityContext.Provider, {
|
|
1435
|
+
value: {
|
|
1436
|
+
density
|
|
1437
|
+
}
|
|
1438
|
+
}, children);
|
|
1439
|
+
} finally {
|
|
1440
|
+
_effect.f();
|
|
1441
|
+
}
|
|
1442
|
+
};
|
|
1443
|
+
var ElevationContext = /* @__PURE__ */ (0, import_react24.createContext)({
|
|
1444
|
+
elevation: "base"
|
|
1445
|
+
});
|
|
1446
|
+
var ElevationProvider = ({ elevation, children }) => {
|
|
1447
|
+
var _effect = (0, import_tracking16.useSignals)();
|
|
1448
|
+
try {
|
|
1449
|
+
return /* @__PURE__ */ import_react24.default.createElement(ElevationContext.Provider, {
|
|
1450
|
+
value: {
|
|
1451
|
+
elevation
|
|
1452
|
+
}
|
|
1453
|
+
}, children);
|
|
1454
|
+
} finally {
|
|
1455
|
+
_effect.f();
|
|
1456
|
+
}
|
|
1457
|
+
};
|
|
1458
|
+
var ThemeContext = /* @__PURE__ */ (0, import_react22.createContext)(void 0);
|
|
1459
|
+
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", ...rest }) => {
|
|
1460
|
+
var _effect = (0, import_tracking14.useSignals)();
|
|
1461
|
+
try {
|
|
1462
|
+
(0, import_react22.useEffect)(() => {
|
|
1463
|
+
if (document.defaultView) {
|
|
1464
|
+
const kb = (0, import_keyborg.createKeyborg)(document.defaultView);
|
|
1465
|
+
kb.subscribe(handleInputModalityChange);
|
|
1466
|
+
return () => kb.unsubscribe(handleInputModalityChange);
|
|
1467
|
+
}
|
|
1468
|
+
}, []);
|
|
1469
|
+
const safeAreaPadding = useSafeArea();
|
|
1470
|
+
const contextValue = (0, import_react22.useMemo)(() => ({
|
|
1471
|
+
tx,
|
|
1472
|
+
themeMode,
|
|
1473
|
+
hasIosKeyboard: hasIosKeyboard(),
|
|
1474
|
+
safeAreaPadding,
|
|
1475
|
+
...rest
|
|
1476
|
+
}), [
|
|
1477
|
+
tx,
|
|
1478
|
+
themeMode,
|
|
1479
|
+
safeAreaPadding,
|
|
1480
|
+
rest
|
|
1481
|
+
]);
|
|
1482
|
+
return /* @__PURE__ */ import_react22.default.createElement(ThemeContext.Provider, {
|
|
1483
|
+
value: contextValue
|
|
1484
|
+
}, /* @__PURE__ */ import_react22.default.createElement(TranslationsProvider, {
|
|
1485
|
+
fallback,
|
|
1486
|
+
resourceExtensions,
|
|
1487
|
+
appNs
|
|
1488
|
+
}, /* @__PURE__ */ import_react22.default.createElement(ElevationProvider, {
|
|
1489
|
+
elevation: "base"
|
|
1490
|
+
}, /* @__PURE__ */ import_react22.default.createElement(DensityProvider, {
|
|
1491
|
+
density: rootDensity
|
|
1492
|
+
}, children))));
|
|
1493
|
+
} finally {
|
|
1494
|
+
_effect.f();
|
|
1495
|
+
}
|
|
1496
|
+
};
|
|
1497
|
+
var handleInputModalityChange = (isUsingKeyboard) => {
|
|
1498
|
+
if (isUsingKeyboard) {
|
|
1499
|
+
document.body.setAttribute("data-is-keyboard", "true");
|
|
1500
|
+
} else {
|
|
1501
|
+
document.body.removeAttribute("data-is-keyboard");
|
|
1502
|
+
}
|
|
1503
|
+
};
|
|
1504
|
+
var inactiveLabelStyles = "invisible bs-px -mbe-px overflow-hidden";
|
|
1505
|
+
var CopyButton = ({ value, classNames, iconProps, ...props }) => {
|
|
1506
|
+
var _effect = (0, import_tracking13.useSignals)();
|
|
1507
|
+
try {
|
|
1508
|
+
const { t } = useTranslation("os");
|
|
1509
|
+
const { textValue, setTextValue } = useClipboard();
|
|
1510
|
+
const isCopied = textValue === value;
|
|
1511
|
+
return /* @__PURE__ */ import_react21.default.createElement(Button, {
|
|
1512
|
+
...props,
|
|
1513
|
+
classNames: [
|
|
1514
|
+
"inline-flex flex-col justify-center",
|
|
1515
|
+
classNames
|
|
1516
|
+
],
|
|
1517
|
+
onClick: () => setTextValue(value),
|
|
1518
|
+
"data-testid": "copy-invitation"
|
|
1519
|
+
}, /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
1520
|
+
role: "none",
|
|
1521
|
+
className: (0, import_react_ui_theme2.mx)("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
1522
|
+
}, /* @__PURE__ */ import_react21.default.createElement("span", {
|
|
1523
|
+
className: "pli-1"
|
|
1524
|
+
}, t("copy label")), /* @__PURE__ */ import_react21.default.createElement(Icon, {
|
|
1525
|
+
icon: "ph--copy--regular",
|
|
1526
|
+
size: 5,
|
|
1527
|
+
...iconProps
|
|
1528
|
+
})), /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
1529
|
+
role: "none",
|
|
1530
|
+
className: (0, import_react_ui_theme2.mx)("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
1531
|
+
}, /* @__PURE__ */ import_react21.default.createElement("span", {
|
|
1532
|
+
className: "pli-1"
|
|
1533
|
+
}, t("copy success label")), /* @__PURE__ */ import_react21.default.createElement(Icon, {
|
|
1534
|
+
icon: "ph--check--regular",
|
|
1535
|
+
size: 5,
|
|
1536
|
+
...iconProps
|
|
1537
|
+
})));
|
|
1538
|
+
} finally {
|
|
1539
|
+
_effect.f();
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
var CopyButtonIconOnly = ({ __scopeTooltip, value, classNames, iconProps, variant, ...props }) => {
|
|
1543
|
+
var _effect = (0, import_tracking13.useSignals)();
|
|
1544
|
+
try {
|
|
1545
|
+
const { t } = useTranslation("os");
|
|
1546
|
+
const { textValue, setTextValue } = useClipboard();
|
|
1547
|
+
const isCopied = textValue === value;
|
|
1548
|
+
const label = isCopied ? t("copy success label") : props.label ?? t("copy label");
|
|
1549
|
+
const { onOpen } = useTooltipContext("CopyButton", __scopeTooltip);
|
|
1550
|
+
return /* @__PURE__ */ import_react21.default.createElement(IconButton, {
|
|
1551
|
+
iconOnly: true,
|
|
1552
|
+
label,
|
|
1553
|
+
icon: "ph--copy--regular",
|
|
1554
|
+
size: 5,
|
|
1555
|
+
variant,
|
|
1556
|
+
classNames: [
|
|
1557
|
+
"inline-flex flex-col justify-center",
|
|
1558
|
+
classNames
|
|
1559
|
+
],
|
|
1560
|
+
onClick: () => setTextValue(value).then(onOpen),
|
|
1561
|
+
"data-testid": "copy-invitation"
|
|
1562
|
+
});
|
|
1563
|
+
} finally {
|
|
1564
|
+
_effect.f();
|
|
1565
|
+
}
|
|
1566
|
+
};
|
|
1567
|
+
var Clipboard = {
|
|
1568
|
+
Button: CopyButton,
|
|
1569
|
+
IconButton: CopyButtonIconOnly,
|
|
1570
|
+
Provider: ClipboardProvider
|
|
1571
|
+
};
|
|
1572
|
+
var DialogRoot = (props) => {
|
|
1573
|
+
var _effect = (0, import_tracking17.useSignals)();
|
|
1574
|
+
try {
|
|
1575
|
+
return /* @__PURE__ */ import_react25.default.createElement(ElevationProvider, {
|
|
1576
|
+
elevation: "dialog"
|
|
1577
|
+
}, /* @__PURE__ */ import_react25.default.createElement(import_react_dialog.Root, props));
|
|
1578
|
+
} finally {
|
|
1579
|
+
_effect.f();
|
|
1580
|
+
}
|
|
1581
|
+
};
|
|
1582
|
+
var DialogTrigger = import_react_dialog.DialogTrigger;
|
|
1583
|
+
var DialogPortal = import_react_dialog.DialogPortal;
|
|
1584
|
+
var DialogTitle = /* @__PURE__ */ (0, import_react25.forwardRef)(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1585
|
+
var _effect = (0, import_tracking17.useSignals)();
|
|
1586
|
+
try {
|
|
1587
|
+
const { tx } = useThemeContext();
|
|
1588
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_react_dialog.DialogTitle, {
|
|
1589
|
+
...props,
|
|
1590
|
+
className: tx("dialog.title", "dialog__title", {
|
|
1591
|
+
srOnly
|
|
1592
|
+
}, classNames),
|
|
1593
|
+
ref: forwardedRef
|
|
1594
|
+
});
|
|
1595
|
+
} finally {
|
|
1596
|
+
_effect.f();
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
var DialogDescription = /* @__PURE__ */ (0, import_react25.forwardRef)(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1600
|
+
var _effect = (0, import_tracking17.useSignals)();
|
|
1601
|
+
try {
|
|
1602
|
+
const { tx } = useThemeContext();
|
|
1603
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_react_dialog.DialogDescription, {
|
|
1604
|
+
...props,
|
|
1605
|
+
className: tx("dialog.description", "dialog__description", {
|
|
1606
|
+
srOnly
|
|
1607
|
+
}, classNames),
|
|
1608
|
+
ref: forwardedRef
|
|
1609
|
+
});
|
|
1610
|
+
} finally {
|
|
1611
|
+
_effect.f();
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
var DialogClose = import_react_dialog.DialogClose;
|
|
1615
|
+
var DIALOG_OVERLAY_NAME = "DialogOverlay";
|
|
1616
|
+
var DIALOG_CONTENT_NAME = "DialogContent";
|
|
1617
|
+
var [OverlayLayoutProvider, useOverlayLayoutContext] = (0, import_react_context4.createContext)(DIALOG_OVERLAY_NAME, {});
|
|
1618
|
+
var DialogOverlay = /* @__PURE__ */ (0, import_react25.forwardRef)(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1619
|
+
var _effect = (0, import_tracking17.useSignals)();
|
|
1620
|
+
try {
|
|
1621
|
+
const { tx } = useThemeContext();
|
|
1622
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_react_dialog.DialogOverlay, {
|
|
1623
|
+
...props,
|
|
1624
|
+
className: tx("dialog.overlay", "dialog__overlay", {}, classNames),
|
|
1625
|
+
ref: forwardedRef,
|
|
1626
|
+
"data-block-align": blockAlign
|
|
1627
|
+
}, /* @__PURE__ */ import_react25.default.createElement(OverlayLayoutProvider, {
|
|
1628
|
+
inOverlayLayout: true
|
|
1629
|
+
}, children));
|
|
1630
|
+
} finally {
|
|
1631
|
+
_effect.f();
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
DialogOverlay.displayName = DIALOG_OVERLAY_NAME;
|
|
1635
|
+
var DialogContent = /* @__PURE__ */ (0, import_react25.forwardRef)(({ classNames, children, inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
1636
|
+
var _effect = (0, import_tracking17.useSignals)();
|
|
1637
|
+
try {
|
|
1638
|
+
const { tx } = useThemeContext();
|
|
1639
|
+
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
1640
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_react_dialog.DialogContent, {
|
|
1641
|
+
// NOTE: Radix warning unless set to undefined.
|
|
1642
|
+
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
1643
|
+
"aria-describedby": void 0,
|
|
1644
|
+
...props,
|
|
1645
|
+
className: tx("dialog.content", "dialog", {
|
|
1646
|
+
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
1647
|
+
}, classNames),
|
|
1648
|
+
ref: forwardedRef
|
|
1649
|
+
}, children);
|
|
1650
|
+
} finally {
|
|
1651
|
+
_effect.f();
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1654
|
+
DialogContent.displayName = DIALOG_CONTENT_NAME;
|
|
1655
|
+
var Dialog = {
|
|
1656
|
+
Root: DialogRoot,
|
|
1657
|
+
Trigger: DialogTrigger,
|
|
1658
|
+
Portal: DialogPortal,
|
|
1659
|
+
Overlay: DialogOverlay,
|
|
1660
|
+
Content: DialogContent,
|
|
1661
|
+
Title: DialogTitle,
|
|
1662
|
+
Description: DialogDescription,
|
|
1663
|
+
Close: DialogClose
|
|
1664
|
+
};
|
|
1665
|
+
var AlertDialogRoot = (props) => {
|
|
1666
|
+
var _effect = (0, import_tracking18.useSignals)();
|
|
1667
|
+
try {
|
|
1668
|
+
return /* @__PURE__ */ import_react26.default.createElement(ElevationProvider, {
|
|
1669
|
+
elevation: "dialog"
|
|
1670
|
+
}, /* @__PURE__ */ import_react26.default.createElement(import_react_alert_dialog.Root, props));
|
|
1671
|
+
} finally {
|
|
1672
|
+
_effect.f();
|
|
1673
|
+
}
|
|
1674
|
+
};
|
|
1675
|
+
var AlertDialogTrigger = import_react_alert_dialog.AlertDialogTrigger;
|
|
1676
|
+
var AlertDialogPortal = import_react_alert_dialog.AlertDialogPortal;
|
|
1677
|
+
var AlertDialogCancel = import_react_alert_dialog.AlertDialogCancel;
|
|
1678
|
+
var AlertDialogAction = import_react_alert_dialog.AlertDialogAction;
|
|
1679
|
+
var AlertDialogTitle = /* @__PURE__ */ (0, import_react26.forwardRef)(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1680
|
+
var _effect = (0, import_tracking18.useSignals)();
|
|
1681
|
+
try {
|
|
1682
|
+
const { tx } = useThemeContext();
|
|
1683
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react_alert_dialog.AlertDialogTitle, {
|
|
1684
|
+
...props,
|
|
1685
|
+
className: tx("dialog.title", "dialog--alert__title", {
|
|
1686
|
+
srOnly
|
|
1687
|
+
}, classNames),
|
|
1688
|
+
ref: forwardedRef
|
|
1689
|
+
});
|
|
1690
|
+
} finally {
|
|
1691
|
+
_effect.f();
|
|
1692
|
+
}
|
|
1693
|
+
});
|
|
1694
|
+
var AlertDialogDescription = /* @__PURE__ */ (0, import_react26.forwardRef)(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1695
|
+
var _effect = (0, import_tracking18.useSignals)();
|
|
1696
|
+
try {
|
|
1697
|
+
const { tx } = useThemeContext();
|
|
1698
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react_alert_dialog.AlertDialogDescription, {
|
|
1699
|
+
...props,
|
|
1700
|
+
className: tx("dialog.description", "dialog--alert__description", {
|
|
1701
|
+
srOnly
|
|
1702
|
+
}, classNames),
|
|
1703
|
+
ref: forwardedRef
|
|
1704
|
+
});
|
|
1705
|
+
} finally {
|
|
1706
|
+
_effect.f();
|
|
1707
|
+
}
|
|
1708
|
+
});
|
|
1709
|
+
var ALERT_DIALOG_OVERLAY_NAME = "AlertDialogOverlay";
|
|
1710
|
+
var ALERT_DIALOG_CONTENT_NAME = "AlertDialogContent";
|
|
1711
|
+
var [OverlayLayoutProvider2, useOverlayLayoutContext2] = (0, import_react_context5.createContext)(ALERT_DIALOG_OVERLAY_NAME, {
|
|
1712
|
+
inOverlayLayout: false
|
|
1713
|
+
});
|
|
1714
|
+
var AlertDialogOverlay = /* @__PURE__ */ (0, import_react26.forwardRef)(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1715
|
+
var _effect = (0, import_tracking18.useSignals)();
|
|
1716
|
+
try {
|
|
1717
|
+
const { tx } = useThemeContext();
|
|
1718
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react_alert_dialog.AlertDialogOverlay, {
|
|
1719
|
+
...props,
|
|
1720
|
+
className: tx("dialog.overlay", "dialog--alert__overlay", {}, classNames, "data-[block-align=start]:justify-center", "data-[block-align=start]:items-start", "data-[block-align=center]:place-content-center"),
|
|
1721
|
+
ref: forwardedRef,
|
|
1722
|
+
"data-block-align": blockAlign
|
|
1723
|
+
}, /* @__PURE__ */ import_react26.default.createElement(OverlayLayoutProvider2, {
|
|
1724
|
+
inOverlayLayout: true
|
|
1725
|
+
}, children));
|
|
1726
|
+
} finally {
|
|
1727
|
+
_effect.f();
|
|
1728
|
+
}
|
|
1729
|
+
});
|
|
1730
|
+
AlertDialogOverlay.displayName = ALERT_DIALOG_OVERLAY_NAME;
|
|
1731
|
+
var AlertDialogContent = /* @__PURE__ */ (0, import_react26.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
1732
|
+
var _effect = (0, import_tracking18.useSignals)();
|
|
1733
|
+
try {
|
|
1734
|
+
const { tx } = useThemeContext();
|
|
1735
|
+
const { inOverlayLayout } = useOverlayLayoutContext2(ALERT_DIALOG_CONTENT_NAME);
|
|
1736
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react_alert_dialog.AlertDialogContent, {
|
|
1737
|
+
...props,
|
|
1738
|
+
className: tx("dialog.content", "dialog--alert", {
|
|
1739
|
+
inOverlayLayout
|
|
1740
|
+
}, classNames),
|
|
1741
|
+
ref: forwardedRef
|
|
1742
|
+
}, children);
|
|
1743
|
+
} finally {
|
|
1744
|
+
_effect.f();
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
AlertDialogContent.displayName = ALERT_DIALOG_CONTENT_NAME;
|
|
1748
|
+
var AlertDialog = {
|
|
1749
|
+
Root: AlertDialogRoot,
|
|
1750
|
+
Trigger: AlertDialogTrigger,
|
|
1751
|
+
Portal: AlertDialogPortal,
|
|
1752
|
+
Overlay: AlertDialogOverlay,
|
|
1753
|
+
Content: AlertDialogContent,
|
|
1754
|
+
Title: AlertDialogTitle,
|
|
1755
|
+
Description: AlertDialogDescription,
|
|
1756
|
+
Cancel: AlertDialogCancel,
|
|
1757
|
+
Action: AlertDialogAction
|
|
1758
|
+
};
|
|
1759
|
+
var Label = /* @__PURE__ */ (0, import_react27.forwardRef)(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1760
|
+
var _effect = (0, import_tracking19.useSignals)();
|
|
1761
|
+
try {
|
|
1762
|
+
const { tx } = useThemeContext();
|
|
1763
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react_input.Label, {
|
|
1764
|
+
...props,
|
|
1765
|
+
className: tx("input.label", "input__label", {
|
|
1766
|
+
srOnly
|
|
1767
|
+
}, classNames),
|
|
1768
|
+
ref: forwardedRef
|
|
1769
|
+
}, children);
|
|
1770
|
+
} finally {
|
|
1771
|
+
_effect.f();
|
|
1772
|
+
}
|
|
1773
|
+
});
|
|
1774
|
+
var Description = /* @__PURE__ */ (0, import_react27.forwardRef)(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1775
|
+
var _effect = (0, import_tracking19.useSignals)();
|
|
1776
|
+
try {
|
|
1777
|
+
const { tx } = useThemeContext();
|
|
1778
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react_input.Description, {
|
|
1779
|
+
...props,
|
|
1780
|
+
className: tx("input.description", "input__description", {
|
|
1781
|
+
srOnly
|
|
1782
|
+
}, classNames),
|
|
1783
|
+
ref: forwardedRef
|
|
1784
|
+
}, children);
|
|
1785
|
+
} finally {
|
|
1786
|
+
_effect.f();
|
|
1787
|
+
}
|
|
1788
|
+
});
|
|
1789
|
+
var Validation = /* @__PURE__ */ (0, import_react27.forwardRef)(({ __inputScope, srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1790
|
+
var _effect = (0, import_tracking19.useSignals)();
|
|
1791
|
+
try {
|
|
1792
|
+
const { tx } = useThemeContext();
|
|
1793
|
+
const { validationValence } = (0, import_react_input.useInputContext)(import_react_input.INPUT_NAME, __inputScope);
|
|
1794
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react_input.Validation, {
|
|
1795
|
+
...props,
|
|
1796
|
+
className: tx("input.validation", `input__validation-message input__validation-message--${validationValence}`, {
|
|
1797
|
+
srOnly,
|
|
1798
|
+
validationValence
|
|
1799
|
+
}, classNames),
|
|
1800
|
+
ref: forwardedRef
|
|
1801
|
+
}, children);
|
|
1802
|
+
} finally {
|
|
1803
|
+
_effect.f();
|
|
1804
|
+
}
|
|
1805
|
+
});
|
|
1806
|
+
var DescriptionAndValidation = /* @__PURE__ */ (0, import_react27.forwardRef)(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1807
|
+
var _effect = (0, import_tracking19.useSignals)();
|
|
1808
|
+
try {
|
|
1809
|
+
const { tx } = useThemeContext();
|
|
1810
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react_input.DescriptionAndValidation, {
|
|
1811
|
+
...props,
|
|
1812
|
+
className: tx("input.descriptionAndValidation", "input__description-and-validation", {
|
|
1813
|
+
srOnly
|
|
1814
|
+
}, classNames),
|
|
1815
|
+
ref: forwardedRef
|
|
1816
|
+
}, children);
|
|
1817
|
+
} finally {
|
|
1818
|
+
_effect.f();
|
|
1819
|
+
}
|
|
1820
|
+
});
|
|
1821
|
+
var PinInput = /* @__PURE__ */ (0, import_react27.forwardRef)(({ density: propsDensity, elevation: propsElevation, segmentClassName: propsSegmentClassName, inputClassName, variant, ...props }, forwardedRef) => {
|
|
1822
|
+
var _effect = (0, import_tracking19.useSignals)();
|
|
1823
|
+
try {
|
|
1824
|
+
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
1825
|
+
const { tx } = useThemeContext();
|
|
1826
|
+
const density = useDensityContext(propsDensity);
|
|
1827
|
+
const elevation = useElevationContext(propsElevation);
|
|
1828
|
+
const segmentClassName = (0, import_react27.useCallback)(({ focused, validationValence }) => tx("input.input", "input--pin-segment", {
|
|
1829
|
+
variant: "static",
|
|
1830
|
+
focused,
|
|
1831
|
+
disabled: props.disabled,
|
|
1832
|
+
density,
|
|
1833
|
+
elevation,
|
|
1834
|
+
validationValence
|
|
1835
|
+
}, propsSegmentClassName), [
|
|
1836
|
+
tx,
|
|
1837
|
+
props.disabled,
|
|
1838
|
+
elevation,
|
|
1839
|
+
propsElevation,
|
|
1840
|
+
density
|
|
1841
|
+
]);
|
|
1842
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react_input.PinInput, {
|
|
1843
|
+
...props,
|
|
1844
|
+
segmentClassName,
|
|
1845
|
+
...props.autoFocus && !hasIosKeyboard2 && {
|
|
1846
|
+
autoFocus: true
|
|
1847
|
+
},
|
|
1848
|
+
inputClassName: tx("input.inputWithSegments", "input input--pin", {
|
|
1849
|
+
disabled: props.disabled
|
|
1850
|
+
}, inputClassName),
|
|
1851
|
+
ref: forwardedRef
|
|
1852
|
+
});
|
|
1853
|
+
} finally {
|
|
1854
|
+
_effect.f();
|
|
1855
|
+
}
|
|
1856
|
+
});
|
|
1857
|
+
var TextInput = /* @__PURE__ */ (0, import_react27.forwardRef)(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
1858
|
+
var _effect = (0, import_tracking19.useSignals)();
|
|
1859
|
+
try {
|
|
1860
|
+
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
1861
|
+
const themeContextValue = useThemeContext();
|
|
1862
|
+
const density = useDensityContext(propsDensity);
|
|
1863
|
+
const elevation = useElevationContext(propsElevation);
|
|
1864
|
+
const { validationValence } = (0, import_react_input.useInputContext)(import_react_input.INPUT_NAME, __inputScope);
|
|
1865
|
+
const { tx } = themeContextValue;
|
|
1866
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react_input.TextInput, {
|
|
1867
|
+
...props,
|
|
1868
|
+
className: tx("input.input", "input", {
|
|
1869
|
+
variant,
|
|
1870
|
+
disabled: props.disabled,
|
|
1871
|
+
density,
|
|
1872
|
+
elevation,
|
|
1873
|
+
validationValence
|
|
1874
|
+
}, classNames),
|
|
1875
|
+
...props.autoFocus && !hasIosKeyboard2 && {
|
|
1876
|
+
autoFocus: true
|
|
1877
|
+
},
|
|
1878
|
+
ref: forwardedRef
|
|
1879
|
+
});
|
|
1880
|
+
} finally {
|
|
1881
|
+
_effect.f();
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
var TextArea = /* @__PURE__ */ (0, import_react27.forwardRef)(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
1885
|
+
var _effect = (0, import_tracking19.useSignals)();
|
|
1886
|
+
try {
|
|
1887
|
+
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
1888
|
+
const { tx } = useThemeContext();
|
|
1889
|
+
const density = useDensityContext(propsDensity);
|
|
1890
|
+
const elevation = useElevationContext(propsElevation);
|
|
1891
|
+
const { validationValence } = (0, import_react_input.useInputContext)(import_react_input.INPUT_NAME, __inputScope);
|
|
1892
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react_input.TextArea, {
|
|
1893
|
+
...props,
|
|
1894
|
+
className: tx("input.input", "input--text-area", {
|
|
1895
|
+
variant,
|
|
1896
|
+
disabled: props.disabled,
|
|
1897
|
+
density,
|
|
1898
|
+
elevation,
|
|
1899
|
+
validationValence
|
|
1900
|
+
}, classNames),
|
|
1901
|
+
...props.autoFocus && !hasIosKeyboard2 && {
|
|
1902
|
+
autoFocus: true
|
|
1903
|
+
},
|
|
1904
|
+
ref: forwardedRef
|
|
1905
|
+
});
|
|
1906
|
+
} finally {
|
|
1907
|
+
_effect.f();
|
|
1908
|
+
}
|
|
1909
|
+
});
|
|
1910
|
+
var Checkbox = /* @__PURE__ */ (0, import_react27.forwardRef)(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, weight = "bold", classNames, ...props }, forwardedRef) => {
|
|
1911
|
+
var _effect = (0, import_tracking19.useSignals)();
|
|
1912
|
+
try {
|
|
1913
|
+
const [checked, onCheckedChange] = (0, import_react_use_controllable_state2.useControllableState)({
|
|
1914
|
+
prop: propsChecked,
|
|
1915
|
+
defaultProp: propsDefaultChecked,
|
|
1916
|
+
onChange: propsOnCheckedChange
|
|
1917
|
+
});
|
|
1918
|
+
const { id, validationValence, descriptionId, errorMessageId } = (0, import_react_input.useInputContext)(import_react_input.INPUT_NAME, __inputScope);
|
|
1919
|
+
const { tx } = useThemeContext();
|
|
1920
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react_checkbox.Root, {
|
|
1921
|
+
...props,
|
|
1922
|
+
checked,
|
|
1923
|
+
onCheckedChange,
|
|
1924
|
+
id,
|
|
1925
|
+
"aria-describedby": descriptionId,
|
|
1926
|
+
...validationValence === "error" && {
|
|
1927
|
+
"aria-invalid": "true",
|
|
1928
|
+
"aria-errormessage": errorMessageId
|
|
1929
|
+
},
|
|
1930
|
+
className: tx("input.checkbox", "input--checkbox", {
|
|
1931
|
+
size
|
|
1932
|
+
}, "shrink-0", classNames),
|
|
1933
|
+
ref: forwardedRef
|
|
1934
|
+
}, /* @__PURE__ */ import_react27.default.createElement(Icon, {
|
|
1935
|
+
icon: checked === "indeterminate" ? "ph--minus--regular" : "ph--check--regular",
|
|
1936
|
+
classNames: tx("input.checkboxIndicator", "input--checkbox__indicator", {
|
|
1937
|
+
size,
|
|
1938
|
+
checked
|
|
1939
|
+
})
|
|
1940
|
+
}));
|
|
1941
|
+
} finally {
|
|
1942
|
+
_effect.f();
|
|
1943
|
+
}
|
|
1944
|
+
});
|
|
1945
|
+
var Switch = /* @__PURE__ */ (0, import_react27.forwardRef)(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, classNames, ...props }, forwardedRef) => {
|
|
1946
|
+
var _effect = (0, import_tracking19.useSignals)();
|
|
1947
|
+
try {
|
|
1948
|
+
const [checked, onCheckedChange] = (0, import_react_use_controllable_state2.useControllableState)({
|
|
1949
|
+
prop: propsChecked,
|
|
1950
|
+
defaultProp: propsDefaultChecked ?? false,
|
|
1951
|
+
onChange: propsOnCheckedChange
|
|
1952
|
+
});
|
|
1953
|
+
const { id, validationValence, descriptionId, errorMessageId } = (0, import_react_input.useInputContext)(import_react_input.INPUT_NAME, __inputScope);
|
|
1954
|
+
return /* @__PURE__ */ import_react27.default.createElement("input", {
|
|
1955
|
+
type: "checkbox",
|
|
1956
|
+
className: (0, import_react_ui_theme3.mx)("dx-checkbox--switch dx-focus-ring", classNames),
|
|
1957
|
+
checked,
|
|
1958
|
+
onChange: (event) => {
|
|
1959
|
+
onCheckedChange(event.target.checked);
|
|
1960
|
+
},
|
|
1961
|
+
id,
|
|
1962
|
+
"aria-describedby": descriptionId,
|
|
1963
|
+
...props,
|
|
1964
|
+
...validationValence === "error" && {
|
|
1965
|
+
"aria-invalid": "true",
|
|
1966
|
+
"aria-errormessage": errorMessageId
|
|
1967
|
+
},
|
|
1968
|
+
ref: forwardedRef
|
|
1969
|
+
});
|
|
1970
|
+
} finally {
|
|
1971
|
+
_effect.f();
|
|
1972
|
+
}
|
|
1973
|
+
});
|
|
1974
|
+
var Input = {
|
|
1975
|
+
Root: import_react_input.InputRoot,
|
|
1976
|
+
PinInput,
|
|
1977
|
+
TextInput,
|
|
1978
|
+
TextArea,
|
|
1979
|
+
Checkbox,
|
|
1980
|
+
Switch,
|
|
1981
|
+
Label,
|
|
1982
|
+
Description,
|
|
1983
|
+
Validation,
|
|
1984
|
+
DescriptionAndValidation
|
|
1985
|
+
};
|
|
1986
|
+
var edgeToOrientationMap = {
|
|
1987
|
+
top: "horizontal",
|
|
1988
|
+
bottom: "horizontal",
|
|
1989
|
+
left: "vertical",
|
|
1990
|
+
right: "vertical"
|
|
1991
|
+
};
|
|
1992
|
+
var orientationStyles = {
|
|
1993
|
+
horizontal: "h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]",
|
|
1994
|
+
vertical: "w-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]"
|
|
1995
|
+
};
|
|
1996
|
+
var edgeStyles = {
|
|
1997
|
+
top: "top-[--line-offset] before:top-[--offset-terminal]",
|
|
1998
|
+
right: "right-[--line-offset] before:right-[--offset-terminal]",
|
|
1999
|
+
bottom: "bottom-[--line-offset] before:bottom-[--offset-terminal]",
|
|
2000
|
+
left: "left-[--line-offset] before:left-[--offset-terminal]"
|
|
2001
|
+
};
|
|
2002
|
+
var strokeSize = 2;
|
|
2003
|
+
var terminalSize = 8;
|
|
2004
|
+
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
2005
|
+
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
2006
|
+
var _effect = (0, import_tracking21.useSignals)();
|
|
2007
|
+
try {
|
|
2008
|
+
const orientation = edgeToOrientationMap[edge];
|
|
2009
|
+
return /* @__PURE__ */ import_react30.default.createElement("div", {
|
|
2010
|
+
role: "none",
|
|
2011
|
+
style: {
|
|
2012
|
+
"--line-thickness": `${strokeSize}px`,
|
|
2013
|
+
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
2014
|
+
"--line-inset": `${lineInset}px`,
|
|
2015
|
+
"--terminal-size": `${terminalSize}px`,
|
|
2016
|
+
"--terminal-radius": `${terminalSize / 2}px`,
|
|
2017
|
+
"--terminal-inset": `${terminalInset}px`,
|
|
2018
|
+
"--offset-terminal": `${offsetToAlignTerminalWithLine}px`
|
|
2019
|
+
},
|
|
2020
|
+
className: `absolute z-10 pointer-events-none bg-accentSurface before:content-[''] before:w-[--terminal-size] before:h-[--terminal-size] box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accentSurface before:rounded-full ${orientationStyles[orientation]} ${edgeStyles[edge]}`
|
|
2021
|
+
});
|
|
2022
|
+
} finally {
|
|
2023
|
+
_effect.f();
|
|
2024
|
+
}
|
|
2025
|
+
};
|
|
2026
|
+
var List = /* @__PURE__ */ (0, import_react29.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
2027
|
+
var _effect = (0, import_tracking20.useSignals)();
|
|
2028
|
+
try {
|
|
2029
|
+
const { tx } = useThemeContext();
|
|
2030
|
+
const density = useDensityContext(props.density);
|
|
2031
|
+
return /* @__PURE__ */ import_react29.default.createElement(DensityProvider, {
|
|
2032
|
+
density
|
|
2033
|
+
}, /* @__PURE__ */ import_react29.default.createElement(import_react_list.List, {
|
|
2034
|
+
...props,
|
|
2035
|
+
className: tx("list.root", "list", {}, classNames),
|
|
2036
|
+
ref: forwardedRef
|
|
2037
|
+
}, children));
|
|
2038
|
+
} finally {
|
|
2039
|
+
_effect.f();
|
|
2040
|
+
}
|
|
2041
|
+
});
|
|
2042
|
+
var ListItemEndcap = /* @__PURE__ */ (0, import_react29.forwardRef)(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
2043
|
+
var _effect = (0, import_tracking20.useSignals)();
|
|
2044
|
+
try {
|
|
2045
|
+
const Root7 = asChild ? import_react_slot7.Slot : "div";
|
|
2046
|
+
const density = useDensityContext();
|
|
2047
|
+
const { tx } = useThemeContext();
|
|
2048
|
+
return /* @__PURE__ */ import_react29.default.createElement(Root7, {
|
|
2049
|
+
...!asChild && {
|
|
2050
|
+
role: "none"
|
|
2051
|
+
},
|
|
2052
|
+
...props,
|
|
2053
|
+
className: tx("list.item.endcap", "list__listItem__endcap", {
|
|
2054
|
+
density
|
|
2055
|
+
}, classNames),
|
|
2056
|
+
ref: forwardedRef
|
|
2057
|
+
}, children);
|
|
2058
|
+
} finally {
|
|
2059
|
+
_effect.f();
|
|
2060
|
+
}
|
|
2061
|
+
});
|
|
2062
|
+
var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
2063
|
+
var _effect = (0, import_tracking20.useSignals)();
|
|
2064
|
+
try {
|
|
2065
|
+
const density = useDensityContext();
|
|
2066
|
+
const { tx } = useThemeContext();
|
|
2067
|
+
return /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
2068
|
+
role: "none",
|
|
2069
|
+
...props,
|
|
2070
|
+
className: tx("list.item.openTrigger", "list__listItem__openTrigger--mock", {
|
|
2071
|
+
density
|
|
2072
|
+
}, classNames)
|
|
2073
|
+
});
|
|
2074
|
+
} finally {
|
|
2075
|
+
_effect.f();
|
|
2076
|
+
}
|
|
2077
|
+
};
|
|
2078
|
+
var ListItemHeading = /* @__PURE__ */ (0, import_react29.forwardRef)(({ children, classNames, ...props }, forwardedRef) => {
|
|
2079
|
+
var _effect = (0, import_tracking20.useSignals)();
|
|
2080
|
+
try {
|
|
2081
|
+
const { tx } = useThemeContext();
|
|
2082
|
+
const density = useDensityContext();
|
|
2083
|
+
return /* @__PURE__ */ import_react29.default.createElement(import_react_list.ListItemHeading, {
|
|
2084
|
+
...props,
|
|
2085
|
+
className: tx("list.item.heading", "list__listItem__heading", {
|
|
2086
|
+
density
|
|
2087
|
+
}, classNames),
|
|
2088
|
+
ref: forwardedRef
|
|
2089
|
+
}, children);
|
|
2090
|
+
} finally {
|
|
2091
|
+
_effect.f();
|
|
2092
|
+
}
|
|
2093
|
+
});
|
|
2094
|
+
var ListItemOpenTrigger = /* @__PURE__ */ (0, import_react29.forwardRef)(({ __listItemScope, classNames, children, ...props }, forwardedRef) => {
|
|
2095
|
+
var _effect = (0, import_tracking20.useSignals)();
|
|
2096
|
+
try {
|
|
2097
|
+
const { tx } = useThemeContext();
|
|
2098
|
+
const density = useDensityContext();
|
|
2099
|
+
const { open } = (0, import_react_list.useListItemContext)(import_react_list.LIST_ITEM_NAME, __listItemScope);
|
|
2100
|
+
const Icon3 = open ? import_react28.CaretDown : import_react28.CaretRight;
|
|
2101
|
+
return /* @__PURE__ */ import_react29.default.createElement(import_react_list.ListItemOpenTrigger, {
|
|
2102
|
+
...props,
|
|
2103
|
+
className: tx("list.item.openTrigger", "list__listItem__openTrigger", {
|
|
2104
|
+
density
|
|
2105
|
+
}, classNames),
|
|
2106
|
+
ref: forwardedRef
|
|
2107
|
+
}, children || /* @__PURE__ */ import_react29.default.createElement(Icon3, {
|
|
2108
|
+
weight: "bold",
|
|
2109
|
+
className: tx("list.item.openTriggerIcon", "list__listItem__openTrigger__icon", {})
|
|
2110
|
+
}));
|
|
2111
|
+
} finally {
|
|
2112
|
+
_effect.f();
|
|
2113
|
+
}
|
|
2114
|
+
});
|
|
2115
|
+
var ListItemRoot = /* @__PURE__ */ (0, import_react29.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
2116
|
+
var _effect = (0, import_tracking20.useSignals)();
|
|
2117
|
+
try {
|
|
2118
|
+
const { tx } = useThemeContext();
|
|
2119
|
+
const density = useDensityContext();
|
|
2120
|
+
return /* @__PURE__ */ import_react29.default.createElement(import_react_list.ListItem, {
|
|
2121
|
+
...props,
|
|
2122
|
+
className: tx("list.item.root", "list__listItem", {
|
|
2123
|
+
density,
|
|
2124
|
+
collapsible: props.collapsible
|
|
2125
|
+
}, classNames),
|
|
2126
|
+
ref: forwardedRef
|
|
2127
|
+
}, children);
|
|
2128
|
+
} finally {
|
|
2129
|
+
_effect.f();
|
|
2130
|
+
}
|
|
2131
|
+
});
|
|
2132
|
+
var ListItem = {
|
|
2133
|
+
Root: ListItemRoot,
|
|
2134
|
+
Endcap: ListItemEndcap,
|
|
2135
|
+
Heading: ListItemHeading,
|
|
2136
|
+
OpenTrigger: ListItemOpenTrigger,
|
|
2137
|
+
CollapsibleContent: import_react_list.ListItemCollapsibleContent,
|
|
2138
|
+
MockOpenTrigger: MockListItemOpenTrigger,
|
|
2139
|
+
DropIndicator: ListDropIndicator
|
|
2140
|
+
};
|
|
2141
|
+
var edgeToOrientationMap2 = {
|
|
2142
|
+
"reorder-above": "sibling",
|
|
2143
|
+
"reorder-below": "sibling",
|
|
2144
|
+
"make-child": "child",
|
|
2145
|
+
reparent: "child"
|
|
2146
|
+
};
|
|
2147
|
+
var orientationStyles2 = {
|
|
2148
|
+
// TODO(wittjosiah): Stop using left/right here.
|
|
2149
|
+
sibling: "bs-[--line-thickness] left-[--horizontal-indent] right-0 bg-accentSurface before:left-[--negative-terminal-size]",
|
|
2150
|
+
child: "is-full block-start-0 block-end-0 border-[length:--line-thickness] before:invisible"
|
|
2151
|
+
};
|
|
2152
|
+
var instructionStyles = {
|
|
2153
|
+
"reorder-above": "block-start-[--line-offset] before:block-start-[--offset-terminal]",
|
|
2154
|
+
"reorder-below": "block-end-[--line-offset] before:block-end-[--offset-terminal]",
|
|
2155
|
+
"make-child": "border-accentSurface",
|
|
2156
|
+
// TODO(wittjosiah): This is not occurring in the current implementation.
|
|
2157
|
+
reparent: ""
|
|
2158
|
+
};
|
|
2159
|
+
var strokeSize2 = 2;
|
|
2160
|
+
var terminalSize2 = 8;
|
|
2161
|
+
var offsetToAlignTerminalWithLine2 = (strokeSize2 - terminalSize2) / 2;
|
|
2162
|
+
var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
2163
|
+
var _effect = (0, import_tracking23.useSignals)();
|
|
2164
|
+
try {
|
|
2165
|
+
const lineOffset = `calc(-0.5 * (${gap}px + ${strokeSize2}px))`;
|
|
2166
|
+
const isBlocked = instruction.type === "instruction-blocked";
|
|
2167
|
+
const desiredInstruction = isBlocked ? instruction.desired : instruction;
|
|
2168
|
+
const orientation = edgeToOrientationMap2[desiredInstruction.type];
|
|
2169
|
+
if (isBlocked) {
|
|
2170
|
+
return null;
|
|
2171
|
+
}
|
|
2172
|
+
return /* @__PURE__ */ import_react32.default.createElement("div", {
|
|
2173
|
+
style: {
|
|
2174
|
+
"--line-thickness": `${strokeSize2}px`,
|
|
2175
|
+
"--line-offset": `${lineOffset}`,
|
|
2176
|
+
"--terminal-size": `${terminalSize2}px`,
|
|
2177
|
+
"--terminal-radius": `${terminalSize2 / 2}px`,
|
|
2178
|
+
"--negative-terminal-size": `-${terminalSize2}px`,
|
|
2179
|
+
"--offset-terminal": `${offsetToAlignTerminalWithLine2}px`,
|
|
2180
|
+
"--horizontal-indent": `${desiredInstruction.currentLevel * desiredInstruction.indentPerLevel + 4}px`
|
|
2181
|
+
},
|
|
2182
|
+
className: `absolute z-10 pointer-events-none before:is-[--terminal-size] before:bs-[--terminal-size] box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accentSurface before:rounded-full ${orientationStyles2[orientation]} ${instructionStyles[desiredInstruction.type]}`
|
|
2183
|
+
});
|
|
2184
|
+
} finally {
|
|
2185
|
+
_effect.f();
|
|
2186
|
+
}
|
|
2187
|
+
};
|
|
2188
|
+
var TreeRoot = /* @__PURE__ */ (0, import_react31.forwardRef)((props, forwardedRef) => {
|
|
2189
|
+
var _effect = (0, import_tracking22.useSignals)();
|
|
2190
|
+
try {
|
|
2191
|
+
return /* @__PURE__ */ import_react31.default.createElement(List, {
|
|
2192
|
+
...props,
|
|
2193
|
+
ref: forwardedRef
|
|
2194
|
+
});
|
|
2195
|
+
} finally {
|
|
2196
|
+
_effect.f();
|
|
2197
|
+
}
|
|
2198
|
+
});
|
|
2199
|
+
var TreeBranch = /* @__PURE__ */ (0, import_react31.forwardRef)(({ __listScope, ...props }, forwardedRef) => {
|
|
2200
|
+
var _effect = (0, import_tracking22.useSignals)();
|
|
2201
|
+
try {
|
|
2202
|
+
const { headingId } = (0, import_react_list.useListItemContext)(import_react_list.LIST_ITEM_NAME, __listScope);
|
|
2203
|
+
return /* @__PURE__ */ import_react31.default.createElement(List, {
|
|
2204
|
+
...props,
|
|
2205
|
+
"aria-labelledby": headingId,
|
|
2206
|
+
ref: forwardedRef
|
|
2207
|
+
});
|
|
2208
|
+
} finally {
|
|
2209
|
+
_effect.f();
|
|
2210
|
+
}
|
|
2211
|
+
});
|
|
2212
|
+
var TreeItemRoot = /* @__PURE__ */ (0, import_react31.forwardRef)((props, forwardedRef) => {
|
|
2213
|
+
var _effect = (0, import_tracking22.useSignals)();
|
|
2214
|
+
try {
|
|
2215
|
+
return /* @__PURE__ */ import_react31.default.createElement(ListItem.Root, {
|
|
2216
|
+
role: "treeitem",
|
|
2217
|
+
...props,
|
|
2218
|
+
ref: forwardedRef
|
|
2219
|
+
});
|
|
2220
|
+
} finally {
|
|
2221
|
+
_effect.f();
|
|
2222
|
+
}
|
|
2223
|
+
});
|
|
2224
|
+
var TreeItemHeading = ListItem.Heading;
|
|
2225
|
+
var TreeItemOpenTrigger = ListItem.OpenTrigger;
|
|
2226
|
+
var MockTreeItemOpenTrigger = ListItem.MockOpenTrigger;
|
|
2227
|
+
var TreeItemBody = ListItem.CollapsibleContent;
|
|
2228
|
+
var Tree = {
|
|
2229
|
+
Root: TreeRoot,
|
|
2230
|
+
Branch: TreeBranch
|
|
2231
|
+
};
|
|
2232
|
+
var TreeItem = {
|
|
2233
|
+
Root: TreeItemRoot,
|
|
2234
|
+
Heading: TreeItemHeading,
|
|
2235
|
+
Body: TreeItemBody,
|
|
2236
|
+
OpenTrigger: TreeItemOpenTrigger,
|
|
2237
|
+
MockOpenTrigger: MockTreeItemOpenTrigger,
|
|
2238
|
+
DropIndicator: TreeDropIndicator
|
|
2239
|
+
};
|
|
2240
|
+
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2241
|
+
var [createTreegridRowContext, createTreegridRowScope] = (0, import_react_context6.createContextScope)(TREEGRID_ROW_NAME, []);
|
|
2242
|
+
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
2243
|
+
var PATH_SEPARATOR = "~";
|
|
2244
|
+
var PARENT_OF_SEPARATOR = " ";
|
|
2245
|
+
var TreegridRoot = /* @__PURE__ */ (0, import_react33.forwardRef)(({ asChild, classNames, children, style, gridTemplateColumns, ...props }, forwardedRef) => {
|
|
2246
|
+
var _effect = (0, import_tracking24.useSignals)();
|
|
2247
|
+
try {
|
|
2248
|
+
const { tx } = useThemeContext();
|
|
2249
|
+
const Root7 = asChild ? import_react_slot8.Slot : import_react_primitive7.Primitive.div;
|
|
2250
|
+
const arrowNavigationAttrs = (0, import_react_tabster.useArrowNavigationGroup)({
|
|
2251
|
+
axis: "vertical",
|
|
2252
|
+
tabbable: false,
|
|
2253
|
+
circular: true
|
|
2254
|
+
});
|
|
2255
|
+
return /* @__PURE__ */ import_react33.default.createElement(Root7, {
|
|
2256
|
+
role: "treegrid",
|
|
2257
|
+
...arrowNavigationAttrs,
|
|
2258
|
+
...props,
|
|
2259
|
+
className: tx("treegrid.root", "treegrid", {}, classNames),
|
|
2260
|
+
style: {
|
|
2261
|
+
...style,
|
|
2262
|
+
gridTemplateColumns
|
|
2263
|
+
},
|
|
2264
|
+
ref: forwardedRef
|
|
2265
|
+
}, children);
|
|
2266
|
+
} finally {
|
|
2267
|
+
_effect.f();
|
|
2268
|
+
}
|
|
2269
|
+
});
|
|
2270
|
+
var TreegridRow = /* @__PURE__ */ (0, import_react33.forwardRef)(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
2271
|
+
var _effect = (0, import_tracking24.useSignals)();
|
|
2272
|
+
try {
|
|
2273
|
+
const { tx } = useThemeContext();
|
|
2274
|
+
const Root7 = asChild ? import_react_slot8.Slot : import_react_primitive7.Primitive.div;
|
|
2275
|
+
const pathParts = id.split(PATH_SEPARATOR);
|
|
2276
|
+
const level = pathParts.length - 1;
|
|
2277
|
+
const [open, onOpenChange] = (0, import_react_use_controllable_state3.useControllableState)({
|
|
2278
|
+
prop: propsOpen,
|
|
2279
|
+
onChange: propsOnOpenChange,
|
|
2280
|
+
defaultProp: defaultOpen
|
|
2281
|
+
});
|
|
2282
|
+
const focusableGroupAttrs = (0, import_react_tabster.useFocusableGroup)({
|
|
2283
|
+
tabBehavior: "limited"
|
|
2284
|
+
});
|
|
2285
|
+
const arrowGroupAttrs = (0, import_react_tabster.useArrowNavigationGroup)({
|
|
2286
|
+
axis: "horizontal",
|
|
2287
|
+
tabbable: false,
|
|
2288
|
+
circular: false,
|
|
2289
|
+
memorizeCurrent: false
|
|
2290
|
+
});
|
|
2291
|
+
return /* @__PURE__ */ import_react33.default.createElement(TreegridRowProvider, {
|
|
2292
|
+
open,
|
|
2293
|
+
onOpenChange,
|
|
2294
|
+
scope: __treegridRowScope
|
|
2295
|
+
}, /* @__PURE__ */ import_react33.default.createElement(Root7, {
|
|
2296
|
+
role: "row",
|
|
2297
|
+
"aria-level": level,
|
|
2298
|
+
className: tx("treegrid.row", "treegrid__row", {
|
|
2299
|
+
level
|
|
2300
|
+
}, classNames),
|
|
2301
|
+
...parentOf && {
|
|
2302
|
+
"aria-expanded": open,
|
|
2303
|
+
"aria-owns": parentOf
|
|
2304
|
+
},
|
|
2305
|
+
tabIndex: 0,
|
|
2306
|
+
...focusableGroupAttrs,
|
|
2307
|
+
...props,
|
|
2308
|
+
id,
|
|
2309
|
+
ref: forwardedRef
|
|
2310
|
+
}, /* @__PURE__ */ import_react33.default.createElement("div", {
|
|
2311
|
+
role: "none",
|
|
2312
|
+
className: "contents",
|
|
2313
|
+
...arrowGroupAttrs
|
|
2314
|
+
}, children)));
|
|
2315
|
+
} finally {
|
|
2316
|
+
_effect.f();
|
|
2317
|
+
}
|
|
2318
|
+
});
|
|
2319
|
+
var TreegridCell = /* @__PURE__ */ (0, import_react33.forwardRef)(({ classNames, children, indent, ...props }, forwardedRef) => {
|
|
2320
|
+
var _effect = (0, import_tracking24.useSignals)();
|
|
2321
|
+
try {
|
|
2322
|
+
const { tx } = useThemeContext();
|
|
2323
|
+
return /* @__PURE__ */ import_react33.default.createElement("div", {
|
|
2324
|
+
role: "gridcell",
|
|
2325
|
+
className: tx("treegrid.cell", "treegrid__cell", {
|
|
2326
|
+
indent
|
|
2327
|
+
}, classNames),
|
|
2328
|
+
...props,
|
|
2329
|
+
ref: forwardedRef
|
|
2330
|
+
}, children);
|
|
2331
|
+
} finally {
|
|
2332
|
+
_effect.f();
|
|
2333
|
+
}
|
|
2334
|
+
});
|
|
2335
|
+
var Treegrid = {
|
|
2336
|
+
Root: TreegridRoot,
|
|
2337
|
+
Row: TreegridRow,
|
|
2338
|
+
Cell: TreegridCell,
|
|
2339
|
+
PARENT_OF_SEPARATOR,
|
|
2340
|
+
PATH_SEPARATOR,
|
|
2341
|
+
createTreegridRowScope,
|
|
2342
|
+
useTreegridRowContext
|
|
2343
|
+
};
|
|
2344
|
+
var useSwipeToDismiss = (ref, {
|
|
2345
|
+
onDismiss,
|
|
2346
|
+
dismissThreshold = 64,
|
|
2347
|
+
debounceThreshold = 8,
|
|
2348
|
+
offset = 0
|
|
2349
|
+
/* side = 'inline-start' */
|
|
2350
|
+
}) => {
|
|
2351
|
+
const $root = ref.current;
|
|
2352
|
+
const [motionState, setMotionState] = (0, import_react35.useState)(0);
|
|
2353
|
+
const [gestureStartX, setGestureStartX] = (0, import_react35.useState)(0);
|
|
2354
|
+
const setIdle = (0, import_react35.useCallback)(() => {
|
|
2355
|
+
setMotionState(0);
|
|
2356
|
+
$root?.style.removeProperty("inset-inline-start");
|
|
2357
|
+
$root?.style.setProperty("transition-duration", "200ms");
|
|
2358
|
+
}, [
|
|
2359
|
+
$root
|
|
2360
|
+
]);
|
|
2361
|
+
const setFollowing = (0, import_react35.useCallback)(() => {
|
|
2362
|
+
setMotionState(2);
|
|
2363
|
+
$root?.style.setProperty("transition-duration", "0ms");
|
|
2364
|
+
}, [
|
|
2365
|
+
$root
|
|
2366
|
+
]);
|
|
2367
|
+
const handlePointerDown = (0, import_react35.useCallback)(({ screenX }) => {
|
|
2368
|
+
if (motionState === 0) {
|
|
2369
|
+
setMotionState(1);
|
|
2370
|
+
setGestureStartX(screenX);
|
|
2371
|
+
}
|
|
2372
|
+
}, [
|
|
2373
|
+
motionState
|
|
2374
|
+
]);
|
|
2375
|
+
const handlePointerMove = (0, import_react35.useCallback)(({ screenX }) => {
|
|
2376
|
+
if ($root) {
|
|
2377
|
+
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2378
|
+
switch (motionState) {
|
|
2379
|
+
case 2:
|
|
2380
|
+
if (Math.abs(delta) > dismissThreshold) {
|
|
2381
|
+
setIdle();
|
|
2382
|
+
onDismiss?.();
|
|
2383
|
+
} else {
|
|
2384
|
+
$root.style.setProperty("inset-inline-start", `${offset + delta}px`);
|
|
2385
|
+
}
|
|
2386
|
+
break;
|
|
2387
|
+
case 1:
|
|
2388
|
+
if (Math.abs(delta) > debounceThreshold) {
|
|
2389
|
+
setFollowing();
|
|
2390
|
+
}
|
|
2391
|
+
break;
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
}, [
|
|
2395
|
+
$root,
|
|
2396
|
+
motionState,
|
|
2397
|
+
gestureStartX
|
|
2398
|
+
]);
|
|
2399
|
+
const handlePointerUp = (0, import_react35.useCallback)(() => {
|
|
2400
|
+
setIdle();
|
|
2401
|
+
}, [
|
|
2402
|
+
setIdle
|
|
2403
|
+
]);
|
|
2404
|
+
(0, import_react35.useEffect)(() => {
|
|
2405
|
+
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
2406
|
+
return () => {
|
|
2407
|
+
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
2408
|
+
};
|
|
2409
|
+
}, [
|
|
2410
|
+
$root,
|
|
2411
|
+
handlePointerDown
|
|
2412
|
+
]);
|
|
2413
|
+
(0, import_react35.useEffect)(() => {
|
|
2414
|
+
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
2415
|
+
return () => {
|
|
2416
|
+
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
2417
|
+
};
|
|
2418
|
+
}, [
|
|
2419
|
+
$root,
|
|
2420
|
+
handlePointerMove
|
|
2421
|
+
]);
|
|
2422
|
+
(0, import_react35.useEffect)(() => {
|
|
2423
|
+
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
2424
|
+
return () => {
|
|
2425
|
+
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
2426
|
+
};
|
|
2427
|
+
}, [
|
|
2428
|
+
$root,
|
|
2429
|
+
handlePointerUp
|
|
2430
|
+
]);
|
|
2431
|
+
};
|
|
2432
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/ui/react-ui/src/components/Main/Main.tsx";
|
|
2433
|
+
var MAIN_ROOT_NAME = "MainRoot";
|
|
2434
|
+
var NAVIGATION_SIDEBAR_NAME = "NavigationSidebar";
|
|
2435
|
+
var COMPLEMENTARY_SIDEBAR_NAME = "ComplementarySidebar";
|
|
2436
|
+
var MAIN_NAME = "Main";
|
|
2437
|
+
var GENERIC_CONSUMER_NAME = "GenericConsumer";
|
|
2438
|
+
var landmarkAttr = "data-main-landmark";
|
|
2439
|
+
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2440
|
+
const handleKeyDown = (0, import_react34.useCallback)((event) => {
|
|
2441
|
+
const target = event.target;
|
|
2442
|
+
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2443
|
+
event.preventDefault();
|
|
2444
|
+
const landmarks = Array.from(document.querySelectorAll(`[${landmarkAttr}]:not([inert])`)).map((el) => el.hasAttribute(landmarkAttr) ? parseInt(el.getAttribute(landmarkAttr)) : NaN).sort();
|
|
2445
|
+
const l = landmarks.length;
|
|
2446
|
+
const cursor = landmarks.indexOf(parseInt(target.getAttribute(landmarkAttr)));
|
|
2447
|
+
const nextLandmark = landmarks[(cursor + l + (event.getModifierState("Shift") ? -1 : 1)) % l];
|
|
2448
|
+
document.querySelector(`[${landmarkAttr}="${nextLandmark}"]`)?.focus();
|
|
2449
|
+
}
|
|
2450
|
+
propsOnKeyDown?.(event);
|
|
2451
|
+
}, [
|
|
2452
|
+
propsOnKeyDown
|
|
2453
|
+
]);
|
|
2454
|
+
const focusableGroupAttrs = window ? {} : {
|
|
2455
|
+
tabBehavior: "limited",
|
|
2456
|
+
ignoreDefaultKeydown: {
|
|
2457
|
+
Tab: true
|
|
2458
|
+
}
|
|
2459
|
+
};
|
|
2460
|
+
return {
|
|
2461
|
+
onKeyDown: handleKeyDown,
|
|
2462
|
+
[landmarkAttr]: landmark,
|
|
2463
|
+
tabIndex: 0,
|
|
2464
|
+
...focusableGroupAttrs
|
|
2465
|
+
};
|
|
2466
|
+
};
|
|
2467
|
+
var [MainProvider, useMainContext] = (0, import_react_context7.createContext)(MAIN_NAME, {
|
|
2468
|
+
resizing: false,
|
|
2469
|
+
navigationSidebarState: "closed",
|
|
2470
|
+
setNavigationSidebarState: (nextState) => {
|
|
2471
|
+
import_log.log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2472
|
+
F: __dxlog_file,
|
|
2473
|
+
L: 82,
|
|
2474
|
+
S: void 0,
|
|
2475
|
+
C: (f, a) => f(...a)
|
|
2476
|
+
});
|
|
2477
|
+
},
|
|
2478
|
+
complementarySidebarState: "closed",
|
|
2479
|
+
setComplementarySidebarState: (nextState) => {
|
|
2480
|
+
import_log.log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2481
|
+
F: __dxlog_file,
|
|
2482
|
+
L: 87,
|
|
2483
|
+
S: void 0,
|
|
2484
|
+
C: (f, a) => f(...a)
|
|
2485
|
+
});
|
|
2486
|
+
}
|
|
2487
|
+
});
|
|
2488
|
+
var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
2489
|
+
const { setNavigationSidebarState, navigationSidebarState, setComplementarySidebarState, complementarySidebarState } = useMainContext(consumerName);
|
|
2490
|
+
return {
|
|
2491
|
+
navigationSidebarState,
|
|
2492
|
+
setNavigationSidebarState,
|
|
2493
|
+
toggleNavigationSidebar: (0, import_react34.useCallback)(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2494
|
+
navigationSidebarState,
|
|
2495
|
+
setNavigationSidebarState
|
|
2496
|
+
]),
|
|
2497
|
+
openNavigationSidebar: (0, import_react34.useCallback)(() => setNavigationSidebarState("expanded"), []),
|
|
2498
|
+
collapseNavigationSidebar: (0, import_react34.useCallback)(() => setNavigationSidebarState("collapsed"), []),
|
|
2499
|
+
closeNavigationSidebar: (0, import_react34.useCallback)(() => setNavigationSidebarState("closed"), []),
|
|
2500
|
+
complementarySidebarState,
|
|
2501
|
+
setComplementarySidebarState,
|
|
2502
|
+
toggleComplementarySidebar: (0, import_react34.useCallback)(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2503
|
+
complementarySidebarState,
|
|
2504
|
+
setComplementarySidebarState
|
|
2505
|
+
]),
|
|
2506
|
+
openComplementarySidebar: (0, import_react34.useCallback)(() => setComplementarySidebarState("expanded"), []),
|
|
2507
|
+
collapseComplementarySidebar: (0, import_react34.useCallback)(() => setComplementarySidebarState("collapsed"), []),
|
|
2508
|
+
closeComplementarySidebar: (0, import_react34.useCallback)(() => setComplementarySidebarState("closed"), [])
|
|
2509
|
+
};
|
|
2510
|
+
};
|
|
2511
|
+
var resizeDebounce = 3e3;
|
|
2512
|
+
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
2513
|
+
var _effect = (0, import_tracking25.useSignals)();
|
|
2514
|
+
try {
|
|
2515
|
+
const [isLg] = (0, import_react_hooks4.useMediaQuery)("lg", {
|
|
2516
|
+
ssr: false
|
|
2517
|
+
});
|
|
2518
|
+
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = (0, import_react_use_controllable_state4.useControllableState)({
|
|
2519
|
+
prop: propsNavigationSidebarState,
|
|
2520
|
+
defaultProp: defaultNavigationSidebarState,
|
|
2521
|
+
onChange: onNavigationSidebarStateChange
|
|
2522
|
+
});
|
|
2523
|
+
const [complementarySidebarState = isLg ? "expanded" : "collapsed", setComplementarySidebarState] = (0, import_react_use_controllable_state4.useControllableState)({
|
|
2524
|
+
prop: propsComplementarySidebarState,
|
|
2525
|
+
defaultProp: defaultComplementarySidebarState,
|
|
2526
|
+
onChange: onComplementarySidebarStateChange
|
|
2527
|
+
});
|
|
2528
|
+
const [resizing, setResizing] = (0, import_react34.useState)(false);
|
|
2529
|
+
const resizeInterval = (0, import_react34.useRef)(null);
|
|
2530
|
+
const handleResize = (0, import_react34.useCallback)(() => {
|
|
2531
|
+
setResizing(true);
|
|
2532
|
+
if (resizeInterval.current) {
|
|
2533
|
+
clearTimeout(resizeInterval.current);
|
|
2534
|
+
}
|
|
2535
|
+
resizeInterval.current = setTimeout(() => {
|
|
2536
|
+
setResizing(false);
|
|
2537
|
+
resizeInterval.current = null;
|
|
2538
|
+
}, resizeDebounce);
|
|
2539
|
+
}, []);
|
|
2540
|
+
(0, import_react34.useEffect)(() => {
|
|
2541
|
+
window.addEventListener("resize", handleResize);
|
|
2542
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
2543
|
+
}, [
|
|
2544
|
+
handleResize
|
|
2545
|
+
]);
|
|
2546
|
+
return /* @__PURE__ */ import_react34.default.createElement(MainProvider, {
|
|
2547
|
+
...props,
|
|
2548
|
+
navigationSidebarState,
|
|
2549
|
+
setNavigationSidebarState,
|
|
2550
|
+
complementarySidebarState,
|
|
2551
|
+
setComplementarySidebarState,
|
|
2552
|
+
resizing
|
|
2553
|
+
}, children);
|
|
2554
|
+
} finally {
|
|
2555
|
+
_effect.f();
|
|
2556
|
+
}
|
|
2557
|
+
};
|
|
2558
|
+
MainRoot.displayName = MAIN_ROOT_NAME;
|
|
2559
|
+
var handleOpenAutoFocus = (event) => {
|
|
2560
|
+
!document.body.hasAttribute("data-is-keyboard") && event.preventDefault();
|
|
2561
|
+
};
|
|
2562
|
+
var MainSidebar = /* @__PURE__ */ (0, import_react34.forwardRef)(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
2563
|
+
var _effect = (0, import_tracking25.useSignals)();
|
|
2564
|
+
try {
|
|
2565
|
+
const [isLg] = (0, import_react_hooks4.useMediaQuery)("lg", {
|
|
2566
|
+
ssr: false
|
|
2567
|
+
});
|
|
2568
|
+
const { tx } = useThemeContext();
|
|
2569
|
+
const { t } = useTranslation();
|
|
2570
|
+
const ref = (0, import_react_hooks4.useForwardedRef)(forwardedRef);
|
|
2571
|
+
const noopRef = (0, import_react34.useRef)(null);
|
|
2572
|
+
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2573
|
+
onDismiss: () => onStateChange?.("closed")
|
|
2574
|
+
});
|
|
2575
|
+
const handleKeyDown = (0, import_react34.useCallback)((event) => {
|
|
2576
|
+
if (event.key === "Escape") {
|
|
2577
|
+
event.target.closest("[data-tabster]")?.focus();
|
|
2578
|
+
}
|
|
2579
|
+
props.onKeyDown?.(event);
|
|
2580
|
+
}, [
|
|
2581
|
+
props.onKeyDown
|
|
2582
|
+
]);
|
|
2583
|
+
const Root7 = isLg ? import_react_primitive8.Primitive.div : import_react_dialog2.DialogContent;
|
|
2584
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_react_dialog2.Root, {
|
|
2585
|
+
open: state !== "closed",
|
|
2586
|
+
"aria-label": toLocalizedString(label, t),
|
|
2587
|
+
modal: false
|
|
2588
|
+
}, !isLg && /* @__PURE__ */ import_react34.default.createElement(import_react_dialog2.DialogTitle, {
|
|
2589
|
+
className: "sr-only"
|
|
2590
|
+
}, toLocalizedString(label, t)), /* @__PURE__ */ import_react34.default.createElement(Root7, {
|
|
2591
|
+
...!isLg && {
|
|
2592
|
+
forceMount: true,
|
|
2593
|
+
tabIndex: -1,
|
|
2594
|
+
onOpenAutoFocus: onOpenAutoFocus ?? handleOpenAutoFocus
|
|
2595
|
+
},
|
|
2596
|
+
...props,
|
|
2597
|
+
"data-side": side === "inline-end" ? "ie" : "is",
|
|
2598
|
+
"data-state": state,
|
|
2599
|
+
"data-resizing": resizing ? "true" : "false",
|
|
2600
|
+
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
2601
|
+
onKeyDown: handleKeyDown,
|
|
2602
|
+
...state === "closed" && {
|
|
2603
|
+
inert: "true"
|
|
2604
|
+
},
|
|
2605
|
+
ref
|
|
2606
|
+
}, children));
|
|
2607
|
+
} finally {
|
|
2608
|
+
_effect.f();
|
|
2609
|
+
}
|
|
2610
|
+
});
|
|
2611
|
+
var MainNavigationSidebar = /* @__PURE__ */ (0, import_react34.forwardRef)((props, forwardedRef) => {
|
|
2612
|
+
var _effect = (0, import_tracking25.useSignals)();
|
|
2613
|
+
try {
|
|
2614
|
+
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
2615
|
+
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
2616
|
+
return /* @__PURE__ */ import_react34.default.createElement(MainSidebar, {
|
|
2617
|
+
...mover,
|
|
2618
|
+
...props,
|
|
2619
|
+
state: navigationSidebarState,
|
|
2620
|
+
onStateChange: setNavigationSidebarState,
|
|
2621
|
+
resizing,
|
|
2622
|
+
side: "inline-start",
|
|
2623
|
+
ref: forwardedRef
|
|
2624
|
+
});
|
|
2625
|
+
} finally {
|
|
2626
|
+
_effect.f();
|
|
2627
|
+
}
|
|
2628
|
+
});
|
|
2629
|
+
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2630
|
+
var MainComplementarySidebar = /* @__PURE__ */ (0, import_react34.forwardRef)((props, forwardedRef) => {
|
|
2631
|
+
var _effect = (0, import_tracking25.useSignals)();
|
|
2632
|
+
try {
|
|
2633
|
+
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
2634
|
+
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
2635
|
+
return /* @__PURE__ */ import_react34.default.createElement(MainSidebar, {
|
|
2636
|
+
...mover,
|
|
2637
|
+
...props,
|
|
2638
|
+
state: complementarySidebarState,
|
|
2639
|
+
onStateChange: setComplementarySidebarState,
|
|
2640
|
+
resizing,
|
|
2641
|
+
side: "inline-end",
|
|
2642
|
+
ref: forwardedRef
|
|
2643
|
+
});
|
|
2644
|
+
} finally {
|
|
2645
|
+
_effect.f();
|
|
2646
|
+
}
|
|
2647
|
+
});
|
|
2648
|
+
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2649
|
+
var MainContent = /* @__PURE__ */ (0, import_react34.forwardRef)(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
2650
|
+
var _effect = (0, import_tracking25.useSignals)();
|
|
2651
|
+
try {
|
|
2652
|
+
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2653
|
+
const { tx } = useThemeContext();
|
|
2654
|
+
const Root7 = asChild ? import_react_slot9.Slot : role ? "div" : "main";
|
|
2655
|
+
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
2656
|
+
return /* @__PURE__ */ import_react34.default.createElement(Root7, {
|
|
2657
|
+
role,
|
|
2658
|
+
...handlesFocus && {
|
|
2659
|
+
...mover
|
|
2660
|
+
},
|
|
2661
|
+
...props,
|
|
2662
|
+
"data-sidebar-inline-start-state": navigationSidebarState,
|
|
2663
|
+
"data-sidebar-inline-end-state": complementarySidebarState,
|
|
2664
|
+
"data-handles-focus": handlesFocus,
|
|
2665
|
+
className: tx("main.content", "main", {
|
|
2666
|
+
bounce,
|
|
2667
|
+
handlesFocus
|
|
2668
|
+
}, classNames),
|
|
2669
|
+
ref: forwardedRef
|
|
2670
|
+
}, children);
|
|
2671
|
+
} finally {
|
|
2672
|
+
_effect.f();
|
|
2673
|
+
}
|
|
2674
|
+
});
|
|
2675
|
+
MainContent.displayName = MAIN_NAME;
|
|
2676
|
+
var MainOverlay = /* @__PURE__ */ (0, import_react34.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
2677
|
+
var _effect = (0, import_tracking25.useSignals)();
|
|
2678
|
+
try {
|
|
2679
|
+
const [isLg] = (0, import_react_hooks4.useMediaQuery)("lg", {
|
|
2680
|
+
ssr: false
|
|
2681
|
+
});
|
|
2682
|
+
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2683
|
+
const { tx } = useThemeContext();
|
|
2684
|
+
return /* @__PURE__ */ import_react34.default.createElement("div", {
|
|
2685
|
+
onClick: () => {
|
|
2686
|
+
setNavigationSidebarState("collapsed");
|
|
2687
|
+
setComplementarySidebarState("collapsed");
|
|
2688
|
+
},
|
|
2689
|
+
...props,
|
|
2690
|
+
className: tx("main.overlay", "main__overlay", {
|
|
2691
|
+
isLg,
|
|
2692
|
+
inlineStartSidebarOpen: navigationSidebarState,
|
|
2693
|
+
inlineEndSidebarOpen: complementarySidebarState
|
|
2694
|
+
}, classNames),
|
|
2695
|
+
"data-state": navigationSidebarState === "expanded" || complementarySidebarState === "expanded" ? "open" : "closed",
|
|
2696
|
+
"aria-hidden": "true",
|
|
2697
|
+
ref: forwardedRef
|
|
2698
|
+
});
|
|
2699
|
+
} finally {
|
|
2700
|
+
_effect.f();
|
|
2701
|
+
}
|
|
2702
|
+
});
|
|
2703
|
+
var Main = {
|
|
2704
|
+
Root: MainRoot,
|
|
2705
|
+
Content: MainContent,
|
|
2706
|
+
Overlay: MainOverlay,
|
|
2707
|
+
NavigationSidebar: MainNavigationSidebar,
|
|
2708
|
+
ComplementarySidebar: MainComplementarySidebar
|
|
2709
|
+
};
|
|
2710
|
+
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
2711
|
+
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
2712
|
+
var safePadding = (propsPadding, safePadding2, side) => {
|
|
2713
|
+
return (propIsNumber(safePadding2[side]) ? safePadding2[side] : 0) + (propIsNumber(propsPadding) ? propsPadding : propsIsRecord(propsPadding) ? propsPadding[side] ?? 0 : 0);
|
|
2714
|
+
};
|
|
2715
|
+
var useSafeCollisionPadding = (collisionPadding) => {
|
|
2716
|
+
const { safeAreaPadding } = useThemeContext();
|
|
2717
|
+
return (0, import_react37.useMemo)(() => ({
|
|
2718
|
+
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
2719
|
+
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
2720
|
+
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
2721
|
+
left: safePadding(collisionPadding, safeAreaPadding, "left")
|
|
2722
|
+
}), [
|
|
2723
|
+
collisionPadding,
|
|
2724
|
+
safeAreaPadding
|
|
2725
|
+
]);
|
|
2726
|
+
};
|
|
2727
|
+
var ContextMenuRoot = ContextMenuPrimitive.ContextMenu;
|
|
2728
|
+
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
2729
|
+
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
2730
|
+
var ContextMenuContent = /* @__PURE__ */ (0, import_react36.forwardRef)(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
2731
|
+
var _effect = (0, import_tracking26.useSignals)();
|
|
2732
|
+
try {
|
|
2733
|
+
const { tx } = useThemeContext();
|
|
2734
|
+
const elevation = useElevationContext();
|
|
2735
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2736
|
+
return /* @__PURE__ */ import_react36.default.createElement(ContextMenuPrimitive.Content, {
|
|
2737
|
+
...props,
|
|
2738
|
+
collisionPadding: safeCollisionPadding,
|
|
2739
|
+
className: tx("menu.content", "menu", {
|
|
2740
|
+
elevation
|
|
2741
|
+
}, classNames),
|
|
2742
|
+
ref: forwardedRef
|
|
2743
|
+
}, children);
|
|
2744
|
+
} finally {
|
|
2745
|
+
_effect.f();
|
|
2746
|
+
}
|
|
2747
|
+
});
|
|
2748
|
+
var ContextMenuViewport = /* @__PURE__ */ (0, import_react36.forwardRef)(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
2749
|
+
var _effect = (0, import_tracking26.useSignals)();
|
|
2750
|
+
try {
|
|
2751
|
+
const { tx } = useThemeContext();
|
|
2752
|
+
const Root7 = asChild ? import_react_slot10.Slot : import_react_primitive9.Primitive.div;
|
|
2753
|
+
return /* @__PURE__ */ import_react36.default.createElement(Root7, {
|
|
2754
|
+
...props,
|
|
2755
|
+
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
2756
|
+
ref: forwardedRef
|
|
2757
|
+
}, children);
|
|
2758
|
+
} finally {
|
|
2759
|
+
_effect.f();
|
|
2760
|
+
}
|
|
2761
|
+
});
|
|
2762
|
+
var ContextMenuArrow = /* @__PURE__ */ (0, import_react36.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
2763
|
+
var _effect = (0, import_tracking26.useSignals)();
|
|
2764
|
+
try {
|
|
2765
|
+
const { tx } = useThemeContext();
|
|
2766
|
+
return /* @__PURE__ */ import_react36.default.createElement(ContextMenuPrimitive.Arrow, {
|
|
2767
|
+
...props,
|
|
2768
|
+
className: tx("menu.arrow", "menu__arrow", {}, classNames),
|
|
2769
|
+
ref: forwardedRef
|
|
2770
|
+
});
|
|
2771
|
+
} finally {
|
|
2772
|
+
_effect.f();
|
|
2773
|
+
}
|
|
2774
|
+
});
|
|
2775
|
+
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
2776
|
+
var ContextMenuItemIndicator = ContextMenuPrimitive.ItemIndicator;
|
|
2777
|
+
var ContextMenuItem = /* @__PURE__ */ (0, import_react36.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
2778
|
+
var _effect = (0, import_tracking26.useSignals)();
|
|
2779
|
+
try {
|
|
2780
|
+
const { tx } = useThemeContext();
|
|
2781
|
+
return /* @__PURE__ */ import_react36.default.createElement(ContextMenuPrimitive.Item, {
|
|
2782
|
+
...props,
|
|
2783
|
+
className: tx("menu.item", "menu__item", {}, classNames),
|
|
2784
|
+
ref: forwardedRef
|
|
2785
|
+
});
|
|
2786
|
+
} finally {
|
|
2787
|
+
_effect.f();
|
|
2788
|
+
}
|
|
2789
|
+
});
|
|
2790
|
+
var ContextMenuCheckboxItem = /* @__PURE__ */ (0, import_react36.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
2791
|
+
var _effect = (0, import_tracking26.useSignals)();
|
|
2792
|
+
try {
|
|
2793
|
+
const { tx } = useThemeContext();
|
|
2794
|
+
return /* @__PURE__ */ import_react36.default.createElement(ContextMenuPrimitive.CheckboxItem, {
|
|
2795
|
+
...props,
|
|
2796
|
+
className: tx("menu.item", "menu__item--checkbox", {}, classNames),
|
|
2797
|
+
ref: forwardedRef
|
|
2798
|
+
});
|
|
2799
|
+
} finally {
|
|
2800
|
+
_effect.f();
|
|
2801
|
+
}
|
|
2802
|
+
});
|
|
2803
|
+
var ContextMenuSeparator = /* @__PURE__ */ (0, import_react36.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
2804
|
+
var _effect = (0, import_tracking26.useSignals)();
|
|
2805
|
+
try {
|
|
2806
|
+
const { tx } = useThemeContext();
|
|
2807
|
+
return /* @__PURE__ */ import_react36.default.createElement(ContextMenuPrimitive.Separator, {
|
|
2808
|
+
...props,
|
|
2809
|
+
className: tx("menu.separator", "menu__item", {}, classNames),
|
|
2810
|
+
ref: forwardedRef
|
|
2811
|
+
});
|
|
2812
|
+
} finally {
|
|
2813
|
+
_effect.f();
|
|
2814
|
+
}
|
|
2815
|
+
});
|
|
2816
|
+
var ContextMenuGroupLabel = /* @__PURE__ */ (0, import_react36.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
2817
|
+
var _effect = (0, import_tracking26.useSignals)();
|
|
2818
|
+
try {
|
|
2819
|
+
const { tx } = useThemeContext();
|
|
2820
|
+
return /* @__PURE__ */ import_react36.default.createElement(ContextMenuPrimitive.Label, {
|
|
2821
|
+
...props,
|
|
2822
|
+
className: tx("menu.groupLabel", "menu__group__label", {}, classNames),
|
|
2823
|
+
ref: forwardedRef
|
|
2824
|
+
});
|
|
2825
|
+
} finally {
|
|
2826
|
+
_effect.f();
|
|
2827
|
+
}
|
|
2828
|
+
});
|
|
2829
|
+
var ContextMenu2 = {
|
|
2830
|
+
Root: ContextMenuRoot,
|
|
2831
|
+
Trigger: ContextMenuTrigger,
|
|
2832
|
+
Portal: ContextMenuPortal,
|
|
2833
|
+
Content: ContextMenuContent,
|
|
2834
|
+
Viewport: ContextMenuViewport,
|
|
2835
|
+
Arrow: ContextMenuArrow,
|
|
2836
|
+
Group: ContextMenuGroup,
|
|
2837
|
+
Item: ContextMenuItem,
|
|
2838
|
+
CheckboxItem: ContextMenuCheckboxItem,
|
|
2839
|
+
ItemIndicator: ContextMenuItemIndicator,
|
|
2840
|
+
Separator: ContextMenuSeparator,
|
|
2841
|
+
GroupLabel: ContextMenuGroupLabel
|
|
2842
|
+
};
|
|
2843
|
+
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
2844
|
+
var [createDropdownMenuContext, createDropdownMenuScope] = (0, import_react_context8.createContextScope)(DROPDOWN_MENU_NAME, [
|
|
2845
|
+
import_react_menu.createMenuScope
|
|
2846
|
+
]);
|
|
2847
|
+
var useMenuScope = (0, import_react_menu.createMenuScope)();
|
|
2848
|
+
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
2849
|
+
var DropdownMenuRoot = (props) => {
|
|
2850
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
2851
|
+
try {
|
|
2852
|
+
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
2853
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2854
|
+
const triggerRef = (0, import_react38.useRef)(null);
|
|
2855
|
+
const [open = false, setOpen] = (0, import_react_use_controllable_state5.useControllableState)({
|
|
2856
|
+
prop: openProp,
|
|
2857
|
+
defaultProp: defaultOpen,
|
|
2858
|
+
onChange: onOpenChange
|
|
2859
|
+
});
|
|
2860
|
+
return /* @__PURE__ */ import_react38.default.createElement(DropdownMenuProvider, {
|
|
2861
|
+
scope: __scopeDropdownMenu,
|
|
2862
|
+
triggerId: (0, import_react_id2.useId)(),
|
|
2863
|
+
triggerRef,
|
|
2864
|
+
contentId: (0, import_react_id2.useId)(),
|
|
2865
|
+
open,
|
|
2866
|
+
onOpenChange: setOpen,
|
|
2867
|
+
onOpenToggle: (0, import_react38.useCallback)(() => setOpen((prevOpen) => !prevOpen), [
|
|
2868
|
+
setOpen
|
|
2869
|
+
]),
|
|
2870
|
+
modal
|
|
2871
|
+
}, /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Root, {
|
|
2872
|
+
...menuScope,
|
|
2873
|
+
open,
|
|
2874
|
+
onOpenChange: setOpen,
|
|
2875
|
+
dir,
|
|
2876
|
+
modal
|
|
2877
|
+
}, children));
|
|
2878
|
+
} finally {
|
|
2879
|
+
_effect.f();
|
|
2880
|
+
}
|
|
2881
|
+
};
|
|
2882
|
+
DropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;
|
|
2883
|
+
var TRIGGER_NAME2 = "DropdownMenuTrigger";
|
|
2884
|
+
var DropdownMenuTrigger = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
2885
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
2886
|
+
try {
|
|
2887
|
+
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
2888
|
+
const context = useDropdownMenuContext(TRIGGER_NAME2, __scopeDropdownMenu);
|
|
2889
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2890
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Anchor, {
|
|
2891
|
+
asChild: true,
|
|
2892
|
+
...menuScope
|
|
2893
|
+
}, /* @__PURE__ */ import_react38.default.createElement(import_react_primitive10.Primitive.button, {
|
|
2894
|
+
type: "button",
|
|
2895
|
+
id: context.triggerId,
|
|
2896
|
+
"aria-haspopup": "menu",
|
|
2897
|
+
"aria-expanded": context.open,
|
|
2898
|
+
"aria-controls": context.open ? context.contentId : void 0,
|
|
2899
|
+
"data-state": context.open ? "open" : "closed",
|
|
2900
|
+
"data-disabled": disabled ? "" : void 0,
|
|
2901
|
+
disabled,
|
|
2902
|
+
...triggerProps,
|
|
2903
|
+
ref: (0, import_react_compose_refs2.composeRefs)(forwardedRef, context.triggerRef),
|
|
2904
|
+
onPointerDown: (0, import_primitive2.composeEventHandlers)(props.onPointerDown, (event) => {
|
|
2905
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
2906
|
+
context.onOpenToggle();
|
|
2907
|
+
if (!context.open) {
|
|
2908
|
+
event.preventDefault();
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
}),
|
|
2912
|
+
onKeyDown: (0, import_primitive2.composeEventHandlers)(props.onKeyDown, (event) => {
|
|
2913
|
+
if (disabled) {
|
|
2914
|
+
return;
|
|
2915
|
+
}
|
|
2916
|
+
if ([
|
|
2917
|
+
"Enter",
|
|
2918
|
+
" "
|
|
2919
|
+
].includes(event.key)) {
|
|
2920
|
+
context.onOpenToggle();
|
|
2921
|
+
}
|
|
2922
|
+
if (event.key === "ArrowDown") {
|
|
2923
|
+
context.onOpenChange(true);
|
|
2924
|
+
}
|
|
2925
|
+
if ([
|
|
2926
|
+
"Enter",
|
|
2927
|
+
" ",
|
|
2928
|
+
"ArrowDown"
|
|
2929
|
+
].includes(event.key)) {
|
|
2930
|
+
event.preventDefault();
|
|
2931
|
+
}
|
|
2932
|
+
})
|
|
2933
|
+
}));
|
|
2934
|
+
} finally {
|
|
2935
|
+
_effect.f();
|
|
2936
|
+
}
|
|
2937
|
+
});
|
|
2938
|
+
DropdownMenuTrigger.displayName = TRIGGER_NAME2;
|
|
2939
|
+
var VIRTUAL_TRIGGER_NAME = "DropdownMenuVirtualTrigger";
|
|
2940
|
+
var DropdownMenuVirtualTrigger = (props) => {
|
|
2941
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
2942
|
+
try {
|
|
2943
|
+
const { __scopeDropdownMenu, virtualRef } = props;
|
|
2944
|
+
const context = useDropdownMenuContext(VIRTUAL_TRIGGER_NAME, __scopeDropdownMenu);
|
|
2945
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2946
|
+
(0, import_react38.useEffect)(() => {
|
|
2947
|
+
if (virtualRef.current) {
|
|
2948
|
+
context.triggerRef.current = virtualRef.current;
|
|
2949
|
+
}
|
|
2950
|
+
});
|
|
2951
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Anchor, {
|
|
2952
|
+
...menuScope,
|
|
2953
|
+
virtualRef
|
|
2954
|
+
});
|
|
2955
|
+
} finally {
|
|
2956
|
+
_effect.f();
|
|
2957
|
+
}
|
|
2958
|
+
};
|
|
2959
|
+
DropdownMenuVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME;
|
|
2960
|
+
var PORTAL_NAME2 = "DropdownMenuPortal";
|
|
2961
|
+
var DropdownMenuPortal = (props) => {
|
|
2962
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
2963
|
+
try {
|
|
2964
|
+
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
2965
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2966
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Portal, {
|
|
2967
|
+
...menuScope,
|
|
2968
|
+
...portalProps
|
|
2969
|
+
});
|
|
2970
|
+
} finally {
|
|
2971
|
+
_effect.f();
|
|
2972
|
+
}
|
|
2973
|
+
};
|
|
2974
|
+
DropdownMenuPortal.displayName = PORTAL_NAME2;
|
|
2975
|
+
var DropdownMenuViewport = /* @__PURE__ */ (0, import_react38.forwardRef)(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
2976
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
2977
|
+
try {
|
|
2978
|
+
const { tx } = useThemeContext();
|
|
2979
|
+
const Root7 = asChild ? import_react_slot11.Slot : import_react_primitive10.Primitive.div;
|
|
2980
|
+
return /* @__PURE__ */ import_react38.default.createElement(Root7, {
|
|
2981
|
+
...props,
|
|
2982
|
+
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
2983
|
+
ref: forwardedRef
|
|
2984
|
+
}, children);
|
|
2985
|
+
} finally {
|
|
2986
|
+
_effect.f();
|
|
2987
|
+
}
|
|
2988
|
+
});
|
|
2989
|
+
var CONTENT_NAME2 = "DropdownMenuContent";
|
|
2990
|
+
var DropdownMenuContent = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
2991
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
2992
|
+
try {
|
|
2993
|
+
const { __scopeDropdownMenu, classNames, collisionPadding = 8, ...contentProps } = props;
|
|
2994
|
+
const { tx } = useThemeContext();
|
|
2995
|
+
const context = useDropdownMenuContext(CONTENT_NAME2, __scopeDropdownMenu);
|
|
2996
|
+
const elevation = useElevationContext();
|
|
2997
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2998
|
+
const hasInteractedOutsideRef = (0, import_react38.useRef)(false);
|
|
2999
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3000
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Content, {
|
|
3001
|
+
id: context.contentId,
|
|
3002
|
+
"aria-labelledby": context.triggerId,
|
|
3003
|
+
...menuScope,
|
|
3004
|
+
...contentProps,
|
|
3005
|
+
collisionPadding: safeCollisionPadding,
|
|
3006
|
+
ref: forwardedRef,
|
|
3007
|
+
onCloseAutoFocus: (0, import_primitive2.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
|
|
3008
|
+
if (!hasInteractedOutsideRef.current) {
|
|
3009
|
+
context.triggerRef.current?.focus();
|
|
3010
|
+
}
|
|
3011
|
+
hasInteractedOutsideRef.current = false;
|
|
3012
|
+
event.preventDefault();
|
|
3013
|
+
}),
|
|
3014
|
+
onInteractOutside: (0, import_primitive2.composeEventHandlers)(props.onInteractOutside, (event) => {
|
|
3015
|
+
const originalEvent = event.detail.originalEvent;
|
|
3016
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
3017
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
3018
|
+
if (!context.modal || isRightClick) {
|
|
3019
|
+
hasInteractedOutsideRef.current = true;
|
|
3020
|
+
}
|
|
3021
|
+
}),
|
|
3022
|
+
className: tx("menu.content", "menu", {
|
|
3023
|
+
elevation
|
|
3024
|
+
}, classNames),
|
|
3025
|
+
style: {
|
|
3026
|
+
...props.style,
|
|
3027
|
+
// re-namespace exposed content custom properties
|
|
3028
|
+
...{
|
|
3029
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3030
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
3031
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
3032
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
3033
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
});
|
|
3037
|
+
} finally {
|
|
3038
|
+
_effect.f();
|
|
3039
|
+
}
|
|
3040
|
+
});
|
|
3041
|
+
DropdownMenuContent.displayName = CONTENT_NAME2;
|
|
3042
|
+
var GROUP_NAME = "DropdownMenuGroup";
|
|
3043
|
+
var DropdownMenuGroup = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3044
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3045
|
+
try {
|
|
3046
|
+
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
3047
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3048
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Group, {
|
|
3049
|
+
...menuScope,
|
|
3050
|
+
...groupProps,
|
|
3051
|
+
ref: forwardedRef
|
|
3052
|
+
});
|
|
3053
|
+
} finally {
|
|
3054
|
+
_effect.f();
|
|
3055
|
+
}
|
|
3056
|
+
});
|
|
3057
|
+
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
3058
|
+
var LABEL_NAME = "DropdownMenuLabel";
|
|
3059
|
+
var DropdownMenuGroupLabel = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3060
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3061
|
+
try {
|
|
3062
|
+
const { __scopeDropdownMenu, classNames, ...labelProps } = props;
|
|
3063
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3064
|
+
const { tx } = useThemeContext();
|
|
3065
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Label, {
|
|
3066
|
+
...menuScope,
|
|
3067
|
+
...labelProps,
|
|
3068
|
+
className: tx("menu.groupLabel", "menu__group__label", {}, classNames),
|
|
3069
|
+
ref: forwardedRef
|
|
3070
|
+
});
|
|
3071
|
+
} finally {
|
|
3072
|
+
_effect.f();
|
|
3073
|
+
}
|
|
3074
|
+
});
|
|
3075
|
+
DropdownMenuGroupLabel.displayName = LABEL_NAME;
|
|
3076
|
+
var ITEM_NAME = "DropdownMenuItem";
|
|
3077
|
+
var DropdownMenuItem = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3078
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3079
|
+
try {
|
|
3080
|
+
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
3081
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3082
|
+
const { tx } = useThemeContext();
|
|
3083
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Item, {
|
|
3084
|
+
...menuScope,
|
|
3085
|
+
...itemProps,
|
|
3086
|
+
className: tx("menu.item", "menu__item", {}, classNames),
|
|
3087
|
+
ref: forwardedRef
|
|
3088
|
+
});
|
|
3089
|
+
} finally {
|
|
3090
|
+
_effect.f();
|
|
3091
|
+
}
|
|
3092
|
+
});
|
|
3093
|
+
DropdownMenuItem.displayName = ITEM_NAME;
|
|
3094
|
+
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
3095
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3096
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3097
|
+
try {
|
|
3098
|
+
const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;
|
|
3099
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3100
|
+
const { tx } = useThemeContext();
|
|
3101
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.CheckboxItem, {
|
|
3102
|
+
...menuScope,
|
|
3103
|
+
...checkboxItemProps,
|
|
3104
|
+
className: tx("menu.item", "menu__item--checkbox", {}, classNames),
|
|
3105
|
+
ref: forwardedRef
|
|
3106
|
+
});
|
|
3107
|
+
} finally {
|
|
3108
|
+
_effect.f();
|
|
3109
|
+
}
|
|
3110
|
+
});
|
|
3111
|
+
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
3112
|
+
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
3113
|
+
var DropdownMenuRadioGroup = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3114
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3115
|
+
try {
|
|
3116
|
+
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
3117
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3118
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.RadioGroup, {
|
|
3119
|
+
...menuScope,
|
|
3120
|
+
...radioGroupProps,
|
|
3121
|
+
ref: forwardedRef
|
|
3122
|
+
});
|
|
3123
|
+
} finally {
|
|
3124
|
+
_effect.f();
|
|
3125
|
+
}
|
|
3126
|
+
});
|
|
3127
|
+
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
3128
|
+
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
3129
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3130
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3131
|
+
try {
|
|
3132
|
+
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
3133
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3134
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.RadioItem, {
|
|
3135
|
+
...menuScope,
|
|
3136
|
+
...radioItemProps,
|
|
3137
|
+
ref: forwardedRef
|
|
3138
|
+
});
|
|
3139
|
+
} finally {
|
|
3140
|
+
_effect.f();
|
|
3141
|
+
}
|
|
3142
|
+
});
|
|
3143
|
+
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
3144
|
+
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
3145
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3146
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3147
|
+
try {
|
|
3148
|
+
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
3149
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3150
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.ItemIndicator, {
|
|
3151
|
+
...menuScope,
|
|
3152
|
+
...itemIndicatorProps,
|
|
3153
|
+
ref: forwardedRef
|
|
3154
|
+
});
|
|
3155
|
+
} finally {
|
|
3156
|
+
_effect.f();
|
|
3157
|
+
}
|
|
3158
|
+
});
|
|
3159
|
+
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
3160
|
+
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
3161
|
+
var DropdownMenuSeparator = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3162
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3163
|
+
try {
|
|
3164
|
+
const { __scopeDropdownMenu, classNames, ...separatorProps } = props;
|
|
3165
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3166
|
+
const { tx } = useThemeContext();
|
|
3167
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Separator, {
|
|
3168
|
+
...menuScope,
|
|
3169
|
+
...separatorProps,
|
|
3170
|
+
className: tx("menu.separator", "menu__item", {}, classNames),
|
|
3171
|
+
ref: forwardedRef
|
|
3172
|
+
});
|
|
3173
|
+
} finally {
|
|
3174
|
+
_effect.f();
|
|
3175
|
+
}
|
|
3176
|
+
});
|
|
3177
|
+
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
3178
|
+
var ARROW_NAME2 = "DropdownMenuArrow";
|
|
3179
|
+
var DropdownMenuArrow = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3180
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3181
|
+
try {
|
|
3182
|
+
const { __scopeDropdownMenu, classNames, ...arrowProps } = props;
|
|
3183
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3184
|
+
const { tx } = useThemeContext();
|
|
3185
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Arrow, {
|
|
3186
|
+
...menuScope,
|
|
3187
|
+
...arrowProps,
|
|
3188
|
+
className: tx("menu.arrow", "menu__arrow", {}, classNames),
|
|
3189
|
+
ref: forwardedRef
|
|
3190
|
+
});
|
|
3191
|
+
} finally {
|
|
3192
|
+
_effect.f();
|
|
3193
|
+
}
|
|
3194
|
+
});
|
|
3195
|
+
DropdownMenuArrow.displayName = ARROW_NAME2;
|
|
3196
|
+
var DropdownMenuSub = (props) => {
|
|
3197
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3198
|
+
try {
|
|
3199
|
+
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
3200
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3201
|
+
const [open = false, setOpen] = (0, import_react_use_controllable_state5.useControllableState)({
|
|
3202
|
+
prop: openProp,
|
|
3203
|
+
defaultProp: defaultOpen,
|
|
3204
|
+
onChange: onOpenChange
|
|
3205
|
+
});
|
|
3206
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.Sub, {
|
|
3207
|
+
...menuScope,
|
|
3208
|
+
open,
|
|
3209
|
+
onOpenChange: setOpen
|
|
3210
|
+
}, children);
|
|
3211
|
+
} finally {
|
|
3212
|
+
_effect.f();
|
|
3213
|
+
}
|
|
3214
|
+
};
|
|
3215
|
+
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
3216
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3217
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3218
|
+
try {
|
|
3219
|
+
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
3220
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3221
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.SubTrigger, {
|
|
3222
|
+
...menuScope,
|
|
3223
|
+
...subTriggerProps,
|
|
3224
|
+
ref: forwardedRef
|
|
3225
|
+
});
|
|
3226
|
+
} finally {
|
|
3227
|
+
_effect.f();
|
|
3228
|
+
}
|
|
3229
|
+
});
|
|
3230
|
+
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
3231
|
+
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
3232
|
+
var DropdownMenuSubContent = /* @__PURE__ */ (0, import_react38.forwardRef)((props, forwardedRef) => {
|
|
3233
|
+
var _effect = (0, import_tracking27.useSignals)();
|
|
3234
|
+
try {
|
|
3235
|
+
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
3236
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3237
|
+
return /* @__PURE__ */ import_react38.default.createElement(MenuPrimitive.SubContent, {
|
|
3238
|
+
...menuScope,
|
|
3239
|
+
...subContentProps,
|
|
3240
|
+
ref: forwardedRef,
|
|
3241
|
+
style: {
|
|
3242
|
+
...props.style,
|
|
3243
|
+
// re-namespace exposed content custom properties
|
|
3244
|
+
...{
|
|
3245
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3246
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
3247
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
3248
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
3249
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
});
|
|
3253
|
+
} finally {
|
|
3254
|
+
_effect.f();
|
|
3255
|
+
}
|
|
3256
|
+
});
|
|
3257
|
+
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
3258
|
+
var DropdownMenu = {
|
|
3259
|
+
Root: DropdownMenuRoot,
|
|
3260
|
+
Trigger: DropdownMenuTrigger,
|
|
3261
|
+
VirtualTrigger: DropdownMenuVirtualTrigger,
|
|
3262
|
+
Portal: DropdownMenuPortal,
|
|
3263
|
+
Content: DropdownMenuContent,
|
|
3264
|
+
Viewport: DropdownMenuViewport,
|
|
3265
|
+
Group: DropdownMenuGroup,
|
|
3266
|
+
GroupLabel: DropdownMenuGroupLabel,
|
|
3267
|
+
Item: DropdownMenuItem,
|
|
3268
|
+
CheckboxItem: DropdownMenuCheckboxItem,
|
|
3269
|
+
RadioGroup: DropdownMenuRadioGroup,
|
|
3270
|
+
RadioItem: DropdownMenuRadioItem,
|
|
3271
|
+
ItemIndicator: DropdownMenuItemIndicator,
|
|
3272
|
+
Separator: DropdownMenuSeparator,
|
|
3273
|
+
Arrow: DropdownMenuArrow,
|
|
3274
|
+
Sub: DropdownMenuSub,
|
|
3275
|
+
SubTrigger: DropdownMenuSubTrigger,
|
|
3276
|
+
SubContent: DropdownMenuSubContent
|
|
3277
|
+
};
|
|
3278
|
+
var useDropdownMenuMenuScope = useMenuScope;
|
|
3279
|
+
var MESSAGE_NAME = "Message";
|
|
3280
|
+
var [MessageProvider, useMessageContext] = (0, import_react_context9.createContext)(MESSAGE_NAME);
|
|
3281
|
+
var MessageRoot = /* @__PURE__ */ (0, import_react39.forwardRef)(({ asChild, valence, elevation: propsElevation, className, titleId: propsTitleId, descriptionId: propsDescriptionId, children, ...props }, forwardedRef) => {
|
|
3282
|
+
var _effect = (0, import_tracking28.useSignals)();
|
|
3283
|
+
try {
|
|
3284
|
+
const { tx } = useThemeContext();
|
|
3285
|
+
const titleId = (0, import_react_hooks5.useId)("message__title", propsTitleId);
|
|
3286
|
+
const descriptionId = (0, import_react_hooks5.useId)("message__description", propsDescriptionId);
|
|
3287
|
+
const elevation = useElevationContext(propsElevation);
|
|
3288
|
+
const Root7 = asChild ? import_react_slot12.Slot : import_react_primitive11.Primitive.div;
|
|
3289
|
+
return /* @__PURE__ */ import_react39.default.createElement(MessageProvider, {
|
|
3290
|
+
titleId,
|
|
3291
|
+
descriptionId
|
|
3292
|
+
}, /* @__PURE__ */ import_react39.default.createElement(Root7, {
|
|
3293
|
+
...props,
|
|
3294
|
+
className: tx("message.root", "message", {
|
|
3295
|
+
valence,
|
|
3296
|
+
elevation
|
|
3297
|
+
}, className),
|
|
3298
|
+
"aria-labelledby": titleId,
|
|
3299
|
+
"aria-describedby": descriptionId,
|
|
3300
|
+
ref: forwardedRef
|
|
3301
|
+
}, children));
|
|
3302
|
+
} finally {
|
|
3303
|
+
_effect.f();
|
|
3304
|
+
}
|
|
3305
|
+
});
|
|
3306
|
+
MessageRoot.displayName = MESSAGE_NAME;
|
|
3307
|
+
var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
3308
|
+
var MessageTitle = /* @__PURE__ */ (0, import_react39.forwardRef)(({ asChild, className, children, ...props }, forwardedRef) => {
|
|
3309
|
+
var _effect = (0, import_tracking28.useSignals)();
|
|
3310
|
+
try {
|
|
3311
|
+
const { tx } = useThemeContext();
|
|
3312
|
+
const { titleId } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3313
|
+
const Root7 = asChild ? import_react_slot12.Slot : import_react_primitive11.Primitive.h2;
|
|
3314
|
+
return /* @__PURE__ */ import_react39.default.createElement(Root7, {
|
|
3315
|
+
...props,
|
|
3316
|
+
className: tx("message.title", "message__title", {}, className),
|
|
3317
|
+
id: titleId,
|
|
3318
|
+
ref: forwardedRef
|
|
3319
|
+
}, children);
|
|
3320
|
+
} finally {
|
|
3321
|
+
_effect.f();
|
|
3322
|
+
}
|
|
3323
|
+
});
|
|
3324
|
+
MessageTitle.displayName = MESSAGE_TITLE_NAME;
|
|
3325
|
+
var MESSAGE_BODY_NAME = "MessageBody";
|
|
3326
|
+
var MessageBody = /* @__PURE__ */ (0, import_react39.forwardRef)(({ asChild, className, children, ...props }, forwardedRef) => {
|
|
3327
|
+
var _effect = (0, import_tracking28.useSignals)();
|
|
3328
|
+
try {
|
|
3329
|
+
const { tx } = useThemeContext();
|
|
3330
|
+
const { descriptionId } = useMessageContext(MESSAGE_BODY_NAME);
|
|
3331
|
+
const Root7 = asChild ? import_react_slot12.Slot : import_react_primitive11.Primitive.p;
|
|
3332
|
+
return /* @__PURE__ */ import_react39.default.createElement(Root7, {
|
|
3333
|
+
...props,
|
|
3334
|
+
className: tx("message.body", "message__body", {}, className),
|
|
3335
|
+
id: descriptionId,
|
|
3336
|
+
ref: forwardedRef
|
|
3337
|
+
}, children);
|
|
3338
|
+
} finally {
|
|
3339
|
+
_effect.f();
|
|
3340
|
+
}
|
|
3341
|
+
});
|
|
3342
|
+
MessageBody.displayName = MESSAGE_BODY_NAME;
|
|
3343
|
+
var Message = {
|
|
3344
|
+
Root: MessageRoot,
|
|
3345
|
+
Title: MessageTitle,
|
|
3346
|
+
Body: MessageBody
|
|
3347
|
+
};
|
|
3348
|
+
var POPOVER_NAME = "Popover";
|
|
3349
|
+
var [createPopoverContext, createPopoverScope] = (0, import_react_context10.createContextScope)(POPOVER_NAME, [
|
|
3350
|
+
import_react_popper2.createPopperScope
|
|
3351
|
+
]);
|
|
3352
|
+
var usePopperScope2 = (0, import_react_popper2.createPopperScope)();
|
|
3353
|
+
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
3354
|
+
var PopoverRoot = (props) => {
|
|
3355
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3356
|
+
try {
|
|
3357
|
+
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
3358
|
+
const popperScope = usePopperScope2(__scopePopover);
|
|
3359
|
+
const triggerRef = (0, import_react40.useRef)(null);
|
|
3360
|
+
const [hasCustomAnchor, setHasCustomAnchor] = (0, import_react40.useState)(false);
|
|
3361
|
+
const [open = false, setOpen] = (0, import_react_use_controllable_state6.useControllableState)({
|
|
3362
|
+
prop: openProp,
|
|
3363
|
+
defaultProp: defaultOpen,
|
|
3364
|
+
onChange: onOpenChange
|
|
3365
|
+
});
|
|
3366
|
+
return /* @__PURE__ */ import_react40.default.createElement(PopperPrimitive2.Root, popperScope, /* @__PURE__ */ import_react40.default.createElement(PopoverProvider, {
|
|
3367
|
+
scope: __scopePopover,
|
|
3368
|
+
contentId: (0, import_react_id3.useId)(),
|
|
3369
|
+
triggerRef,
|
|
3370
|
+
open,
|
|
3371
|
+
onOpenChange: setOpen,
|
|
3372
|
+
onOpenToggle: (0, import_react40.useCallback)(() => setOpen((prevOpen) => !prevOpen), [
|
|
3373
|
+
setOpen
|
|
3374
|
+
]),
|
|
3375
|
+
hasCustomAnchor,
|
|
3376
|
+
onCustomAnchorAdd: (0, import_react40.useCallback)(() => setHasCustomAnchor(true), []),
|
|
3377
|
+
onCustomAnchorRemove: (0, import_react40.useCallback)(() => setHasCustomAnchor(false), []),
|
|
3378
|
+
modal
|
|
3379
|
+
}, children));
|
|
3380
|
+
} finally {
|
|
3381
|
+
_effect.f();
|
|
3382
|
+
}
|
|
3383
|
+
};
|
|
3384
|
+
PopoverRoot.displayName = POPOVER_NAME;
|
|
3385
|
+
var ANCHOR_NAME = "PopoverAnchor";
|
|
3386
|
+
var PopoverAnchor = /* @__PURE__ */ (0, import_react40.forwardRef)((props, forwardedRef) => {
|
|
3387
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3388
|
+
try {
|
|
3389
|
+
const { __scopePopover, ...anchorProps } = props;
|
|
3390
|
+
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
3391
|
+
const popperScope = usePopperScope2(__scopePopover);
|
|
3392
|
+
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
3393
|
+
(0, import_react40.useEffect)(() => {
|
|
3394
|
+
onCustomAnchorAdd();
|
|
3395
|
+
return () => onCustomAnchorRemove();
|
|
3396
|
+
}, [
|
|
3397
|
+
onCustomAnchorAdd,
|
|
3398
|
+
onCustomAnchorRemove
|
|
3399
|
+
]);
|
|
3400
|
+
return /* @__PURE__ */ import_react40.default.createElement(PopperPrimitive2.Anchor, {
|
|
3401
|
+
...popperScope,
|
|
3402
|
+
...anchorProps,
|
|
3403
|
+
ref: forwardedRef
|
|
3404
|
+
});
|
|
3405
|
+
} finally {
|
|
3406
|
+
_effect.f();
|
|
3407
|
+
}
|
|
3408
|
+
});
|
|
3409
|
+
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
3410
|
+
var TRIGGER_NAME3 = "PopoverTrigger";
|
|
3411
|
+
var PopoverTrigger = /* @__PURE__ */ (0, import_react40.forwardRef)((props, forwardedRef) => {
|
|
3412
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3413
|
+
try {
|
|
3414
|
+
const { __scopePopover, ...triggerProps } = props;
|
|
3415
|
+
const context = usePopoverContext(TRIGGER_NAME3, __scopePopover);
|
|
3416
|
+
const popperScope = usePopperScope2(__scopePopover);
|
|
3417
|
+
const composedTriggerRef = (0, import_react_compose_refs3.useComposedRefs)(forwardedRef, context.triggerRef);
|
|
3418
|
+
const trigger = /* @__PURE__ */ import_react40.default.createElement(import_react_primitive12.Primitive.button, {
|
|
3419
|
+
type: "button",
|
|
3420
|
+
"aria-haspopup": "dialog",
|
|
3421
|
+
"aria-expanded": context.open,
|
|
3422
|
+
"aria-controls": context.contentId,
|
|
3423
|
+
"data-state": getState(context.open),
|
|
3424
|
+
...triggerProps,
|
|
3425
|
+
ref: composedTriggerRef,
|
|
3426
|
+
onClick: (0, import_primitive3.composeEventHandlers)(props.onClick, context.onOpenToggle)
|
|
3427
|
+
});
|
|
3428
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ import_react40.default.createElement(PopperPrimitive2.Anchor, {
|
|
3429
|
+
asChild: true,
|
|
3430
|
+
...popperScope
|
|
3431
|
+
}, trigger);
|
|
3432
|
+
} finally {
|
|
3433
|
+
_effect.f();
|
|
3434
|
+
}
|
|
3435
|
+
});
|
|
3436
|
+
PopoverTrigger.displayName = TRIGGER_NAME3;
|
|
3437
|
+
var VIRTUAL_TRIGGER_NAME2 = "PopoverVirtualTrigger";
|
|
3438
|
+
var PopoverVirtualTrigger = (props) => {
|
|
3439
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3440
|
+
try {
|
|
3441
|
+
const { __scopePopover, virtualRef } = props;
|
|
3442
|
+
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
3443
|
+
const popperScope = usePopperScope2(__scopePopover);
|
|
3444
|
+
(0, import_react40.useEffect)(() => {
|
|
3445
|
+
if (virtualRef.current) {
|
|
3446
|
+
context.triggerRef.current = virtualRef.current;
|
|
3447
|
+
}
|
|
3448
|
+
});
|
|
3449
|
+
return /* @__PURE__ */ import_react40.default.createElement(PopperPrimitive2.Anchor, {
|
|
3450
|
+
...popperScope,
|
|
3451
|
+
virtualRef
|
|
3452
|
+
});
|
|
3453
|
+
} finally {
|
|
3454
|
+
_effect.f();
|
|
3455
|
+
}
|
|
3456
|
+
};
|
|
3457
|
+
PopoverVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME2;
|
|
3458
|
+
var PORTAL_NAME3 = "PopoverPortal";
|
|
3459
|
+
var [PortalProvider2, usePortalContext2] = createPopoverContext(PORTAL_NAME3, {
|
|
3460
|
+
forceMount: void 0
|
|
3461
|
+
});
|
|
3462
|
+
var PopoverPortal = (props) => {
|
|
3463
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3464
|
+
try {
|
|
3465
|
+
const { __scopePopover, forceMount, children, container } = props;
|
|
3466
|
+
const context = usePopoverContext(PORTAL_NAME3, __scopePopover);
|
|
3467
|
+
return /* @__PURE__ */ import_react40.default.createElement(PortalProvider2, {
|
|
3468
|
+
scope: __scopePopover,
|
|
3469
|
+
forceMount
|
|
3470
|
+
}, /* @__PURE__ */ import_react40.default.createElement(import_react_presence2.Presence, {
|
|
3471
|
+
present: forceMount || context.open
|
|
3472
|
+
}, /* @__PURE__ */ import_react40.default.createElement(import_react_portal2.Portal, {
|
|
3473
|
+
asChild: true,
|
|
3474
|
+
container
|
|
3475
|
+
}, children)));
|
|
3476
|
+
} finally {
|
|
3477
|
+
_effect.f();
|
|
3478
|
+
}
|
|
3479
|
+
};
|
|
3480
|
+
PopoverPortal.displayName = PORTAL_NAME3;
|
|
3481
|
+
var CONTENT_NAME3 = "PopoverContent";
|
|
3482
|
+
var PopoverContent = /* @__PURE__ */ (0, import_react40.forwardRef)((props, forwardedRef) => {
|
|
3483
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3484
|
+
try {
|
|
3485
|
+
const portalContext = usePortalContext2(CONTENT_NAME3, props.__scopePopover);
|
|
3486
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
3487
|
+
const context = usePopoverContext(CONTENT_NAME3, props.__scopePopover);
|
|
3488
|
+
return /* @__PURE__ */ import_react40.default.createElement(import_react_presence2.Presence, {
|
|
3489
|
+
present: forceMount || context.open
|
|
3490
|
+
}, context.modal ? /* @__PURE__ */ import_react40.default.createElement(PopoverContentModal, {
|
|
3491
|
+
...contentProps,
|
|
3492
|
+
ref: forwardedRef
|
|
3493
|
+
}) : /* @__PURE__ */ import_react40.default.createElement(PopoverContentNonModal, {
|
|
3494
|
+
...contentProps,
|
|
3495
|
+
ref: forwardedRef
|
|
3496
|
+
}));
|
|
3497
|
+
} finally {
|
|
3498
|
+
_effect.f();
|
|
3499
|
+
}
|
|
3500
|
+
});
|
|
3501
|
+
PopoverContent.displayName = CONTENT_NAME3;
|
|
3502
|
+
var PopoverContentModal = /* @__PURE__ */ (0, import_react40.forwardRef)((props, forwardedRef) => {
|
|
3503
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3504
|
+
try {
|
|
3505
|
+
const context = usePopoverContext(CONTENT_NAME3, props.__scopePopover);
|
|
3506
|
+
const contentRef = (0, import_react40.useRef)(null);
|
|
3507
|
+
const composedRefs = (0, import_react_compose_refs3.useComposedRefs)(forwardedRef, contentRef);
|
|
3508
|
+
const isRightClickOutsideRef = (0, import_react40.useRef)(false);
|
|
3509
|
+
(0, import_react40.useEffect)(() => {
|
|
3510
|
+
const content = contentRef.current;
|
|
3511
|
+
if (content) {
|
|
3512
|
+
return (0, import_aria_hidden.hideOthers)(content);
|
|
3513
|
+
}
|
|
3514
|
+
}, []);
|
|
3515
|
+
return /* @__PURE__ */ import_react40.default.createElement(import_react_remove_scroll.RemoveScroll, {
|
|
3516
|
+
as: import_react_slot13.Slot,
|
|
3517
|
+
allowPinchZoom: true
|
|
3518
|
+
}, /* @__PURE__ */ import_react40.default.createElement(PopoverContentImpl, {
|
|
3519
|
+
...props,
|
|
3520
|
+
ref: composedRefs,
|
|
3521
|
+
// we make sure we're not trapping once it's been closed
|
|
3522
|
+
// (closed !== unmounted when animating out)
|
|
3523
|
+
trapFocus: context.open,
|
|
3524
|
+
disableOutsidePointerEvents: true,
|
|
3525
|
+
onCloseAutoFocus: (0, import_primitive3.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
|
|
3526
|
+
event.preventDefault();
|
|
3527
|
+
if (!isRightClickOutsideRef.current) {
|
|
3528
|
+
context.triggerRef.current?.focus();
|
|
3529
|
+
}
|
|
3530
|
+
}),
|
|
3531
|
+
onPointerDownOutside: (0, import_primitive3.composeEventHandlers)(props.onPointerDownOutside, (event) => {
|
|
3532
|
+
const originalEvent = event.detail.originalEvent;
|
|
3533
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
3534
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
3535
|
+
isRightClickOutsideRef.current = isRightClick;
|
|
3536
|
+
}, {
|
|
3537
|
+
checkForDefaultPrevented: false
|
|
3538
|
+
}),
|
|
3539
|
+
// When focus is trapped, a `focusout` event may still happen.
|
|
3540
|
+
// We make sure we don't trigger our `onDismiss` in such case.
|
|
3541
|
+
onFocusOutside: (0, import_primitive3.composeEventHandlers)(props.onFocusOutside, (event) => event.preventDefault(), {
|
|
3542
|
+
checkForDefaultPrevented: false
|
|
3543
|
+
})
|
|
3544
|
+
}));
|
|
3545
|
+
} finally {
|
|
3546
|
+
_effect.f();
|
|
3547
|
+
}
|
|
3548
|
+
});
|
|
3549
|
+
var PopoverContentNonModal = /* @__PURE__ */ (0, import_react40.forwardRef)((props, forwardedRef) => {
|
|
3550
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3551
|
+
try {
|
|
3552
|
+
const context = usePopoverContext(CONTENT_NAME3, props.__scopePopover);
|
|
3553
|
+
const hasInteractedOutsideRef = (0, import_react40.useRef)(false);
|
|
3554
|
+
const hasPointerDownOutsideRef = (0, import_react40.useRef)(false);
|
|
3555
|
+
return /* @__PURE__ */ import_react40.default.createElement(PopoverContentImpl, {
|
|
3556
|
+
...props,
|
|
3557
|
+
ref: forwardedRef,
|
|
3558
|
+
trapFocus: false,
|
|
3559
|
+
disableOutsidePointerEvents: false,
|
|
3560
|
+
onCloseAutoFocus: (event) => {
|
|
3561
|
+
props.onCloseAutoFocus?.(event);
|
|
3562
|
+
if (!event.defaultPrevented) {
|
|
3563
|
+
if (!hasInteractedOutsideRef.current) {
|
|
3564
|
+
context.triggerRef.current?.focus();
|
|
3565
|
+
}
|
|
3566
|
+
event.preventDefault();
|
|
3567
|
+
}
|
|
3568
|
+
hasInteractedOutsideRef.current = false;
|
|
3569
|
+
hasPointerDownOutsideRef.current = false;
|
|
3570
|
+
},
|
|
3571
|
+
onInteractOutside: (event) => {
|
|
3572
|
+
props.onInteractOutside?.(event);
|
|
3573
|
+
if (!event.defaultPrevented) {
|
|
3574
|
+
hasInteractedOutsideRef.current = true;
|
|
3575
|
+
if (event.detail.originalEvent.type === "pointerdown") {
|
|
3576
|
+
hasPointerDownOutsideRef.current = true;
|
|
3577
|
+
}
|
|
3578
|
+
}
|
|
3579
|
+
const target = event.target;
|
|
3580
|
+
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
|
3581
|
+
if (targetIsTrigger) {
|
|
3582
|
+
event.preventDefault();
|
|
3583
|
+
}
|
|
3584
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
3585
|
+
event.preventDefault();
|
|
3586
|
+
}
|
|
3587
|
+
}
|
|
3588
|
+
});
|
|
3589
|
+
} finally {
|
|
3590
|
+
_effect.f();
|
|
3591
|
+
}
|
|
3592
|
+
});
|
|
3593
|
+
var PopoverContentImpl = /* @__PURE__ */ (0, import_react40.forwardRef)((props, forwardedRef) => {
|
|
3594
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3595
|
+
try {
|
|
3596
|
+
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, classNames, ...contentProps } = props;
|
|
3597
|
+
const context = usePopoverContext(CONTENT_NAME3, __scopePopover);
|
|
3598
|
+
const popperScope = usePopperScope2(__scopePopover);
|
|
3599
|
+
const { tx } = useThemeContext();
|
|
3600
|
+
const elevation = useElevationContext();
|
|
3601
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3602
|
+
(0, import_react_focus_guards.useFocusGuards)();
|
|
3603
|
+
return /* @__PURE__ */ import_react40.default.createElement(import_react_focus_scope.FocusScope, {
|
|
3604
|
+
asChild: true,
|
|
3605
|
+
loop: true,
|
|
3606
|
+
trapped: trapFocus,
|
|
3607
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
3608
|
+
onUnmountAutoFocus: onCloseAutoFocus
|
|
3609
|
+
}, /* @__PURE__ */ import_react40.default.createElement(import_react_dismissable_layer2.DismissableLayer, {
|
|
3610
|
+
asChild: true,
|
|
3611
|
+
disableOutsidePointerEvents,
|
|
3612
|
+
onInteractOutside,
|
|
3613
|
+
onEscapeKeyDown,
|
|
3614
|
+
onPointerDownOutside,
|
|
3615
|
+
onFocusOutside,
|
|
3616
|
+
onDismiss: () => context.onOpenChange(false)
|
|
3617
|
+
}, /* @__PURE__ */ import_react40.default.createElement(PopperPrimitive2.Content, {
|
|
3618
|
+
"data-state": getState(context.open),
|
|
3619
|
+
role: "dialog",
|
|
3620
|
+
id: context.contentId,
|
|
3621
|
+
...popperScope,
|
|
3622
|
+
...contentProps,
|
|
3623
|
+
collisionPadding: safeCollisionPadding,
|
|
3624
|
+
className: tx("popover.content", "popover", {
|
|
3625
|
+
elevation
|
|
3626
|
+
}, classNames),
|
|
3627
|
+
ref: forwardedRef,
|
|
3628
|
+
style: {
|
|
3629
|
+
...contentProps.style,
|
|
3630
|
+
// re-namespace exposed content custom properties
|
|
3631
|
+
...{
|
|
3632
|
+
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3633
|
+
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
3634
|
+
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
3635
|
+
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
|
3636
|
+
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
|
3637
|
+
}
|
|
3638
|
+
}
|
|
3639
|
+
})));
|
|
3640
|
+
} finally {
|
|
3641
|
+
_effect.f();
|
|
3642
|
+
}
|
|
3643
|
+
});
|
|
3644
|
+
var CLOSE_NAME = "PopoverClose";
|
|
3645
|
+
var PopoverClose = /* @__PURE__ */ (0, import_react40.forwardRef)((props, forwardedRef) => {
|
|
3646
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3647
|
+
try {
|
|
3648
|
+
const { __scopePopover, ...closeProps } = props;
|
|
3649
|
+
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
3650
|
+
return /* @__PURE__ */ import_react40.default.createElement(import_react_primitive12.Primitive.button, {
|
|
3651
|
+
type: "button",
|
|
3652
|
+
...closeProps,
|
|
3653
|
+
ref: forwardedRef,
|
|
3654
|
+
onClick: (0, import_primitive3.composeEventHandlers)(props.onClick, () => context.onOpenChange(false))
|
|
3655
|
+
});
|
|
3656
|
+
} finally {
|
|
3657
|
+
_effect.f();
|
|
3658
|
+
}
|
|
3659
|
+
});
|
|
3660
|
+
PopoverClose.displayName = CLOSE_NAME;
|
|
3661
|
+
var ARROW_NAME3 = "PopoverArrow";
|
|
3662
|
+
var PopoverArrow = /* @__PURE__ */ (0, import_react40.forwardRef)((props, forwardedRef) => {
|
|
3663
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3664
|
+
try {
|
|
3665
|
+
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
3666
|
+
const popperScope = usePopperScope2(__scopePopover);
|
|
3667
|
+
const { tx } = useThemeContext();
|
|
3668
|
+
return /* @__PURE__ */ import_react40.default.createElement(PopperPrimitive2.Arrow, {
|
|
3669
|
+
...popperScope,
|
|
3670
|
+
...arrowProps,
|
|
3671
|
+
className: tx("popover.arrow", "popover__arrow", {}, classNames),
|
|
3672
|
+
ref: forwardedRef
|
|
3673
|
+
});
|
|
3674
|
+
} finally {
|
|
3675
|
+
_effect.f();
|
|
3676
|
+
}
|
|
3677
|
+
});
|
|
3678
|
+
PopoverArrow.displayName = ARROW_NAME3;
|
|
3679
|
+
var PopoverViewport = /* @__PURE__ */ (0, import_react40.forwardRef)(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
3680
|
+
var _effect = (0, import_tracking29.useSignals)();
|
|
3681
|
+
try {
|
|
3682
|
+
const { tx } = useThemeContext();
|
|
3683
|
+
const Root7 = asChild ? import_react_slot13.Slot : import_react_primitive12.Primitive.div;
|
|
3684
|
+
return /* @__PURE__ */ import_react40.default.createElement(Root7, {
|
|
3685
|
+
...props,
|
|
3686
|
+
className: tx("popover.viewport", "popover__viewport", {
|
|
3687
|
+
constrainInline,
|
|
3688
|
+
constrainBlock
|
|
3689
|
+
}, classNames),
|
|
3690
|
+
ref: forwardedRef
|
|
3691
|
+
}, children);
|
|
3692
|
+
} finally {
|
|
3693
|
+
_effect.f();
|
|
3694
|
+
}
|
|
3695
|
+
});
|
|
3696
|
+
var getState = (open) => open ? "open" : "closed";
|
|
3697
|
+
var Popover = {
|
|
3698
|
+
Root: PopoverRoot,
|
|
3699
|
+
Anchor: PopoverAnchor,
|
|
3700
|
+
Trigger: PopoverTrigger,
|
|
3701
|
+
VirtualTrigger: PopoverVirtualTrigger,
|
|
3702
|
+
Portal: PopoverPortal,
|
|
3703
|
+
Content: PopoverContent,
|
|
3704
|
+
Close: PopoverClose,
|
|
3705
|
+
Arrow: PopoverArrow,
|
|
3706
|
+
Viewport: PopoverViewport
|
|
3707
|
+
};
|
|
3708
|
+
var Status = /* @__PURE__ */ (0, import_react41.forwardRef)(({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
3709
|
+
var _effect = (0, import_tracking30.useSignals)();
|
|
3710
|
+
try {
|
|
3711
|
+
const { tx } = useThemeContext();
|
|
3712
|
+
return /* @__PURE__ */ import_react41.default.createElement("span", {
|
|
3713
|
+
role: "status",
|
|
3714
|
+
...props,
|
|
3715
|
+
className: tx("status.root", "status", {
|
|
3716
|
+
indeterminate,
|
|
3717
|
+
variant
|
|
3718
|
+
}, classNames),
|
|
3719
|
+
ref: forwardedRef
|
|
3720
|
+
}, /* @__PURE__ */ import_react41.default.createElement("span", {
|
|
3721
|
+
role: "none",
|
|
3722
|
+
className: tx("status.bar", "status__bar", {
|
|
3723
|
+
indeterminate,
|
|
3724
|
+
variant
|
|
3725
|
+
}, classNames),
|
|
3726
|
+
...!indeterminate && {
|
|
3727
|
+
style: {
|
|
3728
|
+
width: `${Math.round(progress * 100)}%`
|
|
3729
|
+
}
|
|
3730
|
+
}
|
|
3731
|
+
}), children);
|
|
3732
|
+
} finally {
|
|
3733
|
+
_effect.f();
|
|
3734
|
+
}
|
|
3735
|
+
});
|
|
3736
|
+
var ScrollAreaRoot = /* @__PURE__ */ (0, import_react42.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
3737
|
+
var _effect = (0, import_tracking31.useSignals)();
|
|
3738
|
+
try {
|
|
3739
|
+
const { tx } = useThemeContext();
|
|
3740
|
+
return /* @__PURE__ */ import_react42.default.createElement(import_react_scroll_area.Root, {
|
|
3741
|
+
...props,
|
|
3742
|
+
className: tx("scrollArea.root", "scroll-area", {}, classNames),
|
|
3743
|
+
ref: forwardedRef
|
|
3744
|
+
});
|
|
3745
|
+
} finally {
|
|
3746
|
+
_effect.f();
|
|
3747
|
+
}
|
|
3748
|
+
});
|
|
3749
|
+
var ScrollAreaViewport = /* @__PURE__ */ (0, import_react42.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
3750
|
+
var _effect = (0, import_tracking31.useSignals)();
|
|
3751
|
+
try {
|
|
3752
|
+
const { tx } = useThemeContext();
|
|
3753
|
+
return /* @__PURE__ */ import_react42.default.createElement(import_react_scroll_area.Viewport, {
|
|
3754
|
+
...props,
|
|
3755
|
+
className: tx("scrollArea.viewport", "scroll-area", {}, classNames),
|
|
3756
|
+
ref: forwardedRef
|
|
3757
|
+
});
|
|
3758
|
+
} finally {
|
|
3759
|
+
_effect.f();
|
|
3760
|
+
}
|
|
3761
|
+
});
|
|
3762
|
+
var ScrollAreaScrollbar = /* @__PURE__ */ (0, import_react42.forwardRef)(({ classNames, variant = "fine", ...props }, forwardedRef) => {
|
|
3763
|
+
var _effect = (0, import_tracking31.useSignals)();
|
|
3764
|
+
try {
|
|
3765
|
+
const { tx } = useThemeContext();
|
|
3766
|
+
return /* @__PURE__ */ import_react42.default.createElement(import_react_scroll_area.Scrollbar, {
|
|
3767
|
+
"data-variant": variant,
|
|
3768
|
+
...props,
|
|
3769
|
+
className: tx("scrollArea.scrollbar", "scroll-area__scrollbar", {}, classNames),
|
|
3770
|
+
ref: forwardedRef
|
|
3771
|
+
});
|
|
3772
|
+
} finally {
|
|
3773
|
+
_effect.f();
|
|
3774
|
+
}
|
|
3775
|
+
});
|
|
3776
|
+
var ScrollAreaThumb = /* @__PURE__ */ (0, import_react42.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
3777
|
+
var _effect = (0, import_tracking31.useSignals)();
|
|
3778
|
+
try {
|
|
3779
|
+
const { tx } = useThemeContext();
|
|
3780
|
+
return /* @__PURE__ */ import_react42.default.createElement(import_react_scroll_area.Thumb, {
|
|
3781
|
+
...props,
|
|
3782
|
+
className: tx("scrollArea.thumb", "scroll-area__thumb", {}, classNames),
|
|
3783
|
+
ref: forwardedRef
|
|
3784
|
+
});
|
|
3785
|
+
} finally {
|
|
3786
|
+
_effect.f();
|
|
3787
|
+
}
|
|
3788
|
+
});
|
|
3789
|
+
var ScrollAreaCorner = /* @__PURE__ */ (0, import_react42.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
3790
|
+
var _effect = (0, import_tracking31.useSignals)();
|
|
3791
|
+
try {
|
|
3792
|
+
const { tx } = useThemeContext();
|
|
3793
|
+
return /* @__PURE__ */ import_react42.default.createElement(import_react_scroll_area.Corner, {
|
|
3794
|
+
...props,
|
|
3795
|
+
className: tx("scrollArea.corner", "scroll-area__corner", {}, classNames),
|
|
3796
|
+
ref: forwardedRef
|
|
3797
|
+
});
|
|
3798
|
+
} finally {
|
|
3799
|
+
_effect.f();
|
|
3800
|
+
}
|
|
3801
|
+
});
|
|
3802
|
+
var ScrollArea = {
|
|
3803
|
+
Root: ScrollAreaRoot,
|
|
3804
|
+
Viewport: ScrollAreaViewport,
|
|
3805
|
+
Scrollbar: ScrollAreaScrollbar,
|
|
3806
|
+
Thumb: ScrollAreaThumb,
|
|
3807
|
+
Corner: ScrollAreaCorner
|
|
3808
|
+
};
|
|
3809
|
+
var SelectRoot = SelectPrimitive.Root;
|
|
3810
|
+
var SelectTrigger = SelectPrimitive.Trigger;
|
|
3811
|
+
var SelectValue = SelectPrimitive.Value;
|
|
3812
|
+
var SelectIcon = SelectPrimitive.Icon;
|
|
3813
|
+
var SelectPortal = SelectPrimitive.Portal;
|
|
3814
|
+
var SelectTriggerButton = /* @__PURE__ */ (0, import_react44.forwardRef)(({ children, placeholder, ...props }, forwardedRef) => {
|
|
3815
|
+
var _effect = (0, import_tracking32.useSignals)();
|
|
3816
|
+
try {
|
|
3817
|
+
const { tx } = useThemeContext();
|
|
3818
|
+
return /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.Trigger, {
|
|
3819
|
+
asChild: true,
|
|
3820
|
+
ref: forwardedRef
|
|
3821
|
+
}, /* @__PURE__ */ import_react44.default.createElement(Button, props, /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.Value, {
|
|
3822
|
+
placeholder
|
|
3823
|
+
}, children), /* @__PURE__ */ import_react44.default.createElement("span", {
|
|
3824
|
+
className: "w-1 flex-1"
|
|
3825
|
+
}), /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.Icon, {
|
|
3826
|
+
asChild: true
|
|
3827
|
+
}, /* @__PURE__ */ import_react44.default.createElement(import_react43.CaretDown, {
|
|
3828
|
+
className: tx("select.triggerIcon", "select__trigger__icon", {}),
|
|
3829
|
+
weight: "bold"
|
|
3830
|
+
}))));
|
|
3831
|
+
} finally {
|
|
3832
|
+
_effect.f();
|
|
3833
|
+
}
|
|
3834
|
+
});
|
|
3835
|
+
var SelectContent = /* @__PURE__ */ (0, import_react44.forwardRef)(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
3836
|
+
var _effect = (0, import_tracking32.useSignals)();
|
|
3837
|
+
try {
|
|
3838
|
+
const { tx } = useThemeContext();
|
|
3839
|
+
const elevation = useElevationContext();
|
|
3840
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3841
|
+
return /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.Content, {
|
|
3842
|
+
...props,
|
|
3843
|
+
collisionPadding: safeCollisionPadding,
|
|
3844
|
+
className: tx("select.content", "select__content", {
|
|
3845
|
+
elevation
|
|
3846
|
+
}, classNames),
|
|
3847
|
+
position: "popper",
|
|
3848
|
+
ref: forwardedRef
|
|
3849
|
+
}, children);
|
|
3850
|
+
} finally {
|
|
3851
|
+
_effect.f();
|
|
3852
|
+
}
|
|
3853
|
+
});
|
|
3854
|
+
var SelectScrollUpButton2 = /* @__PURE__ */ (0, import_react44.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
3855
|
+
var _effect = (0, import_tracking32.useSignals)();
|
|
3856
|
+
try {
|
|
3857
|
+
const { tx } = useThemeContext();
|
|
3858
|
+
return /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
3859
|
+
...props,
|
|
3860
|
+
className: tx("select.scrollButton", "select__scroll-button--up", {}, classNames),
|
|
3861
|
+
ref: forwardedRef
|
|
3862
|
+
}, children ?? /* @__PURE__ */ import_react44.default.createElement(import_react43.CaretUp, {
|
|
3863
|
+
weight: "bold"
|
|
3864
|
+
}));
|
|
3865
|
+
} finally {
|
|
3866
|
+
_effect.f();
|
|
3867
|
+
}
|
|
3868
|
+
});
|
|
3869
|
+
var SelectScrollDownButton2 = /* @__PURE__ */ (0, import_react44.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
3870
|
+
var _effect = (0, import_tracking32.useSignals)();
|
|
3871
|
+
try {
|
|
3872
|
+
const { tx } = useThemeContext();
|
|
3873
|
+
return /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
3874
|
+
...props,
|
|
3875
|
+
className: tx("select.scrollButton", "select__scroll-button--down", {}, classNames),
|
|
3876
|
+
ref: forwardedRef
|
|
3877
|
+
}, children ?? /* @__PURE__ */ import_react44.default.createElement(import_react43.CaretDown, {
|
|
3878
|
+
weight: "bold"
|
|
3879
|
+
}));
|
|
3880
|
+
} finally {
|
|
3881
|
+
_effect.f();
|
|
3882
|
+
}
|
|
3883
|
+
});
|
|
3884
|
+
var SelectViewport2 = /* @__PURE__ */ (0, import_react44.forwardRef)(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
3885
|
+
var _effect = (0, import_tracking32.useSignals)();
|
|
3886
|
+
try {
|
|
3887
|
+
const { tx } = useThemeContext();
|
|
3888
|
+
return /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.SelectViewport, {
|
|
3889
|
+
...props,
|
|
3890
|
+
className: tx("select.viewport", "select__viewport", {}, classNames),
|
|
3891
|
+
ref: forwardedRef
|
|
3892
|
+
}, children);
|
|
3893
|
+
} finally {
|
|
3894
|
+
_effect.f();
|
|
3895
|
+
}
|
|
3896
|
+
});
|
|
3897
|
+
var SelectItem = /* @__PURE__ */ (0, import_react44.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
3898
|
+
var _effect = (0, import_tracking32.useSignals)();
|
|
3899
|
+
try {
|
|
3900
|
+
const { tx } = useThemeContext();
|
|
3901
|
+
return /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.Item, {
|
|
3902
|
+
...props,
|
|
3903
|
+
className: tx("select.item", "option", {}, classNames),
|
|
3904
|
+
ref: forwardedRef
|
|
3905
|
+
});
|
|
3906
|
+
} finally {
|
|
3907
|
+
_effect.f();
|
|
3908
|
+
}
|
|
3909
|
+
});
|
|
3910
|
+
var SelectItemText = SelectPrimitive.ItemText;
|
|
3911
|
+
var SelectItemIndicator = /* @__PURE__ */ (0, import_react44.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
3912
|
+
var _effect = (0, import_tracking32.useSignals)();
|
|
3913
|
+
try {
|
|
3914
|
+
const { tx } = useThemeContext();
|
|
3915
|
+
return /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.ItemIndicator, {
|
|
3916
|
+
...props,
|
|
3917
|
+
className: tx("select.itemIndicator", "option__indicator", {}, classNames),
|
|
3918
|
+
ref: forwardedRef
|
|
3919
|
+
}, children);
|
|
3920
|
+
} finally {
|
|
3921
|
+
_effect.f();
|
|
3922
|
+
}
|
|
3923
|
+
});
|
|
3924
|
+
var SelectOption = /* @__PURE__ */ (0, import_react44.forwardRef)(({ children, classNames, ...props }, forwardedRef) => {
|
|
3925
|
+
var _effect = (0, import_tracking32.useSignals)();
|
|
3926
|
+
try {
|
|
3927
|
+
const { tx } = useThemeContext();
|
|
3928
|
+
return /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.Item, {
|
|
3929
|
+
...props,
|
|
3930
|
+
className: tx("select.item", "option", {}, classNames),
|
|
3931
|
+
ref: forwardedRef
|
|
3932
|
+
}, /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ import_react44.default.createElement("span", {
|
|
3933
|
+
className: "grow w-1"
|
|
3934
|
+
}), /* @__PURE__ */ import_react44.default.createElement(Icon, {
|
|
3935
|
+
icon: "ph--check--regular"
|
|
3936
|
+
}));
|
|
3937
|
+
} finally {
|
|
3938
|
+
_effect.f();
|
|
3939
|
+
}
|
|
3940
|
+
});
|
|
3941
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
3942
|
+
var SelectLabel = SelectPrimitive.Label;
|
|
3943
|
+
var SelectSeparator = /* @__PURE__ */ (0, import_react44.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
3944
|
+
var _effect = (0, import_tracking32.useSignals)();
|
|
3945
|
+
try {
|
|
3946
|
+
const { tx } = useThemeContext();
|
|
3947
|
+
return /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.Separator, {
|
|
3948
|
+
...props,
|
|
3949
|
+
className: tx("select.separator", "select__separator", {}, classNames),
|
|
3950
|
+
ref: forwardedRef
|
|
3951
|
+
});
|
|
3952
|
+
} finally {
|
|
3953
|
+
_effect.f();
|
|
3954
|
+
}
|
|
3955
|
+
});
|
|
3956
|
+
var SelectArrow = /* @__PURE__ */ (0, import_react44.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
3957
|
+
var _effect = (0, import_tracking32.useSignals)();
|
|
3958
|
+
try {
|
|
3959
|
+
const { tx } = useThemeContext();
|
|
3960
|
+
return /* @__PURE__ */ import_react44.default.createElement(SelectPrimitive.Arrow, {
|
|
3961
|
+
...props,
|
|
3962
|
+
className: tx("select.arrow", "select__arrow", {}, classNames),
|
|
3963
|
+
ref: forwardedRef
|
|
3964
|
+
});
|
|
3965
|
+
} finally {
|
|
3966
|
+
_effect.f();
|
|
3967
|
+
}
|
|
3968
|
+
});
|
|
3969
|
+
var Select = {
|
|
3970
|
+
Root: SelectRoot,
|
|
3971
|
+
Trigger: SelectTrigger,
|
|
3972
|
+
TriggerButton: SelectTriggerButton,
|
|
3973
|
+
Value: SelectValue,
|
|
3974
|
+
Icon: SelectIcon,
|
|
3975
|
+
Portal: SelectPortal,
|
|
3976
|
+
Content: SelectContent,
|
|
3977
|
+
ScrollUpButton: SelectScrollUpButton2,
|
|
3978
|
+
ScrollDownButton: SelectScrollDownButton2,
|
|
3979
|
+
Viewport: SelectViewport2,
|
|
3980
|
+
Item: SelectItem,
|
|
3981
|
+
ItemText: SelectItemText,
|
|
3982
|
+
ItemIndicator: SelectItemIndicator,
|
|
3983
|
+
Option: SelectOption,
|
|
3984
|
+
Group: SelectGroup,
|
|
3985
|
+
Label: SelectLabel,
|
|
3986
|
+
Separator: SelectSeparator,
|
|
3987
|
+
Arrow: SelectArrow
|
|
3988
|
+
};
|
|
3989
|
+
var Separator4 = /* @__PURE__ */ (0, import_react45.forwardRef)(({ classNames, orientation = "horizontal", ...props }, forwardedRef) => {
|
|
3990
|
+
var _effect = (0, import_tracking33.useSignals)();
|
|
3991
|
+
try {
|
|
3992
|
+
const { tx } = useThemeContext();
|
|
3993
|
+
return /* @__PURE__ */ import_react45.default.createElement(import_react_separator.Separator, {
|
|
3994
|
+
orientation,
|
|
3995
|
+
...props,
|
|
3996
|
+
className: tx("separator.root", "separator", {
|
|
3997
|
+
orientation
|
|
3998
|
+
}, classNames),
|
|
3999
|
+
ref: forwardedRef
|
|
4000
|
+
});
|
|
4001
|
+
} finally {
|
|
4002
|
+
_effect.f();
|
|
4003
|
+
}
|
|
4004
|
+
});
|
|
4005
|
+
var Tag = /* @__PURE__ */ (0, import_react46.forwardRef)(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
4006
|
+
var _effect = (0, import_tracking34.useSignals)();
|
|
4007
|
+
try {
|
|
4008
|
+
const { tx } = useThemeContext();
|
|
4009
|
+
const Root7 = asChild ? import_react_slot14.Slot : import_react_primitive13.Primitive.span;
|
|
4010
|
+
return /* @__PURE__ */ import_react46.default.createElement(Root7, {
|
|
4011
|
+
...props,
|
|
4012
|
+
className: tx("tag.root", "dx-tag", {
|
|
4013
|
+
palette
|
|
4014
|
+
}, classNames),
|
|
4015
|
+
"data-hue": palette,
|
|
4016
|
+
ref: forwardedRef
|
|
4017
|
+
});
|
|
4018
|
+
} finally {
|
|
4019
|
+
_effect.f();
|
|
4020
|
+
}
|
|
4021
|
+
});
|
|
4022
|
+
var ToastProvider = import_react_toast.ToastProvider;
|
|
4023
|
+
var ToastViewport = /* @__PURE__ */ (0, import_react47.forwardRef)(({ classNames, ...props }, forwardedRef) => {
|
|
4024
|
+
var _effect = (0, import_tracking35.useSignals)();
|
|
4025
|
+
try {
|
|
4026
|
+
const { tx } = useThemeContext();
|
|
4027
|
+
return /* @__PURE__ */ import_react47.default.createElement(import_react_toast.ToastViewport, {
|
|
4028
|
+
className: tx("toast.viewport", "toast-viewport", {}, classNames),
|
|
4029
|
+
ref: forwardedRef
|
|
4030
|
+
});
|
|
4031
|
+
} finally {
|
|
4032
|
+
_effect.f();
|
|
4033
|
+
}
|
|
4034
|
+
});
|
|
4035
|
+
var ToastRoot = /* @__PURE__ */ (0, import_react47.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
4036
|
+
var _effect = (0, import_tracking35.useSignals)();
|
|
4037
|
+
try {
|
|
4038
|
+
const { tx } = useThemeContext();
|
|
4039
|
+
return /* @__PURE__ */ import_react47.default.createElement(import_react_toast.Root, {
|
|
4040
|
+
...props,
|
|
4041
|
+
className: tx("toast.root", "toast", {}, classNames),
|
|
4042
|
+
ref: forwardedRef
|
|
4043
|
+
}, /* @__PURE__ */ import_react47.default.createElement(ElevationProvider, {
|
|
4044
|
+
elevation: "toast"
|
|
4045
|
+
}, children));
|
|
4046
|
+
} finally {
|
|
4047
|
+
_effect.f();
|
|
4048
|
+
}
|
|
4049
|
+
});
|
|
4050
|
+
var ToastBody = /* @__PURE__ */ (0, import_react47.forwardRef)(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4051
|
+
var _effect = (0, import_tracking35.useSignals)();
|
|
4052
|
+
try {
|
|
4053
|
+
const { tx } = useThemeContext();
|
|
4054
|
+
const Root7 = asChild ? import_react_slot15.Slot : import_react_primitive14.Primitive.div;
|
|
4055
|
+
return /* @__PURE__ */ import_react47.default.createElement(Root7, {
|
|
4056
|
+
...props,
|
|
4057
|
+
className: tx("toast.body", "toast__body", {}, classNames),
|
|
4058
|
+
ref: forwardedRef
|
|
4059
|
+
});
|
|
4060
|
+
} finally {
|
|
4061
|
+
_effect.f();
|
|
4062
|
+
}
|
|
4063
|
+
});
|
|
4064
|
+
var ToastTitle = /* @__PURE__ */ (0, import_react47.forwardRef)(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4065
|
+
var _effect = (0, import_tracking35.useSignals)();
|
|
4066
|
+
try {
|
|
4067
|
+
const { tx } = useThemeContext();
|
|
4068
|
+
const Root7 = asChild ? import_react_slot15.Slot : import_react_toast.ToastTitle;
|
|
4069
|
+
return /* @__PURE__ */ import_react47.default.createElement(Root7, {
|
|
4070
|
+
...props,
|
|
4071
|
+
className: tx("toast.title", "toast__title", {}, classNames),
|
|
4072
|
+
ref: forwardedRef
|
|
4073
|
+
});
|
|
4074
|
+
} finally {
|
|
4075
|
+
_effect.f();
|
|
4076
|
+
}
|
|
4077
|
+
});
|
|
4078
|
+
var ToastDescription = /* @__PURE__ */ (0, import_react47.forwardRef)(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4079
|
+
var _effect = (0, import_tracking35.useSignals)();
|
|
4080
|
+
try {
|
|
4081
|
+
const { tx } = useThemeContext();
|
|
4082
|
+
const Root7 = asChild ? import_react_slot15.Slot : import_react_toast.ToastDescription;
|
|
4083
|
+
return /* @__PURE__ */ import_react47.default.createElement(Root7, {
|
|
4084
|
+
...props,
|
|
4085
|
+
className: tx("toast.description", "toast__description", {}, classNames),
|
|
4086
|
+
ref: forwardedRef
|
|
4087
|
+
});
|
|
4088
|
+
} finally {
|
|
4089
|
+
_effect.f();
|
|
4090
|
+
}
|
|
4091
|
+
});
|
|
4092
|
+
var ToastActions = /* @__PURE__ */ (0, import_react47.forwardRef)(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4093
|
+
var _effect = (0, import_tracking35.useSignals)();
|
|
4094
|
+
try {
|
|
4095
|
+
const { tx } = useThemeContext();
|
|
4096
|
+
const Root7 = asChild ? import_react_slot15.Slot : import_react_primitive14.Primitive.div;
|
|
4097
|
+
return /* @__PURE__ */ import_react47.default.createElement(Root7, {
|
|
4098
|
+
...props,
|
|
4099
|
+
className: tx("toast.actions", "toast__actions", {}, classNames),
|
|
4100
|
+
ref: forwardedRef
|
|
4101
|
+
});
|
|
4102
|
+
} finally {
|
|
4103
|
+
_effect.f();
|
|
4104
|
+
}
|
|
4105
|
+
});
|
|
4106
|
+
var ToastAction = import_react_toast.ToastAction;
|
|
4107
|
+
var ToastClose = import_react_toast.ToastClose;
|
|
4108
|
+
var Toast = {
|
|
4109
|
+
Provider: ToastProvider,
|
|
4110
|
+
Viewport: ToastViewport,
|
|
4111
|
+
Root: ToastRoot,
|
|
4112
|
+
Body: ToastBody,
|
|
4113
|
+
Title: ToastTitle,
|
|
4114
|
+
Description: ToastDescription,
|
|
4115
|
+
Actions: ToastActions,
|
|
4116
|
+
Action: ToastAction,
|
|
4117
|
+
Close: ToastClose
|
|
4118
|
+
};
|
|
4119
|
+
var ToolbarRoot = /* @__PURE__ */ (0, import_react48.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
4120
|
+
var _effect = (0, import_tracking36.useSignals)();
|
|
4121
|
+
try {
|
|
4122
|
+
const { tx } = useThemeContext();
|
|
4123
|
+
return /* @__PURE__ */ import_react48.default.createElement(ToolbarPrimitive.Root, {
|
|
4124
|
+
...props,
|
|
4125
|
+
className: tx("toolbar.root", "toolbar", {}, classNames),
|
|
4126
|
+
ref: forwardedRef
|
|
4127
|
+
}, children);
|
|
4128
|
+
} finally {
|
|
4129
|
+
_effect.f();
|
|
4130
|
+
}
|
|
4131
|
+
});
|
|
4132
|
+
var ToolbarButton = /* @__PURE__ */ (0, import_react48.forwardRef)((props, forwardedRef) => {
|
|
4133
|
+
var _effect = (0, import_tracking36.useSignals)();
|
|
4134
|
+
try {
|
|
4135
|
+
return /* @__PURE__ */ import_react48.default.createElement(ToolbarPrimitive.Button, {
|
|
4136
|
+
asChild: true
|
|
4137
|
+
}, /* @__PURE__ */ import_react48.default.createElement(Button, {
|
|
4138
|
+
...props,
|
|
4139
|
+
ref: forwardedRef
|
|
4140
|
+
}));
|
|
4141
|
+
} finally {
|
|
4142
|
+
_effect.f();
|
|
4143
|
+
}
|
|
4144
|
+
});
|
|
4145
|
+
var ToolbarIconButton = /* @__PURE__ */ (0, import_react48.forwardRef)((props, forwardedRef) => {
|
|
4146
|
+
var _effect = (0, import_tracking36.useSignals)();
|
|
4147
|
+
try {
|
|
4148
|
+
return /* @__PURE__ */ import_react48.default.createElement(ToolbarPrimitive.Button, {
|
|
4149
|
+
asChild: true
|
|
4150
|
+
}, /* @__PURE__ */ import_react48.default.createElement(IconButton, {
|
|
4151
|
+
...props,
|
|
4152
|
+
ref: forwardedRef
|
|
4153
|
+
}));
|
|
4154
|
+
} finally {
|
|
4155
|
+
_effect.f();
|
|
4156
|
+
}
|
|
4157
|
+
});
|
|
4158
|
+
var ToolbarToggle = /* @__PURE__ */ (0, import_react48.forwardRef)((props, forwardedRef) => {
|
|
4159
|
+
var _effect = (0, import_tracking36.useSignals)();
|
|
4160
|
+
try {
|
|
4161
|
+
return /* @__PURE__ */ import_react48.default.createElement(ToolbarPrimitive.Button, {
|
|
4162
|
+
asChild: true
|
|
4163
|
+
}, /* @__PURE__ */ import_react48.default.createElement(Toggle, {
|
|
4164
|
+
...props,
|
|
4165
|
+
ref: forwardedRef
|
|
4166
|
+
}));
|
|
4167
|
+
} finally {
|
|
4168
|
+
_effect.f();
|
|
4169
|
+
}
|
|
4170
|
+
});
|
|
4171
|
+
var ToolbarLink = /* @__PURE__ */ (0, import_react48.forwardRef)((props, forwardedRef) => {
|
|
4172
|
+
var _effect = (0, import_tracking36.useSignals)();
|
|
4173
|
+
try {
|
|
4174
|
+
return /* @__PURE__ */ import_react48.default.createElement(ToolbarPrimitive.Link, {
|
|
4175
|
+
asChild: true
|
|
4176
|
+
}, /* @__PURE__ */ import_react48.default.createElement(Link, {
|
|
4177
|
+
...props,
|
|
4178
|
+
ref: forwardedRef
|
|
4179
|
+
}));
|
|
4180
|
+
} finally {
|
|
4181
|
+
_effect.f();
|
|
4182
|
+
}
|
|
4183
|
+
});
|
|
4184
|
+
var ToolbarToggleGroup2 = /* @__PURE__ */ (0, import_react48.forwardRef)(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
4185
|
+
var _effect = (0, import_tracking36.useSignals)();
|
|
4186
|
+
try {
|
|
4187
|
+
return /* @__PURE__ */ import_react48.default.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
4188
|
+
...props,
|
|
4189
|
+
asChild: true
|
|
4190
|
+
}, /* @__PURE__ */ import_react48.default.createElement(ButtonGroup, {
|
|
4191
|
+
classNames,
|
|
4192
|
+
children,
|
|
4193
|
+
elevation,
|
|
4194
|
+
ref: forwardedRef
|
|
4195
|
+
}));
|
|
4196
|
+
} finally {
|
|
4197
|
+
_effect.f();
|
|
4198
|
+
}
|
|
4199
|
+
});
|
|
4200
|
+
var ToolbarToggleGroupItem = /* @__PURE__ */ (0, import_react48.forwardRef)(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
4201
|
+
var _effect = (0, import_tracking36.useSignals)();
|
|
4202
|
+
try {
|
|
4203
|
+
return /* @__PURE__ */ import_react48.default.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
4204
|
+
...props,
|
|
4205
|
+
asChild: true
|
|
4206
|
+
}, /* @__PURE__ */ import_react48.default.createElement(Button, {
|
|
4207
|
+
variant,
|
|
4208
|
+
density,
|
|
4209
|
+
elevation,
|
|
4210
|
+
classNames,
|
|
4211
|
+
children,
|
|
4212
|
+
ref: forwardedRef
|
|
4213
|
+
}));
|
|
4214
|
+
} finally {
|
|
4215
|
+
_effect.f();
|
|
4216
|
+
}
|
|
4217
|
+
});
|
|
4218
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ (0, import_react48.forwardRef)(({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
4219
|
+
var _effect = (0, import_tracking36.useSignals)();
|
|
4220
|
+
try {
|
|
4221
|
+
return /* @__PURE__ */ import_react48.default.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
4222
|
+
...props,
|
|
4223
|
+
asChild: true
|
|
4224
|
+
}, /* @__PURE__ */ import_react48.default.createElement(IconButton, {
|
|
4225
|
+
variant,
|
|
4226
|
+
density,
|
|
4227
|
+
elevation,
|
|
4228
|
+
classNames,
|
|
4229
|
+
icon,
|
|
4230
|
+
label,
|
|
4231
|
+
iconOnly,
|
|
4232
|
+
ref: forwardedRef
|
|
4233
|
+
}));
|
|
4234
|
+
} finally {
|
|
4235
|
+
_effect.f();
|
|
4236
|
+
}
|
|
4237
|
+
});
|
|
4238
|
+
var ToolbarSeparator = /* @__PURE__ */ (0, import_react48.forwardRef)(({ variant = "line", ...props }, forwardedRef) => {
|
|
4239
|
+
var _effect = (0, import_tracking36.useSignals)();
|
|
4240
|
+
try {
|
|
4241
|
+
return variant === "line" ? /* @__PURE__ */ import_react48.default.createElement(ToolbarPrimitive.Separator, {
|
|
4242
|
+
asChild: true
|
|
4243
|
+
}, /* @__PURE__ */ import_react48.default.createElement(Separator4, {
|
|
4244
|
+
...props,
|
|
4245
|
+
ref: forwardedRef
|
|
4246
|
+
})) : /* @__PURE__ */ import_react48.default.createElement(ToolbarPrimitive.Separator, {
|
|
4247
|
+
className: "grow",
|
|
4248
|
+
ref: forwardedRef
|
|
4249
|
+
});
|
|
4250
|
+
} finally {
|
|
4251
|
+
_effect.f();
|
|
4252
|
+
}
|
|
4253
|
+
});
|
|
4254
|
+
var Toolbar = {
|
|
4255
|
+
Root: ToolbarRoot,
|
|
4256
|
+
Button: ToolbarButton,
|
|
4257
|
+
IconButton: ToolbarIconButton,
|
|
4258
|
+
Link: ToolbarLink,
|
|
4259
|
+
Toggle: ToolbarToggle,
|
|
4260
|
+
ToggleGroup: ToolbarToggleGroup2,
|
|
4261
|
+
ToggleGroupItem: ToolbarToggleGroupItem,
|
|
4262
|
+
ToggleGroupIconItem: ToolbarToggleGroupIconItem,
|
|
4263
|
+
Separator: ToolbarSeparator
|
|
4264
|
+
};
|
|
4265
|
+
var useDensityContext = (propsDensity) => {
|
|
4266
|
+
const { density } = (0, import_react.useContext)(DensityContext);
|
|
4267
|
+
return propsDensity ?? density;
|
|
4268
|
+
};
|
|
4269
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4270
|
+
0 && (module.exports = {
|
|
4271
|
+
AlertDialog,
|
|
4272
|
+
AnchoredOverflow,
|
|
4273
|
+
Avatar,
|
|
4274
|
+
BUTTON_GROUP_NAME,
|
|
4275
|
+
Breadcrumb,
|
|
4276
|
+
Button,
|
|
4277
|
+
ButtonGroup,
|
|
4278
|
+
Clipboard,
|
|
4279
|
+
ContextMenu,
|
|
4280
|
+
DensityContext,
|
|
4281
|
+
DensityProvider,
|
|
4282
|
+
Dialog,
|
|
4283
|
+
DropdownMenu,
|
|
4284
|
+
ElevationContext,
|
|
4285
|
+
ElevationProvider,
|
|
4286
|
+
Icon,
|
|
4287
|
+
IconButton,
|
|
4288
|
+
Input,
|
|
4289
|
+
LIST_ITEM_NAME,
|
|
4290
|
+
LIST_NAME,
|
|
4291
|
+
Link,
|
|
4292
|
+
List,
|
|
4293
|
+
ListItem,
|
|
4294
|
+
Main,
|
|
4295
|
+
Message,
|
|
4296
|
+
Popover,
|
|
4297
|
+
ScrollArea,
|
|
4298
|
+
Select,
|
|
4299
|
+
Separator,
|
|
4300
|
+
Status,
|
|
4301
|
+
Tag,
|
|
4302
|
+
ThemeContext,
|
|
4303
|
+
ThemeProvider,
|
|
4304
|
+
Toast,
|
|
4305
|
+
Toggle,
|
|
4306
|
+
ToggleGroup,
|
|
4307
|
+
ToggleGroupItem,
|
|
4308
|
+
Toolbar,
|
|
4309
|
+
Tooltip,
|
|
4310
|
+
Tree,
|
|
4311
|
+
TreeItem,
|
|
4312
|
+
Treegrid,
|
|
4313
|
+
createDropdownMenuScope,
|
|
4314
|
+
createPopoverScope,
|
|
4315
|
+
createTooltipScope,
|
|
4316
|
+
hasIosKeyboard,
|
|
4317
|
+
initialSafeArea,
|
|
4318
|
+
isLabel,
|
|
4319
|
+
toLocalizedString,
|
|
4320
|
+
useAvatarContext,
|
|
4321
|
+
useButtonGroupContext,
|
|
4322
|
+
useClipboard,
|
|
4323
|
+
useDensityContext,
|
|
4324
|
+
useDropdownMenuContext,
|
|
4325
|
+
useDropdownMenuMenuScope,
|
|
4326
|
+
useElevationContext,
|
|
4327
|
+
useIconHref,
|
|
4328
|
+
useLandmarkMover,
|
|
4329
|
+
useListContext,
|
|
4330
|
+
useListItemContext,
|
|
4331
|
+
useMainContext,
|
|
4332
|
+
useSafeArea,
|
|
4333
|
+
useSidebars,
|
|
4334
|
+
useThemeContext,
|
|
4335
|
+
useTooltipContext,
|
|
4336
|
+
useTranslation,
|
|
4337
|
+
useTranslationsContext,
|
|
4338
|
+
useVisualViewport
|
|
4339
|
+
});
|
|
4340
|
+
//# sourceMappingURL=chunk-KMS7RFL7.cjs.map
|