@ihabdevteam/core 0.413.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +582 -0
  2. package/dist/components.cjs.js +179 -179
  3. package/dist/components.esm.css +2 -2
  4. package/dist/hooks.cjs.js +5 -5
  5. package/dist/i18n.cjs.js +3 -3
  6. package/dist/ihabdevteam-core.cjs.js +191 -191
  7. package/dist/ihabdevteam-core.d.ts +198 -18
  8. package/dist/packages/core/src/components/Accordion.css +16 -0
  9. package/dist/packages/core/src/components/BarChart.css +20 -4
  10. package/dist/packages/core/src/components/BarChart.d.ts +1 -1
  11. package/dist/packages/core/src/components/BarChart.js +61 -22
  12. package/dist/packages/core/src/components/BulkBar.js +2 -1
  13. package/dist/packages/core/src/components/ChartSection.css +311 -31
  14. package/dist/packages/core/src/components/ChartSection.d.ts +116 -2
  15. package/dist/packages/core/src/components/ChartSection.js +135 -9
  16. package/dist/packages/core/src/components/ColorPicker.d.ts +2 -1
  17. package/dist/packages/core/src/components/ColorPicker.js +2 -1
  18. package/dist/packages/core/src/components/DatePicker.css +5 -0
  19. package/dist/packages/core/src/components/DatePicker.d.ts +2 -1
  20. package/dist/packages/core/src/components/DatePicker.js +1 -1
  21. package/dist/packages/core/src/components/Dropdown.css +6 -0
  22. package/dist/packages/core/src/components/Dropdown.d.ts +2 -1
  23. package/dist/packages/core/src/components/FilterPanel.js +17 -3
  24. package/dist/packages/core/src/components/Header.js +4 -4
  25. package/dist/packages/core/src/components/Panel.css +21 -0
  26. package/dist/packages/core/src/components/RingChart.js +11 -7
  27. package/dist/packages/core/src/components/SegmentedControl.css +6 -1
  28. package/dist/packages/core/src/components/SegmentedControl.d.ts +5 -1
  29. package/dist/packages/core/src/components/SegmentedControl.js +2 -1
  30. package/dist/packages/core/src/components/SideNav.js +1 -1
  31. package/dist/packages/core/src/components/StatChart.d.ts +22 -11
  32. package/dist/packages/core/src/components/StatChart.js +17 -37
  33. package/dist/packages/core/src/components/SummaryStrip.d.ts +1 -1
  34. package/dist/packages/core/src/components/SummaryStrip.js +1 -1
  35. package/dist/packages/core/src/components/Table.d.ts +16 -0
  36. package/dist/packages/core/src/components/Tabs.d.ts +2 -1
  37. package/dist/packages/core/src/components/Tabs.js +2 -1
  38. package/dist/packages/core/src/components/TextField.css +20 -1
  39. package/dist/packages/core/src/components/TextField.d.ts +7 -1
  40. package/dist/packages/core/src/components/TextField.js +2 -1
  41. package/dist/packages/core/src/components/Training/TrainingCardGroup.css +22 -3
  42. package/dist/packages/core/src/components/Word/WordSearchResultBlock.css +9 -0
  43. package/dist/packages/core/src/components/Word/WordSearchResultBlock.js +8 -2
  44. package/dist/packages/core/src/components/barChartTypes.d.ts +20 -0
  45. package/dist/packages/core/src/components/controlSize.d.ts +87 -1
  46. package/dist/packages/core/src/components/controlSize.js +87 -1
  47. package/dist/packages/core/src/components/useBarChartControl.js +27 -7
  48. package/dist/packages/core/src/components.d.ts +3 -3
  49. package/dist/packages/core/src/components.js +1 -1
  50. package/dist/packages/core/src/hooks/useWideCardSpans.d.ts +28 -0
  51. package/dist/packages/core/src/hooks/useWideCardSpans.js +85 -0
  52. package/dist/packages/core/src/i18n/locales/en.json +1 -0
  53. package/dist/packages/core/src/i18n/locales/ko.json +1 -0
  54. package/dist/packages/core/src/utils/legacyBlocks.js +5 -1
  55. package/dist/packages/core/src/version.d.ts +1 -1
  56. package/dist/packages/core/src/version.js +1 -1
  57. package/dist/utils.cjs.js +21 -21
  58. package/package.json +1 -1
  59. package/dist/packages/core/src/components/StatChart.css +0 -93
@@ -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({ 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 {
@@ -398,6 +398,26 @@ export declare interface BarChartProps {
398
398
  * 굵기는 인라인이 아니라 그 변수로 박혀 있다.
399
399
  */
400
400
  barWidth?: number;
401
+ /**
402
+ * **캔버스 키(px)** — 안 주면 `size` 프리셋이 정한다(small 100 · medium 140 · large 180).
403
+ *
404
+ * 카드가 **정해진 상자에 들어가야 할 때** 쓴다. 말귀 대시보드의 `상세 현황` 차트가
405
+ * `ChartSection` 의 `large` 상자(540×260)에 서야 해서 열었다(사장님 지시 2026-11-02) —
406
+ * 260 에서 겉과 머리를 빼면 몸통에 132 가 남고 x축 라벨이 41 이라 캔버스는 90 이다.
407
+ *
408
+ * **프리셋을 바꾸는 대신 프롭을 연 까닭** — `medium` 을 140 → 90 으로 내려 봤더니
409
+ * 짝 시험 **열넷**이 빨개졌다(막대 자리를 140 으로 셈하는 자들이다). 한 화면 때문에
410
+ * 모든 차트의 막대 셈을 흔들 일이 아니다.
411
+ */
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;
401
421
  /** 섹션 제목 i18n 키 */
402
422
  titleKey: string;
403
423
  /** 제목을 머리글 몇 급으로 그릴지 — 그대로 `ChartSection` 에 넘긴다(말귀 요청 (60)③, 2026-10-02).
@@ -1260,10 +1280,21 @@ export declare interface ChartPoint {
1260
1280
  * 공유하도록 두 컴포넌트가 내부적으로 사용한다.
1261
1281
  * @public
1262
1282
  */
1263
- export declare function ChartSection({ title, titleClassName, titleLevel, icon, disc, headRight, headFloat, headSegment, headMenuItems, collapseBelow, onClick, ariaLabel, tooltip, totalNum, totalUnit, totalLabel, 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;
1264
1284
 
1265
1285
  /** @public */
1266
1286
  export declare interface ChartSectionProps {
1287
+ /** 카드 갈래 — `chart`(기본) · `stat`. 아래 프롭 중 어느 것이 드는지가 갈린다 */
1288
+ type?: ChartSectionType;
1289
+ /** `stat` 전용 — 값 옆 증감 수치. 부호(+/-)는 자동으로 붙는다(3 → "+3", -2 → "-2") */
1290
+ change?: number;
1291
+ /** `stat` 전용 — 증감 색. 안 주면 `change` 의 부호로 정한다(양수=up, 음수=down, 0=neutral) */
1292
+ changeType?: StatChartChangeType;
1293
+ /** 카드의 급 — `small` · `medium` · `large` · `xLarge`, 또는 키를 px 로 바로.
1294
+ * 안 주면 갈래를 따른다(`stat`→`small` · `chart`→`large`) */
1295
+ size?: ChartSectionSize | number;
1296
+ /** `stat` 전용 — 값 아래 자리가 서는 곳. `bottom`(기본, 카드 바닥) · `center` */
1297
+ bodyAlign?: StatChartBodyAlign;
1267
1298
  /** 제목을 **머리글 몇 급**으로 그릴지(말귀 요청 (51), 2026-10-02).
1268
1299
  *
1269
1300
  * 전에는 제목이 `<div class="h3">` 였다 — `h3` 는 **글자 꼴**이지 머리글이 아니다.
@@ -1280,7 +1311,7 @@ export declare interface ChartSectionProps {
1280
1311
  icon?: string;
1281
1312
  /** 제목 아래 설명 한 줄 — `Section` 의 `disc` 와 같은 결 */
1282
1313
  disc?: ReactNode;
1283
- /** 제목 타이포그래피 클래스 (기본: 'h3') — 작은 카드(size='small')는 'h5' 등으로 축소 */
1314
+ /** 제목 타이포그래피 클래스 — 기본 `h5`(갈래 셋이 같다, 2026-11-02). 큰 카드에서 올리려면 'h3' 등을 준다 */
1284
1315
  titleClassName?: string;
1285
1316
  /** 헤더 우측 영역 — 기간 네비게이션, 상세보기 버튼 등.
1286
1317
  * 함수로 주면 `collapsed`(머리가 좁아 고르개가 '⋯' 로 접혔는가)를 받는다 — 접혔을 때 단추를 메뉴로 옮기는 쪽이 쓴다. */
@@ -1320,6 +1351,12 @@ export declare interface ChartSectionProps {
1320
1351
  totalNum?: ReactNode;
1321
1352
  /** 수 뒤 단위(`%` 등) — `totalNum` 과 함께 쓴다 */
1322
1353
  totalUnit?: ReactNode;
1354
+ /** 값이 **수가 아니라 빈 것을 이르는 말**일 때(`없음` 등) — 글자를 `lightGray` 로 낮춘다
1355
+ * (사장님 지시 2026-11-02 "없음은 lightGray 로").
1356
+ *
1357
+ * **코어는 그 글자를 못 알아본다** — `totalNum` 은 아무 노드나 받으므로 `없음`·`None`·`—` 이
1358
+ * 수인지 말인지 가릴 길이 없다. 그래서 **부르는 쪽이 말해 준다.** */
1359
+ totalMuted?: boolean;
1323
1360
  /** 수 앞 설명 한 줄 — 색을 입힌 대비 수치 등은 노드로 넘긴다(앱 규칙) */
1324
1361
  totalLabel?: ReactNode;
1325
1362
  /** 카드에 포인터가 닿을 때(키보드는 초점이 들어올 때) 뜨는 설명 — `StatChart tooltip` 과 같은 뜻.
@@ -1327,6 +1364,16 @@ export declare interface ChartSectionProps {
1327
1364
  tooltip?: string;
1328
1365
  /** 총계(ChartTotal) + 범례(ChartLegend)를 담는 서브로우 */
1329
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;
1330
1377
  /** 서브로우에 선 것들의 **세로 맞춤** — `'start'`(기본) · `'center'` · `'end'`.
1331
1378
  *
1332
1379
  * 기본이 `'start'` 인 것은 **범례** 때문이다. 수(설명 한 줄 + 큰 수, 두 줄)와 범례가 함께 서면
@@ -1348,9 +1395,83 @@ export declare interface ChartSectionProps {
1348
1395
  children?: ReactNode;
1349
1396
  }
1350
1397
 
1398
+ /**
1399
+ * **카드의 급 — 넷**(사장님 지시 2026-11-02, 화면에서 하나씩 짚어 주셨다).
1400
+ *
1401
+ * | 급 | 보기 | 상자(실측 2026-11-02, 폭 1430) |
1402
+ * |---|---|---|
1403
+ * | `small` | `총 고객` — 수 하나 | 260 × **120** |
1404
+ * | `medium` | `금일 방문 예정` · 작은 고리 카드 | 260 × **260** |
1405
+ * | `large` | `상세 방문 현황` — 격자 두 칸에 서는 차트 카드 | 두 칸 폭 × 260 이상 |
1406
+ * | `xLarge` | 가로를 통째로 쓰는 차트 카드 | 폭 100% |
1407
+ *
1408
+ * **`small` 의 키가 사다리의 밑동이고, `medium` 은 그것의 두 배 + 틈이다**(사장님 지시
1409
+ * 2026-11-02 — *"small의 높이부터 고정하고 가는 게 나을 것 같아"*). 그래야 격자에서
1410
+ * **`medium` 하나와 `small` 둘(위아래로 쌓인)의 바닥이 한 선**에 선다. 109 는 `small` 의
1411
+ * 속이 내는 키다(여백 19×2 + 테두리 2 + 제목 줄 23 + 틈 2 + 큰 수 44). 틈 14 는 집안
1412
+ * 격자의 틈이고 `.chart-section` 의 아래 여백과 같은 수다.
1413
+ *
1414
+ * 기본은 갈래를 따른다 — `type="stat"` 은 `small`, `type="chart"` 는 `large`.
1415
+ *
1416
+ * 전에는 이 수가 **세 군데에 흩어져** 있었다: `ChartSection` 의 `size`(키 `auto`·`ring`),
1417
+ * `RingChart`·`BarChart` 의 `size`(`small`·`medium`·`large`), 그리고 그 둘이 손으로
1418
+ * 붙이던 `chart-section--compact`·`--full` 클래스. 한 사다리로 모은다.
1419
+ *
1420
+ * 수를 바로 줘도 된다(px) — 프리셋이 안 맞는 자리용 탈출구다.
1421
+ * @public
1422
+ */
1423
+ declare type ChartSectionSize = 'small' | 'medium' | 'large' | 'xLarge';
1424
+
1425
+ /**
1426
+ * **카드의 갈래** — `chart`(기본) 와 `stat` 둘이다.
1427
+ *
1428
+ * `StatChart` 가 따로 있던 것을 여기로 합쳤다(사장님 지시 2026-11-02 — "chartsection과
1429
+ * statChart 하나로 합쳐, type 으로 전부 분기해"). 둘은 테두리·제목·아이콘·큰 수가 **같은
1430
+ * 것**인데 코드가 둘이라, 한쪽만 고치면 조용히 어긋났다 — 그날 하루에만 네 번 따로 고쳤고
1431
+ * 고리 카드의 수가 `32px` 에 남아 실제로 갈렸다.
1432
+ *
1433
+ * | | `chart` | `stat` |
1434
+ * |---|---|---|
1435
+ * | 꼴 | 머리 + 서브로우(수·범례) + 차트 몸통 | 제목 줄 + 큰 수 + 값 아래 자리 |
1436
+ * | 아이콘 | 제목 **왼쪽** | 제목 줄 **오른쪽 끝** |
1437
+ * | 제목 | `h3` · 머리글 급 3 | `h5` · 머리글 아님(급 0) |
1438
+ * | 큰 수 | `totalNum`(서브로우) | `totalNum`(제목 바로 아래) |
1439
+ *
1440
+ * `stat` 에서만 드는 프롭: `change` · `changeType` · `size` · `bodyAlign`.
1441
+ * `chart` 에서만 드는 프롭: `headSegment` · `headFloat` · `subRow` · `disc` 등 머리 쪽 전부.
1442
+ * @public
1443
+ */
1444
+ export declare type ChartSectionType = 'chart' | 'stat';
1445
+
1351
1446
  /** 차트 총계 표시 — label이 있으면 라벨(윗줄)+값(아랫줄) stacked, 없으면 값만. @public */
1352
1447
  export declare function ChartTotal({ label, children }: ChartTotalProps): JSX.Element;
1353
1448
 
1449
+ /**
1450
+ * **카드가 보이는 큰 수의 글자 단계** — 작은 카드(`size="small"` · `type="stat"` 과 한 줄에
1451
+ * 서는 것)는 수 칸의 값과 같은 `h1`(32px · 700), 그 밖은 `h0`(40px).
1452
+ *
1453
+ * `h1` 은 **원래 모습으로 돌아간 것**이다(사장님 지시 2026-11-02 "h1으로"). 2026-11-02
1454
+ * 아침까지 수 칸의 값은 `32px · 700 · 자간 -0.5` 를 CSS 에 박고 있었는데 — 그것이 바로
1455
+ * `h1` 토큰이다(줄높이만 1 이었다). 그날 낮에 `h2`(24·500) 로 내려 봤다가 되돌렸다.
1456
+ *
1457
+ * 네 자리(`ChartSection` · `BarChart` 셋 · `RingChart`)가 저마다 `h0` 를 적고 있었다.
1458
+ *
1459
+ * **`h0`(40px)는 가로를 통째로 쓰는 카드 하나뿐이다**(2026-11-02 — 사장님이 고리 카드의
1460
+ * `56`(h1)과 차트 카드의 `0`(h0)을 나란히 놓고 "같은 거 맞아?" 하셨다. 아니었다).
1461
+ * 격자에 서는 카드는 크기가 달라도 **수의 단계는 같아야** 한 줄로 읽힌다.
1462
+ * 작은 카드만 CSS 로 크기를 덮어 맞췄는데, 그러면 **마크업에 적힌 단계가 아무 일도 안
1463
+ * 한다** — 글자를 고쳐도 화면이 안 바뀐다(사장님이 2026-11-02 에 짚으셨다). 단계를 한
1464
+ * 군데서 정하고, 부르는 쪽은 "작은 카드인가" 만 넘긴다.
1465
+ *
1466
+ * **큰 수의 이름은 이것 하나다**(사장님 지시 2026-11-02 — "하나는 sub-row고 하나는
1467
+ * section-content 네 하나로 통일해"). 수 칸만 `__value`·`__value-row` 라는 제 이름을
1468
+ * 따로 쓰고 있었다 — 같은 자리의 같은 수인데 규칙을 두 벌씩 써야 했고, 그날도 차트 쪽
1469
+ * 한 자리를 빠뜨려 큰 수의 윗여백이 그 카드만 안 들었다. 이제 **그리는 자리 다섯**
1470
+ * (수 칸 · 차트 카드 · 막대 합계 셋 · 고리 퍼센트)이 다 이 함수를 부른다.
1471
+ * @public
1472
+ */
1473
+ export declare const chartTotalNumClass: (small?: boolean) => string;
1474
+
1354
1475
  /** @public */
1355
1476
  export declare interface ChartTotalProps {
1356
1477
  /** 값 위에 표시하는 라벨(윗줄). 지정 시 stacked 레이아웃(라벨 위 · 값 아래). */
@@ -1534,7 +1655,8 @@ export declare interface ColorPickerProps {
1534
1655
  onChange: (hex: string) => void;
1535
1656
  /** 선택 가능한 색상 팔레트. 기본값은 디자인 시스템 브랜드 색상 */
1536
1657
  palette?: string[];
1537
- /** 스와치 크기 — Button과 동일한 체계 (32 / 40 / 48), radius도 Button rounded와 동일하게 맞춤 */
1658
+ /** 스와치 크기 — Button과 동일한 체계 (32 / 40 / 48), radius도 Button rounded와 동일하게 맞춤.
1659
+ * 안 주면 공용 수다(`CONTROL_SIZE` — 2026-11-02 부터 32. 전에는 40 이 박혀 있었다). */
1538
1660
  size?: ColorPickerSize;
1539
1661
  className?: string;
1540
1662
  /** 묶음의 이름(예: '글자 색') — 낭독기가 무엇의 색을 고르는지 읽는다 */
@@ -1945,7 +2067,7 @@ export declare function copyText(text: string): Promise<boolean>;
1945
2067
  *
1946
2068
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
1947
2069
  */
1948
- export declare const CORE_VERSION = "0.413.0";
2070
+ export declare const CORE_VERSION = "0.415.0";
1949
2071
 
1950
2072
  /** @public */
1951
2073
  declare const coreDefault: Record<string, unknown>;
@@ -2191,7 +2313,8 @@ export declare interface DatePickerProps {
2191
2313
  * 줄·머리에서 곁에 서는 단추·글상자·고르개가 모두 40 이다. 기본이 48 이면 안 적은
2192
2314
  * 자리만 한 급 크게 서고, 그것을 막으려고 자리마다 40 을 손으로 적게 된다.
2193
2315
  */
2194
- size?: 40 | 48 | 64;
2316
+ /** 조절칸 키 — 32(줄·머리 기본, 2026-11-02) · 40 · 48 · 64 */
2317
+ size?: 32 | 40 | 48 | 64;
2195
2318
  min?: string;
2196
2319
  max?: string;
2197
2320
  disabled?: boolean;
@@ -2499,7 +2622,8 @@ export declare interface DropdownProps {
2499
2622
  * 단추·글상자·고르개가 40 인데 혼자 48 로 섰다(실측 2026-10-29). `SegmentedControl` 도
2500
2623
  * 2026-09-21 에 같은 까닭으로 48 → 40 으로 내렸다. 큰 자리만 48 을 적는다.
2501
2624
  */
2502
- size?: 40 | 48;
2625
+ /** 조절칸 키 — 32(줄·머리 기본, 2026-11-02) · 40 · 48 */
2626
+ size?: 32 | 40 | 48;
2503
2627
  error?: boolean;
2504
2628
  className?: string;
2505
2629
  /** 화면에 보이는 라벨 없이 스크린리더용 이름을 지정할 때 사용 */
@@ -7186,7 +7310,11 @@ export declare interface SegmentedControlProps {
7186
7310
  *
7187
7311
  * 기본이 48 이던 것을 40 으로 내렸다(사용자 지시 2026-09-21). 코어가 제 안에서 세우는 고르개는 이미 **전부 40**
7188
7312
  * 이었고(`Toolbar`·`FilterPanel`·`BarChart`·`PanelRow`…), 옆에 서는 `Dropdown`·`TextField` 도 40 이다 —
7189
- * 기본값만 혼자 48 이라 안 주고 쓴 자리가 한 급 크게 섰다. */
7313
+ * 기본값만 혼자 48 이라 안 주고 쓴 자리가 한 급 크게 섰다.
7314
+ *
7315
+ * **이제 기본은 공용 수다**(`CONTROL_SIZE` — 2026-11-02 부터 32). 손으로 적은 수를 두면
7316
+ * 공용 수가 움직일 때 **안 주고 부른 자리만 뒤에 남는다** — 2026-11-02 에 그 일이 났고
7317
+ * `Dropdown`·`DatePicker` 둘만 32 가 깔렸다(말귀_3 청 (408)). */
7190
7318
  size?: 24 | 32 | 40 | 48;
7191
7319
  shape?: 'rounded' | 'pill';
7192
7320
  useBG?: boolean;
@@ -7810,12 +7938,35 @@ export declare interface SplashLogoProps {
7810
7938
  export declare function splitTrainingVariants(value: unknown): string[];
7811
7939
 
7812
7940
  /**
7813
- * 순수 카운트 스탯 카드 — 제목+아이콘, 큰 숫자, 증감(선택) 만 보여준다.
7814
- * 도넛/리스트처럼 숫자 하나로 요약되지 않는 카드는 이 컴포넌트의 대상이 아니다
7815
- * (도넛 breakdown은 RingChart segments 모드, 리스트는 페이지에서 직접 구성).
7941
+ * 순수 카운트 스탯 카드.
7942
+ *
7943
+ * @deprecated **`<ChartSection type="stat">` 을 쓴다**(사장님 지시 2026-11-02 — "chartsection과
7944
+ * statChart 하나로 합쳐, type 으로 전부 분기해"). 몸은 이미 그쪽 하나다 — 이것은 이름만
7945
+ * 옮겨 주는 얇은 껍데기이고, 소비자가 다 옮기면 지운다.
7946
+ *
7947
+ * | 여기 | 저기 |
7948
+ * |---|---|
7949
+ * | `label` | `title` |
7950
+ * | `value` | `totalNum` |
7951
+ *
7952
+ * 나머지(`change` · `changeType` · `icon` · `tooltip` · `onClick` · `size` · `bodyAlign` ·
7953
+ * `children`)는 이름이 같다.
7816
7954
  * @public
7817
7955
  */
7818
- export declare function StatChart({ label, value, change, changeType, icon, tooltip, onClick, children }: StatChartProps): JSX.Element;
7956
+ export declare function StatChart({ label, value, change, changeType, icon, tooltip, onClick, size, bodyAlign, children }: StatChartProps): JSX.Element;
7957
+
7958
+ /**
7959
+ * **값 아래 자리(`children`)가 `stat` 카드 안에서 어디에 서나.**
7960
+ *
7961
+ * 기본은 `bottom` — 목록이 카드 바닥까지 내려와 선다(`__left` 가 남는 키를 다 먹는다).
7962
+ * 여러 줄이 차는 카드에는 그게 맞다.
7963
+ *
7964
+ * `center` 는 **그 자리에 한 줄만 들 때**를 위한 것이다. 키를 `size` 로 올려 둔 카드가
7965
+ * 빌 때(예: `오늘 방문 예정이 없습니다.`) 그 한 줄이 바닥에 홀로 붙어, 위의 빈 자리가
7966
+ * 잘린 것처럼 보인다. `center` 는 값 아래 남는 자리의 한가운데에 세운다.
7967
+ * @public
7968
+ */
7969
+ export declare type StatChartBodyAlign = 'bottom' | 'center';
7819
7970
 
7820
7971
  /** @public */
7821
7972
  export declare type StatChartChangeType = 'up' | 'down' | 'neutral';
@@ -7835,11 +7986,17 @@ export declare interface StatChartProps {
7835
7986
  /** 호버 시 표시할 툴팁 텍스트 */
7836
7987
  tooltip?: string;
7837
7988
  onClick?: () => void;
7838
- /** 값 **아래** 에 붙는 자리 — 목록 몇 줄, "외 n건" 단추처럼 값을 풀어 보이는 것.
7839
- * 이 자리가 없어 소비자가 카드 마크업(`stat-chart__card__*` 여덟 이름)을 통째로 베끼고 있었다(말귀 매니저 '금일 방문 예정'). */
7840
- children?: ReactNode;
7989
+ /** 카드의 급 — `small`(기본) · `medium` · `large` · `xLarge`, 또는 키를 px 로 바로 */
7990
+ size?: StatChartSize | number;
7991
+ /** 값 아래 자리가 서는 곳 — `bottom`(기본, 카드 바닥) · `center`(값 아래 남는 자리의 한가운데) */
7992
+ bodyAlign?: StatChartBodyAlign;
7993
+ /** 값 **아래** 에 붙는 자리 — 목록 몇 줄, "외 n건" 단추처럼 값을 풀어 보이는 것 */
7994
+ children?: ChartSectionProps['children'];
7841
7995
  }
7842
7996
 
7997
+ /** @deprecated `ChartSectionSize` 를 쓴다 — `auto`→`small` · `ring`→`medium`(2026-11-02) @public */
7998
+ export declare type StatChartSize = ChartSectionSize;
7999
+
7843
8000
  /**
7844
8001
  * Compound Step Components that work within TrainingPagePopup context
7845
8002
  */
@@ -7986,7 +8143,7 @@ export declare function summarizeMisses(records: readonly TrainingResultRecord[]
7986
8143
  * { label: '생년월일', value: patient.birthDate },
7987
8144
  * { label: '환자번호', value: patient.chartNo ?? '-' },
7988
8145
  * ]}
7989
- * actions={<Button size={40} type="dot" icon="pencil" ariaLabel="정보 수정" onClick={onEdit} />}
8146
+ * actions={<Button size={32} type="dot" icon="pencil" ariaLabel="정보 수정" onClick={onEdit} />}
7990
8147
  * />
7991
8148
  * ```
7992
8149
  *
@@ -8371,6 +8528,22 @@ export declare type TableProps<T extends {
8371
8528
  *
8372
8529
  * **손으로 끌어 둔 표에는 안 듣는다**(`manual`) — 사람이 정한 폭을 쪽 넘김이 덮으면
8373
8530
  * 그것이야말로 뜻 모를 움직임이다. '칸 너비 초기화' 를 눌러 자동으로 돌아가면 다시 듣는다.
8531
+ *
8532
+ * ## 쪽 넘김 말고도 쓸 자리가 있다 — **칸 내용이 첫 잼보다 늦게 들어오는 표**
8533
+ *
8534
+ * 아래 `refitBasis` 걸쇠는 **한 번만 재게** 한다(줄 내용이 갈린 것으로는 다시 안 잰다 —
8535
+ * 위 까닭). 그래서 **줄은 이미 들어왔는데 칸 글자가 아직 비어 있는 렌더가 한 번이라도
8536
+ * 서면, 그 빈 폭이 걸쇠에 박혀 영영 안 풀린다.** `loading` 을 넘겨 막아 보려 해도 한
8537
+ * 발일 뿐이다 — 한 렌더만 일찍 거짓이 되면 그 한 발이 빈 표에 박힌다.
8538
+ *
8539
+ * 말귀 '단어 관리' 가 그 자리를 밟았다(2026-10-31): 낱말은 바로 서는데 **뜻은 따로
8540
+ * 받아** 늦게 채워져, 넷에 한 번 뜻 없는 폭(320px)이 굳었다. `loading` 문을 겹쳐도
8541
+ * 3/4 였고, `refitOn={meanings.size > 0 ? 1 : 0}` 하나로 4/4 가 됐다.
8542
+ *
8543
+ * **걸쇠를 다시 여는 것은 이것뿐이다** — 나머지 계기는 초기화 단추(`refitNonce`)·통 폭
8544
+ * (`boxWidth`)·칸 수(`fields.length`)가 각각 쥐고 있고, 칸 내용을 보는 것은 없다.
8545
+ * 그러니 늦게 오는 값이 **더 붙을 수 있는** 표면 그 값의 *양*(`meanings.size`)을 주고,
8546
+ * 한 번에 다 오면 *왔나 안 왔나*(`? 1 : 0`)로 족하다.
8374
8547
  */
8375
8548
  refitOn?: string | number;
8376
8549
  /** 높이 스케일 — Panel과 공유 (small 48 / medium 56 / large 64). header·row 모두 적용. 기본 small */
@@ -8500,7 +8673,8 @@ export declare interface TabsProps {
8500
8673
  /** 고른 탭의 key 로 불린다. **값이 바뀔 때만** — 지금 탭을 다시 누르거나 화살표가 지금 탭에 머물면 부르지 않는다. */
8501
8674
  onChange?: (key: string) => void;
8502
8675
  className?: string;
8503
- /** 탭 버튼 높이 — SegmentedControl과 동일 체계 (32 / 40 / 48) */
8676
+ /** 탭 버튼 높이 — SegmentedControl과 동일 체계 (32 / 40 / 48).
8677
+ * 안 주면 공용 수다(`CONTROL_SIZE` — 2026-11-02 부터 32. 전에는 40 이 박혀 있었다). */
8504
8678
  size?: 32 | 40 | 48;
8505
8679
  }
8506
8680
 
@@ -8571,7 +8745,13 @@ export declare interface TextFieldProps {
8571
8745
  helperText?: string;
8572
8746
  /** 최대 글자 수 — 설정 시 글자수 카운터 표시 */
8573
8747
  maxLength?: number;
8574
- /** 필드 크기 (실제 높이 px). 박스 치수만 결정 — 텍스트 스타일은 variant가 담당 */
8748
+ /** 필드 크기 (실제 높이 px). 박스 치수만 결정 — 텍스트 스타일은 variant가 담당.
8749
+ *
8750
+ * **안 주면 공용 수다**(`CONTROL_SIZE` — 2026-11-02 부터 32). 전에는 40 이 박혀 있어,
8751
+ * 공용 수가 32 로 내려간 뒤에도 **`size` 를 안 주고 부른 자리만 40 으로 섰다**
8752
+ * (말귀_3 청 (408) · 실측: 어드민 다섯 · 회원앱 셋 · 코어 셋. 업체 등록 창에서는
8753
+ * 바로 아래 `Dropdown` 이 이미 32 라 한 창에 40 과 32 가 나란히 섰다).
8754
+ * 48·64 가 맞는 자리는 그 자리에 적는다. */
8575
8755
  size?: 32 | 40 | 48 | 64;
8576
8756
  /**
8577
8757
  * 텍스트 스타일 변형 (size와 분리)
@@ -36,8 +36,24 @@
36
36
  align-items: center;
37
37
  }
38
38
 
39
+ /* `min-width: 0` 이 있어야 **줄어들 수 있다.** 플렉스 자식의 `min-width` 는 기본이 `auto`
40
+ 라서 속 내용의 최소 폭 아래로 안 줄어든다 — 제목 안에 한 줄 + 말줄임(`white-space:
41
+ nowrap`)인 글이 들어가면 그 글의 최소 폭이 이 칸의 바닥이 되고, 칸이 머리를 넓히고
42
+ 머리가 쪽을 넓혀 **쪽 전체가 옆으로 밀린다.**
43
+
44
+ 말귀_2 가 회원앱 도움말 쪽에서 재어 올렸다(청 (363), 2026-11-02 · 폭 375 · 0.413.0):
45
+ `.content-area` 의 `scrollWidth` 가 **454**(칸은 375 — 79px 이 밖으로), 이 줄을 꽂으면
46
+ 375 로 떨어지고 빼면 454 로 돌아왔다(두 번 재서 가렸다). 앱이 제 쪽
47
+ `.help-inquiry-item__head` 에 `min-width: 0` 을 이미 줬는데 **이 칸에서 막혀** 안
48
+ 내려왔고, 못 `coreOwnedCssTargets` 가 앱 CSS 로 코어 이름 겨누는 것을 막으므로 앱에서
49
+ 덮을 길도 없었다.
50
+
51
+ **넓은 창은 안 흔들린다** — 이것은 *줄어들 수 있게* 할 뿐이고 자리가 넉넉하면 전과
52
+ 같다(1440·768 에서는 전에도 넘침 0 이었다). 그리고 **아무것도 안 가린다** — 자르는 것은
53
+ 제목 안에 넣은 글이 스스로 정하는 일이고, 코어는 칸이 쪽을 밀지 않게만 한다. */
39
54
  .accordion-item__title {
40
55
  flex: 1;
56
+ min-width: 0;
41
57
  text-align: left;
42
58
  }
43
59
 
@@ -1,11 +1,14 @@
1
1
  /* BarChart — 막대차트 섹션 (제목 + 구간 네비 + 주/일 토글 + 2계열 막대) */
2
2
  /* 카드/헤더/total/legend 공통 레이아웃은 ChartSection.css 로 이동(RingChart 섹션과 공유) */
3
3
 
4
- /* 월/주 드롭다운 고정 너비 (주: 'YYYY년 M월 N째주' 수용) */
4
+ /* 월/주 드롭다운 고정 너비 — 가장 긴 글(`2026.11 다섯째주`)을 담는 만큼.
5
+ **200 → 150**(사장님 지시 2026-11-02 — "길이도 좀 줄이고"). 글을 `2026년 11월 첫째주`
6
+ 에서 `2026.11 첫째주` 로 줄인 만큼 상자도 줄인다. 머리의 조절칸 넷이 416 → 366 이 되어
7
+ 카드 폭 540 안에서 제목과 한 줄로 선다. */
5
8
  .month-dropdown .dropdown__trigger {
6
- width: 200px;
7
- min-width: 200px;
8
- max-width: 200px;
9
+ width: 150px;
10
+ min-width: 150px;
11
+ max-width: 150px;
9
12
  }
10
13
 
11
14
  /* 월 드롭다운 스크롤 */
@@ -27,6 +30,14 @@
27
30
  flex-direction: column;
28
31
  gap: var(--spacing-s);
29
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
+ }
30
41
  .bar-chart__gridline {
31
42
  position: absolute;
32
43
  left: 0;
@@ -80,6 +91,10 @@
80
91
 
81
92
  /* 막대 컬럼(flex:1 중앙)과 동일하게 — 막대 중심과 라벨 중심을 수직 정렬.
82
93
  좁을 때 겹침 방지: 메인/서브를 세로 스택 + 줄바꿈 허용 */
94
+ /* **두 줄로 되돌렸다**(사장님 지시 2026-11-02 — "이거 다시 두줄로 바꿔야 겠다").
95
+ 같은 날 한 줄로 바꿨는데(`7~13 첫째주`), 그때 잰 칸 폭 125 는 **넓은 화면의 차트**였다.
96
+ 대시보드의 좁은 차트는 칸이 70px 밖에 안 돼 `23~29 셋째주` 가 한 줄에 못 서고
97
+ **수 한가운데서 끊겼다**(`23~2` / `9`). 위아래로 쌓으면 수와 이름이 각자 한 줄을 쓴다. */
83
98
  .bar-chart__x-axis__label {
84
99
  flex: 1;
85
100
  min-width: 0;
@@ -177,3 +192,4 @@
177
192
  gap: var(--bar-group-gap, 1px);
178
193
  padding: 0 4px;
179
194
  }
195
+
@@ -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({ 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';
@@ -9,7 +9,7 @@ import Button from './Button';
9
9
  import Loader from './Loader';
10
10
  import { getTodayKstDate } from '../utils/date';
11
11
  import DescriptionTooltip from './Tooltip/DescriptionTooltip';
12
- import ChartSection, { ChartTotal, ChartLegend } from './ChartSection';
12
+ import ChartSection, { ChartTotal, ChartLegend, chartTotalNumClass } from './ChartSection';
13
13
  import { devWarnOnce } from '../utils/devWarn';
14
14
  import { firstMondayOfMonth, weekLabel } from './barChartData';
15
15
  import { useBarChartControl } from './useBarChartControl';
@@ -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 }))] }));
@@ -211,7 +244,7 @@ export function BarChartControls({ control }) {
211
244
  주 보기에서 낭독기·툴팁이 실제 동작과 다른 말을 한다(말귀 검수 실측). */
212
245
  const prevLabel = period === 'week' ? t('calendar.prevWeek', '이전 주') : t('calendar.prevMonth', '이전 달');
213
246
  const nextLabel = period === 'week' ? t('calendar.nextWeek', '다음 주') : t('calendar.nextMonth', '다음 달');
214
- return (_jsxs("div", { className: withLegacy("chart-section__controls"), children: [_jsx(Button, { htmlType: "button", size: CONTROL_SIZE, type: "dot", icon: "chevron-left", ariaLabel: prevLabel, showTooltipInfo: prevLabel, disabled: activeIdx === activeOptions.length - 1, onClick: handlePrev }), _jsx(Dropdown, { value: range, onChange: setRange, options: activeOptions, size: CONTROL_SIZE, className: "month-dropdown", ariaLabel: t('calendar.rangeSelect', '기간 선택') }), _jsx(Button, { htmlType: "button", size: CONTROL_SIZE, type: "dot", icon: "chevron-right", ariaLabel: nextLabel, showTooltipInfo: nextLabel, disabled: activeIdx <= 0, onClick: handleNext }), _jsx(SegmentedControl, { ariaLabel: t('calendar.periodSelect', '기간 단위'), options: periodOptions, value: period, onChange: (k) => setPeriod(k), size: CONTROL_SIZE })] }));
247
+ return (_jsxs("div", { className: withLegacy("chart-section__controls"), children: [_jsx(Button, { htmlType: "button", size: CHART_HEAD_SIZE, type: "dot", icon: "chevron-left", ariaLabel: prevLabel, showTooltipInfo: prevLabel, disabled: activeIdx === activeOptions.length - 1, onClick: handlePrev }), _jsx(Dropdown, { value: range, onChange: setRange, options: activeOptions, size: CHART_HEAD_SIZE, className: "month-dropdown", ariaLabel: t('calendar.rangeSelect', '기간 선택') }), _jsx(Button, { htmlType: "button", size: CHART_HEAD_SIZE, type: "dot", icon: "chevron-right", ariaLabel: nextLabel, showTooltipInfo: nextLabel, disabled: activeIdx <= 0, onClick: handleNext }), _jsx(SegmentedControl, { ariaLabel: t('calendar.periodSelect', '기간 단위'), options: periodOptions, value: period, onChange: (k) => setPeriod(k), size: CHART_HEAD_SIZE })] }));
215
248
  }
216
249
  /**
217
250
  * 한 주(월요일부터 7일)의 날마다 — 그 날의 자료와 미래 여부. 달을 넘는 날은 그 달
@@ -284,7 +317,7 @@ function barsFromControl(data, control, t, showPast = true) {
284
317
  });
285
318
  }
286
319
  import { monthKeyOfDate, parseMonthKey } from './barChartMonthKey';
287
- import { CONTROL_SIZE } from './controlSize';
320
+ import { CHART_HEAD_SIZE } from './controlSize';
288
321
  import { withLegacy } from '../utils/legacyBlocks';
289
322
  /** 시맨틱 사이즈 → 캔버스 높이·막대 너비 프리셋 */
290
323
  const BAR_SIZE_PRESET = {
@@ -298,9 +331,10 @@ const BAR_SIZE_PRESET = {
298
331
  * - 주(week): 'YYYY년 M월 N째주' 드롭다운 + 그 주의 요일(월~일) 막대
299
332
  * 원시 렌더링은 내부 BarChartCanvas가 담당한다.
300
333
  */
301
- export default function BarChart({ 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 = CONTROL_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
- const sizePreset = BAR_SIZE_PRESET[size];
336
+ /* 캔버스 키는 부르는 쪽이 덮을 수 있다 — 굵기는 프리셋 그대로다(`canvasHeight`) */
337
+ const sizePreset = { ...BAR_SIZE_PRESET[size], ...(canvasHeight === undefined ? null : { height: canvasHeight }) };
304
338
  // 외부 control 미지정 시 내부 컨트롤 사용 (단독 차트 하위 호환)
305
339
  const internalControl = useBarChartControl(data);
306
340
  const control = controlProp ?? internalControl;
@@ -432,8 +466,9 @@ export default function BarChart({ focusableBars, size = 'medium', barWidth, tit
432
466
  const isSmall = size === 'small';
433
467
  // size='large' — 카드가 가로 폭을 거의 100% 차지(1열)
434
468
  const isLarge = size === 'large';
435
- const sectionClassName = [isSmall ? 'chart-section--compact' : isLarge ? 'chart-section--full' : undefined, className]
436
- .filter(Boolean).join(' ') || undefined;
469
+ /* **급을 `ChartSection` 에 넘긴다**(2026-11-02) — 사다리가 한 칸 어긋난다(위 RingChart 와 같다) */
470
+ const sectionSize = isSmall ? 'medium' : isLarge ? 'xLarge' : 'large';
471
+ const sectionClassName = className || undefined;
437
472
  /**
438
473
  * **상세보기 단추 이름에 그 카드 이름을 담는다**(말귀 요청 (119), 2026-10-12).
439
474
  *
@@ -449,20 +484,24 @@ export default function BarChart({ focusableBars, size = 'medium', barWidth, tit
449
484
  const detailTitle = cardTitle
450
485
  ? t('trainingStatus.detailFor', { name: cardTitle, defaultValue: '{{name}} 상세보기' })
451
486
  : t('trainingStatus.detail', '상세보기');
452
- return (_jsx(ChartSection, { className: sectionClassName, inGrid: inGrid, icon: icon, disc: disc, onClick: onClick, ariaLabel: cardAriaLabel, tooltip: cardTooltip, headSegment: headSegment,
487
+ return (_jsx(ChartSection, { className: sectionClassName, size: sectionSize, inGrid: inGrid, icon: icon, disc: disc, onClick: onClick, ariaLabel: cardAriaLabel, tooltip: cardTooltip, headSegment: headSegment,
453
488
  /* 좁아 고르개가 '⋯' 로 접히면 상세보기도 그 메뉴로 들어간다 — 머리에 단추 둘이 남지 않게 */
454
- headMenuItems: onDetail ? [{ label: detailTitle, icon: 'list', onClick: onDetail, closeOnSelect: true }] : undefined, title: t(titleKey), titleLevel: titleLevel, titleClassName: isSmall ? 'h5 chart-section-title--small' : undefined, 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)) ? (
455
- // 진행률/평균 모드 또는 totalLabelKey+totalFormat 조합: 라벨(윗줄) + 값(아랫줄). size='small'은 라벨 생략
456
- _jsx(ChartTotal, { label: isSmall ? undefined : `${t(control.period === 'week' ? 'manager.chart.weeklyPrefix' : 'manager.chart.monthlyPrefix')} ${t(totalLabelKey ?? labelAKey)}`, children: totalFormat ? (
457
- // 숫자는 h0, 단위(시간/분/초 등)는 h5로 분리
458
- /* 부호는 숫자 쪽에 붙인다 — `[^\d]+` 로 가르면 '-7%p' 의 '-' 가 단위로 넘어가 h5 로 작아졌다(변동률) */
459
- (totalFormat(total).match(/([+-]?\d[\d.,]*|[^\d]+)/g) ?? []).map((part, i) => (/\d/.test(part)
460
- ? _jsx("span", { className: withLegacy("chart-section__total__num h0"), children: part }, i)
461
- : _jsx("span", { className: withLegacy("chart-section__total__unit h5"), children: part }, i)))) : (_jsxs(_Fragment, { children: [_jsx("span", { className: withLegacy("chart-section__total__num h0"), children: total }), totalUnitKey && _jsx("span", { className: withLegacy("chart-section__total__unit h5"), children: t(totalUnitKey) })] })) })) : (_jsxs(ChartTotal, { children: [_jsx("span", { className: withLegacy("chart-section__total__num h0"), children: total }), _jsx("span", { className: withLegacy("chart-section__total__unit h5"), children: t(labelAKey) }), totalUnitKey && _jsx("span", { className: withLegacy("chart-section__total__unit h5"), 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 ? (
462
501
  /* **뼈대 먼저, 그 안에서 기다린다**(사용자 지시 2026-09-17). 기다림 상자를 따로 두면
463
502
  자료가 오는 순간 카드 키가 달라져 격자가 한꺼번에 내려앉는다 — 말귀 실측: 상자 186px
464
503
  → 막대 156px 로 카드마다 30px, 섹션 372 → 342px.
465
504
  그래서 **그려질 것과 같은 뼈대**(칸 자리 + 축 한 줄)를 세우고 그 안에 스피너를 둔다.
466
505
  키는 막대 자리(`sizePreset.height`)에서 오므로 크기 보기(size)가 달라도 따라온다. */
467
- _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 })) }));
468
507
  }