@alfadocs/ui-kit-debug 0.43.0 → 0.44.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/{bmi-calculator-DuVSFDuw.js → bmi-calculator-DFPWL2OJ.js} +92 -78
- package/dist/_chunks/bmi-calculator-DFPWL2OJ.js.map +1 -0
- package/dist/_chunks/{calculator-dialog-DdexHrTP.js → calculator-dialog-D-nfvteH.js} +2 -2
- package/dist/_chunks/{calculator-dialog-DdexHrTP.js.map → calculator-dialog-D-nfvteH.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-Dln-y1k_.js → cycle-calculator-ChHBcjet.js} +58 -50
- package/dist/_chunks/cycle-calculator-ChHBcjet.js.map +1 -0
- package/dist/_chunks/dialog-BTpZV6It.js +223 -0
- package/dist/_chunks/dialog-BTpZV6It.js.map +1 -0
- package/dist/_chunks/{due-date-calculator-Cc4dRqTI.js → due-date-calculator-CYXKLoof.js} +50 -38
- package/dist/_chunks/due-date-calculator-CYXKLoof.js.map +1 -0
- package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js +190 -0
- package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js.map +1 -0
- package/dist/_chunks/insert-result-CoC1oo6R.js +334 -0
- package/dist/_chunks/insert-result-CoC1oo6R.js.map +1 -0
- package/dist/_chunks/{pregnancy-weight-gain-zZL5Ir2-.js → pregnancy-weight-gain-C5YhfYnL.js} +66 -57
- package/dist/_chunks/pregnancy-weight-gain-C5YhfYnL.js.map +1 -0
- package/dist/_chunks/{unit-converter-CuXCXJhK.js → unit-converter-Ds9jalbN.js} +78 -67
- package/dist/_chunks/unit-converter-Ds9jalbN.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/index.d.ts +1 -1
- package/dist/components/_shared/index.d.ts.map +1 -1
- package/dist/components/_shared/insert-result.d.ts +100 -10
- package/dist/components/_shared/insert-result.d.ts.map +1 -1
- package/dist/components/bmi-calculator/bmi-calculator.d.ts +6 -0
- package/dist/components/bmi-calculator/bmi-calculator.d.ts.map +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/cycle-calculator/cycle-calculator.d.ts +6 -0
- package/dist/components/cycle-calculator/cycle-calculator.d.ts.map +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +1 -0
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/due-date-calculator/due-date-calculator.d.ts +6 -0
- package/dist/components/due-date-calculator/due-date-calculator.d.ts.map +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +6 -0
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts.map +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +6 -0
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts.map +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/unit-converter/unit-converter.d.ts +6 -0
- package/dist/components/unit-converter/unit-converter.d.ts.map +1 -1
- package/dist/index.js +494 -493
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/bmi-calculator-DuVSFDuw.js.map +0 -1
- package/dist/_chunks/cycle-calculator-Dln-y1k_.js.map +0 -1
- package/dist/_chunks/dialog-DOYgd75U.js +0 -224
- package/dist/_chunks/dialog-DOYgd75U.js.map +0 -1
- package/dist/_chunks/due-date-calculator-Cc4dRqTI.js.map +0 -1
- package/dist/_chunks/gestational-age-calculator-ZMSrzkRW.js +0 -179
- package/dist/_chunks/gestational-age-calculator-ZMSrzkRW.js.map +0 -1
- package/dist/_chunks/insert-result-DisOY2G-.js +0 -243
- package/dist/_chunks/insert-result-DisOY2G-.js.map +0 -1
- package/dist/_chunks/pregnancy-weight-gain-zZL5Ir2-.js.map +0 -1
- package/dist/_chunks/unit-converter-CuXCXJhK.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { F as
|
|
6
|
-
import { N as
|
|
7
|
-
import { S as
|
|
8
|
-
import { I as
|
|
9
|
-
const
|
|
2
|
+
import { forwardRef as A, useState as v, useMemo as T, useEffect as H } from "react";
|
|
3
|
+
import { c as Y } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as j } from "react-i18next";
|
|
5
|
+
import { F as p } from "./form-field-BOm9hK35.js";
|
|
6
|
+
import { N as B } from "./number-input-Dj5L3pXK.js";
|
|
7
|
+
import { S as C } from "./select-hsCaJSX3.js";
|
|
8
|
+
import { I as L } from "./insert-result-CoC1oo6R.js";
|
|
9
|
+
const _ = {
|
|
10
10
|
// weight → base kg
|
|
11
11
|
kg: { id: "kg", category: "weight", factor: 1, offset: 0 },
|
|
12
12
|
g: { id: "g", category: "weight", factor: 1e-3, offset: 0 },
|
|
@@ -23,19 +23,19 @@ const F = {
|
|
|
23
23
|
// glucose → base mmol/L (1 mg/dL = 1/18.0156 mmol/L)
|
|
24
24
|
mmol_l: { id: "mmol_l", category: "glucose", factor: 1, offset: 0 },
|
|
25
25
|
mg_dl: { id: "mg_dl", category: "glucose", factor: 1 / 18.0156, offset: 0 }
|
|
26
|
-
},
|
|
26
|
+
}, h = {
|
|
27
27
|
weight: ["kg", "g", "lb", "oz"],
|
|
28
28
|
length: ["cm", "m", "in", "ft"],
|
|
29
29
|
temperature: ["c", "f"],
|
|
30
30
|
glucose: ["mmol_l", "mg_dl"]
|
|
31
|
-
},
|
|
31
|
+
}, D = [
|
|
32
32
|
"weight",
|
|
33
33
|
"length",
|
|
34
34
|
"temperature",
|
|
35
35
|
"glucose"
|
|
36
36
|
];
|
|
37
|
-
function
|
|
38
|
-
const o =
|
|
37
|
+
function K(c, r, f) {
|
|
38
|
+
const o = _[r], n = _[f];
|
|
39
39
|
if (!o || !n) throw new Error(`Unknown unit: ${r} → ${f}`);
|
|
40
40
|
if (o.category !== n.category)
|
|
41
41
|
throw new Error(
|
|
@@ -43,113 +43,124 @@ function M(c, r, f) {
|
|
|
43
43
|
);
|
|
44
44
|
return (c * o.factor + o.offset - n.offset) / n.factor;
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const M = Y("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
47
47
|
variants: {
|
|
48
48
|
width: { full: "ds:w-full", auto: "ds:inline-flex" }
|
|
49
49
|
},
|
|
50
50
|
defaultVariants: { width: "full" }
|
|
51
|
-
}),
|
|
51
|
+
}), q = {
|
|
52
|
+
weight: "--info",
|
|
53
|
+
length: "--success",
|
|
54
|
+
temperature: "--warning",
|
|
55
|
+
glucose: "--accent"
|
|
56
|
+
}, J = A(
|
|
52
57
|
({
|
|
53
58
|
defaultCategory: c = "weight",
|
|
54
59
|
onResultChange: r,
|
|
55
60
|
onInsert: f,
|
|
56
61
|
insertVariant: o = "insert",
|
|
57
62
|
onCopy: n,
|
|
58
|
-
onError:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
onError: b,
|
|
64
|
+
insertBrand: E,
|
|
65
|
+
id: F,
|
|
66
|
+
width: U,
|
|
67
|
+
className: O
|
|
68
|
+
}, S) => {
|
|
69
|
+
const { t, i18n: $ } = j(), [g, k] = v(c), [i, G] = v(null), [u, w] = v(
|
|
70
|
+
h[c][0]
|
|
71
|
+
), [l, N] = v(
|
|
72
|
+
h[c][1]
|
|
73
|
+
), V = (s) => {
|
|
74
|
+
const I = s, y = h[I];
|
|
75
|
+
k(I), w(y[0]), N(y[1] ?? y[0]);
|
|
76
|
+
}, a = T(
|
|
77
|
+
() => i === null ? null : K(i, u, l),
|
|
78
|
+
[i, u, l]
|
|
79
|
+
), m = T(
|
|
80
|
+
() => new Intl.NumberFormat($.language, { maximumFractionDigits: 3 }),
|
|
81
|
+
[$.language]
|
|
76
82
|
);
|
|
77
|
-
|
|
83
|
+
H(() => {
|
|
78
84
|
r == null || r(a);
|
|
79
85
|
}, [a, r]);
|
|
80
|
-
const z =
|
|
86
|
+
const z = D.map((s) => ({
|
|
81
87
|
value: s,
|
|
82
88
|
label: t(`unitConverter.category.${s}`)
|
|
83
|
-
})),
|
|
89
|
+
})), x = h[g].map((s) => ({
|
|
84
90
|
value: s,
|
|
85
91
|
label: t(`unitConverter.units.${s}`)
|
|
86
92
|
}));
|
|
87
93
|
return /* @__PURE__ */ d(
|
|
88
94
|
"div",
|
|
89
95
|
{
|
|
90
|
-
ref:
|
|
96
|
+
ref: S,
|
|
91
97
|
"data-component": "unit-converter",
|
|
92
|
-
"data-component-id":
|
|
93
|
-
className:
|
|
98
|
+
"data-component-id": F,
|
|
99
|
+
className: M({ width: U, className: O }),
|
|
94
100
|
children: [
|
|
95
|
-
/* @__PURE__ */ e(
|
|
96
|
-
|
|
101
|
+
/* @__PURE__ */ e(p, { label: t("unitConverter.categoryLabel"), children: /* @__PURE__ */ e(
|
|
102
|
+
C,
|
|
97
103
|
{
|
|
98
104
|
options: z,
|
|
99
|
-
value:
|
|
100
|
-
onValueChange:
|
|
105
|
+
value: g,
|
|
106
|
+
onValueChange: V
|
|
101
107
|
}
|
|
102
108
|
) }),
|
|
103
109
|
/* @__PURE__ */ d("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
|
|
104
|
-
/* @__PURE__ */ e(
|
|
105
|
-
/* @__PURE__ */ e(
|
|
106
|
-
|
|
110
|
+
/* @__PURE__ */ e(p, { label: t("unitConverter.value"), children: /* @__PURE__ */ e(B, { mode: "decimal", value: i, onChange: G }) }),
|
|
111
|
+
/* @__PURE__ */ e(p, { label: t("unitConverter.from"), children: /* @__PURE__ */ e(
|
|
112
|
+
C,
|
|
107
113
|
{
|
|
108
|
-
options:
|
|
109
|
-
value:
|
|
114
|
+
options: x,
|
|
115
|
+
value: u,
|
|
110
116
|
onValueChange: w
|
|
111
117
|
}
|
|
112
118
|
) }),
|
|
113
|
-
/* @__PURE__ */ e(
|
|
114
|
-
|
|
119
|
+
/* @__PURE__ */ e(p, { label: t("unitConverter.to"), children: /* @__PURE__ */ e(
|
|
120
|
+
C,
|
|
115
121
|
{
|
|
116
|
-
options:
|
|
122
|
+
options: x,
|
|
117
123
|
value: l,
|
|
118
|
-
onValueChange:
|
|
124
|
+
onValueChange: N
|
|
119
125
|
}
|
|
120
126
|
) })
|
|
121
127
|
] }),
|
|
122
|
-
/* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: a !== null ? `${
|
|
123
|
-
`unitConverter.units.${
|
|
124
|
-
)} = ${
|
|
128
|
+
/* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: a !== null ? `${m.format(i ?? 0)} ${t(
|
|
129
|
+
`unitConverter.units.${u}`
|
|
130
|
+
)} = ${m.format(a)} ${t(
|
|
125
131
|
`unitConverter.units.${l}`
|
|
126
132
|
)}` : "" }),
|
|
127
133
|
a !== null ? /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
128
134
|
/* @__PURE__ */ e("span", { className: "type-label ds:text-muted-foreground", children: t("unitConverter.result") }),
|
|
129
135
|
/* @__PURE__ */ d("span", { className: "type-metric ds:text-foreground", children: [
|
|
130
|
-
|
|
136
|
+
m.format(a),
|
|
131
137
|
" ",
|
|
132
138
|
t(`unitConverter.units.${l}`)
|
|
133
139
|
] }),
|
|
134
140
|
o === "copy" || f ? /* @__PURE__ */ e(
|
|
135
|
-
|
|
141
|
+
L,
|
|
136
142
|
{
|
|
137
143
|
variant: o,
|
|
138
144
|
onInsert: f,
|
|
139
145
|
onCopy: n,
|
|
140
|
-
onError:
|
|
146
|
+
onError: b,
|
|
141
147
|
card: {
|
|
142
148
|
title: t("insert.title.unitConverter"),
|
|
149
|
+
highlight: t(`unitConverter.category.${g}`),
|
|
150
|
+
// Chip tints by measurement family so the inserted card
|
|
151
|
+
// signals the category at a glance.
|
|
152
|
+
highlightToken: q[g],
|
|
153
|
+
brand: E,
|
|
143
154
|
fields: [
|
|
144
155
|
{
|
|
145
156
|
label: t("unitConverter.from"),
|
|
146
|
-
value: `${
|
|
147
|
-
`unitConverter.units.${
|
|
157
|
+
value: `${m.format(i ?? 0)} ${t(
|
|
158
|
+
`unitConverter.units.${u}`
|
|
148
159
|
)}`
|
|
149
160
|
},
|
|
150
161
|
{
|
|
151
162
|
label: t("unitConverter.to"),
|
|
152
|
-
value: `${
|
|
163
|
+
value: `${m.format(a)} ${t(
|
|
153
164
|
`unitConverter.units.${l}`
|
|
154
165
|
)}`
|
|
155
166
|
}
|
|
@@ -163,12 +174,12 @@ const q = B("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
163
174
|
);
|
|
164
175
|
}
|
|
165
176
|
);
|
|
166
|
-
|
|
177
|
+
J.displayName = "UnitConverter";
|
|
167
178
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
179
|
+
D as C,
|
|
180
|
+
_ as U,
|
|
181
|
+
h as a,
|
|
182
|
+
J as b,
|
|
183
|
+
K as c
|
|
173
184
|
};
|
|
174
|
-
//# sourceMappingURL=unit-converter-
|
|
185
|
+
//# sourceMappingURL=unit-converter-Ds9jalbN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-converter-Ds9jalbN.js","sources":["../../src/components/unit-converter/units.ts","../../src/components/unit-converter/unit-converter.tsx"],"sourcesContent":["/* ------------------------------------------------------------------ */\n/* Generic unit conversion — pure, framework-free, unit-testable. */\n/* */\n/* Every unit is described by an affine map to its category's base */\n/* unit: base = value * factor + offset. Conversion is base-in then */\n/* base-out, so the same code handles linear scales (weight, length, */\n/* glucose) and offset scales (temperature) uniformly. */\n/* ------------------------------------------------------------------ */\n\nexport type UnitCategory = 'weight' | 'length' | 'temperature' | 'glucose';\n\nexport interface UnitDef {\n id: string;\n category: UnitCategory;\n /** Multiplier to the category base unit. */\n factor: number;\n /** Additive offset to the base unit (non-zero only for temperature). */\n offset: number;\n}\n\n/* Base units: kg, cm, °C, mmol/L. */\nexport const UNITS: Record<string, UnitDef> = {\n // weight → base kg\n kg: { id: 'kg', category: 'weight', factor: 1, offset: 0 },\n g: { id: 'g', category: 'weight', factor: 0.001, offset: 0 },\n lb: { id: 'lb', category: 'weight', factor: 0.45359237, offset: 0 },\n oz: { id: 'oz', category: 'weight', factor: 0.028349523125, offset: 0 },\n // length → base cm\n cm: { id: 'cm', category: 'length', factor: 1, offset: 0 },\n m: { id: 'm', category: 'length', factor: 100, offset: 0 },\n in: { id: 'in', category: 'length', factor: 2.54, offset: 0 },\n ft: { id: 'ft', category: 'length', factor: 30.48, offset: 0 },\n // temperature → base °C (affine: °C = °F·5/9 − 32·5/9)\n c: { id: 'c', category: 'temperature', factor: 1, offset: 0 },\n f: { id: 'f', category: 'temperature', factor: 5 / 9, offset: (-32 * 5) / 9 },\n // glucose → base mmol/L (1 mg/dL = 1/18.0156 mmol/L)\n mmol_l: { id: 'mmol_l', category: 'glucose', factor: 1, offset: 0 },\n mg_dl: { id: 'mg_dl', category: 'glucose', factor: 1 / 18.0156, offset: 0 },\n};\n\nexport const UNITS_BY_CATEGORY: Record<UnitCategory, string[]> = {\n weight: ['kg', 'g', 'lb', 'oz'],\n length: ['cm', 'm', 'in', 'ft'],\n temperature: ['c', 'f'],\n glucose: ['mmol_l', 'mg_dl'],\n};\n\nexport const CATEGORIES: UnitCategory[] = [\n 'weight',\n 'length',\n 'temperature',\n 'glucose',\n];\n\n/**\n * Convert `value` from one unit to another. Both ids must belong to the same\n * category; mismatched categories throw (a programming error, not user input).\n */\nexport function convertUnits(\n value: number,\n fromId: string,\n toId: string,\n): number {\n const from = UNITS[fromId];\n const to = UNITS[toId];\n if (!from || !to) throw new Error(`Unknown unit: ${fromId} → ${toId}`);\n if (from.category !== to.category) {\n throw new Error(\n `Cannot convert across categories: ${from.category} → ${to.category}`,\n );\n }\n const base = value * from.factor + from.offset;\n return (base - to.offset) / to.factor;\n}\n","/* ------------------------------------------------------------------ */\n/* UnitConverter — generic clinical/everyday unit conversion across */\n/* weight, length, temperature and glucose. */\n/* */\n/* Maths lives in `./units` (pure, separately tested). */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { FormField } from '../form-field';\nimport { NumberInput } from '../number-input';\nimport { Select } from '../select';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type UnitCategory,\n CATEGORIES,\n UNITS_BY_CATEGORY,\n convertUnits,\n} from './units';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/**\n * DS token NAME backing the result-card category chip, one per measurement\n * family. The converter shows no on-screen badge, but the inserted card carries\n * a category chip so the reader can tell at a glance which family the figure\n * belongs to; each token is a closed-palette semantic alias resolved to a\n * concrete colour at raster time by `InsertButton`.\n */\nconst CATEGORY_HIGHLIGHT_TOKEN: Record<UnitCategory, string> = {\n weight: '--info',\n length: '--success',\n temperature: '--warning',\n glucose: '--accent',\n};\n\nexport interface UnitConverterProps extends VariantProps<typeof rootVariants> {\n /** Initial category. Defaults to `'weight'`. */\n defaultCategory?: UnitCategory;\n /** Fires with the converted value (and `null` when input is empty). */\n onResultChange?: (value: number | null) => void;\n /** When provided, shows an \"Insert\" button that emits the result for an editor. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → the default `'AlfaDocs'` wordmark; a string overrides it;\n * `false` removes the brand line.\n */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport const UnitConverter = forwardRef<HTMLDivElement, UnitConverterProps>(\n (\n {\n defaultCategory = 'weight',\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [category, setCategory] = useState<UnitCategory>(defaultCategory);\n const [value, setValue] = useState<number | null>(null);\n const [fromId, setFromId] = useState<string>(\n UNITS_BY_CATEGORY[defaultCategory][0],\n );\n const [toId, setToId] = useState<string>(\n UNITS_BY_CATEGORY[defaultCategory][1],\n );\n\n const handleCategoryChange = (next: string): void => {\n const cat = next as UnitCategory;\n const units = UNITS_BY_CATEGORY[cat];\n setCategory(cat);\n setFromId(units[0]);\n setToId(units[1] ?? units[0]);\n };\n\n const converted = useMemo(\n () => (value === null ? null : convertUnits(value, fromId, toId)),\n [value, fromId, toId],\n );\n\n const numberFmt = useMemo(\n () => new Intl.NumberFormat(i18n.language, { maximumFractionDigits: 3 }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(converted);\n }, [converted, onResultChange]);\n\n const categoryOptions = CATEGORIES.map((c) => ({\n value: c,\n label: t(`unitConverter.category.${c}`),\n }));\n const unitOptions = UNITS_BY_CATEGORY[category].map((u) => ({\n value: u,\n label: t(`unitConverter.units.${u}`),\n }));\n\n return (\n <div\n ref={ref}\n data-component=\"unit-converter\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <FormField label={t('unitConverter.categoryLabel')}>\n <Select\n options={categoryOptions}\n value={category}\n onValueChange={handleCategoryChange}\n />\n </FormField>\n\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <FormField label={t('unitConverter.value')}>\n <NumberInput mode=\"decimal\" value={value} onChange={setValue} />\n </FormField>\n <FormField label={t('unitConverter.from')}>\n <Select\n options={unitOptions}\n value={fromId}\n onValueChange={setFromId}\n />\n </FormField>\n <FormField label={t('unitConverter.to')}>\n <Select\n options={unitOptions}\n value={toId}\n onValueChange={setToId}\n />\n </FormField>\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {converted !== null\n ? `${numberFmt.format(value ?? 0)} ${t(\n `unitConverter.units.${fromId}`,\n )} = ${numberFmt.format(converted)} ${t(\n `unitConverter.units.${toId}`,\n )}`\n : ''}\n </p>\n\n {converted !== null ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label ds:text-muted-foreground\">\n {t('unitConverter.result')}\n </span>\n <span className=\"type-metric ds:text-foreground\">\n {numberFmt.format(converted)} {t(`unitConverter.units.${toId}`)}\n </span>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n variant={insertVariant}\n onInsert={onInsert}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.unitConverter'),\n highlight: t(`unitConverter.category.${category}`),\n // Chip tints by measurement family so the inserted card\n // signals the category at a glance.\n highlightToken: CATEGORY_HIGHLIGHT_TOKEN[category],\n brand: insertBrand,\n fields: [\n {\n label: t('unitConverter.from'),\n value: `${numberFmt.format(value ?? 0)} ${t(\n `unitConverter.units.${fromId}`,\n )}`,\n },\n {\n label: t('unitConverter.to'),\n value: `${numberFmt.format(converted)} ${t(\n `unitConverter.units.${toId}`,\n )}`,\n },\n ],\n }}\n />\n ) : null}\n </div>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('unitConverter.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nUnitConverter.displayName = 'UnitConverter';\n"],"names":["UNITS","UNITS_BY_CATEGORY","CATEGORIES","convertUnits","value","fromId","toId","from","to","rootVariants","cva","CATEGORY_HIGHLIGHT_TOKEN","UnitConverter","forwardRef","defaultCategory","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","i18n","useTranslation","category","setCategory","useState","setValue","setFromId","setToId","handleCategoryChange","next","cat","units","converted","useMemo","numberFmt","useEffect","categoryOptions","c","unitOptions","u","jsxs","jsx","FormField","Select","NumberInput","InsertButton"],"mappings":";;;;;;;;AAqBO,MAAMA,IAAiC;AAAA;AAAA,EAE5C,IAAI,EAAE,IAAI,MAAM,UAAU,UAAU,QAAQ,GAAG,QAAQ,EAAA;AAAA,EACvD,GAAG,EAAE,IAAI,KAAK,UAAU,UAAU,QAAQ,MAAO,QAAQ,EAAA;AAAA,EACzD,IAAI,EAAE,IAAI,MAAM,UAAU,UAAU,QAAQ,YAAY,QAAQ,EAAA;AAAA,EAChE,IAAI,EAAE,IAAI,MAAM,UAAU,UAAU,QAAQ,gBAAgB,QAAQ,EAAA;AAAA;AAAA,EAEpE,IAAI,EAAE,IAAI,MAAM,UAAU,UAAU,QAAQ,GAAG,QAAQ,EAAA;AAAA,EACvD,GAAG,EAAE,IAAI,KAAK,UAAU,UAAU,QAAQ,KAAK,QAAQ,EAAA;AAAA,EACvD,IAAI,EAAE,IAAI,MAAM,U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AAOF,CAAS,CAAC,IAAI;AAAA,wBACvC,uBAAuB/B,CAAI;AAAA,sBAAA,CAC5B;AAAA,oBAAA;AAAA,kBACH;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,GACN,IAEA,gBAAAwC,EAAC,KAAA,EAAE,WAAU,sCACV,UAAA,EAAE,qBAAqB,EAAA,CAC1B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAlC,EAAc,cAAc;"}
|
package/dist/agent-catalog.json
CHANGED
|
@@ -2,7 +2,7 @@ export { composeRefs } from './compose-refs';
|
|
|
2
2
|
export { isSafeImageSrc, safeImageSrc } from './safe-image-src';
|
|
3
3
|
export { SafeHtml, sanitiseHtml, type SafeHtmlProfile, type SafeHtmlProps, } from './safe-html';
|
|
4
4
|
export { groupOptions } from './group-options';
|
|
5
|
-
export { InsertButton, buildResultText, buildResultHtml, buildResultCardSvg, svgCardToPngDataUri, type InsertButtonProps, type InsertVariant, type InsertPayload, type InsertMode, type InsertCardData, type InsertCardField, type SvgCardToPngOptions, } from './insert-result';
|
|
5
|
+
export { InsertButton, buildResultText, buildResultHtml, buildResultCardSvg, svgCardToPngDataUri, svgCardToPng, type InsertButtonProps, type InsertVariant, type InsertPayload, type InsertPngResult, type InsertMode, type InsertCardData, type InsertCardField, type InsertCardGauge, type SvgCardToPngOptions, } from './insert-result';
|
|
6
6
|
export { normalizeDiacritics } from './normalize-diacritics';
|
|
7
7
|
export { useDebouncedCallback } from './use-debounced-callback';
|
|
8
8
|
export { useFocusTrap, type UseFocusTrapOptions } from './use-focus-trap';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/_shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO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,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/_shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -5,13 +5,62 @@ export interface InsertCardField {
|
|
|
5
5
|
label: string;
|
|
6
6
|
value: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Optional radial gauge, drawn as a hand-rolled native-SVG donut (track
|
|
10
|
+
* `<circle>` + value arc via `stroke-dasharray`) so it survives the
|
|
11
|
+
* `<img>` → `<canvas>` → `toBlob` raster. No `<foreignObject>`, no charting lib.
|
|
12
|
+
*/
|
|
13
|
+
export interface InsertCardGauge {
|
|
14
|
+
/** Big number rendered in the gauge centre (e.g. `'22.4'`). */
|
|
15
|
+
value: string;
|
|
16
|
+
/**
|
|
17
|
+
* Filled fraction of the ring, `0`–`1`. Takes precedence when supplied;
|
|
18
|
+
* otherwise derived from a `value`/`max` numeric parse (falling back to a
|
|
19
|
+
* full ring when neither is numeric).
|
|
20
|
+
*/
|
|
21
|
+
fraction?: number;
|
|
22
|
+
/** Denominator used to derive `fraction` when `fraction` is omitted. */
|
|
23
|
+
max?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Number of evenly-spaced segment gaps to notch into the ring (e.g. `4` for
|
|
26
|
+
* a quartered dial). `0`/omitted draws a continuous arc.
|
|
27
|
+
*/
|
|
28
|
+
segments?: number;
|
|
29
|
+
/**
|
|
30
|
+
* DS token NAME for the arc colour — e.g. `'--success'`, `'--warning'`,
|
|
31
|
+
* `'--destructive'`, `'--info'`, or the light-orange overweight override.
|
|
32
|
+
* Resolved to a concrete colour from a probe span at raster time; never a
|
|
33
|
+
* hex literal in source.
|
|
34
|
+
*/
|
|
35
|
+
colorToken: string;
|
|
36
|
+
/** Small category label under the value inside the ring. */
|
|
37
|
+
label?: string;
|
|
38
|
+
}
|
|
8
39
|
export interface InsertCardData {
|
|
9
40
|
/** Card heading. */
|
|
10
41
|
title: string;
|
|
11
42
|
/** Key/value rows. */
|
|
12
43
|
fields: InsertCardField[];
|
|
13
|
-
/** Optional highlighted line
|
|
44
|
+
/** Optional highlighted line, rendered as a category chip (pill). */
|
|
14
45
|
highlight?: string;
|
|
46
|
+
/**
|
|
47
|
+
* DS token NAME for the highlight chip fill. Defaults to the accent token
|
|
48
|
+
* (`--primary`). The chip text uses the matching `<token>-foreground` when it
|
|
49
|
+
* resolves, else falls back to the card background for contrast.
|
|
50
|
+
*/
|
|
51
|
+
highlightToken?: string;
|
|
52
|
+
/** Optional radial gauge drawn natively in the card. */
|
|
53
|
+
gauge?: InsertCardGauge;
|
|
54
|
+
/**
|
|
55
|
+
* Brand wordmark printed in the card footer.
|
|
56
|
+
*
|
|
57
|
+
* - omitted → the default `'AlfaDocs'` wordmark.
|
|
58
|
+
* - a string → that custom wordmark.
|
|
59
|
+
* - `false` → no brand line at all.
|
|
60
|
+
*
|
|
61
|
+
* A `brand` passed to {@link SvgCardToPngOptions} overrides this per-render.
|
|
62
|
+
*/
|
|
63
|
+
brand?: string | false;
|
|
15
64
|
}
|
|
16
65
|
export interface InsertPayload {
|
|
17
66
|
/** Which button the user chose. */
|
|
@@ -38,14 +87,30 @@ export interface InsertPayload {
|
|
|
38
87
|
*/
|
|
39
88
|
imageDataUri: string;
|
|
40
89
|
/**
|
|
41
|
-
* Async thunk that resolves the result-card
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
90
|
+
* Async thunk that resolves the result-card raster — the format intended for
|
|
91
|
+
* editor insertion. PNG is a flat raster: it carries no script and survives
|
|
92
|
+
* the rich-text sanitiser that strips SVG.
|
|
93
|
+
*
|
|
94
|
+
* Resolves to `{ dataUri, width, height }` where `width`/`height` are the
|
|
95
|
+
* **logical (un-scaled) CSS pixel** dimensions: set them on the inserted
|
|
96
|
+
* `<img width height>` and the supersampled (`>= 2×`) PNG renders crisp with
|
|
97
|
+
* no consumer-side shim. For mode `'text'` resolves to an empty
|
|
98
|
+
* `{ dataUri: '', width: 0, height: 0 }`. Rendered lazily so the synchronous
|
|
99
|
+
* payload stays cheap; `await payload.pngDataUri()` only when you need it.
|
|
100
|
+
*
|
|
101
|
+
* @since 0.43.0 — this return shape changed from a bare `Promise<string>` to
|
|
102
|
+
* `Promise<{ dataUri; width; height }>` (see CHANGELOG).
|
|
47
103
|
*/
|
|
48
|
-
pngDataUri: () => Promise<
|
|
104
|
+
pngDataUri: () => Promise<InsertPngResult>;
|
|
105
|
+
}
|
|
106
|
+
/** Resolved PNG raster plus its logical (un-scaled) `<img>` dimensions. */
|
|
107
|
+
export interface InsertPngResult {
|
|
108
|
+
/** `image/png` data URI, or `''` for the text-only mode. */
|
|
109
|
+
dataUri: string;
|
|
110
|
+
/** Logical (CSS px) width to set on the inserted `<img>`. `0` when empty. */
|
|
111
|
+
width: number;
|
|
112
|
+
/** Logical (CSS px) height to set on the inserted `<img>`. `0` when empty. */
|
|
113
|
+
height: number;
|
|
49
114
|
}
|
|
50
115
|
export interface InsertButtonProps {
|
|
51
116
|
/** Structured result used to build every payload representation. */
|
|
@@ -84,10 +149,22 @@ interface ThemeColours {
|
|
|
84
149
|
border: string;
|
|
85
150
|
bg: string;
|
|
86
151
|
font: string;
|
|
152
|
+
/**
|
|
153
|
+
* Concrete colours resolved from arbitrary DS token names, keyed by the token
|
|
154
|
+
* name the caller passed (e.g. `'--success'`). Populated for the gauge arc
|
|
155
|
+
* and the highlight chip; consulted by {@link buildResultCardSvg} via
|
|
156
|
+
* {@link resolveToken}.
|
|
157
|
+
*/
|
|
158
|
+
tokens?: Record<string, string>;
|
|
87
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Internal resolved-colour shape, re-exported for tests that construct a card
|
|
162
|
+
* raster without a live DOM probe. Not part of the public component API.
|
|
163
|
+
*/
|
|
164
|
+
export type ThemeColoursForTest = ThemeColours;
|
|
88
165
|
export declare function buildResultText(card: InsertCardData): string;
|
|
89
166
|
export declare function buildResultHtml(card: InsertCardData): string;
|
|
90
|
-
export declare function buildResultCardSvg(card: InsertCardData, c: ThemeColours): string;
|
|
167
|
+
export declare function buildResultCardSvg(card: InsertCardData, c: ThemeColours, brand?: string | false): string;
|
|
91
168
|
/** Options for {@link svgCardToPngDataUri}. */
|
|
92
169
|
export interface SvgCardToPngOptions {
|
|
93
170
|
/**
|
|
@@ -98,9 +175,15 @@ export interface SvgCardToPngOptions {
|
|
|
98
175
|
colours?: ThemeColours;
|
|
99
176
|
/**
|
|
100
177
|
* Device-pixel scale factor for the raster. `2` yields a retina-sharp PNG.
|
|
101
|
-
* Defaults to `
|
|
178
|
+
* Defaults to `Math.max(2, devicePixelRatio)` so the inserted image is crisp
|
|
179
|
+
* without a consumer-side supersampling shim.
|
|
102
180
|
*/
|
|
103
181
|
scale?: number;
|
|
182
|
+
/**
|
|
183
|
+
* Brand wordmark for the footer. Omitted → the card's own `brand` (then the
|
|
184
|
+
* default `'AlfaDocs'`); a string overrides it; `false` removes it.
|
|
185
|
+
*/
|
|
186
|
+
brand?: string | false;
|
|
104
187
|
}
|
|
105
188
|
/**
|
|
106
189
|
* Render an {@link InsertCardData} result card to an `image/png` data URI.
|
|
@@ -114,6 +197,13 @@ export interface SvgCardToPngOptions {
|
|
|
114
197
|
* called in a non-DOM context or if the SVG fails to decode.
|
|
115
198
|
*/
|
|
116
199
|
export declare function svgCardToPngDataUri(card: InsertCardData, opts?: SvgCardToPngOptions): Promise<string>;
|
|
200
|
+
/**
|
|
201
|
+
* Like {@link svgCardToPngDataUri} but also returns the **logical (un-scaled)**
|
|
202
|
+
* card dimensions so consumers can size the inserted `<img width height>` and
|
|
203
|
+
* drop their own supersampling shim. The PNG itself is rasterised at `scale`
|
|
204
|
+
* (default `Math.max(2, devicePixelRatio)`) for crispness.
|
|
205
|
+
*/
|
|
206
|
+
export declare function svgCardToPng(card: InsertCardData, opts?: SvgCardToPngOptions): Promise<InsertPngResult>;
|
|
117
207
|
export declare const InsertButton: import("react").ForwardRefExoticComponent<InsertButtonProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
118
208
|
export {};
|
|
119
209
|
//# sourceMappingURL=insert-result.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert-result.d.ts","sourceRoot":"","sources":["../../../src/components/_shared/insert-result.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;AAEzD,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,
|
|
1
|
+
{"version":3,"file":"insert-result.d.ts","sourceRoot":"","sources":["../../../src/components/_shared/insert-result.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;AAEzD,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,KAAK,EAAE,MAAM,C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GAUG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,IAAI,GAAE,mBAAwB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,IAAI,GAAE,mBAAwB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAe1B;AAuFD,eAAO,MAAM,YAAY,8GAqHxB,CAAC"}
|
|
@@ -27,6 +27,12 @@ export interface BmiCalculatorProps extends VariantProps<typeof rootVariants> {
|
|
|
27
27
|
onCopy?: (mode: InsertMode) => void;
|
|
28
28
|
/** `copy` variant only — fired if the clipboard write can't proceed. */
|
|
29
29
|
onError?: (error: unknown) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Brand wordmark printed in the inserted/copied result-card footer.
|
|
32
|
+
* Omitted → the default `'AlfaDocs'` wordmark; a string overrides it;
|
|
33
|
+
* `false` removes the brand line.
|
|
34
|
+
*/
|
|
35
|
+
insertBrand?: string | false;
|
|
30
36
|
/** Opaque instance id, emitted as `data-component-id`. */
|
|
31
37
|
id?: string;
|
|
32
38
|
/** Extra class names on the wrapper. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bmi-calculator.d.ts","sourceRoot":"","sources":["../../../src/components/bmi-calculator/bmi-calculator.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAQjB,MAAM,OAAO,CAAC;AAMf,MAAM,WAAW,SAAS;IACxB,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,QAAQ,EAAE,WAAW,CAAC;CACvB;AAMD,QAAA,MAAM,YAAY;;8EAQhB,CAAC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
|
|
|
1
|
-
import { B as m } from "../../_chunks/bmi-calculator-
|
|
1
|
+
import { B as m } from "../../_chunks/bmi-calculator-DFPWL2OJ.js";
|
|
2
2
|
import { b as e, a as t, c as r, d as T, e as c, f as i, i as b, k as n, l as f } from "../../_chunks/bmi-BxD-tFzU.js";
|
|
3
3
|
export {
|
|
4
4
|
m as BmiCalculator,
|
|
@@ -21,6 +21,12 @@ export interface CycleCalculatorProps extends VariantProps<typeof rootVariants>
|
|
|
21
21
|
onCopy?: (mode: InsertMode) => void;
|
|
22
22
|
/** `copy` variant only — fired if the clipboard write can't proceed. */
|
|
23
23
|
onError?: (error: unknown) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Brand wordmark printed in the inserted/copied result-card footer.
|
|
26
|
+
* Omitted → the default `'AlfaDocs'` wordmark; a string overrides it;
|
|
27
|
+
* `false` removes the brand line.
|
|
28
|
+
*/
|
|
29
|
+
insertBrand?: string | false;
|
|
24
30
|
/** Opaque instance id, emitted as `data-component-id`. */
|
|
25
31
|
id?: string;
|
|
26
32
|
/** Extra class names on the wrapper. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cycle-calculator.d.ts","sourceRoot":"","sources":["../../../src/components/cycle-calculator/cycle-calculator.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,SAAS,CAAC;AAEjB,QAAA,MAAM,YAAY;;8EAKhB,CAAC;
|
|
1
|
+
{"version":3,"file":"cycle-calculator.d.ts","sourceRoot":"","sources":["../../../src/components/cycle-calculator/cycle-calculator.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,SAAS,CAAC;AAEjB,QAAA,MAAM,YAAY;;8EAKhB,CAAC;AAUH,MAAM,WAAW,oBAAqB,SAAQ,YAAY,CACxD,OAAO,YAAY,CACpB;IACC,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8EAA8E;IAC9E,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1D,kFAAkF;IAClF,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,sEAAsE;IACtE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACpC,wEAAwE;IACxE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC7B,0DAA0D;IAC1D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,iHA6K3B,CAAC"}
|
|
@@ -36,6 +36,7 @@ export declare const Dialog: {
|
|
|
36
36
|
Header: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
37
|
Title: import("react").ForwardRefExoticComponent<Omit<RadixDialog.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
38
38
|
Description: import("react").ForwardRefExoticComponent<Omit<RadixDialog.DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
39
|
+
Body: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
39
40
|
Footer: import("react").ForwardRefExoticComponent<DialogFooterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
40
41
|
Close: import("react").ForwardRefExoticComponent<Omit<RadixDialog.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
41
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AA0ClE,QAAA,MAAM,eAAe;;8EAUnB,CAAC;AAGH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,eAAgB,SAAQ,wBAAwB,CAC/D,OAAO,WAAW,CAAC,IAAI,CACxB;IACC,+EAA+E;IAC/E,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAgED,MAAM,WAAW,kBACf,SACE,IAAI,CAAC,wBAAwB,CAAC,OAAO,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,EAClE,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,YAAY,CAAC;IACzC,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAiHD,UAAU,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAqBD,eAAO,MAAM,MAAM;4EAtMhB,eAAe;;;;gFAAf,eAAe;;;;;;;;;;;CAgNhB,CAAC;AAEH,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -21,6 +21,12 @@ export interface DueDateCalculatorProps extends VariantProps<typeof rootVariants
|
|
|
21
21
|
onCopy?: (mode: InsertMode) => void;
|
|
22
22
|
/** `copy` variant only — fired if the clipboard write can't proceed. */
|
|
23
23
|
onError?: (error: unknown) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Brand wordmark printed in the inserted/copied result-card footer.
|
|
26
|
+
* Omitted → the default `'AlfaDocs'` wordmark; a string overrides it;
|
|
27
|
+
* `false` removes the brand line.
|
|
28
|
+
*/
|
|
29
|
+
insertBrand?: string | false;
|
|
24
30
|
/** Opaque instance id, emitted as `data-component-id`. */
|
|
25
31
|
id?: string;
|
|
26
32
|
/** Extra class names on the wrapper. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"due-date-calculator.d.ts","sourceRoot":"","sources":["../../../src/components/due-date-calculator/due-date-calculator.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,aAAa,EAGnB,MAAM,aAAa,CAAC;AAErB,QAAA,MAAM,YAAY;;8EAKhB,CAAC;
|
|
1
|
+
{"version":3,"file":"due-date-calculator.d.ts","sourceRoot":"","sources":["../../../src/components/due-date-calculator/due-date-calculator.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,aAAa,EAGnB,MAAM,aAAa,CAAC;AAErB,QAAA,MAAM,YAAY;;8EAKhB,CAAC;AAmCH,MAAM,WAAW,sBAAuB,SAAQ,YAAY,CAC1D,OAAO,YAAY,CACpB;IACC,kDAAkD;IAClD,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,iFAAiF;IACjF,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,mFAAmF;IACnF,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,sEAAsE;IACtE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACpC,wEAAwE;IACxE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC7B,0DAA0D;IAC1D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,mHA6M7B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as s } from "../../_chunks/due-date-calculator-
|
|
1
|
+
import { D as s } from "../../_chunks/due-date-calculator-CYXKLoof.js";
|
|
2
2
|
import { D as E, G as o, M as D, T as r, c as T, g as _, t as C } from "../../_chunks/gestation-mWF4AXea.js";
|
|
3
3
|
export {
|
|
4
4
|
E as DEFAULT_CYCLE_LENGTH,
|
|
@@ -27,6 +27,12 @@ export interface GestationalAgeCalculatorProps extends VariantProps<typeof rootV
|
|
|
27
27
|
onCopy?: (mode: InsertMode) => void;
|
|
28
28
|
/** `copy` variant only — fired if the clipboard write can't proceed. */
|
|
29
29
|
onError?: (error: unknown) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Brand wordmark printed in the inserted/copied result-card footer.
|
|
32
|
+
* Omitted → the default `'AlfaDocs'` wordmark; a string overrides it;
|
|
33
|
+
* `false` removes the brand line.
|
|
34
|
+
*/
|
|
35
|
+
insertBrand?: string | false;
|
|
30
36
|
/** Opaque instance id, emitted as `data-component-id`. */
|
|
31
37
|
id?: string;
|
|
32
38
|
/** Extra class names on the wrapper. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gestational-age-calculator.d.ts","sourceRoot":"","sources":["../../../src/components/gestational-age-calculator/gestational-age-calculator.tsx"],"names":[],"mappings":"AASA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,SAAS,EACd,KAAK,cAAc,EAIpB,MAAM,wBAAwB,CAAC;AAEhC,QAAA,MAAM,YAAY;;8EAKhB,CAAC;
|
|
1
|
+
{"version":3,"file":"gestational-age-calculator.d.ts","sourceRoot":"","sources":["../../../src/components/gestational-age-calculator/gestational-age-calculator.ts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