@knpkv/rly 0.4.0 → 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.
Files changed (36) hide show
  1. package/README.md +31 -2
  2. package/dist/Dialog-DSwimdwG.js +955 -0
  3. package/dist/Dialog-DSwimdwG.js.map +1 -0
  4. package/dist/{PortalProvider-BpgZwSpw.js → PortalProvider-CN_81Fy3.js} +2 -2
  5. package/dist/{PortalProvider-BpgZwSpw.js.map → PortalProvider-CN_81Fy3.js.map} +1 -1
  6. package/dist/assets/worker-D8fZ3h-U.js.map +1 -1
  7. package/dist/components.css +1 -1
  8. package/dist/diff/bounded/index.js +6 -6
  9. package/dist/diff/bounded/index.js.map +1 -1
  10. package/dist/diff/index.js +479 -467
  11. package/dist/diff/index.js.map +1 -1
  12. package/dist/dts/foundations/PortalProvider.d.ts +1 -0
  13. package/dist/dts/foundations/PortalProvider.d.ts.map +1 -1
  14. package/dist/dts/internal/modal.d.ts +4 -0
  15. package/dist/dts/internal/modal.d.ts.map +1 -1
  16. package/dist/dts/patterns/RelayDock.d.ts +75 -0
  17. package/dist/dts/patterns/RelayDock.d.ts.map +1 -0
  18. package/dist/dts/patterns/index.d.ts +2 -0
  19. package/dist/dts/patterns/index.d.ts.map +1 -1
  20. package/dist/foundations/index.js +2 -2
  21. package/dist/index.js +6 -6
  22. package/dist/patterns/index.js +2 -2
  23. package/dist/patterns-DB9mAzxZ.js +3138 -0
  24. package/dist/patterns-DB9mAzxZ.js.map +1 -0
  25. package/dist/primitives/index.js +3 -3
  26. package/dist/primitives-DYGtIZqB.js +342 -0
  27. package/dist/primitives-DYGtIZqB.js.map +1 -0
  28. package/package.json +1 -1
  29. package/registry/components.json +111 -0
  30. package/registry/search.json +36 -0
  31. package/dist/Dialog-1WvU8GjA.js +0 -715
  32. package/dist/Dialog-1WvU8GjA.js.map +0 -1
  33. package/dist/patterns-CxMz8DKX.js +0 -2792
  34. package/dist/patterns-CxMz8DKX.js.map +0 -1
  35. package/dist/primitives-CW89TsFB.js +0 -543
  36. package/dist/primitives-CW89TsFB.js.map +0 -1
@@ -1,715 +0,0 @@
1
- import { r as e, t } from "./PortalProvider-BpgZwSpw.js";
2
- import { a as n, i as r, l as i, n as a, o, r as s, s as c, t as l } from "./component-DKy8kjZl.js";
3
- import { Avatar as u, Dialog as d } from "radix-ui";
4
- import { createContext as f, createElement as p, useCallback as m, useContext as h, useLayoutEffect as g, useRef as _, useState as v } from "react";
5
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
6
- //#region src/internal/modal.ts
7
- var x = /* @__PURE__ */ new WeakMap(), S = f(null), C = 0, w = (e, t) => {
8
- let n = _({
9
- open: e,
10
- value: t
11
- }), r = e && !n.current.open ? t : n.current.value;
12
- return g(() => {
13
- e ? n.current.open || (n.current = {
14
- open: !0,
15
- value: t
16
- }) : n.current = {
17
- open: !1,
18
- value: t
19
- };
20
- }, [e, t]), r;
21
- }, T = (e) => e !== null && "inert" in e && n(e.inert), E = ({ children: e }) => {
22
- let [t, n] = v(!1);
23
- return p(S.Provider, { value: {
24
- isContentMounted: t,
25
- setContentMounted: n
26
- } }, e);
27
- }, D = () => h(S)?.isContentMounted ?? !0, O = () => {
28
- let e = h(S)?.setContentMounted;
29
- g(() => (e?.(!0), () => e?.(!1)), [e]);
30
- }, k = (e) => {
31
- let t = x.get(e);
32
- if (t === void 0) {
33
- x.set(e, {
34
- count: 1,
35
- previous: e.inert
36
- }), e.inert = !0;
37
- return;
38
- }
39
- t.count += 1;
40
- }, ee = (e) => {
41
- let t = x.get(e);
42
- if (t !== void 0) {
43
- if (t.count > 1) {
44
- --t.count;
45
- return;
46
- }
47
- e.inert = t.previous, x.delete(e);
48
- }
49
- }, A = (e, t) => {
50
- g(() => {
51
- if (!t) return;
52
- let n = e.current;
53
- if (n === null) return;
54
- let r = n, i = [];
55
- for (; r !== r.ownerDocument.body;) {
56
- let e = r.parentElement;
57
- if (e === null) break;
58
- let t = !1;
59
- for (let n of e.children) {
60
- if (n === r) {
61
- t = !0;
62
- continue;
63
- }
64
- !(t && n.hasAttribute("data-rly-modal-layer")) && T(n) && (k(n), i.push(n));
65
- }
66
- r = e;
67
- }
68
- return () => {
69
- for (let e of i) ee(e);
70
- };
71
- }, [t, e]);
72
- }, j = () => {
73
- C += 1;
74
- }, M = (e) => {
75
- let t = ++C;
76
- setTimeout(() => {
77
- C === t && e?.isConnected && e.focus();
78
- }, 0);
79
- }, te = {
80
- layer: "rly_Sheet-module__layer",
81
- trigger: "rly_Sheet-module__trigger",
82
- close: "rly_Sheet-module__close",
83
- iconClose: "rly_Sheet-module__iconClose",
84
- overlay: "rly_Sheet-module__overlay",
85
- "rly-sheet-overlay-out": "rly_Sheet-module__rly-sheet-overlay-out",
86
- "rly-sheet-overlay-in": "rly_Sheet-module__rly-sheet-overlay-in",
87
- content: "rly_Sheet-module__content",
88
- end: "rly_Sheet-module__end",
89
- "rly-sheet-end-out": "rly_Sheet-module__rly-sheet-end-out",
90
- "rly-sheet-end-in": "rly_Sheet-module__rly-sheet-end-in",
91
- start: "rly_Sheet-module__start",
92
- "rly-sheet-start-out": "rly_Sheet-module__rly-sheet-start-out",
93
- "rly-sheet-start-in": "rly_Sheet-module__rly-sheet-start-in",
94
- header: "rly_Sheet-module__header",
95
- heading: "rly_Sheet-module__heading",
96
- title: "rly_Sheet-module__title",
97
- description: "rly_Sheet-module__description",
98
- body: "rly_Sheet-module__body",
99
- footer: "rly_Sheet-module__footer"
100
- }, N = (e) => a(te, e), P = s({ side: {
101
- end: {
102
- className: N("end"),
103
- purpose: "Supporting detail that follows the current reading flow",
104
- tokens: [
105
- "color-surface-1",
106
- "radius-overlay",
107
- "motion-standard"
108
- ]
109
- },
110
- start: {
111
- className: N("start"),
112
- purpose: "Navigation or context that precedes the current reading flow",
113
- tokens: [
114
- "color-surface-1",
115
- "radius-overlay",
116
- "motion-standard"
117
- ]
118
- }
119
- } }), F = s({ side: "end" }), I = f(null), L = () => {
120
- let e = h(I);
121
- if (e === null) throw Error("Sheet compound components must be nested inside Sheet.Root");
122
- return e;
123
- }, ne = ({ children: e, entryMotion: t }) => {
124
- let n = L(), r = _(null);
125
- return O(), A(r, n.open), /* @__PURE__ */ y("div", {
126
- className: N("layer"),
127
- "data-rly-modal-layer": "",
128
- "data-rly-sheet-entry-motion": t,
129
- "data-rly-sheet-layer": "",
130
- ref: r,
131
- children: e
132
- });
133
- }, R = (e, t) => (i(e) && r(e, `${t} children`), e), re = Object.freeze({
134
- Body: ({ className: e, ...t }) => /* @__PURE__ */ y("div", {
135
- ...t,
136
- className: l(N("body"), e)
137
- }),
138
- Close: ({ children: e, className: t, type: n, ...r }) => /* @__PURE__ */ y(d.Close, {
139
- ...r,
140
- className: l(N("close"), t),
141
- type: n ?? "button",
142
- children: R(e, "Sheet.Close")
143
- }),
144
- Content: ({ children: n, className: i, closeLabel: a, description: s, entryMotion: c = "intrinsic", initialFocusRef: u, ref: f, side: p = F.side, tabIndex: h, title: g, ...v }) => {
145
- let x = L(), S = w(x.open, c), C = r(g, "Sheet title"), E = s === void 0 ? void 0 : r(s, "Sheet description"), D = r(a ?? `Close ${C}`, "Sheet closeLabel"), O = _(null), k = m((e) => {
146
- O.current = e, o(f) ? f(e) : f != null && (f.current = e);
147
- }, [f]);
148
- return /* @__PURE__ */ y(t, { children: (t) => /* @__PURE__ */ y(d.Portal, {
149
- container: t,
150
- children: /* @__PURE__ */ b(ne, {
151
- entryMotion: S,
152
- children: [/* @__PURE__ */ y(d.Overlay, {
153
- className: N("overlay"),
154
- "data-rly-sheet-overlay": "",
155
- onPointerDown: () => x.requestOpenChange(!1)
156
- }), /* @__PURE__ */ b(d.Content, {
157
- ...v,
158
- ...E === void 0 ? { "aria-describedby": void 0 } : {},
159
- className: l(N("content"), P.side[p].className, i),
160
- "data-rly-sheet-side": p,
161
- onCloseAutoFocus: (e) => e.preventDefault(),
162
- onOpenAutoFocus: (e) => {
163
- e.preventDefault();
164
- let t = O.current?.ownerDocument.activeElement ?? null;
165
- x.restoreFocusRef.current === null && T(t) && (x.restoreFocusRef.current = t);
166
- let n = u?.current ?? O.current;
167
- n?.focus(), n !== O.current && n?.ownerDocument.activeElement !== n && O.current?.focus();
168
- },
169
- ref: k,
170
- tabIndex: h ?? -1,
171
- children: [/* @__PURE__ */ b("div", {
172
- className: N("header"),
173
- children: [/* @__PURE__ */ b("div", {
174
- className: N("heading"),
175
- children: [/* @__PURE__ */ y(d.Title, {
176
- className: N("title"),
177
- children: C
178
- }), E === void 0 ? null : /* @__PURE__ */ y(d.Description, {
179
- className: N("description"),
180
- children: E
181
- })]
182
- }), /* @__PURE__ */ y(d.Close, {
183
- "aria-label": D,
184
- className: N("iconClose"),
185
- type: "button",
186
- children: /* @__PURE__ */ y(e, {
187
- decorative: !0,
188
- name: "close",
189
- size: "default"
190
- })
191
- })]
192
- }), n]
193
- })]
194
- })
195
- }) });
196
- },
197
- Footer: ({ className: e, ...t }) => /* @__PURE__ */ y("footer", {
198
- ...t,
199
- className: l(N("footer"), e)
200
- }),
201
- Root: (e) => {
202
- let { children: t, defaultOpen: n = !1, onOpenChange: r, open: i } = e, [a, o] = v(n), s = D(), c = _(null), l = (i ?? a) && s, u = _(l), f = (e) => {
203
- i === void 0 && o(e), r?.(e);
204
- };
205
- return g(() => {
206
- u.current !== l && (u.current = l, l ? j() : M(c.current));
207
- }, [l]), /* @__PURE__ */ y(E, { children: /* @__PURE__ */ y(I.Provider, {
208
- value: {
209
- open: l,
210
- requestOpenChange: f,
211
- restoreFocusRef: c
212
- },
213
- children: /* @__PURE__ */ y(d.Root, {
214
- modal: !0,
215
- onOpenChange: f,
216
- open: l,
217
- children: t
218
- })
219
- }) });
220
- },
221
- Trigger: ({ children: e, className: t, onClick: n, type: r, ...i }) => {
222
- let a = L();
223
- return /* @__PURE__ */ y(d.Trigger, {
224
- ...i,
225
- className: l(N("trigger"), t),
226
- onClick: (e) => {
227
- a.restoreFocusRef.current = e.currentTarget, n?.(e);
228
- },
229
- type: r ?? "button",
230
- children: R(e, "Sheet.Trigger")
231
- });
232
- }
233
- }), ie = {
234
- root: "rly_Button-module__root",
235
- primary: "rly_Button-module__primary",
236
- secondary: "rly_Button-module__secondary",
237
- quiet: "rly_Button-module__quiet",
238
- compact: "rly_Button-module__compact",
239
- defaultSize: "rly_Button-module__defaultSize",
240
- principal: "rly_Button-module__principal",
241
- stretch: "rly_Button-module__stretch",
242
- content: "rly_Button-module__content",
243
- label: "rly_Button-module__label",
244
- loadingContent: "rly_Button-module__loadingContent",
245
- loader: "rly_Button-module__loader"
246
- }, z = (e) => a(ie, e), B = s({
247
- variant: {
248
- primary: {
249
- className: z("primary"),
250
- purpose: "Single principal action",
251
- tokens: ["color-action-background", "color-action-foreground"]
252
- },
253
- secondary: {
254
- className: z("secondary"),
255
- purpose: "Default supporting action",
256
- tokens: ["color-surface-1", "color-border-2"]
257
- },
258
- quiet: {
259
- className: z("quiet"),
260
- purpose: "Low-emphasis contextual action",
261
- tokens: ["color-text-1", "color-surface-2"]
262
- }
263
- },
264
- size: {
265
- compact: {
266
- className: z("compact"),
267
- purpose: "Dense text action",
268
- tokens: ["space-40"]
269
- },
270
- default: {
271
- className: z("defaultSize"),
272
- purpose: "Standard action",
273
- tokens: ["space-48"]
274
- },
275
- principal: {
276
- className: z("principal"),
277
- purpose: "Prominent consequential action",
278
- tokens: ["space-48", "space-8"]
279
- }
280
- }
281
- }), ae = s({
282
- variant: "secondary",
283
- size: "default"
284
- }), V = ({ "aria-label": t, "aria-labelledby": n, children: r, className: a, disabled: o, leadingIcon: s, loading: u = !1, size: d = "default", stretch: f = !1, trailingIcon: p, type: m, variant: h = "secondary", ...g }) => {
285
- if (!c(r) && !i(r) || i(r) && r.trim().length === 0) throw Error("Button children must contain visible content");
286
- return /* @__PURE__ */ b("button", {
287
- ...g,
288
- "aria-busy": u ? "true" : void 0,
289
- "aria-label": u && !n?.trim() ? t?.trim() ? t : String(r) : t,
290
- "aria-labelledby": n,
291
- className: l(z("root"), B.variant[h].className, B.size[d].className, f && z("stretch"), a),
292
- "data-loading": u ? "true" : void 0,
293
- disabled: o || u,
294
- type: m ?? "button",
295
- children: [/* @__PURE__ */ b("span", {
296
- className: l(z("content"), u && z("loadingContent")),
297
- children: [
298
- s === void 0 ? null : /* @__PURE__ */ y(e, {
299
- decorative: !0,
300
- name: s,
301
- size: d === "compact" ? "small" : "default"
302
- }),
303
- /* @__PURE__ */ y("span", {
304
- className: z("label"),
305
- children: r
306
- }),
307
- p === void 0 ? null : /* @__PURE__ */ y(e, {
308
- decorative: !0,
309
- name: p,
310
- size: d === "compact" ? "small" : "default"
311
- })
312
- ]
313
- }), u ? /* @__PURE__ */ y("span", {
314
- "aria-hidden": "true",
315
- className: z("loader"),
316
- children: /* @__PURE__ */ y(e, {
317
- decorative: !0,
318
- name: "loader",
319
- size: d === "compact" ? "small" : "default"
320
- })
321
- }) : null]
322
- });
323
- }, oe = {
324
- root: "rly_StateLabel-module__root",
325
- neutral: "rly_StateLabel-module__neutral",
326
- positive: "rly_StateLabel-module__positive",
327
- critical: "rly_StateLabel-module__critical",
328
- caution: "rly_StateLabel-module__caution",
329
- progress: "rly_StateLabel-module__progress",
330
- compact: "rly_StateLabel-module__compact",
331
- defaultSize: "rly_StateLabel-module__defaultSize"
332
- }, H = (e) => a(oe, e), U = s({
333
- tone: {
334
- neutral: {
335
- className: H("neutral"),
336
- purpose: "Neutral or unavailable state",
337
- tokens: ["color-text-2", "color-surface-2"]
338
- },
339
- positive: {
340
- className: H("positive"),
341
- purpose: "Positive state",
342
- tokens: ["color-success-ink", "color-success-tint"]
343
- },
344
- critical: {
345
- className: H("critical"),
346
- purpose: "Critical state",
347
- tokens: ["color-blocked-ink", "color-blocked-tint"]
348
- },
349
- caution: {
350
- className: H("caution"),
351
- purpose: "Caution state",
352
- tokens: ["color-held-ink", "color-held-tint"]
353
- },
354
- progress: {
355
- className: H("progress"),
356
- purpose: "Work in progress",
357
- tokens: ["color-deploying-ink", "color-deploying-tint"]
358
- }
359
- },
360
- size: {
361
- compact: {
362
- className: H("compact"),
363
- purpose: "Dense metadata state",
364
- tokens: ["type-meta"]
365
- },
366
- default: {
367
- className: H("defaultSize"),
368
- purpose: "Standard explicit state",
369
- tokens: ["type-label"]
370
- }
371
- }
372
- }), se = s({
373
- tone: "neutral",
374
- size: "default"
375
- }), ce = {
376
- neutral: "minus",
377
- positive: "check",
378
- critical: "alert",
379
- caution: "clock",
380
- progress: "loader"
381
- }, le = ({ className: t, icon: n, label: i, size: a = "default", tone: o = "neutral", ...s }) => /* @__PURE__ */ b("span", {
382
- ...s,
383
- className: l(H("root"), U.tone[o].className, U.size[a].className, t),
384
- children: [/* @__PURE__ */ y(e, {
385
- decorative: !0,
386
- name: n ?? ce[o],
387
- size: "small"
388
- }), /* @__PURE__ */ y("span", { children: r(i, "StateLabel label") })]
389
- }), ue = {
390
- root: "rly_Avatar-module__root",
391
- small: "rly_Avatar-module__small",
392
- defaultSize: "rly_Avatar-module__defaultSize",
393
- large: "rly_Avatar-module__large",
394
- hero: "rly_Avatar-module__hero",
395
- circle: "rly_Avatar-module__circle",
396
- roundedSquare: "rly_Avatar-module__roundedSquare",
397
- image: "rly_Avatar-module__image",
398
- fallback: "rly_Avatar-module__fallback"
399
- }, W = (e) => a(ue, e), G = s({
400
- size: {
401
- small: {
402
- className: W("small"),
403
- purpose: "Compact supporting identity",
404
- tokens: ["space-24"]
405
- },
406
- default: {
407
- className: W("defaultSize"),
408
- purpose: "Standard identity",
409
- tokens: ["space-32"]
410
- },
411
- large: {
412
- className: W("large"),
413
- purpose: "Prominent identity",
414
- tokens: ["space-40"]
415
- },
416
- hero: {
417
- className: W("hero"),
418
- purpose: "Page-level identity",
419
- tokens: ["space-48", "space-8"]
420
- }
421
- },
422
- form: {
423
- circle: {
424
- className: W("circle"),
425
- purpose: "Human or general identity",
426
- tokens: ["radius-round"]
427
- },
428
- "rounded-square": {
429
- className: W("roundedSquare"),
430
- purpose: "Non-human or system identity",
431
- tokens: ["radius-field"]
432
- }
433
- }
434
- }), de = s({
435
- size: "default",
436
- form: "circle"
437
- }), fe = ({ className: e, decorative: t, fallback: n, form: i = "circle", label: a, size: o = "default", src: s, ...c }) => {
438
- let d = t ? void 0 : r(a, "Avatar label"), f = r(n, "Avatar fallback");
439
- return /* @__PURE__ */ b(u.Root, {
440
- ...c,
441
- "aria-hidden": t ? "true" : void 0,
442
- "aria-label": d,
443
- className: l(W("root"), G.size[o].className, G.form[i].className, e),
444
- role: t ? void 0 : "img",
445
- children: [s === void 0 ? null : /* @__PURE__ */ y(u.Image, {
446
- alt: "",
447
- className: W("image"),
448
- decoding: "async",
449
- loading: "lazy",
450
- src: s
451
- }), /* @__PURE__ */ y(u.Fallback, {
452
- "aria-hidden": "true",
453
- className: W("fallback"),
454
- children: f
455
- })]
456
- });
457
- }, pe = {
458
- root: "rly_Skeleton-module__root",
459
- text: "rly_Skeleton-module__text",
460
- block: "rly_Skeleton-module__block",
461
- circle: "rly_Skeleton-module__circle"
462
- }, K = (e) => a(pe, e), q = s({ variant: {
463
- text: {
464
- className: K("text"),
465
- purpose: "A line of unavailable copy",
466
- tokens: ["type-body", "radius-tag"]
467
- },
468
- block: {
469
- className: K("block"),
470
- purpose: "A rectangular unavailable region",
471
- tokens: ["space-64", "radius-control"]
472
- },
473
- circle: {
474
- className: K("circle"),
475
- purpose: "A circular unavailable image",
476
- tokens: ["radius-round"]
477
- }
478
- } }), me = s({ variant: "text" }), he = ({ className: e, decorative: t = !0, height: n, label: i, style: a, variant: o = "text", width: s, ...c }) => {
479
- if (!t && i === void 0) throw Error("Skeleton label must contain visible text");
480
- let u = t || i === void 0 ? void 0 : r(i, "Skeleton label"), d = {
481
- ...n !== void 0 && { blockSize: n },
482
- ...s !== void 0 && { inlineSize: s }
483
- };
484
- return /* @__PURE__ */ y("div", {
485
- ...c,
486
- "aria-busy": t ? void 0 : "true",
487
- "aria-hidden": t ? "true" : void 0,
488
- "aria-label": u,
489
- className: l(K("root"), q.variant[o].className, e),
490
- role: t ? "presentation" : "status",
491
- style: {
492
- ...a,
493
- ...d
494
- }
495
- });
496
- }, ge = {
497
- root: "rly_StatePanel-module__root",
498
- neutral: "rly_StatePanel-module__neutral",
499
- positive: "rly_StatePanel-module__positive",
500
- critical: "rly_StatePanel-module__critical",
501
- caution: "rly_StatePanel-module__caution",
502
- progress: "rly_StatePanel-module__progress",
503
- rail: "rly_StatePanel-module__rail",
504
- icon: "rly_StatePanel-module__icon",
505
- content: "rly_StatePanel-module__content",
506
- title: "rly_StatePanel-module__title",
507
- description: "rly_StatePanel-module__description",
508
- action: "rly_StatePanel-module__action"
509
- }, J = (e) => a(ge, e), Y = s({ tone: {
510
- neutral: {
511
- className: J("neutral"),
512
- purpose: "Neutral explanatory state",
513
- tokens: ["color-text-2", "color-surface-2"]
514
- },
515
- positive: {
516
- className: J("positive"),
517
- purpose: "Positive outcome",
518
- tokens: ["color-success-ink", "color-success-tint"]
519
- },
520
- critical: {
521
- className: J("critical"),
522
- purpose: "Critical outcome requiring attention",
523
- tokens: ["color-blocked-ink", "color-blocked-tint"]
524
- },
525
- caution: {
526
- className: J("caution"),
527
- purpose: "Held outcome requiring review",
528
- tokens: ["color-held-ink", "color-held-tint"]
529
- },
530
- progress: {
531
- className: J("progress"),
532
- purpose: "Work currently in progress",
533
- tokens: ["color-deploying-ink", "color-deploying-tint"]
534
- }
535
- } }), _e = s({ tone: "neutral" }), ve = {
536
- neutral: "minus",
537
- positive: "check",
538
- critical: "alert",
539
- caution: "clock",
540
- progress: "loader"
541
- }, ye = ({ action: t, announce: n = "off", className: i, description: a, icon: o, title: s, tone: c = "neutral", ...u }) => {
542
- let d = n === "assertive" ? "alert" : n === "polite" ? "status" : void 0;
543
- return /* @__PURE__ */ b("section", {
544
- ...u,
545
- "aria-live": n === "off" ? void 0 : n,
546
- className: l(J("root"), Y.tone[c].className, i),
547
- role: d,
548
- children: [
549
- /* @__PURE__ */ y("span", {
550
- "aria-hidden": "true",
551
- className: J("rail")
552
- }),
553
- /* @__PURE__ */ y("span", {
554
- "aria-hidden": "true",
555
- className: J("icon"),
556
- children: /* @__PURE__ */ y(e, {
557
- decorative: !0,
558
- name: o ?? ve[c]
559
- })
560
- }),
561
- /* @__PURE__ */ b("div", {
562
- className: J("content"),
563
- children: [
564
- /* @__PURE__ */ y("strong", {
565
- className: J("title"),
566
- children: r(s, "StatePanel title")
567
- }),
568
- a === void 0 ? null : /* @__PURE__ */ y("div", {
569
- className: J("description"),
570
- children: a
571
- }),
572
- t === void 0 ? null : /* @__PURE__ */ y("div", {
573
- className: J("action"),
574
- children: t
575
- })
576
- ]
577
- })
578
- ]
579
- });
580
- }, be = {
581
- layer: "rly_Dialog-module__layer",
582
- overlay: "rly_Dialog-module__overlay",
583
- content: "rly_Dialog-module__content",
584
- defaultSize: "rly_Dialog-module__defaultSize",
585
- wide: "rly_Dialog-module__wide",
586
- header: "rly_Dialog-module__header",
587
- title: "rly_Dialog-module__title",
588
- description: "rly_Dialog-module__description",
589
- body: "rly_Dialog-module__body",
590
- "dialog-fade-in": "rly_Dialog-module__dialog-fade-in",
591
- "dialog-fade-out": "rly_Dialog-module__dialog-fade-out",
592
- "dialog-enter": "rly_Dialog-module__dialog-enter",
593
- "dialog-exit": "rly_Dialog-module__dialog-exit",
594
- "dialog-compact-in": "rly_Dialog-module__dialog-compact-in",
595
- "dialog-compact-out": "rly_Dialog-module__dialog-compact-out"
596
- }, X = (e) => a(be, e), Z = f(null), Q = () => {
597
- let e = h(Z);
598
- if (e === null) throw Error("Dialog compound components must be nested inside Dialog");
599
- return e;
600
- }, xe = (e, t) => {
601
- o(e) ? e(t) : e != null && (e.current = t);
602
- }, $ = () => {
603
- try {
604
- return T(document.activeElement) ? document.activeElement : null;
605
- } catch {
606
- return null;
607
- }
608
- }, Se = s({ size: {
609
- default: {
610
- className: X("defaultSize"),
611
- purpose: "Focused decision or short form",
612
- tokens: ["radius-overlay", "space-32"]
613
- },
614
- wide: {
615
- className: X("wide"),
616
- purpose: "Detailed comparison or multi-section form",
617
- tokens: ["radius-overlay", "space-64"]
618
- }
619
- } }), Ce = s({ size: "default" }), we = ({ children: e, entryMotion: t }) => {
620
- let n = Q(), r = _(null);
621
- return O(), A(r, n.open), /* @__PURE__ */ y("div", {
622
- className: X("layer"),
623
- "data-rly-dialog-entry-motion": t,
624
- "data-rly-dialog-layer": "",
625
- "data-rly-modal-layer": "",
626
- ref: r,
627
- children: e
628
- });
629
- }, Te = Object.freeze({
630
- Close: (e) => /* @__PURE__ */ y(d.Close, {
631
- asChild: !0,
632
- children: /* @__PURE__ */ y(V, { ...e })
633
- }),
634
- Content: ({ children: e, className: n, description: i, entryMotion: a = "intrinsic", initialFocusRef: o, size: s = "default", title: c, ...u }) => {
635
- let f = Q(), p = w(f.open, a), m = r(c, "Dialog title"), h = i === void 0 ? void 0 : r(i, "Dialog description");
636
- return /* @__PURE__ */ y(t, { children: (t) => /* @__PURE__ */ y(d.Portal, {
637
- container: t,
638
- children: /* @__PURE__ */ b(we, {
639
- entryMotion: p,
640
- children: [/* @__PURE__ */ y(d.Overlay, {
641
- className: X("overlay"),
642
- "data-rly-dialog-overlay": "",
643
- onPointerDown: () => {
644
- f.requestOpenChange(!1);
645
- }
646
- }), /* @__PURE__ */ b(d.Content, {
647
- ...u,
648
- ...h === void 0 ? { "aria-describedby": void 0 } : {},
649
- className: l(X("content"), Se.size[s].className, n),
650
- onCloseAutoFocus: (e) => {
651
- e.preventDefault();
652
- },
653
- onOpenAutoFocus: (e) => {
654
- let t = $();
655
- f.triggerRef.current === null && t !== null && (f.restoreTargetRef.current = t);
656
- let n = o?.current;
657
- n != null && (e.preventDefault(), n.focus());
658
- },
659
- children: [/* @__PURE__ */ b("header", {
660
- className: X("header"),
661
- children: [/* @__PURE__ */ y(d.Title, {
662
- className: X("title"),
663
- children: m
664
- }), h === void 0 ? null : /* @__PURE__ */ y(d.Description, {
665
- className: X("description"),
666
- children: h
667
- })]
668
- }), /* @__PURE__ */ y("div", {
669
- className: X("body"),
670
- children: e
671
- })]
672
- })]
673
- })
674
- }) });
675
- },
676
- Root: ({ children: e, defaultOpen: t = !1, onOpenChange: n, open: r }) => {
677
- let [i, a] = v(t), o = D(), s = (r ?? i) && o, c = _(s), l = _(null), u = _(s ? $() : null);
678
- s && !c.current && (u.current = l.current ?? $());
679
- let f = (e) => {
680
- e && (u.current = l.current ?? $()), r === void 0 && a(e), n?.(e);
681
- };
682
- return g(() => {
683
- c.current !== s && (c.current = s, s ? j() : M(u.current));
684
- }, [s]), /* @__PURE__ */ y(E, { children: /* @__PURE__ */ y(Z.Provider, {
685
- value: {
686
- open: s,
687
- requestOpenChange: f,
688
- restoreTargetRef: u,
689
- triggerRef: l
690
- },
691
- children: /* @__PURE__ */ y(d.Root, {
692
- modal: !0,
693
- onOpenChange: f,
694
- open: s,
695
- children: e
696
- })
697
- }) });
698
- },
699
- Trigger: ({ ref: e, ...t }) => {
700
- let n = Q();
701
- return /* @__PURE__ */ y(d.Trigger, {
702
- asChild: !0,
703
- children: /* @__PURE__ */ y(V, {
704
- ...t,
705
- ref: (t) => {
706
- n.triggerRef.current = t, xe(e, t);
707
- }
708
- })
709
- });
710
- }
711
- });
712
- //#endregion
713
- export { ae as _, Y as a, P as b, q as c, de as d, G as f, V as g, le as h, _e as i, he as l, U as m, Ce as n, ye as o, se as p, Se as r, me as s, Te as t, fe as u, B as v, re as x, F as y };
714
-
715
- //# sourceMappingURL=Dialog-1WvU8GjA.js.map