sellmate-design-system-react 9.0.0-beta.62 → 9.0.0-beta.64

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.
Files changed (34) hide show
  1. package/AGENTS.md +486 -131
  2. package/dist/components/SCalendarBoard/CalendarDayCard.d.ts +11 -3
  3. package/dist/components/SCalendarBoard/CalendarEventButton.d.ts +7 -2
  4. package/dist/components/SCalendarBoard/CalendarMoreButton.d.ts +2 -1
  5. package/dist/components/SCalendarBoard/README.md +11 -2
  6. package/dist/components/SCalendarBoard/SCalendarBoard.d.ts +4 -1
  7. package/dist/components/SCalendarBoard/calendar-board-layout.d.ts +49 -0
  8. package/dist/components/SCalendarBoard/types.d.ts +10 -1
  9. package/dist/components/SPage/README.md +19 -0
  10. package/dist/components/SPage/SPage.d.ts +11 -2
  11. package/dist/components/SPage/index.d.ts +1 -1
  12. package/dist/components/SPage/page.config.d.ts +8 -0
  13. package/dist/docs/RecipeGallery.d.ts +13 -0
  14. package/dist/index.cjs +168 -56
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.js +168 -57
  17. package/dist/index.js.map +1 -1
  18. package/dist/llms-full.txt +516 -133
  19. package/dist/llms.txt +486 -131
  20. package/dist/recipes/AppShell.d.ts +21 -0
  21. package/dist/recipes/ExcelFilePopupPage.d.ts +5 -0
  22. package/dist/recipes/LoginPage.d.ts +6 -0
  23. package/dist/recipes/ProductCreatePage.d.ts +1 -0
  24. package/dist/recipes/ProductCreateSectionsPage.d.ts +5 -0
  25. package/dist/recipes/ProductDetailInlineEditPage.d.ts +9 -0
  26. package/dist/recipes/ProductDetailPage.d.ts +1 -0
  27. package/dist/recipes/ProductListChipFilterPage.d.ts +1 -0
  28. package/dist/recipes/ProductListPage.d.ts +1 -0
  29. package/dist/recipes/TransferOrderPopupPage.d.ts +2 -0
  30. package/dist/recipes/api.d.ts +91 -0
  31. package/dist/recipes/recipe-story.d.ts +33 -0
  32. package/dist/recipes/router.d.ts +9 -0
  33. package/dist/styles.css +26 -3
  34. package/package.json +3 -1
package/dist/index.cjs CHANGED
@@ -12761,6 +12761,10 @@ var BACKGROUND_CLASS = {
12761
12761
  neutral: "bg-[var(--sys-color-bg-neutralLight)]",
12762
12762
  screen: "bg-[var(--sys-color-bg-screen)]"
12763
12763
  };
12764
+ var PADDING_CLASS2 = {
12765
+ default: "p-[var(--cmp-pageBody-padding-default)]",
12766
+ none: "p-0"
12767
+ };
12764
12768
  var NATIVE_SCROLLBAR_BACKGROUND_CLASS = {
12765
12769
  frame: `${SCROLLBAR_TRACK_BORDER_CLASS} ${SCROLLBAR_TRACK_BG_CLASS}`,
12766
12770
  neutral: `${SCROLLBAR_TRACK_BORDER_CLASS} ${SCROLLBAR_TRACK_BG_WHITE_CLASS}`,
@@ -12776,6 +12780,7 @@ var setForwardedRef = (ref, node) => {
12776
12780
  var SPage = /* @__PURE__ */ react.forwardRef(function SPage2({
12777
12781
  background = "frame",
12778
12782
  scrollEndSpacing = false,
12783
+ padding = "default",
12779
12784
  overlayScrollbar = false,
12780
12785
  contentHeight = "auto",
12781
12786
  contentWidth = "full",
@@ -12814,7 +12819,8 @@ var SPage = /* @__PURE__ */ react.forwardRef(function SPage2({
12814
12819
  {
12815
12820
  ref: setMainRef,
12816
12821
  className: cn(
12817
- "box-border min-h-0 min-w-0 flex-1 overflow-auto p-[var(--cmp-pageBody-padding-default)]",
12822
+ "box-border min-h-0 min-w-0 flex-1 overflow-auto",
12823
+ PADDING_CLASS2[padding],
12818
12824
  overlayScrollbar && "h-full",
12819
12825
  !fill && scrollEndSpacing && "pb-[var(--cmp-pageBody-padding-scrollEnd)]",
12820
12826
  overlayScrollbar ? SCROLLBAR_HIDDEN_CLASS : `${SCROLLBAR_CLASS} ${NATIVE_SCROLLBAR_BACKGROUND_CLASS[background]}`,
@@ -12854,6 +12860,7 @@ var SPage = /* @__PURE__ */ react.forwardRef(function SPage2({
12854
12860
  // src/components/SPage/page.config.ts
12855
12861
  var PAGE_BACKGROUNDS = ["frame", "neutral", "screen"];
12856
12862
  var PAGE_CONTENT_HEIGHTS = ["auto", "fill"];
12863
+ var PAGE_PADDINGS = ["default", "none"];
12857
12864
  var PAGE_CONTENT_WIDTHS = ["full", "fixed", "fixedCenter"];
12858
12865
  var PAGE_HEADER_VARIANTS = ["plain", "bar"];
12859
12866
  var SPageHeader = /* @__PURE__ */ withDisplayName(
@@ -13710,6 +13717,98 @@ function monthCells(year, month) {
13710
13717
  }
13711
13718
  var WEEK_LABELS = ["\uC77C", "\uC6D4", "\uD654", "\uC218", "\uBAA9", "\uAE08", "\uD1A0"];
13712
13719
 
13720
+ // src/components/SCalendarBoard/calendar-board-layout.ts
13721
+ function eventEndDate(event) {
13722
+ const end = event.endDate;
13723
+ return end != null && end > event.date ? end : event.date;
13724
+ }
13725
+ function layoutCalendarBoard({
13726
+ cells,
13727
+ events,
13728
+ rowCapacity,
13729
+ blockedDates
13730
+ }) {
13731
+ const count = cells.length;
13732
+ const weekCount = Math.ceil(count / 7);
13733
+ const segmentsByCell = Array.from({ length: count }, () => []);
13734
+ const eventsByCell = Array.from({ length: count }, () => []);
13735
+ const hiddenCountByCell = new Array(count).fill(0);
13736
+ const moreLaneByWeek = new Array(weekCount).fill(-1);
13737
+ const runs = [];
13738
+ events.forEach((event, order) => {
13739
+ const start = event.date;
13740
+ const end = eventEndDate(event);
13741
+ let from = -1;
13742
+ let to = -1;
13743
+ for (let i = 0; i < count; i++) {
13744
+ const { date } = cells[i];
13745
+ if (date < start || date > end) continue;
13746
+ if (from < 0) from = i;
13747
+ to = i;
13748
+ if (!blockedDates.has(date)) eventsByCell[i].push(event);
13749
+ }
13750
+ if (from < 0) return;
13751
+ let runStart = -1;
13752
+ const flush = (endIndex) => {
13753
+ if (runStart < 0) return;
13754
+ runs.push({ event, order, startIndex: runStart, endIndex, lane: -1 });
13755
+ runStart = -1;
13756
+ };
13757
+ for (let i = from; i <= to; i++) {
13758
+ if (blockedDates.has(cells[i].date)) {
13759
+ flush(i - 1);
13760
+ continue;
13761
+ }
13762
+ if (runStart >= 0 && i % 7 === 0) flush(i - 1);
13763
+ if (runStart < 0) runStart = i;
13764
+ }
13765
+ flush(to);
13766
+ });
13767
+ runs.sort(
13768
+ (a, b) => a.startIndex - b.startIndex || b.endIndex - b.startIndex - (a.endIndex - a.startIndex) || a.order - b.order
13769
+ );
13770
+ const weekLanes = Array.from({ length: weekCount }, () => []);
13771
+ for (const run of runs) {
13772
+ const week = Math.floor(run.startIndex / 7);
13773
+ const fromDay = run.startIndex % 7;
13774
+ const toDay = run.endIndex % 7;
13775
+ const lanes = weekLanes[week];
13776
+ let lane = 0;
13777
+ for (; ; ) {
13778
+ if (lanes[lane] == null) lanes[lane] = new Array(7).fill(false);
13779
+ let free = true;
13780
+ for (let d = fromDay; d <= toDay && free; d++) if (lanes[lane][d]) free = false;
13781
+ if (free) break;
13782
+ lane += 1;
13783
+ }
13784
+ for (let d = fromDay; d <= toDay; d++) lanes[lane][d] = true;
13785
+ run.lane = lane;
13786
+ }
13787
+ for (let week = 0; week < weekCount; week++) {
13788
+ if (weekLanes[week].length > rowCapacity) moreLaneByWeek[week] = rowCapacity - 1;
13789
+ }
13790
+ for (const run of runs) {
13791
+ const week = Math.floor(run.startIndex / 7);
13792
+ const moreLane = moreLaneByWeek[week];
13793
+ const limit = moreLane < 0 ? rowCapacity : moreLane;
13794
+ if (run.lane >= limit) {
13795
+ for (let i = run.startIndex; i <= run.endIndex; i++) hiddenCountByCell[i] += 1;
13796
+ continue;
13797
+ }
13798
+ const { event } = run;
13799
+ segmentsByCell[run.startIndex].push({
13800
+ event,
13801
+ key: `${event.id ?? `${event.date}-${run.order}`}-${run.startIndex}`,
13802
+ startIndex: run.startIndex,
13803
+ span: run.endIndex - run.startIndex + 1,
13804
+ lane: run.lane,
13805
+ startsHere: cells[run.startIndex].date === event.date,
13806
+ endsHere: cells[run.endIndex].date === eventEndDate(event)
13807
+ });
13808
+ }
13809
+ return { segmentsByCell, eventsByCell, hiddenCountByCell, moreLaneByWeek };
13810
+ }
13811
+
13713
13812
  // src/components/SCalendarBoard/calendarBoard.config.ts
13714
13813
  var CALENDAR_BOARD_EVENT_COLORS = [
13715
13814
  "default",
@@ -13754,7 +13853,10 @@ var CALENDAR_BOARD_DAY_BG = {
13754
13853
  function CalendarEventButton({
13755
13854
  event,
13756
13855
  onSelect,
13757
- className
13856
+ flatStart = false,
13857
+ flatEnd = false,
13858
+ className,
13859
+ style
13758
13860
  }) {
13759
13861
  const preset = CALENDAR_BOARD_EVENT_PRESETS[event.color ?? "default"];
13760
13862
  const dot = event.dotColor ?? preset.dot;
@@ -13774,10 +13876,13 @@ function CalendarEventButton({
13774
13876
  "h-(--cmp-calendarBoard-item-height) shrink-0 rounded-(--cmp-calendarBoard-item-radius)",
13775
13877
  "gap-(--cmp-calendarBoard-eventButton-inline-gap) px-(--cmp-calendarBoard-item-paddingX)",
13776
13878
  "bg-(--ceb-bg) text-(--cmp-calendarBoard-eventButton-text-color-default)",
13879
+ // 잘린 쪽은 평평하게 — 다음 조각과 이어 보면 한 막대가 주 경계에서 나뉜 모양이 된다.
13880
+ flatStart && "rounded-s-none",
13881
+ flatEnd && "rounded-e-none",
13777
13882
  disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
13778
13883
  className
13779
13884
  ),
13780
- style: { "--ceb-bg": preset.bg },
13885
+ style: { ...style, "--ceb-bg": preset.bg },
13781
13886
  onClick: (e) => {
13782
13887
  if (disabled) return;
13783
13888
  onSelect?.(event, e);
@@ -13787,7 +13892,7 @@ function CalendarEventButton({
13787
13892
  "span",
13788
13893
  {
13789
13894
  "aria-hidden": true,
13790
- className: "pointer-events-none absolute inset-0 rounded-(--cmp-calendarBoard-item-radius) bg-(--cmp-calendarBoard-eventButton-hover-overlay-color) opacity-0 transition-opacity group-hover:opacity-(--cmp-calendarBoard-eventButton-hover-overlay-opacity)"
13895
+ className: "pointer-events-none absolute inset-0 rounded-[inherit] bg-(--cmp-calendarBoard-eventButton-hover-overlay-color) opacity-0 transition-opacity group-hover:opacity-(--cmp-calendarBoard-eventButton-hover-overlay-opacity)"
13791
13896
  }
13792
13897
  ),
13793
13898
  /* @__PURE__ */ jsxRuntime.jsx(SBadge, { "aria-hidden": true, color: dot, className: "shrink-0" }),
@@ -13821,7 +13926,7 @@ function CalendarEventButton({
13821
13926
  }
13822
13927
  );
13823
13928
  }
13824
- var CalendarMoreButton = /* @__PURE__ */ react.forwardRef(function CalendarMoreButton2({ count, label = "\uB354\uBCF4\uAE30", onClick, className }, ref) {
13929
+ var CalendarMoreButton = /* @__PURE__ */ react.forwardRef(function CalendarMoreButton2({ count, label = "\uB354\uBCF4\uAE30", onClick, className, style }, ref) {
13825
13930
  return /* @__PURE__ */ jsxRuntime.jsxs(
13826
13931
  "button",
13827
13932
  {
@@ -13834,6 +13939,7 @@ var CalendarMoreButton = /* @__PURE__ */ react.forwardRef(function CalendarMoreB
13834
13939
  "bg-(--cmp-calendarBoard-moreButton-bg)",
13835
13940
  className
13836
13941
  ),
13942
+ style,
13837
13943
  onClick,
13838
13944
  children: [
13839
13945
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -13852,6 +13958,9 @@ var CalendarMoreButton = /* @__PURE__ */ react.forwardRef(function CalendarMoreB
13852
13958
  }
13853
13959
  );
13854
13960
  });
13961
+ var HEADER_HEIGHT = "var(--cmp-calendarBoard-dayCard-header-paddingTop) + var(--cmp-calendarBoard-daySequence-size) + var(--cmp-calendarBoard-dayCard-header-paddingBottom)";
13962
+ var laneTop = (lane) => `calc(${HEADER_HEIGHT} + ${lane} * (var(--cmp-calendarBoard-item-height) + var(--cmp-calendarBoard-dayCard-grid-gap)))`;
13963
+ var spanWidth = (span) => `calc(${span} * 100% + ${span - 1}px - 2 * var(--cmp-calendarBoard-dayCard-paddingX))`;
13855
13964
  var CalendarDayCard = /* @__PURE__ */ react.forwardRef(function CalendarDayCard2({
13856
13965
  date,
13857
13966
  day,
@@ -13860,9 +13969,11 @@ var CalendarDayCard = /* @__PURE__ */ react.forwardRef(function CalendarDayCard2
13860
13969
  isSelected,
13861
13970
  selectable,
13862
13971
  color,
13863
- events,
13972
+ segments,
13973
+ dayEventCount,
13864
13974
  body,
13865
13975
  hiddenCount,
13976
+ moreLane,
13866
13977
  isOpen,
13867
13978
  moreLabel,
13868
13979
  onDaySelect,
@@ -13870,7 +13981,7 @@ var CalendarDayCard = /* @__PURE__ */ react.forwardRef(function CalendarDayCard2
13870
13981
  onOpenEvents,
13871
13982
  ...rest
13872
13983
  }, ref) {
13873
- const hasEvents = events.length + hiddenCount > 0;
13984
+ const hasEvents = dayEventCount > 0;
13874
13985
  const interactive = selectable || hasEvents;
13875
13986
  const activate = () => {
13876
13987
  if (hasEvents) onOpenEvents?.();
@@ -13905,7 +14016,7 @@ var CalendarDayCard = /* @__PURE__ */ react.forwardRef(function CalendarDayCard2
13905
14016
  "span",
13906
14017
  {
13907
14018
  "aria-hidden": true,
13908
- className: "pointer-events-none absolute inset-[1px] rounded-(--cmp-calendarBoard-dayCard-focus-border-radius) border-(length:--cmp-calendarBoard-dayCard-focus-border-width) border-solid border-(--cmp-calendarBoard-dayCard-focus-border-color)"
14019
+ className: "pointer-events-none absolute inset-[1px] z-20 rounded-(--cmp-calendarBoard-dayCard-focus-border-radius) border-(length:--cmp-calendarBoard-dayCard-focus-border-width) border-solid border-(--cmp-calendarBoard-dayCard-focus-border-color)"
13909
14020
  }
13910
14021
  ),
13911
14022
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 pt-(--cmp-calendarBoard-dayCard-header-paddingTop) pb-(--cmp-calendarBoard-dayCard-header-paddingBottom)", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -13924,39 +14035,41 @@ var CalendarDayCard = /* @__PURE__ */ react.forwardRef(function CalendarDayCard2
13924
14035
  children: day
13925
14036
  }
13926
14037
  ) }),
13927
- /* @__PURE__ */ jsxRuntime.jsxs(
13928
- "div",
14038
+ body != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-0 flex-1 flex-col pb-(--cmp-calendarBoard-dayCard-grid-paddingBottom)", children: body }),
14039
+ body == null && segments.map((segment) => /* @__PURE__ */ jsxRuntime.jsx(
14040
+ CalendarEventButton,
13929
14041
  {
13930
- className: cn(
13931
- "flex min-h-0 flex-col gap-(--cmp-calendarBoard-dayCard-grid-gap) pb-(--cmp-calendarBoard-dayCard-grid-paddingBottom)",
13932
- // 슬롯은 남는 세로를 다 갖는다 — 안에서 h-full 로 칸을 채울 수 있어야 한다.
13933
- body != null && "flex-1"
13934
- ),
13935
- children: [
13936
- body,
13937
- body == null && events.map((event, i) => /* @__PURE__ */ jsxRuntime.jsx(
13938
- CalendarEventButton,
13939
- {
13940
- event,
13941
- onSelect: (ev, e) => {
13942
- e.stopPropagation();
13943
- onEventClick?.(ev, e);
13944
- }
13945
- },
13946
- event.id ?? `${event.date}-${i}`
13947
- )),
13948
- hiddenCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(
13949
- CalendarMoreButton,
13950
- {
13951
- count: hiddenCount,
13952
- label: moreLabel,
13953
- onClick: (e) => {
13954
- e.stopPropagation();
13955
- onOpenEvents?.();
13956
- }
13957
- }
13958
- )
13959
- ]
14042
+ event: segment.event,
14043
+ flatStart: !segment.startsHere,
14044
+ flatEnd: !segment.endsHere,
14045
+ className: "absolute z-10",
14046
+ style: {
14047
+ top: laneTop(segment.lane),
14048
+ left: "var(--cmp-calendarBoard-dayCard-paddingX)",
14049
+ width: spanWidth(segment.span)
14050
+ },
14051
+ onSelect: (ev, e) => {
14052
+ e.stopPropagation();
14053
+ onEventClick?.(ev, e);
14054
+ }
14055
+ },
14056
+ segment.key
14057
+ )),
14058
+ body == null && hiddenCount > 0 && moreLane >= 0 && /* @__PURE__ */ jsxRuntime.jsx(
14059
+ CalendarMoreButton,
14060
+ {
14061
+ count: hiddenCount,
14062
+ label: moreLabel,
14063
+ className: "absolute z-10",
14064
+ style: {
14065
+ top: laneTop(moreLane),
14066
+ left: "var(--cmp-calendarBoard-dayCard-paddingX)",
14067
+ width: spanWidth(1)
14068
+ },
14069
+ onClick: (e) => {
14070
+ e.stopPropagation();
14071
+ onOpenEvents?.();
14072
+ }
13960
14073
  }
13961
14074
  )
13962
14075
  ]
@@ -14090,16 +14203,14 @@ function SCalendarBoard({
14090
14203
  observer.observe(cell);
14091
14204
  return () => observer.disconnect();
14092
14205
  }, [rowCount]);
14093
- const eventMap = react.useMemo(() => {
14094
- const map = /* @__PURE__ */ new Map();
14095
- (events ?? []).forEach((event) => {
14096
- const list = map.get(event.date);
14097
- if (list) list.push(event);
14098
- else map.set(event.date, [event]);
14099
- });
14100
- return map;
14101
- }, [events]);
14102
- const openEvents = openDate ? eventMap.get(openDate) ?? [] : [];
14206
+ const layout = react.useMemo(() => {
14207
+ const blockedDates = new Set(
14208
+ cells.filter((cell) => dayContent?.[cell.date] != null).map((cell) => cell.date)
14209
+ );
14210
+ return layoutCalendarBoard({ cells, events: events ?? [], rowCapacity, blockedDates });
14211
+ }, [cells, events, rowCapacity, dayContent]);
14212
+ const openIndex = openDate == null ? -1 : cells.findIndex((cell) => cell.date === openDate);
14213
+ const openEvents = openIndex < 0 ? [] : layout.eventsByCell[openIndex];
14103
14214
  react.useLayoutEffect(() => {
14104
14215
  if (openDate == null || panelEl == null) return;
14105
14216
  const cell = gridRef.current?.querySelector(`[data-date="${openDate}"]`);
@@ -14240,11 +14351,9 @@ function SCalendarBoard({
14240
14351
  // 행은 판 높이를 균등하게 나눠 갖는다 — 일정이 많은 주만 길어지면 격자가 깨진다.
14241
14352
  gridTemplateRows: `repeat(${rowCount}, minmax(var(--cmp-calendarBoard-dayCard-minHeight), 1fr))`
14242
14353
  },
14243
- children: cells.map((cell) => {
14354
+ children: cells.map((cell, index) => {
14244
14355
  const content = dayContent?.[cell.date];
14245
- const list = content == null ? eventMap.get(cell.date) ?? [] : [];
14246
- const folded = list.length > rowCapacity;
14247
- const visible = folded ? list.slice(0, rowCapacity - 1) : list;
14356
+ const list = layout.eventsByCell[index];
14248
14357
  const card = /* @__PURE__ */ jsxRuntime.jsx(
14249
14358
  CalendarDayCard,
14250
14359
  {
@@ -14255,9 +14364,11 @@ function SCalendarBoard({
14255
14364
  isSelected: value != null && value === cell.date,
14256
14365
  selectable,
14257
14366
  color: dayColors?.[cell.date] ?? "default",
14258
- events: visible,
14367
+ segments: layout.segmentsByCell[index],
14368
+ dayEventCount: list.length,
14259
14369
  body: content,
14260
- hiddenCount: folded ? list.length - (rowCapacity - 1) : 0,
14370
+ hiddenCount: layout.hiddenCountByCell[index],
14371
+ moreLane: layout.moreLaneByWeek[Math.floor(index / 7)],
14261
14372
  isOpen: openDate === cell.date,
14262
14373
  moreLabel,
14263
14374
  onDaySelect: (date) => onValueChange?.(date, list),
@@ -27009,6 +27120,7 @@ exports.PAGE_BACKGROUNDS = PAGE_BACKGROUNDS;
27009
27120
  exports.PAGE_CONTENT_HEIGHTS = PAGE_CONTENT_HEIGHTS;
27010
27121
  exports.PAGE_CONTENT_WIDTHS = PAGE_CONTENT_WIDTHS;
27011
27122
  exports.PAGE_HEADER_VARIANTS = PAGE_HEADER_VARIANTS;
27123
+ exports.PAGE_PADDINGS = PAGE_PADDINGS;
27012
27124
  exports.RangeCalendar = RangeCalendar;
27013
27125
  exports.SAccountListBox = SAccountListBox;
27014
27126
  exports.SActionModal = SActionModal;