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