@alfadocs/ui-kit 0.42.0 → 0.44.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 (94) hide show
  1. package/dist/_chunks/{ar-Cn_NxqkN.js → ar-DEz65ZJW.js} +2 -2
  2. package/dist/_chunks/bmi-calculator-DFPWL2OJ.js +273 -0
  3. package/dist/_chunks/{booking-4mCw3Mpl.js → booking-CtLwaxkK.js} +4 -4
  4. package/dist/_chunks/{calculator-dialog-B74fqpFZ.js → calculator-dialog-D-nfvteH.js} +2 -2
  5. package/dist/_chunks/{chart-Cbt0_sKv.js → chart-Cg3e9EH9.js} +101 -99
  6. package/dist/_chunks/{cycle-calculator-DsZbyzX6.js → cycle-calculator-ChHBcjet.js} +65 -56
  7. package/dist/_chunks/{date-picker-CvQfs6Xh.js → date-picker-Bq7xhMA-.js} +109 -108
  8. package/dist/_chunks/date-picker-variants-DLi1Va_e.js +3238 -0
  9. package/dist/_chunks/{date-range-picker-U9fn1g9d.js → date-range-picker-DcXuI9y7.js} +20 -19
  10. package/dist/_chunks/{date-time-picker-Cva0ZCWw.js → date-time-picker-RimumeLR.js} +18 -17
  11. package/dist/_chunks/{de-BMM2H7Bs.js → de-bTBGdjPS.js} +2 -2
  12. package/dist/_chunks/dialog-BTpZV6It.js +223 -0
  13. package/dist/_chunks/{due-date-calculator-s_CBgaFs.js → due-date-calculator-CYXKLoof.js} +65 -45
  14. package/dist/_chunks/{editable-currency-cell-renderer-BhUkRiPZ.js → editable-currency-cell-renderer-9jqwDv5x.js} +2 -2
  15. package/dist/_chunks/{el-BYPonAaK.js → el-BWG5RXxa.js} +6 -6
  16. package/dist/_chunks/{es-CMkVCQ4F.js → es-DfO_G435.js} +2 -2
  17. package/dist/_chunks/{fr-BcuWxqft.js → fr-BTn24bs8.js} +2 -2
  18. package/dist/_chunks/{gestation-BXEgDGmP.js → gestation-mWF4AXea.js} +3 -3
  19. package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js +190 -0
  20. package/dist/_chunks/{header-CTZWX-tm.js → header-Ce1Br27u.js} +70 -75
  21. package/dist/_chunks/{hi-wkq_rQAh.js → hi-Dj3oYd84.js} +2 -2
  22. package/dist/_chunks/insert-result-CoC1oo6R.js +334 -0
  23. package/dist/_chunks/{isSameWeek-Bim5ftRd.js → isSameWeek-HfxKk6Lz.js} +2 -2
  24. package/dist/_chunks/{it-GiQrQ9p4.js → it-Y85ofIQQ.js} +7 -7
  25. package/dist/_chunks/{ja-qfYg3Rua.js → ja-CQ7J6YoA.js} +2 -2
  26. package/dist/_chunks/{marketplace-app-shell-kVAVycz_.js → marketplace-app-shell-Dc5cTIt8.js} +186 -149
  27. package/dist/_chunks/{nl-xOogO4sZ.js → nl-D9kHCmp3.js} +2 -2
  28. package/dist/_chunks/{patient-shell-lDX3wwu6.js → patient-shell-CnT4L8gn.js} +2 -2
  29. package/dist/_chunks/{pl-GnOW6eGK.js → pl-B3Smqpkr.js} +3 -3
  30. package/dist/_chunks/{pregnancy-weight-gain-B7kBK-ZR.js → pregnancy-weight-gain-C5YhfYnL.js} +60 -50
  31. package/dist/_chunks/{pt-_bV5b5RW.js → pt-D3J-1c_7.js} +6 -6
  32. package/dist/_chunks/{ro-BEcyh5Nj.js → ro-BKAbbEA3.js} +2 -2
  33. package/dist/_chunks/{ru-Bi86hqMf.js → ru-BeG8f0Ep.js} +3 -3
  34. package/dist/_chunks/{sign-document-QHfcNKFj.js → sign-document-B-3k_0LO.js} +165 -137
  35. package/dist/_chunks/{sq-BujHSAWu.js → sq-_hRPaeUy.js} +6 -6
  36. package/dist/_chunks/subDays-Dv7q9S7u.js +8 -0
  37. package/dist/_chunks/{sv-C8AeDrTA.js → sv-g009fSpe.js} +2 -2
  38. package/dist/_chunks/{tab-bar-C4II-7ej.js → tab-bar-Xetknddo.js} +53 -34
  39. package/dist/_chunks/{tr-CMSs_Vgf.js → tr-OKUOuhMW.js} +2 -2
  40. package/dist/_chunks/{unit-converter-D1UrEUxa.js → unit-converter-Ds9jalbN.js} +78 -67
  41. package/dist/_chunks/{zh-CN-eXB-PFu4.js → zh-CN-De4zwEhx.js} +3 -3
  42. package/dist/agent-catalog.json +1 -1
  43. package/dist/components/_shared/calendar-class-names.d.ts +8 -0
  44. package/dist/components/_shared/index.d.ts +2 -0
  45. package/dist/components/_shared/insert-result.d.ts +149 -4
  46. package/dist/components/badge/badge.d.ts +1 -1
  47. package/dist/components/bmi-calculator/bmi-calculator.d.ts +6 -0
  48. package/dist/components/bmi-calculator/index.js +1 -1
  49. package/dist/components/booking/index.js +1 -1
  50. package/dist/components/calculator-dialog/index.js +1 -1
  51. package/dist/components/card/card.d.ts +1 -1
  52. package/dist/components/chart/chart.d.ts +10 -0
  53. package/dist/components/chart/index.js +1 -1
  54. package/dist/components/cycle-calculator/cycle-calculator.d.ts +6 -0
  55. package/dist/components/cycle-calculator/index.js +1 -1
  56. package/dist/components/data-table/index.js +1 -1
  57. package/dist/components/date-picker/date-picker.d.ts +0 -1
  58. package/dist/components/date-picker/index.js +1 -1
  59. package/dist/components/date-range-picker/date-range-picker.d.ts +0 -1
  60. package/dist/components/date-range-picker/index.js +1 -1
  61. package/dist/components/date-time-picker/date-time-picker.d.ts +0 -1
  62. package/dist/components/date-time-picker/index.js +1 -1
  63. package/dist/components/dialog/dialog.d.ts +1 -0
  64. package/dist/components/dialog/index.js +1 -1
  65. package/dist/components/due-date-calculator/due-date-calculator.d.ts +6 -0
  66. package/dist/components/due-date-calculator/index.js +2 -2
  67. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +6 -0
  68. package/dist/components/gestational-age-calculator/index.js +1 -1
  69. package/dist/components/header/header.d.ts +8 -0
  70. package/dist/components/header/index.js +1 -1
  71. package/dist/components/index.d.ts +1 -1
  72. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  73. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +6 -0
  74. package/dist/components/public-header/public-header.d.ts +1 -1
  75. package/dist/components/sign-document/index.js +1 -1
  76. package/dist/components/sign-document/sign-document.d.ts +12 -0
  77. package/dist/components/stat/stat.d.ts +1 -1
  78. package/dist/components/tab-bar/index.d.ts +1 -1
  79. package/dist/components/tab-bar/index.js +1 -1
  80. package/dist/components/tab-bar/tab-bar.d.ts +44 -1
  81. package/dist/components/unit-converter/index.js +1 -1
  82. package/dist/components/unit-converter/unit-converter.d.ts +6 -0
  83. package/dist/index.js +504 -502
  84. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  85. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +57 -1
  86. package/dist/patterns/patient-shell/index.js +1 -1
  87. package/dist/tokens.css +1411 -2
  88. package/package.json +1 -1
  89. package/dist/_chunks/bmi-calculator-D4juUcyF.js +0 -219
  90. package/dist/_chunks/dialog-Cee13rHU.js +0 -215
  91. package/dist/_chunks/gestational-age-calculator-CWOG3bkI.js +0 -178
  92. package/dist/_chunks/insert-result-DtQQeSSf.js +0 -227
  93. package/dist/_chunks/react-day-picker-CdtIiKjx.js +0 -3174
  94. package/dist/_chunks/subDays-_T9YeKPX.js +0 -8
@@ -1,13 +1,13 @@
1
- import { jsxs as T, jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as Q, useId as X, useMemo as d, useRef as tt, useState as P, useEffect as $, useImperativeHandle as et } from "react";
3
- import { c as ot } from "./index-D2ZczOXr.js";
4
- import { useTranslation as at } from "react-i18next";
5
- import rt from "react-apexcharts";
6
- import k from "apexcharts";
7
- import { u as nt, g as G } from "./apexcharts-theme-BJigns_V.js";
8
- import { u as st } from "./use-prefers-reduced-motion-BMwIQRjB.js";
9
- import { u as it } from "./registry-nPAVE19X.js";
10
- const ct = {
1
+ import { jsxs as x, jsx as c } from "react/jsx-runtime";
2
+ import { forwardRef as X, useId as tt, useMemo as d, useRef as et, useState as $, useEffect as k, useImperativeHandle as ot } from "react";
3
+ import { c as at } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as rt } from "react-i18next";
5
+ import nt from "react-apexcharts";
6
+ import G from "apexcharts";
7
+ import { u as st, g as H } from "./apexcharts-theme-BJigns_V.js";
8
+ import { u as it } from "./use-prefers-reduced-motion-BMwIQRjB.js";
9
+ import { u as ct } from "./registry-nPAVE19X.js";
10
+ const dt = {
11
11
  id: "chart",
12
12
  capabilities: [],
13
13
  state: {},
@@ -34,7 +34,7 @@ const ct = {
34
34
  description: "Sourced from the id prop."
35
35
  }
36
36
  }
37
- }, dt = ot("ds:relative ds:block ds:w-full", {
37
+ }, lt = at("ds:relative ds:block ds:w-full", {
38
38
  variants: {
39
39
  density: {
40
40
  compact: "ds:min-h-[var(--chart-min-height-compact)]",
@@ -46,65 +46,66 @@ const ct = {
46
46
  }
47
47
  },
48
48
  defaultVariants: { density: "comfortable" }
49
- }), lt = [
49
+ }), mt = [
50
50
  "verticalLines",
51
51
  "horizontalLines",
52
52
  "slantedLines",
53
53
  "squares",
54
54
  "circles"
55
- ], mt = ["line", "bar", "area"], ut = ["pie", "donut", "radialBar"];
56
- function x(r) {
57
- return ut.includes(r);
55
+ ], ut = ["line", "bar", "area"], ht = ["pie", "donut", "radialBar"];
56
+ function R(r) {
57
+ return ht.includes(r);
58
58
  }
59
- function ht(r) {
60
- return mt.includes(r);
59
+ function pt(r) {
60
+ return ut.includes(r);
61
61
  }
62
- function pt(r, l) {
63
- return x(l) ? [
62
+ function ft(r, l) {
63
+ return R(l) ? [
64
64
  {
65
65
  name: "",
66
66
  data: r
67
67
  }
68
68
  ] : r;
69
69
  }
70
- const ft = Q(
70
+ const bt = X(
71
71
  ({
72
72
  title: r,
73
73
  id: l,
74
74
  type: o,
75
75
  series: p,
76
- categories: v,
77
- labels: g,
78
- height: L,
79
- width: H,
80
- patterns: O = !1,
81
- toolbar: R = !1,
82
- locale: _,
76
+ categories: g,
77
+ labels: v,
78
+ height: O,
79
+ width: _,
80
+ patterns: A = !1,
81
+ colors: T,
82
+ toolbar: S = !1,
83
+ locale: M,
83
84
  radialValueFormatter: m,
84
- density: M,
85
- className: U
86
- }, D) => {
87
- const { t: a, i18n: W } = at(), A = X(), u = d(
88
- () => `chart-${A.replace(/[^a-zA-Z0-9-_]/g, "")}`,
89
- [A]
90
- ), S = `${u}-summary`, y = tt(null), [z, Y] = P(0);
91
- nt(y);
92
- const h = _ ?? W.language ?? "en", [N, Z] = P(
85
+ density: U,
86
+ className: D
87
+ }, W) => {
88
+ const { t: a, i18n: Y } = rt(), z = tt(), u = d(
89
+ () => `chart-${z.replace(/[^a-zA-Z0-9-_]/g, "")}`,
90
+ [z]
91
+ ), y = `${u}-summary`, I = et(null), [N, Z] = $(0);
92
+ st(I);
93
+ const h = M ?? Y.language ?? "en", [B, j] = $(
93
94
  () => {
94
95
  try {
95
- return G();
96
+ return H();
96
97
  } catch {
97
98
  return {};
98
99
  }
99
100
  }
100
101
  );
101
- $(() => {
102
+ k(() => {
102
103
  if (typeof document > "u") return;
103
104
  let t;
104
105
  const e = new MutationObserver(() => {
105
106
  clearTimeout(t), t = setTimeout(() => {
106
107
  try {
107
- Z(G());
108
+ j(H());
108
109
  } catch {
109
110
  }
110
111
  }, 50);
@@ -115,36 +116,36 @@ const ft = Q(
115
116
  }), () => {
116
117
  clearTimeout(t), e.disconnect();
117
118
  };
118
- }, []), $(() => {
119
- const t = y.current;
119
+ }, []), k(() => {
120
+ const t = I.current;
120
121
  if (!t || typeof ResizeObserver > "u") return;
121
122
  const e = new ResizeObserver((n) => {
122
123
  const s = n[0];
123
- s && Y(Math.floor(s.contentRect.width));
124
+ s && Z(Math.floor(s.contentRect.width));
124
125
  });
125
126
  return e.observe(t), () => e.disconnect();
126
127
  }, []);
127
- const I = d(
128
+ const C = d(
128
129
  () => ({
129
130
  async dataURI() {
130
- const t = k.getChartByID(u);
131
+ const t = G.getChartByID(u);
131
132
  return t ? (await t.dataURI()).imgURI : "";
132
133
  },
133
134
  updateSeries(t) {
134
- const e = k.getChartByID(u);
135
- e && (x(o), e.updateSeries(t));
135
+ const e = G.getChartByID(u);
136
+ e && (R(o), e.updateSeries(t));
136
137
  }
137
138
  }),
138
139
  [u, o]
139
140
  );
140
- et(D, () => I, [I]), it(ct, I, l);
141
- const C = typeof document < "u" && document.documentElement.dir === "rtl", B = d(
142
- () => pt(p, o),
141
+ ot(W, () => C, [C]), ct(dt, C, l);
142
+ const w = typeof document < "u" && document.documentElement.dir === "rtl", E = d(
143
+ () => ft(p, o),
143
144
  [p, o]
144
145
  ), f = d(
145
146
  () => new Intl.NumberFormat(h),
146
147
  [h]
147
- ), E = d(
148
+ ), P = d(
148
149
  () => ({
149
150
  name: h,
150
151
  options: {
@@ -163,24 +164,24 @@ const ft = Q(
163
164
  }
164
165
  }),
165
166
  [h, a]
166
- ), w = st(), j = d(() => {
167
+ ), L = it(), q = d(() => {
167
168
  var n, s, b;
168
- const t = N, e = {
169
+ const t = B, e = {
169
170
  ...t,
170
171
  chart: {
171
172
  ...t.chart,
172
173
  id: u,
173
- toolbar: { show: R },
174
- zoom: { enabled: R },
174
+ toolbar: { show: S },
175
+ zoom: { enabled: S },
175
176
  animations: {
176
- enabled: !w,
177
- dynamicAnimation: { enabled: !w }
177
+ enabled: !L,
178
+ dynamicAnimation: { enabled: !L }
178
179
  },
179
- locales: [E],
180
+ locales: [P],
180
181
  defaultLocale: h,
181
182
  parentHeightOffset: 0
182
183
  },
183
- labels: g,
184
+ labels: v,
184
185
  legend: {
185
186
  ...t.legend,
186
187
  position: "bottom",
@@ -188,7 +189,7 @@ const ft = Q(
188
189
  // to the chart's own text flow. For RTL we flip via `yaxis.opposite`
189
190
  // and ApexCharts' own `direction: 'rtl'` handling; legend stays anchored
190
191
  // to the inline-start by asking for 'left' on LTR and 'right' on RTL.
191
- horizontalAlign: C ? "right" : "left",
192
+ horizontalAlign: w ? "right" : "left",
192
193
  fontFamily: "inherit"
193
194
  },
194
195
  tooltip: {
@@ -201,12 +202,12 @@ const ft = Q(
201
202
  text: a("chart.noData")
202
203
  }
203
204
  };
204
- if (ht(o) && (e.xaxis = {
205
+ if (T && T.length > 0 && (e.colors = T), pt(o) && (e.xaxis = {
205
206
  ...t.xaxis,
206
- categories: v ?? []
207
+ categories: g ?? []
207
208
  }, e.yaxis = {
208
209
  ...t.yaxis,
209
- opposite: C,
210
+ opposite: w,
210
211
  labels: {
211
212
  formatter: (i) => f.format(i)
212
213
  }
@@ -223,17 +224,17 @@ const ft = Q(
223
224
  ...((n = i.radialBar) == null ? void 0 : n.dataLabels) ?? {},
224
225
  value: {
225
226
  ...((b = (s = i.radialBar) == null ? void 0 : s.dataLabels) == null ? void 0 : b.value) ?? {},
226
- formatter: (K) => m(Number(K))
227
+ formatter: (Q) => m(Number(Q))
227
228
  }
228
229
  }
229
230
  }
230
231
  };
231
232
  }
232
- return O ? e.fill = {
233
+ return A ? e.fill = {
233
234
  type: "pattern",
234
235
  opacity: o === "area" ? 0.3 : 1,
235
236
  pattern: {
236
- style: [...lt],
237
+ style: [...mt],
237
238
  strokeWidth: 2
238
239
  }
239
240
  } : o === "area" && (e.fill = {
@@ -241,69 +242,70 @@ const ft = Q(
241
242
  opacity: 0.3
242
243
  }), e;
243
244
  }, [
244
- N,
245
+ B,
245
246
  u,
246
- R,
247
- w,
248
- E,
247
+ S,
248
+ L,
249
+ P,
249
250
  h,
250
- g,
251
+ v,
251
252
  f,
252
253
  a,
253
254
  o,
254
- v,
255
- C,
256
- O,
255
+ g,
256
+ w,
257
+ A,
258
+ T,
257
259
  m
258
- ]), q = H ?? (z > 0 ? z : "100%"), V = L ?? 320, F = d(() => {
259
- const t = x(o) ? g ?? [] : v ?? [], e = B;
260
- return /* @__PURE__ */ T("table", { id: S, className: "ds:sr-only", children: [
260
+ ]), V = _ ?? (N > 0 ? N : "100%"), F = O ?? 320, J = d(() => {
261
+ const t = R(o) ? v ?? [] : g ?? [], e = E;
262
+ return /* @__PURE__ */ x("table", { id: y, className: "ds:sr-only", children: [
261
263
  /* @__PURE__ */ c("caption", { children: r }),
262
- /* @__PURE__ */ c("thead", { children: /* @__PURE__ */ T("tr", { children: [
264
+ /* @__PURE__ */ c("thead", { children: /* @__PURE__ */ x("tr", { children: [
263
265
  /* @__PURE__ */ c("th", { scope: "col", children: a("chart.table.series") }),
264
266
  t.map((n, s) => /* @__PURE__ */ c("th", { scope: "col", children: n }, `${n}-${s}`))
265
267
  ] }) }),
266
- /* @__PURE__ */ c("tbody", { children: e.map((n, s) => /* @__PURE__ */ T("tr", { children: [
268
+ /* @__PURE__ */ c("tbody", { children: e.map((n, s) => /* @__PURE__ */ x("tr", { children: [
267
269
  /* @__PURE__ */ c("th", { scope: "row", children: n.name || a("chart.table.value") }),
268
270
  n.data.map((b, i) => /* @__PURE__ */ c("td", { children: o === "radialBar" && m ? m(b) : f.format(b) }, `${s}-${i}`))
269
271
  ] }, `${n.name}-${s}`)) })
270
272
  ] });
271
273
  }, [
272
274
  o,
273
- B,
274
- g,
275
+ E,
275
276
  v,
276
- S,
277
+ g,
278
+ y,
277
279
  r,
278
280
  a,
279
281
  f,
280
282
  m
281
- ]), J = d(() => (x(o), p), [p, o]);
282
- return /* @__PURE__ */ T(
283
+ ]), K = d(() => (R(o), p), [p, o]);
284
+ return /* @__PURE__ */ x(
283
285
  "div",
284
286
  {
285
- ref: y,
287
+ ref: I,
286
288
  role: "img",
287
289
  "aria-label": r,
288
- "aria-describedby": S,
289
- className: dt({
290
+ "aria-describedby": y,
291
+ className: lt({
290
292
  // Explicit height wins over the density min-height unless the
291
293
  // caller also asked for a density explicitly.
292
- density: M ?? (L !== void 0 ? "none" : void 0),
293
- className: U
294
+ density: U ?? (O !== void 0 ? "none" : void 0),
295
+ className: D
294
296
  }),
295
297
  "data-component": "chart",
296
298
  "data-component-id": l,
297
299
  children: [
298
- F,
300
+ J,
299
301
  /* @__PURE__ */ c(
300
- rt,
302
+ nt,
301
303
  {
302
304
  type: o,
303
- series: J,
304
- options: j,
305
- width: q,
306
- height: V,
305
+ series: K,
306
+ options: q,
307
+ width: V,
308
+ height: F,
307
309
  "aria-hidden": "true"
308
310
  }
309
311
  )
@@ -312,10 +314,10 @@ const ft = Q(
312
314
  );
313
315
  }
314
316
  );
315
- ft.displayName = "Chart";
317
+ bt.displayName = "Chart";
316
318
  export {
317
- ft as C,
318
- dt as a,
319
- ct as c
319
+ bt as C,
320
+ lt as a,
321
+ dt as c
320
322
  };
321
- //# sourceMappingURL=chart-Cbt0_sKv.js.map
323
+ //# sourceMappingURL=chart-Cg3e9EH9.js.map
@@ -1,23 +1,24 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as F, useState as L, useMemo as x, useEffect as A } from "react";
3
- import { c as S } from "./index-D2ZczOXr.js";
4
- import { useTranslation as T } from "react-i18next";
5
- import { F as P } from "./form-field-BOm9hK35.js";
6
- import { D as W } from "./date-picker-CvQfs6Xh.js";
7
- import { N as $ } from "./number-input-Dj5L3pXK.js";
2
+ import { forwardRef as F, useState as L, useMemo as h, useEffect as H } from "react";
3
+ import { c as $ } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as A } from "react-i18next";
5
+ import { F as w } from "./form-field-BOm9hK35.js";
6
+ import { D as I } from "./date-picker-Bq7xhMA-.js";
7
+ import { N as S } from "./number-input-Dj5L3pXK.js";
8
+ import { C as P } from "./card-DPmk26CL.js";
8
9
  import { B as v } from "./badge-zsf5i5bH.js";
9
- import { I as H } from "./insert-result-DtQQeSSf.js";
10
- import { a as i } from "./react-day-picker-CdtIiKjx.js";
11
- import { C as I } from "./check-DPdL_Sm7.js";
12
- import { H as z } from "./heart-C0faivFf.js";
13
- import { c as k } from "./createLucideIcon-CrFbzy84.js";
10
+ import { I as k } from "./insert-result-CoC1oo6R.js";
11
+ import { a as s } from "./date-picker-variants-DLi1Va_e.js";
12
+ import { C as z } from "./check-DPdL_Sm7.js";
13
+ import { H as B } from "./heart-C0faivFf.js";
14
+ import { c as G } from "./createLucideIcon-CrFbzy84.js";
14
15
  /**
15
16
  * @license lucide-react v1.8.0 - ISC
16
17
  *
17
18
  * This source code is licensed under the ISC license.
18
19
  * See the LICENSE file in the root directory of this source tree.
19
20
  */
20
- const B = [
21
+ const Y = [
21
22
  [
22
23
  "path",
23
24
  {
@@ -25,77 +26,78 @@ const B = [
25
26
  key: "c7niix"
26
27
  }
27
28
  ]
28
- ], Y = k("droplet", B), h = 28, j = 14, M = 1;
29
- function U(n, c = 3) {
30
- const d = n.cycleLength ?? h, { lastPeriodStart: s } = n, o = i(s, d - j), u = {
31
- start: i(o, -5),
32
- end: i(o, M)
33
- }, f = i(s, d), p = Array.from(
29
+ ], j = G("droplet", Y), x = 28, M = 14, U = 1;
30
+ function K(n, c = 3) {
31
+ const d = n.cycleLength ?? x, { lastPeriodStart: i } = n, o = s(i, d - M), u = {
32
+ start: s(o, -5),
33
+ end: s(o, U)
34
+ }, f = s(i, d), p = Array.from(
34
35
  { length: c },
35
- (C, g) => i(s, d * (g + 1))
36
+ (C, g) => s(i, d * (g + 1))
36
37
  );
37
38
  return { nextPeriod: f, ovulation: o, fertileWindow: u, upcomingPeriods: p };
38
39
  }
39
- const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
40
+ const O = $("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
40
41
  variants: {
41
42
  width: { full: "ds:w-full", auto: "ds:inline-flex" }
42
43
  },
43
44
  defaultVariants: { width: "full" }
44
- }), V = F(
45
+ }), V = "--accent", q = F(
45
46
  ({
46
- defaultCycleLength: n = h,
47
+ defaultCycleLength: n = x,
47
48
  onResultChange: c,
48
49
  onInsert: d,
49
- insertVariant: s = "insert",
50
+ insertVariant: i = "insert",
50
51
  onCopy: o,
51
52
  onError: u,
52
- id: f,
53
- width: p,
54
- className: C
55
- }, g) => {
56
- const { t: a, i18n: N } = T(), [m, w] = L(void 0), [y, b] = L(
53
+ insertBrand: f,
54
+ id: p,
55
+ width: C,
56
+ className: g
57
+ }, b) => {
58
+ const { t: a, i18n: N } = A(), [m, D] = L(void 0), [y, E] = L(
57
59
  n
58
- ), t = x(() => m ? U({
60
+ ), t = h(() => m ? K({
59
61
  lastPeriodStart: m,
60
- cycleLength: y ?? h
61
- }) : null, [m, y]), D = x(
62
+ cycleLength: y ?? x
63
+ }) : null, [m, y]), T = h(
62
64
  () => new Intl.DateTimeFormat(N.language, { dateStyle: "medium" }),
63
65
  [N.language]
64
66
  );
65
- A(() => {
67
+ H(() => {
66
68
  c == null || c(t);
67
69
  }, [t, c]);
68
- const E = x(() => /* @__PURE__ */ new Date(), []), l = (_) => D.format(_);
70
+ const _ = h(() => /* @__PURE__ */ new Date(), []), l = (W) => T.format(W);
69
71
  return /* @__PURE__ */ r(
70
72
  "div",
71
73
  {
72
- ref: g,
74
+ ref: b,
73
75
  "data-component": "cycle-calculator",
74
- "data-component-id": f,
75
- className: G({ width: p, className: C }),
76
+ "data-component-id": p,
77
+ className: O({ width: C, className: g }),
76
78
  children: [
77
79
  /* @__PURE__ */ r("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
78
- /* @__PURE__ */ e(P, { label: a("cycleCalculator.lastPeriod"), children: /* @__PURE__ */ e(
79
- W,
80
+ /* @__PURE__ */ e(w, { label: a("cycleCalculator.lastPeriod"), children: /* @__PURE__ */ e(
81
+ I,
80
82
  {
81
83
  value: m,
82
- onChange: w,
83
- maxDate: E
84
+ onChange: D,
85
+ maxDate: _
84
86
  }
85
87
  ) }),
86
88
  /* @__PURE__ */ e(
87
- P,
89
+ w,
88
90
  {
89
91
  label: a("cycleCalculator.cycleLength"),
90
92
  description: a("cycleCalculator.cycleLengthHint"),
91
93
  children: /* @__PURE__ */ e(
92
- $,
94
+ S,
93
95
  {
94
96
  mode: "integer",
95
97
  min: 20,
96
98
  max: 45,
97
99
  value: y,
98
- onChange: b
100
+ onChange: E
99
101
  }
100
102
  )
101
103
  }
@@ -104,7 +106,7 @@ const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
104
106
  /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: t ? `${a("cycleCalculator.ovulation")}: ${l(t.ovulation)}. ${a(
105
107
  "cycleCalculator.nextPeriod"
106
108
  )}: ${l(t.nextPeriod)}.` : "" }),
107
- t ? /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
109
+ t ? /* @__PURE__ */ e(P, { variant: "elevated", children: /* @__PURE__ */ r(P.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
108
110
  /* @__PURE__ */ r("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
109
111
  /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
110
112
  /* @__PURE__ */ e("dt", { className: "type-label ds:text-muted-foreground", children: a("cycleCalculator.ovulation") }),
@@ -113,7 +115,7 @@ const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
113
115
  {
114
116
  variant: "success",
115
117
  size: "lg",
116
- leading: /* @__PURE__ */ e(I, { "aria-hidden": !0 }),
118
+ leading: /* @__PURE__ */ e(z, { "aria-hidden": !0 }),
117
119
  children: l(t.ovulation)
118
120
  }
119
121
  ) })
@@ -125,7 +127,7 @@ const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
125
127
  {
126
128
  variant: "accent",
127
129
  size: "lg",
128
- leading: /* @__PURE__ */ e(z, { "aria-hidden": !0 }),
130
+ leading: /* @__PURE__ */ e(B, { "aria-hidden": !0 }),
129
131
  children: [
130
132
  l(t.fertileWindow.start),
131
133
  " –",
@@ -142,21 +144,28 @@ const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
142
144
  {
143
145
  variant: "error",
144
146
  size: "lg",
145
- leading: /* @__PURE__ */ e(Y, { "aria-hidden": !0 }),
147
+ leading: /* @__PURE__ */ e(j, { "aria-hidden": !0 }),
146
148
  children: l(t.nextPeriod)
147
149
  }
148
150
  ) })
149
151
  ] })
150
152
  ] }),
151
- s === "copy" || d ? /* @__PURE__ */ e(
152
- H,
153
+ i === "copy" || d ? /* @__PURE__ */ e(
154
+ k,
153
155
  {
154
156
  onInsert: d,
155
- variant: s,
157
+ variant: i,
156
158
  onCopy: o,
157
159
  onError: u,
158
160
  card: {
159
161
  title: a("insert.title.cycle"),
162
+ highlight: `${l(t.fertileWindow.start)} – ${l(
163
+ t.fertileWindow.end
164
+ )}`,
165
+ // Chip reuses the on-screen fertile-window badge's accent
166
+ // token so the inserted PNG chip matches the screen.
167
+ highlightToken: V,
168
+ brand: f,
160
169
  fields: [
161
170
  {
162
171
  label: a("cycleCalculator.ovulation"),
@@ -176,16 +185,16 @@ const G = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
176
185
  }
177
186
  }
178
187
  ) : null
179
- ] }) : /* @__PURE__ */ e("p", { className: "type-body ds:text-muted-foreground", children: a("cycleCalculator.empty") })
188
+ ] }) }) : /* @__PURE__ */ e("p", { className: "type-body ds:text-muted-foreground", children: a("cycleCalculator.empty") })
180
189
  ]
181
190
  }
182
191
  );
183
192
  }
184
193
  );
185
- V.displayName = "CycleCalculator";
194
+ q.displayName = "CycleCalculator";
186
195
  export {
187
- V as C,
188
- j as L,
189
- U as p
196
+ q as C,
197
+ M as L,
198
+ K as p
190
199
  };
191
- //# sourceMappingURL=cycle-calculator-DsZbyzX6.js.map
200
+ //# sourceMappingURL=cycle-calculator-ChHBcjet.js.map