@knpkv/rly 0.12.0 → 0.13.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.
@@ -1,589 +0,0 @@
1
- import { r as e, t } from "./ThemeProvider-BFeldMeE.js";
2
- import { i as n } from "./PortalProvider-CN_81Fy3.js";
3
- import { i as r, n as i, r as a, t as o } from "./component-DKy8kjZl.js";
4
- import { h as s, i as c, p as l } from "./Dialog-B9Ub_gMT.js";
5
- import { RadioGroup as u, Tabs as d } from "radix-ui";
6
- import { createElement as f, useRef as p } from "react";
7
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
8
- var g = {
9
- root: "rly_ChartLegend-module__root",
10
- item: "rly_ChartLegend-module__item",
11
- swatch: "rly_ChartLegend-module__swatch"
12
- }, _ = (e) => i(g, e), v = [
13
- 1,
14
- 2,
15
- 3,
16
- 4,
17
- 5,
18
- 6,
19
- 7,
20
- 8,
21
- "other"
22
- ], y = (e) => `var(--rly-color-series-${e})`, b = (e) => {
23
- let t = /* @__PURE__ */ new Set();
24
- for (let n of e) {
25
- let e = r(n.id, "ChartLegend item id");
26
- if (t.has(e)) throw Error(`ChartLegend item ids must be unique: ${e}`);
27
- t.add(e);
28
- }
29
- }, x = ({ className: e, items: t, label: n, ...i }) => (b(t), t.length === 0 ? null : /* @__PURE__ */ m("ul", {
30
- ...i,
31
- "aria-label": r(n, "ChartLegend label"),
32
- className: o(_("root"), e),
33
- role: "list",
34
- children: t.map((e) => /* @__PURE__ */ h("li", {
35
- className: _("item"),
36
- children: [/* @__PURE__ */ m("span", {
37
- "aria-hidden": "true",
38
- className: _("swatch"),
39
- "data-series": String(e.series),
40
- style: { background: y(e.series) }
41
- }), r(e.label, "ChartLegend item label")]
42
- }, e.id))
43
- })), ee = {
44
- root: "rly_Divider-module__root",
45
- horizontal: "rly_Divider-module__horizontal",
46
- vertical: "rly_Divider-module__vertical",
47
- subtle: "rly_Divider-module__subtle",
48
- strong: "rly_Divider-module__strong"
49
- }, S = (e) => i(ee, e), C = a({
50
- orientation: {
51
- horizontal: {
52
- className: S("horizontal"),
53
- purpose: "Separate stacked content",
54
- tokens: ["space-0"]
55
- },
56
- vertical: {
57
- className: S("vertical"),
58
- purpose: "Separate adjacent content",
59
- tokens: ["space-0"]
60
- }
61
- },
62
- strength: {
63
- subtle: {
64
- className: S("subtle"),
65
- purpose: "Quiet structural boundary",
66
- tokens: ["color-border-1"]
67
- },
68
- strong: {
69
- className: S("strong"),
70
- purpose: "Explicit structural boundary",
71
- tokens: ["color-border-2"]
72
- }
73
- }
74
- }), te = a({
75
- orientation: "horizontal",
76
- strength: "subtle"
77
- }), ne = ({ className: e, decorative: t = !0, label: n, orientation: i = "horizontal", strength: a = "subtle", ...s }) => {
78
- if (!t && n === void 0) throw Error("Semantic Divider label must contain visible text");
79
- let c = t || n === void 0 ? void 0 : r(n, "Semantic Divider label");
80
- return /* @__PURE__ */ m("div", {
81
- ...s,
82
- "aria-hidden": t ? "true" : void 0,
83
- "aria-label": c,
84
- "aria-orientation": t ? void 0 : i,
85
- className: o(S("root"), C.orientation[i].className, C.strength[a].className, e),
86
- role: t ? "presentation" : "separator"
87
- });
88
- }, re = {
89
- root: "rly_LimitTrack-module__root",
90
- defaultSize: "rly_LimitTrack-module__defaultSize",
91
- slim: "rly_LimitTrack-module__slim",
92
- fill: "rly_LimitTrack-module__fill",
93
- projection: "rly_LimitTrack-module__projection",
94
- near: "rly_LimitTrack-module__near"
95
- }, w = (e) => i(re, e), T = a({ size: {
96
- default: {
97
- className: w("defaultSize"),
98
- purpose: "A limit beside its numbers",
99
- tokens: ["space-12", "radius-tag"]
100
- },
101
- slim: {
102
- className: w("slim"),
103
- purpose: "A limit inside a dense row",
104
- tokens: ["space-6", "radius-tag"]
105
- }
106
- } }), E = a({ size: "default" }), D = (e) => e !== null && Number.isFinite(e) ? e : null, O = (e, t) => {
107
- if (!Number.isFinite(e)) throw Error(`${t} must be a finite number`);
108
- return e;
109
- }, k = (e, t) => {
110
- let n = O(t, "limitTrackTone near"), r = D(e);
111
- return r === null ? "unknown" : r >= 100 ? "full" : r >= n ? "near" : "ok";
112
- }, A = (e) => Math.min(100, Math.max(0, e)), j = ({ className: e, decorative: t = !0, label: n, near: i = 80, projected: a, size: s = E.size, stale: c = !1, value: l, valueText: u, ...d }) => {
113
- let f = D(l), p = O(i, "LimitTrack near"), g = !t, _ = g ? r(n ?? "", "LimitTrack label") : void 0, v = g ? r(u ?? "", "LimitTrack valueText") : void 0, y = g && f !== null, b = f !== null && a !== void 0 && Number.isFinite(a) && a > f ? {
114
- start: A(f),
115
- length: A(a) - A(f)
116
- } : null;
117
- return /* @__PURE__ */ h("span", {
118
- ...d,
119
- "aria-hidden": g ? void 0 : "true",
120
- "aria-label": g && !y ? `${_}: ${v}` : _,
121
- "aria-valuemax": y ? 100 : void 0,
122
- "aria-valuemin": y ? 0 : void 0,
123
- "aria-valuenow": y && f !== null ? A(f) : void 0,
124
- "aria-valuetext": y ? v : void 0,
125
- className: o(w("root"), T.size[s].className, e),
126
- "data-stale": c ? "true" : void 0,
127
- "data-tone": k(f, p),
128
- role: g ? y ? "meter" : "img" : void 0,
129
- children: [
130
- f === null ? null : /* @__PURE__ */ m("span", {
131
- className: w("fill"),
132
- "data-part": "fill",
133
- style: { inlineSize: `${A(f)}%` }
134
- }),
135
- b === null ? null : /* @__PURE__ */ m("span", {
136
- className: w("projection"),
137
- "data-part": "projection",
138
- style: {
139
- inlineSize: `${b.length}%`,
140
- insetInlineStart: `${b.start}%`
141
- }
142
- }),
143
- /* @__PURE__ */ m("span", {
144
- className: w("near"),
145
- "data-part": "near",
146
- style: { insetInlineStart: `min(${A(p)}%, 100% - 1px)` }
147
- })
148
- ]
149
- });
150
- }, M = {
151
- root: "rly_Notice-module__root",
152
- neutral: "rly_Notice-module__neutral",
153
- positive: "rly_Notice-module__positive",
154
- critical: "rly_Notice-module__critical",
155
- caution: "rly_Notice-module__caution",
156
- progress: "rly_Notice-module__progress",
157
- icon: "rly_Notice-module__icon",
158
- lead: "rly_Notice-module__lead",
159
- message: "rly_Notice-module__message",
160
- action: "rly_Notice-module__action"
161
- }, N = (e) => i(M, e), P = a({ tone: {
162
- neutral: {
163
- className: N("neutral"),
164
- purpose: "Neutral context",
165
- tokens: ["color-text-2", "color-border-1"]
166
- },
167
- positive: {
168
- className: N("positive"),
169
- purpose: "Completed outcome",
170
- tokens: ["color-success-ink"]
171
- },
172
- critical: {
173
- className: N("critical"),
174
- purpose: "Failure that needs attention",
175
- tokens: ["color-blocked-ink"]
176
- },
177
- caution: {
178
- className: N("caution"),
179
- purpose: "Limitation or warning",
180
- tokens: ["color-held-ink"]
181
- },
182
- progress: {
183
- className: N("progress"),
184
- purpose: "Work in progress",
185
- tokens: ["color-deploying-ink"]
186
- }
187
- } }), ie = a({ tone: "neutral" }), ae = {
188
- neutral: void 0,
189
- positive: "check",
190
- critical: "alert",
191
- caution: "clock",
192
- progress: "loader"
193
- }, oe = ({ action: e, announce: t = "off", children: r, className: i, icon: a, tone: s = "neutral", ...c }) => {
194
- let l = a ?? ae[s], u = t === "assertive" ? "alert" : t === "polite" ? "status" : c.role;
195
- return /* @__PURE__ */ h("div", {
196
- ...c,
197
- "aria-live": t === "off" ? void 0 : t,
198
- className: o(N("root"), P.tone[s].className, i),
199
- role: u,
200
- children: [/* @__PURE__ */ h("div", {
201
- className: N("lead"),
202
- children: [l === void 0 ? null : /* @__PURE__ */ m("span", {
203
- "aria-hidden": "true",
204
- className: N("icon"),
205
- children: /* @__PURE__ */ m(n, {
206
- decorative: !0,
207
- name: l,
208
- size: "small"
209
- })
210
- }), /* @__PURE__ */ m("div", {
211
- className: N("message"),
212
- children: r
213
- })]
214
- }), e === void 0 ? null : /* @__PURE__ */ m("div", {
215
- className: N("action"),
216
- children: e
217
- })]
218
- });
219
- }, se = {
220
- root: "rly_Surface-module__root",
221
- tonePrimary: "rly_Surface-module__tonePrimary",
222
- toneSecondary: "rly_Surface-module__toneSecondary",
223
- toneTertiary: "rly_Surface-module__toneTertiary",
224
- shapeCard: "rly_Surface-module__shapeCard",
225
- shapeGrouped: "rly_Surface-module__shapeGrouped",
226
- paddingNone: "rly_Surface-module__paddingNone",
227
- paddingCompact: "rly_Surface-module__paddingCompact",
228
- paddingDefault: "rly_Surface-module__paddingDefault",
229
- paddingSpacious: "rly_Surface-module__paddingSpacious"
230
- }, F = (e) => i(se, e), I = a({
231
- tone: {
232
- primary: {
233
- className: F("tonePrimary"),
234
- purpose: "Primary bordered surface",
235
- tokens: ["color-surface-1", "color-border-1"]
236
- },
237
- secondary: {
238
- className: F("toneSecondary"),
239
- purpose: "Quiet secondary surface",
240
- tokens: ["color-surface-2"]
241
- },
242
- tertiary: {
243
- className: F("toneTertiary"),
244
- purpose: "Inset tertiary surface",
245
- tokens: ["color-surface-3"]
246
- }
247
- },
248
- form: {
249
- card: {
250
- className: F("shapeCard"),
251
- purpose: "Standard card geometry",
252
- tokens: ["radius-control"]
253
- },
254
- grouped: {
255
- className: F("shapeGrouped"),
256
- purpose: "Grouped content geometry",
257
- tokens: ["radius-group"]
258
- }
259
- },
260
- padding: {
261
- none: {
262
- className: F("paddingNone"),
263
- purpose: "Caller-owned internal layout",
264
- tokens: ["space-0"]
265
- },
266
- compact: {
267
- className: F("paddingCompact"),
268
- purpose: "Dense supporting content",
269
- tokens: ["space-16"]
270
- },
271
- default: {
272
- className: F("paddingDefault"),
273
- purpose: "Standard content",
274
- tokens: ["space-24"]
275
- },
276
- spacious: {
277
- className: F("paddingSpacious"),
278
- purpose: "Prominent grouped content",
279
- tokens: ["space-32"]
280
- }
281
- }
282
- }), ce = a({
283
- tone: "primary",
284
- form: "card",
285
- padding: "default"
286
- }), L = ({ as: e, children: t, className: n, form: r = "card", padding: i = "default", ref: a, tone: s = "primary", ...c }) => f(e ?? "div", {
287
- ...c,
288
- className: o(F("root"), I.tone[s].className, I.form[r].className, I.padding[i].className, n),
289
- ref: a
290
- }, t), R = {
291
- root: "rly_Tabs-module__root",
292
- list: "rly_Tabs-module__list",
293
- trigger: "rly_Tabs-module__trigger",
294
- defaultSize: "rly_Tabs-module__defaultSize",
295
- large: "rly_Tabs-module__large",
296
- panel: "rly_Tabs-module__panel"
297
- }, z = (e) => i(R, e), B = a({ size: {
298
- default: {
299
- className: z("defaultSize"),
300
- purpose: "Standard section navigation",
301
- tokens: [
302
- "type-label",
303
- "space-40",
304
- "space-4"
305
- ]
306
- },
307
- large: {
308
- className: z("large"),
309
- purpose: "Prominent page-level navigation",
310
- tokens: ["type-body", "space-48"]
311
- }
312
- } }), V = a({ size: "default" }), H = (e) => {
313
- if (e.length === 0) throw Error("Tabs items must contain at least one enabled tab");
314
- let t = /* @__PURE__ */ new Set(), n;
315
- for (let i of e) {
316
- let e = r(i.value, "Tab value");
317
- if (r(i.label, `Tab label for ${e}`), t.has(e)) throw Error(`Tabs item values must be unique: ${e}`);
318
- t.add(e), !i.disabled && n === void 0 && (n = i);
319
- }
320
- if (n === void 0) throw Error("Tabs items must contain at least one enabled tab");
321
- return n;
322
- }, U = ({ "aria-label": e, className: t, defaultValue: n, direction: i, items: a, onValueChange: s, ref: c, size: l = "default", value: u, ...p }) => {
323
- let g = r(e, "Tabs aria-label"), _ = H(a), v = u ?? n ?? _.value, y = a.find((e) => e.value === v);
324
- if (y === void 0 || y.disabled) throw Error(`Tabs selected value must identify an enabled tab: ${v}`);
325
- let b = u === void 0 ? s === void 0 ? { defaultValue: v } : {
326
- defaultValue: v,
327
- onValueChange: s
328
- } : {
329
- onValueChange: s,
330
- value: u
331
- }, x = i === void 0 ? {} : { dir: i };
332
- return /* @__PURE__ */ h(d.Root, {
333
- ...p,
334
- ...b,
335
- ...x,
336
- activationMode: "automatic",
337
- className: o(z("root"), B.size[l].className, t),
338
- orientation: "horizontal",
339
- ref: c,
340
- children: [/* @__PURE__ */ m(d.List, {
341
- "aria-label": g,
342
- className: z("list"),
343
- loop: !0,
344
- children: a.map((e) => /* @__PURE__ */ m(d.Trigger, {
345
- className: z("trigger"),
346
- "data-tab-value": e.value,
347
- disabled: e.disabled,
348
- value: e.value,
349
- children: e.label
350
- }, e.value))
351
- }), a.map((e) => /* @__PURE__ */ f(d.Content, {
352
- className: z("panel"),
353
- ...e.forceMount === void 0 ? {} : { forceMount: e.forceMount },
354
- key: e.value,
355
- value: e.value
356
- }, e.content))]
357
- });
358
- }, W = {
359
- root: "rly_Text-module__root",
360
- verdict: "rly_Text-module__verdict",
361
- pageTitle: "rly_Text-module__pageTitle",
362
- sectionTitle: "rly_Text-module__sectionTitle",
363
- cardTitle: "rly_Text-module__cardTitle",
364
- bodyLarge: "rly_Text-module__bodyLarge",
365
- body: "rly_Text-module__body",
366
- label: "rly_Text-module__label",
367
- meta: "rly_Text-module__meta",
368
- code: "rly_Text-module__code",
369
- tonePrimary: "rly_Text-module__tonePrimary",
370
- toneSecondary: "rly_Text-module__toneSecondary",
371
- toneTertiary: "rly_Text-module__toneTertiary",
372
- toneInherit: "rly_Text-module__toneInherit"
373
- }, G = (e) => i(W, e), K = a({
374
- variant: {
375
- verdict: {
376
- className: G("verdict"),
377
- purpose: "One restrained verdict thesis",
378
- tokens: ["type-verdict"]
379
- },
380
- "page-title": {
381
- className: G("pageTitle"),
382
- purpose: "Primary page title",
383
- tokens: ["type-page-title"]
384
- },
385
- "section-title": {
386
- className: G("sectionTitle"),
387
- purpose: "Section heading",
388
- tokens: ["type-section-title"]
389
- },
390
- "card-title": {
391
- className: G("cardTitle"),
392
- purpose: "Card or panel heading",
393
- tokens: ["type-card-title"]
394
- },
395
- "body-large": {
396
- className: G("bodyLarge"),
397
- purpose: "Leading explanatory copy",
398
- tokens: ["type-body-large"]
399
- },
400
- body: {
401
- className: G("body"),
402
- purpose: "Default interface copy",
403
- tokens: ["type-body"]
404
- },
405
- label: {
406
- className: G("label"),
407
- purpose: "Control and metadata labels",
408
- tokens: ["type-label"]
409
- },
410
- meta: {
411
- className: G("meta"),
412
- purpose: "Supporting metadata",
413
- tokens: ["type-meta"]
414
- },
415
- code: {
416
- className: G("code"),
417
- purpose: "Code and tabular data",
418
- tokens: ["type-code"]
419
- }
420
- },
421
- tone: {
422
- primary: {
423
- className: G("tonePrimary"),
424
- purpose: "Primary readable text",
425
- tokens: ["color-text-1"]
426
- },
427
- secondary: {
428
- className: G("toneSecondary"),
429
- purpose: "Supporting text",
430
- tokens: ["color-text-2"]
431
- },
432
- tertiary: {
433
- className: G("toneTertiary"),
434
- purpose: "Restricted tertiary text",
435
- tokens: ["color-text-3"]
436
- },
437
- inherit: {
438
- className: G("toneInherit"),
439
- purpose: "Inherit semantic context",
440
- tokens: []
441
- }
442
- }
443
- }), q = a({
444
- variant: "body",
445
- tone: "primary"
446
- }), le = (e) => e === "code" ? "code" : e === "verdict" ? "p" : e === "label" || e === "meta" ? "span" : "p", ue = ({ as: e, children: t, className: n, ref: r, tone: i = q.tone, variant: a = q.variant, ...s }) => f(e ?? le(a), {
447
- ...s,
448
- className: o(G("root"), K.variant[a].className, K.tone[i].className, n),
449
- ref: r
450
- }, t), de = { intrinsic: "rly_ThemeSelect-module__intrinsic" }, fe = {
451
- system: "System",
452
- light: "Light",
453
- dark: "Dark"
454
- }, J = t.map((e) => ({
455
- label: fe[e],
456
- value: e
457
- })), pe = ({ className: t, label: n = "Appearance", labelVisibility: r = "visible", onValueChange: a, size: u = l.size, value: d }) => {
458
- let f = (t) => {
459
- let n = e(t);
460
- n !== void 0 && a(n);
461
- };
462
- return r === "hidden" ? /* @__PURE__ */ m(s, {
463
- "aria-label": n,
464
- className: o(i(de, "intrinsic"), t),
465
- onValueChange: f,
466
- options: J,
467
- size: u,
468
- value: d
469
- }) : /* @__PURE__ */ m(c, {
470
- ...t === void 0 ? {} : { className: t },
471
- label: n,
472
- size: u,
473
- children: (e) => /* @__PURE__ */ m(s, {
474
- ...e,
475
- onValueChange: f,
476
- options: J,
477
- size: u,
478
- value: d
479
- })
480
- });
481
- }, me = {
482
- root: "rly_ToggleGroup-module__root",
483
- item: "rly_ToggleGroup-module__item",
484
- dense: "rly_ToggleGroup-module__dense",
485
- compact: "rly_ToggleGroup-module__compact",
486
- defaultSize: "rly_ToggleGroup-module__defaultSize"
487
- }, Y = (e) => i(me, e), X = a({ size: {
488
- dense: {
489
- className: Y("dense"),
490
- purpose: "Tool-density choice beside dense controls; the default",
491
- tokens: [
492
- "control-height-dense",
493
- "type-meta",
494
- "radius-tag"
495
- ]
496
- },
497
- compact: {
498
- className: Y("compact"),
499
- purpose: "Filter rows beside compact controls",
500
- tokens: [
501
- "control-height-compact",
502
- "type-meta",
503
- "radius-tag"
504
- ]
505
- },
506
- default: {
507
- className: Y("defaultSize"),
508
- purpose: "Standard view and filter choices",
509
- tokens: [
510
- "control-height-default",
511
- "type-label",
512
- "radius-tag"
513
- ]
514
- }
515
- } }), Z = a({ size: "dense" }), Q = (e) => e === "ArrowLeft" || e === "ArrowUp" ? -1 : e === "ArrowRight" || e === "ArrowDown" ? 1 : null, he = (e, t) => {
516
- let n = /* @__PURE__ */ new Set();
517
- for (let t of e) {
518
- let e = r(t.value, "ToggleGroup item value");
519
- if (r(t.label, `ToggleGroup item label for ${e}`), n.has(e)) throw Error(`ToggleGroup item values must be unique: ${e}`);
520
- n.add(e);
521
- }
522
- if (!n.has(t)) throw Error(`ToggleGroup value must identify an option: ${t}`);
523
- }, ge = ({ "aria-label": e, className: t, items: n, onValueChange: i, ref: a, size: s = Z.size, value: c, ...l }) => {
524
- let d = r(e, "ToggleGroup aria-label");
525
- he(n, c);
526
- let f = p(/* @__PURE__ */ new Map()), h = (e, t) => {
527
- let r = Q(e.key);
528
- if (r === null) return;
529
- e.preventDefault();
530
- let a = n[(t + r + n.length) % n.length];
531
- a !== void 0 && (a.value !== c && i(a.value), f.current.get(a.value)?.focus());
532
- };
533
- return /* @__PURE__ */ m(u.Root, {
534
- ...l,
535
- "aria-label": d,
536
- className: o(Y("root"), X.size[s].className, t),
537
- loop: !0,
538
- onValueChange: i,
539
- orientation: "horizontal",
540
- ref: a,
541
- value: c,
542
- children: n.map((e, t) => /* @__PURE__ */ m(u.Item, {
543
- className: Y("item"),
544
- onKeyDown: (e) => h(e, t),
545
- ref: (t) => {
546
- t === null ? f.current.delete(e.value) : f.current.set(e.value, t);
547
- },
548
- value: e.value,
549
- children: e.label
550
- }, e.value))
551
- });
552
- }, _e = {
553
- root: "rly_TrackKey-module__root",
554
- item: "rly_TrackKey-module__item",
555
- near: "rly_TrackKey-module__near",
556
- projected: "rly_TrackKey-module__projected",
557
- stale: "rly_TrackKey-module__stale",
558
- unknown: "rly_TrackKey-module__unknown"
559
- }, $ = (e) => i(_e, e), ve = [
560
- "near",
561
- "projected",
562
- "stale",
563
- "unknown"
564
- ], ye = ({ className: e, items: t, label: n, ...i }) => {
565
- if (t.length === 0) throw Error("TrackKey needs at least one mark to explain");
566
- let a = /* @__PURE__ */ new Set();
567
- for (let e of t) {
568
- if (a.has(e.mark)) throw Error(`TrackKey marks must be unique: ${e.mark}`);
569
- a.add(e.mark);
570
- }
571
- return /* @__PURE__ */ m("ul", {
572
- ...i,
573
- "aria-label": r(n, "TrackKey label"),
574
- className: o($("root"), e),
575
- role: "list",
576
- children: t.map((e) => /* @__PURE__ */ h("li", {
577
- className: $("item"),
578
- children: [/* @__PURE__ */ m("span", {
579
- "aria-hidden": "true",
580
- className: $(e.mark),
581
- "data-mark": e.mark
582
- }), r(e.label, "TrackKey item label")]
583
- }, e.mark))
584
- });
585
- };
586
- //#endregion
587
- export { ne as C, v as D, x as E, y as O, k as S, C as T, ie as _, ge as a, E as b, K as c, B as d, U as f, oe as g, L as h, X as i, ue as l, I as m, ye as n, pe as o, ce as p, Z as r, q as s, ve as t, V as u, P as v, te as w, T as x, j as y };
588
-
589
- //# sourceMappingURL=primitives-CgvvYKjR.js.map