@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.
- package/CHANGELOG.md +582 -0
- package/dist/components.cjs.js +179 -179
- package/dist/components.esm.css +2 -2
- package/dist/hooks.cjs.js +5 -5
- package/dist/i18n.cjs.js +3 -3
- package/dist/ihabdevteam-core.cjs.js +191 -191
- package/dist/ihabdevteam-core.d.ts +198 -18
- package/dist/packages/core/src/components/Accordion.css +16 -0
- package/dist/packages/core/src/components/BarChart.css +20 -4
- package/dist/packages/core/src/components/BarChart.d.ts +1 -1
- package/dist/packages/core/src/components/BarChart.js +61 -22
- package/dist/packages/core/src/components/BulkBar.js +2 -1
- package/dist/packages/core/src/components/ChartSection.css +311 -31
- package/dist/packages/core/src/components/ChartSection.d.ts +116 -2
- package/dist/packages/core/src/components/ChartSection.js +135 -9
- package/dist/packages/core/src/components/ColorPicker.d.ts +2 -1
- package/dist/packages/core/src/components/ColorPicker.js +2 -1
- package/dist/packages/core/src/components/DatePicker.css +5 -0
- package/dist/packages/core/src/components/DatePicker.d.ts +2 -1
- package/dist/packages/core/src/components/DatePicker.js +1 -1
- package/dist/packages/core/src/components/Dropdown.css +6 -0
- package/dist/packages/core/src/components/Dropdown.d.ts +2 -1
- package/dist/packages/core/src/components/FilterPanel.js +17 -3
- package/dist/packages/core/src/components/Header.js +4 -4
- package/dist/packages/core/src/components/Panel.css +21 -0
- package/dist/packages/core/src/components/RingChart.js +11 -7
- package/dist/packages/core/src/components/SegmentedControl.css +6 -1
- package/dist/packages/core/src/components/SegmentedControl.d.ts +5 -1
- package/dist/packages/core/src/components/SegmentedControl.js +2 -1
- package/dist/packages/core/src/components/SideNav.js +1 -1
- package/dist/packages/core/src/components/StatChart.d.ts +22 -11
- package/dist/packages/core/src/components/StatChart.js +17 -37
- package/dist/packages/core/src/components/SummaryStrip.d.ts +1 -1
- package/dist/packages/core/src/components/SummaryStrip.js +1 -1
- package/dist/packages/core/src/components/Table.d.ts +16 -0
- package/dist/packages/core/src/components/Tabs.d.ts +2 -1
- package/dist/packages/core/src/components/Tabs.js +2 -1
- package/dist/packages/core/src/components/TextField.css +20 -1
- package/dist/packages/core/src/components/TextField.d.ts +7 -1
- package/dist/packages/core/src/components/TextField.js +2 -1
- package/dist/packages/core/src/components/Training/TrainingCardGroup.css +22 -3
- package/dist/packages/core/src/components/Word/WordSearchResultBlock.css +9 -0
- package/dist/packages/core/src/components/Word/WordSearchResultBlock.js +8 -2
- package/dist/packages/core/src/components/barChartTypes.d.ts +20 -0
- package/dist/packages/core/src/components/controlSize.d.ts +87 -1
- package/dist/packages/core/src/components/controlSize.js +87 -1
- package/dist/packages/core/src/components/useBarChartControl.js +27 -7
- package/dist/packages/core/src/components.d.ts +3 -3
- package/dist/packages/core/src/components.js +1 -1
- package/dist/packages/core/src/hooks/useWideCardSpans.d.ts +28 -0
- package/dist/packages/core/src/hooks/useWideCardSpans.js +85 -0
- package/dist/packages/core/src/i18n/locales/en.json +1 -0
- package/dist/packages/core/src/i18n/locales/ko.json +1 -0
- package/dist/packages/core/src/utils/legacyBlocks.js +5 -1
- package/dist/packages/core/src/version.d.ts +1 -1
- package/dist/packages/core/src/version.js +1 -1
- package/dist/utils.cjs.js +21 -21
- package/package.json +1 -1
- package/dist/packages/core/src/components/StatChart.css +0 -93
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import './ChartSection.css';
|
|
4
|
-
import { useCallback, useEffect, useId, useRef, useState } from 'react';
|
|
4
|
+
import { useCallback, useEffect, useId, useRef, useState, useLayoutEffect } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import Icon from './Icon';
|
|
7
7
|
import SectionHeadFloat from './SectionHeadFloat';
|
|
@@ -12,12 +12,37 @@ import TooltipInfo from './Tooltip/InfoTooltip';
|
|
|
12
12
|
import { useHoverAnchor } from '../hooks/useHoverAnchor';
|
|
13
13
|
import { useIsoLayoutEffect } from '../hooks/useIsoLayoutEffect';
|
|
14
14
|
import MenuTooltip from './Tooltip/MenuTooltip';
|
|
15
|
-
import {
|
|
15
|
+
import { CHART_HEAD_SIZE } from './controlSize';
|
|
16
16
|
import { withLegacy } from '../utils/legacyBlocks';
|
|
17
17
|
/** 차트 범례 — 색상 점 + 라벨 목록. BarChart/RingChart 섹션이 공유. @public */
|
|
18
18
|
export function ChartLegend({ items, className }) {
|
|
19
19
|
return (_jsx("div", { className: withLegacy(className ? `chart-section__legend ${className}` : 'chart-section__legend'), children: items.map((it, i) => (_jsxs("span", { className: withLegacy("chart-section__legend-item"), children: [_jsx("span", { className: withLegacy("chart-section__legend-dot"), style: { background: it.color } }), it.label] }, i))) }));
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* **카드가 보이는 큰 수의 글자 단계** — 작은 카드(`size="small"` · `type="stat"` 과 한 줄에
|
|
23
|
+
* 서는 것)는 수 칸의 값과 같은 `h1`(32px · 700), 그 밖은 `h0`(40px).
|
|
24
|
+
*
|
|
25
|
+
* `h1` 은 **원래 모습으로 돌아간 것**이다(사장님 지시 2026-11-02 "h1으로"). 2026-11-02
|
|
26
|
+
* 아침까지 수 칸의 값은 `32px · 700 · 자간 -0.5` 를 CSS 에 박고 있었는데 — 그것이 바로
|
|
27
|
+
* `h1` 토큰이다(줄높이만 1 이었다). 그날 낮에 `h2`(24·500) 로 내려 봤다가 되돌렸다.
|
|
28
|
+
*
|
|
29
|
+
* 네 자리(`ChartSection` · `BarChart` 셋 · `RingChart`)가 저마다 `h0` 를 적고 있었다.
|
|
30
|
+
*
|
|
31
|
+
* **`h0`(40px)는 가로를 통째로 쓰는 카드 하나뿐이다**(2026-11-02 — 사장님이 고리 카드의
|
|
32
|
+
* `56`(h1)과 차트 카드의 `0`(h0)을 나란히 놓고 "같은 거 맞아?" 하셨다. 아니었다).
|
|
33
|
+
* 격자에 서는 카드는 크기가 달라도 **수의 단계는 같아야** 한 줄로 읽힌다.
|
|
34
|
+
* 작은 카드만 CSS 로 크기를 덮어 맞췄는데, 그러면 **마크업에 적힌 단계가 아무 일도 안
|
|
35
|
+
* 한다** — 글자를 고쳐도 화면이 안 바뀐다(사장님이 2026-11-02 에 짚으셨다). 단계를 한
|
|
36
|
+
* 군데서 정하고, 부르는 쪽은 "작은 카드인가" 만 넘긴다.
|
|
37
|
+
*
|
|
38
|
+
* **큰 수의 이름은 이것 하나다**(사장님 지시 2026-11-02 — "하나는 sub-row고 하나는
|
|
39
|
+
* section-content 네 하나로 통일해"). 수 칸만 `__value`·`__value-row` 라는 제 이름을
|
|
40
|
+
* 따로 쓰고 있었다 — 같은 자리의 같은 수인데 규칙을 두 벌씩 써야 했고, 그날도 차트 쪽
|
|
41
|
+
* 한 자리를 빠뜨려 큰 수의 윗여백이 그 카드만 안 들었다. 이제 **그리는 자리 다섯**
|
|
42
|
+
* (수 칸 · 차트 카드 · 막대 합계 셋 · 고리 퍼센트)이 다 이 함수를 부른다.
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export const chartTotalNumClass = (small) => `chart-section__total__num ${small ? 'h1' : 'h0'}`;
|
|
21
46
|
/** 차트 총계 표시 — label이 있으면 라벨(윗줄)+값(아랫줄) stacked, 없으면 값만. @public */
|
|
22
47
|
export function ChartTotal({ label, children }) {
|
|
23
48
|
if (!label) {
|
|
@@ -25,13 +50,56 @@ export function ChartTotal({ label, children }) {
|
|
|
25
50
|
}
|
|
26
51
|
return (_jsxs("div", { className: withLegacy("chart-section__total chart-section__total--stacked"), children: [_jsx("span", { className: withLegacy("chart-section__total__label body-3"), children: label }), _jsx("span", { className: withLegacy("chart-section__total__value"), children: children })] }));
|
|
27
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* 카드 사이의 틈 — `.chart-section` 의 아래 여백, 소비자 격자의 `gap` 과 같은 수다.
|
|
55
|
+
*
|
|
56
|
+
* **14 → 20**(사장님 지시 2026-11-02 — *"간격 20이 나아?"* · *"응"*). 14 는 집안 사다리
|
|
57
|
+
* (`--spacing-*`: 8 · 12 · 16 · 20 · 24) **밖의 수**였고, 20 은 `--spacing-l` 이면서
|
|
58
|
+
* 카드 안 여백(19 = 20 − 테두리 1)과도 같은 수다.
|
|
59
|
+
*/
|
|
60
|
+
const CARD_GAP = 20;
|
|
61
|
+
/**
|
|
62
|
+
* `small` 의 키 — **사다리의 밑동**(사장님 지시 2026-11-02 — "small -> 260 * 120 으로 하자").
|
|
63
|
+
*
|
|
64
|
+
* 속이 내는 키는 109 다(여백 38 + 테두리 2 + 제목 줄 23 + 틈 2 + 큰 수 44). 120 은 그보다
|
|
65
|
+
* 11 넉넉하다 — 수 하나짜리 카드가 글자에 딱 붙지 않게 둔 자리다. `min-height` 라 속이
|
|
66
|
+
* 더 길면 늘어난다(잘리지 않는다).
|
|
67
|
+
*/
|
|
68
|
+
const CARD_H_SMALL = 120;
|
|
69
|
+
/** 급 → 가장 낮은 키(px). 적힌 것만 키를 받는다 — 나머지는 속이 정한다 */
|
|
70
|
+
const CARD_MIN_HEIGHT = {
|
|
71
|
+
small: CARD_H_SMALL,
|
|
72
|
+
/** `small` 둘이 위아래로 쌓인 것과 **바닥이 한 선**이 되는 키 — 120×2 + 20 = 260 */
|
|
73
|
+
medium: CARD_H_SMALL * 2 + CARD_GAP,
|
|
74
|
+
/** 차트 카드도 **같은 칸**에 선다 — `medium` 보다 낮아지지 않는다(속이 더 길면 늘어난다) */
|
|
75
|
+
large: CARD_H_SMALL * 2 + CARD_GAP,
|
|
76
|
+
};
|
|
77
|
+
/** 급 → 껍데기에 붙는 꼴. `large` 는 밑바탕이라 붙일 것이 없다 */
|
|
78
|
+
const CARD_SIZE_CLASS = {
|
|
79
|
+
small: 'chart-section--compact',
|
|
80
|
+
medium: 'chart-section--compact',
|
|
81
|
+
xLarge: 'chart-section--full',
|
|
82
|
+
};
|
|
28
83
|
/**
|
|
29
84
|
* 차트 카드 공통 레이아웃 — 제목 헤더 + total/legend 서브로우 + 차트 본체.
|
|
30
85
|
* BarChart와 RingChart 기반 섹션(숙제 진행현황 등)이 동일한 헤더/범례 디자인을
|
|
31
86
|
* 공유하도록 두 컴포넌트가 내부적으로 사용한다.
|
|
32
87
|
* @public
|
|
33
88
|
*/
|
|
34
|
-
export default function ChartSection({
|
|
89
|
+
export default function ChartSection({ type = 'chart', title, titleClassName, titleLevel, icon, disc, headRight, headFloat, headSegment, headMenuItems, collapseBelow = 420, onClick, ariaLabel, tooltip, totalNum, totalUnit, totalMuted = false, totalLabel, change, changeType, size, bodyAlign = 'bottom', subRow, legend, subRowAlign = 'start', className, inGrid = false, fitBody = false, children }) {
|
|
90
|
+
const isStat = type === 'stat';
|
|
91
|
+
/** 안 주면 갈래가 정한다 — 수 칸은 `small`, 차트 카드는 `large`(밑바탕) */
|
|
92
|
+
const cardSize = size ?? (isStat ? 'small' : 'large');
|
|
93
|
+
/* **작은 카드인가** — 글자 단계(아래 `totalRow`)와 꼴이 이것으로 갈린다.
|
|
94
|
+
급에서 바로 읽는다. 2026-11-02 아침까지는 `className` 글자에서 `chart-section--compact`
|
|
95
|
+
를 찾았는데, 그 이름을 붙이는 것은 `RingChart`·`BarChart` 뿐이라 **부르는 쪽이 클래스를
|
|
96
|
+
적어야만 작은 카드가 되는** 꼴이었다. 급을 받으면 그 꼼수가 필요 없다. */
|
|
97
|
+
const isCompact = cardSize === 'small' || cardSize === 'medium';
|
|
98
|
+
/* 글자 꼴·머리글 급의 밑바탕이 갈래마다 다르다 — `stat` 의 제목은 작은 이름표(`h5`)이고
|
|
99
|
+
**머리글이 아니다**(급 0). 수 칸이 열 개 서는 화면에서 그것을 다 머리글로 올리면
|
|
100
|
+
낭독기의 층이 수 칸으로 뒤덮인다. */
|
|
101
|
+
const resolvedTitleClass = titleClassName ?? 'h5';
|
|
102
|
+
const resolvedTitleLevel = titleLevel ?? (isStat ? 0 : 3);
|
|
35
103
|
const { t } = useTranslation();
|
|
36
104
|
const secRef = useRef(null);
|
|
37
105
|
/* 설명 툴팁 — StatChart 와 같은 결(카드 사각형 기준, 포인터가 나가거나 초점이 빠지면 닫힘).
|
|
@@ -106,17 +174,75 @@ export default function ChartSection({ title, titleClassName = 'h3', titleLevel
|
|
|
106
174
|
/* 제목(과 `disc`) 아래 수 — 차트 카드(BarChart·RingChart)가 쓰는 `ChartTotal` 그 꼴을 그대로 쓴다.
|
|
107
175
|
같은 자리에 두 모양이 생기면 카드마다 눈금이 달라진다(설명 `disc` 를 머리 아래 한 줄로 모은 것과 같은 까닭).
|
|
108
176
|
0.176.0 까지는 머리 오른쪽에 한 줄로 섰다 — 사용자가 차트 카드의 그 꼴로 정했다(2026-09-17). */
|
|
109
|
-
const totalRow = (totalNum != null || totalLabel) ? (_jsxs(ChartTotal, { label: totalLabel, children: [totalNum != null && _jsx("span", { className: withLegacy(
|
|
177
|
+
const totalRow = (totalNum != null || totalLabel) ? (_jsxs(ChartTotal, { label: totalLabel, children: [totalNum != null && _jsx("span", { className: withLegacy(chartTotalNumClass(isCompact)), children: totalNum }), totalUnit && _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: totalUnit })] })) : null;
|
|
110
178
|
/* 머리 오른쪽에는 **고르개와 `headRight` 만** 남는다 — 고르개가 먼저, 상세보기 단추가 오른쪽 끝(사용자 지시 2026-09-17) */
|
|
111
|
-
const headRightNode = (rightNode || headSegment) ? (_jsxs("div", { className: withLegacy("chart-section__head-right"), children: [headSegment && (collapsed ? (_jsx(Button, { htmlType: "button", size:
|
|
179
|
+
const headRightNode = (rightNode || headSegment) ? (_jsxs("div", { className: withLegacy("chart-section__head-right"), children: [headSegment && (collapsed ? (_jsx(Button, { htmlType: "button", size: CHART_HEAD_SIZE, type: "dot", icon: "ellipsis", ariaLabel: headSegment.ariaLabel ?? t('common.more', '더보기'), showTooltipInfo: headSegment.ariaLabel ?? t('common.more', '더보기'), "aria-haspopup": "menu", "aria-expanded": !!menuRect, onClick: openMenu })) : (_jsx(SegmentedControl, { size: CHART_HEAD_SIZE, ariaLabel: headSegment.ariaLabel, options: headSegment.options.map(o => ({ key: o.key, label: o.label, disabled: o.disabled })), value: headSegment.value, onChange: headSegment.onChange }))), rightNode] })) : null;
|
|
180
|
+
/* **범례가 큰 수 줄보다 길면 그만큼 줄을 넓힌다**(사장님 지시 2026-11-03 "legend 이 선 위로").
|
|
181
|
+
범례는 서브로우 밖에 띄워 세우므로 줄 키에 안 든다 — 계열이 셋이 되자 55px 이 되어 **첫 눈금선을
|
|
182
|
+
10px 넘었다**(실측 2026-11-03: 범례 바닥 113 · 눈금선 103). 위로 키우면 머리의 고르개와 겹치니,
|
|
183
|
+
**아래가 밀리는 쪽**이 맞다 — 잰 키를 카드에 적어 두면 CSS 가 서브로우의 최소 키로 쓰고,
|
|
184
|
+
판은 `fitHeight` 가 남은 자리를 다시 재어 저절로 줄어든다. */
|
|
185
|
+
const legendRef = useRef(null);
|
|
186
|
+
const [legendHeight, setLegendHeight] = useState(null);
|
|
187
|
+
useLayoutEffect(() => {
|
|
188
|
+
const node = legendRef.current;
|
|
189
|
+
if (!node) {
|
|
190
|
+
setLegendHeight(null);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const measure = () => {
|
|
194
|
+
const h = node.getBoundingClientRect().height;
|
|
195
|
+
setLegendHeight(prev => (prev != null && Math.abs(prev - h) < 1 ? prev : h));
|
|
196
|
+
};
|
|
197
|
+
measure();
|
|
198
|
+
/* 흉내 판(jsdom)에는 `ResizeObserver` 가 없다 — 없으면 한 번 잰 것으로 둔다 */
|
|
199
|
+
if (typeof ResizeObserver === 'undefined')
|
|
200
|
+
return;
|
|
201
|
+
const observer = new ResizeObserver(measure);
|
|
202
|
+
observer.observe(node);
|
|
203
|
+
return () => observer.disconnect();
|
|
204
|
+
}, [legend]);
|
|
112
205
|
const titleId = useId();
|
|
113
|
-
const TitleTag =
|
|
114
|
-
|
|
206
|
+
const TitleTag = resolvedTitleLevel ? `h${resolvedTitleLevel}` : 'div';
|
|
207
|
+
/* ── `stat` 갈래 ──────────────────────────────────────────────
|
|
208
|
+
제목 줄(이름표 + 오른쪽 아이콘) · 큰 수 · 값 아래 자리. 머리의 고르개·띄운 줄·
|
|
209
|
+
서브로우는 안 쓴다 — 위의 훅들은 그 자리가 없으면 아무 일도 안 한다(`headSegment`
|
|
210
|
+
가 없으면 재기도 안 돈다).
|
|
211
|
+
|
|
212
|
+
**이름도 `chart-section*` 한 벌로 모았다**(사장님 지시 2026-11-02 "하나로"). 겹치던
|
|
213
|
+
넷(`--clickable` · 아이콘 둘 · 제목)은 글자까지 같았으므로 그대로 저쪽 것을 쓴다. */
|
|
214
|
+
const minHeight = typeof cardSize === 'number' ? cardSize : CARD_MIN_HEIGHT[cardSize];
|
|
215
|
+
const resolvedChangeType = changeType ?? (change === undefined ? undefined : change > 0 ? 'up' : change < 0 ? 'down' : 'neutral');
|
|
216
|
+
const changeText = change === undefined ? undefined : change > 0 ? `+${change}` : `${change}`;
|
|
217
|
+
const tooltipNode = tooltip && tipRect ? (_jsx(TooltipInfo, { anchorRect: {
|
|
218
|
+
left: tipRect.left,
|
|
219
|
+
top: tipRect.top + 21,
|
|
220
|
+
right: tipRect.right,
|
|
221
|
+
bottom: tipRect.bottom,
|
|
222
|
+
width: tipRect.width,
|
|
223
|
+
height: tipRect.height,
|
|
224
|
+
}, text: tooltip })) : null;
|
|
225
|
+
if (isStat) {
|
|
226
|
+
return (_jsxs("div", { ref: secRef, className: withLegacy(['chart-section', 'chart-section--stat', inGrid && 'chart-section--grid', bodyAlign === 'center' && 'chart-section--body-center', typeof cardSize === 'string' && CARD_SIZE_CLASS[cardSize], onClick && 'chart-section--clickable', className].filter(Boolean).join(' ')), style: minHeight === undefined ? undefined : { minHeight }, onClick: onClick ? onCardClick : undefined, onKeyDown: onClick ? onCardKeyDown : undefined, onPointerEnter: tooltip ? showTip : undefined, onPointerLeave: tooltip ? closeTip : undefined,
|
|
227
|
+
// hover 전용이면 키보드로는 툴팁 내용을 볼 수 없다
|
|
228
|
+
onFocus: tooltip ? showTip : undefined, onBlur: tooltip ? closeTip : undefined, role: onClick ? 'button' : undefined, tabIndex: onClick ? 0 : undefined, "aria-label": onClick ? (ariaLabel ?? [typeof title === 'string' ? title : undefined, totalNum, changeText].filter(v => v !== undefined && v !== null && v !== '').join(' ')) : undefined, "aria-labelledby": !onClick && title != null ? titleId : undefined, children: [tooltipNode, _jsxs("div", { className: withLegacy("chart-section__head"), children: [_jsx(TitleTag, { id: titleId, className: withLegacy(['chart-section__title', resolvedTitleClass].filter(Boolean).join(' ')), children: title }), icon && (_jsx("span", { className: withLegacy("chart-section__head-icon"), children: _jsx(Icon, { icon: icon, className: withLegacy("chart-section__head-icon-inner") }) }))] }), _jsxs(_Fragment, { children: [_jsxs("div", { className: withLegacy("chart-section__sub-row"), children: [_jsxs(ChartTotal, { children: [_jsx("span", { className: withLegacy([chartTotalNumClass(true), totalMuted && 'chart-section__total__num--muted'].filter(Boolean).join(' ')), children: totalNum }), totalUnit && _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: totalUnit })] }), changeText && (_jsx("div", { className: withLegacy(`chart-section__change chart-section__change--${resolvedChangeType ?? 'neutral'} caption-1`), children: changeText }))] }), children && _jsx("div", { className: withLegacy("chart-section__body"), children: children })] })] }));
|
|
229
|
+
}
|
|
230
|
+
return (_jsxs("section", { ref: secRef, className: withLegacy(['chart-section', inGrid && 'chart-section--grid', fitBody && 'chart-section--fit', typeof cardSize === 'string' && CARD_SIZE_CLASS[cardSize], onClick && 'chart-section--clickable', className].filter(Boolean).join(' ')),
|
|
231
|
+
/* **속이 제 키에 맞추는 카드는 키를 박는다**(사장님 지시 2026-11-02 "높이 260 으로
|
|
232
|
+
고정시키고 그 안에 그래프가 맞춰지도록 해"). `min-height` 만 두면 속이 한 눈금 자라는
|
|
233
|
+
날 카드가 따라 자라고, 두 줄을 차지하는 카드 곁의 바닥이 어긋난다 — 그날 x축이 두
|
|
234
|
+
줄로 돌아가며 260 이 270 이 됐다. 속은 `BarChart fitHeight` 가 맞춘다.
|
|
235
|
+
**`inGrid` 가 아니라 `fitBody` 를 본다** — 격자에 섰어도 속을 안 맞추는 카드를 박으면
|
|
236
|
+
x축이 카드 밖으로 흐른다(고객 통계 여덟, 같은 날). */
|
|
237
|
+
style: {
|
|
238
|
+
...(minHeight === undefined ? null : (fitBody ? { minHeight, height: minHeight } : { minHeight })),
|
|
239
|
+
...(legendHeight == null ? null : { ['--legend-h']: `${legendHeight}px` }),
|
|
240
|
+
}, onClick: onClick ? onCardClick : undefined, onKeyDown: onClick ? onCardKeyDown : undefined, onPointerEnter: tooltip ? showTip : undefined, onPointerLeave: tooltip ? closeTip : undefined, onFocus: tooltip ? showTip : undefined, onBlur: tooltip ? closeTip : undefined, role: onClick ? 'button' : undefined, tabIndex: onClick ? 0 : undefined, "aria-label": onClick ? (ariaLabel ?? (typeof title === 'string' ? title : undefined)) : undefined, "aria-labelledby": !onClick && title != null ? titleId : undefined, children: [tooltip && tipRect && (_jsx(TooltipInfo, { anchorRect: {
|
|
115
241
|
left: tipRect.left,
|
|
116
242
|
top: tipRect.top + 21,
|
|
117
243
|
right: tipRect.right,
|
|
118
244
|
bottom: tipRect.bottom,
|
|
119
245
|
width: tipRect.width,
|
|
120
246
|
height: tipRect.height,
|
|
121
|
-
}, text: tooltip })), headFloat && _jsx(SectionHeadFloat, { children: headFloat }), _jsxs("div", { className: withLegacy("chart-section__head"), children: [_jsxs("div", { className: withLegacy("chart-section__title-row"), children: [icon && _jsx(Icon, { icon: icon, label: typeof title === 'string' ? title : undefined, className: withLegacy("chart-section__icon") }), _jsx(TitleTag, { id: titleId, className: withLegacy(['chart-section__title',
|
|
247
|
+
}, text: tooltip })), headFloat && _jsx(SectionHeadFloat, { children: headFloat }), _jsxs("div", { className: withLegacy("chart-section__head"), children: [_jsxs("div", { className: withLegacy("chart-section__title-row"), children: [icon && _jsx(Icon, { icon: icon, label: typeof title === 'string' ? title : undefined, className: withLegacy("chart-section__icon") }), _jsx(TitleTag, { id: titleId, className: withLegacy(['chart-section__title', resolvedTitleClass].filter(Boolean).join(' ')), children: title })] }), headRightNode, disc && _jsx("div", { className: withLegacy("chart-section__disc body-3"), children: disc })] }), (totalRow || subRow) && (_jsxs("div", { className: withLegacy(['chart-section__sub-row', subRowAlign !== 'start' && `chart-section__sub-row--${subRowAlign}`].filter(Boolean).join(' ')), children: [totalRow, subRow] })), legend && _jsx("div", { ref: legendRef, className: withLegacy("chart-section__legend-slot"), children: legend }), children, menuRect && (_jsx(Tooltip, { anchorRect: menuRect, onClose: closeMenu, ariaLabel: headSegment?.ariaLabel ?? t('tooltip.menu', '메뉴'), children: _jsx(MenuTooltip, { columns: [{ items: menuItems }], onClose: closeMenu, size: "small" }) }))] }));
|
|
122
248
|
}
|
|
@@ -9,7 +9,8 @@ export interface ColorPickerProps {
|
|
|
9
9
|
onChange: (hex: string) => void;
|
|
10
10
|
/** 선택 가능한 색상 팔레트. 기본값은 디자인 시스템 브랜드 색상 */
|
|
11
11
|
palette?: string[];
|
|
12
|
-
/** 스와치 크기 — Button과 동일한 체계 (32 / 40 / 48), radius도 Button rounded와 동일하게
|
|
12
|
+
/** 스와치 크기 — Button과 동일한 체계 (32 / 40 / 48), radius도 Button rounded와 동일하게 맞춤.
|
|
13
|
+
* 안 주면 공용 수다(`CONTROL_SIZE` — 2026-11-02 부터 32. 전에는 40 이 박혀 있었다). */
|
|
13
14
|
size?: ColorPickerSize;
|
|
14
15
|
className?: string;
|
|
15
16
|
/** 묶음의 이름(예: '글자 색') — 낭독기가 무엇의 색을 고르는지 읽는다 */
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import Icon from './Icon';
|
|
5
5
|
import './ColorPicker.css';
|
|
6
|
+
import { CONTROL_SIZE } from './controlSize';
|
|
6
7
|
const CHECK_ICON_SIZE = 20;
|
|
7
8
|
const DEFAULT_PALETTE = [
|
|
8
9
|
'#499cdf', // main
|
|
@@ -14,7 +15,7 @@ const DEFAULT_PALETTE = [
|
|
|
14
15
|
'#bfc7d1', // disabled
|
|
15
16
|
];
|
|
16
17
|
/** @public */
|
|
17
|
-
export default function ColorPicker({ value, onChange, palette = DEFAULT_PALETTE, size =
|
|
18
|
+
export default function ColorPicker({ value, onChange, palette = DEFAULT_PALETTE, size = CONTROL_SIZE, className = '', ariaLabel, }) {
|
|
18
19
|
const { t } = useTranslation();
|
|
19
20
|
return (
|
|
20
21
|
/* role="group" 은 이름이 없으면 낭독기가 묶음을 알리지 않는다 — 이름을 받는다 */
|
|
@@ -48,6 +48,11 @@
|
|
|
48
48
|
text-align: left;
|
|
49
49
|
transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
|
|
50
50
|
}
|
|
51
|
+
/* **32 — 줄·머리의 기본**(사장님 지시 2026-11-02). 모서리 사다리는 Dropdown·TextField 와 같다 */
|
|
52
|
+
.date-picker--s32 .date-picker__trigger {
|
|
53
|
+
height: 32px;
|
|
54
|
+
border-radius: 8px;
|
|
55
|
+
}
|
|
51
56
|
.date-picker--s40 .date-picker__trigger { height: 40px; border-radius: 10px; }
|
|
52
57
|
.date-picker--s48 .date-picker__trigger { height: 48px; border-radius: 12px; }
|
|
53
58
|
.date-picker--s64 .date-picker__trigger { height: 64px; border-radius: 14px; }
|
|
@@ -9,7 +9,8 @@ export interface DatePickerProps {
|
|
|
9
9
|
* 줄·머리에서 곁에 서는 단추·글상자·고르개가 모두 40 이다. 기본이 48 이면 안 적은
|
|
10
10
|
* 자리만 한 급 크게 서고, 그것을 막으려고 자리마다 40 을 손으로 적게 된다.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
/** 조절칸 키 — 32(줄·머리 기본, 2026-11-02) · 40 · 48 · 64 */
|
|
13
|
+
size?: 32 | 40 | 48 | 64;
|
|
13
14
|
min?: string;
|
|
14
15
|
max?: string;
|
|
15
16
|
disabled?: boolean;
|
|
@@ -304,7 +304,7 @@ export default function DatePicker({ value, onChange, size = CONTROL_SIZE, min,
|
|
|
304
304
|
cells.push(null);
|
|
305
305
|
for (let d = 1; d <= daysInMonth(viewY, viewM); d++)
|
|
306
306
|
cells.push(d);
|
|
307
|
-
const iconSize = size === 64 ? 20 : size === 40 ? 16 : 18;
|
|
307
|
+
const iconSize = size === 64 ? 20 : size === 32 ? 14 : size === 40 ? 16 : 18;
|
|
308
308
|
/* 이름은 브라우저가 짓는다 — 한국어 `2026년` · `10월`, 영어 `2026` · `October`.
|
|
309
309
|
연월을 한 덩어리로 짓던 `yearMonthLabel` 은 **달력 머리줄(Calendar)** 이 여전히 쓴다. */
|
|
310
310
|
const locale = intlLocale(i18n.language);
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/* Size variants — 실제 높이 px + 버튼과 동일한 round */
|
|
19
|
+
/* **32 — 줄·머리의 기본**(사장님 지시 2026-11-02 "size 모두 32 로"). 모서리는 집안
|
|
20
|
+
사다리를 따른다: 32→8 · 40→10 · 48→12(`TextField` 가 먼저 깔아 둔 결이다). */
|
|
21
|
+
.dropdown--s32 .dropdown__trigger {
|
|
22
|
+
height: 32px;
|
|
23
|
+
border-radius: 8px;
|
|
24
|
+
}
|
|
19
25
|
.dropdown--s40 .dropdown__trigger { height: 40px; border-radius: 10px; }
|
|
20
26
|
.dropdown--s48 .dropdown__trigger { height: 48px; border-radius: 12px; }
|
|
21
27
|
|
|
@@ -22,7 +22,8 @@ export interface DropdownProps {
|
|
|
22
22
|
* 단추·글상자·고르개가 40 인데 혼자 48 로 섰다(실측 2026-10-29). `SegmentedControl` 도
|
|
23
23
|
* 2026-09-21 에 같은 까닭으로 48 → 40 으로 내렸다. 큰 자리만 48 을 적는다.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
/** 조절칸 키 — 32(줄·머리 기본, 2026-11-02) · 40 · 48 */
|
|
26
|
+
size?: 32 | 40 | 48;
|
|
26
27
|
error?: boolean;
|
|
27
28
|
className?: string;
|
|
28
29
|
/** 화면에 보이는 라벨 없이 스크린리더용 이름을 지정할 때 사용 */
|
|
@@ -8,6 +8,7 @@ import Button from './Button';
|
|
|
8
8
|
import SegmentedControl from './SegmentedControl';
|
|
9
9
|
import TextField from './TextField';
|
|
10
10
|
import Dropdown from './Dropdown';
|
|
11
|
+
import { CONTROL_SIZE } from './controlSize';
|
|
11
12
|
export { FILTER_ALL_VALUE } from '../types/filterPanel';
|
|
12
13
|
import { FILTER_ALL_VALUE } from '../types/filterPanel';
|
|
13
14
|
import FilterSectionInfo from './FilterSectionInfo';
|
|
@@ -54,7 +55,7 @@ export default function FilterPanel({ title, titleLevel = 2, headerAction, heade
|
|
|
54
55
|
안 잡혀, 셋이 나란히 서도 "지금 어느 판 안인지" 를 알 길이 없었다 — (51)·(54) 에서
|
|
55
56
|
`ChartSection`·`TrainingCardGroup` 에 한 것과 같은 자다.
|
|
56
57
|
**글자 제목일 때만 건다** — 마디를 가리키므로 글이 아닌 제목이면 이름이 안 선다. */
|
|
57
|
-
_jsxs("div", { className: cx('filter-panel', collapsible ? 'filter-panel--collapsible' : '', collapsed ? 'filter-panel--collapsed' : '', className), role: typeof title === 'string' && title ? 'group' : undefined, "aria-labelledby": typeof title === 'string' && title ? titleId : undefined, children: [showHeader && (_jsxs("div", { className: "filter-panel__header", onClick: collapsible ? onHeadClick : undefined, children: [_jsx("div", { className: "filter-panel__title-row", children: title && _jsx(TitleTag, { id: titleId, className: "filter-panel__title h4", children: title }) }), _jsxs("div", { className: "filter-panel__header-actions", children: [collapsed ? summaryNode : headerAction, collapsible && (_jsx(Button, { htmlType: "button", size:
|
|
58
|
+
_jsxs("div", { className: cx('filter-panel', collapsible ? 'filter-panel--collapsible' : '', collapsed ? 'filter-panel--collapsed' : '', className), role: typeof title === 'string' && title ? 'group' : undefined, "aria-labelledby": typeof title === 'string' && title ? titleId : undefined, children: [showHeader && (_jsxs("div", { className: "filter-panel__header", onClick: collapsible ? onHeadClick : undefined, children: [_jsx("div", { className: "filter-panel__title-row", children: title && _jsx(TitleTag, { id: titleId, className: "filter-panel__title h4", children: title }) }), _jsxs("div", { className: "filter-panel__header-actions", children: [collapsed ? summaryNode : headerAction, collapsible && (_jsx(Button, { htmlType: "button", size: CONTROL_SIZE, type: "dot", variant: "transparent-gray", useBorder: false, icon: collapsed ? 'chevron-down' : 'chevron-up',
|
|
58
59
|
/* Button은 aria-label을 자기 ariaLabel prop으로 덮어쓴다({...rest} 뒤에
|
|
59
60
|
aria-label={ariaLabelString}을 다시 쓴다) — kebab으로 넘기면 undefined가
|
|
60
61
|
되어 이름이 통째로 사라진다. 저장소의 다른 호출부는 모두 ariaLabel을 쓴다.
|
|
@@ -135,11 +136,24 @@ export default function FilterPanel({ title, titleLevel = 2, headerAction, heade
|
|
|
135
136
|
2026-09-22 에는 숫자 size 가 768px 이하에서 한 급 줄고(32→28) `size="Keyboard"`(32)는
|
|
136
137
|
안 줄어 폰에서만 어긋났고, 맞추려면 손가락 자리가 28 이 되는 터라 어긋남 쪽을 택했다
|
|
137
138
|
(사용자 판단). 그 사다리를 걷으면서 **둘 다 어느 폭에서나 32** 가 되어 까닭이 사라졌다.
|
|
138
|
-
`test/buttonSizeLadder0922.test.ts` 가 사다리가 다시 생기지 않는지를 센다.
|
|
139
|
+
`test/buttonSizeLadder0922.test.ts` 가 사다리가 다시 생기지 않는지를 센다.
|
|
140
|
+
|
|
141
|
+
**공용 수를 쓰면 안 된다 — 이 자리의 닻은 항목 단추다.**
|
|
142
|
+
2026-11-02 에 공용 수가 32 로 내려가자 두 수가 같아져서 `CONTROL_SIZE` 로
|
|
143
|
+
바꿨는데, **같은 날 공용 수가 40 으로 되돌려지면서 바로 어긋났다**
|
|
144
|
+
(`narrowScreen0922` 가 *"40 이면 옆 항목 단추(32)보다 8px 높다"* 로 울었다).
|
|
145
|
+
항목 단추는 `size="keyboard"`(32)로 **다른 사다리**라 공용 수와 함께 움직이지
|
|
146
|
+
않는다. 그러니 여기는 **32 를 손으로 적는다** — 두 수가 우연히 같아지는
|
|
147
|
+
날에도 바꾸지 않는다. */
|
|
139
148
|
size: 32 })) : (!section.multiple && section.display === 'dropdown') ? (_jsx(Dropdown, { className: "filter-panel__dropdown",
|
|
140
149
|
/* 거르개 절의 이름을 그대로 쓴다 — (70) 로 방아쇠가 `combobox` 가 되면서
|
|
141
150
|
안 글자가 값이 됐다. 이름을 안 주면 절이 여럿인 판에서 다 똑같이 들린다. */
|
|
142
|
-
|
|
151
|
+
/* **옆 갈래와 같은 수를 쓴다.** 바로 위 `SegmentedControl` 갈래는 2026-09-22 에
|
|
152
|
+
32 로 내려갔는데 이 드롭다운만 40 으로 남아, 한 절 안에서 갈래에 따라 키가
|
|
153
|
+
달랐다. 2026-10-29 에 `PanelRow` 에서 겪은 것과 같은 흠이다 — 손으로 적는
|
|
154
|
+
자리가 여럿이면 하나가 빠진다. 그래서 공용 수를 쓴다.
|
|
155
|
+
*/
|
|
156
|
+
ariaLabel: typeof section.label === 'string' ? section.label : undefined, size: CONTROL_SIZE, options: [
|
|
143
157
|
...(section.allOption ? [{ value: FILTER_ALL_VALUE, label: section.allLabel ?? t('common.all', '전체'), disabled: section.allOptionDisabled }] : []),
|
|
144
158
|
...items.map(item => {
|
|
145
159
|
const value = typeof item === 'string' ? item : item.value;
|
|
@@ -80,12 +80,14 @@ export default function Header({ activeKey, onChange, items, malgwiItems: _malgw
|
|
|
80
80
|
}
|
|
81
81
|
onChange?.(key);
|
|
82
82
|
}, [items, onChange]);
|
|
83
|
-
// 모바일 하단 더보기(…) 메뉴에 노출할 유틸(
|
|
83
|
+
// 모바일 하단 더보기(…) 메뉴에 노출할 유틸(디버그·도움말·알림·설정·버그신고·계정).
|
|
84
84
|
// 데스크톱 SideNav 푸터와 동일한 아이콘/키를 사용해 활성표시가 일관되게 반영된다.
|
|
85
85
|
const bottomMoreItems = useMemo(() => {
|
|
86
86
|
const list = [];
|
|
87
87
|
if (onDebug)
|
|
88
88
|
list.push({ key: 'debug', icon: 'terminal', label: t('nav.debug', '디버그'), onClick: onDebug });
|
|
89
|
+
if (onHelp)
|
|
90
|
+
list.push({ key: 'help', icon: 'message-circle-question-mark', label: t('nav.help', '도움말'), onClick: onHelp });
|
|
89
91
|
if (onNotification)
|
|
90
92
|
list.push({
|
|
91
93
|
key: 'notifications', icon: 'bell',
|
|
@@ -96,15 +98,13 @@ export default function Header({ activeKey, onChange, items, malgwiItems: _malgw
|
|
|
96
98
|
});
|
|
97
99
|
if (onSetting)
|
|
98
100
|
list.push({ key: 'settings', icon: 'settings', label: t('nav.settings', '설정'), onClick: onSetting });
|
|
99
|
-
if (onHelp)
|
|
100
|
-
list.push({ key: 'help', icon: 'message-circle-question-mark', label: t('nav.help', '도움말'), onClick: onHelp });
|
|
101
101
|
if (onFeedback)
|
|
102
102
|
list.push({ key: 'feedback', icon: 'bug', label: t('nav.feedback', '버그신고'), onClick: onFeedback });
|
|
103
103
|
if (onAccount)
|
|
104
104
|
list.push({ key: 'account', icon: 'user-round', label: t('nav.account', '계정'), onClick: onAccount });
|
|
105
105
|
return list;
|
|
106
106
|
}, [t, onDebug, onNotification, onSetting, onHelp, onFeedback, onAccount, unreadCount]);
|
|
107
|
-
// 헤더 햄버거 — SideNav 푸터에 해당하는 유틸(
|
|
107
|
+
// 헤더 햄버거 — SideNav 푸터에 해당하는 유틸(디버그·도움말·알림·설정·버그신고·계정)을 띄운다.
|
|
108
108
|
// 데스크톱에선 SideNav 푸터에 늘 보이지만 모바일에선 그 자리가 없어, 같은 항목을
|
|
109
109
|
// 하단 더보기(…)와 동일한 구성(bottomMoreItems)으로 재사용한다.
|
|
110
110
|
const computeUtilMenuStyle = useCallback((rect, trigger) => ({
|
|
@@ -774,6 +774,27 @@
|
|
|
774
774
|
margin-left: 0;
|
|
775
775
|
text-align: left;
|
|
776
776
|
}
|
|
777
|
+
/* **세로줄은 위 `:has(…)` 묶음의 이름표 칸에서 빠진다.**
|
|
778
|
+
*
|
|
779
|
+
* 그 묶음은 **가로줄의 이름표 폭**을 `flex-basis` 로 잡는다(`--panel-label-width`).
|
|
780
|
+
* 세로줄은 `flex-direction: column` 이라 **같은 값이 높이가 된다** — 22px 글자 하나가
|
|
781
|
+
* 64px(또는 기본값 120px) 칸 안에 들어앉아, 이름표와 칸 사이가 벌어진다. 줄 사이는
|
|
782
|
+
* 0 이라 그 칸은 **아래 줄의 이름표 쪽으로** 쏠려 보인다(말귀가 짚었다, 2026-11-01).
|
|
783
|
+
*
|
|
784
|
+
* 바로 위 세 줄(`flex: none`)이 **이미 그렇게 적고 있었는데 번번이 졌다** — `:has()` 가
|
|
785
|
+
* 가장 센 인자의 특이도를 물려받아 저쪽이 (0,4,0), 이쪽이 (0,2,0) 이었다. 값을 바꾸는
|
|
786
|
+
* 것이 아니라 **특이도를 맞춰 다시 적는 것**이다.
|
|
787
|
+
*
|
|
788
|
+
* 말귀 실측(단어표 만들기, 폭 1,766 · 이름표 칸 64px): 이름 줄 128 → 86px ·
|
|
789
|
+
* 설명 줄 162 → 120px. 줄마다 **42px**(64 − 22)이 빈 자리였다.
|
|
790
|
+
*
|
|
791
|
+
* 폭을 안 적는다 — 바로 위 `.panel-row--vertical .panel-row__left` 의 `width: 100%` 가
|
|
792
|
+
* 그대로 선다. 여기서 되돌리는 것은 **높이로 둔갑한 basis 하나**다. */
|
|
793
|
+
.panel-row--vertical:has(> .panel-row__right .text-field) > .panel-row__left,
|
|
794
|
+
.panel-row--vertical:has(> .panel-row__right .dropdown) > .panel-row__left,
|
|
795
|
+
.panel-row--vertical:has(> .panel-row__right .form-input) > .panel-row__left {
|
|
796
|
+
flex: none;
|
|
797
|
+
}
|
|
777
798
|
|
|
778
799
|
/* ── device variant — 좌/우 2-column grid ─────────────────────────────── */
|
|
779
800
|
.panel-row--device {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import './RingChart.css';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import Loader from './Loader';
|
|
6
6
|
import Icon from './Icon';
|
|
7
|
-
import ChartSection, { ChartTotal, ChartLegend } from './ChartSection';
|
|
7
|
+
import ChartSection, { ChartTotal, ChartLegend, chartTotalNumClass } from './ChartSection';
|
|
8
8
|
import { withLegacy } from '../utils/legacyBlocks';
|
|
9
9
|
const RING_SIZE_PRESET = {
|
|
10
10
|
small: { diameter: 96, strokeWidth: 16 },
|
|
@@ -63,11 +63,15 @@ export default function RingChart({ titleKey, titleLevel, headRight, icon, showT
|
|
|
63
63
|
const loaderSize = typeof ringProps.size === 'number' ? ringProps.size : RING_SIZE_PRESET[ringProps.size ?? 'medium'].diameter;
|
|
64
64
|
// size='large' — 카드가 가로 폭을 거의 100% 차지(1열)
|
|
65
65
|
const isLarge = ringProps.size === 'large';
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
/* **급을 `ChartSection` 에 넘긴다**(2026-11-02) — 전에는 꼴 이름을 손으로 붙였다.
|
|
67
|
+
이쪽 `size` 와 저쪽 급의 사다리가 한 칸씩 어긋난다: 이 카드의 `small` 은 260×208 짜리
|
|
68
|
+
작은 카드라 저쪽의 **`medium`** 이고, `medium`(밑바탕)이 저쪽 `large`, `large` 가
|
|
69
|
+
저쪽 `xLarge` 다. 이름을 맞추는 것은 이 컴포넌트의 공개 프롭을 바꾸는 일이라 따로 간다. */
|
|
70
|
+
const sectionSize = isSmall ? 'medium' : isLarge ? 'xLarge' : 'large';
|
|
71
|
+
const sectionClassName = className || undefined;
|
|
72
|
+
// 수 칸(ChartSection type="stat")과 같은 아이콘 규칙 — headRight 자리에 렌더(둘 중 하나만 사용)
|
|
73
|
+
const iconNode = icon && (_jsx("span", { className: withLegacy("chart-section__head-icon"), children: _jsx(Icon, { icon: icon, className: withLegacy("chart-section__head-icon-inner") }) }));
|
|
74
|
+
return (_jsx(ChartSection, { className: sectionClassName, size: sectionSize, inGrid: inGrid, onClick: onClick, ariaLabel: ariaLabel, tooltip: tooltip, title: t(titleKey), titleLevel: titleLevel, headRight: iconNode || (isSmall ? undefined : headRight), legend: legend && _jsx(ChartLegend, { items: legend }), subRow: showTotal && (_jsxs(ChartTotal, { label: !isSmall && totalLabelKey ? t(totalLabelKey) : undefined, children: [_jsx("span", { className: withLegacy(chartTotalNumClass(isSmall)), children: pct }), _jsx("span", { className: withLegacy("chart-section__total__unit body-3"), children: "%" })] })), children: loading ? (
|
|
71
75
|
/* 링도 같은 병이 있었다 — 기다림 상자 186px, 그려진 링은 지름(medium 120px)이다.
|
|
72
76
|
**그려질 링과 같은 자리·같은 지름**의 뼈대를 세우고 그 안에서 기다린다
|
|
73
77
|
(BarChart 와 같은 결, 사용자 지시 2026-09-17 "뼈대 먼저, 그 안에서 로딩"). */
|
|
@@ -41,7 +41,12 @@
|
|
|
41
41
|
셈수를 위 규칙들보다 한 겹 높여(.segmented-control.segmented-control) 크기별 기본을 덮는다. */
|
|
42
42
|
.segmented-control.segmented-control--min .button { min-width: var(--segmented-min-button-w); }
|
|
43
43
|
.segmented-control--24 .button { min-width: 48px; }
|
|
44
|
-
|
|
44
|
+
/* **80 → 64**(사장님 지시 2026-11-02 — "이 세그먼트의 버튼 가로길이 좀 줄이고").
|
|
45
|
+
`주`·`월` 처럼 한 글자가 서는 자리라 80 은 넓었다. 2026-09-17 에 *"64 는 갑갑했다"* 며
|
|
46
|
+
80 으로 올린 자리인데, 그때는 이 고르개가 **40** 이었고 같은 줄의 기간 고르개도 40 이라
|
|
47
|
+
눈금을 맞춘 것이었다 — 2026-11-02 에 줄·머리가 **32** 로 내려오면서 그 짝이 바뀌었다.
|
|
48
|
+
덤으로 차트 카드 머리가 한 줄로 돌아온다(조절칸 405 → 373, 속 폭 502 안에 든다). */
|
|
49
|
+
.segmented-control--32 .button { min-width: 64px; }
|
|
45
50
|
.segmented-control--40 .button { min-width: 80px; }
|
|
46
51
|
.segmented-control--48 .button { min-width: 96px; }
|
|
47
52
|
|
|
@@ -27,7 +27,11 @@ export interface SegmentedControlProps {
|
|
|
27
27
|
*
|
|
28
28
|
* 기본이 48 이던 것을 40 으로 내렸다(사용자 지시 2026-09-21). 코어가 제 안에서 세우는 고르개는 이미 **전부 40**
|
|
29
29
|
* 이었고(`Toolbar`·`FilterPanel`·`BarChart`·`PanelRow`…), 옆에 서는 `Dropdown`·`TextField` 도 40 이다 —
|
|
30
|
-
* 기본값만 혼자 48 이라 안 주고 쓴 자리가 한 급 크게 섰다.
|
|
30
|
+
* 기본값만 혼자 48 이라 안 주고 쓴 자리가 한 급 크게 섰다.
|
|
31
|
+
*
|
|
32
|
+
* **이제 기본은 공용 수다**(`CONTROL_SIZE` — 2026-11-02 부터 32). 손으로 적은 수를 두면
|
|
33
|
+
* 공용 수가 움직일 때 **안 주고 부른 자리만 뒤에 남는다** — 2026-11-02 에 그 일이 났고
|
|
34
|
+
* `Dropdown`·`DatePicker` 둘만 32 가 깔렸다(말귀_3 청 (408)). */
|
|
31
35
|
size?: 24 | 32 | 40 | 48;
|
|
32
36
|
shape?: 'rounded' | 'pill';
|
|
33
37
|
useBG?: boolean;
|
|
@@ -6,6 +6,7 @@ import { useEffect, useId, useRef } from 'react';
|
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import Button from './Button';
|
|
8
8
|
import { devWarnOnce, isDev } from '../utils/devWarn';
|
|
9
|
+
import { CONTROL_SIZE } from './controlSize';
|
|
9
10
|
/**
|
|
10
11
|
* **이름을 안 준 고르개들** — 개발 중에 서로 부딪히는지 세기 위한 자리다(운영에서는 비어 있다).
|
|
11
12
|
*
|
|
@@ -24,7 +25,7 @@ export default function SegmentedControl(props) {
|
|
|
24
25
|
const { t } = useTranslation();
|
|
25
26
|
const { options = [],
|
|
26
27
|
// 안 주면 **켜진** 첫 칸 — 꺼진 첫 칸이 골라져 있었다(Tabs 와 같게)
|
|
27
|
-
value = options.find((o) => !o.disabled)?.key ?? options[0]?.key, onChange = (_v) => { }, className = '', size =
|
|
28
|
+
value = options.find((o) => !o.disabled)?.key ?? options[0]?.key, onChange = (_v) => { }, className = '', size = CONTROL_SIZE, shape = 'pill', useBG = true, fullWidth = false, minButtonWidth, ariaLabel, } = props || {};
|
|
28
29
|
/* **라디오 무리는 Tab 자리 하나 + 화살표**가 ARIA 규칙이다.
|
|
29
30
|
`role="radiogroup"`·`role="radio"` 만 붙여 놓고 키를 안 만들면 **안 붙인 것보다
|
|
30
31
|
나쁘다** — 낭독기가 "라디오 그룹, 3 중 2" 라고 읽어 주니 사람은 화살표를 누르는데
|
|
@@ -26,7 +26,7 @@ function SideNavFooter(props) {
|
|
|
26
26
|
// 하나도 없으면 바닥 자체를 비운다 — 빈 채로 두면 여백(margin-top + padding)만 남는다.
|
|
27
27
|
if (!hasAny)
|
|
28
28
|
return null;
|
|
29
|
-
return (_jsxs("div", { className: "side-nav__footer", children: [onDebug && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "terminal", ariaLabel: t('nav.debug', '디버그'), onClick: onDebug, selected: activeKey === 'debug' })),
|
|
29
|
+
return (_jsxs("div", { className: "side-nav__footer", children: [onDebug && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "terminal", ariaLabel: t('nav.debug', '디버그'), onClick: onDebug, selected: activeKey === 'debug' })), onHelp && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "message-circle-question-mark", ariaLabel: t('nav.help', '도움말'), onClick: onHelp, selected: activeKey === 'help' })), onNotification && (_jsxs("span", { className: "side-nav__notification-wrap", children: [_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "bell", ariaLabel: nameWithCount(t, t('nav.notifications', '알림'), unreadCount), onClick: onNotification, selected: activeKey === 'notifications' }), !!unreadCount && unreadCount > 0 && (_jsx(CircleBadge, { number: Math.min(unreadCount, 99), size: 24, "aria-hidden": true }))] })), onSetting && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "settings", ariaLabel: t('nav.settings', '설정'), onClick: onSetting, selected: activeKey === 'settings' })), onFeedback && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "bug", ariaLabel: t('nav.feedback', '버그신고'), onClick: onFeedback, selected: activeKey === 'feedback' })), onAccount && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "user-round", ariaLabel: t('nav.account', '계정'), onClick: onAccount, selected: activeKey === 'account' }))] }));
|
|
30
30
|
}
|
|
31
31
|
function SideNavButton(props) {
|
|
32
32
|
const { t } = useTranslation();
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import './
|
|
2
|
-
|
|
3
|
-
/** @public */
|
|
4
|
-
export type StatChartChangeType = 'up' | 'down' | 'neutral';
|
|
1
|
+
import { type ChartSectionProps, type StatChartSize, type StatChartChangeType, type StatChartBodyAlign } from './ChartSection';
|
|
2
|
+
export type { StatChartSize, StatChartChangeType, StatChartBodyAlign };
|
|
5
3
|
/** @public */
|
|
6
4
|
export interface StatChartProps {
|
|
7
5
|
/** 카드 제목(좌상단) */
|
|
@@ -17,14 +15,27 @@ export interface StatChartProps {
|
|
|
17
15
|
/** 호버 시 표시할 툴팁 텍스트 */
|
|
18
16
|
tooltip?: string;
|
|
19
17
|
onClick?: () => void;
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
/** 카드의 급 — `small`(기본) · `medium` · `large` · `xLarge`, 또는 키를 px 로 바로 */
|
|
19
|
+
size?: StatChartSize | number;
|
|
20
|
+
/** 값 아래 자리가 서는 곳 — `bottom`(기본, 카드 바닥) · `center`(값 아래 남는 자리의 한가운데) */
|
|
21
|
+
bodyAlign?: StatChartBodyAlign;
|
|
22
|
+
/** 값 **아래** 에 붙는 자리 — 목록 몇 줄, "외 n건" 단추처럼 값을 풀어 보이는 것 */
|
|
23
|
+
children?: ChartSectionProps['children'];
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
|
-
* 순수 카운트 스탯
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* 순수 카운트 스탯 카드.
|
|
27
|
+
*
|
|
28
|
+
* @deprecated **`<ChartSection type="stat">` 을 쓴다**(사장님 지시 2026-11-02 — "chartsection과
|
|
29
|
+
* statChart 하나로 합쳐, type 으로 전부 분기해"). 몸은 이미 그쪽 하나다 — 이것은 이름만
|
|
30
|
+
* 옮겨 주는 얇은 껍데기이고, 소비자가 다 옮기면 지운다.
|
|
31
|
+
*
|
|
32
|
+
* | 여기 | 저기 |
|
|
33
|
+
* |---|---|
|
|
34
|
+
* | `label` | `title` |
|
|
35
|
+
* | `value` | `totalNum` |
|
|
36
|
+
*
|
|
37
|
+
* 나머지(`change` · `changeType` · `icon` · `tooltip` · `onClick` · `size` · `bodyAlign` ·
|
|
38
|
+
* `children`)는 이름이 같다.
|
|
28
39
|
* @public
|
|
29
40
|
*/
|
|
30
|
-
export default function StatChart({ label, value, change, changeType, icon, tooltip, onClick, children }: StatChartProps): import("react").JSX.Element;
|
|
41
|
+
export default function StatChart({ label, value, change, changeType, icon, tooltip, onClick, size, bodyAlign, children }: StatChartProps): import("react").JSX.Element;
|