@alfadocs/ui-kit 1.3.9 → 1.3.12
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/{anamnesis-i18n-CcwFL4B2.js → anamnesis-i18n-9OrXTNS3.js} +1621 -1570
- package/dist/_chunks/{bmi-calculator-Bk2GAju7.js → bmi-calculator-CM0-G2mg.js} +2 -2
- package/dist/_chunks/{cycle-calculator-DNvvr0bP.js → cycle-calculator-DrdC2hPj.js} +2 -2
- package/dist/_chunks/{due-date-calculator-BEcdoy_E.js → due-date-calculator-DzNMFyOU.js} +2 -2
- package/dist/_chunks/{fetal-weight-1F9N4IMx.js → fetal-weight-ePlLjJPc.js} +2 -2
- package/dist/_chunks/{hcg-doubling-fZ6qQN08.js → hcg-doubling-BBqD2wI2.js} +2 -2
- package/dist/_chunks/{link-cell-renderer-_DlEZHLI.js → link-cell-renderer-C5XLwVXQ.js} +2 -2
- package/dist/_chunks/number-input-DrozbZAU.js +370 -0
- package/dist/_chunks/{optical-prescription-BEjYQjiO.js → optical-prescription-BDHJr8Zz.js} +2 -2
- package/dist/_chunks/{patient-details-BAUg0FWs.js → patient-details-D7D3f9dy.js} +2 -2
- package/dist/_chunks/{patient-table-C7QHFC63.js → patient-table-BmIDrLIS.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-BdFl-rB1.js → pregnancy-dating-C3WvXHee.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-B-CkVYnU.js → pregnancy-weight-gain-O6J0sUIi.js} +2 -2
- package/dist/_chunks/{unit-converter-CSLWFDQh.js → unit-converter-COgkN7YP.js} +2 -2
- package/dist/agent-catalog.json +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/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/hcg-doubling/index.js +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-table/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/unit-converter/index.js +1 -1
- package/dist/index.js +14 -14
- package/dist/patterns/anamnesis/anamnesis-derive.d.ts +16 -0
- package/dist/patterns/anamnesis/anamnesis-format.d.ts +8 -0
- package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts +4 -3
- package/dist/patterns/anamnesis/index.js +1 -1
- package/package.json +1 -1
- package/dist/_chunks/number-input-DjWzmlEY.js +0 -350
package/dist/index.js
CHANGED
|
@@ -27,12 +27,12 @@ import { C as Na, c as ha } from "./_chunks/copy-field-DBc9QquW.js";
|
|
|
27
27
|
import { D as Fa, d as Ma } from "./_chunks/date-picker-BP_W6VtE.js";
|
|
28
28
|
import { D as La, d as ya } from "./_chunks/date-range-picker-pEG3Ln3i.js";
|
|
29
29
|
import { D as Ba, d as va } from "./_chunks/date-time-picker-695QvBGj.js";
|
|
30
|
-
import { P as Ha } from "./_chunks/pregnancy-dating-
|
|
31
|
-
import { D as Va } from "./_chunks/due-date-calculator-
|
|
30
|
+
import { P as Ha } from "./_chunks/pregnancy-dating-C3WvXHee.js";
|
|
31
|
+
import { D as Va } from "./_chunks/due-date-calculator-DzNMFyOU.js";
|
|
32
32
|
import { G as Wa } from "./_chunks/gestational-age-calculator-CuGkVqKp.js";
|
|
33
33
|
import { B as Ya, a as Xa, b as qa, c as za, d as ja, e as Qa } from "./_chunks/bishop-score-DDW5-gb9.js";
|
|
34
|
-
import { F as Za, e as $a } from "./_chunks/fetal-weight-
|
|
35
|
-
import { H as ee, M as re, a as se } from "./_chunks/hcg-doubling-
|
|
34
|
+
import { F as Za, e as $a } from "./_chunks/fetal-weight-ePlLjJPc.js";
|
|
35
|
+
import { H as ee, M as re, a as se } from "./_chunks/hcg-doubling-BBqD2wI2.js";
|
|
36
36
|
import { E as te, e as ne } from "./_chunks/email-input-Dpe63k0K.js";
|
|
37
37
|
import { I as pe, a as me, M as le, b as de, c as Ae, i as ce, d as fe, w as ge, e as Ce } from "./_chunks/iban-input-DXIA8Ln_.js";
|
|
38
38
|
import { F as xe, f as Te } from "./_chunks/field-array-DH3Mb1i8.js";
|
|
@@ -45,7 +45,7 @@ import { F as We, b as Ke, f as Ye } from "./_chunks/file-upload-CwxdqkMK.js";
|
|
|
45
45
|
import { F as qe } from "./_chunks/form-field-M5UpX65Z.js";
|
|
46
46
|
import { F as je, u as Qe } from "./_chunks/form-field-context-B3APVHKx.js";
|
|
47
47
|
import { M as Ze, m as $e, a as ar } from "./_chunks/multi-select-CC52Qws6.js";
|
|
48
|
-
import { N as rr, u as sr } from "./_chunks/number-input-
|
|
48
|
+
import { N as rr, u as sr } from "./_chunks/number-input-DrozbZAU.js";
|
|
49
49
|
import { O as tr } from "./_chunks/otp-input-DzBQ-CpE.js";
|
|
50
50
|
import { P as ir, u as pr } from "./_chunks/use-password-requirements-Bwtqx1qN.js";
|
|
51
51
|
import { P as lr, c as dr, p as Ar, a as cr } from "./_chunks/phone-input-BsZIoE36.js";
|
|
@@ -66,10 +66,10 @@ import { A as ts, M as ns, m as is } from "./_chunks/annotation-marker-CsUJGZjQ.
|
|
|
66
66
|
import { A as ms, g as ls, n as ds } from "./_chunks/avatar-BNQNhoyL.js";
|
|
67
67
|
import { B as cs } from "./_chunks/badge-DCOqV9mI.js";
|
|
68
68
|
import { B as gs } from "./_chunks/benefit-card-DB1Kdrmc.js";
|
|
69
|
-
import { B as Ss } from "./_chunks/bmi-calculator-
|
|
69
|
+
import { B as Ss } from "./_chunks/bmi-calculator-CM0-G2mg.js";
|
|
70
70
|
import { b as Ts, a as us, c as Ps, d as Is, e as Es, f as bs, i as Rs, k as _s, l as Ns } from "./_chunks/bmi-BxD-tFzU.js";
|
|
71
71
|
import { C as Ds } from "./_chunks/calculator-dialog-DuXMQSdm.js";
|
|
72
|
-
import { C as Ms, L as Os, p as Ls } from "./_chunks/cycle-calculator-
|
|
72
|
+
import { C as Ms, L as Os, p as Ls } from "./_chunks/cycle-calculator-DrdC2hPj.js";
|
|
73
73
|
import { C as ks } from "./_chunks/card-DPmk26CL.js";
|
|
74
74
|
import { C as vs, c as Gs } from "./_chunks/carousel.agent-CtAAdsAd.js";
|
|
75
75
|
import { C as ws, c as Vs } from "./_chunks/connection-status-oEUyrvev.js";
|
|
@@ -77,7 +77,7 @@ import { C as Ws } from "./_chunks/contact-card-0hnFJwrz.js";
|
|
|
77
77
|
import { C as Ys } from "./_chunks/counter-dRlTNC_y.js";
|
|
78
78
|
import { A as qs, D as zs, T as js, a as Qs, b as Js, c as Zs, d as $s, e as ao, f as eo } from "./_chunks/actions-cell-renderer-Ceah0ywE.js";
|
|
79
79
|
import { B as so, C as oo, E as to, a as no, R as io, T as po, b as mo, r as lo, u as Ao } from "./_chunks/editable-currency-cell-renderer-Uhzkd0ZP.js";
|
|
80
|
-
import { C as fo, D as go, a as Co, b as So, I as xo, L as To, N as uo, c as Po, S as Io, d as Eo, e as bo, T as Ro, f as _o, g as No, U as ho } from "./_chunks/link-cell-renderer-
|
|
80
|
+
import { C as fo, D as go, a as Co, b as So, I as xo, L as To, N as uo, c as Po, S as Io, d as Eo, e as bo, T as Ro, f as _o, g as No, U as ho } from "./_chunks/link-cell-renderer-C5XLwVXQ.js";
|
|
81
81
|
import { D as Fo, d as Mo, a as Oo, b as Lo } from "./_chunks/data-table-tabs-BEUXiRlu.js";
|
|
82
82
|
import { C as ko, c as Bo } from "./_chunks/clinical-note-card-D63x_AkK.js";
|
|
83
83
|
import { D as Go } from "./_chunks/description-list-ClNLdRMy.js";
|
|
@@ -140,7 +140,7 @@ import { N as Gp, n as Hp } from "./_chunks/notification-tray-CzIzz3bX.js";
|
|
|
140
140
|
import { N as Vp } from "./_chunks/notes-panel-DPsgB4Mv.js";
|
|
141
141
|
import { P as Wp, p as Kp } from "./_chunks/popover-Cc0a69sw.js";
|
|
142
142
|
import { R as Xp, I as qp, r as zp } from "./_chunks/radiograph-panel.agent-AsXJBr1p.js";
|
|
143
|
-
import { P as Qp, R as Jp, T as Zp, a as $p, r as am } from "./_chunks/pregnancy-weight-gain-
|
|
143
|
+
import { P as Qp, R as Jp, T as Zp, a as $p, r as am } from "./_chunks/pregnancy-weight-gain-O6J0sUIi.js";
|
|
144
144
|
import { P as rm, p as sm } from "./_chunks/privacy-lock-YYBiI_bY.js";
|
|
145
145
|
import { P as tm, a as nm, p as im, b as pm } from "./_chunks/product-hub-panel-CTld1r5V.js";
|
|
146
146
|
import { P as lm, p as dm } from "./_chunks/progress-DA413-zn.js";
|
|
@@ -161,7 +161,7 @@ import { H as el, P as rl, a as sl, R as ol, r as tl, u as nl } from "./_chunks/
|
|
|
161
161
|
import { S as pl, a as ml, b as ll, c as dl, d as Al, e as cl } from "./_chunks/scroll-area-BZOvUhwQ.js";
|
|
162
162
|
import { S as gl } from "./_chunks/separator-CYU_bGFn.js";
|
|
163
163
|
import { T as Sl } from "./_chunks/theme-root-BOO73p5t.js";
|
|
164
|
-
import { C as Tl, U as ul, a as Pl, b as Il, c as El } from "./_chunks/unit-converter-
|
|
164
|
+
import { C as Tl, U as ul, a as Pl, b as Il, c as El } from "./_chunks/unit-converter-COgkN7YP.js";
|
|
165
165
|
import { V as Rl } from "./_chunks/visually-hidden-BHxEUGyT.js";
|
|
166
166
|
import { C as Nl, c as hl, a as Dl } from "./_chunks/chart-DR68TJD5.js";
|
|
167
167
|
import { A as Ml, a as Ol } from "./_chunks/ai-prompt-input-DziJCGLe.js";
|
|
@@ -179,7 +179,7 @@ import { T as td, t as nd } from "./_chunks/transcript-panel-BGkEhvHO.js";
|
|
|
179
179
|
import { T as pd } from "./_chunks/typing-indicator-DHeVN4ob.js";
|
|
180
180
|
import { A as ld } from "./_chunks/anamnesis-card-CJ5MNbkc.js";
|
|
181
181
|
import { D as Ad, F as cd, a as fd, M as gd, b as Cd, e as Sd, f as xd, g as Td, c as ud, m as Pd, r as Id, v as Ed } from "./_chunks/muscle-scheme-yfzP_xoJ.js";
|
|
182
|
-
import { A as Rd, a as _d, b as Nd, c as hd, d as Dd, e as Fd, C as Md, f as Od, g as Ld, D as yd, h as kd, E as Bd, L as vd, O as Gd, P as Hd, i as wd, j as Vd, k as Ud, l as Wd, R as Kd, S as Yd, m as Xd, n as qd, o as zd, p as jd, q as Qd, r as Jd, s as Zd, t as $d, u as aA, v as eA, w as rA, x as sA, y as oA, z as tA, B as nA, F as iA } from "./_chunks/optical-prescription-
|
|
182
|
+
import { A as Rd, a as _d, b as Nd, c as hd, d as Dd, e as Fd, C as Md, f as Od, g as Ld, D as yd, h as kd, E as Bd, L as vd, O as Gd, P as Hd, i as wd, j as Vd, k as Ud, l as Wd, R as Kd, S as Yd, m as Xd, n as qd, o as zd, p as jd, q as Qd, r as Jd, s as Zd, t as $d, u as aA, v as eA, w as rA, x as sA, y as oA, z as tA, B as nA, F as iA } from "./_chunks/optical-prescription-BDHJr8Zz.js";
|
|
183
183
|
import { B as mA, C as lA, O as dA, b as AA } from "./_chunks/booking-BxFV0hT5.js";
|
|
184
184
|
import { C as fA, c as gA, r as CA } from "./_chunks/calendar-4dXTvsCz.js";
|
|
185
185
|
import { C as xA } from "./_chunks/calendar-event-card-C6qGtywL.js";
|
|
@@ -187,10 +187,10 @@ import { C as uA, c as PA } from "./_chunks/care-plan-card-1G_f4I5s.js";
|
|
|
187
187
|
import { C as EA, c as bA } from "./_chunks/care-plan-entry-card-DmBsffHS.js";
|
|
188
188
|
import { C as _A, c as NA } from "./_chunks/care-plan-header-BXvRpGG8.js";
|
|
189
189
|
import { O as DA, o as FA } from "./_chunks/operator-hero-DVy0RGoD.js";
|
|
190
|
-
import { P as OA, p as LA } from "./_chunks/patient-details-
|
|
190
|
+
import { P as OA, p as LA } from "./_chunks/patient-details-D7D3f9dy.js";
|
|
191
191
|
import { P as kA, p as BA } from "./_chunks/patient-search-yG0UaCpQ.js";
|
|
192
192
|
import { P as GA, p as HA } from "./_chunks/patient-summary-card-C-iVDo53.js";
|
|
193
|
-
import { B as VA, C as UA, N as WA, P as KA, a as YA, b as XA, g as qA, u as zA } from "./_chunks/patient-table-
|
|
193
|
+
import { B as VA, C as UA, N as WA, P as KA, a as YA, b as XA, g as qA, u as zA } from "./_chunks/patient-table-BmIDrLIS.js";
|
|
194
194
|
import { B as QA, M as JA, P as ZA, a as $A, b as ac, c as ec, d as rc, S as sc, e as oc, f as tc, g as nc, h as ic, p as pc, i as mc, j as lc, k as dc, s as Ac, t as cc, l as fc } from "./_chunks/periodontal-chart-CYBhr9vc.js";
|
|
195
195
|
import { P as Cc, a as Sc, p as xc } from "./_chunks/periodontal-chart-card-WVjJAheq.js";
|
|
196
196
|
import { D as uc, P as Pc, a as Ic, b as Ec, c as bc, S as Rc, e as _c, i as Nc, p as hc } from "./_chunks/periodontal-diagnosis-cco40xTa.js";
|
|
@@ -214,7 +214,7 @@ import { T as Og } from "./_chunks/transaction-chip-DJCstquX.js";
|
|
|
214
214
|
import { W as yg, a as kg } from "./_chunks/whatsapp-button-BIy6NaJK.js";
|
|
215
215
|
import { C as vg, W as Gg, a as Hg, b as wg, c as Vg, i as Ug, l as Wg, m as Kg, r as Yg, w as Xg, d as qg, e as zg, f as jg } from "./_chunks/workflow-map-BVMeVHkV.js";
|
|
216
216
|
import { A as Jg, a as Zg, b as $g, c as aC } from "./_chunks/alia-sidebar-DzNz1gDf.js";
|
|
217
|
-
import { A as rC, a as sC, L as oC, P as tC, S as nC, T as iC, b as pC, c as mC, d as lC, e as dC, f as AC, g as cC, h as fC, i as gC, j as CC, k as SC, l as xC, m as TC, r as uC, n as PC, s as IC, o as EC } from "./_chunks/anamnesis-i18n-
|
|
217
|
+
import { A as rC, a as sC, L as oC, P as tC, S as nC, T as iC, b as pC, c as mC, d as lC, e as dC, f as AC, g as cC, h as fC, i as gC, j as CC, k as SC, l as xC, m as TC, r as uC, n as PC, s as IC, o as EC } from "./_chunks/anamnesis-i18n-9OrXTNS3.js";
|
|
218
218
|
import { C as RC, M as _C, P as NC } from "./_chunks/marketplace-app-shell-DwcFMxzp.js";
|
|
219
219
|
import { P as DC } from "./_chunks/payment-automation-upsell-D_x880pr.js";
|
|
220
220
|
import { S as MC } from "./_chunks/signature-request-CrRj64Nz.js";
|
|
@@ -46,6 +46,22 @@ export declare function parameterStorage(def: NumericParameterDef): ParameterSto
|
|
|
46
46
|
* the six shipped anthropometrics read from the set, everything else looked up
|
|
47
47
|
* in `labs` by key). Non-finite stored values read as absent. */
|
|
48
48
|
export declare function parameterValueAt(visit: Visit, def: NumericParameterDef): number | null;
|
|
49
|
+
/** The MOST RECENT recorded value of a parameter, and the visit it was
|
|
50
|
+
* recorded at — walking backwards from the newest visit to the first one that
|
|
51
|
+
* measured it.
|
|
52
|
+
*
|
|
53
|
+
* Not the same question as `parameterValueAt(latestVisit, def)`, and the
|
|
54
|
+
* difference is what a goal tile lives on: a practice that weighs the patient
|
|
55
|
+
* on the 1st and sees them again on the 10th has a weight on record, and a
|
|
56
|
+
* tile reading only the newest visit called it "not yet measured". Every
|
|
57
|
+
* surface that answers "where is this patient now" wants this one; the grid,
|
|
58
|
+
* which is per-column by construction, wants the other.
|
|
59
|
+
*
|
|
60
|
+
* `null` when no visit ever measured it. */
|
|
61
|
+
export declare function latestParameterValue(visits: readonly Visit[], def: NumericParameterDef): {
|
|
62
|
+
value: number;
|
|
63
|
+
visit: Visit;
|
|
64
|
+
} | null;
|
|
49
65
|
/** Write a numeric value onto a visit at its storage home, returning a new
|
|
50
66
|
* visit. Computed parameters are never written. Pure — the surfaces call it
|
|
51
67
|
* through their own working-state setters. */
|
|
@@ -42,6 +42,14 @@ export declare function parameterLabel(def: NumericParameterDef, t: TFunction):
|
|
|
42
42
|
export declare function parameterLabelWithUnit(def: NumericParameterDef, t: TFunction): string;
|
|
43
43
|
/** Intake field label — practice wording, else `anamnesis.field.<key>.label`. */
|
|
44
44
|
export declare function intakeFieldLabel(def: IntakeFieldDef, t: TFunction): string;
|
|
45
|
+
/** Intake field label with its unit appended — what a `number` field renders,
|
|
46
|
+
* so the reader knows whether 85 is kilograms or pounds before typing it.
|
|
47
|
+
*
|
|
48
|
+
* Practice units only in practice: no kit-seeded intake field carries `unit`
|
|
49
|
+
* (the seeded labels spell theirs out), which is why this is a sibling helper
|
|
50
|
+
* and not folded into `intakeFieldLabel` — that one also feeds the config
|
|
51
|
+
* editor's rename placeholder, where a unit would end up inside the wording. */
|
|
52
|
+
export declare function intakeFieldLabelWithUnit(def: IntakeFieldDef, t: TFunction): string;
|
|
45
53
|
/** Optional help text under an intake field. Practice help text wins; the kit
|
|
46
54
|
* key is optional and resolves to `undefined` when unset. */
|
|
47
55
|
export declare function intakeFieldHelp(def: IntakeFieldDef, t: TFunction): string | undefined;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
2
|
import type { NumericParameterDef, Visit } from './anamnesis-types';
|
|
3
3
|
export interface AnamnesisTargetStripProps {
|
|
4
|
-
/** The
|
|
5
|
-
|
|
4
|
+
/** The record's visits, oldest first. Each tile's "Now" is the most recent
|
|
5
|
+
* visit that actually MEASURED its parameter — not the newest visit. */
|
|
6
|
+
visits: readonly Visit[];
|
|
6
7
|
/** The strip's parameters, in order. See `stripParameters`. */
|
|
7
8
|
defs: NumericParameterDef[];
|
|
8
9
|
/** Committed targets by parameter key. */
|
|
@@ -10,5 +11,5 @@ export interface AnamnesisTargetStripProps {
|
|
|
10
11
|
t: TFunction;
|
|
11
12
|
onTargetChange: (def: NumericParameterDef, target: number | null) => void;
|
|
12
13
|
}
|
|
13
|
-
export declare function AnamnesisTargetStrip({
|
|
14
|
+
export declare function AnamnesisTargetStrip({ visits, defs, targets, t, onTargetChange, }: AnamnesisTargetStripProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
15
|
//# sourceMappingURL=anamnesis-target-strip.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a as i, L as n, P as r, S as o, T as l, b as t, c as d, d as g, e as A, f as E, g as c, h as m, i as P, j as f, k as S, l as T, m as h, r as u, n as N, s as _, o as C } from "../../_chunks/anamnesis-i18n-
|
|
1
|
+
import { A as e, a as i, L as n, P as r, S as o, T as l, b as t, c as d, d as g, e as A, f as E, g as c, h as m, i as P, j as f, k as S, l as T, m as h, r as u, n as N, s as _, o as C } from "../../_chunks/anamnesis-i18n-9OrXTNS3.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Anamnesis,
|
|
4
4
|
i as AnamnesisConfigEditor,
|
package/package.json
CHANGED
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import { jsxs as ve, jsx as F } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as G, forwardRef as be, useRef as A, useCallback as O, useState as _, useEffect as ge } from "react";
|
|
3
|
-
import { c as he } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as ye } from "react-i18next";
|
|
5
|
-
import { u as Ne } from "./use-controllable-state-BiY4xTzM.js";
|
|
6
|
-
import { u as we } from "./form-field-context-B3APVHKx.js";
|
|
7
|
-
import { c as Ie } from "./compose-refs-C0k0tdqF.js";
|
|
8
|
-
import { u as De } from "./registry-DvAUVLHh.js";
|
|
9
|
-
import { C as xe } from "./chevron-down-DWE7GSq9.js";
|
|
10
|
-
import { C as Fe } from "./chevron-up-umRGgtJA.js";
|
|
11
|
-
const Ce = {
|
|
12
|
-
id: "number-input",
|
|
13
|
-
capabilities: ["set_value"],
|
|
14
|
-
state: {
|
|
15
|
-
value: {
|
|
16
|
-
type: "number | null",
|
|
17
|
-
descriptionKey: "ui.agent.numberInput.state.value",
|
|
18
|
-
description: "Current numeric value, or null when empty.",
|
|
19
|
-
read: (t) => t.getValue()
|
|
20
|
-
},
|
|
21
|
-
isEmpty: {
|
|
22
|
-
type: "boolean",
|
|
23
|
-
descriptionKey: "ui.agent.numberInput.state.isEmpty",
|
|
24
|
-
description: "Whether the input has no value.",
|
|
25
|
-
read: (t) => t.getValue() === null
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
actions: {
|
|
29
|
-
set_value: {
|
|
30
|
-
safety: "write",
|
|
31
|
-
argsType: "{ value: number | null }",
|
|
32
|
-
argsSchema: {
|
|
33
|
-
type: "object",
|
|
34
|
-
properties: { value: { type: ["number", "null"] } },
|
|
35
|
-
required: ["value"]
|
|
36
|
-
},
|
|
37
|
-
idempotent: !0,
|
|
38
|
-
examples: [{ args: { value: 42 } }, { args: { value: null } }],
|
|
39
|
-
descriptionKey: "ui.agent.numberInput.actions.setValue",
|
|
40
|
-
description: "Replace the numeric value, or pass null to clear.",
|
|
41
|
-
invoke: (t, r) => {
|
|
42
|
-
t.setValue(r.value);
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
clear: {
|
|
46
|
-
safety: "destructive",
|
|
47
|
-
idempotent: !0,
|
|
48
|
-
descriptionKey: "ui.agent.numberInput.actions.clear",
|
|
49
|
-
description: "Empty the input. Loses any typed value.",
|
|
50
|
-
invoke: (t) => {
|
|
51
|
-
t.clear();
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
focus: {
|
|
55
|
-
safety: "read",
|
|
56
|
-
idempotent: !0,
|
|
57
|
-
descriptionKey: "ui.agent.numberInput.actions.focus",
|
|
58
|
-
description: "Move keyboard focus to the input.",
|
|
59
|
-
invoke: (t) => {
|
|
60
|
-
t.focus();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
domHooks: {
|
|
65
|
-
root: {
|
|
66
|
-
attr: "data-component",
|
|
67
|
-
value: "number-input",
|
|
68
|
-
description: "Marks the NumberInput wrapper."
|
|
69
|
-
},
|
|
70
|
-
instanceId: {
|
|
71
|
-
attr: "data-component-id",
|
|
72
|
-
sourceProp: "id",
|
|
73
|
-
description: "Sourced from the id prop."
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
function Se(t) {
|
|
78
|
-
let r = "";
|
|
79
|
-
for (const d of t) {
|
|
80
|
-
const n = d.codePointAt(0);
|
|
81
|
-
n !== void 0 && (n >= 1632 && n <= 1641 ? r += String.fromCodePoint(48 + (n - 1632)) : n >= 1776 && n <= 1785 ? r += String.fromCodePoint(48 + (n - 1776)) : r += d);
|
|
82
|
-
}
|
|
83
|
-
return r;
|
|
84
|
-
}
|
|
85
|
-
function Ve(t, r, d) {
|
|
86
|
-
return G(() => {
|
|
87
|
-
var S, V;
|
|
88
|
-
const n = new Intl.NumberFormat(t).formatToParts(1234.5), u = ((S = n.find((a) => a.type === "decimal")) == null ? void 0 : S.value) ?? ".", C = ((V = n.find((a) => a.type === "group")) == null ? void 0 : V.value) ?? ",", p = r === "currency" ? new Intl.NumberFormat(t, {
|
|
89
|
-
style: "currency",
|
|
90
|
-
currency: d ?? "USD"
|
|
91
|
-
}) : r === "percentage" ? new Intl.NumberFormat(t, {
|
|
92
|
-
style: "percent",
|
|
93
|
-
maximumFractionDigits: 4
|
|
94
|
-
}) : r === "integer" ? new Intl.NumberFormat(t, { maximumFractionDigits: 0 }) : new Intl.NumberFormat(t, { maximumFractionDigits: 10 }), T = (a) => Number.isFinite(a) ? p.format(a) : "", z = (a) => {
|
|
95
|
-
if (!a) return NaN;
|
|
96
|
-
const M = Se(a), g = M.trim(), I = g.startsWith("-") || g.startsWith("−");
|
|
97
|
-
let c = "";
|
|
98
|
-
for (const h of M)
|
|
99
|
-
h >= "0" && h <= "9" ? c += h : h === u && (c += ".");
|
|
100
|
-
if (!c || c === ".") return NaN;
|
|
101
|
-
let m = Number(c);
|
|
102
|
-
return Number.isFinite(m) ? (I && (m = -m), r === "percentage" && (m = m / 100), m) : NaN;
|
|
103
|
-
};
|
|
104
|
-
let b = "decimal";
|
|
105
|
-
if (r === "integer")
|
|
106
|
-
b = "numeric";
|
|
107
|
-
else if (r === "currency")
|
|
108
|
-
try {
|
|
109
|
-
const { maximumFractionDigits: a } = new Intl.NumberFormat(t, {
|
|
110
|
-
style: "currency",
|
|
111
|
-
currency: d ?? "USD"
|
|
112
|
-
}).resolvedOptions();
|
|
113
|
-
b = a === 0 ? "numeric" : "decimal";
|
|
114
|
-
} catch {
|
|
115
|
-
b = "decimal";
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
format: T,
|
|
119
|
-
parse: z,
|
|
120
|
-
decimalSeparator: u,
|
|
121
|
-
groupingSeparator: C,
|
|
122
|
-
inputMode: b
|
|
123
|
-
};
|
|
124
|
-
}, [t, r, d]);
|
|
125
|
-
}
|
|
126
|
-
const Me = he(
|
|
127
|
-
[
|
|
128
|
-
"ds:flex ds:items-center ds:w-full ds:rounded-[var(--radius-sm)]",
|
|
129
|
-
"ds:border ds:bg-input ds:text-foreground",
|
|
130
|
-
"ds:shadow-[var(--shadow-input)]",
|
|
131
|
-
"ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
132
|
-
"ds:focus-within:outline-[length:var(--focus-ring-width)] ds:focus-within:outline-solid",
|
|
133
|
-
"ds:focus-within:outline-ring ds:focus-within:outline-offset-[length:var(--focus-ring-offset)]",
|
|
134
|
-
"ds:has-[:disabled]:cursor-not-allowed ds:has-[:disabled]:opacity-50"
|
|
135
|
-
].join(" "),
|
|
136
|
-
{
|
|
137
|
-
variants: {
|
|
138
|
-
size: {
|
|
139
|
-
sm: "ds:h-8 ds:text-[length:var(--font-size-sm)]",
|
|
140
|
-
md: "ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)]",
|
|
141
|
-
lg: "ds:h-12 ds:text-[length:var(--font-size-lg)]"
|
|
142
|
-
},
|
|
143
|
-
tone: {
|
|
144
|
-
default: "ds:border-border",
|
|
145
|
-
error: "ds:border-destructive ds:focus-within:outline-destructive"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
defaultVariants: { size: "md", tone: "default" }
|
|
149
|
-
}
|
|
150
|
-
), $ = [
|
|
151
|
-
"ds:inline-flex ds:items-center ds:justify-center",
|
|
152
|
-
"ds:h-full ds:shrink-0",
|
|
153
|
-
"ds:text-muted-foreground ds:hover:text-foreground",
|
|
154
|
-
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
155
|
-
"ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
|
|
156
|
-
].join(" "), ke = () => typeof navigator < "u" && navigator.language ? navigator.language : "en-US";
|
|
157
|
-
function Te(t) {
|
|
158
|
-
if (!Number.isFinite(t)) return 0;
|
|
159
|
-
const r = String(t), d = r.indexOf(".");
|
|
160
|
-
return d === -1 ? 0 : r.length - d - 1;
|
|
161
|
-
}
|
|
162
|
-
function ze(t, r) {
|
|
163
|
-
if (r <= 0 || !Number.isFinite(r)) return t;
|
|
164
|
-
const n = 10 ** Te(r);
|
|
165
|
-
return Math.round(t * n) / n;
|
|
166
|
-
}
|
|
167
|
-
const Pe = be(
|
|
168
|
-
({
|
|
169
|
-
value: t,
|
|
170
|
-
defaultValue: r,
|
|
171
|
-
onChange: d,
|
|
172
|
-
min: n,
|
|
173
|
-
max: u,
|
|
174
|
-
step: C = 1,
|
|
175
|
-
mode: p = "integer",
|
|
176
|
-
currency: T,
|
|
177
|
-
locale: z,
|
|
178
|
-
size: b = "md",
|
|
179
|
-
tone: S,
|
|
180
|
-
className: V,
|
|
181
|
-
id: a,
|
|
182
|
-
disabled: M,
|
|
183
|
-
onFocus: g,
|
|
184
|
-
onBlur: I,
|
|
185
|
-
onKeyDown: c,
|
|
186
|
-
...m
|
|
187
|
-
}, h) => {
|
|
188
|
-
const { t: E } = ye(), D = we(), J = a ?? D.id, k = !!(D.disabled || M), Q = z ?? ke(), P = Ve(Q, p, T), {
|
|
189
|
-
decimalSeparator: U,
|
|
190
|
-
format: R,
|
|
191
|
-
parse: B
|
|
192
|
-
} = P, K = A(null), X = Ie(h, K), [Y, Z] = Ne({
|
|
193
|
-
value: t,
|
|
194
|
-
defaultValue: r ?? null,
|
|
195
|
-
onChange: d
|
|
196
|
-
}), s = Y ?? null, L = A(s);
|
|
197
|
-
L.current = s;
|
|
198
|
-
const x = O(
|
|
199
|
-
(e) => {
|
|
200
|
-
const i = p === "percentage" ? e * 100 : e;
|
|
201
|
-
return (Number.isInteger(i) ? String(i) : i.toString()).replace(".", U);
|
|
202
|
-
},
|
|
203
|
-
[p, U]
|
|
204
|
-
), f = O(
|
|
205
|
-
(e) => e == null || Number.isNaN(e) ? "" : R(e),
|
|
206
|
-
[R]
|
|
207
|
-
), [j, l] = _(
|
|
208
|
-
() => f(s)
|
|
209
|
-
), y = A(!1), [ee, N] = _(!1);
|
|
210
|
-
ge(() => {
|
|
211
|
-
y.current || l(f(s));
|
|
212
|
-
}, [s, f]);
|
|
213
|
-
const te = ee || s !== null && (n !== void 0 && s < n || u !== void 0 && s > u), q = D.invalid || te, ne = q ? "error" : S ?? "default", v = (e) => {
|
|
214
|
-
Z(e);
|
|
215
|
-
}, w = (e) => {
|
|
216
|
-
let o = (s ?? 0) + C * e;
|
|
217
|
-
n !== void 0 && (o = Math.max(n, o)), u !== void 0 && (o = Math.min(u, o)), o = ze(o, C), v(o), N(!1), l(
|
|
218
|
-
y.current ? x(o) : f(o)
|
|
219
|
-
);
|
|
220
|
-
}, H = (e) => {
|
|
221
|
-
v(e), N(!1), l(
|
|
222
|
-
y.current ? x(e) : f(e)
|
|
223
|
-
);
|
|
224
|
-
}, re = (e) => {
|
|
225
|
-
if (c == null || c(e), e.defaultPrevented || k) return;
|
|
226
|
-
const { key: i, shiftKey: o } = e;
|
|
227
|
-
i === "ArrowUp" ? (e.preventDefault(), w(o ? 10 : 1)) : i === "ArrowDown" ? (e.preventDefault(), w(o ? -10 : -1)) : i === "PageUp" ? (e.preventDefault(), w(100)) : i === "PageDown" ? (e.preventDefault(), w(-100)) : i === "Home" && n !== void 0 ? (e.preventDefault(), H(n)) : i === "End" && u !== void 0 && (e.preventDefault(), H(u));
|
|
228
|
-
}, se = (e) => {
|
|
229
|
-
const i = e.target.value;
|
|
230
|
-
if (l(i), i.trim() === "") {
|
|
231
|
-
v(null), N(!1);
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
const o = B(i);
|
|
235
|
-
Number.isNaN(o) || v(o);
|
|
236
|
-
}, ie = (e) => {
|
|
237
|
-
g == null || g(e), y.current = !0, s != null && l(x(s));
|
|
238
|
-
}, oe = (e) => {
|
|
239
|
-
if (I == null || I(e), y.current = !1, j.trim() === "") {
|
|
240
|
-
v(null), N(!1), l("");
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
const i = B(j);
|
|
244
|
-
if (Number.isNaN(i)) {
|
|
245
|
-
l(f(s));
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
const o = n !== void 0 && i < n || u !== void 0 && i > u;
|
|
249
|
-
N(o), v(i), l(f(i));
|
|
250
|
-
}, W = (e) => {
|
|
251
|
-
e.preventDefault();
|
|
252
|
-
}, ae = () => w(1), ue = () => w(-1), de = G(
|
|
253
|
-
() => ({
|
|
254
|
-
getValue: () => L.current,
|
|
255
|
-
setValue: (e) => {
|
|
256
|
-
v(e), l(
|
|
257
|
-
e === null ? "" : y.current ? x(e) : f(e)
|
|
258
|
-
);
|
|
259
|
-
},
|
|
260
|
-
clear: () => {
|
|
261
|
-
v(null), l(""), N(!1);
|
|
262
|
-
},
|
|
263
|
-
focus: () => {
|
|
264
|
-
var e;
|
|
265
|
-
return (e = K.current) == null ? void 0 : e.focus();
|
|
266
|
-
}
|
|
267
|
-
}),
|
|
268
|
-
// The handle is reconstructed per render; consumers (the agent runtime)
|
|
269
|
-
// re-register only when the identity changes, which is a cheap no-op.
|
|
270
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
271
|
-
[x, f]
|
|
272
|
-
);
|
|
273
|
-
De(Ce, de, a);
|
|
274
|
-
const le = k || n !== void 0 && s !== null && s <= n, ce = k || u !== void 0 && s !== null && s >= u, fe = s ?? void 0, pe = (p === "currency" || p === "percentage") && s !== null && s !== null ? R(s) : void 0, me = P.inputMode === "numeric" ? "[0-9]*" : void 0;
|
|
275
|
-
return /* @__PURE__ */ ve(
|
|
276
|
-
"div",
|
|
277
|
-
{
|
|
278
|
-
className: Me({
|
|
279
|
-
size: b,
|
|
280
|
-
tone: ne,
|
|
281
|
-
className: V
|
|
282
|
-
}),
|
|
283
|
-
"data-component": "number-input",
|
|
284
|
-
"data-component-id": a,
|
|
285
|
-
"data-mode": p,
|
|
286
|
-
children: [
|
|
287
|
-
/* @__PURE__ */ F(
|
|
288
|
-
"button",
|
|
289
|
-
{
|
|
290
|
-
type: "button",
|
|
291
|
-
tabIndex: -1,
|
|
292
|
-
"aria-label": E("inputs.number.decrement", "Decrement"),
|
|
293
|
-
onClick: ue,
|
|
294
|
-
onMouseDown: W,
|
|
295
|
-
disabled: le,
|
|
296
|
-
className: `${$} ds:ps-2 ds:pe-1`,
|
|
297
|
-
children: /* @__PURE__ */ F(xe, { "aria-hidden": "true", className: "ds:size-4" })
|
|
298
|
-
}
|
|
299
|
-
),
|
|
300
|
-
/* @__PURE__ */ F(
|
|
301
|
-
"input",
|
|
302
|
-
{
|
|
303
|
-
ref: X,
|
|
304
|
-
id: J,
|
|
305
|
-
type: "text",
|
|
306
|
-
role: "spinbutton",
|
|
307
|
-
inputMode: P.inputMode,
|
|
308
|
-
pattern: me,
|
|
309
|
-
autoComplete: "off",
|
|
310
|
-
value: j,
|
|
311
|
-
disabled: k,
|
|
312
|
-
"aria-valuemin": n,
|
|
313
|
-
"aria-valuemax": u,
|
|
314
|
-
"aria-valuenow": fe,
|
|
315
|
-
"aria-valuetext": pe,
|
|
316
|
-
"aria-invalid": q || void 0,
|
|
317
|
-
"aria-required": D.required || void 0,
|
|
318
|
-
"aria-describedby": D.describedBy || void 0,
|
|
319
|
-
onChange: se,
|
|
320
|
-
onFocus: ie,
|
|
321
|
-
onBlur: oe,
|
|
322
|
-
onKeyDown: re,
|
|
323
|
-
className: "ds:flex-1 ds:w-full ds:min-w-0 ds:bg-transparent ds:outline-none ds:ps-2 ds:pe-2 ds:text-start ds:tabular-nums ds:disabled:cursor-not-allowed",
|
|
324
|
-
...m
|
|
325
|
-
}
|
|
326
|
-
),
|
|
327
|
-
/* @__PURE__ */ F(
|
|
328
|
-
"button",
|
|
329
|
-
{
|
|
330
|
-
type: "button",
|
|
331
|
-
tabIndex: -1,
|
|
332
|
-
"aria-label": E("inputs.number.increment", "Increment"),
|
|
333
|
-
onClick: ae,
|
|
334
|
-
onMouseDown: W,
|
|
335
|
-
disabled: ce,
|
|
336
|
-
className: `${$} ds:ps-1 ds:pe-2`,
|
|
337
|
-
children: /* @__PURE__ */ F(Fe, { "aria-hidden": "true", className: "ds:size-4" })
|
|
338
|
-
}
|
|
339
|
-
)
|
|
340
|
-
]
|
|
341
|
-
}
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
|
-
);
|
|
345
|
-
Pe.displayName = "NumberInput";
|
|
346
|
-
export {
|
|
347
|
-
Pe as N,
|
|
348
|
-
Ve as u
|
|
349
|
-
};
|
|
350
|
-
//# sourceMappingURL=number-input-DjWzmlEY.js.map
|