@superxd-studio/adptr 0.5.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/GENERATIVE.md +101 -0
- package/INTERACTIONS.md +51 -0
- package/LICENSE +21 -0
- package/README.md +57 -0
- package/REUSE.md +170 -0
- package/REVIEW.md +68 -0
- package/THIRD-PARTY-NOTICES.md +28 -0
- package/ai-sdk/index.js +96 -0
- package/assets/ibm-plex-mono-cyrillic-400-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-cyrillic-500-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-cyrillic-ext-400-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-cyrillic-ext-500-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-vietnamese-400-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-vietnamese-500-normal.woff2 +0 -0
- package/assets/instrument-sans-latin-ext-wght-normal.woff2 +0 -0
- package/assets/instrument-sans-latin-wght-normal.woff2 +0 -0
- package/assistant-ui/index.js +139 -0
- package/chunks/callout-DKMHSnjc.js +342 -0
- package/chunks/canvas-BJ15-XxE.js +598 -0
- package/chunks/controller-Cfpg0C7v.js +180 -0
- package/chunks/core-BCqVRLUy.js +312 -0
- package/chunks/text-field-BLtoaZFn.js +41 -0
- package/chunks/types-BGF7r1my.js +115 -0
- package/chunks/ui-9DyNsYXY.js +967 -0
- package/core/index.js +4 -0
- package/custom/index.js +64 -0
- package/examples/ai-sdk-backend/package.json +11 -0
- package/examples/ai-sdk-backend/server.mjs +316 -0
- package/examples/custom-backend/copy.mjs +7 -0
- package/examples/custom-backend/server.mjs +118 -0
- package/examples/generative/specs.json +2094 -0
- package/examples/review-backend/copy.mjs +27 -0
- package/examples/review-backend/package.json +11 -0
- package/examples/review-backend/server.mjs +276 -0
- package/examples/web-ai-sdk/index.html +12 -0
- package/examples/web-ai-sdk/package.json +21 -0
- package/examples/web-ai-sdk/src/copy.ts +1 -0
- package/examples/web-ai-sdk/src/main.tsx +64 -0
- package/examples/web-ai-sdk/tsconfig.json +13 -0
- package/examples/web-generative/index.html +12 -0
- package/examples/web-generative/package.json +23 -0
- package/examples/web-generative/src/copy.ts +42 -0
- package/examples/web-generative/src/main.tsx +74 -0
- package/examples/web-generative/tsconfig.json +14 -0
- package/examples/web-independent/index.html +12 -0
- package/examples/web-independent/package.json +20 -0
- package/examples/web-independent/src/main.tsx +32 -0
- package/examples/web-independent/tsconfig.json +14 -0
- package/examples/web-interactions/index.html +12 -0
- package/examples/web-interactions/package.json +21 -0
- package/examples/web-interactions/src/copy.ts +215 -0
- package/examples/web-interactions/src/examples.tsx +628 -0
- package/examples/web-interactions/src/main.tsx +116 -0
- package/examples/web-interactions/tsconfig.json +14 -0
- package/examples/web-review/index.html +12 -0
- package/examples/web-review/package.json +20 -0
- package/examples/web-review/src/main.tsx +59 -0
- package/examples/web-review/tsconfig.json +14 -0
- package/fonts.css +117 -0
- package/generative/index.js +1560 -0
- package/interactions/index.js +1591 -0
- package/langgraph-review/index.js +36 -0
- package/licenses/ai-sdk.txt +13 -0
- package/licenses/assistant-ui-generative.txt +21 -0
- package/licenses/assistant-ui.txt +23 -0
- package/licenses/ibm-plex-mono.txt +93 -0
- package/licenses/instrument-sans.txt +93 -0
- package/licenses/internationalized-date.txt +201 -0
- package/licenses/langgraph.txt +21 -0
- package/licenses/lucide.txt +43 -0
- package/licenses/react-markdown.txt +21 -0
- package/licenses/remark-gfm.txt +22 -0
- package/licenses/zod.txt +21 -0
- package/package.json +138 -0
- package/review/index.js +31 -0
- package/source/components/avatar.tsx +50 -0
- package/source/components/button.tsx +155 -0
- package/source/components/callout.tsx +65 -0
- package/source/components/canvas/connector.tsx +14 -0
- package/source/components/canvas/copy.ts +34 -0
- package/source/components/canvas/index.tsx +257 -0
- package/source/components/canvas/recorder.ts +36 -0
- package/source/components/date-time-field.tsx +77 -0
- package/source/components/flow-motion.tsx +109 -0
- package/source/components/icons.tsx +275 -0
- package/source/components/responsive-overlay.tsx +91 -0
- package/source/components/scenario-picker/copy.ts +5 -0
- package/source/components/scenario-picker/index.tsx +142 -0
- package/source/components/scroll-area.tsx +59 -0
- package/source/components/search-picker.tsx +127 -0
- package/source/components/segmented-control.tsx +123 -0
- package/source/components/skeleton.tsx +11 -0
- package/source/components/spinner.tsx +19 -0
- package/source/components/superxd-arrow.tsx +22 -0
- package/source/components/switch.tsx +45 -0
- package/source/components/text-field.tsx +81 -0
- package/source/components/thinking.tsx +16 -0
- package/source/components/ui/copy.ts +12 -0
- package/source/components/ui/display.tsx +276 -0
- package/source/components/ui/navigation.tsx +346 -0
- package/source/components/ui/portal-theme.tsx +28 -0
- package/source/components/ui/selection.tsx +336 -0
- package/source/lib/cn.ts +23 -0
- package/source/reusable/ai-sdk/index.ts +114 -0
- package/source/reusable/assistant-ui/index.tsx +266 -0
- package/source/reusable/core/attachments.ts +163 -0
- package/source/reusable/core/index.ts +417 -0
- package/source/reusable/custom/index.ts +90 -0
- package/source/reusable/generative/actions.ts +188 -0
- package/source/reusable/generative/copy.ts +47 -0
- package/source/reusable/generative/data.tsx +126 -0
- package/source/reusable/generative/index.tsx +517 -0
- package/source/reusable/generative/schema.ts +327 -0
- package/source/reusable/generative/timeline.tsx +214 -0
- package/source/reusable/generative/vocabulary.tsx +847 -0
- package/source/reusable/interactions/agent.ts +259 -0
- package/source/reusable/interactions/artifact.ts +236 -0
- package/source/reusable/interactions/context.tsx +38 -0
- package/source/reusable/interactions/copy.ts +117 -0
- package/source/reusable/interactions/feedback.ts +73 -0
- package/source/reusable/interactions/index.ts +11 -0
- package/source/reusable/interactions/presentation.tsx +483 -0
- package/source/reusable/interactions/store.ts +74 -0
- package/source/reusable/interactions/threads.ts +126 -0
- package/source/reusable/interactions/web.tsx +574 -0
- package/source/reusable/langgraph-review/index.ts +73 -0
- package/source/reusable/review/controller.ts +263 -0
- package/source/reusable/review/index.ts +47 -0
- package/source/reusable/review/types.ts +189 -0
- package/source/reusable/ui/index.ts +25 -0
- package/source/reusable/uploads/index.ts +48 -0
- package/source/reusable/web/attachments/copy.ts +23 -0
- package/source/reusable/web/attachments/index.tsx +233 -0
- package/source/reusable/web/copy.ts +22 -0
- package/source/reusable/web/index.tsx +470 -0
- package/source/reusable/web/message/copy.ts +26 -0
- package/source/reusable/web/message/index.tsx +388 -0
- package/source/reusable/web/message/streaming.ts +64 -0
- package/source/reusable/web/message/styles.css +21 -0
- package/source/reusable/web/review/copy.ts +78 -0
- package/source/reusable/web/review/flow.ts +24 -0
- package/source/reusable/web/review/index.tsx +506 -0
- package/source/reusable/web/styles.ts +2 -0
- package/source/styles/library.css +612 -0
- package/source/styles/theme.css +228 -0
- package/styles.css +3 -0
- package/styles.d.ts +1 -0
- package/types/components/avatar.d.ts +14 -0
- package/types/components/button.d.ts +36 -0
- package/types/components/callout.d.ts +19 -0
- package/types/components/canvas/connector.d.ts +2 -0
- package/types/components/canvas/copy.d.ts +34 -0
- package/types/components/canvas/index.d.ts +33 -0
- package/types/components/canvas/recorder.d.ts +10 -0
- package/types/components/date-time-field.d.ts +11 -0
- package/types/components/flow-motion.d.ts +38 -0
- package/types/components/icons.d.ts +138 -0
- package/types/components/responsive-overlay.d.ts +15 -0
- package/types/components/scenario-picker/copy.d.ts +5 -0
- package/types/components/scenario-picker/index.d.ts +14 -0
- package/types/components/scroll-area.d.ts +14 -0
- package/types/components/search-picker.d.ts +27 -0
- package/types/components/segmented-control.d.ts +23 -0
- package/types/components/skeleton.d.ts +4 -0
- package/types/components/spinner.d.ts +4 -0
- package/types/components/superxd-arrow.d.ts +5 -0
- package/types/components/switch.d.ts +8 -0
- package/types/components/text-field.d.ts +19 -0
- package/types/components/thinking.d.ts +8 -0
- package/types/components/ui/copy.d.ts +12 -0
- package/types/components/ui/display.d.ts +50 -0
- package/types/components/ui/navigation.d.ts +63 -0
- package/types/components/ui/portal-theme.d.ts +8 -0
- package/types/components/ui/selection.d.ts +37 -0
- package/types/lib/cn.d.ts +3 -0
- package/types/reusable/ai-sdk/index.d.ts +15 -0
- package/types/reusable/assistant-ui/index.d.ts +12 -0
- package/types/reusable/core/attachments.d.ts +54 -0
- package/types/reusable/core/index.d.ts +107 -0
- package/types/reusable/custom/index.d.ts +14 -0
- package/types/reusable/generative/actions.d.ts +45 -0
- package/types/reusable/generative/copy.d.ts +48 -0
- package/types/reusable/generative/data.d.ts +4 -0
- package/types/reusable/generative/index.d.ts +30 -0
- package/types/reusable/generative/schema.d.ts +303 -0
- package/types/reusable/generative/timeline.d.ts +21 -0
- package/types/reusable/generative/vocabulary.d.ts +34 -0
- package/types/reusable/interactions/agent.d.ts +98 -0
- package/types/reusable/interactions/artifact.d.ts +118 -0
- package/types/reusable/interactions/context.d.ts +130 -0
- package/types/reusable/interactions/copy.d.ts +115 -0
- package/types/reusable/interactions/feedback.d.ts +34 -0
- package/types/reusable/interactions/index.d.ts +10 -0
- package/types/reusable/interactions/presentation.d.ts +97 -0
- package/types/reusable/interactions/store.d.ts +29 -0
- package/types/reusable/interactions/threads.d.ts +38 -0
- package/types/reusable/interactions/web.d.ts +22 -0
- package/types/reusable/langgraph-review/index.d.ts +5 -0
- package/types/reusable/review/controller.d.ts +52 -0
- package/types/reusable/review/index.d.ts +12 -0
- package/types/reusable/review/types.d.ts +61 -0
- package/types/reusable/ui/index.d.ts +19 -0
- package/types/reusable/uploads/index.d.ts +11 -0
- package/types/reusable/web/attachments/copy.d.ts +25 -0
- package/types/reusable/web/attachments/index.d.ts +24 -0
- package/types/reusable/web/copy.d.ts +24 -0
- package/types/reusable/web/index.d.ts +41 -0
- package/types/reusable/web/message/copy.d.ts +27 -0
- package/types/reusable/web/message/index.d.ts +56 -0
- package/types/reusable/web/message/streaming.d.ts +27 -0
- package/types/reusable/web/review/copy.d.ts +72 -0
- package/types/reusable/web/review/flow.d.ts +3 -0
- package/types/reusable/web/review/index.d.ts +38 -0
- package/types/reusable/web/styles.d.ts +2 -0
- package/ui/index.js +4 -0
- package/uploads/index.js +34 -0
- package/web/index.js +931 -0
|
@@ -0,0 +1,967 @@
|
|
|
1
|
+
import { C as e, D as t, O as n, a as r, d as i, n as a, p as o, u as s } from "./callout-DKMHSnjc.js";
|
|
2
|
+
import { t as c } from "./text-field-BLtoaZFn.js";
|
|
3
|
+
import { createContext as l, useContext as u, useEffect as d, useId as f, useLayoutEffect as p, useRef as m, useState as h, useSyncExternalStore as g } from "react";
|
|
4
|
+
import { Autocomplete as _, Breadcrumb as v, Breadcrumbs as y, Button as b, Cell as ee, Checkbox as te, CheckboxGroup as ne, Column as re, DateField as ie, DateInput as ae, DateSegment as oe, Dialog as x, DialogTrigger as S, Disclosure as se, DisclosureGroup as ce, DisclosurePanel as le, FieldError as C, Form as ue, Heading as w, I18nProvider as de, Input as T, Label as E, Link as fe, ListBox as D, ListBoxItem as O, Menu as k, MenuItem as A, MenuTrigger as pe, Modal as j, ModalOverlay as M, Popover as N, ProgressBar as me, Radio as he, RadioGroup as ge, Row as _e, SearchField as P, Select as F, SelectValue as I, SelectionIndicator as ve, Separator as ye, Slider as be, SliderOutput as xe, SliderThumb as Se, SliderTrack as Ce, Switch as we, Tab as Te, TabList as Ee, TabPanel as De, Table as Oe, TableBody as ke, TableHeader as Ae, Tabs as je, Text as L, TimeField as Me, ToggleButton as R, ToggleButtonGroup as Ne, Tooltip as Pe, TooltipTrigger as Fe, UNSTABLE_Toast as Ie, UNSTABLE_ToastContent as Le, UNSTABLE_ToastQueue as Re, UNSTABLE_ToastRegion as ze, useFilter as z } from "react-aria-components";
|
|
5
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
6
|
+
import { parseDate as Be, parseTime as U } from "@internationalized/date";
|
|
7
|
+
//#region src/components/ui/portal-theme.tsx
|
|
8
|
+
function W({ children: e }) {
|
|
9
|
+
let t = m(null), [n, r] = h({
|
|
10
|
+
className: "sxd",
|
|
11
|
+
style: {}
|
|
12
|
+
}), i = () => {
|
|
13
|
+
if (!t.current) return;
|
|
14
|
+
let e = getComputedStyle(t.current), n = {};
|
|
15
|
+
for (let t = 0; t < e.length; t++) {
|
|
16
|
+
let r = e.item(t);
|
|
17
|
+
r.startsWith("--") && (n[r] = e.getPropertyValue(r));
|
|
18
|
+
}
|
|
19
|
+
r({
|
|
20
|
+
className: t.current.closest(".dark") ? "sxd dark" : "sxd",
|
|
21
|
+
style: n
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ V("div", {
|
|
25
|
+
ref: t,
|
|
26
|
+
className: "contents",
|
|
27
|
+
onPointerDownCapture: i,
|
|
28
|
+
onFocusCapture: i,
|
|
29
|
+
children: e(n)
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/ui/copy.ts
|
|
34
|
+
var G = {
|
|
35
|
+
choose: "Choose an option",
|
|
36
|
+
empty: "No options available.",
|
|
37
|
+
close: "Close",
|
|
38
|
+
previous: "Previous page",
|
|
39
|
+
next: "Next page",
|
|
40
|
+
page: (e, t) => `Page ${e} of ${t}`,
|
|
41
|
+
sort: (e) => `Sort by ${e}`,
|
|
42
|
+
noRows: "No rows to show.",
|
|
43
|
+
dismiss: "Dismiss notification",
|
|
44
|
+
notifications: "Notifications"
|
|
45
|
+
}, K = "flex min-w-0 flex-col gap-2", q = "type-caption font-normal text-fg-subtle";
|
|
46
|
+
function J({ label: e, description: t, className: r, ...i }) {
|
|
47
|
+
let a = f();
|
|
48
|
+
return /* @__PURE__ */ V(te, {
|
|
49
|
+
...i,
|
|
50
|
+
"aria-describedby": t ? `${a}-hint` : i["aria-describedby"],
|
|
51
|
+
className: n("group inline-flex min-h-control-md cursor-pointer items-start gap-3 rounded-control py-2 outline-none data-disabled:cursor-default data-disabled:opacity-50 data-focus-visible:focus-ring", typeof r == "string" && r),
|
|
52
|
+
children: ({ isSelected: r, isIndeterminate: i }) => /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("span", {
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
className: "mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-cell border border-line-input bg-surface transition-[background-color,border-color,scale] duration-(--duration-settle) ease-settle group-data-indeterminate:border-brand group-data-indeterminate:bg-brand group-data-indeterminate:text-on-brand group-data-pressed:scale-(--press-depth) group-data-pressed:duration-(--duration-snap) group-data-pressed:ease-snap group-data-selected:border-brand group-data-selected:bg-brand group-data-selected:text-on-brand",
|
|
55
|
+
children: i ? /* @__PURE__ */ V("span", { children: "−" }) : /* @__PURE__ */ V(s, { className: n("size-3.5 transition-[scale] duration-(--duration-settle) ease-settle", r ? "scale-100" : "scale-0") })
|
|
56
|
+
}), /* @__PURE__ */ H("span", {
|
|
57
|
+
className: "min-w-0",
|
|
58
|
+
children: [/* @__PURE__ */ V("span", {
|
|
59
|
+
className: "block type-label text-fg-emphasis",
|
|
60
|
+
children: e
|
|
61
|
+
}), t ? /* @__PURE__ */ V("span", {
|
|
62
|
+
id: `${a}-hint`,
|
|
63
|
+
className: n("mt-1 block", q),
|
|
64
|
+
children: t
|
|
65
|
+
}) : null]
|
|
66
|
+
})] })
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function Ve({ label: e, description: t, error: r, options: i, className: a, ...o }) {
|
|
70
|
+
return /* @__PURE__ */ H(ne, {
|
|
71
|
+
...o,
|
|
72
|
+
isInvalid: !!r || o.isInvalid,
|
|
73
|
+
className: n(K, typeof a == "string" && a),
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ V(E, {
|
|
76
|
+
className: "type-label text-fg-emphasis",
|
|
77
|
+
children: e
|
|
78
|
+
}),
|
|
79
|
+
i.map((e) => /* @__PURE__ */ V(J, {
|
|
80
|
+
value: e.id,
|
|
81
|
+
label: e.label,
|
|
82
|
+
description: e.description,
|
|
83
|
+
isDisabled: e.isDisabled
|
|
84
|
+
}, e.id)),
|
|
85
|
+
t && /* @__PURE__ */ V(L, {
|
|
86
|
+
slot: "description",
|
|
87
|
+
className: q,
|
|
88
|
+
children: t
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ V(C, {
|
|
91
|
+
className: "type-caption text-error",
|
|
92
|
+
children: r
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function He({ label: e, description: t, error: r, options: i, className: a, ...o }) {
|
|
98
|
+
return /* @__PURE__ */ H(ge, {
|
|
99
|
+
...o,
|
|
100
|
+
isInvalid: !!r || o.isInvalid,
|
|
101
|
+
className: n(K, typeof a == "string" && a),
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ V(E, {
|
|
104
|
+
className: "type-label text-fg-emphasis",
|
|
105
|
+
children: e
|
|
106
|
+
}),
|
|
107
|
+
i.map((e) => /* @__PURE__ */ H(he, {
|
|
108
|
+
value: e.id,
|
|
109
|
+
isDisabled: e.isDisabled,
|
|
110
|
+
className: "group flex min-h-control-md cursor-pointer items-start gap-3 rounded-control py-2 outline-none data-disabled:opacity-50 data-focus-visible:focus-ring",
|
|
111
|
+
children: [/* @__PURE__ */ V("span", {
|
|
112
|
+
"aria-hidden": "true",
|
|
113
|
+
className: "mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-pill border border-line-input bg-surface transition-[border-color,scale] duration-(--duration-settle) ease-settle group-data-pressed:scale-(--press-depth) group-data-pressed:duration-(--duration-snap) group-data-selected:border-brand",
|
|
114
|
+
children: /* @__PURE__ */ V("span", { className: "size-2.5 scale-0 rounded-pill bg-brand transition-[scale] duration-(--duration-settle) ease-settle group-data-selected:scale-100" })
|
|
115
|
+
}), /* @__PURE__ */ H("span", { children: [/* @__PURE__ */ V("span", {
|
|
116
|
+
className: "block type-label text-fg-emphasis",
|
|
117
|
+
children: e.label
|
|
118
|
+
}), e.description && /* @__PURE__ */ V(L, {
|
|
119
|
+
slot: "description",
|
|
120
|
+
className: n("mt-1 block", q),
|
|
121
|
+
children: e.description
|
|
122
|
+
})] })]
|
|
123
|
+
}, e.id)),
|
|
124
|
+
t && /* @__PURE__ */ V(L, {
|
|
125
|
+
slot: "description",
|
|
126
|
+
className: q,
|
|
127
|
+
children: t
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ V(C, {
|
|
130
|
+
className: "type-caption text-error",
|
|
131
|
+
children: r
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function Ue({ label: e, description: t, error: r, options: o, className: c, placeholder: l = G.choose, ...u }) {
|
|
137
|
+
return /* @__PURE__ */ V(W, { children: (d) => /* @__PURE__ */ H(F, {
|
|
138
|
+
...u,
|
|
139
|
+
placeholder: l,
|
|
140
|
+
isInvalid: !!r || u.isInvalid,
|
|
141
|
+
disabledKeys: o.filter((e) => e.isDisabled).map((e) => e.id),
|
|
142
|
+
className: n(K, typeof c == "string" && c),
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ V(E, {
|
|
145
|
+
className: "type-label text-fg-emphasis",
|
|
146
|
+
children: e
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ H(a, {
|
|
149
|
+
className: "group/trigger w-full justify-between text-left whitespace-normal",
|
|
150
|
+
children: [/* @__PURE__ */ V(I, {
|
|
151
|
+
className: "min-w-0 break-words data-placeholder:text-fg-subtle",
|
|
152
|
+
children: ({ isPlaceholder: e, selectedText: t, defaultChildren: n }) => e ? n : t
|
|
153
|
+
}), /* @__PURE__ */ V(i, { className: "transition-[rotate] duration-(--duration-settle) ease-settle group-aria-expanded/trigger:rotate-180 motion-reduce:transition-none" })]
|
|
154
|
+
}),
|
|
155
|
+
t && /* @__PURE__ */ V(L, {
|
|
156
|
+
slot: "description",
|
|
157
|
+
className: q,
|
|
158
|
+
children: t
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ V(C, {
|
|
161
|
+
className: "type-caption text-error",
|
|
162
|
+
children: r
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ V(N, {
|
|
165
|
+
style: d.style,
|
|
166
|
+
placement: "bottom start",
|
|
167
|
+
className: n(d.className, "z-50 w-(--trigger-width) max-w-[calc(100vw-2rem)] origin-(--trigger-anchor-point) rounded-surface border border-line-subtle bg-surface p-1 text-fg shadow-popover outline-none data-entering:animate-pop-in data-exiting:animate-pop-out"),
|
|
168
|
+
children: /* @__PURE__ */ V(D, {
|
|
169
|
+
items: o,
|
|
170
|
+
className: "max-h-72 overflow-y-auto outline-none",
|
|
171
|
+
renderEmptyState: () => /* @__PURE__ */ V("p", {
|
|
172
|
+
className: "p-3 type-body text-fg-subtle",
|
|
173
|
+
children: G.empty
|
|
174
|
+
}),
|
|
175
|
+
children: (e) => /* @__PURE__ */ H(O, {
|
|
176
|
+
id: e.id,
|
|
177
|
+
textValue: e.label,
|
|
178
|
+
className: "group flex cursor-pointer items-center gap-3 rounded-cell p-3 outline-none data-disabled:opacity-50 data-focused:bg-surface-subtle data-selected:bg-surface-muted",
|
|
179
|
+
children: [/* @__PURE__ */ H("span", {
|
|
180
|
+
className: "min-w-0 flex-1",
|
|
181
|
+
children: [/* @__PURE__ */ V(L, {
|
|
182
|
+
slot: "label",
|
|
183
|
+
className: "block type-label",
|
|
184
|
+
children: e.label
|
|
185
|
+
}), e.description && /* @__PURE__ */ V(L, {
|
|
186
|
+
slot: "description",
|
|
187
|
+
className: n("mt-1 block", q),
|
|
188
|
+
children: e.description
|
|
189
|
+
})]
|
|
190
|
+
}), /* @__PURE__ */ V(s, { className: "invisible group-data-selected:visible" })]
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
})
|
|
194
|
+
]
|
|
195
|
+
}) });
|
|
196
|
+
}
|
|
197
|
+
function We({ label: e, className: t, ...r }) {
|
|
198
|
+
return /* @__PURE__ */ H(be, {
|
|
199
|
+
...r,
|
|
200
|
+
className: n("flex w-full min-w-0 flex-col gap-3 data-disabled:opacity-50", typeof t == "string" && t),
|
|
201
|
+
children: [/* @__PURE__ */ H("div", {
|
|
202
|
+
className: "flex justify-between gap-4",
|
|
203
|
+
children: [/* @__PURE__ */ V(E, {
|
|
204
|
+
className: "type-label text-fg-emphasis",
|
|
205
|
+
children: e
|
|
206
|
+
}), /* @__PURE__ */ V(xe, { className: "type-caption text-fg-subtle numeric" })]
|
|
207
|
+
}), /* @__PURE__ */ V(Ce, {
|
|
208
|
+
className: "relative h-6 w-full rounded-control bg-surface-subtle",
|
|
209
|
+
children: ({ state: t }) => /* @__PURE__ */ V(B, { children: t.values.map((t, n) => /* @__PURE__ */ V(Se, {
|
|
210
|
+
index: n,
|
|
211
|
+
"aria-label": Array.isArray(r.value) || Array.isArray(r.defaultValue) ? `${typeof e == "string" ? e : "Value"} ${n + 1}` : void 0,
|
|
212
|
+
className: "top-1/2 size-6 origin-top-left rounded-pill border border-line-emphasis bg-surface shadow-control transition-[scale,border-color] duration-(--duration-settle) ease-settle outline-none data-dragging:scale-110 data-dragging:border-brand data-focus-visible:focus-ring"
|
|
213
|
+
}, n)) })
|
|
214
|
+
})]
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function Ge({ className: e, ...t }) {
|
|
218
|
+
return /* @__PURE__ */ V(R, {
|
|
219
|
+
...t,
|
|
220
|
+
className: n(r({ size: "sm" }), "data-selected:border-brand data-selected:bg-brand data-selected:text-on-brand", typeof e == "string" && e)
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
var Y = l(void 0);
|
|
224
|
+
function Ke(e) {
|
|
225
|
+
let t = u(Y);
|
|
226
|
+
return /* @__PURE__ */ V(c, {
|
|
227
|
+
...e,
|
|
228
|
+
validationBehavior: e.validationBehavior ?? t ?? "aria"
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
function qe({ className: e, children: t, validationBehavior: r = "native", ...i }) {
|
|
232
|
+
return /* @__PURE__ */ V(ue, {
|
|
233
|
+
...i,
|
|
234
|
+
validationBehavior: r,
|
|
235
|
+
className: n("flex min-w-0 flex-col gap-4", typeof e == "string" && e),
|
|
236
|
+
children: /* @__PURE__ */ V(Y.Provider, {
|
|
237
|
+
value: r,
|
|
238
|
+
children: t
|
|
239
|
+
})
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/components/ui/navigation.tsx
|
|
244
|
+
function Je({ label: e, items: t, onAction: r, isDisabled: o = !1 }) {
|
|
245
|
+
return /* @__PURE__ */ V(W, { children: (s) => /* @__PURE__ */ H(pe, { children: [/* @__PURE__ */ H(a, {
|
|
246
|
+
isDisabled: o,
|
|
247
|
+
className: "group/trigger",
|
|
248
|
+
children: [e, /* @__PURE__ */ V(i, { className: "transition-[rotate] duration-(--duration-settle) ease-settle group-aria-expanded/trigger:rotate-180 motion-reduce:transition-none" })]
|
|
249
|
+
}), /* @__PURE__ */ V(N, {
|
|
250
|
+
style: s.style,
|
|
251
|
+
className: n(s.className, "z-50 max-w-[calc(100vw-2rem)] origin-(--trigger-anchor-point) rounded-surface border border-line-subtle bg-surface p-1 text-fg shadow-popover outline-none data-entering:animate-pop-in data-exiting:animate-pop-out"),
|
|
252
|
+
children: /* @__PURE__ */ V(k, {
|
|
253
|
+
"aria-label": e,
|
|
254
|
+
items: t,
|
|
255
|
+
disabledKeys: t.filter((e) => e.isDisabled).map((e) => e.id),
|
|
256
|
+
onAction: (e) => r(String(e)),
|
|
257
|
+
className: "max-w-80 min-w-48 outline-none",
|
|
258
|
+
children: (e) => /* @__PURE__ */ H(A, {
|
|
259
|
+
id: e.id,
|
|
260
|
+
textValue: e.label,
|
|
261
|
+
className: n("cursor-pointer rounded-cell px-3 py-2 outline-none data-disabled:opacity-50 data-focused:bg-surface-subtle", e.isDestructive ? "text-error" : "text-fg-emphasis"),
|
|
262
|
+
children: [/* @__PURE__ */ V(L, {
|
|
263
|
+
slot: "label",
|
|
264
|
+
className: "block type-label",
|
|
265
|
+
children: e.label
|
|
266
|
+
}), e.description && /* @__PURE__ */ V(L, {
|
|
267
|
+
slot: "description",
|
|
268
|
+
className: "mt-1 block type-caption text-fg-subtle",
|
|
269
|
+
children: e.description
|
|
270
|
+
})]
|
|
271
|
+
})
|
|
272
|
+
})
|
|
273
|
+
})] }) });
|
|
274
|
+
}
|
|
275
|
+
function Ye({ label: e, items: t, className: r, ...o }) {
|
|
276
|
+
return /* @__PURE__ */ V(ce, {
|
|
277
|
+
...o,
|
|
278
|
+
"aria-label": e,
|
|
279
|
+
className: n("w-full min-w-0 divide-y divide-line-subtle", typeof r == "string" && r),
|
|
280
|
+
children: t.map((e) => /* @__PURE__ */ H(se, {
|
|
281
|
+
id: e.id,
|
|
282
|
+
"data-accordion-item": e.id,
|
|
283
|
+
isDisabled: e.isDisabled,
|
|
284
|
+
className: "group min-w-0 py-1",
|
|
285
|
+
children: [/* @__PURE__ */ V(w, { children: /* @__PURE__ */ H(a, {
|
|
286
|
+
slot: "trigger",
|
|
287
|
+
variant: "ghost",
|
|
288
|
+
className: "h-auto min-h-control-md w-full justify-between px-control-md-x py-3 text-left whitespace-normal",
|
|
289
|
+
children: [/* @__PURE__ */ V("span", {
|
|
290
|
+
className: "min-w-0 flex-1 break-words",
|
|
291
|
+
children: e.title
|
|
292
|
+
}), /* @__PURE__ */ V(i, { className: "transition-[rotate] duration-(--duration-settle) ease-settle group-data-expanded:rotate-180 motion-reduce:transition-none" })]
|
|
293
|
+
}) }), /* @__PURE__ */ V(le, {
|
|
294
|
+
className: "min-w-0 type-body text-fg",
|
|
295
|
+
children: /* @__PURE__ */ V("div", {
|
|
296
|
+
className: "animate-reveal-in px-control-md-x pt-3 pb-4",
|
|
297
|
+
children: e.content
|
|
298
|
+
})
|
|
299
|
+
})]
|
|
300
|
+
}, e.id))
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
function Xe({ label: e, items: t, className: r, ...i }) {
|
|
304
|
+
return /* @__PURE__ */ H(je, {
|
|
305
|
+
...i,
|
|
306
|
+
className: n("w-full min-w-0", typeof r == "string" && r),
|
|
307
|
+
children: [/* @__PURE__ */ V(Ee, {
|
|
308
|
+
"aria-label": e,
|
|
309
|
+
className: "flex flex-wrap gap-1 border-b border-line-subtle",
|
|
310
|
+
children: t.map((e) => /* @__PURE__ */ H(Te, {
|
|
311
|
+
id: e.id,
|
|
312
|
+
isDisabled: e.isDisabled,
|
|
313
|
+
className: "relative cursor-pointer rounded-t-control border-b-2 border-transparent px-3 py-2 type-label text-fg-subtle transition-colors duration-(--duration-snap) ease-snap outline-none data-disabled:opacity-50 data-focus-visible:focus-ring data-hovered:text-fg-emphasis data-selected:text-fg-emphasis",
|
|
314
|
+
children: [e.label, /* @__PURE__ */ V(ve, { className: "absolute inset-x-0 -bottom-0.5 h-0.5 bg-brand transition-[translate,width] duration-(--duration-settle) ease-settle" })]
|
|
315
|
+
}, e.id))
|
|
316
|
+
}), t.map((e) => /* @__PURE__ */ V(De, {
|
|
317
|
+
id: e.id,
|
|
318
|
+
className: "min-w-0 py-4 outline-none data-focus-visible:focus-ring",
|
|
319
|
+
children: e.content
|
|
320
|
+
}, e.id))]
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
function Ze({ children: e, content: t, ...r }) {
|
|
324
|
+
return /* @__PURE__ */ V(W, { children: (i) => /* @__PURE__ */ H(Fe, {
|
|
325
|
+
...r,
|
|
326
|
+
children: [e, /* @__PURE__ */ V(Pe, {
|
|
327
|
+
style: i.style,
|
|
328
|
+
placement: "top",
|
|
329
|
+
className: n(i.className, "z-50 max-w-64 origin-(--trigger-anchor-point) rounded-control border border-line-subtle bg-surface px-3 py-2 type-caption text-fg-emphasis shadow-popover data-entering:animate-pop-in data-exiting:animate-pop-out"),
|
|
330
|
+
children: t
|
|
331
|
+
})]
|
|
332
|
+
}) });
|
|
333
|
+
}
|
|
334
|
+
function Qe({ title: e, children: r, isOpen: i, onOpenChange: o, isDismissDisabled: s = !1, trigger: c }) {
|
|
335
|
+
return /* @__PURE__ */ V(W, { children: (l) => /* @__PURE__ */ H(S, {
|
|
336
|
+
isOpen: i,
|
|
337
|
+
onOpenChange: o,
|
|
338
|
+
children: [c, /* @__PURE__ */ V(M, {
|
|
339
|
+
style: l.style,
|
|
340
|
+
isDismissable: !s,
|
|
341
|
+
isKeyboardDismissDisabled: s,
|
|
342
|
+
className: n(l.className, "fixed inset-0 z-50 flex items-center justify-center bg-overlay p-4 data-entering:animate-fade-in data-exiting:animate-fade-out"),
|
|
343
|
+
children: /* @__PURE__ */ V(j, {
|
|
344
|
+
className: "max-h-[calc(100dvh-2rem)] w-full max-w-lg overflow-y-auto rounded-surface border border-line-subtle bg-surface p-6 text-fg shadow-dialog data-entering:animate-dialog-settle data-exiting:animate-pop-out",
|
|
345
|
+
children: /* @__PURE__ */ V(x, {
|
|
346
|
+
className: "min-w-0 outline-none",
|
|
347
|
+
children: ({ close: n }) => /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("div", {
|
|
348
|
+
className: "mb-4 flex items-start justify-between gap-4",
|
|
349
|
+
children: [/* @__PURE__ */ V(w, {
|
|
350
|
+
slot: "title",
|
|
351
|
+
className: "type-heading text-fg-emphasis",
|
|
352
|
+
children: e
|
|
353
|
+
}), /* @__PURE__ */ V(a, {
|
|
354
|
+
variant: "ghost",
|
|
355
|
+
size: "icon-sm",
|
|
356
|
+
"aria-label": G.close,
|
|
357
|
+
isDisabled: s,
|
|
358
|
+
onPress: n,
|
|
359
|
+
children: /* @__PURE__ */ V(t, {})
|
|
360
|
+
})]
|
|
361
|
+
}), r] })
|
|
362
|
+
})
|
|
363
|
+
})
|
|
364
|
+
})]
|
|
365
|
+
}) });
|
|
366
|
+
}
|
|
367
|
+
function $e({ label: e, page: t, total: n, onChange: r, isDisabled: i = !1 }) {
|
|
368
|
+
let s = Math.max(1, Math.floor(Number.isFinite(n) ? n : 1)), c = Math.min(s, Math.max(1, Math.floor(Number.isFinite(t) ? t : 1)));
|
|
369
|
+
return /* @__PURE__ */ H("nav", {
|
|
370
|
+
"aria-label": e,
|
|
371
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
372
|
+
children: [
|
|
373
|
+
/* @__PURE__ */ H(a, {
|
|
374
|
+
size: "sm",
|
|
375
|
+
"aria-label": G.previous,
|
|
376
|
+
isDisabled: i || c === 1,
|
|
377
|
+
onPress: () => r(c - 1),
|
|
378
|
+
children: [/* @__PURE__ */ V(o, { className: "rotate-180" }), G.previous]
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ V("span", {
|
|
381
|
+
"aria-current": "page",
|
|
382
|
+
className: "type-caption text-fg-subtle numeric",
|
|
383
|
+
children: G.page(c, s)
|
|
384
|
+
}),
|
|
385
|
+
/* @__PURE__ */ H(a, {
|
|
386
|
+
size: "sm",
|
|
387
|
+
"aria-label": G.next,
|
|
388
|
+
isDisabled: i || c === s,
|
|
389
|
+
onPress: () => r(c + 1),
|
|
390
|
+
children: [G.next, /* @__PURE__ */ V(o, {})]
|
|
391
|
+
})
|
|
392
|
+
]
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
function et({ label: e, items: t }) {
|
|
396
|
+
return /* @__PURE__ */ V(y, {
|
|
397
|
+
"aria-label": e,
|
|
398
|
+
className: "flex flex-wrap items-center gap-2 type-caption text-fg-subtle",
|
|
399
|
+
children: t.map((e, n) => /* @__PURE__ */ H(v, {
|
|
400
|
+
className: "inline-flex items-center gap-2",
|
|
401
|
+
children: [/* @__PURE__ */ V(fe, {
|
|
402
|
+
href: e.href,
|
|
403
|
+
className: "rounded-cell outline-none data-focus-visible:focus-ring data-hovered:underline",
|
|
404
|
+
children: e.label
|
|
405
|
+
}), n < t.length - 1 && /* @__PURE__ */ V(o, { className: "size-3" })]
|
|
406
|
+
}, e.id))
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/components/ui/display.tsx
|
|
411
|
+
function tt({ children: e, className: t, ...r }) {
|
|
412
|
+
return /* @__PURE__ */ V("section", {
|
|
413
|
+
...r,
|
|
414
|
+
className: n("min-w-0 rounded-surface border border-line-subtle bg-surface p-6 text-fg shadow-surface", t),
|
|
415
|
+
children: e
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
var nt = {
|
|
419
|
+
neutral: "bg-surface-subtle text-fg-subtle",
|
|
420
|
+
info: "bg-info-subtle text-info",
|
|
421
|
+
success: "bg-success-subtle text-success",
|
|
422
|
+
attention: "bg-attention-subtle text-attention",
|
|
423
|
+
error: "bg-error-subtle text-error"
|
|
424
|
+
};
|
|
425
|
+
function rt({ children: e, tone: t = "neutral" }) {
|
|
426
|
+
return /* @__PURE__ */ V("span", {
|
|
427
|
+
className: n("inline-flex max-w-full items-center gap-1.5 rounded-cell px-2 py-1 type-caption", nt[t]),
|
|
428
|
+
children: e
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
function it({ label: e, className: t, ...r }) {
|
|
432
|
+
return /* @__PURE__ */ V(me, {
|
|
433
|
+
...r,
|
|
434
|
+
"aria-label": e,
|
|
435
|
+
className: n("flex w-full min-w-0 flex-col gap-2", typeof t == "string" && t),
|
|
436
|
+
children: ({ percentage: t, valueText: r, isIndeterminate: i }) => /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("div", {
|
|
437
|
+
className: "flex items-center justify-between gap-3",
|
|
438
|
+
children: [/* @__PURE__ */ V("span", {
|
|
439
|
+
className: "type-label",
|
|
440
|
+
children: e
|
|
441
|
+
}), !i && /* @__PURE__ */ V("span", {
|
|
442
|
+
className: "type-caption text-fg-subtle numeric",
|
|
443
|
+
children: r
|
|
444
|
+
})]
|
|
445
|
+
}), /* @__PURE__ */ V("div", {
|
|
446
|
+
className: "h-2 overflow-hidden rounded-pill bg-surface-subtle",
|
|
447
|
+
children: /* @__PURE__ */ V("div", {
|
|
448
|
+
style: { width: i ? "100%" : `${t}%` },
|
|
449
|
+
className: n("h-full rounded-pill bg-brand transition-[width] duration-(--duration-base) motion-reduce:transition-none", i && "animate-pulse-soft motion-reduce:animate-none")
|
|
450
|
+
})
|
|
451
|
+
})] })
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
function at({ className: e, ...t }) {
|
|
455
|
+
return /* @__PURE__ */ V(ye, {
|
|
456
|
+
...t,
|
|
457
|
+
className: n("border-0 bg-line-subtle", t.orientation === "vertical" ? "h-6 w-px" : "h-px w-full", typeof e == "string" && e)
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
function ot({ ratio: e = 16 / 9, children: t, className: r }) {
|
|
461
|
+
return /* @__PURE__ */ V("div", {
|
|
462
|
+
style: { aspectRatio: Number.isFinite(e) && e > 0 ? e : 1 },
|
|
463
|
+
className: n("relative w-full min-w-0 overflow-hidden rounded-surface", r),
|
|
464
|
+
children: t
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
function st({ children: e }) {
|
|
468
|
+
return /* @__PURE__ */ V("kbd", {
|
|
469
|
+
className: "inline-flex rounded-cell border border-line-subtle bg-surface-muted px-1.5 py-0.5 font-mono type-caption text-fg-subtle",
|
|
470
|
+
children: e
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
function X(e, t) {
|
|
474
|
+
if (!t) return [...e];
|
|
475
|
+
let n = new Intl.Collator(void 0, {
|
|
476
|
+
numeric: !0,
|
|
477
|
+
sensitivity: "base"
|
|
478
|
+
});
|
|
479
|
+
return [...e].sort((e, r) => {
|
|
480
|
+
let i = e.values[String(t.column)] ?? "", a = r.values[String(t.column)] ?? "", o = typeof i == "number" && typeof a == "number" ? i - a : n.compare(String(i), String(a));
|
|
481
|
+
return t.direction === "descending" ? -o : o;
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
function ct({ label: e, columns: t, rows: n, empty: r = G.noRows, selectionMode: i = "none", selectedKeys: a, onSelectionChange: o }) {
|
|
485
|
+
let [s, c] = h();
|
|
486
|
+
return /* @__PURE__ */ V("div", {
|
|
487
|
+
className: "max-w-full overflow-x-auto rounded-surface border border-line-subtle bg-surface",
|
|
488
|
+
children: /* @__PURE__ */ H(Oe, {
|
|
489
|
+
"aria-label": e,
|
|
490
|
+
sortDescriptor: s,
|
|
491
|
+
onSortChange: c,
|
|
492
|
+
selectionMode: i,
|
|
493
|
+
selectedKeys: a,
|
|
494
|
+
onSelectionChange: o,
|
|
495
|
+
className: "w-full outline-none",
|
|
496
|
+
children: [/* @__PURE__ */ V(Ae, {
|
|
497
|
+
columns: t,
|
|
498
|
+
children: (e) => /* @__PURE__ */ V(re, {
|
|
499
|
+
id: e.id,
|
|
500
|
+
isRowHeader: e.isRowHeader ?? e === t[0],
|
|
501
|
+
allowsSorting: e.sortable,
|
|
502
|
+
className: "border-b border-line-subtle bg-surface-muted p-3 text-left type-label text-fg-emphasis outline-none data-focus-visible:focus-ring",
|
|
503
|
+
children: ({ sortDirection: t }) => /* @__PURE__ */ H("span", {
|
|
504
|
+
className: "inline-flex items-center gap-2",
|
|
505
|
+
children: [e.label, e.sortable && /* @__PURE__ */ V("span", {
|
|
506
|
+
"aria-hidden": "true",
|
|
507
|
+
children: t === "ascending" ? "↑" : t === "descending" ? "↓" : "↕"
|
|
508
|
+
})]
|
|
509
|
+
})
|
|
510
|
+
})
|
|
511
|
+
}), /* @__PURE__ */ V(ke, {
|
|
512
|
+
items: X(n, s),
|
|
513
|
+
renderEmptyState: () => /* @__PURE__ */ V("p", {
|
|
514
|
+
className: "p-6 type-body text-fg-subtle",
|
|
515
|
+
children: r
|
|
516
|
+
}),
|
|
517
|
+
children: (e) => /* @__PURE__ */ V(_e, {
|
|
518
|
+
id: e.id,
|
|
519
|
+
columns: t,
|
|
520
|
+
className: "border-b border-line-subtle outline-none last:border-b-0 data-focus-visible:focus-ring data-selected:bg-surface-subtle",
|
|
521
|
+
children: (t) => /* @__PURE__ */ V(ee, {
|
|
522
|
+
className: "max-w-80 p-3 type-body break-words text-fg outline-none data-focus-visible:focus-ring",
|
|
523
|
+
children: e.values[t.id] ?? ""
|
|
524
|
+
})
|
|
525
|
+
})
|
|
526
|
+
})]
|
|
527
|
+
})
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
function lt() {
|
|
531
|
+
return new Re({ maxVisibleToasts: 3 });
|
|
532
|
+
}
|
|
533
|
+
function ut({ queue: e, label: n = G.notifications }) {
|
|
534
|
+
return /* @__PURE__ */ V(ze, {
|
|
535
|
+
queue: e,
|
|
536
|
+
"aria-label": n,
|
|
537
|
+
className: "fixed right-4 bottom-4 z-50 flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-3 outline-none",
|
|
538
|
+
children: ({ toast: e }) => /* @__PURE__ */ V(Ie, {
|
|
539
|
+
toast: e,
|
|
540
|
+
className: "rounded-surface border border-line-subtle bg-surface p-4 text-fg shadow-popover outline-none data-entering:animate-toast-in data-exiting:animate-fade-out data-focus-visible:focus-ring",
|
|
541
|
+
children: /* @__PURE__ */ H(Le, { children: [/* @__PURE__ */ H("div", {
|
|
542
|
+
className: "flex items-start justify-between gap-3",
|
|
543
|
+
children: [/* @__PURE__ */ V(L, {
|
|
544
|
+
slot: "title",
|
|
545
|
+
className: "type-label text-fg-emphasis",
|
|
546
|
+
children: e.content.title
|
|
547
|
+
}), /* @__PURE__ */ V(a, {
|
|
548
|
+
slot: "close",
|
|
549
|
+
size: "icon-sm",
|
|
550
|
+
variant: "ghost",
|
|
551
|
+
"aria-label": G.dismiss,
|
|
552
|
+
children: /* @__PURE__ */ V(t, {})
|
|
553
|
+
})]
|
|
554
|
+
}), e.content.description && /* @__PURE__ */ V(L, {
|
|
555
|
+
slot: "description",
|
|
556
|
+
className: "mt-2 block type-body text-fg-subtle",
|
|
557
|
+
children: e.content.description
|
|
558
|
+
})] })
|
|
559
|
+
})
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
//#endregion
|
|
563
|
+
//#region src/components/switch.tsx
|
|
564
|
+
function dt({ label: e, description: t, className: r, ...i }) {
|
|
565
|
+
let a = f();
|
|
566
|
+
return /* @__PURE__ */ H(we, {
|
|
567
|
+
...i,
|
|
568
|
+
"aria-labelledby": `${a}-label`,
|
|
569
|
+
"aria-describedby": t ? `${a}-description` : i["aria-describedby"],
|
|
570
|
+
className: n("group inline-flex min-h-control-md cursor-pointer items-center gap-3 rounded-control outline-none data-disabled:cursor-default data-focus-visible:focus-ring", typeof r == "string" ? r : void 0),
|
|
571
|
+
children: [/* @__PURE__ */ V("span", {
|
|
572
|
+
"aria-hidden": "true",
|
|
573
|
+
className: "flex h-6 w-10 shrink-0 items-center rounded-pill border border-line-input bg-surface-subtle p-0.5 transition-colors duration-(--duration-snap) ease-snap [corner-shape:var(--corner-shape,round)] group-data-disabled:opacity-50 group-data-selected:border-brand group-data-selected:bg-brand",
|
|
574
|
+
children: /* @__PURE__ */ V("span", { className: "size-4 origin-left rounded-pill bg-fg-subtle transition-[translate,scale] duration-(--duration-settle) ease-settle [corner-shape:var(--corner-shape,round)] group-data-pressed:scale-x-125 group-data-pressed:duration-(--duration-snap) group-data-pressed:ease-snap group-data-selected:origin-right group-data-selected:translate-x-4 group-data-selected:bg-on-brand motion-reduce:transition-none" })
|
|
575
|
+
}), /* @__PURE__ */ H("span", {
|
|
576
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
577
|
+
children: [/* @__PURE__ */ V("span", {
|
|
578
|
+
id: `${a}-label`,
|
|
579
|
+
className: "type-label text-fg-emphasis group-data-disabled:text-fg-muted",
|
|
580
|
+
children: e
|
|
581
|
+
}), t ? /* @__PURE__ */ V("span", {
|
|
582
|
+
id: `${a}-description`,
|
|
583
|
+
className: "type-caption text-fg-subtle",
|
|
584
|
+
children: t
|
|
585
|
+
}) : null]
|
|
586
|
+
})]
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
//#endregion
|
|
590
|
+
//#region src/components/search-picker.tsx
|
|
591
|
+
function ft({ label: t, items: r, value: a, onChange: o, trigger: c, searchPlaceholder: l = "Search", emptyMessage: u = "Nothing matches that search.", triggerClassName: d }) {
|
|
592
|
+
let { contains: f } = z({ sensitivity: "base" });
|
|
593
|
+
return /* @__PURE__ */ H(S, { children: [/* @__PURE__ */ H(b, {
|
|
594
|
+
"aria-label": t,
|
|
595
|
+
className: n("inline-flex cursor-pointer items-center gap-1.5 rounded-cell text-left transition-colors duration-(--duration-fast) outline-none data-focus-visible:focus-ring data-hovered:text-fg-emphasis", d),
|
|
596
|
+
children: [c, /* @__PURE__ */ V(i, { className: "size-3.5 text-fg-subtle" })]
|
|
597
|
+
}), /* @__PURE__ */ V(N, {
|
|
598
|
+
placement: "bottom start",
|
|
599
|
+
offset: 6,
|
|
600
|
+
className: "w-72 origin-(--trigger-anchor-point) overflow-hidden rounded-surface border border-line-subtle bg-surface shadow-popover outline-none data-entering:animate-pop-in data-exiting:animate-pop-out",
|
|
601
|
+
children: /* @__PURE__ */ V(x, {
|
|
602
|
+
"aria-label": t,
|
|
603
|
+
className: "outline-none",
|
|
604
|
+
children: ({ close: n }) => /* @__PURE__ */ H(_, {
|
|
605
|
+
filter: (e, t) => f(e, t),
|
|
606
|
+
children: [/* @__PURE__ */ V(P, {
|
|
607
|
+
"aria-label": `Search ${t.toLowerCase()}`,
|
|
608
|
+
autoFocus: !0,
|
|
609
|
+
className: "border-b border-line-subtle",
|
|
610
|
+
children: /* @__PURE__ */ H("div", {
|
|
611
|
+
className: "flex items-center gap-2 px-3",
|
|
612
|
+
children: [/* @__PURE__ */ V(e, { className: "text-fg-subtle" }), /* @__PURE__ */ V(T, {
|
|
613
|
+
placeholder: l,
|
|
614
|
+
className: "h-10 w-full bg-transparent text-sm text-fg-emphasis outline-none placeholder:text-fg-subtle [&::-webkit-search-cancel-button]:hidden"
|
|
615
|
+
})]
|
|
616
|
+
})
|
|
617
|
+
}), /* @__PURE__ */ V(D, {
|
|
618
|
+
"aria-label": t,
|
|
619
|
+
items: r,
|
|
620
|
+
selectionMode: "single",
|
|
621
|
+
selectedKeys: [a],
|
|
622
|
+
onSelectionChange: (e) => {
|
|
623
|
+
let [t] = [...e];
|
|
624
|
+
t !== void 0 && (o(String(t)), n());
|
|
625
|
+
},
|
|
626
|
+
renderEmptyState: () => /* @__PURE__ */ V("p", {
|
|
627
|
+
className: "px-3 py-6 text-center type-body text-fg-subtle",
|
|
628
|
+
children: u
|
|
629
|
+
}),
|
|
630
|
+
className: "max-h-72 overflow-y-auto p-1 outline-none",
|
|
631
|
+
children: (e) => /* @__PURE__ */ H(O, {
|
|
632
|
+
id: e.id,
|
|
633
|
+
textValue: [
|
|
634
|
+
e.label,
|
|
635
|
+
e.detail,
|
|
636
|
+
e.keywords
|
|
637
|
+
].filter(Boolean).join(" "),
|
|
638
|
+
className: "group flex cursor-pointer items-center gap-2 rounded-cell px-2 py-1.5 type-body text-fg outline-none data-focused:bg-surface-subtle data-focused:text-fg-emphasis data-selected:text-fg-emphasis",
|
|
639
|
+
children: [
|
|
640
|
+
/* @__PURE__ */ V("span", {
|
|
641
|
+
className: "min-w-0 flex-1 truncate",
|
|
642
|
+
children: e.label
|
|
643
|
+
}),
|
|
644
|
+
e.detail ? /* @__PURE__ */ V("span", {
|
|
645
|
+
className: "shrink-0 type-caption font-normal text-fg-subtle numeric",
|
|
646
|
+
children: e.detail
|
|
647
|
+
}) : null,
|
|
648
|
+
/* @__PURE__ */ V(s, { className: "invisible size-3.5 text-fg-emphasis group-data-selected:visible" })
|
|
649
|
+
]
|
|
650
|
+
})
|
|
651
|
+
})]
|
|
652
|
+
})
|
|
653
|
+
})
|
|
654
|
+
})] });
|
|
655
|
+
}
|
|
656
|
+
//#endregion
|
|
657
|
+
//#region src/components/segmented-control.tsx
|
|
658
|
+
function pt(e, t) {
|
|
659
|
+
let n = m(null), r = m(null), i = m(e);
|
|
660
|
+
return p(() => {
|
|
661
|
+
let a = i.current;
|
|
662
|
+
i.current = e;
|
|
663
|
+
let o = r.current, s = n.current?.children[t.indexOf(a)];
|
|
664
|
+
if (a === e || !o || !s || typeof o.animate != "function" || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
665
|
+
let c = s.getBoundingClientRect(), l = o.getBoundingClientRect(), u = getComputedStyle(o);
|
|
666
|
+
o.animate([{
|
|
667
|
+
translate: `${c.left - l.left}px ${c.top - l.top}px`,
|
|
668
|
+
width: `${c.width}px`,
|
|
669
|
+
height: `${c.height}px`
|
|
670
|
+
}, {
|
|
671
|
+
translate: "0 0",
|
|
672
|
+
width: `${l.width}px`,
|
|
673
|
+
height: `${l.height}px`
|
|
674
|
+
}], {
|
|
675
|
+
duration: parseFloat(u.getPropertyValue("--duration-settle")) || 0,
|
|
676
|
+
easing: u.getPropertyValue("--ease-settle").trim() || "ease-out"
|
|
677
|
+
});
|
|
678
|
+
}, [e, t]), {
|
|
679
|
+
group: n,
|
|
680
|
+
mark: r
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
function mt({ label: e, options: t, value: r, onChange: i, size: a = "sm", className: o }) {
|
|
684
|
+
let { group: s, mark: c } = pt(r, t.map((e) => e.id));
|
|
685
|
+
return /* @__PURE__ */ V(Ne, {
|
|
686
|
+
ref: s,
|
|
687
|
+
"aria-label": e,
|
|
688
|
+
selectionMode: "single",
|
|
689
|
+
disallowEmptySelection: !0,
|
|
690
|
+
selectedKeys: [r],
|
|
691
|
+
onSelectionChange: (e) => {
|
|
692
|
+
let [t] = [...e];
|
|
693
|
+
t !== void 0 && t !== r && i(String(t));
|
|
694
|
+
},
|
|
695
|
+
className: n("inline-flex max-w-full shrink-0 flex-wrap items-center gap-0.5 rounded-control bg-surface-subtle p-0.5", o),
|
|
696
|
+
children: t.map((e) => /* @__PURE__ */ H(R, {
|
|
697
|
+
id: e.id,
|
|
698
|
+
"aria-label": e["aria-label"],
|
|
699
|
+
isDisabled: e.isDisabled,
|
|
700
|
+
className: n("relative inline-flex cursor-pointer items-center justify-center gap-1.5 rounded-[calc(var(--radius-control)-2px)] text-fg transition-colors duration-(--duration-snap) ease-snap outline-none squircle", "data-disabled:cursor-not-allowed data-disabled:text-fg-muted data-focus-visible:focus-ring data-hovered:text-fg-emphasis data-selected:text-fg-emphasis", a === "sm" ? "h-control-sm min-w-control-sm px-control-sm-x type-caption" : "h-control-md min-w-control-md px-control-md-x type-label"),
|
|
701
|
+
children: [e.id === r ? /* @__PURE__ */ V("span", {
|
|
702
|
+
ref: c,
|
|
703
|
+
"aria-hidden": "true",
|
|
704
|
+
className: "absolute inset-0 rounded-[calc(var(--radius-control)-2px)] border border-line-subtle bg-surface shadow-control squircle"
|
|
705
|
+
}) : null, /* @__PURE__ */ H("span", {
|
|
706
|
+
className: "relative inline-flex items-center gap-1.5",
|
|
707
|
+
children: [e.icon, e.label]
|
|
708
|
+
})]
|
|
709
|
+
}, e.id))
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
//#endregion
|
|
713
|
+
//#region src/components/avatar.tsx
|
|
714
|
+
var ht = {
|
|
715
|
+
sm: "size-avatar-sm text-avatar-sm",
|
|
716
|
+
md: "size-avatar-md text-xs",
|
|
717
|
+
lg: "size-avatar-lg text-sm"
|
|
718
|
+
};
|
|
719
|
+
function gt(e) {
|
|
720
|
+
let t = e.trim().split(/\s+/);
|
|
721
|
+
return ((t[0]?.[0] ?? "") + (t.length > 1 ? t[t.length - 1]?.[0] ?? "" : "")).toUpperCase();
|
|
722
|
+
}
|
|
723
|
+
function _t({ name: e, src: t, size: r = "md", className: i }) {
|
|
724
|
+
let [a, o] = h(!1), s = t && !a;
|
|
725
|
+
return /* @__PURE__ */ V("span", {
|
|
726
|
+
className: n("inline-flex shrink-0 items-center justify-center overflow-hidden rounded-pill bg-surface-emphasis font-semibold text-fg-emphasis select-none", ht[r], i),
|
|
727
|
+
children: s ? /* @__PURE__ */ V("img", {
|
|
728
|
+
src: t,
|
|
729
|
+
alt: e,
|
|
730
|
+
className: "size-full object-cover",
|
|
731
|
+
onError: () => o(!0)
|
|
732
|
+
}) : /* @__PURE__ */ V("span", {
|
|
733
|
+
role: "img",
|
|
734
|
+
"aria-label": e,
|
|
735
|
+
children: gt(e)
|
|
736
|
+
})
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
//#endregion
|
|
740
|
+
//#region src/components/skeleton.tsx
|
|
741
|
+
function vt({ className: e }) {
|
|
742
|
+
return /* @__PURE__ */ V("span", {
|
|
743
|
+
"aria-hidden": "true",
|
|
744
|
+
className: n("block animate-pulse-soft rounded-cell bg-surface-subtle", e)
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
//#endregion
|
|
748
|
+
//#region src/components/scroll-area.tsx
|
|
749
|
+
function yt({ children: e, className: t, label: r, scrollTo: i }) {
|
|
750
|
+
let a = m(null), [o, s] = h({
|
|
751
|
+
top: !1,
|
|
752
|
+
bottom: !1
|
|
753
|
+
});
|
|
754
|
+
d(() => {
|
|
755
|
+
let e = a.current;
|
|
756
|
+
if (!e) return;
|
|
757
|
+
let t = () => s({
|
|
758
|
+
top: e.scrollTop > 1,
|
|
759
|
+
bottom: e.scrollTop + e.clientHeight < e.scrollHeight - 1
|
|
760
|
+
}), n = new ResizeObserver(t);
|
|
761
|
+
n.observe(e);
|
|
762
|
+
for (let t of e.children) n.observe(t);
|
|
763
|
+
return e.addEventListener("scroll", t, { passive: !0 }), () => {
|
|
764
|
+
n.disconnect(), e.removeEventListener("scroll", t);
|
|
765
|
+
};
|
|
766
|
+
}, []), d(() => {
|
|
767
|
+
i !== void 0 && a.current && (a.current.scrollTop = i);
|
|
768
|
+
}, [i]);
|
|
769
|
+
let c = "1.5rem", l = `linear-gradient(to bottom, ${o.top ? "transparent" : "black"} 0, black ${o.top ? c : "0"}, black calc(100% - ${o.bottom ? c : "0px"}), ${o.bottom ? "transparent" : "black"} 100%)`;
|
|
770
|
+
return /* @__PURE__ */ V("div", {
|
|
771
|
+
ref: a,
|
|
772
|
+
tabIndex: o.top || o.bottom ? 0 : void 0,
|
|
773
|
+
role: o.top || o.bottom ? "region" : void 0,
|
|
774
|
+
"aria-label": o.top || o.bottom ? r : void 0,
|
|
775
|
+
className: n("overflow-y-auto overscroll-contain rounded-[2px]", t),
|
|
776
|
+
style: {
|
|
777
|
+
maskImage: l,
|
|
778
|
+
WebkitMaskImage: l
|
|
779
|
+
},
|
|
780
|
+
children: e
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
//#endregion
|
|
784
|
+
//#region src/components/responsive-overlay.tsx
|
|
785
|
+
var Z = "(max-width: 639px)", Q = "(min-width: 960px)", bt = "flex min-h-0 flex-col overflow-hidden bg-surface text-fg shadow-dialog";
|
|
786
|
+
function xt(e) {
|
|
787
|
+
let t = [window.matchMedia(Z), window.matchMedia(Q)];
|
|
788
|
+
return t.forEach((t) => t.addEventListener("change", e)), () => t.forEach((t) => t.removeEventListener("change", e));
|
|
789
|
+
}
|
|
790
|
+
function St() {
|
|
791
|
+
return window.matchMedia(Z).matches ? "drawer" : window.matchMedia(Q).matches ? "side" : "below";
|
|
792
|
+
}
|
|
793
|
+
function Ct({ isOpen: e, onOpenChange: t, triggerRef: r, "aria-label": i, isDismissDisabled: a = !1, children: o, className: s }) {
|
|
794
|
+
let c = g(xt, St, () => "side"), l = /* @__PURE__ */ V(x, {
|
|
795
|
+
"aria-label": i,
|
|
796
|
+
className: "flex min-h-0 flex-1 flex-col outline-none",
|
|
797
|
+
children: o
|
|
798
|
+
}), u = bt;
|
|
799
|
+
return c === "drawer" ? /* @__PURE__ */ V(M, {
|
|
800
|
+
isOpen: e,
|
|
801
|
+
onOpenChange: t,
|
|
802
|
+
isDismissable: !a,
|
|
803
|
+
isKeyboardDismissDisabled: a,
|
|
804
|
+
className: "fixed inset-0 z-50 flex items-end justify-center bg-overlay data-entering:animate-fade-in data-exiting:animate-fade-out",
|
|
805
|
+
children: /* @__PURE__ */ V(j, {
|
|
806
|
+
"data-presentation": "drawer",
|
|
807
|
+
className: n(u, "max-h-[calc(100dvh-1rem)] w-full rounded-t-surface pb-[env(safe-area-inset-bottom)] data-entering:animate-drawer-settle data-exiting:animate-drawer-out", s),
|
|
808
|
+
children: l
|
|
809
|
+
})
|
|
810
|
+
}) : /* @__PURE__ */ V(N, {
|
|
811
|
+
isOpen: e,
|
|
812
|
+
onOpenChange: t,
|
|
813
|
+
triggerRef: r,
|
|
814
|
+
placement: c === "side" ? "right" : "bottom start",
|
|
815
|
+
isKeyboardDismissDisabled: a,
|
|
816
|
+
shouldCloseOnInteractOutside: () => !a,
|
|
817
|
+
"data-presentation": "popover",
|
|
818
|
+
className: n(u, "z-50 max-h-[min(48rem,calc(100dvh-2rem))] w-96 max-w-[calc(100vw-2rem)] origin-(--trigger-anchor-point) rounded-surface border border-line shadow-popover data-entering:animate-pop-in data-exiting:animate-pop-out", s),
|
|
819
|
+
children: l
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
//#endregion
|
|
823
|
+
//#region src/components/date-time-field.tsx
|
|
824
|
+
function wt({ label: e, value: t, onChange: r, error: i, isDisabled: a, kind: o, className: s }) {
|
|
825
|
+
let c = /* @__PURE__ */ H(B, { children: [
|
|
826
|
+
/* @__PURE__ */ V(E, {
|
|
827
|
+
className: "type-label text-fg-emphasis",
|
|
828
|
+
children: e
|
|
829
|
+
}),
|
|
830
|
+
/* @__PURE__ */ V(ae, {
|
|
831
|
+
className: "flex h-control-md items-center rounded-control border border-line-input bg-surface px-control-md-x type-body text-fg-emphasis shadow-control outline-none data-disabled:bg-surface-muted data-disabled:text-fg-muted data-focus-within:border-brand data-focus-within:ring-2 data-focus-within:ring-brand/15 data-invalid:border-error",
|
|
832
|
+
children: (e) => /* @__PURE__ */ V(oe, {
|
|
833
|
+
segment: e,
|
|
834
|
+
className: "rounded-cell px-0.5 numeric outline-none data-focused:bg-brand data-focused:text-on-brand data-placeholder:text-fg-subtle"
|
|
835
|
+
})
|
|
836
|
+
}),
|
|
837
|
+
/* @__PURE__ */ V(C, {
|
|
838
|
+
className: "type-caption text-error",
|
|
839
|
+
children: i
|
|
840
|
+
})
|
|
841
|
+
] }), l = {
|
|
842
|
+
isInvalid: !!i,
|
|
843
|
+
isDisabled: a,
|
|
844
|
+
isRequired: !0,
|
|
845
|
+
validationBehavior: "aria",
|
|
846
|
+
className: n("flex min-w-0 flex-col gap-1.5", s)
|
|
847
|
+
};
|
|
848
|
+
return /* @__PURE__ */ V(de, {
|
|
849
|
+
locale: "en-AU",
|
|
850
|
+
children: o === "date" ? /* @__PURE__ */ V(ie, {
|
|
851
|
+
...l,
|
|
852
|
+
value: t ? Be(t) : null,
|
|
853
|
+
onChange: (e) => r(e?.toString() ?? ""),
|
|
854
|
+
children: c
|
|
855
|
+
}) : /* @__PURE__ */ V(Me, {
|
|
856
|
+
...l,
|
|
857
|
+
hourCycle: 24,
|
|
858
|
+
granularity: "minute",
|
|
859
|
+
value: t ? U(t) : null,
|
|
860
|
+
onChange: (e) => r(e ? e.toString().slice(0, 5) : ""),
|
|
861
|
+
children: c
|
|
862
|
+
})
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
//#endregion
|
|
866
|
+
//#region src/components/scenario-picker/copy.ts
|
|
867
|
+
var $ = {
|
|
868
|
+
label: "Scenario",
|
|
869
|
+
search: "Search scenarios",
|
|
870
|
+
empty: "No matching scenarios."
|
|
871
|
+
};
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region src/components/scenario-picker/index.tsx
|
|
874
|
+
function Tt({ label: t, value: r, onChange: o, options: c, isDisabled: l = !1 }) {
|
|
875
|
+
let u = m(null), [d, f] = h(!1), [p, g] = h(!1), { contains: v } = z({ sensitivity: "base" }), y = c.find((e) => e.id === r), b = /* @__PURE__ */ V(D, {
|
|
876
|
+
items: c,
|
|
877
|
+
className: "p-1 outline-none",
|
|
878
|
+
renderEmptyState: () => /* @__PURE__ */ V("p", {
|
|
879
|
+
className: "px-3 py-5 type-body text-fg-subtle",
|
|
880
|
+
children: $.empty
|
|
881
|
+
}),
|
|
882
|
+
children: (e) => /* @__PURE__ */ H(O, {
|
|
883
|
+
id: e.id,
|
|
884
|
+
textValue: `${e.label} ${e.description}`,
|
|
885
|
+
isDisabled: e.isDisabled,
|
|
886
|
+
className: "group flex cursor-pointer items-start gap-3 rounded-cell px-3 py-2.5 text-fg-emphasis outline-none data-disabled:cursor-not-allowed data-disabled:opacity-50 data-focus-visible:focus-ring data-focused:bg-surface-subtle",
|
|
887
|
+
children: [/* @__PURE__ */ H("div", {
|
|
888
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
889
|
+
children: [/* @__PURE__ */ V(L, {
|
|
890
|
+
slot: "label",
|
|
891
|
+
className: "type-label",
|
|
892
|
+
children: e.label
|
|
893
|
+
}), /* @__PURE__ */ V(L, {
|
|
894
|
+
slot: "description",
|
|
895
|
+
className: "type-caption font-normal text-fg-subtle",
|
|
896
|
+
children: e.description
|
|
897
|
+
})]
|
|
898
|
+
}), /* @__PURE__ */ V(s, { className: "invisible mt-0.5 size-4 shrink-0 group-data-selected:visible" })]
|
|
899
|
+
})
|
|
900
|
+
});
|
|
901
|
+
return /* @__PURE__ */ H(F, {
|
|
902
|
+
ref: u,
|
|
903
|
+
"aria-label": t,
|
|
904
|
+
value: r,
|
|
905
|
+
onChange: (e) => {
|
|
906
|
+
let t = c.find((t) => t.id === e);
|
|
907
|
+
t && t.id !== r && !t.isDisabled && o(t.id);
|
|
908
|
+
},
|
|
909
|
+
isOpen: d,
|
|
910
|
+
onOpenChange: (e) => {
|
|
911
|
+
e && g(!!u.current?.closest(".dark")), f(e);
|
|
912
|
+
},
|
|
913
|
+
isDisabled: l,
|
|
914
|
+
className: "max-w-full min-w-0 self-start",
|
|
915
|
+
children: [/* @__PURE__ */ H(a, {
|
|
916
|
+
size: "sm",
|
|
917
|
+
"aria-label": t,
|
|
918
|
+
className: "max-w-full min-w-0 justify-between",
|
|
919
|
+
children: [
|
|
920
|
+
/* @__PURE__ */ H("span", {
|
|
921
|
+
className: "font-normal text-fg-subtle",
|
|
922
|
+
children: [$.label, ":"]
|
|
923
|
+
}),
|
|
924
|
+
/* @__PURE__ */ V(I, {
|
|
925
|
+
className: "min-w-0 truncate",
|
|
926
|
+
children: y?.label
|
|
927
|
+
}),
|
|
928
|
+
/* @__PURE__ */ V(i, { className: "size-3.5 shrink-0 text-fg-subtle" })
|
|
929
|
+
]
|
|
930
|
+
}), /* @__PURE__ */ V(N, {
|
|
931
|
+
placement: "bottom start",
|
|
932
|
+
offset: 6,
|
|
933
|
+
className: n("z-50 w-80 max-w-[calc(100vw-2rem)] origin-(--trigger-anchor-point) overflow-hidden rounded-surface border border-line-subtle bg-surface text-fg shadow-popover outline-none data-entering:animate-pop-in data-exiting:animate-pop-out", p && "dark"),
|
|
934
|
+
children: /* @__PURE__ */ V("div", {
|
|
935
|
+
onKeyDownCapture: (e) => {
|
|
936
|
+
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), f(!1));
|
|
937
|
+
},
|
|
938
|
+
children: c.length > 6 ? /* @__PURE__ */ H(_, {
|
|
939
|
+
filter: v,
|
|
940
|
+
children: [/* @__PURE__ */ V(P, {
|
|
941
|
+
"aria-label": $.search,
|
|
942
|
+
autoFocus: !0,
|
|
943
|
+
className: "border-b border-line-subtle",
|
|
944
|
+
children: /* @__PURE__ */ H("div", {
|
|
945
|
+
className: "flex items-center gap-2 px-3",
|
|
946
|
+
children: [/* @__PURE__ */ V(e, { className: "size-4 shrink-0 text-fg-subtle" }), /* @__PURE__ */ V(T, {
|
|
947
|
+
placeholder: $.search,
|
|
948
|
+
className: "h-control-md w-full min-w-0 bg-transparent type-body text-fg-emphasis outline-none placeholder:text-fg-subtle [&::-webkit-search-cancel-button]:hidden"
|
|
949
|
+
})]
|
|
950
|
+
})
|
|
951
|
+
}), /* @__PURE__ */ V("div", {
|
|
952
|
+
role: "region",
|
|
953
|
+
"aria-label": t,
|
|
954
|
+
tabIndex: 0,
|
|
955
|
+
className: "max-h-[min(24rem,60dvh)] overflow-y-auto outline-none focus-visible:focus-ring",
|
|
956
|
+
children: b
|
|
957
|
+
})]
|
|
958
|
+
}) : /* @__PURE__ */ V("div", {
|
|
959
|
+
className: "max-h-[min(24rem,60dvh)] overflow-y-auto",
|
|
960
|
+
children: b
|
|
961
|
+
})
|
|
962
|
+
})
|
|
963
|
+
})]
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
//#endregion
|
|
967
|
+
export { He as A, Qe as C, J as D, Ze as E, G as F, We as M, Ke as N, Ve as O, Ge as P, Je as S, Xe as T, ut as _, vt as a, Ye as b, ft as c, rt as d, tt as f, at as g, it as h, yt as i, Ue as j, qe as k, dt as l, st as m, wt as n, _t as o, ct as p, Ct as r, mt as s, Tt as t, ot as u, lt as v, $e as w, et as x, X as y };
|