@ihabdevteam/core 0.435.0 → 0.436.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 +24 -0
- package/dist/components.cjs.js +180 -180
- package/dist/components.esm.css +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/i18n.cjs.js +1 -1
- package/dist/ihabdevteam-core.cjs.js +185 -185
- package/dist/ihabdevteam-core.d.ts +21 -17
- package/dist/packages/core/src/components/Badge.css +7 -1
- package/dist/packages/core/src/components/Badge.d.ts +10 -0
- package/dist/packages/core/src/components/Badge.js +2 -2
- package/dist/packages/core/src/components/BulkBar.js +4 -1
- package/dist/packages/core/src/components/Button.js +6 -1
- package/dist/packages/core/src/components/ColorPicker.d.ts +1 -1
- package/dist/packages/core/src/components/ColorPicker.js +5 -1
- package/dist/packages/core/src/components/ConsentRecordPopup.js +1 -1
- package/dist/packages/core/src/components/DatePicker.d.ts +1 -1
- package/dist/packages/core/src/components/DatePicker.js +5 -1
- package/dist/packages/core/src/components/Dropdown.d.ts +1 -1
- package/dist/packages/core/src/components/Dropdown.js +5 -1
- package/dist/packages/core/src/components/FilterPanel.js +5 -2
- package/dist/packages/core/src/components/Panel.css +14 -12
- package/dist/packages/core/src/components/Panel.d.ts +5 -8
- package/dist/packages/core/src/components/Panel.js +16 -6
- package/dist/packages/core/src/components/PanelRow.js +10 -6
- package/dist/packages/core/src/components/Popup/ListPopup.js +1 -1
- package/dist/packages/core/src/components/Popup/SaveTablePopup.js +1 -1
- package/dist/packages/core/src/components/SegmentedControl.js +5 -1
- package/dist/packages/core/src/components/Table.css +12 -15
- package/dist/packages/core/src/components/Table.d.ts +1 -3
- package/dist/packages/core/src/components/Table.js +77 -73
- package/dist/packages/core/src/components/Tabs.d.ts +1 -1
- package/dist/packages/core/src/components/Tabs.js +5 -1
- package/dist/packages/core/src/components/TextField.js +5 -1
- package/dist/packages/core/src/components/Toolbar.js +5 -2
- package/dist/packages/core/src/components/Word/WordSearchResultBlock.js +4 -1
- package/dist/packages/core/src/components/Word/WordTableBlock.js +1 -1
- package/dist/packages/core/src/components/controlSize.d.ts +13 -0
- package/dist/packages/core/src/components/controlSize.js +13 -0
- package/dist/packages/core/src/components/controlSizeContext.d.ts +17 -0
- package/dist/packages/core/src/components/controlSizeContext.js +8 -0
- package/dist/packages/core/src/version.d.ts +1 -1
- package/dist/packages/core/src/version.js +1 -1
- package/dist/utils.cjs.js +1 -1
- package/package.json +1 -1
|
@@ -292,6 +292,16 @@ export declare interface BadgeProps {
|
|
|
292
292
|
* - `soft` — 연한 배경
|
|
293
293
|
*/
|
|
294
294
|
fill?: BadgeFill;
|
|
295
|
+
/**
|
|
296
|
+
* **테두리 꼴(`fill="outline"`)이 바탕을 까는가** — 기본 `true`(말귀 청 (418), 사장님 지시 2026-11-12).
|
|
297
|
+
*
|
|
298
|
+
* 테두리 꼴은 원래 투명이었다. 로그인 창 「최근 로그인」 표가 단추 윗변에 걸쳐 앉아
|
|
299
|
+
* 위 절반엔 흰 바탕, 아래 절반엔 카카오 노랑이 비쳤고 노랑 위의 파란 글자가 안 읽혔다.
|
|
300
|
+
* 그래서 판·카드와 같은 바탕(`--color-white` — 밝은 꼴 흰색, 어두운 꼴은 카드 색)을 깐다.
|
|
301
|
+
* `false` 면 전처럼 투명하다. `Panel` 의 `useBg` 와 같은 이름 · 같은 뜻이다.
|
|
302
|
+
* 다른 꼴(`filled` · `soft`)에는 영향이 없다.
|
|
303
|
+
*/
|
|
304
|
+
useBg?: boolean;
|
|
295
305
|
/**
|
|
296
306
|
* 색 직접 지정 (bar 전용) — variant가 정하는 색을 덮는다.
|
|
297
307
|
* 토큰 이름('--color-sub')이나 CSS 색('#d97706') 둘 다 받는다.
|
|
@@ -1699,7 +1709,7 @@ export declare interface CodeBoxProps {
|
|
|
1699
1709
|
}
|
|
1700
1710
|
|
|
1701
1711
|
/** @public */
|
|
1702
|
-
export declare function ColorPicker({ value, onChange, palette, size, className, ariaLabel, }: ColorPickerProps): JSX.Element;
|
|
1712
|
+
export declare function ColorPicker({ value, onChange, palette, size: sizeProp, className, ariaLabel, }: ColorPickerProps): JSX.Element;
|
|
1703
1713
|
|
|
1704
1714
|
/** @public */
|
|
1705
1715
|
export declare interface ColorPickerProps {
|
|
@@ -2121,7 +2131,7 @@ export declare function copyText(text: string): Promise<boolean>;
|
|
|
2121
2131
|
*
|
|
2122
2132
|
* 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
|
|
2123
2133
|
*/
|
|
2124
|
-
export declare const CORE_VERSION = "0.
|
|
2134
|
+
export declare const CORE_VERSION = "0.436.0";
|
|
2125
2135
|
|
|
2126
2136
|
/** @public */
|
|
2127
2137
|
declare const coreDefault: Record<string, unknown>;
|
|
@@ -2355,7 +2365,7 @@ export declare function cx(...parts: (string | false | null | undefined)[]): str
|
|
|
2355
2365
|
|
|
2356
2366
|
export declare type DataLevel = 0 | 1 | 2 | 3;
|
|
2357
2367
|
|
|
2358
|
-
export declare function DatePicker({ value, onChange, size, min, max, disabled, placeholder: placeholderProp, className, today, ariaLabel, ariaLabelledBy, }: DatePickerProps): JSX.Element;
|
|
2368
|
+
export declare function DatePicker({ value, onChange, size: sizeProp, min, max, disabled, placeholder: placeholderProp, className, today, ariaLabel, ariaLabelledBy, }: DatePickerProps): JSX.Element;
|
|
2359
2369
|
|
|
2360
2370
|
/** @public */
|
|
2361
2371
|
export declare interface DatePickerProps {
|
|
@@ -2651,7 +2661,7 @@ export declare interface DraftItem<T> {
|
|
|
2651
2661
|
export declare function draftValues<T>(draft: readonly DraftItem<T>[]): T[];
|
|
2652
2662
|
|
|
2653
2663
|
/** @public */
|
|
2654
|
-
export declare function Dropdown({ options, value, onChange, placeholder, disabled, block, size, error, className, ariaLabel, ariaDescribedBy }: DropdownProps): JSX.Element;
|
|
2664
|
+
export declare function Dropdown({ options, value, onChange, placeholder, disabled, block, size: sizeProp, error, className, ariaLabel, ariaDescribedBy }: DropdownProps): JSX.Element;
|
|
2655
2665
|
|
|
2656
2666
|
export declare type DropdownItem = {
|
|
2657
2667
|
options: {
|
|
@@ -5282,7 +5292,7 @@ export declare interface PairStats {
|
|
|
5282
5292
|
total: number;
|
|
5283
5293
|
}
|
|
5284
5294
|
|
|
5285
|
-
export declare function Panel({ title, titleLevel, icon, disc, actions,
|
|
5295
|
+
export declare function Panel({ title, titleLevel, icon, disc, actions, minHeight, maxWidth, className, scrollable, scrollbarGutter, compactRows, useBorder, useBg, labelWidth, form, loading, empty, children }: PanelProps): JSX.Element;
|
|
5286
5296
|
|
|
5287
5297
|
/** @public */
|
|
5288
5298
|
export declare type PanelElement = HTMLDivElement & {
|
|
@@ -5333,8 +5343,6 @@ declare interface PanelProps {
|
|
|
5333
5343
|
*/
|
|
5334
5344
|
disc?: ReactNode;
|
|
5335
5345
|
actions?: ReactNode;
|
|
5336
|
-
/** 행 높이 스케일 — small 48 / medium 56 / large 64. 기본 medium */
|
|
5337
|
-
size?: PanelSize;
|
|
5338
5346
|
minHeight?: number | string;
|
|
5339
5347
|
maxWidth?: number | string;
|
|
5340
5348
|
className?: string;
|
|
@@ -5345,16 +5353,16 @@ declare interface PanelProps {
|
|
|
5345
5353
|
*/
|
|
5346
5354
|
scrollbarGutter?: 'auto' | 'stable';
|
|
5347
5355
|
/**
|
|
5348
|
-
* 행을 조금 낮춘다 — 최소 높이 46px·위아래 여백 3px.
|
|
5356
|
+
* 행을 조금 낮춘다 — 최소 높이 46px·위아래 여백 3px. 행 하나짜리 머리 없는 패널의
|
|
5349
5357
|
* **테두리까지 바깥 높이가 48px** 이라 옆의 48px 단추와 줄이 맞는다(공유 링크 칸 등). 머리 높이·라벨 급은 그대로.
|
|
5350
5358
|
*/
|
|
5351
5359
|
compactRows?: boolean;
|
|
5352
|
-
/** 외곽선 표시 여부. 기본 true
|
|
5360
|
+
/** 외곽선 표시 여부. 기본 true.
|
|
5361
|
+
* **끄면 줄 사이 선도 함께 꺼지고, 안의 조절칸은 48 이 된다**(사장님 지시 2026-11-12 — `useRowBorder` 를
|
|
5362
|
+
* 이것에 합쳤다: *"useRowBorder 이거 useborder로 합치고 제거해줘"*). 테두리 없는 판은 팝업 안 입력 양식이다. */
|
|
5353
5363
|
useBorder?: boolean;
|
|
5354
5364
|
/** 배경(카드 흰 배경) 표시 여부. 기본 true. false면 투명 배경으로 페이지에 녹아든다 */
|
|
5355
5365
|
useBg?: boolean;
|
|
5356
|
-
/** row 구분선 표시 여부. 기본 true */
|
|
5357
|
-
useRowBorder?: boolean;
|
|
5358
5366
|
/** PanelRow label 열 고정 너비 (예: 80, '6rem') */
|
|
5359
5367
|
labelWidth?: number | string;
|
|
5360
5368
|
/** 폼 레이아웃 — 모든 row를 라벨 고정폭(labelWidth, 기본 80px) grid로 정렬 */
|
|
@@ -5539,8 +5547,6 @@ export declare type PanelRowToggle = Base & {
|
|
|
5539
5547
|
onChange: (v: boolean) => void;
|
|
5540
5548
|
};
|
|
5541
5549
|
|
|
5542
|
-
declare type PanelSize = 'small' | 'medium' | 'large';
|
|
5543
|
-
|
|
5544
5550
|
/**
|
|
5545
5551
|
* 'YYYY-MM-DD' 날짜 전용 문자열(예: 서버가 KST 기준으로 집계해 내려주는 log_date)을
|
|
5546
5552
|
* 로컬 타임존 자정 Date로 파싱한다. new Date('YYYY-MM-DD')는 UTC 자정으로 해석되어,
|
|
@@ -8624,7 +8630,7 @@ export declare type TabItem = {
|
|
|
8624
8630
|
/** @public */
|
|
8625
8631
|
export declare function Table<T extends {
|
|
8626
8632
|
id?: string | number;
|
|
8627
|
-
}>({ fields: rawFields, sort: sortBinding, sortable, headerGroups, items: rawItems, renderRow, onRowClick, isRowClickable, onRowMouseEnter, onRowMouseLeave, onRowDragStart, onRowDragEnd, draggingId, gridTemplateColumns, mobileGridTemplateColumns, resizable, resizeMode, resizeStorageKey, refitOn,
|
|
8633
|
+
}>({ fields: rawFields, sort: sortBinding, sortable, headerGroups, items: rawItems, renderRow, onRowClick, isRowClickable, onRowMouseEnter, onRowMouseLeave, onRowDragStart, onRowDragEnd, draggingId, gridTemplateColumns, mobileGridTemplateColumns, resizable, resizeMode, resizeStorageKey, refitOn, title, icon, count, collapsed, onToggleCollapse, headerActions, empty, loading, dragOver, onDragOver, onDragLeave, onDrop, renderExpandedRow, expandedId, }: TableProps<T>): JSX.Element;
|
|
8628
8634
|
|
|
8629
8635
|
/**
|
|
8630
8636
|
* **다음에 쓸 표를 고른다.**
|
|
@@ -8934,8 +8940,6 @@ export declare type TableProps<T extends {
|
|
|
8934
8940
|
* 한 번에 다 오면 *왔나 안 왔나*(`? 1 : 0`)로 족하다.
|
|
8935
8941
|
*/
|
|
8936
8942
|
refitOn?: string | number;
|
|
8937
|
-
/** 높이 스케일 — Panel과 공유 (small 48 / medium 56 / large 64). header·row 모두 적용. 기본 small */
|
|
8938
|
-
size?: 'small' | 'medium' | 'large';
|
|
8939
8943
|
/** 테이블 상단 그룹 헤더 제목. 지정하면 .table-header 영역이 렌더됩니다. */
|
|
8940
8944
|
title?: ReactNode;
|
|
8941
8945
|
/**
|
|
@@ -9047,7 +9051,7 @@ export declare function tableTrends(records: readonly ScoreRecord[]): TableTrend
|
|
|
9047
9051
|
*
|
|
9048
9052
|
* @public
|
|
9049
9053
|
*/
|
|
9050
|
-
export declare function Tabs({ items, value, onChange, className, size }: TabsProps): JSX.Element;
|
|
9054
|
+
export declare function Tabs({ items, value, onChange, className, size: sizeProp }: TabsProps): JSX.Element;
|
|
9051
9055
|
|
|
9052
9056
|
/** 이 자가 보는 것은 **이것뿐이다** — 세션의 나머지는 알 필요가 없다 @public */
|
|
9053
9057
|
export declare interface TabSessionLike {
|
|
@@ -99,13 +99,19 @@
|
|
|
99
99
|
|
|
100
100
|
/* ── outline — transparent bg, variant color border + text ── */
|
|
101
101
|
.badge--outline {
|
|
102
|
-
|
|
102
|
+
/* 판·카드와 같은 바탕을 깐다(말귀 청 (418)) — 색이 깔린 자리(카카오 단추 윗변 따위)에 걸쳐
|
|
103
|
+
앉아도 글자가 제 바탕 위에서 읽힌다. `useBg={false}` 면 전처럼 투명(`.badge--no-bg`). */
|
|
104
|
+
background: var(--color-white);
|
|
103
105
|
/* 글자는 `--badge-ink`(없으면 면 색) — 어두운 꼴에서만 글자용으로 한 단 밝은 색을 쓴다(말귀 청 413 덧) */
|
|
104
106
|
color: var(--badge-ink, var(--badge-color));
|
|
105
107
|
border: 1px solid var(--badge-color);
|
|
106
108
|
box-shadow: none;
|
|
107
109
|
}
|
|
108
110
|
|
|
111
|
+
.badge--outline.badge--no-bg {
|
|
112
|
+
background: transparent;
|
|
113
|
+
}
|
|
114
|
+
|
|
109
115
|
/* ── soft — variant color text + 20% tinted bg ── */
|
|
110
116
|
.badge--soft {
|
|
111
117
|
background: color-mix(in srgb, var(--badge-color) 10%, transparent);
|
|
@@ -92,6 +92,16 @@ export interface BadgeProps {
|
|
|
92
92
|
* - `soft` — 연한 배경
|
|
93
93
|
*/
|
|
94
94
|
fill?: BadgeFill;
|
|
95
|
+
/**
|
|
96
|
+
* **테두리 꼴(`fill="outline"`)이 바탕을 까는가** — 기본 `true`(말귀 청 (418), 사장님 지시 2026-11-12).
|
|
97
|
+
*
|
|
98
|
+
* 테두리 꼴은 원래 투명이었다. 로그인 창 「최근 로그인」 표가 단추 윗변에 걸쳐 앉아
|
|
99
|
+
* 위 절반엔 흰 바탕, 아래 절반엔 카카오 노랑이 비쳤고 노랑 위의 파란 글자가 안 읽혔다.
|
|
100
|
+
* 그래서 판·카드와 같은 바탕(`--color-white` — 밝은 꼴 흰색, 어두운 꼴은 카드 색)을 깐다.
|
|
101
|
+
* `false` 면 전처럼 투명하다. `Panel` 의 `useBg` 와 같은 이름 · 같은 뜻이다.
|
|
102
|
+
* 다른 꼴(`filled` · `soft`)에는 영향이 없다.
|
|
103
|
+
*/
|
|
104
|
+
useBg?: boolean;
|
|
95
105
|
/**
|
|
96
106
|
* 색 직접 지정 (bar 전용) — variant가 정하는 색을 덮는다.
|
|
97
107
|
* 토큰 이름('--color-sub')이나 CSS 색('#d97706') 둘 다 받는다.
|
|
@@ -38,7 +38,7 @@ export default function Badge(props) {
|
|
|
38
38
|
'숨긴 것은 낭독기에 끼어들 수 없어 아무것도 안 읽힙니다 — 둘 중 하나만 주세요.');
|
|
39
39
|
}
|
|
40
40
|
// ── 그리기 — `dot`(알약) · `bar`(띠) 가 같은 색·같은 자를 쓴다 ───────────
|
|
41
|
-
const { label, children, variant = 'default', fill = 'filled', minWidth, iconLeft, iconRight, color } = props;
|
|
41
|
+
const { label, children, variant = 'default', fill = 'filled', useBg = true, minWidth, iconLeft, iconRight, color } = props;
|
|
42
42
|
/* 넓게 눕는 띠인가 — 아니면 작은 알약이다(기본) */
|
|
43
43
|
const isBand = type === 'bar';
|
|
44
44
|
// 문자열 크기만 쓴다 — 옛 원형의 숫자가 들어오면 기본값(medium)으로 떨어뜨린다.
|
|
@@ -53,7 +53,7 @@ export default function Badge(props) {
|
|
|
53
53
|
? { small: 'caption-2', medium: 'body-3', large: 'body-2' }
|
|
54
54
|
: { small: 'caption-2b', medium: 'body-3b', large: 'body-2b' })[barSize] ?? (isBand ? 'body-2' : 'body-2b');
|
|
55
55
|
const iconSize = { small: 12, medium: 14, large: 16 }[barSize] ?? 14;
|
|
56
|
-
const cls = cx('badge', isBand ? 'badge--bar' : '', `badge--${variant}`, `badge--${barSize}`, fill !== 'filled' ? `badge--${fill}` : '', sizeFont, className);
|
|
56
|
+
const cls = cx('badge', isBand ? 'badge--bar' : '', `badge--${variant}`, `badge--${barSize}`, fill !== 'filled' ? `badge--${fill}` : '', fill === 'outline' && !useBg ? 'badge--no-bg' : '', sizeFont, className);
|
|
57
57
|
// color는 variant가 정하는 --badge-color를 덮는다. 토큰 이름('--color-main')을 주면
|
|
58
58
|
// var()로 감싸 준다(Button의 color prop과 같은 규칙). filled/soft/outline 모두
|
|
59
59
|
// 이 변수 하나만 보므로 fill과 조합이 자유롭다.
|
|
@@ -6,8 +6,11 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
import './BulkBar.css';
|
|
7
7
|
import Button from './Button';
|
|
8
8
|
import Badge from './Badge';
|
|
9
|
+
import { useControlSize } from './controlSizeContext';
|
|
9
10
|
import { CONTROL_SIZE } from './controlSize';
|
|
10
11
|
export default function BulkBar({ count, actions, onClear, clearLabel: clearLabelProp, visible, content, max, }) {
|
|
12
|
+
// 둘레 판이 고른 조절칸 크기(테두리 없는 판 48 · 그 밖 40) — 청 (419), 2026-11-12
|
|
13
|
+
const ctrlSize = useControlSize() ?? CONTROL_SIZE;
|
|
11
14
|
const { t } = useTranslation();
|
|
12
15
|
const show = visible !== undefined ? visible : count > 0;
|
|
13
16
|
/* 기본 문구도 사전에서 — 예전에는 '선택 해제' 가 박혀 영어 화면에서도 한국어였다 */
|
|
@@ -101,5 +104,5 @@ export default function BulkBar({ count, actions, onClear, clearLabel: clearLabe
|
|
|
101
104
|
/* 보이는 것은 `3 / 20` 이지만 낭독기로는 **맨 숫자 둘**이라 뜻이 안 선다.
|
|
102
105
|
위 `role="status"` 가 고른 수는 말하는데 **천장(max)은 여기에만 있다**
|
|
103
106
|
(말귀 요청 ㊼ 를 받고 코어 안을 같은 눈으로 훑다가 나왔다). */
|
|
104
|
-
_jsx(Badge, { size: "small", fill: "soft", variant: "main", label: `${count} / ${max}`, "aria-label": t('common.selectedOfMax', { count, max, defaultValue: `최대 ${max}개 중 ${count}개` }) })), _jsxs("div", { className: `bulk-bar__actions${stacked ? ' bulk-bar__actions--stacked' : ''}`, children: [_jsx(Button, { htmlType: "button", size:
|
|
107
|
+
_jsx(Badge, { size: "small", fill: "soft", variant: "main", label: `${count} / ${max}`, "aria-label": t('common.selectedOfMax', { count, max, defaultValue: `최대 ${max}개 중 ${count}개` }) })), _jsxs("div", { className: `bulk-bar__actions${stacked ? ' bulk-bar__actions--stacked' : ''}`, children: [_jsx(Button, { htmlType: "button", size: ctrlSize, label: clearLabel, onClick: onClear }), actions.map((a, i) => (_jsx(Button, { htmlType: "button", size: ctrlSize, variant: a.variant ?? 'default', icon: a.icon, label: a.label, onClick: a.onClick }, i)))] })] }));
|
|
105
108
|
}
|
|
@@ -4,6 +4,7 @@ import { cx } from '../utils/cx';
|
|
|
4
4
|
import { devWarnOnce, isDev } from '../utils/devWarn';
|
|
5
5
|
import { forwardRef, useCallback, useEffect, useId, useRef, useState } from 'react';
|
|
6
6
|
import './Button.css';
|
|
7
|
+
import { useControlSize } from './controlSizeContext';
|
|
7
8
|
import Icon from './Icon';
|
|
8
9
|
import Loader from './Loader';
|
|
9
10
|
import InfoTooltip from "./Tooltip/InfoTooltip";
|
|
@@ -12,7 +13,11 @@ import { isTouchPointer, recentlyTouched, useTouchToggle } from '../hooks/touchT
|
|
|
12
13
|
/* **ref 는 forwardRef 로 받는다** — React 19 는 ref 를 props 로 넘기지만 peer 는 16.8~ 라, React 18(kscan) 에서는 함수 컴포넌트에 준
|
|
13
14
|
ref 가 버려진다. 게다가 전에는 안쪽 ref(`btnRef`)가 props 에서 온 ref 를 덮어써 19 에서도 부르는 쪽 ref 가 비었다. 두 ref 를 잇는다. */
|
|
14
15
|
function ButtonInner(props, forwardedRef) {
|
|
15
|
-
const { size
|
|
16
|
+
const { size: sizeProp, type: explicitType, htmlType, href, target, rel, icon, rightIcon, label: labelProp, count, subLabel, children, ariaLabel, variant = 'default', align = 'center', nowrap = false, ellipsis = false, selected, toggleable = false, ariaExpanded, ariaControls, disabled = false, loading = false, useLabel = true, useBorder = true, useBG = true, useDisabledCovered = false, useDisabledInvisible = false, useDisabledFilled = false, width, minWidth, onClick, onDisabledClick, showTooltipInfo = false, tooltipInfoText = null, tooltipDescription = null, tooltipOnly = false, iconSize = 'medium', iconColor, shape = 'rounded', color, className, ...rest } = props;
|
|
17
|
+
/* 안 주면 가장 가까운 판 · 표의 값(말귀 청 (419) 덧) — 테두리 없는 판 48 · 테두리 있는 판과 표 40.
|
|
18
|
+
판 · 표 밖이면 **본래 기본값 48** 그대로다(공용 수 40 을 쓰지 않는다 — 쪽 위 단추가 다 줄어든다). */
|
|
19
|
+
const inheritedSize = useControlSize();
|
|
20
|
+
const size = sizeProp ?? inheritedSize ?? 48;
|
|
16
21
|
const sizeKey = typeof size === 'string' && isNaN(Number(size))
|
|
17
22
|
? size.toLowerCase()
|
|
18
23
|
: String(Number(size) || 48);
|
|
@@ -17,4 +17,4 @@ export interface ColorPickerProps {
|
|
|
17
17
|
ariaLabel?: string;
|
|
18
18
|
}
|
|
19
19
|
/** @public */
|
|
20
|
-
export default function ColorPicker({ value, onChange, palette, size, className, ariaLabel, }: ColorPickerProps): import("react").JSX.Element;
|
|
20
|
+
export default function ColorPicker({ value, onChange, palette, size: sizeProp, className, ariaLabel, }: ColorPickerProps): import("react").JSX.Element;
|
|
@@ -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 { useControlSize } from './controlSizeContext';
|
|
6
7
|
import { CONTROL_SIZE } from './controlSize';
|
|
7
8
|
const CHECK_ICON_SIZE = 20;
|
|
8
9
|
const DEFAULT_PALETTE = [
|
|
@@ -15,7 +16,10 @@ const DEFAULT_PALETTE = [
|
|
|
15
16
|
'#bfc7d1', // disabled
|
|
16
17
|
];
|
|
17
18
|
/** @public */
|
|
18
|
-
export default function ColorPicker({ value, onChange, palette = DEFAULT_PALETTE, size
|
|
19
|
+
export default function ColorPicker({ value, onChange, palette = DEFAULT_PALETTE, size: sizeProp, className = '', ariaLabel, }) {
|
|
20
|
+
// 안 주면 가장 가까운 판 · 표의 값(청 (419)) — 그 밖이면 공용 수 `CONTROL_SIZE`(40)
|
|
21
|
+
const inheritedSize = useControlSize();
|
|
22
|
+
const size = sizeProp ?? inheritedSize ?? CONTROL_SIZE;
|
|
19
23
|
const { t } = useTranslation();
|
|
20
24
|
return (
|
|
21
25
|
/* role="group" 은 이름이 없으면 낭독기가 묶음을 알리지 않는다 — 이름을 받는다 */
|
|
@@ -67,7 +67,7 @@ export default function ConsentRecordPopup({ takenKinds, busy, today, onClose, o
|
|
|
67
67
|
kinds, method, source,
|
|
68
68
|
consentedAt: day || null,
|
|
69
69
|
note: note.trim() || null,
|
|
70
|
-
}) })), children: _jsxs(Panel, { useBorder: false,
|
|
70
|
+
}) })), children: _jsxs(Panel, { useBorder: false, labelWidth: 96, children: [_jsx(PanelRow, { variant: "custom", useFullWidth: true, label: t('customers.consent.kinds', '받은 갈래'), children: _jsxs("div", { className: "consent-record-popup__kinds", children: [pickable.map(k => (_jsx(Checkbox, { checked: kinds.includes(k), disabled: busy, label: kindLabel[k], onChange: on => setKinds(was => on ? [...was, k] : was.filter(x => x !== k)) }, k))), pickable.length === 0 && (_jsx("p", { className: "body-3 consent-record-popup__none", children: t('customers.consent.allTaken', '세 갈래를 이미 다 받았습니다. 다시 받으려면 먼저 철회하세요.') }))] }) }), _jsx(PanelRow, { variant: "custom", useFullWidth: true, label: t('customers.consent.methodTitle', '받은 방법'), children: _jsx(SegmentedControl, { size: 40, fullWidth: true, ariaLabel: t('customers.consent.methodTitle', '받은 방법'), options: [
|
|
71
71
|
{ key: 'paper', label: t('customers.consent.method.paper', '서면') },
|
|
72
72
|
{ key: 'verbal', label: t('customers.consent.method.verbal', '구두') },
|
|
73
73
|
{ key: 'electronic', label: t('customers.consent.method.electronic', '전자') },
|
|
@@ -40,4 +40,4 @@ export interface DatePickerProps {
|
|
|
40
40
|
/** 눈에 보이는 이름표의 `id` — 그 글자가 이 칸의 이름이 된다(`ariaLabel` 대신 쓴다) */
|
|
41
41
|
ariaLabelledBy?: string;
|
|
42
42
|
}
|
|
43
|
-
export default function DatePicker({ value, onChange, size, min, max, disabled, placeholder: placeholderProp, className, today, ariaLabel, ariaLabelledBy, }: DatePickerProps): import("react").JSX.Element;
|
|
43
|
+
export default function DatePicker({ value, onChange, size: sizeProp, min, max, disabled, placeholder: placeholderProp, className, today, ariaLabel, ariaLabelledBy, }: DatePickerProps): import("react").JSX.Element;
|
|
@@ -19,6 +19,7 @@ import { useAnchoredMenu, anchoredMenuZIndex } from '../hooks/useAnchoredMenu';
|
|
|
19
19
|
import { useCalendarMonth } from './useCalendarMonth';
|
|
20
20
|
import { FOCUSABLE_SELECTOR } from '../hooks/useFocusTrap';
|
|
21
21
|
import './DatePicker.css';
|
|
22
|
+
import { useControlSize } from './controlSizeContext';
|
|
22
23
|
import { CONTROL_SIZE } from './controlSize';
|
|
23
24
|
function daysInMonth(y, m) { return new Date(y, m + 1, 0).getDate(); }
|
|
24
25
|
function firstDay(y, m) { return new Date(y, m, 1).getDay(); }
|
|
@@ -99,7 +100,10 @@ function monthOptions(year, label, min, max) {
|
|
|
99
100
|
}
|
|
100
101
|
return opts;
|
|
101
102
|
}
|
|
102
|
-
export default function DatePicker({ value, onChange, size
|
|
103
|
+
export default function DatePicker({ value, onChange, size: sizeProp, min, max, disabled, placeholder: placeholderProp, className, today, ariaLabel, ariaLabelledBy, }) {
|
|
104
|
+
// 안 주면 가장 가까운 판 · 표의 값(청 (419)) — 그 밖이면 공용 수 `CONTROL_SIZE`(40)
|
|
105
|
+
const inheritedSize = useControlSize();
|
|
106
|
+
const size = sizeProp ?? inheritedSize ?? CONTROL_SIZE;
|
|
103
107
|
/* **이름 없는 날짜 칸은 "편집, 비어 있음" 으로만 읽힌다.** `placeholder` 는 이름이
|
|
104
108
|
아니다 — 값이 들어오면 사라진다. `TextField`·`Slider` 가 같은 자리에서 같게 알린다. */
|
|
105
109
|
if (!ariaLabel && !ariaLabelledBy) {
|
|
@@ -32,4 +32,4 @@ export interface DropdownProps {
|
|
|
32
32
|
ariaDescribedBy?: string;
|
|
33
33
|
}
|
|
34
34
|
/** @public */
|
|
35
|
-
export default function Dropdown({ options, value, onChange, placeholder, disabled, block, size, error, className, ariaLabel, ariaDescribedBy }: DropdownProps): import("react").JSX.Element;
|
|
35
|
+
export default function Dropdown({ options, value, onChange, placeholder, disabled, block, size: sizeProp, error, className, ariaLabel, ariaDescribedBy }: DropdownProps): import("react").JSX.Element;
|
|
@@ -3,12 +3,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { cx } from '../utils/cx';
|
|
4
4
|
import { useCallback, useEffect, useId, useRef, useState } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
|
+
import { useControlSize } from './controlSizeContext';
|
|
6
7
|
import { CONTROL_SIZE } from './controlSize';
|
|
7
8
|
import { useTranslation } from 'react-i18next';
|
|
8
9
|
import { useAnchoredMenu, anchoredMenuZIndex } from '../hooks/useAnchoredMenu';
|
|
9
10
|
import './Dropdown.css';
|
|
10
11
|
/** @public */
|
|
11
|
-
export default function Dropdown({ options, value, onChange, placeholder, disabled = false, block = false, size
|
|
12
|
+
export default function Dropdown({ options, value, onChange, placeholder, disabled = false, block = false, size: sizeProp, error = false, className = '', ariaLabel, ariaDescribedBy }) {
|
|
13
|
+
// 안 주면 가장 가까운 판 · 표의 값(청 (419)) — 그 밖이면 공용 수 `CONTROL_SIZE`(40)
|
|
14
|
+
const inheritedSize = useControlSize();
|
|
15
|
+
const size = sizeProp ?? inheritedSize ?? CONTROL_SIZE;
|
|
12
16
|
const { t } = useTranslation();
|
|
13
17
|
const resolvedPlaceholder = placeholder ?? t('dropdown.placeholder', '선택');
|
|
14
18
|
const listId = useId();
|
|
@@ -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 { useControlSize } from './controlSizeContext';
|
|
11
12
|
import { CONTROL_SIZE } from './controlSize';
|
|
12
13
|
export { FILTER_ALL_VALUE } from '../types/filterPanel';
|
|
13
14
|
import { FILTER_ALL_VALUE } from '../types/filterPanel';
|
|
@@ -16,6 +17,8 @@ import { devWarnOnce } from '../utils/devWarn';
|
|
|
16
17
|
import { buildFilterSummary } from '../utils/filterPanelSummary';
|
|
17
18
|
/** @public */
|
|
18
19
|
export default function FilterPanel({ title, titleLevel = 2, headerAction, headerSummary, collapsible = false, defaultCollapsed = false, collapsed: controlledCollapsed, onCollapsedChange, footer, sections, selected = {}, onSelect, align, sectionAlign, className, }) {
|
|
20
|
+
// 둘레 판이 고른 조절칸 크기(테두리 없는 판 48 · 그 밖 40) — 청 (419), 2026-11-12
|
|
21
|
+
const ctrlSize = useControlSize() ?? CONTROL_SIZE;
|
|
19
22
|
// align 우선. 없으면 구 prop(sectionAlign) 매핑, 그것도 없으면 inline 기본.
|
|
20
23
|
const isRow = (align ?? (sectionAlign === 'vertical' ? 'newline' : sectionAlign === 'horizontal' ? 'inline' : 'inline')) === 'inline';
|
|
21
24
|
const { t } = useTranslation();
|
|
@@ -55,7 +58,7 @@ export default function FilterPanel({ title, titleLevel = 2, headerAction, heade
|
|
|
55
58
|
안 잡혀, 셋이 나란히 서도 "지금 어느 판 안인지" 를 알 길이 없었다 — (51)·(54) 에서
|
|
56
59
|
`ChartSection`·`TrainingCardGroup` 에 한 것과 같은 자다.
|
|
57
60
|
**글자 제목일 때만 건다** — 마디를 가리키므로 글이 아닌 제목이면 이름이 안 선다. */
|
|
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:
|
|
61
|
+
_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: ctrlSize, type: "dot", variant: "transparent-gray", useBorder: false, icon: collapsed ? 'chevron-down' : 'chevron-up',
|
|
59
62
|
/* Button은 aria-label을 자기 ariaLabel prop으로 덮어쓴다({...rest} 뒤에
|
|
60
63
|
aria-label={ariaLabelString}을 다시 쓴다) — kebab으로 넘기면 undefined가
|
|
61
64
|
되어 이름이 통째로 사라진다. 저장소의 다른 호출부는 모두 ariaLabel을 쓴다.
|
|
@@ -153,7 +156,7 @@ export default function FilterPanel({ title, titleLevel = 2, headerAction, heade
|
|
|
153
156
|
달랐다. 2026-10-29 에 `PanelRow` 에서 겪은 것과 같은 흠이다 — 손으로 적는
|
|
154
157
|
자리가 여럿이면 하나가 빠진다. 그래서 공용 수를 쓴다.
|
|
155
158
|
*/
|
|
156
|
-
ariaLabel: typeof section.label === 'string' ? section.label : undefined, size:
|
|
159
|
+
ariaLabel: typeof section.label === 'string' ? section.label : undefined, size: ctrlSize, options: [
|
|
157
160
|
...(section.allOption ? [{ value: FILTER_ALL_VALUE, label: section.allLabel ?? t('common.all', '전체'), disabled: section.allOptionDisabled }] : []),
|
|
158
161
|
...items.map(item => {
|
|
159
162
|
const value = typeof item === 'string' ? item : item.value;
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
padding-left: 0;
|
|
32
32
|
padding-right: 0;
|
|
33
33
|
}
|
|
34
|
-
/* row 구분선 제거 */
|
|
35
|
-
.panel--no-
|
|
34
|
+
/* row 구분선 제거 — 테두리를 끄면 함께 꺼진다(2026-11-12, `useRowBorder` 를 `useBorder` 에 합쳤다) */
|
|
35
|
+
.panel--no-border .panel-row + .panel-row {
|
|
36
36
|
border-top: none;
|
|
37
37
|
}
|
|
38
38
|
.panel__header {
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
.panel__header:last-child {
|
|
51
51
|
border-bottom: none;
|
|
52
52
|
}
|
|
53
|
-
/*
|
|
54
|
-
.
|
|
55
|
-
|
|
56
|
-
.panel
|
|
53
|
+
/* 높이는 **한 급뿐이다 — 안쪽 56, 밑선은 그 밖에 1**(사장님 지시 2026-11-12: *"모두 medium 하나로
|
|
54
|
+
정리. size prop 제거"* · *"선까지 56이면 내부가 55인데 홀수가 되버리잖아"*). small 48 · large 64 를
|
|
55
|
+
두었는데 판마다 급이 달라 한 화면에 줄 높이가 섞였다. 줄(`.panel-row`)과 같은 셈 — `content-box`. */
|
|
56
|
+
.panel .panel__header { min-height: 56px; box-sizing: content-box; }
|
|
57
57
|
/* 제목 앞 아이콘 — Section 과 같은 크기·같은 색. 제목·설명 묶음 밖에 서므로
|
|
58
58
|
설명도 제목 글자와 같은 왼쪽 선에서 시작한다. */
|
|
59
59
|
.panel__icon {
|
|
@@ -110,12 +110,14 @@
|
|
|
110
110
|
padding: 4px 20px; /* 좌우 20 / 상하 4 통일. 실제 행 높이는 min-height(size)가 결정 */
|
|
111
111
|
box-sizing: border-box;
|
|
112
112
|
}
|
|
113
|
-
/*
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
/* **줄 안쪽은 56, 구분선은 그 밖에 1**(사장님 지시 2026-11-12).
|
|
114
|
+
전에는 `border-box` 로 56 안에 선까지 넣어, 선 있는 줄은 글자만 있으면 안쪽이 55(홀수)이고
|
|
115
|
+
48 칸이 들면 4 + 48 + 4 + 1 = 57 로 자라 줄마다 달랐다. 그래서 키를 **선 밖에서** 잰다 —
|
|
116
|
+
`content-box` 로 안쪽 최소 48 + 위아래 여백 4·4 = 56, 선이 있으면 그 아래 1 이 더해진다.
|
|
117
|
+
폭은 `auto` 라 `content-box` 가 넘치지 않는다. */
|
|
118
|
+
.panel .panel-row { min-height: 48px; box-sizing: content-box; }
|
|
117
119
|
/* compactRows — 크기 규칙 **뒤에** 둬야 같은 특이도로 이긴다 */
|
|
118
|
-
.panel--compact-rows .panel-row { min-height:
|
|
120
|
+
.panel--compact-rows .panel-row { min-height: 40px; padding-top: 3px; padding-bottom: 3px; } /* 안쪽 40 + 3·3 = 46 (content-box) */
|
|
119
121
|
/* 인접한 row 사이에만 구분선 (첫/끝 처리 불필요) */
|
|
120
122
|
.panel-row + .panel-row {
|
|
121
123
|
border-top: 1px solid var(--color-darkWhite);
|
|
@@ -127,7 +129,7 @@
|
|
|
127
129
|
.panel--fill .panel-row + .panel-row {
|
|
128
130
|
border-top: none;
|
|
129
131
|
}
|
|
130
|
-
.panel--no-
|
|
132
|
+
.panel--no-border .panel-row {
|
|
131
133
|
border-bottom: none;
|
|
132
134
|
}
|
|
133
135
|
/* 비-row 콘텐츠(stats 등) 다음에 오는 첫 row — 구분선만 제거 */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ReactNode, type CSSProperties } from 'react';
|
|
2
2
|
import './Panel.css';
|
|
3
|
-
type PanelSize = 'small' | 'medium' | 'large';
|
|
4
3
|
interface PanelProps {
|
|
5
4
|
/** 제목을 **머리글 몇 급**으로 그릴지(말귀 요청 (59), 2026-10-02).
|
|
6
5
|
*
|
|
@@ -30,8 +29,6 @@ interface PanelProps {
|
|
|
30
29
|
*/
|
|
31
30
|
disc?: ReactNode;
|
|
32
31
|
actions?: ReactNode;
|
|
33
|
-
/** 행 높이 스케일 — small 48 / medium 56 / large 64. 기본 medium */
|
|
34
|
-
size?: PanelSize;
|
|
35
32
|
minHeight?: number | string;
|
|
36
33
|
maxWidth?: number | string;
|
|
37
34
|
className?: string;
|
|
@@ -42,16 +39,16 @@ interface PanelProps {
|
|
|
42
39
|
*/
|
|
43
40
|
scrollbarGutter?: 'auto' | 'stable';
|
|
44
41
|
/**
|
|
45
|
-
* 행을 조금 낮춘다 — 최소 높이 46px·위아래 여백 3px.
|
|
42
|
+
* 행을 조금 낮춘다 — 최소 높이 46px·위아래 여백 3px. 행 하나짜리 머리 없는 패널의
|
|
46
43
|
* **테두리까지 바깥 높이가 48px** 이라 옆의 48px 단추와 줄이 맞는다(공유 링크 칸 등). 머리 높이·라벨 급은 그대로.
|
|
47
44
|
*/
|
|
48
45
|
compactRows?: boolean;
|
|
49
|
-
/** 외곽선 표시 여부. 기본 true
|
|
46
|
+
/** 외곽선 표시 여부. 기본 true.
|
|
47
|
+
* **끄면 줄 사이 선도 함께 꺼지고, 안의 조절칸은 48 이 된다**(사장님 지시 2026-11-12 — `useRowBorder` 를
|
|
48
|
+
* 이것에 합쳤다: *"useRowBorder 이거 useborder로 합치고 제거해줘"*). 테두리 없는 판은 팝업 안 입력 양식이다. */
|
|
50
49
|
useBorder?: boolean;
|
|
51
50
|
/** 배경(카드 흰 배경) 표시 여부. 기본 true. false면 투명 배경으로 페이지에 녹아든다 */
|
|
52
51
|
useBg?: boolean;
|
|
53
|
-
/** row 구분선 표시 여부. 기본 true */
|
|
54
|
-
useRowBorder?: boolean;
|
|
55
52
|
/** PanelRow label 열 고정 너비 (예: 80, '6rem') */
|
|
56
53
|
labelWidth?: number | string;
|
|
57
54
|
/** 폼 레이아웃 — 모든 row를 라벨 고정폭(labelWidth, 기본 80px) grid로 정렬 */
|
|
@@ -62,7 +59,7 @@ interface PanelProps {
|
|
|
62
59
|
empty?: ReactNode;
|
|
63
60
|
children?: ReactNode;
|
|
64
61
|
}
|
|
65
|
-
export default function Panel({ title, titleLevel, icon, disc, actions,
|
|
62
|
+
export default function Panel({ title, titleLevel, icon, disc, actions, minHeight, maxWidth, className, scrollable, scrollbarGutter, compactRows, useBorder, useBg, labelWidth, form, loading, empty, children }: PanelProps): import("react").JSX.Element;
|
|
66
63
|
/** @public */
|
|
67
64
|
export declare function PanelGrid({ cols, layout, gap, collapseAt, className, style, children, }: {
|
|
68
65
|
cols?: number;
|
|
@@ -4,11 +4,13 @@ import { cx } from '../utils/cx';
|
|
|
4
4
|
import { PanelRow } from './PanelRow';
|
|
5
5
|
import { Children, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import Icon from './Icon';
|
|
7
|
+
import { ControlSizeContext } from './controlSizeContext';
|
|
8
|
+
import { CONTROL_SIZE } from './controlSize';
|
|
7
9
|
import './Panel.css';
|
|
8
|
-
export default function Panel({ title, titleLevel = 2, icon, disc, actions,
|
|
9
|
-
const cls = cx('panel',
|
|
10
|
+
export default function Panel({ title, titleLevel = 2, icon, disc, actions, minHeight, maxWidth, className, scrollable, scrollbarGutter = 'auto', compactRows = false, useBorder = true, useBg = true, labelWidth, form = false, loading, empty, children }) {
|
|
11
|
+
const cls = cx('panel', form ? 'panel--form' : '',
|
|
10
12
|
/* minHeight 패널은 마지막 행 아래 빈 공간이 생길 수 있으므로 행 하단 구분선 사용 */
|
|
11
|
-
minHeight !== undefined ? 'panel--fill' : '', !useBorder ? 'panel--no-border' : '', !useBg ? 'panel--no-bg' : '',
|
|
13
|
+
minHeight !== undefined ? 'panel--fill' : '', !useBorder ? 'panel--no-border' : '', !useBg ? 'panel--no-bg' : '', compactRows ? 'panel--compact-rows' : '', className);
|
|
12
14
|
const style = {};
|
|
13
15
|
if (minHeight !== undefined)
|
|
14
16
|
style.minHeight = minHeight;
|
|
@@ -17,9 +19,17 @@ export default function Panel({ title, titleLevel = 2, icon, disc, actions, size
|
|
|
17
19
|
if (labelWidth !== undefined)
|
|
18
20
|
style['--panel-label-width'] = typeof labelWidth === 'number' ? `${labelWidth}px` : labelWidth;
|
|
19
21
|
const TitleTag = titleLevel ? `h${titleLevel}` : 'div';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
/* **판 안 조절칸의 크기는 테두리가 정한다**(사장님 지시 2026-11-12, 말귀 청 (419)):
|
|
23
|
+
*"sizecontrol 제거하고 useborder false = 48, useborder true = 40"*.
|
|
24
|
+
테두리 없는 판은 팝업 안 입력 양식이라 칸이 선 없이 떠 있어 48 이 맞고, 테두리 있는 판은
|
|
25
|
+
카드 목록이라 40 으로 촘촘하다. 줄 안의 칸 · 머리 `actions` 까지 이 값을 따르고, 칸이 제
|
|
26
|
+
`size` 를 주면 그것이 이긴다. 판 안의 판은 가장 가까운 판의 테두리를 따른다. */
|
|
27
|
+
const panelControlSize = useBorder ? CONTROL_SIZE : 48;
|
|
28
|
+
return (
|
|
29
|
+
// 머리의 `actions` 까지 감싼다 — 한 판 안의 조절칸은 한 크기다
|
|
30
|
+
_jsx(ControlSizeContext.Provider, { value: panelControlSize, children: _jsxs("div", { className: cls, style: Object.keys(style).length ? style : undefined, children: [(!!title || disc != null) && (_jsxs("div", { className: cx('panel__header', disc != null ? 'panel__header--with-disc' : ''), children: [icon && (_jsx(Icon, { icon: icon, label: typeof title === 'string' ? title : undefined, className: "panel__icon" })), _jsxs("div", { className: "panel__title-group", children: [!!title && (_jsx(TitleTag, { className: `panel__title ${disc != null ? 'body-3b' : 'h5b'}`, children: title })), disc != null && _jsx("p", { className: "panel__disc caption-1", children: disc })] }), actions && _jsx("div", { className: "panel__actions", children: actions })] })), loading ? (_jsx(PanelRow, { variant: "loading" })
|
|
31
|
+
/* 비었는지는 React 가 그리는 것으로 센다 — `{조건 && 행들}` 이 false 면 children 이 false 라 빈 상태 문구가 안 떴다 */
|
|
32
|
+
) : empty != null && Children.toArray(children).length === 0 ? (_jsx(PanelRow, { variant: "empty", children: empty })) : scrollable ? (_jsx("div", { className: cx('panel__body--scroll', scrollbarGutter === 'stable' && 'panel__body--gutter-stable'), children: children })) : children] }) }));
|
|
23
33
|
}
|
|
24
34
|
// ── PanelGrid ──────────────────────────────────────────────────────────────
|
|
25
35
|
/** @public */
|
|
@@ -12,6 +12,7 @@ import { deviceKindVariant, deviceKindLabel } from '../utils/deviceKind';
|
|
|
12
12
|
import { formatWornDate } from '../utils/wornDate';
|
|
13
13
|
import TextField from './TextField';
|
|
14
14
|
import Loader from './Loader';
|
|
15
|
+
import { useControlSize } from './controlSizeContext';
|
|
15
16
|
import { CONTROL_SIZE } from './controlSize';
|
|
16
17
|
import './Panel.css';
|
|
17
18
|
const noop = () => { };
|
|
@@ -19,6 +20,9 @@ export function PanelRow(props) {
|
|
|
19
20
|
// toggle 행의 라벨-스위치 연결용 id — 모든 variant에서 훅 호출 순서를 유지하기 위해
|
|
20
21
|
// 조건부 return들보다 앞에서 무조건 호출한다 (사용하지 않는 variant에서는 그냥 버려짐)
|
|
21
22
|
const uid = useId();
|
|
23
|
+
// 판이 내려 준 조절칸 크기(청 (419)) — 테두리 없는 판 48 · 있는 판 40, 판 밖이면 공용 수 `CONTROL_SIZE`(40).
|
|
24
|
+
// 줄이 제 값(`size`·`btnSize`)을 주면 그것이 이긴다. 훅이라 조건부 return 들보다 앞에 둔다.
|
|
25
|
+
const rowSize = useControlSize() ?? CONTROL_SIZE;
|
|
22
26
|
// children 기반 하위 호환 모드
|
|
23
27
|
if (!('variant' in props)) {
|
|
24
28
|
const { label, sub, onClick, children, align = 'horizontal', icon, useFullWidth = false, required = false } = props;
|
|
@@ -78,27 +82,27 @@ export function PanelRow(props) {
|
|
|
78
82
|
const p = props;
|
|
79
83
|
// dropdown 행과 동일하게, PanelRow 왼쪽 라벨은 <label htmlFor>가 아닌 일반 div라서
|
|
80
84
|
// SegmentedControl에 ariaLabel로 넘겨야 스크린리더가 이름 없는 라디오그룹으로 안내하지 않는다.
|
|
81
|
-
right = _jsx(SegmentedControl, { options: p.options, value: p.value, onChange: p.onChange, size: p.size ??
|
|
85
|
+
right = _jsx(SegmentedControl, { options: p.options, value: p.value, onChange: p.onChange, size: p.size ?? rowSize, ariaLabel: label });
|
|
82
86
|
}
|
|
83
87
|
else if (variant === 'dropdown') {
|
|
84
88
|
const p = props;
|
|
85
|
-
const dropdowns = p.dropdowns?.length ? (_jsx("div", { className: `panel-row__dropdown-group${useFullWidth ? ' panel-row__dropdown-group--full' : ''}`, children: p.dropdowns.map((d, i) => (_jsx("div", { className: useFullWidth ? 'panel-row__dropdown-item--full' : undefined, children: _jsx(Dropdown, { options: d.options, value: d.value, onChange: d.onChange, size:
|
|
89
|
+
const dropdowns = p.dropdowns?.length ? (_jsx("div", { className: `panel-row__dropdown-group${useFullWidth ? ' panel-row__dropdown-group--full' : ''}`, children: p.dropdowns.map((d, i) => (_jsx("div", { className: useFullWidth ? 'panel-row__dropdown-item--full' : undefined, children: _jsx(Dropdown, { options: d.options, value: d.value, onChange: d.onChange, size: rowSize, placeholder: d.placeholder, block: useFullWidth, error: !!error, ariaDescribedBy: errorId,
|
|
86
90
|
// 한 행에 여러 개가 놓이므로 행 라벨만 넘기면 셋 다 "생년월일" 이라는 같은 이름이 된다.
|
|
87
91
|
// aria-label 이 있으면 스크린리더는 트리거의 화면 텍스트(년/월/일)를 읽지 않으므로
|
|
88
92
|
// 사용자는 어느 것이 무엇인지 구별할 수 없다 — placeholder 를 붙여 구별되게 한다.
|
|
89
93
|
ariaLabel: d.ariaLabel ?? ([label, d.placeholder].filter(Boolean).join(' ') || undefined) }) }, i))) })) : (
|
|
90
94
|
// PanelRow 왼쪽 라벨(panel-row__label)은 <label htmlFor>가 아니라 그냥 div라서 트리거 버튼과
|
|
91
95
|
// 프로그래밍적으로 연결되지 않는다 — ariaLabel로 직접 이름을 넘긴다 (TextField의 ariaLabel과 동일 패턴)
|
|
92
|
-
_jsx(Dropdown, { options: p.options ?? [], value: p.value ?? '', onChange: p.onChange ?? noop, size:
|
|
96
|
+
_jsx(Dropdown, { options: p.options ?? [], value: p.value ?? '', onChange: p.onChange ?? noop, size: rowSize, block: useFullWidth, error: !!error, ariaLabel: label, ariaDescribedBy: errorId }));
|
|
93
97
|
right = error ? (_jsxs("div", { className: `panel-row__dropdown-error-wrap${useFullWidth ? ' panel-row__dropdown-error-wrap--full' : ''}`, children: [dropdowns, _jsx("span", { id: errorId, className: "caption-1 panel-row__error", role: "alert", children: error })] })) : dropdowns;
|
|
94
98
|
}
|
|
95
99
|
else if (variant === 'button') {
|
|
96
100
|
const p = props;
|
|
97
101
|
if (p.buttons?.length) {
|
|
98
|
-
right = (_jsx("div", { className: "panel-row__button-group", children: p.buttons.map((btn, i) => (_jsx(Button, { htmlType: "button", size: btn.btnSize ??
|
|
102
|
+
right = (_jsx("div", { className: "panel-row__button-group", children: p.buttons.map((btn, i) => (_jsx(Button, { htmlType: "button", size: btn.btnSize ?? rowSize, variant: btn.btnVariant ?? 'default', disabled: btn.disabled, onClick: btn.onClick, children: btn.label }, i))) }));
|
|
99
103
|
}
|
|
100
104
|
else {
|
|
101
|
-
right = (_jsx(Button, { htmlType: "button", size: p.btnSize ??
|
|
105
|
+
right = (_jsx(Button, { htmlType: "button", size: p.btnSize ?? rowSize, variant: p.btnVariant ?? 'default', disabled: p.disabled, onClick: p.onClick, children: p.buttonLabel }));
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
108
|
else if (variant === 'text') {
|
|
@@ -107,7 +111,7 @@ export function PanelRow(props) {
|
|
|
107
111
|
}
|
|
108
112
|
else if (variant === 'input') {
|
|
109
113
|
const p = props;
|
|
110
|
-
right = (_jsxs("div", { className: `panel-row__input-wrap${useFullWidth ? ' panel-row__input-wrap--full' : ''}`, children: [_jsx(TextField, { size:
|
|
114
|
+
right = (_jsxs("div", { className: `panel-row__input-wrap${useFullWidth ? ' panel-row__input-wrap--full' : ''}`, children: [_jsx(TextField, { size: rowSize, value: p.value, onChange: p.onChange ?? noop, onKeyDown: p.onKeyDown, onEnter: p.onEnter, placeholder: p.placeholder, ghostText: p.ghostText, inputMode: p.inputMode, readOnly: p.readOnly, disabled: p.disabled, type: p.type, autoComplete: p.autoComplete, maxLength: p.maxLength, showCount: p.showCount, multiline: p.multiline, rows: p.rows, fullWidth: useFullWidth, error: error, ariaLabel: label, required: required, ariaDescribedBy: p.helperText ? helperId : undefined }), p.helperText && _jsx("div", { id: helperId, className: "panel-row__helper caption-1", children: p.helperText })] }));
|
|
111
115
|
}
|
|
112
116
|
else if (variant === 'custom') {
|
|
113
117
|
const p = props;
|
|
@@ -99,7 +99,7 @@ export default function ListPopup(props) {
|
|
|
99
99
|
sortDir: col.sortable !== false && sortKey === col.key ? (sortAsc ? 'asc' : 'desc') : null,
|
|
100
100
|
})), [columns, sortKey, sortAsc, handleSort]);
|
|
101
101
|
const pageSizeOpts = useMemo(() => pageSizeOptions.map(n => ({ value: String(n), label: t('common.pageSizeLabel', { n }) })), [pageSizeOptions, t]);
|
|
102
|
-
return (_jsxs(Popup, { className: `popup-list ${className}`, title: title, onClose: onClose, children: [topContent, 'label' in countParts && _jsx("p", { className: "toolbar__count body-1", children: countParts.label }), _jsx(Toolbar, { count: 'label' in countParts ? undefined : { value: filtered.length, prefix: countParts.prefix, suffix: countParts.suffix }, search: searchEnabled ? { value: search, onChange: setSearch, placeholder: resolvedSearchPlaceholder } : undefined, pageSize: { options: pageSizeOpts, value: pageSize, onChange: setPageSize }, pagination: { page: clampedPage, total: totalPages, onChange: setPage } }), _jsx(Table, {
|
|
102
|
+
return (_jsxs(Popup, { className: `popup-list ${className}`, title: title, onClose: onClose, children: [topContent, 'label' in countParts && _jsx("p", { className: "toolbar__count body-1", children: countParts.label }), _jsx(Toolbar, { count: 'label' in countParts ? undefined : { value: filtered.length, prefix: countParts.prefix, suffix: countParts.suffix }, search: searchEnabled ? { value: search, onChange: setSearch, placeholder: resolvedSearchPlaceholder } : undefined, pageSize: { options: pageSizeOpts, value: pageSize, onChange: setPageSize }, pagination: { page: clampedPage, total: totalPages, onChange: setPage } }), _jsx(Table, { gridTemplateColumns: gridTemplateColumns, mobileGridTemplateColumns: mobileGridTemplateColumns,
|
|
103
103
|
/* 폭 조절은 켜고, 저장 열쇠는 **부르는 쪽이 고른다**((306), 2026-10-14).
|
|
104
104
|
|
|
105
105
|
한때 여기서 **일부러 안 줬다** — *"창은 열 때마다 새로 짓는 것이라 폭이 따라다니면
|
|
@@ -61,5 +61,5 @@ export default function SaveTablePopup({ title, saveLabel, defaultName = '', def
|
|
|
61
61
|
transform: `scale(${previewState.scale})`,
|
|
62
62
|
top: previewState.offsetY,
|
|
63
63
|
left: previewState.offsetX,
|
|
64
|
-
}, children: preview }) })), _jsxs(Panel, {
|
|
64
|
+
}, children: preview }) })), _jsxs(Panel, { labelWidth: 64, useBorder: false, children: [_jsx(PanelRow, { variant: "custom", label: t('wordTable.save.nameLabel', '이름'), required: true, align: "vertical", useFullWidth: true, children: _jsx(TextField, { required: true, value: name, onChange: setName, ariaLabel: t('wordTable.save.nameLabel', '이름'), placeholder: t('wordTable.save.placeholder', '이 단어표에 대한 제목을 입력하세요.'), maxLength: 40, size: 48, fullWidth: true, autoFocus: true, onEnter: handleEnter, error: isDuplicateName ? t('wordTable.save.duplicateName', '이미 사용 중인 이름입니다.') : undefined }) }), _jsx(PanelRow, { variant: "custom", label: t('wordTable.save.descriptionLabel', '설명'), align: "vertical", useFullWidth: true, children: _jsx(TextField, { value: description, onChange: setDescription, ariaLabel: t('wordTable.save.descriptionLabel', '설명'), placeholder: t('wordTable.save.descriptionPlaceholder', '이 단어표에 대한 설명을 입력하세요.'), maxLength: 200, multiline: true, rows: 3, fullWidth: true }) })] })] }) }));
|
|
65
65
|
}
|