sellmate-design-system-react 9.0.0-beta.30 → 9.0.0-beta.31

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.cjs CHANGED
@@ -9313,13 +9313,26 @@ var SGnb = /* @__PURE__ */ react.forwardRef(function SGnb2({
9313
9313
  "topContent"
9314
9314
  ) : null;
9315
9315
  const systemMenuContext = react.useMemo(
9316
- () => ({ color, folded: false }),
9316
+ () => ({ color, folded: false, placement: "panel" }),
9317
9317
  [color]
9318
9318
  );
9319
9319
  const systemFoldedContext = react.useMemo(
9320
- () => ({ color, folded: true }),
9320
+ () => ({ color, folded: true, placement: "panel" }),
9321
9321
  [color]
9322
9322
  );
9323
+ const systemTopContext = react.useMemo(
9324
+ () => ({ color, folded: false, placement: "top" }),
9325
+ [color]
9326
+ );
9327
+ const systemTopBox = header === "full" && system ? /* @__PURE__ */ jsxRuntime.jsx(
9328
+ "div",
9329
+ {
9330
+ className: "flex shrink-0 items-center",
9331
+ style: { marginLeft: topContentBox ? H.topGap : "auto" },
9332
+ children: /* @__PURE__ */ jsxRuntime.jsx(SGnbSystemContext.Provider, { value: systemTopContext, children: system })
9333
+ },
9334
+ "system"
9335
+ ) : null;
9323
9336
  return /* @__PURE__ */ jsxRuntime.jsxs(
9324
9337
  "div",
9325
9338
  {
@@ -9361,7 +9374,8 @@ var SGnb = /* @__PURE__ */ react.forwardRef(function SGnb2({
9361
9374
  launcherButton,
9362
9375
  foldButton,
9363
9376
  logoBox,
9364
- topContentBox
9377
+ topContentBox,
9378
+ systemTopBox
9365
9379
  ] })
9366
9380
  }
9367
9381
  ),
@@ -9441,7 +9455,7 @@ var SGnb = /* @__PURE__ */ react.forwardRef(function SGnb2({
9441
9455
  }
9442
9456
  ),
9443
9457
  menuFooter && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: menuFooter }),
9444
- system && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(SGnbSystemContext.Provider, { value: systemMenuContext, children: system }) })
9458
+ !isFull && system && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(SGnbSystemContext.Provider, { value: systemMenuContext, children: system }) })
9445
9459
  ]
9446
9460
  }
9447
9461
  )
@@ -9478,6 +9492,7 @@ var SGnb = /* @__PURE__ */ react.forwardRef(function SGnb2({
9478
9492
 
9479
9493
  // src/components/SGnbSystem/gnbSystem.config.ts
9480
9494
  var GNB_SYSTEM_COLORS = ["light", "dark"];
9495
+ var GNB_SYSTEM_PLACEMENTS = ["panel", "top"];
9481
9496
  var panel = (p) => `var(--cmp-gnb-system-panel-${p})`;
9482
9497
  var domain = (p) => `var(--cmp-gnb-system-domainTag-${p})`;
9483
9498
  var item2 = (p) => `var(--cmp-gnb-system-item-${p})`;
@@ -9508,6 +9523,27 @@ var GNB_SYSTEM_COLOR_CONFIG = {
9508
9523
  alertHoverBg: void 0
9509
9524
  }
9510
9525
  };
9526
+ var GNB_SYSTEM_TOP_COLOR_CONFIG = {
9527
+ light: {
9528
+ item: "light",
9529
+ divider: panel("divider-color-light"),
9530
+ domainBg: domain("light-bg"),
9531
+ domainText: domain("light-text"),
9532
+ alertIcon: alert("icon-color-notification-light"),
9533
+ alertCount: alert("count-color-light"),
9534
+ alertHoverBg: alert("bg-notificationHover-light")
9535
+ },
9536
+ dark: {
9537
+ item: "darker",
9538
+ divider: panel("divider-color-darker"),
9539
+ domainBg: domain("darker-bg"),
9540
+ domainText: domain("darker-text"),
9541
+ alertIcon: alert("icon-color-notification-dark"),
9542
+ alertCount: alert("count-color-dark"),
9543
+ // darker 면에는 알림 hover 배경 토큰이 없다 → 행 기본 hover 를 그대로 쓴다.
9544
+ alertHoverBg: void 0
9545
+ }
9546
+ };
9511
9547
  var GNB_SYSTEM_LAYOUT = {
9512
9548
  /** 펼친 패널의 안쪽 여백 */
9513
9549
  padding: "var(--cmp-gnb-system-project-padding)",
@@ -9620,6 +9656,7 @@ function SystemButton({
9620
9656
  var SGnbSystem = /* @__PURE__ */ react.forwardRef(function SGnbSystem2({
9621
9657
  color: colorProp,
9622
9658
  folded: foldedProp,
9659
+ placement: placementProp,
9623
9660
  actions,
9624
9661
  domain: domain2,
9625
9662
  alert: alert2,
@@ -9631,8 +9668,18 @@ var SGnbSystem = /* @__PURE__ */ react.forwardRef(function SGnbSystem2({
9631
9668
  }, ref) {
9632
9669
  const gnb2 = react.useContext(SGnbSystemContext);
9633
9670
  const color = colorProp ?? gnb2?.color ?? "light";
9634
- const folded = foldedProp ?? gnb2?.folded ?? false;
9671
+ const placement = placementProp ?? gnb2?.placement ?? "panel";
9672
+ const isTop = placement === "top";
9673
+ const folded = !isTop && (foldedProp ?? gnb2?.folded ?? false);
9635
9674
  const c = GNB_SYSTEM_COLOR_CONFIG[color];
9675
+ const t = GNB_SYSTEM_TOP_COLOR_CONFIG[color];
9676
+ const itemColor = isTop ? t.item : color;
9677
+ const dividerColor = isTop ? t.divider : c.divider;
9678
+ const domainBg = isTop ? t.domainBg : c.domainBg;
9679
+ const domainText = isTop ? t.domainText : c.domainText;
9680
+ const alertIconColor = isTop ? t.alertIcon : c.alertIcon;
9681
+ const alertCountColor = isTop ? t.alertCount : c.alertCount;
9682
+ const alertHoverBg = isTop ? t.alertHoverBg : c.alertHoverBg;
9636
9683
  const hasActions = (actions?.length ?? 0) > 0;
9637
9684
  const hasDomain = domain2 != null;
9638
9685
  const hasUserBlock = Boolean(alert2 || setting || account);
@@ -9643,20 +9690,109 @@ var SGnbSystem = /* @__PURE__ */ react.forwardRef(function SGnbSystem2({
9643
9690
  const alertButton = alert2 && /* @__PURE__ */ jsxRuntime.jsx(
9644
9691
  SystemButton,
9645
9692
  {
9646
- color,
9693
+ color: itemColor,
9647
9694
  icon: notified ? "alert" : "bell",
9648
- label: folded ? void 0 : alertLabel,
9695
+ label: folded || isTop ? void 0 : alertLabel,
9649
9696
  ariaLabel: alertLabel,
9650
9697
  paddingX: GNB_SYSTEM_LAYOUT.alertPaddingX,
9651
- iconColor: notified ? c.alertIcon : void 0,
9652
- hoverBg: notified ? c.alertHoverBg : void 0,
9698
+ iconColor: notified ? alertIconColor : void 0,
9699
+ hoverBg: notified ? alertHoverBg : void 0,
9653
9700
  count: folded ? void 0 : alertCount,
9654
9701
  dot: folded && notified,
9655
- accentColor: c.alertCount,
9656
- stretch: !folded,
9702
+ accentColor: alertCountColor,
9703
+ stretch: !folded && !isTop,
9657
9704
  onClick: alert2.onClick
9658
9705
  }
9659
9706
  );
9707
+ const settingButton = setting && /* @__PURE__ */ jsxRuntime.jsx(
9708
+ SystemButton,
9709
+ {
9710
+ color: itemColor,
9711
+ icon: "setting",
9712
+ label: isTop ? void 0 : settingLabel,
9713
+ ariaLabel: settingLabel,
9714
+ paddingX: GNB_SYSTEM_LAYOUT.settingPaddingX,
9715
+ stretch: !isTop && !alert2,
9716
+ onClick: setting.onClick
9717
+ }
9718
+ );
9719
+ const accountButton = account && /* @__PURE__ */ jsxRuntime.jsx(
9720
+ SSystemActionButton,
9721
+ {
9722
+ color: itemColor,
9723
+ type: "account",
9724
+ label: account.label,
9725
+ onClick: account.onClick,
9726
+ className: isTop ? "w-auto shrink-0" : void 0
9727
+ }
9728
+ );
9729
+ const domainTag = hasDomain && /* @__PURE__ */ jsxRuntime.jsx(
9730
+ "div",
9731
+ {
9732
+ className: cn(
9733
+ "typo-body-sm-medium box-border",
9734
+ isTop ? "shrink-0 whitespace-nowrap" : "w-full truncate text-center"
9735
+ ),
9736
+ style: {
9737
+ paddingInline: GNB_SYSTEM_LAYOUT.domainPaddingX,
9738
+ paddingBlock: GNB_SYSTEM_LAYOUT.domainPaddingY,
9739
+ borderRadius: GNB_SYSTEM_LAYOUT.domainRadius,
9740
+ backgroundColor: domainBg,
9741
+ color: domainText
9742
+ },
9743
+ children: domain2
9744
+ }
9745
+ );
9746
+ if (isTop) {
9747
+ const segments = [];
9748
+ actions?.forEach(
9749
+ ({ value, ...action2 }, index) => segments.push({
9750
+ key: `action-${value ?? index}`,
9751
+ node: /* @__PURE__ */ jsxRuntime.jsx(
9752
+ SSystemActionButton,
9753
+ {
9754
+ color: itemColor,
9755
+ className: "w-auto shrink-0",
9756
+ ...action2
9757
+ }
9758
+ )
9759
+ })
9760
+ );
9761
+ if (alertButton) segments.push({ key: "alert", node: alertButton });
9762
+ if (settingButton) segments.push({ key: "setting", node: settingButton });
9763
+ if (domainTag || accountButton) {
9764
+ segments.push({
9765
+ key: "user",
9766
+ node: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center", style: { gap: GNB_SYSTEM_LAYOUT.gap }, children: [
9767
+ domainTag,
9768
+ accountButton
9769
+ ] })
9770
+ });
9771
+ }
9772
+ if (segments.length === 0) return null;
9773
+ return /* @__PURE__ */ jsxRuntime.jsx(
9774
+ "div",
9775
+ {
9776
+ ref,
9777
+ className: cn("flex items-center", className),
9778
+ style: { gap: GNB_SYSTEM_LAYOUT.gap, ...style },
9779
+ "data-color": color,
9780
+ "data-placement": "top",
9781
+ ...rest,
9782
+ children: segments.map(({ key, node }, index) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
9783
+ index > 0 && /* @__PURE__ */ jsxRuntime.jsx(
9784
+ "span",
9785
+ {
9786
+ className: "h-sd-16 w-px shrink-0",
9787
+ style: { backgroundColor: dividerColor },
9788
+ "aria-hidden": true
9789
+ }
9790
+ ),
9791
+ node
9792
+ ] }, key))
9793
+ }
9794
+ );
9795
+ }
9660
9796
  const panelStyle = {
9661
9797
  backgroundColor: c.bg,
9662
9798
  // 색에 따라 경계선이 없을 수 있다 — 배경 차이만으로 경계가 읽히는 dark 가 그렇다.
@@ -9673,6 +9809,7 @@ var SGnbSystem = /* @__PURE__ */ react.forwardRef(function SGnbSystem2({
9673
9809
  className: cn("box-border flex w-full flex-col", className),
9674
9810
  style: panelStyle,
9675
9811
  "data-color": color,
9812
+ "data-placement": "panel",
9676
9813
  "data-folded": "",
9677
9814
  ...rest,
9678
9815
  children: [
@@ -9680,7 +9817,7 @@ var SGnbSystem = /* @__PURE__ */ react.forwardRef(function SGnbSystem2({
9680
9817
  account && /* @__PURE__ */ jsxRuntime.jsx(
9681
9818
  SystemButton,
9682
9819
  {
9683
- color,
9820
+ color: itemColor,
9684
9821
  icon: "user",
9685
9822
  ariaLabel: account.label ?? "account",
9686
9823
  paddingX: GNB_SYSTEM_LAYOUT.alertPaddingX,
@@ -9699,31 +9836,19 @@ var SGnbSystem = /* @__PURE__ */ react.forwardRef(function SGnbSystem2({
9699
9836
  className: cn("box-border flex w-full flex-col", className),
9700
9837
  style: { ...panelStyle, gap: GNB_SYSTEM_LAYOUT.gap },
9701
9838
  "data-color": color,
9839
+ "data-placement": "panel",
9702
9840
  ...rest,
9703
9841
  children: [
9704
9842
  actions?.map(({ value, ...action2 }, index) => /* @__PURE__ */ jsxRuntime.jsx(
9705
9843
  SSystemActionButton,
9706
9844
  {
9707
- color,
9845
+ color: itemColor,
9708
9846
  ...action2
9709
9847
  },
9710
9848
  value ?? index
9711
9849
  )),
9712
- hasActions && (hasDomain || hasUserBlock) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px shrink-0", style: { backgroundColor: c.divider } }),
9713
- domain2 != null && /* @__PURE__ */ jsxRuntime.jsx(
9714
- "div",
9715
- {
9716
- className: "typo-body-sm-medium box-border w-full truncate text-center",
9717
- style: {
9718
- paddingInline: GNB_SYSTEM_LAYOUT.domainPaddingX,
9719
- paddingBlock: GNB_SYSTEM_LAYOUT.domainPaddingY,
9720
- borderRadius: GNB_SYSTEM_LAYOUT.domainRadius,
9721
- backgroundColor: c.domainBg,
9722
- color: c.domainText
9723
- },
9724
- children: domain2
9725
- }
9726
- ),
9850
+ hasActions && (hasDomain || hasUserBlock) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px shrink-0", style: { backgroundColor: dividerColor } }),
9851
+ domainTag,
9727
9852
  hasUserBlock && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
9728
9853
  (alert2 || setting) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", style: { gap: GNB_SYSTEM_LAYOUT.gap }, children: [
9729
9854
  alertButton,
@@ -9731,32 +9856,13 @@ var SGnbSystem = /* @__PURE__ */ react.forwardRef(function SGnbSystem2({
9731
9856
  "span",
9732
9857
  {
9733
9858
  className: "h-sd-16 w-px shrink-0",
9734
- style: { backgroundColor: c.divider },
9859
+ style: { backgroundColor: dividerColor },
9735
9860
  "aria-hidden": true
9736
9861
  }
9737
9862
  ),
9738
- setting && /* @__PURE__ */ jsxRuntime.jsx(
9739
- SystemButton,
9740
- {
9741
- color,
9742
- icon: "setting",
9743
- label: settingLabel,
9744
- ariaLabel: settingLabel,
9745
- paddingX: GNB_SYSTEM_LAYOUT.settingPaddingX,
9746
- stretch: !alert2,
9747
- onClick: setting.onClick
9748
- }
9749
- )
9863
+ settingButton
9750
9864
  ] }),
9751
- account && /* @__PURE__ */ jsxRuntime.jsx(
9752
- SSystemActionButton,
9753
- {
9754
- color,
9755
- type: "account",
9756
- label: account.label,
9757
- onClick: account.onClick
9758
- }
9759
- )
9865
+ accountButton
9760
9866
  ] })
9761
9867
  ]
9762
9868
  }
@@ -18046,8 +18152,16 @@ var createPeriodValue = (unit, maxRange) => ({
18046
18152
  unit,
18047
18153
  value: getDefaultPeriodInputValue(unit, maxRange)
18048
18154
  });
18155
+ var singleOptionValue = (field) => {
18156
+ if (field.type !== "select" && field.type !== "select-multi") return void 0;
18157
+ const options = field.options ?? [];
18158
+ if (options.length !== 1 || options[0].disabled === true) return void 0;
18159
+ return options[0].value;
18160
+ };
18049
18161
  var resolveFieldDefault = (field) => {
18050
18162
  if (field.defaultValue !== void 0 && isFixedField(field)) return field.defaultValue;
18163
+ const only = singleOptionValue(field);
18164
+ if (only !== void 0) return field.type === "select-multi" ? [only] : only;
18051
18165
  if (field.type === "datepicker-range") {
18052
18166
  if (!isInlineDateField(field) && !field.required) return void 0;
18053
18167
  const today = todayIso();
@@ -18146,7 +18260,7 @@ var displayValue = (field, value) => {
18146
18260
  if (field.type === "select-multi") {
18147
18261
  const values = toArrayValue(value);
18148
18262
  const selectableValues = (field.options ?? []).filter((option) => !option.disabled).map((option) => option.value);
18149
- if (selectableValues.length > 0 && selectableValues.every((selectableValue) => values.includes(selectableValue))) {
18263
+ if (selectableValues.length > 1 && selectableValues.every((selectableValue) => values.includes(selectableValue))) {
18150
18264
  return "\uC804\uCCB4";
18151
18265
  }
18152
18266
  return formatValueList(values.map((v) => optionLabel(field, v)));
@@ -21079,6 +21193,8 @@ exports.GNB_RAIL_WIDTH = GNB_RAIL_WIDTH;
21079
21193
  exports.GNB_SYSTEM_COLORS = GNB_SYSTEM_COLORS;
21080
21194
  exports.GNB_SYSTEM_COLOR_CONFIG = GNB_SYSTEM_COLOR_CONFIG;
21081
21195
  exports.GNB_SYSTEM_LAYOUT = GNB_SYSTEM_LAYOUT;
21196
+ exports.GNB_SYSTEM_PLACEMENTS = GNB_SYSTEM_PLACEMENTS;
21197
+ exports.GNB_SYSTEM_TOP_COLOR_CONFIG = GNB_SYSTEM_TOP_COLOR_CONFIG;
21082
21198
  exports.ICONS = ICONS;
21083
21199
  exports.IMAGE_FITS = IMAGE_FITS;
21084
21200
  exports.PAGE_BACKGROUNDS = PAGE_BACKGROUNDS;