@haklex/rich-editor-ui 0.0.82 → 0.0.83
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/index.mjs
CHANGED
|
@@ -1,441 +1,436 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, createContext, use, createElement, useSyncExternalStore } from "react";
|
|
3
|
+
import { ChevronDown, Check, X } from "lucide-react";
|
|
4
4
|
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
5
|
-
import {
|
|
5
|
+
import { PortalThemeWrapper, PortalThemeProvider } from "@haklex/rich-style-token";
|
|
6
|
+
import { PortalThemeProvider as PortalThemeProvider2, PortalThemeWrapper as PortalThemeWrapper2, usePortalTheme } from "@haklex/rich-style-token";
|
|
6
7
|
import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
|
|
7
8
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
8
9
|
import { Menu } from "@base-ui/react/menu";
|
|
9
10
|
import { Tooltip } from "@base-ui/react/tooltip";
|
|
10
|
-
//#region ../../node_modules/.pnpm/@vanilla-extract+recipes@0.5.7_@vanilla-extract+css@1.18.0/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
11
11
|
function toPrimitive(t, r) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
if ("object" != typeof t || !t) return t;
|
|
13
|
+
var e = t[Symbol.toPrimitive];
|
|
14
|
+
if (void 0 !== e) {
|
|
15
|
+
var i = e.call(t, r);
|
|
16
|
+
if ("object" != typeof i) return i;
|
|
17
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
18
|
+
}
|
|
19
|
+
return ("string" === r ? String : Number)(t);
|
|
20
20
|
}
|
|
21
21
|
function toPropertyKey(t) {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
var i = toPrimitive(t, "string");
|
|
23
|
+
return "symbol" == typeof i ? i : String(i);
|
|
24
24
|
}
|
|
25
25
|
function _defineProperty(obj, key, value) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
key = toPropertyKey(key);
|
|
27
|
+
if (key in obj) {
|
|
28
|
+
Object.defineProperty(obj, key, {
|
|
29
|
+
value,
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
obj[key] = value;
|
|
36
|
+
}
|
|
37
|
+
return obj;
|
|
35
38
|
}
|
|
36
39
|
function ownKeys(e, r) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
var t = Object.keys(e);
|
|
41
|
+
if (Object.getOwnPropertySymbols) {
|
|
42
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
43
|
+
r && (o = o.filter(function(r2) {
|
|
44
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
45
|
+
})), t.push.apply(t, o);
|
|
46
|
+
}
|
|
47
|
+
return t;
|
|
45
48
|
}
|
|
46
49
|
function _objectSpread2(e) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
51
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
52
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
53
|
+
_defineProperty(e, r2, t[r2]);
|
|
54
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
55
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return e;
|
|
56
59
|
}
|
|
57
60
|
function mapValues(input, fn) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
var result = {};
|
|
62
|
+
for (var _key in input) {
|
|
63
|
+
result[_key] = fn(input[_key], _key);
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
61
66
|
}
|
|
62
67
|
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
for (var key of Object.keys(compoundCheck)) {
|
|
69
|
+
var _selections$key;
|
|
70
|
+
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
68
75
|
};
|
|
69
76
|
var createRuntimeFn = (config) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
77
|
+
var runtimeFn = (options) => {
|
|
78
|
+
var className = config.defaultClassName;
|
|
79
|
+
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
80
|
+
for (var variantName in selections) {
|
|
81
|
+
var _selections$variantNa;
|
|
82
|
+
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
83
|
+
if (variantSelection != null) {
|
|
84
|
+
var selection = variantSelection;
|
|
85
|
+
if (typeof selection === "boolean") {
|
|
86
|
+
selection = selection === true ? "true" : "false";
|
|
87
|
+
}
|
|
88
|
+
var selectionClassName = (
|
|
89
|
+
// @ts-expect-error
|
|
90
|
+
config.variantClassNames[variantName][selection]
|
|
91
|
+
);
|
|
92
|
+
if (selectionClassName) {
|
|
93
|
+
className += " " + selectionClassName;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
98
|
+
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
|
|
99
|
+
className += " " + compoundClassName;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return className;
|
|
103
|
+
};
|
|
104
|
+
runtimeFn.variants = () => Object.keys(config.variantClassNames);
|
|
105
|
+
runtimeFn.classNames = {
|
|
106
|
+
get base() {
|
|
107
|
+
return config.defaultClassName.split(" ")[0];
|
|
108
|
+
},
|
|
109
|
+
get variants() {
|
|
110
|
+
return mapValues(config.variantClassNames, (classNames) => mapValues(classNames, (className) => className.split(" ")[0]));
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
return runtimeFn;
|
|
105
114
|
};
|
|
115
|
+
var semanticClassNames = { actionBar: "re-ui-action-bar", actionButton: "re-ui-action-btn", actionButtonEnd: "re-ui-action-btn--end", actionButtonDanger: "re-ui-action-btn--danger", actionButtonIcon: "re-ui-action-btn--icon" };
|
|
106
116
|
var actionBar = "_73ej2i0";
|
|
107
|
-
var actionButton = createRuntimeFn({
|
|
108
|
-
defaultClassName: "_73ej2i1",
|
|
109
|
-
variantClassNames: {
|
|
110
|
-
variant: {
|
|
111
|
-
ghost: "_73ej2i2",
|
|
112
|
-
solid: "_73ej2i3",
|
|
113
|
-
outline: "_73ej2i4",
|
|
114
|
-
accent: "_73ej2i5"
|
|
115
|
-
},
|
|
116
|
-
size: {
|
|
117
|
-
sm: "_73ej2i6",
|
|
118
|
-
md: "_73ej2i7",
|
|
119
|
-
lg: "_73ej2i8"
|
|
120
|
-
},
|
|
121
|
-
icon: {
|
|
122
|
-
true: "_73ej2i9",
|
|
123
|
-
false: "_73ej2ia"
|
|
124
|
-
},
|
|
125
|
-
end: {
|
|
126
|
-
true: "_73ej2ib",
|
|
127
|
-
false: "_73ej2ic"
|
|
128
|
-
},
|
|
129
|
-
danger: {
|
|
130
|
-
true: "_73ej2id",
|
|
131
|
-
false: "_73ej2ie"
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
defaultVariants: {
|
|
135
|
-
variant: "ghost",
|
|
136
|
-
size: "sm",
|
|
137
|
-
icon: false,
|
|
138
|
-
end: false,
|
|
139
|
-
danger: false
|
|
140
|
-
},
|
|
141
|
-
compoundVariants: [
|
|
142
|
-
[{
|
|
143
|
-
icon: true,
|
|
144
|
-
size: "sm"
|
|
145
|
-
}, "_73ej2if"],
|
|
146
|
-
[{
|
|
147
|
-
icon: true,
|
|
148
|
-
size: "md"
|
|
149
|
-
}, "_73ej2ig"],
|
|
150
|
-
[{ danger: true }, "_73ej2ih"]
|
|
151
|
-
]
|
|
152
|
-
});
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/components/action-button/index.tsx
|
|
117
|
+
var actionButton = createRuntimeFn({ defaultClassName: "_73ej2i1", variantClassNames: { variant: { ghost: "_73ej2i2", solid: "_73ej2i3", outline: "_73ej2i4", accent: "_73ej2i5" }, size: { sm: "_73ej2i6", md: "_73ej2i7", lg: "_73ej2i8" }, icon: { true: "_73ej2i9", false: "_73ej2ia" }, end: { true: "_73ej2ib", false: "_73ej2ic" }, danger: { true: "_73ej2id", false: "_73ej2ie" } }, defaultVariants: { variant: "ghost", size: "sm", icon: false, end: false, danger: false }, compoundVariants: [[{ icon: true, size: "sm" }, "_73ej2if"], [{ icon: true, size: "md" }, "_73ej2ig"], [{ icon: true, size: "lg" }, "_73ej2ih"], [{ danger: true }, "_73ej2ii"]] });
|
|
155
118
|
function ActionBar({ className, gap, style, ...props }) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
function ActionButton({
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
className: `${actionBar} ${semanticClassNames.actionBar}${className ? ` ${className}` : ""}`,
|
|
123
|
+
style: gap != null ? { ...style, gap } : style,
|
|
124
|
+
...props
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function ActionButton({
|
|
129
|
+
variant,
|
|
130
|
+
size,
|
|
131
|
+
end = false,
|
|
132
|
+
danger = false,
|
|
133
|
+
icon = false,
|
|
134
|
+
className,
|
|
135
|
+
type = "button",
|
|
136
|
+
...props
|
|
137
|
+
}) {
|
|
138
|
+
const semanticParts = [semanticClassNames.actionButton];
|
|
139
|
+
if (end) semanticParts.push(semanticClassNames.actionButtonEnd);
|
|
140
|
+
if (danger) semanticParts.push(semanticClassNames.actionButtonDanger);
|
|
141
|
+
if (icon) semanticParts.push(semanticClassNames.actionButtonIcon);
|
|
142
|
+
const recipeClass = actionButton({ variant, size, end, danger, icon });
|
|
143
|
+
return /* @__PURE__ */ jsx(
|
|
144
|
+
"button",
|
|
145
|
+
{
|
|
146
|
+
className: `${recipeClass} ${semanticParts.join(" ")}${className ? ` ${className}` : ""}`,
|
|
147
|
+
type,
|
|
148
|
+
...props
|
|
149
|
+
}
|
|
150
|
+
);
|
|
181
151
|
}
|
|
182
152
|
function getActionButtonClassName(options) {
|
|
183
|
-
|
|
153
|
+
return `${actionButton(options)} ${semanticClassNames.actionButton}`;
|
|
184
154
|
}
|
|
185
|
-
//#endregion
|
|
186
|
-
//#region src/components/animated-tabs/styles.css.ts
|
|
187
155
|
var root$1 = "iryuae0";
|
|
188
156
|
var tablist = "iryuae1";
|
|
189
157
|
var tab = "iryuae2";
|
|
190
158
|
var tabActive = "iryuae3";
|
|
191
159
|
var border = "iryuae4";
|
|
192
160
|
var indicator$1 = "iryuae5";
|
|
193
|
-
//#endregion
|
|
194
|
-
//#region src/components/animated-tabs/index.tsx
|
|
195
161
|
function cn(...parts) {
|
|
196
|
-
|
|
162
|
+
return parts.filter(Boolean).join(" ");
|
|
197
163
|
}
|
|
198
164
|
function AnimatedTabs({ tabs, defaultTab, value, onChange, className }) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
//#endregion
|
|
268
|
-
//#region src/components/checkbox/styles.css.ts
|
|
165
|
+
const isControlled = value !== void 0;
|
|
166
|
+
const [internalTab, setInternalTab] = useState(defaultTab ?? tabs[0]?.id ?? "");
|
|
167
|
+
const activeTab = isControlled ? value : internalTab;
|
|
168
|
+
const [indicator2, setIndicator] = useState({
|
|
169
|
+
left: 0,
|
|
170
|
+
width: 0
|
|
171
|
+
});
|
|
172
|
+
const tabRefs = useRef(/* @__PURE__ */ new Map());
|
|
173
|
+
const containerRef = useRef(null);
|
|
174
|
+
const updateIndicator = useCallback(() => {
|
|
175
|
+
const activeEl = tabRefs.current.get(activeTab);
|
|
176
|
+
const container2 = containerRef.current;
|
|
177
|
+
if (activeEl && container2) {
|
|
178
|
+
const containerRect = container2.getBoundingClientRect();
|
|
179
|
+
const tabRect = activeEl.getBoundingClientRect();
|
|
180
|
+
setIndicator({
|
|
181
|
+
left: tabRect.left - containerRect.left,
|
|
182
|
+
width: tabRect.width
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}, [activeTab]);
|
|
186
|
+
useEffect(() => {
|
|
187
|
+
updateIndicator();
|
|
188
|
+
}, [updateIndicator]);
|
|
189
|
+
useEffect(() => {
|
|
190
|
+
window.addEventListener("resize", updateIndicator);
|
|
191
|
+
return () => window.removeEventListener("resize", updateIndicator);
|
|
192
|
+
}, [updateIndicator]);
|
|
193
|
+
const handleTabClick = (tabId) => {
|
|
194
|
+
if (!isControlled) {
|
|
195
|
+
setInternalTab(tabId);
|
|
196
|
+
}
|
|
197
|
+
onChange?.(tabId);
|
|
198
|
+
};
|
|
199
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(root$1, className), ref: containerRef, children: [
|
|
200
|
+
/* @__PURE__ */ jsx("div", { "aria-orientation": "horizontal", className: tablist, role: "tablist", children: tabs.map((tab$1) => /* @__PURE__ */ jsx(
|
|
201
|
+
"button",
|
|
202
|
+
{
|
|
203
|
+
"aria-selected": activeTab === tab$1.id,
|
|
204
|
+
className: cn(tab, activeTab === tab$1.id ? tabActive : void 0),
|
|
205
|
+
role: "tab",
|
|
206
|
+
type: "button",
|
|
207
|
+
ref: (el) => {
|
|
208
|
+
if (el) {
|
|
209
|
+
tabRefs.current.set(tab$1.id, el);
|
|
210
|
+
} else {
|
|
211
|
+
tabRefs.current.delete(tab$1.id);
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
onClick: () => handleTabClick(tab$1.id),
|
|
215
|
+
children: tab$1.label
|
|
216
|
+
},
|
|
217
|
+
tab$1.id
|
|
218
|
+
)) }),
|
|
219
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: border }),
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
"div",
|
|
222
|
+
{
|
|
223
|
+
"aria-hidden": "true",
|
|
224
|
+
className: indicator$1,
|
|
225
|
+
style: {
|
|
226
|
+
left: indicator2.left,
|
|
227
|
+
width: indicator2.width
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
] });
|
|
232
|
+
}
|
|
269
233
|
var root = "_10muorc2";
|
|
234
|
+
var rootDisabled = "_10muorc3";
|
|
270
235
|
var box = "_10muorc4";
|
|
271
236
|
var boxUnchecked = "_10muorc5";
|
|
272
237
|
var boxChecked = "_10muorc6";
|
|
238
|
+
var boxBouncing = "_10muorc7";
|
|
273
239
|
var checkmark = "_10muorc8";
|
|
274
240
|
var checkmarkVisible = "_10muorc9";
|
|
275
241
|
var checkmarkHidden = "_10muorca";
|
|
276
242
|
var ripple = "_10muorcb";
|
|
277
|
-
|
|
278
|
-
|
|
243
|
+
var rippleActive = "_10muorcc";
|
|
244
|
+
var labelArea = "_10muorcd";
|
|
245
|
+
var label$1 = "_10muorce";
|
|
246
|
+
var labelDisabled = "_10muorcf";
|
|
247
|
+
var description$2 = "_10muorcg";
|
|
279
248
|
function cx(...args) {
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
function AnimatedCheckbox({
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
249
|
+
return args.filter(Boolean).join(" ");
|
|
250
|
+
}
|
|
251
|
+
function AnimatedCheckbox({
|
|
252
|
+
label: label2,
|
|
253
|
+
description: description2,
|
|
254
|
+
checked: controlledChecked,
|
|
255
|
+
defaultChecked = false,
|
|
256
|
+
onChange,
|
|
257
|
+
disabled = false,
|
|
258
|
+
className
|
|
259
|
+
}) {
|
|
260
|
+
const [internalChecked, setInternalChecked] = useState(defaultChecked);
|
|
261
|
+
const [bouncing, setBouncing] = useState(false);
|
|
262
|
+
const isControlled = controlledChecked !== void 0;
|
|
263
|
+
const isChecked = isControlled ? controlledChecked : internalChecked;
|
|
264
|
+
const isFirstRender = useRef(true);
|
|
265
|
+
const rippleKey = useRef(0);
|
|
266
|
+
useEffect(() => {
|
|
267
|
+
if (isFirstRender.current) {
|
|
268
|
+
isFirstRender.current = false;
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
setBouncing(true);
|
|
272
|
+
rippleKey.current += 1;
|
|
273
|
+
const timer = setTimeout(() => setBouncing(false), 400);
|
|
274
|
+
return () => clearTimeout(timer);
|
|
275
|
+
}, [isChecked]);
|
|
276
|
+
const handleToggle = () => {
|
|
277
|
+
if (disabled) return;
|
|
278
|
+
const next = !isChecked;
|
|
279
|
+
if (!isControlled) setInternalChecked(next);
|
|
280
|
+
onChange?.(next);
|
|
281
|
+
};
|
|
282
|
+
return /* @__PURE__ */ jsxs(
|
|
283
|
+
"button",
|
|
284
|
+
{
|
|
285
|
+
"aria-checked": isChecked,
|
|
286
|
+
"aria-disabled": disabled,
|
|
287
|
+
className: cx(root, disabled && rootDisabled, className),
|
|
288
|
+
role: "checkbox",
|
|
289
|
+
type: "button",
|
|
290
|
+
onClick: handleToggle,
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ jsxs(
|
|
293
|
+
"span",
|
|
294
|
+
{
|
|
295
|
+
className: cx(
|
|
296
|
+
box,
|
|
297
|
+
isChecked ? boxChecked : boxUnchecked,
|
|
298
|
+
bouncing && boxBouncing
|
|
299
|
+
),
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ jsx(
|
|
302
|
+
"svg",
|
|
303
|
+
{
|
|
304
|
+
className: cx(checkmark, isChecked ? checkmarkVisible : checkmarkHidden),
|
|
305
|
+
fill: "none",
|
|
306
|
+
viewBox: "0 0 12 10",
|
|
307
|
+
children: /* @__PURE__ */ jsx(
|
|
308
|
+
"path",
|
|
309
|
+
{
|
|
310
|
+
d: "M1 5.5L4 8.5L11 1.5",
|
|
311
|
+
stroke: "currentColor",
|
|
312
|
+
strokeLinecap: "round",
|
|
313
|
+
strokeLinejoin: "round",
|
|
314
|
+
strokeWidth: "2",
|
|
315
|
+
style: {
|
|
316
|
+
color: "#fff",
|
|
317
|
+
strokeDasharray: 20,
|
|
318
|
+
strokeDashoffset: isChecked ? 0 : 20,
|
|
319
|
+
transition: isChecked ? "stroke-dashoffset 0.4s ease-out 0.1s" : "stroke-dashoffset 0.2s ease-in"
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
}
|
|
324
|
+
),
|
|
325
|
+
/* @__PURE__ */ jsx("span", { className: cx(ripple, bouncing && rippleActive) }, rippleKey.current)
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
(label2 || description2) && /* @__PURE__ */ jsxs("span", { className: labelArea, children: [
|
|
330
|
+
label2 && /* @__PURE__ */ jsx("span", { className: cx(label$1, disabled && labelDisabled), children: label2 }),
|
|
331
|
+
description2 && /* @__PURE__ */ jsx("span", { className: description$2, children: description2 })
|
|
332
|
+
] })
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
}
|
|
346
337
|
function getStrictContext(name) {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
|
|
338
|
+
const Context = createContext(void 0);
|
|
339
|
+
const Provider = ({
|
|
340
|
+
value,
|
|
341
|
+
children
|
|
342
|
+
}) => /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
343
|
+
const useSafeContext = () => {
|
|
344
|
+
const ctx = use(Context);
|
|
345
|
+
if (ctx === void 0) {
|
|
346
|
+
throw new Error(`useContext must be used within ${name}`);
|
|
347
|
+
}
|
|
348
|
+
return ctx;
|
|
349
|
+
};
|
|
350
|
+
return [Provider, useSafeContext];
|
|
351
|
+
}
|
|
361
352
|
var popup$4 = "f2q44l2";
|
|
362
353
|
var arrow = "f2q44l3";
|
|
363
354
|
var title$1 = "f2q44l4";
|
|
364
355
|
var description$1 = "f2q44l5";
|
|
365
|
-
|
|
366
|
-
//#region src/components/popover/index.tsx
|
|
367
|
-
var [PopoverProvider, usePopover] = getStrictContext("PopoverContext");
|
|
356
|
+
const [PopoverProvider, usePopover] = getStrictContext("PopoverContext");
|
|
368
357
|
function Popover(props) {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
value: { isOpen },
|
|
379
|
-
children: /* @__PURE__ */ jsx(Popover$1.Root, {
|
|
380
|
-
...props,
|
|
381
|
-
onOpenChange: handleOpenChange
|
|
382
|
-
})
|
|
383
|
-
});
|
|
358
|
+
const [isOpen, setIsOpen] = useState(props?.defaultOpen ?? false);
|
|
359
|
+
useEffect(() => {
|
|
360
|
+
if (props.open !== void 0) setIsOpen(props.open);
|
|
361
|
+
}, [props.open]);
|
|
362
|
+
const handleOpenChange = (open, details) => {
|
|
363
|
+
setIsOpen(open);
|
|
364
|
+
props.onOpenChange?.(open, details);
|
|
365
|
+
};
|
|
366
|
+
return /* @__PURE__ */ jsx(PopoverProvider, { value: { isOpen }, children: /* @__PURE__ */ jsx(Popover$1.Root, { ...props, onOpenChange: handleOpenChange }) });
|
|
384
367
|
}
|
|
385
368
|
function PopoverTrigger(props) {
|
|
386
|
-
|
|
369
|
+
return /* @__PURE__ */ jsx(Popover$1.Trigger, { ...props });
|
|
387
370
|
}
|
|
388
371
|
function PopoverPortal({ children, ...props }) {
|
|
389
|
-
|
|
390
|
-
...props,
|
|
391
|
-
children: /* @__PURE__ */ jsx(PortalThemeWrapper$1, { children })
|
|
392
|
-
});
|
|
372
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { ...props, children: /* @__PURE__ */ jsx(PortalThemeWrapper, { children }) });
|
|
393
373
|
}
|
|
394
374
|
function PopoverPositioner(props) {
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
function PopoverPopup({
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
375
|
+
return /* @__PURE__ */ jsx(Popover$1.Positioner, { ...props });
|
|
376
|
+
}
|
|
377
|
+
function PopoverPopup({
|
|
378
|
+
className,
|
|
379
|
+
children,
|
|
380
|
+
...props
|
|
381
|
+
}) {
|
|
382
|
+
return /* @__PURE__ */ jsx(
|
|
383
|
+
Popover$1.Popup,
|
|
384
|
+
{
|
|
385
|
+
className: `${popup$4}${className ? ` ${className}` : ""}`,
|
|
386
|
+
...props,
|
|
387
|
+
children
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
function PopoverPanel({
|
|
392
|
+
align = "center",
|
|
393
|
+
side,
|
|
394
|
+
sideOffset = 4,
|
|
395
|
+
className,
|
|
396
|
+
children,
|
|
397
|
+
...popupProps
|
|
398
|
+
}) {
|
|
399
|
+
return /* @__PURE__ */ jsx(PopoverPortal, { children: /* @__PURE__ */ jsx(PopoverPositioner, { align, side, sideOffset, children: /* @__PURE__ */ jsx(PopoverPopup, { className, ...popupProps, children }) }) });
|
|
415
400
|
}
|
|
416
401
|
function PopoverArrow({ className, ...props }) {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
402
|
+
return /* @__PURE__ */ jsx(
|
|
403
|
+
Popover$1.Arrow,
|
|
404
|
+
{
|
|
405
|
+
className: `${arrow}${className ? ` ${className}` : ""}`,
|
|
406
|
+
...props
|
|
407
|
+
}
|
|
408
|
+
);
|
|
421
409
|
}
|
|
422
410
|
function PopoverClose(props) {
|
|
423
|
-
|
|
411
|
+
return /* @__PURE__ */ jsx(Popover$1.Close, { ...props });
|
|
424
412
|
}
|
|
425
413
|
function PopoverTitle({ className, ...props }) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
414
|
+
return /* @__PURE__ */ jsx(
|
|
415
|
+
Popover$1.Title,
|
|
416
|
+
{
|
|
417
|
+
className: `${title$1}${className ? ` ${className}` : ""}`,
|
|
418
|
+
...props
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
function PopoverDescription({
|
|
423
|
+
className,
|
|
424
|
+
...props
|
|
425
|
+
}) {
|
|
426
|
+
return /* @__PURE__ */ jsx(
|
|
427
|
+
Popover$1.Description,
|
|
428
|
+
{
|
|
429
|
+
className: `${description$1}${className ? ` ${className}` : ""}`,
|
|
430
|
+
...props
|
|
431
|
+
}
|
|
432
|
+
);
|
|
433
|
+
}
|
|
439
434
|
var trigger = "_17r50hf1";
|
|
440
435
|
var triggerLabel = "_17r50hf2";
|
|
441
436
|
var triggerLetter = "_17r50hf3";
|
|
@@ -445,155 +440,141 @@ var panel = "_17r50hf6";
|
|
|
445
440
|
var grid = "_17r50hf7";
|
|
446
441
|
var swatch = "_17r50hf8";
|
|
447
442
|
var swatchDot = "_17r50hf9";
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
name: "Red",
|
|
461
|
-
value: "#ef4444"
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
name: "Orange",
|
|
465
|
-
value: "#f97316"
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
name: "Amber",
|
|
469
|
-
value: "#f59e0b"
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
name: "Green",
|
|
473
|
-
value: "#22c55e"
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
name: "Teal",
|
|
477
|
-
value: "#14b8a6"
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
name: "Blue",
|
|
481
|
-
value: "#3b82f6"
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
name: "Indigo",
|
|
485
|
-
value: "#6366f1"
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
name: "Pink",
|
|
489
|
-
value: "#ec4899"
|
|
490
|
-
}
|
|
443
|
+
var swatchCheck = "_17r50hfa";
|
|
444
|
+
const TEXT_COLORS = [
|
|
445
|
+
{ name: "Default", value: "inherit" },
|
|
446
|
+
{ name: "Gray", value: "#6b7280" },
|
|
447
|
+
{ name: "Red", value: "#ef4444" },
|
|
448
|
+
{ name: "Orange", value: "#f97316" },
|
|
449
|
+
{ name: "Amber", value: "#f59e0b" },
|
|
450
|
+
{ name: "Green", value: "#22c55e" },
|
|
451
|
+
{ name: "Teal", value: "#14b8a6" },
|
|
452
|
+
{ name: "Blue", value: "#3b82f6" },
|
|
453
|
+
{ name: "Indigo", value: "#6366f1" },
|
|
454
|
+
{ name: "Pink", value: "#ec4899" }
|
|
491
455
|
];
|
|
492
456
|
function ColorPicker({ currentColor, onSelect, className }) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
457
|
+
const displayColor = currentColor === "inherit" || !currentColor ? "currentColor" : currentColor;
|
|
458
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
459
|
+
/* @__PURE__ */ jsxs(
|
|
460
|
+
PopoverTrigger,
|
|
461
|
+
{
|
|
462
|
+
className: `${trigger}${className ? ` ${className}` : ""}`,
|
|
463
|
+
render: /* @__PURE__ */ jsx("button", { type: "button", onMouseDown: (e) => e.preventDefault() }),
|
|
464
|
+
children: [
|
|
465
|
+
/* @__PURE__ */ jsxs("span", { className: triggerLabel, children: [
|
|
466
|
+
/* @__PURE__ */ jsx("span", { className: triggerLetter, style: { color: displayColor }, children: "A" }),
|
|
467
|
+
/* @__PURE__ */ jsx("span", { className: triggerBar, style: { backgroundColor: displayColor } })
|
|
468
|
+
] }),
|
|
469
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: triggerChevron })
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
),
|
|
473
|
+
/* @__PURE__ */ jsx(PopoverPanel, { className: panel, side: "bottom", sideOffset: 6, children: /* @__PURE__ */ jsx("div", { className: grid, children: TEXT_COLORS.map((color) => /* @__PURE__ */ jsxs(
|
|
474
|
+
"button",
|
|
475
|
+
{
|
|
476
|
+
"aria-label": color.name,
|
|
477
|
+
className: swatch,
|
|
478
|
+
type: "button",
|
|
479
|
+
onMouseDown: (e) => {
|
|
480
|
+
e.preventDefault();
|
|
481
|
+
onSelect(color.value);
|
|
482
|
+
},
|
|
483
|
+
children: [
|
|
484
|
+
/* @__PURE__ */ jsx(
|
|
485
|
+
"span",
|
|
486
|
+
{
|
|
487
|
+
className: swatchDot,
|
|
488
|
+
style: {
|
|
489
|
+
backgroundColor: color.value === "inherit" ? "currentColor" : color.value
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
),
|
|
493
|
+
currentColor === color.value && /* @__PURE__ */ jsx(Check, { className: swatchCheck })
|
|
494
|
+
]
|
|
495
|
+
},
|
|
496
|
+
color.value
|
|
497
|
+
)) }) })
|
|
498
|
+
] });
|
|
499
|
+
}
|
|
535
500
|
var popup$3 = "_2buwsh0";
|
|
536
501
|
var item$2 = "_2buwsh1";
|
|
537
502
|
var empty = "_2buwsh2";
|
|
538
|
-
//#endregion
|
|
539
|
-
//#region src/components/combobox/index.tsx
|
|
540
503
|
function Combobox(props) {
|
|
541
|
-
|
|
504
|
+
return /* @__PURE__ */ jsx(Combobox$1.Root, { ...props });
|
|
542
505
|
}
|
|
543
506
|
function ComboboxInput({ className, ...props }) {
|
|
544
|
-
|
|
545
|
-
className,
|
|
546
|
-
...props
|
|
547
|
-
});
|
|
507
|
+
return /* @__PURE__ */ jsx(Combobox$1.Input, { className, ...props });
|
|
548
508
|
}
|
|
549
509
|
function ComboboxPortal({ children }) {
|
|
550
|
-
|
|
551
|
-
}
|
|
552
|
-
function ComboboxContent({
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
510
|
+
return /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(PortalThemeWrapper, { children }) });
|
|
511
|
+
}
|
|
512
|
+
function ComboboxContent({
|
|
513
|
+
align = "start",
|
|
514
|
+
alignOffset = 0,
|
|
515
|
+
side = "bottom",
|
|
516
|
+
sideOffset = 4,
|
|
517
|
+
className,
|
|
518
|
+
positionMethod = "absolute",
|
|
519
|
+
children,
|
|
520
|
+
...popupProps
|
|
521
|
+
}) {
|
|
522
|
+
return /* @__PURE__ */ jsx(ComboboxPortal, { children: /* @__PURE__ */ jsx(
|
|
523
|
+
Combobox$1.Positioner,
|
|
524
|
+
{
|
|
525
|
+
align,
|
|
526
|
+
alignOffset,
|
|
527
|
+
positionMethod,
|
|
528
|
+
side,
|
|
529
|
+
sideOffset,
|
|
530
|
+
style: { zIndex: 50 },
|
|
531
|
+
children: /* @__PURE__ */ jsx(
|
|
532
|
+
Combobox$1.Popup,
|
|
533
|
+
{
|
|
534
|
+
className: `${popup$3}${className ? ` ${className}` : ""}`,
|
|
535
|
+
...popupProps,
|
|
536
|
+
children
|
|
537
|
+
}
|
|
538
|
+
)
|
|
539
|
+
}
|
|
540
|
+
) });
|
|
566
541
|
}
|
|
567
542
|
function ComboboxList(props) {
|
|
568
|
-
|
|
543
|
+
return /* @__PURE__ */ jsx(Combobox$1.List, { ...props });
|
|
569
544
|
}
|
|
570
545
|
function ComboboxItem({ className, ...props }) {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
546
|
+
return /* @__PURE__ */ jsx(
|
|
547
|
+
Combobox$1.Item,
|
|
548
|
+
{
|
|
549
|
+
className: `${item$2}${className ? ` ${className}` : ""}`,
|
|
550
|
+
...props
|
|
551
|
+
}
|
|
552
|
+
);
|
|
575
553
|
}
|
|
576
554
|
function ComboboxItemIndicator(props) {
|
|
577
|
-
|
|
555
|
+
return /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, { ...props });
|
|
578
556
|
}
|
|
579
557
|
function ComboboxEmpty({ className, ...props }) {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
558
|
+
return /* @__PURE__ */ jsx(
|
|
559
|
+
Combobox$1.Empty,
|
|
560
|
+
{
|
|
561
|
+
className: `${empty}${className ? ` ${className}` : ""}`,
|
|
562
|
+
...props
|
|
563
|
+
}
|
|
564
|
+
);
|
|
584
565
|
}
|
|
585
566
|
function ComboboxGroup(props) {
|
|
586
|
-
|
|
567
|
+
return /* @__PURE__ */ jsx(Combobox$1.Group, { ...props });
|
|
587
568
|
}
|
|
588
569
|
function ComboboxGroupLabel(props) {
|
|
589
|
-
|
|
570
|
+
return /* @__PURE__ */ jsx(Combobox$1.GroupLabel, { ...props });
|
|
590
571
|
}
|
|
591
|
-
//#endregion
|
|
592
|
-
//#region src/components/dialog/styles.css.ts
|
|
593
572
|
var backdrop = "vwlngv4";
|
|
594
573
|
var popup$2 = "vwlngv5";
|
|
574
|
+
var closeButton = "vwlngv6";
|
|
595
575
|
var header = "vwlngv7";
|
|
596
576
|
var headerContent = "vwlngv8";
|
|
577
|
+
var headerCloseButton = "vwlngv9";
|
|
597
578
|
var footer = "vwlngva";
|
|
598
579
|
var title = "vwlngvb";
|
|
599
580
|
var description = "vwlngvc";
|
|
@@ -602,320 +583,328 @@ var sheetContainer = "vwlngvg";
|
|
|
602
583
|
var sheetDragHandle = "vwlngvh";
|
|
603
584
|
var sheetDragPill = "vwlngvi";
|
|
604
585
|
var sheetContent = "vwlngvj";
|
|
605
|
-
|
|
606
|
-
//#region src/components/dialog/index.tsx
|
|
586
|
+
var sheetHeader = "vwlngvk";
|
|
607
587
|
function Dialog(props) {
|
|
608
|
-
|
|
588
|
+
return /* @__PURE__ */ jsx(Dialog$1.Root, { ...props });
|
|
609
589
|
}
|
|
610
590
|
function DialogTrigger(props) {
|
|
611
|
-
|
|
591
|
+
return /* @__PURE__ */ jsx(Dialog$1.Trigger, { ...props });
|
|
612
592
|
}
|
|
613
593
|
function DialogPortal({ children, ...props }) {
|
|
614
|
-
|
|
615
|
-
...props,
|
|
616
|
-
children: /* @__PURE__ */ jsx(PortalThemeWrapper$1, { children })
|
|
617
|
-
});
|
|
594
|
+
return /* @__PURE__ */ jsx(Dialog$1.Portal, { ...props, children: /* @__PURE__ */ jsx(PortalThemeWrapper, { children }) });
|
|
618
595
|
}
|
|
619
596
|
function DialogBackdrop({ className, ...props }) {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
597
|
+
return /* @__PURE__ */ jsx(
|
|
598
|
+
Dialog$1.Backdrop,
|
|
599
|
+
{
|
|
600
|
+
className: `${backdrop}${className ? ` ${className}` : ""}`,
|
|
601
|
+
...props
|
|
602
|
+
}
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
function DialogPopup({
|
|
606
|
+
showCloseButton = true,
|
|
607
|
+
className,
|
|
608
|
+
children,
|
|
609
|
+
...props
|
|
610
|
+
}) {
|
|
611
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
612
|
+
/* @__PURE__ */ jsx(DialogBackdrop, {}),
|
|
613
|
+
/* @__PURE__ */ jsxs(
|
|
614
|
+
Dialog$1.Popup,
|
|
615
|
+
{
|
|
616
|
+
className: `${popup$2}${className ? ` ${className}` : ""}`,
|
|
617
|
+
...props,
|
|
618
|
+
children: [
|
|
619
|
+
children,
|
|
620
|
+
showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { className: closeButton, children: /* @__PURE__ */ jsx(X, {}) })
|
|
621
|
+
]
|
|
622
|
+
}
|
|
623
|
+
)
|
|
624
|
+
] });
|
|
634
625
|
}
|
|
635
626
|
function DialogClose(props) {
|
|
636
|
-
|
|
627
|
+
return /* @__PURE__ */ jsx(Dialog$1.Close, { ...props });
|
|
637
628
|
}
|
|
638
629
|
function DialogHeader({ className, children, ...props }) {
|
|
639
|
-
|
|
640
|
-
className: `${header}${className ? ` ${className}` : ""}`,
|
|
641
|
-
...props,
|
|
642
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
643
|
-
className: headerContent,
|
|
644
|
-
children
|
|
645
|
-
})
|
|
646
|
-
});
|
|
630
|
+
return /* @__PURE__ */ jsx("div", { className: `${header}${className ? ` ${className}` : ""}`, ...props, children: /* @__PURE__ */ jsx("div", { className: headerContent, children }) });
|
|
647
631
|
}
|
|
648
632
|
function DialogFooter({ className, ...props }) {
|
|
649
|
-
|
|
650
|
-
className: `${footer}${className ? ` ${className}` : ""}`,
|
|
651
|
-
...props
|
|
652
|
-
});
|
|
633
|
+
return /* @__PURE__ */ jsx("div", { className: `${footer}${className ? ` ${className}` : ""}`, ...props });
|
|
653
634
|
}
|
|
654
635
|
function DialogTitle({ className, ...props }) {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
636
|
+
return /* @__PURE__ */ jsx(
|
|
637
|
+
Dialog$1.Title,
|
|
638
|
+
{
|
|
639
|
+
className: `${title}${className ? ` ${className}` : ""}`,
|
|
640
|
+
...props
|
|
641
|
+
}
|
|
642
|
+
);
|
|
659
643
|
}
|
|
660
644
|
function DialogDescription({ className, ...props }) {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
645
|
+
return /* @__PURE__ */ jsx(
|
|
646
|
+
Dialog$1.Description,
|
|
647
|
+
{
|
|
648
|
+
className: `${description}${className ? ` ${className}` : ""}`,
|
|
649
|
+
...props
|
|
650
|
+
}
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
let stack = [];
|
|
654
|
+
let idCounter = 0;
|
|
655
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
671
656
|
function emit() {
|
|
672
|
-
|
|
657
|
+
for (const fn of listeners) fn();
|
|
673
658
|
}
|
|
674
659
|
function subscribe(fn) {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
660
|
+
listeners.add(fn);
|
|
661
|
+
return () => {
|
|
662
|
+
listeners.delete(fn);
|
|
663
|
+
};
|
|
679
664
|
}
|
|
680
665
|
function getSnapshot() {
|
|
681
|
-
|
|
666
|
+
return stack;
|
|
682
667
|
}
|
|
683
668
|
function presentDialog(props) {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
open: true
|
|
689
|
-
}];
|
|
690
|
-
emit();
|
|
691
|
-
return () => dismissDialog(id);
|
|
669
|
+
const id = `dialog-${++idCounter}`;
|
|
670
|
+
stack = [...stack, { ...props, id, open: true }];
|
|
671
|
+
emit();
|
|
672
|
+
return () => dismissDialog(id);
|
|
692
673
|
}
|
|
693
674
|
function removeDialog(id) {
|
|
694
|
-
|
|
695
|
-
|
|
675
|
+
stack = stack.filter((item2) => item2.id !== id);
|
|
676
|
+
emit();
|
|
696
677
|
}
|
|
697
678
|
function dismissDialog(id) {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
open: false
|
|
701
|
-
} : item);
|
|
702
|
-
emit();
|
|
679
|
+
stack = stack.map((item2) => item2.id === id ? { ...item2, open: false } : item2);
|
|
680
|
+
emit();
|
|
703
681
|
}
|
|
704
682
|
function dismissTopDialog() {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
683
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
684
|
+
if (stack[i].open) {
|
|
685
|
+
dismissDialog(stack[i].id);
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
709
689
|
}
|
|
710
690
|
function dismissAllDialogs() {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
691
|
+
stack = stack.map((item2) => ({ ...item2, open: false }));
|
|
692
|
+
emit();
|
|
693
|
+
}
|
|
694
|
+
const SheetStackEntry = ({ item: item2, index }) => {
|
|
695
|
+
const {
|
|
696
|
+
id,
|
|
697
|
+
open,
|
|
698
|
+
title: title$12,
|
|
699
|
+
description: description$12,
|
|
700
|
+
content,
|
|
701
|
+
className,
|
|
702
|
+
portalClassName,
|
|
703
|
+
theme = "light",
|
|
704
|
+
clickOutsideToDismiss = true
|
|
705
|
+
} = item2;
|
|
706
|
+
const dismiss = useCallback(() => dismissDialog(id), [id]);
|
|
707
|
+
useEffect(() => {
|
|
708
|
+
if (!open) {
|
|
709
|
+
const timer = setTimeout(() => removeDialog(id), 200);
|
|
710
|
+
return () => clearTimeout(timer);
|
|
711
|
+
}
|
|
712
|
+
}, [open, id]);
|
|
713
|
+
useEffect(() => {
|
|
714
|
+
const original = document.body.style.overflow;
|
|
715
|
+
document.body.style.overflow = "hidden";
|
|
716
|
+
return () => {
|
|
717
|
+
document.body.style.overflow = original;
|
|
718
|
+
};
|
|
719
|
+
}, []);
|
|
720
|
+
const sheetRef = useRef(null);
|
|
721
|
+
const contentRef = useRef(null);
|
|
722
|
+
const dragState = useRef(null);
|
|
723
|
+
const [translateY, setTranslateY] = useState(0);
|
|
724
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
725
|
+
const handleTouchStart = useCallback((e) => {
|
|
726
|
+
const touch = e.touches[0];
|
|
727
|
+
const target = e.target;
|
|
728
|
+
const isHandle = target.closest(`.${sheetDragHandle}`) !== null;
|
|
729
|
+
const contentEl = contentRef.current;
|
|
730
|
+
const isContentAtTop = !contentEl || contentEl.scrollTop <= 0;
|
|
731
|
+
if (!isHandle && !isContentAtTop) return;
|
|
732
|
+
dragState.current = {
|
|
733
|
+
startY: touch.clientY,
|
|
734
|
+
startTime: Date.now(),
|
|
735
|
+
currentY: touch.clientY,
|
|
736
|
+
isDragging: false
|
|
737
|
+
};
|
|
738
|
+
}, []);
|
|
739
|
+
const handleTouchMove = useCallback((e) => {
|
|
740
|
+
const state = dragState.current;
|
|
741
|
+
if (!state) return;
|
|
742
|
+
const touch = e.touches[0];
|
|
743
|
+
const deltaY = touch.clientY - state.startY;
|
|
744
|
+
if (deltaY < 0) {
|
|
745
|
+
if (state.isDragging) {
|
|
746
|
+
setTranslateY(0);
|
|
747
|
+
setIsDragging(false);
|
|
748
|
+
state.isDragging = false;
|
|
749
|
+
}
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
if (!state.isDragging && deltaY > 5) {
|
|
753
|
+
state.isDragging = true;
|
|
754
|
+
setIsDragging(true);
|
|
755
|
+
}
|
|
756
|
+
if (state.isDragging) {
|
|
757
|
+
e.preventDefault();
|
|
758
|
+
state.currentY = touch.clientY;
|
|
759
|
+
setTranslateY(deltaY);
|
|
760
|
+
}
|
|
761
|
+
}, []);
|
|
762
|
+
const handleTouchEnd = useCallback(() => {
|
|
763
|
+
const state = dragState.current;
|
|
764
|
+
if (!state || !state.isDragging) {
|
|
765
|
+
dragState.current = null;
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
const deltaY = state.currentY - state.startY;
|
|
769
|
+
const elapsed = Date.now() - state.startTime;
|
|
770
|
+
const velocity = deltaY / Math.max(elapsed, 1) * 1e3;
|
|
771
|
+
const sheetHeight2 = sheetRef.current?.offsetHeight ?? 0;
|
|
772
|
+
const threshold = sheetHeight2 * 0.25;
|
|
773
|
+
if (deltaY > threshold || velocity > 500) {
|
|
774
|
+
dismiss();
|
|
775
|
+
} else {
|
|
776
|
+
setTranslateY(0);
|
|
777
|
+
}
|
|
778
|
+
setIsDragging(false);
|
|
779
|
+
dragState.current = null;
|
|
780
|
+
}, [dismiss]);
|
|
781
|
+
const zIndex = 50 + index;
|
|
782
|
+
const sheetHeight = sheetRef.current?.offsetHeight || 1;
|
|
783
|
+
const backdropOpacity = isDragging ? Math.max(0, 1 - translateY / sheetHeight) * 0.5 : 0.5;
|
|
784
|
+
return /* @__PURE__ */ jsx(PortalThemeProvider, { className: portalClassName ?? "", theme, children: /* @__PURE__ */ jsxs(PortalThemeWrapper, { children: [
|
|
785
|
+
/* @__PURE__ */ jsx(
|
|
786
|
+
"div",
|
|
787
|
+
{
|
|
788
|
+
className: sheetBackdrop,
|
|
789
|
+
style: {
|
|
790
|
+
zIndex,
|
|
791
|
+
opacity: open ? backdropOpacity : 0,
|
|
792
|
+
pointerEvents: open ? "auto" : "none"
|
|
793
|
+
},
|
|
794
|
+
onClick: clickOutsideToDismiss ? dismiss : void 0
|
|
795
|
+
}
|
|
796
|
+
),
|
|
797
|
+
/* @__PURE__ */ jsxs(
|
|
798
|
+
"div",
|
|
799
|
+
{
|
|
800
|
+
className: `${sheetContainer}${className ? ` ${className}` : ""}`,
|
|
801
|
+
"data-closed": !open ? "" : void 0,
|
|
802
|
+
"data-open": open ? "" : void 0,
|
|
803
|
+
ref: sheetRef,
|
|
804
|
+
style: {
|
|
805
|
+
zIndex: zIndex + 1,
|
|
806
|
+
transform: isDragging ? `translateY(${translateY}px)` : void 0,
|
|
807
|
+
transition: isDragging ? "none" : "transform 300ms cubic-bezier(0.32, 0.72, 0, 1)"
|
|
808
|
+
},
|
|
809
|
+
onTouchEnd: handleTouchEnd,
|
|
810
|
+
onTouchMove: handleTouchMove,
|
|
811
|
+
onTouchStart: handleTouchStart,
|
|
812
|
+
children: [
|
|
813
|
+
/* @__PURE__ */ jsx("div", { className: sheetDragHandle, children: /* @__PURE__ */ jsx("div", { className: sheetDragPill }) }),
|
|
814
|
+
(title$12 || description$12) && /* @__PURE__ */ jsxs("div", { className: sheetHeader, children: [
|
|
815
|
+
title$12 && /* @__PURE__ */ jsx("div", { className: title, children: title$12 }),
|
|
816
|
+
description$12 && /* @__PURE__ */ jsx("div", { className: description, children: description$12 })
|
|
817
|
+
] }),
|
|
818
|
+
/* @__PURE__ */ jsx("div", { className: sheetContent, ref: contentRef, children: createElement(content, { dismiss }) })
|
|
819
|
+
]
|
|
820
|
+
}
|
|
821
|
+
)
|
|
822
|
+
] }) });
|
|
840
823
|
};
|
|
841
|
-
|
|
842
|
-
//#region src/components/dialog/stack.tsx
|
|
843
|
-
var MOBILE_QUERY = "(max-width: 640px)";
|
|
824
|
+
const MOBILE_QUERY = "(max-width: 640px)";
|
|
844
825
|
function useIsMobile() {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
826
|
+
return useSyncExternalStore(
|
|
827
|
+
(cb) => {
|
|
828
|
+
const mql = window.matchMedia(MOBILE_QUERY);
|
|
829
|
+
mql.addEventListener("change", cb);
|
|
830
|
+
return () => mql.removeEventListener("change", cb);
|
|
831
|
+
},
|
|
832
|
+
() => window.matchMedia(MOBILE_QUERY).matches,
|
|
833
|
+
() => false
|
|
834
|
+
);
|
|
850
835
|
}
|
|
851
836
|
function shouldUseSheet(sheet, isMobile) {
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
837
|
+
if (sheet === true) return true;
|
|
838
|
+
if (sheet === "auto") return isMobile;
|
|
839
|
+
return false;
|
|
840
|
+
}
|
|
841
|
+
const CloseIcon = () => /* @__PURE__ */ jsx(X, {});
|
|
842
|
+
const DialogStackEntry = ({ item: item2, index }) => {
|
|
843
|
+
const {
|
|
844
|
+
id,
|
|
845
|
+
open,
|
|
846
|
+
title: title$12,
|
|
847
|
+
description: description$12,
|
|
848
|
+
content,
|
|
849
|
+
className,
|
|
850
|
+
portalClassName,
|
|
851
|
+
theme = "light",
|
|
852
|
+
showCloseButton = true,
|
|
853
|
+
clickOutsideToDismiss = true
|
|
854
|
+
} = item2;
|
|
855
|
+
const dismiss = useCallback(() => dismissDialog(id), [id]);
|
|
856
|
+
useEffect(() => {
|
|
857
|
+
if (!open) {
|
|
858
|
+
const timer = setTimeout(() => {
|
|
859
|
+
removeDialog(id);
|
|
860
|
+
}, 150);
|
|
861
|
+
return () => clearTimeout(timer);
|
|
862
|
+
}
|
|
863
|
+
}, [open, id]);
|
|
864
|
+
const zIndex = 50 + index;
|
|
865
|
+
return /* @__PURE__ */ jsx(
|
|
866
|
+
Dialog$1.Root,
|
|
867
|
+
{
|
|
868
|
+
disablePointerDismissal: !clickOutsideToDismiss,
|
|
869
|
+
open,
|
|
870
|
+
onOpenChange: (open2) => {
|
|
871
|
+
if (!open2) dismiss();
|
|
872
|
+
},
|
|
873
|
+
children: /* @__PURE__ */ jsx(Dialog$1.Portal, { children: /* @__PURE__ */ jsx(PortalThemeProvider, { className: portalClassName ?? "", theme, children: /* @__PURE__ */ jsxs(PortalThemeWrapper, { children: [
|
|
874
|
+
/* @__PURE__ */ jsx(Dialog$1.Backdrop, { className: backdrop, style: { zIndex } }),
|
|
875
|
+
/* @__PURE__ */ jsxs(
|
|
876
|
+
Dialog$1.Popup,
|
|
877
|
+
{
|
|
878
|
+
suppressHydrationWarning: true,
|
|
879
|
+
className: `${popup$2}${className ? ` ${className}` : ""}`,
|
|
880
|
+
"data-theme": theme,
|
|
881
|
+
style: { zIndex: zIndex + 1 },
|
|
882
|
+
children: [
|
|
883
|
+
(title$12 || description$12 || showCloseButton) && /* @__PURE__ */ jsxs("div", { className: header, children: [
|
|
884
|
+
(title$12 || description$12) && /* @__PURE__ */ jsxs("div", { className: headerContent, children: [
|
|
885
|
+
title$12 && /* @__PURE__ */ jsx(Dialog$1.Title, { className: title, children: title$12 }),
|
|
886
|
+
description$12 && /* @__PURE__ */ jsx(Dialog$1.Description, { className: description, children: description$12 })
|
|
887
|
+
] }),
|
|
888
|
+
showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { className: headerCloseButton, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
|
|
889
|
+
] }),
|
|
890
|
+
createElement(content, { dismiss })
|
|
891
|
+
]
|
|
892
|
+
}
|
|
893
|
+
)
|
|
894
|
+
] }) }) })
|
|
895
|
+
}
|
|
896
|
+
);
|
|
905
897
|
};
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}, item.id))] });
|
|
898
|
+
const DialogStackProvider = ({ children }) => {
|
|
899
|
+
const stack2 = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
900
|
+
const isMobile = useIsMobile();
|
|
901
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
902
|
+
children,
|
|
903
|
+
stack2.map(
|
|
904
|
+
(item2, index) => shouldUseSheet(item2.sheet, isMobile) ? /* @__PURE__ */ jsx(SheetStackEntry, { index, item: item2 }, item2.id) : /* @__PURE__ */ jsx(DialogStackEntry, { index, item: item2 }, item2.id)
|
|
905
|
+
)
|
|
906
|
+
] });
|
|
916
907
|
};
|
|
917
|
-
//#endregion
|
|
918
|
-
//#region src/components/dropdown-menu/styles.css.ts
|
|
919
908
|
var popup$1 = "oih0op0";
|
|
920
909
|
var positioner$1 = "oih0op1";
|
|
921
910
|
var item$1 = "oih0op2";
|
|
@@ -925,331 +914,397 @@ var checkboxItem = "oih0op3";
|
|
|
925
914
|
var radioItem = "oih0op3";
|
|
926
915
|
var checkboxIndicator = "oih0op4";
|
|
927
916
|
var radioIndicator = "oih0op5";
|
|
928
|
-
//#endregion
|
|
929
|
-
//#region src/components/dropdown-menu/index.tsx
|
|
930
917
|
function DropdownMenu(props) {
|
|
931
|
-
|
|
932
|
-
"data-slot": "dropdown-menu",
|
|
933
|
-
...props
|
|
934
|
-
});
|
|
918
|
+
return /* @__PURE__ */ jsx(Menu.Root, { "data-slot": "dropdown-menu", ...props });
|
|
935
919
|
}
|
|
936
920
|
function DropdownMenuTrigger(props) {
|
|
937
|
-
|
|
938
|
-
"data-slot": "dropdown-menu-trigger",
|
|
939
|
-
...props
|
|
940
|
-
});
|
|
921
|
+
return /* @__PURE__ */ jsx(Menu.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
941
922
|
}
|
|
942
923
|
function DropdownMenuPortal({ children }) {
|
|
943
|
-
|
|
944
|
-
}
|
|
945
|
-
function DropdownMenuContent({
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
924
|
+
return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(PortalThemeWrapper, { children }) });
|
|
925
|
+
}
|
|
926
|
+
function DropdownMenuContent({
|
|
927
|
+
align = "start",
|
|
928
|
+
alignOffset = 0,
|
|
929
|
+
side = "bottom",
|
|
930
|
+
sideOffset = 4,
|
|
931
|
+
className,
|
|
932
|
+
positionMethod = "absolute",
|
|
933
|
+
children,
|
|
934
|
+
...popupProps
|
|
935
|
+
}) {
|
|
936
|
+
return /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(
|
|
937
|
+
Menu.Positioner,
|
|
938
|
+
{
|
|
939
|
+
align,
|
|
940
|
+
alignOffset,
|
|
941
|
+
className: positioner$1,
|
|
942
|
+
"data-slot": "dropdown-menu-positioner",
|
|
943
|
+
positionMethod,
|
|
944
|
+
side,
|
|
945
|
+
sideOffset,
|
|
946
|
+
style: { zIndex: 50 },
|
|
947
|
+
children: /* @__PURE__ */ jsx(
|
|
948
|
+
Menu.Popup,
|
|
949
|
+
{
|
|
950
|
+
className: `${popup$1}${className ? ` ${className}` : ""}`,
|
|
951
|
+
"data-slot": "dropdown-menu-content",
|
|
952
|
+
...popupProps,
|
|
953
|
+
children
|
|
954
|
+
}
|
|
955
|
+
)
|
|
956
|
+
}
|
|
957
|
+
) });
|
|
962
958
|
}
|
|
963
959
|
function DropdownMenuGroup(props) {
|
|
964
|
-
|
|
965
|
-
"data-slot": "dropdown-menu-group",
|
|
966
|
-
...props
|
|
967
|
-
});
|
|
960
|
+
return /* @__PURE__ */ jsx(Menu.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
968
961
|
}
|
|
969
962
|
function DropdownMenuLabel({ className, ...props }) {
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
963
|
+
return /* @__PURE__ */ jsx(
|
|
964
|
+
Menu.GroupLabel,
|
|
965
|
+
{
|
|
966
|
+
className: `${label}${className ? ` ${className}` : ""}`,
|
|
967
|
+
"data-slot": "dropdown-menu-label",
|
|
968
|
+
...props
|
|
969
|
+
}
|
|
970
|
+
);
|
|
975
971
|
}
|
|
976
972
|
function DropdownMenuItem({ className, ...props }) {
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
973
|
+
return /* @__PURE__ */ jsx(
|
|
974
|
+
Menu.Item,
|
|
975
|
+
{
|
|
976
|
+
className: `${item$1}${className ? ` ${className}` : ""}`,
|
|
977
|
+
"data-slot": "dropdown-menu-item",
|
|
978
|
+
...props
|
|
979
|
+
}
|
|
980
|
+
);
|
|
982
981
|
}
|
|
983
982
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
983
|
+
return /* @__PURE__ */ jsx(
|
|
984
|
+
Menu.Separator,
|
|
985
|
+
{
|
|
986
|
+
className: `${separator}${className ? ` ${className}` : ""}`,
|
|
987
|
+
"data-slot": "dropdown-menu-separator",
|
|
988
|
+
...props
|
|
989
|
+
}
|
|
990
|
+
);
|
|
989
991
|
}
|
|
990
992
|
function DropdownMenuRadioGroup(props) {
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
993
|
+
return /* @__PURE__ */ jsx(Menu.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
|
|
994
|
+
}
|
|
995
|
+
function DropdownMenuRadioItem({
|
|
996
|
+
className,
|
|
997
|
+
children,
|
|
998
|
+
...props
|
|
999
|
+
}) {
|
|
1000
|
+
return /* @__PURE__ */ jsxs(
|
|
1001
|
+
Menu.RadioItem,
|
|
1002
|
+
{
|
|
1003
|
+
className: `${item$1} ${radioItem}${className ? ` ${className}` : ""}`,
|
|
1004
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
1005
|
+
...props,
|
|
1006
|
+
children: [
|
|
1007
|
+
children,
|
|
1008
|
+
/* @__PURE__ */ jsx(
|
|
1009
|
+
Menu.RadioItemIndicator,
|
|
1010
|
+
{
|
|
1011
|
+
className: radioIndicator,
|
|
1012
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
1013
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
1014
|
+
}
|
|
1015
|
+
)
|
|
1016
|
+
]
|
|
1017
|
+
}
|
|
1018
|
+
);
|
|
1019
|
+
}
|
|
1020
|
+
function DropdownMenuCheckboxItem({
|
|
1021
|
+
className,
|
|
1022
|
+
children,
|
|
1023
|
+
...props
|
|
1024
|
+
}) {
|
|
1025
|
+
return /* @__PURE__ */ jsxs(
|
|
1026
|
+
Menu.CheckboxItem,
|
|
1027
|
+
{
|
|
1028
|
+
className: `${item$1} ${checkboxItem}${className ? ` ${className}` : ""}`,
|
|
1029
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
1030
|
+
...props,
|
|
1031
|
+
children: [
|
|
1032
|
+
children,
|
|
1033
|
+
/* @__PURE__ */ jsx(
|
|
1034
|
+
Menu.CheckboxItemIndicator,
|
|
1035
|
+
{
|
|
1036
|
+
className: checkboxIndicator,
|
|
1037
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
1038
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
1039
|
+
}
|
|
1040
|
+
)
|
|
1041
|
+
]
|
|
1042
|
+
}
|
|
1043
|
+
);
|
|
1019
1044
|
}
|
|
1020
1045
|
function CheckIcon() {
|
|
1021
|
-
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
var
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
size,
|
|
1148
|
-
fullWidth
|
|
1149
|
-
})} ${className || ""}`.trim(),
|
|
1150
|
-
ref: containerRef,
|
|
1151
|
-
role: "tablist",
|
|
1152
|
-
onKeyDown: handleKeyDown,
|
|
1153
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
1154
|
-
"aria-hidden": "true",
|
|
1155
|
-
className: indicator({ ready: isReady }),
|
|
1156
|
-
style: {
|
|
1157
|
-
left: indicator$2.left,
|
|
1158
|
-
width: indicator$2.width
|
|
1159
|
-
}
|
|
1160
|
-
}), items.map((item$3) => {
|
|
1161
|
-
const isActive = item$3.value === value;
|
|
1162
|
-
return /* @__PURE__ */ jsx("button", {
|
|
1163
|
-
"aria-selected": isActive,
|
|
1164
|
-
"data-active": isActive || void 0,
|
|
1165
|
-
disabled: item$3.disabled,
|
|
1166
|
-
role: "tab",
|
|
1167
|
-
tabIndex: isActive ? 0 : -1,
|
|
1168
|
-
type: "button",
|
|
1169
|
-
className: item({
|
|
1170
|
-
size,
|
|
1171
|
-
active: isActive,
|
|
1172
|
-
disabled: Boolean(item$3.disabled),
|
|
1173
|
-
fullWidth
|
|
1174
|
-
}),
|
|
1175
|
-
ref: (el) => {
|
|
1176
|
-
if (el) itemElementsRef.current.set(item$3.value, el);
|
|
1177
|
-
else itemElementsRef.current.delete(item$3.value);
|
|
1178
|
-
},
|
|
1179
|
-
onClick: () => onChange(item$3.value),
|
|
1180
|
-
children: item$3.label
|
|
1181
|
-
}, item$3.value);
|
|
1182
|
-
})]
|
|
1183
|
-
});
|
|
1184
|
-
}
|
|
1185
|
-
//#endregion
|
|
1186
|
-
//#region src/components/tooltip/styles.css.ts
|
|
1046
|
+
return /* @__PURE__ */ jsx(Check, { size: 16 });
|
|
1047
|
+
}
|
|
1048
|
+
var container = createRuntimeFn({ defaultClassName: "_6d8tz20", variantClassNames: { size: { sm: "_6d8tz21", md: "_6d8tz22" }, fullWidth: { true: "_6d8tz23", false: "_6d8tz24" } }, defaultVariants: { size: "sm", fullWidth: false }, compoundVariants: [] });
|
|
1049
|
+
var indicator = createRuntimeFn({ defaultClassName: "_6d8tz25", variantClassNames: { ready: { true: "_6d8tz26", false: "_6d8tz27" } }, defaultVariants: { ready: true }, compoundVariants: [] });
|
|
1050
|
+
var item = createRuntimeFn({ defaultClassName: "_6d8tz28", variantClassNames: { size: { sm: "_6d8tz29", md: "_6d8tz2a" }, active: { true: "_6d8tz2b", false: "_6d8tz2c" }, disabled: { true: "_6d8tz2d", false: "_6d8tz2e" }, fullWidth: { true: "_6d8tz2f", false: "_6d8tz2g" } }, defaultVariants: { size: "sm", active: false, disabled: false, fullWidth: false }, compoundVariants: [] });
|
|
1051
|
+
function SegmentedControl({
|
|
1052
|
+
items,
|
|
1053
|
+
value,
|
|
1054
|
+
onChange,
|
|
1055
|
+
size = "sm",
|
|
1056
|
+
fullWidth = false,
|
|
1057
|
+
className
|
|
1058
|
+
}) {
|
|
1059
|
+
const containerRef = useRef(null);
|
|
1060
|
+
const itemElementsRef = useRef(/* @__PURE__ */ new Map());
|
|
1061
|
+
const [indicator$12, setIndicator] = useState({ left: 0, width: 0 });
|
|
1062
|
+
const [isReady, setIsReady] = useState(false);
|
|
1063
|
+
const updateIndicator = useCallback(() => {
|
|
1064
|
+
const container2 = containerRef.current;
|
|
1065
|
+
const activeEl = itemElementsRef.current.get(value);
|
|
1066
|
+
if (!container2 || !activeEl) return;
|
|
1067
|
+
const containerRect = container2.getBoundingClientRect();
|
|
1068
|
+
const activeRect = activeEl.getBoundingClientRect();
|
|
1069
|
+
setIndicator({
|
|
1070
|
+
left: activeRect.left - containerRect.left,
|
|
1071
|
+
width: activeRect.width
|
|
1072
|
+
});
|
|
1073
|
+
setIsReady(true);
|
|
1074
|
+
}, [value]);
|
|
1075
|
+
useEffect(() => {
|
|
1076
|
+
updateIndicator();
|
|
1077
|
+
}, [updateIndicator]);
|
|
1078
|
+
useEffect(() => {
|
|
1079
|
+
const container2 = containerRef.current;
|
|
1080
|
+
if (!container2) return;
|
|
1081
|
+
const observer = new ResizeObserver(() => {
|
|
1082
|
+
updateIndicator();
|
|
1083
|
+
});
|
|
1084
|
+
observer.observe(container2);
|
|
1085
|
+
return () => observer.disconnect();
|
|
1086
|
+
}, [updateIndicator]);
|
|
1087
|
+
const handleKeyDown = (e) => {
|
|
1088
|
+
const enabledItems = items.filter((item2) => !item2.disabled);
|
|
1089
|
+
const currentIndex = enabledItems.findIndex((item2) => item2.value === value);
|
|
1090
|
+
let nextIndex = currentIndex;
|
|
1091
|
+
switch (e.key) {
|
|
1092
|
+
case "ArrowRight":
|
|
1093
|
+
case "ArrowDown": {
|
|
1094
|
+
e.preventDefault();
|
|
1095
|
+
nextIndex = (currentIndex + 1) % enabledItems.length;
|
|
1096
|
+
break;
|
|
1097
|
+
}
|
|
1098
|
+
case "ArrowLeft":
|
|
1099
|
+
case "ArrowUp": {
|
|
1100
|
+
e.preventDefault();
|
|
1101
|
+
nextIndex = (currentIndex - 1 + enabledItems.length) % enabledItems.length;
|
|
1102
|
+
break;
|
|
1103
|
+
}
|
|
1104
|
+
case "Home": {
|
|
1105
|
+
e.preventDefault();
|
|
1106
|
+
nextIndex = 0;
|
|
1107
|
+
break;
|
|
1108
|
+
}
|
|
1109
|
+
case "End": {
|
|
1110
|
+
e.preventDefault();
|
|
1111
|
+
nextIndex = enabledItems.length - 1;
|
|
1112
|
+
break;
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
if (nextIndex !== currentIndex) {
|
|
1116
|
+
const nextItem = enabledItems[nextIndex];
|
|
1117
|
+
onChange(nextItem.value);
|
|
1118
|
+
itemElementsRef.current.get(nextItem.value)?.focus();
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
return /* @__PURE__ */ jsxs(
|
|
1122
|
+
"div",
|
|
1123
|
+
{
|
|
1124
|
+
"aria-orientation": "horizontal",
|
|
1125
|
+
className: `${container({ size, fullWidth })} ${className || ""}`.trim(),
|
|
1126
|
+
ref: containerRef,
|
|
1127
|
+
role: "tablist",
|
|
1128
|
+
onKeyDown: handleKeyDown,
|
|
1129
|
+
children: [
|
|
1130
|
+
/* @__PURE__ */ jsx(
|
|
1131
|
+
"div",
|
|
1132
|
+
{
|
|
1133
|
+
"aria-hidden": "true",
|
|
1134
|
+
className: indicator({ ready: isReady }),
|
|
1135
|
+
style: {
|
|
1136
|
+
left: indicator$12.left,
|
|
1137
|
+
width: indicator$12.width
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
),
|
|
1141
|
+
items.map((item$12) => {
|
|
1142
|
+
const isActive = item$12.value === value;
|
|
1143
|
+
return /* @__PURE__ */ jsx(
|
|
1144
|
+
"button",
|
|
1145
|
+
{
|
|
1146
|
+
"aria-selected": isActive,
|
|
1147
|
+
"data-active": isActive || void 0,
|
|
1148
|
+
disabled: item$12.disabled,
|
|
1149
|
+
role: "tab",
|
|
1150
|
+
tabIndex: isActive ? 0 : -1,
|
|
1151
|
+
type: "button",
|
|
1152
|
+
className: item({
|
|
1153
|
+
size,
|
|
1154
|
+
active: isActive,
|
|
1155
|
+
disabled: Boolean(item$12.disabled),
|
|
1156
|
+
fullWidth
|
|
1157
|
+
}),
|
|
1158
|
+
ref: (el) => {
|
|
1159
|
+
if (el) itemElementsRef.current.set(item$12.value, el);
|
|
1160
|
+
else itemElementsRef.current.delete(item$12.value);
|
|
1161
|
+
},
|
|
1162
|
+
onClick: () => onChange(item$12.value),
|
|
1163
|
+
children: item$12.label
|
|
1164
|
+
},
|
|
1165
|
+
item$12.value
|
|
1166
|
+
);
|
|
1167
|
+
})
|
|
1168
|
+
]
|
|
1169
|
+
}
|
|
1170
|
+
);
|
|
1171
|
+
}
|
|
1187
1172
|
var positioner = "_1cspf2m2";
|
|
1188
1173
|
var popup = "_1cspf2m3";
|
|
1189
|
-
//#endregion
|
|
1190
|
-
//#region src/components/tooltip/index.tsx
|
|
1191
1174
|
function TooltipProvider(props) {
|
|
1192
|
-
|
|
1175
|
+
return /* @__PURE__ */ jsx(Tooltip.Provider, { ...props });
|
|
1193
1176
|
}
|
|
1194
1177
|
function TooltipRoot(props) {
|
|
1195
|
-
|
|
1178
|
+
return /* @__PURE__ */ jsx(Tooltip.Root, { ...props });
|
|
1196
1179
|
}
|
|
1197
1180
|
function TooltipTrigger(props) {
|
|
1198
|
-
|
|
1181
|
+
return /* @__PURE__ */ jsx(Tooltip.Trigger, { ...props });
|
|
1199
1182
|
}
|
|
1200
1183
|
function TooltipPortal({ children, ...props }) {
|
|
1201
|
-
|
|
1202
|
-
...props,
|
|
1203
|
-
children: /* @__PURE__ */ jsx(PortalThemeWrapper$1, { children })
|
|
1204
|
-
});
|
|
1184
|
+
return /* @__PURE__ */ jsx(Tooltip.Portal, { ...props, children: /* @__PURE__ */ jsx(PortalThemeWrapper, { children }) });
|
|
1205
1185
|
}
|
|
1206
1186
|
function TooltipPositioner(props) {
|
|
1207
|
-
|
|
1187
|
+
return /* @__PURE__ */ jsx(Tooltip.Positioner, { ...props });
|
|
1208
1188
|
}
|
|
1209
1189
|
function TooltipPopup({ className, children, ...props }) {
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1190
|
+
return /* @__PURE__ */ jsx(
|
|
1191
|
+
Tooltip.Popup,
|
|
1192
|
+
{
|
|
1193
|
+
className: `${popup}${className ? ` ${className}` : ""}`,
|
|
1194
|
+
...props,
|
|
1195
|
+
children
|
|
1196
|
+
}
|
|
1197
|
+
);
|
|
1198
|
+
}
|
|
1199
|
+
function TooltipContent({
|
|
1200
|
+
side = "top",
|
|
1201
|
+
sideOffset = 6,
|
|
1202
|
+
align = "center",
|
|
1203
|
+
className,
|
|
1204
|
+
children,
|
|
1205
|
+
...popupProps
|
|
1206
|
+
}) {
|
|
1207
|
+
return /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsx(
|
|
1208
|
+
TooltipPositioner,
|
|
1209
|
+
{
|
|
1210
|
+
align,
|
|
1211
|
+
className: positioner,
|
|
1212
|
+
side,
|
|
1213
|
+
sideOffset,
|
|
1214
|
+
children: /* @__PURE__ */ jsx(TooltipPopup, { className, ...popupProps, children })
|
|
1215
|
+
}
|
|
1216
|
+
) });
|
|
1217
|
+
}
|
|
1218
|
+
const createTooltipHandle = Tooltip.createHandle;
|
|
1219
|
+
function ViewportGate({
|
|
1220
|
+
children,
|
|
1221
|
+
fallback,
|
|
1222
|
+
threshold = 0.5
|
|
1223
|
+
}) {
|
|
1224
|
+
const ref = useRef(null);
|
|
1225
|
+
const [visible, setVisible] = useState(false);
|
|
1226
|
+
useEffect(() => {
|
|
1227
|
+
if (visible) return;
|
|
1228
|
+
const el = ref.current;
|
|
1229
|
+
if (!el) return;
|
|
1230
|
+
const obs = new IntersectionObserver(
|
|
1231
|
+
(entries) => {
|
|
1232
|
+
if (entries.some((e) => e.isIntersecting)) {
|
|
1233
|
+
setVisible(true);
|
|
1234
|
+
obs.disconnect();
|
|
1235
|
+
}
|
|
1236
|
+
},
|
|
1237
|
+
{ threshold }
|
|
1238
|
+
);
|
|
1239
|
+
obs.observe(el);
|
|
1240
|
+
return () => obs.disconnect();
|
|
1241
|
+
}, [visible, threshold]);
|
|
1242
|
+
if (visible) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
1243
|
+
return /* @__PURE__ */ jsx("div", { ref, children: fallback });
|
|
1244
|
+
}
|
|
1245
|
+
export {
|
|
1246
|
+
ActionBar,
|
|
1247
|
+
ActionButton,
|
|
1248
|
+
AnimatedCheckbox,
|
|
1249
|
+
AnimatedTabs,
|
|
1250
|
+
ColorPicker,
|
|
1251
|
+
Combobox,
|
|
1252
|
+
ComboboxContent,
|
|
1253
|
+
ComboboxEmpty,
|
|
1254
|
+
ComboboxGroup,
|
|
1255
|
+
ComboboxGroupLabel,
|
|
1256
|
+
ComboboxInput,
|
|
1257
|
+
ComboboxItem,
|
|
1258
|
+
ComboboxItemIndicator,
|
|
1259
|
+
ComboboxList,
|
|
1260
|
+
Dialog,
|
|
1261
|
+
DialogBackdrop,
|
|
1262
|
+
DialogClose,
|
|
1263
|
+
DialogDescription,
|
|
1264
|
+
DialogFooter,
|
|
1265
|
+
DialogHeader,
|
|
1266
|
+
DialogPopup,
|
|
1267
|
+
DialogPortal,
|
|
1268
|
+
DialogStackProvider,
|
|
1269
|
+
DialogTitle,
|
|
1270
|
+
DialogTrigger,
|
|
1271
|
+
DropdownMenu,
|
|
1272
|
+
DropdownMenuCheckboxItem,
|
|
1273
|
+
DropdownMenuContent,
|
|
1274
|
+
DropdownMenuGroup,
|
|
1275
|
+
DropdownMenuItem,
|
|
1276
|
+
DropdownMenuLabel,
|
|
1277
|
+
DropdownMenuRadioGroup,
|
|
1278
|
+
DropdownMenuRadioItem,
|
|
1279
|
+
DropdownMenuSeparator,
|
|
1280
|
+
DropdownMenuTrigger,
|
|
1281
|
+
Popover,
|
|
1282
|
+
PopoverArrow,
|
|
1283
|
+
PopoverClose,
|
|
1284
|
+
PopoverDescription,
|
|
1285
|
+
PopoverPanel,
|
|
1286
|
+
PopoverPopup,
|
|
1287
|
+
PopoverPortal,
|
|
1288
|
+
PopoverPositioner,
|
|
1289
|
+
PopoverTitle,
|
|
1290
|
+
PopoverTrigger,
|
|
1291
|
+
PortalThemeProvider2 as PortalThemeProvider,
|
|
1292
|
+
PortalThemeWrapper2 as PortalThemeWrapper,
|
|
1293
|
+
SegmentedControl,
|
|
1294
|
+
TooltipContent,
|
|
1295
|
+
TooltipPopup,
|
|
1296
|
+
TooltipPortal,
|
|
1297
|
+
TooltipPositioner,
|
|
1298
|
+
TooltipProvider,
|
|
1299
|
+
TooltipRoot,
|
|
1300
|
+
TooltipTrigger,
|
|
1301
|
+
ViewportGate,
|
|
1302
|
+
createTooltipHandle,
|
|
1303
|
+
dismissAllDialogs,
|
|
1304
|
+
dismissDialog,
|
|
1305
|
+
dismissTopDialog,
|
|
1306
|
+
getActionButtonClassName,
|
|
1307
|
+
presentDialog,
|
|
1308
|
+
usePopover,
|
|
1309
|
+
usePortalTheme
|
|
1310
|
+
};
|