@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
@@ -108,7 +108,7 @@ export { buildMonthChartData } from './components/barChartData';
108
108
  export { monthKeyOf, monthKeyOfDate, parseMonthKey, weekValueOf } from './components/barChartMonthKey';
109
109
  export { getControlDateRange } from './components/barChartTypes';
110
110
  export { default as RingChart } from './components/RingChart';
111
- export { default as ChartSection, ChartTotal, ChartLegend } from './components/ChartSection';
111
+ export { default as ChartSection, ChartTotal, ChartLegend, chartTotalNumClass } from './components/ChartSection';
112
112
  export { default as StatChart } from './components/StatChart';
113
113
  export { default as Slider } from './components/Slider';
114
114
  export { default as AudioMeter } from './components/AudioMeter';
@@ -0,0 +1,28 @@
1
+ /**
2
+ * **칸보다 넓은 카드는 다음 칸까지 쓴다**(사장님 지시 2026-11-02 — *"가로가 길면 다음 칸
3
+ * 까지 사용하도록 해야지?"*).
4
+ *
5
+ * 낱말 묶음 격자는 **200px 고정 열**인데(`repeat(auto-fill, 200px)`), 그 안의 단추는
6
+ * 글 길이만큼 넓어진다(`min-width: 200px` 이고 넘침을 안 감춘다). 그래서 긴 묶음이 들면
7
+ * **단추가 제 칸을 넘어 옆 칸 위로 삐져나가고, 옆 카드가 그 위에 그려져 잘린 것처럼 보인다.**
8
+ *
9
+ * **아무 자도 그걸 못 잡는다** — `scrollWidth` 는 격자가 아니라 제 상자를 재니 멀쩡하고
10
+ * (실측 2026-11-02: 단추 `scrollWidth` 260 = `clientWidth` 260, 넘침 0으로 읽힌다),
11
+ * `overflow` 는 `visible` 이라 구르지도 잘리지도 않는다. 눈으로만 잡히던 자리다.
12
+ *
13
+ * 실측(2026-11-02 · 폭 1420 · 50묶음) — 열 200 × 6 · 틈 8. `가운뎃손가락 다리미질하다
14
+ * 콘트라베이스` 한 묶음이 **단추 262px** 라 62px 이 옆 칸을 덮었다. 두 칸이면 408px 이라 든다.
15
+ *
16
+ * ## 왜 CSS 로 못 하나
17
+ *
18
+ * 격자는 **칸 수를 글 길이로 못 정한다.** `max-content` 로 열을 잡으면 **가장 긴 묶음의 폭이
19
+ * 모든 열에 퍼져** 짧은 묶음 사이가 휑해지고(이 파일 CSS 머리말에 그 자취가 있다),
20
+ * `1fr` 로 늘리면 단추가 열을 못 채워 같은 일이 난다. 그래서 **재서 칸 수를 적는다.**
21
+ *
22
+ * 그리기 **직후에** 잰다(`useLayoutEffect`) — 효과가 늦으면 한 틱 동안 덮인 채 보인다.
23
+ * 폭이 바뀌면 열 수가 달라지므로 `ResizeObserver` 로 다시 잰다.
24
+ *
25
+ * @param deps 다시 재야 하는 때(묶음 목록·쪽·정렬이 바뀔 때).
26
+ * @returns 격자들을 **감싸는** 자리에 다는 자리표(격자 자체가 아니다 — 여럿일 수 있다).
27
+ */
28
+ export declare function useWideCardSpans(deps?: readonly unknown[]): import("react").RefObject<HTMLDivElement | null>;
@@ -0,0 +1,85 @@
1
+ 'use client';
2
+ import { useCallback, useLayoutEffect, useRef } from 'react';
3
+ /**
4
+ * **칸보다 넓은 카드는 다음 칸까지 쓴다**(사장님 지시 2026-11-02 — *"가로가 길면 다음 칸
5
+ * 까지 사용하도록 해야지?"*).
6
+ *
7
+ * 낱말 묶음 격자는 **200px 고정 열**인데(`repeat(auto-fill, 200px)`), 그 안의 단추는
8
+ * 글 길이만큼 넓어진다(`min-width: 200px` 이고 넘침을 안 감춘다). 그래서 긴 묶음이 들면
9
+ * **단추가 제 칸을 넘어 옆 칸 위로 삐져나가고, 옆 카드가 그 위에 그려져 잘린 것처럼 보인다.**
10
+ *
11
+ * **아무 자도 그걸 못 잡는다** — `scrollWidth` 는 격자가 아니라 제 상자를 재니 멀쩡하고
12
+ * (실측 2026-11-02: 단추 `scrollWidth` 260 = `clientWidth` 260, 넘침 0으로 읽힌다),
13
+ * `overflow` 는 `visible` 이라 구르지도 잘리지도 않는다. 눈으로만 잡히던 자리다.
14
+ *
15
+ * 실측(2026-11-02 · 폭 1420 · 50묶음) — 열 200 × 6 · 틈 8. `가운뎃손가락 다리미질하다
16
+ * 콘트라베이스` 한 묶음이 **단추 262px** 라 62px 이 옆 칸을 덮었다. 두 칸이면 408px 이라 든다.
17
+ *
18
+ * ## 왜 CSS 로 못 하나
19
+ *
20
+ * 격자는 **칸 수를 글 길이로 못 정한다.** `max-content` 로 열을 잡으면 **가장 긴 묶음의 폭이
21
+ * 모든 열에 퍼져** 짧은 묶음 사이가 휑해지고(이 파일 CSS 머리말에 그 자취가 있다),
22
+ * `1fr` 로 늘리면 단추가 열을 못 채워 같은 일이 난다. 그래서 **재서 칸 수를 적는다.**
23
+ *
24
+ * 그리기 **직후에** 잰다(`useLayoutEffect`) — 효과가 늦으면 한 틱 동안 덮인 채 보인다.
25
+ * 폭이 바뀌면 열 수가 달라지므로 `ResizeObserver` 로 다시 잰다.
26
+ *
27
+ * @param deps 다시 재야 하는 때(묶음 목록·쪽·정렬이 바뀔 때).
28
+ * @returns 격자들을 **감싸는** 자리에 다는 자리표(격자 자체가 아니다 — 여럿일 수 있다).
29
+ */
30
+ export function useWideCardSpans(deps = []) {
31
+ const ref = useRef(null);
32
+ /* **격자가 여럿일 수 있다** — 묶어서 보여 줄 때는 묶음마다 제 격자를 세운다. 그래서
33
+ 자리표는 **격자가 아니라 그 바깥**에 달고, 안의 격자를 다 찾아 하나씩 잰다(격자에 달면
34
+ 마지막 하나만 잡힌다). */
35
+ const measureGrid = useCallback((grid) => {
36
+ const style = getComputedStyle(grid);
37
+ /* 열 하나의 폭과 틈을 **격자에게 묻는다** — 200·8 을 여기 또 적으면 CSS 를 고칠 때
38
+ 이 자리만 옛 수로 남는다. */
39
+ const columns = style.gridTemplateColumns.split(' ').filter(Boolean);
40
+ const column = parseFloat(columns[0] ?? '0');
41
+ const gap = parseFloat(style.columnGap || '0') || 0;
42
+ if (!column || columns.length < 2) { // 열이 하나뿐인 좁은 판은 넓힐 데가 없다
43
+ for (const cell of grid.children)
44
+ cell.style.gridColumn = '';
45
+ return;
46
+ }
47
+ for (const node of grid.children) {
48
+ const cell = node;
49
+ /* **단추의 제 폭**을 재려면 먼저 자리표를 걷는다 — 지난번에 넓혀 둔 칸이 그대로면
50
+ 단추가 그 폭에 맞춰져 "이제 안 넘친다" 로 읽힌다(고친 뒤 다시 좁아지지 않는다). */
51
+ cell.style.gridColumn = '';
52
+ cell.removeAttribute('data-wide');
53
+ const button = cell.querySelector('button');
54
+ const need = button ? button.getBoundingClientRect().width : 0;
55
+ if (need <= column + 0.5)
56
+ continue;
57
+ const span = Math.min(columns.length, Math.ceil((need + gap) / (column + gap)));
58
+ if (span <= 1)
59
+ continue;
60
+ cell.style.gridColumn = `span ${span}`;
61
+ /* **넓힌 칸은 카드가 채운다** — 칸만 넓히면 단추는 제 글 폭(262)에 머물러 오른쪽에
62
+ 146px 이 빈다(실측 2026-11-02). 격자에 구멍이 난 것처럼 보인다. 채우는 일은 CSS 가
63
+ 하고(`[data-wide]`), 여기서는 **어느 칸이 넓은지만** 표시한다. */
64
+ cell.setAttribute('data-wide', '');
65
+ }
66
+ }, []);
67
+ const measure = useCallback(() => {
68
+ const root = ref.current;
69
+ if (!root)
70
+ return;
71
+ for (const grid of root.querySelectorAll('.word-search-result-block__items'))
72
+ measureGrid(grid);
73
+ }, [measureGrid]);
74
+ useLayoutEffect(() => {
75
+ measure();
76
+ const root = ref.current;
77
+ if (!root || typeof ResizeObserver === 'undefined')
78
+ return;
79
+ const watch = new ResizeObserver(() => measure());
80
+ watch.observe(root);
81
+ return () => watch.disconnect();
82
+ // eslint-disable-next-line react-hooks/exhaustive-deps
83
+ }, [measure, ...deps]);
84
+ return ref;
85
+ }
@@ -115,6 +115,7 @@
115
115
  "Fri",
116
116
  "Sat"
117
117
  ],
118
+ "yearMonthCompact": "{{full}}",
118
119
  "weekLabel": "Week {{ord}}",
119
120
  "prevMonth": "Previous month",
120
121
  "addOnDate": "Add a visit on {{date}}",
@@ -120,6 +120,7 @@
120
120
  "여섯째",
121
121
  "일곱째"
122
122
  ],
123
+ "yearMonthCompact": "{{year}}.{{month}}",
123
124
  "weekLabel": "{{ord}}주",
124
125
  "prevMonth": "이전 달",
125
126
  "addOnDate": "{{date}}에 방문 등록",
@@ -80,7 +80,11 @@ export const RENAMED = {
80
80
  'bar-chart__slot': 'manager-bar-chart-slot',
81
81
  'bar-chart__col': 'manager-bar-chart-col',
82
82
  'bar-chart__bar': 'manager-bar-chart-bar',
83
- 'stat-chart__card': 'manager-stat-card',
83
+ /* `stat-chart__card` 는 2026-11-02 에 **이름 자체가 없어졌다** — `StatChart` 가
84
+ `ChartSection type="stat"` 으로 합쳐지며 `chart-section--stat` 이 됐다(사장님 지시).
85
+ 그 이름을 겨누던 자리는 말귀 넷뿐이었고 함께 옮겼다(실측: 앱 19곳 · 공식웹 0곳).
86
+ `chart-section` 의 옛 이름(`manager-section`)은 위에 그대로 있으니, 수 칸도 이제
87
+ `manager-section manager-section--stat` 을 함께 단다. */
84
88
  };
85
89
  /**
86
90
  * 주어진 표에서 이 클래스의 옛 이름을 찾는다. 바뀐 적이 없으면 `null`.
@@ -46,4 +46,4 @@
46
46
  *
47
47
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
48
48
  */
49
- export declare const CORE_VERSION = "0.413.0";
49
+ export declare const CORE_VERSION = "0.415.0";
@@ -46,4 +46,4 @@
46
46
  *
47
47
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
48
48
  */
49
- export const CORE_VERSION = '0.413.0';
49
+ export const CORE_VERSION = '0.415.0';