@ihabdevteam/core 0.415.0 → 0.423.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 (50) hide show
  1. package/CHANGELOG.md +617 -1
  2. package/dist/components.cjs.js +179 -179
  3. package/dist/components.esm.css +2 -2
  4. package/dist/hooks.cjs.js +3 -3
  5. package/dist/i18n.cjs.js +3 -3
  6. package/dist/ihabdevteam-core.cjs.js +190 -190
  7. package/dist/ihabdevteam-core.d.ts +199 -8
  8. package/dist/packages/core/src/components/Badge.css +26 -0
  9. package/dist/packages/core/src/components/Badge.d.ts +6 -1
  10. package/dist/packages/core/src/components/BarChart.css +25 -5
  11. package/dist/packages/core/src/components/Button.css +114 -2
  12. package/dist/packages/core/src/components/Button.js +3 -2
  13. package/dist/packages/core/src/components/ChartSection.css +33 -0
  14. package/dist/packages/core/src/components/ChartSection.d.ts +8 -3
  15. package/dist/packages/core/src/components/ChartSection.js +106 -4
  16. package/dist/packages/core/src/components/Header.css +3 -1
  17. package/dist/packages/core/src/components/Landing/Landing.css +235 -0
  18. package/dist/packages/core/src/components/Landing/LandingButton.d.ts +31 -0
  19. package/dist/packages/core/src/components/Landing/LandingButton.js +19 -0
  20. package/dist/packages/core/src/components/Landing/LandingCard.d.ts +31 -0
  21. package/dist/packages/core/src/components/Landing/LandingCard.js +21 -0
  22. package/dist/packages/core/src/components/Landing/LandingSection.d.ts +28 -0
  23. package/dist/packages/core/src/components/Landing/LandingSection.js +18 -0
  24. package/dist/packages/core/src/components/Landing/LandingStatBand.d.ts +23 -0
  25. package/dist/packages/core/src/components/Landing/LandingStatBand.js +90 -0
  26. package/dist/packages/core/src/components/Landing/LandingTitle.d.ts +34 -0
  27. package/dist/packages/core/src/components/Landing/LandingTitle.js +26 -0
  28. package/dist/packages/core/src/components/Popup/DeviceSideTable.js +6 -1
  29. package/dist/packages/core/src/components/SideNav.css +44 -15
  30. package/dist/packages/core/src/components/SideNav.js +1 -1
  31. package/dist/packages/core/src/components/StatChart.d.ts +1 -1
  32. package/dist/packages/core/src/components/TableField.css +9 -0
  33. package/dist/packages/core/src/components/Word/wordTableScoring.d.ts +54 -0
  34. package/dist/packages/core/src/components/Word/wordTableScoring.js +60 -0
  35. package/dist/packages/core/src/components/WordTable.css +30 -1
  36. package/dist/packages/core/src/components/WordTable.js +34 -2
  37. package/dist/packages/core/src/components/barChartData.d.ts +23 -0
  38. package/dist/packages/core/src/components/barChartData.js +30 -0
  39. package/dist/packages/core/src/components/buttonTypes.d.ts +35 -2
  40. package/dist/packages/core/src/components/useBarChartControl.js +17 -13
  41. package/dist/packages/core/src/components.d.ts +10 -0
  42. package/dist/packages/core/src/components.js +6 -0
  43. package/dist/packages/core/src/i18n/locales/en.json +2 -1
  44. package/dist/packages/core/src/i18n/locales/ko.json +1 -0
  45. package/dist/packages/core/src/utils/date.d.ts +12 -0
  46. package/dist/packages/core/src/utils/date.js +18 -0
  47. package/dist/packages/core/src/version.d.ts +1 -1
  48. package/dist/packages/core/src/version.js +1 -1
  49. package/dist/utils.cjs.js +3 -3
  50. package/package.json +5 -1
@@ -1,6 +1,25 @@
1
1
  import type { MouseEvent, ReactNode } from 'react';
2
- /** @public */
3
- export type ButtonVariant = 'default' | 'main' | 'sub' | 'transparent-white' | 'transparent-gray' | 'transparent-lightGray' | 'danger' | 'disabled-faded' | (string & {});
2
+ /**
3
+ * 단추의 변형.
4
+ *
5
+ * 대부분은 **강조의 세기**를 말한다 — `main`(쪽마다 하나뿐인 주요 행동) ·
6
+ * `default`(흔한 보조 행동) · `transparent-*`(덜 드러나야 하는 행동) ·
7
+ * `danger`(되돌릴 수 없는 행동).
8
+ *
9
+ * **`white` 와 `black` 만 뜻이 다르다 — 강조가 아니라 *바탕*을 고른다**
10
+ * (사용자 지시 2026-11-06). 색이 깔린 자리(브랜드색 띠 · 사진 위 · `main` 판 안)에는
11
+ * `white`, 밝은 자리에는 `black` 이다. 바탕이 비어 뒤가 비치는
12
+ * `transparent-white` 와 달리 이 둘은 **바탕이 꽉 찬 판**이다.
13
+ *
14
+ * 이 둘은 **테마를 안 따라간다** — 어두운 테마에서도 흰 단추는 희고 검은 단추는
15
+ * 검다. 바탕을 따라가야 하면 `default` 가 그 일을 한다. 까닭은 `Button.css` 의
16
+ * 그 자리에 적어 두었다(`--color-pureWhite` 는 테마에서 뒤집힌다).
17
+ *
18
+ * `white` 의 글자는 앱의 본색(`--color-main`)이라 **명암비가 앱마다 다르다** —
19
+ * 디자인 시스템 기본값으로는 AA 아래고 말귀의 브랜드색으로는 11.92:1 이다.
20
+ * @public
21
+ */
22
+ export type ButtonVariant = 'default' | 'main' | 'sub' | 'transparent-white' | 'transparent-gray' | 'transparent-lightGray' | 'white' | 'black' | 'danger' | 'disabled-faded' | (string & {});
4
23
  /** @public */
5
24
  export type ButtonLayoutType = 'bar' | 'dot';
6
25
  /**
@@ -85,6 +104,20 @@ export interface ButtonProps {
85
104
  * 기본을 nowrap 으로 바꾸지 않은 까닭: 두 줄 라벨(`subLabel`·설명 붙은 단추)이 이미 선 화면이 있고,
86
105
  * 좁은 자리에서 nowrap 은 **넘쳐 잘린다**(줄바꿈은 키만 늘어난다). 어느 쪽이 나은지는 그 자리가 안다. */
87
106
  nowrap?: boolean;
107
+ /** 라벨을 **한 줄로 두고 넘치면 말줄임**(`…`)한다 — `nowrap` 의 모자란 데를 메운다.
108
+ *
109
+ * `nowrap` 은 줄바꿈만 막는다. 그래서 좁은 자리에서는 글자가 **상자를 넘어 옆을 덮는다**
110
+ * (바로 위 `nowrap` 머리말이 적어 둔 그 손해다 — *"좁은 자리에서 nowrap 은 넘쳐 잘린다"*).
111
+ * 이것은 거기에 `overflow: hidden` + `text-overflow: ellipsis` 를 더해 **상자 안에서 끝내고
112
+ * 끝에 `…` 를 남긴다** — 넘친 글자가 어딘가를 덮지 않고, 더 있다는 것이 보인다.
113
+ *
114
+ * 말귀 청 (373), 2026-11-03 — 사장님 지시 *"2줄 나오게 하지말고 이클립스 되도록"*.
115
+ * 대시보드 추천훈련의 줄 단추가 `size 56`(키 고정)인데 긴 훈련 이름이 **두 줄로 접혀**
116
+ * 단추 밖으로 1px 씩 비어져 나왔다. 키가 박힌 단추에서는 줄바꿈이 갈 데가 없다.
117
+ *
118
+ * `subLabel` 이 붙은 단추에서는 **두 줄 다** 각자 한 줄로 서고 각자 말줄임한다.
119
+ * `nowrap` 과 함께 줘도 된다 — 이쪽이 줄바꿈 금지를 이미 품는다. */
120
+ ellipsis?: boolean;
88
121
  selected?: boolean;
89
122
  toggleable?: boolean;
90
123
  /**
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { useState, useEffect, useMemo, useCallback } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
- import { firstMondayOfMonth, todayWeekValue, monthOptionsNow, weekLabel } from './barChartData';
5
- import { yearMonthLabel } from '../utils/date';
4
+ import { firstMondayOfMonth, todayWeekValue, monthOptionsNow, weekLabelCompact } from './barChartData';
5
+ import { yearMonthLabel, formatYearMonthShort } from '../utils/date';
6
6
  import { weekValueOf } from './barChartMonthKey';
7
7
  /**
8
8
  * BarChart 기간 상태/옵션/네비게이션을 캡슐화한 훅.
@@ -26,13 +26,6 @@ export function useBarChartControl(data) {
26
26
  }
27
27
  return opts;
28
28
  }, [DATA_MONTH_OPTIONS]);
29
- /* **짧은 연월** — `2026년 11월` 이 아니라 `2026.11`(사장님 지시 2026-11-02 —
30
- "2026.11 첫째주 로 글씨 줄이고"). 고르개가 **차트 카드 머리에 다른 조절칸 셋과 한 줄로
31
- 서는데**, 긴 꼴로는 그 줄이 카드 폭을 넘어 제목이 아랫줄로 접혔다(실측 2026-11-02,
32
- 카드 540: 조절칸 416 + 제목 113 > 속 폭 502).
33
-
34
- `yearMonthLabel`(Intl) 은 **그대로 둔다** — 달력 머리줄(`Calendar`)이 쓰는 자리라
35
- 거기까지 줄이면 달력이 달을 읽기 어려워진다. 짧은 꼴은 사전이 쥔다. */
36
29
  /**
37
30
  * **짧은 연월** — `2026년 11월` 이 아니라 `2026.11`(사장님 지시 2026-11-02 —
38
31
  * "2026.11 첫째주 로 글씨 줄이고"). 고르개가 차트 카드 머리에 다른 조절칸 셋과 한 줄로
@@ -40,16 +33,27 @@ export function useBarChartControl(data) {
40
33
  * 조절칸 416 + 제목 113 > 속 폭 502).
41
34
  *
42
35
  * **어느 꼴로 적을지는 사전이 고른다** — 코드가 말을 보고 가르지 않는다(`langBranchInDict`).
43
- * 숫자(`year`·`month`)와 Intl 이 지은 긴 꼴(`full`)을 **둘 다 넘기고**, 한국어 사전은
44
- * 숫자를, 영어 사전은 긴 꼴을 쓴다(영어는 **달 이름**이 보여야 한다 —
45
- * `yearMonthEverySite`). `yearMonthLabel` 자체는 그대로 둔다 — 달력 머리줄이 쓰는 자리다.
36
+ * 숫자(`year`·`month`)와 Intl 이 지은 두 꼴(`full`·`short`)을 **다 넘기고**, 한국어 사전은
37
+ * 숫자를, 영어 사전은 **줄인 꼴**을 쓴다. 영어에 **달 이름이 보여야 하는 것은 그대로**이고
38
+ * (`yearMonthEverySite`) `Sep` 도 달 이름이다 — 줄인 것은 이름이 아니라 길이다.
39
+ *
40
+ * **영어가 긴 꼴을 쓰던 동안 이름표가 잘렸다**(청 (365), 실측 2026-11-03). 카드 540 ·
41
+ * 글자 16px 에서 이름표 칸은 **100**인데 `September 2026 Week 4` 는 **179** 가 필요해
42
+ * `September …` 로 끊겼다 — **주 수가 통째로 사라지는** 자리다. 상자를 글에 맞춰 늘리면
43
+ * 229 가 되어 **머리가 두 줄로 접힌다**(32 → 63). 줄인 꼴은 가장 긴 `May 2026 Week 4` 가
44
+ * **130**(상자 180)이라 한 줄에 선다. `yearMonthLabel`(긴 꼴)은 그대로 둔다 — 달력
45
+ * 머리줄이 쓰는 자리다.
46
46
  */
47
47
  const yearMonthShort = useCallback((year, month) => t('calendar.yearMonthCompact', {
48
48
  year, month,
49
49
  full: yearMonthLabel(t, i18n.language, year, month),
50
+ short: formatYearMonthShort(year, month, i18n.language),
50
51
  defaultValue: '{{full}}',
51
52
  }), [t, i18n.language]);
52
- const weekOptionLabel = useCallback((o) => `${yearMonthShort(o.year, o.month)} ${weekLabel(t, o.week)}`, [t, yearMonthShort]);
53
+ /* **주 이름표도 짧은 꼴을 쓴다**(`weekLabelCompact`, 영어 `W4`) — 긴 꼴이면 상자가 180 이
54
+ 되어 제목에 96 만 남고 실제 영어 제목 셋에서 머리가 두 줄로 접힌다(청 (365) 실측). 막대
55
+ 밑글과 회원앱 `periodLabel` 은 긴 꼴을 그대로 쓴다 — 모자란 것은 이 자리의 폭뿐이다. */
56
+ const weekOptionLabel = useCallback((o) => `${yearMonthShort(o.year, o.month)} ${weekLabelCompact(t, o.week)}`, [t, yearMonthShort]);
53
57
  const monthOptions = useMemo(() => DATA_MONTH_OPTIONS.map(o => ({
54
58
  value: o.value, label: yearMonthShort(o.year, o.month),
55
59
  })), [yearMonthShort, DATA_MONTH_OPTIONS]);
@@ -68,6 +68,16 @@ export type { SoundCompassMode, SoundCompassPhase, SoundCompassExam, UseSoundCom
68
68
  export type { SpeakerPos } from './types/audio';
69
69
  export { default as SideNav } from './components/SideNav';
70
70
  export { default as Button } from './components/Button';
71
+ export { default as LandingSection } from './components/Landing/LandingSection';
72
+ export type { LandingSectionProps } from './components/Landing/LandingSection';
73
+ export { default as LandingTitle } from './components/Landing/LandingTitle';
74
+ export type { LandingTitleProps } from './components/Landing/LandingTitle';
75
+ export { default as LandingCard } from './components/Landing/LandingCard';
76
+ export type { LandingCardProps } from './components/Landing/LandingCard';
77
+ export { default as LandingButton } from './components/Landing/LandingButton';
78
+ export type { LandingButtonProps } from './components/Landing/LandingButton';
79
+ export { default as LandingStatBand } from './components/Landing/LandingStatBand';
80
+ export type { LandingStatBandProps, LandingStat } from './components/Landing/LandingStatBand';
71
81
  export { default as Badge } from './components/Badge';
72
82
  export type { BadgeProps, BadgeType, BadgeFill, BadgeDotIcon } from './components/Badge';
73
83
  export { default as CircleBadge } from './components/CircleBadge';
@@ -52,6 +52,12 @@ export { default as SoundCompass } from './components/SoundCompass';
52
52
  export { useSoundCompassExam } from './hooks/useSoundCompassExam';
53
53
  export { default as SideNav } from './components/SideNav';
54
54
  export { default as Button } from './components/Button';
55
+ /* ── 랜딩(소개) 쪽을 짓는 부품 — 말귀 랜딩 시안에서 옮겨 왔다(2026-11-05) ── */
56
+ export { default as LandingSection } from './components/Landing/LandingSection';
57
+ export { default as LandingTitle } from './components/Landing/LandingTitle';
58
+ export { default as LandingCard } from './components/Landing/LandingCard';
59
+ export { default as LandingButton } from './components/Landing/LandingButton';
60
+ export { default as LandingStatBand } from './components/Landing/LandingStatBand';
55
61
  export { default as Badge } from './components/Badge';
56
62
  export { default as CircleBadge } from './components/CircleBadge';
57
63
  export { default as ShortcutBadge } from './components/ShortcutBadge';
@@ -115,8 +115,9 @@
115
115
  "Fri",
116
116
  "Sat"
117
117
  ],
118
- "yearMonthCompact": "{{full}}",
118
+ "yearMonthCompact": "{{short}}",
119
119
  "weekLabel": "Week {{ord}}",
120
+ "weekLabelCompact": "W{{ord}}",
120
121
  "prevMonth": "Previous month",
121
122
  "addOnDate": "Add a visit on {{date}}",
122
123
  "nextMonth": "Next month",
@@ -122,6 +122,7 @@
122
122
  ],
123
123
  "yearMonthCompact": "{{year}}.{{month}}",
124
124
  "weekLabel": "{{ord}}주",
125
+ "weekLabelCompact": "{{ord}}주",
125
126
  "prevMonth": "이전 달",
126
127
  "addOnDate": "{{date}}에 방문 등록",
127
128
  "nextMonth": "다음 달",
@@ -41,6 +41,18 @@ export declare function formatDateLocale(iso: string, lang: string): string;
41
41
  */
42
42
  export declare function intlLocale(lang: string): string;
43
43
  export declare function formatYearMonth(year: number, month: number, lang: string): string;
44
+ /**
45
+ * **달 이름을 줄인 연월** — `September 2026` 대신 `Sep 2026`.
46
+ *
47
+ * 긴 꼴은 차트 카드 머리의 기간 고르개에 **안 들어간다.** 실측(2026-11-03, 카드 540 ·
48
+ * 글자 16px): `September 2026 Week 4` 는 이름표 칸 100 에 **179** 가 필요해 `September …`
49
+ * 로 잘렸고, 상자를 글에 맞춰 늘리면 229 가 되어 **머리가 두 줄로 접혔다**(32 → 63).
50
+ * 달 이름을 줄이면 `May 2026 Week 4` 가 가장 길어 **130** — 상자 180 으로 한 줄에 선다.
51
+ *
52
+ * **`formatYearMonth`(긴 꼴)은 그대로 둔다** — 달력 머리줄(`Calendar`)이 쓰는 자리라
53
+ * 거기서는 달 이름이 온전히 보여야 한다. 줄인 꼴이 필요한 자리만 이것을 부른다.
54
+ */
55
+ export declare function formatYearMonthShort(year: number, month: number, lang: string): string;
44
56
  /**
45
57
  * **연·월 이름표 — 사전이 있으면 사전, 없으면 브라우저.** @public
46
58
  *
@@ -122,6 +122,24 @@ export function formatYearMonth(year, month, lang) {
122
122
  return `${year}-${month}`;
123
123
  return new Intl.DateTimeFormat(intlLocale(lang), { year: 'numeric', month: 'long' }).format(new Date(year, month - 1, 1));
124
124
  }
125
+ /**
126
+ * **달 이름을 줄인 연월** — `September 2026` 대신 `Sep 2026`.
127
+ *
128
+ * 긴 꼴은 차트 카드 머리의 기간 고르개에 **안 들어간다.** 실측(2026-11-03, 카드 540 ·
129
+ * 글자 16px): `September 2026 Week 4` 는 이름표 칸 100 에 **179** 가 필요해 `September …`
130
+ * 로 잘렸고, 상자를 글에 맞춰 늘리면 229 가 되어 **머리가 두 줄로 접혔다**(32 → 63).
131
+ * 달 이름을 줄이면 `May 2026 Week 4` 가 가장 길어 **130** — 상자 180 으로 한 줄에 선다.
132
+ *
133
+ * **`formatYearMonth`(긴 꼴)은 그대로 둔다** — 달력 머리줄(`Calendar`)이 쓰는 자리라
134
+ * 거기서는 달 이름이 온전히 보여야 한다. 줄인 꼴이 필요한 자리만 이것을 부른다.
135
+ */
136
+ export function formatYearMonthShort(year, month, lang) {
137
+ /* 범위 밖을 받으면 긴 꼴과 **같은 꼴로** 돌려준다 — 두 함수가 같은 입력에 다른 말을
138
+ 하면 어느 쪽이 맞는지 부르는 쪽이 못 가린다. */
139
+ if (!Number.isFinite(year) || !Number.isFinite(month) || month < 1 || month > 12)
140
+ return `${year}-${month}`;
141
+ return new Intl.DateTimeFormat(intlLocale(lang), { year: 'numeric', month: 'short' }).format(new Date(year, month - 1, 1));
142
+ }
125
143
  /**
126
144
  * **연·월 이름표 — 사전이 있으면 사전, 없으면 브라우저.** @public
127
145
  *
@@ -46,4 +46,4 @@
46
46
  *
47
47
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
48
48
  */
49
- export declare const CORE_VERSION = "0.415.0";
49
+ export declare const CORE_VERSION = "0.423.0";
@@ -46,4 +46,4 @@
46
46
  *
47
47
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
48
48
  */
49
- export const CORE_VERSION = '0.415.0';
49
+ export const CORE_VERSION = '0.423.0';