@alfadocs/ui-kit-debug 0.58.0 → 0.60.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/dist/_chunks/{bishop-score-CMQxsdy4.js → bishop-score-B9tvgoIq.js} +2 -2
- package/dist/_chunks/{bishop-score-CMQxsdy4.js.map → bishop-score-B9tvgoIq.js.map} +1 -1
- package/dist/_chunks/{bmi-calculator-DuUneHuZ.js → bmi-calculator-DA2NGmVK.js} +2 -2
- package/dist/_chunks/{bmi-calculator-DuUneHuZ.js.map → bmi-calculator-DA2NGmVK.js.map} +1 -1
- package/dist/_chunks/{calendar-oYWOCrnf.js → calendar-CkuJIg3s.js} +1 -1
- package/dist/_chunks/{calendar-oYWOCrnf.js.map → calendar-CkuJIg3s.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-vTtZZAmn.js → cycle-calculator-C_t1Hs8V.js} +2 -2
- package/dist/_chunks/{cycle-calculator-vTtZZAmn.js.map → cycle-calculator-C_t1Hs8V.js.map} +1 -1
- package/dist/_chunks/date-picker-variants-CXEAx3O_.js.map +1 -1
- package/dist/_chunks/{due-date-calculator-CUm5KJbf.js → due-date-calculator-Q8MIwEVV.js} +2 -2
- package/dist/_chunks/{due-date-calculator-CUm5KJbf.js.map → due-date-calculator-Q8MIwEVV.js.map} +1 -1
- package/dist/_chunks/{fetal-weight-Xf8-ZoDy.js → fetal-weight-D1a6BmM-.js} +2 -2
- package/dist/_chunks/{fetal-weight-Xf8-ZoDy.js.map → fetal-weight-D1a6BmM-.js.map} +1 -1
- package/dist/_chunks/{gestational-age-calculator-830KJql3.js → gestational-age-calculator-AkNFfZYs.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-830KJql3.js.map → gestational-age-calculator-AkNFfZYs.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-kVOpDfny.js → hcg-doubling-Dg0Hr7ey.js} +2 -2
- package/dist/_chunks/{hcg-doubling-kVOpDfny.js.map → hcg-doubling-Dg0Hr7ey.js.map} +1 -1
- package/dist/_chunks/{insert-result-njqBthzT.js → insert-result-C1SYdueh.js} +125 -115
- package/dist/_chunks/insert-result-C1SYdueh.js.map +1 -0
- package/dist/_chunks/{pregnancy-dating-BA37LSkF.js → pregnancy-dating-Dg6dTe1p.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-BA37LSkF.js.map → pregnancy-dating-Dg6dTe1p.js.map} +1 -1
- package/dist/_chunks/{pregnancy-weight-gain-BMRBeA8V.js → pregnancy-weight-gain-DI7X-0JX.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-BMRBeA8V.js.map → pregnancy-weight-gain-DI7X-0JX.js.map} +1 -1
- package/dist/_chunks/rich-text-editor-B03qM22-.js +334 -0
- package/dist/_chunks/rich-text-editor-B03qM22-.js.map +1 -0
- package/dist/_chunks/{unit-converter-BQ6lEYvd.js → unit-converter-3sINXO3m.js} +2 -2
- package/dist/_chunks/{unit-converter-BQ6lEYvd.js.map → unit-converter-3sINXO3m.js.map} +1 -1
- package/dist/agent-catalog.json +2 -2
- package/dist/components/_shared/safe-html.d.ts +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/rich-text-editor/index.d.ts +2 -2
- package/dist/components/rich-text-editor/index.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +4 -7
- package/dist/components/rich-text-editor/rich-text-editor.agent.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +21 -15
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +1 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +1 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +1 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +1 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +1 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +1 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +1 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +1 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +1 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +1 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +1 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +1 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +1 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +1 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +1 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +1 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +1 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +1 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +1 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +1 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +1 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +1 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +1 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +1 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +1 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +1 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +1 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +1 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +1 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +1 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +1 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +1 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +1 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +1 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +143 -146
- package/dist/locales/ar.json +1 -0
- package/dist/locales/de.json +1 -0
- package/dist/locales/el.json +1 -0
- package/dist/locales/en.json +1 -0
- package/dist/locales/es.json +1 -0
- package/dist/locales/fr.json +1 -0
- package/dist/locales/hi.json +1 -0
- package/dist/locales/it.json +1 -0
- package/dist/locales/ja.json +1 -0
- package/dist/locales/nl.json +1 -0
- package/dist/locales/pl.json +1 -0
- package/dist/locales/pt.json +1 -0
- package/dist/locales/ro.json +1 -0
- package/dist/locales/ru.json +1 -0
- package/dist/locales/sq.json +1 -0
- package/dist/locales/sv.json +1 -0
- package/dist/locales/tr.json +1 -0
- package/dist/locales/zh.json +1 -0
- package/dist/safe-html/index.js.map +1 -1
- package/dist/tokens.css +23 -25
- package/package.json +2 -52
- package/dist/_chunks/image-C6RM5hfF.js +0 -16
- package/dist/_chunks/image-C6RM5hfF.js.map +0 -1
- package/dist/_chunks/insert-result-njqBthzT.js.map +0 -1
- package/dist/_chunks/rich-text-editor-DhGIBd4a.js +0 -921
- package/dist/_chunks/rich-text-editor-DhGIBd4a.js.map +0 -1
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import { jsxs as P, jsx as g } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as ht, useRef as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { c as
|
|
5
|
-
import { B as
|
|
6
|
-
import { L as
|
|
7
|
-
import {
|
|
8
|
-
import { c as Pt } from "./createLucideIcon-CrFbzy84.js";
|
|
2
|
+
import { forwardRef as ht, useRef as Dt } from "react";
|
|
3
|
+
import { useTranslation as Nt } from "react-i18next";
|
|
4
|
+
import { c as Gt } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { B as Ht } from "./button-DD_0Xdmr.js";
|
|
6
|
+
import { L as Rt } from "./layers-pzGcbLPj.js";
|
|
7
|
+
import { c as pt } from "./createLucideIcon-CrFbzy84.js";
|
|
9
8
|
/**
|
|
10
9
|
* @license lucide-react v1.8.0 - ISC
|
|
11
10
|
*
|
|
12
11
|
* This source code is licensed under the ISC license.
|
|
13
12
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
13
|
*/
|
|
15
|
-
const
|
|
14
|
+
const Pt = [
|
|
15
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
16
|
+
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
17
|
+
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
18
|
+
], Ft = pt("image", Pt);
|
|
19
|
+
/**
|
|
20
|
+
* @license lucide-react v1.8.0 - ISC
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the ISC license.
|
|
23
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/
|
|
25
|
+
const Ot = [
|
|
16
26
|
["path", { d: "M12 4v16", key: "1654pz" }],
|
|
17
27
|
["path", { d: "M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2", key: "e0r10z" }],
|
|
18
28
|
["path", { d: "M9 20h6", key: "s66wpe" }]
|
|
19
|
-
],
|
|
29
|
+
], Ut = pt("type", Ot), zt = 15, at = 40, Wt = [18.5, 25, 30];
|
|
20
30
|
function Mn() {
|
|
21
31
|
return {
|
|
22
32
|
bands: [
|
|
@@ -25,19 +35,19 @@ function Mn() {
|
|
|
25
35
|
{ upTo: 30, colorToken: "--warning-readable" },
|
|
26
36
|
{ upTo: at, colorToken: "--destructive" }
|
|
27
37
|
],
|
|
28
|
-
min:
|
|
38
|
+
min: zt,
|
|
29
39
|
max: at,
|
|
30
|
-
ticks: [...
|
|
40
|
+
ticks: [...Wt]
|
|
31
41
|
};
|
|
32
42
|
}
|
|
33
|
-
const V = 14, j = 12,
|
|
43
|
+
const V = 14, j = 12, Xt = j / 2, ot = 18, Vt = 12, jt = 16;
|
|
34
44
|
function N(t, n, i, a, o) {
|
|
35
45
|
if (i <= n) return a;
|
|
36
46
|
const r = (t - n) / (i - n);
|
|
37
47
|
return a + r * (o - a);
|
|
38
48
|
}
|
|
39
|
-
function
|
|
40
|
-
const a = V, o = n - V, r = ot +
|
|
49
|
+
function bt(t, { width: n, height: i }) {
|
|
50
|
+
const a = V, o = n - V, r = ot + Vt, e = ot, c = r + j + jt;
|
|
41
51
|
let u = t.min;
|
|
42
52
|
const d = t.bands.map((l) => {
|
|
43
53
|
const T = Math.max(t.min, Math.min(u, t.max)), y = Math.max(t.min, Math.min(l.upTo, t.max));
|
|
@@ -55,7 +65,7 @@ function pt(t, { width: n, height: i }) {
|
|
|
55
65
|
barEnd: o,
|
|
56
66
|
barY: r,
|
|
57
67
|
barH: j,
|
|
58
|
-
barRadius:
|
|
68
|
+
barRadius: Xt,
|
|
59
69
|
bands: d,
|
|
60
70
|
marker: {
|
|
61
71
|
x: k,
|
|
@@ -72,23 +82,23 @@ function pt(t, { width: n, height: i }) {
|
|
|
72
82
|
};
|
|
73
83
|
}
|
|
74
84
|
const s = (t) => Math.round(t * 100) / 100, M = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
75
|
-
function
|
|
85
|
+
function mt(t, n, i, a, o, r) {
|
|
76
86
|
const e = t + i, c = n + a, u = r > 0 ? `A${r} ${r} 0 0 1 ${s(e)} ${s(n + r)}` : "", d = r > 0 ? `A${r} ${r} 0 0 1 ${s(e - r)} ${s(c)}` : "", f = o > 0 ? `A${o} ${o} 0 0 1 ${s(t)} ${s(c - o)}` : "", b = o > 0 ? `A${o} ${o} 0 0 1 ${s(t + o)} ${s(n)}` : "";
|
|
77
87
|
return `M${s(t + o)} ${s(n)} H${s(e - r)} ${u} V${s(
|
|
78
88
|
c - r
|
|
79
89
|
)} ${d} H${s(t + o)} ${f} V${s(n + o)} ${b} Z`;
|
|
80
90
|
}
|
|
81
|
-
function
|
|
91
|
+
function Kt(t, n) {
|
|
82
92
|
const { resolve: i, font: a, fg: o, muted: r, track: e } = n, c = M(a), u = `<rect x="${s(t.barStart)}" y="${s(
|
|
83
93
|
t.barY
|
|
84
94
|
)}" width="${s(t.barEnd - t.barStart)}" height="${t.barH}" rx="${t.barRadius}" fill="${e}"/>`, d = t.bands.length, f = t.bands.map((m, x) => {
|
|
85
|
-
const C = i(m.colorToken),
|
|
86
|
-
return `<path d="${
|
|
95
|
+
const C = i(m.colorToken), _ = x === 0 ? t.barRadius : 0, U = x === d - 1 ? t.barRadius : 0;
|
|
96
|
+
return `<path d="${mt(
|
|
87
97
|
m.x,
|
|
88
98
|
t.barY,
|
|
89
99
|
m.w,
|
|
90
100
|
t.barH,
|
|
91
|
-
|
|
101
|
+
_,
|
|
92
102
|
U
|
|
93
103
|
)}" fill="${C}"/>`;
|
|
94
104
|
}).join(""), b = t.barY + t.barH, k = b + 4, h = t.ticks.map((m) => {
|
|
@@ -137,13 +147,13 @@ function jt(t, n) {
|
|
|
137
147
|
t.ariaLabel
|
|
138
148
|
)}">${D}${u}${f}${h}${y}${E}${w}${B}${S}</g>`;
|
|
139
149
|
}
|
|
140
|
-
const
|
|
141
|
-
function
|
|
150
|
+
const Zt = 260, Q = 64;
|
|
151
|
+
function qt(t) {
|
|
142
152
|
return `var(${t})`;
|
|
143
153
|
}
|
|
144
|
-
const
|
|
145
|
-
function({ model: n, width: i =
|
|
146
|
-
const e =
|
|
154
|
+
const Jt = ht(
|
|
155
|
+
function({ model: n, width: i = Zt, height: a = Q, className: o }, r) {
|
|
156
|
+
const e = bt(n, { width: i, height: a }), c = e.barY + e.barH, u = c + 4, d = e.barY - 3, f = e.barY + e.barH + 3, b = e.barY - 4, k = e.bands.length, h = e.barY + e.barH / 2;
|
|
147
157
|
return /* @__PURE__ */ P(
|
|
148
158
|
"svg",
|
|
149
159
|
{
|
|
@@ -172,7 +182,7 @@ const qt = ht(
|
|
|
172
182
|
e.bands.map(($, l) => /* @__PURE__ */ g(
|
|
173
183
|
"path",
|
|
174
184
|
{
|
|
175
|
-
d:
|
|
185
|
+
d: mt(
|
|
176
186
|
$.x,
|
|
177
187
|
e.barY,
|
|
178
188
|
$.w,
|
|
@@ -180,7 +190,7 @@ const qt = ht(
|
|
|
180
190
|
l === 0 ? e.barRadius : 0,
|
|
181
191
|
l === k - 1 ? e.barRadius : 0
|
|
182
192
|
),
|
|
183
|
-
fill:
|
|
193
|
+
fill: qt($.colorToken)
|
|
184
194
|
},
|
|
185
195
|
`${$.colorToken}-${l}`
|
|
186
196
|
)),
|
|
@@ -282,8 +292,8 @@ const qt = ht(
|
|
|
282
292
|
);
|
|
283
293
|
}
|
|
284
294
|
);
|
|
285
|
-
|
|
286
|
-
const
|
|
295
|
+
Jt.displayName = "BandedGauge";
|
|
296
|
+
const Qt = 24, gt = 18, G = 12, xt = {
|
|
287
297
|
activity: '<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/>',
|
|
288
298
|
scale: '<path d="M12 3v18"/><path d="m19 8 3 8a5 5 0 0 1-6 0zV7"/><path d="M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1"/><path d="m5 8 3 8a5 5 0 0 1-6 0zV7"/><path d="M7 21h10"/>',
|
|
289
299
|
ruler: '<path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z"/><path d="m14.5 12.5 2-2"/><path d="m11.5 9.5 2-2"/><path d="m8.5 6.5 2-2"/><path d="m17.5 15.5 2-2"/>',
|
|
@@ -297,22 +307,22 @@ const Jt = 24, mt = 18, G = 12, gt = {
|
|
|
297
307
|
"trending-up": '<path d="M16 7h6v6"/><path d="m22 7-8.5 8.5-5-5L2 17"/>',
|
|
298
308
|
percent: '<line x1="19" x2="5" y1="5" y2="19"/><circle cx="6.5" cy="6.5" r="2.5"/><circle cx="17.5" cy="17.5" r="2.5"/>'
|
|
299
309
|
};
|
|
300
|
-
function
|
|
301
|
-
return Object.prototype.hasOwnProperty.call(
|
|
310
|
+
function vt(t) {
|
|
311
|
+
return Object.prototype.hasOwnProperty.call(xt, t);
|
|
302
312
|
}
|
|
303
313
|
function rt(t, n, i, a, o) {
|
|
304
|
-
if (!
|
|
305
|
-
const r = o /
|
|
306
|
-
return `<g transform="translate(${i} ${a}) scale(${r})" fill="none" color="${n}" stroke="${n}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${
|
|
314
|
+
if (!vt(t)) return "";
|
|
315
|
+
const r = o / Qt;
|
|
316
|
+
return `<g transform="translate(${i} ${a}) scale(${r})" fill="none" color="${n}" stroke="${n}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${xt[t]}</g>`;
|
|
307
317
|
}
|
|
308
318
|
function Y(t) {
|
|
309
319
|
return t.variant === "banded";
|
|
310
320
|
}
|
|
311
|
-
const
|
|
312
|
-
function
|
|
321
|
+
const tn = ["fg", "muted", "accent", "border", "bg"], tt = "--primary", F = 380, kt = (t) => t.trim().replace(/^--/, "");
|
|
322
|
+
function nn(t) {
|
|
313
323
|
return `ds:text-[color:var(${t})]`;
|
|
314
324
|
}
|
|
315
|
-
function
|
|
325
|
+
function yt(t) {
|
|
316
326
|
return t.highlightToken ?? tt;
|
|
317
327
|
}
|
|
318
328
|
function W(t) {
|
|
@@ -321,7 +331,7 @@ function W(t) {
|
|
|
321
331
|
const a = t.highlightToken ?? tt;
|
|
322
332
|
n.add(a), n.add(`${a}-foreground`);
|
|
323
333
|
}
|
|
324
|
-
const i =
|
|
334
|
+
const i = yt(t);
|
|
325
335
|
if (n.add(i), t.gauge)
|
|
326
336
|
if (Y(t.gauge))
|
|
327
337
|
for (const a of t.gauge.bands) n.add(a.colorToken);
|
|
@@ -346,7 +356,7 @@ function K(t, n = []) {
|
|
|
346
356
|
}, o = {};
|
|
347
357
|
for (const r of n) {
|
|
348
358
|
const e = t.querySelector(
|
|
349
|
-
`[data-token="${
|
|
359
|
+
`[data-token="${kt(r)}"]`
|
|
350
360
|
);
|
|
351
361
|
if (e) {
|
|
352
362
|
const c = getComputedStyle(e).color;
|
|
@@ -368,19 +378,19 @@ function O(t, n, i) {
|
|
|
368
378
|
return n ? ((a = t.tokens) == null ? void 0 : a[n]) ?? i : i;
|
|
369
379
|
}
|
|
370
380
|
const v = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
371
|
-
function
|
|
381
|
+
function Lt(t) {
|
|
372
382
|
const n = [t.title];
|
|
373
383
|
t.highlight && n.push(t.highlight);
|
|
374
384
|
for (const i of t.fields) n.push(`• ${i.label}: ${i.value}`);
|
|
375
385
|
return n.join(`
|
|
376
386
|
`);
|
|
377
387
|
}
|
|
378
|
-
function
|
|
388
|
+
function wt(t) {
|
|
379
389
|
const n = t.fields.map((a) => `<li>${v(a.label)}: ${v(a.value)}</li>`).join(""), i = t.highlight ? `<p><strong>${v(t.highlight)}</strong></p>` : "";
|
|
380
390
|
return `<p><strong>${v(t.title)}</strong></p>${i}<ul>${n}</ul>`;
|
|
381
391
|
}
|
|
382
|
-
const L = 20,
|
|
383
|
-
function
|
|
392
|
+
const L = 20, I = L + 18, H = 22, en = 10, Tt = 22, st = 16, it = 12, an = 12, Et = 34, Z = 9, q = (Et + Z) * 2, on = 16, lt = gt, rn = 6, R = L + G + rn, X = F - L - R, ct = 13, _t = 14, Mt = 13, J = 16;
|
|
393
|
+
function sn(t) {
|
|
384
394
|
return t >= 4352 && t <= 4447 || // Hangul Jamo
|
|
385
395
|
t >= 11904 && t <= 42191 || // CJK radicals … Yi
|
|
386
396
|
t >= 44032 && t <= 55203 || // Hangul syllables
|
|
@@ -392,10 +402,10 @@ function rn(t) {
|
|
|
392
402
|
function A(t, n) {
|
|
393
403
|
let i = 0;
|
|
394
404
|
for (const a of t)
|
|
395
|
-
i +=
|
|
405
|
+
i += sn(a.codePointAt(0) ?? 0) ? 1 : 0.62;
|
|
396
406
|
return i * n;
|
|
397
407
|
}
|
|
398
|
-
function
|
|
408
|
+
function ln(t, n, i) {
|
|
399
409
|
const a = [];
|
|
400
410
|
let o = "";
|
|
401
411
|
for (const r of t)
|
|
@@ -406,7 +416,7 @@ function ut(t, n, i) {
|
|
|
406
416
|
const a = [];
|
|
407
417
|
let o = "";
|
|
408
418
|
const r = (e) => {
|
|
409
|
-
const c =
|
|
419
|
+
const c = ln(e, n, i);
|
|
410
420
|
for (let u = 0; u < c.length - 1; u += 1) a.push(c[u]);
|
|
411
421
|
o = c[c.length - 1];
|
|
412
422
|
};
|
|
@@ -416,11 +426,11 @@ function ut(t, n, i) {
|
|
|
416
426
|
}
|
|
417
427
|
return o && a.push(o), a.length ? a : [""];
|
|
418
428
|
}
|
|
419
|
-
function
|
|
429
|
+
function It(t) {
|
|
420
430
|
const n = [];
|
|
421
431
|
let i = 0;
|
|
422
432
|
t.fields.forEach((r, e) => {
|
|
423
|
-
const c = e === 0 ?
|
|
433
|
+
const c = e === 0 ? _t : Mt, d = A(`${r.label}: `, ct) + A(r.value, c) <= X ? [{ kind: "inline", text: "" }] : [
|
|
424
434
|
...ut(
|
|
425
435
|
`${r.label}:`,
|
|
426
436
|
ct,
|
|
@@ -430,7 +440,7 @@ function Mt(t) {
|
|
|
430
440
|
(f) => ({ kind: "value", text: f })
|
|
431
441
|
)
|
|
432
442
|
];
|
|
433
|
-
n.push({ field: r, index: e, firstLineDy: i, lines: d }), i +=
|
|
443
|
+
n.push({ field: r, index: e, firstLineDy: i, lines: d }), i += Tt + (d.length - 1) * J;
|
|
434
444
|
});
|
|
435
445
|
const a = n[n.length - 1], o = a ? a.firstLineDy + (a.lines.length - 1) * J : 0;
|
|
436
446
|
return { placements: n, endDy: o };
|
|
@@ -439,14 +449,14 @@ function nt(t, n) {
|
|
|
439
449
|
const i = n !== void 0 ? n : t.brand;
|
|
440
450
|
return typeof i == "string" ? i : !1;
|
|
441
451
|
}
|
|
442
|
-
function
|
|
452
|
+
function cn(t) {
|
|
443
453
|
if (typeof t.fraction == "number")
|
|
444
454
|
return Math.min(1, Math.max(0, t.fraction));
|
|
445
455
|
const n = parseFloat(t.value);
|
|
446
456
|
return Number.isFinite(n) && typeof t.max == "number" && t.max > 0 ? Math.min(1, Math.max(0, n / t.max)) : 1;
|
|
447
457
|
}
|
|
448
|
-
function
|
|
449
|
-
const i = !!t.highlight, a =
|
|
458
|
+
function At(t, n) {
|
|
459
|
+
const i = !!t.highlight, a = I + en, o = (i ? a + H + st : I + st) + Tt - 6, r = o + It(t).endDy, e = t.gauge && Y(t.gauge), d = t.gauge && !Y(t.gauge) ? (i ? a : I) + q : 0, f = e ? r + on : null, b = f !== null ? f + Q : 0, k = Math.max(r, d, b), h = n ? k + it + an - 4 : k, $ = Math.round(h + (n ? it : L));
|
|
450
460
|
return {
|
|
451
461
|
hasChip: i,
|
|
452
462
|
chipY: a,
|
|
@@ -457,11 +467,11 @@ function _t(t, n) {
|
|
|
457
467
|
height: $
|
|
458
468
|
};
|
|
459
469
|
}
|
|
460
|
-
function
|
|
461
|
-
return
|
|
470
|
+
function Bt(t, n) {
|
|
471
|
+
return At(t, n !== !1).height;
|
|
462
472
|
}
|
|
463
|
-
function
|
|
464
|
-
const r =
|
|
473
|
+
function un(t, n, i, a, o) {
|
|
474
|
+
const r = Et, e = 2 * Math.PI * r, c = cn(t), u = O(n, t.colorToken, n.accent), d = typeof t.segments == "number" && t.segments > 1 ? t.segments : 0, f = d ? 3 : 0, b = d ? e / d - f : e, k = d ? `${b} ${f}` : "", h = `${e * c} ${e}`, $ = `transform="rotate(-90 ${a} ${o})"`, l = v(
|
|
465
475
|
t.label ? `${t.value} — ${t.label}` : t.value
|
|
466
476
|
), T = `<circle cx="${a}" cy="${o}" r="${r}" fill="none" stroke="${n.border}" stroke-width="${Z}"${k ? ` stroke-dasharray="${k}"` : ""} ${$}/>`, y = `<circle cx="${a}" cy="${o}" r="${r}" fill="none" stroke="${u}" stroke-width="${Z}" stroke-linecap="round" stroke-dasharray="${h}" ${$}/>`, p = `<text x="${a}" y="${o + 1}" text-anchor="middle" dominant-baseline="middle" font-family="${i}" font-size="16" font-weight="700" fill="${n.fg}">${v(
|
|
467
477
|
t.value
|
|
@@ -470,8 +480,8 @@ function cn(t, n, i, a, o) {
|
|
|
470
480
|
)}</text>` : "";
|
|
471
481
|
return `<g role="img" aria-label="${l}"><title>${l}</title>${T}${y}${p}${E}</g>`;
|
|
472
482
|
}
|
|
473
|
-
function
|
|
474
|
-
const o = L - V, r = i - 2 * o, e =
|
|
483
|
+
function dn(t, n, i, a) {
|
|
484
|
+
const o = L - V, r = i - 2 * o, e = bt(
|
|
475
485
|
{
|
|
476
486
|
value: t.value,
|
|
477
487
|
bands: t.bands,
|
|
@@ -484,7 +494,7 @@ function un(t, n, i, a) {
|
|
|
484
494
|
ticks: t.ticks
|
|
485
495
|
},
|
|
486
496
|
{ width: r, height: Q }
|
|
487
|
-
), c =
|
|
497
|
+
), c = Kt(e, {
|
|
488
498
|
resolve: (u) => O(n, u, n.accent),
|
|
489
499
|
// Raw theme font — buildBandedGaugeSvgString escapes it once. Passing the
|
|
490
500
|
// card's already-escaped `font` here would double-escape and break it.
|
|
@@ -506,71 +516,71 @@ function ft([t, n, i]) {
|
|
|
506
516
|
};
|
|
507
517
|
return 0.2126 * a(t) + 0.7152 * a(n) + 0.0722 * a(i);
|
|
508
518
|
}
|
|
509
|
-
function
|
|
519
|
+
function fn(t, n) {
|
|
510
520
|
const i = dt(t), a = dt(n);
|
|
511
521
|
if (!i || !a) return 0;
|
|
512
522
|
const o = ft(i), r = ft(a);
|
|
513
523
|
return (Math.max(o, r) + 0.05) / (Math.min(o, r) + 0.05);
|
|
514
524
|
}
|
|
515
|
-
function
|
|
516
|
-
const o = t.highlight, r = t.highlightToken ?? tt, e = O(n, r, n.accent), c =
|
|
525
|
+
function $n(t, n, i, a) {
|
|
526
|
+
const o = t.highlight, r = t.highlightToken ?? tt, e = O(n, r, n.accent), c = fn(n.bg, e) >= 3 ? n.bg : n.fg, u = Math.round(o.length * 7.2 + 28), d = L + u / 2, f = a + H / 2 + 1;
|
|
517
527
|
return `<rect x="${L}" y="${a}" width="${u}" height="${H}" rx="${H / 2}" fill="${e}"/><text x="${d}" y="${f}" text-anchor="middle" dominant-baseline="middle" font-family="${i}" font-size="12" font-weight="600" fill="${c}">${v(
|
|
518
528
|
o
|
|
519
529
|
)}</text>`;
|
|
520
530
|
}
|
|
521
531
|
function et(t, n, i = !1) {
|
|
522
|
-
const a = F, o =
|
|
532
|
+
const a = F, o = At(t, i !== !1), r = o.height, e = v(n.font), c = yt(t), u = O(n, c, n.accent), d = t.icon ? rt(
|
|
523
533
|
t.icon,
|
|
524
534
|
u,
|
|
525
535
|
a - L - lt,
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
) : "", { placements: f } =
|
|
529
|
-
const E = o.firstFieldY + p.firstLineDy, w = p.index === 0, B = w ?
|
|
536
|
+
I - lt + 2,
|
|
537
|
+
gt
|
|
538
|
+
) : "", { placements: f } = It(t), b = f.map((p) => {
|
|
539
|
+
const E = o.firstFieldY + p.firstLineDy, w = p.index === 0, B = w ? _t : Mt, S = w ? 700 : 500, D = w ? u : n.fg, m = E - 4;
|
|
530
540
|
let x;
|
|
531
|
-
p.field.icon &&
|
|
541
|
+
p.field.icon && vt(p.field.icon) ? x = rt(
|
|
532
542
|
p.field.icon,
|
|
533
543
|
u,
|
|
534
544
|
L,
|
|
535
545
|
m - G / 2,
|
|
536
546
|
G
|
|
537
547
|
) : x = `<circle cx="${L + G / 2}" cy="${m}" r="2" fill="${n.muted}"/>`;
|
|
538
|
-
const C = p.lines.map((
|
|
548
|
+
const C = p.lines.map((_, U) => {
|
|
539
549
|
const z = E + U * J;
|
|
540
|
-
return
|
|
550
|
+
return _.kind === "inline" ? `<text x="${R}" y="${z}" font-family="${e}" font-size="13"><tspan fill="${n.muted}">${v(
|
|
541
551
|
p.field.label
|
|
542
552
|
)}: </tspan><tspan font-size="${B}" font-weight="${S}" fill="${D}">${v(
|
|
543
553
|
p.field.value
|
|
544
|
-
)}</tspan></text>` :
|
|
545
|
-
|
|
554
|
+
)}</tspan></text>` : _.kind === "label" ? `<text x="${R}" y="${z}" font-family="${e}" font-size="13" fill="${n.muted}">${v(
|
|
555
|
+
_.text
|
|
546
556
|
)}</text>` : `<text x="${R}" y="${z}" font-family="${e}" font-size="${B}" font-weight="${S}" fill="${D}">${v(
|
|
547
|
-
|
|
557
|
+
_.text
|
|
548
558
|
)}</text>`;
|
|
549
559
|
}).join("");
|
|
550
560
|
return `${x}${C}`;
|
|
551
|
-
}).join(""), k = o.hasChip ?
|
|
561
|
+
}).join(""), k = o.hasChip ? $n(t, n, e, o.chipY) : "";
|
|
552
562
|
let h = "";
|
|
553
|
-
t.gauge && (Y(t.gauge) && o.bandedGaugeY !== null ? h =
|
|
563
|
+
t.gauge && (Y(t.gauge) && o.bandedGaugeY !== null ? h = dn(t.gauge, n, a, o.bandedGaugeY) : Y(t.gauge) || (h = un(
|
|
554
564
|
t.gauge,
|
|
555
565
|
n,
|
|
556
566
|
e,
|
|
557
567
|
a - L - q / 2,
|
|
558
|
-
(o.hasChip ? o.chipY :
|
|
568
|
+
(o.hasChip ? o.chipY : I) + q / 2
|
|
559
569
|
)));
|
|
560
570
|
const $ = i !== !1 ? `<text x="${L}" y="${o.footerY}" font-family="${e}" font-size="10" font-weight="500" fill="${n.muted}">${v(
|
|
561
571
|
i
|
|
562
|
-
)}</text>` : "", l = `<text x="${L}" y="${
|
|
572
|
+
)}</text>` : "", l = `<text x="${L}" y="${I}" font-family="${e}" font-size="16" font-weight="700" fill="${n.fg}">${v(
|
|
563
573
|
t.title
|
|
564
574
|
)}</text>`, T = `<rect x="0.5" y="0.5" width="${a - 1}" height="${r - 1}" rx="12" fill="${n.bg}"/>`, y = `<rect x="0.5" y="0.5" width="${a - 1}" height="${r - 1}" rx="12" fill="none" stroke="${n.border}"/>`;
|
|
565
575
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${r}" viewBox="0 0 ${a} ${r}" role="img" aria-label="${v(
|
|
566
576
|
t.title
|
|
567
577
|
)}">${T}${l}${d}${k}${h}${b}${$}${y}</svg>`;
|
|
568
578
|
}
|
|
569
|
-
function
|
|
579
|
+
function hn() {
|
|
570
580
|
var t;
|
|
571
581
|
return typeof navigator < "u" && typeof ((t = navigator.clipboard) == null ? void 0 : t.write) == "function" && typeof ClipboardItem < "u";
|
|
572
582
|
}
|
|
573
|
-
function
|
|
583
|
+
function Ct(t, n, i) {
|
|
574
584
|
return new Promise((a, o) => {
|
|
575
585
|
const r = new Image();
|
|
576
586
|
r.decoding = "async", r.onload = () => {
|
|
@@ -587,46 +597,46 @@ function Bt(t, n, i) {
|
|
|
587
597
|
}, r.onerror = () => o(new Error("SVG failed to decode as an image")), r.src = t;
|
|
588
598
|
});
|
|
589
599
|
}
|
|
590
|
-
function
|
|
600
|
+
function Yt() {
|
|
591
601
|
const t = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : 1;
|
|
592
602
|
return Math.max(2, t);
|
|
593
603
|
}
|
|
594
|
-
async function
|
|
595
|
-
return (await
|
|
604
|
+
async function In(t, n = {}) {
|
|
605
|
+
return (await St(t, n)).dataUri;
|
|
596
606
|
}
|
|
597
|
-
async function
|
|
598
|
-
const { colours: i, scale: a =
|
|
607
|
+
async function St(t, n = {}) {
|
|
608
|
+
const { colours: i, scale: a = Yt() } = n, o = i ?? K(null), r = nt(t, n.brand), e = et(t, o, r), c = `data:image/svg+xml,${encodeURIComponent(e)}`, u = F, d = Bt(t, r), f = await Ct(
|
|
599
609
|
c,
|
|
600
610
|
Math.round(u * a),
|
|
601
611
|
Math.round(d * a)
|
|
602
612
|
);
|
|
603
|
-
return { dataUri: await
|
|
613
|
+
return { dataUri: await pn(f), width: u, height: d };
|
|
604
614
|
}
|
|
605
|
-
function
|
|
615
|
+
function pn(t) {
|
|
606
616
|
return new Promise((n, i) => {
|
|
607
617
|
const a = new FileReader();
|
|
608
618
|
a.onload = () => n(String(a.result)), a.onerror = () => i(a.error ?? new Error("FileReader error")), a.readAsDataURL(t);
|
|
609
619
|
});
|
|
610
620
|
}
|
|
611
|
-
async function
|
|
612
|
-
const a =
|
|
621
|
+
async function bn(t, n, i) {
|
|
622
|
+
const a = Lt(n), o = new Blob([a], { type: "text/plain" });
|
|
613
623
|
if (t === "text")
|
|
614
624
|
return new ClipboardItem({ "text/plain": o });
|
|
615
|
-
const r = nt(n, void 0), e = et(n, i, r), c = `data:image/svg+xml,${encodeURIComponent(e)}`, u =
|
|
625
|
+
const r = nt(n, void 0), e = et(n, i, r), c = `data:image/svg+xml,${encodeURIComponent(e)}`, u = Yt(), d = await Ct(
|
|
616
626
|
c,
|
|
617
627
|
Math.round(F * u),
|
|
618
|
-
Math.round(
|
|
628
|
+
Math.round(Bt(n, r) * u)
|
|
619
629
|
);
|
|
620
630
|
if (t === "image")
|
|
621
631
|
return new ClipboardItem({ "image/png": d, "text/plain": o });
|
|
622
|
-
const f = new Blob([
|
|
632
|
+
const f = new Blob([wt(n)], { type: "text/html" });
|
|
623
633
|
return new ClipboardItem({
|
|
624
634
|
"text/html": f,
|
|
625
635
|
"image/png": d,
|
|
626
636
|
"text/plain": o
|
|
627
637
|
});
|
|
628
638
|
}
|
|
629
|
-
const
|
|
639
|
+
const mn = Gt(
|
|
630
640
|
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
631
641
|
{
|
|
632
642
|
variants: {
|
|
@@ -637,10 +647,10 @@ const bn = Nt(
|
|
|
637
647
|
},
|
|
638
648
|
defaultVariants: { variant: "insert" }
|
|
639
649
|
}
|
|
640
|
-
),
|
|
641
|
-
text: /* @__PURE__ */ g(
|
|
642
|
-
image: /* @__PURE__ */ g(
|
|
643
|
-
"text-image": /* @__PURE__ */ g(
|
|
650
|
+
), gn = ["text", "image", "text-image"], xn = {
|
|
651
|
+
text: /* @__PURE__ */ g(Ut, { "aria-hidden": !0 }),
|
|
652
|
+
image: /* @__PURE__ */ g(Ft, { "aria-hidden": !0 }),
|
|
653
|
+
"text-image": /* @__PURE__ */ g(Rt, { "aria-hidden": !0 })
|
|
644
654
|
}, $t = {
|
|
645
655
|
insert: {
|
|
646
656
|
text: "insert.text",
|
|
@@ -652,7 +662,7 @@ const bn = Nt(
|
|
|
652
662
|
image: "insert.copyImage",
|
|
653
663
|
"text-image": "insert.copyTextImage"
|
|
654
664
|
}
|
|
655
|
-
},
|
|
665
|
+
}, vn = ht(
|
|
656
666
|
function({
|
|
657
667
|
card: n,
|
|
658
668
|
variant: i = "insert",
|
|
@@ -662,13 +672,13 @@ const bn = Nt(
|
|
|
662
672
|
size: e = "sm",
|
|
663
673
|
intent: c = "primary"
|
|
664
674
|
}, u) {
|
|
665
|
-
const { t: d } =
|
|
666
|
-
const T =
|
|
675
|
+
const { t: d } = Nt(), f = Dt(null), b = (l) => {
|
|
676
|
+
const T = Lt(n), y = wt(n);
|
|
667
677
|
let p = "", E = "";
|
|
668
678
|
const w = l === "text" ? null : K(f.current, W(n));
|
|
669
|
-
return w && (p = et(n, w, nt(n, void 0)), E = `data:image/svg+xml,${encodeURIComponent(p)}`), { mode: l, text: T, html: y, svg: p, imageDataUri: E, pngDataUri: () => w ?
|
|
679
|
+
return w && (p = et(n, w, nt(n, void 0)), E = `data:image/svg+xml,${encodeURIComponent(p)}`), { mode: l, text: T, html: y, svg: p, imageDataUri: E, pngDataUri: () => w ? St(n, { colours: w }) : Promise.resolve({ dataUri: "", width: 0, height: 0 }) };
|
|
670
680
|
}, $ = i === "copy" ? (l) => {
|
|
671
|
-
if (
|
|
681
|
+
if (!hn()) {
|
|
672
682
|
r == null || r(new Error("Clipboard write unavailable in this context"));
|
|
673
683
|
return;
|
|
674
684
|
}
|
|
@@ -678,7 +688,7 @@ const bn = Nt(
|
|
|
678
688
|
);
|
|
679
689
|
(async () => {
|
|
680
690
|
try {
|
|
681
|
-
const y = await
|
|
691
|
+
const y = await bn(l, n, T);
|
|
682
692
|
await navigator.clipboard.write([y]), o == null || o(l);
|
|
683
693
|
} catch (y) {
|
|
684
694
|
r == null || r(y);
|
|
@@ -693,10 +703,10 @@ const bn = Nt(
|
|
|
693
703
|
ref: u,
|
|
694
704
|
"data-component": "insert-result",
|
|
695
705
|
"data-variant": i,
|
|
696
|
-
className:
|
|
706
|
+
className: mn({ variant: i }),
|
|
697
707
|
children: [
|
|
698
708
|
/* @__PURE__ */ P("span", { ref: f, "aria-hidden": !0, className: "ds:sr-only", children: [
|
|
699
|
-
|
|
709
|
+
tn.map((l) => /* @__PURE__ */ g(
|
|
700
710
|
"span",
|
|
701
711
|
{
|
|
702
712
|
"data-k": l,
|
|
@@ -707,19 +717,19 @@ const bn = Nt(
|
|
|
707
717
|
W(n).map((l) => /* @__PURE__ */ g(
|
|
708
718
|
"span",
|
|
709
719
|
{
|
|
710
|
-
"data-token":
|
|
711
|
-
className:
|
|
720
|
+
"data-token": kt(l),
|
|
721
|
+
className: nn(l)
|
|
712
722
|
},
|
|
713
723
|
l
|
|
714
724
|
))
|
|
715
725
|
] }),
|
|
716
|
-
|
|
717
|
-
|
|
726
|
+
gn.map((l) => /* @__PURE__ */ g(
|
|
727
|
+
Ht,
|
|
718
728
|
{
|
|
719
729
|
type: "button",
|
|
720
730
|
intent: c,
|
|
721
731
|
size: e,
|
|
722
|
-
startIcon:
|
|
732
|
+
startIcon: xn[l],
|
|
723
733
|
"aria-label": d($t[i][l]),
|
|
724
734
|
onClick: () => $(l),
|
|
725
735
|
children: d($t[i][l])
|
|
@@ -731,12 +741,12 @@ const bn = Nt(
|
|
|
731
741
|
);
|
|
732
742
|
}
|
|
733
743
|
);
|
|
734
|
-
|
|
744
|
+
vn.displayName = "InsertButton";
|
|
735
745
|
export {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
746
|
+
Jt as B,
|
|
747
|
+
vn as I,
|
|
748
|
+
In as a,
|
|
739
749
|
Mn as b,
|
|
740
|
-
|
|
750
|
+
St as s
|
|
741
751
|
};
|
|
742
|
-
//# sourceMappingURL=insert-result-
|
|
752
|
+
//# sourceMappingURL=insert-result-C1SYdueh.js.map
|