@alfadocs/ui-kit 1.31.0 → 1.33.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.
Files changed (192) hide show
  1. package/dist/_chunks/{agenda-card-pdN49pMu.js → agenda-card-DVz3jwTf.js} +2 -2
  2. package/dist/_chunks/{agenda-tray-BweO8pDo.js → agenda-tray-1oDWCJdB.js} +2 -2
  3. package/dist/_chunks/{ai-prompt-input-CrHr-5H8.js → ai-prompt-input-Dt7tpCBh.js} +2 -2
  4. package/dist/_chunks/{alia-sidebar-BWcWZivN.js → alia-sidebar-D18kp3p9.js} +3 -3
  5. package/dist/_chunks/{anamnesis-summary-rows-DMO3MWSt.js → anamnesis-summary-rows-BYgyp_i2.js} +6 -6
  6. package/dist/_chunks/{appointment-card-CvUFFEdS.js → appointment-card-D-oj_ugh.js} +2 -2
  7. package/dist/_chunks/{appointment-timeline-DsMZY7U9.js → appointment-timeline-CymGHyIP.js} +2 -2
  8. package/dist/_chunks/{appointment-tray-Z2GaOIYQ.js → appointment-tray-DCk8gHod.js} +2 -2
  9. package/dist/_chunks/{audio-recorder-DXG6LTtO.js → audio-recorder-11wClczr.js} +2 -2
  10. package/dist/_chunks/{avatar-BNQNhoyL.js → avatar-CkDeQOSI.js} +37 -37
  11. package/dist/_chunks/{balance-badge-cell-CX6b0ML4.js → balance-badge-cell-DhBtFRoW.js} +4 -4
  12. package/dist/_chunks/{bishop-score-CJUVBfAu.js → bishop-score-CAl7C5hm.js} +2 -2
  13. package/dist/_chunks/{bmi-calculator-CcH6upht.js → bmi-calculator-Dwkih9a4.js} +3 -3
  14. package/dist/_chunks/{booking-jGzRUETo.js → booking-BqkEtsKx.js} +777 -747
  15. package/dist/_chunks/{calculator-dialog-12d3Sxaz.js → calculator-dialog-C0ixc3SU.js} +2 -2
  16. package/dist/_chunks/{calendar-BNQKpxhE.js → calendar-Dgvl5L4T.js} +2 -2
  17. package/dist/_chunks/{calendar-workspace-Dy1jHBvG.js → calendar-workspace-BX-zDyVR.js} +14 -14
  18. package/dist/_chunks/{care-plan-card-CQVboTn1.js → care-plan-card-CZW476Kg.js} +2 -2
  19. package/dist/_chunks/{care-plan-entry-card-jxHkzez5.js → care-plan-entry-card-BMUYagEw.js} +2 -2
  20. package/dist/_chunks/{chat-message-DBQu10rs.js → chat-message-C-8UU2av.js} +2 -2
  21. package/dist/_chunks/{clinical-note-card-yCTR9DB6.js → clinical-note-card-D2WTV2CO.js} +2 -2
  22. package/dist/_chunks/{data-table-DB5BiVQ0.js → data-table-DC96JJIq.js} +2 -2
  23. package/dist/_chunks/{dependent-selector-cJlJFAKD.js → dependent-selector-yTKKsuc9.js} +2 -2
  24. package/dist/_chunks/{dialog-UbKJCi1X.js → dialog-BJiLqhx6.js} +54 -46
  25. package/dist/_chunks/{document-preview-CDb-n_W7.js → document-preview-BrhMHNh8.js} +2 -2
  26. package/dist/_chunks/{due-date-calculator-BtgWeFqp.js → due-date-calculator-CxgK8vzt.js} +3 -3
  27. package/dist/_chunks/{entity-summary-B_vO5Ur4.js → entity-summary-5o768XLU.js} +2 -2
  28. package/dist/_chunks/{file-manager-Cd8V9IcZ.js → file-manager-CI2Qn8qW.js} +3 -3
  29. package/dist/_chunks/{gestational-age-calculator-KdMg9z9H.js → gestational-age-calculator-CZHVrERT.js} +4 -4
  30. package/dist/_chunks/{link-cell-renderer-tWEOv3Sc.js → link-cell-renderer-BEpMNtAa.js} +3 -3
  31. package/dist/_chunks/{marketplace-app-shell-C4AjQmvz.js → marketplace-app-shell-CK_ND8Tr.js} +2 -2
  32. package/dist/_chunks/{message-card-D8GB4FdF.js → message-card-BUMv16un.js} +2 -2
  33. package/dist/_chunks/{message-tray-CGIRQjx5.js → message-tray-0zsv27xX.js} +2 -2
  34. package/dist/_chunks/{muscle-scheme-BSJsI4-I.js → muscle-scheme-UVz_x4iE.js} +2 -2
  35. package/dist/_chunks/{notes-panel-am6e-Lwh.js → notes-panel-C4G-mhZ9.js} +3 -3
  36. package/dist/_chunks/{operator-hero-BnFv-Uef.js → operator-hero-D7-iiFQ9.js} +2 -2
  37. package/dist/_chunks/{optical-prescription-BvwuqTpl.js → optical-prescription-DUJOhKz_.js} +2 -2
  38. package/dist/_chunks/{patient-details-CdfursHt.js → patient-details-BGiawUHd.js} +3 -3
  39. package/dist/_chunks/{patient-summary-card-C9WBwct-.js → patient-summary-card--CT_gbaQ.js} +2 -2
  40. package/dist/_chunks/{periodontal-diagnosis-HrFsVi-C.js → periodontal-diagnosis-lEwA8wqX.js} +3 -3
  41. package/dist/_chunks/{practice-profile-hero-YQ7h2K4o.js → practice-profile-hero-DQyDvpJL.js} +2 -2
  42. package/dist/_chunks/{practice-results-CxIsU2YO.js → practice-results-DjEzPgAK.js} +2 -2
  43. package/dist/_chunks/{pregnancy-dating-m-c05DOI.js → pregnancy-dating-n5j5dAKy.js} +4 -4
  44. package/dist/_chunks/{pregnancy-weight-gain-CJwbs9W-.js → pregnancy-weight-gain-D5A8vPjj.js} +3 -3
  45. package/dist/_chunks/qr-code-DOJs4suh.js +750 -0
  46. package/dist/_chunks/radio-DNRe6H_8.js +193 -0
  47. package/dist/_chunks/radio-group-DyVBgnA3.js +297 -0
  48. package/dist/_chunks/{radiograph-panel.agent-ByM9M3qm.js → radiograph-panel.agent-o4jwEJPC.js} +2 -2
  49. package/dist/_chunks/{rich-text-editor-VJATL1Tk.js → rich-text-editor-CQ7yZdG3.js} +2 -2
  50. package/dist/_chunks/select-CLSUnKjF.js +520 -0
  51. package/dist/_chunks/signature-request-vihDT8On.js +2232 -0
  52. package/dist/_chunks/{tabs-DqKtTIjZ.js → tabs-BnRaLT0y.js} +2 -2
  53. package/dist/_chunks/{tasks-panel-DPCNaRko.js → tasks-panel-DQuaVvl5.js} +2 -2
  54. package/dist/_chunks/{timeline-u-2t9t_M.js → timeline-Bs9Erxlo.js} +2 -2
  55. package/dist/_chunks/{tooth-scheme-C9jssOmy.js → tooth-scheme-Qe7LO5Di.js} +2 -2
  56. package/dist/_chunks/{unit-converter-C6jMjqL9.js → unit-converter-BTgU50gk.js} +2 -2
  57. package/dist/_chunks/{widget-picker-em4xGgv0.js → widget-picker-DvUkBemi.js} +2 -2
  58. package/dist/agent-catalog.json +316 -20
  59. package/dist/agent-i18n/en.json +18 -8
  60. package/dist/components/agenda-card/index.js +1 -1
  61. package/dist/components/agenda-tray/index.js +1 -1
  62. package/dist/components/ai-prompt-input/index.js +1 -1
  63. package/dist/components/appointment-card/index.js +2 -2
  64. package/dist/components/appointment-timeline/index.js +1 -1
  65. package/dist/components/audio-recorder/index.js +1 -1
  66. package/dist/components/avatar/avatar.d.ts +2 -0
  67. package/dist/components/avatar/index.js +1 -1
  68. package/dist/components/bishop-score/index.js +1 -1
  69. package/dist/components/bmi-calculator/index.js +1 -1
  70. package/dist/components/booking/index.js +1 -1
  71. package/dist/components/calculator-dialog/index.js +1 -1
  72. package/dist/components/calendar/index.js +1 -1
  73. package/dist/components/care-plan-card/index.js +1 -1
  74. package/dist/components/care-plan-entry-card/index.js +1 -1
  75. package/dist/components/chat-message/index.js +1 -1
  76. package/dist/components/clinical-note-card/index.js +1 -1
  77. package/dist/components/data-table/index.js +2 -2
  78. package/dist/components/dependent-selector/index.js +1 -1
  79. package/dist/components/dialog/dialog.d.ts +9 -0
  80. package/dist/components/dialog/index.js +1 -1
  81. package/dist/components/document-preview/index.js +1 -1
  82. package/dist/components/due-date-calculator/index.js +1 -1
  83. package/dist/components/entity-summary/index.js +1 -1
  84. package/dist/components/file-manager/index.js +1 -1
  85. package/dist/components/gestational-age-calculator/index.js +1 -1
  86. package/dist/components/message-card/index.js +1 -1
  87. package/dist/components/message-tray/index.js +1 -1
  88. package/dist/components/muscle-scheme/index.js +1 -1
  89. package/dist/components/notes-panel/index.js +1 -1
  90. package/dist/components/operator-hero/index.js +1 -1
  91. package/dist/components/optical-prescription/index.js +1 -1
  92. package/dist/components/patient-details/index.js +1 -1
  93. package/dist/components/patient-summary-card/index.js +1 -1
  94. package/dist/components/patient-table/index.js +1 -1
  95. package/dist/components/periodontal-diagnosis/index.js +1 -1
  96. package/dist/components/practice-profile-hero/index.js +1 -1
  97. package/dist/components/practice-results/index.js +1 -1
  98. package/dist/components/pregnancy-dating/index.js +1 -1
  99. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  100. package/dist/components/qr-code/index.js +1 -1
  101. package/dist/components/qr-code/qr-encode.d.ts +14 -16
  102. package/dist/components/radio/index.js +1 -1
  103. package/dist/components/radio-group/index.js +2 -2
  104. package/dist/components/radio-group/radio-group-context.d.ts +4 -1
  105. package/dist/components/radio-group/radio-group.d.ts +13 -1
  106. package/dist/components/radio-group/radio.d.ts +24 -1
  107. package/dist/components/radiograph-panel/index.js +1 -1
  108. package/dist/components/rich-text-editor/index.js +1 -1
  109. package/dist/components/select/index.js +1 -1
  110. package/dist/components/select/select.d.ts +33 -0
  111. package/dist/components/skeleton-scheme/index.js +1 -1
  112. package/dist/components/tabs/index.js +1 -1
  113. package/dist/components/tasks-panel/index.js +1 -1
  114. package/dist/components/timeline/index.js +1 -1
  115. package/dist/components/tooth-scheme/index.js +1 -1
  116. package/dist/components/unit-converter/index.js +1 -1
  117. package/dist/components/widget-picker/index.js +1 -1
  118. package/dist/i18n/locales/ar.d.ts +68 -0
  119. package/dist/i18n/locales/ar.js +69 -1
  120. package/dist/i18n/locales/de.d.ts +68 -0
  121. package/dist/i18n/locales/de.js +71 -1
  122. package/dist/i18n/locales/el.d.ts +68 -0
  123. package/dist/i18n/locales/el.js +69 -1
  124. package/dist/i18n/locales/en.d.ts +68 -0
  125. package/dist/i18n/locales/en.js +69 -1
  126. package/dist/i18n/locales/es.d.ts +68 -0
  127. package/dist/i18n/locales/es.js +69 -1
  128. package/dist/i18n/locales/fr.d.ts +68 -0
  129. package/dist/i18n/locales/fr.js +69 -1
  130. package/dist/i18n/locales/hi.d.ts +68 -0
  131. package/dist/i18n/locales/hi.js +69 -1
  132. package/dist/i18n/locales/it.d.ts +68 -0
  133. package/dist/i18n/locales/it.js +69 -1
  134. package/dist/i18n/locales/ja.d.ts +68 -0
  135. package/dist/i18n/locales/ja.js +69 -1
  136. package/dist/i18n/locales/nl.d.ts +68 -0
  137. package/dist/i18n/locales/nl.js +69 -1
  138. package/dist/i18n/locales/pl.d.ts +68 -0
  139. package/dist/i18n/locales/pl.js +69 -1
  140. package/dist/i18n/locales/pt.d.ts +68 -0
  141. package/dist/i18n/locales/pt.js +69 -1
  142. package/dist/i18n/locales/ro.d.ts +68 -0
  143. package/dist/i18n/locales/ro.js +69 -1
  144. package/dist/i18n/locales/ru.d.ts +68 -0
  145. package/dist/i18n/locales/ru.js +69 -1
  146. package/dist/i18n/locales/sq.d.ts +68 -0
  147. package/dist/i18n/locales/sq.js +69 -1
  148. package/dist/i18n/locales/sv.d.ts +68 -0
  149. package/dist/i18n/locales/sv.js +69 -1
  150. package/dist/i18n/locales/tr.d.ts +68 -0
  151. package/dist/i18n/locales/tr.js +69 -1
  152. package/dist/i18n/locales/zh.d.ts +68 -0
  153. package/dist/i18n/locales/zh.js +69 -1
  154. package/dist/index.js +57 -57
  155. package/dist/locales/ar.json +69 -1
  156. package/dist/locales/de.json +69 -1
  157. package/dist/locales/el.json +69 -1
  158. package/dist/locales/en.json +69 -1
  159. package/dist/locales/es.json +69 -1
  160. package/dist/locales/fr.json +69 -1
  161. package/dist/locales/hi.json +69 -1
  162. package/dist/locales/it.json +69 -1
  163. package/dist/locales/ja.json +69 -1
  164. package/dist/locales/nl.json +69 -1
  165. package/dist/locales/pl.json +69 -1
  166. package/dist/locales/pt.json +69 -1
  167. package/dist/locales/ro.json +69 -1
  168. package/dist/locales/ru.json +69 -1
  169. package/dist/locales/sq.json +69 -1
  170. package/dist/locales/sv.json +69 -1
  171. package/dist/locales/tr.json +69 -1
  172. package/dist/locales/zh.json +69 -1
  173. package/dist/patterns/alia-assistant/index.js +1 -1
  174. package/dist/patterns/anamnesis/index.js +1 -1
  175. package/dist/patterns/calendar/index.js +1 -1
  176. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  177. package/dist/patterns/signature-request/channel-meta.d.ts +27 -0
  178. package/dist/patterns/signature-request/index.d.ts +1 -1
  179. package/dist/patterns/signature-request/index.js +1 -1
  180. package/dist/patterns/signature-request/load-status.d.ts +13 -0
  181. package/dist/patterns/signature-request/person-grid.d.ts +32 -0
  182. package/dist/patterns/signature-request/required-documents.d.ts +127 -0
  183. package/dist/patterns/signature-request/signature-history.d.ts +57 -0
  184. package/dist/patterns/signature-request/signature-outcome.d.ts +29 -0
  185. package/dist/patterns/signature-request/signature-request.d.ts +390 -26
  186. package/dist/tokens.css +1 -1
  187. package/package.json +3 -1
  188. package/dist/_chunks/qr-code-CPkEs5mG.js +0 -574
  189. package/dist/_chunks/radio-TWf9Q-mp.js +0 -108
  190. package/dist/_chunks/radio-group-rXDJADzW.js +0 -175
  191. package/dist/_chunks/select-Bi8zril7.js +0 -471
  192. package/dist/_chunks/signature-request-C-IsbkPf.js +0 -417
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "1.31.0",
3
+ "version": "1.33.0",
4
4
  "type": "module",
5
5
  "description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe.",
6
6
  "license": "BUSL-1.1",
@@ -1070,6 +1070,7 @@
1070
1070
  "react-dropzone": "^15.0.0",
1071
1071
  "sonner": "^2.0.7",
1072
1072
  "tw-animate-css": "^1.4.0",
1073
+ "uqr": "^0.1.3",
1073
1074
  "validator": "^13.15.35"
1074
1075
  },
1075
1076
  "devDependencies": {
@@ -1124,6 +1125,7 @@
1124
1125
  "eslint-plugin-react-hooks": "^5.2.0",
1125
1126
  "globals": "^17.6.0",
1126
1127
  "i18next": "^26.0.4",
1128
+ "jsqr": "^1.4.0",
1127
1129
  "libphonenumber-js": "^1.12.41",
1128
1130
  "pdfjs-dist": "^5.6.205",
1129
1131
  "playwright": "^1.59.1",
@@ -1,574 +0,0 @@
1
- var K = Object.defineProperty;
2
- var P = (e, t, o) => t in e ? K(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var D = (e, t, o) => P(e, typeof t != "symbol" ? t + "" : t, o);
4
- import { jsxs as N, jsx as w } from "react/jsx-runtime";
5
- import { forwardRef as H, useMemo as X } from "react";
6
- import { c as Q } from "./index-D2ZczOXr.js";
7
- import { useTranslation as Z } from "react-i18next";
8
- import { u as J } from "./registry-DvAUVLHh.js";
9
- import { A as W } from "./Alfadocs_Logo_Mark-7o3L3WBI.js";
10
- const Y = {
11
- id: "qr-code",
12
- capabilities: [],
13
- state: {
14
- value: {
15
- type: "string",
16
- descriptionKey: "ui.agent.qrCode.state.value",
17
- description: "The string (typically an https URL) encoded into the QR.",
18
- read: (e) => e
19
- }
20
- },
21
- actions: {},
22
- domHooks: {
23
- root: {
24
- attr: "data-component",
25
- value: "qr-code",
26
- description: "Marks the element as a kit QrCode renderer."
27
- },
28
- instanceId: {
29
- attr: "data-component-id",
30
- sourceProp: "id",
31
- description: "Sourced from the id prop."
32
- }
33
- }
34
- }, A = new Uint8Array(512), I = new Uint8Array(256);
35
- (() => {
36
- let e = 1;
37
- for (let t = 0; t < 255; t++)
38
- A[t] = e, I[e] = t, e <<= 1, e & 256 && (e ^= 285);
39
- for (let t = 255; t < 512; t++) A[t] = A[t - 255];
40
- })();
41
- function G(e, t) {
42
- return e === 0 || t === 0 ? 0 : A[I[e] + I[t]];
43
- }
44
- function ee(e) {
45
- let t = [1];
46
- for (let o = 0; o < e; o++) {
47
- const r = new Array(t.length + 1).fill(0);
48
- for (let n = 0; n < t.length; n++)
49
- r[n] ^= t[n], r[n + 1] ^= G(t[n], A[o]);
50
- t = r;
51
- }
52
- return t;
53
- }
54
- function F(e, t) {
55
- const o = ee(t), r = new Array(t).fill(0);
56
- for (const n of e) {
57
- const l = n ^ r[0];
58
- if (r.shift(), r.push(0), l !== 0)
59
- for (let s = 0; s < t; s++) r[s] ^= G(o[s + 1], l);
60
- }
61
- return r;
62
- }
63
- const $ = {
64
- L: {
65
- 1: [7, 1, 19, 0, 0],
66
- 2: [10, 1, 34, 0, 0],
67
- 3: [15, 1, 55, 0, 0],
68
- 4: [20, 1, 80, 0, 0],
69
- 5: [26, 1, 108, 0, 0],
70
- 6: [18, 2, 68, 0, 0],
71
- 7: [20, 2, 78, 0, 0],
72
- 8: [24, 2, 97, 0, 0],
73
- 9: [30, 2, 116, 0, 0],
74
- 10: [18, 2, 68, 2, 69]
75
- },
76
- M: {
77
- 1: [10, 1, 16, 0, 0],
78
- 2: [16, 1, 28, 0, 0],
79
- 3: [26, 1, 44, 0, 0],
80
- 4: [18, 2, 32, 0, 0],
81
- 5: [24, 2, 43, 0, 0],
82
- 6: [16, 4, 27, 0, 0],
83
- 7: [18, 4, 31, 0, 0],
84
- 8: [22, 2, 38, 2, 39],
85
- 9: [22, 3, 36, 2, 37],
86
- 10: [26, 4, 43, 1, 44]
87
- },
88
- Q: {
89
- 1: [13, 1, 13, 0, 0],
90
- 2: [22, 1, 22, 0, 0],
91
- 3: [18, 2, 17, 0, 0],
92
- 4: [26, 2, 24, 0, 0],
93
- 5: [18, 2, 15, 2, 16],
94
- 6: [24, 4, 19, 0, 0],
95
- 7: [18, 2, 14, 4, 15],
96
- 8: [22, 4, 18, 2, 19],
97
- 9: [20, 4, 16, 4, 17],
98
- 10: [24, 6, 19, 2, 20]
99
- },
100
- H: {
101
- 1: [17, 1, 9, 0, 0],
102
- 2: [28, 1, 16, 0, 0],
103
- 3: [22, 2, 13, 0, 0],
104
- 4: [16, 4, 9, 0, 0],
105
- 5: [22, 2, 11, 2, 12],
106
- 6: [28, 4, 15, 0, 0],
107
- 7: [26, 4, 13, 1, 14],
108
- 8: [26, 4, 14, 2, 15],
109
- 9: [24, 4, 12, 4, 13],
110
- 10: [28, 6, 15, 2, 16]
111
- }
112
- };
113
- function R(e) {
114
- const [, t, o, r, n] = e;
115
- return t * o + r * n;
116
- }
117
- const te = {
118
- L: 1,
119
- M: 0,
120
- Q: 3,
121
- H: 2
122
- };
123
- function re(e) {
124
- let t = e << 10;
125
- const o = 1335;
126
- for (; k(t) - k(o) >= 0; ) t ^= o << k(t) - k(o);
127
- return (e << 10 | t) ^ 21522;
128
- }
129
- function oe(e) {
130
- let t = e << 12;
131
- const o = 7973;
132
- for (; k(t) - k(o) >= 0; ) t ^= o << k(t) - k(o);
133
- return e << 12 | t;
134
- }
135
- function k(e) {
136
- let t = 0;
137
- for (; e; )
138
- t++, e >>>= 1;
139
- return t;
140
- }
141
- const se = {
142
- 1: [],
143
- 2: [6, 18],
144
- 3: [6, 22],
145
- 4: [6, 26],
146
- 5: [6, 30],
147
- 6: [6, 34],
148
- 7: [6, 22, 38],
149
- 8: [6, 24, 42],
150
- 9: [6, 26, 46],
151
- 10: [6, 28, 50]
152
- };
153
- function U(e) {
154
- const t = new TextEncoder();
155
- return Array.from(t.encode(e));
156
- }
157
- function ne(e, t) {
158
- for (let o = 1; o <= 10; o++) {
159
- const r = $[t][o], n = R(r), s = 4 + (o >= 10 ? 16 : 8), i = Math.floor((n * 8 - s) / 8);
160
- if (e <= i) return o;
161
- }
162
- throw new Error(
163
- `[QrCode] value too long for version 10 at EC level ${t} (${e} bytes).`
164
- );
165
- }
166
- class ae {
167
- constructor() {
168
- D(this, "bits", []);
169
- }
170
- put(t, o) {
171
- for (let r = o - 1; r >= 0; r--) this.bits.push(t >>> r & 1);
172
- }
173
- get length() {
174
- return this.bits.length;
175
- }
176
- }
177
- function ce(e, t, o) {
178
- const r = U(e), n = $[t][o], l = R(n), s = new ae();
179
- s.put(4, 4), s.put(r.length, o >= 10 ? 16 : 8);
180
- for (const f of r) s.put(f, 8);
181
- const i = l * 8, h = Math.min(4, i - s.length);
182
- for (s.put(0, h); s.length % 8 !== 0; ) s.bits.push(0);
183
- const v = [];
184
- for (let f = 0; f < s.length; f += 8) {
185
- let m = 0;
186
- for (let q = 0; q < 8; q++) m = m << 1 | s.bits[f + q];
187
- v.push(m);
188
- }
189
- const a = [236, 17];
190
- let c = 0;
191
- for (; v.length < l; ) v.push(a[c++ % 2]);
192
- const [d, u, b, _, y] = n, g = [];
193
- let p = 0;
194
- for (let f = 0; f < u; f++) {
195
- const m = v.slice(p, p + b);
196
- p += b, g.push({ data: m, ec: F(m, d) });
197
- }
198
- for (let f = 0; f < _; f++) {
199
- const m = v.slice(p, p + y);
200
- p += y, g.push({ data: m, ec: F(m, d) });
201
- }
202
- const x = [], L = Math.max(b, y);
203
- for (let f = 0; f < L; f++)
204
- for (const m of g) f < m.data.length && x.push(m.data[f]);
205
- for (let f = 0; f < d; f++)
206
- for (const m of g) x.push(m.ec[f]);
207
- return x;
208
- }
209
- function le(e) {
210
- return Array.from(
211
- { length: e },
212
- () => Array.from({ length: e }, () => ({ dark: !1, reserved: !1 }))
213
- );
214
- }
215
- function z(e, t, o) {
216
- for (let r = -1; r <= 7; r++)
217
- for (let n = -1; n <= 7; n++) {
218
- const l = t + r, s = o + n;
219
- if (l < 0 || l >= e.length || s < 0 || s >= e.length) continue;
220
- const i = r >= 0 && r <= 6 && (n === 0 || n === 6) || n >= 0 && n <= 6 && (r === 0 || r === 6), h = r >= 2 && r <= 4 && n >= 2 && n <= 4;
221
- e[l][s] = { dark: i || h, reserved: !0 };
222
- }
223
- }
224
- function de(e, t) {
225
- const o = se[t];
226
- for (const r of o)
227
- for (const n of o)
228
- if (!(r === 6 && n === 6 || r === 6 && n === o[o.length - 1] || r === o[o.length - 1] && n === 6) && !e[r][n].reserved)
229
- for (let l = -2; l <= 2; l++)
230
- for (let s = -2; s <= 2; s++) {
231
- const i = Math.max(Math.abs(l), Math.abs(s)) !== 1;
232
- e[r + l][n + s] = { dark: i, reserved: !0 };
233
- }
234
- }
235
- function ie(e) {
236
- for (let t = 8; t < e.length - 8; t++)
237
- e[6][t].reserved || (e[6][t] = { dark: t % 2 === 0, reserved: !0 }), e[t][6].reserved || (e[t][6] = { dark: t % 2 === 0, reserved: !0 });
238
- }
239
- function fe(e, t) {
240
- const o = e.length;
241
- e[o - 8][8] = { dark: !0, reserved: !0 };
242
- for (let r = 0; r < 9; r++)
243
- e[8][r].reserved || (e[8][r].reserved = !0), e[r][8].reserved || (e[r][8].reserved = !0);
244
- for (let r = 0; r < 8; r++)
245
- e[8][o - 1 - r].reserved = !0, e[o - 1 - r][8].reserved = !0;
246
- if (t >= 7)
247
- for (let r = 0; r < 6; r++)
248
- for (let n = 0; n < 3; n++)
249
- e[r][o - 11 + n].reserved = !0, e[o - 11 + n][r].reserved = !0;
250
- }
251
- function ue(e, t) {
252
- const o = e.length;
253
- let r = 0;
254
- const n = t.length * 8, l = (i) => i < n ? t[i >> 3] >> 7 - (i & 7) & 1 : 0;
255
- let s = !0;
256
- for (let i = o - 1; i > 0; i -= 2) {
257
- i === 6 && i--;
258
- for (let h = 0; h < o; h++) {
259
- const v = s ? o - 1 - h : h;
260
- for (let a = 0; a < 2; a++) {
261
- const c = i - a, d = e[v][c];
262
- d.reserved || (d.dark = l(r) === 1, r++);
263
- }
264
- }
265
- s = !s;
266
- }
267
- }
268
- const he = [
269
- (e, t) => (e + t) % 2 === 0,
270
- (e) => e % 2 === 0,
271
- (e, t) => t % 3 === 0,
272
- (e, t) => (e + t) % 3 === 0,
273
- (e, t) => (Math.floor(e / 2) + Math.floor(t / 3)) % 2 === 0,
274
- (e, t) => e * t % 2 + e * t % 3 === 0,
275
- (e, t) => (e * t % 2 + e * t % 3) % 2 === 0,
276
- (e, t) => ((e + t) % 2 + e * t % 3) % 2 === 0
277
- ];
278
- function pe(e, t) {
279
- return e.map(
280
- (o, r) => o.map((n, l) => ({
281
- dark: n.reserved ? n.dark : n.dark !== he[t](r, l)
282
- }))
283
- );
284
- }
285
- function me(e, t, o) {
286
- const r = e.length, n = re(te[t] << 3 | o), l = (s) => (n >> s & 1) === 1;
287
- for (let s = 0; s <= 5; s++) e[s][8].dark = l(s);
288
- e[7][8].dark = l(6), e[8][8].dark = l(7), e[8][7].dark = l(8);
289
- for (let s = 9; s < 15; s++) e[8][14 - s].dark = l(s);
290
- for (let s = 0; s < 8; s++) e[8][r - 1 - s].dark = l(s);
291
- for (let s = 8; s < 15; s++) e[r - 15 + s][8].dark = l(s);
292
- e[r - 8][8].dark = !0;
293
- }
294
- function ve(e, t) {
295
- if (t < 7) return;
296
- const o = e.length, r = oe(t);
297
- for (let n = 0; n < 18; n++) {
298
- const l = (r >> n & 1) === 1, s = Math.floor(n / 3), i = n % 3;
299
- e[s][o - 11 + i].dark = l, e[o - 11 + i][s].dark = l;
300
- }
301
- }
302
- function be(e) {
303
- const t = e.length;
304
- let o = 0;
305
- const r = (a) => {
306
- let c = 0, d = 1;
307
- for (let u = 1; u < a.length; u++)
308
- a[u] === a[u - 1] ? d++ : (d >= 5 && (c += 3 + (d - 5)), d = 1);
309
- return d >= 5 && (c += 3 + (d - 5)), c;
310
- };
311
- for (let a = 0; a < t; a++) o += r(e[a].map((c) => c.dark));
312
- for (let a = 0; a < t; a++) o += r(e.map((c) => c[a].dark));
313
- for (let a = 0; a < t - 1; a++)
314
- for (let c = 0; c < t - 1; c++) {
315
- const d = e[a][c].dark;
316
- e[a][c + 1].dark === d && e[a + 1][c].dark === d && e[a + 1][c + 1].dark === d && (o += 3);
317
- }
318
- const n = [!0, !1, !0, !0, !0, !1, !0], l = (a, c) => n.every((d, u) => a[c + u] === d), s = (a) => {
319
- let c = 0;
320
- for (let d = 0; d + 11 <= a.length; d++)
321
- l(a, d) && a.slice(d + 7, d + 11).every((u) => !u) && (c += 40), a.slice(d, d + 4).every((u) => !u) && l(a, d + 4) && (c += 40);
322
- return c;
323
- };
324
- for (let a = 0; a < t; a++) o += s(e[a].map((c) => c.dark));
325
- for (let a = 0; a < t; a++)
326
- o += s(e.map((c) => c[a].dark));
327
- let i = 0;
328
- for (const a of e) for (const c of a) c.dark && i++;
329
- const h = i / (t * t) * 100, v = Math.floor(Math.abs(h - 50) / 5);
330
- return o += v * 10, o;
331
- }
332
- function ge(e, t) {
333
- const o = U(e).length, r = ne(o, t), n = r * 4 + 17, l = ce(e, t, r), s = le(n);
334
- z(s, 0, 0), z(s, 0, n - 7), z(s, n - 7, 0), de(s, r), ie(s), fe(s, r), ue(s, l);
335
- let i = null, h = 1 / 0;
336
- for (let c = 0; c < 8; c++) {
337
- const d = pe(s, c);
338
- me(d, t, c), ve(d, r);
339
- const u = be(d);
340
- u < h && (h = u, i = d);
341
- }
342
- const v = i, a = [];
343
- for (let c = 0; c < n; c++)
344
- for (let d = 0; d < n; d++) a.push(v[c][d].dark);
345
- return { size: n, modules: a };
346
- }
347
- let T = null;
348
- function Te(e) {
349
- T = e;
350
- }
351
- function ke(e, t) {
352
- if (T) {
353
- const o = T(e, { errorCorrectionLevel: t }), { size: r, data: n } = o.modules, l = [];
354
- for (let s = 0; s < n.length; s++) l.push(n[s] === 1);
355
- return { size: r, modules: l };
356
- }
357
- return ge(e, t);
358
- }
359
- const ye = Q(
360
- [
361
- "ds:inline-flex ds:flex-col ds:items-center ds:shrink-0",
362
- "ds:gap-[var(--spacing-sm)]",
363
- // The matrix must never mirror in RTL — a mirrored QR is unscannable —
364
- // so the wrapper pins LTR while caption/label text still flips via the
365
- // logical `text-*` utilities. Mirrors Sparkline's `dir="ltr"` pin.
366
- "ds:leading-none"
367
- ],
368
- {
369
- variants: {
370
- variant: {
371
- plain: "",
372
- framed: [
373
- "ds:bg-[var(--card)] ds:text-[var(--card-foreground)]",
374
- "ds:border ds:border-[color:var(--border)]",
375
- // Accessible theme thickens the boundary in step with Card / Stat.
376
- "ds:[.theme-accessible_&]:border-2",
377
- "ds:rounded-[var(--radius-lg)]",
378
- "ds:p-[var(--spacing-md)]",
379
- // Forced-colors: the UA strips background; keep a CanvasText
380
- // boundary so the frame survives Windows High Contrast Mode.
381
- "ds:forced-colors:border ds:forced-colors:border-[CanvasText]"
382
- ],
383
- "with-caption": [
384
- "ds:bg-[var(--card)] ds:text-[var(--card-foreground)]",
385
- "ds:border ds:border-[color:var(--border)]",
386
- "ds:[.theme-accessible_&]:border-2",
387
- "ds:rounded-[var(--radius-lg)]",
388
- "ds:p-[var(--spacing-md)]",
389
- "ds:forced-colors:border ds:forced-colors:border-[CanvasText]"
390
- ]
391
- },
392
- // Edge length of the matrix box, driven by dedicated tokens
393
- // (`--qr-code-size-*`, parallel to `--logo-size-*`). The token owner
394
- // controls the scale and the accessible theme can lift it; the
395
- // var() fallback is only a graceful default so the box renders before
396
- // those token rows land — the token wins whenever it is defined.
397
- size: {
398
- sm: "ds:[--qr-edge:var(--qr-code-size-sm,8rem)]",
399
- md: "ds:[--qr-edge:var(--qr-code-size-md,12rem)]",
400
- lg: "ds:[--qr-edge:var(--qr-code-size-lg,16rem)]"
401
- },
402
- tone: {
403
- default: "",
404
- // Light modules on a dark quiet zone. The chrome inverts via tokens;
405
- // the matrix colours themselves are swapped in the SVG (scanner
406
- // constraint — see the literal note below).
407
- inverted: ""
408
- }
409
- },
410
- defaultVariants: { variant: "framed", size: "md", tone: "default" }
411
- }
412
- ), xe = Q(
413
- [
414
- "type-body-sm",
415
- "ds:text-[color:var(--card-foreground)]",
416
- // Caption flips with reading direction; the matrix above stays LTR.
417
- "ds:text-center"
418
- ],
419
- {
420
- variants: {
421
- tone: {
422
- default: "",
423
- inverted: ""
424
- }
425
- },
426
- defaultVariants: { tone: "default" }
427
- }
428
- ), we = Q(
429
- [
430
- "ds:pointer-events-none ds:absolute ds:inset-0 ds:m-auto",
431
- "ds:flex ds:items-center ds:justify-center",
432
- "ds:rounded-[var(--radius-sm)] ds:p-[var(--spacing-2xs)]",
433
- "ds:bg-[var(--background)]",
434
- // Clamp to the published LOGO_EDGE_FRACTION of the matrix edge.
435
- "ds:[block-size:calc(var(--qr-edge)*var(--qr-logo-edge))]",
436
- "ds:[inline-size:calc(var(--qr-edge)*var(--qr-logo-edge))]",
437
- // The mark/custom node fills the padded knockout box.
438
- "ds:[&>*]:h-full ds:[&>*]:w-full",
439
- "ds:[&>*]:max-h-full ds:[&>*]:max-w-full"
440
- ],
441
- {
442
- variants: {
443
- tone: {
444
- default: "ds:text-[color:var(--primary)]",
445
- inverted: "ds:text-[color:var(--foreground)]"
446
- }
447
- },
448
- defaultVariants: { tone: "default" }
449
- }
450
- ), E = 4, qe = "ds:[--qr-logo-edge:0.22]", Me = /* @__PURE__ */ w(W, { "aria-hidden": !0, focusable: "false" });
451
- function Ce(e, t) {
452
- if (!e) return null;
453
- try {
454
- return ke(e, t);
455
- } catch {
456
- return null;
457
- }
458
- }
459
- const Ae = H(
460
- ({
461
- value: e,
462
- variant: t = "framed",
463
- size: o = "md",
464
- tone: r = "default",
465
- errorCorrectionLevel: n,
466
- logo: l,
467
- caption: s,
468
- quietZone: i = E,
469
- label: h,
470
- decorative: v,
471
- className: a,
472
- id: c,
473
- ...d
474
- }, u) => {
475
- const { t: b } = Z(), _ = l !== !1, y = _ ? l ?? Me : null, g = n ?? (_ ? "H" : "M"), p = X(() => Ce(e, g), [e, g]), x = Math.max(E, Math.floor(i)), L = p ? h ? b("qrCode.ariaLabelNamed", { label: h }) : b("qrCode.ariaLabel") : b("qrCode.empty"), f = v ? { role: "presentation", "aria-hidden": !0 } : { role: "img", "aria-label": L }, q = t === "with-caption" ? s ?? b("qrCode.caption") : void 0, j = r === "inverted" ? "#fff" : "#000", S = r === "inverted" ? "#000" : "#fff", O = [];
476
- let B = `0 0 ${(E * 2 + 1) * 1} ${(E * 2 + 1) * 1}`;
477
- if (p) {
478
- const V = p.size + x * 2;
479
- B = `0 0 ${V} ${V}`;
480
- for (let M = 0; M < p.size; M++)
481
- for (let C = 0; C < p.size; C++)
482
- p.modules[M * p.size + C] && O.push(
483
- /* @__PURE__ */ w(
484
- "rect",
485
- {
486
- x: C + x,
487
- y: M + x,
488
- width: 1,
489
- height: 1,
490
- fill: j
491
- },
492
- `${M}-${C}`
493
- )
494
- );
495
- }
496
- return J(Y, e, c), /* @__PURE__ */ N(
497
- "div",
498
- {
499
- ref: u,
500
- ...f,
501
- ...d,
502
- id: c,
503
- dir: "ltr",
504
- "data-component": "qr-code",
505
- "data-component-id": c,
506
- "data-tone": r,
507
- "data-ec": g,
508
- "data-logo": y ? "true" : "false",
509
- className: ye({ variant: t, size: o, tone: r, className: a }),
510
- children: [
511
- /* @__PURE__ */ N(
512
- "div",
513
- {
514
- className: `ds:relative ds:w-[var(--qr-edge)] ds:h-[var(--qr-edge)] ds:max-w-full ${qe}`,
515
- children: [
516
- p ? /* @__PURE__ */ N(
517
- "svg",
518
- {
519
- "aria-hidden": "true",
520
- focusable: "false",
521
- viewBox: B,
522
- shapeRendering: "crispEdges",
523
- className: "ds:block ds:h-full ds:w-full",
524
- children: [
525
- /* @__PURE__ */ w("rect", { x: 0, y: 0, width: "100%", height: "100%", fill: S }),
526
- O
527
- ]
528
- }
529
- ) : /* @__PURE__ */ w(
530
- "svg",
531
- {
532
- "aria-hidden": "true",
533
- focusable: "false",
534
- viewBox: B,
535
- className: "ds:block ds:h-full ds:w-full",
536
- children: /* @__PURE__ */ w(
537
- "rect",
538
- {
539
- x: 0,
540
- y: 0,
541
- width: "100%",
542
- height: "100%",
543
- fill: S,
544
- className: "ds:opacity-0"
545
- }
546
- )
547
- }
548
- ),
549
- p && y ? /* @__PURE__ */ w(
550
- "span",
551
- {
552
- "aria-hidden": "true",
553
- "data-slot": "qr-center-logo",
554
- className: we({ tone: r }),
555
- children: y
556
- }
557
- ) : null
558
- ]
559
- }
560
- ),
561
- q ? /* @__PURE__ */ w("p", { className: xe({ tone: r }), children: q }) : null
562
- ]
563
- }
564
- );
565
- }
566
- );
567
- Ae.displayName = "QrCode";
568
- export {
569
- Ae as Q,
570
- ke as c,
571
- Y as q,
572
- Te as s
573
- };
574
- //# sourceMappingURL=qr-code-CPkEs5mG.js.map
@@ -1,108 +0,0 @@
1
- import { jsx as s, jsxs as a } from "react/jsx-runtime";
2
- import { useContext as N, createContext as C, forwardRef as j, useId as R, useRef as I, useEffect as k } from "react";
3
- import * as u from "@radix-ui/react-radio-group";
4
- import { c as w } from "./index-D2ZczOXr.js";
5
- import { T as G } from "./tooltip-DvmfrNvB.js";
6
- const F = C(null);
7
- function S() {
8
- return N(F);
9
- }
10
- const T = w(
11
- [
12
- "ds:group ds:inline-flex ds:items-center ds:justify-center ds:shrink-0 ds:rounded-full",
13
- "ds:border ds:border-border ds:bg-background",
14
- "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
15
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
16
- "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
17
- "ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
18
- "ds:data-[state=checked]:border-primary",
19
- "ds:data-[disabled]:border-muted",
20
- 'ds:relative ds:before:absolute ds:before:inset-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""]'
21
- ].join(" "),
22
- {
23
- variants: {
24
- size: {
25
- sm: "ds:size-3.5",
26
- md: "ds:size-4",
27
- lg: "ds:size-5"
28
- }
29
- },
30
- defaultVariants: {
31
- size: "md"
32
- }
33
- }
34
- ), V = {
35
- sm: "ds:size-1.5",
36
- md: "ds:size-2",
37
- lg: "ds:size-2.5"
38
- }, _ = j(
39
- ({
40
- label: t,
41
- size: o = "md",
42
- disabled: e,
43
- disabledReason: i,
44
- description: n,
45
- id: p,
46
- className: f,
47
- value: c,
48
- ...g
49
- }, b) => {
50
- const h = R(), r = p ?? h, d = S(), v = (d == null ? void 0 : d.variant) === "card";
51
- I(!1), k(() => {
52
- }, [d]);
53
- const x = [
54
- "ds:rounded-full ds:bg-primary",
55
- V[o],
56
- "ds:group-data-[disabled]:bg-muted"
57
- ].join(" "), l = /* @__PURE__ */ s(
58
- u.Item,
59
- {
60
- ref: b,
61
- id: r,
62
- disabled: e,
63
- "aria-disabled": e || void 0,
64
- value: c,
65
- className: T({ size: o, className: f }),
66
- "data-component": "radio",
67
- "data-option-id": c,
68
- ...g,
69
- children: /* @__PURE__ */ s(
70
- u.Indicator,
71
- {
72
- asChild: !0,
73
- className: "ds:inline-flex ds:items-center ds:justify-center",
74
- children: /* @__PURE__ */ s("span", { "aria-hidden": "true", className: x })
75
- }
76
- )
77
- }
78
- ), y = [
79
- "type-label ds:text-foreground ds:select-none",
80
- e ? "ds:cursor-not-allowed ds:opacity-50" : "ds:cursor-pointer"
81
- ].join(" "), z = [
82
- "ds:flex ds:items-start ds:gap-[var(--spacing-md)]",
83
- "ds:rounded-[var(--radius-md)] ds:border ds:border-border",
84
- "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:py-[var(--spacing-md)]",
85
- "ds:min-h-[var(--min-target-size)]",
86
- "ds:has-[[data-state=checked]]:border-ring",
87
- "ds:has-[[data-state=checked]]:bg-[color-mix(in_srgb,var(--accent)_5%,transparent)]",
88
- "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
89
- e ? "ds:cursor-not-allowed ds:opacity-50" : "ds:cursor-pointer"
90
- ].join(" "), m = v ? /* @__PURE__ */ a("label", { htmlFor: r, className: z, children: [
91
- l,
92
- /* @__PURE__ */ a("span", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:text-start", children: [
93
- /* @__PURE__ */ s("span", { className: "type-label ds:text-foreground", children: t }),
94
- n ? /* @__PURE__ */ s("span", { className: "type-body-sm ds:text-muted-foreground", children: n }) : null
95
- ] })
96
- ] }) : /* @__PURE__ */ a("div", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:min-h-[var(--min-target-size)]", children: [
97
- l,
98
- /* @__PURE__ */ s("label", { htmlFor: r, className: y, children: t })
99
- ] });
100
- return e && i ? /* @__PURE__ */ s(G, { label: i, children: m }) : m;
101
- }
102
- );
103
- _.displayName = "Radio";
104
- export {
105
- _ as R,
106
- F as a
107
- };
108
- //# sourceMappingURL=radio-TWf9Q-mp.js.map