@alfadocs/ui-kit 0.37.0 → 0.38.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/Alfadocs_Logo_Mark-7o3L3WBI.js +56 -0
- package/dist/_chunks/{alia-sidebar-BEoMl6UL.js → alia-sidebar-DXsYPinm.js} +2 -2
- package/dist/_chunks/{ar-D1RwVZFj.js → ar-Cn_NxqkN.js} +2 -2
- package/dist/_chunks/bmi-BxD-tFzU.js +32 -0
- package/dist/_chunks/bmi-calculator-BRUru9QX.js +213 -0
- package/dist/_chunks/{booking-DqXsd1Mv.js → booking-DK_BPHnQ.js} +4 -4
- package/dist/_chunks/calculator-dialog-B74fqpFZ.js +40 -0
- package/dist/_chunks/{chat-message-D53_fH2w.js → chat-message-ASgGtj-L.js} +30 -39
- package/dist/_chunks/{contact-profile-card-BA6fgS45.js → contact-profile-card-DHyuAPXM.js} +14 -13
- package/dist/_chunks/cycle-calculator-B5Uj9QeT.js +185 -0
- package/dist/_chunks/{date-picker-CXFpu-qY.js → date-picker-CvQfs6Xh.js} +2 -2
- package/dist/_chunks/{date-range-picker-I-q5rifj.js → date-range-picker-U9fn1g9d.js} +3 -3
- package/dist/_chunks/{date-time-picker-CqpGPlcH.js → date-time-picker-Cva0ZCWw.js} +2 -2
- package/dist/_chunks/{de-HTQ4b4-J.js → de-BMM2H7Bs.js} +2 -2
- package/dist/_chunks/dependent-selector-CRWgieHm.js +324 -0
- package/dist/_chunks/document-scanner-CdHQ6lTN.js +702 -0
- package/dist/_chunks/due-date-calculator-CUspKSTw.js +171 -0
- package/dist/_chunks/{editable-currency-cell-renderer-DnjwZNZP.js → editable-currency-cell-renderer-DGKuRNVG.js} +2 -2
- package/dist/_chunks/{el-Dr1pjuDq.js → el-BYPonAaK.js} +2 -2
- package/dist/_chunks/{es-CvyTjLS0.js → es-CMkVCQ4F.js} +2 -2
- package/dist/_chunks/{file-upload-CdozCPct.js → file-upload-CnzRcErt.js} +2 -1
- package/dist/_chunks/fiscal-code-input-BZ0FxwUl.js +540 -0
- package/dist/_chunks/{fr-CS7aqaFR.js → fr-BcuWxqft.js} +2 -2
- package/dist/_chunks/gestation-BXEgDGmP.js +50 -0
- package/dist/_chunks/gestational-age-calculator-CsQ05qDy.js +165 -0
- package/dist/_chunks/heart-C0faivFf.js +20 -0
- package/dist/_chunks/{hi-3uy8KpsH.js → hi-wkq_rQAh.js} +2 -2
- package/dist/_chunks/image-C6RM5hfF.js +16 -0
- package/dist/_chunks/insert-result-yJ0QavoN.js +133 -0
- package/dist/_chunks/{isSameWeek-DRpMibi9.js → isSameWeek-Bim5ftRd.js} +2 -2
- package/dist/_chunks/{it-B_RF5VSw.js → it-GiQrQ9p4.js} +3 -3
- package/dist/_chunks/{ja-C1mEYy35.js → ja-qfYg3Rua.js} +2 -2
- package/dist/_chunks/{logo-_Z-jLq80.js → logo-yituK7sE.js} +42 -91
- package/dist/_chunks/{marketplace-app-shell-DXHxy9dj.js → marketplace-app-shell-BnClrL2B.js} +2 -2
- package/dist/_chunks/{nl-Dl7lO2t3.js → nl-xOogO4sZ.js} +2 -2
- package/dist/_chunks/{patient-shell-CDvMw_Nk.js → patient-shell-Bz3CdO84.js} +2 -2
- package/dist/_chunks/{pl-Dgsogljx.js → pl-GnOW6eGK.js} +3 -3
- package/dist/_chunks/{practice-results-BFM_lyUs.js → practice-results-C8ciLQap.js} +3 -2
- package/dist/_chunks/pregnancy-weight-gain-BCdi-JSv.js +209 -0
- package/dist/_chunks/{privacy-lock-DD-wHxBg.js → privacy-lock-BmX_gkvt.js} +2 -2
- package/dist/_chunks/{pt-Dm2JF4bc.js → pt-_bV5b5RW.js} +2 -2
- package/dist/_chunks/{public-footer.agent-Cjfe5jus.js → public-footer.agent-zw1vFin_.js} +2 -2
- package/dist/_chunks/qr-code-DNXhi6se.js +568 -0
- package/dist/_chunks/{react-day-picker-DYDdR8Vv.js → react-day-picker-CdtIiKjx.js} +24 -24
- package/dist/_chunks/{rich-text-editor-CHmr9Bz8.js → rich-text-editor-DLbg2852.js} +114 -124
- package/dist/_chunks/{ro-BXFZ_xIX.js → ro-BEcyh5Nj.js} +2 -2
- package/dist/_chunks/rotate-ccw-BWANpitO.js +15 -0
- package/dist/_chunks/{ru-BPQkNRRV.js → ru-Bi86hqMf.js} +3 -3
- package/dist/_chunks/session-countdown-LPnhTHjn.js +214 -0
- package/dist/_chunks/{shield-check-BhHyReu8.js → shield-check-C73ma9Cs.js} +8 -24
- package/dist/_chunks/{sign-in-with-alfadocs-button-BI0fVonM.js → sign-in-with-alfadocs-button-DeHBFRNS.js} +2 -2
- package/dist/_chunks/social-sign-in-button-X54ySJr1.js +243 -0
- package/dist/_chunks/{sq-ChTlGFcJ.js → sq-BujHSAWu.js} +2 -2
- package/dist/_chunks/subDays-_T9YeKPX.js +8 -0
- package/dist/_chunks/{sv-Do_gs6ir.js → sv-C8AeDrTA.js} +2 -2
- package/dist/_chunks/{tr-da_UnkYH.js → tr-CMSs_Vgf.js} +2 -2
- package/dist/_chunks/unit-converter-EUwO6QYq.js +168 -0
- package/dist/_chunks/wallet-pay-button-DK4ESYge.js +250 -0
- package/dist/_chunks/{zh-CN-C9qi5oak.js → zh-CN-eXB-PFu4.js} +3 -3
- package/dist/agent-catalog.json +203 -1
- package/dist/brand/provider-marks/apple-pay.d.ts +12 -0
- package/dist/brand/provider-marks/apple.d.ts +12 -0
- package/dist/brand/provider-marks/google-pay.d.ts +12 -0
- package/dist/brand/provider-marks/google.d.ts +13 -0
- package/dist/components/_shared/insert-result.d.ts +47 -0
- package/dist/components/bmi-calculator/bmi-calculator.d.ts +3 -0
- package/dist/components/bmi-calculator/index.js +6 -5
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calculator-dialog/calculator-dialog.d.ts +26 -0
- package/dist/components/calculator-dialog/index.d.ts +3 -0
- package/dist/components/calculator-dialog/index.js +5 -0
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/cycle-calculator/cycle-calculator.d.ts +21 -0
- package/dist/components/cycle-calculator/cycle.d.ts +37 -0
- package/dist/components/cycle-calculator/index.d.ts +4 -0
- package/dist/components/cycle-calculator/index.js +7 -0
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dependent-selector/dependent-selector.agent.d.ts +4 -0
- package/dist/components/dependent-selector/dependent-selector.d.ts +72 -0
- package/dist/components/dependent-selector/index.d.ts +4 -0
- package/dist/components/dependent-selector/index.js +6 -0
- package/dist/components/document-scanner/document-scanner.agent.d.ts +4 -0
- package/dist/components/document-scanner/document-scanner.d.ts +93 -0
- package/dist/components/document-scanner/index.d.ts +4 -0
- package/dist/components/document-scanner/index.js +6 -0
- package/dist/components/due-date-calculator/due-date-calculator.d.ts +3 -0
- package/dist/components/due-date-calculator/gestation.d.ts +16 -0
- package/dist/components/due-date-calculator/index.d.ts +1 -1
- package/dist/components/due-date-calculator/index.js +10 -7
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/fiscal-code-input/calculate-codice-fiscale.d.ts +24 -0
- package/dist/components/fiscal-code-input/fiscal-code-input.agent.d.ts +4 -0
- package/dist/components/fiscal-code-input/fiscal-code-input.d.ts +61 -0
- package/dist/components/fiscal-code-input/index.d.ts +6 -0
- package/dist/components/fiscal-code-input/index.js +11 -0
- package/dist/components/fiscal-code-input/is-valid-codice-fiscale.d.ts +21 -0
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +27 -0
- package/dist/components/gestational-age-calculator/index.d.ts +3 -0
- package/dist/components/gestational-age-calculator/index.js +5 -0
- package/dist/components/index.d.ts +13 -0
- package/dist/components/logo/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.d.ts +4 -0
- package/dist/components/pregnancy-weight-gain/index.js +9 -0
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +19 -0
- package/dist/components/pregnancy-weight-gain/weight-gain.d.ts +41 -0
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/public-footer/index.js +1 -1
- package/dist/components/qr-code/index.d.ts +5 -0
- package/dist/components/qr-code/index.js +8 -0
- package/dist/components/qr-code/qr-code.agent.d.ts +3 -0
- package/dist/components/qr-code/qr-code.d.ts +59 -0
- package/dist/components/qr-code/qr-encode.d.ts +46 -0
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/session-countdown/index.d.ts +4 -0
- package/dist/components/session-countdown/index.js +6 -0
- package/dist/components/session-countdown/session-countdown.agent.d.ts +3 -0
- package/dist/components/session-countdown/session-countdown.d.ts +38 -0
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/social-sign-in-button/index.d.ts +3 -0
- package/dist/components/social-sign-in-button/index.js +5 -0
- package/dist/components/social-sign-in-button/social-sign-in-button.d.ts +56 -0
- package/dist/components/unit-converter/index.d.ts +4 -0
- package/dist/components/unit-converter/index.js +9 -0
- package/dist/components/unit-converter/unit-converter.d.ts +21 -0
- package/dist/components/unit-converter/units.d.ts +18 -0
- package/dist/components/wallet-pay-button/index.d.ts +3 -0
- package/dist/components/wallet-pay-button/index.js +5 -0
- package/dist/components/wallet-pay-button/wallet-pay-button.d.ts +63 -0
- package/dist/i18n/locales/ar.d.ts +252 -0
- package/dist/i18n/locales/ar.js +249 -0
- package/dist/i18n/locales/de.d.ts +252 -0
- package/dist/i18n/locales/de.js +249 -0
- package/dist/i18n/locales/el.d.ts +252 -0
- package/dist/i18n/locales/el.js +249 -0
- package/dist/i18n/locales/en.d.ts +252 -0
- package/dist/i18n/locales/en.js +252 -0
- package/dist/i18n/locales/es.d.ts +252 -0
- package/dist/i18n/locales/es.js +249 -0
- package/dist/i18n/locales/fr.d.ts +252 -0
- package/dist/i18n/locales/fr.js +249 -0
- package/dist/i18n/locales/hi.d.ts +252 -0
- package/dist/i18n/locales/hi.js +249 -0
- package/dist/i18n/locales/it.d.ts +252 -0
- package/dist/i18n/locales/it.js +249 -0
- package/dist/i18n/locales/ja.d.ts +252 -0
- package/dist/i18n/locales/ja.js +245 -0
- package/dist/i18n/locales/nl.d.ts +252 -0
- package/dist/i18n/locales/nl.js +249 -0
- package/dist/i18n/locales/pl.d.ts +252 -0
- package/dist/i18n/locales/pl.js +249 -0
- package/dist/i18n/locales/pt.d.ts +252 -0
- package/dist/i18n/locales/pt.js +252 -0
- package/dist/i18n/locales/ro.d.ts +252 -0
- package/dist/i18n/locales/ro.js +249 -0
- package/dist/i18n/locales/ru.d.ts +252 -0
- package/dist/i18n/locales/ru.js +249 -0
- package/dist/i18n/locales/sq.d.ts +252 -0
- package/dist/i18n/locales/sq.js +249 -0
- package/dist/i18n/locales/sv.d.ts +252 -0
- package/dist/i18n/locales/sv.js +249 -0
- package/dist/i18n/locales/tr.d.ts +252 -0
- package/dist/i18n/locales/tr.js +249 -0
- package/dist/i18n/locales/zh.d.ts +252 -0
- package/dist/i18n/locales/zh.js +245 -0
- package/dist/index.js +587 -535
- package/dist/locales/ar.json +252 -0
- package/dist/locales/de.json +252 -0
- package/dist/locales/el.json +252 -0
- package/dist/locales/en.json +252 -0
- package/dist/locales/es.json +252 -0
- package/dist/locales/fr.json +252 -0
- package/dist/locales/hi.json +252 -0
- package/dist/locales/it.json +252 -0
- package/dist/locales/ja.json +252 -0
- package/dist/locales/nl.json +252 -0
- package/dist/locales/pl.json +252 -0
- package/dist/locales/pt.json +252 -0
- package/dist/locales/ro.json +252 -0
- package/dist/locales/ru.json +252 -0
- package/dist/locales/sq.json +252 -0
- package/dist/locales/sv.json +252 -0
- package/dist/locales/tr.json +252 -0
- package/dist/locales/zh.json +252 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +49 -1
- package/dist/_chunks/bmi-calculator-DQD5_nE-.js +0 -214
- package/dist/_chunks/due-date-calculator-kf9U_g7O.js +0 -173
- package/dist/_chunks/subDays-D-WYRpdW.js +0 -8
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type FiscalCodeReason } from './is-valid-codice-fiscale';
|
|
2
|
+
import { type CodiceFiscaleInput } from './calculate-codice-fiscale';
|
|
3
|
+
/** Agent-readiness curated handle for FiscalCodeInput. */
|
|
4
|
+
export interface FiscalCodeInputHandle {
|
|
5
|
+
getValue: () => string;
|
|
6
|
+
setValue: (value: string) => void;
|
|
7
|
+
clear: () => void;
|
|
8
|
+
focus: () => void;
|
|
9
|
+
isValid: () => boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Structured payload emitted on every keystroke alongside the raw value. */
|
|
12
|
+
export interface FiscalCodeChangeMeta {
|
|
13
|
+
/** Structurally sound AND control character matches (always 16 chars). */
|
|
14
|
+
isValid: boolean;
|
|
15
|
+
/** Whether all 16 characters are present (regardless of validity). */
|
|
16
|
+
isComplete: boolean;
|
|
17
|
+
/** Why the value is (in)valid — drives consumer messaging. */
|
|
18
|
+
reason: FiscalCodeReason;
|
|
19
|
+
}
|
|
20
|
+
export interface FiscalCodeInputProps {
|
|
21
|
+
/** Controlled value (raw, uppercased, no spaces). Pair with onChange. */
|
|
22
|
+
value?: string;
|
|
23
|
+
/** Uncontrolled initial value. Normalised on mount. */
|
|
24
|
+
defaultValue?: string;
|
|
25
|
+
/** Fires on every keystroke with the normalised raw string + meta. */
|
|
26
|
+
onChange?: (raw: string, meta: FiscalCodeChangeMeta) => void;
|
|
27
|
+
size?: 'sm' | 'md' | 'lg';
|
|
28
|
+
tone?: 'default' | 'error';
|
|
29
|
+
/** When the invalid tone + error string surface. Never marks partial input invalid. */
|
|
30
|
+
validateOn?: 'change' | 'blur' | 'submit';
|
|
31
|
+
/** Controlled escape hatch to force the invalid state (e.g. server rejection). */
|
|
32
|
+
showError?: boolean;
|
|
33
|
+
/** Overrides the kit's default i18n error string. */
|
|
34
|
+
errorMessage?: string;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
readOnly?: boolean;
|
|
37
|
+
required?: boolean;
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
/** Render the "16 characters" caption when NOT inside a FormField. */
|
|
40
|
+
showFormatHint?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* OPT-IN. When the consuming form already holds the person's identity
|
|
43
|
+
* data, supply it here to render an inline "calculate" affordance: a
|
|
44
|
+
* small icon button that derives the codice fiscale and fills the field.
|
|
45
|
+
* The caller supplies the 4-char `belfioreCode` of the birthplace — the
|
|
46
|
+
* kit does not bundle the municipality lookup table. Omit to render
|
|
47
|
+
* nothing extra (no behavioural change). Ignored when readOnly/disabled.
|
|
48
|
+
*/
|
|
49
|
+
calculateFrom?: CodiceFiscaleInput;
|
|
50
|
+
id?: string;
|
|
51
|
+
name?: string;
|
|
52
|
+
className?: string;
|
|
53
|
+
'aria-label'?: string;
|
|
54
|
+
}
|
|
55
|
+
declare const wrapperVariants: (props?: ({
|
|
56
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
57
|
+
tone?: "default" | "error" | null | undefined;
|
|
58
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
59
|
+
export declare const FiscalCodeInput: import("react").ForwardRefExoticComponent<FiscalCodeInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
60
|
+
export { wrapperVariants as fiscalCodeWrapperVariants };
|
|
61
|
+
//# sourceMappingURL=fiscal-code-input.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { FiscalCodeInput, fiscalCodeWrapperVariants, } from './fiscal-code-input';
|
|
2
|
+
export type { FiscalCodeInputProps, FiscalCodeInputHandle, FiscalCodeChangeMeta, } from './fiscal-code-input';
|
|
3
|
+
export { fiscalCodeInputAgent } from './fiscal-code-input.agent';
|
|
4
|
+
export { classifyCodiceFiscale, isValidCodiceFiscale, computeControlChar, type FiscalCodeReason, } from './is-valid-codice-fiscale';
|
|
5
|
+
export { calculateCodiceFiscale, type CodiceFiscaleInput, } from './calculate-codice-fiscale';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { F as c, c as e, a as i, b as l, f as o, w as t, i as C } from "../../_chunks/fiscal-code-input-BZ0FxwUl.js";
|
|
2
|
+
export {
|
|
3
|
+
c as FiscalCodeInput,
|
|
4
|
+
e as calculateCodiceFiscale,
|
|
5
|
+
i as classifyCodiceFiscale,
|
|
6
|
+
l as computeControlChar,
|
|
7
|
+
o as fiscalCodeInputAgent,
|
|
8
|
+
t as fiscalCodeWrapperVariants,
|
|
9
|
+
C as isValidCodiceFiscale
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Outcome of a structural + checksum check on a 16-char candidate. */
|
|
2
|
+
export type FiscalCodeReason = 'empty' | 'incomplete' | 'badFormat' | 'badChecksum' | 'valid';
|
|
3
|
+
/**
|
|
4
|
+
* Compute the expected 16th control character from the first 15
|
|
5
|
+
* informative characters. The input MUST already be 15 uppercase
|
|
6
|
+
* `[A-Z0-9]` characters (callers guard with `hasValidStructure`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function computeControlChar(first15: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Classify a normalised (uppercased, `[A-Z0-9]`-only) candidate.
|
|
11
|
+
*
|
|
12
|
+
* - `empty` — no characters.
|
|
13
|
+
* - `incomplete` — fewer than 16 characters.
|
|
14
|
+
* - `badFormat` — 16 characters but the position-class pattern fails.
|
|
15
|
+
* - `badChecksum` — 16 well-formed characters but the control char is wrong.
|
|
16
|
+
* - `valid` — structurally sound and the control char matches.
|
|
17
|
+
*/
|
|
18
|
+
export declare function classifyCodiceFiscale(raw: string): FiscalCodeReason;
|
|
19
|
+
/** Convenience boolean: structurally sound AND control character matches. */
|
|
20
|
+
export declare function isValidCodiceFiscale(raw: string): boolean;
|
|
21
|
+
//# sourceMappingURL=is-valid-codice-fiscale.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { type InsertPayload } from '../_shared/insert-result';
|
|
3
|
+
import { type Trimester, type GestationalAge } from '../due-date-calculator';
|
|
4
|
+
declare const rootVariants: (props?: ({
|
|
5
|
+
width?: "auto" | "full" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type DateMethod = 'lmp' | 'edd';
|
|
8
|
+
export interface GestationalAgeResult {
|
|
9
|
+
gestationalAge: GestationalAge | null;
|
|
10
|
+
trimester: Trimester;
|
|
11
|
+
dueDate: Date;
|
|
12
|
+
}
|
|
13
|
+
export interface GestationalAgeCalculatorProps extends VariantProps<typeof rootVariants> {
|
|
14
|
+
/** Whether the input date is the last period (`lmp`) or the due date (`edd`). */
|
|
15
|
+
defaultMethod?: DateMethod;
|
|
16
|
+
/** Fires whenever a result can be computed (and `null` when it can't). */
|
|
17
|
+
onResultChange?: (result: GestationalAgeResult | null) => void;
|
|
18
|
+
/** When provided, shows an "Insert" button that emits the result for an editor. */
|
|
19
|
+
onInsert?: (payload: InsertPayload) => void;
|
|
20
|
+
/** Opaque instance id, emitted as `data-component-id`. */
|
|
21
|
+
id?: string;
|
|
22
|
+
/** Extra class names on the wrapper. */
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const GestationalAgeCalculator: import("react").ForwardRefExoticComponent<GestationalAgeCalculatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=gestational-age-calculator.d.ts.map
|
|
@@ -19,6 +19,7 @@ export * from './date-picker';
|
|
|
19
19
|
export * from './date-range-picker';
|
|
20
20
|
export * from './date-time-picker';
|
|
21
21
|
export * from './due-date-calculator';
|
|
22
|
+
export * from './gestational-age-calculator';
|
|
22
23
|
export * from './email-input';
|
|
23
24
|
export * from './file-upload';
|
|
24
25
|
export * from './form-field';
|
|
@@ -37,11 +38,14 @@ export * from './switch';
|
|
|
37
38
|
export * from './text-area';
|
|
38
39
|
export * from './text-input';
|
|
39
40
|
export * from './time-picker';
|
|
41
|
+
export { InsertButton, type InsertButtonProps, type InsertPayload, type InsertMode, type InsertCardData, type InsertCardField, } from './_shared/insert-result';
|
|
40
42
|
export * from './accordion';
|
|
41
43
|
export * from './avatar';
|
|
42
44
|
export * from './badge';
|
|
43
45
|
export * from './benefit-card';
|
|
44
46
|
export * from './bmi-calculator';
|
|
47
|
+
export * from './calculator-dialog';
|
|
48
|
+
export * from './cycle-calculator';
|
|
45
49
|
export * from './card';
|
|
46
50
|
export * from './carousel';
|
|
47
51
|
export * from './contact-card';
|
|
@@ -89,6 +93,7 @@ export * from './message-tray';
|
|
|
89
93
|
export * from './notification-card';
|
|
90
94
|
export * from './notification-tray';
|
|
91
95
|
export * from './popover';
|
|
96
|
+
export * from './pregnancy-weight-gain';
|
|
92
97
|
export * from './privacy-lock';
|
|
93
98
|
export * from './progress';
|
|
94
99
|
export * from './sheet';
|
|
@@ -105,6 +110,7 @@ export * from './resizable';
|
|
|
105
110
|
export * from './scroll-area';
|
|
106
111
|
export * from './separator';
|
|
107
112
|
export * from './theme-root';
|
|
113
|
+
export * from './unit-converter';
|
|
108
114
|
export * from './visually-hidden';
|
|
109
115
|
export * from './chart';
|
|
110
116
|
export * from './ai-prompt-input';
|
|
@@ -137,4 +143,11 @@ export * from './workflow';
|
|
|
137
143
|
export * from '../patterns/alia-assistant';
|
|
138
144
|
export * from '../patterns/patient-shell';
|
|
139
145
|
export * from '../patterns/marketplace-app-shell';
|
|
146
|
+
export * from './dependent-selector';
|
|
147
|
+
export * from './document-scanner';
|
|
148
|
+
export * from './fiscal-code-input';
|
|
149
|
+
export * from './qr-code';
|
|
150
|
+
export * from './session-countdown';
|
|
151
|
+
export * from './social-sign-in-button';
|
|
152
|
+
export * from './wallet-pay-button';
|
|
140
153
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { PregnancyWeightGain } from './pregnancy-weight-gain';
|
|
2
|
+
export type { PregnancyWeightGainProps } from './pregnancy-weight-gain';
|
|
3
|
+
export { assessWeightGain, recommendedGainToDate, TOTAL_GAIN_BANDS, RATE_BANDS, type GainBand, type GainStatus, type WeightGainInput, type WeightGainResult, } from './weight-gain';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { P as s, R as n, T as i, a as r, r as A } from "../../_chunks/pregnancy-weight-gain-BCdi-JSv.js";
|
|
2
|
+
export {
|
|
3
|
+
s as PregnancyWeightGain,
|
|
4
|
+
n as RATE_BANDS,
|
|
5
|
+
i as TOTAL_GAIN_BANDS,
|
|
6
|
+
r as assessWeightGain,
|
|
7
|
+
A as recommendedGainToDate
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { type InsertPayload } from '../_shared/insert-result';
|
|
3
|
+
import { type WeightGainResult } from './weight-gain';
|
|
4
|
+
declare const rootVariants: (props?: ({
|
|
5
|
+
width?: "auto" | "full" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface PregnancyWeightGainProps extends VariantProps<typeof rootVariants> {
|
|
8
|
+
/** Fires whenever a result can be computed (and `null` when it can't). */
|
|
9
|
+
onResultChange?: (result: WeightGainResult | null) => void;
|
|
10
|
+
/** When provided, shows an "Insert" button that emits the result for an editor. */
|
|
11
|
+
onInsert?: (payload: InsertPayload) => void;
|
|
12
|
+
/** Opaque instance id, emitted as `data-component-id`. */
|
|
13
|
+
id?: string;
|
|
14
|
+
/** Extra class names on the wrapper. */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const PregnancyWeightGain: import("react").ForwardRefExoticComponent<PregnancyWeightGainProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=pregnancy-weight-gain.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type BmiCategory } from '../bmi-calculator/bmi';
|
|
2
|
+
export interface GainBand {
|
|
3
|
+
/** Lower bound, kg. */
|
|
4
|
+
min: number;
|
|
5
|
+
/** Upper bound, kg. */
|
|
6
|
+
max: number;
|
|
7
|
+
}
|
|
8
|
+
export type GainStatus = 'below' | 'within' | 'above';
|
|
9
|
+
/** IOM (2009) total recommended gain for a singleton pregnancy, kg. */
|
|
10
|
+
export declare const TOTAL_GAIN_BANDS: Record<BmiCategory, GainBand>;
|
|
11
|
+
/** IOM (2009) mean rate of gain in the 2nd/3rd trimester, kg per week. */
|
|
12
|
+
export declare const RATE_BANDS: Record<BmiCategory, GainBand>;
|
|
13
|
+
/** First-trimester total gain band, kg (category-independent in IOM). */
|
|
14
|
+
export declare const FIRST_TRIMESTER_GAIN: GainBand;
|
|
15
|
+
/** Completed weeks counted as the first trimester for gain purposes. */
|
|
16
|
+
export declare const FIRST_TRIMESTER_WEEKS = 13;
|
|
17
|
+
export interface WeightGainInput {
|
|
18
|
+
/** Pre-pregnancy BMI (kg/m²) — drives the category. */
|
|
19
|
+
prePregnancyBmi: number;
|
|
20
|
+
/** Pre-pregnancy weight, kg. */
|
|
21
|
+
prePregnancyWeightKg: number;
|
|
22
|
+
/** Current weight, kg. */
|
|
23
|
+
currentWeightKg: number;
|
|
24
|
+
/** Completed gestational weeks. */
|
|
25
|
+
gestationalWeeks: number;
|
|
26
|
+
}
|
|
27
|
+
export interface WeightGainResult {
|
|
28
|
+
category: BmiCategory;
|
|
29
|
+
/** Recommended TOTAL gain across the whole pregnancy. */
|
|
30
|
+
totalRange: GainBand;
|
|
31
|
+
/** Recommended gain accumulated by the current gestational week. */
|
|
32
|
+
recommendedToDate: GainBand;
|
|
33
|
+
/** Actual gain so far (current − pre-pregnancy), kg. */
|
|
34
|
+
actualGainKg: number;
|
|
35
|
+
/** Where the actual gain sits against the to-date recommendation. */
|
|
36
|
+
status: GainStatus;
|
|
37
|
+
}
|
|
38
|
+
/** Recommended cumulative gain by a given gestational week. */
|
|
39
|
+
export declare function recommendedGainToDate(category: BmiCategory, weeks: number): GainBand;
|
|
40
|
+
export declare function assessWeightGain(input: WeightGainInput): WeightGainResult;
|
|
41
|
+
//# sourceMappingURL=weight-gain.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as s, a as A, P as L, S as e, c as S, p as _ } from "../../_chunks/public-footer.agent-
|
|
1
|
+
import { D as s, a as A, P as L, S as e, c as S, p as _ } from "../../_chunks/public-footer.agent-zw1vFin_.js";
|
|
2
2
|
export {
|
|
3
3
|
s as DEFAULT_MARKETING_BASE_URL,
|
|
4
4
|
A as DEFAULT_SOCIAL_URLS,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { QrCode } from './qr-code';
|
|
2
|
+
export type { QrCodeProps } from './qr-code';
|
|
3
|
+
export { qrCodeAgent } from './qr-code.agent';
|
|
4
|
+
export { createQrMatrix, setQrCreate, type ErrorCorrectionLevel, type QrMatrix, type QrCreateFn, } from './qr-encode';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { type ErrorCorrectionLevel } from './qr-encode';
|
|
4
|
+
declare const qrCodeVariants: (props?: ({
|
|
5
|
+
variant?: "plain" | "framed" | "with-caption" | null | undefined;
|
|
6
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
7
|
+
tone?: "default" | "inverted" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
type QrCodeVariantProps = VariantProps<typeof qrCodeVariants>;
|
|
10
|
+
interface QrCodeBase extends Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-label' | 'aria-hidden' | 'children' | 'color'>, QrCodeVariantProps {
|
|
11
|
+
/**
|
|
12
|
+
* The string encoded into the QR — typically an absolute https URL
|
|
13
|
+
* (check-in landing or patient-portal link), but any text is valid. An
|
|
14
|
+
* empty string renders the empty state. Not validated as a URL: the kit
|
|
15
|
+
* is byte-transparent and the consumer passes a fully-formed value.
|
|
16
|
+
*/
|
|
17
|
+
value: string;
|
|
18
|
+
/**
|
|
19
|
+
* Reed-Solomon redundancy. When omitted it defaults to `H` (high, ~30%
|
|
20
|
+
* recovery) whenever a centre logo is shown — the obscured centre still
|
|
21
|
+
* decodes — and to `M` when the logo is disabled (`logo={false}`). Pass an
|
|
22
|
+
* explicit level to override (raising to `Q`/`H` is required if a logo
|
|
23
|
+
* occludes the centre).
|
|
24
|
+
*/
|
|
25
|
+
errorCorrectionLevel?: ErrorCorrectionLevel;
|
|
26
|
+
/**
|
|
27
|
+
* Centre mark over the matrix. The product wants the AlfaDocs mark present
|
|
28
|
+
* on every code, so this defaults to the canonical mark
|
|
29
|
+
* ({@link AlfadocsLogoMark}, decorative). Pass `logo={false}` to disable it,
|
|
30
|
+
* or `logo={<custom/>}` to override with your own node. The mark is clamped
|
|
31
|
+
* to ~22% of the edge and seated on a tone-matched opaque knockout so the
|
|
32
|
+
* modules beneath it are visually cleared; ECC-H reconstructs them on scan.
|
|
33
|
+
*/
|
|
34
|
+
logo?: ReactNode | false;
|
|
35
|
+
/** Caption for `variant="with-caption"`. Defaults to the i18n caption. */
|
|
36
|
+
caption?: string;
|
|
37
|
+
/** Quiet-zone width in MODULES. Clamped up to the spec minimum of 4. */
|
|
38
|
+
quietZone?: number;
|
|
39
|
+
}
|
|
40
|
+
type QrCodeA11y = {
|
|
41
|
+
/**
|
|
42
|
+
* Human-readable destination woven into the accessible name, e.g. a
|
|
43
|
+
* practice name → "QR code to check in at Studio Dentistico Rossi".
|
|
44
|
+
* Not rendered visually.
|
|
45
|
+
*/
|
|
46
|
+
label?: string;
|
|
47
|
+
decorative?: never;
|
|
48
|
+
} | {
|
|
49
|
+
label?: never;
|
|
50
|
+
/**
|
|
51
|
+
* Decorative usage — the code is hidden from assistive tech (rare; the
|
|
52
|
+
* same QR is duplicated purely ornamentally next to a real one).
|
|
53
|
+
*/
|
|
54
|
+
decorative: true;
|
|
55
|
+
};
|
|
56
|
+
export type QrCodeProps = QrCodeBase & QrCodeA11y;
|
|
57
|
+
export declare const QrCode: import("react").ForwardRefExoticComponent<QrCodeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=qr-code.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type ErrorCorrectionLevel = 'L' | 'M' | 'Q' | 'H';
|
|
2
|
+
export interface QrMatrix {
|
|
3
|
+
/** Edge length in modules (e.g. 21 for version 1). */
|
|
4
|
+
size: number;
|
|
5
|
+
/** Row-major `size * size` booleans — true = dark module. */
|
|
6
|
+
modules: boolean[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Shape of the geometry `qrcode.create()` returns, so a host that has the
|
|
10
|
+
* dependency installed can hand its output straight to the renderer.
|
|
11
|
+
*/
|
|
12
|
+
export interface QrcodeCreateResult {
|
|
13
|
+
modules: {
|
|
14
|
+
size: number;
|
|
15
|
+
data: Uint8Array | number[];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Injectable geometry provider — swap in `qrcode.create` once installed. */
|
|
19
|
+
export type QrCreateFn = (value: string, options: {
|
|
20
|
+
errorCorrectionLevel: ErrorCorrectionLevel;
|
|
21
|
+
}) => QrcodeCreateResult;
|
|
22
|
+
/**
|
|
23
|
+
* OPTIONAL override: register the npm `qrcode` package's `create` as the
|
|
24
|
+
* geometry source. Not used by default — the vendored byte-mode encoder is the
|
|
25
|
+
* shipped path. A maintainer who chooses to add the dependency can wire this
|
|
26
|
+
* once at app/bundle init:
|
|
27
|
+
*
|
|
28
|
+
* import QRCode from 'qrcode';
|
|
29
|
+
* import { setQrCreate } from '@alfadocs/ui-kit/qr-code';
|
|
30
|
+
* setQrCreate(QRCode.create);
|
|
31
|
+
*
|
|
32
|
+
* Pass `null` to revert to the vendored encoder. Either path yields scannable
|
|
33
|
+
* geometry — the seam keeps the call-site identical so the swap is a one-liner.
|
|
34
|
+
*/
|
|
35
|
+
export declare function setQrCreate(fn: QrCreateFn | null): void;
|
|
36
|
+
/**
|
|
37
|
+
* Build the QR module matrix for `value`. Uses the vendored byte-mode encoder
|
|
38
|
+
* by default; only delegates to a `qrcode` geometry provider if one has been
|
|
39
|
+
* registered via {@link setQrCreate} (optional, off by default). Returns the
|
|
40
|
+
* raw module geometry — the component renders its own token-styled SVG.
|
|
41
|
+
*
|
|
42
|
+
* Throws when the value exceeds the encodable capacity; callers catch and
|
|
43
|
+
* render the empty state (see QrCode's defensive try/catch).
|
|
44
|
+
*/
|
|
45
|
+
export declare function createQrMatrix(value: string, errorCorrectionLevel: ErrorCorrectionLevel): QrMatrix;
|
|
46
|
+
//# sourceMappingURL=qr-encode.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as t, e as o, r as s, t as i, a as e, w as n } from "../../_chunks/rich-text-editor-
|
|
1
|
+
import { R as t, e as o, r as s, t as i, a as e, w as n } from "../../_chunks/rich-text-editor-DLbg2852.js";
|
|
2
2
|
export {
|
|
3
3
|
t as RichTextEditor,
|
|
4
4
|
o as editorSurfaceVariants,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const countdownVariants: (props?: ({
|
|
4
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
5
|
+
tone?: "warning" | "running" | "expired" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type CountdownVariantProps = Pick<VariantProps<typeof countdownVariants>, 'size'>;
|
|
8
|
+
export interface SessionCountdownProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'>, CountdownVariantProps {
|
|
9
|
+
/** Controlled remaining milliseconds. Source of truth; no internal tick. */
|
|
10
|
+
remainingMs?: number;
|
|
11
|
+
/** Absolute deadline (ms-epoch, ISO string, or Date). Ticks internally. */
|
|
12
|
+
expiresAt?: number | string | Date;
|
|
13
|
+
/** Full session duration in ms — progress denominator. Default 900000. */
|
|
14
|
+
totalMs?: number;
|
|
15
|
+
/** Remaining threshold (ms) at/below which tone escalates to warning. */
|
|
16
|
+
warnAtMs?: number;
|
|
17
|
+
/** Type / padding scale. Default `md`. */
|
|
18
|
+
size?: 'sm' | 'md' | 'lg';
|
|
19
|
+
/** Determinate Progress bar of elapsed fraction. */
|
|
20
|
+
showProgress?: boolean;
|
|
21
|
+
/** Fired exactly once when remaining crosses to 0. Idempotent. */
|
|
22
|
+
onExpire?: () => void;
|
|
23
|
+
/** Restart CTA handler (expired banner). Omit → no button rendered. */
|
|
24
|
+
onRestart?: () => void;
|
|
25
|
+
/** Restart in flight — disables + spins the Restart button. */
|
|
26
|
+
restarting?: boolean;
|
|
27
|
+
/** Internal tick cadence (ms) for the `expiresAt` path. Default 1000. */
|
|
28
|
+
tickMs?: number;
|
|
29
|
+
/** Locale override for number formatting. Falls back to i18n.language. */
|
|
30
|
+
locale?: string;
|
|
31
|
+
/** Override the accessible name of the timer region. */
|
|
32
|
+
label?: string;
|
|
33
|
+
/** Merged onto the outermost element. CVA-composed, never inline style. */
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const SessionCountdown: import("react").ForwardRefExoticComponent<SessionCountdownProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=session-countdown.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const rootVariants: (props?: ({
|
|
4
|
+
provider?: "apple" | "google" | null | undefined;
|
|
5
|
+
appearance?: "light" | "dark" | null | undefined;
|
|
6
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export type SocialSignInProvider = 'apple' | 'google';
|
|
9
|
+
/**
|
|
10
|
+
* Brand surface variant — independent of the kit theme. Apple HIG:
|
|
11
|
+
* `light` = white button + black mark/text, `dark` = black button +
|
|
12
|
+
* white mark/text. Google: `light` = white/neutral button, `dark` =
|
|
13
|
+
* Google-blue button. Pick the appearance that contrasts with your
|
|
14
|
+
* auth-card background; do NOT bind it to `useTheme()`. Defaults to
|
|
15
|
+
* `'light'`. Derived from `rootVariants` so the prop union tracks the
|
|
16
|
+
* CVA option list automatically.
|
|
17
|
+
*/
|
|
18
|
+
export type SocialSignInAppearance = NonNullable<VariantProps<typeof rootVariants>['appearance']>;
|
|
19
|
+
/** Button size. Defaults to `'md'`. Derived from `rootVariants`. */
|
|
20
|
+
export type SocialSignInSize = NonNullable<VariantProps<typeof rootVariants>['size']>;
|
|
21
|
+
export interface SocialSignInButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>, Omit<VariantProps<typeof rootVariants>, 'provider'> {
|
|
22
|
+
/**
|
|
23
|
+
* Which identity provider this button represents. Drives the brand
|
|
24
|
+
* mark, the surface colour token, and the default i18n verb + name.
|
|
25
|
+
* Designed extensible — the union and the CVA option list grow
|
|
26
|
+
* together when a new provider (e.g. `'microsoft'`) is added.
|
|
27
|
+
*/
|
|
28
|
+
provider: SocialSignInProvider;
|
|
29
|
+
/**
|
|
30
|
+
* Swaps the brand mark for the kit Spinner (size-matched), sets
|
|
31
|
+
* `aria-busy='true'`, and disables the button so the user cannot
|
|
32
|
+
* double-submit the OAuth redirect. The label stays visible.
|
|
33
|
+
*/
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Override the visible label. When omitted, reads
|
|
37
|
+
* `socialSignInButton.<provider>` ("Sign in with Apple" / "Sign in
|
|
38
|
+
* with Google"). Override only to switch the verb to "Continue with"
|
|
39
|
+
* — never for marketing copy, and the provider NAME ("Apple" /
|
|
40
|
+
* "Google") must stay verbatim per brand rules.
|
|
41
|
+
*/
|
|
42
|
+
label?: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Fired when the component detects the user cancelled an in-flight
|
|
45
|
+
* sign-in — typically by pressing browser back after the OAuth
|
|
46
|
+
* redirect, which restores the page from bfcache with `loading` still
|
|
47
|
+
* true. Wire this to your loading-state setter so the button returns
|
|
48
|
+
* to idle. Only fires when `loading` is currently true; never on first
|
|
49
|
+
* mount. Mirrors SignInWithAlfadocsButton — the component does not
|
|
50
|
+
* reset state it doesn't own.
|
|
51
|
+
*/
|
|
52
|
+
onLoadingCancelled?: () => void;
|
|
53
|
+
}
|
|
54
|
+
export declare const SocialSignInButton: import("react").ForwardRefExoticComponent<SocialSignInButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=social-sign-in-button.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { type InsertPayload } from '../_shared/insert-result';
|
|
3
|
+
import { type UnitCategory } from './units';
|
|
4
|
+
declare const rootVariants: (props?: ({
|
|
5
|
+
width?: "auto" | "full" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface UnitConverterProps extends VariantProps<typeof rootVariants> {
|
|
8
|
+
/** Initial category. Defaults to `'weight'`. */
|
|
9
|
+
defaultCategory?: UnitCategory;
|
|
10
|
+
/** Fires with the converted value (and `null` when input is empty). */
|
|
11
|
+
onResultChange?: (value: number | null) => void;
|
|
12
|
+
/** When provided, shows an "Insert" button that emits the result for an editor. */
|
|
13
|
+
onInsert?: (payload: InsertPayload) => void;
|
|
14
|
+
/** Opaque instance id, emitted as `data-component-id`. */
|
|
15
|
+
id?: string;
|
|
16
|
+
/** Extra class names on the wrapper. */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const UnitConverter: import("react").ForwardRefExoticComponent<UnitConverterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=unit-converter.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type UnitCategory = 'weight' | 'length' | 'temperature' | 'glucose';
|
|
2
|
+
export interface UnitDef {
|
|
3
|
+
id: string;
|
|
4
|
+
category: UnitCategory;
|
|
5
|
+
/** Multiplier to the category base unit. */
|
|
6
|
+
factor: number;
|
|
7
|
+
/** Additive offset to the base unit (non-zero only for temperature). */
|
|
8
|
+
offset: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const UNITS: Record<string, UnitDef>;
|
|
11
|
+
export declare const UNITS_BY_CATEGORY: Record<UnitCategory, string[]>;
|
|
12
|
+
export declare const CATEGORIES: UnitCategory[];
|
|
13
|
+
/**
|
|
14
|
+
* Convert `value` from one unit to another. Both ids must belong to the same
|
|
15
|
+
* category; mismatched categories throw (a programming error, not user input).
|
|
16
|
+
*/
|
|
17
|
+
export declare function convertUnits(value: number, fromId: string, toId: string): number;
|
|
18
|
+
//# sourceMappingURL=units.d.ts.map
|