@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
@@ -0,0 +1,955 @@
1
+ import { i as e, t } from "./PortalProvider-CN_81Fy3.js";
2
+ import { a as n, c as r, i, l as a, n as o, o as s, r as c, s as l, t as u } from "./component-DKy8kjZl.js";
3
+ import { Avatar as d, Dialog as f, Select as p } from "radix-ui";
4
+ import { createContext as m, createElement as h, useCallback as g, useContext as _, useId as v, useLayoutEffect as y, useRef as b, useState as x } from "react";
5
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
6
+ //#region src/internal/modal.ts
7
+ var w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = m(null), D = 0, O = (e, t) => {
8
+ let n = b({
9
+ open: e,
10
+ value: t
11
+ }), r = e && !n.current.open ? t : n.current.value;
12
+ return y(() => {
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
+ }, k = (e) => "inert" in e && n(e.inert), A = (e) => e !== null && k(e), j = ({ children: e }) => {
22
+ let [t, n] = x(!1);
23
+ return h(E.Provider, { value: {
24
+ isContentMounted: t,
25
+ setContentMounted: n
26
+ } }, e);
27
+ }, M = () => _(E)?.isContentMounted ?? !0, N = () => _(E) !== null, P = () => {
28
+ let e = _(E)?.setContentMounted;
29
+ y(() => (e?.(!0), () => e?.(!1)), [e]);
30
+ }, ee = (e) => {
31
+ let t = w.get(e);
32
+ if (t === void 0) {
33
+ w.set(e, {
34
+ count: 1,
35
+ previous: e.inert
36
+ }), e.inert = !0;
37
+ return;
38
+ }
39
+ t.count += 1;
40
+ }, te = (e) => {
41
+ let t = w.get(e);
42
+ if (t !== void 0) {
43
+ if (t.count > 1) {
44
+ --t.count;
45
+ return;
46
+ }
47
+ e.inert = t.previous, w.delete(e);
48
+ }
49
+ }, F = (e, t) => {
50
+ y(() => {
51
+ if (!t) return;
52
+ let n = e.current;
53
+ if (n === null) return;
54
+ let i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = n.ownerDocument.defaultView?.MutationObserver, s = null, c = () => {
55
+ let e = n;
56
+ for (; e !== e.ownerDocument.body;) {
57
+ let t = e.parentNode;
58
+ if (t === null) break;
59
+ a.has(t) || (s?.observe(t, { childList: !0 }), a.add(t));
60
+ let n = !1;
61
+ for (let r of t.children) {
62
+ if (r === e) {
63
+ n = !0;
64
+ continue;
65
+ }
66
+ !(n && r.hasAttribute("data-rly-modal-layer")) && A(r) && !i.has(r) && (ee(r), i.add(r));
67
+ }
68
+ let o = e.parentElement;
69
+ if (o !== null) {
70
+ e = o;
71
+ continue;
72
+ }
73
+ if (!("host" in t)) break;
74
+ let c = t.host;
75
+ if (!r(c) || !k(c)) break;
76
+ e = c;
77
+ }
78
+ };
79
+ return o !== void 0 && (s = new o(c)), c(), () => {
80
+ s?.disconnect();
81
+ for (let e of i) te(e);
82
+ };
83
+ }, [t, e]);
84
+ }, I = (e) => {
85
+ let t = T.get(e);
86
+ if (t !== void 0) {
87
+ t.count += 1;
88
+ return;
89
+ }
90
+ let n = e.documentElement;
91
+ T.set(e, {
92
+ count: 1,
93
+ overflow: n.style.overflow,
94
+ overscrollBehavior: n.style.overscrollBehavior
95
+ }), n.style.overflow = "hidden", n.style.overscrollBehavior = "none";
96
+ }, ne = (e) => {
97
+ let t = T.get(e);
98
+ if (t === void 0) return;
99
+ if (t.count > 1) {
100
+ --t.count;
101
+ return;
102
+ }
103
+ let n = e.documentElement;
104
+ n.style.overflow = t.overflow, n.style.overscrollBehavior = t.overscrollBehavior, T.delete(e);
105
+ }, re = (e, t) => {
106
+ y(() => {
107
+ if (!t) return;
108
+ let n = e.current?.ownerDocument;
109
+ if (n !== void 0) return I(n), () => ne(n);
110
+ }, [t, e]);
111
+ }, L = () => {
112
+ D += 1;
113
+ }, ie = (e) => {
114
+ let t = ++D;
115
+ setTimeout(() => {
116
+ D === t && e !== null && e.isConnected === !0 && e.focus();
117
+ }, 0);
118
+ }, ae = {
119
+ layer: "rly_Sheet-module__layer",
120
+ trigger: "rly_Sheet-module__trigger",
121
+ close: "rly_Sheet-module__close",
122
+ iconClose: "rly_Sheet-module__iconClose",
123
+ overlay: "rly_Sheet-module__overlay",
124
+ "rly-sheet-overlay-out": "rly_Sheet-module__rly-sheet-overlay-out",
125
+ "rly-sheet-overlay-in": "rly_Sheet-module__rly-sheet-overlay-in",
126
+ content: "rly_Sheet-module__content",
127
+ end: "rly_Sheet-module__end",
128
+ "rly-sheet-end-out": "rly_Sheet-module__rly-sheet-end-out",
129
+ "rly-sheet-end-in": "rly_Sheet-module__rly-sheet-end-in",
130
+ start: "rly_Sheet-module__start",
131
+ "rly-sheet-start-out": "rly_Sheet-module__rly-sheet-start-out",
132
+ "rly-sheet-start-in": "rly_Sheet-module__rly-sheet-start-in",
133
+ header: "rly_Sheet-module__header",
134
+ heading: "rly_Sheet-module__heading",
135
+ title: "rly_Sheet-module__title",
136
+ description: "rly_Sheet-module__description",
137
+ body: "rly_Sheet-module__body",
138
+ footer: "rly_Sheet-module__footer"
139
+ }, R = (e) => o(ae, e), oe = c({ side: {
140
+ end: {
141
+ className: R("end"),
142
+ purpose: "Supporting detail that follows the current reading flow",
143
+ tokens: [
144
+ "color-surface-1",
145
+ "radius-overlay",
146
+ "motion-standard"
147
+ ]
148
+ },
149
+ start: {
150
+ className: R("start"),
151
+ purpose: "Navigation or context that precedes the current reading flow",
152
+ tokens: [
153
+ "color-surface-1",
154
+ "radius-overlay",
155
+ "motion-standard"
156
+ ]
157
+ }
158
+ } }), se = c({ side: "end" }), ce = m(null), z = () => {
159
+ let e = _(ce);
160
+ if (e === null) throw Error("Sheet compound components must be nested inside Sheet.Root");
161
+ return e;
162
+ }, le = ({ children: e, entryMotion: t }) => {
163
+ let n = z(), r = b(null);
164
+ return P(), F(r, n.open), /* @__PURE__ */ S("div", {
165
+ className: R("layer"),
166
+ "data-rly-modal-layer": "",
167
+ "data-rly-sheet-entry-motion": t,
168
+ "data-rly-sheet-layer": "",
169
+ ref: r,
170
+ children: e
171
+ });
172
+ }, ue = (e, t) => (a(e) && i(e, `${t} children`), e), de = Object.freeze({
173
+ Body: ({ className: e, ...t }) => /* @__PURE__ */ S("div", {
174
+ ...t,
175
+ className: u(R("body"), e)
176
+ }),
177
+ Close: ({ children: e, className: t, type: n, ...r }) => /* @__PURE__ */ S(f.Close, {
178
+ ...r,
179
+ className: u(R("close"), t),
180
+ type: n ?? "button",
181
+ children: ue(e, "Sheet.Close")
182
+ }),
183
+ Content: ({ children: n, className: r, closeLabel: a, description: o, entryMotion: c = "intrinsic", initialFocusRef: l, ref: d, side: p = se.side, tabIndex: m, title: h, ..._ }) => {
184
+ let v = z(), y = O(v.open, c), x = i(h, "Sheet title"), w = o === void 0 ? void 0 : i(o, "Sheet description"), T = i(a ?? `Close ${x}`, "Sheet closeLabel"), E = b(null), D = g((e) => {
185
+ E.current = e, s(d) ? d(e) : d != null && (d.current = e);
186
+ }, [d]);
187
+ return /* @__PURE__ */ S(t, { children: (t) => /* @__PURE__ */ S(f.Portal, {
188
+ container: t,
189
+ children: /* @__PURE__ */ C(le, {
190
+ entryMotion: y,
191
+ children: [/* @__PURE__ */ S(f.Overlay, {
192
+ className: R("overlay"),
193
+ "data-rly-sheet-overlay": "",
194
+ onPointerDown: () => v.requestOpenChange(!1)
195
+ }), /* @__PURE__ */ C(f.Content, {
196
+ ..._,
197
+ ...w === void 0 ? { "aria-describedby": void 0 } : {},
198
+ className: u(R("content"), oe.side[p].className, r),
199
+ "data-rly-sheet-side": p,
200
+ onCloseAutoFocus: (e) => e.preventDefault(),
201
+ onOpenAutoFocus: (e) => {
202
+ e.preventDefault();
203
+ let t = E.current?.ownerDocument.activeElement ?? null;
204
+ v.restoreFocusRef.current === null && A(t) && (v.restoreFocusRef.current = t);
205
+ let n = l?.current ?? E.current;
206
+ n?.focus(), n !== E.current && n?.ownerDocument.activeElement !== n && E.current?.focus();
207
+ },
208
+ ref: D,
209
+ tabIndex: m ?? -1,
210
+ children: [/* @__PURE__ */ C("div", {
211
+ className: R("header"),
212
+ children: [/* @__PURE__ */ C("div", {
213
+ className: R("heading"),
214
+ children: [/* @__PURE__ */ S(f.Title, {
215
+ className: R("title"),
216
+ children: x
217
+ }), w === void 0 ? null : /* @__PURE__ */ S(f.Description, {
218
+ className: R("description"),
219
+ children: w
220
+ })]
221
+ }), /* @__PURE__ */ S(f.Close, {
222
+ "aria-label": T,
223
+ className: R("iconClose"),
224
+ type: "button",
225
+ children: /* @__PURE__ */ S(e, {
226
+ decorative: !0,
227
+ name: "close",
228
+ size: "default"
229
+ })
230
+ })]
231
+ }), n]
232
+ })]
233
+ })
234
+ }) });
235
+ },
236
+ Footer: ({ className: e, ...t }) => /* @__PURE__ */ S("footer", {
237
+ ...t,
238
+ className: u(R("footer"), e)
239
+ }),
240
+ Root: (e) => {
241
+ let { children: t, defaultOpen: n = !1, onOpenChange: r, open: i } = e, [a, o] = x(n), s = M(), c = b(null), l = (i ?? a) && s, u = b(l), d = (e) => {
242
+ i === void 0 && o(e), r?.(e);
243
+ };
244
+ return y(() => {
245
+ u.current !== l && (u.current = l, l ? L() : ie(c.current));
246
+ }, [l]), /* @__PURE__ */ S(j, { children: /* @__PURE__ */ S(ce.Provider, {
247
+ value: {
248
+ open: l,
249
+ requestOpenChange: d,
250
+ restoreFocusRef: c
251
+ },
252
+ children: /* @__PURE__ */ S(f.Root, {
253
+ modal: !0,
254
+ onOpenChange: d,
255
+ open: l,
256
+ children: t
257
+ })
258
+ }) });
259
+ },
260
+ Trigger: ({ children: e, className: t, onClick: n, type: r, ...i }) => {
261
+ let a = z();
262
+ return /* @__PURE__ */ S(f.Trigger, {
263
+ ...i,
264
+ className: u(R("trigger"), t),
265
+ onClick: (e) => {
266
+ a.restoreFocusRef.current = e.currentTarget, n?.(e);
267
+ },
268
+ type: r ?? "button",
269
+ children: ue(e, "Sheet.Trigger")
270
+ });
271
+ }
272
+ }), fe = {
273
+ root: "rly_Button-module__root",
274
+ primary: "rly_Button-module__primary",
275
+ secondary: "rly_Button-module__secondary",
276
+ quiet: "rly_Button-module__quiet",
277
+ compact: "rly_Button-module__compact",
278
+ defaultSize: "rly_Button-module__defaultSize",
279
+ principal: "rly_Button-module__principal",
280
+ stretch: "rly_Button-module__stretch",
281
+ content: "rly_Button-module__content",
282
+ label: "rly_Button-module__label",
283
+ loadingContent: "rly_Button-module__loadingContent",
284
+ loader: "rly_Button-module__loader"
285
+ }, B = (e) => o(fe, e), V = c({
286
+ variant: {
287
+ primary: {
288
+ className: B("primary"),
289
+ purpose: "Single principal action",
290
+ tokens: ["color-action-background", "color-action-foreground"]
291
+ },
292
+ secondary: {
293
+ className: B("secondary"),
294
+ purpose: "Default supporting action",
295
+ tokens: ["color-surface-1", "color-border-2"]
296
+ },
297
+ quiet: {
298
+ className: B("quiet"),
299
+ purpose: "Low-emphasis contextual action",
300
+ tokens: ["color-text-1", "color-surface-2"]
301
+ }
302
+ },
303
+ size: {
304
+ compact: {
305
+ className: B("compact"),
306
+ purpose: "Dense text action",
307
+ tokens: ["space-40"]
308
+ },
309
+ default: {
310
+ className: B("defaultSize"),
311
+ purpose: "Standard action",
312
+ tokens: ["space-48"]
313
+ },
314
+ principal: {
315
+ className: B("principal"),
316
+ purpose: "Prominent consequential action",
317
+ tokens: ["space-48", "space-8"]
318
+ }
319
+ }
320
+ }), pe = c({
321
+ variant: "secondary",
322
+ size: "default"
323
+ }), H = ({ "aria-label": t, "aria-labelledby": n, children: r, className: i, disabled: o, leadingIcon: s, loading: c = !1, size: d = "default", stretch: f = !1, trailingIcon: p, type: m, variant: h = "secondary", ...g }) => {
324
+ if (!l(r) && !a(r) || a(r) && r.trim().length === 0) throw Error("Button children must contain visible content");
325
+ return /* @__PURE__ */ C("button", {
326
+ ...g,
327
+ "aria-busy": c ? "true" : void 0,
328
+ "aria-label": c && !n?.trim() ? t?.trim() ? t : String(r) : t,
329
+ "aria-labelledby": n,
330
+ className: u(B("root"), V.variant[h].className, V.size[d].className, f && B("stretch"), i),
331
+ "data-loading": c ? "true" : void 0,
332
+ disabled: o || c,
333
+ type: m ?? "button",
334
+ children: [/* @__PURE__ */ C("span", {
335
+ className: u(B("content"), c && B("loadingContent")),
336
+ children: [
337
+ s === void 0 ? null : /* @__PURE__ */ S(e, {
338
+ decorative: !0,
339
+ name: s,
340
+ size: d === "compact" ? "small" : "default"
341
+ }),
342
+ /* @__PURE__ */ S("span", {
343
+ className: B("label"),
344
+ children: r
345
+ }),
346
+ p === void 0 ? null : /* @__PURE__ */ S(e, {
347
+ decorative: !0,
348
+ name: p,
349
+ size: d === "compact" ? "small" : "default"
350
+ })
351
+ ]
352
+ }), c ? /* @__PURE__ */ S("span", {
353
+ "aria-hidden": "true",
354
+ className: B("loader"),
355
+ children: /* @__PURE__ */ S(e, {
356
+ decorative: !0,
357
+ name: "loader",
358
+ size: d === "compact" ? "small" : "default"
359
+ })
360
+ }) : null]
361
+ });
362
+ }, me = {
363
+ root: "rly_StateLabel-module__root",
364
+ neutral: "rly_StateLabel-module__neutral",
365
+ positive: "rly_StateLabel-module__positive",
366
+ critical: "rly_StateLabel-module__critical",
367
+ caution: "rly_StateLabel-module__caution",
368
+ progress: "rly_StateLabel-module__progress",
369
+ compact: "rly_StateLabel-module__compact",
370
+ defaultSize: "rly_StateLabel-module__defaultSize"
371
+ }, U = (e) => o(me, e), W = c({
372
+ tone: {
373
+ neutral: {
374
+ className: U("neutral"),
375
+ purpose: "Neutral or unavailable state",
376
+ tokens: ["color-text-2", "color-surface-2"]
377
+ },
378
+ positive: {
379
+ className: U("positive"),
380
+ purpose: "Positive state",
381
+ tokens: ["color-success-ink", "color-success-tint"]
382
+ },
383
+ critical: {
384
+ className: U("critical"),
385
+ purpose: "Critical state",
386
+ tokens: ["color-blocked-ink", "color-blocked-tint"]
387
+ },
388
+ caution: {
389
+ className: U("caution"),
390
+ purpose: "Caution state",
391
+ tokens: ["color-held-ink", "color-held-tint"]
392
+ },
393
+ progress: {
394
+ className: U("progress"),
395
+ purpose: "Work in progress",
396
+ tokens: ["color-deploying-ink", "color-deploying-tint"]
397
+ }
398
+ },
399
+ size: {
400
+ compact: {
401
+ className: U("compact"),
402
+ purpose: "Dense metadata state",
403
+ tokens: ["type-meta"]
404
+ },
405
+ default: {
406
+ className: U("defaultSize"),
407
+ purpose: "Standard explicit state",
408
+ tokens: ["type-label"]
409
+ }
410
+ }
411
+ }), he = c({
412
+ tone: "neutral",
413
+ size: "default"
414
+ }), ge = {
415
+ neutral: "minus",
416
+ positive: "check",
417
+ critical: "alert",
418
+ caution: "clock",
419
+ progress: "loader"
420
+ }, _e = ({ className: t, icon: n, label: r, size: a = "default", tone: o = "neutral", ...s }) => /* @__PURE__ */ C("span", {
421
+ ...s,
422
+ className: u(U("root"), W.tone[o].className, W.size[a].className, t),
423
+ children: [/* @__PURE__ */ S(e, {
424
+ decorative: !0,
425
+ name: n ?? ge[o],
426
+ size: "small"
427
+ }), /* @__PURE__ */ S("span", { children: i(r, "StateLabel label") })]
428
+ }), ve = {
429
+ root: "rly_Avatar-module__root",
430
+ small: "rly_Avatar-module__small",
431
+ defaultSize: "rly_Avatar-module__defaultSize",
432
+ large: "rly_Avatar-module__large",
433
+ hero: "rly_Avatar-module__hero",
434
+ circle: "rly_Avatar-module__circle",
435
+ roundedSquare: "rly_Avatar-module__roundedSquare",
436
+ image: "rly_Avatar-module__image",
437
+ fallback: "rly_Avatar-module__fallback"
438
+ }, G = (e) => o(ve, e), K = c({
439
+ size: {
440
+ small: {
441
+ className: G("small"),
442
+ purpose: "Compact supporting identity",
443
+ tokens: ["space-24"]
444
+ },
445
+ default: {
446
+ className: G("defaultSize"),
447
+ purpose: "Standard identity",
448
+ tokens: ["space-32"]
449
+ },
450
+ large: {
451
+ className: G("large"),
452
+ purpose: "Prominent identity",
453
+ tokens: ["space-40"]
454
+ },
455
+ hero: {
456
+ className: G("hero"),
457
+ purpose: "Page-level identity",
458
+ tokens: ["space-48", "space-8"]
459
+ }
460
+ },
461
+ form: {
462
+ circle: {
463
+ className: G("circle"),
464
+ purpose: "Human or general identity",
465
+ tokens: ["radius-round"]
466
+ },
467
+ "rounded-square": {
468
+ className: G("roundedSquare"),
469
+ purpose: "Non-human or system identity",
470
+ tokens: ["radius-field"]
471
+ }
472
+ }
473
+ }), ye = c({
474
+ size: "default",
475
+ form: "circle"
476
+ }), be = ({ className: e, decorative: t, fallback: n, form: r = "circle", label: a, size: o = "default", src: s, ...c }) => {
477
+ let l = t ? void 0 : i(a, "Avatar label"), f = i(n, "Avatar fallback");
478
+ return /* @__PURE__ */ C(d.Root, {
479
+ ...c,
480
+ "aria-hidden": t ? "true" : void 0,
481
+ "aria-label": l,
482
+ className: u(G("root"), K.size[o].className, K.form[r].className, e),
483
+ role: t ? void 0 : "img",
484
+ children: [s === void 0 ? null : /* @__PURE__ */ S(d.Image, {
485
+ alt: "",
486
+ className: G("image"),
487
+ decoding: "async",
488
+ loading: "lazy",
489
+ src: s
490
+ }), /* @__PURE__ */ S(d.Fallback, {
491
+ "aria-hidden": "true",
492
+ className: G("fallback"),
493
+ children: f
494
+ })]
495
+ });
496
+ }, xe = {
497
+ root: "rly_Skeleton-module__root",
498
+ text: "rly_Skeleton-module__text",
499
+ block: "rly_Skeleton-module__block",
500
+ circle: "rly_Skeleton-module__circle"
501
+ }, q = (e) => o(xe, e), Se = c({ variant: {
502
+ text: {
503
+ className: q("text"),
504
+ purpose: "A line of unavailable copy",
505
+ tokens: ["type-body", "radius-tag"]
506
+ },
507
+ block: {
508
+ className: q("block"),
509
+ purpose: "A rectangular unavailable region",
510
+ tokens: ["space-64", "radius-control"]
511
+ },
512
+ circle: {
513
+ className: q("circle"),
514
+ purpose: "A circular unavailable image",
515
+ tokens: ["radius-round"]
516
+ }
517
+ } }), Ce = c({ variant: "text" }), we = ({ className: e, decorative: t = !0, height: n, label: r, style: a, variant: o = "text", width: s, ...c }) => {
518
+ if (!t && r === void 0) throw Error("Skeleton label must contain visible text");
519
+ let l = t || r === void 0 ? void 0 : i(r, "Skeleton label"), d = {
520
+ ...n !== void 0 && { blockSize: n },
521
+ ...s !== void 0 && { inlineSize: s }
522
+ };
523
+ return /* @__PURE__ */ S("div", {
524
+ ...c,
525
+ "aria-busy": t ? void 0 : "true",
526
+ "aria-hidden": t ? "true" : void 0,
527
+ "aria-label": l,
528
+ className: u(q("root"), Se.variant[o].className, e),
529
+ role: t ? "presentation" : "status",
530
+ style: {
531
+ ...a,
532
+ ...d
533
+ }
534
+ });
535
+ }, Te = {
536
+ root: "rly_StatePanel-module__root",
537
+ neutral: "rly_StatePanel-module__neutral",
538
+ positive: "rly_StatePanel-module__positive",
539
+ critical: "rly_StatePanel-module__critical",
540
+ caution: "rly_StatePanel-module__caution",
541
+ progress: "rly_StatePanel-module__progress",
542
+ rail: "rly_StatePanel-module__rail",
543
+ icon: "rly_StatePanel-module__icon",
544
+ content: "rly_StatePanel-module__content",
545
+ title: "rly_StatePanel-module__title",
546
+ description: "rly_StatePanel-module__description",
547
+ action: "rly_StatePanel-module__action"
548
+ }, J = (e) => o(Te, e), Ee = c({ tone: {
549
+ neutral: {
550
+ className: J("neutral"),
551
+ purpose: "Neutral explanatory state",
552
+ tokens: ["color-text-2", "color-surface-2"]
553
+ },
554
+ positive: {
555
+ className: J("positive"),
556
+ purpose: "Positive outcome",
557
+ tokens: ["color-success-ink", "color-success-tint"]
558
+ },
559
+ critical: {
560
+ className: J("critical"),
561
+ purpose: "Critical outcome requiring attention",
562
+ tokens: ["color-blocked-ink", "color-blocked-tint"]
563
+ },
564
+ caution: {
565
+ className: J("caution"),
566
+ purpose: "Held outcome requiring review",
567
+ tokens: ["color-held-ink", "color-held-tint"]
568
+ },
569
+ progress: {
570
+ className: J("progress"),
571
+ purpose: "Work currently in progress",
572
+ tokens: ["color-deploying-ink", "color-deploying-tint"]
573
+ }
574
+ } }), De = c({ tone: "neutral" }), Oe = {
575
+ neutral: "minus",
576
+ positive: "check",
577
+ critical: "alert",
578
+ caution: "clock",
579
+ progress: "loader"
580
+ }, ke = ({ action: t, announce: n = "off", className: r, description: a, icon: o, title: s, tone: c = "neutral", ...l }) => {
581
+ let d = n === "assertive" ? "alert" : n === "polite" ? "status" : void 0;
582
+ return /* @__PURE__ */ C("section", {
583
+ ...l,
584
+ "aria-live": n === "off" ? void 0 : n,
585
+ className: u(J("root"), Ee.tone[c].className, r),
586
+ role: d,
587
+ children: [
588
+ /* @__PURE__ */ S("span", {
589
+ "aria-hidden": "true",
590
+ className: J("rail")
591
+ }),
592
+ /* @__PURE__ */ S("span", {
593
+ "aria-hidden": "true",
594
+ className: J("icon"),
595
+ children: /* @__PURE__ */ S(e, {
596
+ decorative: !0,
597
+ name: o ?? Oe[c]
598
+ })
599
+ }),
600
+ /* @__PURE__ */ C("div", {
601
+ className: J("content"),
602
+ children: [
603
+ /* @__PURE__ */ S("strong", {
604
+ className: J("title"),
605
+ children: i(s, "StatePanel title")
606
+ }),
607
+ a === void 0 ? null : /* @__PURE__ */ S("div", {
608
+ className: J("description"),
609
+ children: a
610
+ }),
611
+ t === void 0 ? null : /* @__PURE__ */ S("div", {
612
+ className: J("action"),
613
+ children: t
614
+ })
615
+ ]
616
+ })
617
+ ]
618
+ });
619
+ }, Ae = /* @__PURE__ */ new WeakSet(), je = (e) => (Ae.add(e), e), Me = (e) => Ae.has(e), Ne = {
620
+ root: "rly_Field-module__root",
621
+ label: "rly_Field-module__label",
622
+ required: "rly_Field-module__required",
623
+ description: "rly_Field-module__description",
624
+ error: "rly_Field-module__error",
625
+ controlSlot: "rly_Field-module__controlSlot",
626
+ control: "rly_Field-module__control",
627
+ compact: "rly_Field-module__compact",
628
+ defaultSize: "rly_Field-module__defaultSize"
629
+ }, Y = (e) => o(Ne, e), Pe = [
630
+ "aria-describedby",
631
+ "aria-errormessage",
632
+ "aria-invalid",
633
+ "aria-labelledby",
634
+ "aria-required",
635
+ "id",
636
+ "required"
637
+ ], Fe = /* @__PURE__ */ new Set([
638
+ "button",
639
+ "input",
640
+ "select",
641
+ "textarea"
642
+ ]), Ie = c({ size: {
643
+ compact: {
644
+ className: Y("compact"),
645
+ purpose: "Dense form rows",
646
+ tokens: ["space-40", "type-meta"]
647
+ },
648
+ default: {
649
+ className: Y("defaultSize"),
650
+ purpose: "Standard form controls",
651
+ tokens: ["space-48", "type-label"]
652
+ }
653
+ } }), Le = c({ size: "default" }), Re = ({ children: e, className: t, controlId: n, description: o, error: c, label: l, required: d = !1, size: f = Le.size, ...p }) => {
654
+ let m = v(), h = n ?? `rly-field-${m}`, g = `${h}-label`, _ = o === void 0 ? void 0 : `${h}-description`, y = c === void 0 ? void 0 : `${h}-error`, b = {
655
+ "aria-describedby": [_, y].filter((e) => e !== void 0).join(" ") || void 0,
656
+ "aria-errormessage": y,
657
+ "aria-invalid": c !== void 0 || void 0,
658
+ "aria-labelledby": g,
659
+ "aria-required": d ? !0 : void 0,
660
+ className: Y("control"),
661
+ id: h
662
+ }, x = d ? {
663
+ ...b,
664
+ required: !0
665
+ } : b, w = e(x), T = w.type;
666
+ if (!(a(T) ? Fe.has(T) : (s(T) || r(T)) && T !== null && Me(T))) throw Error("Field children must render one concrete or rly-owned control");
667
+ for (let e of Pe) if (w.props[e] !== x[e]) throw Error(`Field control must apply ${e}`);
668
+ if (!w.props.className.split(" ").includes(x.className)) throw Error("Field control must apply className");
669
+ return /* @__PURE__ */ C("div", {
670
+ ...p,
671
+ className: u(Y("root"), Ie.size[f].className, t),
672
+ "data-error": c === void 0 ? void 0 : "true",
673
+ children: [
674
+ /* @__PURE__ */ C("label", {
675
+ className: Y("label"),
676
+ htmlFor: h,
677
+ id: g,
678
+ children: [i(l, "Field label"), d ? /* @__PURE__ */ S("span", {
679
+ className: Y("required"),
680
+ children: "Required"
681
+ }) : null]
682
+ }),
683
+ o === void 0 ? null : /* @__PURE__ */ S("p", {
684
+ className: Y("description"),
685
+ id: _,
686
+ children: i(o, "Field description")
687
+ }),
688
+ /* @__PURE__ */ S("div", {
689
+ className: Y("controlSlot"),
690
+ children: w
691
+ }),
692
+ c === void 0 ? null : /* @__PURE__ */ S("p", {
693
+ className: Y("error"),
694
+ id: y,
695
+ role: "alert",
696
+ children: i(c, "Field error")
697
+ })
698
+ ]
699
+ });
700
+ }, ze = {
701
+ trigger: "rly_Select-module__trigger",
702
+ compact: "rly_Select-module__compact",
703
+ defaultSize: "rly_Select-module__defaultSize",
704
+ triggerIcon: "rly_Select-module__triggerIcon",
705
+ content: "rly_Select-module__content",
706
+ viewport: "rly_Select-module__viewport",
707
+ item: "rly_Select-module__item",
708
+ itemIndicator: "rly_Select-module__itemIndicator",
709
+ scrollButton: "rly_Select-module__scrollButton"
710
+ }, X = (e) => o(ze, e), Z = c({ size: {
711
+ compact: {
712
+ className: X("compact"),
713
+ purpose: "Dense form rows",
714
+ tokens: ["space-40", "type-meta"]
715
+ },
716
+ default: {
717
+ className: X("defaultSize"),
718
+ purpose: "Standard selection control",
719
+ tokens: ["space-48", "type-body"]
720
+ }
721
+ } }), Be = c({ size: "default" }), Ve = (e, t) => {
722
+ if (!t && !e.some((e) => !e.disabled)) throw Error("Select options must contain at least one enabled option");
723
+ let n = /* @__PURE__ */ new Set();
724
+ for (let t of e) {
725
+ i(t.label, "Select option label");
726
+ let e = i(t.value, "Select option value");
727
+ if (n.has(e)) throw Error(`Duplicate Select option value: ${e}`);
728
+ n.add(e);
729
+ }
730
+ }, He = /* @__PURE__ */ je((n) => {
731
+ let r = "value" in n, { "aria-describedby": a, "aria-errormessage": o, "aria-invalid": s, "aria-label": c, "aria-labelledby": l, "aria-required": d, autoComplete: f, className: m, defaultOpen: g, defaultValue: _, disabled: v = !1, form: y, id: b, name: x, onBlur: w, onFocus: T, onKeyDown: E, onOpenChange: D, onValueChange: O, open: k, options: A, placeholder: j = "Select an option", ref: M, required: N = !1, size: P = Be.size, tabIndex: ee, value: te } = n;
732
+ Ve(A, v), i(c ?? l, c === void 0 ? "Select aria-labelledby" : "Select aria-label");
733
+ let F = i(j, "Select placeholder"), I = te ?? _;
734
+ if (I !== void 0 && !A.some((e) => e.value === I)) throw Error(`Select value does not match an option: ${I}`);
735
+ return /* @__PURE__ */ C(p.Root, {
736
+ ...f === void 0 ? {} : { autoComplete: f },
737
+ ...g === void 0 ? {} : { defaultOpen: g },
738
+ ..._ === void 0 ? {} : { defaultValue: _ },
739
+ disabled: v,
740
+ ...y === void 0 ? {} : { form: y },
741
+ ...x === void 0 ? {} : { name: x },
742
+ ...D === void 0 ? {} : { onOpenChange: D },
743
+ ...O === void 0 ? {} : { onValueChange: O },
744
+ ...k === void 0 ? {} : { open: k },
745
+ required: N,
746
+ ...r ? { value: te ?? "" } : {},
747
+ children: [/* @__PURE__ */ C(p.Trigger, {
748
+ "aria-describedby": a,
749
+ "aria-errormessage": o,
750
+ "aria-invalid": s,
751
+ "aria-label": c,
752
+ "aria-labelledby": l,
753
+ "aria-required": d ?? (N ? !0 : void 0),
754
+ className: u(X("trigger"), Z.size[P].className, m),
755
+ id: b,
756
+ onBlur: w,
757
+ onFocus: T,
758
+ onKeyDown: E,
759
+ ref: M,
760
+ tabIndex: ee,
761
+ children: [/* @__PURE__ */ S(p.Value, { placeholder: F }), /* @__PURE__ */ S(p.Icon, {
762
+ asChild: !0,
763
+ children: /* @__PURE__ */ S("span", {
764
+ "aria-hidden": "true",
765
+ className: X("triggerIcon"),
766
+ children: /* @__PURE__ */ S(e, {
767
+ decorative: !0,
768
+ name: "chevron-down",
769
+ size: "small"
770
+ })
771
+ })
772
+ })]
773
+ }), /* @__PURE__ */ S(t, { children: (t) => /* @__PURE__ */ S(p.Portal, {
774
+ container: t,
775
+ children: /* @__PURE__ */ C(p.Content, {
776
+ align: "start",
777
+ className: u(X("content"), Z.size[P].className),
778
+ position: "popper",
779
+ sideOffset: 6,
780
+ children: [
781
+ /* @__PURE__ */ S(p.ScrollUpButton, {
782
+ "aria-hidden": "true",
783
+ className: X("scrollButton"),
784
+ children: /* @__PURE__ */ S(e, {
785
+ decorative: !0,
786
+ name: "chevron-up",
787
+ size: "small"
788
+ })
789
+ }),
790
+ /* @__PURE__ */ S(p.Viewport, {
791
+ className: X("viewport"),
792
+ children: A.map((t) => /* @__PURE__ */ h(p.Item, {
793
+ className: X("item"),
794
+ ...t.disabled === void 0 ? {} : { disabled: t.disabled },
795
+ key: t.value,
796
+ textValue: t.label,
797
+ value: t.value
798
+ }, /* @__PURE__ */ S(p.ItemText, { children: t.label }), /* @__PURE__ */ S(p.ItemIndicator, {
799
+ className: X("itemIndicator"),
800
+ children: /* @__PURE__ */ S(e, {
801
+ decorative: !0,
802
+ name: "check",
803
+ size: "small"
804
+ })
805
+ })))
806
+ }),
807
+ /* @__PURE__ */ S(p.ScrollDownButton, {
808
+ "aria-hidden": "true",
809
+ className: X("scrollButton"),
810
+ children: /* @__PURE__ */ S(e, {
811
+ decorative: !0,
812
+ name: "chevron-down",
813
+ size: "small"
814
+ })
815
+ })
816
+ ]
817
+ })
818
+ }) })]
819
+ });
820
+ }), Ue = {
821
+ layer: "rly_Dialog-module__layer",
822
+ overlay: "rly_Dialog-module__overlay",
823
+ content: "rly_Dialog-module__content",
824
+ defaultSize: "rly_Dialog-module__defaultSize",
825
+ wide: "rly_Dialog-module__wide",
826
+ header: "rly_Dialog-module__header",
827
+ title: "rly_Dialog-module__title",
828
+ description: "rly_Dialog-module__description",
829
+ body: "rly_Dialog-module__body",
830
+ "dialog-fade-in": "rly_Dialog-module__dialog-fade-in",
831
+ "dialog-fade-out": "rly_Dialog-module__dialog-fade-out",
832
+ "dialog-enter": "rly_Dialog-module__dialog-enter",
833
+ "dialog-exit": "rly_Dialog-module__dialog-exit",
834
+ "dialog-compact-in": "rly_Dialog-module__dialog-compact-in",
835
+ "dialog-compact-out": "rly_Dialog-module__dialog-compact-out"
836
+ }, Q = (e) => o(Ue, e), We = m(null), Ge = () => {
837
+ let e = _(We);
838
+ if (e === null) throw Error("Dialog compound components must be nested inside Dialog");
839
+ return e;
840
+ }, Ke = (e, t) => {
841
+ s(e) ? e(t) : e != null && (e.current = t);
842
+ }, $ = () => {
843
+ try {
844
+ return A(document.activeElement) ? document.activeElement : null;
845
+ } catch {
846
+ return null;
847
+ }
848
+ }, qe = c({ size: {
849
+ default: {
850
+ className: Q("defaultSize"),
851
+ purpose: "Focused decision or short form",
852
+ tokens: ["radius-overlay", "space-32"]
853
+ },
854
+ wide: {
855
+ className: Q("wide"),
856
+ purpose: "Detailed comparison or multi-section form",
857
+ tokens: ["radius-overlay", "space-64"]
858
+ }
859
+ } }), Je = c({ size: "default" }), Ye = ({ children: e, entryMotion: t }) => {
860
+ let n = Ge(), r = b(null);
861
+ return P(), F(r, n.open), /* @__PURE__ */ S("div", {
862
+ className: Q("layer"),
863
+ "data-rly-dialog-entry-motion": t,
864
+ "data-rly-dialog-layer": "",
865
+ "data-rly-modal-layer": "",
866
+ ref: r,
867
+ children: e
868
+ });
869
+ }, Xe = Object.freeze({
870
+ Close: (e) => /* @__PURE__ */ S(f.Close, {
871
+ asChild: !0,
872
+ children: /* @__PURE__ */ S(H, { ...e })
873
+ }),
874
+ Content: ({ children: e, className: n, description: r, entryMotion: a = "intrinsic", initialFocusRef: o, size: s = "default", title: c, ...l }) => {
875
+ let d = Ge(), p = O(d.open, a), m = i(c, "Dialog title"), h = r === void 0 ? void 0 : i(r, "Dialog description");
876
+ return /* @__PURE__ */ S(t, { children: (t) => /* @__PURE__ */ S(f.Portal, {
877
+ container: t,
878
+ children: /* @__PURE__ */ C(Ye, {
879
+ entryMotion: p,
880
+ children: [/* @__PURE__ */ S(f.Overlay, {
881
+ className: Q("overlay"),
882
+ "data-rly-dialog-overlay": "",
883
+ onPointerDown: () => {
884
+ d.requestOpenChange(!1);
885
+ }
886
+ }), /* @__PURE__ */ C(f.Content, {
887
+ ...l,
888
+ ...h === void 0 ? { "aria-describedby": void 0 } : {},
889
+ className: u(Q("content"), qe.size[s].className, n),
890
+ onCloseAutoFocus: (e) => {
891
+ e.preventDefault();
892
+ },
893
+ onOpenAutoFocus: (e) => {
894
+ let t = $();
895
+ d.triggerRef.current === null && t !== null && (d.restoreTargetRef.current = t);
896
+ let n = o?.current;
897
+ n != null && (e.preventDefault(), n.focus());
898
+ },
899
+ children: [/* @__PURE__ */ C("header", {
900
+ className: Q("header"),
901
+ children: [/* @__PURE__ */ S(f.Title, {
902
+ className: Q("title"),
903
+ children: m
904
+ }), h === void 0 ? null : /* @__PURE__ */ S(f.Description, {
905
+ className: Q("description"),
906
+ children: h
907
+ })]
908
+ }), /* @__PURE__ */ S("div", {
909
+ className: Q("body"),
910
+ children: e
911
+ })]
912
+ })]
913
+ })
914
+ }) });
915
+ },
916
+ Root: ({ children: e, defaultOpen: t = !1, onOpenChange: n, open: r }) => {
917
+ let [i, a] = x(t), o = M(), s = (r ?? i) && o, c = b(s), l = b(null), u = b(s ? $() : null);
918
+ s && !c.current && (u.current = l.current ?? $());
919
+ let d = (e) => {
920
+ e && (u.current = l.current ?? $()), r === void 0 && a(e), n?.(e);
921
+ };
922
+ return y(() => {
923
+ c.current !== s && (c.current = s, s ? L() : ie(u.current));
924
+ }, [s]), /* @__PURE__ */ S(j, { children: /* @__PURE__ */ S(We.Provider, {
925
+ value: {
926
+ open: s,
927
+ requestOpenChange: d,
928
+ restoreTargetRef: u,
929
+ triggerRef: l
930
+ },
931
+ children: /* @__PURE__ */ S(f.Root, {
932
+ modal: !0,
933
+ onOpenChange: d,
934
+ open: s,
935
+ children: e
936
+ })
937
+ }) });
938
+ },
939
+ Trigger: ({ ref: e, ...t }) => {
940
+ let n = Ge();
941
+ return /* @__PURE__ */ S(f.Trigger, {
942
+ asChild: !0,
943
+ children: /* @__PURE__ */ S(H, {
944
+ ...t,
945
+ ref: (t) => {
946
+ n.triggerRef.current = t, Ke(e, t);
947
+ }
948
+ })
949
+ });
950
+ }
951
+ });
952
+ //#endregion
953
+ export { A, pe as C, de as D, oe as E, N as F, M as I, P as M, F as N, j as O, re as P, H as S, se as T, ye as _, Z as a, W as b, Le as c, Ee as d, ke as f, be as g, we as h, Be as i, ie as j, L as k, Ie as l, Se as m, Je as n, He as o, Ce as p, qe as r, Re as s, Xe as t, De as u, K as v, V as w, _e as x, he as y };
954
+
955
+ //# sourceMappingURL=Dialog-DSwimdwG.js.map