@haklex/rich-editor-ui 0.1.1 → 0.3.0
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 +1903 -1853
- package/dist/rich-editor-ui.css +2 -1
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -1,812 +1,886 @@
|
|
|
1
|
-
import { jsx, jsxs
|
|
2
|
-
import { AlertCircle, AlertTriangle,
|
|
3
|
-
import {
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AlertCircle, AlertTriangle, ArrowLeft, Check, ChevronDown, ChevronRight, ChevronUp, Copy, Info, Pipette, Plus, X } from "lucide-react";
|
|
3
|
+
import { createContext, createElement, forwardRef, use, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
|
|
5
5
|
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
6
|
-
import {
|
|
7
|
-
import { PortalThemeProvider as PortalThemeProvider2, PortalThemeWrapper as PortalThemeWrapper2, usePortalTheme } from "@haklex/rich-style-token";
|
|
6
|
+
import { PortalThemeProvider, PortalThemeProvider as PortalThemeProvider$1, PortalThemeWrapper, PortalThemeWrapper as PortalThemeWrapper$1, usePortalTheme } from "@haklex/rich-style-token";
|
|
8
7
|
import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
|
|
9
8
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
10
9
|
import { Menu } from "@base-ui/react/menu";
|
|
11
10
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
12
11
|
import { Tooltip } from "@base-ui/react/tooltip";
|
|
12
|
+
//#region ../../node_modules/.pnpm/@vanilla-extract+recipes@0.5.7_@vanilla-extract+css@1.20.1_babel-plugin-macros@3.1.0_/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
13
13
|
function toPrimitive(t, r) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
if ("object" != typeof t || !t) return t;
|
|
15
|
+
var e = t[Symbol.toPrimitive];
|
|
16
|
+
if (void 0 !== e) {
|
|
17
|
+
var i = e.call(t, r || "default");
|
|
18
|
+
if ("object" != typeof i) return i;
|
|
19
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
20
|
+
}
|
|
21
|
+
return ("string" === r ? String : Number)(t);
|
|
22
22
|
}
|
|
23
23
|
function toPropertyKey(t) {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
var i = toPrimitive(t, "string");
|
|
25
|
+
return "symbol" == typeof i ? i : String(i);
|
|
26
26
|
}
|
|
27
27
|
function _defineProperty(obj, key, value) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
obj[key] = value;
|
|
38
|
-
}
|
|
39
|
-
return obj;
|
|
28
|
+
key = toPropertyKey(key);
|
|
29
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
30
|
+
value,
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true
|
|
34
|
+
});
|
|
35
|
+
else obj[key] = value;
|
|
36
|
+
return obj;
|
|
40
37
|
}
|
|
41
38
|
function ownKeys(e, r) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
var t = Object.keys(e);
|
|
40
|
+
if (Object.getOwnPropertySymbols) {
|
|
41
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
42
|
+
r && (o = o.filter(function(r) {
|
|
43
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
44
|
+
})), t.push.apply(t, o);
|
|
45
|
+
}
|
|
46
|
+
return t;
|
|
50
47
|
}
|
|
51
48
|
function _objectSpread2(e) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
50
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
51
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
52
|
+
_defineProperty(e, r, t[r]);
|
|
53
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
54
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return e;
|
|
61
58
|
}
|
|
62
59
|
function mapValues(input, fn) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
return result;
|
|
60
|
+
var result = {};
|
|
61
|
+
for (var _key in input) result[_key] = fn(input[_key], _key);
|
|
62
|
+
return result;
|
|
68
63
|
}
|
|
69
64
|
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
return true;
|
|
65
|
+
for (var key of Object.keys(compoundCheck)) {
|
|
66
|
+
var _selections$key;
|
|
67
|
+
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) return false;
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
77
70
|
};
|
|
78
71
|
var createRuntimeFn = (config) => {
|
|
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
|
-
|
|
114
|
-
};
|
|
115
|
-
return runtimeFn;
|
|
72
|
+
var runtimeFn = (options) => {
|
|
73
|
+
var className = config.defaultClassName;
|
|
74
|
+
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
75
|
+
for (var variantName in selections) {
|
|
76
|
+
var _selections$variantNa;
|
|
77
|
+
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
78
|
+
if (variantSelection != null) {
|
|
79
|
+
var selection = variantSelection;
|
|
80
|
+
if (typeof selection === "boolean") selection = selection === true ? "true" : "false";
|
|
81
|
+
var selectionClassName = config.variantClassNames[variantName][selection];
|
|
82
|
+
if (selectionClassName) className += " " + selectionClassName;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
for (var [compoundCheck, compoundClassName] of config.compoundVariants) if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) className += " " + compoundClassName;
|
|
86
|
+
return className;
|
|
87
|
+
};
|
|
88
|
+
runtimeFn.variants = () => Object.keys(config.variantClassNames);
|
|
89
|
+
runtimeFn.classNames = {
|
|
90
|
+
get base() {
|
|
91
|
+
return config.defaultClassName.split(" ")[0];
|
|
92
|
+
},
|
|
93
|
+
get variants() {
|
|
94
|
+
return mapValues(config.variantClassNames, (classNames) => mapValues(classNames, (className) => className.split(" ")[0]));
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return runtimeFn;
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/components/action-button/styles.css.ts
|
|
101
|
+
var semanticClassNames = {
|
|
102
|
+
actionBar: "re-ui-action-bar",
|
|
103
|
+
actionButton: "re-ui-action-btn",
|
|
104
|
+
actionButtonEnd: "re-ui-action-btn--end",
|
|
105
|
+
actionButtonDanger: "re-ui-action-btn--danger",
|
|
106
|
+
actionButtonIcon: "re-ui-action-btn--icon"
|
|
116
107
|
};
|
|
117
|
-
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" };
|
|
118
108
|
var actionBar = "_73ej2i0";
|
|
119
|
-
var actionButton$1 = createRuntimeFn({
|
|
109
|
+
var actionButton$1 = createRuntimeFn({
|
|
110
|
+
defaultClassName: "_73ej2i1",
|
|
111
|
+
variantClassNames: {
|
|
112
|
+
variant: {
|
|
113
|
+
ghost: "_73ej2i2",
|
|
114
|
+
solid: "_73ej2i3",
|
|
115
|
+
outline: "_73ej2i4",
|
|
116
|
+
accent: "_73ej2i5"
|
|
117
|
+
},
|
|
118
|
+
size: {
|
|
119
|
+
sm: "_73ej2i6",
|
|
120
|
+
md: "_73ej2i7",
|
|
121
|
+
lg: "_73ej2i8"
|
|
122
|
+
},
|
|
123
|
+
icon: {
|
|
124
|
+
true: "_73ej2i9",
|
|
125
|
+
false: "_73ej2ia"
|
|
126
|
+
},
|
|
127
|
+
end: {
|
|
128
|
+
true: "_73ej2ib",
|
|
129
|
+
false: "_73ej2ic"
|
|
130
|
+
},
|
|
131
|
+
danger: {
|
|
132
|
+
true: "_73ej2id",
|
|
133
|
+
false: "_73ej2ie"
|
|
134
|
+
},
|
|
135
|
+
rounded: {
|
|
136
|
+
true: "_73ej2if",
|
|
137
|
+
false: "_73ej2ig"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
defaultVariants: {
|
|
141
|
+
variant: "ghost",
|
|
142
|
+
size: "sm",
|
|
143
|
+
icon: false,
|
|
144
|
+
end: false,
|
|
145
|
+
danger: false,
|
|
146
|
+
rounded: false
|
|
147
|
+
},
|
|
148
|
+
compoundVariants: [
|
|
149
|
+
[{
|
|
150
|
+
icon: true,
|
|
151
|
+
size: "sm"
|
|
152
|
+
}, "_73ej2ih"],
|
|
153
|
+
[{
|
|
154
|
+
icon: true,
|
|
155
|
+
size: "md"
|
|
156
|
+
}, "_73ej2ii"],
|
|
157
|
+
[{
|
|
158
|
+
icon: true,
|
|
159
|
+
size: "lg"
|
|
160
|
+
}, "_73ej2ij"],
|
|
161
|
+
[{
|
|
162
|
+
rounded: true,
|
|
163
|
+
icon: true
|
|
164
|
+
}, "_73ej2ik"],
|
|
165
|
+
[{ danger: true }, "_73ej2il"]
|
|
166
|
+
]
|
|
167
|
+
});
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/components/action-button/index.tsx
|
|
120
170
|
function ActionBar({ className, gap, style, ...props }) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
function ActionButton({
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
"button",
|
|
148
|
-
{
|
|
149
|
-
className: `${recipeClass} ${semanticParts.join(" ")}${className ? ` ${className}` : ""}`,
|
|
150
|
-
type,
|
|
151
|
-
...props
|
|
152
|
-
}
|
|
153
|
-
);
|
|
171
|
+
return /* @__PURE__ */ jsx("div", {
|
|
172
|
+
className: `${actionBar} ${semanticClassNames.actionBar}${className ? ` ${className}` : ""}`,
|
|
173
|
+
style: gap != null ? {
|
|
174
|
+
...style,
|
|
175
|
+
gap
|
|
176
|
+
} : style,
|
|
177
|
+
...props
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function ActionButton({ variant, size, end = false, danger = false, icon = false, rounded = false, className, type = "button", ...props }) {
|
|
181
|
+
const semanticParts = [semanticClassNames.actionButton];
|
|
182
|
+
if (end) semanticParts.push(semanticClassNames.actionButtonEnd);
|
|
183
|
+
if (danger) semanticParts.push(semanticClassNames.actionButtonDanger);
|
|
184
|
+
if (icon) semanticParts.push(semanticClassNames.actionButtonIcon);
|
|
185
|
+
return /* @__PURE__ */ jsx("button", {
|
|
186
|
+
className: `${actionButton$1({
|
|
187
|
+
variant,
|
|
188
|
+
size,
|
|
189
|
+
end,
|
|
190
|
+
danger,
|
|
191
|
+
icon,
|
|
192
|
+
rounded
|
|
193
|
+
})} ${semanticParts.join(" ")}${className ? ` ${className}` : ""}`,
|
|
194
|
+
type,
|
|
195
|
+
...props
|
|
196
|
+
});
|
|
154
197
|
}
|
|
155
198
|
function getActionButtonClassName(options) {
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
199
|
+
return `${actionButton$1(options)} ${semanticClassNames.actionButton}`;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/components/alert/styles.css.ts
|
|
203
|
+
var alert = createRuntimeFn({
|
|
204
|
+
defaultClassName: "_15r7gwx0",
|
|
205
|
+
variantClassNames: { variant: {
|
|
206
|
+
info: "_15r7gwx1",
|
|
207
|
+
warning: "_15r7gwx2",
|
|
208
|
+
error: "_15r7gwx3"
|
|
209
|
+
} },
|
|
210
|
+
defaultVariants: { variant: "info" },
|
|
211
|
+
compoundVariants: []
|
|
212
|
+
});
|
|
159
213
|
var alertContent = "_15r7gwx4";
|
|
160
214
|
var alertIcon = "_15r7gwx5";
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/components/alert/index.tsx
|
|
217
|
+
var icons = {
|
|
218
|
+
info: Info,
|
|
219
|
+
warning: AlertTriangle,
|
|
220
|
+
error: AlertCircle
|
|
166
221
|
};
|
|
167
222
|
function Alert({ variant, children, action, className }) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
223
|
+
const IconComponent = icons[variant];
|
|
224
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
225
|
+
className: `${alert({ variant })}${className ? ` ${className}` : ""}`,
|
|
226
|
+
role: "alert",
|
|
227
|
+
children: [
|
|
228
|
+
/* @__PURE__ */ jsx(IconComponent, { className: alertIcon }),
|
|
229
|
+
/* @__PURE__ */ jsx("div", {
|
|
230
|
+
className: alertContent,
|
|
231
|
+
children
|
|
232
|
+
}),
|
|
233
|
+
action && /* @__PURE__ */ jsx("div", {
|
|
234
|
+
className: "_15r7gwx6",
|
|
235
|
+
children: action
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/components/animated-tabs/styles.css.ts
|
|
175
242
|
var root$1 = "iryuae0";
|
|
176
243
|
var tablist = "iryuae1";
|
|
177
244
|
var tab = "iryuae2";
|
|
178
245
|
var tabActive = "iryuae3";
|
|
179
246
|
var border = "iryuae4";
|
|
180
247
|
var indicator$1 = "iryuae5";
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/components/animated-tabs/index.tsx
|
|
181
250
|
function cn(...parts) {
|
|
182
|
-
|
|
251
|
+
return parts.filter(Boolean).join(" ");
|
|
183
252
|
}
|
|
184
253
|
function AnimatedTabs({ tabs, defaultTab, value, onChange, className }) {
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
254
|
+
const isControlled = value !== void 0;
|
|
255
|
+
const [internalTab, setInternalTab] = useState(defaultTab ?? tabs[0]?.id ?? "");
|
|
256
|
+
const activeTab = isControlled ? value : internalTab;
|
|
257
|
+
const [indicator, setIndicator] = useState({
|
|
258
|
+
left: 0,
|
|
259
|
+
width: 0
|
|
260
|
+
});
|
|
261
|
+
const tabRefs = useRef(/* @__PURE__ */ new Map());
|
|
262
|
+
const containerRef = useRef(null);
|
|
263
|
+
const updateIndicator = useCallback(() => {
|
|
264
|
+
const activeEl = tabRefs.current.get(activeTab);
|
|
265
|
+
const container = containerRef.current;
|
|
266
|
+
if (activeEl && container) {
|
|
267
|
+
const containerRect = container.getBoundingClientRect();
|
|
268
|
+
const tabRect = activeEl.getBoundingClientRect();
|
|
269
|
+
setIndicator({
|
|
270
|
+
left: tabRect.left - containerRect.left,
|
|
271
|
+
width: tabRect.width
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
}, [activeTab]);
|
|
275
|
+
useEffect(() => {
|
|
276
|
+
updateIndicator();
|
|
277
|
+
}, [updateIndicator]);
|
|
278
|
+
useEffect(() => {
|
|
279
|
+
window.addEventListener("resize", updateIndicator);
|
|
280
|
+
return () => window.removeEventListener("resize", updateIndicator);
|
|
281
|
+
}, [updateIndicator]);
|
|
282
|
+
const handleTabClick = (tabId) => {
|
|
283
|
+
if (!isControlled) setInternalTab(tabId);
|
|
284
|
+
onChange?.(tabId);
|
|
285
|
+
};
|
|
286
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
287
|
+
className: cn(root$1, className),
|
|
288
|
+
ref: containerRef,
|
|
289
|
+
children: [
|
|
290
|
+
/* @__PURE__ */ jsx("div", {
|
|
291
|
+
"aria-orientation": "horizontal",
|
|
292
|
+
className: tablist,
|
|
293
|
+
role: "tablist",
|
|
294
|
+
children: tabs.map((tab$1) => /* @__PURE__ */ jsx("button", {
|
|
295
|
+
"aria-selected": activeTab === tab$1.id,
|
|
296
|
+
className: cn(tab, activeTab === tab$1.id ? tabActive : void 0),
|
|
297
|
+
role: "tab",
|
|
298
|
+
type: "button",
|
|
299
|
+
ref: (el) => {
|
|
300
|
+
if (el) tabRefs.current.set(tab$1.id, el);
|
|
301
|
+
else tabRefs.current.delete(tab$1.id);
|
|
302
|
+
},
|
|
303
|
+
onClick: () => handleTabClick(tab$1.id),
|
|
304
|
+
children: tab$1.label
|
|
305
|
+
}, tab$1.id))
|
|
306
|
+
}),
|
|
307
|
+
/* @__PURE__ */ jsx("div", {
|
|
308
|
+
"aria-hidden": "true",
|
|
309
|
+
className: border
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ jsx("div", {
|
|
312
|
+
"aria-hidden": "true",
|
|
313
|
+
className: indicator$1,
|
|
314
|
+
style: {
|
|
315
|
+
left: indicator.left,
|
|
316
|
+
width: indicator.width
|
|
317
|
+
}
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
//#endregion
|
|
323
|
+
//#region src/components/auto-resize-textarea/styles.css.ts
|
|
253
324
|
var textarea = "_1b25hgb0";
|
|
254
325
|
var overflowing = "_1b25hgb1";
|
|
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
|
-
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/components/auto-resize-textarea/index.tsx
|
|
328
|
+
var AutoResizeTextArea = forwardRef(function AutoResizeTextArea({ maxRows = 6, minRows = 1, className, onInput, ...props }, ref) {
|
|
329
|
+
const innerRef = useRef(null);
|
|
330
|
+
useImperativeHandle(ref, () => innerRef.current);
|
|
331
|
+
const resize = useCallback(() => {
|
|
332
|
+
const el = innerRef.current;
|
|
333
|
+
if (!el) return;
|
|
334
|
+
el.style.height = "auto";
|
|
335
|
+
const maxHeight = (Number.parseFloat(getComputedStyle(el).lineHeight) || 21) * maxRows + 16;
|
|
336
|
+
const scrollHeight = el.scrollHeight;
|
|
337
|
+
if (scrollHeight > maxHeight) {
|
|
338
|
+
el.style.height = `${maxHeight}px`;
|
|
339
|
+
el.classList.add(overflowing);
|
|
340
|
+
} else {
|
|
341
|
+
el.style.height = `${scrollHeight}px`;
|
|
342
|
+
el.classList.remove(overflowing);
|
|
343
|
+
}
|
|
344
|
+
}, [maxRows]);
|
|
345
|
+
useEffect(() => {
|
|
346
|
+
resize();
|
|
347
|
+
}, [resize, props.value]);
|
|
348
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
349
|
+
className: `${textarea}${className ? ` ${className}` : ""}`,
|
|
350
|
+
ref: innerRef,
|
|
351
|
+
rows: minRows,
|
|
352
|
+
onInput: (e) => {
|
|
353
|
+
resize();
|
|
354
|
+
onInput?.(e);
|
|
355
|
+
},
|
|
356
|
+
...props
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/components/badge/styles.css.ts
|
|
361
|
+
var badge = createRuntimeFn({
|
|
362
|
+
defaultClassName: "_1vt0sm10",
|
|
363
|
+
variantClassNames: {
|
|
364
|
+
variant: {
|
|
365
|
+
neutral: "_1vt0sm11",
|
|
366
|
+
success: "_1vt0sm12",
|
|
367
|
+
error: "_1vt0sm13",
|
|
368
|
+
warning: "_1vt0sm14",
|
|
369
|
+
info: "_1vt0sm15"
|
|
370
|
+
},
|
|
371
|
+
size: {
|
|
372
|
+
sm: "_1vt0sm16",
|
|
373
|
+
md: "_1vt0sm17"
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
defaultVariants: {
|
|
377
|
+
variant: "neutral",
|
|
378
|
+
size: "sm"
|
|
379
|
+
},
|
|
380
|
+
compoundVariants: []
|
|
381
|
+
});
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region src/components/badge/index.tsx
|
|
293
384
|
function Badge({ variant, size, children, className }) {
|
|
294
|
-
|
|
295
|
-
|
|
385
|
+
return /* @__PURE__ */ jsx("span", {
|
|
386
|
+
className: `${badge({
|
|
387
|
+
variant,
|
|
388
|
+
size
|
|
389
|
+
})}${className ? ` ${className}` : ""}`,
|
|
390
|
+
children
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region src/components/checkbox/styles.css.ts
|
|
296
395
|
var root = "_10muorc2";
|
|
297
|
-
var rootDisabled = "_10muorc3";
|
|
298
396
|
var box = "_10muorc4";
|
|
299
397
|
var boxUnchecked = "_10muorc5";
|
|
300
398
|
var boxChecked = "_10muorc6";
|
|
301
|
-
var boxBouncing = "_10muorc7";
|
|
302
399
|
var checkmark = "_10muorc8";
|
|
303
400
|
var checkmarkVisible = "_10muorc9";
|
|
304
401
|
var checkmarkHidden = "_10muorca";
|
|
305
402
|
var ripple = "_10muorcb";
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
var label$1 = "_10muorce";
|
|
309
|
-
var labelDisabled = "_10muorcf";
|
|
310
|
-
var description$2 = "_10muorcg";
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/components/checkbox/index.tsx
|
|
311
405
|
function cx(...args) {
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
function AnimatedCheckbox({
|
|
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
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
css: "#1572b6",
|
|
409
|
-
scss: "#cc6699",
|
|
410
|
-
json: "#f59e0b",
|
|
411
|
-
markdown: "#737373",
|
|
412
|
-
md: "#737373",
|
|
413
|
-
bash: "#4eaa25",
|
|
414
|
-
sh: "#4eaa25",
|
|
415
|
-
shell: "#4eaa25",
|
|
416
|
-
zsh: "#4eaa25",
|
|
417
|
-
python: "#3776ab",
|
|
418
|
-
py: "#3776ab",
|
|
419
|
-
rust: "#dea584",
|
|
420
|
-
go: "#00add8",
|
|
421
|
-
java: "#b07219",
|
|
422
|
-
c: "#a8b9cc",
|
|
423
|
-
cpp: "#00599c",
|
|
424
|
-
"c++": "#00599c",
|
|
425
|
-
swift: "#fa7343",
|
|
426
|
-
kotlin: "#7f52ff",
|
|
427
|
-
yaml: "#cb171e",
|
|
428
|
-
yml: "#cb171e",
|
|
429
|
-
sql: "#e38c00"
|
|
406
|
+
return args.filter(Boolean).join(" ");
|
|
407
|
+
}
|
|
408
|
+
function AnimatedCheckbox({ label, description, checked: controlledChecked, defaultChecked = false, onChange, disabled = false, className }) {
|
|
409
|
+
const [internalChecked, setInternalChecked] = useState(defaultChecked);
|
|
410
|
+
const [bouncing, setBouncing] = useState(false);
|
|
411
|
+
const isControlled = controlledChecked !== void 0;
|
|
412
|
+
const isChecked = isControlled ? controlledChecked : internalChecked;
|
|
413
|
+
const isFirstRender = useRef(true);
|
|
414
|
+
const rippleKey = useRef(0);
|
|
415
|
+
useEffect(() => {
|
|
416
|
+
if (isFirstRender.current) {
|
|
417
|
+
isFirstRender.current = false;
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
setBouncing(true);
|
|
421
|
+
rippleKey.current += 1;
|
|
422
|
+
const timer = setTimeout(() => setBouncing(false), 400);
|
|
423
|
+
return () => clearTimeout(timer);
|
|
424
|
+
}, [isChecked]);
|
|
425
|
+
const handleToggle = () => {
|
|
426
|
+
if (disabled) return;
|
|
427
|
+
const next = !isChecked;
|
|
428
|
+
if (!isControlled) setInternalChecked(next);
|
|
429
|
+
onChange?.(next);
|
|
430
|
+
};
|
|
431
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
432
|
+
"aria-checked": isChecked,
|
|
433
|
+
"aria-disabled": disabled,
|
|
434
|
+
className: cx(root, disabled && "_10muorc3", className),
|
|
435
|
+
role: "checkbox",
|
|
436
|
+
type: "button",
|
|
437
|
+
onClick: handleToggle,
|
|
438
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
439
|
+
className: cx(box, isChecked ? boxChecked : boxUnchecked, bouncing && "_10muorc7"),
|
|
440
|
+
children: [/* @__PURE__ */ jsx("svg", {
|
|
441
|
+
className: cx(checkmark, isChecked ? checkmarkVisible : checkmarkHidden),
|
|
442
|
+
fill: "none",
|
|
443
|
+
viewBox: "0 0 12 10",
|
|
444
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
445
|
+
d: "M1 5.5L4 8.5L11 1.5",
|
|
446
|
+
stroke: "currentColor",
|
|
447
|
+
strokeLinecap: "round",
|
|
448
|
+
strokeLinejoin: "round",
|
|
449
|
+
strokeWidth: "2",
|
|
450
|
+
style: {
|
|
451
|
+
color: "#fff",
|
|
452
|
+
strokeDasharray: 20,
|
|
453
|
+
strokeDashoffset: isChecked ? 0 : 20,
|
|
454
|
+
transition: isChecked ? "stroke-dashoffset 0.4s ease-out 0.1s" : "stroke-dashoffset 0.2s ease-in"
|
|
455
|
+
}
|
|
456
|
+
})
|
|
457
|
+
}), /* @__PURE__ */ jsx("span", { className: cx(ripple, bouncing && "_10muorcc") }, rippleKey.current)]
|
|
458
|
+
}), (label || description) && /* @__PURE__ */ jsxs("span", {
|
|
459
|
+
className: "_10muorcd",
|
|
460
|
+
children: [label && /* @__PURE__ */ jsx("span", {
|
|
461
|
+
className: cx("_10muorce", disabled && "_10muorcf"),
|
|
462
|
+
children: label
|
|
463
|
+
}), description && /* @__PURE__ */ jsx("span", {
|
|
464
|
+
className: "_10muorcg",
|
|
465
|
+
children: description
|
|
466
|
+
})]
|
|
467
|
+
})]
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region src/components/code-block/constants.ts
|
|
472
|
+
var languageToColorMap = {
|
|
473
|
+
javascript: "#f7df1e",
|
|
474
|
+
js: "#f7df1e",
|
|
475
|
+
typescript: "#3178c6",
|
|
476
|
+
ts: "#3178c6",
|
|
477
|
+
jsx: "#61dafb",
|
|
478
|
+
tsx: "#61dafb",
|
|
479
|
+
html: "#e34f26",
|
|
480
|
+
css: "#1572b6",
|
|
481
|
+
scss: "#cc6699",
|
|
482
|
+
json: "#f59e0b",
|
|
483
|
+
markdown: "#737373",
|
|
484
|
+
md: "#737373",
|
|
485
|
+
bash: "#4eaa25",
|
|
486
|
+
sh: "#4eaa25",
|
|
487
|
+
shell: "#4eaa25",
|
|
488
|
+
zsh: "#4eaa25",
|
|
489
|
+
python: "#3776ab",
|
|
490
|
+
py: "#3776ab",
|
|
491
|
+
rust: "#dea584",
|
|
492
|
+
go: "#00add8",
|
|
493
|
+
java: "#b07219",
|
|
494
|
+
c: "#a8b9cc",
|
|
495
|
+
cpp: "#00599c",
|
|
496
|
+
"c++": "#00599c",
|
|
497
|
+
swift: "#fa7343",
|
|
498
|
+
kotlin: "#7f52ff",
|
|
499
|
+
yaml: "#cb171e",
|
|
500
|
+
yml: "#cb171e",
|
|
501
|
+
sql: "#e38c00"
|
|
430
502
|
};
|
|
431
|
-
function normalizeLanguage(
|
|
432
|
-
|
|
433
|
-
|
|
503
|
+
function normalizeLanguage(lang) {
|
|
504
|
+
if (!lang) return "text";
|
|
505
|
+
return lang.trim().toLowerCase() || "text";
|
|
434
506
|
}
|
|
435
|
-
function getLanguageDisplayName(
|
|
436
|
-
|
|
437
|
-
|
|
507
|
+
function getLanguageDisplayName(lang) {
|
|
508
|
+
if (lang === "text") return "TEXT";
|
|
509
|
+
return lang.toUpperCase();
|
|
438
510
|
}
|
|
511
|
+
//#endregion
|
|
512
|
+
//#region src/components/code-block/styles.css.ts
|
|
439
513
|
var card = "_1gq8hf90";
|
|
440
|
-
var lang = "_1gq8hf91";
|
|
441
|
-
var copyButton = "_1gq8hf92";
|
|
442
514
|
var bodyBackground = "_1gq8hf93";
|
|
443
515
|
var bodyBackgroundStatic = "_1gq8hf94 _1gq8hf93";
|
|
444
516
|
var scroll = "_1gq8hf95";
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
var
|
|
448
|
-
var
|
|
449
|
-
var
|
|
450
|
-
|
|
451
|
-
const
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
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
|
-
|
|
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
|
-
/* @__PURE__ */ jsx("span", { children: "Expand" })
|
|
526
|
-
]
|
|
527
|
-
}
|
|
528
|
-
) })
|
|
529
|
-
] })
|
|
530
|
-
]
|
|
531
|
-
}
|
|
532
|
-
);
|
|
533
|
-
}
|
|
534
|
-
let highlighterPromise = null;
|
|
517
|
+
//#endregion
|
|
518
|
+
//#region src/components/code-block/CodeBlockCard.tsx
|
|
519
|
+
var CopyIcon = /* @__PURE__ */ jsx(Copy, { size: 16 });
|
|
520
|
+
var CheckIcon$1 = /* @__PURE__ */ jsx(Check, { size: 16 });
|
|
521
|
+
var ExpandIcon = /* @__PURE__ */ jsx(ChevronDown, { size: 14 });
|
|
522
|
+
function CodeBlockCard({ children, className, code, collapsible = true, language, showCopyButton = true, static: staticMode = false }) {
|
|
523
|
+
const normalizedLanguage = normalizeLanguage(language);
|
|
524
|
+
const languageLabel = getLanguageDisplayName(normalizedLanguage);
|
|
525
|
+
const accent = languageToColorMap[normalizedLanguage] || "#737373";
|
|
526
|
+
const [copied, setCopied] = useState(false);
|
|
527
|
+
const copyTimerRef = useRef(void 0);
|
|
528
|
+
const [isCollapsed, setIsCollapsed] = useState(true);
|
|
529
|
+
const [isOverflow, setIsOverflow] = useState(false);
|
|
530
|
+
const scrollRef = useRef(null);
|
|
531
|
+
useEffect(() => {
|
|
532
|
+
if (!collapsible) {
|
|
533
|
+
setIsOverflow(false);
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
const el = scrollRef.current;
|
|
537
|
+
if (!el) return;
|
|
538
|
+
const check = () => {
|
|
539
|
+
const halfVh = window.innerHeight / 2;
|
|
540
|
+
setIsOverflow(el.scrollHeight >= halfVh);
|
|
541
|
+
};
|
|
542
|
+
const raf = requestAnimationFrame(check);
|
|
543
|
+
return () => cancelAnimationFrame(raf);
|
|
544
|
+
}, [
|
|
545
|
+
children,
|
|
546
|
+
code,
|
|
547
|
+
collapsible
|
|
548
|
+
]);
|
|
549
|
+
useEffect(() => () => clearTimeout(copyTimerRef.current), []);
|
|
550
|
+
const handleCopy = useCallback(() => {
|
|
551
|
+
navigator.clipboard.writeText(code).then(() => {
|
|
552
|
+
setCopied(true);
|
|
553
|
+
clearTimeout(copyTimerRef.current);
|
|
554
|
+
copyTimerRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
555
|
+
}).catch(() => {});
|
|
556
|
+
}, [code]);
|
|
557
|
+
const cardStyle = useMemo(() => ({ "--rr-code-accent": accent }), [accent]);
|
|
558
|
+
const scrollClassName = [scroll, collapsible && isCollapsed && isOverflow && "_1gq8hf96"].filter(Boolean).join(" ");
|
|
559
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
560
|
+
className: `${card}${className ? ` ${className}` : ""}`,
|
|
561
|
+
style: cardStyle,
|
|
562
|
+
children: [
|
|
563
|
+
language && normalizedLanguage !== "text" && /* @__PURE__ */ jsx("div", {
|
|
564
|
+
"aria-hidden": true,
|
|
565
|
+
className: "_1gq8hf91",
|
|
566
|
+
children: /* @__PURE__ */ jsx("span", { children: languageLabel })
|
|
567
|
+
}),
|
|
568
|
+
showCopyButton && /* @__PURE__ */ jsx("button", {
|
|
569
|
+
"aria-label": copied ? "Copied" : "Copy code",
|
|
570
|
+
className: "_1gq8hf92",
|
|
571
|
+
type: "button",
|
|
572
|
+
onClick: handleCopy,
|
|
573
|
+
children: copied ? CheckIcon$1 : CopyIcon
|
|
574
|
+
}),
|
|
575
|
+
/* @__PURE__ */ jsxs("div", {
|
|
576
|
+
className: staticMode ? bodyBackgroundStatic : bodyBackground,
|
|
577
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
578
|
+
className: scrollClassName,
|
|
579
|
+
ref: scrollRef,
|
|
580
|
+
children
|
|
581
|
+
}), collapsible && isOverflow && isCollapsed && /* @__PURE__ */ jsx("div", {
|
|
582
|
+
className: "_1gq8hf97",
|
|
583
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
584
|
+
className: "_1gq8hf98",
|
|
585
|
+
type: "button",
|
|
586
|
+
onClick: () => setIsCollapsed(false),
|
|
587
|
+
children: [ExpandIcon, /* @__PURE__ */ jsx("span", { children: "Expand" })]
|
|
588
|
+
})
|
|
589
|
+
})]
|
|
590
|
+
})
|
|
591
|
+
]
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
//#endregion
|
|
595
|
+
//#region src/components/code-block/shiki.ts
|
|
596
|
+
var highlighterPromise = null;
|
|
535
597
|
function getHighlighter() {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
})
|
|
542
|
-
);
|
|
543
|
-
}
|
|
544
|
-
return highlighterPromise;
|
|
598
|
+
if (!highlighterPromise) highlighterPromise = import("shiki/bundle/web").then((mod) => mod.createHighlighter({
|
|
599
|
+
langs: [],
|
|
600
|
+
themes: ["github-light", "github-dark"]
|
|
601
|
+
}));
|
|
602
|
+
return highlighterPromise;
|
|
545
603
|
}
|
|
546
604
|
async function getHighlighterWithLang(language) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
559
|
-
const SHIKI_DUAL_THEMES = {
|
|
560
|
-
light: "github-light",
|
|
561
|
-
dark: "github-dark"
|
|
605
|
+
const highlighter = await getHighlighter();
|
|
606
|
+
if (language && language !== "text" && language !== "plaintext") {
|
|
607
|
+
if (!highlighter.getLoadedLanguages().includes(language)) try {
|
|
608
|
+
await highlighter.loadLanguage(language);
|
|
609
|
+
} catch {}
|
|
610
|
+
}
|
|
611
|
+
return highlighter;
|
|
612
|
+
}
|
|
613
|
+
var SHIKI_DUAL_THEMES = {
|
|
614
|
+
light: "github-light",
|
|
615
|
+
dark: "github-dark"
|
|
562
616
|
};
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
}
|
|
609
|
-
);
|
|
610
|
-
}
|
|
617
|
+
//#endregion
|
|
618
|
+
//#region src/components/code-block/index.tsx
|
|
619
|
+
function CodeBlock({ className, collapsible = true, code, language, showCopyButton = true, showLineNumbers = false }) {
|
|
620
|
+
const normalizedLanguage = normalizeLanguage(language);
|
|
621
|
+
const [html, setHtml] = useState(null);
|
|
622
|
+
useEffect(() => {
|
|
623
|
+
let cancelled = false;
|
|
624
|
+
setHtml(null);
|
|
625
|
+
(async () => {
|
|
626
|
+
const highlighter = await getHighlighterWithLang(normalizedLanguage);
|
|
627
|
+
if (cancelled) return;
|
|
628
|
+
const lang = highlighter.getLoadedLanguages().includes(normalizedLanguage) ? normalizedLanguage : "text";
|
|
629
|
+
const result = highlighter.codeToHtml(code, {
|
|
630
|
+
lang,
|
|
631
|
+
themes: SHIKI_DUAL_THEMES
|
|
632
|
+
});
|
|
633
|
+
if (!cancelled) setHtml(result);
|
|
634
|
+
})();
|
|
635
|
+
return () => {
|
|
636
|
+
cancelled = true;
|
|
637
|
+
};
|
|
638
|
+
}, [code, normalizedLanguage]);
|
|
639
|
+
const fallbackLines = useMemo(() => code.split("\n"), [code]);
|
|
640
|
+
const linedClassName = [showLineNumbers && "_1gq8hf99", showLineNumbers && "_1gq8hf9a"].filter(Boolean).join(" ");
|
|
641
|
+
return /* @__PURE__ */ jsx(CodeBlockCard, {
|
|
642
|
+
className,
|
|
643
|
+
code,
|
|
644
|
+
collapsible,
|
|
645
|
+
language,
|
|
646
|
+
showCopyButton,
|
|
647
|
+
static: true,
|
|
648
|
+
children: html ? /* @__PURE__ */ jsx("div", {
|
|
649
|
+
className: linedClassName,
|
|
650
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
651
|
+
}) : /* @__PURE__ */ jsx("pre", {
|
|
652
|
+
className: linedClassName,
|
|
653
|
+
children: /* @__PURE__ */ jsx("code", { children: fallbackLines.map((line, i) => /* @__PURE__ */ jsx("span", {
|
|
654
|
+
className: "line",
|
|
655
|
+
children: line
|
|
656
|
+
}, i)) })
|
|
657
|
+
})
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
//#endregion
|
|
661
|
+
//#region src/components/collapsible/styles.css.ts
|
|
611
662
|
var trigger$1 = "_1hdi6a90";
|
|
612
|
-
var chevron = "_1hdi6a91";
|
|
613
663
|
var panel$1 = "_1hdi6a92";
|
|
664
|
+
//#endregion
|
|
665
|
+
//#region src/components/collapsible/index.tsx
|
|
614
666
|
function Collapsible(props) {
|
|
615
|
-
|
|
616
|
-
}
|
|
617
|
-
function CollapsibleTrigger({
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
})
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
);
|
|
634
|
-
}
|
|
635
|
-
function CollapsiblePanel({
|
|
636
|
-
children,
|
|
637
|
-
className,
|
|
638
|
-
...props
|
|
639
|
-
}) {
|
|
640
|
-
return /* @__PURE__ */ jsx(
|
|
641
|
-
Collapsible$1.Panel,
|
|
642
|
-
{
|
|
643
|
-
...props,
|
|
644
|
-
className: `${panel$1}${className ? ` ${className}` : ""}`,
|
|
645
|
-
children
|
|
646
|
-
}
|
|
647
|
-
);
|
|
648
|
-
}
|
|
667
|
+
return /* @__PURE__ */ jsx(Collapsible$1.Root, { ...props });
|
|
668
|
+
}
|
|
669
|
+
function CollapsibleTrigger({ children, className, hideChevron, ...props }) {
|
|
670
|
+
return /* @__PURE__ */ jsxs(Collapsible$1.Trigger, {
|
|
671
|
+
...props,
|
|
672
|
+
className: `${trigger$1}${className ? ` ${className}` : ""}`,
|
|
673
|
+
children: [!hideChevron && /* @__PURE__ */ jsx(ChevronRight, { className: "_1hdi6a91" }), children]
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
function CollapsiblePanel({ children, className, ...props }) {
|
|
677
|
+
return /* @__PURE__ */ jsx(Collapsible$1.Panel, {
|
|
678
|
+
...props,
|
|
679
|
+
className: `${panel$1}${className ? ` ${className}` : ""}`,
|
|
680
|
+
children
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
//#endregion
|
|
684
|
+
//#region src/lib/get-strict-context.tsx
|
|
649
685
|
function getStrictContext(name) {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
686
|
+
const Context = createContext(void 0);
|
|
687
|
+
const Provider = ({ value, children }) => /* @__PURE__ */ jsx(Context.Provider, {
|
|
688
|
+
value,
|
|
689
|
+
children
|
|
690
|
+
});
|
|
691
|
+
const useSafeContext = () => {
|
|
692
|
+
const ctx = use(Context);
|
|
693
|
+
if (ctx === void 0) throw new Error(`useContext must be used within ${name ?? "a Provider"}`);
|
|
694
|
+
return ctx;
|
|
695
|
+
};
|
|
696
|
+
return [Provider, useSafeContext];
|
|
697
|
+
}
|
|
698
|
+
//#endregion
|
|
699
|
+
//#region src/components/popover/styles.css.ts
|
|
664
700
|
var popup$5 = "f2q44l2";
|
|
665
701
|
var arrow = "f2q44l3";
|
|
666
702
|
var title$1 = "f2q44l4";
|
|
667
703
|
var description$1 = "f2q44l5";
|
|
668
|
-
|
|
704
|
+
//#endregion
|
|
705
|
+
//#region src/components/popover/index.tsx
|
|
706
|
+
var [PopoverProvider, usePopover] = getStrictContext("PopoverContext");
|
|
669
707
|
function Popover(props) {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
708
|
+
const [isOpen, setIsOpen] = useState(props?.defaultOpen ?? false);
|
|
709
|
+
useEffect(() => {
|
|
710
|
+
if (props.open !== void 0) setIsOpen(props.open);
|
|
711
|
+
}, [props.open]);
|
|
712
|
+
const handleOpenChange = (open, details) => {
|
|
713
|
+
setIsOpen(open);
|
|
714
|
+
props.onOpenChange?.(open, details);
|
|
715
|
+
};
|
|
716
|
+
return /* @__PURE__ */ jsx(PopoverProvider, {
|
|
717
|
+
value: { isOpen },
|
|
718
|
+
children: /* @__PURE__ */ jsx(Popover$1.Root, {
|
|
719
|
+
...props,
|
|
720
|
+
onOpenChange: handleOpenChange
|
|
721
|
+
})
|
|
722
|
+
});
|
|
679
723
|
}
|
|
680
724
|
function PopoverTrigger(props) {
|
|
681
|
-
|
|
725
|
+
return /* @__PURE__ */ jsx(Popover$1.Trigger, { ...props });
|
|
682
726
|
}
|
|
683
727
|
function PopoverPortal({ children, ...props }) {
|
|
684
|
-
|
|
728
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, {
|
|
729
|
+
...props,
|
|
730
|
+
children: /* @__PURE__ */ jsx(PortalThemeWrapper$1, { children })
|
|
731
|
+
});
|
|
685
732
|
}
|
|
686
733
|
function PopoverPositioner(props) {
|
|
687
|
-
|
|
688
|
-
}
|
|
689
|
-
function PopoverPopup({
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
className,
|
|
708
|
-
children,
|
|
709
|
-
...popupProps
|
|
710
|
-
}) {
|
|
711
|
-
return /* @__PURE__ */ jsx(PopoverPortal, { children: /* @__PURE__ */ jsx(PopoverPositioner, { align, side, sideOffset, children: /* @__PURE__ */ jsx(PopoverPopup, { className, ...popupProps, children }) }) });
|
|
734
|
+
return /* @__PURE__ */ jsx(Popover$1.Positioner, { ...props });
|
|
735
|
+
}
|
|
736
|
+
function PopoverPopup({ className, children, ...props }) {
|
|
737
|
+
return /* @__PURE__ */ jsx(Popover$1.Popup, {
|
|
738
|
+
className: `${popup$5}${className ? ` ${className}` : ""}`,
|
|
739
|
+
...props,
|
|
740
|
+
children
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
function PopoverPanel({ align = "center", side, sideOffset = 4, className, children, ...popupProps }) {
|
|
744
|
+
return /* @__PURE__ */ jsx(PopoverPortal, { children: /* @__PURE__ */ jsx(PopoverPositioner, {
|
|
745
|
+
align,
|
|
746
|
+
side,
|
|
747
|
+
sideOffset,
|
|
748
|
+
children: /* @__PURE__ */ jsx(PopoverPopup, {
|
|
749
|
+
className,
|
|
750
|
+
...popupProps,
|
|
751
|
+
children
|
|
752
|
+
})
|
|
753
|
+
}) });
|
|
712
754
|
}
|
|
713
755
|
function PopoverArrow({ className, ...props }) {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
...props
|
|
719
|
-
}
|
|
720
|
-
);
|
|
756
|
+
return /* @__PURE__ */ jsx(Popover$1.Arrow, {
|
|
757
|
+
className: `${arrow}${className ? ` ${className}` : ""}`,
|
|
758
|
+
...props
|
|
759
|
+
});
|
|
721
760
|
}
|
|
722
761
|
function PopoverClose(props) {
|
|
723
|
-
|
|
762
|
+
return /* @__PURE__ */ jsx(Popover$1.Close, { ...props });
|
|
724
763
|
}
|
|
725
764
|
function PopoverTitle({ className, ...props }) {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
...props
|
|
743
|
-
}
|
|
744
|
-
);
|
|
745
|
-
}
|
|
746
|
-
const clamp = (n, min, max) => n < min ? min : n > max ? max : n;
|
|
747
|
-
const to255 = (n) => Math.round(clamp(n, 0, 1) * 255);
|
|
748
|
-
const pad2 = (n) => n.toString(16).padStart(2, "0");
|
|
765
|
+
return /* @__PURE__ */ jsx(Popover$1.Title, {
|
|
766
|
+
className: `${title$1}${className ? ` ${className}` : ""}`,
|
|
767
|
+
...props
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
function PopoverDescription({ className, ...props }) {
|
|
771
|
+
return /* @__PURE__ */ jsx(Popover$1.Description, {
|
|
772
|
+
className: `${description$1}${className ? ` ${className}` : ""}`,
|
|
773
|
+
...props
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region src/components/color-picker/color-math.ts
|
|
778
|
+
var clamp = (n, min, max) => n < min ? min : n > max ? max : n;
|
|
779
|
+
var to255 = (n) => Math.round(clamp(n, 0, 1) * 255);
|
|
780
|
+
var pad2 = (n) => n.toString(16).padStart(2, "0");
|
|
749
781
|
function hsvToRgb(h, s, v) {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
782
|
+
const hh = (h % 360 + 360) % 360 / 60;
|
|
783
|
+
const ss = clamp(s, 0, 1);
|
|
784
|
+
const vv = clamp(v, 0, 1);
|
|
785
|
+
const c = vv * ss;
|
|
786
|
+
const x = c * (1 - Math.abs(hh % 2 - 1));
|
|
787
|
+
const m = vv - c;
|
|
788
|
+
let r;
|
|
789
|
+
let g;
|
|
790
|
+
let b;
|
|
791
|
+
if (hh < 1) [r, g, b] = [
|
|
792
|
+
c,
|
|
793
|
+
x,
|
|
794
|
+
0
|
|
795
|
+
];
|
|
796
|
+
else if (hh < 2) [r, g, b] = [
|
|
797
|
+
x,
|
|
798
|
+
c,
|
|
799
|
+
0
|
|
800
|
+
];
|
|
801
|
+
else if (hh < 3) [r, g, b] = [
|
|
802
|
+
0,
|
|
803
|
+
c,
|
|
804
|
+
x
|
|
805
|
+
];
|
|
806
|
+
else if (hh < 4) [r, g, b] = [
|
|
807
|
+
0,
|
|
808
|
+
x,
|
|
809
|
+
c
|
|
810
|
+
];
|
|
811
|
+
else if (hh < 5) [r, g, b] = [
|
|
812
|
+
x,
|
|
813
|
+
0,
|
|
814
|
+
c
|
|
815
|
+
];
|
|
816
|
+
else [r, g, b] = [
|
|
817
|
+
c,
|
|
818
|
+
0,
|
|
819
|
+
x
|
|
820
|
+
];
|
|
821
|
+
return {
|
|
822
|
+
r: r + m,
|
|
823
|
+
g: g + m,
|
|
824
|
+
b: b + m
|
|
825
|
+
};
|
|
766
826
|
}
|
|
767
827
|
function rgbToHsv(r, g, b) {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
828
|
+
const max = Math.max(r, g, b);
|
|
829
|
+
const d = max - Math.min(r, g, b);
|
|
830
|
+
const v = max;
|
|
831
|
+
const s = max === 0 ? 0 : d / max;
|
|
832
|
+
let h = 0;
|
|
833
|
+
if (d !== 0) {
|
|
834
|
+
if (max === r) h = (g - b) / d % 6;
|
|
835
|
+
else if (max === g) h = (b - r) / d + 2;
|
|
836
|
+
else h = (r - g) / d + 4;
|
|
837
|
+
h *= 60;
|
|
838
|
+
if (h < 0) h += 360;
|
|
839
|
+
}
|
|
840
|
+
return {
|
|
841
|
+
h,
|
|
842
|
+
s,
|
|
843
|
+
v
|
|
844
|
+
};
|
|
782
845
|
}
|
|
783
846
|
function hsvaToHex(hsva) {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
847
|
+
const { r, g, b } = hsvToRgb(hsva.h, hsva.s, hsva.v);
|
|
848
|
+
const hex = `#${pad2(to255(r))}${pad2(to255(g))}${pad2(to255(b))}`;
|
|
849
|
+
return hsva.a < 1 ? `${hex}${pad2(to255(hsva.a))}` : hex;
|
|
787
850
|
}
|
|
788
851
|
function parseHex(input) {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
return { r, g, b, a };
|
|
852
|
+
let s = input.trim().replace(/^#/, "");
|
|
853
|
+
if (!/^[\da-f]+$/i.test(s)) return null;
|
|
854
|
+
if (s.length === 3 || s.length === 4) s = s.split("").map((c) => c + c).join("");
|
|
855
|
+
if (s.length !== 6 && s.length !== 8) return null;
|
|
856
|
+
return {
|
|
857
|
+
r: Number.parseInt(s.slice(0, 2), 16) / 255,
|
|
858
|
+
g: Number.parseInt(s.slice(2, 4), 16) / 255,
|
|
859
|
+
b: Number.parseInt(s.slice(4, 6), 16) / 255,
|
|
860
|
+
a: s.length === 8 ? Number.parseInt(s.slice(6, 8), 16) / 255 : 1
|
|
861
|
+
};
|
|
800
862
|
}
|
|
801
863
|
function hexToHsva(input) {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
864
|
+
const rgba = parseHex(input);
|
|
865
|
+
if (!rgba) return null;
|
|
866
|
+
const { h, s, v } = rgbToHsv(rgba.r, rgba.g, rgba.b);
|
|
867
|
+
return {
|
|
868
|
+
h,
|
|
869
|
+
s,
|
|
870
|
+
v,
|
|
871
|
+
a: rgba.a
|
|
872
|
+
};
|
|
806
873
|
}
|
|
807
874
|
function huePreviewHex(h) {
|
|
808
|
-
|
|
809
|
-
|
|
875
|
+
return hsvaToHex({
|
|
876
|
+
h,
|
|
877
|
+
s: 1,
|
|
878
|
+
v: 1,
|
|
879
|
+
a: 1
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
//#endregion
|
|
883
|
+
//#region src/components/color-picker/styles.css.ts
|
|
810
884
|
var trigger = "_17r50hf1";
|
|
811
885
|
var triggerLabel = "_17r50hf2";
|
|
812
886
|
var triggerLetter = "_17r50hf3";
|
|
@@ -816,7 +890,6 @@ var panel = "_17r50hf6";
|
|
|
816
890
|
var grid = "_17r50hf7";
|
|
817
891
|
var swatch = "_17r50hf8";
|
|
818
892
|
var swatchDot = "_17r50hf9";
|
|
819
|
-
var swatchCheck = "_17r50hfa";
|
|
820
893
|
var addSwatchDot = "_17r50hfb";
|
|
821
894
|
var addSwatchIcon = "_17r50hfc";
|
|
822
895
|
var pickerView = "_17r50hfd";
|
|
@@ -833,402 +906,423 @@ var sliderThumb = "_17r50hfn";
|
|
|
833
906
|
var hexRow = "_17r50hfo";
|
|
834
907
|
var hexInput = "_17r50hfp";
|
|
835
908
|
var hexInputInvalid = "_17r50hfq";
|
|
836
|
-
var iconButton = "_17r50hfr";
|
|
837
|
-
var icon = "_17r50hfs";
|
|
838
909
|
var previewPair = "_17r50hft";
|
|
839
910
|
var previewCell = "_17r50hfu";
|
|
840
911
|
var actionRow = "_17r50hfv";
|
|
841
912
|
var actionButton = "_17r50hfw";
|
|
842
913
|
var actionButtonPrimary = "_17r50hfx";
|
|
843
|
-
|
|
914
|
+
//#endregion
|
|
915
|
+
//#region src/components/color-picker/picker-view.tsx
|
|
916
|
+
var FALLBACK = {
|
|
917
|
+
h: 0,
|
|
918
|
+
s: 0,
|
|
919
|
+
v: 0,
|
|
920
|
+
a: 1
|
|
921
|
+
};
|
|
844
922
|
function seedHsva(input) {
|
|
845
|
-
|
|
846
|
-
|
|
923
|
+
if (!input || input === "inherit" || input === "currentColor") return FALLBACK;
|
|
924
|
+
return hexToHsva(input) ?? FALLBACK;
|
|
847
925
|
}
|
|
848
926
|
function PickerView({ initialColor, onApply, onCancel, onBack }) {
|
|
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
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
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
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
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
|
-
|
|
927
|
+
const [hsva, setHsva] = useState(() => seedHsva(initialColor));
|
|
928
|
+
const [hexDraft, setHexDraft] = useState(() => hsvaToHex(seedHsva(initialColor)));
|
|
929
|
+
const [hexInvalid, setHexInvalid] = useState(false);
|
|
930
|
+
const [hasEyeDropper, setHasEyeDropper] = useState(false);
|
|
931
|
+
const oldColorRef = useRef(initialColor);
|
|
932
|
+
const satRef = useRef(null);
|
|
933
|
+
const hueRef = useRef(null);
|
|
934
|
+
const alphaRef = useRef(null);
|
|
935
|
+
useEffect(() => {
|
|
936
|
+
setHasEyeDropper(typeof window !== "undefined" && "EyeDropper" in window);
|
|
937
|
+
}, []);
|
|
938
|
+
useEffect(() => {
|
|
939
|
+
if (document.activeElement?.tagName !== "INPUT") {
|
|
940
|
+
setHexDraft(hsvaToHex(hsva));
|
|
941
|
+
setHexInvalid(false);
|
|
942
|
+
}
|
|
943
|
+
}, [hsva]);
|
|
944
|
+
const currentHex = hsvaToHex(hsva);
|
|
945
|
+
const updateFromPointer = (target, ev) => {
|
|
946
|
+
const el = target === "sat" ? satRef.current : target === "hue" ? hueRef.current : alphaRef.current;
|
|
947
|
+
if (!el) return;
|
|
948
|
+
const rect = el.getBoundingClientRect();
|
|
949
|
+
const x = clamp((ev.clientX - rect.left) / rect.width, 0, 1);
|
|
950
|
+
const y = clamp((ev.clientY - rect.top) / rect.height, 0, 1);
|
|
951
|
+
setHsva((prev) => {
|
|
952
|
+
if (target === "sat") return {
|
|
953
|
+
...prev,
|
|
954
|
+
s: x,
|
|
955
|
+
v: 1 - y
|
|
956
|
+
};
|
|
957
|
+
if (target === "hue") return {
|
|
958
|
+
...prev,
|
|
959
|
+
h: x * 360
|
|
960
|
+
};
|
|
961
|
+
return {
|
|
962
|
+
...prev,
|
|
963
|
+
a: x
|
|
964
|
+
};
|
|
965
|
+
});
|
|
966
|
+
};
|
|
967
|
+
const startDrag = (target) => (ev) => {
|
|
968
|
+
ev.preventDefault();
|
|
969
|
+
ev.currentTarget.setPointerCapture(ev.pointerId);
|
|
970
|
+
updateFromPointer(target, ev);
|
|
971
|
+
};
|
|
972
|
+
const onMove = (target) => (ev) => {
|
|
973
|
+
if (ev.buttons === 0) return;
|
|
974
|
+
updateFromPointer(target, ev);
|
|
975
|
+
};
|
|
976
|
+
const onHexChange = (value) => {
|
|
977
|
+
setHexDraft(value);
|
|
978
|
+
const parsed = parseHex(value);
|
|
979
|
+
if (!parsed) {
|
|
980
|
+
setHexInvalid(true);
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
setHexInvalid(false);
|
|
984
|
+
const { h, s, v } = rgbToHsv(parsed.r, parsed.g, parsed.b);
|
|
985
|
+
setHsva({
|
|
986
|
+
h,
|
|
987
|
+
s,
|
|
988
|
+
v,
|
|
989
|
+
a: parsed.a
|
|
990
|
+
});
|
|
991
|
+
};
|
|
992
|
+
const onHexBlur = () => {
|
|
993
|
+
if (hexInvalid) {
|
|
994
|
+
setHexDraft(currentHex);
|
|
995
|
+
setHexInvalid(false);
|
|
996
|
+
}
|
|
997
|
+
};
|
|
998
|
+
const openEyeDropper = async () => {
|
|
999
|
+
const Ctor = window.EyeDropper;
|
|
1000
|
+
if (!Ctor) return;
|
|
1001
|
+
try {
|
|
1002
|
+
const parsed = parseHex((await new Ctor().open()).sRGBHex);
|
|
1003
|
+
if (!parsed) return;
|
|
1004
|
+
const { h, s, v } = rgbToHsv(parsed.r, parsed.g, parsed.b);
|
|
1005
|
+
setHsva((prev) => ({
|
|
1006
|
+
h,
|
|
1007
|
+
s,
|
|
1008
|
+
v,
|
|
1009
|
+
a: prev.a
|
|
1010
|
+
}));
|
|
1011
|
+
} catch {}
|
|
1012
|
+
};
|
|
1013
|
+
const handleApply = () => onApply(currentHex);
|
|
1014
|
+
const hueHex = huePreviewHex(hsva.h);
|
|
1015
|
+
const previewNewCss = hsvaToHex(hsva);
|
|
1016
|
+
const previewOldCss = oldColorRef.current === "inherit" || !oldColorRef.current ? "transparent" : oldColorRef.current;
|
|
1017
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1018
|
+
className: pickerView,
|
|
1019
|
+
children: [
|
|
1020
|
+
/* @__PURE__ */ jsxs("button", {
|
|
1021
|
+
"aria-label": "Back to presets",
|
|
1022
|
+
className: backButton,
|
|
1023
|
+
type: "button",
|
|
1024
|
+
onClick: onBack,
|
|
1025
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1026
|
+
children: [/* @__PURE__ */ jsx(ArrowLeft, { className: backIcon }), /* @__PURE__ */ jsx("span", { children: "Back" })]
|
|
1027
|
+
}),
|
|
1028
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1029
|
+
className: satSquare,
|
|
1030
|
+
ref: satRef,
|
|
1031
|
+
style: { backgroundColor: hueHex },
|
|
1032
|
+
onPointerDown: startDrag("sat"),
|
|
1033
|
+
onPointerMove: onMove("sat"),
|
|
1034
|
+
children: [
|
|
1035
|
+
/* @__PURE__ */ jsx("div", { className: satOverlayX }),
|
|
1036
|
+
/* @__PURE__ */ jsx("div", { className: satOverlayY }),
|
|
1037
|
+
/* @__PURE__ */ jsx("div", {
|
|
1038
|
+
className: satThumb,
|
|
1039
|
+
style: {
|
|
1040
|
+
left: `${hsva.s * 100}%`,
|
|
1041
|
+
top: `${(1 - hsva.v) * 100}%`,
|
|
1042
|
+
backgroundColor: hsvaToHex({
|
|
1043
|
+
...hsva,
|
|
1044
|
+
a: 1
|
|
1045
|
+
})
|
|
1046
|
+
}
|
|
1047
|
+
})
|
|
1048
|
+
]
|
|
1049
|
+
}),
|
|
1050
|
+
/* @__PURE__ */ jsx("div", {
|
|
1051
|
+
className: hueTrack,
|
|
1052
|
+
ref: hueRef,
|
|
1053
|
+
onPointerDown: startDrag("hue"),
|
|
1054
|
+
onPointerMove: onMove("hue"),
|
|
1055
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1056
|
+
className: sliderThumb,
|
|
1057
|
+
style: {
|
|
1058
|
+
left: `${hsva.h / 360 * 100}%`,
|
|
1059
|
+
backgroundColor: hueHex
|
|
1060
|
+
}
|
|
1061
|
+
})
|
|
1062
|
+
}),
|
|
1063
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1064
|
+
className: alphaTrack,
|
|
1065
|
+
ref: alphaRef,
|
|
1066
|
+
onPointerDown: startDrag("alpha"),
|
|
1067
|
+
onPointerMove: onMove("alpha"),
|
|
1068
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1069
|
+
className: alphaGradient,
|
|
1070
|
+
style: { background: `linear-gradient(to right, transparent, ${hsvaToHex({
|
|
1071
|
+
...hsva,
|
|
1072
|
+
a: 1
|
|
1073
|
+
})})` }
|
|
1074
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1075
|
+
className: sliderThumb,
|
|
1076
|
+
style: {
|
|
1077
|
+
left: `${hsva.a * 100}%`,
|
|
1078
|
+
backgroundColor: currentHex
|
|
1079
|
+
}
|
|
1080
|
+
})]
|
|
1081
|
+
}),
|
|
1082
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1083
|
+
className: hexRow,
|
|
1084
|
+
children: [
|
|
1085
|
+
/* @__PURE__ */ jsx("input", {
|
|
1086
|
+
"aria-invalid": hexInvalid || void 0,
|
|
1087
|
+
"aria-label": "Hex color",
|
|
1088
|
+
className: `${hexInput}${hexInvalid ? ` ${hexInputInvalid}` : ""}`,
|
|
1089
|
+
spellCheck: false,
|
|
1090
|
+
type: "text",
|
|
1091
|
+
value: hexDraft,
|
|
1092
|
+
onBlur: onHexBlur,
|
|
1093
|
+
onChange: (e) => onHexChange(e.target.value)
|
|
1094
|
+
}),
|
|
1095
|
+
hasEyeDropper && /* @__PURE__ */ jsx("button", {
|
|
1096
|
+
"aria-label": "Pick color from screen",
|
|
1097
|
+
className: "_17r50hfr",
|
|
1098
|
+
type: "button",
|
|
1099
|
+
onClick: openEyeDropper,
|
|
1100
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1101
|
+
children: /* @__PURE__ */ jsx(Pipette, { className: "_17r50hfs" })
|
|
1102
|
+
}),
|
|
1103
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1104
|
+
"aria-hidden": true,
|
|
1105
|
+
className: previewPair,
|
|
1106
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1107
|
+
className: previewCell,
|
|
1108
|
+
style: { backgroundColor: previewOldCss }
|
|
1109
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1110
|
+
className: previewCell,
|
|
1111
|
+
style: { backgroundColor: previewNewCss }
|
|
1112
|
+
})]
|
|
1113
|
+
})
|
|
1114
|
+
]
|
|
1115
|
+
}),
|
|
1116
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1117
|
+
className: actionRow,
|
|
1118
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
1119
|
+
className: actionButton,
|
|
1120
|
+
type: "button",
|
|
1121
|
+
onClick: onCancel,
|
|
1122
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1123
|
+
children: "Cancel"
|
|
1124
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
1125
|
+
className: `${actionButton} ${actionButtonPrimary}`,
|
|
1126
|
+
type: "button",
|
|
1127
|
+
onClick: handleApply,
|
|
1128
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1129
|
+
children: "Apply"
|
|
1130
|
+
})]
|
|
1131
|
+
})
|
|
1132
|
+
]
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
//#endregion
|
|
1136
|
+
//#region src/components/color-picker/index.tsx
|
|
1137
|
+
var TEXT_COLORS = [
|
|
1138
|
+
{
|
|
1139
|
+
name: "Default",
|
|
1140
|
+
value: "inherit"
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
name: "Gray",
|
|
1144
|
+
value: "#6b7280"
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
name: "Red",
|
|
1148
|
+
value: "#ef4444"
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
name: "Orange",
|
|
1152
|
+
value: "#f97316"
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
name: "Amber",
|
|
1156
|
+
value: "#f59e0b"
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
name: "Green",
|
|
1160
|
+
value: "#22c55e"
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
name: "Teal",
|
|
1164
|
+
value: "#14b8a6"
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
name: "Blue",
|
|
1168
|
+
value: "#3b82f6"
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
name: "Indigo",
|
|
1172
|
+
value: "#6366f1"
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
name: "Purple",
|
|
1176
|
+
value: "#a855f7"
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
name: "Pink",
|
|
1180
|
+
value: "#ec4899"
|
|
1181
|
+
}
|
|
1072
1182
|
];
|
|
1073
1183
|
function ColorPicker({ currentColor, onSelect, className }) {
|
|
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
|
-
}
|
|
1184
|
+
const [open, setOpen] = useState(false);
|
|
1185
|
+
const [view, setView] = useState("preset");
|
|
1186
|
+
const displayColor = currentColor === "inherit" || !currentColor ? "currentColor" : currentColor;
|
|
1187
|
+
const handleOpenChange = (next) => {
|
|
1188
|
+
setOpen(next);
|
|
1189
|
+
if (!next) setView("preset");
|
|
1190
|
+
};
|
|
1191
|
+
const handlePreset = (value) => {
|
|
1192
|
+
onSelect(value);
|
|
1193
|
+
handleOpenChange(false);
|
|
1194
|
+
};
|
|
1195
|
+
const handleApply = (hex) => {
|
|
1196
|
+
onSelect(hex);
|
|
1197
|
+
handleOpenChange(false);
|
|
1198
|
+
};
|
|
1199
|
+
const handleCancel = () => handleOpenChange(false);
|
|
1200
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
1201
|
+
open,
|
|
1202
|
+
onOpenChange: handleOpenChange,
|
|
1203
|
+
children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
1204
|
+
className: `${trigger}${className ? ` ${className}` : ""}`,
|
|
1205
|
+
render: /* @__PURE__ */ jsx("button", {
|
|
1206
|
+
type: "button",
|
|
1207
|
+
onMouseDown: (e) => e.preventDefault()
|
|
1208
|
+
}),
|
|
1209
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
1210
|
+
className: triggerLabel,
|
|
1211
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1212
|
+
className: triggerLetter,
|
|
1213
|
+
style: { color: displayColor },
|
|
1214
|
+
children: "A"
|
|
1215
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1216
|
+
className: triggerBar,
|
|
1217
|
+
style: { backgroundColor: displayColor }
|
|
1218
|
+
})]
|
|
1219
|
+
}), /* @__PURE__ */ jsx(ChevronDown, { className: triggerChevron })]
|
|
1220
|
+
}), /* @__PURE__ */ jsx(PopoverPanel, {
|
|
1221
|
+
className: panel,
|
|
1222
|
+
side: "bottom",
|
|
1223
|
+
sideOffset: 6,
|
|
1224
|
+
children: view === "preset" ? /* @__PURE__ */ jsxs("div", {
|
|
1225
|
+
className: grid,
|
|
1226
|
+
children: [TEXT_COLORS.map((color) => /* @__PURE__ */ jsxs("button", {
|
|
1227
|
+
"aria-label": color.name,
|
|
1228
|
+
className: swatch,
|
|
1229
|
+
type: "button",
|
|
1230
|
+
onClick: () => handlePreset(color.value),
|
|
1231
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1232
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1233
|
+
className: swatchDot,
|
|
1234
|
+
style: { backgroundColor: color.value === "inherit" ? "currentColor" : color.value }
|
|
1235
|
+
}), currentColor === color.value && /* @__PURE__ */ jsx(Check, { className: "_17r50hfa" })]
|
|
1236
|
+
}, color.value)), /* @__PURE__ */ jsx("button", {
|
|
1237
|
+
"aria-label": "Custom color",
|
|
1238
|
+
className: swatch,
|
|
1239
|
+
type: "button",
|
|
1240
|
+
onClick: () => setView("picker"),
|
|
1241
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1242
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
1243
|
+
className: addSwatchDot,
|
|
1244
|
+
children: /* @__PURE__ */ jsx(Plus, { className: addSwatchIcon })
|
|
1245
|
+
})
|
|
1246
|
+
})]
|
|
1247
|
+
}) : /* @__PURE__ */ jsx(PickerView, {
|
|
1248
|
+
initialColor: currentColor,
|
|
1249
|
+
onApply: handleApply,
|
|
1250
|
+
onBack: () => setView("preset"),
|
|
1251
|
+
onCancel: handleCancel
|
|
1252
|
+
})
|
|
1253
|
+
})]
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
//#endregion
|
|
1257
|
+
//#region src/components/combobox/styles.css.ts
|
|
1151
1258
|
var popup$4 = "_2buwsh0";
|
|
1152
1259
|
var item$3 = "_2buwsh1";
|
|
1153
1260
|
var empty = "_2buwsh2";
|
|
1261
|
+
//#endregion
|
|
1262
|
+
//#region src/components/combobox/index.tsx
|
|
1154
1263
|
function Combobox(props) {
|
|
1155
|
-
|
|
1264
|
+
return /* @__PURE__ */ jsx(Combobox$1.Root, { ...props });
|
|
1156
1265
|
}
|
|
1157
1266
|
function ComboboxTrigger({ className, ...props }) {
|
|
1158
|
-
|
|
1267
|
+
return /* @__PURE__ */ jsx(Combobox$1.Trigger, {
|
|
1268
|
+
className,
|
|
1269
|
+
...props
|
|
1270
|
+
});
|
|
1159
1271
|
}
|
|
1160
1272
|
function ComboboxInput({ className, ...props }) {
|
|
1161
|
-
|
|
1273
|
+
return /* @__PURE__ */ jsx(Combobox$1.Input, {
|
|
1274
|
+
className,
|
|
1275
|
+
...props
|
|
1276
|
+
});
|
|
1162
1277
|
}
|
|
1163
1278
|
function ComboboxPortal({ children }) {
|
|
1164
|
-
|
|
1165
|
-
}
|
|
1166
|
-
function ComboboxContent({
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
alignOffset,
|
|
1181
|
-
positionMethod,
|
|
1182
|
-
side,
|
|
1183
|
-
sideOffset,
|
|
1184
|
-
style: { zIndex: 50 },
|
|
1185
|
-
children: /* @__PURE__ */ jsx(
|
|
1186
|
-
Combobox$1.Popup,
|
|
1187
|
-
{
|
|
1188
|
-
className: `${popup$4}${className ? ` ${className}` : ""}`,
|
|
1189
|
-
...popupProps,
|
|
1190
|
-
children
|
|
1191
|
-
}
|
|
1192
|
-
)
|
|
1193
|
-
}
|
|
1194
|
-
) });
|
|
1279
|
+
return /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(PortalThemeWrapper$1, { children }) });
|
|
1280
|
+
}
|
|
1281
|
+
function ComboboxContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, positionMethod = "absolute", children, ...popupProps }) {
|
|
1282
|
+
return /* @__PURE__ */ jsx(ComboboxPortal, { children: /* @__PURE__ */ jsx(Combobox$1.Positioner, {
|
|
1283
|
+
align,
|
|
1284
|
+
alignOffset,
|
|
1285
|
+
positionMethod,
|
|
1286
|
+
side,
|
|
1287
|
+
sideOffset,
|
|
1288
|
+
style: { zIndex: 50 },
|
|
1289
|
+
children: /* @__PURE__ */ jsx(Combobox$1.Popup, {
|
|
1290
|
+
className: `${popup$4}${className ? ` ${className}` : ""}`,
|
|
1291
|
+
...popupProps,
|
|
1292
|
+
children
|
|
1293
|
+
})
|
|
1294
|
+
}) });
|
|
1195
1295
|
}
|
|
1196
1296
|
function ComboboxList(props) {
|
|
1197
|
-
|
|
1297
|
+
return /* @__PURE__ */ jsx(Combobox$1.List, { ...props });
|
|
1198
1298
|
}
|
|
1199
1299
|
function ComboboxItem({ className, ...props }) {
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
...props
|
|
1205
|
-
}
|
|
1206
|
-
);
|
|
1300
|
+
return /* @__PURE__ */ jsx(Combobox$1.Item, {
|
|
1301
|
+
className: `${item$3}${className ? ` ${className}` : ""}`,
|
|
1302
|
+
...props
|
|
1303
|
+
});
|
|
1207
1304
|
}
|
|
1208
1305
|
function ComboboxItemIndicator(props) {
|
|
1209
|
-
|
|
1306
|
+
return /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, { ...props });
|
|
1210
1307
|
}
|
|
1211
1308
|
function ComboboxEmpty({ className, ...props }) {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
...props
|
|
1217
|
-
}
|
|
1218
|
-
);
|
|
1309
|
+
return /* @__PURE__ */ jsx(Combobox$1.Empty, {
|
|
1310
|
+
className: `${empty}${className ? ` ${className}` : ""}`,
|
|
1311
|
+
...props
|
|
1312
|
+
});
|
|
1219
1313
|
}
|
|
1220
1314
|
function ComboboxGroup(props) {
|
|
1221
|
-
|
|
1315
|
+
return /* @__PURE__ */ jsx(Combobox$1.Group, { ...props });
|
|
1222
1316
|
}
|
|
1223
1317
|
function ComboboxGroupLabel(props) {
|
|
1224
|
-
|
|
1318
|
+
return /* @__PURE__ */ jsx(Combobox$1.GroupLabel, { ...props });
|
|
1225
1319
|
}
|
|
1320
|
+
//#endregion
|
|
1321
|
+
//#region src/components/dialog/styles.css.ts
|
|
1226
1322
|
var backdrop = "vwlngv4";
|
|
1227
1323
|
var popup$3 = "vwlngv5";
|
|
1228
|
-
var closeButton = "vwlngv6";
|
|
1229
1324
|
var header = "vwlngv7";
|
|
1230
1325
|
var headerContent = "vwlngv8";
|
|
1231
|
-
var headerCloseButton = "vwlngv9";
|
|
1232
1326
|
var footer = "vwlngva";
|
|
1233
1327
|
var title = "vwlngvb";
|
|
1234
1328
|
var description = "vwlngvc";
|
|
@@ -1237,328 +1331,320 @@ var sheetContainer = "vwlngvg";
|
|
|
1237
1331
|
var sheetDragHandle = "vwlngvh";
|
|
1238
1332
|
var sheetDragPill = "vwlngvi";
|
|
1239
1333
|
var sheetContent = "vwlngvj";
|
|
1240
|
-
|
|
1334
|
+
//#endregion
|
|
1335
|
+
//#region src/components/dialog/index.tsx
|
|
1241
1336
|
function Dialog(props) {
|
|
1242
|
-
|
|
1337
|
+
return /* @__PURE__ */ jsx(Dialog$1.Root, { ...props });
|
|
1243
1338
|
}
|
|
1244
1339
|
function DialogTrigger(props) {
|
|
1245
|
-
|
|
1340
|
+
return /* @__PURE__ */ jsx(Dialog$1.Trigger, { ...props });
|
|
1246
1341
|
}
|
|
1247
1342
|
function DialogPortal({ children, ...props }) {
|
|
1248
|
-
|
|
1343
|
+
return /* @__PURE__ */ jsx(Dialog$1.Portal, {
|
|
1344
|
+
...props,
|
|
1345
|
+
children: /* @__PURE__ */ jsx(PortalThemeWrapper$1, { children })
|
|
1346
|
+
});
|
|
1249
1347
|
}
|
|
1250
1348
|
function DialogBackdrop({ className, ...props }) {
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
})
|
|
1265
|
-
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
1266
|
-
/* @__PURE__ */ jsx(DialogBackdrop, {}),
|
|
1267
|
-
/* @__PURE__ */ jsxs(
|
|
1268
|
-
Dialog$1.Popup,
|
|
1269
|
-
{
|
|
1270
|
-
className: `${popup$3}${className ? ` ${className}` : ""}`,
|
|
1271
|
-
...props,
|
|
1272
|
-
children: [
|
|
1273
|
-
children,
|
|
1274
|
-
showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { className: closeButton, children: /* @__PURE__ */ jsx(X, {}) })
|
|
1275
|
-
]
|
|
1276
|
-
}
|
|
1277
|
-
)
|
|
1278
|
-
] });
|
|
1349
|
+
return /* @__PURE__ */ jsx(Dialog$1.Backdrop, {
|
|
1350
|
+
className: `${backdrop}${className ? ` ${className}` : ""}`,
|
|
1351
|
+
...props
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
function DialogPopup({ showCloseButton = true, className, children, ...props }) {
|
|
1355
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogBackdrop, {}), /* @__PURE__ */ jsxs(Dialog$1.Popup, {
|
|
1356
|
+
className: `${popup$3}${className ? ` ${className}` : ""}`,
|
|
1357
|
+
...props,
|
|
1358
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
1359
|
+
className: "vwlngv6",
|
|
1360
|
+
children: /* @__PURE__ */ jsx(X, {})
|
|
1361
|
+
})]
|
|
1362
|
+
})] });
|
|
1279
1363
|
}
|
|
1280
1364
|
function DialogClose(props) {
|
|
1281
|
-
|
|
1365
|
+
return /* @__PURE__ */ jsx(Dialog$1.Close, { ...props });
|
|
1282
1366
|
}
|
|
1283
1367
|
function DialogHeader({ className, children, ...props }) {
|
|
1284
|
-
|
|
1368
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1369
|
+
className: `${header}${className ? ` ${className}` : ""}`,
|
|
1370
|
+
...props,
|
|
1371
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1372
|
+
className: headerContent,
|
|
1373
|
+
children
|
|
1374
|
+
})
|
|
1375
|
+
});
|
|
1285
1376
|
}
|
|
1286
1377
|
function DialogFooter({ className, ...props }) {
|
|
1287
|
-
|
|
1378
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1379
|
+
className: `${footer}${className ? ` ${className}` : ""}`,
|
|
1380
|
+
...props
|
|
1381
|
+
});
|
|
1288
1382
|
}
|
|
1289
1383
|
function DialogTitle({ className, ...props }) {
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
...props
|
|
1295
|
-
}
|
|
1296
|
-
);
|
|
1384
|
+
return /* @__PURE__ */ jsx(Dialog$1.Title, {
|
|
1385
|
+
className: `${title}${className ? ` ${className}` : ""}`,
|
|
1386
|
+
...props
|
|
1387
|
+
});
|
|
1297
1388
|
}
|
|
1298
1389
|
function DialogDescription({ className, ...props }) {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
1390
|
+
return /* @__PURE__ */ jsx(Dialog$1.Description, {
|
|
1391
|
+
className: `${description}${className ? ` ${className}` : ""}`,
|
|
1392
|
+
...props
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
//#endregion
|
|
1396
|
+
//#region src/components/dialog/store.ts
|
|
1397
|
+
var stack = [];
|
|
1398
|
+
var idCounter = 0;
|
|
1399
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
1310
1400
|
function emit() {
|
|
1311
|
-
|
|
1401
|
+
for (const fn of listeners) fn();
|
|
1312
1402
|
}
|
|
1313
1403
|
function subscribe(fn) {
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1404
|
+
listeners.add(fn);
|
|
1405
|
+
return () => {
|
|
1406
|
+
listeners.delete(fn);
|
|
1407
|
+
};
|
|
1318
1408
|
}
|
|
1319
1409
|
function getSnapshot() {
|
|
1320
|
-
|
|
1410
|
+
return stack;
|
|
1321
1411
|
}
|
|
1322
1412
|
function presentDialog(props) {
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1413
|
+
const id = `dialog-${++idCounter}`;
|
|
1414
|
+
stack = [...stack, {
|
|
1415
|
+
...props,
|
|
1416
|
+
id,
|
|
1417
|
+
open: true
|
|
1418
|
+
}];
|
|
1419
|
+
emit();
|
|
1420
|
+
return () => dismissDialog(id);
|
|
1327
1421
|
}
|
|
1328
1422
|
function removeDialog(id) {
|
|
1329
|
-
|
|
1330
|
-
|
|
1423
|
+
stack = stack.filter((item) => item.id !== id);
|
|
1424
|
+
emit();
|
|
1331
1425
|
}
|
|
1332
1426
|
function dismissDialog(id) {
|
|
1333
|
-
|
|
1334
|
-
|
|
1427
|
+
stack = stack.map((item) => item.id === id ? {
|
|
1428
|
+
...item,
|
|
1429
|
+
open: false
|
|
1430
|
+
} : item);
|
|
1431
|
+
emit();
|
|
1335
1432
|
}
|
|
1336
1433
|
function dismissTopDialog() {
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1434
|
+
for (let i = stack.length - 1; i >= 0; i--) if (stack[i].open) {
|
|
1435
|
+
dismissDialog(stack[i].id);
|
|
1436
|
+
return;
|
|
1437
|
+
}
|
|
1343
1438
|
}
|
|
1344
1439
|
function dismissAllDialogs() {
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
}
|
|
1475
|
-
)
|
|
1476
|
-
] }) });
|
|
1440
|
+
stack = stack.map((item) => ({
|
|
1441
|
+
...item,
|
|
1442
|
+
open: false
|
|
1443
|
+
}));
|
|
1444
|
+
emit();
|
|
1445
|
+
}
|
|
1446
|
+
//#endregion
|
|
1447
|
+
//#region src/components/dialog/sheet.tsx
|
|
1448
|
+
var SheetStackEntry = ({ item, index }) => {
|
|
1449
|
+
const { id, open, title: title$3, description: description$4, content, className, portalClassName, theme = "light", clickOutsideToDismiss = true } = item;
|
|
1450
|
+
const dismiss = useCallback(() => dismissDialog(id), [id]);
|
|
1451
|
+
useEffect(() => {
|
|
1452
|
+
if (!open) {
|
|
1453
|
+
const timer = setTimeout(() => removeDialog(id), 200);
|
|
1454
|
+
return () => clearTimeout(timer);
|
|
1455
|
+
}
|
|
1456
|
+
}, [open, id]);
|
|
1457
|
+
useEffect(() => {
|
|
1458
|
+
const original = document.body.style.overflow;
|
|
1459
|
+
document.body.style.overflow = "hidden";
|
|
1460
|
+
return () => {
|
|
1461
|
+
document.body.style.overflow = original;
|
|
1462
|
+
};
|
|
1463
|
+
}, []);
|
|
1464
|
+
const sheetRef = useRef(null);
|
|
1465
|
+
const contentRef = useRef(null);
|
|
1466
|
+
const dragState = useRef(null);
|
|
1467
|
+
const [translateY, setTranslateY] = useState(0);
|
|
1468
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
1469
|
+
const handleTouchStart = useCallback((e) => {
|
|
1470
|
+
const touch = e.touches[0];
|
|
1471
|
+
const isHandle = e.target.closest(`.${sheetDragHandle}`) !== null;
|
|
1472
|
+
const contentEl = contentRef.current;
|
|
1473
|
+
const isContentAtTop = !contentEl || contentEl.scrollTop <= 0;
|
|
1474
|
+
if (!isHandle && !isContentAtTop) return;
|
|
1475
|
+
dragState.current = {
|
|
1476
|
+
startY: touch.clientY,
|
|
1477
|
+
startTime: Date.now(),
|
|
1478
|
+
currentY: touch.clientY,
|
|
1479
|
+
isDragging: false
|
|
1480
|
+
};
|
|
1481
|
+
}, []);
|
|
1482
|
+
const handleTouchMove = useCallback((e) => {
|
|
1483
|
+
const state = dragState.current;
|
|
1484
|
+
if (!state) return;
|
|
1485
|
+
const touch = e.touches[0];
|
|
1486
|
+
const deltaY = touch.clientY - state.startY;
|
|
1487
|
+
if (deltaY < 0) {
|
|
1488
|
+
if (state.isDragging) {
|
|
1489
|
+
setTranslateY(0);
|
|
1490
|
+
setIsDragging(false);
|
|
1491
|
+
state.isDragging = false;
|
|
1492
|
+
}
|
|
1493
|
+
return;
|
|
1494
|
+
}
|
|
1495
|
+
if (!state.isDragging && deltaY > 5) {
|
|
1496
|
+
state.isDragging = true;
|
|
1497
|
+
setIsDragging(true);
|
|
1498
|
+
}
|
|
1499
|
+
if (state.isDragging) {
|
|
1500
|
+
e.preventDefault();
|
|
1501
|
+
state.currentY = touch.clientY;
|
|
1502
|
+
setTranslateY(deltaY);
|
|
1503
|
+
}
|
|
1504
|
+
}, []);
|
|
1505
|
+
const handleTouchEnd = useCallback(() => {
|
|
1506
|
+
const state = dragState.current;
|
|
1507
|
+
if (!state || !state.isDragging) {
|
|
1508
|
+
dragState.current = null;
|
|
1509
|
+
return;
|
|
1510
|
+
}
|
|
1511
|
+
const deltaY = state.currentY - state.startY;
|
|
1512
|
+
const elapsed = Date.now() - state.startTime;
|
|
1513
|
+
const velocity = deltaY / Math.max(elapsed, 1) * 1e3;
|
|
1514
|
+
if (deltaY > (sheetRef.current?.offsetHeight ?? 0) * .25 || velocity > 500) dismiss();
|
|
1515
|
+
else setTranslateY(0);
|
|
1516
|
+
setIsDragging(false);
|
|
1517
|
+
dragState.current = null;
|
|
1518
|
+
}, [dismiss]);
|
|
1519
|
+
const zIndex = 50 + index;
|
|
1520
|
+
const sheetHeight = sheetRef.current?.offsetHeight || 1;
|
|
1521
|
+
const backdropOpacity = isDragging ? Math.max(0, 1 - translateY / sheetHeight) * .5 : .5;
|
|
1522
|
+
return /* @__PURE__ */ jsx(PortalThemeProvider$1, {
|
|
1523
|
+
className: portalClassName ?? "",
|
|
1524
|
+
theme,
|
|
1525
|
+
children: /* @__PURE__ */ jsxs(PortalThemeWrapper$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
1526
|
+
className: sheetBackdrop,
|
|
1527
|
+
style: {
|
|
1528
|
+
zIndex,
|
|
1529
|
+
opacity: open ? backdropOpacity : 0,
|
|
1530
|
+
pointerEvents: open ? "auto" : "none"
|
|
1531
|
+
},
|
|
1532
|
+
onClick: clickOutsideToDismiss ? dismiss : void 0
|
|
1533
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1534
|
+
className: `${sheetContainer}${className ? ` ${className}` : ""}`,
|
|
1535
|
+
"data-closed": !open ? "" : void 0,
|
|
1536
|
+
"data-open": open ? "" : void 0,
|
|
1537
|
+
ref: sheetRef,
|
|
1538
|
+
style: {
|
|
1539
|
+
zIndex: zIndex + 1,
|
|
1540
|
+
transform: isDragging ? `translateY(${translateY}px)` : void 0,
|
|
1541
|
+
transition: isDragging ? "none" : "transform 300ms cubic-bezier(0.32, 0.72, 0, 1)"
|
|
1542
|
+
},
|
|
1543
|
+
onTouchEnd: handleTouchEnd,
|
|
1544
|
+
onTouchMove: handleTouchMove,
|
|
1545
|
+
onTouchStart: handleTouchStart,
|
|
1546
|
+
children: [
|
|
1547
|
+
/* @__PURE__ */ jsx("div", {
|
|
1548
|
+
className: sheetDragHandle,
|
|
1549
|
+
children: /* @__PURE__ */ jsx("div", { className: sheetDragPill })
|
|
1550
|
+
}),
|
|
1551
|
+
(title$3 || description$4) && /* @__PURE__ */ jsxs("div", {
|
|
1552
|
+
className: "vwlngvk",
|
|
1553
|
+
children: [title$3 && /* @__PURE__ */ jsx("div", {
|
|
1554
|
+
className: "vwlngvb",
|
|
1555
|
+
children: title$3
|
|
1556
|
+
}), description$4 && /* @__PURE__ */ jsx("div", {
|
|
1557
|
+
className: "vwlngvc",
|
|
1558
|
+
children: description$4
|
|
1559
|
+
})]
|
|
1560
|
+
}),
|
|
1561
|
+
/* @__PURE__ */ jsx("div", {
|
|
1562
|
+
className: sheetContent,
|
|
1563
|
+
ref: contentRef,
|
|
1564
|
+
children: createElement(content, { dismiss })
|
|
1565
|
+
})
|
|
1566
|
+
]
|
|
1567
|
+
})] })
|
|
1568
|
+
});
|
|
1477
1569
|
};
|
|
1478
|
-
|
|
1570
|
+
//#endregion
|
|
1571
|
+
//#region src/components/dialog/stack.tsx
|
|
1572
|
+
var MOBILE_QUERY = "(max-width: 640px)";
|
|
1479
1573
|
function useIsMobile() {
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
},
|
|
1486
|
-
() => window.matchMedia(MOBILE_QUERY).matches,
|
|
1487
|
-
() => false
|
|
1488
|
-
);
|
|
1574
|
+
return useSyncExternalStore((cb) => {
|
|
1575
|
+
const mql = window.matchMedia(MOBILE_QUERY);
|
|
1576
|
+
mql.addEventListener("change", cb);
|
|
1577
|
+
return () => mql.removeEventListener("change", cb);
|
|
1578
|
+
}, () => window.matchMedia(MOBILE_QUERY).matches, () => false);
|
|
1489
1579
|
}
|
|
1490
1580
|
function shouldUseSheet(sheet, isMobile) {
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
createElement(content, { dismiss })
|
|
1545
|
-
]
|
|
1546
|
-
}
|
|
1547
|
-
)
|
|
1548
|
-
] }) }) })
|
|
1549
|
-
}
|
|
1550
|
-
);
|
|
1581
|
+
if (sheet === true) return true;
|
|
1582
|
+
if (sheet === "auto") return isMobile;
|
|
1583
|
+
return false;
|
|
1584
|
+
}
|
|
1585
|
+
var CloseIcon = () => /* @__PURE__ */ jsx(X, {});
|
|
1586
|
+
var DialogStackEntry = ({ item, index }) => {
|
|
1587
|
+
const { id, open, title: title$2, description: description$3, content, className, portalClassName, theme = "light", showCloseButton = true, clickOutsideToDismiss = true } = item;
|
|
1588
|
+
const dismiss = useCallback(() => dismissDialog(id), [id]);
|
|
1589
|
+
useEffect(() => {
|
|
1590
|
+
if (!open) {
|
|
1591
|
+
const timer = setTimeout(() => {
|
|
1592
|
+
removeDialog(id);
|
|
1593
|
+
}, 150);
|
|
1594
|
+
return () => clearTimeout(timer);
|
|
1595
|
+
}
|
|
1596
|
+
}, [open, id]);
|
|
1597
|
+
const zIndex = 50 + index;
|
|
1598
|
+
return /* @__PURE__ */ jsx(Dialog$1.Root, {
|
|
1599
|
+
disablePointerDismissal: !clickOutsideToDismiss,
|
|
1600
|
+
open,
|
|
1601
|
+
onOpenChange: (open) => {
|
|
1602
|
+
if (!open) dismiss();
|
|
1603
|
+
},
|
|
1604
|
+
children: /* @__PURE__ */ jsx(Dialog$1.Portal, { children: /* @__PURE__ */ jsx(PortalThemeProvider$1, {
|
|
1605
|
+
className: portalClassName ?? "",
|
|
1606
|
+
theme,
|
|
1607
|
+
children: /* @__PURE__ */ jsxs(PortalThemeWrapper$1, { children: [/* @__PURE__ */ jsx(Dialog$1.Backdrop, {
|
|
1608
|
+
className: backdrop,
|
|
1609
|
+
style: { zIndex }
|
|
1610
|
+
}), /* @__PURE__ */ jsxs(Dialog$1.Popup, {
|
|
1611
|
+
suppressHydrationWarning: true,
|
|
1612
|
+
className: `${popup$3}${className ? ` ${className}` : ""}`,
|
|
1613
|
+
"data-theme": theme,
|
|
1614
|
+
style: { zIndex: zIndex + 1 },
|
|
1615
|
+
children: [(title$2 || description$3 || showCloseButton) && /* @__PURE__ */ jsxs("div", {
|
|
1616
|
+
className: "vwlngv7",
|
|
1617
|
+
children: [(title$2 || description$3) && /* @__PURE__ */ jsxs("div", {
|
|
1618
|
+
className: "vwlngv8",
|
|
1619
|
+
children: [title$2 && /* @__PURE__ */ jsx(Dialog$1.Title, {
|
|
1620
|
+
className: "vwlngvb",
|
|
1621
|
+
children: title$2
|
|
1622
|
+
}), description$3 && /* @__PURE__ */ jsx(Dialog$1.Description, {
|
|
1623
|
+
className: "vwlngvc",
|
|
1624
|
+
children: description$3
|
|
1625
|
+
})]
|
|
1626
|
+
}), showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
1627
|
+
className: "vwlngv9",
|
|
1628
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
1629
|
+
})]
|
|
1630
|
+
}), createElement(content, { dismiss })]
|
|
1631
|
+
})] })
|
|
1632
|
+
}) })
|
|
1633
|
+
});
|
|
1551
1634
|
};
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1635
|
+
var DialogStackProvider = ({ children }) => {
|
|
1636
|
+
const stack = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
1637
|
+
const isMobile = useIsMobile();
|
|
1638
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [children, stack.map((item, index) => shouldUseSheet(item.sheet, isMobile) ? /* @__PURE__ */ jsx(SheetStackEntry, {
|
|
1639
|
+
index,
|
|
1640
|
+
item
|
|
1641
|
+
}, item.id) : /* @__PURE__ */ jsx(DialogStackEntry, {
|
|
1642
|
+
index,
|
|
1643
|
+
item
|
|
1644
|
+
}, item.id))] });
|
|
1561
1645
|
};
|
|
1646
|
+
//#endregion
|
|
1647
|
+
//#region src/components/dropdown-menu/styles.css.ts
|
|
1562
1648
|
var popup$2 = "oih0op0";
|
|
1563
1649
|
var positioner$2 = "oih0op1";
|
|
1564
1650
|
var item$2 = "oih0op2";
|
|
@@ -1568,293 +1654,295 @@ var checkboxItem = "oih0op3";
|
|
|
1568
1654
|
var radioItem = "oih0op3";
|
|
1569
1655
|
var checkboxIndicator = "oih0op4";
|
|
1570
1656
|
var radioIndicator = "oih0op5";
|
|
1657
|
+
//#endregion
|
|
1658
|
+
//#region src/components/dropdown-menu/index.tsx
|
|
1571
1659
|
function DropdownMenu(props) {
|
|
1572
|
-
|
|
1660
|
+
return /* @__PURE__ */ jsx(Menu.Root, {
|
|
1661
|
+
"data-slot": "dropdown-menu",
|
|
1662
|
+
...props
|
|
1663
|
+
});
|
|
1573
1664
|
}
|
|
1574
1665
|
function DropdownMenuTrigger(props) {
|
|
1575
|
-
|
|
1666
|
+
return /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
1667
|
+
"data-slot": "dropdown-menu-trigger",
|
|
1668
|
+
...props
|
|
1669
|
+
});
|
|
1576
1670
|
}
|
|
1577
1671
|
function DropdownMenuPortal({ children }) {
|
|
1578
|
-
|
|
1579
|
-
}
|
|
1580
|
-
function DropdownMenuContent({
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
positionMethod,
|
|
1598
|
-
side,
|
|
1599
|
-
sideOffset,
|
|
1600
|
-
style: { zIndex: 50 },
|
|
1601
|
-
children: /* @__PURE__ */ jsx(
|
|
1602
|
-
Menu.Popup,
|
|
1603
|
-
{
|
|
1604
|
-
className: `${popup$2}${className ? ` ${className}` : ""}`,
|
|
1605
|
-
"data-slot": "dropdown-menu-content",
|
|
1606
|
-
...popupProps,
|
|
1607
|
-
children
|
|
1608
|
-
}
|
|
1609
|
-
)
|
|
1610
|
-
}
|
|
1611
|
-
) });
|
|
1672
|
+
return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(PortalThemeWrapper$1, { children }) });
|
|
1673
|
+
}
|
|
1674
|
+
function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, positionMethod = "absolute", children, ...popupProps }) {
|
|
1675
|
+
return /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
1676
|
+
align,
|
|
1677
|
+
alignOffset,
|
|
1678
|
+
className: positioner$2,
|
|
1679
|
+
"data-slot": "dropdown-menu-positioner",
|
|
1680
|
+
positionMethod,
|
|
1681
|
+
side,
|
|
1682
|
+
sideOffset,
|
|
1683
|
+
style: { zIndex: 50 },
|
|
1684
|
+
children: /* @__PURE__ */ jsx(Menu.Popup, {
|
|
1685
|
+
className: `${popup$2}${className ? ` ${className}` : ""}`,
|
|
1686
|
+
"data-slot": "dropdown-menu-content",
|
|
1687
|
+
...popupProps,
|
|
1688
|
+
children
|
|
1689
|
+
})
|
|
1690
|
+
}) });
|
|
1612
1691
|
}
|
|
1613
1692
|
function DropdownMenuGroup(props) {
|
|
1614
|
-
|
|
1693
|
+
return /* @__PURE__ */ jsx(Menu.Group, {
|
|
1694
|
+
"data-slot": "dropdown-menu-group",
|
|
1695
|
+
...props
|
|
1696
|
+
});
|
|
1615
1697
|
}
|
|
1616
1698
|
function DropdownMenuLabel({ className, ...props }) {
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
...props
|
|
1623
|
-
}
|
|
1624
|
-
);
|
|
1699
|
+
return /* @__PURE__ */ jsx(Menu.GroupLabel, {
|
|
1700
|
+
className: `${label}${className ? ` ${className}` : ""}`,
|
|
1701
|
+
"data-slot": "dropdown-menu-label",
|
|
1702
|
+
...props
|
|
1703
|
+
});
|
|
1625
1704
|
}
|
|
1626
1705
|
function DropdownMenuItem({ className, ...props }) {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
...props
|
|
1633
|
-
}
|
|
1634
|
-
);
|
|
1706
|
+
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
1707
|
+
className: `${item$2}${className ? ` ${className}` : ""}`,
|
|
1708
|
+
"data-slot": "dropdown-menu-item",
|
|
1709
|
+
...props
|
|
1710
|
+
});
|
|
1635
1711
|
}
|
|
1636
1712
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
...props
|
|
1643
|
-
}
|
|
1644
|
-
);
|
|
1713
|
+
return /* @__PURE__ */ jsx(Menu.Separator, {
|
|
1714
|
+
className: `${separator$1}${className ? ` ${className}` : ""}`,
|
|
1715
|
+
"data-slot": "dropdown-menu-separator",
|
|
1716
|
+
...props
|
|
1717
|
+
});
|
|
1645
1718
|
}
|
|
1646
1719
|
function DropdownMenuRadioGroup(props) {
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
|
-
className,
|
|
1676
|
-
children,
|
|
1677
|
-
...props
|
|
1678
|
-
}) {
|
|
1679
|
-
return /* @__PURE__ */ jsxs(
|
|
1680
|
-
Menu.CheckboxItem,
|
|
1681
|
-
{
|
|
1682
|
-
className: `${item$2} ${checkboxItem}${className ? ` ${className}` : ""}`,
|
|
1683
|
-
"data-slot": "dropdown-menu-checkbox-item",
|
|
1684
|
-
...props,
|
|
1685
|
-
children: [
|
|
1686
|
-
children,
|
|
1687
|
-
/* @__PURE__ */ jsx(
|
|
1688
|
-
Menu.CheckboxItemIndicator,
|
|
1689
|
-
{
|
|
1690
|
-
className: checkboxIndicator,
|
|
1691
|
-
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
1692
|
-
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
1693
|
-
}
|
|
1694
|
-
)
|
|
1695
|
-
]
|
|
1696
|
-
}
|
|
1697
|
-
);
|
|
1720
|
+
return /* @__PURE__ */ jsx(Menu.RadioGroup, {
|
|
1721
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
1722
|
+
...props
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
1726
|
+
return /* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
1727
|
+
className: `${item$2} ${radioItem}${className ? ` ${className}` : ""}`,
|
|
1728
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
1729
|
+
...props,
|
|
1730
|
+
children: [children, /* @__PURE__ */ jsx(Menu.RadioItemIndicator, {
|
|
1731
|
+
className: radioIndicator,
|
|
1732
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
1733
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
1734
|
+
})]
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
function DropdownMenuCheckboxItem({ className, children, ...props }) {
|
|
1738
|
+
return /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
|
|
1739
|
+
className: `${item$2} ${checkboxItem}${className ? ` ${className}` : ""}`,
|
|
1740
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
1741
|
+
...props,
|
|
1742
|
+
children: [children, /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, {
|
|
1743
|
+
className: checkboxIndicator,
|
|
1744
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
1745
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
1746
|
+
})]
|
|
1747
|
+
});
|
|
1698
1748
|
}
|
|
1699
1749
|
function CheckIcon() {
|
|
1700
|
-
|
|
1750
|
+
return /* @__PURE__ */ jsx(Check, { size: 16 });
|
|
1701
1751
|
}
|
|
1752
|
+
//#endregion
|
|
1753
|
+
//#region src/components/scroll-area/styles.css.ts
|
|
1702
1754
|
var scrollArea = "_1y5k2ih0";
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1755
|
+
//#endregion
|
|
1756
|
+
//#region src/components/scroll-area/index.tsx
|
|
1757
|
+
function ScrollArea({ children, className, autoScrollToBottom = false, scrollRef }) {
|
|
1758
|
+
const innerRef = useRef(null);
|
|
1759
|
+
const ref = scrollRef ?? innerRef;
|
|
1760
|
+
const isAtBottomRef = useRef(true);
|
|
1761
|
+
const handleScroll = useCallback(() => {
|
|
1762
|
+
const el = ref.current;
|
|
1763
|
+
if (!el) return;
|
|
1764
|
+
isAtBottomRef.current = el.scrollHeight - el.scrollTop - el.clientHeight < 40;
|
|
1765
|
+
}, [ref]);
|
|
1766
|
+
useEffect(() => {
|
|
1767
|
+
if (!autoScrollToBottom) return;
|
|
1768
|
+
const el = ref.current;
|
|
1769
|
+
if (!el || !isAtBottomRef.current) return;
|
|
1770
|
+
el.scrollTo({
|
|
1771
|
+
top: el.scrollHeight,
|
|
1772
|
+
behavior: "smooth"
|
|
1773
|
+
});
|
|
1774
|
+
});
|
|
1775
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1776
|
+
className: `${scrollArea}${className ? ` ${className}` : ""}`,
|
|
1777
|
+
ref,
|
|
1778
|
+
onScroll: autoScrollToBottom ? handleScroll : void 0,
|
|
1779
|
+
children
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
//#endregion
|
|
1783
|
+
//#region src/components/segmented-control/styles.css.ts
|
|
1784
|
+
var container = createRuntimeFn({
|
|
1785
|
+
defaultClassName: "_6d8tz20",
|
|
1786
|
+
variantClassNames: {
|
|
1787
|
+
size: {
|
|
1788
|
+
sm: "_6d8tz21",
|
|
1789
|
+
md: "_6d8tz22"
|
|
1790
|
+
},
|
|
1791
|
+
fullWidth: {
|
|
1792
|
+
true: "_6d8tz23",
|
|
1793
|
+
false: "_6d8tz24"
|
|
1794
|
+
}
|
|
1795
|
+
},
|
|
1796
|
+
defaultVariants: {
|
|
1797
|
+
size: "sm",
|
|
1798
|
+
fullWidth: false
|
|
1799
|
+
},
|
|
1800
|
+
compoundVariants: []
|
|
1801
|
+
});
|
|
1802
|
+
var indicator = createRuntimeFn({
|
|
1803
|
+
defaultClassName: "_6d8tz25",
|
|
1804
|
+
variantClassNames: { ready: {
|
|
1805
|
+
true: "_6d8tz26",
|
|
1806
|
+
false: "_6d8tz27"
|
|
1807
|
+
} },
|
|
1808
|
+
defaultVariants: { ready: true },
|
|
1809
|
+
compoundVariants: []
|
|
1810
|
+
});
|
|
1811
|
+
var item$1 = createRuntimeFn({
|
|
1812
|
+
defaultClassName: "_6d8tz28",
|
|
1813
|
+
variantClassNames: {
|
|
1814
|
+
size: {
|
|
1815
|
+
sm: "_6d8tz29",
|
|
1816
|
+
md: "_6d8tz2a"
|
|
1817
|
+
},
|
|
1818
|
+
active: {
|
|
1819
|
+
true: "_6d8tz2b",
|
|
1820
|
+
false: "_6d8tz2c"
|
|
1821
|
+
},
|
|
1822
|
+
disabled: {
|
|
1823
|
+
true: "_6d8tz2d",
|
|
1824
|
+
false: "_6d8tz2e"
|
|
1825
|
+
},
|
|
1826
|
+
fullWidth: {
|
|
1827
|
+
true: "_6d8tz2f",
|
|
1828
|
+
false: "_6d8tz2g"
|
|
1829
|
+
}
|
|
1830
|
+
},
|
|
1831
|
+
defaultVariants: {
|
|
1832
|
+
size: "sm",
|
|
1833
|
+
active: false,
|
|
1834
|
+
disabled: false,
|
|
1835
|
+
fullWidth: false
|
|
1836
|
+
},
|
|
1837
|
+
compoundVariants: []
|
|
1838
|
+
});
|
|
1839
|
+
//#endregion
|
|
1840
|
+
//#region src/components/segmented-control/index.tsx
|
|
1841
|
+
function SegmentedControl({ items, value, onChange, size = "sm", fullWidth = false, className }) {
|
|
1842
|
+
const containerRef = useRef(null);
|
|
1843
|
+
const itemElementsRef = useRef(/* @__PURE__ */ new Map());
|
|
1844
|
+
const [indicator$2, setIndicator] = useState({
|
|
1845
|
+
left: 0,
|
|
1846
|
+
width: 0
|
|
1847
|
+
});
|
|
1848
|
+
const [isReady, setIsReady] = useState(false);
|
|
1849
|
+
const updateIndicator = useCallback(() => {
|
|
1850
|
+
const container = containerRef.current;
|
|
1851
|
+
const activeEl = itemElementsRef.current.get(value);
|
|
1852
|
+
if (!container || !activeEl) return;
|
|
1853
|
+
const containerRect = container.getBoundingClientRect();
|
|
1854
|
+
const activeRect = activeEl.getBoundingClientRect();
|
|
1855
|
+
setIndicator({
|
|
1856
|
+
left: activeRect.left - containerRect.left,
|
|
1857
|
+
width: activeRect.width
|
|
1858
|
+
});
|
|
1859
|
+
setIsReady(true);
|
|
1860
|
+
}, [value]);
|
|
1861
|
+
useEffect(() => {
|
|
1862
|
+
updateIndicator();
|
|
1863
|
+
}, [updateIndicator]);
|
|
1864
|
+
useEffect(() => {
|
|
1865
|
+
const container = containerRef.current;
|
|
1866
|
+
if (!container) return;
|
|
1867
|
+
const observer = new ResizeObserver(() => {
|
|
1868
|
+
updateIndicator();
|
|
1869
|
+
});
|
|
1870
|
+
observer.observe(container);
|
|
1871
|
+
return () => observer.disconnect();
|
|
1872
|
+
}, [updateIndicator]);
|
|
1873
|
+
const handleKeyDown = (e) => {
|
|
1874
|
+
const enabledItems = items.filter((item) => !item.disabled);
|
|
1875
|
+
const currentIndex = enabledItems.findIndex((item) => item.value === value);
|
|
1876
|
+
let nextIndex = currentIndex;
|
|
1877
|
+
switch (e.key) {
|
|
1878
|
+
case "ArrowRight":
|
|
1879
|
+
case "ArrowDown":
|
|
1880
|
+
e.preventDefault();
|
|
1881
|
+
nextIndex = (currentIndex + 1) % enabledItems.length;
|
|
1882
|
+
break;
|
|
1883
|
+
case "ArrowLeft":
|
|
1884
|
+
case "ArrowUp":
|
|
1885
|
+
e.preventDefault();
|
|
1886
|
+
nextIndex = (currentIndex - 1 + enabledItems.length) % enabledItems.length;
|
|
1887
|
+
break;
|
|
1888
|
+
case "Home":
|
|
1889
|
+
e.preventDefault();
|
|
1890
|
+
nextIndex = 0;
|
|
1891
|
+
break;
|
|
1892
|
+
case "End":
|
|
1893
|
+
e.preventDefault();
|
|
1894
|
+
nextIndex = enabledItems.length - 1;
|
|
1895
|
+
break;
|
|
1896
|
+
}
|
|
1897
|
+
if (nextIndex !== currentIndex) {
|
|
1898
|
+
const nextItem = enabledItems[nextIndex];
|
|
1899
|
+
onChange(nextItem.value);
|
|
1900
|
+
itemElementsRef.current.get(nextItem.value)?.focus();
|
|
1901
|
+
}
|
|
1902
|
+
};
|
|
1903
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1904
|
+
"aria-orientation": "horizontal",
|
|
1905
|
+
className: `${container({
|
|
1906
|
+
size,
|
|
1907
|
+
fullWidth
|
|
1908
|
+
})} ${className || ""}`.trim(),
|
|
1909
|
+
ref: containerRef,
|
|
1910
|
+
role: "tablist",
|
|
1911
|
+
onKeyDown: handleKeyDown,
|
|
1912
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1913
|
+
"aria-hidden": "true",
|
|
1914
|
+
className: indicator({ ready: isReady }),
|
|
1915
|
+
style: {
|
|
1916
|
+
left: indicator$2.left,
|
|
1917
|
+
width: indicator$2.width
|
|
1918
|
+
}
|
|
1919
|
+
}), items.map((item) => {
|
|
1920
|
+
const isActive = item.value === value;
|
|
1921
|
+
return /* @__PURE__ */ jsx("button", {
|
|
1922
|
+
"aria-selected": isActive,
|
|
1923
|
+
"data-active": isActive || void 0,
|
|
1924
|
+
disabled: item.disabled,
|
|
1925
|
+
role: "tab",
|
|
1926
|
+
tabIndex: isActive ? 0 : -1,
|
|
1927
|
+
type: "button",
|
|
1928
|
+
className: item$1({
|
|
1929
|
+
size,
|
|
1930
|
+
active: isActive,
|
|
1931
|
+
disabled: Boolean(item.disabled),
|
|
1932
|
+
fullWidth
|
|
1933
|
+
}),
|
|
1934
|
+
ref: (el) => {
|
|
1935
|
+
if (el) itemElementsRef.current.set(item.value, el);
|
|
1936
|
+
else itemElementsRef.current.delete(item.value);
|
|
1937
|
+
},
|
|
1938
|
+
onClick: () => onChange(item.value),
|
|
1939
|
+
children: item.label
|
|
1940
|
+
}, item.value);
|
|
1941
|
+
})]
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
//#endregion
|
|
1945
|
+
//#region src/components/select/styles.css.ts
|
|
1858
1946
|
var triggerButton = "p74a622";
|
|
1859
1947
|
var triggerIcon = "p74a623";
|
|
1860
1948
|
var positioner$1 = "p74a624";
|
|
@@ -1865,258 +1953,220 @@ var itemIndicator = "p74a628";
|
|
|
1865
1953
|
var groupLabel = "p74a629";
|
|
1866
1954
|
var separator = "p74a62a";
|
|
1867
1955
|
var scrollButton = "p74a62b";
|
|
1956
|
+
//#endregion
|
|
1957
|
+
//#region src/components/select/index.tsx
|
|
1868
1958
|
function Select(props) {
|
|
1869
|
-
|
|
1959
|
+
return /* @__PURE__ */ jsx(Select$1.Root, { ...props });
|
|
1870
1960
|
}
|
|
1871
1961
|
function SelectTrigger({ children, className, ...props }) {
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
]
|
|
1881
|
-
}
|
|
1882
|
-
);
|
|
1962
|
+
return /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
1963
|
+
...props,
|
|
1964
|
+
className: `${triggerButton}${className ? ` ${className}` : ""}`,
|
|
1965
|
+
children: [children, /* @__PURE__ */ jsx(Select$1.Icon, {
|
|
1966
|
+
className: triggerIcon,
|
|
1967
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { size: 16 })
|
|
1968
|
+
})]
|
|
1969
|
+
});
|
|
1883
1970
|
}
|
|
1884
1971
|
function SelectValue(props) {
|
|
1885
|
-
|
|
1886
|
-
}
|
|
1887
|
-
function SelectContent({
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
/* @__PURE__ */ jsx(Select$1.ScrollUpArrow, { className: scrollButton, children: /* @__PURE__ */ jsx(ChevronUp, { size: 16 }) }),
|
|
1911
|
-
/* @__PURE__ */ jsx(Select$1.List, { children }),
|
|
1912
|
-
/* @__PURE__ */ jsx(Select$1.ScrollDownArrow, { className: scrollButton, children: /* @__PURE__ */ jsx(ChevronDown, { size: 16 }) })
|
|
1913
|
-
]
|
|
1914
|
-
}
|
|
1915
|
-
)
|
|
1916
|
-
}
|
|
1917
|
-
) }) });
|
|
1972
|
+
return /* @__PURE__ */ jsx(Select$1.Value, { ...props });
|
|
1973
|
+
}
|
|
1974
|
+
function SelectContent({ children, className, align = "center", alignItemWithTrigger = true, side = "bottom", sideOffset = 4, ...props }) {
|
|
1975
|
+
return /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(PortalThemeWrapper, { children: /* @__PURE__ */ jsx(Select$1.Positioner, {
|
|
1976
|
+
align,
|
|
1977
|
+
alignItemWithTrigger,
|
|
1978
|
+
className: positioner$1,
|
|
1979
|
+
side,
|
|
1980
|
+
sideOffset,
|
|
1981
|
+
children: /* @__PURE__ */ jsxs(Select$1.Popup, {
|
|
1982
|
+
...props,
|
|
1983
|
+
className: `${popup$1}${className ? ` ${className}` : ""}`,
|
|
1984
|
+
children: [
|
|
1985
|
+
/* @__PURE__ */ jsx(Select$1.ScrollUpArrow, {
|
|
1986
|
+
className: scrollButton,
|
|
1987
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { size: 16 })
|
|
1988
|
+
}),
|
|
1989
|
+
/* @__PURE__ */ jsx(Select$1.List, { children }),
|
|
1990
|
+
/* @__PURE__ */ jsx(Select$1.ScrollDownArrow, {
|
|
1991
|
+
className: scrollButton,
|
|
1992
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { size: 16 })
|
|
1993
|
+
})
|
|
1994
|
+
]
|
|
1995
|
+
})
|
|
1996
|
+
}) }) });
|
|
1918
1997
|
}
|
|
1919
1998
|
function SelectItem({ className, children, ...props }) {
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1999
|
+
return /* @__PURE__ */ jsxs(Select$1.Item, {
|
|
2000
|
+
...props,
|
|
2001
|
+
className: `${item}${className ? ` ${className}` : ""}`,
|
|
2002
|
+
children: [/* @__PURE__ */ jsx(Select$1.ItemText, { children }), /* @__PURE__ */ jsx(Select$1.ItemIndicator, {
|
|
2003
|
+
className: itemIndicator,
|
|
2004
|
+
children: /* @__PURE__ */ jsx(Check, { size: 16 })
|
|
2005
|
+
})]
|
|
2006
|
+
});
|
|
1924
2007
|
}
|
|
1925
2008
|
function SelectGroup({ className, ...props }) {
|
|
1926
|
-
|
|
2009
|
+
return /* @__PURE__ */ jsx(Select$1.Group, {
|
|
2010
|
+
...props,
|
|
2011
|
+
className: `${group}${className ? ` ${className}` : ""}`
|
|
2012
|
+
});
|
|
1927
2013
|
}
|
|
1928
2014
|
function SelectGroupLabel({ className, ...props }) {
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
className: `${groupLabel}${className ? ` ${className}` : ""}`
|
|
1934
|
-
}
|
|
1935
|
-
);
|
|
2015
|
+
return /* @__PURE__ */ jsx(Select$1.GroupLabel, {
|
|
2016
|
+
...props,
|
|
2017
|
+
className: `${groupLabel}${className ? ` ${className}` : ""}`
|
|
2018
|
+
});
|
|
1936
2019
|
}
|
|
1937
2020
|
function SelectSeparator({ className }) {
|
|
1938
|
-
|
|
1939
|
-
}
|
|
1940
|
-
|
|
2021
|
+
return /* @__PURE__ */ jsx("div", { className: `${separator}${className ? ` ${className}` : ""}` });
|
|
2022
|
+
}
|
|
2023
|
+
//#endregion
|
|
2024
|
+
//#region src/components/spinner/styles.css.ts
|
|
2025
|
+
var spinner = createRuntimeFn({
|
|
2026
|
+
defaultClassName: "_131cfek1",
|
|
2027
|
+
variantClassNames: { size: {
|
|
2028
|
+
sm: "_131cfek2",
|
|
2029
|
+
md: "_131cfek3"
|
|
2030
|
+
} },
|
|
2031
|
+
defaultVariants: { size: "sm" },
|
|
2032
|
+
compoundVariants: []
|
|
2033
|
+
});
|
|
2034
|
+
//#endregion
|
|
2035
|
+
//#region src/components/spinner/index.tsx
|
|
1941
2036
|
function Spinner({ size, className }) {
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
}
|
|
2037
|
+
return /* @__PURE__ */ jsx("span", {
|
|
2038
|
+
"aria-hidden": "true",
|
|
2039
|
+
className: `${spinner({ size })}${className ? ` ${className}` : ""}`,
|
|
2040
|
+
role: "status"
|
|
2041
|
+
});
|
|
2042
|
+
}
|
|
2043
|
+
//#endregion
|
|
2044
|
+
//#region src/components/status-dot/styles.css.ts
|
|
1951
2045
|
var statusDotWrapper = "_73cmpa1";
|
|
1952
|
-
var dot = createRuntimeFn({
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2046
|
+
var dot = createRuntimeFn({
|
|
2047
|
+
defaultClassName: "_73cmpa2",
|
|
2048
|
+
variantClassNames: {
|
|
2049
|
+
status: {
|
|
2050
|
+
idle: "_73cmpa3",
|
|
2051
|
+
active: "_73cmpa4",
|
|
2052
|
+
success: "_73cmpa5",
|
|
2053
|
+
error: "_73cmpa6",
|
|
2054
|
+
warning: "_73cmpa7"
|
|
2055
|
+
},
|
|
2056
|
+
size: {
|
|
2057
|
+
sm: "_73cmpa8",
|
|
2058
|
+
md: "_73cmpa9"
|
|
2059
|
+
}
|
|
2060
|
+
},
|
|
2061
|
+
defaultVariants: {
|
|
2062
|
+
status: "idle",
|
|
2063
|
+
size: "sm"
|
|
2064
|
+
},
|
|
2065
|
+
compoundVariants: []
|
|
2066
|
+
});
|
|
2067
|
+
var pulseRing = createRuntimeFn({
|
|
2068
|
+
defaultClassName: "_73cmpaa",
|
|
2069
|
+
variantClassNames: {
|
|
2070
|
+
status: {
|
|
2071
|
+
idle: "_73cmpab",
|
|
2072
|
+
active: "_73cmpac",
|
|
2073
|
+
success: "_73cmpad",
|
|
2074
|
+
error: "_73cmpae",
|
|
2075
|
+
warning: "_73cmpaf"
|
|
2076
|
+
},
|
|
2077
|
+
size: {
|
|
2078
|
+
sm: "_73cmpag",
|
|
2079
|
+
md: "_73cmpah"
|
|
2080
|
+
}
|
|
2081
|
+
},
|
|
2082
|
+
defaultVariants: {
|
|
2083
|
+
status: "idle",
|
|
2084
|
+
size: "sm"
|
|
2085
|
+
},
|
|
2086
|
+
compoundVariants: []
|
|
2087
|
+
});
|
|
2088
|
+
//#endregion
|
|
2089
|
+
//#region src/components/status-dot/index.tsx
|
|
2090
|
+
function StatusDot({ status, pulse: showPulse, size, className }) {
|
|
2091
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
2092
|
+
className: `${statusDotWrapper}${className ? ` ${className}` : ""}`,
|
|
2093
|
+
children: [showPulse && /* @__PURE__ */ jsx("span", { className: pulseRing({
|
|
2094
|
+
status,
|
|
2095
|
+
size
|
|
2096
|
+
}) }), /* @__PURE__ */ jsx("span", { className: dot({
|
|
2097
|
+
status,
|
|
2098
|
+
size
|
|
2099
|
+
}) })]
|
|
2100
|
+
});
|
|
2101
|
+
}
|
|
2102
|
+
//#endregion
|
|
2103
|
+
//#region src/components/tooltip/styles.css.ts
|
|
1965
2104
|
var positioner = "_1cspf2m2";
|
|
1966
2105
|
var popup = "_1cspf2m3";
|
|
2106
|
+
//#endregion
|
|
2107
|
+
//#region src/components/tooltip/index.tsx
|
|
1967
2108
|
function TooltipProvider(props) {
|
|
1968
|
-
|
|
2109
|
+
return /* @__PURE__ */ jsx(Tooltip.Provider, { ...props });
|
|
1969
2110
|
}
|
|
1970
2111
|
function TooltipRoot(props) {
|
|
1971
|
-
|
|
2112
|
+
return /* @__PURE__ */ jsx(Tooltip.Root, { ...props });
|
|
1972
2113
|
}
|
|
1973
2114
|
function TooltipTrigger(props) {
|
|
1974
|
-
|
|
2115
|
+
return /* @__PURE__ */ jsx(Tooltip.Trigger, { ...props });
|
|
1975
2116
|
}
|
|
1976
2117
|
function TooltipPortal({ children, ...props }) {
|
|
1977
|
-
|
|
2118
|
+
return /* @__PURE__ */ jsx(Tooltip.Portal, {
|
|
2119
|
+
...props,
|
|
2120
|
+
children: /* @__PURE__ */ jsx(PortalThemeWrapper$1, { children })
|
|
2121
|
+
});
|
|
1978
2122
|
}
|
|
1979
2123
|
function TooltipPositioner(props) {
|
|
1980
|
-
|
|
2124
|
+
return /* @__PURE__ */ jsx(Tooltip.Positioner, { ...props });
|
|
1981
2125
|
}
|
|
1982
2126
|
function TooltipPopup({ className, children, ...props }) {
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
})
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
},
|
|
2030
|
-
{ threshold }
|
|
2031
|
-
);
|
|
2032
|
-
obs.observe(el);
|
|
2033
|
-
return () => obs.disconnect();
|
|
2034
|
-
}, [visible, threshold]);
|
|
2035
|
-
if (visible) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
2036
|
-
return /* @__PURE__ */ jsx("div", { ref, children: fallback });
|
|
2037
|
-
}
|
|
2038
|
-
export {
|
|
2039
|
-
ActionBar,
|
|
2040
|
-
ActionButton,
|
|
2041
|
-
Alert,
|
|
2042
|
-
AnimatedCheckbox,
|
|
2043
|
-
AnimatedTabs,
|
|
2044
|
-
AutoResizeTextArea,
|
|
2045
|
-
Badge,
|
|
2046
|
-
CodeBlock,
|
|
2047
|
-
Collapsible,
|
|
2048
|
-
CollapsiblePanel,
|
|
2049
|
-
CollapsibleTrigger,
|
|
2050
|
-
ColorPicker,
|
|
2051
|
-
Combobox,
|
|
2052
|
-
ComboboxContent,
|
|
2053
|
-
ComboboxEmpty,
|
|
2054
|
-
ComboboxGroup,
|
|
2055
|
-
ComboboxGroupLabel,
|
|
2056
|
-
ComboboxInput,
|
|
2057
|
-
ComboboxItem,
|
|
2058
|
-
ComboboxItemIndicator,
|
|
2059
|
-
ComboboxList,
|
|
2060
|
-
ComboboxTrigger,
|
|
2061
|
-
Dialog,
|
|
2062
|
-
DialogBackdrop,
|
|
2063
|
-
DialogClose,
|
|
2064
|
-
DialogDescription,
|
|
2065
|
-
DialogFooter,
|
|
2066
|
-
DialogHeader,
|
|
2067
|
-
DialogPopup,
|
|
2068
|
-
DialogPortal,
|
|
2069
|
-
DialogStackProvider,
|
|
2070
|
-
DialogTitle,
|
|
2071
|
-
DialogTrigger,
|
|
2072
|
-
DropdownMenu,
|
|
2073
|
-
DropdownMenuCheckboxItem,
|
|
2074
|
-
DropdownMenuContent,
|
|
2075
|
-
DropdownMenuGroup,
|
|
2076
|
-
DropdownMenuItem,
|
|
2077
|
-
DropdownMenuLabel,
|
|
2078
|
-
DropdownMenuRadioGroup,
|
|
2079
|
-
DropdownMenuRadioItem,
|
|
2080
|
-
DropdownMenuSeparator,
|
|
2081
|
-
DropdownMenuTrigger,
|
|
2082
|
-
Popover,
|
|
2083
|
-
PopoverArrow,
|
|
2084
|
-
PopoverClose,
|
|
2085
|
-
PopoverDescription,
|
|
2086
|
-
PopoverPanel,
|
|
2087
|
-
PopoverPopup,
|
|
2088
|
-
PopoverPortal,
|
|
2089
|
-
PopoverPositioner,
|
|
2090
|
-
PopoverTitle,
|
|
2091
|
-
PopoverTrigger,
|
|
2092
|
-
PortalThemeProvider2 as PortalThemeProvider,
|
|
2093
|
-
PortalThemeWrapper2 as PortalThemeWrapper,
|
|
2094
|
-
ScrollArea,
|
|
2095
|
-
SegmentedControl,
|
|
2096
|
-
Select,
|
|
2097
|
-
SelectContent,
|
|
2098
|
-
SelectGroup,
|
|
2099
|
-
SelectGroupLabel,
|
|
2100
|
-
SelectItem,
|
|
2101
|
-
SelectSeparator,
|
|
2102
|
-
SelectTrigger,
|
|
2103
|
-
SelectValue,
|
|
2104
|
-
Spinner,
|
|
2105
|
-
StatusDot,
|
|
2106
|
-
TooltipContent,
|
|
2107
|
-
TooltipPopup,
|
|
2108
|
-
TooltipPortal,
|
|
2109
|
-
TooltipPositioner,
|
|
2110
|
-
TooltipProvider,
|
|
2111
|
-
TooltipRoot,
|
|
2112
|
-
TooltipTrigger,
|
|
2113
|
-
ViewportGate,
|
|
2114
|
-
createTooltipHandle,
|
|
2115
|
-
dismissAllDialogs,
|
|
2116
|
-
dismissDialog,
|
|
2117
|
-
dismissTopDialog,
|
|
2118
|
-
getActionButtonClassName,
|
|
2119
|
-
presentDialog,
|
|
2120
|
-
usePopover,
|
|
2121
|
-
usePortalTheme
|
|
2122
|
-
};
|
|
2127
|
+
return /* @__PURE__ */ jsx(Tooltip.Popup, {
|
|
2128
|
+
className: `${popup}${className ? ` ${className}` : ""}`,
|
|
2129
|
+
...props,
|
|
2130
|
+
children
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2133
|
+
function TooltipContent({ side = "top", sideOffset = 6, align = "center", className, children, ...popupProps }) {
|
|
2134
|
+
return /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsx(TooltipPositioner, {
|
|
2135
|
+
align,
|
|
2136
|
+
className: positioner,
|
|
2137
|
+
side,
|
|
2138
|
+
sideOffset,
|
|
2139
|
+
children: /* @__PURE__ */ jsx(TooltipPopup, {
|
|
2140
|
+
className,
|
|
2141
|
+
...popupProps,
|
|
2142
|
+
children
|
|
2143
|
+
})
|
|
2144
|
+
}) });
|
|
2145
|
+
}
|
|
2146
|
+
var createTooltipHandle = Tooltip.createHandle;
|
|
2147
|
+
//#endregion
|
|
2148
|
+
//#region src/components/viewport-gate/index.tsx
|
|
2149
|
+
function ViewportGate({ children, fallback, threshold = .5 }) {
|
|
2150
|
+
const ref = useRef(null);
|
|
2151
|
+
const [visible, setVisible] = useState(false);
|
|
2152
|
+
useEffect(() => {
|
|
2153
|
+
if (visible) return;
|
|
2154
|
+
const el = ref.current;
|
|
2155
|
+
if (!el) return;
|
|
2156
|
+
const obs = new IntersectionObserver((entries) => {
|
|
2157
|
+
if (entries.some((e) => e.isIntersecting)) {
|
|
2158
|
+
setVisible(true);
|
|
2159
|
+
obs.disconnect();
|
|
2160
|
+
}
|
|
2161
|
+
}, { threshold });
|
|
2162
|
+
obs.observe(el);
|
|
2163
|
+
return () => obs.disconnect();
|
|
2164
|
+
}, [visible, threshold]);
|
|
2165
|
+
if (visible) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
2166
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2167
|
+
ref,
|
|
2168
|
+
children: fallback
|
|
2169
|
+
});
|
|
2170
|
+
}
|
|
2171
|
+
//#endregion
|
|
2172
|
+
export { ActionBar, ActionButton, Alert, AnimatedCheckbox, AnimatedTabs, AutoResizeTextArea, Badge, CodeBlock, Collapsible, CollapsiblePanel, CollapsibleTrigger, ColorPicker, Combobox, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxItemIndicator, ComboboxList, ComboboxTrigger, 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, ScrollArea, SegmentedControl, Select, SelectContent, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue, Spinner, StatusDot, TooltipContent, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipProvider, TooltipRoot, TooltipTrigger, ViewportGate, createTooltipHandle, dismissAllDialogs, dismissDialog, dismissTopDialog, getActionButtonClassName, presentDialog, usePopover, usePortalTheme };
|