@openzeppelin/ui-components 3.2.0 → 3.3.0

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/index.cjs CHANGED
@@ -38,7 +38,7 @@ let sonner = require("sonner");
38
38
  let next_themes = require("next-themes");
39
39
 
40
40
  //#region src/version.ts
41
- const VERSION = "3.2.0";
41
+ const VERSION = "3.3.0";
42
42
 
43
43
  //#endregion
44
44
  //#region src/components/ui/accordion.tsx
@@ -470,32 +470,55 @@ const variantStyles = {
470
470
  icon: "text-red-600",
471
471
  title: "text-red-900",
472
472
  body: "text-red-800"
473
+ },
474
+ neutral: {
475
+ container: "border-border bg-muted/30",
476
+ icon: "text-muted-foreground",
477
+ title: "text-foreground",
478
+ body: "text-muted-foreground"
479
+ }
480
+ };
481
+ const sizeStyles = {
482
+ default: {
483
+ container: "p-4",
484
+ gap: "gap-3",
485
+ title: "mb-2 text-sm font-semibold",
486
+ body: "text-sm whitespace-pre-line",
487
+ dismissIcon: "h-5 w-5"
488
+ },
489
+ compact: {
490
+ container: "px-4 py-3",
491
+ gap: "gap-2",
492
+ title: "mb-1 text-xs font-medium",
493
+ body: "text-xs leading-relaxed whitespace-pre-line",
494
+ dismissIcon: "h-4 w-4"
473
495
  }
474
496
  };
475
497
  /**
476
498
  * Dismissible banner component for notifications and alerts
477
- * Can be used with various variants (info, success, warning, error)
499
+ * Can be used with various variants (info, success, warning, error, neutral)
478
500
  */
479
- const Banner = react.forwardRef(({ className, variant = "info", title, children, dismissible = true, onDismiss, icon }, ref) => {
480
- const styles = variantStyles[variant] || variantStyles.info;
501
+ const Banner = react.forwardRef(({ className, variant = "info", size = "default", title, children, dismissible = true, onDismiss, icon }, ref) => {
502
+ const styles = variantStyles[variant];
503
+ const sizing = sizeStyles[size];
481
504
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
482
505
  ref,
483
506
  role: "alert",
484
- className: (0, _openzeppelin_ui_utils.cn)("rounded-md border p-4", styles.container, className),
507
+ className: (0, _openzeppelin_ui_utils.cn)("rounded-md border", sizing.container, styles.container, className),
485
508
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
486
- className: "flex gap-3",
509
+ className: (0, _openzeppelin_ui_utils.cn)("flex", sizing.gap),
487
510
  children: [
488
511
  icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
489
512
  className: (0, _openzeppelin_ui_utils.cn)("mt-0.5 shrink-0", styles.icon),
490
513
  children: icon
491
514
  }),
492
515
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
493
- className: "flex-1",
516
+ className: "min-w-0 flex-1",
494
517
  children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
495
- className: (0, _openzeppelin_ui_utils.cn)("mb-2 font-semibold text-sm", styles.title),
518
+ className: (0, _openzeppelin_ui_utils.cn)(sizing.title, styles.title),
496
519
  children: title
497
520
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
498
- className: (0, _openzeppelin_ui_utils.cn)("text-sm whitespace-pre-line", styles.body),
521
+ className: (0, _openzeppelin_ui_utils.cn)(sizing.body, styles.body),
499
522
  children
500
523
  })]
501
524
  }),
@@ -504,7 +527,7 @@ const Banner = react.forwardRef(({ className, variant = "info", title, children,
504
527
  onClick: onDismiss,
505
528
  className: (0, _openzeppelin_ui_utils.cn)("self-start shrink-0 transition-colors hover:opacity-70", styles.icon),
506
529
  "aria-label": "Dismiss banner",
507
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "h-5 w-5" })
530
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: sizing.dismissIcon })
508
531
  })
509
532
  ]
510
533
  })