@titan-design/react-ui 0.9.3 → 0.11.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 (120) hide show
  1. package/dist/bodymap.js +78 -24
  2. package/dist/bodymap.js.map +1 -1
  3. package/dist/bodymap.mjs +78 -24
  4. package/dist/bodymap.mjs.map +1 -1
  5. package/dist/index.d.mts +429 -11
  6. package/dist/index.d.ts +429 -11
  7. package/dist/index.js +2386 -885
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +2306 -836
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/{pages-DyEx-lBf.d.ts → pages-B1hqnGIC.d.ts} +149 -15
  12. package/dist/{pages-D7hOD4Vj.d.mts → pages-CvsFqNtx.d.mts} +149 -15
  13. package/dist/pages.d.mts +1 -1
  14. package/dist/pages.d.ts +1 -1
  15. package/dist/pages.js +1900 -1609
  16. package/dist/pages.js.map +1 -1
  17. package/dist/pages.mjs +1901 -1610
  18. package/dist/pages.mjs.map +1 -1
  19. package/dist/theme/index.d.mts +129 -34
  20. package/dist/theme/index.d.ts +129 -34
  21. package/dist/theme/index.js +95 -19
  22. package/dist/theme/index.js.map +1 -1
  23. package/dist/theme/index.mjs +92 -20
  24. package/dist/theme/index.mjs.map +1 -1
  25. package/dist/theme/tokens-css.js +88 -24
  26. package/dist/theme/tokens-css.js.map +1 -1
  27. package/dist/theme/tokens-css.mjs +88 -24
  28. package/dist/theme/tokens-css.mjs.map +1 -1
  29. package/package.json +8 -3
  30. package/src/components/custom/Fatigue/DualGhostSpark.stories.tsx +258 -0
  31. package/src/components/custom/Fatigue/DualGhostSpark.test.tsx +138 -0
  32. package/src/components/custom/Fatigue/DualGhostSpark.tsx +208 -0
  33. package/src/components/custom/Fatigue/FatigueLights.stories.tsx +74 -0
  34. package/src/components/custom/Fatigue/FatigueLights.test.tsx +33 -0
  35. package/src/components/custom/Fatigue/FatigueLights.tsx +83 -0
  36. package/src/components/custom/Fatigue/GhostBand.test.tsx +235 -0
  37. package/src/components/custom/Fatigue/GhostBand.tsx +246 -0
  38. package/src/components/custom/Fatigue/GhostBloom.tsx +132 -0
  39. package/src/components/custom/Fatigue/GhostSpark.stories.tsx +175 -0
  40. package/src/components/custom/Fatigue/GhostSpark.test.tsx +45 -0
  41. package/src/components/custom/Fatigue/GhostSpark.tsx +126 -0
  42. package/src/components/custom/Fatigue/LiveFatigueCard.stories.tsx +126 -0
  43. package/src/components/custom/Fatigue/LiveFatigueCard.test.tsx +28 -0
  44. package/src/components/custom/Fatigue/LiveFatigueCard.tsx +86 -0
  45. package/src/components/custom/Fatigue/LiveFatiguePanel.stories.tsx +95 -0
  46. package/src/components/custom/Fatigue/LiveFatiguePanel.tsx +151 -0
  47. package/src/components/custom/Fatigue/README.md +93 -0
  48. package/src/components/custom/Fatigue/RomProgressionChart.stories.tsx +94 -0
  49. package/src/components/custom/Fatigue/RomProgressionChart.test.tsx +31 -0
  50. package/src/components/custom/Fatigue/RomProgressionChart.tsx +132 -0
  51. package/src/components/custom/Fatigue/SilverRedPalette.stories.tsx +226 -0
  52. package/src/components/custom/Fatigue/VelocityHero.stories.tsx +70 -0
  53. package/src/components/custom/Fatigue/VelocityHero.test.tsx +26 -0
  54. package/src/components/custom/Fatigue/VelocityHero.tsx +46 -0
  55. package/src/components/custom/Fatigue/VerdictHero.stories.tsx +59 -0
  56. package/src/components/custom/Fatigue/VerdictHero.test.tsx +49 -0
  57. package/src/components/custom/Fatigue/VerdictHero.tsx +79 -0
  58. package/src/components/custom/Fatigue/fatigue-mock.test.ts +59 -0
  59. package/src/components/custom/Fatigue/fatigue-mock.ts +268 -0
  60. package/src/components/custom/Fatigue/fatigue-model.ts +129 -0
  61. package/src/components/custom/Fatigue/fatigue-tokens.test.ts +70 -0
  62. package/src/components/custom/Fatigue/fatigue-tokens.ts +180 -0
  63. package/src/components/custom/Fatigue/index.ts +41 -0
  64. package/src/components/custom/Fatigue/tempo-pacing.test.ts +176 -0
  65. package/src/components/custom/Fatigue/tempo-pacing.ts +112 -0
  66. package/src/components/custom/Workout/BaseBadge.tsx +5 -5
  67. package/src/components/custom/Workout/DualVelocityStrip.test.tsx +685 -0
  68. package/src/components/custom/Workout/ExerciseCard.test.tsx +4 -4
  69. package/src/components/custom/Workout/ExerciseCard.tsx +3 -1
  70. package/src/components/custom/Workout/ExerciseDetailPage.tsx +7 -1
  71. package/src/components/custom/Workout/README.md +62 -16
  72. package/src/components/custom/Workout/RowInventory.stories.tsx +5 -2
  73. package/src/components/custom/Workout/S3FullRail.stories.tsx +13 -1
  74. package/src/components/custom/Workout/SegmentedBar.stories.tsx +3 -3
  75. package/src/components/custom/Workout/SessionHeader.tsx +2 -2
  76. package/src/components/custom/Workout/SessionRail.stories.tsx +4 -1
  77. package/src/components/custom/Workout/SessionRail.test.tsx +43 -0
  78. package/src/components/custom/Workout/SessionRail.tsx +55 -18
  79. package/src/components/custom/Workout/SetRow.test.tsx +6 -6
  80. package/src/components/custom/Workout/SetRow.tsx +9 -2
  81. package/src/components/custom/Workout/SupersetWrapper.stories.tsx +16 -25
  82. package/src/components/custom/Workout/SupersetWrapper.tsx +1 -1
  83. package/src/components/custom/Workout/TempoDisplay.tsx +3 -7
  84. package/src/components/custom/Workout/VelocityStrip.compact.stories.tsx +191 -0
  85. package/src/components/custom/Workout/VelocityStrip.dual.stories.tsx +186 -0
  86. package/src/components/custom/Workout/VelocityStrip.expanded.stories.tsx +296 -0
  87. package/src/components/custom/Workout/VelocityStrip.hero.stories.tsx +259 -0
  88. package/src/components/custom/Workout/VelocityStrip.stories.tsx +217 -250
  89. package/src/components/custom/Workout/VelocityStrip.test.tsx +196 -79
  90. package/src/components/custom/Workout/VelocityStrip.tsx +953 -609
  91. package/src/components/custom/Workout/VolumeLandmarkBar.stories.tsx +4 -1
  92. package/src/components/custom/Workout/WorkoutPill.tsx +2 -2
  93. package/src/components/custom/Workout/index.ts +3 -0
  94. package/src/components/custom/Workout/velocity-story-kit.tsx +438 -0
  95. package/src/components/custom/charts/SetBarChart.test.tsx +275 -0
  96. package/src/components/custom/charts/SetBarChart.tsx +651 -0
  97. package/src/components/custom/charts/live-rep-growth.ts +91 -0
  98. package/src/components/custom/index.ts +1 -0
  99. package/src/components/ui/surface/Surface.stories.tsx +195 -1
  100. package/src/components/ui/surface/Surface.test.tsx +148 -9
  101. package/src/components/ui/surface/Surface.tsx +37 -9
  102. package/src/components/ui/surface/SurfaceContext.ts +48 -8
  103. package/src/components/ui/surface/index.ts +1 -0
  104. package/src/components/ui/surface/surface.contract.test.ts +283 -0
  105. package/src/test/raw-color-patterns.test.ts +71 -0
  106. package/src/theme/ColorPalettes.stories.tsx +871 -0
  107. package/src/theme/ColorPrimitives.stories.tsx +300 -0
  108. package/src/theme/bar-paper.ts +59 -0
  109. package/src/theme/color-stories.coverage.test.ts +130 -0
  110. package/src/theme/color-story-kit.tsx +170 -0
  111. package/src/theme/config.ts +12 -0
  112. package/src/theme/elevation.ts +90 -67
  113. package/src/theme/global.css +35 -9
  114. package/src/theme/tokens/primitives.ts +40 -0
  115. package/src/theme/tokens/semantic.ts +63 -14
  116. package/tailwind.config.js +8 -0
  117. package/src/components/custom/Workout/VelocityStrip.modalities.stories.tsx +0 -254
  118. package/src/components/custom/Workout/VelocityStrip.responsive.stories.tsx +0 -145
  119. package/src/theme/ColorSystem.stories.tsx +0 -323
  120. package/src/theme/Colors.stories.tsx +0 -323
@@ -77,6 +77,21 @@ var primitiveColors = {
77
77
  black: "#000000",
78
78
  transparent: "transparent"
79
79
  };
80
+ var surfaceRampDark = {
81
+ inset: "#13100D",
82
+ // L*4.5 — sub-shell well / pressed
83
+ background: "#1C1916",
84
+ // L*9 — shell / frame
85
+ base: "#252321",
86
+ // L*13.5 — main content plane
87
+ elevated: "#2C2A28",
88
+ // L*17 — nav / rail
89
+ raised: "#31302F",
90
+ // L*20 — cards
91
+ overlay: "#373635"
92
+ // L*22.5 — hero / popover
93
+ };
94
+ var backgroundFrameDark = "#100D0A";
80
95
  var primitiveRamps = {
81
96
  red: {
82
97
  50: "#FFF4F4",
@@ -544,10 +559,19 @@ var semanticColorsLight = {
544
559
  "surface-overlay": primitiveColors.white,
545
560
  "surface-input": primitiveColors.neutral[50],
546
561
  // Input field background (filled variant)
562
+ // Deepest pressed pit (TD-surface-tokens, S-3) — light-mode counterpart of
563
+ // the dark ramp's `inset` plane; a placeholder pairing, not part of the
564
+ // dark-ramp investigation (surface.contract.test.ts is dark-mode only).
565
+ "surface-inset": primitiveColors.neutral[300],
547
566
  // Background colors (background-*)
548
567
  "background-base": "#EBEBEB",
549
568
  "background-default": primitiveColors.white,
550
569
  "background-subtle": primitiveColors.neutral[50],
570
+ // Frame/bezel chrome (TD-surface-tokens, S-3) — top bar + side nav shell,
571
+ // one step below `background-base` (darker still than `surface-inset`
572
+ // above, mirroring the dark-mode ordering). Placeholder pairing for light
573
+ // mode (see dark-mode note on `surface-inset` above).
574
+ "background-frame": primitiveColors.neutral[400],
551
575
  // Border colors (border-*)
552
576
  "border-default": "#E8E9EB",
553
577
  "border-subtle": primitiveColors.neutral[100],
@@ -563,6 +587,11 @@ var semanticColorsLight = {
563
587
  // Input field border on focus
564
588
  "border-input-error": primitiveColors.red[600],
565
589
  // Input field border on error
590
+ // Alpha hairline separators (surface-independent — composite toward black on
591
+ // light surfaces, mirroring the dark-mode white-alpha family). See §4/S-2.
592
+ "hairline-subtle": "rgba(0, 0, 0, 0.06)",
593
+ "hairline-default": "rgba(0, 0, 0, 0.09)",
594
+ "hairline-strong": "rgba(0, 0, 0, 0.14)",
566
595
  // Interactive states (interactive-*)
567
596
  "interactive-hover": "rgba(55, 65, 81, 0.04)",
568
597
  "interactive-focus": "rgba(55, 65, 81, 0.12)",
@@ -655,25 +684,46 @@ var semanticColorsDark = {
655
684
  "text-inverse": primitiveColors.neutral[900],
656
685
  "text-link": "#828DF8",
657
686
  "text-link-hover": primitiveColors.blue[400],
658
- // Surface colors - dark backgrounds
659
- "surface-base": primitiveColors.charcoal[700],
660
- // main surface
661
- "surface-elevated": primitiveColors.charcoal[600],
662
- // elevated surface
663
- "surface-raised": primitiveColors.charcoal[500],
664
- // raised surface
665
- "surface-overlay": primitiveColors.charcoal[600],
666
- // overlay surface
667
- "surface-input": primitiveColors.charcoal[600],
668
- // input surface
669
- // Background colors
670
- "background-base": primitiveColors.charcoal[900],
671
- // darkest charcoal
672
- "background-default": primitiveColors.charcoal[700],
673
- // main background
674
- "background-subtle": primitiveColors.charcoal[500],
675
- // subtle background
676
- // Border colors
687
+ // Surface colors - dark backgrounds — warm-tapered DERIVED ramp (TD-surface-tokens,
688
+ // S-1, re-spaced S-3). Shipped verbatim from `deriveSurfaceRamp()` — see
689
+ // `surfaceRampDark` in primitives.ts for the full derivation note. `surface-overlay`
690
+ // and `surface-elevated` are distinct (were both #191919 pre-S-1); `surface-input`
691
+ // tracks one plane above `surface-base`, same relative position as before the remap.
692
+ // `background-base` backs `Surface level="background"` (SurfaceContext.SURFACE_LEVEL_TOKEN),
693
+ // so it takes the ramp's `background` (shell/frame) role, NOT `inset`. The ramp's
694
+ // deepest `inset` plane is now promoted to `surface-inset` below (S-3) — still no
695
+ // `SurfaceLevel` member for it (follow-up, alongside the elevation.ts -1/-2 pressed
696
+ // levels — parallel workstream, not this branch).
697
+ "surface-base": surfaceRampDark.base,
698
+ // main surface (#252321, L*13.5)
699
+ "surface-elevated": surfaceRampDark.elevated,
700
+ // elevated surface (#2C2A28, L*17 — nav/rail)
701
+ "surface-raised": surfaceRampDark.raised,
702
+ // raised surface (#31302F, L*20 — cards)
703
+ "surface-overlay": surfaceRampDark.overlay,
704
+ // overlay surface (#373635, L*22.5 — hero/popover)
705
+ "surface-input": surfaceRampDark.elevated,
706
+ // input surface (#2C2A28 — one plane above base)
707
+ "surface-inset": surfaceRampDark.inset,
708
+ // deepest pressed pit (#13100D, L*4.5 — sub-shell well)
709
+ // Background colors — same ramp, the frame/shell end of it.
710
+ "background-base": surfaceRampDark.background,
711
+ // shell / frame (#1C1916, L*9 — Surface level="background")
712
+ "background-default": surfaceRampDark.base,
713
+ // main background (#252321, L*13.5 — matches surface-base)
714
+ "background-subtle": surfaceRampDark.elevated,
715
+ // subtle background (#2C2A28, L*17 — matches surface-elevated)
716
+ // Frame/bezel chrome (S-3) — the top bar + side nav shell; one step BELOW
717
+ // `background-base`, darker even than `surface-inset` — it exits the content
718
+ // ramp entirely rather than sitting in it. See `backgroundFrameDark` in
719
+ // primitives.ts.
720
+ "background-frame": backgroundFrameDark,
721
+ // frame / bezel (#100D0A, L*3.79)
722
+ // Border colors — `border-subtle` (#1C1C1C) previously collided with
723
+ // `surface-raised` (also #1C1C1C, an invisible border on raised cards). The
724
+ // re-spaced ramp above moved `surface-raised` to #2D2C2B, so this value is now
725
+ // distinct from every surface hex without needing to change it — see
726
+ // `surface.contract.test.ts` R2/R4.
677
727
  "border-default": primitiveColors.charcoal[400],
678
728
  // default border
679
729
  "border-subtle": primitiveColors.charcoal[500],
@@ -687,6 +737,14 @@ var semanticColorsDark = {
687
737
  "border-input-hover": primitiveColors.neutral[500],
688
738
  "border-input-focus": "#828DF8",
689
739
  "border-input-error": primitiveColors.red[500],
740
+ // Alpha hairline separators — the primary separation cue (§4/S-2). Self-
741
+ // normalizing: composites toward white by ~the same amount on ANY plane, so
742
+ // one family works at every elevation instead of per-surface border tokens.
743
+ // Shadows are demoted to floating-overlay use only (not shipped as a fill
744
+ // separator here — see elevation.ts, follow-up S-4).
745
+ "hairline-subtle": "rgba(255, 255, 255, 0.06)",
746
+ "hairline-default": "rgba(255, 255, 255, 0.09)",
747
+ "hairline-strong": "rgba(255, 255, 255, 0.14)",
690
748
  // Interactive states
691
749
  "interactive-hover": "rgba(255, 255, 255, 0.04)",
692
750
  "interactive-focus": "rgba(255, 255, 255, 0.12)",
@@ -864,9 +922,11 @@ var lightThemeCSSVars = {
864
922
  "--color-surface-base": semanticColorsLight["surface-base"],
865
923
  "--color-surface-elevated": semanticColorsLight["surface-elevated"],
866
924
  "--color-surface-raised": semanticColorsLight["surface-raised"],
925
+ "--color-surface-inset": semanticColorsLight["surface-inset"],
867
926
  "--color-background-base": semanticColorsLight["background-base"],
868
927
  "--color-background-default": semanticColorsLight["background-default"],
869
928
  "--color-background-subtle": semanticColorsLight["background-subtle"],
929
+ "--color-background-frame": semanticColorsLight["background-frame"],
870
930
  "--color-border-default": semanticColorsLight["border-default"],
871
931
  "--color-border-subtle": semanticColorsLight["border-subtle"],
872
932
  "--color-border-strong": semanticColorsLight["border-strong"],
@@ -923,6 +983,9 @@ var lightThemeCSSVars = {
923
983
  "--color-border-input-hover": semanticColorsLight["border-input-hover"],
924
984
  "--color-border-input-focus": semanticColorsLight["border-input-focus"],
925
985
  "--color-border-input-error": semanticColorsLight["border-input-error"],
986
+ "--color-hairline-subtle": semanticColorsLight["hairline-subtle"],
987
+ "--color-hairline-default": semanticColorsLight["hairline-default"],
988
+ "--color-hairline-strong": semanticColorsLight["hairline-strong"],
926
989
  "--color-interactive-disabled-text": semanticColorsLight["interactive-disabled-text"],
927
990
  "--color-avatar-background": semanticColorsLight["avatar-background"],
928
991
  "--color-avatar-text": semanticColorsLight["avatar-text"],
@@ -962,9 +1025,11 @@ var darkThemeCSSVars = {
962
1025
  "--color-surface-base": semanticColorsDark["surface-base"],
963
1026
  "--color-surface-elevated": semanticColorsDark["surface-elevated"],
964
1027
  "--color-surface-raised": semanticColorsDark["surface-raised"],
1028
+ "--color-surface-inset": semanticColorsDark["surface-inset"],
965
1029
  "--color-background-base": semanticColorsDark["background-base"],
966
1030
  "--color-background-default": semanticColorsDark["background-default"],
967
1031
  "--color-background-subtle": semanticColorsDark["background-subtle"],
1032
+ "--color-background-frame": semanticColorsDark["background-frame"],
968
1033
  "--color-border-default": semanticColorsDark["border-default"],
969
1034
  "--color-border-subtle": semanticColorsDark["border-subtle"],
970
1035
  "--color-border-strong": semanticColorsDark["border-strong"],
@@ -1021,6 +1086,9 @@ var darkThemeCSSVars = {
1021
1086
  "--color-border-input-hover": semanticColorsDark["border-input-hover"],
1022
1087
  "--color-border-input-focus": semanticColorsDark["border-input-focus"],
1023
1088
  "--color-border-input-error": semanticColorsDark["border-input-error"],
1089
+ "--color-hairline-subtle": semanticColorsDark["hairline-subtle"],
1090
+ "--color-hairline-default": semanticColorsDark["hairline-default"],
1091
+ "--color-hairline-strong": semanticColorsDark["hairline-strong"],
1024
1092
  "--color-interactive-disabled-text": semanticColorsDark["interactive-disabled-text"],
1025
1093
  "--color-avatar-background": semanticColorsDark["avatar-background"],
1026
1094
  "--color-avatar-text": semanticColorsDark["avatar-text"],
@@ -1655,6 +1723,10 @@ function getElevationShadow(baseColor, level, theme, isHovered = false) {
1655
1723
  elevationShadowCache.set(cacheKey, result);
1656
1724
  return result;
1657
1725
  }
1726
+ var PRESSED_ELEVATION_LEVEL = -1;
1727
+ function getPressedRecessShadow(fillColor, theme) {
1728
+ return getElevationShadow(fillColor, PRESSED_ELEVATION_LEVEL, theme);
1729
+ }
1658
1730
  function getBaseSurfaceColor(theme) {
1659
1731
  return theme === "light" ? semanticColorsLight["surface-raised"] : semanticColorsDark["surface-elevated"];
1660
1732
  }
@@ -1985,6 +2057,6 @@ function ThemeProvider({
1985
2057
  return /* @__PURE__ */ jsx(SurfaceContext.Provider, { value: { mode: resolved, level: "base" }, children: /* @__PURE__ */ jsx(View, { style: [MODE_VARS[resolved], { flex: 1 }, style], ...props, children }) });
1986
2058
  }
1987
2059
 
1988
- export { CATEGORICAL_CVD_SAFE_MAX, ThemeProvider, applyThemePreset, audiobookPreset, bestTextColor, buttonSizes, categoricalPalette, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, defaultPreset, discreteRainbow, divergingScale, elevationSystem, getBaseSurfaceColor, getCategoricalColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isCssPropertyManifest, isDark, lightThemeCSSVars, lighten, linearGradient, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveRamps, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, resolveColor, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, sequentialEffort, shadowColors, surfaceGradient, validateCssPropertyManifest };
2060
+ export { CATEGORICAL_CVD_SAFE_MAX, PRESSED_ELEVATION_LEVEL, ThemeProvider, applyThemePreset, audiobookPreset, backgroundFrameDark, bestTextColor, buttonSizes, categoricalPalette, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, defaultPreset, discreteRainbow, divergingScale, elevationSystem, getBaseSurfaceColor, getCategoricalColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getPressedRecessShadow, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isCssPropertyManifest, isDark, lightThemeCSSVars, lighten, linearGradient, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveRamps, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, resolveColor, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, sequentialEffort, shadowColors, surfaceGradient, surfaceRampDark, validateCssPropertyManifest };
1989
2061
  //# sourceMappingURL=index.mjs.map
1990
2062
  //# sourceMappingURL=index.mjs.map