sellmate-design-system-react 9.0.0-beta.42 → 9.0.0-beta.43
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/components/SGuide/README.md +1 -1
- package/dist/components/SGuide/SGuide.d.ts +5 -2
- package/dist/index.cjs +35 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -17
- package/dist/index.js.map +1 -1
- package/dist/llms-full.txt +1 -1
- package/dist/styles.css +6 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7851,6 +7851,8 @@ var SPopup = /* @__PURE__ */ forwardRef(function SPopup2({
|
|
|
7851
7851
|
});
|
|
7852
7852
|
var DEFAULT_LABEL = { tip: "\uD65C\uC6A9 TIP", notion: "\uC0AC\uC6A9\uBC95 \uC548\uB0B4" };
|
|
7853
7853
|
var ICON = { tip: "helpOutline", notion: "notion" };
|
|
7854
|
+
var VIEWPORT_GUTTER = 24;
|
|
7855
|
+
var CLOSE_INSET = 12;
|
|
7854
7856
|
function flattenMessages(message, depth = 0) {
|
|
7855
7857
|
if (Array.isArray(message)) return message.flatMap((m) => flattenMessages(m, depth + 1));
|
|
7856
7858
|
return message !== "" ? [{ text: message, depth }] : [];
|
|
@@ -7861,13 +7863,14 @@ function SGuide({
|
|
|
7861
7863
|
message = "",
|
|
7862
7864
|
url = "",
|
|
7863
7865
|
popupTitle = "",
|
|
7864
|
-
popupWidth,
|
|
7866
|
+
popupWidth = "auto",
|
|
7865
7867
|
className,
|
|
7866
7868
|
style
|
|
7867
7869
|
}) {
|
|
7868
7870
|
const [open, setOpen] = useState(false);
|
|
7869
7871
|
const portalContainer = usePortalContainer();
|
|
7870
7872
|
const isNotion = type === "notion";
|
|
7873
|
+
const isAutoWidth = popupWidth === "auto";
|
|
7871
7874
|
const defaultLabel = DEFAULT_LABEL[type];
|
|
7872
7875
|
const iconName = ICON[type];
|
|
7873
7876
|
const messages = flattenMessages(message);
|
|
@@ -7907,30 +7910,45 @@ function SGuide({
|
|
|
7907
7910
|
side: "bottom",
|
|
7908
7911
|
align: "start",
|
|
7909
7912
|
sideOffset: 4,
|
|
7913
|
+
collisionPadding: VIEWPORT_GUTTER,
|
|
7910
7914
|
className: cn(
|
|
7911
7915
|
"relative z-50 rounded-[var(--cmp-guide-contents-radius)] bg-[var(--color-white)]",
|
|
7912
|
-
// popupWidth(기본 426px)가 창보다 넓으면 창 폭에 맞춘다 — max-width 가 width 를 이긴다.
|
|
7913
|
-
"max-w-[var(--radix-popover-content-available-width)]",
|
|
7914
7916
|
FLOATING_SLIDE_ANIM
|
|
7915
7917
|
),
|
|
7916
7918
|
style: {
|
|
7917
|
-
width:
|
|
7919
|
+
width: isAutoWidth ? "max-content" : popupWidth,
|
|
7920
|
+
// 유일한 폭 상한. auto 든 고정 폭이든 창 좌우 여백을 먹고 들어가지 않는다.
|
|
7921
|
+
// 트리거 위치가 아니라 창 기준이라, 오른쪽 끝 트리거에서도 폭이 깎이지 않는다
|
|
7922
|
+
// (넘치면 Radix 가 왼쪽으로 민다). 100vw 는 세로 스크롤바를 포함하지만
|
|
7923
|
+
// 여백이 그보다 넉넉해 화면 밖으로 나가지 않는다.
|
|
7924
|
+
maxWidth: `calc(100vw - ${VIEWPORT_GUTTER * 2}px)`,
|
|
7918
7925
|
padding: "var(--cmp-guide-contents-paddingY) var(--cmp-guide-contents-paddingX)",
|
|
7919
7926
|
boxShadow: "4px 4px 24px 4px rgba(0,0,0,0.1)"
|
|
7920
7927
|
},
|
|
7921
7928
|
children: [
|
|
7922
|
-
/* @__PURE__ */ jsx("div", { className: "absolute
|
|
7923
|
-
/* @__PURE__ */ jsxs(
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7929
|
+
/* @__PURE__ */ jsx("div", { className: "absolute", style: { top: CLOSE_INSET, right: CLOSE_INSET }, children: /* @__PURE__ */ jsx(SGhostButton, { icon: "close", size: "sm", ariaLabel: "close", onClick: () => setOpen(false) }) }),
|
|
7930
|
+
/* @__PURE__ */ jsxs(
|
|
7931
|
+
"div",
|
|
7932
|
+
{
|
|
7933
|
+
className: "flex items-center gap-[var(--cmp-guide-contents-title-gap)]",
|
|
7934
|
+
style: {
|
|
7935
|
+
// 닫기 버튼은 absolute 라 폭 계산에 안 들어간다. 폭이 내용에 붙는 auto 에서 제목이
|
|
7936
|
+
// 버튼 밑으로 들어가지 않도록, 버튼이 콘텐츠 영역을 침범하는 만큼을 미리 비운다.
|
|
7937
|
+
paddingRight: `max(0px, calc(var(--cmp-ghostButton-sm-size) + ${CLOSE_INSET}px + var(--cmp-guide-contents-title-gap) - var(--cmp-guide-contents-paddingX)))`
|
|
7938
|
+
},
|
|
7939
|
+
children: [
|
|
7940
|
+
/* @__PURE__ */ jsx(
|
|
7941
|
+
SIcon,
|
|
7942
|
+
{
|
|
7943
|
+
name: iconName,
|
|
7944
|
+
size: 24,
|
|
7945
|
+
color: isNotion ? "var(--sys-color-fg-primary)" : "var(--cmp-guide-contents-icon)"
|
|
7946
|
+
}
|
|
7947
|
+
),
|
|
7948
|
+
/* @__PURE__ */ jsx("h3", { className: "m-0 break-keep text-[16px] font-bold leading-[26px] text-[color:var(--cmp-guide-contents-typography-color)]", children: popupTitle || defaultLabel })
|
|
7949
|
+
]
|
|
7950
|
+
}
|
|
7951
|
+
),
|
|
7934
7952
|
/* @__PURE__ */ jsx("ul", { className: "m-0 mt-[var(--cmp-guide-contents-gap)] flex w-full list-none flex-col gap-[var(--cmp-guide-contents-body-gap)] p-0 text-[12px] leading-[20px] text-[color:var(--cmp-guide-contents-typography-color)]", children: messages.map((m, i) => /* @__PURE__ */ jsx(
|
|
7935
7953
|
"li",
|
|
7936
7954
|
{
|
|
@@ -7941,7 +7959,7 @@ function SGuide({
|
|
|
7941
7959
|
children: /* @__PURE__ */ jsx(
|
|
7942
7960
|
"p",
|
|
7943
7961
|
{
|
|
7944
|
-
className: "m-0 w-full min-w-0 break-words",
|
|
7962
|
+
className: "m-0 w-full min-w-0 break-keep break-words text-pretty",
|
|
7945
7963
|
dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(m.text) }
|
|
7946
7964
|
}
|
|
7947
7965
|
)
|