@sia.soul/sia-react-ui 0.1.37 → 0.1.38
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/core.css +3 -1
- package/dist/index.cjs +3 -1
- package/dist/index.css +3 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/core.css
CHANGED
|
@@ -9637,9 +9637,11 @@ body > .sia-popup-portal[data-sia-popup-layer] {
|
|
|
9637
9637
|
display: block;
|
|
9638
9638
|
}
|
|
9639
9639
|
.sia-alert__content > span {
|
|
9640
|
-
margin-top: 3px;
|
|
9641
9640
|
color: var(--sia-color-text-secondary);
|
|
9642
9641
|
}
|
|
9642
|
+
.sia-alert__content > strong + span {
|
|
9643
|
+
margin-top: 3px;
|
|
9644
|
+
}
|
|
9643
9645
|
.sia-alert__close {
|
|
9644
9646
|
align-self: flex-start;
|
|
9645
9647
|
padding: 3px;
|
package/dist/index.cjs
CHANGED
|
@@ -1927,11 +1927,13 @@ function Alert({
|
|
|
1927
1927
|
}) {
|
|
1928
1928
|
const [visible, setVisible] = (0, import_react9.useState)(true);
|
|
1929
1929
|
const resolvedStatus = status ?? type ?? (banner ? "warning" : "info");
|
|
1930
|
+
const heading = message2 ?? title;
|
|
1931
|
+
const hasHeading = heading != null && heading !== "" && typeof heading !== "boolean";
|
|
1930
1932
|
if (!visible) return null;
|
|
1931
1933
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `sia-alert sia-alert--${resolvedStatus}${banner ? " sia-alert--banner" : ""}${description ? " sia-alert--with-description" : ""} ${className}`.trim(), role: "alert", ...withTitleTooltip(props), children: [
|
|
1932
1934
|
showIcon || banner ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "sia-alert__icon", "aria-hidden": "true", children: alertIcons[resolvedStatus] }) : null,
|
|
1933
1935
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "sia-alert__content", children: [
|
|
1934
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("strong", { children:
|
|
1936
|
+
hasHeading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("strong", { children: heading }) : null,
|
|
1935
1937
|
description ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: description }) : null
|
|
1936
1938
|
] }),
|
|
1937
1939
|
action ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "sia-alert__action", children: action }) : null,
|
package/dist/index.css
CHANGED
|
@@ -9637,9 +9637,11 @@ body > .sia-popup-portal[data-sia-popup-layer] {
|
|
|
9637
9637
|
display: block;
|
|
9638
9638
|
}
|
|
9639
9639
|
.sia-alert__content > span {
|
|
9640
|
-
margin-top: 3px;
|
|
9641
9640
|
color: var(--sia-color-text-secondary);
|
|
9642
9641
|
}
|
|
9642
|
+
.sia-alert__content > strong + span {
|
|
9643
|
+
margin-top: 3px;
|
|
9644
|
+
}
|
|
9643
9645
|
.sia-alert__close {
|
|
9644
9646
|
align-self: flex-start;
|
|
9645
9647
|
padding: 3px;
|
package/dist/index.d.cts
CHANGED
|
@@ -20,9 +20,9 @@ interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
|
20
20
|
status?: AlertStatus;
|
|
21
21
|
/** 类型标识,用于选择对应的表现形式。 */
|
|
22
22
|
type?: AlertStatus;
|
|
23
|
-
/**
|
|
23
|
+
/** 标题内容,支持文本或 React 节点;message 未提供时使用。 */
|
|
24
24
|
title?: ReactNode;
|
|
25
|
-
/**
|
|
25
|
+
/** 提示标题,支持文本或 React 节点,优先于 title;没有标题内容时不渲染标题区域。 */
|
|
26
26
|
message?: ReactNode;
|
|
27
27
|
/** 补充说明内容。 */
|
|
28
28
|
description?: ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
|
20
20
|
status?: AlertStatus;
|
|
21
21
|
/** 类型标识,用于选择对应的表现形式。 */
|
|
22
22
|
type?: AlertStatus;
|
|
23
|
-
/**
|
|
23
|
+
/** 标题内容,支持文本或 React 节点;message 未提供时使用。 */
|
|
24
24
|
title?: ReactNode;
|
|
25
|
-
/**
|
|
25
|
+
/** 提示标题,支持文本或 React 节点,优先于 title;没有标题内容时不渲染标题区域。 */
|
|
26
26
|
message?: ReactNode;
|
|
27
27
|
/** 补充说明内容。 */
|
|
28
28
|
description?: ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -162,11 +162,13 @@ function Alert({
|
|
|
162
162
|
}) {
|
|
163
163
|
const [visible, setVisible] = useState(true);
|
|
164
164
|
const resolvedStatus = status ?? type ?? (banner ? "warning" : "info");
|
|
165
|
+
const heading = message2 ?? title;
|
|
166
|
+
const hasHeading = heading != null && heading !== "" && typeof heading !== "boolean";
|
|
165
167
|
if (!visible) return null;
|
|
166
168
|
return /* @__PURE__ */ jsxs("div", { className: `sia-alert sia-alert--${resolvedStatus}${banner ? " sia-alert--banner" : ""}${description ? " sia-alert--with-description" : ""} ${className}`.trim(), role: "alert", ...withTitleTooltip(props), children: [
|
|
167
169
|
showIcon || banner ? /* @__PURE__ */ jsx("span", { className: "sia-alert__icon", "aria-hidden": "true", children: alertIcons[resolvedStatus] }) : null,
|
|
168
170
|
/* @__PURE__ */ jsxs("div", { className: "sia-alert__content", children: [
|
|
169
|
-
/* @__PURE__ */ jsx("strong", { children:
|
|
171
|
+
hasHeading ? /* @__PURE__ */ jsx("strong", { children: heading }) : null,
|
|
170
172
|
description ? /* @__PURE__ */ jsx("span", { children: description }) : null
|
|
171
173
|
] }),
|
|
172
174
|
action ? /* @__PURE__ */ jsx("div", { className: "sia-alert__action", children: action }) : null,
|