@nurihaus/web-design-system 3.9.0 → 3.9.2

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/README.md CHANGED
@@ -26,7 +26,7 @@ import '@nurihaus/web-design-system/tokens.css';
26
26
  import '@nurihaus/web-design-system/styles.css';
27
27
  ```
28
28
 
29
- 글꼴 파일은 앱이 불러온다. 디자인 시스템은 글꼴을 내려받지 않는다. `styles.css` 의 `.nuri-theme` 는 앱이 Pretendard 를 불러왔으면 Pretendard 를 먼저 쓰고, 없으면 시스템 글꼴로 넘어간다. 스택은 `font-family` 이름 `Pretendard` 로 찾는다. 앱이 다른 이름으로 불러오면(예: 이름을 해시로 바꾸는 도구) `.nuri-theme` 의 `font-family` 를 앱에서 덮어쓴다.
29
+ 글꼴 파일은 앱이 불러온다. 디자인 시스템은 글꼴을 내려받지 않는다. `styles.css` 의 `.nuri-theme` 는 앱이 Pretendard 를 불러왔으면 Pretendard 를 먼저 쓰고, 없으면 시스템 글꼴로 넘어간다. 스택은 `font-family` 이름 `Pretendard` → `Pretendard Variable` → `PretendardVariable` 순으로 찾는다(가변 글꼴·동적 서브셋 CSS 가 쓰는 이름까지). 앱이 또 다른 이름으로 불러오면(예: 이름을 해시로 바꾸는 도구) `.nuri-theme` 의 `font-family` 를 앱에서 덮어쓴다. 토큰 `--font-family-primary` 는 Figma 의 글꼴 이름이고 컴포넌트는 쓰지 않는다.
30
30
 
31
31
  `.nuri-theme` 글꼴 스택도 필요 없으면 나눠서 가져온다. 컴포넌트 글자는 앱의 글꼴을 물려받는다.
32
32
 
@@ -194,7 +194,7 @@ import { IconButton } from '@nurihaus/web-design-system/icon-button'; // 이
194
194
  import { IconButton } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
195
195
  ```
196
196
 
197
- **언제 쓴다.** 글자 없이 아이콘 하나로 뜻이 통하는 버튼에 쓴다(뒤로, 알림, 첨부, 떠 있는 추가 버튼). `icon` 은 Icon 이름, `label` 은 버튼의 이름(aria-label)이라 꼭 준다. `variant` 는 `ghost`(기본, 바탕 없이 회색 아이콘, 누르는 동안 회색 원)·`secondary`(연보라)·`primary`(진보라). `size` 는 `s`(36)·`m`(44, 기본)·`l`(56)이고 보이는 크기가 작아도 누르는 자리는 44 이상이다. 다른 화면으로 옮겨 가는 버튼은 `asChild` 를 주고 링크 요소 하나를 children 으로 준다 — 그 링크가 버튼 모양이 되고 아이콘은 링크 안에 들어간다. 떠 있는 버튼의 자리·그림자는 쓰는 쪽이 `className` 으로 준다(`--shadow-floating`). `className`·`style` 은 버튼(또는 링크)에 붙는다.
197
+ **언제 쓴다.** 글자 없이 아이콘 하나로 뜻이 통하는 버튼에 쓴다(뒤로, 알림, 첨부, 떠 있는 추가 버튼). `icon` 은 Icon 이름, `label` 은 버튼의 이름(aria-label)이라 꼭 준다. `variant` 는 `ghost`(기본, 바탕 없이 회색 아이콘, 누르는 동안 회색 원)·`secondary`(연보라)·`primary`(진보라). `size` 는 `s`(36)·`m`(44, 기본)·`l`(56)이고 보이는 크기가 작아도 누르는 자리는 44 이상이다. 다른 화면으로 옮겨 가는 버튼은 `asChild` 를 주고 링크 요소 하나를 children 으로 준다 — 그 링크가 버튼 모양이 되고 아이콘은 링크 안에 들어간다. 떠 있는 버튼은 감싸는 요소에 자리(`position: fixed` 등)·모양(`border-radius`)·그림자(`--shadow-floating`)를 준다 — 버튼 자체의 `className` 으로 `position` 을 덮으면 CSS 가 실리는 순서에 따라 DS 의 `position: relative`(터치 영역 기준)가 이긴다. `className`·`style` 은 버튼(또는 링크)에 붙는다.
198
198
 
199
199
  **쓰지 않는다.** 글자가 있는 버튼은 CTAButton 을 쓴다. 칩의 지우기는 Tag 의 `onRemove`, 대화 보내기는 MessageComposer 를 쓴다.
200
200
 
@@ -370,7 +370,9 @@ import { DataTable } from '@nurihaus/web-design-system/data-table'; // 이 컴
370
370
  import { DataTable } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
371
371
  ```
372
372
 
373
- **언제 쓴다.** 여러 레코드를 열 단위로 나열하는 목록 화면에 쓴다. 이름과 달리 `rows`는 헤더 열 정의(`id`, 헤더 내용)이고 `columns`는 데이터 행 배열이며, 각 데이터 행은 `rows`의 모든 `id`를 키로 가진다. 열 너비는 셀 내용의 너비를 따르므로 같은 열의 헤더와 셀 내용에 같은 너비를 준다.
373
+ **언제 쓴다.** 여러 레코드를 열 단위로 나열하는 목록 화면에 쓴다. 이름과 달리 `rows`는 헤더 열 정의(`id`, 헤더 내용)이고 `columns`는 데이터 행 배열이며, 각 데이터 행은 `rows`의 모든 `id`를 키로 가진다. 열 너비는 `rows` 항목의 `width`로 준다. 없으면 셀 내용의 너비를 따른다.
374
+
375
+ `variant="padded"`를 주면 헤더 칸과 본문 셀이 여백·글자 크기·색을 기본으로 갖고, `fixedRowsIndex`로 고정한 마지막 열 오른쪽에 경계선이 행 높이만큼 그어진다. 기본 `plain`은 셀 내용이 모양을 정한다. `padded`에서 여백만 끄려면 `className`으로 `--data-table-cell-padding: 0`을 준다.
374
376
 
375
377
  `track`을 주면 `onClickRow`가 있는 `rows` 항목(헤더 칸)을 누를 때 `click`과 그 `id`를 `value`에 담아 사용 로그로 보낸다. `onClickRow`가 없는 칸과 본문 셀은 보내지 않는다.
376
378
 
@@ -378,14 +380,15 @@ import { DataTable } from '@nurihaus/web-design-system'; // 루트.
378
380
 
379
381
  ```tsx
380
382
  <DataTable
383
+ variant="padded"
381
384
  rows={[
382
- { id: 'name', value: <div style={{ width: '160px' }}>이름</div> },
383
- { id: 'status', value: <div style={{ width: '120px' }}>상태</div> },
385
+ { id: 'name', value: '이름', width: 160 },
386
+ { id: 'status', value: '상태', width: 120 },
384
387
  ] as const}
385
388
  columns={[
386
389
  {
387
- name: { value: <div style={{ width: '160px' }}>홍길동</div> },
388
- status: { value: <div style={{ width: '120px' }}>대기</div>, onClickCell: () => {} },
390
+ name: { value: '홍길동' },
391
+ status: { value: '대기', onClickCell: () => {} },
389
392
  },
390
393
  ]}
391
394
  fixedRowsIndex={1}
@@ -400,6 +403,7 @@ import { DataTable } from '@nurihaus/web-design-system'; // 루트.
400
403
  | --- | --- | --- | --- |
401
404
  | `rows` | `T` | 예 | |
402
405
  | `columns` | `ColumnsType<T>` | 예 | |
406
+ | `variant` | `'plain' \| 'padded'` | | `'plain'` |
403
407
  | `fixedRowsIndex` | `number` | | `0` |
404
408
  | `headerHeight` | `number` | | `85` |
405
409
  | `rowHeight` | `number` | | `60` |
@@ -937,7 +941,11 @@ import { CollapsibleMenu } from '@nurihaus/web-design-system'; //
937
941
 
938
942
  `track`을 주면 링크·버튼 항목을 고를 때 `navigate`와 그 항목의 `key`를 `value`에 담아 사용 로그로 보낸다. 그룹을 펼치고 접는 것은 보내지 않는다.
939
943
 
940
- **쓰지 않는다.** 같은 화면 안에서 패널을 바꾸는 용도는 Tabs를 쓴다. 본문 콘텐츠를 접고 펼치는 아코디언 용도로는 쓰지 않는다(`<nav>`로 렌더된다). 값을 고르는 폼 입력은 DropDown을 쓴다.
944
+ 그룹은 기본으로 스스로 열고 닫는다(`defaultOpen`). 다른 메뉴에서 그룹 안 경로로 이동했을 때 그 그룹을 열어야 하면 `open`·`onOpenChange` 로 밖에서 제어한다. 접힌 사이드바에서 그룹을 눌렀을 때 먼저 사이드바를 펼치는 식의 처리는 `onTriggerClick` 에서 한다. `e.preventDefault()` 하면 그 클릭은 열고 닫지 않는다. 열고 닫을 때 높이가 움직이고, `prefers-reduced-motion` 이면 바로 바뀐다.
945
+
946
+ "섹션 제목 + 항목들" 묶음이 여러 개면 `sections` 로 넘긴다. 항목은 `ul`/`li` 로 그려 스크린리더가 목록으로 읽는다. 루트는 `<nav aria-label="Collapsible menu">` 다. 이름은 `aria-label` 로 바꾸고, 앱이 이미 `<nav>` 로 감쌌거나 한 화면에 여러 개 두면 `as="div"` 로 `nav` 를 뺀다.
947
+
948
+ **쓰지 않는다.** 같은 화면 안에서 패널을 바꾸는 용도는 Tabs를 쓴다. 본문 콘텐츠를 접고 펼치는 아코디언 용도로는 쓰지 않는다. 값을 고르는 폼 입력은 DropDown을 쓴다.
941
949
 
942
950
  Next.js 에서는 `next/link` 의 `Link` 를 그대로 넘긴다.
943
951
 
@@ -967,6 +975,35 @@ import Link from 'next/link';
967
975
  />
968
976
  ```
969
977
 
978
+ 섹션과 제어되는 그룹. 섹션만 쓰면 `items` 는 `[]`:
979
+
980
+ ```tsx
981
+ <CollapsibleMenu
982
+ as="div"
983
+ items={[]}
984
+ activeKey="quest.list"
985
+ sections={[
986
+ {
987
+ key: 'ops',
988
+ title: '운영',
989
+ items: [
990
+ {
991
+ key: 'quest',
992
+ item: <span>퀘스트</span>,
993
+ open: true,
994
+ onOpenChange: () => {},
995
+ onTriggerClick: (e) => {
996
+ if (e.altKey) e.preventDefault();
997
+ },
998
+ children: [{ key: 'quest.list', item: <span>목록</span>, href: '/quests' }],
999
+ },
1000
+ ],
1001
+ },
1002
+ { key: 'me', title: '내 정보', items: [{ key: 'profile', item: <span>프로필</span> }] },
1003
+ ]}
1004
+ />
1005
+ ```
1006
+
970
1007
  **모션.** press · expand. 토큰 값과 규칙은 `motion.md`.
971
1008
 
972
1009
  ### props
@@ -975,12 +1012,15 @@ import Link from 'next/link';
975
1012
  | --- | --- | --- | --- |
976
1013
  | `size` | `'s' \| 'm'` | | `'s'` |
977
1014
  | `items` | `CollapsibleMenuItem[]` | 예 | |
1015
+ | `sections` | `CollapsibleMenuSection[]` | | |
978
1016
  | `activeKey` | `string` | | |
979
1017
  | `onActiveKeyChange` | `((key: string) => void)` | | |
980
1018
  | `indent` | `number` | | `12` |
981
1019
  | `chevron` | `ReactNode` | | |
982
1020
  | `width` | `string \| number` | | `'240px'` |
983
1021
  | `linkComponent` | `ComponentType<CollapsibleMenuLinkProps>` | | |
1022
+ | `as` | `'div' \| 'nav'` | | `'nav'` |
1023
+ | `aria-label` | `string` | | |
984
1024
  | `className` | `string` | | |
985
1025
  | `style` | `CSSProperties` | | |
986
1026
  | `track` | `string` | | |
package/dist/ai/motion.md CHANGED
@@ -412,7 +412,7 @@
412
412
  - **Skeleton** `skeleton-style.css:68 prefers-reduced-motion 에서 animation none` → busy
413
413
  - **Breadcrumb** `breadcrumb-style.css:75 transition color var(--motion-fast) var(--motion-ease)` → press
414
414
  - **DropDown** `drop-down-style.css:91 transition transform var(--motion-fast) var(--motion-ease) (화살표)` → expand
415
- - **CollapsibleMenu** `collapsible-menu-style.css:86 transition transform var(--motion-fast) var(--motion-ease) (화살표)` → expand
415
+ - **CollapsibleMenu** `collapsible-menu-style.css:120 transition transform var(--motion-fast) var(--motion-ease) (화살표)` → expand
416
416
  - **Tabs** `tabs-style.css:48 transition color var(--motion-base) var(--motion-ease)` → press
417
417
  - **Tabs** `tabs-style.css:92 transition left·width var(--motion-base) var(--motion-ease)` → progress
418
418
  - **Spinner** `spinner-style.css:28 animation motion-busy-ring var(--spinner-duration) var(--spinner-ease)` → busy
@@ -63,13 +63,15 @@ var CollapsibleMenuTrigger = /*#__PURE__*/(0,external_root_React_commonjs2_react
63
63
  className = props.className,
64
64
  asChild = props.asChild,
65
65
  disabled = props.disabled,
66
- style = props.style;
66
+ style = props.style,
67
+ onClick = props.onClick;
67
68
  return (0,jsx_runtime_.jsx)(external_root_RadixUI_commonjs2_radix_ui_commonjs_radix_ui_amd_radix_ui_module_radix_ui_.Collapsible.Trigger, {
68
69
  ref: ref,
69
70
  className: (0,classNames/* classNames */.x)('nuri-theme base-collapsible-menu trigger', className),
70
71
  asChild: asChild,
71
72
  disabled: disabled,
72
73
  style: style,
74
+ onClick: onClick,
73
75
  children: children
74
76
  });
75
77
  });
@@ -129,11 +131,16 @@ var CollapsibleMenu = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
129
131
  className = _a.className,
130
132
  style = _a.style,
131
133
  items = _a.items,
134
+ sections = _a.sections,
132
135
  activeKey = _a.activeKey,
133
136
  onActiveKeyChange = _a.onActiveKeyChange,
134
137
  _b = _a.indent,
135
138
  indent = _b === void 0 ? 12 : _b,
136
139
  linkComponent = _a.linkComponent,
140
+ _c = _a.as,
141
+ Root = _c === void 0 ? 'nav' : _c,
142
+ _d = _a["aria-label"],
143
+ ariaLabel = _d === void 0 ? 'Collapsible menu' : _d,
137
144
  track = _a.track,
138
145
  trackProps = _a.trackProps;
139
146
  var emit = (0,useTrack/* useTrack */.n)('CollapsibleMenu', {
@@ -154,72 +161,94 @@ var CollapsibleMenu = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
154
161
  onActiveKeyChange === null || onActiveKeyChange === void 0 ? void 0 : onActiveKeyChange(item.key);
155
162
  (_a = item.onSelect) === null || _a === void 0 ? void 0 : _a.call(item);
156
163
  };
157
- var _renderItems = function renderItems(targetItems, depth) {
164
+ var renderItem = function renderItem(item, depth) {
165
+ var _a;
158
166
  var indentStyle = {
159
167
  paddingLeft: "".concat(depth * indent, "px")
160
168
  };
161
- return targetItems.map(function (item) {
162
- var _a;
163
- var hasChildren = !!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length);
164
- var isActive = activeKey === item.key;
165
- if (hasChildren) {
166
- var triggerClassName = (0,classNames/* classNames */.x)('collapsible-menu-trigger', 'collapsible-menu-row', _hasActiveDescendant(item) && 'is-active');
167
- return (0,jsx_runtime_.jsxs)(base_collapsible_menu, {
168
- defaultOpen: item.defaultOpen,
169
+ var hasChildren = !!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length);
170
+ var isActive = activeKey === item.key;
171
+ if (hasChildren) {
172
+ var triggerClassName = (0,classNames/* classNames */.x)('collapsible-menu-trigger', 'collapsible-menu-row', _hasActiveDescendant(item) && 'is-active');
173
+ return (0,jsx_runtime_.jsxs)(base_collapsible_menu, {
174
+ defaultOpen: item.defaultOpen,
175
+ open: item.open,
176
+ onOpenChange: item.onOpenChange,
177
+ disabled: item.disabled,
178
+ children: [(0,jsx_runtime_.jsx)(base_collapsible_menu.Trigger, {
179
+ className: triggerClassName,
169
180
  disabled: item.disabled,
170
- children: [(0,jsx_runtime_.jsx)(base_collapsible_menu.Trigger, {
171
- className: triggerClassName,
172
- disabled: item.disabled,
173
- children: (0,jsx_runtime_.jsx)("span", {
174
- className: 'collapsible-menu-left',
175
- style: indentStyle,
176
- children: item.item
177
- })
178
- }), (0,jsx_runtime_.jsx)(base_collapsible_menu.Content, {
179
- className: 'collapsible-menu-content',
180
- children: item.children ? _renderItems(item.children, depth + 1) : null
181
- })]
182
- }, item.key);
183
- }
184
- var itemClassName = (0,classNames/* classNames */.x)('collapsible-menu-item', 'collapsible-menu-row', isActive && 'is-active');
185
- var left = (0,jsx_runtime_.jsx)("span", {
186
- className: 'collapsible-menu-left',
187
- style: indentStyle,
188
- children: item.item
181
+ onClick: item.onTriggerClick,
182
+ children: (0,jsx_runtime_.jsx)("span", {
183
+ className: 'collapsible-menu-left',
184
+ style: indentStyle,
185
+ children: item.item
186
+ })
187
+ }), (0,jsx_runtime_.jsx)(base_collapsible_menu.Content, {
188
+ className: 'collapsible-menu-content',
189
+ children: item.children ? renderList(item.children, depth + 1) : null
190
+ })]
189
191
  });
190
- if (item.href) {
191
- return (0,jsx_runtime_.jsx)(Link, {
192
- className: itemClassName,
193
- href: item.href,
194
- "aria-current": isActive ? 'page' : undefined,
195
- "aria-disabled": item.disabled ? 'true' : undefined,
196
- onClick: function onClick(e) {
197
- if (item.disabled) {
198
- e.preventDefault();
199
- return;
200
- }
201
- selectItem(item);
202
- },
203
- children: left
204
- }, item.key);
205
- }
206
- return (0,jsx_runtime_.jsx)("button", {
207
- type: 'button',
192
+ }
193
+ var itemClassName = (0,classNames/* classNames */.x)('collapsible-menu-item', 'collapsible-menu-row', isActive && 'is-active');
194
+ var left = (0,jsx_runtime_.jsx)("span", {
195
+ className: 'collapsible-menu-left',
196
+ style: indentStyle,
197
+ children: item.item
198
+ });
199
+ if (item.href) {
200
+ return (0,jsx_runtime_.jsx)(Link, {
208
201
  className: itemClassName,
209
- disabled: item.disabled,
210
- onClick: function onClick() {
211
- return selectItem(item);
202
+ href: item.href,
203
+ "aria-current": isActive ? 'page' : undefined,
204
+ "aria-disabled": item.disabled ? 'true' : undefined,
205
+ onClick: function onClick(e) {
206
+ if (item.disabled) {
207
+ e.preventDefault();
208
+ return;
209
+ }
210
+ selectItem(item);
212
211
  },
213
212
  children: left
214
- }, item.key);
213
+ });
214
+ }
215
+ return (0,jsx_runtime_.jsx)("button", {
216
+ type: 'button',
217
+ className: itemClassName,
218
+ disabled: item.disabled,
219
+ onClick: function onClick() {
220
+ return selectItem(item);
221
+ },
222
+ children: left
215
223
  });
216
224
  };
217
- return (0,jsx_runtime_.jsx)("nav", {
225
+ // reset.css 가 list-style 을 지우면 Safari 가 목록 의미를 버리므로 role 을 직접 단다.
226
+ var renderList = function renderList(targetItems, depth) {
227
+ return (0,jsx_runtime_.jsx)("ul", {
228
+ className: 'collapsible-menu-list',
229
+ role: 'list',
230
+ children: targetItems.map(function (item) {
231
+ return (0,jsx_runtime_.jsx)("li", {
232
+ children: renderItem(item, depth)
233
+ }, item.key);
234
+ })
235
+ });
236
+ };
237
+ var renderSection = function renderSection(section) {
238
+ return (0,jsx_runtime_.jsxs)("div", {
239
+ className: 'collapsible-menu-section',
240
+ children: [section.title ? (0,jsx_runtime_.jsx)("div", {
241
+ className: 'collapsible-menu-section-title',
242
+ children: section.title
243
+ }) : null, renderList(section.items, 0)]
244
+ }, section.key);
245
+ };
246
+ return (0,jsx_runtime_.jsxs)(Root, {
218
247
  ref: ref,
219
248
  className: rootClassName,
220
249
  style: style,
221
- "aria-label": 'Collapsible menu',
222
- children: _renderItems(items, 0)
250
+ "aria-label": Root === 'nav' ? ariaLabel : undefined,
251
+ children: [items.length ? renderList(items, 0) : null, sections === null || sections === void 0 ? void 0 : sections.map(renderSection)]
223
252
  });
224
253
  });
225
254
  CollapsibleMenu.displayName = 'CollapsibleMenu';
@@ -10,6 +10,8 @@ export interface CollapsibleMenuRootProps {
10
10
  }
11
11
  export interface CollapsibleMenuTriggerProps extends AsChildProps, StyleProps {
12
12
  disabled?: boolean;
13
+ /** `e.preventDefault()` 하면 열고 닫지 않는다. */
14
+ onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
13
15
  }
14
16
  export interface CollapsibleMenuContentProps extends AsChildProps, StyleProps {
15
17
  }
@@ -20,7 +22,20 @@ export interface CollapsibleMenuItem {
20
22
  href?: string;
21
23
  onSelect?: () => void;
22
24
  children?: CollapsibleMenuItem[];
25
+ /** 그룹(children 있음) 전용. 처음 열림 여부. */
23
26
  defaultOpen?: boolean;
27
+ /** 그룹 전용. 주면 열림을 밖에서 제어한다. */
28
+ open?: boolean;
29
+ /** 그룹 전용. 트리거로 열고 닫을 때 불린다. */
30
+ onOpenChange?: (open: boolean) => void;
31
+ /** 그룹 전용. 트리거 클릭. `e.preventDefault()` 하면 열고 닫지 않는다. */
32
+ onTriggerClick?: (e: MouseEvent<HTMLButtonElement>) => void;
33
+ }
34
+ /** 섹션 제목 하나와 그 아래 항목 목록. */
35
+ export interface CollapsibleMenuSection {
36
+ key: string;
37
+ title?: ReactNode;
38
+ items: CollapsibleMenuItem[];
24
39
  }
25
40
  /** `href` 가 있는 항목을 그릴 때 `linkComponent` 가 받는 props. next/link 의 Link 를 그대로 넘길 수 있다. */
26
41
  export interface CollapsibleMenuLinkProps {
@@ -33,11 +48,18 @@ export interface CollapsibleMenuLinkProps {
33
48
  }
34
49
  export interface CollapsibleMenuProps extends StyleProps, TrackProps {
35
50
  size?: (typeof sizes)[number];
51
+ /** 섹션 없는 항목. `sections` 와 함께 주면 `sections` 앞에 그린다. 섹션만 쓰면 `[]`. */
36
52
  items: CollapsibleMenuItem[];
53
+ /** 제목이 있는 섹션 여러 개. */
54
+ sections?: CollapsibleMenuSection[];
37
55
  activeKey?: string;
38
56
  onActiveKeyChange?: (key: string) => void;
39
57
  indent?: number;
40
58
  chevron?: ReactNode;
41
59
  width?: number | string;
42
60
  linkComponent?: ComponentType<CollapsibleMenuLinkProps>;
61
+ /** 루트 요소. 앱이 이미 `<nav>` 로 감쌌으면 `'div'`. 기본 `'nav'`. */
62
+ as?: 'nav' | 'div';
63
+ /** 루트가 `nav` 일 때 접근성 이름. 기본 `'Collapsible menu'`. */
64
+ 'aria-label'?: string;
43
65
  }
@@ -1,4 +1,4 @@
1
1
  import { CollapsibleMenuProps } from './collapsible-menu-type';
2
2
  declare const CollapsibleMenu: import("react").ForwardRefExoticComponent<CollapsibleMenuProps & import("react").RefAttributes<HTMLElement>>;
3
3
  export default CollapsibleMenu;
4
- export type { CollapsibleMenuProps, CollapsibleMenuItem, CollapsibleMenuLinkProps, } from './collapsible-menu-type';
4
+ export type { CollapsibleMenuProps, CollapsibleMenuItem, CollapsibleMenuSection, CollapsibleMenuLinkProps, } from './collapsible-menu-type';
@@ -23,3 +23,5 @@ export declare const Sizes: Story;
23
23
  /** 자식이 있는 항목에 disabled 를 주면 그룹(Radix Collapsible root)이 접히지도 펼쳐지지도 않는다. */
24
24
  export declare const Disabled: Story;
25
25
  export declare const CustomLink: Story;
26
+ /** 섹션 제목 + 목록 묶음. 그룹은 `open`·`onOpenChange` 로 밖에서 열고, 접힌 사이드바 흉내로 Alt+클릭은 열지 않는다. */
27
+ export declare const Sections: Story;
@@ -1,3 +1,12 @@
1
+ export declare const variants: readonly ["plain", "padded"];
2
+ export declare const dataTableProps: {
3
+ variant: {
4
+ type: "className";
5
+ className: string;
6
+ values: readonly ["plain", "padded"];
7
+ default: "plain";
8
+ };
9
+ };
1
10
  export declare const dataTableHeaderProps: {
2
11
  headerHeight: {
3
12
  type: "css";
@@ -1,5 +1,6 @@
1
1
  import { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  import { TrackProps } from '../logging/logging-type';
3
+ import { variants } from './table-props';
3
4
  export interface TableProps {
4
5
  children: React.ReactNode;
5
6
  }
@@ -17,6 +18,8 @@ export interface RowItem {
17
18
  id: string;
18
19
  value: ReactNode;
19
20
  onClickRow?: (id: RowItem['id']) => void;
21
+ /** 열 너비. 헤더 칸과 본문 셀에 같이 붙는다. 숫자는 px. */
22
+ width?: number | string;
20
23
  }
21
24
  type ColumnsType<T extends readonly RowItem[]> = Array<{
22
25
  [K in T[number]['id']]: {
@@ -27,6 +30,8 @@ type ColumnsType<T extends readonly RowItem[]> = Array<{
27
30
  export interface DataTableProps<T extends readonly RowItem[]> extends TrackProps {
28
31
  rows: T;
29
32
  columns: ColumnsType<T>;
33
+ /** `padded` 면 셀 여백·글자 기본값과 마지막 고정 열 경계선을 그린다. 기본 `plain` 은 셀 내용이 모양을 정한다. */
34
+ variant?: (typeof variants)[number];
30
35
  fixedRowsIndex?: number;
31
36
  headerHeight?: number;
32
37
  rowHeight?: number;
@@ -54,6 +54,27 @@ declare const rowItems: readonly [{
54
54
  readonly id: "15";
55
55
  readonly value: import("react/jsx-runtime").JSX.Element;
56
56
  }];
57
+ declare const paddedRows: readonly [{
58
+ readonly id: "id";
59
+ readonly value: "ID";
60
+ readonly width: 60;
61
+ }, {
62
+ readonly id: "name";
63
+ readonly value: "Name";
64
+ readonly width: 160;
65
+ }, {
66
+ readonly id: "email";
67
+ readonly value: "Email";
68
+ readonly width: 240;
69
+ }, {
70
+ readonly id: "address";
71
+ readonly value: "Address";
72
+ readonly width: 400;
73
+ }, {
74
+ readonly id: "status";
75
+ readonly value: "Status";
76
+ readonly width: 120;
77
+ }];
57
78
  export declare const Default: StoryObj<DataTableProps<typeof rowItems>>;
58
79
  declare const smallRows: readonly [{
59
80
  readonly id: "id";
@@ -70,4 +91,6 @@ export declare const Small: StoryObj<DataTableProps<typeof smallRows>>;
70
91
  export declare const Heights: StoryObj<DataTableProps<typeof smallRows>>;
71
92
  /** 행에 마우스를 올리면 배경이 바뀌고, 고정 열은 가로 스크롤에도 남는다. */
72
93
  export declare const FixedColumns: StoryObj<DataTableProps<typeof rowItems>>;
94
+ /** padded: 셀 여백·글자 기본값, 마지막 고정 열 경계선. 열 너비는 rows 의 width 로 준다. */
95
+ export declare const Padded: StoryObj<DataTableProps<typeof paddedRows>>;
73
96
  export declare const Empty: StoryObj<DataTableProps<typeof smallRows>>;
@@ -290,10 +290,10 @@ declare const meta: {
290
290
  open?: boolean | undefined;
291
291
  defaultOpen?: boolean | undefined;
292
292
  onOpenChange?: ((open: boolean) => void) | undefined;
293
- onResume?: (() => void) | undefined;
294
- duration?: number | undefined;
295
293
  description?: import("react").ReactNode;
296
294
  action?: import("./toast-type").ToastAction | undefined;
295
+ onResume?: (() => void) | undefined;
296
+ duration?: number | undefined;
297
297
  showClose?: boolean | undefined;
298
298
  ref?: import("react").LegacyRef<HTMLLIElement> | undefined;
299
299
  }>) => import("react/jsx-runtime").JSX.Element)[];
@@ -175,7 +175,8 @@
175
175
  /*
176
176
  * 공용 키프레임. 컴포넌트 CSS 는 @keyframes 를 두지 않고 이 이름을 쓴다(빌드 R18).
177
177
  * 시간·곡선은 쓰는 쪽 animation 에서 --motion-{토큰}-* 로 준다. 여기는 모양만 정한다.
178
- * 쓰는 쪽이 두는 입력 변수: --motion-slide-offset(transform 값), --motion-swipe-from, --motion-swipe-to.
178
+ * 쓰는 쪽이 두는 입력 변수: --motion-slide-offset(transform 값), --motion-swipe-from, --motion-swipe-to,
179
+ * --motion-content-height(펼친 높이. Radix 의 --radix-collapsible-content-height 등).
179
180
  */
180
181
 
181
182
  @keyframes motion-enter-fade {
@@ -349,6 +350,26 @@
349
350
  }
350
351
  }
351
352
 
353
+ @keyframes motion-enter-expand {
354
+ from {
355
+ height: 0;
356
+ overflow: hidden;
357
+ }
358
+ to {
359
+ height: var(--motion-content-height);
360
+ overflow: hidden;
361
+ }
362
+ }
363
+
364
+ @keyframes motion-exit-expand {
365
+ from {
366
+ height: var(--motion-content-height);
367
+ }
368
+ to {
369
+ height: 0;
370
+ }
371
+ }
372
+
352
373
  /* Component */
353
374
 
354
375
  .base-avatar {
@@ -953,11 +974,12 @@
953
974
  .cta-button.variant-neutral {
954
975
  background-color: var(--color-white);
955
976
  color: var(--color-purple-900);
977
+
978
+ /* 호버 때만 테두리를 그리면 그만큼 커져 덜컹거린다. 배경과 같은 색이라 보이지도 않아 테두리는 두지 않는다 */
956
979
  }
957
980
 
958
981
  .cta-button.variant-neutral:not(:disabled):hover {
959
982
  background-color: var(--color-grey-scale-100);
960
- border: var(--hairline) solid var(--color-grey-scale-100);
961
983
  color: var(--color-purple-900);
962
984
  }
963
985
 
@@ -1107,6 +1129,8 @@
1107
1129
  .base-callout::after {
1108
1130
  content: '';
1109
1131
  position: absolute;
1132
+ /* reset.css 가 가상 요소도 border-box 로 바꿔도 테두리가 정사각형 밖에 붙게 둔다 */
1133
+ box-sizing: content-box;
1110
1134
  width: var(--spacing-8);
1111
1135
  height: var(--spacing-8);
1112
1136
  border: 0 solid var(--color-purple-300);
@@ -1359,6 +1383,40 @@
1359
1383
  gap: var(--spacing-4);
1360
1384
  }
1361
1385
 
1386
+ /* reset.css 없이 components.css 만 가져온 앱에서도 글머리표·들여쓰기가 생기지 않게 한다. */
1387
+
1388
+ .collapsible-menu-list {
1389
+ display: flex;
1390
+ flex-direction: column;
1391
+ gap: var(--spacing-4);
1392
+ margin: 0;
1393
+ padding: 0;
1394
+ list-style: none;
1395
+ }
1396
+
1397
+ .collapsible-menu-list > li {
1398
+ margin: 0;
1399
+ padding: 0;
1400
+ }
1401
+
1402
+ .collapsible-menu-section {
1403
+ display: flex;
1404
+ flex-direction: column;
1405
+ gap: var(--spacing-4);
1406
+ }
1407
+
1408
+ .collapsible-menu-list + .collapsible-menu-section,.collapsible-menu-section + .collapsible-menu-section {
1409
+ margin-top: var(--spacing-12);
1410
+ }
1411
+
1412
+ .collapsible-menu-section-title {
1413
+ padding: 0 var(--spacing-12);
1414
+ font-size: var(--font-size-xsm);
1415
+ line-height: var(--line-height-xsm);
1416
+ font-weight: var(--font-weight-medium);
1417
+ color: var(--collapsible-menu-section-title-color, var(--color-grey-scale-500));
1418
+ }
1419
+
1362
1420
  .collapsible-menu.size-s .collapsible-menu-row {
1363
1421
  height: var(--menu-row-height-s);
1364
1422
  }
@@ -1430,6 +1488,28 @@
1430
1488
  gap: var(--spacing-2);
1431
1489
  margin-top: var(--spacing-2);
1432
1490
  margin-bottom: var(--spacing-4);
1491
+ /* 여닫는 높이. 여백은 이 상자 밖에 있어 Radix 가 잰 높이와 맞고, 열린 채로 둘 때는 overflow 를 숨기지 않는다. */
1492
+ --motion-content-height: var(--radix-collapsible-content-height);
1493
+ }
1494
+
1495
+ .collapsible-menu-content[data-state='open'] {
1496
+ animation: motion-enter-expand var(--motion-expand-duration) var(--motion-expand-ease);
1497
+ }
1498
+
1499
+ .collapsible-menu-content[data-state='closed'] {
1500
+ overflow: hidden;
1501
+ animation: motion-exit-expand var(--motion-expand-duration) var(--motion-expand-ease);
1502
+ }
1503
+
1504
+ .collapsible-menu-content .collapsible-menu-list {
1505
+ gap: var(--spacing-2);
1506
+ }
1507
+
1508
+ @media (prefers-reduced-motion: reduce) {
1509
+ .collapsible-menu-content[data-state='open'],
1510
+ .collapsible-menu-content[data-state='closed'] {
1511
+ animation: none;
1512
+ }
1433
1513
  }
1434
1514
 
1435
1515
  .base-description-list {
@@ -1645,6 +1725,13 @@
1645
1725
  gap: var(--spacing-10);
1646
1726
  }
1647
1727
 
1728
+ /* popper 는 높이를 정하지 않아 긴 목록(나라 221개)이 화면 밖으로 넘치고 스크롤도 안 된다.
1729
+ 화면에 남은 높이까지만 쓰고 Viewport 가 스크롤한다 */
1730
+
1731
+ .base-drop-down.content {
1732
+ max-height: var(--radix-select-content-available-height);
1733
+ }
1734
+
1648
1735
  /***************************************************************************************************
1649
1736
  * *
1650
1737
  * drop-down-single *
@@ -3927,6 +4014,32 @@ button.modal-with-double-button-close-button {
3927
4014
  border-bottom: var(--hairline) solid var(--color-grey-scale-200);
3928
4015
  }
3929
4016
 
4017
+ /*
4018
+ * variant-padded: 셀 여백·글자 기본값과 마지막 고정 열 경계선. plain 은 셀 내용이 모양을 정한다.
4019
+ * :where 로 특이도를 (0,2,0) 에 묶어 쓰는 쪽 CSS 가 같은 특이도로 덮어쓸 수 있게 한다.
4020
+ */
4021
+
4022
+ :where(.data-table.variant-padded) .data-table-header .cell {
4023
+ padding: var(--data-table-cell-padding, var(--spacing-8) var(--spacing-12));
4024
+ font-size: var(--font-size-sm);
4025
+ line-height: var(--line-height-sm);
4026
+ font-weight: var(--font-weight-semibold);
4027
+ color: var(--data-table-header-color, var(--color-grey-scale-500));
4028
+ }
4029
+
4030
+ :where(.data-table.variant-padded) .body .cell {
4031
+ padding: var(--data-table-cell-padding, var(--spacing-8) var(--spacing-12));
4032
+ font-size: var(--font-size-sm);
4033
+ line-height: var(--line-height-sm);
4034
+ color: var(--data-table-cell-color, var(--color-grey-scale-900));
4035
+ }
4036
+
4037
+ /* 마지막 고정 열의 경계선. border-collapse 표의 border 는 sticky 셀과 함께 움직이지 않아 그림자로 셀 안에 그린다 */
4038
+
4039
+ :where(.data-table.variant-padded) .fixed-last {
4040
+ box-shadow: inset calc(var(--hairline) * -1) 0 0 var(--color-grey-scale-200);
4041
+ }
4042
+
3930
4043
  .data-table-row {
3931
4044
  position: relative;
3932
4045
  border-bottom: var(--hairline) solid var(--color-grey-scale-200);
@@ -108,6 +108,15 @@ var table_props_assign = undefined && undefined.__assign || function () {
108
108
  return table_props_assign.apply(this, arguments);
109
109
  };
110
110
  var dataTableCommonProps = {};
111
+ var variants = ['plain', 'padded'];
112
+ var dataTableProps = {
113
+ variant: {
114
+ type: 'className',
115
+ className: 'variant',
116
+ values: variants,
117
+ "default": 'plain'
118
+ }
119
+ };
111
120
  var dataTableHeaderProps = table_props_assign(table_props_assign({}, dataTableCommonProps), {
112
121
  headerHeight: {
113
122
  type: 'css',
@@ -129,6 +138,16 @@ var dataTableCellProps = table_props_assign(table_props_assign({}, dataTableComm
129
138
  }
130
139
  });
131
140
  ;// ./components/table/data-table.tsx
141
+ var data_table_assign = undefined && undefined.__assign || function () {
142
+ data_table_assign = Object.assign || function (t) {
143
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
144
+ s = arguments[i];
145
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
146
+ }
147
+ return t;
148
+ };
149
+ return data_table_assign.apply(this, arguments);
150
+ };
132
151
 
133
152
 
134
153
 
@@ -141,16 +160,27 @@ var DataTableBase = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs
141
160
  columns = props.columns,
142
161
  _a = props.fixedRowsIndex,
143
162
  fixedRowsIndex = _a === void 0 ? 0 : _a,
144
- className = props.className,
145
163
  track = props.track,
146
164
  trackProps = props.trackProps;
147
165
  var emit = (0,useTrack/* useTrack */.n)('DataTable', {
148
166
  track: track,
149
167
  trackProps: trackProps
150
168
  });
169
+ var className = (0,getMergedProps/* getMergedProps */.p)(props, dataTableProps).className;
151
170
  var headerStyle = (0,getMergedProps/* getMergedProps */.p)(props, dataTableHeaderProps).style;
152
171
  var rowStyle = (0,getMergedProps/* getMergedProps */.p)(props, dataTableRowProps).style;
153
172
  var cellStyle = (0,getMergedProps/* getMergedProps */.p)(props, dataTableCellProps).style;
173
+ var widthStyle = function widthStyle(item) {
174
+ return item.width == null ? undefined : {
175
+ width: item.width
176
+ };
177
+ };
178
+ var bodyCellStyle = function bodyCellStyle(item) {
179
+ return data_table_assign(data_table_assign({}, cellStyle), widthStyle(item));
180
+ };
181
+ var fixedClassName = function fixedClassName(index) {
182
+ return (0,classNames/* classNames */.x)(index < fixedRowsIndex && 'fixed', index === fixedRowsIndex - 1 && 'fixed-last');
183
+ };
154
184
  return (0,jsx_runtime_.jsxs)(base_table, {
155
185
  ref: ref,
156
186
  className: (0,classNames/* classNames */.x)('data-table', className),
@@ -175,7 +205,8 @@ var DataTableBase = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs
175
205
  el.style.left = leftPosition + 'px';
176
206
  }
177
207
  },
178
- className: (0,classNames/* classNames */.x)(index < fixedRowsIndex && 'fixed'),
208
+ className: fixedClassName(index),
209
+ style: widthStyle(item),
179
210
  onClick: function onClick() {
180
211
  if (!item.onClickRow) return;
181
212
  emit('click', item.id);
@@ -209,13 +240,13 @@ var DataTableBase = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs
209
240
  el.style.left = leftPosition + 'px';
210
241
  }
211
242
  },
212
- className: (0,classNames/* classNames */.x)(i < fixedRowsIndex && 'fixed'),
243
+ className: fixedClassName(i),
213
244
  "data-id": item.id,
214
245
  onClick: function onClick() {
215
246
  var _a;
216
247
  return (_a = cellData === null || cellData === void 0 ? void 0 : cellData.onClickCell) === null || _a === void 0 ? void 0 : _a.call(cellData);
217
248
  },
218
- style: cellStyle,
249
+ style: bodyCellStyle(item),
219
250
  children: typeof cellValue === 'function' ? cellValue(item) : cellValue
220
251
  }, "".concat(columnKey, "__").concat(item.id));
221
252
  })
package/dist/index.js CHANGED
@@ -1799,13 +1799,15 @@ var CollapsibleMenuTrigger = /*#__PURE__*/(0,external_root_React_commonjs2_react
1799
1799
  className = props.className,
1800
1800
  asChild = props.asChild,
1801
1801
  disabled = props.disabled,
1802
- style = props.style;
1802
+ style = props.style,
1803
+ onClick = props.onClick;
1803
1804
  return (0,jsx_runtime_.jsx)(external_root_RadixUI_commonjs2_radix_ui_commonjs_radix_ui_amd_radix_ui_module_radix_ui_.Collapsible.Trigger, {
1804
1805
  ref: ref,
1805
1806
  className: (0,classNames/* classNames */.x)('nuri-theme base-collapsible-menu trigger', className),
1806
1807
  asChild: asChild,
1807
1808
  disabled: disabled,
1808
1809
  style: style,
1810
+ onClick: onClick,
1809
1811
  children: children
1810
1812
  });
1811
1813
  });
@@ -1865,11 +1867,16 @@ var CollapsibleMenu = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
1865
1867
  className = _a.className,
1866
1868
  style = _a.style,
1867
1869
  items = _a.items,
1870
+ sections = _a.sections,
1868
1871
  activeKey = _a.activeKey,
1869
1872
  onActiveKeyChange = _a.onActiveKeyChange,
1870
1873
  _b = _a.indent,
1871
1874
  indent = _b === void 0 ? 12 : _b,
1872
1875
  linkComponent = _a.linkComponent,
1876
+ _c = _a.as,
1877
+ Root = _c === void 0 ? 'nav' : _c,
1878
+ _d = _a["aria-label"],
1879
+ ariaLabel = _d === void 0 ? 'Collapsible menu' : _d,
1873
1880
  track = _a.track,
1874
1881
  trackProps = _a.trackProps;
1875
1882
  var emit = (0,useTrack/* useTrack */.n)('CollapsibleMenu', {
@@ -1890,72 +1897,94 @@ var CollapsibleMenu = /*#__PURE__*/(0,external_root_React_commonjs2_react_common
1890
1897
  onActiveKeyChange === null || onActiveKeyChange === void 0 ? void 0 : onActiveKeyChange(item.key);
1891
1898
  (_a = item.onSelect) === null || _a === void 0 ? void 0 : _a.call(item);
1892
1899
  };
1893
- var _renderItems = function renderItems(targetItems, depth) {
1900
+ var renderItem = function renderItem(item, depth) {
1901
+ var _a;
1894
1902
  var indentStyle = {
1895
1903
  paddingLeft: "".concat(depth * indent, "px")
1896
1904
  };
1897
- return targetItems.map(function (item) {
1898
- var _a;
1899
- var hasChildren = !!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length);
1900
- var isActive = activeKey === item.key;
1901
- if (hasChildren) {
1902
- var triggerClassName = (0,classNames/* classNames */.x)('collapsible-menu-trigger', 'collapsible-menu-row', _hasActiveDescendant(item) && 'is-active');
1903
- return (0,jsx_runtime_.jsxs)(base_collapsible_menu, {
1904
- defaultOpen: item.defaultOpen,
1905
+ var hasChildren = !!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length);
1906
+ var isActive = activeKey === item.key;
1907
+ if (hasChildren) {
1908
+ var triggerClassName = (0,classNames/* classNames */.x)('collapsible-menu-trigger', 'collapsible-menu-row', _hasActiveDescendant(item) && 'is-active');
1909
+ return (0,jsx_runtime_.jsxs)(base_collapsible_menu, {
1910
+ defaultOpen: item.defaultOpen,
1911
+ open: item.open,
1912
+ onOpenChange: item.onOpenChange,
1913
+ disabled: item.disabled,
1914
+ children: [(0,jsx_runtime_.jsx)(base_collapsible_menu.Trigger, {
1915
+ className: triggerClassName,
1905
1916
  disabled: item.disabled,
1906
- children: [(0,jsx_runtime_.jsx)(base_collapsible_menu.Trigger, {
1907
- className: triggerClassName,
1908
- disabled: item.disabled,
1909
- children: (0,jsx_runtime_.jsx)("span", {
1910
- className: 'collapsible-menu-left',
1911
- style: indentStyle,
1912
- children: item.item
1913
- })
1914
- }), (0,jsx_runtime_.jsx)(base_collapsible_menu.Content, {
1915
- className: 'collapsible-menu-content',
1916
- children: item.children ? _renderItems(item.children, depth + 1) : null
1917
- })]
1918
- }, item.key);
1919
- }
1920
- var itemClassName = (0,classNames/* classNames */.x)('collapsible-menu-item', 'collapsible-menu-row', isActive && 'is-active');
1921
- var left = (0,jsx_runtime_.jsx)("span", {
1922
- className: 'collapsible-menu-left',
1923
- style: indentStyle,
1924
- children: item.item
1917
+ onClick: item.onTriggerClick,
1918
+ children: (0,jsx_runtime_.jsx)("span", {
1919
+ className: 'collapsible-menu-left',
1920
+ style: indentStyle,
1921
+ children: item.item
1922
+ })
1923
+ }), (0,jsx_runtime_.jsx)(base_collapsible_menu.Content, {
1924
+ className: 'collapsible-menu-content',
1925
+ children: item.children ? renderList(item.children, depth + 1) : null
1926
+ })]
1925
1927
  });
1926
- if (item.href) {
1927
- return (0,jsx_runtime_.jsx)(Link, {
1928
- className: itemClassName,
1929
- href: item.href,
1930
- "aria-current": isActive ? 'page' : undefined,
1931
- "aria-disabled": item.disabled ? 'true' : undefined,
1932
- onClick: function onClick(e) {
1933
- if (item.disabled) {
1934
- e.preventDefault();
1935
- return;
1936
- }
1937
- selectItem(item);
1938
- },
1939
- children: left
1940
- }, item.key);
1941
- }
1942
- return (0,jsx_runtime_.jsx)("button", {
1943
- type: 'button',
1928
+ }
1929
+ var itemClassName = (0,classNames/* classNames */.x)('collapsible-menu-item', 'collapsible-menu-row', isActive && 'is-active');
1930
+ var left = (0,jsx_runtime_.jsx)("span", {
1931
+ className: 'collapsible-menu-left',
1932
+ style: indentStyle,
1933
+ children: item.item
1934
+ });
1935
+ if (item.href) {
1936
+ return (0,jsx_runtime_.jsx)(Link, {
1944
1937
  className: itemClassName,
1945
- disabled: item.disabled,
1946
- onClick: function onClick() {
1947
- return selectItem(item);
1938
+ href: item.href,
1939
+ "aria-current": isActive ? 'page' : undefined,
1940
+ "aria-disabled": item.disabled ? 'true' : undefined,
1941
+ onClick: function onClick(e) {
1942
+ if (item.disabled) {
1943
+ e.preventDefault();
1944
+ return;
1945
+ }
1946
+ selectItem(item);
1948
1947
  },
1949
1948
  children: left
1950
- }, item.key);
1949
+ });
1950
+ }
1951
+ return (0,jsx_runtime_.jsx)("button", {
1952
+ type: 'button',
1953
+ className: itemClassName,
1954
+ disabled: item.disabled,
1955
+ onClick: function onClick() {
1956
+ return selectItem(item);
1957
+ },
1958
+ children: left
1959
+ });
1960
+ };
1961
+ // reset.css 가 list-style 을 지우면 Safari 가 목록 의미를 버리므로 role 을 직접 단다.
1962
+ var renderList = function renderList(targetItems, depth) {
1963
+ return (0,jsx_runtime_.jsx)("ul", {
1964
+ className: 'collapsible-menu-list',
1965
+ role: 'list',
1966
+ children: targetItems.map(function (item) {
1967
+ return (0,jsx_runtime_.jsx)("li", {
1968
+ children: renderItem(item, depth)
1969
+ }, item.key);
1970
+ })
1951
1971
  });
1952
1972
  };
1953
- return (0,jsx_runtime_.jsx)("nav", {
1973
+ var renderSection = function renderSection(section) {
1974
+ return (0,jsx_runtime_.jsxs)("div", {
1975
+ className: 'collapsible-menu-section',
1976
+ children: [section.title ? (0,jsx_runtime_.jsx)("div", {
1977
+ className: 'collapsible-menu-section-title',
1978
+ children: section.title
1979
+ }) : null, renderList(section.items, 0)]
1980
+ }, section.key);
1981
+ };
1982
+ return (0,jsx_runtime_.jsxs)(Root, {
1954
1983
  ref: ref,
1955
1984
  className: rootClassName,
1956
1985
  style: style,
1957
- "aria-label": 'Collapsible menu',
1958
- children: _renderItems(items, 0)
1986
+ "aria-label": Root === 'nav' ? ariaLabel : undefined,
1987
+ children: [items.length ? renderList(items, 0) : null, sections === null || sections === void 0 ? void 0 : sections.map(renderSection)]
1959
1988
  });
1960
1989
  });
1961
1990
  CollapsibleMenu.displayName = 'CollapsibleMenu';
@@ -6269,6 +6298,15 @@ var table_props_assign = undefined && undefined.__assign || function () {
6269
6298
  return table_props_assign.apply(this, arguments);
6270
6299
  };
6271
6300
  var dataTableCommonProps = {};
6301
+ var variants = ['plain', 'padded'];
6302
+ var dataTableProps = {
6303
+ variant: {
6304
+ type: 'className',
6305
+ className: 'variant',
6306
+ values: variants,
6307
+ "default": 'plain'
6308
+ }
6309
+ };
6272
6310
  var dataTableHeaderProps = table_props_assign(table_props_assign({}, dataTableCommonProps), {
6273
6311
  headerHeight: {
6274
6312
  type: 'css',
@@ -6290,6 +6328,16 @@ var dataTableCellProps = table_props_assign(table_props_assign({}, dataTableComm
6290
6328
  }
6291
6329
  });
6292
6330
  ;// ./components/table/data-table.tsx
6331
+ var data_table_assign = undefined && undefined.__assign || function () {
6332
+ data_table_assign = Object.assign || function (t) {
6333
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6334
+ s = arguments[i];
6335
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6336
+ }
6337
+ return t;
6338
+ };
6339
+ return data_table_assign.apply(this, arguments);
6340
+ };
6293
6341
 
6294
6342
 
6295
6343
 
@@ -6302,16 +6350,27 @@ var DataTableBase = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs
6302
6350
  columns = props.columns,
6303
6351
  _a = props.fixedRowsIndex,
6304
6352
  fixedRowsIndex = _a === void 0 ? 0 : _a,
6305
- className = props.className,
6306
6353
  track = props.track,
6307
6354
  trackProps = props.trackProps;
6308
6355
  var emit = (0,useTrack/* useTrack */.n)('DataTable', {
6309
6356
  track: track,
6310
6357
  trackProps: trackProps
6311
6358
  });
6359
+ var className = (0,getMergedProps/* getMergedProps */.p)(props, dataTableProps).className;
6312
6360
  var headerStyle = (0,getMergedProps/* getMergedProps */.p)(props, dataTableHeaderProps).style;
6313
6361
  var rowStyle = (0,getMergedProps/* getMergedProps */.p)(props, dataTableRowProps).style;
6314
6362
  var cellStyle = (0,getMergedProps/* getMergedProps */.p)(props, dataTableCellProps).style;
6363
+ var widthStyle = function widthStyle(item) {
6364
+ return item.width == null ? undefined : {
6365
+ width: item.width
6366
+ };
6367
+ };
6368
+ var bodyCellStyle = function bodyCellStyle(item) {
6369
+ return data_table_assign(data_table_assign({}, cellStyle), widthStyle(item));
6370
+ };
6371
+ var fixedClassName = function fixedClassName(index) {
6372
+ return (0,classNames/* classNames */.x)(index < fixedRowsIndex && 'fixed', index === fixedRowsIndex - 1 && 'fixed-last');
6373
+ };
6315
6374
  return (0,jsx_runtime_.jsxs)(base_table, {
6316
6375
  ref: ref,
6317
6376
  className: (0,classNames/* classNames */.x)('data-table', className),
@@ -6336,7 +6395,8 @@ var DataTableBase = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs
6336
6395
  el.style.left = leftPosition + 'px';
6337
6396
  }
6338
6397
  },
6339
- className: (0,classNames/* classNames */.x)(index < fixedRowsIndex && 'fixed'),
6398
+ className: fixedClassName(index),
6399
+ style: widthStyle(item),
6340
6400
  onClick: function onClick() {
6341
6401
  if (!item.onClickRow) return;
6342
6402
  emit('click', item.id);
@@ -6370,13 +6430,13 @@ var DataTableBase = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs
6370
6430
  el.style.left = leftPosition + 'px';
6371
6431
  }
6372
6432
  },
6373
- className: (0,classNames/* classNames */.x)(i < fixedRowsIndex && 'fixed'),
6433
+ className: fixedClassName(i),
6374
6434
  "data-id": item.id,
6375
6435
  onClick: function onClick() {
6376
6436
  var _a;
6377
6437
  return (_a = cellData === null || cellData === void 0 ? void 0 : cellData.onClickCell) === null || _a === void 0 ? void 0 : _a.call(cellData);
6378
6438
  },
6379
- style: cellStyle,
6439
+ style: bodyCellStyle(item),
6380
6440
  children: typeof cellValue === 'function' ? cellValue(item) : cellValue
6381
6441
  }, "".concat(columnKey, "__").concat(item.id));
6382
6442
  })
package/dist/reset.css CHANGED
@@ -4,6 +4,10 @@
4
4
  padding: 0;
5
5
  box-sizing: border-box;
6
6
  }
7
+ *::before,
8
+ *::after {
9
+ box-sizing: border-box;
10
+ }
7
11
  /* 기본 폰트 설정 및 텍스트 렌더링 최적화 */
8
12
  html {
9
13
  -webkit-text-size-adjust: 100%;
package/dist/styles.css CHANGED
@@ -512,6 +512,8 @@
512
512
  'Twemoji Country Flags',
513
513
  'Pretendard',
514
514
  Pretendard,
515
+ 'Pretendard Variable',
516
+ PretendardVariable,
515
517
  -apple-system,
516
518
  BlinkMacSystemFont,
517
519
  system-ui,
@@ -538,6 +540,10 @@
538
540
  padding: 0;
539
541
  box-sizing: border-box;
540
542
  }
543
+ *::before,
544
+ *::after {
545
+ box-sizing: border-box;
546
+ }
541
547
  /* 기본 폰트 설정 및 텍스트 렌더링 최적화 */
542
548
  html {
543
549
  -webkit-text-size-adjust: 100%;
@@ -709,7 +715,8 @@ p {
709
715
  /*
710
716
  * 공용 키프레임. 컴포넌트 CSS 는 @keyframes 를 두지 않고 이 이름을 쓴다(빌드 R18).
711
717
  * 시간·곡선은 쓰는 쪽 animation 에서 --motion-{토큰}-* 로 준다. 여기는 모양만 정한다.
712
- * 쓰는 쪽이 두는 입력 변수: --motion-slide-offset(transform 값), --motion-swipe-from, --motion-swipe-to.
718
+ * 쓰는 쪽이 두는 입력 변수: --motion-slide-offset(transform 값), --motion-swipe-from, --motion-swipe-to,
719
+ * --motion-content-height(펼친 높이. Radix 의 --radix-collapsible-content-height 등).
713
720
  */
714
721
  @keyframes motion-enter-fade {
715
722
  from {
@@ -866,6 +873,24 @@ p {
866
873
  transform: translateY(calc(var(--motion-attention-float-distance) * -1));
867
874
  }
868
875
  }
876
+ @keyframes motion-enter-expand {
877
+ from {
878
+ height: 0;
879
+ overflow: hidden;
880
+ }
881
+ to {
882
+ height: var(--motion-content-height);
883
+ overflow: hidden;
884
+ }
885
+ }
886
+ @keyframes motion-exit-expand {
887
+ from {
888
+ height: var(--motion-content-height);
889
+ }
890
+ to {
891
+ height: 0;
892
+ }
893
+ }
869
894
  /* Component */
870
895
  .base-avatar {
871
896
  border-radius: 50%;
@@ -1378,10 +1403,11 @@ p {
1378
1403
  .cta-button.variant-neutral {
1379
1404
  background-color: var(--color-white);
1380
1405
  color: var(--color-purple-900);
1406
+
1407
+ /* 호버 때만 테두리를 그리면 그만큼 커져 덜컹거린다. 배경과 같은 색이라 보이지도 않아 테두리는 두지 않는다 */
1381
1408
  }
1382
1409
  .cta-button.variant-neutral:not(:disabled):hover {
1383
1410
  background-color: var(--color-grey-scale-100);
1384
- border: var(--hairline) solid var(--color-grey-scale-100);
1385
1411
  color: var(--color-purple-900);
1386
1412
  }
1387
1413
  .cta-button.variant-confirm {
@@ -1509,6 +1535,8 @@ p {
1509
1535
  .base-callout::after {
1510
1536
  content: '';
1511
1537
  position: absolute;
1538
+ /* reset.css 가 가상 요소도 border-box 로 바꿔도 테두리가 정사각형 밖에 붙게 둔다 */
1539
+ box-sizing: content-box;
1512
1540
  width: var(--spacing-8);
1513
1541
  height: var(--spacing-8);
1514
1542
  border: 0 solid var(--color-purple-300);
@@ -1720,6 +1748,34 @@ p {
1720
1748
  flex-direction: column;
1721
1749
  gap: var(--spacing-4);
1722
1750
  }
1751
+ /* reset.css 없이 components.css 만 가져온 앱에서도 글머리표·들여쓰기가 생기지 않게 한다. */
1752
+ .collapsible-menu-list {
1753
+ display: flex;
1754
+ flex-direction: column;
1755
+ gap: var(--spacing-4);
1756
+ margin: 0;
1757
+ padding: 0;
1758
+ list-style: none;
1759
+ }
1760
+ .collapsible-menu-list > li {
1761
+ margin: 0;
1762
+ padding: 0;
1763
+ }
1764
+ .collapsible-menu-section {
1765
+ display: flex;
1766
+ flex-direction: column;
1767
+ gap: var(--spacing-4);
1768
+ }
1769
+ .collapsible-menu-list + .collapsible-menu-section,.collapsible-menu-section + .collapsible-menu-section {
1770
+ margin-top: var(--spacing-12);
1771
+ }
1772
+ .collapsible-menu-section-title {
1773
+ padding: 0 var(--spacing-12);
1774
+ font-size: var(--font-size-xsm);
1775
+ line-height: var(--line-height-xsm);
1776
+ font-weight: var(--font-weight-medium);
1777
+ color: var(--collapsible-menu-section-title-color, var(--color-grey-scale-500));
1778
+ }
1723
1779
  .collapsible-menu.size-s .collapsible-menu-row {
1724
1780
  height: var(--menu-row-height-s);
1725
1781
  }
@@ -1781,6 +1837,24 @@ p {
1781
1837
  gap: var(--spacing-2);
1782
1838
  margin-top: var(--spacing-2);
1783
1839
  margin-bottom: var(--spacing-4);
1840
+ /* 여닫는 높이. 여백은 이 상자 밖에 있어 Radix 가 잰 높이와 맞고, 열린 채로 둘 때는 overflow 를 숨기지 않는다. */
1841
+ --motion-content-height: var(--radix-collapsible-content-height);
1842
+ }
1843
+ .collapsible-menu-content[data-state='open'] {
1844
+ animation: motion-enter-expand var(--motion-expand-duration) var(--motion-expand-ease);
1845
+ }
1846
+ .collapsible-menu-content[data-state='closed'] {
1847
+ overflow: hidden;
1848
+ animation: motion-exit-expand var(--motion-expand-duration) var(--motion-expand-ease);
1849
+ }
1850
+ .collapsible-menu-content .collapsible-menu-list {
1851
+ gap: var(--spacing-2);
1852
+ }
1853
+ @media (prefers-reduced-motion: reduce) {
1854
+ .collapsible-menu-content[data-state='open'],
1855
+ .collapsible-menu-content[data-state='closed'] {
1856
+ animation: none;
1857
+ }
1784
1858
  }
1785
1859
  .base-description-list {
1786
1860
  display: flex;
@@ -1959,6 +2033,11 @@ p {
1959
2033
  justify-content: space-between;
1960
2034
  gap: var(--spacing-10);
1961
2035
  }
2036
+ /* popper 는 높이를 정하지 않아 긴 목록(나라 221개)이 화면 밖으로 넘치고 스크롤도 안 된다.
2037
+ 화면에 남은 높이까지만 쓰고 Viewport 가 스크롤한다 */
2038
+ .base-drop-down.content {
2039
+ max-height: var(--radix-select-content-available-height);
2040
+ }
1962
2041
  /***************************************************************************************************
1963
2042
  * *
1964
2043
  * drop-down-single *
@@ -3809,6 +3888,27 @@ button.modal-with-double-button-close-button {
3809
3888
  z-index: var(--z-sticky-header);
3810
3889
  border-bottom: var(--hairline) solid var(--color-grey-scale-200);
3811
3890
  }
3891
+ /*
3892
+ * variant-padded: 셀 여백·글자 기본값과 마지막 고정 열 경계선. plain 은 셀 내용이 모양을 정한다.
3893
+ * :where 로 특이도를 (0,2,0) 에 묶어 쓰는 쪽 CSS 가 같은 특이도로 덮어쓸 수 있게 한다.
3894
+ */
3895
+ :where(.data-table.variant-padded) .data-table-header .cell {
3896
+ padding: var(--data-table-cell-padding, var(--spacing-8) var(--spacing-12));
3897
+ font-size: var(--font-size-sm);
3898
+ line-height: var(--line-height-sm);
3899
+ font-weight: var(--font-weight-semibold);
3900
+ color: var(--data-table-header-color, var(--color-grey-scale-500));
3901
+ }
3902
+ :where(.data-table.variant-padded) .body .cell {
3903
+ padding: var(--data-table-cell-padding, var(--spacing-8) var(--spacing-12));
3904
+ font-size: var(--font-size-sm);
3905
+ line-height: var(--line-height-sm);
3906
+ color: var(--data-table-cell-color, var(--color-grey-scale-900));
3907
+ }
3908
+ /* 마지막 고정 열의 경계선. border-collapse 표의 border 는 sticky 셀과 함께 움직이지 않아 그림자로 셀 안에 그린다 */
3909
+ :where(.data-table.variant-padded) .fixed-last {
3910
+ box-shadow: inset calc(var(--hairline) * -1) 0 0 var(--color-grey-scale-200);
3911
+ }
3812
3912
  .data-table-row {
3813
3913
  position: relative;
3814
3914
  border-bottom: var(--hairline) solid var(--color-grey-scale-200);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nurihaus/web-design-system",
3
- "version": "3.9.0",
3
+ "version": "3.9.2",
4
4
  "description": "Nurihaus 디자인 시스템 — 컴포넌트와 디자인 토큰",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",