sellmate-design-system-react 4.1.0 → 4.2.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/dist/index.js CHANGED
@@ -6933,6 +6933,8 @@ var GNB_RAIL_WIDTH = 68;
6933
6933
  var GNB_FOLD_MS = 200;
6934
6934
  var GNB_EXPAND_MS = 200;
6935
6935
  var GNB_MENU_WIDTH = 240;
6936
+ var GNB_FULL_LOGO_WIDTH = 140;
6937
+ var GNB_TOP_ICON_GAP = 8;
6936
6938
  function findGnbRailValue(items, value) {
6937
6939
  if (items.some((item) => item.value === value)) return value;
6938
6940
  return findGnbAncestors(items, value)[0];
@@ -7037,6 +7039,7 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
7037
7039
  onFoldChange,
7038
7040
  onLauncherClick,
7039
7041
  logo,
7042
+ topContent,
7040
7043
  railFooter,
7041
7044
  menuFooter,
7042
7045
  foldedFooter,
@@ -7268,13 +7271,67 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
7268
7271
  ...style
7269
7272
  };
7270
7273
  const hideAfterSlide = (hidden) => `visibility 0s linear ${hidden ? `${GNB_FOLD_MS}ms` : "0s"}`;
7271
- const foldInline = !!logo;
7272
7274
  const sideFoldStyle = {
7273
7275
  opacity: railFolded ? 0 : 1,
7274
7276
  position: railFolded ? "absolute" : "static",
7275
7277
  visibility: railFolded ? "hidden" : "visible",
7276
7278
  transition: `opacity ${GNB_FOLD_MS}ms ease-out, ${hideAfterSlide(railFolded)}`
7277
7279
  };
7280
+ const launcherButton = onLauncherClick ? /* @__PURE__ */ jsx(
7281
+ SGhostButton,
7282
+ {
7283
+ icon: "launcher",
7284
+ size: "xs",
7285
+ intent: color === "dark" ? "inverse" : "default",
7286
+ ariaLabel: "app launcher",
7287
+ onClick: onLauncherClick,
7288
+ className: "shrink-0",
7289
+ style: { ...sideFoldStyle, marginRight: header === "fix" ? H.topGap : GNB_TOP_ICON_GAP }
7290
+ },
7291
+ "launcher"
7292
+ ) : null;
7293
+ const foldButton = /* @__PURE__ */ jsx(
7294
+ SGhostButton,
7295
+ {
7296
+ icon: "sidebar",
7297
+ size: "xs",
7298
+ intent: color === "dark" ? "inverse" : "default",
7299
+ ariaLabel: "toggle navigation",
7300
+ ariaPressed: folded,
7301
+ onClick: handleFoldToggle,
7302
+ className: cn("shrink-0", header === "fix" && "ml-auto")
7303
+ },
7304
+ "fold"
7305
+ );
7306
+ const logoBox = logo ? /* @__PURE__ */ jsx(
7307
+ "div",
7308
+ {
7309
+ className: "flex shrink-0 items-center",
7310
+ style: {
7311
+ height: H.logoHeight,
7312
+ ...header === "full" ? (
7313
+ // full 은 전폭이라 로고 자리가 고정이다 — 폭 140px(디자인 스펙, 전용 토큰 없음)로 못 박아
7314
+ // 로고 내용이 바뀌어도 오른쪽 topContent 시작점이 흔들리지 않게 한다.
7315
+ { width: GNB_FULL_LOGO_WIDTH, marginLeft: H.topGap }
7316
+ ) : (
7317
+ // fix 는 폴드가 ml-auto 로 밀려나므로(margin-left 를 못 쓴다) 로고 오른쪽에 최소 간격을 둔다
7318
+ { marginRight: H.topGap }
7319
+ ),
7320
+ ...sideFoldStyle
7321
+ },
7322
+ children: logo
7323
+ },
7324
+ "logo"
7325
+ ) : null;
7326
+ const topContentBox = header === "full" && topContent ? /* @__PURE__ */ jsx(
7327
+ "div",
7328
+ {
7329
+ className: "flex min-w-0 flex-1 items-center",
7330
+ style: { marginLeft: H.topGap },
7331
+ children: topContent
7332
+ },
7333
+ "topContent"
7334
+ ) : null;
7278
7335
  return /* @__PURE__ */ jsxs(
7279
7336
  "div",
7280
7337
  {
@@ -7292,8 +7349,9 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
7292
7349
  className: "relative box-border flex shrink-0 items-center overflow-hidden",
7293
7350
  style: {
7294
7351
  height: H.topHeight,
7295
- // 인라인 간격은 컨테이너 gap 대신 각 요소 margin 으로 준다 — 런처↔폴드(8px)와
7296
- // 폴드↔로고(top-gap)를 다르게 두기 위함. 접히면 런처·로고가 흐름에서 빠져 margin 도 무의미해진다.
7352
+ // 간격은 컨테이너 gap 대신 각 요소 margin 으로 준다 — 순서가 header 마다 달라
7353
+ // 이웃 쌍마다 값이 다르기 때문(위 launcherButton/logoBox 주석).
7354
+ // 접히면 런처·로고가 흐름에서 빠져 margin 도 무의미해진다.
7297
7355
  padding: `0 ${railFolded ? GNB_RAIL.padding : H.topPaddingX}`,
7298
7356
  borderBottom: `1px solid ${C.topBorder}`,
7299
7357
  backgroundColor: C.panelBg,
@@ -7302,90 +7360,16 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
7302
7360
  // 아이콘 버튼은 자체 ghostButton 토큰을 쓰므로, 이 색은 logo 슬롯 상속용
7303
7361
  color: C.itemColorDefault
7304
7362
  },
7305
- children: foldInline ? (
7306
- // 런처(있을 때)·폴드·로고를 흐름에 나란히 둔다 → 폴드 버튼이 (런처와) 로고 사이에 선다.
7307
- // 접히면 런처·로고가 페이드하며 흐름에서 빠지고(sideFoldStyle), 폴드 버튼만 남아 레일 가운데에 선다.
7308
- /* @__PURE__ */ jsxs(Fragment, { children: [
7309
- onLauncherClick && /* @__PURE__ */ jsx(
7310
- SGhostButton,
7311
- {
7312
- icon: "launcher",
7313
- size: "xs",
7314
- intent: color === "dark" ? "inverse" : "default",
7315
- ariaLabel: "app launcher",
7316
- onClick: onLauncherClick,
7317
- className: "shrink-0",
7318
- style: { ...sideFoldStyle, marginRight: "8px" }
7319
- }
7320
- ),
7321
- /* @__PURE__ */ jsx(
7322
- SGhostButton,
7323
- {
7324
- icon: "sidebar",
7325
- size: "xs",
7326
- intent: color === "dark" ? "inverse" : "default",
7327
- ariaLabel: "toggle navigation",
7328
- ariaPressed: folded,
7329
- onClick: handleFoldToggle,
7330
- className: "shrink-0"
7331
- }
7332
- ),
7333
- /* @__PURE__ */ jsx(
7334
- "div",
7335
- {
7336
- className: "flex shrink-0 items-center",
7337
- style: { height: H.logoHeight, marginLeft: H.topGap, ...sideFoldStyle },
7338
- children: logo
7339
- }
7340
- )
7341
- ] })
7342
- ) : (
7343
- // 런처·로고는 좌측 그룹(흐름에서 빼 폭 축소 중 폴드 버튼을 밀어내지 않는다),
7344
- // 폴드 버튼은 우측 끝(ml-auto)이라 폭·패딩이 줄면 저절로 레일 가운데에 선다.
7345
- /* @__PURE__ */ jsxs(Fragment, { children: [
7346
- (onLauncherClick || logo) && /* @__PURE__ */ jsxs(
7347
- "div",
7348
- {
7349
- className: "absolute inset-y-0 flex items-center",
7350
- style: {
7351
- left: H.topPaddingX,
7352
- gap: H.topGap,
7353
- opacity: railFolded ? 0 : 1,
7354
- transition: `opacity ${GNB_FOLD_MS}ms ease-out, ${hideAfterSlide(railFolded)}, transform ${GNB_FOLD_MS}ms ease-out`,
7355
- // 메뉴와 같은 방향으로 빠지되, 좁은 레일 안에서 꼬리가 비치지 않게 페이드가 거리를 대신한다
7356
- transform: railFolded ? `translateX(-${H.topPaddingX})` : "none",
7357
- visibility: railFolded ? "hidden" : "visible"
7358
- },
7359
- children: [
7360
- onLauncherClick && /* @__PURE__ */ jsx(
7361
- SGhostButton,
7362
- {
7363
- icon: "launcher",
7364
- size: "xs",
7365
- intent: color === "dark" ? "inverse" : "default",
7366
- ariaLabel: "app launcher",
7367
- onClick: onLauncherClick,
7368
- className: "shrink-0"
7369
- }
7370
- ),
7371
- logo && /* @__PURE__ */ jsx("div", { className: "flex items-center", style: { height: H.logoHeight }, children: logo })
7372
- ]
7373
- }
7374
- ),
7375
- /* @__PURE__ */ jsx(
7376
- SGhostButton,
7377
- {
7378
- icon: "sidebar",
7379
- size: "xs",
7380
- intent: color === "dark" ? "inverse" : "default",
7381
- ariaLabel: "toggle navigation",
7382
- ariaPressed: folded,
7383
- onClick: handleFoldToggle,
7384
- className: "ml-auto shrink-0"
7385
- }
7386
- )
7387
- ] })
7388
- )
7363
+ children: header === "fix" ? /* @__PURE__ */ jsxs(Fragment, { children: [
7364
+ launcherButton,
7365
+ logoBox,
7366
+ foldButton
7367
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
7368
+ launcherButton,
7369
+ foldButton,
7370
+ logoBox,
7371
+ topContentBox
7372
+ ] })
7389
7373
  }
7390
7374
  ),
7391
7375
  /* @__PURE__ */ jsxs(
@@ -13435,6 +13419,6 @@ function STimeRangePicker({
13435
13419
  );
13436
13420
  }
13437
13421
 
13438
- export { BADGE_COLORS, BUTTON_COLORS, BUTTON_SIZES, COLOR_KEYS, GNB_COLORS, GNB_COMMON, GNB_FOLD_MS, GNB_HEADER, GNB_MENU, GNB_MENU_WIDTH, GNB_RAIL, GNB_RAIL_WIDTH, ICONS, PAGE_BACKGROUNDS, SActionModal, SBadge, SBarcodeInput, SButton, SCROLL_AREA_AXES, SCalendar, SCallout, SCard, SCheckbox, SChip2 as SChip, SChipInput, SCircleProgress, SConfirmModal, SDatePicker, SDateRangePicker, SDivider, SDraggableGroup, SDraggableItem2 as SDraggableItem, SDraggableList, SDraggableProvider, SDropdownButton2 as SDropdownButton, SExpansionItem, SExpansionList2 as SExpansionList, SField, SFilePicker, SForm, SGhostButton, SGnb, SGuide, SIcon, SInput, SKeyValueTable, SLayout, SLayoutContext, SLinearProgress, SList2 as SList, SListItem2 as SListItem, SLoadingContainer, SLoadingModal, SLoadingViewport, SModal, SNumberInput, SPage, SPagination, SPopover, SPopup, SPortal, SRadio, SRadioButton, SRadioGroup, SScrollArea, SSectionHeaderCard2 as SSectionHeaderCard, SSelect2 as SSelect, SStepper, SSwitch, STEPPER_SIZES, STable, STableBar, STabs, STag, STextLink, STextarea, STimePicker, STimeRangePicker, SToast, SToastContainer, SToggle, STooltip2 as STooltip, STree2 as STree, STreeItem2 as STreeItem, TAG_COLORS, TAG_SHAPES, TAG_SIZES, TIMEPICKER_SIZES, TIMEPICKER_SIZE_CONFIG, buttonPreset, cn, findGnbAncestors, findGnbRailValue, isColorKey, loading, resolveColor, useSLayout };
13422
+ export { BADGE_COLORS, BUTTON_COLORS, BUTTON_SIZES, COLOR_KEYS, GNB_COLORS, GNB_COMMON, GNB_FOLD_MS, GNB_FULL_LOGO_WIDTH, GNB_HEADER, GNB_MENU, GNB_MENU_WIDTH, GNB_RAIL, GNB_RAIL_WIDTH, ICONS, PAGE_BACKGROUNDS, SActionModal, SBadge, SBarcodeInput, SButton, SCROLL_AREA_AXES, SCalendar, SCallout, SCard, SCheckbox, SChip2 as SChip, SChipInput, SCircleProgress, SConfirmModal, SDatePicker, SDateRangePicker, SDivider, SDraggableGroup, SDraggableItem2 as SDraggableItem, SDraggableList, SDraggableProvider, SDropdownButton2 as SDropdownButton, SExpansionItem, SExpansionList2 as SExpansionList, SField, SFilePicker, SForm, SGhostButton, SGnb, SGuide, SIcon, SInput, SKeyValueTable, SLayout, SLayoutContext, SLinearProgress, SList2 as SList, SListItem2 as SListItem, SLoadingContainer, SLoadingModal, SLoadingViewport, SModal, SNumberInput, SPage, SPagination, SPopover, SPopup, SPortal, SRadio, SRadioButton, SRadioGroup, SScrollArea, SSectionHeaderCard2 as SSectionHeaderCard, SSelect2 as SSelect, SStepper, SSwitch, STEPPER_SIZES, STable, STableBar, STabs, STag, STextLink, STextarea, STimePicker, STimeRangePicker, SToast, SToastContainer, SToggle, STooltip2 as STooltip, STree2 as STree, STreeItem2 as STreeItem, TAG_COLORS, TAG_SHAPES, TAG_SIZES, TIMEPICKER_SIZES, TIMEPICKER_SIZE_CONFIG, buttonPreset, cn, findGnbAncestors, findGnbRailValue, isColorKey, loading, resolveColor, useSLayout };
13439
13423
  //# sourceMappingURL=index.js.map
13440
13424
  //# sourceMappingURL=index.js.map