@powered-by-array/ui 1.80.3 → 1.81.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.
Files changed (28) hide show
  1. package/dist/components/SideSheet/SideSheet.d.ts +9 -6
  2. package/dist/components/SideSheet/SideSheet.d.ts.map +1 -1
  3. package/dist/components/SideSheet/SideSheet.js +13 -7
  4. package/dist/components/SideSheet/SideSheet.js.map +1 -1
  5. package/dist/components/SideSheet/SideSheet.types.d.ts +2 -0
  6. package/dist/components/SideSheet/SideSheet.types.d.ts.map +1 -1
  7. package/dist/components/SideSheet/SideSheetContent/SideSheetContent.d.ts +4 -1
  8. package/dist/components/SideSheet/SideSheetContent/SideSheetContent.d.ts.map +1 -1
  9. package/dist/components/SideSheet/SideSheetContent/SideSheetContent.js +11 -3
  10. package/dist/components/SideSheet/SideSheetContent/SideSheetContent.js.map +1 -1
  11. package/dist/components/SideSheet/SideSheetContent/SideSheetContent.variants.d.ts +2 -1
  12. package/dist/components/SideSheet/SideSheetContent/SideSheetContent.variants.d.ts.map +1 -1
  13. package/dist/components/SideSheet/SideSheetContent/SideSheetContent.variants.js +2 -1
  14. package/dist/components/SideSheet/SideSheetContent/SideSheetContent.variants.js.map +1 -1
  15. package/dist/components/SideSheet/SideSheetContext.d.ts +6 -0
  16. package/dist/components/SideSheet/SideSheetContext.d.ts.map +1 -0
  17. package/dist/components/SideSheet/SideSheetContext.js +3 -0
  18. package/dist/components/SideSheet/SideSheetContext.js.map +1 -0
  19. package/dist/components/SideSheet/SideSheetHeader/SideSheetHeader.d.ts +6 -2
  20. package/dist/components/SideSheet/SideSheetHeader/SideSheetHeader.d.ts.map +1 -1
  21. package/dist/components/SideSheet/SideSheetHeader/SideSheetHeader.js +10 -3
  22. package/dist/components/SideSheet/SideSheetHeader/SideSheetHeader.js.map +1 -1
  23. package/dist/components/SideSheet/SideSheetHeader/SideSheetHeader.types.d.ts +1 -3
  24. package/dist/components/SideSheet/SideSheetHeader/SideSheetHeader.types.d.ts.map +1 -1
  25. package/dist/components/SideSheet/SideSheetHeader/SideSheetHeader.variants.d.ts +2 -2
  26. package/dist/components/SideSheet/SideSheetHeader/SideSheetHeader.variants.js +2 -2
  27. package/dist/components/SideSheet/SideSheetHeader/SideSheetHeader.variants.js.map +1 -1
  28. package/package.json +1 -1
@@ -5,13 +5,16 @@ import { SideSheetHeader } from "./SideSheetHeader/index.js";
5
5
  /**
6
6
  * Docked side sheet for master-detail layouts.
7
7
  *
8
- * Composed of three regions — `SideSheet.Header` (carries the close button),
9
- * `SideSheet.Content` (scrollable), and the optional `SideSheet.Footer`. The
10
- * panel transitions its width between `0` (closed) and the internal
11
- * `SIDE_SHEET_WIDTH` constant (open). The consuming app supplies the portal
12
- * slot and "push" padding — this component is only the visual panel.
8
+ * The close button is owned by the panel and rendered only when `onClose` is
9
+ * provided (omit it to hide the close button). With a `SideSheet.Header` it
10
+ * lives in its own column on the right of the header, so header content can
11
+ * never overlap it. Without a header it lives at the top-right of the scrollable
12
+ * `SideSheet.Content` and scrolls away with it. The panel transitions its width
13
+ * between `0` (closed) and the internal
14
+ * `SIDE_SHEET_WIDTH` constant (open). The consuming app supplies the portal slot
15
+ * and "push" padding — this component is only the visual panel.
13
16
  */
14
- declare function SideSheet({ isOpen, children, title }: SideSheetProps): import("react/jsx-runtime").JSX.Element;
17
+ declare function SideSheet({ isOpen, children, title, onClose }: SideSheetProps): import("react/jsx-runtime").JSX.Element;
15
18
  declare namespace SideSheet {
16
19
  var Header: typeof SideSheetHeader;
17
20
  var Content: typeof SideSheetContent;
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheet.d.ts","sourceRoot":"","sources":["../../../src/components/SideSheet/SideSheet.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAW7D;;;;;;;;GAQG;AACH,iBAAS,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,cAAc,2CAgB7D;kBAhBQ,SAAS;;;;;AAsBlB,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"SideSheet.d.ts","sourceRoot":"","sources":["../../../src/components/SideSheet/SideSheet.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAW7D;;;;;;;;;;;GAWG;AACH,iBAAS,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,cAAc,2CAsBtE;kBAtBQ,SAAS;;;;;AA4BlB,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,8 +1,10 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
3
4
  import { cn } from "../../lib/cn.js";
4
5
  import { sideSheetSlotVariants as sv } from "./SideSheet.variants.js";
5
6
  import { SideSheetContent } from "./SideSheetContent/index.js";
7
+ import { SideSheetContext } from "./SideSheetContext.js";
6
8
  import { SideSheetFooter } from "./SideSheetFooter/index.js";
7
9
  import { SideSheetHeader } from "./SideSheetHeader/index.js";
8
10
  /**
@@ -15,14 +17,18 @@ const SIDE_SHEET_WIDTH = "clamp(380px, calc((100vw - var(--sidebar-width)) * 0.4
15
17
  /**
16
18
  * Docked side sheet for master-detail layouts.
17
19
  *
18
- * Composed of three regions — `SideSheet.Header` (carries the close button),
19
- * `SideSheet.Content` (scrollable), and the optional `SideSheet.Footer`. The
20
- * panel transitions its width between `0` (closed) and the internal
21
- * `SIDE_SHEET_WIDTH` constant (open). The consuming app supplies the portal
22
- * slot and "push" padding — this component is only the visual panel.
20
+ * The close button is owned by the panel and rendered only when `onClose` is
21
+ * provided (omit it to hide the close button). With a `SideSheet.Header` it
22
+ * lives in its own column on the right of the header, so header content can
23
+ * never overlap it. Without a header it lives at the top-right of the scrollable
24
+ * `SideSheet.Content` and scrolls away with it. The panel transitions its width
25
+ * between `0` (closed) and the internal
26
+ * `SIDE_SHEET_WIDTH` constant (open). The consuming app supplies the portal slot
27
+ * and "push" padding — this component is only the visual panel.
23
28
  */
24
- function SideSheet({ isOpen, children, title }) {
25
- return (_jsx("div", { "data-slot": "side-sheet", className: cn(sv.root), style: { width: isOpen ? SIDE_SHEET_WIDTH : "0px" }, "aria-hidden": !isOpen, "aria-label": title, children: isOpen && (_jsx("div", { "data-slot": "side-sheet-body", className: cn(sv.body), children: children })) }));
29
+ function SideSheet({ isOpen, children, title, onClose }) {
30
+ const hasHeader = React.Children.toArray(children).some((child) => React.isValidElement(child) && child.type === SideSheetHeader);
31
+ return (_jsx(SideSheetContext.Provider, { value: { onClose, hasHeader }, children: _jsx("div", { "data-slot": "side-sheet", className: cn(sv.root), style: { width: isOpen ? SIDE_SHEET_WIDTH : "0px" }, "aria-hidden": !isOpen, "aria-label": title, children: isOpen && (_jsx("div", { "data-slot": "side-sheet-body", className: cn(sv.body), children: children })) }) }));
26
32
  }
27
33
  SideSheet.Header = SideSheetHeader;
28
34
  SideSheet.Content = SideSheetContent;
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheet.js","sourceRoot":"","sources":["../../../src/components/SideSheet/SideSheet.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,qBAAqB,IAAI,EAAE,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,gBAAgB,GACpB,mEAAmE,CAAC;AAEtE;;;;;;;;GAQG;AACH,SAAS,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAkB;IAC5D,OAAO,CACL,2BACY,YAAY,EACtB,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EACtB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,EAAE,iBACtC,CAAC,MAAM,gBACR,KAAK,YAEhB,MAAM,IAAI,CACT,2BAAe,iBAAiB,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,YACpD,QAAQ,GACL,CACP,GACG,CACP,CAAC;AACJ,CAAC;AAED,SAAS,CAAC,MAAM,GAAG,eAAe,CAAC;AACnC,SAAS,CAAC,OAAO,GAAG,gBAAgB,CAAC;AACrC,SAAS,CAAC,MAAM,GAAG,eAAe,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"SideSheet.js","sourceRoot":"","sources":["../../../src/components/SideSheet/SideSheet.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,qBAAqB,IAAI,EAAE,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,gBAAgB,GACpB,mEAAmE,CAAC;AAEtE;;;;;;;;;;;GAWG;AACH,SAAS,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAkB;IACrE,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CACrD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,CACzE,CAAC;IAEF,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,YACtD,2BACY,YAAY,EACtB,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EACtB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,EAAE,iBACtC,CAAC,MAAM,gBACR,KAAK,YAEhB,MAAM,IAAI,CACT,2BAAe,iBAAiB,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,YACpD,QAAQ,GACL,CACP,GACG,GACoB,CAC7B,CAAC;AACJ,CAAC;AAED,SAAS,CAAC,MAAM,GAAG,eAAe,CAAC;AACnC,SAAS,CAAC,OAAO,GAAG,gBAAgB,CAAC;AACrC,SAAS,CAAC,MAAM,GAAG,eAAe,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -6,5 +6,7 @@ export interface SideSheetProps {
6
6
  children: ReactNode;
7
7
  /** sr-only title for accessibility. */
8
8
  title?: string;
9
+ /** When provided, renders the close button (header column, or top-right of the content when there is no header). Omit it to hide the close button entirely. */
10
+ onClose?: () => void;
9
11
  }
10
12
  //# sourceMappingURL=SideSheet.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheet.types.d.ts","sourceRoot":"","sources":["../../../src/components/SideSheet/SideSheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,MAAM,EAAE,OAAO,CAAC;IAChB,sGAAsG;IACtG,QAAQ,EAAE,SAAS,CAAC;IACpB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"SideSheet.types.d.ts","sourceRoot":"","sources":["../../../src/components/SideSheet/SideSheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,MAAM,EAAE,OAAO,CAAC;IAChB,sGAAsG;IACtG,QAAQ,EAAE,SAAS,CAAC;IACpB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+JAA+J;IAC/J,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
@@ -1,5 +1,8 @@
1
1
  import type { SideSheetContentProps } from "./SideSheetContent.types.js";
2
- /** Scrollable middle region. */
2
+ /**
3
+ * Scrollable middle region. When the sheet has no header, it also renders the
4
+ * close button at its top-right, so the button scrolls away with the content.
5
+ */
3
6
  declare function SideSheetContent({ children }: SideSheetContentProps): import("react/jsx-runtime").JSX.Element;
4
7
  declare namespace SideSheetContent {
5
8
  var displayName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheetContent.d.ts","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetContent/SideSheetContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGzE,gCAAgC;AAChC,iBAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAM5D;kBANQ,gBAAgB;;;AAUzB,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"SideSheetContent.d.ts","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetContent/SideSheetContent.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGzE;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAmB5D;kBAnBQ,gBAAgB;;;AAuBzB,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,9 +1,17 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { X } from "lucide-react";
3
+ import { useContext } from "react";
2
4
  import { cn } from "../../../lib/cn.js";
5
+ import { Button } from "../../Button/index.js";
6
+ import { SideSheetContext } from "../SideSheetContext.js";
3
7
  import { sideSheetContentSlotVariants as sv } from "./SideSheetContent.variants.js";
4
- /** Scrollable middle region. */
8
+ /**
9
+ * Scrollable middle region. When the sheet has no header, it also renders the
10
+ * close button at its top-right, so the button scrolls away with the content.
11
+ */
5
12
  function SideSheetContent({ children }) {
6
- return (_jsx("div", { "data-slot": "side-sheet-content", className: cn(sv.root), children: children }));
13
+ const { onClose, hasHeader } = useContext(SideSheetContext);
14
+ return (_jsxs("div", { "data-slot": "side-sheet-content", className: cn(sv.root), children: [onClose && !hasHeader && (_jsx(Button, { variant: "tertiary", size: "sm", className: cn(sv.close), onClick: onClose, "aria-label": "Close", children: _jsx(X, {}) })), children] }));
7
15
  }
8
16
  SideSheetContent.displayName = "SideSheet.Content";
9
17
  export { SideSheetContent };
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheetContent.js","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetContent/SideSheetContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,OAAO,EAAE,4BAA4B,IAAI,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpF,gCAAgC;AAChC,SAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAyB;IAC3D,OAAO,CACL,2BAAe,oBAAoB,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,YACvD,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"SideSheetContent.js","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetContent/SideSheetContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,4BAA4B,IAAI,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpF;;;GAGG;AACH,SAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAyB;IAC3D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAE5D,OAAO,CACL,4BAAe,oBAAoB,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,aACvD,OAAO,IAAI,CAAC,SAAS,IAAI,CACxB,KAAC,MAAM,IACL,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,IAAI,EACT,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EACvB,OAAO,EAAE,OAAO,gBACL,OAAO,YAElB,KAAC,CAAC,KAAG,GACE,CACV,EACA,QAAQ,IACL,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export declare const sideSheetContentSlotVariants: {
2
- readonly root: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-[24px]";
2
+ readonly root: "relative min-h-0 flex-1 overflow-y-auto overscroll-contain p-[24px]";
3
+ readonly close: "absolute right-[24px] top-[24px] z-10 size-[18px] shrink-0 cursor-pointer p-0 m-0";
3
4
  };
4
5
  //# sourceMappingURL=SideSheetContent.variants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheetContent.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetContent/SideSheetContent.variants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B;;CAE/B,CAAC"}
1
+ {"version":3,"file":"SideSheetContent.variants.d.ts","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetContent/SideSheetContent.variants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B;;;CAG/B,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export const sideSheetContentSlotVariants = {
2
- root: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-[24px]",
2
+ root: "relative min-h-0 flex-1 overflow-y-auto overscroll-contain p-[24px]",
3
+ close: "absolute right-[24px] top-[24px] z-10 size-[18px] shrink-0 cursor-pointer p-0 m-0",
3
4
  };
4
5
  //# sourceMappingURL=SideSheetContent.variants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheetContent.variants.js","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetContent/SideSheetContent.variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,4DAA4D;CAC1D,CAAC"}
1
+ {"version":3,"file":"SideSheetContent.variants.js","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetContent/SideSheetContent.variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,qEAAqE;IAC3E,KAAK,EAAE,mFAAmF;CAClF,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface SideSheetContextValue {
2
+ onClose?: () => void;
3
+ hasHeader?: boolean;
4
+ }
5
+ export declare const SideSheetContext: import("react").Context<SideSheetContextValue>;
6
+ //# sourceMappingURL=SideSheetContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideSheetContext.d.ts","sourceRoot":"","sources":["../../../src/components/SideSheet/SideSheetContext.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,gDAA2C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { createContext } from "react";
2
+ export const SideSheetContext = createContext({});
3
+ //# sourceMappingURL=SideSheetContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideSheetContext.js","sourceRoot":"","sources":["../../../src/components/SideSheet/SideSheetContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAOtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAwB,EAAE,CAAC,CAAC"}
@@ -1,6 +1,10 @@
1
1
  import type { SideSheetHeaderProps } from "./SideSheetHeader.types.js";
2
- /** Top region: caller content on the left, close button pinned to the right. */
3
- declare function SideSheetHeader({ children, onClose }: SideSheetHeaderProps): import("react/jsx-runtime").JSX.Element;
2
+ /**
3
+ * Top region: caller content on the left, close button in its own column on the
4
+ * right (only when the sheet has an `onClose`). The close button's column bounds
5
+ * the content so header actions can never overlap it.
6
+ */
7
+ declare function SideSheetHeader({ children }: SideSheetHeaderProps): import("react/jsx-runtime").JSX.Element;
4
8
  declare namespace SideSheetHeader {
5
9
  var displayName: string;
6
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheetHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetHeader/SideSheetHeader.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,gFAAgF;AAChF,iBAAS,eAAe,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,oBAAoB,2CAenE;kBAfQ,eAAe;;;AAmBxB,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"SideSheetHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetHeader/SideSheetHeader.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGvE;;;;GAIG;AACH,iBAAS,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE,oBAAoB,2CAmB1D;kBAnBQ,eAAe;;;AAuBxB,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,11 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { X } from "lucide-react";
3
+ import { useContext } from "react";
3
4
  import { cn } from "../../../lib/cn.js";
4
5
  import { Button } from "../../Button/index.js";
6
+ import { SideSheetContext } from "../SideSheetContext.js";
5
7
  import { sideSheetHeaderSlotVariants as sv } from "./SideSheetHeader.variants.js";
6
- /** Top region: caller content on the left, close button pinned to the right. */
7
- function SideSheetHeader({ children, onClose }) {
8
- return (_jsxs("div", { "data-slot": "side-sheet-header", className: cn(sv.root), children: [_jsx("div", { className: cn(sv.content), children: children }), _jsx(Button, { variant: "tertiary", size: "sm", className: cn(sv.close), onClick: onClose, "aria-label": "Close", children: _jsx(X, {}) })] }));
8
+ /**
9
+ * Top region: caller content on the left, close button in its own column on the
10
+ * right (only when the sheet has an `onClose`). The close button's column bounds
11
+ * the content so header actions can never overlap it.
12
+ */
13
+ function SideSheetHeader({ children }) {
14
+ const { onClose } = useContext(SideSheetContext);
15
+ return (_jsxs("div", { "data-slot": "side-sheet-header", className: cn(sv.root), children: [_jsx("div", { className: cn(sv.content), children: children }), onClose && (_jsx(Button, { variant: "tertiary", size: "sm", className: cn(sv.close), onClick: onClose, "aria-label": "Close", children: _jsx(X, {}) }))] }));
9
16
  }
10
17
  SideSheetHeader.displayName = "SideSheet.Header";
11
18
  export { SideSheetHeader };
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheetHeader.js","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetHeader/SideSheetHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,2BAA2B,IAAI,EAAE,EAAE,MAAM,+BAA+B,CAAC;AAElF,gFAAgF;AAChF,SAAS,eAAe,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAwB;IAClE,OAAO,CACL,4BAAe,mBAAmB,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,aACvD,cAAK,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,YAAG,QAAQ,GAAO,EAChD,KAAC,MAAM,IACL,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,IAAI,EACT,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EACvB,OAAO,EAAE,OAAO,gBACL,OAAO,YAElB,KAAC,CAAC,KAAE,GACG,IACL,CACP,CAAC;AACJ,CAAC;AAED,eAAe,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"SideSheetHeader.js","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetHeader/SideSheetHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,2BAA2B,IAAI,EAAE,EAAE,MAAM,+BAA+B,CAAC;AAElF;;;;GAIG;AACH,SAAS,eAAe,CAAC,EAAE,QAAQ,EAAwB;IACzD,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAEjD,OAAO,CACL,4BAAe,mBAAmB,EAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,aACvD,cAAK,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,YAAG,QAAQ,GAAO,EAC/C,OAAO,IAAI,CACV,KAAC,MAAM,IACL,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,IAAI,EACT,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EACvB,OAAO,EAAE,OAAO,gBACL,OAAO,YAElB,KAAC,CAAC,KAAG,GACE,CACV,IACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,8 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  export interface SideSheetHeaderProps {
3
- /** Header content rendered to the left of the close button. */
3
+ /** Header content. The close button is owned by the SideSheet root. */
4
4
  children: ReactNode;
5
- /** Called when the close button is clicked — closes the side sheet. Required. */
6
- onClose: () => void;
7
5
  }
8
6
  //# sourceMappingURL=SideSheetHeader.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheetHeader.types.d.ts","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetHeader/SideSheetHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,QAAQ,EAAE,SAAS,CAAC;IACpB,iFAAiF;IACjF,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
1
+ {"version":3,"file":"SideSheetHeader.types.d.ts","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetHeader/SideSheetHeader.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,oBAAoB;IACnC,uEAAuE;IACvE,QAAQ,EAAE,SAAS,CAAC;CACrB"}
@@ -1,6 +1,6 @@
1
1
  export declare const sideSheetHeaderSlotVariants: {
2
- readonly root: readonly ["flex shrink-0 items-center justify-between gap-4", "border-b border-[var(--color-semantic-side-sheet-border)]", "p-[24px]"];
2
+ readonly root: readonly ["flex shrink-0 items-start justify-between gap-4", "border-b border-[var(--color-semantic-side-sheet-border)]", "p-[24px]"];
3
3
  readonly content: "min-w-0 flex-1";
4
- readonly close: "size-[18px] shrink-0 p-0 m-0 cursor-pointer";
4
+ readonly close: "size-[18px] shrink-0 cursor-pointer p-0 m-0";
5
5
  };
6
6
  //# sourceMappingURL=SideSheetHeader.variants.d.ts.map
@@ -1,10 +1,10 @@
1
1
  export const sideSheetHeaderSlotVariants = {
2
2
  root: [
3
- "flex shrink-0 items-center justify-between gap-4",
3
+ "flex shrink-0 items-start justify-between gap-4",
4
4
  "border-b border-[var(--color-semantic-side-sheet-border)]",
5
5
  "p-[24px]",
6
6
  ],
7
7
  content: "min-w-0 flex-1",
8
- close: "size-[18px] shrink-0 p-0 m-0 cursor-pointer",
8
+ close: "size-[18px] shrink-0 cursor-pointer p-0 m-0",
9
9
  };
10
10
  //# sourceMappingURL=SideSheetHeader.variants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideSheetHeader.variants.js","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetHeader/SideSheetHeader.variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI,EAAE;QACJ,kDAAkD;QAClD,2DAA2D;QAC3D,UAAU;KACX;IACD,OAAO,EAAE,gBAAgB;IACzB,KAAK,EAAE,6CAA6C;CAC5C,CAAC"}
1
+ {"version":3,"file":"SideSheetHeader.variants.js","sourceRoot":"","sources":["../../../../src/components/SideSheet/SideSheetHeader/SideSheetHeader.variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI,EAAE;QACJ,iDAAiD;QACjD,2DAA2D;QAC3D,UAAU;KACX;IACD,OAAO,EAAE,gBAAgB;IACzB,KAAK,EAAE,6CAA6C;CAC5C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powered-by-array/ui",
3
- "version": "1.80.3",
3
+ "version": "1.81.0",
4
4
  "description": "ArrayHQ design system UI components",
5
5
  "type": "module",
6
6
  "repository": {