@alfadocs/ui-kit 0.36.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-CEpIJtcO.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-eM0y0NIR.js → booking-DK_BPHnQ.js} +4 -4
- package/dist/_chunks/calculator-dialog-B74fqpFZ.js +40 -0
- package/dist/_chunks/chart-DnHvmiDX.js +312 -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-B94HAV4A.js → date-picker-CvQfs6Xh.js} +2 -2
- package/dist/_chunks/{date-range-picker-D8CHNYQT.js → date-range-picker-U9fn1g9d.js} +3 -3
- package/dist/_chunks/{date-time-picker-D1GEzf8p.js → date-time-picker-Cva0ZCWw.js} +2 -2
- package/dist/_chunks/{de-Dfbeau59.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-CZcVWBPo.js → editable-currency-cell-renderer-DGKuRNVG.js} +2 -2
- package/dist/_chunks/{el-Dro3J7CP.js → el-BYPonAaK.js} +2 -2
- package/dist/_chunks/{es-Dvg8u70B.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-VOGjBSPP.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-BSDxWU_y.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-Dfzu29cW.js → isSameWeek-Bim5ftRd.js} +2 -2
- package/dist/_chunks/{it-CuonvcI_.js → it-GiQrQ9p4.js} +3 -3
- package/dist/_chunks/{ja-DO57gIOT.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-DjPaaWaW.js → nl-xOogO4sZ.js} +2 -2
- package/dist/_chunks/{patient-shell-CDvMw_Nk.js → patient-shell-Bz3CdO84.js} +2 -2
- package/dist/_chunks/{pl-Cl4lOx2N.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-D7qO5CzD.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-DsjfS7uI.js → react-day-picker-CdtIiKjx.js} +27 -27
- package/dist/_chunks/{rich-text-editor-CHmr9Bz8.js → rich-text-editor-DLbg2852.js} +114 -124
- package/dist/_chunks/{ro-CP2-VJ_O.js → ro-BEcyh5Nj.js} +2 -2
- package/dist/_chunks/rotate-ccw-BWANpitO.js +15 -0
- package/dist/_chunks/{ru-RPn9_Lpq.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-AQvefouo.js → sq-BujHSAWu.js} +2 -2
- package/dist/_chunks/subDays-_T9YeKPX.js +8 -0
- package/dist/_chunks/{sv-zkx9eBtD.js → sv-C8AeDrTA.js} +2 -2
- package/dist/_chunks/{tr-Dmr412Ac.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-DxVt64Zk.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 +27 -0
- package/dist/components/bmi-calculator/bmi.d.ts +37 -0
- package/dist/components/bmi-calculator/index.d.ts +4 -0
- package/dist/components/bmi-calculator/index.js +15 -0
- 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/chart/chart.d.ts +7 -0
- package/dist/components/chart/index.js +1 -1
- 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 +21 -0
- package/dist/components/due-date-calculator/gestation.d.ts +60 -0
- package/dist/components/due-date-calculator/index.d.ts +4 -0
- package/dist/components/due-date-calculator/index.js +13 -0
- 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 +15 -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/skeleton/skeleton.d.ts +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 +316 -0
- package/dist/i18n/locales/ar.js +307 -0
- package/dist/i18n/locales/de.d.ts +316 -0
- package/dist/i18n/locales/de.js +307 -0
- package/dist/i18n/locales/el.d.ts +316 -0
- package/dist/i18n/locales/el.js +307 -0
- package/dist/i18n/locales/en.d.ts +316 -0
- package/dist/i18n/locales/en.js +310 -0
- package/dist/i18n/locales/es.d.ts +316 -0
- package/dist/i18n/locales/es.js +307 -0
- package/dist/i18n/locales/fr.d.ts +316 -0
- package/dist/i18n/locales/fr.js +307 -0
- package/dist/i18n/locales/hi.d.ts +316 -0
- package/dist/i18n/locales/hi.js +307 -0
- package/dist/i18n/locales/it.d.ts +316 -0
- package/dist/i18n/locales/it.js +307 -0
- package/dist/i18n/locales/ja.d.ts +316 -0
- package/dist/i18n/locales/ja.js +303 -0
- package/dist/i18n/locales/nl.d.ts +316 -0
- package/dist/i18n/locales/nl.js +307 -0
- package/dist/i18n/locales/pl.d.ts +316 -0
- package/dist/i18n/locales/pl.js +307 -0
- package/dist/i18n/locales/pt.d.ts +316 -0
- package/dist/i18n/locales/pt.js +310 -0
- package/dist/i18n/locales/ro.d.ts +316 -0
- package/dist/i18n/locales/ro.js +307 -0
- package/dist/i18n/locales/ru.d.ts +316 -0
- package/dist/i18n/locales/ru.js +307 -0
- package/dist/i18n/locales/sq.d.ts +316 -0
- package/dist/i18n/locales/sq.js +307 -0
- package/dist/i18n/locales/sv.d.ts +316 -0
- package/dist/i18n/locales/sv.js +307 -0
- package/dist/i18n/locales/tr.d.ts +316 -0
- package/dist/i18n/locales/tr.js +307 -0
- package/dist/i18n/locales/zh.d.ts +316 -0
- package/dist/i18n/locales/zh.js +303 -0
- package/dist/index.js +597 -527
- package/dist/locales/ar.json +316 -0
- package/dist/locales/de.json +316 -0
- package/dist/locales/el.json +316 -0
- package/dist/locales/en.json +316 -0
- package/dist/locales/es.json +316 -0
- package/dist/locales/fr.json +316 -0
- package/dist/locales/hi.json +316 -0
- package/dist/locales/it.json +316 -0
- package/dist/locales/ja.json +316 -0
- package/dist/locales/nl.json +316 -0
- package/dist/locales/pl.json +316 -0
- package/dist/locales/pt.json +316 -0
- package/dist/locales/ro.json +316 -0
- package/dist/locales/ru.json +316 -0
- package/dist/locales/sq.json +316 -0
- package/dist/locales/sv.json +316 -0
- package/dist/locales/tr.json +316 -0
- package/dist/locales/zh.json +316 -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 +57 -1
- package/dist/_chunks/chart-DLkVn_ex.js +0 -292
- package/dist/_chunks/subDays-CANHP9hz.js +0 -8
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
import { jsxs as N, jsx as l, Fragment as Ze } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Xe, useContext as je, useState as oe, useRef as P, useId as Ke, useEffect as Oe, useMemo as H, useCallback as ae } from "react";
|
|
3
|
+
import { c as ue } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Ge } from "react-i18next";
|
|
5
|
+
import { u as We, F as Ye } from "./form-field-context-B3APVHKx.js";
|
|
6
|
+
import { I as ie, c as qe, a as L, b as Z } from "./input-surface-xyERuLU_.js";
|
|
7
|
+
import { c as Je } from "./compose-refs-C0k0tdqF.js";
|
|
8
|
+
import { u as Qe } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
9
|
+
import { I as et } from "./icon-button-CKEOrN37.js";
|
|
10
|
+
import { u as tt } from "./registry-nPAVE19X.js";
|
|
11
|
+
import { c as st } from "./createLucideIcon-CrFbzy84.js";
|
|
12
|
+
import { C as ce } from "./circle-alert-ChA9opNA.js";
|
|
13
|
+
import { C as le } from "./circle-check-9AeSgJD_.js";
|
|
14
|
+
/**
|
|
15
|
+
* @license lucide-react v1.8.0 - ISC
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the ISC license.
|
|
18
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/
|
|
20
|
+
const nt = [
|
|
21
|
+
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", key: "1nb95v" }],
|
|
22
|
+
["line", { x1: "8", x2: "16", y1: "6", y2: "6", key: "x4nwl0" }],
|
|
23
|
+
["line", { x1: "16", x2: "16", y1: "14", y2: "18", key: "wjye3r" }],
|
|
24
|
+
["path", { d: "M16 10h.01", key: "1m94wz" }],
|
|
25
|
+
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
26
|
+
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
27
|
+
["path", { d: "M12 14h.01", key: "1etili" }],
|
|
28
|
+
["path", { d: "M8 14h.01", key: "6423bh" }],
|
|
29
|
+
["path", { d: "M12 18h.01", key: "mhygvu" }],
|
|
30
|
+
["path", { d: "M8 18h.01", key: "lrp35t" }]
|
|
31
|
+
], rt = st("calculator", nt), ot = {
|
|
32
|
+
id: "fiscal-code-input",
|
|
33
|
+
capabilities: ["edit_inline"],
|
|
34
|
+
state: {
|
|
35
|
+
value: {
|
|
36
|
+
type: "string",
|
|
37
|
+
descriptionKey: "ui.agent.fiscalCodeInput.state.value",
|
|
38
|
+
description: "Current codice fiscale, normalised (uppercased, 0–16 [A-Z0-9] characters).",
|
|
39
|
+
read: (e) => e.getValue()
|
|
40
|
+
},
|
|
41
|
+
isValid: {
|
|
42
|
+
type: "boolean",
|
|
43
|
+
descriptionKey: "ui.agent.fiscalCodeInput.state.isValid",
|
|
44
|
+
description: "Whether the value is 16 structurally-sound characters with a matching control character.",
|
|
45
|
+
read: (e) => e.isValid()
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
actions: {
|
|
49
|
+
set_value: {
|
|
50
|
+
safety: "write",
|
|
51
|
+
argsType: "{ value: string }",
|
|
52
|
+
descriptionKey: "ui.agent.fiscalCodeInput.actions.setValue",
|
|
53
|
+
description: "Replace the codice fiscale. The value is uppercased and stripped to [A-Z0-9], capped at 16 characters.",
|
|
54
|
+
invoke: (e, t) => {
|
|
55
|
+
e.setValue(t.value);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
clear: {
|
|
59
|
+
safety: "destructive",
|
|
60
|
+
descriptionKey: "ui.agent.fiscalCodeInput.actions.clear",
|
|
61
|
+
description: "Empty the input. Loses any typed value.",
|
|
62
|
+
invoke: (e) => {
|
|
63
|
+
e.clear();
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
focus: {
|
|
67
|
+
safety: "read",
|
|
68
|
+
descriptionKey: "ui.agent.fiscalCodeInput.actions.focus",
|
|
69
|
+
description: "Move keyboard focus to the codice fiscale input.",
|
|
70
|
+
invoke: (e) => {
|
|
71
|
+
e.focus();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
domHooks: {
|
|
76
|
+
root: {
|
|
77
|
+
attr: "data-component",
|
|
78
|
+
value: "fiscal-code-input",
|
|
79
|
+
description: "Marks the FiscalCodeInput wrapper."
|
|
80
|
+
},
|
|
81
|
+
instanceId: {
|
|
82
|
+
attr: "data-component-id",
|
|
83
|
+
sourceProp: "id",
|
|
84
|
+
description: "Sourced from the id prop."
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}, at = /* @__PURE__ */ new Set([0, 1, 2, 3, 4, 5, 8, 11]), it = /* @__PURE__ */ new Set([6, 7, 9, 10, 12, 13, 14]), ct = Object.freeze({
|
|
88
|
+
0: 1,
|
|
89
|
+
1: 0,
|
|
90
|
+
2: 5,
|
|
91
|
+
3: 7,
|
|
92
|
+
4: 9,
|
|
93
|
+
5: 13,
|
|
94
|
+
6: 15,
|
|
95
|
+
7: 17,
|
|
96
|
+
8: 19,
|
|
97
|
+
9: 21,
|
|
98
|
+
A: 1,
|
|
99
|
+
B: 0,
|
|
100
|
+
C: 5,
|
|
101
|
+
D: 7,
|
|
102
|
+
E: 9,
|
|
103
|
+
F: 13,
|
|
104
|
+
G: 15,
|
|
105
|
+
H: 17,
|
|
106
|
+
I: 19,
|
|
107
|
+
J: 21,
|
|
108
|
+
K: 2,
|
|
109
|
+
L: 4,
|
|
110
|
+
M: 18,
|
|
111
|
+
N: 20,
|
|
112
|
+
O: 11,
|
|
113
|
+
P: 3,
|
|
114
|
+
Q: 6,
|
|
115
|
+
R: 8,
|
|
116
|
+
S: 12,
|
|
117
|
+
T: 14,
|
|
118
|
+
U: 16,
|
|
119
|
+
V: 10,
|
|
120
|
+
W: 22,
|
|
121
|
+
X: 25,
|
|
122
|
+
Y: 24,
|
|
123
|
+
Z: 23
|
|
124
|
+
}), lt = Object.freeze({
|
|
125
|
+
0: 0,
|
|
126
|
+
1: 1,
|
|
127
|
+
2: 2,
|
|
128
|
+
3: 3,
|
|
129
|
+
4: 4,
|
|
130
|
+
5: 5,
|
|
131
|
+
6: 6,
|
|
132
|
+
7: 7,
|
|
133
|
+
8: 8,
|
|
134
|
+
9: 9,
|
|
135
|
+
A: 0,
|
|
136
|
+
B: 1,
|
|
137
|
+
C: 2,
|
|
138
|
+
D: 3,
|
|
139
|
+
E: 4,
|
|
140
|
+
F: 5,
|
|
141
|
+
G: 6,
|
|
142
|
+
H: 7,
|
|
143
|
+
I: 8,
|
|
144
|
+
J: 9,
|
|
145
|
+
K: 10,
|
|
146
|
+
L: 11,
|
|
147
|
+
M: 12,
|
|
148
|
+
N: 13,
|
|
149
|
+
O: 14,
|
|
150
|
+
P: 15,
|
|
151
|
+
Q: 16,
|
|
152
|
+
R: 17,
|
|
153
|
+
S: 18,
|
|
154
|
+
T: 19,
|
|
155
|
+
U: 20,
|
|
156
|
+
V: 21,
|
|
157
|
+
W: 22,
|
|
158
|
+
X: 23,
|
|
159
|
+
Y: 24,
|
|
160
|
+
Z: 25
|
|
161
|
+
}), dt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
162
|
+
function ut(e) {
|
|
163
|
+
if (!/^[A-Z0-9]{15}[A-Z]$/.test(e)) return !1;
|
|
164
|
+
for (let t = 0; t < 15; t += 1) {
|
|
165
|
+
const n = e[t], r = n >= "0" && n <= "9";
|
|
166
|
+
if (at.has(t) && r || it.has(t) && !r) return !1;
|
|
167
|
+
}
|
|
168
|
+
return !0;
|
|
169
|
+
}
|
|
170
|
+
function fe(e) {
|
|
171
|
+
let t = 0;
|
|
172
|
+
for (let n = 0; n < 15; n += 1) {
|
|
173
|
+
const r = e[n];
|
|
174
|
+
t += n % 2 === 0 ? ct[r] : lt[r];
|
|
175
|
+
}
|
|
176
|
+
return dt[t % 26];
|
|
177
|
+
}
|
|
178
|
+
function w(e) {
|
|
179
|
+
if (e.length === 0) return "empty";
|
|
180
|
+
if (e.length < 16) return "incomplete";
|
|
181
|
+
const t = e.slice(0, 16);
|
|
182
|
+
return ut(t) ? fe(t.slice(0, 15)) !== t[15] ? "badChecksum" : "valid" : "badFormat";
|
|
183
|
+
}
|
|
184
|
+
function Ut(e) {
|
|
185
|
+
return w(e) === "valid";
|
|
186
|
+
}
|
|
187
|
+
const pe = /* @__PURE__ */ new Set(["A", "E", "I", "O", "U"]), ft = [
|
|
188
|
+
"A",
|
|
189
|
+
"B",
|
|
190
|
+
"C",
|
|
191
|
+
"D",
|
|
192
|
+
"E",
|
|
193
|
+
"H",
|
|
194
|
+
"L",
|
|
195
|
+
"M",
|
|
196
|
+
"P",
|
|
197
|
+
"R",
|
|
198
|
+
"S",
|
|
199
|
+
"T"
|
|
200
|
+
];
|
|
201
|
+
function me(e) {
|
|
202
|
+
return e.normalize("NFD").replace(/[̀-ͯ]/g, "").toUpperCase().replace(/[^A-Z]/g, "");
|
|
203
|
+
}
|
|
204
|
+
function he(e) {
|
|
205
|
+
return [...e].filter((t) => !pe.has(t)).join("");
|
|
206
|
+
}
|
|
207
|
+
function ge(e) {
|
|
208
|
+
return [...e].filter((t) => pe.has(t)).join("");
|
|
209
|
+
}
|
|
210
|
+
function pt(e) {
|
|
211
|
+
const t = me(e);
|
|
212
|
+
return (he(t) + ge(t) + "XXX").slice(0, 3);
|
|
213
|
+
}
|
|
214
|
+
function mt(e) {
|
|
215
|
+
const t = me(e), n = he(t);
|
|
216
|
+
return n.length >= 4 ? n[0] + n[2] + n[3] : (n + ge(t) + "XXX").slice(0, 3);
|
|
217
|
+
}
|
|
218
|
+
function ht(e) {
|
|
219
|
+
const t = e instanceof Date ? e : new Date(e);
|
|
220
|
+
if (Number.isNaN(t.getTime()))
|
|
221
|
+
throw new Error(`calculateCodiceFiscale: invalid birthDate "${e}"`);
|
|
222
|
+
return t;
|
|
223
|
+
}
|
|
224
|
+
function de(e) {
|
|
225
|
+
return String(e).padStart(2, "0");
|
|
226
|
+
}
|
|
227
|
+
function gt(e, t) {
|
|
228
|
+
const n = ht(e), r = de(n.getUTCFullYear() % 100), i = ft[n.getUTCMonth()], g = n.getUTCDate() + (t === "F" ? 40 : 0);
|
|
229
|
+
return r + i + de(g);
|
|
230
|
+
}
|
|
231
|
+
function Ct(e) {
|
|
232
|
+
const { surname: t, name: n, birthDate: r, sex: i, belfioreCode: g } = e, m = g.trim().toUpperCase();
|
|
233
|
+
if (!/^[A-Z][0-9]{3}$/.test(m))
|
|
234
|
+
throw new Error(
|
|
235
|
+
`calculateCodiceFiscale: belfioreCode must be a letter + 3 digits (e.g. "H501"), got "${g}"`
|
|
236
|
+
);
|
|
237
|
+
const S = pt(t) + mt(n) + gt(r, i) + m;
|
|
238
|
+
return S + fe(S);
|
|
239
|
+
}
|
|
240
|
+
const k = 16, vt = ue(
|
|
241
|
+
["ds:relative ds:flex ds:items-center ds:w-full", qe].join(
|
|
242
|
+
" "
|
|
243
|
+
),
|
|
244
|
+
{
|
|
245
|
+
variants: {
|
|
246
|
+
size: {
|
|
247
|
+
sm: L.sm,
|
|
248
|
+
md: L.md,
|
|
249
|
+
lg: L.lg
|
|
250
|
+
},
|
|
251
|
+
tone: {
|
|
252
|
+
default: ie.default,
|
|
253
|
+
error: `${ie.error} ds:focus-within:outline-destructive`
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
defaultVariants: { size: "md", tone: "default" }
|
|
257
|
+
}
|
|
258
|
+
), bt = ue(
|
|
259
|
+
[
|
|
260
|
+
// dir="ltr" + tabular-nums keep the alphanumeric code rendering
|
|
261
|
+
// left-to-right and evenly spaced even under an RTL/CJK surrounding
|
|
262
|
+
// UI — this is a value-RENDERING concern (the code is never mirrored),
|
|
263
|
+
// not a layout-direction violation, so logical-prop rules don't apply
|
|
264
|
+
// to the code glyphs themselves.
|
|
265
|
+
"ds:w-full ds:min-w-0 ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground",
|
|
266
|
+
"ds:border-0 ds:outline-none ds:tabular-nums ds:uppercase ds:tracking-wide",
|
|
267
|
+
"ds:disabled:cursor-not-allowed",
|
|
268
|
+
"ds:read-only:cursor-default"
|
|
269
|
+
].join(" "),
|
|
270
|
+
{
|
|
271
|
+
variants: {
|
|
272
|
+
size: {
|
|
273
|
+
sm: `ds:pe-3 ${Z.sm}`,
|
|
274
|
+
md: `ds:pe-3 ${Z.md}`,
|
|
275
|
+
lg: `ds:pe-4 ${Z.lg}`
|
|
276
|
+
},
|
|
277
|
+
// When the calculate affordance is shown, the input text starts after
|
|
278
|
+
// the inline-start icon button (mirrors `hasEnd`'s pe-10 reservation).
|
|
279
|
+
hasStart: {
|
|
280
|
+
true: "ds:ps-10",
|
|
281
|
+
false: ""
|
|
282
|
+
},
|
|
283
|
+
hasEnd: {
|
|
284
|
+
true: "ds:pe-10",
|
|
285
|
+
false: ""
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
compoundVariants: [
|
|
289
|
+
{ size: "sm", hasStart: !1, class: "ds:ps-3" },
|
|
290
|
+
{ size: "md", hasStart: !1, class: "ds:ps-3" },
|
|
291
|
+
{ size: "lg", hasStart: !1, class: "ds:ps-4" }
|
|
292
|
+
],
|
|
293
|
+
defaultVariants: { size: "md", hasStart: !1, hasEnd: !1 }
|
|
294
|
+
}
|
|
295
|
+
), yt = "ds:absolute ds:inset-y-0 ds:end-0 ds:pe-3 ds:flex ds:items-center ds:pointer-events-none ds:[&_svg]:size-4", Et = "ds:absolute ds:inset-y-0 ds:start-0 ds:ps-1 ds:flex ds:items-center", X = "type-body-sm ds:mt-[var(--spacing-xs)]";
|
|
296
|
+
function p(e) {
|
|
297
|
+
return e.normalize("NFKC").replace(/[٠-٩]/g, (t) => String(t.charCodeAt(0) - 1632)).replace(/[۰-۹]/g, (t) => String(t.charCodeAt(0) - 1776)).toUpperCase().replace(/[^A-Z0-9]/g, "").slice(0, k);
|
|
298
|
+
}
|
|
299
|
+
function It(e, t) {
|
|
300
|
+
let n = 0;
|
|
301
|
+
for (let r = 0; r < t && r < e.length; r += 1) {
|
|
302
|
+
const i = e[r];
|
|
303
|
+
(i >= "0" && i <= "9" || i >= "A" && i <= "Z" || i >= "a" && i <= "z") && (n += 1);
|
|
304
|
+
}
|
|
305
|
+
return n;
|
|
306
|
+
}
|
|
307
|
+
const xt = Xe(function({
|
|
308
|
+
value: t,
|
|
309
|
+
defaultValue: n,
|
|
310
|
+
onChange: r,
|
|
311
|
+
size: i = "md",
|
|
312
|
+
tone: g = "default",
|
|
313
|
+
validateOn: m = "blur",
|
|
314
|
+
showError: S,
|
|
315
|
+
errorMessage: A,
|
|
316
|
+
disabled: Ce,
|
|
317
|
+
readOnly: d,
|
|
318
|
+
required: ve,
|
|
319
|
+
placeholder: be,
|
|
320
|
+
showFormatHint: ye = !0,
|
|
321
|
+
calculateFrom: R,
|
|
322
|
+
id: V,
|
|
323
|
+
name: Ee,
|
|
324
|
+
className: Ie,
|
|
325
|
+
"aria-label": j
|
|
326
|
+
}, xe) {
|
|
327
|
+
const { t: u } = Ge(), y = We(), f = je(Ye) !== null, C = t !== void 0, [Se, M] = oe(
|
|
328
|
+
() => p(n ?? "")
|
|
329
|
+
), c = C ? p(t ?? "") : Se, [Te, K] = oe(!1), _ = P(!1), v = P(null), h = P(null), Fe = Je(xe, h), B = Ke(), O = `${B}-hint`, G = `${B}-status`, W = `${B}-error`;
|
|
330
|
+
Oe(() => {
|
|
331
|
+
}, [f, j]);
|
|
332
|
+
const T = H(
|
|
333
|
+
() => w(c),
|
|
334
|
+
[c]
|
|
335
|
+
), Y = c.length === k, E = T === "valid", D = (f ? y.disabled : !1) || !!Ce, Ne = (f ? y.required : !1) || !!ve, we = !d && (!!S || Y && !E && (m === "change" || m === "blur" && Te)), q = f && y.invalid, b = we && !q, J = q || b, ke = J || g === "error" ? "error" : "default", Ae = H(() => A || u(T === "badChecksum" ? "inputs.fiscalCode.errorChecksum" : T === "badFormat" ? "inputs.fiscalCode.errorFormat" : "inputs.fiscalCode.errorIncomplete"), [A, T, u]), Q = !f && ye && !d, Re = f ? void 0 : [
|
|
336
|
+
Q ? O : null,
|
|
337
|
+
b ? W : G
|
|
338
|
+
].filter(Boolean).join(" ") || void 0, Ve = f ? y.describedBy || void 0 : Re, Me = V ?? y.id, I = ae(
|
|
339
|
+
(s) => {
|
|
340
|
+
const o = w(s);
|
|
341
|
+
r == null || r(s, {
|
|
342
|
+
isValid: o === "valid",
|
|
343
|
+
isComplete: s.length === k,
|
|
344
|
+
reason: o
|
|
345
|
+
});
|
|
346
|
+
},
|
|
347
|
+
[r]
|
|
348
|
+
), F = ae(
|
|
349
|
+
(s) => {
|
|
350
|
+
C || M(s), I(s);
|
|
351
|
+
},
|
|
352
|
+
[C, I]
|
|
353
|
+
);
|
|
354
|
+
Qe(() => {
|
|
355
|
+
if (v.current == null) return;
|
|
356
|
+
const s = v.current;
|
|
357
|
+
v.current = null;
|
|
358
|
+
const o = h.current;
|
|
359
|
+
if (o && document.activeElement === o) {
|
|
360
|
+
const a = Math.min(s, o.value.length);
|
|
361
|
+
o.setSelectionRange(a, a);
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
const _e = (s) => {
|
|
365
|
+
if (d || _.current) return;
|
|
366
|
+
const o = s.target, a = o.value, $ = o.selectionStart ?? a.length, z = It(a, $), x = p(a);
|
|
367
|
+
v.current = Math.min(z, x.length), F(x);
|
|
368
|
+
}, Be = () => {
|
|
369
|
+
_.current = !0;
|
|
370
|
+
}, De = (s) => {
|
|
371
|
+
if (_.current = !1, d) return;
|
|
372
|
+
const o = p(s.currentTarget.value);
|
|
373
|
+
v.current = o.length, F(o);
|
|
374
|
+
}, Ue = (s) => {
|
|
375
|
+
if (d) return;
|
|
376
|
+
const o = s.clipboardData.getData("text");
|
|
377
|
+
s.preventDefault();
|
|
378
|
+
const a = h.current, $ = (a == null ? void 0 : a.selectionStart) ?? c.length, z = (a == null ? void 0 : a.selectionEnd) ?? c.length, x = p(o), ne = c.slice(0, $), Le = c.slice(z), re = p(ne + x + Le);
|
|
379
|
+
v.current = Math.min((ne + x).length, re.length), F(re);
|
|
380
|
+
}, $e = () => {
|
|
381
|
+
m === "blur" && K(!0);
|
|
382
|
+
}, ze = () => {
|
|
383
|
+
var a;
|
|
384
|
+
if (!R || d || D) return;
|
|
385
|
+
let s;
|
|
386
|
+
try {
|
|
387
|
+
s = Ct(R);
|
|
388
|
+
} catch {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
const o = p(s);
|
|
392
|
+
m === "blur" && K(!0), F(o), (a = h.current) == null || a.focus();
|
|
393
|
+
}, Pe = H(
|
|
394
|
+
() => ({
|
|
395
|
+
getValue: () => c,
|
|
396
|
+
setValue: (s) => {
|
|
397
|
+
var a;
|
|
398
|
+
const o = p(s);
|
|
399
|
+
C || M(o), I(o), (a = h.current) == null || a.focus();
|
|
400
|
+
},
|
|
401
|
+
clear: () => {
|
|
402
|
+
var s;
|
|
403
|
+
C || M(""), I(""), (s = h.current) == null || s.focus();
|
|
404
|
+
},
|
|
405
|
+
focus: () => {
|
|
406
|
+
var s;
|
|
407
|
+
return (s = h.current) == null ? void 0 : s.focus();
|
|
408
|
+
},
|
|
409
|
+
isValid: () => w(c) === "valid"
|
|
410
|
+
}),
|
|
411
|
+
[c, C, I]
|
|
412
|
+
);
|
|
413
|
+
tt(ot, Pe, V);
|
|
414
|
+
const He = be ?? u("inputs.fiscalCode.placeholder"), U = d || f ? "" : E ? u("inputs.fiscalCode.valid") : c.length > 0 && !Y ? u("inputs.fiscalCode.charactersEntered", {
|
|
415
|
+
count: c.length
|
|
416
|
+
}) : "", ee = b ? Ae : "", te = !d && (b || E && !f), se = !!R && !d && !D;
|
|
417
|
+
return /* @__PURE__ */ N(
|
|
418
|
+
"div",
|
|
419
|
+
{
|
|
420
|
+
className: "ds:flex ds:flex-col",
|
|
421
|
+
"data-component": "fiscal-code-input",
|
|
422
|
+
"data-component-id": V,
|
|
423
|
+
children: [
|
|
424
|
+
/* @__PURE__ */ N(
|
|
425
|
+
"div",
|
|
426
|
+
{
|
|
427
|
+
"data-slot": "fiscal-code-input",
|
|
428
|
+
className: vt({ size: i, tone: ke, className: Ie }),
|
|
429
|
+
children: [
|
|
430
|
+
se ? /* @__PURE__ */ l("span", { className: Et, children: /* @__PURE__ */ l(
|
|
431
|
+
et,
|
|
432
|
+
{
|
|
433
|
+
type: "button",
|
|
434
|
+
size: "sm",
|
|
435
|
+
intent: "ghost",
|
|
436
|
+
icon: /* @__PURE__ */ l(rt, {}),
|
|
437
|
+
"aria-label": u("inputs.fiscalCode.calculate"),
|
|
438
|
+
onClick: ze
|
|
439
|
+
}
|
|
440
|
+
) }) : null,
|
|
441
|
+
/* @__PURE__ */ l(
|
|
442
|
+
"input",
|
|
443
|
+
{
|
|
444
|
+
ref: Fe,
|
|
445
|
+
id: Me,
|
|
446
|
+
name: Ee,
|
|
447
|
+
dir: "ltr",
|
|
448
|
+
type: "text",
|
|
449
|
+
inputMode: "text",
|
|
450
|
+
autoCapitalize: "characters",
|
|
451
|
+
autoCorrect: "off",
|
|
452
|
+
autoComplete: "off",
|
|
453
|
+
spellCheck: !1,
|
|
454
|
+
maxLength: k,
|
|
455
|
+
pattern: "[A-Z0-9]{15}[A-Z]",
|
|
456
|
+
value: c,
|
|
457
|
+
placeholder: He,
|
|
458
|
+
disabled: D,
|
|
459
|
+
readOnly: d,
|
|
460
|
+
"aria-label": j,
|
|
461
|
+
"aria-describedby": Ve,
|
|
462
|
+
"aria-invalid": J || void 0,
|
|
463
|
+
"aria-required": Ne || void 0,
|
|
464
|
+
onChange: _e,
|
|
465
|
+
onCompositionStart: Be,
|
|
466
|
+
onCompositionEnd: De,
|
|
467
|
+
onPaste: Ue,
|
|
468
|
+
onBlur: $e,
|
|
469
|
+
className: bt({
|
|
470
|
+
size: i,
|
|
471
|
+
hasStart: se,
|
|
472
|
+
hasEnd: te
|
|
473
|
+
})
|
|
474
|
+
}
|
|
475
|
+
),
|
|
476
|
+
te ? /* @__PURE__ */ l(
|
|
477
|
+
"span",
|
|
478
|
+
{
|
|
479
|
+
"aria-hidden": "true",
|
|
480
|
+
className: `${yt} ${b ? "ds:text-destructive" : "ds:text-success"}`,
|
|
481
|
+
children: b ? /* @__PURE__ */ l(ce, {}) : /* @__PURE__ */ l(le, {})
|
|
482
|
+
}
|
|
483
|
+
) : null
|
|
484
|
+
]
|
|
485
|
+
}
|
|
486
|
+
),
|
|
487
|
+
Q ? /* @__PURE__ */ l(
|
|
488
|
+
"p",
|
|
489
|
+
{
|
|
490
|
+
id: O,
|
|
491
|
+
className: `${X} ds:text-muted-foreground`,
|
|
492
|
+
children: u("inputs.fiscalCode.formatHint")
|
|
493
|
+
}
|
|
494
|
+
) : null,
|
|
495
|
+
/* @__PURE__ */ l(
|
|
496
|
+
"p",
|
|
497
|
+
{
|
|
498
|
+
id: G,
|
|
499
|
+
role: "status",
|
|
500
|
+
"aria-live": "polite",
|
|
501
|
+
className: `${X} ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] ${E ? "ds:text-success" : "ds:text-muted-foreground"} ${U ? "" : "ds:sr-only"}`,
|
|
502
|
+
children: U ? /* @__PURE__ */ N(Ze, { children: [
|
|
503
|
+
E ? /* @__PURE__ */ l(
|
|
504
|
+
le,
|
|
505
|
+
{
|
|
506
|
+
"aria-hidden": "true",
|
|
507
|
+
className: "ds:size-4 ds:shrink-0"
|
|
508
|
+
}
|
|
509
|
+
) : null,
|
|
510
|
+
/* @__PURE__ */ l("span", { children: U })
|
|
511
|
+
] }) : null
|
|
512
|
+
}
|
|
513
|
+
),
|
|
514
|
+
ee ? /* @__PURE__ */ N(
|
|
515
|
+
"p",
|
|
516
|
+
{
|
|
517
|
+
id: W,
|
|
518
|
+
role: "alert",
|
|
519
|
+
className: `${X} ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-destructive`,
|
|
520
|
+
children: [
|
|
521
|
+
/* @__PURE__ */ l(ce, { "aria-hidden": "true", className: "ds:size-4 ds:shrink-0" }),
|
|
522
|
+
/* @__PURE__ */ l("span", { children: ee })
|
|
523
|
+
]
|
|
524
|
+
}
|
|
525
|
+
) : null
|
|
526
|
+
]
|
|
527
|
+
}
|
|
528
|
+
);
|
|
529
|
+
});
|
|
530
|
+
xt.displayName = "FiscalCodeInput";
|
|
531
|
+
export {
|
|
532
|
+
xt as F,
|
|
533
|
+
w as a,
|
|
534
|
+
fe as b,
|
|
535
|
+
Ct as c,
|
|
536
|
+
ot as f,
|
|
537
|
+
Ut as i,
|
|
538
|
+
vt as w
|
|
539
|
+
};
|
|
540
|
+
//# sourceMappingURL=fiscal-code-input-BZ0FxwUl.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as m, q as r, r as o, v as d } from "./react-day-picker-
|
|
1
|
+
import { o as m, q as r, r as o, v as d } from "./react-day-picker-CdtIiKjx.js";
|
|
2
2
|
const u = {
|
|
3
3
|
lessThanXSeconds: {
|
|
4
4
|
one: "moins d’une seconde",
|
|
@@ -335,4 +335,4 @@ const u = {
|
|
|
335
335
|
export {
|
|
336
336
|
q as fr
|
|
337
337
|
};
|
|
338
|
-
//# sourceMappingURL=fr-
|
|
338
|
+
//# sourceMappingURL=fr-BcuWxqft.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { a, d as E } from "./react-day-picker-CdtIiKjx.js";
|
|
2
|
+
import { s as i } from "./subDays-_T9YeKPX.js";
|
|
3
|
+
const T = 280, m = 14, u = 266, d = 28;
|
|
4
|
+
function p(e) {
|
|
5
|
+
if (e < 0) return "preconception";
|
|
6
|
+
const t = Math.floor(e / 7);
|
|
7
|
+
return t < 14 ? "first" : t < 28 ? "second" : t < 42 ? "third" : "postterm";
|
|
8
|
+
}
|
|
9
|
+
function S(e, t) {
|
|
10
|
+
const { method: f, date: s } = e;
|
|
11
|
+
let o, r;
|
|
12
|
+
if (f === "lmp") {
|
|
13
|
+
const c = e.cycleLength ?? d;
|
|
14
|
+
o = s, r = a(s, T + (c - d));
|
|
15
|
+
} else if (f === "conception")
|
|
16
|
+
o = i(s, m), r = a(s, u);
|
|
17
|
+
else {
|
|
18
|
+
const c = e.embryoAge ?? 5, l = i(s, c);
|
|
19
|
+
o = i(l, m), r = a(l, u);
|
|
20
|
+
}
|
|
21
|
+
const n = E(t, o), D = n < 0 ? null : {
|
|
22
|
+
weeks: Math.floor(n / 7),
|
|
23
|
+
days: n % 7,
|
|
24
|
+
totalDays: n
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
dueDate: r,
|
|
28
|
+
gestationalStart: o,
|
|
29
|
+
gestationalAge: D,
|
|
30
|
+
trimester: p(n)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const y = [12, 24, 28, 37, 40];
|
|
34
|
+
function g(e) {
|
|
35
|
+
return y.map((t) => ({
|
|
36
|
+
key: `w${t}`,
|
|
37
|
+
week: t,
|
|
38
|
+
date: a(e, t * 7)
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
d as D,
|
|
43
|
+
T as G,
|
|
44
|
+
y as M,
|
|
45
|
+
u as T,
|
|
46
|
+
S as c,
|
|
47
|
+
g,
|
|
48
|
+
p as t
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=gestation-BXEgDGmP.js.map
|