sellmate-design-system-react 2.1.0 → 2.1.2
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/SActionModal/SActionModal.cjs +8 -2
- package/dist/components/SActionModal/SActionModal.cjs.map +1 -1
- package/dist/components/SActionModal/SActionModal.d.ts +11 -2
- package/dist/components/SActionModal/SActionModal.js +8 -2
- package/dist/components/SActionModal/SActionModal.js.map +1 -1
- package/dist/components/SChipInput/SChipInput.cjs +9 -2
- package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
- package/dist/components/SChipInput/SChipInput.js +9 -2
- package/dist/components/SChipInput/SChipInput.js.map +1 -1
- package/dist/components/SConfirmModal/SConfirmModal.cjs +101 -8
- package/dist/components/SConfirmModal/SConfirmModal.cjs.map +1 -1
- package/dist/components/SConfirmModal/SConfirmModal.d.ts +4 -3
- package/dist/components/SConfirmModal/SConfirmModal.js +101 -8
- package/dist/components/SConfirmModal/SConfirmModal.js.map +1 -1
- package/dist/components/SExpansionItem/SExpansionItem.cjs +11 -11
- package/dist/components/SExpansionItem/SExpansionItem.cjs.map +1 -1
- package/dist/components/SExpansionItem/SExpansionItem.js +11 -11
- package/dist/components/SExpansionItem/SExpansionItem.js.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +20 -19
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.d.ts +57 -4
- package/dist/components/SKeyValueTable/SKeyValueTable.js +20 -19
- package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.cjs +8 -2
- package/dist/components/SLoadingModal/SLoadingModal.cjs.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.js +8 -2
- package/dist/components/SLoadingModal/SLoadingModal.js.map +1 -1
- package/dist/components/SModal/SModal.cjs +101 -8
- package/dist/components/SModal/SModal.cjs.map +1 -1
- package/dist/components/SModal/SModal.js +101 -8
- package/dist/components/SModal/SModal.js.map +1 -1
- package/dist/components/SModalContainer/SModalContainer.cjs +8 -2
- package/dist/components/SModalContainer/SModalContainer.cjs.map +1 -1
- package/dist/components/SModalContainer/SModalContainer.js +8 -2
- package/dist/components/SModalContainer/SModalContainer.js.map +1 -1
- package/dist/components/SSelect/SSelect.cjs +20 -19
- package/dist/components/SSelect/SSelect.cjs.map +1 -1
- package/dist/components/SSelect/SSelect.js +20 -19
- package/dist/components/SSelect/SSelect.js.map +1 -1
- package/dist/components/SStepper/SStepper.cjs +1 -1
- package/dist/components/SStepper/SStepper.cjs.map +1 -1
- package/dist/components/SStepper/SStepper.js +1 -1
- package/dist/components/SStepper/SStepper.js.map +1 -1
- package/dist/components/STable/STable.cjs +20 -19
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.js +20 -19
- package/dist/components/STable/STable.js.map +1 -1
- package/dist/components/STimePicker/STimePicker.cjs +1 -1
- package/dist/components/STimePicker/STimePicker.cjs.map +1 -1
- package/dist/components/STimePicker/STimePicker.js +1 -1
- package/dist/components/STimePicker/STimePicker.js.map +1 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.cjs +1 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.cjs.map +1 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.js +1 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.js.map +1 -1
- package/dist/index.cjs +75 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +75 -43
- package/dist/index.js.map +1 -1
- package/dist/styles.css +303 -195
- package/dist/theme.css +229 -121
- package/package.json +1 -1
|
@@ -3166,11 +3166,17 @@ function SModalContainer({
|
|
|
3166
3166
|
/* @__PURE__ */ jsxRuntime.jsx(InsideModalProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(PortalContainerProvider, { value: portalContainer, children }) })
|
|
3167
3167
|
]
|
|
3168
3168
|
}
|
|
3169
|
+
),
|
|
3170
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3171
|
+
"div",
|
|
3172
|
+
{
|
|
3173
|
+
ref: setPortalContainer,
|
|
3174
|
+
className: "pointer-events-auto fixed left-0 top-0 z-[1001]"
|
|
3175
|
+
}
|
|
3169
3176
|
)
|
|
3170
3177
|
]
|
|
3171
3178
|
}
|
|
3172
|
-
) })
|
|
3173
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: setPortalContainer, className: "pointer-events-auto fixed left-0 top-0 z-[1001]" })
|
|
3179
|
+
) })
|
|
3174
3180
|
] }) });
|
|
3175
3181
|
}
|
|
3176
3182
|
|
|
@@ -3339,6 +3345,75 @@ var SButton = react.forwardRef(function SButton2({
|
|
|
3339
3345
|
}
|
|
3340
3346
|
);
|
|
3341
3347
|
});
|
|
3348
|
+
|
|
3349
|
+
// src/lib/sanitize-inline-html.ts
|
|
3350
|
+
var ALLOWED_INLINE_TAGS = /* @__PURE__ */ new Set(["A", "B", "STRONG", "I", "EM", "BR", "SPAN"]);
|
|
3351
|
+
var ALLOWED_ATTRS_BY_TAG = {
|
|
3352
|
+
A: /* @__PURE__ */ new Set(["href", "target", "rel", "class"])
|
|
3353
|
+
};
|
|
3354
|
+
var COMMON_ALLOWED_ATTRS = /* @__PURE__ */ new Set(["class"]);
|
|
3355
|
+
var SAFE_HREF_RE = /^(https?:|mailto:|tel:|\/|#|\.)/i;
|
|
3356
|
+
var DROP_CONTENT_TAGS = /* @__PURE__ */ new Set([
|
|
3357
|
+
"SCRIPT",
|
|
3358
|
+
"STYLE",
|
|
3359
|
+
"IFRAME",
|
|
3360
|
+
"OBJECT",
|
|
3361
|
+
"EMBED",
|
|
3362
|
+
"META",
|
|
3363
|
+
"LINK",
|
|
3364
|
+
"BASE",
|
|
3365
|
+
"NOSCRIPT",
|
|
3366
|
+
// SVG/MATH 는 foreign-content 파싱 모드로 전환되어 재직렬화 시 다른 트리로
|
|
3367
|
+
// 재파싱될 수 있다(mXSS 벡터). 인라인 라벨에 필요 없으므로 통째로 제거한다.
|
|
3368
|
+
"SVG",
|
|
3369
|
+
"MATH",
|
|
3370
|
+
"TEMPLATE"
|
|
3371
|
+
]);
|
|
3372
|
+
var escapeHtml = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3373
|
+
var sanitizeNode = (node) => {
|
|
3374
|
+
if (node.nodeType === Node.COMMENT_NODE) {
|
|
3375
|
+
node.remove();
|
|
3376
|
+
return;
|
|
3377
|
+
}
|
|
3378
|
+
if (node.nodeType !== Node.ELEMENT_NODE) return;
|
|
3379
|
+
const element = node;
|
|
3380
|
+
const tagName = element.tagName;
|
|
3381
|
+
if (DROP_CONTENT_TAGS.has(tagName)) {
|
|
3382
|
+
element.remove();
|
|
3383
|
+
return;
|
|
3384
|
+
}
|
|
3385
|
+
Array.from(element.childNodes).forEach((child) => sanitizeNode(child));
|
|
3386
|
+
if (ALLOWED_INLINE_TAGS.has(tagName)) {
|
|
3387
|
+
if (element.hasAttribute("className")) {
|
|
3388
|
+
const val = element.getAttribute("className");
|
|
3389
|
+
element.removeAttribute("className");
|
|
3390
|
+
if (!element.hasAttribute("class")) element.setAttribute("class", val);
|
|
3391
|
+
}
|
|
3392
|
+
const allowedAttrs = ALLOWED_ATTRS_BY_TAG[tagName] ?? COMMON_ALLOWED_ATTRS;
|
|
3393
|
+
Array.from(element.attributes).forEach((attr) => {
|
|
3394
|
+
if (!allowedAttrs.has(attr.name)) element.removeAttribute(attr.name);
|
|
3395
|
+
});
|
|
3396
|
+
if (tagName === "A") {
|
|
3397
|
+
const href = element.getAttribute("href");
|
|
3398
|
+
if (href !== null && href !== "" && !SAFE_HREF_RE.test(href)) element.removeAttribute("href");
|
|
3399
|
+
if (element.hasAttribute("target")) {
|
|
3400
|
+
element.setAttribute("rel", "noopener noreferrer");
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
return;
|
|
3404
|
+
}
|
|
3405
|
+
const parent = element.parentNode;
|
|
3406
|
+
if (parent == null) return;
|
|
3407
|
+
while (element.firstChild) parent.insertBefore(element.firstChild, element);
|
|
3408
|
+
parent.removeChild(element);
|
|
3409
|
+
};
|
|
3410
|
+
var sanitizeInlineHtml = (value) => {
|
|
3411
|
+
if (typeof document === "undefined") return escapeHtml(value);
|
|
3412
|
+
const template = document.createElement("template");
|
|
3413
|
+
template.innerHTML = value;
|
|
3414
|
+
Array.from(template.content.childNodes).forEach((child) => sanitizeNode(child));
|
|
3415
|
+
return template.innerHTML;
|
|
3416
|
+
};
|
|
3342
3417
|
var TYPE_ICON = {
|
|
3343
3418
|
positive: "notificationOutline",
|
|
3344
3419
|
negative: "warningOutline",
|
|
@@ -3388,7 +3463,8 @@ function SConfirmModal({
|
|
|
3388
3463
|
const mainStyle = MAIN_BUTTON_STYLE[mainButtonName ?? DEFAULT_MAIN_BUTTON[type]];
|
|
3389
3464
|
const tagNode = tagSlot ?? (tagLabel ? /* @__PURE__ */ jsxRuntime.jsx(STag, { shape: tagShape, size: tagSize, color: tagColor, label: tagLabel }) : null);
|
|
3390
3465
|
const optionNode = optionSlot ?? (slotLabel ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: slotLabel }) : null);
|
|
3391
|
-
const
|
|
3466
|
+
const hasContentBox = tagNode != null || optionNode != null;
|
|
3467
|
+
const hasBody = topMessage.length > 0 || bottomMessage.length > 0 || hasContentBox;
|
|
3392
3468
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3393
3469
|
SModalContainer,
|
|
3394
3470
|
{
|
|
@@ -3415,11 +3491,28 @@ function SConfirmModal({
|
|
|
3415
3491
|
)
|
|
3416
3492
|
] }),
|
|
3417
3493
|
hasBody && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-[20px] text-center text-[12px] font-normal leading-[20px] text-[color:var(--cmp-modal-confirm-message-color)] w-full", children: [
|
|
3418
|
-
topMessage.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-[2px]", children: topMessage.map((m, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3494
|
+
topMessage.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-[2px]", children: topMessage.map((m, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3495
|
+
"p",
|
|
3496
|
+
{
|
|
3497
|
+
className: "m-0",
|
|
3498
|
+
dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(m) }
|
|
3499
|
+
},
|
|
3500
|
+
i
|
|
3501
|
+
)) }),
|
|
3502
|
+
hasContentBox && // content-box: 흰 박스 + 1px 테두리 + 패딩 + 14/700 (원본 sd-confirm-modal__content-box)
|
|
3503
|
+
// tag 왼쪽, slotLabel/optionSlot 이 그 오른쪽에 gap 8 로 나란히 놓인다
|
|
3504
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-[8px] rounded-[8px] border border-solid border-[color:var(--color-grey-30)] bg-white px-[16px] py-[12px] text-[14px] font-bold leading-[22px] w-full", children: [
|
|
3505
|
+
tagNode,
|
|
3506
|
+
optionNode
|
|
3507
|
+
] }),
|
|
3508
|
+
bottomMessage.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-[2px]", children: bottomMessage.map((m, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3509
|
+
"p",
|
|
3510
|
+
{
|
|
3511
|
+
className: "m-0",
|
|
3512
|
+
dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(m) }
|
|
3513
|
+
},
|
|
3514
|
+
i
|
|
3515
|
+
)) })
|
|
3423
3516
|
] })
|
|
3424
3517
|
] }),
|
|
3425
3518
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-shrink-0 gap-[8px]", children: [
|