@bigtablet/design-system 3.4.0 → 3.4.1
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/dist/index.css +11 -0
- package/dist/index.d.ts +11 -3
- package/dist/index.js +8 -5
- package/dist/styles/layout/_index.scss +4 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -4507,6 +4507,17 @@
|
|
|
4507
4507
|
border-radius: 8px;
|
|
4508
4508
|
background: var(--bt-color-bg-solid);
|
|
4509
4509
|
}
|
|
4510
|
+
.table_sr_only {
|
|
4511
|
+
position: absolute;
|
|
4512
|
+
width: 1px;
|
|
4513
|
+
height: 1px;
|
|
4514
|
+
padding: 0;
|
|
4515
|
+
margin: -1px;
|
|
4516
|
+
overflow: hidden;
|
|
4517
|
+
clip: rect(0, 0, 0, 0);
|
|
4518
|
+
white-space: nowrap;
|
|
4519
|
+
border: 0;
|
|
4520
|
+
}
|
|
4510
4521
|
.table {
|
|
4511
4522
|
width: 100%;
|
|
4512
4523
|
border-collapse: collapse;
|
package/dist/index.d.ts
CHANGED
|
@@ -1317,7 +1317,7 @@ declare const Divider: ({ weight, className, ...props }: DividerProps) => React$
|
|
|
1317
1317
|
|
|
1318
1318
|
/** Drawer 가 미끄러져 들어오는 방향 (top 은 범위 외) */
|
|
1319
1319
|
type DrawerPlacement = "left" | "right" | "bottom";
|
|
1320
|
-
interface DrawerProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1320
|
+
interface DrawerProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title" | "onClick" | "onKeyDown" | "role"> {
|
|
1321
1321
|
/** 드로어 열림 여부 */
|
|
1322
1322
|
open: boolean;
|
|
1323
1323
|
/** 드로어 닫기 콜백 */
|
|
@@ -1644,7 +1644,7 @@ interface MediaCardProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "t
|
|
|
1644
1644
|
declare const MediaCard: ({ image, imagePosition, aspectRatio, heading, headingAs: HeadingTag, eyebrow, shadow, bordered, clickable, meta, children, className, ...props }: MediaCardProps) => React$1.JSX.Element;
|
|
1645
1645
|
|
|
1646
1646
|
type ModalFooterAlign = "end" | "between" | "start";
|
|
1647
|
-
interface ModalProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1647
|
+
interface ModalProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title" | "onClick" | "onKeyDown" | "role"> {
|
|
1648
1648
|
/** 모달 열림 여부 */
|
|
1649
1649
|
open: boolean;
|
|
1650
1650
|
/** 모달 닫기 콜백 */
|
|
@@ -1897,6 +1897,14 @@ type TableProps<T extends object> = {
|
|
|
1897
1897
|
className?: string;
|
|
1898
1898
|
/** 행 클릭 콜백 */
|
|
1899
1899
|
onRowClick?: (item: T, index: number) => void;
|
|
1900
|
+
/**
|
|
1901
|
+
* clickable 행(onRowClick)의 동작 설명. 각 clickable 행에 `aria-describedby` 로 연결된다 (기본값: "클릭 가능한 행").
|
|
1902
|
+
* 행마다 셀 데이터가 이미 행을 식별하므로 여기엔 동작만 담으면 된다 (예: "선택하면 상세 항목으로 이동").
|
|
1903
|
+
* `""`(빈 문자열)로 두면 힌트를 붙이지 않는다.
|
|
1904
|
+
* `aria-label` 대신 `aria-describedby` 를 쓰는 이유: `<tr>` 의 `aria-label`/`role="button"` 은 행/셀의
|
|
1905
|
+
* accessible name 을 덮거나 셀을 presentational 로 만들어 스크린리더가 셀 데이터를 못 읽는다.
|
|
1906
|
+
*/
|
|
1907
|
+
rowClickHint?: string;
|
|
1900
1908
|
/** 현재 정렬 상태 (제어형). `undefined` 는 정렬 없음 */
|
|
1901
1909
|
sort?: TableSort;
|
|
1902
1910
|
/** 정렬 가능한 헤더 클릭 시 발화 (none→asc→desc→none 순환). DS는 데이터를 직접 정렬하지 않음 - 정렬된 `data` 를 다시 전달해야 함 */
|
|
@@ -1911,7 +1919,7 @@ type TableProps<T extends object> = {
|
|
|
1911
1919
|
* @param props 테이블 속성
|
|
1912
1920
|
* @returns 테이블 컴포넌트
|
|
1913
1921
|
*/
|
|
1914
|
-
declare const Table: <T extends object>({ columns, data, keyExtractor, emptyMessage, isLoading, skeletonRows, size, hoverable, stickyHeader, ariaLabel, className, onRowClick, sort, onSortChange, selectAllAriaLabel, selectRowAriaLabel, selectable, rowKey, selectedKeys, onSelectionChange, }: TableProps<T>) => React$1.JSX.Element;
|
|
1922
|
+
declare const Table: <T extends object>({ columns, data, keyExtractor, emptyMessage, isLoading, skeletonRows, size, hoverable, stickyHeader, ariaLabel, className, onRowClick, rowClickHint, sort, onSortChange, selectAllAriaLabel, selectRowAriaLabel, selectable, rowKey, selectedKeys, onSelectionChange, }: TableProps<T>) => React$1.JSX.Element;
|
|
1915
1923
|
|
|
1916
1924
|
type ThemeMode = "light" | "dark" | "system";
|
|
1917
1925
|
type ResolvedTheme = "light" | "dark";
|
package/dist/index.js
CHANGED
|
@@ -2720,14 +2720,14 @@ var Drawer = ({
|
|
|
2720
2720
|
animated.div,
|
|
2721
2721
|
{
|
|
2722
2722
|
ref: panelRef,
|
|
2723
|
+
...props,
|
|
2723
2724
|
className: cn("drawer_panel", className),
|
|
2724
|
-
style: { ...panelStyle, ...panelSizeStyle },
|
|
2725
|
+
style: { ...props.style, ...panelStyle, ...panelSizeStyle },
|
|
2725
2726
|
role: "document",
|
|
2726
2727
|
onClick: (e) => e.stopPropagation(),
|
|
2727
2728
|
onKeyDown: (e) => {
|
|
2728
2729
|
if (e.key !== "Escape") e.stopPropagation();
|
|
2729
2730
|
},
|
|
2730
|
-
...props,
|
|
2731
2731
|
children: [
|
|
2732
2732
|
showCloseIcon && onClose && /* @__PURE__ */ jsx(
|
|
2733
2733
|
"button",
|
|
@@ -3166,14 +3166,14 @@ var Modal = ({
|
|
|
3166
3166
|
animated.div,
|
|
3167
3167
|
{
|
|
3168
3168
|
ref: panelRef,
|
|
3169
|
+
...props,
|
|
3169
3170
|
className: cn("modal_panel", className),
|
|
3170
|
-
style: { ...panelStyle, width },
|
|
3171
|
+
style: { ...props.style, ...panelStyle, width },
|
|
3171
3172
|
role: "document",
|
|
3172
3173
|
onClick: (e) => e.stopPropagation(),
|
|
3173
3174
|
onKeyDown: (e) => {
|
|
3174
3175
|
if (e.key !== "Escape") e.stopPropagation();
|
|
3175
3176
|
},
|
|
3176
|
-
...props,
|
|
3177
3177
|
children: [
|
|
3178
3178
|
showCloseIcon && onClose && /* @__PURE__ */ jsx(
|
|
3179
3179
|
"button",
|
|
@@ -3562,6 +3562,7 @@ var Table = ({
|
|
|
3562
3562
|
ariaLabel,
|
|
3563
3563
|
className,
|
|
3564
3564
|
onRowClick,
|
|
3565
|
+
rowClickHint = "\uD074\uB9AD \uAC00\uB2A5\uD55C \uD589",
|
|
3565
3566
|
sort,
|
|
3566
3567
|
onSortChange,
|
|
3567
3568
|
selectAllAriaLabel = "\uC804\uCCB4 \uC120\uD0DD",
|
|
@@ -3580,6 +3581,7 @@ var Table = ({
|
|
|
3580
3581
|
const isEmpty = !isLoading && data.length === 0;
|
|
3581
3582
|
const getRowKey = (item, index) => rowKey?.(item) ?? String(index);
|
|
3582
3583
|
const allRowKeys = selectable ? data.map((item, index) => getRowKey(item, index)) : [];
|
|
3584
|
+
const rowClickHintId = React19.useId();
|
|
3583
3585
|
const selectedSet = React19.useMemo(() => new Set(selectedKeys ?? []), [selectedKeys]);
|
|
3584
3586
|
const selectedCount = allRowKeys.filter((key) => selectedSet.has(key)).length;
|
|
3585
3587
|
const isAllSelected = allRowKeys.length > 0 && selectedCount === allRowKeys.length;
|
|
@@ -3692,7 +3694,7 @@ var Table = ({
|
|
|
3692
3694
|
isSelected && "table_row_selected"
|
|
3693
3695
|
),
|
|
3694
3696
|
"aria-selected": isSelected ? "true" : void 0,
|
|
3695
|
-
|
|
3697
|
+
"aria-describedby": onRowClick && rowClickHint ? rowClickHintId : void 0,
|
|
3696
3698
|
tabIndex: onRowClick ? 0 : void 0,
|
|
3697
3699
|
onClick: onRowClick ? () => onRowClick(item, rowIndex) : void 0,
|
|
3698
3700
|
onKeyDown: onRowClick ? (e) => {
|
|
@@ -3737,6 +3739,7 @@ var Table = ({
|
|
|
3737
3739
|
);
|
|
3738
3740
|
}) })
|
|
3739
3741
|
] }),
|
|
3742
|
+
onRowClick && rowClickHint && /* @__PURE__ */ jsx("span", { id: rowClickHintId, className: "table_sr_only", children: rowClickHint }),
|
|
3740
3743
|
isEmpty && /* @__PURE__ */ jsx("div", { className: "table_empty", role: "status", children: emptyMessage })
|
|
3741
3744
|
] });
|
|
3742
3745
|
};
|