@nurihaus/web-design-system 3.9.1 → 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/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;
@@ -3814,6 +3888,27 @@ button.modal-with-double-button-close-button {
3814
3888
  z-index: var(--z-sticky-header);
3815
3889
  border-bottom: var(--hairline) solid var(--color-grey-scale-200);
3816
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
+ }
3817
3912
  .data-table-row {
3818
3913
  position: relative;
3819
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.1",
3
+ "version": "3.9.2",
4
4
  "description": "Nurihaus 디자인 시스템 — 컴포넌트와 디자인 토큰",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",