@salemcobalt/ui 0.2.0-rc.35 → 0.2.0-rc.36

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.d.ts CHANGED
@@ -1310,12 +1310,19 @@ declare const Toolbar: {
1310
1310
  };
1311
1311
 
1312
1312
  type BannerTone = 'info' | 'success' | 'warning' | 'danger' | 'neutral';
1313
+ type BannerPlacement = 'inline' | 'page';
1313
1314
  interface BannerProps extends ComponentPropsWithRef<'div'> {
1314
1315
  /** Colour and default icon. `warning` and `danger` are announced as alerts; the rest as status. */
1315
1316
  tone?: BannerTone | undefined;
1317
+ /**
1318
+ * `inline` (default): a rounded strip inside a view. `page`: a full-bleed notice across the top of the page, above
1319
+ * the header: square, compact, with a hairline under it. A page notice is there on every load, so pass
1320
+ * `role="status"` with a `warning` tone unless it must interrupt.
1321
+ */
1322
+ placement?: BannerPlacement | undefined;
1316
1323
  /** Replaces the tone's icon; `false` removes it. */
1317
1324
  icon?: ReactNode | false | undefined;
1318
- /** One Button, usually `variant="ghost" size="sm"`, at the end of the strip. */
1325
+ /** One Button, usually `variant="ghost" size="sm"`, at the end of the strip; or an Inline of two (Details, Hide). */
1319
1326
  action?: ReactNode | undefined;
1320
1327
  /** Shows a close button that hides the banner. */
1321
1328
  dismissible?: boolean | undefined;
@@ -1327,7 +1334,7 @@ interface BannerProps extends ComponentPropsWithRef<'div'> {
1327
1334
  dismissLabel?: string | undefined;
1328
1335
  }
1329
1336
  /** A single-line status strip across the top of a view: paused, offline, "3 new since you looked". */
1330
- declare function Banner({ tone, icon, action, dismissible, onDismiss, open, dismissLabel, role, className, children, ...rest }: BannerProps): react.JSX.Element | null;
1337
+ declare function Banner({ tone, placement, icon, action, dismissible, onDismiss, open, dismissLabel, role, className, children, ...rest }: BannerProps): react.JSX.Element | null;
1331
1338
 
1332
1339
  interface SpinnerProps extends ComponentPropsWithRef<'span'> {
1333
1340
  /** `xs` 12, `sm` 14, `md` 16 (default), `lg` 20, `xl` 24, or `em` to follow the font size. */
package/dist/index.js CHANGED
@@ -1505,6 +1505,7 @@ var toneIcons = {
1505
1505
  };
1506
1506
  function Banner({
1507
1507
  tone = "info",
1508
+ placement = "inline",
1508
1509
  icon,
1509
1510
  action,
1510
1511
  dismissible = false,
@@ -1526,6 +1527,7 @@ function Banner({
1526
1527
  role: role ?? (tone === "warning" || tone === "danger" ? "alert" : "status"),
1527
1528
  className: cx("sc-banner", className),
1528
1529
  "data-tone": tone,
1530
+ "data-placement": placement === "page" ? "page" : void 0,
1529
1531
  ...rest,
1530
1532
  children: [
1531
1533
  glyph ? /* @__PURE__ */ jsx18("span", { className: "sc-banner__icon", "aria-hidden": "true", children: glyph }) : null,