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