Files
CatoandClaude 141f60e88c feat(charts): trends, check-in strip and meters on @bitbaum/chartkit 0.7 (#138)
ChartKit 0.7.0 closes the three gaps recorded in package-plan.json
(#136): LineChart labels days on short spans, Sparkline takes per-point
tones and null gaps, and Meter takes a tone and showValue={false}.

- CheckinTrendChart and AssessmentTrendChart render ChartKit's
  LineChart on the server, dated by ISO day in the app's en-GB locale.
  Callers pass the day instead of a pre-formatted label, and the
  assessments page drops its client wrapper.
- The patients table's 7-day strip is a Sparkline: one point a day,
  toned by wellness level (SPARK_LEVEL_TONES), a gap on a day without a
  check-in, and the counts in its accessible name.
- Dimension score bars (/assessments, the public results overlay) and
  the reports adherence bars are toned Meters; scoreColor becomes
  scoreTone. The overlay sets --ck-line to its own hairline.
- --ck-series-4 maps to the gold: it defaulted to --ck-up, the same
  teal as the accent, so Energy and Focus drew in one colour.
- recharts, the metric colour field, --purple and the bar/dot CSS are
  removed; the design gate's allowlist drops the three files that no
  longer need a style prop. All three exceptions leave package-plan.json.


Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-29 20:06:50 +01:00

531 lines
8.9 KiB
CSS

.overlay {
position: fixed;
inset: 0;
background: var(--ink);
z-index: 200;
overflow-y: auto;
display: flex;
flex-direction: column;
}
/* Embedded variant — the portal /assessment page renders the instrument
INSIDE the portal shell (sidebar + header stay visible) instead of
hijacking the whole viewport like the marketing overlay does. The fixed
children (progress bar, close button) become absolute within this frame. */
.embedded {
position: relative;
inset: auto;
z-index: auto;
border-radius: var(--radius-xl);
min-height: calc(100vh - 14rem);
overflow: hidden;
}
.embedded .ovPb {
position: absolute;
}
.embedded .ovClose {
position: absolute;
}
.ovPb {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 3px;
background: var(--white-5);
z-index: 201;
}
.ovPbFill {
height: 100%;
background: var(--teal);
transition: width var(--transition-slow);
}
.ovClose {
position: fixed;
top: 1.2rem;
right: 1.5rem;
background: none;
border: 1px solid var(--white-10);
color: var(--white-40);
font-size: 1.2rem;
width: 2.2rem;
height: 2.2rem;
cursor: pointer;
border-radius: var(--radius-full);
z-index: 202;
display: flex;
align-items: center;
justify-content: center;
transition: all var(--transition-normal);
}
.ovClose:hover {
border-color: var(--teal);
color: var(--teal);
}
.ovClose:focus-visible {
outline: 2px solid var(--teal);
outline-offset: 2px;
}
.ovScreen {
display: none;
max-width: 700px;
margin: 0 auto;
padding: 5rem 2rem;
width: 100%;
}
.active {
display: block;
}
.ovEyebrow {
font-size: 0.55rem;
letter-spacing: 0.3em;
text-transform: uppercase;
color: var(--teal-60);
margin-bottom: 1.5rem;
}
.ovH1 {
font-family: var(--font-cormorant), serif;
font-size: 3.5rem;
font-weight: 300;
color: var(--white);
line-height: 1.1;
}
.ovH1 em {
font-style: italic;
color: var(--teal);
}
.ovH2 {
font-family: var(--font-cormorant), serif;
font-size: 1.2rem;
font-weight: 300;
color: var(--white-30);
margin-top: 0.8rem;
}
.ovSub {
font-size: 0.82rem;
color: var(--white-30);
line-height: 1.85;
margin-top: 1.5rem;
max-width: 32rem;
}
.ovStats {
display: flex;
gap: 3rem;
margin-top: 2rem;
}
.ovStatN {
font-family: var(--font-cormorant), serif;
font-size: 1.8rem;
color: var(--white);
}
.ovStatL {
font-size: 0.6rem;
letter-spacing: 0.15em;
text-transform: uppercase;
color: var(--white-20);
}
.ovDims {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
gap: 0.5rem;
margin-top: 2rem;
}
.ovDim {
background: var(--white-3);
border: 1px solid var(--white-6);
border-radius: var(--radius-sm);
padding: 0.8rem;
text-align: center;
}
.ovDimIcon {
font-size: 1.2rem;
margin-bottom: 0.3rem;
}
.ovDimName {
font-size: 0.55rem;
letter-spacing: 0.1em;
color: var(--white-25);
}
.ovStartBtn {
background: var(--teal);
color: var(--white);
border: none;
padding: 1rem 2.5rem;
font-size: 0.7rem;
letter-spacing: 0.16em;
text-transform: uppercase;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-sm);
margin-top: 2.5rem;
transition: background var(--transition-normal);
}
.ovStartBtn:hover {
background: var(--teal-dark);
}
.ovStartBtn:focus-visible {
outline: 2px solid var(--teal);
outline-offset: 2px;
}
.ovDisc {
font-size: 0.6rem;
color: var(--white-12);
margin-top: 1.5rem;
}
/* Question screen */
.qDimLabel {
font-size: 0.6rem;
letter-spacing: 0.2em;
text-transform: uppercase;
color: var(--teal);
margin-bottom: 0.5rem;
}
.qProg {
font-size: 0.6rem;
color: var(--white-20);
margin-bottom: 0.3rem;
}
.qTrack {
height: 2px;
background: var(--white-5);
border-radius: var(--radius-2xs);
margin-bottom: 2rem;
}
.qTrackFill {
height: 100%;
background: var(--teal);
border-radius: var(--radius-2xs);
transition: width var(--transition-normal);
}
.qText {
font-family: var(--font-cormorant), serif;
font-size: 1.5rem;
font-weight: 300;
color: var(--white);
line-height: 1.4;
margin-bottom: 2rem;
}
.qBtns {
display: flex;
gap: 0.4rem;
margin-bottom: 2rem;
flex-wrap: wrap;
}
.qBtn {
width: 3rem;
height: 3rem;
border-radius: var(--radius-sm);
border: 1px solid var(--white-10);
background: none;
color: var(--white-30);
font-size: 0.85rem;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
transition: all var(--transition-fast);
}
.qBtn:hover {
border-color: var(--teal);
color: var(--teal);
}
.qBtn:focus-visible {
outline: 2px solid var(--teal);
outline-offset: 2px;
}
.selected {
background: var(--teal);
border-color: var(--teal);
color: var(--white);
}
.qScale {
display: flex;
justify-content: space-between;
font-size: 0.6rem;
color: var(--white-15);
margin-top: -1.2rem;
margin-bottom: 2rem;
}
.qNav {
display: flex;
gap: 0.6rem;
}
.qPrev {
background: none;
border: 1px solid var(--white-10);
color: var(--white-30);
padding: 0.6rem 1.5rem;
font-size: 0.65rem;
letter-spacing: 0.14em;
text-transform: uppercase;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-xs);
transition: all var(--transition-normal);
}
.qPrev:hover {
border-color: var(--teal);
color: var(--teal);
}
.qPrev:focus-visible,
.qNext:focus-visible {
outline: 2px solid var(--teal);
outline-offset: 2px;
}
.qPrev:disabled {
opacity: 0.2;
cursor: default;
}
.qNext:disabled {
cursor: default;
}
.qNext {
background: var(--white-5);
border: none;
color: var(--white-15);
padding: 0.6rem 1.5rem;
font-size: 0.65rem;
letter-spacing: 0.14em;
text-transform: uppercase;
cursor: default;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-xs);
transition: all var(--transition-normal);
}
.enabled {
background: var(--teal);
color: var(--white);
cursor: pointer;
}
/* Results screen */
.vCard {
background: var(--white-3);
border: 1px solid var(--white-6);
border-radius: var(--radius-lg);
padding: 2.5rem;
text-align: center;
margin-bottom: 2rem;
}
.vScore {
font-family: var(--font-cormorant), serif;
font-size: 4rem;
font-weight: 300;
color: var(--teal);
}
.vScore span {
font-size: 1.5rem;
color: var(--teal-50);
}
.vName {
font-family: var(--font-cormorant), serif;
font-size: 1.3rem;
color: var(--white);
margin: 0.5rem 0;
}
.vText {
font-size: 0.8rem;
color: var(--white-35);
line-height: 1.8;
max-width: 28rem;
margin: 0 auto;
}
.rScores {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0.8rem;
margin-bottom: 2.5rem;
}
.rScoreCard {
background: var(--white-3);
border-radius: var(--radius-sm);
padding: 1rem;
text-align: center;
}
.rScIcon {
font-size: 1.2rem;
margin-bottom: 0.3rem;
}
.rScName {
font-size: 0.55rem;
letter-spacing: 0.1em;
color: var(--white-25);
margin-bottom: 0.4rem;
}
.rScN {
font-family: var(--font-cormorant), serif;
font-size: 1.4rem;
font-weight: 300;
}
/* ChartKit meters on the dark overlay: the track takes the overlay's hairline. */
.rScores,
.rDim {
--ck-line: var(--white-5);
}
.rScMeter {
margin-top: 0.5rem;
}
.rDim {
margin-bottom: 1.5rem;
}
.rDimTop {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.4rem;
}
.rDimName {
font-size: 0.7rem;
letter-spacing: 0.1em;
color: var(--white-40);
}
.rDimScore {
font-family: var(--font-cormorant), serif;
font-size: 1.1rem;
}
.rDimMeter {
margin-bottom: 0.6rem;
}
.rDimText {
font-size: 0.78rem;
color: var(--white-30);
line-height: 1.75;
}
.rCta {
text-align: center;
margin-top: 3rem;
padding: 2rem;
background: var(--teal-8);
border-radius: var(--radius-md);
}
.rCtaTitle {
font-family: var(--font-cormorant), serif;
font-size: 1.4rem;
color: var(--white);
margin-bottom: 0.5rem;
}
.rCtaSub {
font-size: 0.83rem;
color: var(--muted);
margin-bottom: 1.5rem;
}
.rCtaSubSpaced {
composes: rCtaSub;
margin-top: 0.5rem;
}
.rCtaBtns {
display: flex;
gap: 0.7rem;
justify-content: center;
flex-wrap: wrap;
}
.rBtnP {
background: var(--teal);
color: var(--white);
border: none;
padding: 0.8rem 2rem;
font-size: 0.7rem;
letter-spacing: 0.16em;
text-transform: uppercase;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-sm);
text-decoration: none;
display: inline-block;
}
.rBtnO {
border: 1px solid var(--teal-30);
color: var(--teal);
background: none;
padding: 0.8rem 2rem;
font-size: 0.7rem;
letter-spacing: 0.16em;
text-transform: uppercase;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-sm);
}
@media (max-width: 767px) {
.ovClose,
.ovStartBtn,
.qPrev,
.qNext,
.rBtnP,
.rBtnO {
min-height: 2.75rem;
}
}
@media (min-width: 768px) {
.rScores {
grid-template-columns: repeat(5, 1fr);
}
}