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.
Files changed (62) hide show
  1. package/dist/components/SActionModal/SActionModal.cjs +8 -2
  2. package/dist/components/SActionModal/SActionModal.cjs.map +1 -1
  3. package/dist/components/SActionModal/SActionModal.d.ts +11 -2
  4. package/dist/components/SActionModal/SActionModal.js +8 -2
  5. package/dist/components/SActionModal/SActionModal.js.map +1 -1
  6. package/dist/components/SChipInput/SChipInput.cjs +9 -2
  7. package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
  8. package/dist/components/SChipInput/SChipInput.js +9 -2
  9. package/dist/components/SChipInput/SChipInput.js.map +1 -1
  10. package/dist/components/SConfirmModal/SConfirmModal.cjs +101 -8
  11. package/dist/components/SConfirmModal/SConfirmModal.cjs.map +1 -1
  12. package/dist/components/SConfirmModal/SConfirmModal.d.ts +4 -3
  13. package/dist/components/SConfirmModal/SConfirmModal.js +101 -8
  14. package/dist/components/SConfirmModal/SConfirmModal.js.map +1 -1
  15. package/dist/components/SExpansionItem/SExpansionItem.cjs +11 -11
  16. package/dist/components/SExpansionItem/SExpansionItem.cjs.map +1 -1
  17. package/dist/components/SExpansionItem/SExpansionItem.js +11 -11
  18. package/dist/components/SExpansionItem/SExpansionItem.js.map +1 -1
  19. package/dist/components/SKeyValueTable/SKeyValueTable.cjs +20 -19
  20. package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
  21. package/dist/components/SKeyValueTable/SKeyValueTable.d.ts +57 -4
  22. package/dist/components/SKeyValueTable/SKeyValueTable.js +20 -19
  23. package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
  24. package/dist/components/SLoadingModal/SLoadingModal.cjs +8 -2
  25. package/dist/components/SLoadingModal/SLoadingModal.cjs.map +1 -1
  26. package/dist/components/SLoadingModal/SLoadingModal.js +8 -2
  27. package/dist/components/SLoadingModal/SLoadingModal.js.map +1 -1
  28. package/dist/components/SModal/SModal.cjs +101 -8
  29. package/dist/components/SModal/SModal.cjs.map +1 -1
  30. package/dist/components/SModal/SModal.js +101 -8
  31. package/dist/components/SModal/SModal.js.map +1 -1
  32. package/dist/components/SModalContainer/SModalContainer.cjs +8 -2
  33. package/dist/components/SModalContainer/SModalContainer.cjs.map +1 -1
  34. package/dist/components/SModalContainer/SModalContainer.js +8 -2
  35. package/dist/components/SModalContainer/SModalContainer.js.map +1 -1
  36. package/dist/components/SSelect/SSelect.cjs +20 -19
  37. package/dist/components/SSelect/SSelect.cjs.map +1 -1
  38. package/dist/components/SSelect/SSelect.js +20 -19
  39. package/dist/components/SSelect/SSelect.js.map +1 -1
  40. package/dist/components/SStepper/SStepper.cjs +1 -1
  41. package/dist/components/SStepper/SStepper.cjs.map +1 -1
  42. package/dist/components/SStepper/SStepper.js +1 -1
  43. package/dist/components/SStepper/SStepper.js.map +1 -1
  44. package/dist/components/STable/STable.cjs +20 -19
  45. package/dist/components/STable/STable.cjs.map +1 -1
  46. package/dist/components/STable/STable.js +20 -19
  47. package/dist/components/STable/STable.js.map +1 -1
  48. package/dist/components/STimePicker/STimePicker.cjs +1 -1
  49. package/dist/components/STimePicker/STimePicker.cjs.map +1 -1
  50. package/dist/components/STimePicker/STimePicker.js +1 -1
  51. package/dist/components/STimePicker/STimePicker.js.map +1 -1
  52. package/dist/components/STimeRangePicker/STimeRangePicker.cjs +1 -1
  53. package/dist/components/STimeRangePicker/STimeRangePicker.cjs.map +1 -1
  54. package/dist/components/STimeRangePicker/STimeRangePicker.js +1 -1
  55. package/dist/components/STimeRangePicker/STimeRangePicker.js.map +1 -1
  56. package/dist/index.cjs +75 -43
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.js +75 -43
  59. package/dist/index.js.map +1 -1
  60. package/dist/styles.css +303 -195
  61. package/dist/theme.css +229 -121
  62. package/package.json +1 -1
@@ -3143,11 +3143,17 @@ function SModalContainer({
3143
3143
  /* @__PURE__ */ jsx(InsideModalProvider, { value: true, children: /* @__PURE__ */ jsx(PortalContainerProvider, { value: portalContainer, children }) })
3144
3144
  ]
3145
3145
  }
3146
+ ),
3147
+ /* @__PURE__ */ jsx(
3148
+ "div",
3149
+ {
3150
+ ref: setPortalContainer,
3151
+ className: "pointer-events-auto fixed left-0 top-0 z-[1001]"
3152
+ }
3146
3153
  )
3147
3154
  ]
3148
3155
  }
3149
- ) }),
3150
- /* @__PURE__ */ jsx("div", { ref: setPortalContainer, className: "pointer-events-auto fixed left-0 top-0 z-[1001]" })
3156
+ ) })
3151
3157
  ] }) });
3152
3158
  }
3153
3159
 
@@ -3316,6 +3322,75 @@ var SButton = forwardRef(function SButton2({
3316
3322
  }
3317
3323
  );
3318
3324
  });
3325
+
3326
+ // src/lib/sanitize-inline-html.ts
3327
+ var ALLOWED_INLINE_TAGS = /* @__PURE__ */ new Set(["A", "B", "STRONG", "I", "EM", "BR", "SPAN"]);
3328
+ var ALLOWED_ATTRS_BY_TAG = {
3329
+ A: /* @__PURE__ */ new Set(["href", "target", "rel", "class"])
3330
+ };
3331
+ var COMMON_ALLOWED_ATTRS = /* @__PURE__ */ new Set(["class"]);
3332
+ var SAFE_HREF_RE = /^(https?:|mailto:|tel:|\/|#|\.)/i;
3333
+ var DROP_CONTENT_TAGS = /* @__PURE__ */ new Set([
3334
+ "SCRIPT",
3335
+ "STYLE",
3336
+ "IFRAME",
3337
+ "OBJECT",
3338
+ "EMBED",
3339
+ "META",
3340
+ "LINK",
3341
+ "BASE",
3342
+ "NOSCRIPT",
3343
+ // SVG/MATH 는 foreign-content 파싱 모드로 전환되어 재직렬화 시 다른 트리로
3344
+ // 재파싱될 수 있다(mXSS 벡터). 인라인 라벨에 필요 없으므로 통째로 제거한다.
3345
+ "SVG",
3346
+ "MATH",
3347
+ "TEMPLATE"
3348
+ ]);
3349
+ var escapeHtml = (value) => value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
3350
+ var sanitizeNode = (node) => {
3351
+ if (node.nodeType === Node.COMMENT_NODE) {
3352
+ node.remove();
3353
+ return;
3354
+ }
3355
+ if (node.nodeType !== Node.ELEMENT_NODE) return;
3356
+ const element = node;
3357
+ const tagName = element.tagName;
3358
+ if (DROP_CONTENT_TAGS.has(tagName)) {
3359
+ element.remove();
3360
+ return;
3361
+ }
3362
+ Array.from(element.childNodes).forEach((child) => sanitizeNode(child));
3363
+ if (ALLOWED_INLINE_TAGS.has(tagName)) {
3364
+ if (element.hasAttribute("className")) {
3365
+ const val = element.getAttribute("className");
3366
+ element.removeAttribute("className");
3367
+ if (!element.hasAttribute("class")) element.setAttribute("class", val);
3368
+ }
3369
+ const allowedAttrs = ALLOWED_ATTRS_BY_TAG[tagName] ?? COMMON_ALLOWED_ATTRS;
3370
+ Array.from(element.attributes).forEach((attr) => {
3371
+ if (!allowedAttrs.has(attr.name)) element.removeAttribute(attr.name);
3372
+ });
3373
+ if (tagName === "A") {
3374
+ const href = element.getAttribute("href");
3375
+ if (href !== null && href !== "" && !SAFE_HREF_RE.test(href)) element.removeAttribute("href");
3376
+ if (element.hasAttribute("target")) {
3377
+ element.setAttribute("rel", "noopener noreferrer");
3378
+ }
3379
+ }
3380
+ return;
3381
+ }
3382
+ const parent = element.parentNode;
3383
+ if (parent == null) return;
3384
+ while (element.firstChild) parent.insertBefore(element.firstChild, element);
3385
+ parent.removeChild(element);
3386
+ };
3387
+ var sanitizeInlineHtml = (value) => {
3388
+ if (typeof document === "undefined") return escapeHtml(value);
3389
+ const template = document.createElement("template");
3390
+ template.innerHTML = value;
3391
+ Array.from(template.content.childNodes).forEach((child) => sanitizeNode(child));
3392
+ return template.innerHTML;
3393
+ };
3319
3394
  var TYPE_ICON = {
3320
3395
  positive: "notificationOutline",
3321
3396
  negative: "warningOutline",
@@ -3365,7 +3440,8 @@ function SConfirmModal({
3365
3440
  const mainStyle = MAIN_BUTTON_STYLE[mainButtonName ?? DEFAULT_MAIN_BUTTON[type]];
3366
3441
  const tagNode = tagSlot ?? (tagLabel ? /* @__PURE__ */ jsx(STag, { shape: tagShape, size: tagSize, color: tagColor, label: tagLabel }) : null);
3367
3442
  const optionNode = optionSlot ?? (slotLabel ? /* @__PURE__ */ jsx("span", { children: slotLabel }) : null);
3368
- const hasBody = topMessage.length > 0 || bottomMessage.length > 0 || tagNode != null || optionNode != null;
3443
+ const hasContentBox = tagNode != null || optionNode != null;
3444
+ const hasBody = topMessage.length > 0 || bottomMessage.length > 0 || hasContentBox;
3369
3445
  return /* @__PURE__ */ jsx(
3370
3446
  SModalContainer,
3371
3447
  {
@@ -3392,11 +3468,28 @@ function SConfirmModal({
3392
3468
  )
3393
3469
  ] }),
3394
3470
  hasBody && /* @__PURE__ */ 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: [
3395
- topMessage.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-[2px]", children: topMessage.map((m, i) => /* @__PURE__ */ jsx("p", { className: "m-0", children: m }, i)) }),
3396
- tagNode != null && // tag 위치 content-box: 흰 박스 + 1px 테두리 + 패딩 + 14/700 (원본 sd-confirm-modal__content-box)
3397
- /* @__PURE__ */ jsx("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: tagNode }),
3398
- bottomMessage.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-[2px]", children: bottomMessage.map((m, i) => /* @__PURE__ */ jsx("p", { className: "m-0", children: m }, i)) }),
3399
- optionNode != null && optionNode
3471
+ topMessage.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-[2px]", children: topMessage.map((m, i) => /* @__PURE__ */ jsx(
3472
+ "p",
3473
+ {
3474
+ className: "m-0",
3475
+ dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(m) }
3476
+ },
3477
+ i
3478
+ )) }),
3479
+ hasContentBox && // content-box: 흰 박스 + 1px 테두리 + 패딩 + 14/700 (원본 sd-confirm-modal__content-box)
3480
+ // tag 왼쪽, slotLabel/optionSlot 이 그 오른쪽에 gap 8 로 나란히 놓인다
3481
+ /* @__PURE__ */ 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: [
3482
+ tagNode,
3483
+ optionNode
3484
+ ] }),
3485
+ bottomMessage.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-[2px]", children: bottomMessage.map((m, i) => /* @__PURE__ */ jsx(
3486
+ "p",
3487
+ {
3488
+ className: "m-0",
3489
+ dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(m) }
3490
+ },
3491
+ i
3492
+ )) })
3400
3493
  ] })
3401
3494
  ] }),
3402
3495
  /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 gap-[8px]", children: [