sellmate-design-system-react 9.0.0-beta.11 → 9.0.0-beta.13

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/AGENTS.md CHANGED
@@ -1106,14 +1106,16 @@ const columns: STableColumn[] = [
1106
1106
 
1107
1107
  - **항목 하나의 속성을 나열하는 것은 목록이 아니다.** `라벨: 값` 이 세로로 쌓이는 것은 `SKeyValueTable` 이다 (§4-4).
1108
1108
  - `SList` 는 레이아웃만 담당한다. 펼침·단일 선택 동작이 필요하면 `SExpansionList` 다 (§3-7-7).
1109
- - **항목 사이 구분선은 리스트가 그린다.** `SListItem`·`SExpansionItem`·`SDraggableItem` 스스로 구분선을 그리지 않으므로, 목록을 감싸는 `SList`·`SExpansionList`·`SDraggableList` `separator` 준다 아이템에 `border-b` 직접 붙이지 않는다. 테두리형(`bordered`)은 테두리가 구분 역할을 하므로 `separator` 대신 `useGap` 으로 띄운다.
1109
+ - **`SList` 자식은 `SListItem` 권장한다.** 다른 자식도 그대로 렌더되지만, 펼치는 항목은 `SExpansionList` + `SExpansionItem` 이, 끌어서 순서를 바꾸는 항목은 `SDraggableList` + `SDraggableItem` 여닫힘·선택·정렬 동작까지 함께 관리하므로 그쪽을 쓴다 (§3-7-7).
1110
+ - **항목 사이 구분선은 리스트가 알아서 그린다.** `SListItem`·`SExpansionItem`·`SDraggableItem` 셋 다 스스로 구분선을 그리지 않는다. `SList`·`SExpansionList`·`SDraggableList` 가 자식 **사이에** 구분선을 넣으므로 아이템에 `border-b` 를 직접 붙이지 않고, 켜는 prop 도 따로 없다. 마지막 항목 아래에는 선이 남지 않는다. 테두리형(`bordered`)은 테두리가 구분 역할을 하므로 리스트가 구분선을 빼고, `useGap` 으로 띄운다 — `useGap` 을 준 목록에도 구분선은 들어가지 않는다.
1110
1111
  - **`SListItem` 은 기본이 표시 전용이다.** 눌러서 이동·선택하게 하려면 `clickable` 을 준다 — hover·`selected`·`interaction="chevron"` 표현이 전부 여기에 딸려 있어서, `clickable` 없이 `selected` 만 주면 선택 표시가 나오지 않는다. `SExpansionList` 는 선택을 자기가 관리하므로 자식 아이템을 알아서 클릭 가능하게 만든다.
1111
1112
 
1112
1113
  ```tsx
1113
- ✅ <SList separator><SListItem title="일반 문의" />…</SList> {/* 줄로 구분되는 목록 */}
1114
+ ✅ <SList><SListItem title="일반 문의" />…</SList> {/* 줄로 구분되는 목록 — 구분선은 자동 */}
1114
1115
  ✅ <SList useGap><SListItem title="일반 문의" bordered />…</SList> {/* 카드처럼 떨어진 목록 */}
1115
1116
  ✅ <SListItem title="일반 문의" clickable selected onClick={…} /> {/* 눌러서 고르는 목록 */}
1116
- ❌ <SList><SListItem title="일반 문의" className="border-b" />…</SList>
1117
+ ❌ <SList><SListItem title="일반 문의" className="border-b" />…</SList> {/* 구분선을 직접 붙이지 않는다 */}
1118
+ ❌ <SList><><SListItem title="일반 문의" /><SListItem title="결제 문의" /></></SList> {/* Fragment 로 묶으면 그 안쪽은 구분되지 않는다 */}
1117
1119
  ❌ <SListItem title="일반 문의" selected /> {/* clickable 없으면 선택 표시가 안 나온다 */}
1118
1120
  ```
1119
1121
 
@@ -1125,7 +1127,7 @@ const columns: STableColumn[] = [
1125
1127
  | **한 번에 하나만** 열려야 한다 (아코디언) | `SExpansionList` + `SExpansionItem` |
1126
1128
  | **부모-자식 계층 자체**를 보여줘야 한다 (2단 이상, 연결선) | `STree` |
1127
1129
 
1128
- `SExpansionList` 는 depth 별 단일 확장·선택을 관리하는 wrapper 다. 직접 `useState` 로 "열린 항목 하나"를 들고 있지 않는다. 항목 사이 구분선은 여기서도 리스트가 그린다 — `separator` 준다 (§3-7-6).
1130
+ `SExpansionList` 는 depth 별 단일 확장·선택을 관리하는 wrapper 다. 직접 `useState` 로 "열린 항목 하나"를 들고 있지 않는다. 항목 사이 구분선은 여기서도 리스트가 알아서 그린다 — 따로 prop 이 없다 (§3-7-6).
1129
1131
 
1130
1132
  #### 3-7-8. SCard vs SSectionHeaderCard
1131
1133
 
@@ -16,6 +16,7 @@
16
16
 
17
17
  - [SCalendar](../SCalendar)
18
18
  - [SDateRangePicker](../SDateRangePicker)
19
+ - [SList](../SList)
19
20
  - [STableBar](../STableBar)
20
21
 
21
22
  ### Graph
@@ -24,6 +25,7 @@
24
25
  graph TD;
25
26
  SCalendar --> SDivider
26
27
  SDateRangePicker --> SDivider
28
+ SList --> SDivider
27
29
  STableBar --> SDivider
28
30
  style SDivider fill:#f9f,stroke:#333,stroke-width:4px
29
31
  ```
@@ -19,10 +19,15 @@
19
19
  - [SDraggableList](../SDraggableList)
20
20
  - [SExpansionList](../SExpansionList)
21
21
 
22
+ ### Depends on
23
+
24
+ - [SDivider](../SDivider)
25
+
22
26
  ### Graph
23
27
 
24
28
  ```mermaid
25
29
  graph TD;
30
+ SList --> SDivider
26
31
  SDraggableList --> SList
27
32
  SExpansionList --> SList
28
33
  style SList fill:#f9f,stroke:#333,stroke-width:4px
package/dist/index.cjs CHANGED
@@ -3654,7 +3654,49 @@ var SDraggableItemImpl = /* @__PURE__ */ react.forwardRef(function SDraggableIte
3654
3654
  ] });
3655
3655
  });
3656
3656
  var SDraggableItem2 = /* @__PURE__ */ withDisplayName(SDraggableItemImpl, "SDraggableItem");
3657
+ var SDivider = /* @__PURE__ */ react.forwardRef(function SDivider2({ vertical = false, className, style, ...rest }, ref) {
3658
+ return /* @__PURE__ */ jsxRuntime.jsx(
3659
+ "hr",
3660
+ {
3661
+ ref,
3662
+ "aria-orientation": vertical ? "vertical" : "horizontal",
3663
+ className: cn(
3664
+ "shrink-0 border-0",
3665
+ vertical ? "inline-block h-auto w-px self-stretch" : "block h-px w-full",
3666
+ className
3667
+ ),
3668
+ style: { backgroundColor: "var(--sys-color-divider-default, #E1E1E1)", ...style },
3669
+ ...rest
3670
+ }
3671
+ );
3672
+ });
3673
+ var dividerStyle = { backgroundColor: "var(--cmp-listItem-border-default)" };
3674
+ function hasBorderedChild(children) {
3675
+ let bordered = false;
3676
+ react.Children.forEach(children, (child) => {
3677
+ if (!react.isValidElement(child)) return;
3678
+ if (child.props.bordered === true) {
3679
+ bordered = true;
3680
+ return;
3681
+ }
3682
+ react.Children.forEach(child.props.children, (wrapped) => {
3683
+ if (react.isValidElement(wrapped) && wrapped.props.bordered === true) {
3684
+ bordered = true;
3685
+ }
3686
+ });
3687
+ });
3688
+ return bordered;
3689
+ }
3690
+ function withDividers(children) {
3691
+ return react.Children.toArray(children).flatMap(
3692
+ (child, index) => index === 0 ? [child] : [
3693
+ /* @__PURE__ */ jsxRuntime.jsx(SDivider, { "aria-hidden": "true", style: dividerStyle }, `s-list-divider-${index}`),
3694
+ child
3695
+ ]
3696
+ );
3697
+ }
3657
3698
  var SListImpl = /* @__PURE__ */ react.forwardRef(function SList({ className, children, useGap = false, usePadding = false, ...rest }, ref) {
3699
+ const showDivider = !useGap && !hasBorderedChild(children);
3658
3700
  return /* @__PURE__ */ jsxRuntime.jsx(
3659
3701
  "div",
3660
3702
  {
@@ -3662,11 +3704,10 @@ var SListImpl = /* @__PURE__ */ react.forwardRef(function SList({ className, chi
3662
3704
  className: cn(
3663
3705
  useGap && "flex flex-col gap-(--cmp-list-group-gap)",
3664
3706
  usePadding && "p-(--cmp-list-group-padding)",
3665
- "[&>*]:border-b [&>*]:border-(--cmp-listItem-border-default)",
3666
3707
  className
3667
3708
  ),
3668
3709
  ...rest,
3669
- children
3710
+ children: showDivider ? withDividers(children) : children
3670
3711
  }
3671
3712
  );
3672
3713
  });
@@ -5381,22 +5422,6 @@ var SSectionHeaderCardRootImpl = /* @__PURE__ */ react.forwardRef(
5381
5422
  }
5382
5423
  );
5383
5424
  var SSectionHeaderCard2 = /* @__PURE__ */ withDisplayName(SSectionHeaderCardRootImpl, "SSectionHeaderCard");
5384
- var SDivider = /* @__PURE__ */ react.forwardRef(function SDivider2({ vertical = false, className, style, ...rest }, ref) {
5385
- return /* @__PURE__ */ jsxRuntime.jsx(
5386
- "hr",
5387
- {
5388
- ref,
5389
- "aria-orientation": vertical ? "vertical" : "horizontal",
5390
- className: cn(
5391
- "shrink-0 border-0",
5392
- vertical ? "inline-block h-auto w-px self-stretch" : "block h-px w-full",
5393
- className
5394
- ),
5395
- style: { backgroundColor: "var(--sys-color-divider-default, #E1E1E1)", ...style },
5396
- ...rest
5397
- }
5398
- );
5399
- });
5400
5425
 
5401
5426
  // src/lib/scrollbar.ts
5402
5427
  var FIREFOX_SCROLLBAR_CLASS = "supports-[not_selector(::-webkit-scrollbar)]:[scrollbar-width:thin] supports-[not_selector(::-webkit-scrollbar)]:[scrollbar-color:var(--color-grey-45)_transparent]";
@@ -5479,7 +5504,7 @@ var SSplitterRoot = /* @__PURE__ */ react.forwardRef(function SSplitter({
5479
5504
  vertical = false,
5480
5505
  disabled = false,
5481
5506
  dividerClassName,
5482
- dividerStyle,
5507
+ dividerStyle: dividerStyle2,
5483
5508
  className,
5484
5509
  style,
5485
5510
  children,
@@ -5604,7 +5629,7 @@ var SSplitterRoot = /* @__PURE__ */ react.forwardRef(function SSplitter({
5604
5629
  ),
5605
5630
  style: {
5606
5631
  ...vertical ? { bottom: HIT_END, height: HIT } : { right: HIT_END, width: HIT },
5607
- ...dividerStyle
5632
+ ...dividerStyle2
5608
5633
  },
5609
5634
  children: /* @__PURE__ */ jsxRuntime.jsx(
5610
5635
  "span",
@@ -7011,7 +7036,7 @@ function SModalContainer({
7011
7036
  "div",
7012
7037
  {
7013
7038
  className: cn(
7014
- "relative flex max-h-[85dvh] max-w-[calc(100dvw-48px)] flex-col overflow-hidden rounded-[var(--cmp-modal-radius)] bg-[var(--cmp-modal-bg)] shadow-normal-md",
7039
+ "relative flex max-h-[calc(100dvh-48px)] max-w-[calc(100dvw-48px)] flex-col overflow-hidden rounded-[var(--cmp-modal-radius)] bg-[var(--cmp-modal-bg)] shadow-normal-md",
7015
7040
  shaking && "animate-modal-shake",
7016
7041
  className
7017
7042
  ),
@@ -7268,7 +7293,7 @@ function SActionModal({
7268
7293
  showClose: true,
7269
7294
  width,
7270
7295
  height,
7271
- className: "w-fit min-w-[min(480px,calc(100dvw-48px))] min-h-[min(320px,85dvh)]",
7296
+ className: "w-fit min-w-[min(480px,calc(100dvw-48px))] min-h-[min(320px,calc(100dvh-48px))]",
7272
7297
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-auto flex-col", children: [
7273
7298
  /* @__PURE__ */ jsxRuntime.jsx(SOverlayHeader, { title: modalTitle, description, reserveCloseSpace: true }),
7274
7299
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-auto px-[var(--cmp-modal-action-body-paddingX)] pb-[var(--cmp-modal-action-body-paddingBottom)]", children }),