@jjlmoya/utils-babies 1.11.0 → 1.13.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 (29) hide show
  1. package/package.json +7 -4
  2. package/scripts/postinstall.mjs +27 -0
  3. package/src/category/index.ts +6 -6
  4. package/src/entries.ts +20 -0
  5. package/src/tool/baby-feeding-calculator/baby-feeding-calculator.css +402 -0
  6. package/src/tool/baby-feeding-calculator/component.astro +0 -404
  7. package/src/tool/baby-feeding-calculator/entry.ts +47 -0
  8. package/src/tool/baby-feeding-calculator/index.ts +2 -49
  9. package/src/tool/baby-percentile-calculator/baby-weight-height-percentile.css +451 -0
  10. package/src/tool/baby-percentile-calculator/component.astro +0 -453
  11. package/src/tool/baby-percentile-calculator/entry.ts +55 -0
  12. package/src/tool/baby-percentile-calculator/index.ts +2 -57
  13. package/src/tool/baby-size-converter/baby-size-converter.css +553 -0
  14. package/src/tool/baby-size-converter/component.astro +0 -555
  15. package/src/tool/baby-size-converter/entry.ts +53 -0
  16. package/src/tool/baby-size-converter/index.ts +2 -55
  17. package/src/tool/fertile-days-estimator/component.astro +0 -551
  18. package/src/tool/fertile-days-estimator/entry.ts +47 -0
  19. package/src/tool/fertile-days-estimator/fertile-days-calculator.css +549 -0
  20. package/src/tool/fertile-days-estimator/index.ts +2 -49
  21. package/src/tool/pregnancy-calculator/component.astro +0 -1054
  22. package/src/tool/pregnancy-calculator/entry.ts +87 -0
  23. package/src/tool/pregnancy-calculator/index.ts +2 -89
  24. package/src/tool/pregnancy-calculator/pregnancy-weeks-calculator.css +1053 -0
  25. package/src/tool/vaccination-calendar/baby-vaccination-calendar-spain.css +396 -0
  26. package/src/tool/vaccination-calendar/component.astro +0 -398
  27. package/src/tool/vaccination-calendar/entry.ts +67 -0
  28. package/src/tool/vaccination-calendar/index.ts +2 -69
  29. package/src/tools.ts +1 -1
package/package.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-babies",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
7
7
  "exports": {
8
8
  ".": "./src/index.ts",
9
- "./data": "./src/data.ts"
9
+ "./data": "./src/data.ts",
10
+ "./entries": "./src/entries.ts"
10
11
  },
11
12
  "files": [
12
- "src"
13
+ "src",
14
+ "scripts"
13
15
  ],
14
16
  "publishConfig": {
15
17
  "access": "public"
@@ -28,7 +30,8 @@
28
30
  "postversion": "git push && git push --tags",
29
31
  "patch": "npm version patch",
30
32
  "minor": "npm version minor",
31
- "major": "npm version major"
33
+ "major": "npm version major",
34
+ "postinstall": "node scripts/postinstall.mjs"
32
35
  },
33
36
  "lint-staged": {
34
37
  "*.{ts,tsx,astro}": [
@@ -0,0 +1,27 @@
1
+ import { readFileSync, writeFileSync, mkdirSync, readdirSync } from 'fs';
2
+ import { join, dirname } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ const libDir = dirname(fileURLToPath(import.meta.url));
6
+ const toolsDir = join(libDir, '../src/tool');
7
+
8
+ const inNodeModules = libDir.includes('node_modules');
9
+ if (!inNodeModules) process.exit(0);
10
+
11
+ const projectRoot = join(libDir, '../../../..');
12
+ const categoryKey = JSON.parse(readFileSync(join(libDir, '../package.json'), 'utf8')).name.replace('@jjlmoya/utils-', '');
13
+ const destDir = join(projectRoot, `public/styles/lib/${categoryKey}`);
14
+
15
+ mkdirSync(destDir, { recursive: true });
16
+
17
+ const tools = readdirSync(toolsDir, { withFileTypes: true }).filter(d => d.isDirectory());
18
+ for (const tool of tools) {
19
+ const toolDir = join(toolsDir, tool.name);
20
+ let files;
21
+ try { files = readdirSync(toolDir).filter(f => f.endsWith('.css')); }
22
+ catch { continue; }
23
+ for (const file of files) {
24
+ writeFileSync(join(destDir, file), readFileSync(join(toolDir, file)));
25
+ console.log(`[@jjlmoya/utils-${categoryKey}] copied ${file}`);
26
+ }
27
+ }
@@ -1,10 +1,10 @@
1
1
  import type { BabiesCategoryEntry } from '../types';
2
- import { babyFeedingCalculator } from '../tool/baby-feeding-calculator';
3
- import { babySizeConverter } from '../tool/baby-size-converter';
4
- import { vaccinationCalendar } from '../tool/vaccination-calendar';
5
- import { fertileDaysEstimator } from '../tool/fertile-days-estimator';
6
- import { babyPercentileCalculator } from '../tool/baby-percentile-calculator';
7
- import { pregnancyCalculator } from '../tool/pregnancy-calculator';
2
+ import { babyFeedingCalculator } from '../tool/baby-feeding-calculator/entry';
3
+ import { babySizeConverter } from '../tool/baby-size-converter/entry';
4
+ import { vaccinationCalendar } from '../tool/vaccination-calendar/entry';
5
+ import { fertileDaysEstimator } from '../tool/fertile-days-estimator/entry';
6
+ import { babyPercentileCalculator } from '../tool/baby-percentile-calculator/entry';
7
+ import { pregnancyCalculator } from '../tool/pregnancy-calculator/entry';
8
8
 
9
9
  export const babiesCategory: BabiesCategoryEntry = {
10
10
  icon: 'mdi:baby-carriage',
package/src/entries.ts ADDED
@@ -0,0 +1,20 @@
1
+ export { babyFeedingCalculator } from './tool/baby-feeding-calculator/entry';
2
+ export type { BabyFeedingCalculatorUI, BabyFeedingCalculatorLocaleContent } from './tool/baby-feeding-calculator/entry';
3
+ export { babyPercentileCalculator } from './tool/baby-percentile-calculator/entry';
4
+ export type { BabyPercentileCalculatorUI, BabyPercentileCalculatorLocaleContent } from './tool/baby-percentile-calculator/entry';
5
+ export { babySizeConverter } from './tool/baby-size-converter/entry';
6
+ export type { BabySizeConverterUI, BabySizeConverterLocaleContent } from './tool/baby-size-converter/entry';
7
+ export { fertileDaysEstimator } from './tool/fertile-days-estimator/entry';
8
+ export type { FertileDaysEstimatorUI, FertileDaysEstimatorLocaleContent } from './tool/fertile-days-estimator/entry';
9
+ export { pregnancyCalculator } from './tool/pregnancy-calculator/entry';
10
+ export type { MilestoneI18n, PregnancyCalculatorUI, PregnancyCalculatorLocaleContent } from './tool/pregnancy-calculator/entry';
11
+ export { vaccinationCalendar } from './tool/vaccination-calendar/entry';
12
+ export type { VaccinationCalendarUI, VaccinationCalendarLocaleContent } from './tool/vaccination-calendar/entry';
13
+ export { babiesCategory } from './category';
14
+ import { babyFeedingCalculator } from './tool/baby-feeding-calculator/entry';
15
+ import { babyPercentileCalculator } from './tool/baby-percentile-calculator/entry';
16
+ import { babySizeConverter } from './tool/baby-size-converter/entry';
17
+ import { fertileDaysEstimator } from './tool/fertile-days-estimator/entry';
18
+ import { pregnancyCalculator } from './tool/pregnancy-calculator/entry';
19
+ import { vaccinationCalendar } from './tool/vaccination-calendar/entry';
20
+ export const ALL_ENTRIES = [babyFeedingCalculator, babyPercentileCalculator, babySizeConverter, fertileDaysEstimator, pregnancyCalculator, vaccinationCalendar];
@@ -0,0 +1,402 @@
1
+ :global(.bfc-card) {
2
+ background: #fff;
3
+ border: 1px solid #e2e8f0;
4
+ border-radius: 28px;
5
+ overflow: hidden;
6
+ display: flex;
7
+ flex-direction: column;
8
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
9
+ }
10
+
11
+ :global(.theme-dark .bfc-card) {
12
+ background: #111827;
13
+ border-color: #1f2937;
14
+ }
15
+
16
+ .bfc-main {
17
+ display: grid;
18
+ grid-template-columns: 1fr 1fr;
19
+ }
20
+
21
+ .bfc-left {
22
+ background: #f8fafc;
23
+ padding: 40px;
24
+ border-right: 1px solid #e2e8f0;
25
+ }
26
+
27
+ :global(.theme-dark .bfc-left) {
28
+ background: #1f2937;
29
+ border-right-color: #374151;
30
+ }
31
+
32
+ :global(.bfc-right) {
33
+ background: #fff;
34
+ padding: 40px;
35
+ }
36
+
37
+ :global(.theme-dark .bfc-right) {
38
+ background: #111827;
39
+ }
40
+
41
+ .bfc-section-marker {
42
+ display: block;
43
+ font-size: 0.75rem;
44
+ font-weight: 800;
45
+ text-transform: uppercase;
46
+ letter-spacing: 0.15em;
47
+ color: #64748b;
48
+ margin-bottom: 32px;
49
+ }
50
+
51
+ :global(.bfc-input-label) {
52
+ display: block;
53
+ font-size: 0.95rem;
54
+ font-weight: 700;
55
+ color: #334155;
56
+ margin-bottom: 12px;
57
+ }
58
+
59
+ :global(.theme-dark .bfc-input-label) {
60
+ color: #e2e8f0;
61
+ }
62
+
63
+ .bfc-input-group {
64
+ margin-bottom: 28px;
65
+ }
66
+
67
+ .bfc-unit-nav {
68
+ display: flex;
69
+ background: #e2e8f0;
70
+ padding: 4px;
71
+ border-radius: 12px;
72
+ margin-bottom: 24px;
73
+ }
74
+
75
+ :global(.theme-dark .bfc-unit-nav) {
76
+ background: #374151;
77
+ }
78
+
79
+ :global(.bfc-unit-tab) {
80
+ flex: 1;
81
+ padding: 8px;
82
+ border: none;
83
+ background: #f1f5f9;
84
+ color: #64748b;
85
+ font-size: 0.85rem;
86
+ font-weight: 700;
87
+ border-radius: 8px;
88
+ cursor: pointer;
89
+ transition: all 0.2s ease;
90
+ margin: 2px;
91
+ }
92
+
93
+ :global(.theme-dark .bfc-unit-tab) {
94
+ background: #1f2937;
95
+ }
96
+
97
+ :global(.bfc-unit-active) {
98
+ background: #fff;
99
+ color: #0d9488;
100
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
101
+ }
102
+
103
+ :global(.theme-dark .bfc-unit-active) {
104
+ background: #4b5563;
105
+ color: #2dd4bf;
106
+ }
107
+
108
+ .bfc-stepper-box {
109
+ display: flex;
110
+ align-items: center;
111
+ justify-content: space-between;
112
+ background: #fff;
113
+ border: 1px solid #cbd5e1;
114
+ border-radius: 16px;
115
+ padding: 8px;
116
+ margin-bottom: 8px;
117
+ }
118
+
119
+ :global(.theme-dark .bfc-stepper-box) {
120
+ background: #111827;
121
+ border-color: #4b5563;
122
+ }
123
+
124
+ :global(.bfc-btn-step) {
125
+ width: 44px;
126
+ height: 44px;
127
+ border-radius: 12px;
128
+ border: none;
129
+ background: #f1f5f9;
130
+ color: #334155;
131
+ font-size: 1.25rem;
132
+ font-weight: 700;
133
+ cursor: pointer;
134
+ transition: all 0.2s ease;
135
+ }
136
+
137
+ :global(.theme-dark .bfc-btn-step) {
138
+ background: #374151;
139
+ color: #f9fafb;
140
+ }
141
+
142
+ :global(.bfc-btn-step:hover) {
143
+ background: #0d9488;
144
+ color: #fff;
145
+ }
146
+
147
+ .bfc-val-view {
148
+ text-align: center;
149
+ }
150
+
151
+ :global(.bfc-val-big) {
152
+ display: block;
153
+ font-size: 2rem;
154
+ font-weight: 800;
155
+ color: #0f172a;
156
+ }
157
+
158
+ :global(.theme-dark .bfc-val-big) {
159
+ color: #fff;
160
+ }
161
+
162
+ :global(.bfc-val-sub) {
163
+ display: block;
164
+ font-size: 0.85rem;
165
+ color: #64748b;
166
+ font-weight: 600;
167
+ }
168
+
169
+ .bfc-slider-wrap {
170
+ padding: 0 11px;
171
+ }
172
+
173
+ .bfc-slider {
174
+ -webkit-appearance: none;
175
+ appearance: none;
176
+ width: 100%;
177
+ margin: 16px 0;
178
+ height: 6px;
179
+ background: #e2e8f0;
180
+ border-radius: 3px;
181
+ outline: none;
182
+ }
183
+
184
+ :global(.theme-dark .bfc-slider) {
185
+ background: #374151;
186
+ }
187
+
188
+ :global(.bfc-slider::-webkit-slider-thumb) {
189
+ -webkit-appearance: none;
190
+ appearance: none;
191
+ width: 22px;
192
+ height: 22px;
193
+ border-radius: 50%;
194
+ background: #0d9488;
195
+ cursor: pointer;
196
+ border: 3px solid #fff;
197
+ box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
198
+ }
199
+
200
+ .bfc-type-rack {
201
+ display: grid;
202
+ grid-template-columns: repeat(3, 1fr);
203
+ gap: 12px;
204
+ }
205
+
206
+ :global(.bfc-type-tile) {
207
+ background: #f1f5f9;
208
+ border: 1px solid #cbd5e1;
209
+ border-radius: 14px;
210
+ padding: 14px 4px;
211
+ text-align: center;
212
+ cursor: pointer;
213
+ transition: all 0.2s ease;
214
+ font-size: 0.9rem;
215
+ font-weight: 700;
216
+ color: #64748b;
217
+ }
218
+
219
+ :global(.theme-dark .bfc-type-tile) {
220
+ background: #1f2937;
221
+ border-color: #4b5563;
222
+ }
223
+
224
+ :global(.bfc-type-active) {
225
+ background: #f0fdfa;
226
+ border-color: #0d9488;
227
+ color: #0f766e;
228
+ box-shadow: 0 2px 8px rgba(13, 148, 136, 0.1);
229
+ }
230
+
231
+ :global(.theme-dark .bfc-type-active) {
232
+ background: rgba(13, 148, 136, 0.1);
233
+ color: #2dd4bf;
234
+ border-color: #2dd4bf;
235
+ }
236
+
237
+ .bfc-gauge-area {
238
+ margin-top: 40px;
239
+ padding: 30px;
240
+ background: #fff;
241
+ border-radius: 20px;
242
+ border: 1px solid #e2e8f0;
243
+ }
244
+
245
+ :global(.theme-dark .bfc-gauge-area) {
246
+ background: #111827;
247
+ border-color: #374151;
248
+ }
249
+
250
+ .bfc-gauge-viz {
251
+ display: flex;
252
+ flex-direction: column;
253
+ align-items: center;
254
+ text-align: center;
255
+ gap: 16px;
256
+ }
257
+
258
+ .bfc-stomach-bubble {
259
+ width: 60px;
260
+ height: 60px;
261
+ background: radial-gradient(circle at 30% 30%, #5eead4 0%, #0d9488 100%);
262
+ border-radius: 50%;
263
+ transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
264
+ box-shadow: 0 10px 25px rgba(13, 148, 136, 0.2);
265
+ }
266
+
267
+ :global(.bfc-visual-hint) {
268
+ font-size: 0.95rem;
269
+ font-weight: 600;
270
+ color: #0f766e;
271
+ margin: 0;
272
+ }
273
+
274
+ :global(.theme-dark .bfc-visual-hint) {
275
+ color: #2dd4bf;
276
+ }
277
+
278
+ .bfc-res-card-box {
279
+ background: #f0fdfa;
280
+ border-radius: 24px;
281
+ padding: 32px 16px;
282
+ text-align: center;
283
+ margin-bottom: 24px;
284
+ }
285
+
286
+ :global(.theme-dark .bfc-res-card-box) {
287
+ background: rgba(13, 148, 136, 0.05);
288
+ }
289
+
290
+ :global(.bfc-res-main-val) {
291
+ display: block;
292
+ font-size: 3.5rem;
293
+ font-weight: 950;
294
+ color: #0d9488;
295
+ letter-spacing: -0.05em;
296
+ line-height: 1;
297
+ }
298
+
299
+ :global(.theme-dark .bfc-res-main-val) {
300
+ color: #2dd4bf;
301
+ }
302
+
303
+ :global(.bfc-res-label) {
304
+ display: block;
305
+ margin-top: 8px;
306
+ font-size: 1rem;
307
+ font-weight: 700;
308
+ color: #64748b;
309
+ }
310
+
311
+ .bfc-stats-grid {
312
+ display: grid;
313
+ grid-template-columns: 1fr 1fr;
314
+ gap: 20px;
315
+ margin-bottom: 32px;
316
+ }
317
+
318
+ .bfc-stat-item {
319
+ padding: 8px;
320
+ border-bottom: 2px solid #f1f5f9;
321
+ }
322
+
323
+ :global(.theme-dark .bfc-stat-item) {
324
+ border-bottom-color: #374151;
325
+ }
326
+
327
+ :global(.bfc-stat-label) {
328
+ display: block;
329
+ font-size: 0.7rem;
330
+ font-weight: 800;
331
+ color: #94a3b8;
332
+ text-transform: uppercase;
333
+ margin-bottom: 2px;
334
+ }
335
+
336
+ :global(.bfc-stat-value) {
337
+ font-size: 1.15rem;
338
+ font-weight: 800;
339
+ color: #334155;
340
+ }
341
+
342
+ :global(.theme-dark .bfc-stat-value) {
343
+ color: #e2e8f0;
344
+ }
345
+
346
+ .bfc-behavior-sec {
347
+ margin-top: 32px;
348
+ }
349
+
350
+ .bfc-pills-container {
351
+ display: flex;
352
+ flex-wrap: wrap;
353
+ gap: 8px;
354
+ margin-top: 12px;
355
+ }
356
+
357
+ .bfc-pill {
358
+ font-size: 0.8rem;
359
+ font-weight: 700;
360
+ padding: 6px 12px;
361
+ border-radius: 100px;
362
+ }
363
+
364
+ :global(.bfc-pill-hunger) {
365
+ background: #fff7ed;
366
+ color: #c2410c;
367
+ }
368
+
369
+ :global(.theme-dark .bfc-pill-hunger) {
370
+ background: rgba(194, 65, 12, 0.1);
371
+ color: #fdba74;
372
+ }
373
+
374
+ :global(.bfc-pill-fullness) {
375
+ background: #f0fdf4;
376
+ color: #15803d;
377
+ }
378
+
379
+ :global(.theme-dark .bfc-pill-fullness) {
380
+ background: rgba(21, 128, 61, 0.1);
381
+ color: #4ade80;
382
+ }
383
+
384
+ .bfc-hidden {
385
+ display: none;
386
+ }
387
+
388
+ @media (max-width: 800px) {
389
+ .bfc-main {
390
+ grid-template-columns: 1fr;
391
+ }
392
+
393
+ .bfc-left {
394
+ border-right: none;
395
+ border-bottom: 1px solid #e2e8f0;
396
+ padding: 30px 20px;
397
+ }
398
+
399
+ .bfc-right {
400
+ padding: 30px 20px;
401
+ }
402
+ }