@robert-stackflow/oneui 0.6.48 → 0.6.49

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.
@@ -5,6 +5,8 @@ export type DrawerProps = {
5
5
  onClose(): void;
6
6
  onAfterClose?(): void;
7
7
  title: ReactNode;
8
+ /** Contextual actions next to the close control, outside the title heading. */
9
+ headerActions?: ReactNode;
8
10
  description?: ReactNode;
9
11
  /** Hide the header divider when embedded navigation already provides one. */
10
12
  headerDivider?: boolean;
@@ -22,4 +24,4 @@ export type DrawerProps = {
22
24
  portalContainer?: HTMLElement | null;
23
25
  className?: string;
24
26
  };
25
- export declare function Drawer({ open: requestedOpen, onClose, onAfterClose, title, description, headerDivider, children, footer, placement, size, closable, closeOnEscape, closeOnBackdrop, initialFocus, returnFocus, fallbackFocus, portalContainer, closeLabel, className, }: DrawerProps): import("react").ReactPortal | null;
27
+ export declare function Drawer({ open: requestedOpen, onClose, onAfterClose, title, headerActions, description, headerDivider, children, footer, placement, size, closable, closeOnEscape, closeOnBackdrop, initialFocus, returnFocus, fallbackFocus, portalContainer, closeLabel, className, }: DrawerProps): import("react").ReactPortal | null;
@@ -32,6 +32,7 @@ function Drawer({
32
32
  onClose,
33
33
  onAfterClose,
34
34
  title,
35
+ headerActions,
35
36
  description,
36
37
  headerDivider = true,
37
38
  children,
@@ -147,7 +148,10 @@ function Drawer({
147
148
  /* @__PURE__ */ jsx("h2", { id: titleId, children: title }),
148
149
  description != null && /* @__PURE__ */ jsx("div", { id: descriptionId, className: s.description, children: description })
149
150
  ] }),
150
- closable && /* @__PURE__ */ jsx(IconButton, { label: closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx(X, {}) })
151
+ (headerActions || closable) && /* @__PURE__ */ jsxs("div", { className: s.actions, children: [
152
+ headerActions,
153
+ closable && /* @__PURE__ */ jsx(IconButton, { label: closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx(X, {}) })
154
+ ] })
151
155
  ] }),
152
156
  /* @__PURE__ */ jsx("div", { className: s.body, "data-drawer-body": true, children }),
153
157
  footer && /* @__PURE__ */ jsx("footer", { className: s.footer, children: footer })
@@ -62,9 +62,16 @@
62
62
  var(--separator-color);
63
63
  }
64
64
  .heading {
65
+ flex: 1;
65
66
  min-width: 0;
66
67
  padding-top: 4px;
67
68
  }
69
+ .actions {
70
+ display: flex;
71
+ flex: none;
72
+ align-items: center;
73
+ gap: 8px;
74
+ }
68
75
  .header[data-divider="false"] {
69
76
  border-bottom: 0;
70
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robert-stackflow/oneui",
3
- "version": "0.6.48",
3
+ "version": "0.6.49",
4
4
  "description": "OneUI React components, application shell and portable visual themes",
5
5
  "type": "module",
6
6
  "sideEffects": [