@hanzo/ui 8.0.24 → 8.0.25
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/README.md +59 -0
- package/dist/chunk-3NG33DV2.cjs +607 -0
- package/dist/chunk-3NG33DV2.cjs.map +1 -0
- package/dist/chunk-5CZOYONP.js +343 -0
- package/dist/chunk-5CZOYONP.js.map +1 -0
- package/dist/{chunk-P2P6ST6J.js → chunk-7ZNK6JSS.js} +9 -394
- package/dist/chunk-7ZNK6JSS.js.map +1 -0
- package/dist/chunk-GVCOAJLO.js +397 -0
- package/dist/chunk-GVCOAJLO.js.map +1 -0
- package/dist/chunk-GWNNLYX4.cjs +353 -0
- package/dist/chunk-GWNNLYX4.cjs.map +1 -0
- package/dist/{chunk-NBZDIMP3.cjs → chunk-ONVERVFG.cjs} +33 -438
- package/dist/chunk-ONVERVFG.cjs.map +1 -0
- package/dist/chunk-P2QU5MN5.js +555 -0
- package/dist/chunk-P2QU5MN5.js.map +1 -0
- package/dist/chunk-WHJR5S4L.cjs +418 -0
- package/dist/chunk-WHJR5S4L.cjs.map +1 -0
- package/dist/framework/CollectionBuilder.d.ts +12 -0
- package/dist/framework/CollectionsBrowser.d.ts +26 -19
- package/dist/framework/DocTypeRecords.d.ts +31 -11
- package/dist/framework/MediaGrid.d.ts +42 -0
- package/dist/framework/RecordCards.d.ts +35 -0
- package/dist/framework/builder-logic.d.ts +76 -0
- package/dist/framework/client.d.ts +31 -44
- package/dist/framework/core.cjs +213 -0
- package/dist/framework/core.cjs.map +1 -0
- package/dist/framework/core.d.ts +6 -0
- package/dist/framework/core.js +4 -0
- package/dist/framework/core.js.map +1 -0
- package/dist/framework/data.d.ts +2 -2
- package/dist/framework/fields.d.ts +47 -4
- package/dist/framework/index.cjs +1340 -0
- package/dist/framework/index.cjs.map +1 -0
- package/dist/framework/index.d.ts +9 -23
- package/dist/framework/index.js +1119 -0
- package/dist/framework/index.js.map +1 -0
- package/dist/framework/media.d.ts +53 -0
- package/dist/framework/parts.d.ts +74 -0
- package/dist/framework/responsive.d.ts +41 -0
- package/dist/framework/types.d.ts +13 -7
- package/dist/product/SelectMenu.d.ts +13 -1
- package/dist/product/index.cjs +2061 -336
- package/dist/product/index.cjs.map +1 -1
- package/dist/product/index.js +1909 -3
- package/dist/product/index.js.map +1 -1
- package/dist/product/social/index.cjs +17 -16
- package/dist/product/social/index.js +3 -2
- package/package.json +11 -5
- package/dist/chunk-2BM42AZR.cjs +0 -2301
- package/dist/chunk-2BM42AZR.cjs.map +0 -1
- package/dist/chunk-7P7R7FC5.js +0 -2231
- package/dist/chunk-7P7R7FC5.js.map +0 -1
- package/dist/chunk-NBZDIMP3.cjs.map +0 -1
- package/dist/chunk-P2P6ST6J.js.map +0 -1
- package/dist/framework/Loader.d.ts +0 -4
- package/dist/framework.cjs +0 -760
- package/dist/framework.cjs.map +0 -1
- package/dist/framework.d.ts +0 -1
- package/dist/framework.js +0 -730
- package/dist/framework.js.map +0 -1
|
@@ -1,75 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useEmit, textSize, labelOf } from './chunk-FVQXROBK.js';
|
|
3
2
|
import { PROVIDERS } from './chunk-ZGTJCJ55.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { EmptyState, FieldRow, FieldTextArea, FieldSelect, FieldText, PrimaryButton, classifyBackend, PageHeader, BackendStateCard } from './chunk-GVCOAJLO.js';
|
|
4
|
+
import { useEmit } from './chunk-FVQXROBK.js';
|
|
5
|
+
import { useRef, useEffect, useMemo, useState, useCallback } from 'react';
|
|
6
|
+
import { YStack, XStack, Text, Button, ScrollView, Card } from '@hanzo/gui';
|
|
7
|
+
import { ChevronsUpDown, ChevronUp, ChevronDown, X, Calendar, AlertTriangle, CheckCircle2, List, Plus, Link2, RefreshCw, Share2, Send, Pencil, Trash2 } from '@hanzogui/lucide-icons-2';
|
|
8
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
8
9
|
|
|
9
|
-
var HostCtx = createContext({});
|
|
10
|
-
var HostProvider = ({ actions, children }) => /* @__PURE__ */ jsx(HostCtx.Provider, { value: actions, children });
|
|
11
|
-
var useHost = () => useContext(HostCtx);
|
|
12
|
-
function classifyBackend(e) {
|
|
13
|
-
const status = typeof e?.status === "number" ? e.status : 0;
|
|
14
|
-
const message = e instanceof Error ? e.message : String(e);
|
|
15
|
-
if (status === 503) return { kind: "not-initialized", message };
|
|
16
|
-
if (status === 404 || status === 405) return { kind: "unavailable", message };
|
|
17
|
-
if (status === 501) return { kind: "not-implemented", message };
|
|
18
|
-
if (status === 402) return { kind: "billing", message };
|
|
19
|
-
if (status === 401) return { kind: "signin", message };
|
|
20
|
-
if (status === 403) return { kind: "access", message };
|
|
21
|
-
return { kind: "error", message };
|
|
22
|
-
}
|
|
23
|
-
function classifyRead(e) {
|
|
24
|
-
const s = classifyBackend(e);
|
|
25
|
-
return s.kind === "billing" ? null : s;
|
|
26
|
-
}
|
|
27
|
-
var TITLES = {
|
|
28
|
-
"not-initialized": "Backend not initialized",
|
|
29
|
-
unavailable: "Not available on this deployment yet",
|
|
30
|
-
"not-implemented": "Not yet available",
|
|
31
|
-
access: "Not enabled for your account",
|
|
32
|
-
signin: "Your session expired",
|
|
33
|
-
billing: "Add credits to continue",
|
|
34
|
-
error: "Could not reach the backend"
|
|
35
|
-
};
|
|
36
|
-
var BODIES = {
|
|
37
|
-
"not-initialized": "The /v1 route is mounted but its runtime (or the console API key it proxies to) is not configured on this deployment yet. Real data appears here once it is \u2014 no placeholder data is shown.",
|
|
38
|
-
unavailable: "This endpoint is not mounted at the gateway on this host yet. The view lights up automatically once the route is live.",
|
|
39
|
-
// 501 — a real, planned capability whose body ships in a later phase.
|
|
40
|
-
"not-implemented": "This capability is planned but not wired yet. The backend answers honestly rather than pretending it worked \u2014 nothing here is fabricated, and the view lights up automatically once it ships.",
|
|
41
|
-
// 403 for a SIGNED-IN user — never "sign in".
|
|
42
|
-
access: "You're signed in, but this isn't enabled for your organization on this deployment, or it's an admin-only surface. It appears here automatically once your account has access \u2014 nothing is fabricated.",
|
|
43
|
-
// 401 — the session itself lapsed; re-auth returns to this exact page.
|
|
44
|
-
signin: "Your session has expired or isn\u2019t recognized here. Sign in again to continue where you left off.",
|
|
45
|
-
// Empty → the card shows the backend's own message (the honest "Insufficient
|
|
46
|
-
// balance. Please add credits…" from the gateway billing gate).
|
|
47
|
-
billing: "",
|
|
48
|
-
error: ""
|
|
49
|
-
};
|
|
50
|
-
function BackendStateCard({
|
|
51
|
-
state,
|
|
52
|
-
onRetry,
|
|
53
|
-
hint
|
|
54
|
-
}) {
|
|
55
|
-
const { signIn, addCredits } = useHost();
|
|
56
|
-
return /* @__PURE__ */ jsxs(Card, { borderWidth: 1, borderColor: "$borderColor", p: "$4", gap: "$2", maxWidth: 640, children: [
|
|
57
|
-
/* @__PURE__ */ jsxs(XStack, { gap: "$2", items: "center", children: [
|
|
58
|
-
/* @__PURE__ */ jsx(TriangleAlert, { size: 16 }),
|
|
59
|
-
/* @__PURE__ */ jsx(Text, { fontSize: "$4", fontWeight: "700", children: TITLES[state.kind] })
|
|
60
|
-
] }),
|
|
61
|
-
/* @__PURE__ */ jsx(Text, { fontSize: "$3", color: "$color11", children: BODIES[state.kind] || state.message }),
|
|
62
|
-
hint ? /* @__PURE__ */ jsx(Text, { fontSize: "$2", color: "$color10", children: hint }) : null,
|
|
63
|
-
state.kind === "signin" && signIn ? /* @__PURE__ */ jsx(Button, { size: "$2", theme: "light", self: "flex-start", onPress: signIn, children: "Sign in again" }) : state.kind === "billing" && addCredits ? (
|
|
64
|
-
// 402 — the org has no funded balance. Offer a top-up CTA (and keep Retry so
|
|
65
|
-
// a returning, funded caller can reload in place).
|
|
66
|
-
/* @__PURE__ */ jsxs(XStack, { gap: "$2", items: "center", flexWrap: "wrap", children: [
|
|
67
|
-
/* @__PURE__ */ jsx(Button, { size: "$2", theme: "light", self: "flex-start", icon: /* @__PURE__ */ jsx(CreditCard, { size: 14 }), onPress: addCredits, children: "Add credits" }),
|
|
68
|
-
onRetry ? /* @__PURE__ */ jsx(Button, { size: "$2", self: "flex-start", onPress: onRetry, children: "Retry" }) : null
|
|
69
|
-
] })
|
|
70
|
-
) : onRetry ? /* @__PURE__ */ jsx(Button, { size: "$2", self: "flex-start", onPress: onRetry, children: "Retry" }) : null
|
|
71
|
-
] });
|
|
72
|
-
}
|
|
73
10
|
function SkeletonRows({ columns, count = 6 }) {
|
|
74
11
|
return /* @__PURE__ */ jsx(YStack, { children: Array.from({ length: count }).map((_, r) => /* @__PURE__ */ jsx(XStack, { py: "$2.5", px: "$3", gap: "$3", borderTopWidth: 1, borderColor: "$borderColor", items: "center", children: columns.map((c, i) => /* @__PURE__ */ jsx(YStack, { width: c.width, flex: c.width ? void 0 : 1, minW: c.width ? void 0 : FLEX_MIN_COL_W, items: c.align === "right" ? "flex-end" : "flex-start", children: /* @__PURE__ */ jsx(
|
|
75
12
|
"div",
|
|
@@ -191,328 +128,6 @@ function DataTable({
|
|
|
191
128
|
] });
|
|
192
129
|
}
|
|
193
130
|
var FLEX_MIN_COL_W = 120;
|
|
194
|
-
function isHexColor(v) {
|
|
195
|
-
return typeof v === "string" && /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(v.trim());
|
|
196
|
-
}
|
|
197
|
-
function resolveAccent(theme) {
|
|
198
|
-
if (!theme || !theme.isEnabled) return null;
|
|
199
|
-
const hex = (theme.colorPrimary ?? "").trim();
|
|
200
|
-
return isHexColor(hex) ? hex : null;
|
|
201
|
-
}
|
|
202
|
-
function expandHex(hex) {
|
|
203
|
-
const h = hex.trim().toLowerCase();
|
|
204
|
-
if (h.length === 4) return `#${h[1]}${h[1]}${h[2]}${h[2]}${h[3]}${h[3]}`;
|
|
205
|
-
return h;
|
|
206
|
-
}
|
|
207
|
-
function contrastText(hex) {
|
|
208
|
-
if (!isHexColor(hex)) return "#ffffff";
|
|
209
|
-
const h = expandHex(hex);
|
|
210
|
-
const r = parseInt(h.slice(1, 3), 16) / 255;
|
|
211
|
-
const g = parseInt(h.slice(3, 5), 16) / 255;
|
|
212
|
-
const b = parseInt(h.slice(5, 7), 16) / 255;
|
|
213
|
-
const lin = (c) => c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
214
|
-
const luminance = 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
|
|
215
|
-
return luminance > 0.5 ? "#000000" : "#ffffff";
|
|
216
|
-
}
|
|
217
|
-
function accentFor(theme) {
|
|
218
|
-
const hex = resolveAccent(theme);
|
|
219
|
-
return { accent: hex, contrast: hex ? contrastText(hex) : "#ffffff" };
|
|
220
|
-
}
|
|
221
|
-
var DEFAULT = { accent: null, contrast: "#ffffff" };
|
|
222
|
-
var current = DEFAULT;
|
|
223
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
224
|
-
function setOrgAccent(theme) {
|
|
225
|
-
const next = accentFor(theme);
|
|
226
|
-
if (next.accent === current.accent) return;
|
|
227
|
-
current = next.accent ? next : DEFAULT;
|
|
228
|
-
for (const l of listeners) l();
|
|
229
|
-
}
|
|
230
|
-
function subscribe(cb) {
|
|
231
|
-
listeners.add(cb);
|
|
232
|
-
return () => {
|
|
233
|
-
listeners.delete(cb);
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
function useAccent() {
|
|
237
|
-
return useSyncExternalStore(
|
|
238
|
-
subscribe,
|
|
239
|
-
() => current,
|
|
240
|
-
() => DEFAULT
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
function PrimaryButton({ onPress, ...rest }) {
|
|
244
|
-
const { accent, contrast } = useAccent();
|
|
245
|
-
const track = useEmit();
|
|
246
|
-
const press = (e) => {
|
|
247
|
-
track({
|
|
248
|
-
component: "PrimaryButton",
|
|
249
|
-
action: "click",
|
|
250
|
-
id: labelOf(rest.children) ?? rest["aria-label"]
|
|
251
|
-
});
|
|
252
|
-
onPress?.(e);
|
|
253
|
-
};
|
|
254
|
-
const handler = press;
|
|
255
|
-
if (accent) {
|
|
256
|
-
return /* @__PURE__ */ jsx(Button, { style: { backgroundColor: accent, color: contrast, borderColor: accent }, onPress: handler, ...rest });
|
|
257
|
-
}
|
|
258
|
-
return /* @__PURE__ */ jsx(Button, { theme: "light", onPress: handler, ...rest });
|
|
259
|
-
}
|
|
260
|
-
function openHref(href) {
|
|
261
|
-
if (typeof window !== "undefined") window.open(href, "_blank", "noopener");
|
|
262
|
-
}
|
|
263
|
-
function EmptyState({
|
|
264
|
-
icon: Icon,
|
|
265
|
-
title,
|
|
266
|
-
description,
|
|
267
|
-
bullets,
|
|
268
|
-
primary,
|
|
269
|
-
secondary
|
|
270
|
-
}) {
|
|
271
|
-
const track = useEmit();
|
|
272
|
-
return /* @__PURE__ */ jsxs(
|
|
273
|
-
Card,
|
|
274
|
-
{
|
|
275
|
-
borderWidth: 1,
|
|
276
|
-
borderColor: "$borderColor",
|
|
277
|
-
borderStyle: "dashed",
|
|
278
|
-
p: "$6",
|
|
279
|
-
gap: "$4",
|
|
280
|
-
items: "center",
|
|
281
|
-
maxWidth: 640,
|
|
282
|
-
self: "center",
|
|
283
|
-
width: "100%",
|
|
284
|
-
children: [
|
|
285
|
-
/* @__PURE__ */ jsx(
|
|
286
|
-
YStack,
|
|
287
|
-
{
|
|
288
|
-
width: 48,
|
|
289
|
-
height: 48,
|
|
290
|
-
items: "center",
|
|
291
|
-
justify: "center",
|
|
292
|
-
rounded: "$4",
|
|
293
|
-
bg: "$color3",
|
|
294
|
-
children: /* @__PURE__ */ jsx(Icon, { size: 24 })
|
|
295
|
-
}
|
|
296
|
-
),
|
|
297
|
-
/* @__PURE__ */ jsxs(YStack, { gap: "$2", items: "center", maxW: 480, children: [
|
|
298
|
-
/* @__PURE__ */ jsx(Text, { fontSize: "$6", fontWeight: "500", text: "center", letterSpacing: -0.3, children: title }),
|
|
299
|
-
/* @__PURE__ */ jsx(Text, { fontSize: "$3", color: "$color11", text: "center", children: description })
|
|
300
|
-
] }),
|
|
301
|
-
bullets && bullets.length ? /* @__PURE__ */ jsx(YStack, { gap: "$2", self: "stretch", maxW: 420, mx: "auto", children: bullets.map((b) => /* @__PURE__ */ jsxs(XStack, { gap: "$2", items: "flex-start", children: [
|
|
302
|
-
/* @__PURE__ */ jsx(YStack, { pt: "$1", children: /* @__PURE__ */ jsx(Check, { size: 14, color: "$color10" }) }),
|
|
303
|
-
/* @__PURE__ */ jsx(Text, { fontSize: "$3", color: "$color11", flex: 1, children: b })
|
|
304
|
-
] }, b)) }) : null,
|
|
305
|
-
primary || secondary ? /* @__PURE__ */ jsxs(XStack, { gap: "$2", items: "center", flexWrap: "wrap", justify: "center", children: [
|
|
306
|
-
primary ? /* @__PURE__ */ jsx(
|
|
307
|
-
PrimaryButton,
|
|
308
|
-
{
|
|
309
|
-
icon: primary.icon,
|
|
310
|
-
iconAfter: primary.href ? /* @__PURE__ */ jsx(ExternalLink, { size: 15 }) : /* @__PURE__ */ jsx(ArrowRight, { size: 15 }),
|
|
311
|
-
onPress: () => {
|
|
312
|
-
track({ component: "EmptyState", action: "click", id: title, value: primary.label });
|
|
313
|
-
if (primary.href) openHref(primary.href);
|
|
314
|
-
else primary.onPress?.();
|
|
315
|
-
},
|
|
316
|
-
children: primary.label
|
|
317
|
-
}
|
|
318
|
-
) : null,
|
|
319
|
-
secondary ? /* @__PURE__ */ jsx(
|
|
320
|
-
Button,
|
|
321
|
-
{
|
|
322
|
-
chromeless: true,
|
|
323
|
-
icon: secondary.icon,
|
|
324
|
-
iconAfter: secondary.href ? /* @__PURE__ */ jsx(ExternalLink, { size: 14 }) : void 0,
|
|
325
|
-
onPress: () => {
|
|
326
|
-
track({ component: "EmptyState", action: "click", id: title, value: secondary.label });
|
|
327
|
-
if (secondary.href) openHref(secondary.href);
|
|
328
|
-
else secondary.onPress?.();
|
|
329
|
-
},
|
|
330
|
-
children: secondary.label
|
|
331
|
-
}
|
|
332
|
-
) : null
|
|
333
|
-
] }) : null
|
|
334
|
-
]
|
|
335
|
-
}
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
var FieldNameContext = createContext(void 0);
|
|
339
|
-
function useFieldTrack(component) {
|
|
340
|
-
const track = useEmit();
|
|
341
|
-
const name = useContext(FieldNameContext);
|
|
342
|
-
return (e) => track({ component, id: name, ...e });
|
|
343
|
-
}
|
|
344
|
-
function FieldRow({ label, children }) {
|
|
345
|
-
return /* @__PURE__ */ jsx(FieldNameContext.Provider, { value: label, children: /* @__PURE__ */ jsxs(XStack, { gap: "$3", items: "flex-start", flexWrap: "wrap", children: [
|
|
346
|
-
/* @__PURE__ */ jsx(Label, { width: "100%", pt: "$2", color: "$color11", fontSize: "$3", $md: { width: 180 }, children: label }),
|
|
347
|
-
/* @__PURE__ */ jsx(YStack, { flex: 1, minW: 0, $md: { minW: 240 }, children })
|
|
348
|
-
] }) });
|
|
349
|
-
}
|
|
350
|
-
function FieldText({
|
|
351
|
-
value,
|
|
352
|
-
onChange,
|
|
353
|
-
disabled,
|
|
354
|
-
secure,
|
|
355
|
-
placeholder
|
|
356
|
-
}) {
|
|
357
|
-
const track = useFieldTrack("FieldText");
|
|
358
|
-
return /* @__PURE__ */ jsx(
|
|
359
|
-
Input,
|
|
360
|
-
{
|
|
361
|
-
value,
|
|
362
|
-
onChangeText: (v) => {
|
|
363
|
-
track({ action: "change", value: secure ? 0 : textSize(v) });
|
|
364
|
-
onChange(v);
|
|
365
|
-
},
|
|
366
|
-
disabled,
|
|
367
|
-
secureTextEntry: secure,
|
|
368
|
-
placeholder,
|
|
369
|
-
autoCapitalize: "none"
|
|
370
|
-
}
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
function FieldTextArea({
|
|
374
|
-
value,
|
|
375
|
-
onChange,
|
|
376
|
-
disabled,
|
|
377
|
-
rows = 6
|
|
378
|
-
}) {
|
|
379
|
-
const track = useFieldTrack("FieldTextArea");
|
|
380
|
-
return /* @__PURE__ */ jsx(
|
|
381
|
-
TextArea,
|
|
382
|
-
{
|
|
383
|
-
value,
|
|
384
|
-
onChangeText: (v) => {
|
|
385
|
-
track({ action: "change", value: textSize(v) });
|
|
386
|
-
onChange(v);
|
|
387
|
-
},
|
|
388
|
-
disabled,
|
|
389
|
-
numberOfLines: rows
|
|
390
|
-
}
|
|
391
|
-
);
|
|
392
|
-
}
|
|
393
|
-
function FieldSwitch({
|
|
394
|
-
checked,
|
|
395
|
-
onChange,
|
|
396
|
-
disabled
|
|
397
|
-
}) {
|
|
398
|
-
const track = useFieldTrack("FieldSwitch");
|
|
399
|
-
return /* @__PURE__ */ jsx(
|
|
400
|
-
Switch,
|
|
401
|
-
{
|
|
402
|
-
checked,
|
|
403
|
-
onCheckedChange: (v) => {
|
|
404
|
-
track({ action: "change", value: v });
|
|
405
|
-
onChange(v);
|
|
406
|
-
},
|
|
407
|
-
disabled,
|
|
408
|
-
size: "$3",
|
|
409
|
-
children: /* @__PURE__ */ jsx(Switch.Thumb, {})
|
|
410
|
-
}
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
|
-
var CHEVRON = `data:image/svg+xml,${encodeURIComponent(
|
|
414
|
-
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#9a9a9a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>'
|
|
415
|
-
)}`;
|
|
416
|
-
function selectStyle(disabled) {
|
|
417
|
-
return {
|
|
418
|
-
width: "100%",
|
|
419
|
-
boxSizing: "border-box",
|
|
420
|
-
appearance: "none",
|
|
421
|
-
WebkitAppearance: "none",
|
|
422
|
-
MozAppearance: "none",
|
|
423
|
-
background: `var(--background) url("${CHEVRON}") no-repeat right 10px center`,
|
|
424
|
-
color: "var(--color12)",
|
|
425
|
-
border: "1px solid var(--borderColor)",
|
|
426
|
-
borderRadius: 9,
|
|
427
|
-
padding: "9px 34px 9px 12px",
|
|
428
|
-
fontSize: 14,
|
|
429
|
-
lineHeight: "20px",
|
|
430
|
-
fontFamily: "inherit",
|
|
431
|
-
height: 40,
|
|
432
|
-
outline: "none",
|
|
433
|
-
cursor: disabled ? "not-allowed" : "pointer",
|
|
434
|
-
opacity: disabled ? 0.5 : 1
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
var OPTION_STYLE = { background: "var(--color2)", color: "var(--color12)" };
|
|
438
|
-
function FieldSelect({
|
|
439
|
-
value,
|
|
440
|
-
options,
|
|
441
|
-
onChange,
|
|
442
|
-
disabled,
|
|
443
|
-
placeholder = "Select\u2026"
|
|
444
|
-
}) {
|
|
445
|
-
const track = useFieldTrack("FieldSelect");
|
|
446
|
-
const showPlaceholder = value === "" || !options.includes(value);
|
|
447
|
-
return /* @__PURE__ */ jsxs(
|
|
448
|
-
"select",
|
|
449
|
-
{
|
|
450
|
-
value: showPlaceholder ? "" : value,
|
|
451
|
-
onChange: (e) => {
|
|
452
|
-
track({ action: "change", value: e.currentTarget.value });
|
|
453
|
-
onChange(e.currentTarget.value);
|
|
454
|
-
},
|
|
455
|
-
disabled,
|
|
456
|
-
"aria-label": placeholder,
|
|
457
|
-
style: selectStyle(disabled),
|
|
458
|
-
children: [
|
|
459
|
-
showPlaceholder ? /* @__PURE__ */ jsx("option", { value: "", disabled: true, style: OPTION_STYLE, children: placeholder }) : null,
|
|
460
|
-
options.map((opt) => /* @__PURE__ */ jsx("option", { value: opt, style: OPTION_STYLE, children: opt }, opt))
|
|
461
|
-
]
|
|
462
|
-
}
|
|
463
|
-
);
|
|
464
|
-
}
|
|
465
|
-
function FieldSlider({
|
|
466
|
-
value,
|
|
467
|
-
min,
|
|
468
|
-
max,
|
|
469
|
-
step,
|
|
470
|
-
onChange,
|
|
471
|
-
disabled
|
|
472
|
-
}) {
|
|
473
|
-
const track = useFieldTrack("FieldSlider");
|
|
474
|
-
return /* @__PURE__ */ jsxs(XStack, { gap: "$3", items: "center", children: [
|
|
475
|
-
/* @__PURE__ */ jsx(Text, { width: 56, fontSize: "$3", color: "$color11", children: value }),
|
|
476
|
-
/* @__PURE__ */ jsxs(
|
|
477
|
-
Slider,
|
|
478
|
-
{
|
|
479
|
-
flex: 1,
|
|
480
|
-
min,
|
|
481
|
-
max,
|
|
482
|
-
step,
|
|
483
|
-
value: [value],
|
|
484
|
-
onValueChange: (v) => {
|
|
485
|
-
track({ action: "change", value: v[0] ?? min });
|
|
486
|
-
onChange(v[0] ?? min);
|
|
487
|
-
},
|
|
488
|
-
disabled,
|
|
489
|
-
children: [
|
|
490
|
-
/* @__PURE__ */ jsx(Slider.Track, { children: /* @__PURE__ */ jsx(Slider.TrackActive, {}) }),
|
|
491
|
-
/* @__PURE__ */ jsx(Slider.Thumb, { index: 0, circular: true })
|
|
492
|
-
]
|
|
493
|
-
}
|
|
494
|
-
)
|
|
495
|
-
] });
|
|
496
|
-
}
|
|
497
|
-
function PageHeader({
|
|
498
|
-
title,
|
|
499
|
-
subtitle,
|
|
500
|
-
actions
|
|
501
|
-
}) {
|
|
502
|
-
return (
|
|
503
|
-
// flexWrap lets the actions drop below the title on narrow screens; flex={1}
|
|
504
|
-
// minW={0} lets the title column shrink so a long subtitle WRAPS instead of
|
|
505
|
-
// running off the viewport (a flex child defaults to min-width:auto = content
|
|
506
|
-
// width, which would overflow on mobile).
|
|
507
|
-
/* @__PURE__ */ jsxs(XStack, { justify: "space-between", items: "flex-start", gap: "$3", flexWrap: "wrap", children: [
|
|
508
|
-
/* @__PURE__ */ jsxs(YStack, { gap: "$1", flex: 1, minW: 200, children: [
|
|
509
|
-
/* @__PURE__ */ jsx(Text, { fontSize: "$7", fontWeight: "500", letterSpacing: -0.4, children: title }),
|
|
510
|
-
subtitle ? /* @__PURE__ */ jsx(Text, { fontSize: "$3", color: "$color11", children: subtitle }) : null
|
|
511
|
-
] }),
|
|
512
|
-
actions ? /* @__PURE__ */ jsx(XStack, { gap: "$2", items: "center", flexWrap: "wrap", width: "100%", $md: { width: "auto", justify: "flex-end" }, children: actions }) : null
|
|
513
|
-
] })
|
|
514
|
-
);
|
|
515
|
-
}
|
|
516
131
|
var toneOf = (status) => {
|
|
517
132
|
const s = status.toLowerCase();
|
|
518
133
|
if (s === "green") return "green";
|
|
@@ -1211,6 +826,6 @@ function PostCard({
|
|
|
1211
826
|
] });
|
|
1212
827
|
}
|
|
1213
828
|
|
|
1214
|
-
export {
|
|
1215
|
-
//# sourceMappingURL=chunk-
|
|
1216
|
-
//# sourceMappingURL=chunk-
|
|
829
|
+
export { COMPOSE_MODES, CampaignCard, ChannelBadge, DataTable, LG, PostAgenda, PostCard, PostComposer, ProviderReadinessList, SlideOver, SocialResource, SocialSummaryBar, StatusTag, ViewToggle, asColor, formatPostTime, parsePostTime, postDayBucket, postPreview };
|
|
830
|
+
//# sourceMappingURL=chunk-7ZNK6JSS.js.map
|
|
831
|
+
//# sourceMappingURL=chunk-7ZNK6JSS.js.map
|