@dofek/scoring 0.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 (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +75 -0
  3. package/dist/breathwork.d.ts +27 -0
  4. package/dist/breathwork.d.ts.map +1 -0
  5. package/dist/breathwork.js +65 -0
  6. package/dist/breathwork.js.map +1 -0
  7. package/dist/colors.d.ts +74 -0
  8. package/dist/colors.d.ts.map +1 -0
  9. package/dist/colors.js +74 -0
  10. package/dist/colors.js.map +1 -0
  11. package/dist/healthspan-years.d.ts +22 -0
  12. package/dist/healthspan-years.d.ts.map +1 -0
  13. package/dist/healthspan-years.js +33 -0
  14. package/dist/healthspan-years.js.map +1 -0
  15. package/dist/loading-policy.d.ts +8 -0
  16. package/dist/loading-policy.d.ts.map +1 -0
  17. package/dist/loading-policy.js +9 -0
  18. package/dist/loading-policy.js.map +1 -0
  19. package/dist/menstrual-cycle.d.ts +24 -0
  20. package/dist/menstrual-cycle.d.ts.map +1 -0
  21. package/dist/menstrual-cycle.js +32 -0
  22. package/dist/menstrual-cycle.js.map +1 -0
  23. package/dist/query-cache.d.ts +2 -0
  24. package/dist/query-cache.d.ts.map +1 -0
  25. package/dist/query-cache.js +2 -0
  26. package/dist/query-cache.js.map +1 -0
  27. package/dist/scoring.d.ts +114 -0
  28. package/dist/scoring.d.ts.map +1 -0
  29. package/dist/scoring.js +325 -0
  30. package/dist/scoring.js.map +1 -0
  31. package/dist/sleep-performance.d.ts +36 -0
  32. package/dist/sleep-performance.d.ts.map +1 -0
  33. package/dist/sleep-performance.js +59 -0
  34. package/dist/sleep-performance.js.map +1 -0
  35. package/dist/strain-target.d.ts +18 -0
  36. package/dist/strain-target.d.ts.map +1 -0
  37. package/dist/strain-target.js +59 -0
  38. package/dist/strain-target.js.map +1 -0
  39. package/dist/tokens.d.ts +99 -0
  40. package/dist/tokens.d.ts.map +1 -0
  41. package/dist/tokens.js +106 -0
  42. package/dist/tokens.js.map +1 -0
  43. package/package.json +83 -0
package/dist/tokens.js ADDED
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Design tokens shared across web and iOS.
3
+ *
4
+ * Platform-agnostic values — no React, no HTML, no React Native.
5
+ * Web uses these via Tailwind @theme + CSS. iOS uses them in StyleSheets.
6
+ *
7
+ * Colors live in ./colors.ts (separate module for historical reasons).
8
+ */
9
+ // ── Typography ──
10
+ export const fontFamily = {
11
+ /** Body text — Inter on web, system default on iOS until fonts load */
12
+ body: "Inter",
13
+ /** Monospace for numbers, metrics, code — DM Mono on web, Menlo on iOS */
14
+ mono: "DM Mono",
15
+ };
16
+ export const fontSize = {
17
+ xs: 11,
18
+ sm: 13,
19
+ base: 14,
20
+ lg: 16,
21
+ xl: 20,
22
+ "2xl": 24,
23
+ "3xl": 30,
24
+ "4xl": 36,
25
+ "5xl": 48,
26
+ };
27
+ export const fontWeight = {
28
+ normal: "400",
29
+ medium: "500",
30
+ semibold: "600",
31
+ bold: "700",
32
+ extrabold: "800",
33
+ };
34
+ // ── Animation ──
35
+ export const duration = {
36
+ /** Micro-interactions: hover, press, toggle */
37
+ fast: 150,
38
+ /** Standard transitions: fade, slide */
39
+ normal: 300,
40
+ /** Content reveals: card appear, section expand */
41
+ slow: 500,
42
+ /** Count-up numbers */
43
+ countUp: 800,
44
+ /** Ring draw-in, chart bars grow */
45
+ chart: 1200,
46
+ /** Logo heartbeat cycle */
47
+ heartbeat: 3000,
48
+ };
49
+ export const easing = {
50
+ /** Standard ease-out for most transitions */
51
+ out: "cubic-bezier(0.16, 1, 0.3, 1)",
52
+ /** Ease-in-out for looping animations */
53
+ inOut: "cubic-bezier(0.4, 0, 0.2, 1)",
54
+ /** ECharts cubic out */
55
+ echartsOut: "cubicOut",
56
+ };
57
+ // ── Spacing ──
58
+ export const spacing = {
59
+ /** Tight: between related items (icon + label) */
60
+ xs: 4,
61
+ /** Default gap between cards in a row */
62
+ sm: 8,
63
+ /** Section padding, card internal spacing */
64
+ md: 16,
65
+ /** Between dashboard sections */
66
+ lg: 24,
67
+ /** Page margins */
68
+ xl: 32,
69
+ };
70
+ // ── Border radius ──
71
+ export const radius = {
72
+ /** Pill shapes, status dots */
73
+ full: 9999,
74
+ /** Cards, major containers */
75
+ xl: 16,
76
+ /** Secondary containers, modals */
77
+ lg: 12,
78
+ /** Buttons, inputs */
79
+ md: 8,
80
+ /** Small elements, badges */
81
+ sm: 4,
82
+ };
83
+ // ── Chart defaults ──
84
+ // Platform-agnostic chart configuration values.
85
+ // Web applies these to ECharts. iOS applies to SVG/canvas.
86
+ export const chart = {
87
+ /** Default chart height in px */
88
+ defaultHeight: 250,
89
+ /** Stagger delay between bar animations (ms) */
90
+ barStaggerDelay: 50,
91
+ /** Grid padding defaults (px) */
92
+ grid: {
93
+ top: 30,
94
+ right: 12,
95
+ bottom: 30,
96
+ left: 40,
97
+ },
98
+ /** Grid padding when chart has dual y-axes */
99
+ gridDualAxis: {
100
+ top: 30,
101
+ right: 60,
102
+ bottom: 30,
103
+ left: 50,
104
+ },
105
+ };
106
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mBAAmB;AAEnB,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,uEAAuE;IACvE,IAAI,EAAE,OAAO;IACb,0EAA0E;IAC1E,IAAI,EAAE,SAAS;CACP,CAAC;AAEX,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,IAAI,EAAE,EAAE;IACR,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;CACD,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM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,EAAE;IACnB,iCAAiC;IACjC,IAAI,EAAE;QACJ,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,EAAE;KACT;IACD,8CAA8C;IAC9C,YAAY,EAAE;QACZ,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,EAAE;KACT;CACO,CAAC"}
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@dofek/scoring",
3
+ "version": "0.1.0",
4
+ "description": "Platform-agnostic health scoring models, labels, colors, and design tokens",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Asherlc/dofek.git",
10
+ "directory": "packages/scoring"
11
+ },
12
+ "homepage": "https://github.com/Asherlc/dofek/tree/main/packages/scoring#readme",
13
+ "bugs": "https://github.com/Asherlc/dofek/issues",
14
+ "keywords": [
15
+ "health",
16
+ "fitness",
17
+ "scoring",
18
+ "recovery",
19
+ "strain",
20
+ "typescript"
21
+ ],
22
+ "engines": {
23
+ "node": ">=22.14.0"
24
+ },
25
+ "sideEffects": false,
26
+ "files": [
27
+ "dist",
28
+ "README.md",
29
+ "LICENSE"
30
+ ],
31
+ "exports": {
32
+ "./scoring": {
33
+ "types": "./dist/scoring.d.ts",
34
+ "import": "./dist/scoring.js"
35
+ },
36
+ "./colors": {
37
+ "types": "./dist/colors.d.ts",
38
+ "import": "./dist/colors.js"
39
+ },
40
+ "./tokens": {
41
+ "types": "./dist/tokens.d.ts",
42
+ "import": "./dist/tokens.js"
43
+ },
44
+ "./strain-target": {
45
+ "types": "./dist/strain-target.d.ts",
46
+ "import": "./dist/strain-target.js"
47
+ },
48
+ "./sleep-performance": {
49
+ "types": "./dist/sleep-performance.d.ts",
50
+ "import": "./dist/sleep-performance.js"
51
+ },
52
+ "./healthspan-years": {
53
+ "types": "./dist/healthspan-years.d.ts",
54
+ "import": "./dist/healthspan-years.js"
55
+ },
56
+ "./menstrual-cycle": {
57
+ "types": "./dist/menstrual-cycle.d.ts",
58
+ "import": "./dist/menstrual-cycle.js"
59
+ },
60
+ "./breathwork": {
61
+ "types": "./dist/breathwork.d.ts",
62
+ "import": "./dist/breathwork.js"
63
+ },
64
+ "./loading-policy": {
65
+ "types": "./dist/loading-policy.d.ts",
66
+ "import": "./dist/loading-policy.js"
67
+ },
68
+ "./query-cache": {
69
+ "types": "./dist/query-cache.d.ts",
70
+ "import": "./dist/query-cache.js"
71
+ }
72
+ },
73
+ "publishConfig": {
74
+ "access": "public"
75
+ },
76
+ "scripts": {
77
+ "build": "tsc",
78
+ "prepack": "pnpm run build",
79
+ "test": "vitest run src",
80
+ "typecheck": "tsc --noEmit"
81
+ },
82
+ "gitHead": "ac95258c753c7e75b57da7ae47426d22b78e8c01"
83
+ }