@ihabdevteam/core 0.414.0 → 0.415.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.
@@ -334,7 +334,7 @@ export declare function balancedColumns(count: number, perRow: number): number;
334
334
  * - 주(week): 'YYYY년 M월 N째주' 드롭다운 + 그 주의 요일(월~일) 막대
335
335
  * 원시 렌더링은 내부 BarChartCanvas가 담당한다.
336
336
  */
337
- export declare function BarChart({ canvasHeight, focusableBars, size, barWidth, titleKey, titleLevel, data, colorA, colorB, labelAKey, labelBKey, showTotal, totalUnitKey, totalLabelKey, control: controlProp, hideControls, rate, rateAgg, tightMax, avgMode, totalFormat, series, seriesMode, loading, onDetail, headExtra, headSegment, icon, disc, onClick, cardAriaLabel, cardTooltip, detailSize, barGap, baseline, className, inGrid, }: BarChartProps): JSX.Element;
337
+ export declare function BarChart({ canvasHeight, fitHeight, focusableBars, size, barWidth, titleKey, titleLevel, data, colorA, colorB, labelAKey, labelBKey, showTotal, totalUnitKey, totalLabelKey, control: controlProp, hideControls, rate, rateAgg, tightMax, avgMode, totalFormat, series, seriesMode, loading, onDetail, headExtra, headSegment, icon, disc, onClick, cardAriaLabel, cardTooltip, detailSize, barGap, baseline, className, inGrid, }: BarChartProps): JSX.Element;
338
338
 
339
339
  /** @public */
340
340
  export declare interface BarChartControl {
@@ -410,6 +410,14 @@ export declare interface BarChartProps {
410
410
  * 모든 차트의 막대 셈을 흔들 일이 아니다.
411
411
  */
412
412
  canvasHeight?: number;
413
+ /** **카드에 남은 자리에 판을 맞춘다** — 카드 키가 박혀 있는 자리(사장님 지시 2026-11-02
414
+ * "높이 260 으로 고정시키고 그 안에 그래프가 맞춰지도록 해").
415
+ *
416
+ * `canvasHeight` 는 **손으로 맞춘 수**라, 머리·x축이 한 눈금만 달라져도 카드가 그만큼
417
+ * 넘치거나 모자랐다(2026-11-02 에 x축이 두 줄로 돌아가며 260 이 270 이 됐다 — 격자에서
418
+ * 곁 카드의 바닥이 어긋났다). 이것을 켜면 **그린 뒤 남은 키를 재서** 쓰므로 그 손질이
419
+ * 필요 없다. 카드가 제 키를 고정하고 있어야 뜻이 있다(`inGrid` 격자 카드). */
420
+ fitHeight?: boolean;
413
421
  /** 섹션 제목 i18n 키 */
414
422
  titleKey: string;
415
423
  /** 제목을 머리글 몇 급으로 그릴지 — 그대로 `ChartSection` 에 넘긴다(말귀 요청 (60)③, 2026-10-02).
@@ -1272,7 +1280,7 @@ export declare interface ChartPoint {
1272
1280
  * 공유하도록 두 컴포넌트가 내부적으로 사용한다.
1273
1281
  * @public
1274
1282
  */
1275
- export declare function ChartSection({ type, title, titleClassName, titleLevel, icon, disc, headRight, headFloat, headSegment, headMenuItems, collapseBelow, onClick, ariaLabel, tooltip, totalNum, totalUnit, totalLabel, change, changeType, size, bodyAlign, subRow, subRowAlign, className, inGrid, children }: ChartSectionProps): JSX.Element;
1283
+ export declare function ChartSection({ type, title, titleClassName, titleLevel, icon, disc, headRight, headFloat, headSegment, headMenuItems, collapseBelow, onClick, ariaLabel, tooltip, totalNum, totalUnit, totalMuted, totalLabel, change, changeType, size, bodyAlign, subRow, legend, subRowAlign, className, inGrid, fitBody, children }: ChartSectionProps): JSX.Element;
1276
1284
 
1277
1285
  /** @public */
1278
1286
  export declare interface ChartSectionProps {
@@ -1343,6 +1351,12 @@ export declare interface ChartSectionProps {
1343
1351
  totalNum?: ReactNode;
1344
1352
  /** 수 뒤 단위(`%` 등) — `totalNum` 과 함께 쓴다 */
1345
1353
  totalUnit?: ReactNode;
1354
+ /** 값이 **수가 아니라 빈 것을 이르는 말**일 때(`없음` 등) — 글자를 `lightGray` 로 낮춘다
1355
+ * (사장님 지시 2026-11-02 "없음은 lightGray 로").
1356
+ *
1357
+ * **코어는 그 글자를 못 알아본다** — `totalNum` 은 아무 노드나 받으므로 `없음`·`None`·`—` 이
1358
+ * 수인지 말인지 가릴 길이 없다. 그래서 **부르는 쪽이 말해 준다.** */
1359
+ totalMuted?: boolean;
1346
1360
  /** 수 앞 설명 한 줄 — 색을 입힌 대비 수치 등은 노드로 넘긴다(앱 규칙) */
1347
1361
  totalLabel?: ReactNode;
1348
1362
  /** 카드에 포인터가 닿을 때(키보드는 초점이 들어올 때) 뜨는 설명 — `StatChart tooltip` 과 같은 뜻.
@@ -1350,6 +1364,16 @@ export declare interface ChartSectionProps {
1350
1364
  tooltip?: string;
1351
1365
  /** 총계(ChartTotal) + 범례(ChartLegend)를 담는 서브로우 */
1352
1366
  subRow?: ReactNode;
1367
+ /** **범례 — 서브로우 밖의 제 자리**(사장님 지시 2026-11-02 "legend 를 sub row 에서 분리해서
1368
+ * 배치해줘. 상대적으로 위로 올라가있는걸 조정 못하겠어"). 서브로우 안에 수와 나란히 세우면
1369
+ * 수의 줄상자에 매여 **범례만 따로 올리고 내릴 손잡이가 없다.** 여기 주면 카드 오른쪽에
1370
+ * 따로 서고, 세로 자리는 `--legend-offset`(px, 기본 0 = 큰 수 줄의 윗선) 하나로 움직인다. */
1371
+ legend?: ReactNode;
1372
+ /** **카드 키를 박는다** — 속이 그 키에 **스스로 맞출 때만** 켠다(`BarChart fitHeight` 가 켠다).
1373
+ * 2026-11-02 에 이것을 `inGrid` 에 묶었더니 격자에 선 **모든** 차트 카드가 260 으로 박혀,
1374
+ * 속을 안 맞추는 고객 통계의 차트 여덟이 x축 둘째 줄을 카드 밖으로 흘렸다(사장님 "아따
1375
+ * 여기 죄다 깨졌네"). 격자에 섰다는 것과 속을 맞춘다는 것은 다른 말이다. */
1376
+ fitBody?: boolean;
1353
1377
  /** 서브로우에 선 것들의 **세로 맞춤** — `'start'`(기본) · `'center'` · `'end'`.
1354
1378
  *
1355
1379
  * 기본이 `'start'` 인 것은 **범례** 때문이다. 수(설명 한 줄 + 큰 수, 두 줄)와 범례가 함께 서면
@@ -1438,6 +1462,12 @@ export declare function ChartTotal({ label, children }: ChartTotalProps): JSX.El
1438
1462
  * 작은 카드만 CSS 로 크기를 덮어 맞췄는데, 그러면 **마크업에 적힌 단계가 아무 일도 안
1439
1463
  * 한다** — 글자를 고쳐도 화면이 안 바뀐다(사장님이 2026-11-02 에 짚으셨다). 단계를 한
1440
1464
  * 군데서 정하고, 부르는 쪽은 "작은 카드인가" 만 넘긴다.
1465
+ *
1466
+ * **큰 수의 이름은 이것 하나다**(사장님 지시 2026-11-02 — "하나는 sub-row고 하나는
1467
+ * section-content 네 하나로 통일해"). 수 칸만 `__value`·`__value-row` 라는 제 이름을
1468
+ * 따로 쓰고 있었다 — 같은 자리의 같은 수인데 규칙을 두 벌씩 써야 했고, 그날도 차트 쪽
1469
+ * 한 자리를 빠뜨려 큰 수의 윗여백이 그 카드만 안 들었다. 이제 **그리는 자리 다섯**
1470
+ * (수 칸 · 차트 카드 · 막대 합계 셋 · 고리 퍼센트)이 다 이 함수를 부른다.
1441
1471
  * @public
1442
1472
  */
1443
1473
  export declare const chartTotalNumClass: (small?: boolean) => string;
@@ -2037,7 +2067,7 @@ export declare function copyText(text: string): Promise<boolean>;
2037
2067
  *
2038
2068
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
2039
2069
  */
2040
- export declare const CORE_VERSION = "0.414.0";
2070
+ export declare const CORE_VERSION = "0.415.0";
2041
2071
 
2042
2072
  /** @public */
2043
2073
  declare const coreDefault: Record<string, unknown>;
@@ -30,6 +30,14 @@
30
30
  flex-direction: column;
31
31
  gap: var(--spacing-s);
32
32
  }
33
+ /* **속을 맞추는 카드(`--fit`)의 판은 남은 자리를 다 쓴다.** 그 카드는 키가 박혀 있고
34
+ (`fitBody` 면 `height: 260`), `fitHeight` 가 **이 상자의 키를 재서** 판 키로 삼는다 — 상자가 제 속을
35
+ 감싸고만 있으면 잴 것이 제 속뿐이라 **늘 지금 값이 나온다**(2026-11-02 에 그래서 못 늘었다).
36
+ `min-height: 0` 이 없으면 flex 자식이 제 속보다 작아지지 않아 카드를 넘긴다. */
37
+ .chart-section--fit .bar-chart__wrap {
38
+ flex: 1;
39
+ min-height: 0;
40
+ }
33
41
  .bar-chart__gridline {
34
42
  position: absolute;
35
43
  left: 0;
@@ -83,18 +91,18 @@
83
91
 
84
92
  /* 막대 컬럼(flex:1 중앙)과 동일하게 — 막대 중심과 라벨 중심을 수직 정렬.
85
93
  좁을 때 겹침 방지: 메인/서브를 세로 스택 + 줄바꿈 허용 */
86
- /* **칸 이름을 한 줄로**(사장님 지시 2026-11-02 — "한 줄로 처리하는 게 공간상 더
87
- 이득일 것 같다"). `7~13` 과 `첫째주` 를 위아래로 쌓으면 x축이 41px 을 먹는데, 칸 폭이
88
- 125 라 한 줄(`7~13 첫째주` ≈ 70)로도 넉넉하다. 날 보기(`2 월`)도 마찬가지다.
89
- 아낀 키는 막대가 쓴다. */
94
+ /* **두 줄로 되돌렸다**(사장님 지시 2026-11-02 — "이거 다시 두줄로 바꿔야 겠다").
95
+ 같은 날 한 줄로 바꿨는데(`7~13 첫째주`), 그때 잰 칸 폭 125 는 **넓은 화면의 차트**였다.
96
+ 대시보드의 좁은 차트는 칸이 70px 밖에 안 돼 `23~29 셋째주` 가 한 줄에 못 서고
97
+ **수 한가운데서 끊겼다**(`23~2` / `9`). 위아래로 쌓으면 수와 이름이 각자 한 줄을 쓴다. */
90
98
  .bar-chart__x-axis__label {
91
99
  flex: 1;
92
100
  min-width: 0;
93
101
  display: flex;
94
- flex-direction: row;
95
- align-items: baseline;
96
- justify-content: center;
97
- gap: 4px;
102
+ flex-direction: column;
103
+ align-items: center;
104
+ justify-content: flex-start;
105
+ gap: 1px;
98
106
  text-align: center;
99
107
  word-break: keep-all;
100
108
  }
@@ -13,4 +13,4 @@ import type { BarChartProps } from './barChartTypes';
13
13
  * - 주(week): 'YYYY년 M월 N째주' 드롭다운 + 그 주의 요일(월~일) 막대
14
14
  * 원시 렌더링은 내부 BarChartCanvas가 담당한다.
15
15
  */
16
- export default function BarChart({ canvasHeight, focusableBars, size, barWidth, titleKey, titleLevel, data, colorA, colorB, labelAKey, labelBKey, showTotal, totalUnitKey, totalLabelKey, control: controlProp, hideControls, rate, rateAgg, tightMax, avgMode, totalFormat, series, seriesMode, loading, onDetail, headExtra, headSegment, icon, disc, onClick, cardAriaLabel, cardTooltip, detailSize, barGap, baseline, className, inGrid, }: BarChartProps): import("react").JSX.Element;
16
+ export default function BarChart({ canvasHeight, fitHeight, focusableBars, size, barWidth, titleKey, titleLevel, data, colorA, colorB, labelAKey, labelBKey, showTotal, totalUnitKey, totalLabelKey, control: controlProp, hideControls, rate, rateAgg, tightMax, avgMode, totalFormat, series, seriesMode, loading, onDetail, headExtra, headSegment, icon, disc, onClick, cardAriaLabel, cardTooltip, detailSize, barGap, baseline, className, inGrid, }: BarChartProps): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import './BarChart.css';
4
- import { useState, useMemo, useCallback, useEffect } from 'react';
4
+ import { useState, useMemo, useCallback, useEffect, useLayoutEffect, useRef } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import Dropdown from './Dropdown';
7
7
  import SegmentedControl from './SegmentedControl';
@@ -22,7 +22,7 @@ function isFutureBar(d, showPast = true) {
22
22
  /* `baseline` 을 쓰는 차트는 −1 이 진짜 값이라 옛 표시를 보지 않는다 — 부르는 쪽이 옛표시=false 로 끈다 */
23
23
  return d.future === true || (showPast && d.a === -1);
24
24
  }
25
- function BarChartCanvas({ data, colorA, colorB, labelA, labelB, barWidth = 10, barGap = 1, height = 140, maxOverride, tightMax, seriesColors, seriesLabels, rateLabels, grouped = false, baseline, focusableBars = false }) {
25
+ function BarChartCanvas({ data, colorA, colorB, labelA, labelB, barWidth = 10, barGap = 1, height = 140, fitHeight = false, maxOverride, tightMax, seriesColors, seriesLabels, rateLabels, grouped = false, baseline, focusableBars = false }) {
26
26
  // colorB 미지정 시 단일 계열(A) 모드
27
27
  const single = !colorB;
28
28
  const stacked = !!(seriesColors && seriesColors.length > 0);
@@ -47,7 +47,40 @@ function BarChartCanvas({ data, colorA, colorB, labelA, labelB, barWidth = 10, b
47
47
  const m = base != null ? symmetricMax : maxVal;
48
48
  return maxOverride ?? (tightMax ? (m > 0 ? m : 10) : (Math.ceil(m / 10) * 10 || 10));
49
49
  }, [maxVal, symmetricMax, base, maxOverride, tightMax]);
50
- const h = height;
50
+ /* **남은 자리를 재서 판의 키로 쓴다**(`fitHeight`). 판 + x축이 `__wrap` 을 꽉 채우므로
51
+ `남은 키 = 감싼 상자 - x축` 이다. 감싼 상자는 `flex: 1` 이라 **속이 커져도 안 커진다** —
52
+ 그래서 되먹임이 돌지 않는다(그래도 1px 미만은 안 고친다). 처음 그릴 때는 잴 것이 없어
53
+ `height` 로 한 번 그리고, 그 직후(`useLayoutEffect`)에 재서 고친다 — 사람 눈에는 안 보인다. */
54
+ const wrapRef = useRef(null);
55
+ const axisRef = useRef(null);
56
+ const [fittedHeight, setFittedHeight] = useState(null);
57
+ useLayoutEffect(() => {
58
+ if (!fitHeight) {
59
+ setFittedHeight(null);
60
+ return;
61
+ }
62
+ const wrap = wrapRef.current;
63
+ if (!wrap)
64
+ return;
65
+ const measure = () => {
66
+ const axis = axisRef.current;
67
+ const left = wrap.clientHeight - (axis ? axis.getBoundingClientRect().height : 0);
68
+ if (left <= 0)
69
+ return;
70
+ setFittedHeight(prev => (prev != null && Math.abs(prev - left) < 1 ? prev : left));
71
+ };
72
+ measure();
73
+ /* 흉내 판(jsdom)에는 `ResizeObserver` 가 없다 — 없으면 한 번 잰 것으로 둔다.
74
+ 안 가리면 그리는 중에 터져 **부르는 쪽 시험이 통째로 빨개진다**(앱 78개, 2026-11-02). */
75
+ if (typeof ResizeObserver === 'undefined')
76
+ return;
77
+ const observer = new ResizeObserver(measure);
78
+ observer.observe(wrap);
79
+ if (axisRef.current)
80
+ observer.observe(axisRef.current);
81
+ return () => observer.disconnect();
82
+ }, [fitHeight]);
83
+ const h = fittedHeight ?? height;
51
84
  // 막대 너비 — 여백과 무관하게 막대 '개수'(컬럼 × 계열)가 늘수록 점진 축소(최대 barWidth)
52
85
  const barsPerCol = stacked ? (grouped ? Math.max(1, seriesColors.length) : 1) : (single ? 1 : 2);
53
86
  const effBarWidth = useMemo(() => {
@@ -147,7 +180,7 @@ function BarChartCanvas({ data, colorA, colorB, labelA, labelB, barWidth = 10, b
147
180
  document.removeEventListener('pointerdown', onOutsidePress, true);
148
181
  };
149
182
  }, [isOpen]);
150
- return (_jsxs("div", { className: withLegacy("bar-chart__wrap"), style: groupGapStyle, children: [_jsx("div", { className: withLegacy("bar-chart__inner"), children: _jsx("div", { className: withLegacy("bar-chart__scroll"), children: _jsxs("div", { className: withLegacy("bar-chart__area"), children: [_jsxs("div", { className: withLegacy("bar-chart__plot"), style: { height: h }, children: [ticks.slice(0, -1).map((t, i) => (
183
+ return (_jsxs("div", { ref: wrapRef, className: withLegacy("bar-chart__wrap"), style: groupGapStyle, children: [_jsx("div", { className: withLegacy("bar-chart__inner"), children: _jsx("div", { className: withLegacy("bar-chart__scroll"), children: _jsxs("div", { className: withLegacy("bar-chart__area"), children: [_jsxs("div", { className: withLegacy("bar-chart__plot"), style: { height: h }, children: [ticks.slice(0, -1).map((t, i) => (
151
184
  /* 눈금선은 **적힌 값의 높이**에 둔다 — 가운데 값을 반올림(최대 3 → '2')하면서 자리는 절반(1.5)에 두어 선과 숫자가 어긋났다 */
152
185
  _jsx("div", { className: withLegacy(`bar-chart__gridline${base != null && t === base ? ' bar-chart__gridline--baseline' : ''}`), style: { top: tickPos(t) * h }, children: _jsx("span", { className: withLegacy("bar-chart__gridline__label caption-1"), children: t }) }, i))), data.map((d, i) => {
153
186
  const isFuture = isFutureBar(d, base == null);
@@ -198,7 +231,7 @@ function BarChartCanvas({ data, colorA, colorB, labelA, labelB, barWidth = 10, b
198
231
  return _jsx("div", { className: withLegacy("bar-chart__stack-segment"), style: { height: piece, background: (seriesColors ?? [])[k], borderRadius: k === topK ? '6px 6px 0 0' : undefined } }, k);
199
232
  });
200
233
  })() })) : (base != null ? (_jsx(_Fragment, { children: [{ v: num(d.a), c: colorA }, ...(single ? [] : [{ v: num(d.b), c: colorB }])].map(({ v, c }, k) => (_jsxs("div", { className: withLegacy("bar-chart__slot"), style: barWidthStyle, children: [_jsx("div", { className: withLegacy("bar-chart__slot__half bar-chart__slot__half--up"), children: v >= base && _jsx("div", { className: withLegacy("bar-chart__bar bar-chart__bar--full"), style: { height: heightOf(v), background: c } }) }), _jsx("div", { className: withLegacy("bar-chart__slot__half bar-chart__slot__half--down"), children: v < base && _jsx("div", { className: withLegacy("bar-chart__bar bar-chart__bar--full bar-chart__bar--down"), style: { height: heightOf(v), background: c } }) })] }, k))) })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: withLegacy("bar-chart__bar"), style: { ...barWidthStyle, height: ha, background: colorA } }), !single && _jsx("div", { className: withLegacy("bar-chart__bar"), style: { ...barWidthStyle, height: hb, background: colorB } })] })))) }, i));
201
- })] }), _jsx("div", { className: withLegacy("bar-chart__x-axis"), children: data.map((d, i) => {
234
+ })] }), _jsx("div", { ref: axisRef, className: withLegacy("bar-chart__x-axis"), children: data.map((d, i) => {
202
235
  const isFuture = isFutureBar(d, base == null); // 아직 도래하지 않은 날 — 글씨 흐리게
203
236
  return (_jsxs("span", { className: withLegacy(`bar-chart__x-axis__label${isFuture ? ' bar-chart__x-axis__label--future' : ''}`), children: [_jsxs("span", { className: withLegacy("caption-1 bar-chart__x-axis__main"), children: [d.isToday && _jsx("span", { className: withLegacy("bar-chart__x-axis__today-dot"), style: { background: colorA } }), d.label] }), d.sublabel && _jsx("span", { className: "caption-1", children: d.sublabel })] }, i));
204
237
  }) })] }) }) }), tooltip && (_jsx(DescriptionTooltip, { anchorRect: tooltip.rect, title: tooltip.title, items: tooltip.items, showIndex: false, closeOnOutsideClick: false }))] }));
@@ -298,7 +331,7 @@ const BAR_SIZE_PRESET = {
298
331
  * - 주(week): 'YYYY년 M월 N째주' 드롭다운 + 그 주의 요일(월~일) 막대
299
332
  * 원시 렌더링은 내부 BarChartCanvas가 담당한다.
300
333
  */
301
- export default function BarChart({ canvasHeight, focusableBars, size = 'medium', barWidth, titleKey, titleLevel, data, colorA, colorB, labelAKey, labelBKey, showTotal = false, totalUnitKey, totalLabelKey, control: controlProp, hideControls = false, rate = false, rateAgg = 'dayMean', tightMax = false, avgMode = false, totalFormat, series, seriesMode = 'stack', loading = false, onDetail, headExtra, headSegment, icon, disc, onClick, cardAriaLabel, cardTooltip, detailSize = CHART_HEAD_SIZE, barGap, baseline, className, inGrid = false, }) {
334
+ export default function BarChart({ canvasHeight, fitHeight, focusableBars, size = 'medium', barWidth, titleKey, titleLevel, data, colorA, colorB, labelAKey, labelBKey, showTotal = false, totalUnitKey, totalLabelKey, control: controlProp, hideControls = false, rate = false, rateAgg = 'dayMean', tightMax = false, avgMode = false, totalFormat, series, seriesMode = 'stack', loading = false, onDetail, headExtra, headSegment, icon, disc, onClick, cardAriaLabel, cardTooltip, detailSize = CHART_HEAD_SIZE, barGap, baseline, className, inGrid = false, }) {
302
335
  const { t } = useTranslation();
303
336
  /* 캔버스 키는 부르는 쪽이 덮을 수 있다 — 굵기는 프리셋 그대로다(`canvasHeight`) */
304
337
  const sizePreset = { ...BAR_SIZE_PRESET[size], ...(canvasHeight === undefined ? null : { height: canvasHeight }) };
@@ -453,18 +486,22 @@ export default function BarChart({ canvasHeight, focusableBars, size = 'medium',
453
486
  : t('trainingStatus.detail', '상세보기');
454
487
  return (_jsx(ChartSection, { className: sectionClassName, size: sectionSize, inGrid: inGrid, icon: icon, disc: disc, onClick: onClick, ariaLabel: cardAriaLabel, tooltip: cardTooltip, headSegment: headSegment,
455
488
  /* 좁아 고르개가 '⋯' 로 접히면 상세보기도 그 메뉴로 들어간다 — 머리에 단추 둘이 남지 않게 */
456
- headMenuItems: onDetail ? [{ label: detailTitle, icon: 'list', onClick: onDetail, closeOnSelect: true }] : undefined, title: t(titleKey), titleLevel: titleLevel, headRight: isSmall ? (headExtra ?? undefined) : ({ collapsed }) => _jsxs(_Fragment, { children: [!hideControls && _jsx(BarChartControls, { control: control }), headExtra, onDetail && !collapsed && (_jsx("span", { className: withLegacy("bar-chart__detail-btn"), children: _jsx(Button, { htmlType: "button", size: detailSize, type: "dot", icon: "list", ariaLabel: detailTitle, showTooltipInfo: detailTitle, onClick: onDetail }) }))] }), subRow: _jsxs(_Fragment, { children: [showTotal ? ((rate || avgMode || (!!totalLabelKey && !!totalFormat)) ? (
457
- // 진행률/평균 모드 또는 totalLabelKey+totalFormat 조합: 라벨(윗줄) + 값(아랫줄). size='small'은 라벨 생략
458
- _jsx(ChartTotal, { label: isSmall ? undefined : `${t(control.period === 'week' ? 'manager.chart.weeklyPrefix' : 'manager.chart.monthlyPrefix')} ${t(totalLabelKey ?? labelAKey)}`, children: totalFormat ? (
459
- // 숫자는 h0, 단위(시간/분/초 등)는 h5로 분리
460
- /* 부호는 숫자 쪽에 붙인다 — `[^\d]+` 로 가르면 '-7%p' 의 '-' 가 단위로 넘어가 h5 로 작아졌다(변동률) */
461
- (totalFormat(total).match(/([+-]?\d[\d.,]*|[^\d]+)/g) ?? []).map((part, i) => (/\d/.test(part)
462
- ? _jsx("span", { className: withLegacy(chartTotalNumClass(!isLarge)), children: part }, i)
463
- : _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: part }, i)))) : (_jsxs(_Fragment, { children: [_jsx("span", { className: withLegacy(chartTotalNumClass(!isLarge)), children: total }), totalUnitKey && _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: t(totalUnitKey) })] })) })) : (_jsxs(ChartTotal, { children: [_jsx("span", { className: withLegacy(chartTotalNumClass(!isLarge)), children: total }), _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: t(labelAKey) }), totalUnitKey && _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: t(totalUnitKey) })] }))) : _jsx("span", {}), _jsx(ChartLegend, { items: legendItems, className: "caption-1" })] }), children: loading ? (
489
+ headMenuItems: onDetail ? [{ label: detailTitle, icon: 'list', onClick: onDetail, closeOnSelect: true }] : undefined, title: t(titleKey), titleLevel: titleLevel, headRight: isSmall ? (headExtra ?? undefined) : ({ collapsed }) => _jsxs(_Fragment, { children: [!hideControls && _jsx(BarChartControls, { control: control }), headExtra, onDetail && !collapsed && (_jsx("span", { className: withLegacy("bar-chart__detail-btn"), children: _jsx(Button, { htmlType: "button", size: detailSize, type: "dot", icon: "list", ariaLabel: detailTitle, showTooltipInfo: detailTitle, onClick: onDetail }) }))] }),
490
+ /* 범례는 서브로우 밖 제 자리(`legend`)에 — 사장님 지시 2026-11-02, 수의 줄상자에서 푼다 */
491
+ legend: _jsx(ChartLegend, { items: legendItems, className: "caption-1" }),
492
+ /* 속을 카드 키에 맞출 때만 카드가 키를 박는다 — 안 맞추는 카드를 박으면 x축이 흘러나온다 */
493
+ fitBody: fitHeight, subRow: showTotal && _jsx(_Fragment, { children: ((rate || avgMode || (!!totalLabelKey && !!totalFormat)) ? (
494
+ // 진행률/평균 모드 또는 totalLabelKey+totalFormat 조합: 라벨(윗줄) + 값(아랫줄). size='small'은 라벨 생략
495
+ _jsx(ChartTotal, { label: isSmall ? undefined : `${t(control.period === 'week' ? 'manager.chart.weeklyPrefix' : 'manager.chart.monthlyPrefix')} ${t(totalLabelKey ?? labelAKey)}`, children: totalFormat ? (
496
+ // 숫자는 h0, 단위(시간/분/초 등)는 h5로 분리
497
+ /* 부호는 숫자 쪽에 붙인다 — `[^\d]+` 로 가르면 '-7%p' 의 '-' 가 단위로 넘어가 h5 로 작아졌다(변동률) */
498
+ (totalFormat(total).match(/([+-]?\d[\d.,]*|[^\d]+)/g) ?? []).map((part, i) => (/\d/.test(part)
499
+ ? _jsx("span", { className: withLegacy(chartTotalNumClass(!isLarge)), children: part }, i)
500
+ : _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: part }, i)))) : (_jsxs(_Fragment, { children: [_jsx("span", { className: withLegacy(chartTotalNumClass(!isLarge)), children: total }), totalUnitKey && _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: t(totalUnitKey) })] })) })) : (_jsxs(ChartTotal, { children: [_jsx("span", { className: withLegacy(chartTotalNumClass(!isLarge)), children: total }), _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: t(labelAKey) }), totalUnitKey && _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: t(totalUnitKey) })] }))) }), children: loading ? (
464
501
  /* **뼈대 먼저, 그 안에서 기다린다**(사용자 지시 2026-09-17). 기다림 상자를 따로 두면
465
502
  자료가 오는 순간 카드 키가 달라져 격자가 한꺼번에 내려앉는다 — 말귀 실측: 상자 186px
466
503
  → 막대 156px 로 카드마다 30px, 섹션 372 → 342px.
467
504
  그래서 **그려질 것과 같은 뼈대**(칸 자리 + 축 한 줄)를 세우고 그 안에 스피너를 둔다.
468
505
  키는 막대 자리(`sizePreset.height`)에서 오므로 크기 보기(size)가 달라도 따라온다. */
469
- _jsx("div", { className: withLegacy("bar-chart__wrap bar-chart__loading"), "aria-busy": "true", children: _jsx("div", { className: withLegacy("bar-chart__inner"), children: _jsxs("div", { className: withLegacy("bar-chart__area bar-chart__area--loading"), children: [_jsx("div", { className: withLegacy("bar-chart__plot bar-chart__plot--loading"), style: { height: sizePreset.height }, children: _jsx(Loader, { size: 32 }) }), _jsx("div", { className: withLegacy("bar-chart__x-axis"), "aria-hidden": "true", children: _jsxs("span", { className: withLegacy("bar-chart__x-axis__label"), children: [_jsx("span", { className: withLegacy("caption-1 bar-chart__x-axis__main"), children: "\u00A0" }), bars.some(b => !!b.sublabel) && _jsx("span", { className: "caption-1", children: "\u00A0" })] }) })] }) }) })) : (_jsx(BarChartCanvas, { focusableBars: focusableBars, data: bars, colorA: colorA, colorB: labelBKey ? colorB : undefined, labelA: t(labelAKey), labelB: labelBKey ? t(labelBKey) : undefined, barWidth: barWidth ?? sizePreset.barWidth, barGap: barGap, baseline: baseline, height: sizePreset.height, maxOverride: rate ? 100 : undefined, tightMax: tightMax, seriesColors: series?.map(s => s.color), seriesLabels: series?.map(s => s.label), rateLabels: rate ? { total: t('trainingStatus.today.tooltipTotal', '전체'), done: t('trainingStatus.today.tooltipDone', '완료') } : undefined, grouped: grouped })) }));
506
+ _jsx("div", { className: withLegacy("bar-chart__wrap bar-chart__loading"), "aria-busy": "true", children: _jsx("div", { className: withLegacy("bar-chart__inner"), children: _jsxs("div", { className: withLegacy("bar-chart__area bar-chart__area--loading"), children: [_jsx("div", { className: withLegacy("bar-chart__plot bar-chart__plot--loading"), style: { height: sizePreset.height }, children: _jsx(Loader, { size: 32 }) }), _jsx("div", { className: withLegacy("bar-chart__x-axis"), "aria-hidden": "true", children: _jsxs("span", { className: withLegacy("bar-chart__x-axis__label"), children: [_jsx("span", { className: withLegacy("caption-1 bar-chart__x-axis__main"), children: "\u00A0" }), bars.some(b => !!b.sublabel) && _jsx("span", { className: "caption-1", children: "\u00A0" })] }) })] }) }) })) : (_jsx(BarChartCanvas, { focusableBars: focusableBars, data: bars, colorA: colorA, colorB: labelBKey ? colorB : undefined, labelA: t(labelAKey), labelB: labelBKey ? t(labelBKey) : undefined, barWidth: barWidth ?? sizePreset.barWidth, barGap: barGap, baseline: baseline, height: sizePreset.height, fitHeight: fitHeight, maxOverride: rate ? 100 : undefined, tightMax: tightMax, seriesColors: series?.map(s => s.color), seriesLabels: series?.map(s => s.label), rateLabels: rate ? { total: t('trainingStatus.today.tooltipTotal', '전체'), done: t('trainingStatus.today.tooltipDone', '완료') } : undefined, grouped: grouped })) }));
470
507
  }
@@ -34,6 +34,14 @@
34
34
  맞춰 서야 제목 줄과 윗선이 맞는다. 부르는 쪽이 그 수를 베껴 적지 않게 한다(2026-09-24). */
35
35
  --card-pad: 19px;
36
36
  padding: var(--card-pad);
37
+ /* 머리 아래 틈 — 큰 수 줄이 **어디서 시작하는지**를 이 수가 정한다. 범례 자리(`__legend-slot`)
38
+ 가 같은 수로 큰 수 줄의 윗선을 찾으므로, 머리 여백을 적는 규칙은 **이 변수로** 적는다. */
39
+ --head-gap: var(--spacing-xs);
40
+ /* 범례를 큰 수 줄 윗선에서 얼마나 내릴지(px) — 사장님이 움직이는 손잡이.
41
+ 0 → 3 → 4(사장님 지시 2026-11-02 "3px 내려봐" 뒤에 "1px 더"). 3 은 큰 수의 글자 윗선
42
+ (줄상자보다 cap 위 여백 3 아래)에 범례 첫 줄 윗선을 맞춘 수였고, 거기서 1 을 더 내렸다 —
43
+ 범례 두 줄이 큰 수 글자와 거의 같은 띠에 선다(실측 2026-11-02, 폭 1771: 수 531~569 · 범례 536~570). */
44
+ --legend-offset: 4px;
37
45
  /* 머리 오른쪽에 띄우는 줄(`SectionHeadFloat`)의 기준점 — 없으면 창 구석으로 날아간다 */
38
46
  position: relative;
39
47
  /* 카드 사이 틈 — `CARD_GAP` 과 같은 수다(14 → 20, 사장님 지시 2026-11-02) */
@@ -58,9 +66,19 @@
58
66
  /* 좁으면 줄을 바꾼다 — 안 바꾸면 오른쪽 묶음(고르개·상세보기)이 제목 위로 올라탄다 */
59
67
  flex-wrap: wrap;
60
68
  gap: var(--spacing-xs);
61
- /* 머리 바로 아래가 합계 줄이라 12px 은 떠 보인다 — 한 눈금 줄인다 */
62
- margin-bottom: var(--spacing-xs);
63
- }
69
+ /* 머리 바로 아래가 합계 줄이라 12px 은 떠 보인다 — 한 눈금 줄인다(`--head-gap`, 기본 8) */
70
+ margin-bottom: var(--head-gap);
71
+ /* **머리가 차지하는 키는 갈래를 안 가린다**(사장님 지시 2026-11-02 — "위치도 안맞아
72
+ 확인해봐" 뒤에 "여전히 디자인도 다르고"). 머리는 **그 아래가 어디서 시작하는지**를
73
+ 정하는 자리다 — 조절칸이 든 차트 카드는 32 인데 그림씨만 든 고리·수 칸은 **23** 이라,
74
+ 한 격자에 나란히 선 카드들의 큰 수가 서로 다른 높이에서 섰다(실측 2026-11-02, 폭 1771:
75
+ 고리 378 · 수 칸 387 · 막대 차트 402). 처음에 `--stat` 에만 박았더니 수 칸이 막대
76
+ 차트에만 맞고 **고리와 9px 어긋났다** — 갈래마다 박으면 꼭 하나가 빠진다.
77
+ `CHART_HEAD_SIZE` 와 같은 수다(짝 시험이 둘을 맞댄다). */
78
+ min-height: 32px;
79
+ }
80
+ /* 격자에 선 차트 카드는 **머리 아래 여백도 수 칸과 같다**(2). 수 칸은 `gap: 2` 로 붙는데
81
+ 여기만 8 이면, 머리 키를 맞춰도 큰 수가 6px 아래에 선다. 격자 밖 차트는 8 그대로다. */
64
82
  /* **띄운 줄이 있으면 그만큼 비워 둔다.** 띄운 줄은 흐름에서 빠져 제목·곁줄을 덮는다.
65
83
  `SectionHeadFloat` 이 잰 제 폭을 카드에 적어 두므로 눈대중으로 수를 적을 일이 없다 —
66
84
  안 띄운 카드에서는 -12 + 12 = 0 이라 아무 일도 안 일어난다(2026-09-24). */
@@ -75,11 +93,16 @@
75
93
  글**이 된다. 이제 단계도 색도 한 군데서 든다 — 단계는 `titleClassName` 의 기본값
76
94
  (`h5`), 색은 이 줄.
77
95
 
96
+ **색은 `darkGray` 다**(사장님 지시 2026-11-02 *"darkGray 로"*). 셋을 맞출 때 **작은 쪽에
97
+ 맞춰 `deepGray` 로 내렸더니** 큰 차트 카드의 제목이 전(#111)보다 옅어졌고, 사장님이
98
+ *"title 컬러를 밝게 올렸냐?"* 고 짚으셨다. 한 단 올려 `darkGray`(#434d56) 로 둔다 —
99
+ 셋이 같은 것은 그대로고, 제목이 먼저 읽힌다(흰 바탕 대비 **8.63:1**).
100
+
78
101
  줄어들 수 있어야 한다 — `min-width` 기본값(auto)이면 글자 길이만큼 버텨 넘친다. */
79
102
  .chart-section__title,
80
103
  .manager-section__title {
81
104
  min-width: 0;
82
- color: var(--color-deepGray);
105
+ color: var(--color-darkGray);
83
106
  }
84
107
  /* 아이콘 + (제목·설명) — Section 의 머리와 같은 결 */
85
108
  .chart-section__title-row,
@@ -154,6 +177,27 @@
154
177
  align-items: flex-start;
155
178
  gap: var(--spacing-s);
156
179
  }
180
+ /* **오른쪽이 그림씨 하나뿐인 머리는 세우지 않는다**(실측 2026-11-02 · 375 · 대시보드).
181
+ 위 규칙은 **차트 카드** 때문에 있다 — 거기 오른쪽은 조절칸 한 줄(◀ · 달 고르개 · ▶ ·
182
+ 주∣월)이라 폰에서 제목 옆에 못 선다. 그런데 **수 칸**의 오른쪽은 18px 그림씨 하나뿐인데
183
+ 같이 세워져서, 그림씨가 **제 줄로 내려가 왼쪽에 홀로** 섰다(제목 y 356 · 그림씨 y 388,
184
+ x 가 둘 다 213). 글과 떨어진 채 왼쪽에 뜬 그림씨는 무엇을 가리키는지 알 수 없다.
185
+
186
+ 대시보드 열여덟 칸 가운데 **열다섯이 그 꼴**이었다(머리의 자식이 `__title` + `__head-icon`).
187
+ 차트·고리 셋은 `__title-row` + `__head-right` 라 이 선택자에 안 걸린다 — 그쪽은 세운 채
188
+ 둔다. (`:has()` 는 이 집에서 이미 쓰는 길이다.) */
189
+ .chart-section__head:has(> .chart-section__head-icon),
190
+ .manager-section__head:has(> .chart-section__head-icon),
191
+ /* 고리 카드는 제목·설명이 묶여 있어 오른쪽이 `__head-right` 로 한 겹 더 싸인다. 그 안이
192
+ **그림씨 하나뿐이면** 수 칸과 같은 꼴이다(실측 2026-11-02: 고리 카드 오른쪽 18px ·
193
+ 차트 카드 오른쪽 299px). `:only-child` 가 그 둘을 가른다 — 차트 쪽의 외동은
194
+ `__controls` 다. */
195
+ .chart-section__head:has(> .chart-section__head-right > .chart-section__head-icon:only-child),
196
+ .manager-section__head:has(> .chart-section__head-right > .chart-section__head-icon:only-child) {
197
+ flex-direction: row;
198
+ align-items: center;
199
+ gap: var(--spacing-xs);
200
+ }
157
201
  /* 월 네비게이션과 주/일 토글이 한 줄에 안 들어올 때 자연스럽게 줄바꿈 */
158
202
  .chart-section__controls {
159
203
  flex-wrap: wrap;
@@ -249,11 +293,31 @@
249
293
  display: flex;
250
294
  flex-direction: column; /* 항상 세로로 나열 */
251
295
  align-items: flex-end;
252
- gap: 6px;
296
+ /* 6 → 2(사장님 지시 2026-11-02 "Legend 간격 줄여봐") — 집안 사다리의 한 칸이고,
297
+ 수 칸의 제목↔값 틈과 같은 수다. 두 줄 범례가 40 → 36 이 된다. */
298
+ gap: 2px;
253
299
  padding-right: var(--spacing-xs);
254
300
  font-size: 12px;
255
301
  color: var(--color-gray);
256
302
  }
303
+ /* **범례의 제 자리** — 서브로우 밖(사장님 지시 2026-11-02 "legend 를 sub row 에서 분리해서
304
+ 배치해줘"). 서브로우 안에 수와 나란히 두면 `align-items` 가 둘을 한 상자에 묶어, 범례만
305
+ 따로 올리고 내릴 길이 없었다(수의 윗여백을 깎자 범례가 따라 움직였다). 카드 오른쪽에 띄워
306
+ 세우고, 세로는 **큰 수 줄의 윗선 + `--legend-offset`** 이다 — 그 윗선은 `카드 여백 + 머리
307
+ 32 + 머리 아래 틈` 이라 머리 규칙과 같은 변수(`--head-gap`)로 센다. 띄워 세우므로 서브로우
308
+ 폭을 안 먹는다 — 긴 범례가 수와 겹치지 않게 폭을 반 조금 넘게 막고 말줄임은 범례 제 규칙이
309
+ 든다. */
310
+ /* 범례가 큰 수 줄보다 길면 **줄이 그만큼 넓어진다**(사장님 지시 2026-11-03 "legend 이 선 위로").
311
+ 잰 키는 `ChartSection` 이 `--legend-h` 로 적어 둔다 — 안 적혔으면 아무 일도 안 한다. */
312
+ .chart-section__sub-row:has(+ .chart-section__legend-slot) {
313
+ min-height: var(--legend-h, auto);
314
+ }
315
+ .chart-section__legend-slot {
316
+ position: absolute;
317
+ right: var(--card-pad);
318
+ top: calc(var(--card-pad) + 32px + var(--head-gap) + var(--legend-offset));
319
+ max-width: 55%;
320
+ }
257
321
  .chart-section__legend-item,
258
322
  .manager-bar-chart-legend-item {
259
323
  display: inline-flex;
@@ -272,20 +336,17 @@
272
336
  패딩·헤더 높이·간격을 수 칸(`--stat`)과 동일하게 맞춰, 같은 그리드 행에 나란히
273
337
  놓였을 때 숫자 세로 위치가 어긋나지 않게 한다 */
274
338
  .chart-section--compact {
339
+ --head-gap: 2px; /* 머리 아래 틈 — 수 칸의 카드 `gap: 2` 와 같은 수 */
275
340
  --card-pad: 19px; /* 20 − 테두리 1px */
276
341
  padding: var(--card-pad);
277
342
  min-width: 160px;
278
343
  }
279
344
  /* **작은 카드의 머리는 수 칸(`--stat`)과 같은 상자다**(사장님 지시 2026-11-02 — 두 수가
280
- 세로로 7px 어긋나 있었다). 전에는 `min-height: 28` + 아래 여백 4 였는데, 28 은
281
- 속(제목 23 · 아이콘 22)보다 커서 **제목 아래에 5px 이 남아** 그만큼 수를 내렸다.
282
- 수 칸은 그 자리를 2026-11-02 에 이미 걷었다 — 둘이 한 줄에 나란히 서므로 함께 간다.
283
- 틈 2 는 수 칸의 카드 `gap: 2` 와 같은 수다. */
284
- .chart-section--compact .chart-section__head,
285
- .chart-section--compact .manager-section__head {
286
- min-height: 0;
287
- margin-bottom: 2px;
288
- }
345
+ 세로로 7px 어긋나 있었다). 전에는 `min-height: 28` + 아래 여백 4 였고, 그날 낮에 여기서
346
+ `min-height: 0` 으로 걷었다. **같은 날 저녁 그 0 이 머리 키를 도로 무너뜨렸다** — 밑바탕이
347
+ 모든 머리를 32 로 맞추자(위 `.chart-section__head`), 이 0 이 작은 카드(고리·수 칸)만
348
+ 23 으로 되돌려 막대 차트와 9px 어긋났다. 머리 키는 밑바탕 한 줄이 든다 — 여기서는
349
+ 틈만 적는다(2 는 수 칸의 카드 `gap: 2` 와 같은 수다). */
289
350
  /* `chart-section-title--small` 은 **없앴다**(2026-11-02) — 작은 카드만 `h5`·deepGray 로
290
351
  내리려고 있던 것인데, 이제 그것이 밑바탕이다. 남겨 두면 "작은 카드는 다르다" 는
291
352
  낡은 뜻이 코드에 남는다. */
@@ -353,6 +414,7 @@
353
414
  (말귀 훈련 현황의 네 칸이 범례 줄 수가 달라 막대 바닥이 들쭉날쭉했다). */
354
415
  .chart-section--grid,
355
416
  .manager-section--grid {
417
+ --head-gap: 2px; /* 머리 아래 틈 — 격자에 나란히 선 수 칸과 같은 수 */
356
418
  margin-bottom: 0;
357
419
  min-width: 0;
358
420
  display: flex;
@@ -416,24 +478,70 @@
416
478
  .chart-section--stat .chart-section__head {
417
479
  margin-bottom: 0;
418
480
  }
419
- .chart-section--stat .chart-section__content {
420
- display: flex;
421
- flex-direction: column;
422
- align-items: flex-start;
423
- gap: var(--spacing-xs);
481
+ /* 수 칸의 큰 수 줄은 차트 카드와 **같은 `__sub-row`** 다(마크업을 하나로 합쳤다).
482
+ 다른 것은 셋뿐이다 — 남는 키를 먹고(`flex: 1`), 머리 아래 틈은 카드의 `gap: 2` 가 드니
483
+ 제 여백은 0 이며, 오른쪽에 붙는 것이 범례가 아니라 증감 배지라 사이를 8 로 띄운다.
484
+ `--body-center` 는 이 아래에서 `flex` 를 도로 거둔다(거기서는 자리를 다 먹으면 안 된다). */
485
+ .chart-section--stat .chart-section__sub-row {
424
486
  flex: 1;
487
+ gap: 8px;
488
+ margin-bottom: 0;
489
+ justify-content: flex-start;
490
+ text-align: left;
491
+ }
492
+ /* 격자에 선 카드는 **큰 수 줄 아래 틈도 같다.** 갈래마다 달랐다 — 고리(`--compact`) 12 ·
493
+ 막대 차트 8 · 수 칸 0(실측 2026-11-02). 격자에서는 그 틈이 **곁 카드와 견주어 보이는
494
+ 자리**라 한 수로 둔다. 격자 밖 카드는 제 갈래 수를 그대로 쓴다.
495
+ **`--compact`·`--stat` 규칙보다 뒤에 서야 한다** — 급이 같아 차례가 가른다(처음엔 앞에
496
+ 둬서 아무 일도 안 했다). 아래에 몸이 없으면(수 하나뿐인 120 카드) 틈도 없다 — 있으면
497
+ 19+32+2+41+8+19 = 121 로 120 을 1px 넘긴다. */
498
+ .chart-section--grid .chart-section__sub-row {
499
+ margin-bottom: var(--spacing-xs);
500
+ }
501
+ .chart-section--grid .chart-section__sub-row:last-child {
502
+ margin-bottom: 0;
503
+ }
504
+ /* `__content` 를 걷었다(사장님 지시 2026-11-02 "div 도 달라") — 머리·큰 수 줄·몸이
505
+ 차트 카드처럼 **카드의 직계**다. 그 한 겹이 하던 "남는 키를 먹고 위아래로 벌린다" 는
506
+ 카드가 이미 세로 flex 라 **카드가 든다**. */
507
+ .chart-section--stat {
425
508
  justify-content: space-between;
509
+ --head-gap: 2px; /* 머리 여백은 0 이고 카드 `gap: 2` 가 그 틈을 든다 — 범례 셈은 같은 2 */
426
510
  }
427
511
  /* **값 아래 자리를 한가운데로**(`bodyAlign="center"`, 사장님 지시 2026-11-02).
428
- 밑바탕에서는 `__value-row` 가 `flex: 1` 로 남는 키를 다 먹어 자리가 바닥에 붙는다.
512
+ 밑바탕에서는 큰 수 줄이 `flex: 1` 로 남는 키를 다 먹어 자리가 바닥에 붙는다.
429
513
  여기서는 그것을 놓고 `margin-block: auto` 로 남는 키를 위아래에 똑같이 나눈다 — 그러면
430
514
  값 아래 남는 자리의 한가운데에 선다. 한 줄만 드는 빈 카드(`오늘 방문 예정이 없습니다.`)
431
515
  를 위한 것이고, 여러 줄이 차면 남는 키가 없어 `bottom` 과 같아진다. */
432
- .chart-section__content--body-center > .chart-section__value-row {
516
+ .chart-section--body-center > .chart-section__sub-row {
433
517
  flex: 0 0 auto;
434
518
  }
435
- .chart-section__content--body-center > .chart-section__body {
519
+ .chart-section--body-center > .chart-section__body {
436
520
  margin-block: auto;
521
+ /* **눈으로는 아래로 쏠려 보인다**(사장님 지시 2026-11-02 "영역에서는 가운데일텐데 약간
522
+ 아래로 쏠려보여 보정해줘"). `auto` 는 큰 수 줄 **아래** 남는 자리의 한가운데에 세우는데,
523
+ 눈은 큰 수를 머리의 일부로 읽어 **머리 아래 전체**의 가운데를 기대한다 — 그 차이가 큰 수
524
+ 줄(41) + 틈(2) 의 반, 21px 이다(실측: 카드 699~959 · 글 861~883, 카드 가운데보다 27 아래).
525
+ 상자 아래에 그 두 배를 덧대면 `auto` 가 그만큼 위로 민다 — `--body-lift` 하나로 움직인다. */
526
+ --body-lift: 21px;
527
+ padding-bottom: calc(2 * var(--body-lift));
528
+ }
529
+ /* **틈이 위쪽에만 붙어 한가운데가 아니었다**(사장님이 "살짝 아래로 내려가 있는 느낌" 으로
530
+ 짚으셨다, 2026-11-02). `margin-block: auto` 는 *남는* 키를 반씩 나누는데, 위의 `gap`(8)은
531
+ 남는 키에서 먼저 빠져 **값 쪽에만** 붙는다 — 그래서 위 69 · 아래 60 으로 8px 기울었다
532
+ (실측: 자리 195 · 값 줄 44 · 글 22). 여기서는 틈을 `auto` 에게 넘긴다. */
533
+ .chart-section--stat.chart-section--body-center {
534
+ gap: 0;
535
+ }
536
+ /* `__content` 를 걷고 나니 위의 `gap: 0` 이 **머리와 큰 수 사이(2)까지** 지웠다 — 그래서
537
+ `금일 방문 예정` 의 수만 곁 카드보다 2px 위에 섰다(실측 2026-11-02: 405 대 407). 그 2 는
538
+ 머리의 여백으로 되돌리고, 큰 수 줄 아래 틈(격자 8)은 `auto` 에게 넘긴다 — 안 넘기면
539
+ 빈 글이 위 67 · 아래 60 으로 또 기운다. */
540
+ .chart-section--stat.chart-section--body-center > .chart-section__head {
541
+ margin-bottom: 2px;
542
+ }
543
+ .chart-section--stat.chart-section--body-center > .chart-section__sub-row {
544
+ margin-bottom: 0;
437
545
  }
438
546
  /* 값 아래 자리 — 목록·단추 등 카드가 값을 풀어 보이는 것 */
439
547
  .chart-section__body {
@@ -444,16 +552,10 @@
444
552
  width: 100%;
445
553
  text-align: left;
446
554
  }
447
- .chart-section__value-row {
448
- display: flex;
449
- flex-direction: row;
450
- align-items: flex-start;
451
- gap: 8px;
452
- flex: 1;
453
- text-align: left;
454
- }
455
- /* **카드가 보이는 큰 수 — 한 규칙이 둘을 다 든다**(사장님 지시 2026-11-02 "하나로").
456
- 수 칸(`--stat`)의 값과 작은 차트 카드(`--compact`)의 수는 **한 줄에 나란히 선다**.
555
+ /* **카드가 보이는 큰 수 — 이름이 하나다**(사장님 지시 2026-11-02 "하나로" · "하나로 통일해").
556
+ 수 칸(`--stat`)의 값과 차트 카드의 수는 **한 줄에 나란히 선다**. 한동안 이름이 둘이라
557
+ (`__value` · `__total__num`) 규칙을 두 벌씩 썼는데, 2026-11-02 에 마크업을 합치며
558
+ **`__total__num` 하나로 모았다** — 감싼 상자(`__total`)·단위(`__total__unit`)와 한 결이다.
457
559
  그런데 마크업이 서로 다른 단계를 달고 있었다 — 수 칸은 `h2`, 차트 쪽은 `h0`. 몸과
458
560
  이름을 합친 뒤에도 그 둘만 남아, 같은 24px 인데 **굵기 500 대 700 · 자간 -0.5 대 -1**
459
561
  로 보였다(실측 2026-11-02, 폭 1407 — 사장님이 "같은 컴포넌트인데 왜 달라?" 로 짚으셨다).
@@ -464,14 +566,24 @@
464
566
  수 칸에서 걷어낸 바로 그 함정이었다. 자간도 `-0.5` 를 박아 뒀었는데 **그것이 마침
465
567
  `h1` 의 값이라** 걷었다. 여기 남는 것은 단계가 안 정하는 색뿐이다.
466
568
 
467
- 큰 차트 카드(`--compact` 가 아닌 것)는 안 든다 — 거기 수는 `h0`(40px) 제 크기로 선다. */
468
- .chart-section__value,
469
- .chart-section--compact .chart-section__total__num {
569
+ 큰 차트 카드(`--compact` 가 아닌 것)는 안 든다 — 거기 수는 `h0`(40px) 제 크기로 선다.
570
+
571
+ **윗여백 -3px 은 글자 윗선을 맞추려는 것이다**(사장님 지시 2026-11-02 — "value 도 legend도
572
+ 같이 상단으로 정렬해봐"). `h1` 의 줄상자는 44 인데 글자(cap~baseline)는 38 이라 **위에 3px,
573
+ 아래에 3px 이 남는다** — 그래서 두 줄짜리 범례의 첫 줄(글자 윗선 754)보다 큰 수의 윗선이
574
+ 756 으로 내려앉아 범례가 위로 붙어 보였다(실측 2026-11-02, 폭 1771). 여기서도 **크기·
575
+ 줄높이·자간은 안 건드린다** — 남는 윗여백만 걷는다. 수 칸과 차트 카드가 **한 이름**을
576
+ 쓰므로 이 한 줄이 둘을 다 든다(한쪽만 걷으면 격자에서 둘의 수가 다시 어긋난다). */
577
+ .chart-section__total__num {
470
578
  color: var(--color-black);
471
- }
472
- .chart-section__value {
473
579
  white-space: nowrap;
474
580
  flex-shrink: 0;
581
+ margin-top: -3px;
582
+ }
583
+ /* **값이 수가 아니라 `없음` 일 때는 글자를 낮춘다**(사장님 지시 2026-11-02 "없음은 lightGray 로").
584
+ `totalMuted` 를 받은 카드만 든다 — 코어는 그 글자가 수인지 말인지 못 가린다. */
585
+ .chart-section__total__num--muted {
586
+ color: var(--color-lightGray);
475
587
  }
476
588
  /* 값 우측 상단에 배지처럼 붙어 증감 유무와 무관하게 카드 높이가 일정하게 유지되도록 함 */
477
589
  .chart-section__change {
@@ -34,6 +34,12 @@ export interface ChartTotalProps {
34
34
  * 작은 카드만 CSS 로 크기를 덮어 맞췄는데, 그러면 **마크업에 적힌 단계가 아무 일도 안
35
35
  * 한다** — 글자를 고쳐도 화면이 안 바뀐다(사장님이 2026-11-02 에 짚으셨다). 단계를 한
36
36
  * 군데서 정하고, 부르는 쪽은 "작은 카드인가" 만 넘긴다.
37
+ *
38
+ * **큰 수의 이름은 이것 하나다**(사장님 지시 2026-11-02 — "하나는 sub-row고 하나는
39
+ * section-content 네 하나로 통일해"). 수 칸만 `__value`·`__value-row` 라는 제 이름을
40
+ * 따로 쓰고 있었다 — 같은 자리의 같은 수인데 규칙을 두 벌씩 써야 했고, 그날도 차트 쪽
41
+ * 한 자리를 빠뜨려 큰 수의 윗여백이 그 카드만 안 들었다. 이제 **그리는 자리 다섯**
42
+ * (수 칸 · 차트 카드 · 막대 합계 셋 · 고리 퍼센트)이 다 이 함수를 부른다.
37
43
  * @public
38
44
  */
39
45
  export declare const chartTotalNumClass: (small?: boolean) => string;
@@ -185,6 +191,12 @@ export interface ChartSectionProps {
185
191
  totalNum?: ReactNode;
186
192
  /** 수 뒤 단위(`%` 등) — `totalNum` 과 함께 쓴다 */
187
193
  totalUnit?: ReactNode;
194
+ /** 값이 **수가 아니라 빈 것을 이르는 말**일 때(`없음` 등) — 글자를 `lightGray` 로 낮춘다
195
+ * (사장님 지시 2026-11-02 "없음은 lightGray 로").
196
+ *
197
+ * **코어는 그 글자를 못 알아본다** — `totalNum` 은 아무 노드나 받으므로 `없음`·`None`·`—` 이
198
+ * 수인지 말인지 가릴 길이 없다. 그래서 **부르는 쪽이 말해 준다.** */
199
+ totalMuted?: boolean;
188
200
  /** 수 앞 설명 한 줄 — 색을 입힌 대비 수치 등은 노드로 넘긴다(앱 규칙) */
189
201
  totalLabel?: ReactNode;
190
202
  /** 카드에 포인터가 닿을 때(키보드는 초점이 들어올 때) 뜨는 설명 — `StatChart tooltip` 과 같은 뜻.
@@ -192,6 +204,16 @@ export interface ChartSectionProps {
192
204
  tooltip?: string;
193
205
  /** 총계(ChartTotal) + 범례(ChartLegend)를 담는 서브로우 */
194
206
  subRow?: ReactNode;
207
+ /** **범례 — 서브로우 밖의 제 자리**(사장님 지시 2026-11-02 "legend 를 sub row 에서 분리해서
208
+ * 배치해줘. 상대적으로 위로 올라가있는걸 조정 못하겠어"). 서브로우 안에 수와 나란히 세우면
209
+ * 수의 줄상자에 매여 **범례만 따로 올리고 내릴 손잡이가 없다.** 여기 주면 카드 오른쪽에
210
+ * 따로 서고, 세로 자리는 `--legend-offset`(px, 기본 0 = 큰 수 줄의 윗선) 하나로 움직인다. */
211
+ legend?: ReactNode;
212
+ /** **카드 키를 박는다** — 속이 그 키에 **스스로 맞출 때만** 켠다(`BarChart fitHeight` 가 켠다).
213
+ * 2026-11-02 에 이것을 `inGrid` 에 묶었더니 격자에 선 **모든** 차트 카드가 260 으로 박혀,
214
+ * 속을 안 맞추는 고객 통계의 차트 여덟이 x축 둘째 줄을 카드 밖으로 흘렸다(사장님 "아따
215
+ * 여기 죄다 깨졌네"). 격자에 섰다는 것과 속을 맞춘다는 것은 다른 말이다. */
216
+ fitBody?: boolean;
195
217
  /** 서브로우에 선 것들의 **세로 맞춤** — `'start'`(기본) · `'center'` · `'end'`.
196
218
  *
197
219
  * 기본이 `'start'` 인 것은 **범례** 때문이다. 수(설명 한 줄 + 큰 수, 두 줄)와 범례가 함께 서면
@@ -218,4 +240,4 @@ export interface ChartSectionProps {
218
240
  * 공유하도록 두 컴포넌트가 내부적으로 사용한다.
219
241
  * @public
220
242
  */
221
- export default function ChartSection({ type, title, titleClassName, titleLevel, icon, disc, headRight, headFloat, headSegment, headMenuItems, collapseBelow, onClick, ariaLabel, tooltip, totalNum, totalUnit, totalLabel, change, changeType, size, bodyAlign, subRow, subRowAlign, className, inGrid, children }: ChartSectionProps): import("react").JSX.Element;
243
+ export default function ChartSection({ type, title, titleClassName, titleLevel, icon, disc, headRight, headFloat, headSegment, headMenuItems, collapseBelow, onClick, ariaLabel, tooltip, totalNum, totalUnit, totalMuted, totalLabel, change, changeType, size, bodyAlign, subRow, legend, subRowAlign, className, inGrid, fitBody, children }: ChartSectionProps): import("react").JSX.Element;