@jjlmoya/utils-babies 1.1.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 (82) hide show
  1. package/package.json +69 -0
  2. package/src/category/i18n/en.ts +48 -0
  3. package/src/category/i18n/es.ts +48 -0
  4. package/src/category/i18n/fr.ts +48 -0
  5. package/src/category/index.ts +24 -0
  6. package/src/category/seo.astro +15 -0
  7. package/src/components/PreviewNavSidebar.astro +116 -0
  8. package/src/components/PreviewToolbar.astro +143 -0
  9. package/src/data.ts +30 -0
  10. package/src/env.d.ts +5 -0
  11. package/src/index.ts +19 -0
  12. package/src/layouts/PreviewLayout.astro +117 -0
  13. package/src/pages/[locale]/[slug].astro +146 -0
  14. package/src/pages/[locale].astro +251 -0
  15. package/src/pages/index.astro +4 -0
  16. package/src/tests/faq_count.test.ts +19 -0
  17. package/src/tests/locale_completeness.test.ts +42 -0
  18. package/src/tests/mocks/astro_mock.js +2 -0
  19. package/src/tests/no_h1_in_components.test.ts +48 -0
  20. package/src/tests/seo_length.test.ts +23 -0
  21. package/src/tests/tool_validation.test.ts +17 -0
  22. package/src/tool/baby-feeding-calculator/bibliography.astro +7 -0
  23. package/src/tool/baby-feeding-calculator/component.astro +210 -0
  24. package/src/tool/baby-feeding-calculator/i18n/en.ts +162 -0
  25. package/src/tool/baby-feeding-calculator/i18n/es.ts +162 -0
  26. package/src/tool/baby-feeding-calculator/i18n/fr.ts +162 -0
  27. package/src/tool/baby-feeding-calculator/index.ts +47 -0
  28. package/src/tool/baby-feeding-calculator/logic.ts +85 -0
  29. package/src/tool/baby-feeding-calculator/seo.astro +58 -0
  30. package/src/tool/baby-feeding-calculator/style.css +329 -0
  31. package/src/tool/baby-percentile-calculator/bibliography.astro +7 -0
  32. package/src/tool/baby-percentile-calculator/component.astro +388 -0
  33. package/src/tool/baby-percentile-calculator/i18n/en.ts +244 -0
  34. package/src/tool/baby-percentile-calculator/i18n/es.ts +244 -0
  35. package/src/tool/baby-percentile-calculator/i18n/fr.ts +244 -0
  36. package/src/tool/baby-percentile-calculator/index.ts +54 -0
  37. package/src/tool/baby-percentile-calculator/lmsData.ts +80 -0
  38. package/src/tool/baby-percentile-calculator/logic.ts +85 -0
  39. package/src/tool/baby-percentile-calculator/seo.astro +36 -0
  40. package/src/tool/baby-percentile-calculator/style.css +393 -0
  41. package/src/tool/baby-size-converter/bibliography.astro +7 -0
  42. package/src/tool/baby-size-converter/component.astro +289 -0
  43. package/src/tool/baby-size-converter/data.json +11 -0
  44. package/src/tool/baby-size-converter/i18n/en.ts +203 -0
  45. package/src/tool/baby-size-converter/i18n/es.ts +203 -0
  46. package/src/tool/baby-size-converter/i18n/fr.ts +203 -0
  47. package/src/tool/baby-size-converter/index.ts +53 -0
  48. package/src/tool/baby-size-converter/logic.ts +44 -0
  49. package/src/tool/baby-size-converter/seo.astro +36 -0
  50. package/src/tool/baby-size-converter/style.css +394 -0
  51. package/src/tool/fertile-days-estimator/bibliography.astro +7 -0
  52. package/src/tool/fertile-days-estimator/component.astro +265 -0
  53. package/src/tool/fertile-days-estimator/i18n/en.ts +258 -0
  54. package/src/tool/fertile-days-estimator/i18n/es.ts +262 -0
  55. package/src/tool/fertile-days-estimator/i18n/fr.ts +258 -0
  56. package/src/tool/fertile-days-estimator/index.ts +47 -0
  57. package/src/tool/fertile-days-estimator/logic.ts +58 -0
  58. package/src/tool/fertile-days-estimator/seo.astro +36 -0
  59. package/src/tool/fertile-days-estimator/style.css +419 -0
  60. package/src/tool/pregnancy-calculator/bibliography.astro +7 -0
  61. package/src/tool/pregnancy-calculator/calculator.ts +41 -0
  62. package/src/tool/pregnancy-calculator/component.astro +432 -0
  63. package/src/tool/pregnancy-calculator/i18n/en.ts +315 -0
  64. package/src/tool/pregnancy-calculator/i18n/es.ts +319 -0
  65. package/src/tool/pregnancy-calculator/i18n/fr.ts +315 -0
  66. package/src/tool/pregnancy-calculator/index.ts +55 -0
  67. package/src/tool/pregnancy-calculator/milestones.ts +153 -0
  68. package/src/tool/pregnancy-calculator/seo.astro +36 -0
  69. package/src/tool/pregnancy-calculator/store.ts +60 -0
  70. package/src/tool/pregnancy-calculator/style.css +807 -0
  71. package/src/tool/vaccination-calendar/bibliography.astro +7 -0
  72. package/src/tool/vaccination-calendar/component.astro +286 -0
  73. package/src/tool/vaccination-calendar/i18n/en.ts +170 -0
  74. package/src/tool/vaccination-calendar/i18n/es.ts +174 -0
  75. package/src/tool/vaccination-calendar/i18n/fr.ts +170 -0
  76. package/src/tool/vaccination-calendar/index.ts +47 -0
  77. package/src/tool/vaccination-calendar/logic.ts +59 -0
  78. package/src/tool/vaccination-calendar/seo.astro +36 -0
  79. package/src/tool/vaccination-calendar/style.css +316 -0
  80. package/src/tool/vaccination-calendar/vaccinationData.ts +21 -0
  81. package/src/tools.ts +17 -0
  82. package/src/types.ts +72 -0
@@ -0,0 +1,210 @@
1
+ ---
2
+ import './style.css';
3
+ import type { BabyFeedingCalculatorUI } from './index';
4
+ interface Props { ui: BabyFeedingCalculatorUI; }
5
+ const { ui } = Astro.props;
6
+ ---
7
+ <div id="baby-feeding-calculator-root" class="baby-feeding-calculator" data-ui={JSON.stringify(ui)}>
8
+ <div class="baby-feeding-calculator-card">
9
+ <div class="baby-feeding-calculator-card-main">
10
+ <div class="baby-feeding-calculator-card-left">
11
+ <div class="baby-feeding-calculator-section-marker">{ui.labelConfig}</div>
12
+
13
+ <div class="baby-feeding-calculator-input-group">
14
+ <div class="baby-feeding-calculator-input-label">Edad del bebé</div>
15
+ <div class="baby-feeding-calculator-unit-nav">
16
+ <button class="baby-feeding-calculator-unit-tab active" data-unit="days">{ui.unitDays}</button>
17
+ <button class="baby-feeding-calculator-unit-tab" data-unit="weeks">{ui.unitWeeks}</button>
18
+ <button class="baby-feeding-calculator-unit-tab" data-unit="months">{ui.unitMonths}</button>
19
+ </div>
20
+ <div class="baby-feeding-calculator-stepper-box">
21
+ <button class="baby-feeding-calculator-btn-step" id="bfc-age-dec" aria-label="Reducir edad">−</button>
22
+ <div class="baby-feeding-calculator-val-view">
23
+ <span class="baby-feeding-calculator-val-big" id="bfc-age-val">7</span>
24
+ <span class="baby-feeding-calculator-val-sub" id="bfc-age-unit">{ui.unitDays}</span>
25
+ </div>
26
+ <button class="baby-feeding-calculator-btn-step" id="bfc-age-inc" aria-label="Aumentar edad">+</button>
27
+ </div>
28
+ <input class="baby-feeding-calculator-slider-line" type="range" id="bfc-age-slider" min="0" max="30" value="7" />
29
+ </div>
30
+
31
+ <div class="baby-feeding-calculator-input-group">
32
+ <div class="baby-feeding-calculator-input-label">{ui.labelWeight}</div>
33
+ <div class="baby-feeding-calculator-stepper-box">
34
+ <button class="baby-feeding-calculator-btn-step" id="bfc-weight-dec" aria-label="Reducir peso">−</button>
35
+ <div class="baby-feeding-calculator-val-view">
36
+ <span class="baby-feeding-calculator-val-big" id="bfc-weight-val">3.5</span>
37
+ <span class="baby-feeding-calculator-val-sub">kg</span>
38
+ </div>
39
+ <button class="baby-feeding-calculator-btn-step" id="bfc-weight-inc" aria-label="Aumentar peso">+</button>
40
+ </div>
41
+ <input class="baby-feeding-calculator-slider-line" type="range" id="bfc-weight-slider" min="1" max="15" step="0.1" value="3.5" />
42
+ </div>
43
+
44
+ <div class="baby-feeding-calculator-input-group">
45
+ <div class="baby-feeding-calculator-input-label">{ui.labelFeedType}</div>
46
+ <div class="baby-feeding-calculator-type-rack">
47
+ <button class="baby-feeding-calculator-type-tile active" data-type="breast">{ui.feedBreast}</button>
48
+ <button class="baby-feeding-calculator-type-tile" data-type="mixed">{ui.feedMixed}</button>
49
+ <button class="baby-feeding-calculator-type-tile" data-type="formula">{ui.feedFormula}</button>
50
+ </div>
51
+ </div>
52
+
53
+ <div class="baby-feeding-calculator-gauge-area">
54
+ <div class="baby-feeding-calculator-gauge-viz">
55
+ <div class="baby-feeding-calculator-stomach-bubble" id="bfc-stomach-bubble">
56
+ <span class="baby-feeding-calculator-visual-hint" id="bfc-stomach-hint">Huevo</span>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="baby-feeding-calculator-card-right">
63
+ <div class="baby-feeding-calculator-section-marker">{ui.labelPlan}</div>
64
+
65
+ <div class="baby-feeding-calculator-res-card-box baby-feeding-calculator-res-free-demand">
66
+ <div class="baby-feeding-calculator-res-label">{ui.labelFreeDemand}</div>
67
+ <div class="baby-feeding-calculator-res-main-val" id="bfc-res-demand">Libre demanda</div>
68
+ </div>
69
+
70
+ <div class="baby-feeding-calculator-stats-grid">
71
+ <div class="baby-feeding-calculator-stat-item">
72
+ <div class="baby-feeding-calculator-stat-value" id="bfc-stat-feeds">8</div>
73
+ <div class="baby-feeding-calculator-stat-label">{ui.labelFeedsCount}</div>
74
+ </div>
75
+ <div class="baby-feeding-calculator-stat-item">
76
+ <div class="baby-feeding-calculator-stat-value" id="bfc-stat-per-feed">30–60 ml</div>
77
+ <div class="baby-feeding-calculator-stat-label">{ui.labelMlPerFeed}</div>
78
+ </div>
79
+ <div class="baby-feeding-calculator-stat-item">
80
+ <div class="baby-feeding-calculator-stat-value" id="bfc-stat-daily">360–480 ml</div>
81
+ <div class="baby-feeding-calculator-stat-label">{ui.labelDailyTotal}</div>
82
+ </div>
83
+ </div>
84
+
85
+ <div class="baby-feeding-calculator-behavior-sec">
86
+ <div class="baby-feeding-calculator-input-label">{ui.labelHunger}</div>
87
+ <div class="baby-feeding-calculator-pills-container" id="bfc-hunger-pills">
88
+ <span class="baby-feeding-calculator-pill baby-feeding-calculator-pill-hambre">Busca el pecho</span>
89
+ <span class="baby-feeding-calculator-pill baby-feeding-calculator-pill-hambre">Llanto</span>
90
+ <span class="baby-feeding-calculator-pill baby-feeding-calculator-pill-hambre">Chupa los puños</span>
91
+ <span class="baby-feeding-calculator-pill baby-feeding-calculator-pill-hambre">Movimientos de succión</span>
92
+ </div>
93
+ </div>
94
+
95
+ <div class="baby-feeding-calculator-behavior-sec">
96
+ <div class="baby-feeding-calculator-input-label">{ui.labelFullness}</div>
97
+ <div class="baby-feeding-calculator-pills-container" id="bfc-fullness-pills">
98
+ <span class="baby-feeding-calculator-pill baby-feeding-calculator-pill-saciedad">Suelta el pecho</span>
99
+ <span class="baby-feeding-calculator-pill baby-feeding-calculator-pill-saciedad">Se queda dormido</span>
100
+ <span class="baby-feeding-calculator-pill baby-feeding-calculator-pill-saciedad">Manos relajadas</span>
101
+ <span class="baby-feeding-calculator-pill baby-feeding-calculator-pill-saciedad">Cara relajada</span>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ </div>
107
+ </div>
108
+
109
+ <script>
110
+ import { toAgeInDays, calculateFeeding } from './logic';
111
+ import type { AgeUnit, FeedType } from './logic';
112
+
113
+ const root = document.getElementById('baby-feeding-calculator-root') as HTMLElement;
114
+ const ui = JSON.parse(root.dataset.ui as string) as Record<string, string>;
115
+
116
+ let ageValue = 7;
117
+ let ageUnit: AgeUnit = 'days';
118
+ let weight = 3.5;
119
+ let feedType: FeedType = 'breast';
120
+
121
+ const ageSlider = root.querySelector('#bfc-age-slider') as HTMLInputElement;
122
+ const ageValEl = root.querySelector('#bfc-age-val') as HTMLElement;
123
+ const ageUnitEl = root.querySelector('#bfc-age-unit') as HTMLElement;
124
+ const weightSlider = root.querySelector('#bfc-weight-slider') as HTMLInputElement;
125
+ const weightValEl = root.querySelector('#bfc-weight-val') as HTMLElement;
126
+ const stomachBubble = root.querySelector('#bfc-stomach-bubble') as HTMLElement;
127
+ const stomachHint = root.querySelector('#bfc-stomach-hint') as HTMLElement;
128
+ const statFeeds = root.querySelector('#bfc-stat-feeds') as HTMLElement;
129
+ const statPerFeed = root.querySelector('#bfc-stat-per-feed') as HTMLElement;
130
+ const statDaily = root.querySelector('#bfc-stat-daily') as HTMLElement;
131
+
132
+ const AGE_LIMITS: Record<AgeUnit, { min: number; max: number }> = {
133
+ days: { min: 0, max: 30 },
134
+ weeks: { min: 0, max: 52 },
135
+ months: { min: 0, max: 24 },
136
+ };
137
+
138
+ function getUnitLabel(unit: AgeUnit): string {
139
+ if (unit === 'days') return ui['unitDays'] ?? '';
140
+ if (unit === 'weeks') return ui['unitWeeks'] ?? '';
141
+ return ui['unitMonths'] ?? '';
142
+ }
143
+
144
+ function updateDisplay(): void {
145
+ root.dataset['feedType'] = feedType;
146
+ const ageInDays = toAgeInDays(ageValue, ageUnit);
147
+ const result = calculateFeeding(ageInDays, weight);
148
+
149
+ stomachBubble.style.transform = `scale(${result.scale})`;
150
+ stomachHint.textContent = result.hint;
151
+
152
+ statFeeds.textContent = String(result.numFeeds);
153
+ statPerFeed.textContent = `${result.perFeedMin}–${result.perFeedMax} ml`;
154
+ statDaily.textContent = `${result.totalMin}–${result.totalMax} ml`;
155
+
156
+ const limits = AGE_LIMITS[ageUnit];
157
+ ageSlider.min = String(limits.min);
158
+ ageSlider.max = String(limits.max);
159
+ ageSlider.value = String(ageValue);
160
+ ageValEl.textContent = String(ageValue);
161
+ ageUnitEl.textContent = getUnitLabel(ageUnit);
162
+ weightValEl.textContent = weight.toFixed(1);
163
+ weightSlider.value = String(weight);
164
+ }
165
+
166
+ root.querySelectorAll('.baby-feeding-calculator-unit-tab').forEach((btn) => {
167
+ btn.addEventListener('click', () => {
168
+ ageUnit = (btn as HTMLElement).dataset.unit as AgeUnit;
169
+ ageValue = AGE_LIMITS[ageUnit].min;
170
+ root.querySelectorAll('.baby-feeding-calculator-unit-tab').forEach((b) => b.classList.remove('active'));
171
+ btn.classList.add('active');
172
+ updateDisplay();
173
+ });
174
+ });
175
+
176
+ root.querySelectorAll('.baby-feeding-calculator-type-tile').forEach((btn) => {
177
+ btn.addEventListener('click', () => {
178
+ feedType = (btn as HTMLElement).dataset.type as FeedType;
179
+ root.querySelectorAll('.baby-feeding-calculator-type-tile').forEach((b) => b.classList.remove('active'));
180
+ btn.classList.add('active');
181
+ updateDisplay();
182
+ });
183
+ });
184
+
185
+ root.querySelector('#bfc-age-dec')?.addEventListener('click', () => {
186
+ const limits = AGE_LIMITS[ageUnit];
187
+ if (ageValue > limits.min) { ageValue -= 1; updateDisplay(); }
188
+ });
189
+ root.querySelector('#bfc-age-inc')?.addEventListener('click', () => {
190
+ const limits = AGE_LIMITS[ageUnit];
191
+ if (ageValue < limits.max) { ageValue += 1; updateDisplay(); }
192
+ });
193
+ ageSlider.addEventListener('input', () => {
194
+ ageValue = Number(ageSlider.value);
195
+ updateDisplay();
196
+ });
197
+
198
+ root.querySelector('#bfc-weight-dec')?.addEventListener('click', () => {
199
+ if (weight > 1) { weight = Math.round((weight - 0.1) * 10) / 10; updateDisplay(); }
200
+ });
201
+ root.querySelector('#bfc-weight-inc')?.addEventListener('click', () => {
202
+ if (weight < 15) { weight = Math.round((weight + 0.1) * 10) / 10; updateDisplay(); }
203
+ });
204
+ weightSlider.addEventListener('input', () => {
205
+ weight = Number(weightSlider.value);
206
+ updateDisplay();
207
+ });
208
+
209
+ updateDisplay();
210
+ </script>
@@ -0,0 +1,162 @@
1
+ import type { BabyFeedingCalculatorLocaleContent } from '../index';
2
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
3
+
4
+ const slug = 'baby-feeding-calculator';
5
+ const title = 'Baby Feeding Calculator';
6
+ const description = 'Calculate how much milk your baby needs based on weight and age. Recommended feeds, milliliters per feed, and hunger and fullness cues.';
7
+
8
+ const faq = [
9
+ {
10
+ question: 'How much milk does a newborn need?',
11
+ answer: 'On day one, a newborn\'s stomach is the size of a cherry and needs only 5–7 ml per feed. By day five, capacity grows to 45–60 ml and needs increase progressively.',
12
+ },
13
+ {
14
+ question: 'How often should a baby eat?',
15
+ answer: 'Newborns need 8–12 feeds per day. By 3 months this typically spaces out to 7–8 feeds, and by 6 months around 5 feeds daily.',
16
+ },
17
+ {
18
+ question: 'How do I know if my baby is eating enough?',
19
+ answer: 'The most reliable indicators are: adequate weight gain, at least 5–6 wet diapers per day, and the baby showing fullness cues after feeds.',
20
+ },
21
+ {
22
+ question: 'Are breastfeeding and formula amounts the same?',
23
+ answer: 'With breastfeeding, on-demand feeding without measuring volumes is recommended. With formula, the common reference is 150 ml per kg of body weight per day, distributed across the number of feeds appropriate for the baby\'s age.',
24
+ },
25
+ ];
26
+
27
+ const howTo = [
28
+ {
29
+ name: 'Select the baby\'s age',
30
+ text: 'Choose the unit (days, weeks, or months) and adjust the value with the slider or buttons.',
31
+ },
32
+ {
33
+ name: 'Enter the baby\'s weight',
34
+ text: 'Use the weight slider or buttons to adjust the baby\'s current weight in kilograms.',
35
+ },
36
+ {
37
+ name: 'Select the feed type',
38
+ text: 'Choose between breast, mixed, or formula to get the most tailored guide.',
39
+ },
40
+ {
41
+ name: 'Review the recommended plan',
42
+ text: 'The calculator shows number of feeds, milliliters per feed, and estimated daily total.',
43
+ },
44
+ ];
45
+
46
+ const faqSchema: WithContext<FAQPage> = {
47
+ '@context': 'https://schema.org',
48
+ '@type': 'FAQPage',
49
+ mainEntity: faq.map((item) => ({
50
+ '@type': 'Question',
51
+ name: item.question,
52
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
53
+ })),
54
+ };
55
+
56
+ const howToSchema: WithContext<HowTo> = {
57
+ '@context': 'https://schema.org',
58
+ '@type': 'HowTo',
59
+ name: title,
60
+ description,
61
+ step: howTo.map((step) => ({
62
+ '@type': 'HowToStep',
63
+ name: step.name,
64
+ text: step.text,
65
+ })),
66
+ };
67
+
68
+ const appSchema: WithContext<SoftwareApplication> = {
69
+ '@context': 'https://schema.org',
70
+ '@type': 'SoftwareApplication',
71
+ name: title,
72
+ description,
73
+ applicationCategory: 'UtilitiesApplication',
74
+ operatingSystem: 'Web',
75
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
76
+ inLanguage: 'en',
77
+ };
78
+
79
+ export const content: BabyFeedingCalculatorLocaleContent = {
80
+ slug,
81
+ title,
82
+ description,
83
+ ui: {
84
+ labelConfig: 'Current settings',
85
+ labelPlan: 'Recommended plan',
86
+ unitDays: 'days',
87
+ unitWeeks: 'weeks',
88
+ unitMonths: 'months',
89
+ labelWeight: 'Baby weight',
90
+ labelFeedType: 'Feed type',
91
+ feedBreast: 'Breast',
92
+ feedMixed: 'Mixed',
93
+ feedFormula: 'Formula',
94
+ labelFreeDemand: 'On demand',
95
+ labelMlPerFeed: 'ml per feed',
96
+ labelFeedsCount: 'Feeds / 24h',
97
+ labelDailyTotal: 'Daily total (est.)',
98
+ labelHunger: 'Hunger cues',
99
+ labelFullness: 'Fullness cues',
100
+ faqTitle: 'Frequently asked questions',
101
+ bibliographyTitle: 'References',
102
+ },
103
+ seo: [
104
+ { type: 'summary', title: 'Summary: Baby feeding', items: [
105
+ 'A newborn\'s stomach capacity is only 5–7 ml on day one.',
106
+ 'The general formula reference is 150 ml per kg of body weight per day.',
107
+ 'Breastfeeding is offered on demand without fixed volumes.',
108
+ 'Feed frequency decreases with age: from 8–12 feeds to 4–5 by 6 months.',
109
+ ]},
110
+ { type: 'title', text: 'How much milk does my baby need by weight and age?', level: 2 },
111
+ { type: 'paragraph', html: 'Milk needs change rapidly in the first months. The calculator estimates the amount based on current weight and age, following WHO and AAP paediatric guidelines.' },
112
+ { type: 'stats', columns: 3, items: [
113
+ { value: '5–7 ml', label: 'Day 1 (cherry size)' },
114
+ { value: '150 ml/kg', label: 'Daily formula reference' },
115
+ { value: '8–12', label: 'Feeds/day newborn' },
116
+ ]},
117
+ { type: 'title', text: 'Stomach size by age', level: 3 },
118
+ { type: 'table', headers: ['Age', 'Size ref.', 'Capacity', 'Feeds/day'], rows: [
119
+ ['Day 1', 'Cherry', '5–7 ml', '8–12'],
120
+ ['Days 2–4', 'Walnut', '22–27 ml', '8–12'],
121
+ ['Days 5–30', 'Egg', '45–60 ml', '8–10'],
122
+ ['1–3 months', 'Full', '90–120 ml', '7–8'],
123
+ ['3–6 months', 'Full', '120–150 ml', '5–6'],
124
+ ['6+ months', 'Full', '150–180 ml', '4–5'],
125
+ ]},
126
+ { type: 'tip', html: 'A reliable sign of adequate feeding is wet nappy count: 5–6 heavy nappies per day from day five indicate good hydration.' },
127
+ { type: 'title', text: 'Breastfeeding vs formula', level: 3 },
128
+ { type: 'comparative', columns: 2, items: [
129
+ { title: 'Breastfeeding', description: 'Natural on-demand feeding.', points: ['No fixed schedule', 'Active antibodies', 'Variable composition', 'Hard to quantify'] },
130
+ { title: 'Formula', description: 'Scheduled feeds with measurable volume.', points: ['Every 3–4 hours', 'Stable composition', 'Easy to track intake', 'Requires sterile preparation'] },
131
+ ]},
132
+ { type: 'list', items: [
133
+ 'Adequate weight gain: 150–200 g/week in the first month',
134
+ 'At least 5–6 wet nappies per day',
135
+ 'Baby is calm after feeds',
136
+ 'Urine is clear or very pale yellow',
137
+ ]},
138
+ ],
139
+ faqTitle: "Frequently asked questions",
140
+ faq,
141
+ bibliographyTitle: "References",
142
+ bibliography: [
143
+ {
144
+ name: 'WHO - Infant and young child feeding',
145
+ url: 'https://www.who.int/health-topics/infant-feeding',
146
+ },
147
+ {
148
+ name: 'American Academy of Pediatrics - Breastfeeding Guidelines',
149
+ url: 'https://www.aap.org/en/patient-care/breastfeeding/',
150
+ },
151
+ {
152
+ name: 'La Leche League International',
153
+ url: 'https://www.llli.org',
154
+ },
155
+ {
156
+ name: 'UNICEF - Breastfeeding',
157
+ url: 'https://www.unicef.org/nutrition/index_24824.html',
158
+ },
159
+ ],
160
+ howTo,
161
+ schemas: [faqSchema as any, howToSchema as any, appSchema],
162
+ };
@@ -0,0 +1,162 @@
1
+ import type { BabyFeedingCalculatorLocaleContent } from '../index';
2
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
3
+
4
+ const slug = 'calculadora-tomas-bebe';
5
+ const title = 'Calculadora de Tomas del Bebé';
6
+ const description = 'Calcula cuánta leche necesita tu bebé según su peso y edad. Tomas recomendadas, mililitros por toma y señales de hambre y saciedad.';
7
+
8
+ const faq = [
9
+ {
10
+ question: '¿Cuánta leche necesita un recién nacido?',
11
+ answer: 'En el primer día de vida, el estómago del bebé tiene el tamaño de una cereza y solo necesita entre 5 y 7 ml por toma. A partir del quinto día la capacidad crece hasta los 45–60 ml y las necesidades aumentan progresivamente.',
12
+ },
13
+ {
14
+ question: '¿Con qué frecuencia debe comer un bebé?',
15
+ answer: 'Los recién nacidos necesitan entre 8 y 12 tomas al día. A los 3 meses suelen espaciarse a 7–8 tomas, y a los 6 meses a unas 5 tomas diarias.',
16
+ },
17
+ {
18
+ question: '¿Cómo sé si mi bebé está comiendo suficiente?',
19
+ answer: 'Los indicadores más fiables son: ganancia de peso adecuada, al menos 5–6 pañales mojados al día y que el bebé muestre señales de saciedad tras las tomas.',
20
+ },
21
+ {
22
+ question: '¿La lactancia materna y la fórmula tienen las mismas cantidades?',
23
+ answer: 'Con lactancia materna se recomienda alimentar a libre demanda sin medir volúmenes. Con fórmula, la referencia habitual es 150 ml por kg de peso al día, distribuidos en el número de tomas según la edad.',
24
+ },
25
+ ];
26
+
27
+ const howTo = [
28
+ {
29
+ name: 'Selecciona la edad del bebé',
30
+ text: 'Elige la unidad (días, semanas o meses) y ajusta el valor con el slider o los botones.',
31
+ },
32
+ {
33
+ name: 'Introduce el peso del bebé',
34
+ text: 'Usa el slider de peso o los botones para ajustar el peso actual del bebé en kilogramos.',
35
+ },
36
+ {
37
+ name: 'Selecciona el tipo de alimentación',
38
+ text: 'Elige entre pecho, mixta o fórmula para obtener la guía más adaptada.',
39
+ },
40
+ {
41
+ name: 'Consulta el plan recomendado',
42
+ text: 'La calculadora muestra el número de tomas, mililitros por toma y el total diario estimado.',
43
+ },
44
+ ];
45
+
46
+ const faqSchema: WithContext<FAQPage> = {
47
+ '@context': 'https://schema.org',
48
+ '@type': 'FAQPage',
49
+ mainEntity: faq.map((item) => ({
50
+ '@type': 'Question',
51
+ name: item.question,
52
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
53
+ })),
54
+ };
55
+
56
+ const howToSchema: WithContext<HowTo> = {
57
+ '@context': 'https://schema.org',
58
+ '@type': 'HowTo',
59
+ name: title,
60
+ description,
61
+ step: howTo.map((step) => ({
62
+ '@type': 'HowToStep',
63
+ name: step.name,
64
+ text: step.text,
65
+ })),
66
+ };
67
+
68
+ const appSchema: WithContext<SoftwareApplication> = {
69
+ '@context': 'https://schema.org',
70
+ '@type': 'SoftwareApplication',
71
+ name: title,
72
+ description,
73
+ applicationCategory: 'UtilitiesApplication',
74
+ operatingSystem: 'Web',
75
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
76
+ inLanguage: 'es',
77
+ };
78
+
79
+ export const content: BabyFeedingCalculatorLocaleContent = {
80
+ slug,
81
+ title,
82
+ description,
83
+ ui: {
84
+ labelConfig: 'Configuración actual',
85
+ labelPlan: 'Plan recomendado',
86
+ unitDays: 'días',
87
+ unitWeeks: 'semanas',
88
+ unitMonths: 'meses',
89
+ labelWeight: 'Peso del bebé',
90
+ labelFeedType: 'Tipo de alimentación',
91
+ feedBreast: 'Pecho',
92
+ feedMixed: 'Mixta',
93
+ feedFormula: 'Fórmula',
94
+ labelFreeDemand: 'Libre demanda',
95
+ labelMlPerFeed: 'ml por cada toma',
96
+ labelFeedsCount: 'Tomas / 24h',
97
+ labelDailyTotal: 'Total diario (est.)',
98
+ labelHunger: 'Señales de hambre',
99
+ labelFullness: 'Señales de saciedad',
100
+ faqTitle: 'Preguntas frecuentes',
101
+ bibliographyTitle: 'Referencias',
102
+ },
103
+ seo: [
104
+ { type: 'summary', title: 'Resumen: Alimentación del bebé', items: [
105
+ 'La capacidad gástrica del recién nacido es de apenas 5–7 ml en el primer día.',
106
+ 'La referencia general para fórmula es 150 ml por kg de peso al día.',
107
+ 'La lactancia materna se ofrece a libre demanda sin volúmenes fijos.',
108
+ 'La frecuencia disminuye con la edad: de 8–12 tomas a 4–5 en 6 meses.',
109
+ ]},
110
+ { type: 'title', text: '¿Cuánta leche necesita mi bebé según su peso y edad?', level: 2 },
111
+ { type: 'paragraph', html: 'Las necesidades de leche cambian rápidamente en los primeros meses. La calculadora estima la cantidad según el peso actual y la edad del bebé, siguiendo las pautas pediátricas de la OMS y la AAP.' },
112
+ { type: 'stats', columns: 3, items: [
113
+ { value: '5–7 ml', label: 'Día 1 (tamaño cereza)' },
114
+ { value: '150 ml/kg', label: 'Referencia diaria fórmula' },
115
+ { value: '8–12', label: 'Tomas/día recién nacido' },
116
+ ]},
117
+ { type: 'title', text: 'Tamaño del estómago por edad', level: 3 },
118
+ { type: 'table', headers: ['Edad', 'Tamaño ref.', 'Capacidad', 'Tomas/día'], rows: [
119
+ ['Día 1', 'Cereza', '5–7 ml', '8–12'],
120
+ ['Días 2–4', 'Nuez', '22–27 ml', '8–12'],
121
+ ['Días 5–30', 'Huevo', '45–60 ml', '8–10'],
122
+ ['1–3 meses', 'Máxima', '90–120 ml', '7–8'],
123
+ ['3–6 meses', 'Máxima', '120–150 ml', '5–6'],
124
+ ['6+ meses', 'Máxima', '150–180 ml', '4–5'],
125
+ ]},
126
+ { type: 'tip', html: 'Un indicador fiable de alimentación adecuada es el número de pañales mojados: entre 5 y 6 al día a partir del quinto día indican buena hidratación.' },
127
+ { type: 'title', text: 'Lactancia materna vs fórmula', level: 3 },
128
+ { type: 'comparative', columns: 2, items: [
129
+ { title: 'Lactancia materna', description: 'Alimentación natural a libre demanda.', points: ['Sin horario fijo', 'Anticuerpos activos', 'Composición variable', 'Difícil cuantificar'] },
130
+ { title: 'Leche de fórmula', description: 'Tomas programadas con volumen calculable.', points: ['Cada 3–4 horas', 'Composición estable', 'Fácil controlar ingesta', 'Requiere preparación estéril'] },
131
+ ]},
132
+ { type: 'list', items: [
133
+ 'Ganancia de peso adecuada: 150–200 g/semana en el primer mes',
134
+ 'Al menos 5–6 pañales mojados al día',
135
+ 'El bebé se muestra tranquilo tras las tomas',
136
+ 'Orina clara o amarillo muy pálido',
137
+ ]},
138
+ ],
139
+ faqTitle: "Preguntas frecuentes",
140
+ faq,
141
+ bibliographyTitle: "Referencias",
142
+ bibliography: [
143
+ {
144
+ name: 'OMS - Alimentación del lactante y del niño pequeño',
145
+ url: 'https://www.who.int/es/health-topics/infant-feeding',
146
+ },
147
+ {
148
+ name: 'American Academy of Pediatrics - Breastfeeding Guidelines',
149
+ url: 'https://www.aap.org/en/patient-care/breastfeeding/',
150
+ },
151
+ {
152
+ name: 'La Liga de la Leche Internacional',
153
+ url: 'https://www.llli.org',
154
+ },
155
+ {
156
+ name: 'Asociación Española de Pediatría - Lactancia materna',
157
+ url: 'https://www.aeped.es/comite-lactancia-materna',
158
+ },
159
+ ],
160
+ howTo,
161
+ schemas: [faqSchema as any, howToSchema as any, appSchema],
162
+ };