@asanchez-sa/abby 0.1.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/alert/alert.d.ts +1 -1
- package/dist/components/alert/alert.js +2 -1
- package/dist/components/alert-dialog/alert-dialog.d.ts +10 -1
- package/dist/components/alert-dialog/alert-dialog.js +80 -3
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +3 -2
- package/dist/components/dialog/dialog.d.ts +9 -1
- package/dist/components/dialog/dialog.js +82 -3
- package/dist/components/field/field.d.ts +5 -1
- package/dist/components/field/field.js +25 -21
- package/dist/components/input/input.d.ts +12 -2
- package/dist/components/input/input.js +33 -18
- package/dist/components/meter/meter.d.ts +52 -3
- package/dist/components/meter/meter.js +535 -33
- package/dist/components/note-editor/parts/suggestions.js +2 -2
- package/dist/components/otp-input/otp-input.d.ts +14 -4
- package/dist/components/otp-input/otp-input.js +74 -39
- package/dist/components/sheet/sheet.js +1 -1
- package/dist/components/switch/switch.d.ts +9 -2
- package/dist/components/switch/switch.js +23 -17
- package/dist/components/team-mark/team-mark.d.ts +26 -0
- package/dist/components/team-mark/team-mark.js +101 -0
- package/package.json +2 -1
- package/skills/agent-ready-ui/SKILL.md +1 -1
- package/skills/blocks/SKILL.md +1 -1
- package/skills/compose-screens/SKILL.md +89 -5
- package/skills/note-editor/SKILL.md +1 -1
- package/skills/note-status/SKILL.md +1 -1
- package/skills/setup/SKILL.md +1 -1
- package/skills/theming/SKILL.md +1 -1
- package/src/blocks/shell/parts/marks.tsx +18 -4
- package/src/blocks/shell/parts/rail.tsx +7 -7
|
@@ -1,39 +1,152 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cnState } from "../../utilities/cn/index.js";
|
|
2
|
+
import { cn, cnState, cva } from "../../utilities/cn/index.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
|
-
import {
|
|
4
|
+
import { createContext, useContext, useEffect, useId, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { Meter as Meter$1, MeterIndicator as MeterIndicator$1, MeterLabel as MeterLabel$1, MeterTrack as MeterTrack$1, MeterValue as MeterValue$1 } from "@ui-sdk/react/meter";
|
|
6
7
|
// src/components/meter/meter.tsx
|
|
8
|
+
const order = [
|
|
9
|
+
"forecast",
|
|
10
|
+
"threshold",
|
|
11
|
+
"legend"
|
|
12
|
+
];
|
|
13
|
+
const MeterContext = createContext(null);
|
|
14
|
+
function useMeter(part) {
|
|
15
|
+
const scope = useContext(MeterContext);
|
|
16
|
+
if (!scope) throw new Error(`${part} goes inside a Meter`);
|
|
17
|
+
return scope;
|
|
18
|
+
}
|
|
19
|
+
/** Where a value sits between `min` and `max`, from 0 to 100, clamped. */
|
|
20
|
+
function percentOf(value, { min, max }) {
|
|
21
|
+
if (!(max > min)) return 0;
|
|
22
|
+
return Math.min(100, Math.max(0, (value - min) / (max - min) * 100));
|
|
23
|
+
}
|
|
24
|
+
function useDescription(part, scope, t0) {
|
|
25
|
+
const $ = c(5);
|
|
26
|
+
const on = t0 === void 0 ? true : t0;
|
|
27
|
+
const { describe } = scope;
|
|
28
|
+
let t1;
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[0] !== describe || $[1] !== on || $[2] !== part) {
|
|
31
|
+
t1 = () => {
|
|
32
|
+
if (!on) return;
|
|
33
|
+
describe(part, true);
|
|
34
|
+
return () => describe(part, false);
|
|
35
|
+
};
|
|
36
|
+
t2 = [
|
|
37
|
+
describe,
|
|
38
|
+
part,
|
|
39
|
+
on
|
|
40
|
+
];
|
|
41
|
+
$[0] = describe;
|
|
42
|
+
$[1] = on;
|
|
43
|
+
$[2] = part;
|
|
44
|
+
$[3] = t1;
|
|
45
|
+
$[4] = t2;
|
|
46
|
+
} else {
|
|
47
|
+
t1 = $[3];
|
|
48
|
+
t2 = $[4];
|
|
49
|
+
}
|
|
50
|
+
useEffect(t1, t2);
|
|
51
|
+
return `${scope.id}-${part}`;
|
|
52
|
+
}
|
|
7
53
|
function Meter(t0) {
|
|
8
|
-
const $ = c(
|
|
54
|
+
const $ = c(28);
|
|
9
55
|
let className;
|
|
56
|
+
let describedBy;
|
|
10
57
|
let props;
|
|
58
|
+
let t1;
|
|
59
|
+
let t2;
|
|
11
60
|
if ($[0] !== t0) {
|
|
12
|
-
({className, ...props} = t0);
|
|
61
|
+
({className, min: t1, max: t2, "aria-describedby": describedBy, ...props} = t0);
|
|
13
62
|
$[0] = t0;
|
|
14
63
|
$[1] = className;
|
|
15
|
-
$[2] =
|
|
64
|
+
$[2] = describedBy;
|
|
65
|
+
$[3] = props;
|
|
66
|
+
$[4] = t1;
|
|
67
|
+
$[5] = t2;
|
|
16
68
|
} else {
|
|
17
69
|
className = $[1];
|
|
18
|
-
|
|
70
|
+
describedBy = $[2];
|
|
71
|
+
props = $[3];
|
|
72
|
+
t1 = $[4];
|
|
73
|
+
t2 = $[5];
|
|
19
74
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
75
|
+
const min = t1 === void 0 ? 0 : t1;
|
|
76
|
+
const max = t2 === void 0 ? 100 : t2;
|
|
77
|
+
const id = useId();
|
|
78
|
+
let t3;
|
|
79
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
80
|
+
t3 = [];
|
|
81
|
+
$[6] = t3;
|
|
82
|
+
} else t3 = $[6];
|
|
83
|
+
const [described, setDescribed] = useState(t3);
|
|
84
|
+
let t4;
|
|
85
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
86
|
+
t4 = () => (part, on) => setDescribed((parts) => {
|
|
87
|
+
const next = parts.filter((each) => each !== part);
|
|
88
|
+
return on ? [...next, part] : next;
|
|
89
|
+
});
|
|
90
|
+
$[7] = t4;
|
|
91
|
+
} else t4 = $[7];
|
|
92
|
+
const [describe] = useState(t4);
|
|
93
|
+
let t5;
|
|
94
|
+
if ($[8] !== described || $[9] !== describedBy || $[10] !== id) {
|
|
95
|
+
const ids = order.filter((part_0) => described.includes(part_0)).map((part_1) => `${id}-${part_1}`);
|
|
96
|
+
t5 = [describedBy, ...ids].filter(Boolean).join(" ") || void 0;
|
|
97
|
+
$[8] = described;
|
|
98
|
+
$[9] = describedBy;
|
|
99
|
+
$[10] = id;
|
|
100
|
+
$[11] = t5;
|
|
101
|
+
} else t5 = $[11];
|
|
102
|
+
const description = t5;
|
|
103
|
+
let t6;
|
|
104
|
+
if ($[12] !== describe || $[13] !== id || $[14] !== max || $[15] !== min) {
|
|
105
|
+
t6 = {
|
|
106
|
+
min,
|
|
107
|
+
max,
|
|
108
|
+
id,
|
|
109
|
+
describe
|
|
110
|
+
};
|
|
111
|
+
$[12] = describe;
|
|
112
|
+
$[13] = id;
|
|
113
|
+
$[14] = max;
|
|
114
|
+
$[15] = min;
|
|
115
|
+
$[16] = t6;
|
|
116
|
+
} else t6 = $[16];
|
|
117
|
+
let t7;
|
|
118
|
+
if ($[17] !== className) {
|
|
119
|
+
t7 = cnState("flex w-full min-w-48 flex-wrap gap-x-3 gap-y-2", className);
|
|
120
|
+
$[17] = className;
|
|
121
|
+
$[18] = t7;
|
|
122
|
+
} else t7 = $[18];
|
|
123
|
+
let t8;
|
|
124
|
+
if ($[19] !== description || $[20] !== max || $[21] !== min || $[22] !== props || $[23] !== t7) {
|
|
125
|
+
t8 = /* @__PURE__ */ jsx(Meter$1, {
|
|
126
|
+
min,
|
|
127
|
+
max,
|
|
128
|
+
"aria-describedby": description,
|
|
129
|
+
className: t7,
|
|
30
130
|
...props
|
|
31
131
|
});
|
|
32
|
-
$[
|
|
33
|
-
$[
|
|
34
|
-
$[
|
|
35
|
-
|
|
36
|
-
|
|
132
|
+
$[19] = description;
|
|
133
|
+
$[20] = max;
|
|
134
|
+
$[21] = min;
|
|
135
|
+
$[22] = props;
|
|
136
|
+
$[23] = t7;
|
|
137
|
+
$[24] = t8;
|
|
138
|
+
} else t8 = $[24];
|
|
139
|
+
let t9;
|
|
140
|
+
if ($[25] !== t6 || $[26] !== t8) {
|
|
141
|
+
t9 = /* @__PURE__ */ jsx(MeterContext.Provider, {
|
|
142
|
+
value: t6,
|
|
143
|
+
children: t8
|
|
144
|
+
});
|
|
145
|
+
$[25] = t6;
|
|
146
|
+
$[26] = t8;
|
|
147
|
+
$[27] = t9;
|
|
148
|
+
} else t9 = $[27];
|
|
149
|
+
return t9;
|
|
37
150
|
}
|
|
38
151
|
function MeterLabel(t0) {
|
|
39
152
|
const $ = c(8);
|
|
@@ -97,7 +210,60 @@ function MeterValue(t0) {
|
|
|
97
210
|
} else t2 = $[7];
|
|
98
211
|
return t2;
|
|
99
212
|
}
|
|
213
|
+
const TrackVariant = createContext("default");
|
|
100
214
|
function MeterTrack(t0) {
|
|
215
|
+
const $ = c(13);
|
|
216
|
+
let className;
|
|
217
|
+
let props;
|
|
218
|
+
let t1;
|
|
219
|
+
if ($[0] !== t0) {
|
|
220
|
+
({className, variant: t1, ...props} = t0);
|
|
221
|
+
$[0] = t0;
|
|
222
|
+
$[1] = className;
|
|
223
|
+
$[2] = props;
|
|
224
|
+
$[3] = t1;
|
|
225
|
+
} else {
|
|
226
|
+
className = $[1];
|
|
227
|
+
props = $[2];
|
|
228
|
+
t1 = $[3];
|
|
229
|
+
}
|
|
230
|
+
const variant = t1 === void 0 ? "default" : t1;
|
|
231
|
+
let t2;
|
|
232
|
+
if ($[4] !== className) {
|
|
233
|
+
t2 = cnState([
|
|
234
|
+
"group/meter-track relative flex h-1 w-full items-center overflow-hidden rounded-full bg-muted [--meter-gap:0px]",
|
|
235
|
+
"has-data-[slot=meter-threshold]:overflow-visible",
|
|
236
|
+
"has-data-[slot=meter-forecast]:isolate",
|
|
237
|
+
"data-[variant=segmented]:gap-(--meter-gap) data-[variant=segmented]:overflow-visible data-[variant=segmented]:rounded-none data-[variant=segmented]:bg-transparent data-[variant=segmented]:[--meter-gap:--spacing(1)]"
|
|
238
|
+
], className);
|
|
239
|
+
$[4] = className;
|
|
240
|
+
$[5] = t2;
|
|
241
|
+
} else t2 = $[5];
|
|
242
|
+
let t3;
|
|
243
|
+
if ($[6] !== props || $[7] !== t2 || $[8] !== variant) {
|
|
244
|
+
t3 = /* @__PURE__ */ jsx(MeterTrack$1, {
|
|
245
|
+
"data-variant": variant,
|
|
246
|
+
className: t2,
|
|
247
|
+
...props
|
|
248
|
+
});
|
|
249
|
+
$[6] = props;
|
|
250
|
+
$[7] = t2;
|
|
251
|
+
$[8] = variant;
|
|
252
|
+
$[9] = t3;
|
|
253
|
+
} else t3 = $[9];
|
|
254
|
+
let t4;
|
|
255
|
+
if ($[10] !== t3 || $[11] !== variant) {
|
|
256
|
+
t4 = /* @__PURE__ */ jsx(TrackVariant.Provider, {
|
|
257
|
+
value: variant,
|
|
258
|
+
children: t3
|
|
259
|
+
});
|
|
260
|
+
$[10] = t3;
|
|
261
|
+
$[11] = variant;
|
|
262
|
+
$[12] = t4;
|
|
263
|
+
} else t4 = $[12];
|
|
264
|
+
return t4;
|
|
265
|
+
}
|
|
266
|
+
function MeterIndicator(t0) {
|
|
101
267
|
const $ = c(8);
|
|
102
268
|
let className;
|
|
103
269
|
let props;
|
|
@@ -112,13 +278,13 @@ function MeterTrack(t0) {
|
|
|
112
278
|
}
|
|
113
279
|
let t1;
|
|
114
280
|
if ($[3] !== className) {
|
|
115
|
-
t1 = cnState("
|
|
281
|
+
t1 = cnState("h-full bg-primary transition-[width] duration-popup ease-out motion-reduce:transition-none group-has-data-[slot=meter-forecast]/meter-track:rounded-full group-has-data-[slot=meter-threshold]/meter-track:rounded-full", className);
|
|
116
282
|
$[3] = className;
|
|
117
283
|
$[4] = t1;
|
|
118
284
|
} else t1 = $[4];
|
|
119
285
|
let t2;
|
|
120
286
|
if ($[5] !== props || $[6] !== t1) {
|
|
121
|
-
t2 = /* @__PURE__ */ jsx(
|
|
287
|
+
t2 = /* @__PURE__ */ jsx(MeterIndicator$1, {
|
|
122
288
|
className: t1,
|
|
123
289
|
...props
|
|
124
290
|
});
|
|
@@ -128,8 +294,280 @@ function MeterTrack(t0) {
|
|
|
128
294
|
} else t2 = $[7];
|
|
129
295
|
return t2;
|
|
130
296
|
}
|
|
131
|
-
|
|
132
|
-
|
|
297
|
+
/**
|
|
298
|
+
* A mark across the track at a value, like a spending alert at 80%: an ink
|
|
299
|
+
* line 2px wide that reaches 4px past the track on each side.
|
|
300
|
+
*/
|
|
301
|
+
function MeterThreshold(t0) {
|
|
302
|
+
const $ = c(23);
|
|
303
|
+
let className;
|
|
304
|
+
let label;
|
|
305
|
+
let props;
|
|
306
|
+
let style;
|
|
307
|
+
let value;
|
|
308
|
+
if ($[0] !== t0) {
|
|
309
|
+
({value, label, className, style, ...props} = t0);
|
|
310
|
+
$[0] = t0;
|
|
311
|
+
$[1] = className;
|
|
312
|
+
$[2] = label;
|
|
313
|
+
$[3] = props;
|
|
314
|
+
$[4] = style;
|
|
315
|
+
$[5] = value;
|
|
316
|
+
} else {
|
|
317
|
+
className = $[1];
|
|
318
|
+
label = $[2];
|
|
319
|
+
props = $[3];
|
|
320
|
+
style = $[4];
|
|
321
|
+
value = $[5];
|
|
322
|
+
}
|
|
323
|
+
const scope = useMeter("MeterThreshold");
|
|
324
|
+
const id = useDescription("threshold", scope, Boolean(label));
|
|
325
|
+
const t1 = label ? void 0 : true;
|
|
326
|
+
let t2;
|
|
327
|
+
if ($[6] !== className) {
|
|
328
|
+
t2 = cn("pointer-events-none absolute -inset-y-1 start-(--meter-at) w-0.5 -translate-x-1/2 rounded-full bg-foreground rtl:translate-x-1/2", className);
|
|
329
|
+
$[6] = className;
|
|
330
|
+
$[7] = t2;
|
|
331
|
+
} else t2 = $[7];
|
|
332
|
+
let t3;
|
|
333
|
+
if ($[8] !== scope || $[9] !== value) {
|
|
334
|
+
t3 = percentOf(value, scope);
|
|
335
|
+
$[8] = scope;
|
|
336
|
+
$[9] = value;
|
|
337
|
+
$[10] = t3;
|
|
338
|
+
} else t3 = $[10];
|
|
339
|
+
const t4 = `${t3}%`;
|
|
340
|
+
let t5;
|
|
341
|
+
if ($[11] !== style || $[12] !== t4) {
|
|
342
|
+
t5 = {
|
|
343
|
+
"--meter-at": t4,
|
|
344
|
+
...style
|
|
345
|
+
};
|
|
346
|
+
$[11] = style;
|
|
347
|
+
$[12] = t4;
|
|
348
|
+
$[13] = t5;
|
|
349
|
+
} else t5 = $[13];
|
|
350
|
+
const t6 = t5;
|
|
351
|
+
let t7;
|
|
352
|
+
if ($[14] !== id || $[15] !== label) {
|
|
353
|
+
t7 = label && /* @__PURE__ */ jsx("span", {
|
|
354
|
+
id,
|
|
355
|
+
className: "sr-only",
|
|
356
|
+
children: label
|
|
357
|
+
});
|
|
358
|
+
$[14] = id;
|
|
359
|
+
$[15] = label;
|
|
360
|
+
$[16] = t7;
|
|
361
|
+
} else t7 = $[16];
|
|
362
|
+
let t8;
|
|
363
|
+
if ($[17] !== props || $[18] !== t1 || $[19] !== t2 || $[20] !== t6 || $[21] !== t7) {
|
|
364
|
+
t8 = /* @__PURE__ */ jsx("span", {
|
|
365
|
+
"data-slot": "meter-threshold",
|
|
366
|
+
"aria-hidden": t1,
|
|
367
|
+
className: t2,
|
|
368
|
+
style: t6,
|
|
369
|
+
...props,
|
|
370
|
+
children: t7
|
|
371
|
+
});
|
|
372
|
+
$[17] = props;
|
|
373
|
+
$[18] = t1;
|
|
374
|
+
$[19] = t2;
|
|
375
|
+
$[20] = t6;
|
|
376
|
+
$[21] = t7;
|
|
377
|
+
$[22] = t8;
|
|
378
|
+
} else t8 = $[22];
|
|
379
|
+
return t8;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Where the value is heading, like the month's spending at this pace: a
|
|
383
|
+
* lighter fill from the track's start, behind the value.
|
|
384
|
+
*/
|
|
385
|
+
function MeterForecast(t0) {
|
|
386
|
+
const $ = c(22);
|
|
387
|
+
let className;
|
|
388
|
+
let label;
|
|
389
|
+
let props;
|
|
390
|
+
let style;
|
|
391
|
+
let value;
|
|
392
|
+
if ($[0] !== t0) {
|
|
393
|
+
({value, label, className, style, ...props} = t0);
|
|
394
|
+
$[0] = t0;
|
|
395
|
+
$[1] = className;
|
|
396
|
+
$[2] = label;
|
|
397
|
+
$[3] = props;
|
|
398
|
+
$[4] = style;
|
|
399
|
+
$[5] = value;
|
|
400
|
+
} else {
|
|
401
|
+
className = $[1];
|
|
402
|
+
label = $[2];
|
|
403
|
+
props = $[3];
|
|
404
|
+
style = $[4];
|
|
405
|
+
value = $[5];
|
|
406
|
+
}
|
|
407
|
+
const scope = useMeter("MeterForecast");
|
|
408
|
+
const id = useDescription("forecast", scope, Boolean(label));
|
|
409
|
+
let t1;
|
|
410
|
+
if ($[6] !== className) {
|
|
411
|
+
t1 = cn("pointer-events-none absolute inset-y-0 start-0 -z-1 w-(--meter-at) rounded-full bg-foreground/15 transition-[width] duration-popup ease-out motion-reduce:transition-none", className);
|
|
412
|
+
$[6] = className;
|
|
413
|
+
$[7] = t1;
|
|
414
|
+
} else t1 = $[7];
|
|
415
|
+
let t2;
|
|
416
|
+
if ($[8] !== scope || $[9] !== value) {
|
|
417
|
+
t2 = percentOf(value, scope);
|
|
418
|
+
$[8] = scope;
|
|
419
|
+
$[9] = value;
|
|
420
|
+
$[10] = t2;
|
|
421
|
+
} else t2 = $[10];
|
|
422
|
+
const t3 = `${t2}%`;
|
|
423
|
+
let t4;
|
|
424
|
+
if ($[11] !== style || $[12] !== t3) {
|
|
425
|
+
t4 = {
|
|
426
|
+
"--meter-at": t3,
|
|
427
|
+
...style
|
|
428
|
+
};
|
|
429
|
+
$[11] = style;
|
|
430
|
+
$[12] = t3;
|
|
431
|
+
$[13] = t4;
|
|
432
|
+
} else t4 = $[13];
|
|
433
|
+
const t5 = t4;
|
|
434
|
+
let t6;
|
|
435
|
+
if ($[14] !== id || $[15] !== label) {
|
|
436
|
+
t6 = label && /* @__PURE__ */ jsx("span", {
|
|
437
|
+
id,
|
|
438
|
+
className: "sr-only",
|
|
439
|
+
children: label
|
|
440
|
+
});
|
|
441
|
+
$[14] = id;
|
|
442
|
+
$[15] = label;
|
|
443
|
+
$[16] = t6;
|
|
444
|
+
} else t6 = $[16];
|
|
445
|
+
let t7;
|
|
446
|
+
if ($[17] !== props || $[18] !== t1 || $[19] !== t5 || $[20] !== t6) {
|
|
447
|
+
t7 = /* @__PURE__ */ jsx("span", {
|
|
448
|
+
"data-slot": "meter-forecast",
|
|
449
|
+
className: t1,
|
|
450
|
+
style: t5,
|
|
451
|
+
...props,
|
|
452
|
+
children: t6
|
|
453
|
+
});
|
|
454
|
+
$[17] = props;
|
|
455
|
+
$[18] = t1;
|
|
456
|
+
$[19] = t5;
|
|
457
|
+
$[20] = t6;
|
|
458
|
+
$[21] = t7;
|
|
459
|
+
} else t7 = $[21];
|
|
460
|
+
return t7;
|
|
461
|
+
}
|
|
462
|
+
const meterSegmentVariants = cva("", {
|
|
463
|
+
variants: { variant: {
|
|
464
|
+
default: "bg-primary",
|
|
465
|
+
muted: "bg-placeholder",
|
|
466
|
+
empty: "bg-sidebar-accent",
|
|
467
|
+
forecast: "bg-foreground/15"
|
|
468
|
+
} },
|
|
469
|
+
defaultVariants: { variant: "default" }
|
|
470
|
+
});
|
|
471
|
+
/**
|
|
472
|
+
* One part of a stacked bar, in place of the indicator: segments follow each
|
|
473
|
+
* other from the track's start, each as wide as its share of the range.
|
|
474
|
+
* Name each one in a `MeterLegend`, and give the meter the sum as its value.
|
|
475
|
+
*/
|
|
476
|
+
function MeterSegment(t0) {
|
|
477
|
+
const $ = c(27);
|
|
478
|
+
let className;
|
|
479
|
+
let props;
|
|
480
|
+
let style;
|
|
481
|
+
let value;
|
|
482
|
+
let variant;
|
|
483
|
+
if ($[0] !== t0) {
|
|
484
|
+
({value, variant, className, style, ...props} = t0);
|
|
485
|
+
$[0] = t0;
|
|
486
|
+
$[1] = className;
|
|
487
|
+
$[2] = props;
|
|
488
|
+
$[3] = style;
|
|
489
|
+
$[4] = value;
|
|
490
|
+
$[5] = variant;
|
|
491
|
+
} else {
|
|
492
|
+
className = $[1];
|
|
493
|
+
props = $[2];
|
|
494
|
+
style = $[3];
|
|
495
|
+
value = $[4];
|
|
496
|
+
variant = $[5];
|
|
497
|
+
}
|
|
498
|
+
const scope = useMeter("MeterSegment");
|
|
499
|
+
const track = useContext(TrackVariant);
|
|
500
|
+
const range = scope.max - scope.min;
|
|
501
|
+
const units = Math.max(0, Math.min(value, range));
|
|
502
|
+
const basis = range > 0 ? `calc(${units} * (100% + var(--meter-gap)) / ${range} - var(--meter-gap))` : "0";
|
|
503
|
+
let t1;
|
|
504
|
+
if ($[6] !== track || $[7] !== units) {
|
|
505
|
+
t1 = track === "segmented" ? Math.min(Math.round(units), 500) : 0;
|
|
506
|
+
$[6] = track;
|
|
507
|
+
$[7] = units;
|
|
508
|
+
$[8] = t1;
|
|
509
|
+
} else t1 = $[8];
|
|
510
|
+
const cells = t1;
|
|
511
|
+
const t2 = variant ?? "default";
|
|
512
|
+
let t3;
|
|
513
|
+
if ($[9] !== cells || $[10] !== className || $[11] !== variant) {
|
|
514
|
+
t3 = cn("h-full min-w-0 shrink transition-[flex-basis] duration-popup ease-out motion-reduce:transition-none", cells ? "flex gap-(--meter-gap)" : [meterSegmentVariants({ variant }), "group-has-data-[slot=meter-threshold]/meter-track:first-of-type:rounded-s-full group-has-data-[slot=meter-threshold]/meter-track:last-of-type:rounded-e-full"], className);
|
|
515
|
+
$[9] = cells;
|
|
516
|
+
$[10] = className;
|
|
517
|
+
$[11] = variant;
|
|
518
|
+
$[12] = t3;
|
|
519
|
+
} else t3 = $[12];
|
|
520
|
+
let t4;
|
|
521
|
+
if ($[13] !== basis || $[14] !== style) {
|
|
522
|
+
t4 = {
|
|
523
|
+
flexBasis: basis,
|
|
524
|
+
...style
|
|
525
|
+
};
|
|
526
|
+
$[13] = basis;
|
|
527
|
+
$[14] = style;
|
|
528
|
+
$[15] = t4;
|
|
529
|
+
} else t4 = $[15];
|
|
530
|
+
let t5;
|
|
531
|
+
if ($[16] !== cells || $[17] !== variant) {
|
|
532
|
+
let t6;
|
|
533
|
+
if ($[19] !== variant) {
|
|
534
|
+
t6 = (_, cell) => /* @__PURE__ */ jsx("div", {
|
|
535
|
+
"data-slot": "meter-cell",
|
|
536
|
+
className: cn("h-full flex-1 rounded-[calc(var(--radius)*0.3)]", meterSegmentVariants({ variant }))
|
|
537
|
+
}, cell);
|
|
538
|
+
$[19] = variant;
|
|
539
|
+
$[20] = t6;
|
|
540
|
+
} else t6 = $[20];
|
|
541
|
+
t5 = Array.from({ length: cells }, t6);
|
|
542
|
+
$[16] = cells;
|
|
543
|
+
$[17] = variant;
|
|
544
|
+
$[18] = t5;
|
|
545
|
+
} else t5 = $[18];
|
|
546
|
+
let t6;
|
|
547
|
+
if ($[21] !== props || $[22] !== t2 || $[23] !== t3 || $[24] !== t4 || $[25] !== t5) {
|
|
548
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
549
|
+
"data-slot": "meter-segment",
|
|
550
|
+
"data-variant": t2,
|
|
551
|
+
className: t3,
|
|
552
|
+
style: t4,
|
|
553
|
+
...props,
|
|
554
|
+
children: t5
|
|
555
|
+
});
|
|
556
|
+
$[21] = props;
|
|
557
|
+
$[22] = t2;
|
|
558
|
+
$[23] = t3;
|
|
559
|
+
$[24] = t4;
|
|
560
|
+
$[25] = t5;
|
|
561
|
+
$[26] = t6;
|
|
562
|
+
} else t6 = $[26];
|
|
563
|
+
return t6;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* What each segment is, with its swatch. It describes the meter, so a screen
|
|
567
|
+
* reader hears every segment's name after the value: keep it inside `Meter`.
|
|
568
|
+
*/
|
|
569
|
+
function MeterLegend(t0) {
|
|
570
|
+
const $ = c(9);
|
|
133
571
|
let className;
|
|
134
572
|
let props;
|
|
135
573
|
if ($[0] !== t0) {
|
|
@@ -141,22 +579,86 @@ function MeterIndicator(t0) {
|
|
|
141
579
|
className = $[1];
|
|
142
580
|
props = $[2];
|
|
143
581
|
}
|
|
582
|
+
const id = useDescription("legend", useMeter("MeterLegend"));
|
|
144
583
|
let t1;
|
|
145
584
|
if ($[3] !== className) {
|
|
146
|
-
t1 =
|
|
585
|
+
t1 = cn("flex w-full flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground", className);
|
|
147
586
|
$[3] = className;
|
|
148
587
|
$[4] = t1;
|
|
149
588
|
} else t1 = $[4];
|
|
150
589
|
let t2;
|
|
151
|
-
if ($[5] !==
|
|
152
|
-
t2 = /* @__PURE__ */ jsx(
|
|
590
|
+
if ($[5] !== id || $[6] !== props || $[7] !== t1) {
|
|
591
|
+
t2 = /* @__PURE__ */ jsx("ul", {
|
|
592
|
+
id,
|
|
593
|
+
"data-slot": "meter-legend",
|
|
153
594
|
className: t1,
|
|
154
595
|
...props
|
|
155
596
|
});
|
|
156
|
-
$[5] =
|
|
157
|
-
$[6] =
|
|
158
|
-
$[7] =
|
|
159
|
-
|
|
597
|
+
$[5] = id;
|
|
598
|
+
$[6] = props;
|
|
599
|
+
$[7] = t1;
|
|
600
|
+
$[8] = t2;
|
|
601
|
+
} else t2 = $[8];
|
|
160
602
|
return t2;
|
|
161
603
|
}
|
|
162
|
-
|
|
604
|
+
function MeterLegendItem(t0) {
|
|
605
|
+
const $ = c(17);
|
|
606
|
+
let children;
|
|
607
|
+
let className;
|
|
608
|
+
let props;
|
|
609
|
+
let variant;
|
|
610
|
+
if ($[0] !== t0) {
|
|
611
|
+
({variant, className, children, ...props} = t0);
|
|
612
|
+
$[0] = t0;
|
|
613
|
+
$[1] = children;
|
|
614
|
+
$[2] = className;
|
|
615
|
+
$[3] = props;
|
|
616
|
+
$[4] = variant;
|
|
617
|
+
} else {
|
|
618
|
+
children = $[1];
|
|
619
|
+
className = $[2];
|
|
620
|
+
props = $[3];
|
|
621
|
+
variant = $[4];
|
|
622
|
+
}
|
|
623
|
+
const t1 = variant ?? "default";
|
|
624
|
+
let t2;
|
|
625
|
+
if ($[5] !== className) {
|
|
626
|
+
t2 = cn("flex items-center gap-1.5", className);
|
|
627
|
+
$[5] = className;
|
|
628
|
+
$[6] = t2;
|
|
629
|
+
} else t2 = $[6];
|
|
630
|
+
let t3;
|
|
631
|
+
if ($[7] !== variant) {
|
|
632
|
+
t3 = cn("size-2 shrink-0 rounded-2xs", meterSegmentVariants({ variant }), variant === "empty" && "ring-1 ring-border ring-inset", variant === "forecast" && "w-3");
|
|
633
|
+
$[7] = variant;
|
|
634
|
+
$[8] = t3;
|
|
635
|
+
} else t3 = $[8];
|
|
636
|
+
let t4;
|
|
637
|
+
if ($[9] !== t3) {
|
|
638
|
+
t4 = /* @__PURE__ */ jsx("span", {
|
|
639
|
+
"aria-hidden": true,
|
|
640
|
+
"data-slot": "meter-legend-swatch",
|
|
641
|
+
className: t3
|
|
642
|
+
});
|
|
643
|
+
$[9] = t3;
|
|
644
|
+
$[10] = t4;
|
|
645
|
+
} else t4 = $[10];
|
|
646
|
+
let t5;
|
|
647
|
+
if ($[11] !== children || $[12] !== props || $[13] !== t1 || $[14] !== t2 || $[15] !== t4) {
|
|
648
|
+
t5 = /* @__PURE__ */ jsxs("li", {
|
|
649
|
+
"data-slot": "meter-legend-item",
|
|
650
|
+
"data-variant": t1,
|
|
651
|
+
className: t2,
|
|
652
|
+
...props,
|
|
653
|
+
children: [t4, children]
|
|
654
|
+
});
|
|
655
|
+
$[11] = children;
|
|
656
|
+
$[12] = props;
|
|
657
|
+
$[13] = t1;
|
|
658
|
+
$[14] = t2;
|
|
659
|
+
$[15] = t4;
|
|
660
|
+
$[16] = t5;
|
|
661
|
+
} else t5 = $[16];
|
|
662
|
+
return t5;
|
|
663
|
+
}
|
|
664
|
+
export { Meter, MeterForecast, MeterIndicator, MeterLabel, MeterLegend, MeterLegendItem, MeterSegment, MeterThreshold, MeterTrack, MeterValue, meterSegmentVariants };
|
|
@@ -41,13 +41,13 @@ function NoteEditorAssistantMark(t0) {
|
|
|
41
41
|
}
|
|
42
42
|
let t1;
|
|
43
43
|
if ($[3] !== className) {
|
|
44
|
-
t1 = cn("flex size-4 shrink-0 items-center justify-center rounded-xs bg-
|
|
44
|
+
t1 = cn("flex size-4 shrink-0 items-center justify-center rounded-xs bg-[#1d1d1f] dark:ring-1 dark:ring-[#ffffff24] dark:ring-inset", className);
|
|
45
45
|
$[3] = className;
|
|
46
46
|
$[4] = t1;
|
|
47
47
|
} else t1 = $[4];
|
|
48
48
|
let t2;
|
|
49
49
|
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
50
|
-
t2 = /* @__PURE__ */ jsx("span", { className: "size-1 rounded-full bg-
|
|
50
|
+
t2 = /* @__PURE__ */ jsx("span", { className: "size-1 rounded-full bg-[#8e5be0]" });
|
|
51
51
|
$[5] = t2;
|
|
52
52
|
} else t2 = $[5];
|
|
53
53
|
let t3;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
import { VariantProps } from "../../utilities/cn/index.js";
|
|
1
2
|
import { ComponentProps } from "react";
|
|
2
3
|
import { OTPInput as OTPInput$1, OTPInputGroup as OTPInputGroup$1, OTPInputSeparator as OTPInputSeparator$1, OTPInputSlot as OTPInputSlot$1, createOTPInputController } from "@ui-sdk/react/otp-input";
|
|
3
4
|
declare function OTPInput({ className, ...props }: ComponentProps<typeof OTPInput$1>): import("react").JSX.Element;
|
|
4
5
|
declare function OTPInputGroup({ className, ...props }: ComponentProps<typeof OTPInputGroup$1>): import("react").JSX.Element;
|
|
6
|
+
declare const otpInputSlotVariants: (props?: ({
|
|
7
|
+
size?: "default" | "lg" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
type OTPInputSlotProps = ComponentProps<typeof OTPInputSlot$1> & VariantProps<typeof otpInputSlotVariants>;
|
|
5
10
|
/**
|
|
6
11
|
* One cell, with the look of `Input`: a one-character field, so a circle. The one real input sits over all the
|
|
7
|
-
* cells and takes focus, so the active cell draws
|
|
8
|
-
* caret itself.
|
|
12
|
+
* cells and takes focus, so the active cell draws a field's focus and the
|
|
13
|
+
* caret itself. `size="lg"` is the 48px cell of a screen that asks only for
|
|
14
|
+
* the code; the default stays at a field's 36px.
|
|
9
15
|
*/
|
|
10
|
-
declare function OTPInputSlot({ className, ...props }:
|
|
11
|
-
|
|
16
|
+
declare function OTPInputSlot({ className, size, ...props }: OTPInputSlotProps): import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* The mark between two groups. With no children it draws Alma's: a short
|
|
19
|
+
* 8px bar, 1.5px thick, in a faint gray. Children replace it whole.
|
|
20
|
+
*/
|
|
21
|
+
declare function OTPInputSeparator({ className, children, ...props }: ComponentProps<typeof OTPInputSeparator$1>): import("react").JSX.Element;
|
|
12
22
|
export { OTPInput, OTPInputGroup, OTPInputSeparator, OTPInputSlot, createOTPInputController };
|