@alfadocs/ui-kit 0.41.1 → 0.42.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 (147) hide show
  1. package/dist/_chunks/address-autocomplete-CSjMrBvu.js +358 -0
  2. package/dist/_chunks/{alia-sidebar-DXsYPinm.js → alia-sidebar-BpX4z_af.js} +2 -2
  3. package/dist/_chunks/{bmi-calculator-DnEr513I.js → bmi-calculator-D4juUcyF.js} +57 -51
  4. package/dist/_chunks/{breadcrumb-CLlhx7qo.js → breadcrumb-OTbaY70e.js} +4 -4
  5. package/dist/_chunks/cycle-calculator-DsZbyzX6.js +191 -0
  6. package/dist/_chunks/{document-scanner-CqS_klIr.js → document-scanner-BqLsGs4Y.js} +7 -7
  7. package/dist/_chunks/{dropdown-menu-BC5ZdOMo.js → dropdown-menu-CUEXqKis.js} +2 -2
  8. package/dist/_chunks/{due-date-calculator-CUspKSTw.js → due-date-calculator-s_CBgaFs.js} +53 -40
  9. package/dist/_chunks/{editable-currency-cell-renderer-DgkCIIcO.js → editable-currency-cell-renderer-BhUkRiPZ.js} +2 -2
  10. package/dist/_chunks/{freemium-paywall-BAk3a6er.js → freemium-paywall-BLXESpH4.js} +2 -2
  11. package/dist/_chunks/{gestational-age-calculator-CsQ05qDy.js → gestational-age-calculator-CWOG3bkI.js} +56 -43
  12. package/dist/_chunks/{header-settings-CBLwUK6t.js → header-settings-Bx0Biimh.js} +2 -2
  13. package/dist/_chunks/index.modern-D2LGACWg.js +1529 -0
  14. package/dist/_chunks/insert-result-DtQQeSSf.js +227 -0
  15. package/dist/_chunks/{kbd-Cglkd7CY.js → kbd-D855ZXIW.js} +2 -2
  16. package/dist/_chunks/map-view-Tb5VfK9Y.js +333 -0
  17. package/dist/_chunks/marketplace-app-shell-kVAVycz_.js +391 -0
  18. package/dist/_chunks/{patient-search-CBq62kmL.js → patient-search-DPe2ZYEL.js} +2 -2
  19. package/dist/_chunks/{patient-shell-DF81lALv.js → patient-shell-lDX3wwu6.js} +2 -2
  20. package/dist/_chunks/{payment-form-Dy3WIIsC.js → payment-form-BzVsG6Ks.js} +5 -5
  21. package/dist/_chunks/{pdf-viewer-Cy6Ul3hZ.js → pdf-viewer-B6MC6VTx.js} +139 -126
  22. package/dist/_chunks/{practice-results-C0d4IL5E.js → practice-results-CrLpEiiW.js} +4 -4
  23. package/dist/_chunks/pregnancy-weight-gain-B7kBK-ZR.js +223 -0
  24. package/dist/_chunks/{public-header.agent-B2dDg2_d.js → public-header.agent-BY6FH71R.js} +2 -2
  25. package/dist/_chunks/radio-group-CLjK-SlK.js +167 -0
  26. package/dist/_chunks/{rich-text-editor-DLbg2852.js → rich-text-editor-DhGIBd4a.js} +10 -10
  27. package/dist/_chunks/{sheet-BV-yuLE2.js → sheet-xbzu4YiY.js} +7 -7
  28. package/dist/_chunks/{sign-document-CpLDZ6Db.js → sign-document-QHfcNKFj.js} +5 -5
  29. package/dist/_chunks/{signature-capture-DoiBd6i3.js → signature-capture-CpMBhqQ9.js} +6 -6
  30. package/dist/_chunks/tab-bar-C4II-7ej.js +86 -0
  31. package/dist/_chunks/{theme-toggle-DpC28kt5.js → theme-toggle-ClATnY4Q.js} +2 -2
  32. package/dist/_chunks/{toast.agent-WHHfw5VX.js → toast.agent-B0MCsvdZ.js} +2 -2
  33. package/dist/_chunks/{unit-converter-EUwO6QYq.js → unit-converter-D1UrEUxa.js} +46 -40
  34. package/dist/_chunks/{workflow-map-C3gB0FvB.js → workflow-map-BFNpzTiw.js} +2 -2
  35. package/dist/agent-catalog.json +1 -1
  36. package/dist/brand/product-lockup/product-lockup.d.ts +16 -0
  37. package/dist/components/_shared/insert-result.d.ts +21 -4
  38. package/dist/components/address-autocomplete/address-autocomplete.d.ts +77 -0
  39. package/dist/components/address-autocomplete/index.d.ts +4 -0
  40. package/dist/components/address-autocomplete/index.js +6 -0
  41. package/dist/components/address-autocomplete/parse-address.d.ts +52 -0
  42. package/dist/components/bmi-calculator/bmi-calculator.d.ts +11 -1
  43. package/dist/components/bmi-calculator/index.js +1 -1
  44. package/dist/components/breadcrumb/index.js +1 -1
  45. package/dist/components/cycle-calculator/cycle-calculator.d.ts +12 -2
  46. package/dist/components/cycle-calculator/index.js +1 -1
  47. package/dist/components/data-table/index.js +1 -1
  48. package/dist/components/document-scanner/index.js +1 -1
  49. package/dist/components/dropdown-menu/index.js +1 -1
  50. package/dist/components/due-date-calculator/due-date-calculator.d.ts +11 -1
  51. package/dist/components/due-date-calculator/index.js +1 -1
  52. package/dist/components/freemium-paywall/index.js +1 -1
  53. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +12 -2
  54. package/dist/components/gestational-age-calculator/index.js +1 -1
  55. package/dist/components/header-settings/index.js +1 -1
  56. package/dist/components/index.d.ts +3 -1
  57. package/dist/components/kbd/index.js +1 -1
  58. package/dist/components/map-view/index.js +1 -1
  59. package/dist/components/matrix-rain/matrix-rain.d.ts +1 -1
  60. package/dist/components/patient-search/index.js +1 -1
  61. package/dist/components/payment-form/index.js +1 -1
  62. package/dist/components/pdf-viewer/index.js +1 -1
  63. package/dist/components/practice-results/index.js +1 -1
  64. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  65. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +12 -2
  66. package/dist/components/public-header/index.js +1 -1
  67. package/dist/components/radio-group/index.js +1 -1
  68. package/dist/components/rich-text-editor/index.js +1 -1
  69. package/dist/components/sheet/index.js +1 -1
  70. package/dist/components/sign-document/index.js +1 -1
  71. package/dist/components/signature-capture/index.js +1 -1
  72. package/dist/components/tab-bar/index.d.ts +3 -0
  73. package/dist/components/tab-bar/index.js +5 -0
  74. package/dist/components/tab-bar/tab-bar.d.ts +61 -0
  75. package/dist/components/theme-toggle/index.js +1 -1
  76. package/dist/components/toast/index.js +1 -1
  77. package/dist/components/unit-converter/index.js +1 -1
  78. package/dist/components/unit-converter/unit-converter.d.ts +11 -1
  79. package/dist/components/workflow/index.js +1 -1
  80. package/dist/i18n/config.js +39 -24
  81. package/dist/i18n/locales/ar.d.ts +17 -0
  82. package/dist/i18n/locales/ar.js +18 -1
  83. package/dist/i18n/locales/de.d.ts +17 -0
  84. package/dist/i18n/locales/de.js +18 -1
  85. package/dist/i18n/locales/el.d.ts +17 -0
  86. package/dist/i18n/locales/el.js +18 -1
  87. package/dist/i18n/locales/en.d.ts +17 -0
  88. package/dist/i18n/locales/en.js +18 -1
  89. package/dist/i18n/locales/es.d.ts +17 -0
  90. package/dist/i18n/locales/es.js +18 -1
  91. package/dist/i18n/locales/fr.d.ts +17 -0
  92. package/dist/i18n/locales/fr.js +18 -1
  93. package/dist/i18n/locales/hi.d.ts +17 -0
  94. package/dist/i18n/locales/hi.js +18 -1
  95. package/dist/i18n/locales/it.d.ts +17 -0
  96. package/dist/i18n/locales/it.js +18 -1
  97. package/dist/i18n/locales/ja.d.ts +17 -0
  98. package/dist/i18n/locales/ja.js +18 -1
  99. package/dist/i18n/locales/nl.d.ts +17 -0
  100. package/dist/i18n/locales/nl.js +18 -1
  101. package/dist/i18n/locales/pl.d.ts +17 -0
  102. package/dist/i18n/locales/pl.js +18 -1
  103. package/dist/i18n/locales/pt.d.ts +17 -0
  104. package/dist/i18n/locales/pt.js +18 -1
  105. package/dist/i18n/locales/ro.d.ts +17 -0
  106. package/dist/i18n/locales/ro.js +18 -1
  107. package/dist/i18n/locales/ru.d.ts +17 -0
  108. package/dist/i18n/locales/ru.js +18 -1
  109. package/dist/i18n/locales/sq.d.ts +17 -0
  110. package/dist/i18n/locales/sq.js +18 -1
  111. package/dist/i18n/locales/sv.d.ts +17 -0
  112. package/dist/i18n/locales/sv.js +18 -1
  113. package/dist/i18n/locales/tr.d.ts +17 -0
  114. package/dist/i18n/locales/tr.js +18 -1
  115. package/dist/i18n/locales/zh.d.ts +17 -0
  116. package/dist/i18n/locales/zh.js +18 -1
  117. package/dist/index.js +604 -599
  118. package/dist/locales/ar.json +18 -1
  119. package/dist/locales/de.json +18 -1
  120. package/dist/locales/el.json +18 -1
  121. package/dist/locales/en.json +18 -1
  122. package/dist/locales/es.json +18 -1
  123. package/dist/locales/fr.json +18 -1
  124. package/dist/locales/hi.json +18 -1
  125. package/dist/locales/it.json +18 -1
  126. package/dist/locales/ja.json +18 -1
  127. package/dist/locales/nl.json +18 -1
  128. package/dist/locales/pl.json +18 -1
  129. package/dist/locales/pt.json +18 -1
  130. package/dist/locales/ro.json +18 -1
  131. package/dist/locales/ru.json +18 -1
  132. package/dist/locales/sq.json +18 -1
  133. package/dist/locales/sv.json +18 -1
  134. package/dist/locales/tr.json +18 -1
  135. package/dist/locales/zh.json +18 -1
  136. package/dist/patterns/alia-assistant/index.js +1 -1
  137. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  138. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +30 -3
  139. package/dist/patterns/patient-shell/index.js +1 -1
  140. package/dist/tokens.css +1 -1
  141. package/package.json +16 -1
  142. package/dist/_chunks/cycle-calculator-B5Uj9QeT.js +0 -185
  143. package/dist/_chunks/insert-result-yJ0QavoN.js +0 -133
  144. package/dist/_chunks/map-view-qJLybrmN.js +0 -1850
  145. package/dist/_chunks/marketplace-app-shell-BlxVizU4.js +0 -296
  146. package/dist/_chunks/pregnancy-weight-gain-BCdi-JSv.js +0 -209
  147. package/dist/_chunks/radio-group-BcF92GEF.js +0 -152
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "0.41.1",
3
+ "version": "0.42.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",
@@ -51,6 +51,10 @@
51
51
  "types": "./dist/components/accordion/index.d.ts",
52
52
  "import": "./dist/components/accordion/index.js"
53
53
  },
54
+ "./address-autocomplete": {
55
+ "types": "./dist/components/address-autocomplete/index.d.ts",
56
+ "import": "./dist/components/address-autocomplete/index.js"
57
+ },
54
58
  "./ai-prompt-input": {
55
59
  "types": "./dist/components/ai-prompt-input/index.d.ts",
56
60
  "import": "./dist/components/ai-prompt-input/index.js"
@@ -515,6 +519,10 @@
515
519
  "types": "./dist/components/switch/index.d.ts",
516
520
  "import": "./dist/components/switch/index.js"
517
521
  },
522
+ "./tab-bar": {
523
+ "types": "./dist/components/tab-bar/index.d.ts",
524
+ "import": "./dist/components/tab-bar/index.js"
525
+ },
518
526
  "./tabs": {
519
527
  "types": "./dist/components/tabs/index.d.ts",
520
528
  "import": "./dist/components/tabs/index.js"
@@ -629,6 +637,7 @@
629
637
  "format:check": "prettier --check .",
630
638
  "stylelint": "stylelint \"src/**/*.css\"",
631
639
  "check:data-component": "node scripts/check-data-component-coverage.mjs",
640
+ "check:arbitrary-classes": "node scripts/check-arbitrary-classes.mjs",
632
641
  "check:prop-runtime-coverage": "node scripts/check-prop-runtime-coverage.mjs",
633
642
  "check:story-locale-thrash": "node scripts/check-story-locale-thrash.mjs",
634
643
  "check:i18n": "node scripts/check-no-namespaced-i18n.mjs",
@@ -815,6 +824,7 @@
815
824
  },
816
825
  "devDependencies": {
817
826
  "@chromatic-com/storybook": "^5.1.2",
827
+ "@exa-online/storybook-jira-addon": "^3.0.3",
818
828
  "@fullcalendar/core": "^6.1.20",
819
829
  "@fullcalendar/daygrid": "^6.1.20",
820
830
  "@fullcalendar/interaction": "^6.1.20",
@@ -829,7 +839,12 @@
829
839
  "@storybook/addon-docs": "^10.3.5",
830
840
  "@storybook/addon-themes": "^10.3.5",
831
841
  "@storybook/addon-vitest": "^10.3.5",
842
+ "@storybook/components": "file:.storybook/sb-compat-shims/components",
843
+ "@storybook/core-events": "file:.storybook/sb-compat-shims/core-events",
844
+ "@storybook/manager-api": "file:.storybook/sb-compat-shims/manager-api",
845
+ "@storybook/preview-api": "file:.storybook/sb-compat-shims/preview-api",
832
846
  "@storybook/react-vite": "^10.3.5",
847
+ "@storybook/theming": "file:.storybook/sb-compat-shims/theming",
833
848
  "@stripe/react-stripe-js": "^6.2.0",
834
849
  "@stripe/stripe-js": "^9.2.0",
835
850
  "@tailwindcss/postcss": "^4.2.2",
@@ -1,185 +0,0 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as D, useState as h, useMemo as y, useEffect as E } from "react";
3
- import { c as _ } from "./index-D2ZczOXr.js";
4
- import { useTranslation as F } from "react-i18next";
5
- import { F as C } from "./form-field-BOm9hK35.js";
6
- import { D as A } from "./date-picker-CvQfs6Xh.js";
7
- import { N as S } from "./number-input-Dj5L3pXK.js";
8
- import { B as x } from "./badge-zsf5i5bH.js";
9
- import { I as T } from "./insert-result-yJ0QavoN.js";
10
- import { a as n } from "./react-day-picker-CdtIiKjx.js";
11
- import { C as W } from "./check-DPdL_Sm7.js";
12
- import { H as $ } from "./heart-C0faivFf.js";
13
- import { c as H } from "./createLucideIcon-CrFbzy84.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 I = [
21
- [
22
- "path",
23
- {
24
- d: "M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",
25
- key: "c7niix"
26
- }
27
- ]
28
- ], z = H("droplet", I), v = 28, k = 14, B = 1;
29
- function Y(m, c = 3) {
30
- const d = m.cycleLength ?? v, { lastPeriodStart: o } = m, i = n(o, d - k), u = {
31
- start: n(i, -5),
32
- end: n(i, B)
33
- }, f = n(o, d), t = Array.from(
34
- { length: c },
35
- (p, s) => n(o, d * (s + 1))
36
- );
37
- return { nextPeriod: f, ovulation: i, fertileWindow: u, upcomingPeriods: t };
38
- }
39
- const j = _("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
40
- variants: {
41
- width: { full: "ds:w-full", auto: "ds:inline-flex" }
42
- },
43
- defaultVariants: { width: "full" }
44
- }), M = D(
45
- ({
46
- defaultCycleLength: m = v,
47
- onResultChange: c,
48
- onInsert: d,
49
- id: o,
50
- width: i,
51
- className: u
52
- }, f) => {
53
- const { t, i18n: p } = F(), [s, N] = h(void 0), [g, L] = h(
54
- m
55
- ), a = y(() => s ? Y({
56
- lastPeriodStart: s,
57
- cycleLength: g ?? v
58
- }) : null, [s, g]), P = y(
59
- () => new Intl.DateTimeFormat(p.language, { dateStyle: "medium" }),
60
- [p.language]
61
- );
62
- E(() => {
63
- c == null || c(a);
64
- }, [a, c]);
65
- const w = y(() => /* @__PURE__ */ new Date(), []), l = (b) => P.format(b);
66
- return /* @__PURE__ */ r(
67
- "div",
68
- {
69
- ref: f,
70
- "data-component": "cycle-calculator",
71
- "data-component-id": o,
72
- className: j({ width: i, className: u }),
73
- children: [
74
- /* @__PURE__ */ r("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
75
- /* @__PURE__ */ e(C, { label: t("cycleCalculator.lastPeriod"), children: /* @__PURE__ */ e(
76
- A,
77
- {
78
- value: s,
79
- onChange: N,
80
- maxDate: w
81
- }
82
- ) }),
83
- /* @__PURE__ */ e(
84
- C,
85
- {
86
- label: t("cycleCalculator.cycleLength"),
87
- description: t("cycleCalculator.cycleLengthHint"),
88
- children: /* @__PURE__ */ e(
89
- S,
90
- {
91
- mode: "integer",
92
- min: 20,
93
- max: 45,
94
- value: g,
95
- onChange: L
96
- }
97
- )
98
- }
99
- )
100
- ] }),
101
- /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: a ? `${t("cycleCalculator.ovulation")}: ${l(a.ovulation)}. ${t(
102
- "cycleCalculator.nextPeriod"
103
- )}: ${l(a.nextPeriod)}.` : "" }),
104
- a ? /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
105
- /* @__PURE__ */ r("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
106
- /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
107
- /* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: t("cycleCalculator.ovulation") }),
108
- /* @__PURE__ */ e("dd", { children: /* @__PURE__ */ e(
109
- x,
110
- {
111
- variant: "success",
112
- size: "lg",
113
- leading: /* @__PURE__ */ e(W, { "aria-hidden": !0 }),
114
- children: l(a.ovulation)
115
- }
116
- ) })
117
- ] }),
118
- /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
119
- /* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: t("cycleCalculator.fertileWindow") }),
120
- /* @__PURE__ */ e("dd", { children: /* @__PURE__ */ r(
121
- x,
122
- {
123
- variant: "accent",
124
- size: "lg",
125
- leading: /* @__PURE__ */ e($, { "aria-hidden": !0 }),
126
- children: [
127
- l(a.fertileWindow.start),
128
- " –",
129
- " ",
130
- l(a.fertileWindow.end)
131
- ]
132
- }
133
- ) })
134
- ] }),
135
- /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
136
- /* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: t("cycleCalculator.nextPeriod") }),
137
- /* @__PURE__ */ e("dd", { children: /* @__PURE__ */ e(
138
- x,
139
- {
140
- variant: "error",
141
- size: "lg",
142
- leading: /* @__PURE__ */ e(z, { "aria-hidden": !0 }),
143
- children: l(a.nextPeriod)
144
- }
145
- ) })
146
- ] })
147
- ] }),
148
- d ? /* @__PURE__ */ e(
149
- T,
150
- {
151
- onInsert: d,
152
- card: {
153
- title: t("insert.title.cycle"),
154
- fields: [
155
- {
156
- label: t("cycleCalculator.ovulation"),
157
- value: l(a.ovulation)
158
- },
159
- {
160
- label: t("cycleCalculator.fertileWindow"),
161
- value: `${l(a.fertileWindow.start)} – ${l(
162
- a.fertileWindow.end
163
- )}`
164
- },
165
- {
166
- label: t("cycleCalculator.nextPeriod"),
167
- value: l(a.nextPeriod)
168
- }
169
- ]
170
- }
171
- }
172
- ) : null
173
- ] }) : /* @__PURE__ */ e("p", { className: "type-body ds:text-muted-foreground", children: t("cycleCalculator.empty") })
174
- ]
175
- }
176
- );
177
- }
178
- );
179
- M.displayName = "CycleCalculator";
180
- export {
181
- M as C,
182
- k as L,
183
- Y as p
184
- };
185
- //# sourceMappingURL=cycle-calculator-B5Uj9QeT.js.map
@@ -1,133 +0,0 @@
1
- import { jsxs as p, Fragment as C, jsx as r } from "react/jsx-runtime";
2
- import { useRef as v } from "react";
3
- import { useTranslation as w } from "react-i18next";
4
- import { B as I } from "./button-DD_0Xdmr.js";
5
- import { D as c } from "./dropdown-menu-BC5ZdOMo.js";
6
- import { C as D } from "./chevron-down-BX_NP2Yh.js";
7
- import { c as Y } from "./createLucideIcon-CrFbzy84.js";
8
- import { I as A } from "./image-C6RM5hfF.js";
9
- import { C as P } from "./copy-B00HK7tj.js";
10
- /**
11
- * @license lucide-react v1.8.0 - ISC
12
- *
13
- * This source code is licensed under the ISC license.
14
- * See the LICENSE file in the root directory of this source tree.
15
- */
16
- const R = [
17
- ["path", { d: "M12 4v16", key: "1654pz" }],
18
- ["path", { d: "M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2", key: "e0r10z" }],
19
- ["path", { d: "M9 20h6", key: "s66wpe" }]
20
- ], S = Y("type", R), z = ["fg", "muted", "accent", "border", "bg"];
21
- function B(t) {
22
- const e = {
23
- fg: "currentColor",
24
- muted: "currentColor",
25
- accent: "currentColor",
26
- border: "currentColor",
27
- bg: "transparent",
28
- font: "sans-serif"
29
- };
30
- if (!t) return e;
31
- const o = (i) => {
32
- const s = t.querySelector(`[data-k="${i}"]`);
33
- return s && getComputedStyle(s).color || "currentColor";
34
- };
35
- return {
36
- fg: o("fg"),
37
- muted: o("muted"),
38
- accent: o("accent"),
39
- border: o("border"),
40
- bg: o("bg"),
41
- font: getComputedStyle(t).fontFamily || "sans-serif"
42
- };
43
- }
44
- const l = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
45
- function j(t) {
46
- const e = [t.title];
47
- t.highlight && e.push(t.highlight);
48
- for (const o of t.fields) e.push(`• ${o.label}: ${o.value}`);
49
- return e.join(`
50
- `);
51
- }
52
- function T(t) {
53
- const e = t.fields.map((i) => `<li>${l(i.label)}: ${l(i.value)}</li>`).join(""), o = t.highlight ? `<p><strong>${l(t.highlight)}</strong></p>` : "";
54
- return `<p><strong>${l(t.title)}</strong></p>${o}<ul>${e}</ul>`;
55
- }
56
- function E(t, e) {
57
- const a = !!t.highlight, n = 62, h = (a ? n : 38) + 28, u = 22, f = h + t.fields.length * u + 8, g = f + 20, d = l(e.font), x = t.fields.map(($, b) => `<text x="20" y="${h + b * u}" font-family="${d}" font-size="13"><tspan fill="${e.muted}">${l(
58
- $.label
59
- )}: </tspan><tspan fill="${e.fg}">${l($.value)}</tspan></text>`).join(""), y = a ? `<text x="20" y="${n}" font-family="${d}" font-size="14" font-weight="600" fill="${e.accent}">${l(
60
- t.highlight
61
- )}</text>` : "";
62
- return `<svg xmlns="http://www.w3.org/2000/svg" width="380" height="${g}" viewBox="0 0 380 ${g}" role="img" aria-label="${l(
63
- t.title
64
- )}"><rect x="0.5" y="0.5" width="379" height="${g - 1}" rx="12" fill="${e.bg}" stroke="${e.border}"/><text x="20" y="38" font-family="${d}" font-size="16" font-weight="700" fill="${e.fg}">${l(
65
- t.title
66
- )}</text>${y}${x}<text x="20" y="${f}" font-family="${d}" font-size="10" fill="${e.muted}">AlfaDocs</text></svg>`;
67
- }
68
- function L({
69
- card: t,
70
- onInsert: e,
71
- size: o = "sm"
72
- }) {
73
- const { t: i } = w(), s = v(null), a = (n) => {
74
- const h = j(t), u = T(t);
75
- let m = "", f = "";
76
- if (n !== "text") {
77
- const g = B(s.current);
78
- m = E(t, g), f = `data:image/svg+xml,${encodeURIComponent(m)}`;
79
- }
80
- e({ mode: n, text: h, html: u, svg: m, imageDataUri: f });
81
- };
82
- return /* @__PURE__ */ p(C, { children: [
83
- /* @__PURE__ */ r("span", { ref: s, "aria-hidden": !0, className: "ds:sr-only", children: z.map((n) => /* @__PURE__ */ r(
84
- "span",
85
- {
86
- "data-k": n,
87
- className: n === "fg" ? "ds:text-foreground" : n === "muted" ? "ds:text-muted-foreground" : n === "accent" ? "ds:text-[color:var(--primary)]" : n === "border" ? "ds:text-[color:var(--border)]" : "ds:text-[color:var(--card)]"
88
- },
89
- n
90
- )) }),
91
- /* @__PURE__ */ p(c.Root, { children: [
92
- /* @__PURE__ */ r(c.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
93
- I,
94
- {
95
- intent: "outline",
96
- size: o,
97
- endIcon: /* @__PURE__ */ r(D, { "aria-hidden": !0 }),
98
- children: i("insert.button")
99
- }
100
- ) }),
101
- /* @__PURE__ */ p(c.Content, { children: [
102
- /* @__PURE__ */ r(
103
- c.Item,
104
- {
105
- startIcon: /* @__PURE__ */ r(S, { "aria-hidden": !0 }),
106
- onSelect: () => a("text"),
107
- children: i("insert.text")
108
- }
109
- ),
110
- /* @__PURE__ */ r(
111
- c.Item,
112
- {
113
- startIcon: /* @__PURE__ */ r(A, { "aria-hidden": !0 }),
114
- onSelect: () => a("image"),
115
- children: i("insert.image")
116
- }
117
- ),
118
- /* @__PURE__ */ r(
119
- c.Item,
120
- {
121
- startIcon: /* @__PURE__ */ r(P, { "aria-hidden": !0 }),
122
- onSelect: () => a("text-image"),
123
- children: i("insert.textImage")
124
- }
125
- )
126
- ] })
127
- ] })
128
- ] });
129
- }
130
- export {
131
- L as I
132
- };
133
- //# sourceMappingURL=insert-result-yJ0QavoN.js.map