@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.
- package/package.json +69 -0
- package/src/category/i18n/en.ts +48 -0
- package/src/category/i18n/es.ts +48 -0
- package/src/category/i18n/fr.ts +48 -0
- package/src/category/index.ts +24 -0
- package/src/category/seo.astro +15 -0
- package/src/components/PreviewNavSidebar.astro +116 -0
- package/src/components/PreviewToolbar.astro +143 -0
- package/src/data.ts +30 -0
- package/src/env.d.ts +5 -0
- package/src/index.ts +19 -0
- package/src/layouts/PreviewLayout.astro +117 -0
- package/src/pages/[locale]/[slug].astro +146 -0
- package/src/pages/[locale].astro +251 -0
- package/src/pages/index.astro +4 -0
- package/src/tests/faq_count.test.ts +19 -0
- package/src/tests/locale_completeness.test.ts +42 -0
- package/src/tests/mocks/astro_mock.js +2 -0
- package/src/tests/no_h1_in_components.test.ts +48 -0
- package/src/tests/seo_length.test.ts +23 -0
- package/src/tests/tool_validation.test.ts +17 -0
- package/src/tool/baby-feeding-calculator/bibliography.astro +7 -0
- package/src/tool/baby-feeding-calculator/component.astro +210 -0
- package/src/tool/baby-feeding-calculator/i18n/en.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/es.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/fr.ts +162 -0
- package/src/tool/baby-feeding-calculator/index.ts +47 -0
- package/src/tool/baby-feeding-calculator/logic.ts +85 -0
- package/src/tool/baby-feeding-calculator/seo.astro +58 -0
- package/src/tool/baby-feeding-calculator/style.css +329 -0
- package/src/tool/baby-percentile-calculator/bibliography.astro +7 -0
- package/src/tool/baby-percentile-calculator/component.astro +388 -0
- package/src/tool/baby-percentile-calculator/i18n/en.ts +244 -0
- package/src/tool/baby-percentile-calculator/i18n/es.ts +244 -0
- package/src/tool/baby-percentile-calculator/i18n/fr.ts +244 -0
- package/src/tool/baby-percentile-calculator/index.ts +54 -0
- package/src/tool/baby-percentile-calculator/lmsData.ts +80 -0
- package/src/tool/baby-percentile-calculator/logic.ts +85 -0
- package/src/tool/baby-percentile-calculator/seo.astro +36 -0
- package/src/tool/baby-percentile-calculator/style.css +393 -0
- package/src/tool/baby-size-converter/bibliography.astro +7 -0
- package/src/tool/baby-size-converter/component.astro +289 -0
- package/src/tool/baby-size-converter/data.json +11 -0
- package/src/tool/baby-size-converter/i18n/en.ts +203 -0
- package/src/tool/baby-size-converter/i18n/es.ts +203 -0
- package/src/tool/baby-size-converter/i18n/fr.ts +203 -0
- package/src/tool/baby-size-converter/index.ts +53 -0
- package/src/tool/baby-size-converter/logic.ts +44 -0
- package/src/tool/baby-size-converter/seo.astro +36 -0
- package/src/tool/baby-size-converter/style.css +394 -0
- package/src/tool/fertile-days-estimator/bibliography.astro +7 -0
- package/src/tool/fertile-days-estimator/component.astro +265 -0
- package/src/tool/fertile-days-estimator/i18n/en.ts +258 -0
- package/src/tool/fertile-days-estimator/i18n/es.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/fr.ts +258 -0
- package/src/tool/fertile-days-estimator/index.ts +47 -0
- package/src/tool/fertile-days-estimator/logic.ts +58 -0
- package/src/tool/fertile-days-estimator/seo.astro +36 -0
- package/src/tool/fertile-days-estimator/style.css +419 -0
- package/src/tool/pregnancy-calculator/bibliography.astro +7 -0
- package/src/tool/pregnancy-calculator/calculator.ts +41 -0
- package/src/tool/pregnancy-calculator/component.astro +432 -0
- package/src/tool/pregnancy-calculator/i18n/en.ts +315 -0
- package/src/tool/pregnancy-calculator/i18n/es.ts +319 -0
- package/src/tool/pregnancy-calculator/i18n/fr.ts +315 -0
- package/src/tool/pregnancy-calculator/index.ts +55 -0
- package/src/tool/pregnancy-calculator/milestones.ts +153 -0
- package/src/tool/pregnancy-calculator/seo.astro +36 -0
- package/src/tool/pregnancy-calculator/store.ts +60 -0
- package/src/tool/pregnancy-calculator/style.css +807 -0
- package/src/tool/vaccination-calendar/bibliography.astro +7 -0
- package/src/tool/vaccination-calendar/component.astro +286 -0
- package/src/tool/vaccination-calendar/i18n/en.ts +170 -0
- package/src/tool/vaccination-calendar/i18n/es.ts +174 -0
- package/src/tool/vaccination-calendar/i18n/fr.ts +170 -0
- package/src/tool/vaccination-calendar/index.ts +47 -0
- package/src/tool/vaccination-calendar/logic.ts +59 -0
- package/src/tool/vaccination-calendar/seo.astro +36 -0
- package/src/tool/vaccination-calendar/style.css +316 -0
- package/src/tool/vaccination-calendar/vaccinationData.ts +21 -0
- package/src/tools.ts +17 -0
- package/src/types.ts +72 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { boys, girls, interpolateLMS, type GenderData } from './lmsData';
|
|
2
|
+
|
|
3
|
+
interface LMSData {
|
|
4
|
+
L: number;
|
|
5
|
+
M: number;
|
|
6
|
+
S: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function erf(x: number): number {
|
|
10
|
+
const a1 = 0.254829592;
|
|
11
|
+
const a2 = -0.284496736;
|
|
12
|
+
const a3 = 1.421413741;
|
|
13
|
+
const a4 = -1.453152027;
|
|
14
|
+
const a5 = 1.061405429;
|
|
15
|
+
const p = 0.3275911;
|
|
16
|
+
const sign = x < 0 ? -1 : 1;
|
|
17
|
+
const ax = Math.abs(x);
|
|
18
|
+
const t = 1 / (1 + p * ax);
|
|
19
|
+
const y = 1 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * Math.exp(-ax * ax);
|
|
20
|
+
return sign * y;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function zToPercentile(z: number): number {
|
|
24
|
+
return 0.5 * (1 + erf(z / Math.sqrt(2))) * 100;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function calculatePercentile(val: number, lms: LMSData): number {
|
|
28
|
+
const { L, M, S } = lms;
|
|
29
|
+
if (L === 0) return zToPercentile(Math.log(val / M) / S);
|
|
30
|
+
const z = (Math.pow(val / M, L) - 1) / (L * S);
|
|
31
|
+
return zToPercentile(z);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function getDescriptionKey(p: number): string {
|
|
35
|
+
if (p < 3) return 'labelLowRange';
|
|
36
|
+
if (p < 15) return 'labelLowNormal';
|
|
37
|
+
if (p < 85) return 'labelNormal';
|
|
38
|
+
if (p < 97) return 'labelHighNormal';
|
|
39
|
+
return 'labelHighRange';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function getDataSet(sex: string): GenderData {
|
|
43
|
+
return sex === 'boy' ? boys : girls;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function calcBMI(weight: number, height: number): number {
|
|
47
|
+
return weight / Math.pow(height / 100, 2);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface CurvePoint {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function zForCurve(c: number): number {
|
|
56
|
+
if (c === 50) return 0;
|
|
57
|
+
if (c === 3) return -1.88;
|
|
58
|
+
if (c === 15) return -1.04;
|
|
59
|
+
if (c === 85) return 1.04;
|
|
60
|
+
return 1.88;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function buildCurveData(dataSet: GenderData, z: number): CurvePoint[] {
|
|
64
|
+
return Array.from({ length: 61 }, (_, m) => {
|
|
65
|
+
const lms = interpolateLMS(m, dataSet.weight);
|
|
66
|
+
if (lms.L === 0) return { x: m, y: lms.M * Math.exp(lms.S * z) };
|
|
67
|
+
return { x: m, y: lms.M * Math.pow(1 + lms.L * lms.S * z, 1 / lms.L) };
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const CURVES = [3, 15, 50, 85, 97];
|
|
72
|
+
|
|
73
|
+
export function buildChartDatasets(sex: string): object[] {
|
|
74
|
+
const dataSet = getDataSet(sex);
|
|
75
|
+
const mainColor = sex === 'boy' ? '#0ea5e9' : '#0d9488';
|
|
76
|
+
return CURVES.map(c => ({
|
|
77
|
+
label: `P${c}`,
|
|
78
|
+
data: buildCurveData(dataSet, zForCurve(c)),
|
|
79
|
+
borderColor: c === 50 ? mainColor : '#cbd5e1',
|
|
80
|
+
borderWidth: c === 50 ? 2 : 1,
|
|
81
|
+
fill: false,
|
|
82
|
+
tension: 0.1,
|
|
83
|
+
parsing: { xAxisKey: 'x', yAxisKey: 'y' }
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
import {
|
|
3
|
+
SEOTitle, SEOStats, SEOTip, SEOTable,
|
|
4
|
+
SEOList, SEOSummary, SEOComparative, SEOGlossary, SEOArticle,
|
|
5
|
+
} from '@jjlmoya/utils-shared';
|
|
6
|
+
import { babyPercentileCalculator } from './index';
|
|
7
|
+
import type { KnownLocale } from '../../types';
|
|
8
|
+
|
|
9
|
+
interface Props { locale?: KnownLocale; }
|
|
10
|
+
const { locale = 'es' } = Astro.props;
|
|
11
|
+
const content = await babyPercentileCalculator.i18n[locale]?.();
|
|
12
|
+
if (!content) return null;
|
|
13
|
+
const { seo } = content;
|
|
14
|
+
---
|
|
15
|
+
<SEOArticle>
|
|
16
|
+
{seo.map((section: any) => {
|
|
17
|
+
switch (section.type) {
|
|
18
|
+
case 'summary': return <SEOSummary title={section.title} items={section.items} />;
|
|
19
|
+
case 'title': return <SEOTitle title={section.text} level={section.level || 2} />;
|
|
20
|
+
case 'paragraph': return <p set:html={section.html} />;
|
|
21
|
+
case 'stats': return <SEOStats stats={section.items} columns={section.columns} />;
|
|
22
|
+
case 'tip': return <SEOTip><Fragment set:html={section.html} /></SEOTip>;
|
|
23
|
+
case 'table': return (
|
|
24
|
+
<SEOTable headers={section.headers}>
|
|
25
|
+
{section.rows.map((row: string[]) => (
|
|
26
|
+
<tr>{row.map((cell: string) => <td set:html={cell} />)}</tr>
|
|
27
|
+
))}
|
|
28
|
+
</SEOTable>
|
|
29
|
+
);
|
|
30
|
+
case 'list': return <SEOList items={section.items} />;
|
|
31
|
+
case 'comparative': return <SEOComparative items={section.items} columns={section.columns} />;
|
|
32
|
+
case 'glossary': return <SEOGlossary items={section.items} />;
|
|
33
|
+
default: return null;
|
|
34
|
+
}
|
|
35
|
+
})}
|
|
36
|
+
</SEOArticle>
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
.baby-percentile-calculator {
|
|
2
|
+
--bpc-bg: #fff;
|
|
3
|
+
--bpc-bg-muted: #f8fafc;
|
|
4
|
+
--bpc-bg-alt: #f1f5f9;
|
|
5
|
+
--bpc-text: #0f172a;
|
|
6
|
+
--bpc-text-muted: #1e293b;
|
|
7
|
+
--bpc-text-dim: #64748b;
|
|
8
|
+
--bpc-text-faint: #94a3b8;
|
|
9
|
+
--bpc-border: #e2e8f0;
|
|
10
|
+
--bpc-border-inner: #475569;
|
|
11
|
+
--bpc-shadow: rgba(0, 0, 0, 0.05);
|
|
12
|
+
--bpc-primary: #0d9488;
|
|
13
|
+
--bpc-primary-on: #fff;
|
|
14
|
+
--bpc-primary-glow: rgba(13, 148, 136, 0.4);
|
|
15
|
+
--bpc-accent-boy: #0ea5e9;
|
|
16
|
+
--bpc-accent-boy-glow: rgba(14, 165, 233, 0.4);
|
|
17
|
+
--bpc-success: #10b981;
|
|
18
|
+
--bpc-warning-bg: #fff7ed;
|
|
19
|
+
--bpc-warning-border: #fed7aa;
|
|
20
|
+
--bpc-warning-text: #9a3412;
|
|
21
|
+
--bpc-disclaimer-bg: #f1f5f9;
|
|
22
|
+
|
|
23
|
+
background-color: var(--bpc-bg);
|
|
24
|
+
color: var(--bpc-text);
|
|
25
|
+
border: 1px solid var(--bpc-border);
|
|
26
|
+
border-radius: 1rem;
|
|
27
|
+
padding: 1.5rem;
|
|
28
|
+
box-shadow: 0 1px 3px var(--bpc-shadow);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.theme-dark .baby-percentile-calculator {
|
|
32
|
+
--bpc-bg: #0f172a;
|
|
33
|
+
--bpc-bg-muted: #1e293b;
|
|
34
|
+
--bpc-bg-alt: #334155;
|
|
35
|
+
--bpc-text: #f8fafc;
|
|
36
|
+
--bpc-text-muted: #f8fafc;
|
|
37
|
+
--bpc-text-dim: #94a3b8;
|
|
38
|
+
--bpc-text-faint: #64748b;
|
|
39
|
+
--bpc-border: #1e293b;
|
|
40
|
+
--bpc-border-inner: #475569;
|
|
41
|
+
--bpc-shadow: rgba(0, 0, 0, 0.4);
|
|
42
|
+
--bpc-primary: #2dd4bf;
|
|
43
|
+
--bpc-primary-on: #fff;
|
|
44
|
+
--bpc-primary-glow: rgba(45, 212, 191, 0.4);
|
|
45
|
+
--bpc-accent-boy: #38bdf8;
|
|
46
|
+
--bpc-accent-boy-glow: rgba(56, 189, 248, 0.4);
|
|
47
|
+
--bpc-success: #34d399;
|
|
48
|
+
--bpc-warning-bg: rgba(154, 52, 18, 0.1);
|
|
49
|
+
--bpc-warning-border: rgba(154, 52, 18, 0.2);
|
|
50
|
+
--bpc-warning-text: #fdba74;
|
|
51
|
+
--bpc-disclaimer-bg: #1e293b;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.baby-percentile-calculator-main {
|
|
55
|
+
display: flex;
|
|
56
|
+
gap: 1.5rem;
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.baby-percentile-calculator-left {
|
|
61
|
+
flex: 1 1 18rem;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
gap: 1rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.baby-percentile-calculator-right {
|
|
68
|
+
flex: 2 1 24rem;
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
gap: 1rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.baby-percentile-calculator-section-marker {
|
|
75
|
+
display: block;
|
|
76
|
+
font-size: 0.75rem;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
letter-spacing: 0.08em;
|
|
79
|
+
text-transform: uppercase;
|
|
80
|
+
color: var(--bpc-text-dim);
|
|
81
|
+
border-bottom: 1px solid var(--bpc-border);
|
|
82
|
+
padding-bottom: 0.5rem;
|
|
83
|
+
margin-bottom: 0.25rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.baby-percentile-calculator-input-group {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: 0.25rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.baby-percentile-calculator-input-label {
|
|
93
|
+
font-size: 0.8rem;
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
color: var(--bpc-text-dim);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.baby-percentile-calculator-sex-selector {
|
|
99
|
+
display: flex;
|
|
100
|
+
gap: 0.5rem;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.baby-percentile-calculator-sex-btn {
|
|
104
|
+
flex: 1;
|
|
105
|
+
padding: 0.5rem 1rem;
|
|
106
|
+
border: 1px solid var(--bpc-border);
|
|
107
|
+
border-radius: 0.5rem;
|
|
108
|
+
background-color: var(--bpc-bg-muted);
|
|
109
|
+
color: var(--bpc-text-muted);
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
font-size: 0.875rem;
|
|
112
|
+
font-weight: 500;
|
|
113
|
+
transition: background-color 0.15s, border-color 0.15s, color 0.15s;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.baby-percentile-calculator-sex-btn:hover {
|
|
117
|
+
border-color: var(--bpc-primary);
|
|
118
|
+
color: var(--bpc-primary);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.baby-percentile-calculator-sex-btn[data-active="true"] {
|
|
122
|
+
background-color: var(--bpc-primary);
|
|
123
|
+
border-color: var(--bpc-primary);
|
|
124
|
+
color: var(--bpc-primary-on);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.baby-percentile-calculator-boy .baby-percentile-calculator-sex-btn[data-active="true"] {
|
|
128
|
+
background-color: var(--bpc-accent-boy);
|
|
129
|
+
border-color: var(--bpc-accent-boy);
|
|
130
|
+
color: var(--bpc-primary-on);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.baby-percentile-calculator-unit-nav {
|
|
134
|
+
display: flex;
|
|
135
|
+
background-color: var(--bpc-bg-alt);
|
|
136
|
+
border-radius: 0.5rem;
|
|
137
|
+
padding: 0.25rem;
|
|
138
|
+
gap: 0.25rem;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.baby-percentile-calculator-unit-tab {
|
|
142
|
+
flex: 1;
|
|
143
|
+
padding: 0.375rem 0.75rem;
|
|
144
|
+
border: none;
|
|
145
|
+
border-radius: 0.375rem;
|
|
146
|
+
background-color: transparent;
|
|
147
|
+
color: var(--bpc-text-dim);
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
font-size: 0.8rem;
|
|
150
|
+
font-weight: 500;
|
|
151
|
+
transition: background-color 0.15s, color 0.15s;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.baby-percentile-calculator-unit-tab:hover {
|
|
155
|
+
color: var(--bpc-text);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.baby-percentile-calculator-unit-tab[data-active="true"] {
|
|
159
|
+
background-color: var(--bpc-bg);
|
|
160
|
+
color: var(--bpc-text);
|
|
161
|
+
box-shadow: 0 1px 3px var(--bpc-shadow);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.baby-percentile-calculator-stepper-box {
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
gap: 0.75rem;
|
|
168
|
+
background-color: var(--bpc-bg-muted);
|
|
169
|
+
border: 1px solid var(--bpc-border);
|
|
170
|
+
border-radius: 0.75rem;
|
|
171
|
+
padding: 0.5rem 0.75rem;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.baby-percentile-calculator-btn-step {
|
|
175
|
+
width: 2rem;
|
|
176
|
+
height: 2rem;
|
|
177
|
+
border: 1px solid var(--bpc-border);
|
|
178
|
+
border-radius: 0.375rem;
|
|
179
|
+
background-color: var(--bpc-bg);
|
|
180
|
+
color: var(--bpc-text);
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
font-size: 1rem;
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
justify-content: center;
|
|
186
|
+
transition: border-color 0.15s, color 0.15s;
|
|
187
|
+
flex-shrink: 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.baby-percentile-calculator-btn-step:hover {
|
|
191
|
+
border-color: var(--bpc-primary);
|
|
192
|
+
color: var(--bpc-primary);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.baby-percentile-calculator-val-view {
|
|
196
|
+
flex: 1;
|
|
197
|
+
display: flex;
|
|
198
|
+
flex-direction: column;
|
|
199
|
+
align-items: center;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.baby-percentile-calculator-val-big {
|
|
203
|
+
font-size: 1.5rem;
|
|
204
|
+
font-weight: 700;
|
|
205
|
+
color: var(--bpc-text);
|
|
206
|
+
line-height: 1;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.baby-percentile-calculator-val-sub {
|
|
210
|
+
font-size: 0.75rem;
|
|
211
|
+
color: var(--bpc-text-dim);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.baby-percentile-calculator-slider-line {
|
|
215
|
+
width: 100%;
|
|
216
|
+
accent-color: var(--bpc-primary);
|
|
217
|
+
cursor: pointer;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.baby-percentile-calculator-boy .baby-percentile-calculator-slider-line {
|
|
221
|
+
accent-color: var(--bpc-accent-boy);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.baby-percentile-calculator-grid-2 {
|
|
225
|
+
display: grid;
|
|
226
|
+
grid-template-columns: 1fr 1fr;
|
|
227
|
+
gap: 0.75rem;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.baby-percentile-calculator-num-input {
|
|
231
|
+
width: 100%;
|
|
232
|
+
padding: 0.5rem 0.75rem;
|
|
233
|
+
border: 1px solid var(--bpc-border);
|
|
234
|
+
border-radius: 0.5rem;
|
|
235
|
+
background-color: var(--bpc-bg-muted);
|
|
236
|
+
color: var(--bpc-text);
|
|
237
|
+
font-size: 1rem;
|
|
238
|
+
box-sizing: border-box;
|
|
239
|
+
transition: border-color 0.15s;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.baby-percentile-calculator-num-input:focus {
|
|
243
|
+
outline: none;
|
|
244
|
+
border-color: var(--bpc-primary);
|
|
245
|
+
box-shadow: 0 0 0 3px var(--bpc-primary-glow);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.baby-percentile-calculator-boy .baby-percentile-calculator-num-input:focus {
|
|
249
|
+
border-color: var(--bpc-accent-boy);
|
|
250
|
+
box-shadow: 0 0 0 3px var(--bpc-accent-boy-glow);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.baby-percentile-calculator-history-actions {
|
|
254
|
+
display: flex;
|
|
255
|
+
gap: 0.5rem;
|
|
256
|
+
flex-wrap: wrap;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.baby-percentile-calculator-btn-secondary {
|
|
260
|
+
flex: 1;
|
|
261
|
+
padding: 0.625rem 1rem;
|
|
262
|
+
border: 1px solid var(--bpc-primary);
|
|
263
|
+
border-radius: 0.5rem;
|
|
264
|
+
background-color: transparent;
|
|
265
|
+
color: var(--bpc-primary);
|
|
266
|
+
cursor: pointer;
|
|
267
|
+
font-size: 0.875rem;
|
|
268
|
+
font-weight: 500;
|
|
269
|
+
transition: background-color 0.15s, color 0.15s;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.baby-percentile-calculator-btn-secondary:hover {
|
|
273
|
+
background-color: var(--bpc-primary);
|
|
274
|
+
color: var(--bpc-primary-on);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.baby-percentile-calculator-boy .baby-percentile-calculator-btn-secondary {
|
|
278
|
+
border-color: var(--bpc-accent-boy);
|
|
279
|
+
color: var(--bpc-accent-boy);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.baby-percentile-calculator-boy .baby-percentile-calculator-btn-secondary:hover {
|
|
283
|
+
background-color: var(--bpc-accent-boy);
|
|
284
|
+
color: var(--bpc-primary-on);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.baby-percentile-calculator-btn-clear {
|
|
288
|
+
flex: 1;
|
|
289
|
+
padding: 0.625rem 1rem;
|
|
290
|
+
border: 1px solid var(--bpc-border);
|
|
291
|
+
border-radius: 0.5rem;
|
|
292
|
+
background-color: var(--bpc-bg-muted);
|
|
293
|
+
color: var(--bpc-text-dim);
|
|
294
|
+
cursor: pointer;
|
|
295
|
+
font-size: 0.875rem;
|
|
296
|
+
font-weight: 500;
|
|
297
|
+
transition: border-color 0.15s, color 0.15s;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.baby-percentile-calculator-btn-clear:hover {
|
|
301
|
+
border-color: var(--bpc-text-dim);
|
|
302
|
+
color: var(--bpc-text);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.baby-percentile-calculator-res-grid {
|
|
306
|
+
display: grid;
|
|
307
|
+
grid-template-columns: repeat(3, 1fr);
|
|
308
|
+
gap: 0.75rem;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.baby-percentile-calculator-res-item {
|
|
312
|
+
background-color: var(--bpc-bg-muted);
|
|
313
|
+
border: 1px solid var(--bpc-border);
|
|
314
|
+
border-radius: 0.75rem;
|
|
315
|
+
padding: 0.75rem;
|
|
316
|
+
display: flex;
|
|
317
|
+
flex-direction: column;
|
|
318
|
+
gap: 0.25rem;
|
|
319
|
+
text-align: center;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.baby-percentile-calculator-res-title {
|
|
323
|
+
font-size: 0.75rem;
|
|
324
|
+
font-weight: 600;
|
|
325
|
+
text-transform: uppercase;
|
|
326
|
+
letter-spacing: 0.05em;
|
|
327
|
+
color: var(--bpc-text-dim);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.baby-percentile-calculator-percent-val {
|
|
331
|
+
font-size: 1.75rem;
|
|
332
|
+
font-weight: 700;
|
|
333
|
+
color: var(--bpc-primary);
|
|
334
|
+
line-height: 1;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.baby-percentile-calculator-boy .baby-percentile-calculator-percent-val {
|
|
338
|
+
color: var(--bpc-accent-boy);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.baby-percentile-calculator-res-desc {
|
|
342
|
+
font-size: 0.7rem;
|
|
343
|
+
color: var(--bpc-text-faint);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.baby-percentile-calculator-alert {
|
|
347
|
+
background-color: var(--bpc-warning-bg);
|
|
348
|
+
border: 1px solid var(--bpc-warning-border);
|
|
349
|
+
border-radius: 0.5rem;
|
|
350
|
+
padding: 0.75rem 1rem;
|
|
351
|
+
font-size: 0.875rem;
|
|
352
|
+
color: var(--bpc-warning-text);
|
|
353
|
+
display: none;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.baby-percentile-calculator-alert[data-visible="true"] {
|
|
357
|
+
display: block;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.baby-percentile-calculator-chart-box {
|
|
361
|
+
position: relative;
|
|
362
|
+
width: 100%;
|
|
363
|
+
aspect-ratio: 16 / 9;
|
|
364
|
+
min-height: 200px;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.baby-percentile-calculator-chart-box canvas {
|
|
368
|
+
width: 100%;
|
|
369
|
+
height: 100%;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.baby-percentile-calculator-disclaimer {
|
|
373
|
+
background-color: var(--bpc-disclaimer-bg);
|
|
374
|
+
border-radius: 0.5rem;
|
|
375
|
+
padding: 0.75rem 1rem;
|
|
376
|
+
font-size: 0.8rem;
|
|
377
|
+
color: var(--bpc-text-dim);
|
|
378
|
+
line-height: 1.5;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
@media (max-width: 640px) {
|
|
382
|
+
.baby-percentile-calculator-main {
|
|
383
|
+
flex-direction: column;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.baby-percentile-calculator-res-grid {
|
|
387
|
+
grid-template-columns: 1fr;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.baby-percentile-calculator-grid-2 {
|
|
391
|
+
grid-template-columns: 1fr;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Bibliography as BibliographyUI } from '@jjlmoya/utils-shared';
|
|
3
|
+
import type { BibliographyEntry } from '../../types';
|
|
4
|
+
interface Props { links?: BibliographyEntry[]; title: string; }
|
|
5
|
+
const { links = [], title } = Astro.props;
|
|
6
|
+
---
|
|
7
|
+
<BibliographyUI links={links} title={title} />
|