@oomol-lab/open-flow 0.1.0-alpha.9 → 0.1.0-beta.2

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.
Files changed (58) hide show
  1. package/README.md +5 -1
  2. package/dist/browser/createResourceDialog-BkZns-oZ.js +504 -0
  3. package/dist/browser/diagnostics-giPSzyMo.js +9346 -0
  4. package/dist/browser/{dist-DhsGR_K3.js → dist-3Mj8q8Pr.js} +27 -27
  5. package/dist/browser/{dist-n9WmBm5w.js → dist-BKuSVKCC.js} +1 -1
  6. package/dist/browser/{dist-DQVavPcf.js → dist-BMqL-qR5.js} +469 -903
  7. package/dist/browser/{dist-D5mdziGP.js → dist-BN4ZCyOB.js} +9 -9
  8. package/dist/browser/{dist-CVtP-E2c.js → dist-BpopSHwP.js} +1 -1
  9. package/dist/browser/{dist-B0Q2Mn0n.js → dist-CJpzJrLM.js} +191 -191
  10. package/dist/browser/{dist-DXgEYMFx.js → dist-CPuF50D9.js} +196 -196
  11. package/dist/browser/{dist-CUkceEvN.js → dist-CUSrALSX.js} +113 -113
  12. package/dist/browser/dist-CeSZ2xSM.js +444 -0
  13. package/dist/browser/{dist-Bc9TvHYl.js → dist-DUzA0Ukh.js} +20 -20
  14. package/dist/browser/{dist-DWzdGVm9.js → dist-DWADUsVB.js} +74 -74
  15. package/dist/browser/{esm-YIGXG-Js.js → esm-B_PbUobB.js} +13 -13
  16. package/dist/browser/flow-authoring-node.d.ts +4 -2
  17. package/dist/browser/flow-authoring.d.ts +2 -1
  18. package/dist/browser/flow-authoring.js +400 -100
  19. package/dist/browser/flow-change.d.ts +9 -4
  20. package/dist/browser/flow-change.js +49 -46
  21. package/dist/browser/{flowRunInputEditorStore-DXOyyY7o.js → flowRunInputEditorStore-BeyUSWpO.js} +1644 -908
  22. package/dist/browser/{flowWorkspace-D7-rBA1-.js → flowWorkspace-DAMLVMcF.js} +18416 -16444
  23. package/dist/browser/getPseudoElementBounds-ESJExRFX.js +7642 -0
  24. package/dist/browser/languages-DgJehE1g.js +62 -0
  25. package/dist/browser/lib-C5Ipyfps.js +7856 -0
  26. package/dist/browser/licenses.md +119 -1
  27. package/dist/browser/main-DmjVyuWr.js +76 -0
  28. package/dist/browser/{markdownContent-ColGUxHy.js → markdownContent-DdlIRN3_.js} +4811 -4795
  29. package/dist/browser/theme.css +63 -0
  30. package/dist/browser/theme.css.d.ts +1 -0
  31. package/dist/browser/typeScriptSession-mPCiA9sV.js +2579 -0
  32. package/dist/browser/workbench-contract.d.ts +2 -1
  33. package/dist/browser/workbench.css +1 -1
  34. package/dist/browser/workbench.d.ts +46 -1
  35. package/dist/browser/workbench.js +1132 -1474
  36. package/dist/browser/workbenchSelect-B2s1HV-Y.js +1374 -0
  37. package/dist/common/connector-action.d.ts +6 -0
  38. package/dist/common/connector-action.js +37 -29
  39. package/dist/common/control-api-conformance.js +80 -29
  40. package/dist/common/control-api-errors.d.ts +24 -0
  41. package/dist/common/control-api.d.ts +54 -7
  42. package/dist/common/control-api.js +226 -95
  43. package/dist/common/flow-encoding.d.ts +2 -2
  44. package/dist/common/flow-encoding.js +4 -1
  45. package/dist/common/flow-semantics.d.ts +3 -0
  46. package/dist/common/flow-semantics.js +939 -851
  47. package/dist/common/integration-trigger.d.ts +1 -0
  48. package/dist/common/licenses.md +1 -25
  49. package/dist/common/localization.d.ts +21 -0
  50. package/dist/common/localization.js +62 -0
  51. package/dist/common/provider-triggers.js +4 -1
  52. package/dist/common/scheduler.d.ts +5 -5
  53. package/dist/common/scheduler.js +250 -236
  54. package/package.json +10 -1
  55. package/dist/browser/addNodeOptions-DRndy4EK.js +0 -6910
  56. package/dist/browser/createLucideIcon-CqjqCezK.js +0 -5537
  57. package/dist/browser/createResourceDialog-A64dDFCG.js +0 -467
  58. package/dist/browser/field-CKGQHCIi.js +0 -312
package/README.md CHANGED
@@ -11,8 +11,12 @@ bun add --dev @oomol-lab/open-flow
11
11
  Hosted products can use the controlled Workbench runtime:
12
12
 
13
13
  ```ts
14
- import { OpenFlowWorkbench } from '@oomol-lab/open-flow/workbench'
14
+ import { OpenFlowSessionGate, OpenFlowWorkbench } from '@oomol-lab/open-flow/workbench'
15
15
  import '@oomol-lab/open-flow/workbench.css'
16
16
  ```
17
17
 
18
+ Hosts can render `OpenFlowSessionGate` before authentication to keep login, retry, pending, and error states on the same shared shadcn composition as the Workbench.
19
+
20
+ Deployment chrome can import `@oomol-lab/open-flow/theme.css` and apply `open-flow-theme` plus `data-theme` to its root.
21
+
18
22
  The Open Flow command and hosted Workbench applications are distributed separately.
@@ -0,0 +1,504 @@
1
+ import { a as e } from "./main-DmjVyuWr.js";
2
+ import { B as t, Ct as n, F as r, Ft as i, It as a, Jn as o, Kn as s, L as c, Lt as l, M as u, Mt as d, Nn as f, Ot as p, P as m, Pn as h, Qn as g, R as _, Tt as v, Ut as y, V as b, Vn as x, W as S, Xn as C, Yn as w, Z as T, an as E, c as D, er as O, et as ee, fr as k, i as A, lr as j, lt as M, n as te, nn as N, nt as P, o as ne, p as F, qn as I, rr as L, vr as re, x as ie, z as ae, zt as oe } from "./getPseudoElementBounds-ESJExRFX.js";
3
+ import { t as se } from "./workbenchSelect-B2s1HV-Y.js";
4
+ import * as R from "react";
5
+ import { useEffect as ce, useRef as z, useState as le } from "react";
6
+ import { Fragment as ue, jsx as B, jsxs as V } from "react/jsx-runtime";
7
+ //#region ../../node_modules/.bun/lucide-react@0.468.0+f4eacebf2041cd4f/node_modules/lucide-react/dist/esm/icons/x.js
8
+ var H = i("X", [["path", {
9
+ d: "M18 6 6 18",
10
+ key: "1bl5f8"
11
+ }], ["path", {
12
+ d: "m6 6 12 12",
13
+ key: "d8bk6v"
14
+ }]]), U = /*#__PURE__*/ R.createContext(void 0);
15
+ process.env.NODE_ENV !== "production" && (U.displayName = "DialogRootContext");
16
+ function W(e) {
17
+ let t = R.useContext(U);
18
+ if (e === !1 && t === void 0) throw Error(process.env.NODE_ENV === "production" ? k(27) : "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");
19
+ return t;
20
+ }
21
+ //#endregion
22
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/backdrop/DialogBackdrop.js
23
+ var de = {
24
+ ...v,
25
+ ...E
26
+ }, G = /*#__PURE__*/ R.forwardRef(function(e, t) {
27
+ let { render: n, className: r, style: i, forceRender: a = !1, ...o } = e, { store: s } = W(), c = s.useState("open"), l = s.useState("nested"), u = s.useState("mounted"), d = {
28
+ open: c,
29
+ transitionStatus: s.useState("transitionStatus")
30
+ };
31
+ return L("div", e, {
32
+ state: d,
33
+ ref: [s.context.backdropRef, t],
34
+ stateAttributesMapping: de,
35
+ props: [{
36
+ role: "presentation",
37
+ hidden: !u,
38
+ style: {
39
+ userSelect: "none",
40
+ WebkitUserSelect: "none"
41
+ }
42
+ }, o],
43
+ enabled: a || !l
44
+ });
45
+ });
46
+ process.env.NODE_ENV !== "production" && (G.displayName = "DialogBackdrop");
47
+ //#endregion
48
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/close/DialogClose.js
49
+ var K = /*#__PURE__*/ R.forwardRef(function(e, t) {
50
+ let { render: n, className: r, disabled: i = !1, nativeButton: a = !0, style: o, ...s } = e, { store: c } = W(), u = c.useState("open");
51
+ function d(e) {
52
+ u && c.setOpen(!1, l(oe, e.nativeEvent));
53
+ }
54
+ let { getButtonProps: f, buttonRef: p } = j({
55
+ disabled: i,
56
+ native: a
57
+ });
58
+ return L("button", e, {
59
+ state: { disabled: i },
60
+ ref: [t, p],
61
+ props: [
62
+ { onClick: d },
63
+ s,
64
+ f
65
+ ]
66
+ });
67
+ });
68
+ process.env.NODE_ENV !== "production" && (K.displayName = "DialogClose");
69
+ //#endregion
70
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/popup/DialogPopupCssVars.js
71
+ var fe = /*#__PURE__*/ function(e) {
72
+ return e.nestedDialogs = "--nested-dialogs", e;
73
+ }({}), pe = function(e) {
74
+ return e[e.open = n.open] = "open", e[e.closed = n.closed] = "closed", e[e.startingStyle = n.startingStyle] = "startingStyle", e[e.endingStyle = n.endingStyle] = "endingStyle", e.nested = "data-nested", e.nestedDialogOpen = "data-nested-dialog-open", e;
75
+ }({}), q = /*#__PURE__*/ R.createContext(void 0);
76
+ process.env.NODE_ENV !== "production" && (q.displayName = "DialogPortalContext");
77
+ function me() {
78
+ let e = R.useContext(q);
79
+ if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? k(26) : "Base UI: <Dialog.Portal> is missing.");
80
+ return e;
81
+ }
82
+ //#endregion
83
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/popup/DialogPopup.js
84
+ var he = {
85
+ ...v,
86
+ ...E,
87
+ nestedDialogOpen(e) {
88
+ return e ? { [pe.nestedDialogOpen]: "" } : null;
89
+ }
90
+ }, J = /*#__PURE__*/ R.forwardRef(function(e, t) {
91
+ let { className: n, finalFocus: r, initialFocus: i, render: a, style: o, ...s } = e, { store: c } = W(), l = c.useState("descriptionElementId"), u = c.useState("disablePointerDismissal"), d = c.useState("floatingRootContext"), f = c.useState("popupProps"), p = c.useState("modal"), m = c.useState("mounted"), h = c.useState("nested"), g = c.useState("nestedOpenDialogCount"), _ = c.useState("open"), v = c.useState("openMethod"), y = c.useState("titleElementId"), b = c.useState("transitionStatus"), x = c.useState("role");
92
+ me(), N({
93
+ open: _,
94
+ ref: c.context.popupRef,
95
+ onComplete() {
96
+ _ && c.context.onOpenChangeComplete?.(!0);
97
+ }
98
+ });
99
+ function S(e) {
100
+ return e !== "touch" || c.context.popupRef.current;
101
+ }
102
+ let C = i === void 0 ? S : i, w = L("div", e, {
103
+ state: {
104
+ open: _,
105
+ nested: h,
106
+ transitionStatus: b,
107
+ nestedDialogOpen: g > 0
108
+ },
109
+ props: [
110
+ f,
111
+ {
112
+ "aria-labelledby": y ?? void 0,
113
+ "aria-describedby": l ?? void 0,
114
+ role: x,
115
+ tabIndex: -1,
116
+ hidden: !m,
117
+ onKeyDown(e) {
118
+ ie.has(e.key) && e.stopPropagation();
119
+ },
120
+ style: { [fe.nestedDialogs]: g }
121
+ },
122
+ s
123
+ ],
124
+ ref: [
125
+ t,
126
+ c.context.popupRef,
127
+ c.useStateSetter("popupElement")
128
+ ],
129
+ stateAttributesMapping: he
130
+ });
131
+ return /*#__PURE__*/ B(P, {
132
+ context: d,
133
+ openInteractionType: v,
134
+ disabled: !m,
135
+ closeOnFocusOut: !u,
136
+ initialFocus: C,
137
+ returnFocus: r,
138
+ modal: p !== !1,
139
+ restoreFocus: "popup",
140
+ children: w
141
+ });
142
+ });
143
+ process.env.NODE_ENV !== "production" && (J.displayName = "DialogPopup");
144
+ //#endregion
145
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/portal/DialogPortal.js
146
+ var Y = /*#__PURE__*/ R.forwardRef(function(e, t) {
147
+ let { keepMounted: n = !1, ...r } = e, { store: i } = W(), a = i.useState("mounted"), o = i.useState("modal"), s = i.useState("open");
148
+ return a || n ? /*#__PURE__*/ B(q.Provider, {
149
+ value: n,
150
+ children: /*#__PURE__*/ V(M, {
151
+ ref: t,
152
+ ...r,
153
+ children: [a && o === !0 && /*#__PURE__*/ B(D, {
154
+ ref: i.context.internalBackdropRef,
155
+ inert: F(!s)
156
+ }), e.children]
157
+ })
158
+ }) : null;
159
+ });
160
+ process.env.NODE_ENV !== "production" && (Y.displayName = "DialogPortal");
161
+ //#endregion
162
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/root/useDialogRoot.js
163
+ function ge(e) {
164
+ let { store: n, parentContext: i, actionsRef: a, isDrawer: o } = e, s = n.useState("open"), c = n.useState("disablePointerDismissal"), d = n.useState("modal"), p = n.useState("popupElement"), { openMethod: g, triggerProps: _ } = te(s);
165
+ t(n);
166
+ let { forceUnmount: v } = b(s, n), x = R.useCallback(() => {
167
+ n.setOpen(!1, l(y));
168
+ }, [n]);
169
+ R.useImperativeHandle(a, () => ({
170
+ unmount: v,
171
+ close: x
172
+ }), [v, x]);
173
+ let S = r({
174
+ popupStore: n,
175
+ onOpenChange: n.setOpen,
176
+ treatPopupAsFloatingElement: !0
177
+ }), [C, w] = R.useState(0), [T, E] = R.useState(0), D = C === 0, O = u(S), k = ee(S, {
178
+ outsidePressEvent() {
179
+ return n.context.internalBackdropRef.current || n.context.backdropRef.current ? "intentional" : {
180
+ mouse: d === "trap-focus" ? "sloppy" : "intentional",
181
+ touch: "sloppy"
182
+ };
183
+ },
184
+ outsidePress(e) {
185
+ if (!n.context.outsidePressEnabledRef.current || "button" in e && e.button !== 0 || "touches" in e && e.touches.length !== 1) return !1;
186
+ let t = h(e);
187
+ if (D && !c) {
188
+ let e = t;
189
+ return d && (n.context.internalBackdropRef.current || n.context.backdropRef.current) ? n.context.internalBackdropRef.current === e || n.context.backdropRef.current === e || f(e, p) && !e?.hasAttribute("data-base-ui-portal") : !0;
190
+ }
191
+ return !1;
192
+ },
193
+ escapeKey: D
194
+ });
195
+ ne(s && d === !0, p);
196
+ let { getReferenceProps: A, getFloatingProps: j, getTriggerProps: M } = m([O, k]);
197
+ n.useContextCallback("onNestedDialogOpen", (e, t) => {
198
+ w(e), E(t);
199
+ }), n.useContextCallback("onNestedDialogClose", () => {
200
+ w(0), E(0);
201
+ }), R.useEffect(() => (i?.onNestedDialogOpen && s && i.onNestedDialogOpen(C + 1, T + +!!o), i?.onNestedDialogClose && !s && i.onNestedDialogClose(), () => {
202
+ i?.onNestedDialogClose && s && i.onNestedDialogClose();
203
+ }), [
204
+ o,
205
+ s,
206
+ C,
207
+ T,
208
+ i
209
+ ]);
210
+ let N = R.useMemo(() => A(_), [A, _]), P = R.useMemo(() => M(_), [M, _]), F = R.useMemo(() => j(), [j]);
211
+ n.useSyncedValues({
212
+ openMethod: g,
213
+ activeTriggerProps: N,
214
+ inactiveTriggerProps: P,
215
+ popupProps: F,
216
+ floatingRootContext: S,
217
+ nestedOpenDialogCount: C,
218
+ nestedOpenDrawerCount: T
219
+ });
220
+ }
221
+ //#endregion
222
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/store/DialogStore.js
223
+ var _e = {
224
+ ..._,
225
+ modal: T((e) => e.modal),
226
+ nested: T((e) => e.nested),
227
+ nestedOpenDialogCount: T((e) => e.nestedOpenDialogCount),
228
+ nestedOpenDrawerCount: T((e) => e.nestedOpenDrawerCount),
229
+ disablePointerDismissal: T((e) => e.disablePointerDismissal),
230
+ openMethod: T((e) => e.openMethod),
231
+ descriptionElementId: T((e) => e.descriptionElementId),
232
+ titleElementId: T((e) => e.titleElementId),
233
+ viewportElement: T((e) => e.viewportElement),
234
+ role: T((e) => e.role)
235
+ }, ve = class e extends S {
236
+ constructor(e) {
237
+ super(ye(e), {
238
+ popupRef: /*#__PURE__*/ R.createRef(),
239
+ backdropRef: /*#__PURE__*/ R.createRef(),
240
+ internalBackdropRef: /*#__PURE__*/ R.createRef(),
241
+ outsidePressEnabledRef: { current: !0 },
242
+ triggerElements: new ae(),
243
+ onOpenChange: void 0,
244
+ onOpenChangeComplete: void 0
245
+ }, _e);
246
+ }
247
+ setOpen = (e, t) => {
248
+ if (t.preventUnmountOnClose = () => {
249
+ this.set("preventUnmountingOnClose", !0);
250
+ }, !e && t.trigger == null && this.state.activeTriggerId != null && (t.trigger = this.state.activeTriggerElement ?? void 0), this.context.onOpenChange?.(e, t), t.isCanceled) return;
251
+ this.state.floatingRootContext.dispatchOpenChange(e, t);
252
+ let n = { open: e }, r = t.trigger?.id ?? null;
253
+ (r || e) && (n.activeTriggerId = r, n.activeTriggerElement = t.trigger ?? null), this.update(n);
254
+ };
255
+ static useStore(t, n) {
256
+ let r = re(() => new e(n)).current;
257
+ return t ?? r;
258
+ }
259
+ };
260
+ function ye(e = {}) {
261
+ return {
262
+ ...c(),
263
+ modal: !0,
264
+ disablePointerDismissal: !1,
265
+ popupElement: null,
266
+ viewportElement: null,
267
+ descriptionElementId: void 0,
268
+ titleElementId: void 0,
269
+ openMethod: null,
270
+ nested: !1,
271
+ nestedOpenDialogCount: 0,
272
+ nestedOpenDrawerCount: 0,
273
+ role: "dialog",
274
+ ...e
275
+ };
276
+ }
277
+ //#endregion
278
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/root/DialogRoot.js
279
+ var X = /*#__PURE__*/ R.createContext(!1);
280
+ process.env.NODE_ENV !== "production" && (X.displayName = "IsDrawerContext");
281
+ function be(e) {
282
+ let { children: t, open: n, defaultOpen: r = !1, onOpenChange: i, onOpenChangeComplete: a, disablePointerDismissal: o = !1, modal: s = !0, actionsRef: c, handle: l, triggerId: u, defaultTriggerId: d = null } = e, f = W(!0), p = R.useContext(X), m = !!f, h = ve.useStore(l?.store, {
283
+ open: r,
284
+ openProp: n,
285
+ activeTriggerId: d,
286
+ triggerIdProp: u,
287
+ modal: s,
288
+ disablePointerDismissal: o,
289
+ nested: m
290
+ });
291
+ A(() => {
292
+ n === void 0 && h.state.open === !1 && r === !0 && h.update({
293
+ open: !0,
294
+ activeTriggerId: d
295
+ });
296
+ }), h.useControlledProp("openProp", n), h.useControlledProp("triggerIdProp", u), h.useSyncedValues({
297
+ disablePointerDismissal: o,
298
+ nested: m,
299
+ modal: s
300
+ }), h.useContextCallback("onOpenChange", i), h.useContextCallback("onOpenChangeComplete", a);
301
+ let g = h.useState("payload");
302
+ ge({
303
+ store: h,
304
+ actionsRef: c,
305
+ parentContext: f?.store.context,
306
+ isDrawer: p,
307
+ onOpenChange: i,
308
+ triggerIdProp: u
309
+ });
310
+ let _ = R.useMemo(() => ({ store: h }), [h]);
311
+ return /*#__PURE__*/ B(X.Provider, {
312
+ value: !1,
313
+ children: /*#__PURE__*/ B(U.Provider, {
314
+ value: _,
315
+ children: typeof t == "function" ? t({ payload: g }) : t
316
+ })
317
+ });
318
+ }
319
+ //#endregion
320
+ //#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/dialog/title/DialogTitle.js
321
+ var Z = /*#__PURE__*/ R.forwardRef(function(e, t) {
322
+ let { render: n, className: r, style: i, id: a, ...o } = e, { store: s } = W(), c = x(a);
323
+ return s.useSyncedValueWithCleanup("titleElementId", c), L("h2", e, {
324
+ ref: t,
325
+ props: [{ id: c }, o]
326
+ });
327
+ });
328
+ process.env.NODE_ENV !== "production" && (Z.displayName = "DialogTitle");
329
+ //#endregion
330
+ //#region src/ui/browser/dialog.tsx
331
+ function xe(e) {
332
+ return /* @__PURE__ */ B(be, {
333
+ "data-slot": "dialog",
334
+ ...e
335
+ });
336
+ }
337
+ function Se(e) {
338
+ return /* @__PURE__ */ B(Y, {
339
+ "data-slot": "dialog-portal",
340
+ ...e
341
+ });
342
+ }
343
+ function Q(e) {
344
+ return /* @__PURE__ */ B(K, {
345
+ "data-slot": "dialog-close",
346
+ ...e
347
+ });
348
+ }
349
+ function Ce({ className: e, ...t }) {
350
+ return /* @__PURE__ */ B(G, {
351
+ "data-slot": "dialog-overlay",
352
+ className: O("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:animate-none motion-reduce:transition-none", e),
353
+ ...t
354
+ });
355
+ }
356
+ function $({ children: e, className: t, closeLabel: n = "Close", container: r, showCloseButton: i = !0, ...a }) {
357
+ return /* @__PURE__ */ V(Se, {
358
+ container: r,
359
+ children: [/* @__PURE__ */ B(Ce, {}), /* @__PURE__ */ V(J, {
360
+ "data-slot": "dialog-content",
361
+ className: O("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none motion-reduce:transition-none", t),
362
+ ...a,
363
+ children: [e, i && /* @__PURE__ */ V(K, {
364
+ "data-slot": "dialog-close",
365
+ render: /* @__PURE__ */ B(g, {
366
+ className: "absolute top-2 right-2",
367
+ size: "icon-sm",
368
+ variant: "ghost"
369
+ }),
370
+ children: [/* @__PURE__ */ B(H, {}), /* @__PURE__ */ B("span", {
371
+ className: "sr-only",
372
+ children: n
373
+ })]
374
+ })]
375
+ })]
376
+ });
377
+ }
378
+ function we({ className: e, ...t }) {
379
+ return /* @__PURE__ */ B("div", {
380
+ "data-slot": "dialog-header",
381
+ className: O("flex flex-col gap-2", e),
382
+ ...t
383
+ });
384
+ }
385
+ function Te({ className: e, ...t }) {
386
+ return /* @__PURE__ */ B("div", {
387
+ "data-slot": "dialog-footer",
388
+ className: O("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t border-border bg-muted/50 p-4 sm:flex-row sm:justify-end", e),
389
+ ...t
390
+ });
391
+ }
392
+ function Ee({ className: e, ...t }) {
393
+ return /* @__PURE__ */ B(Z, {
394
+ "data-slot": "dialog-title",
395
+ className: O("text-base leading-none font-medium", e),
396
+ ...t
397
+ });
398
+ }
399
+ //#endregion
400
+ //#region src/workbench/browser/runtime/shell/createResourceDialog.tsx
401
+ function De({ disabled: t, field: n, id: r, issue: i, label: c, name: l, onNameChange: u, onOpenChange: f, onSubmit: m, pending: h, title: _ }) {
402
+ let v = e(), y = z(null), b = z(null), [x, S] = le(!1), T = l.length > 0 && i != null, E = v(T ? `resource.nameIssue.${i}` : "resource.nameHint", { max: 80 }), D = `${r}-message`, O = `${r}-option`;
403
+ return ce(() => S(!0), []), /* @__PURE__ */ V(ue, { children: [/* @__PURE__ */ B("div", { ref: b }), /* @__PURE__ */ B(xe, {
404
+ onOpenChange: S,
405
+ onOpenChangeComplete: (e) => {
406
+ e || f(!1);
407
+ },
408
+ open: x,
409
+ children: /* @__PURE__ */ B($, {
410
+ container: b.current,
411
+ initialFocus: () => y.current,
412
+ showCloseButton: !1,
413
+ children: /* @__PURE__ */ V("form", {
414
+ className: "flex flex-col gap-4",
415
+ onSubmit: m,
416
+ children: [
417
+ /* @__PURE__ */ V(we, {
418
+ className: "flex-row items-center justify-between",
419
+ children: [/* @__PURE__ */ B(Ee, { children: _ }), /* @__PURE__ */ B(Q, {
420
+ "aria-label": v("common.cancel"),
421
+ render: /* @__PURE__ */ B(g, {
422
+ size: "icon-sm",
423
+ variant: "ghost"
424
+ }),
425
+ type: "button",
426
+ children: /* @__PURE__ */ B(p, { name: "close" })
427
+ })]
428
+ }),
429
+ /* @__PURE__ */ V(w, {
430
+ className: "gap-4",
431
+ children: [/* @__PURE__ */ V(s, {
432
+ "data-invalid": T,
433
+ children: [
434
+ /* @__PURE__ */ B(C, {
435
+ htmlFor: r,
436
+ children: c
437
+ }),
438
+ /* @__PURE__ */ B(a, {
439
+ autoComplete: "off",
440
+ "aria-describedby": D,
441
+ "aria-invalid": T,
442
+ id: r,
443
+ name: "resource-name",
444
+ onChange: (e) => u(e.target.value),
445
+ ref: y,
446
+ required: !0,
447
+ value: l
448
+ }),
449
+ B(T ? o : I, {
450
+ id: D,
451
+ children: E
452
+ })
453
+ ]
454
+ }), n != null && /* @__PURE__ */ V(s, { children: [
455
+ /* @__PURE__ */ B(C, {
456
+ htmlFor: n.state == "ready" ? O : void 0,
457
+ children: n.label
458
+ }),
459
+ n.state == "ready" ? /* @__PURE__ */ B(se, {
460
+ ariaLabel: n.ariaLabel,
461
+ className: "w-full",
462
+ id: O,
463
+ onValueChange: n.onValueChange,
464
+ options: n.options,
465
+ portalRoot: b.current,
466
+ value: n.value
467
+ }) : /* @__PURE__ */ V("div", {
468
+ className: "flex min-h-9 items-center gap-2 rounded-lg border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",
469
+ role: n.state == "error" ? "alert" : "status",
470
+ children: [
471
+ n.state == "loading" && /* @__PURE__ */ B(d, { "aria-hidden": "true" }),
472
+ /* @__PURE__ */ B("span", { children: n.status }),
473
+ n.state == "error" && /* @__PURE__ */ B(g, {
474
+ className: "ml-auto bg-background",
475
+ onClick: n.onRetry,
476
+ size: "sm",
477
+ type: "button",
478
+ variant: "outline",
479
+ children: n.retry
480
+ })
481
+ ]
482
+ }),
483
+ /* @__PURE__ */ B(I, { children: n.description })
484
+ ] })]
485
+ }),
486
+ /* @__PURE__ */ V(Te, {
487
+ className: "mx-0 mb-0 border-0 bg-transparent p-0 pt-1",
488
+ children: [/* @__PURE__ */ B(Q, {
489
+ render: /* @__PURE__ */ B(g, { variant: "outline" }),
490
+ type: "button",
491
+ children: v("common.cancel")
492
+ }), /* @__PURE__ */ B(g, {
493
+ disabled: t || h || i != null,
494
+ type: "submit",
495
+ children: v(h ? "common.creating" : "common.create")
496
+ })]
497
+ })
498
+ ]
499
+ })
500
+ })
501
+ })] });
502
+ }
503
+ //#endregion
504
+ export { De as default };