@youngonesworks/ui 0.1.101 → 0.1.103

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.
@@ -1,9 +1,9 @@
1
- import { HTMLAttributes } from 'react';
1
+ import { type HTMLAttributes } from 'react';
2
2
  type AlertType = 'success' | 'warning' | 'error';
3
3
  interface AlertProps extends HTMLAttributes<HTMLDivElement> {
4
4
  show: boolean;
5
5
  title: string;
6
- description?: string;
6
+ description?: string | React.ReactNode;
7
7
  type?: AlertType;
8
8
  button?: React.ReactNode;
9
9
  plain?: boolean;
package/dist/index.cjs CHANGED
@@ -245,7 +245,7 @@ const Alert = ({ show, title, description, type = "warning", button, plain = fal
245
245
  };
246
246
  const config = typeConfig[type];
247
247
  const { bg, iconColor, Icon } = config;
248
- const descriptionId = description ? `alert-desc` : undefined;
248
+ const descriptionId = description ? "alert-desc" : undefined;
249
249
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
250
250
  role: "alert",
251
251
  "aria-live": "assertive",
@@ -274,11 +274,15 @@ const Alert = ({ show, title, description, type = "warning", button, plain = fal
274
274
  children: title
275
275
  })]
276
276
  }),
277
- description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
277
+ description && (typeof description === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
278
278
  id: descriptionId,
279
279
  className: "text-sm text-color-gray-900",
280
280
  children: description
281
- }),
281
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
282
+ id: descriptionId,
283
+ className: "text-sm text-color-gray-900",
284
+ children: description
285
+ })),
282
286
  button && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: button })
283
287
  ]
284
288
  }), closable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {