@a5it/sync-ui 0.1.38 → 0.1.40

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 (68) hide show
  1. package/dist/components/cards/detail-line-item.d.ts +45 -0
  2. package/dist/components/cards/detail-line-item.d.ts.map +1 -0
  3. package/dist/components/cards/detail-line-item.js +51 -0
  4. package/dist/components/cards/detail-line-item.js.map +1 -0
  5. package/dist/components/cards/index.d.ts +5 -0
  6. package/dist/components/cards/index.d.ts.map +1 -0
  7. package/dist/components/cards/index.js +6 -0
  8. package/dist/components/cards/index.js.map +1 -0
  9. package/dist/components/cards/sidebar-card.d.ts +87 -0
  10. package/dist/components/cards/sidebar-card.d.ts.map +1 -0
  11. package/dist/components/cards/sidebar-card.js +150 -0
  12. package/dist/components/cards/sidebar-card.js.map +1 -0
  13. package/dist/components/sidebar/index.d.ts +8 -1
  14. package/dist/components/sidebar/index.d.ts.map +1 -1
  15. package/dist/components/sidebar/index.js +8 -1
  16. package/dist/components/sidebar/index.js.map +1 -1
  17. package/dist/components/sidebar/sidebar-nav-popover.d.ts +70 -0
  18. package/dist/components/sidebar/sidebar-nav-popover.d.ts.map +1 -0
  19. package/dist/components/sidebar/sidebar-nav-popover.js +71 -0
  20. package/dist/components/sidebar/sidebar-nav-popover.js.map +1 -0
  21. package/dist/components/sidebar/sidebar-nav.d.ts +63 -0
  22. package/dist/components/sidebar/sidebar-nav.d.ts.map +1 -0
  23. package/dist/components/sidebar/sidebar-nav.js +119 -0
  24. package/dist/components/sidebar/sidebar-nav.js.map +1 -0
  25. package/dist/components/sidebar/sidebar-toggle.d.ts +14 -0
  26. package/dist/components/sidebar/sidebar-toggle.d.ts.map +1 -0
  27. package/dist/components/sidebar/sidebar-toggle.js +18 -0
  28. package/dist/components/sidebar/sidebar-toggle.js.map +1 -0
  29. package/dist/components/sidebar/use-sidebar-active.d.ts +12 -0
  30. package/dist/components/sidebar/use-sidebar-active.d.ts.map +1 -0
  31. package/dist/components/sidebar/use-sidebar-active.js +46 -0
  32. package/dist/components/sidebar/use-sidebar-active.js.map +1 -0
  33. package/dist/components/ui/button.d.ts +1 -1
  34. package/dist/components/ui/separator.d.ts +5 -0
  35. package/dist/components/ui/separator.d.ts.map +1 -0
  36. package/dist/components/ui/separator.js +9 -0
  37. package/dist/components/ui/separator.js.map +1 -0
  38. package/dist/components/ui/sidebar.d.ts +69 -0
  39. package/dist/components/ui/sidebar.d.ts.map +1 -0
  40. package/dist/components/ui/sidebar.js +193 -0
  41. package/dist/components/ui/sidebar.js.map +1 -0
  42. package/dist/components/ui/skeleton.d.ts +4 -0
  43. package/dist/components/ui/skeleton.d.ts.map +1 -0
  44. package/dist/components/ui/skeleton.js +8 -0
  45. package/dist/components/ui/skeleton.js.map +1 -0
  46. package/dist/components/ui/tooltip.d.ts +8 -0
  47. package/dist/components/ui/tooltip.d.ts.map +1 -0
  48. package/dist/components/ui/tooltip.js +18 -0
  49. package/dist/components/ui/tooltip.js.map +1 -0
  50. package/dist/hooks/index.d.ts +3 -0
  51. package/dist/hooks/index.d.ts.map +1 -1
  52. package/dist/hooks/index.js +3 -0
  53. package/dist/hooks/index.js.map +1 -1
  54. package/dist/hooks/use-is-mobile.d.ts +2 -0
  55. package/dist/hooks/use-is-mobile.d.ts.map +1 -0
  56. package/dist/hooks/use-is-mobile.js +16 -0
  57. package/dist/hooks/use-is-mobile.js.map +1 -0
  58. package/dist/index.d.ts +2 -0
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +2 -0
  61. package/dist/index.js.map +1 -1
  62. package/dist/providers/index.d.ts +1 -0
  63. package/dist/providers/index.d.ts.map +1 -1
  64. package/dist/providers/index.js +1 -0
  65. package/dist/providers/index.js.map +1 -1
  66. package/dist/types/index.d.ts +3 -0
  67. package/dist/types/index.d.ts.map +1 -1
  68. package/package.json +8 -4
@@ -0,0 +1,45 @@
1
+ import * as React from "react";
2
+ export type DetailLineItemProps = React.ComponentProps<"div">;
3
+ /**
4
+ * A key-value pair row for detail/sidebar cards.
5
+ *
6
+ * Compose with `DetailLineItemLabel` and `DetailLineItemValue` as children.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <DetailLineItem>
11
+ * <DetailLineItemLabel>Sub-Total</DetailLineItemLabel>
12
+ * <DetailLineItemValue>$1,234.56</DetailLineItemValue>
13
+ * </DetailLineItem>
14
+ * ```
15
+ *
16
+ * @example — custom label with tooltip
17
+ * ```tsx
18
+ * <DetailLineItem>
19
+ * <DetailLineItemLabel>
20
+ * <span>Est Margin</span>
21
+ * <Tooltip>…</Tooltip>
22
+ * </DetailLineItemLabel>
23
+ * <DetailLineItemValue className="text-[#2e6dfa]">
24
+ * $500.00 (15.5%)
25
+ * </DetailLineItemValue>
26
+ * </DetailLineItem>
27
+ * ```
28
+ */
29
+ declare function DetailLineItem({ className, children, ...props }: DetailLineItemProps): import("react/jsx-runtime").JSX.Element;
30
+ export type DetailLineItemLabelProps = React.ComponentProps<"div">;
31
+ /**
32
+ * Left-side label of a key-value row.
33
+ * Renders with 60% opacity by default. Accepts any ReactNode — plain text,
34
+ * icons, tooltips, etc.
35
+ */
36
+ declare function DetailLineItemLabel({ className, children, ...props }: DetailLineItemLabelProps): import("react/jsx-runtime").JSX.Element;
37
+ export type DetailLineItemValueProps = React.ComponentProps<"div">;
38
+ /**
39
+ * Right-side value of a key-value row.
40
+ * Renders as semibold text. Accepts any ReactNode — formatted currency,
41
+ * status pills, links, etc.
42
+ */
43
+ declare function DetailLineItemValue({ className, children, ...props }: DetailLineItemValueProps): import("react/jsx-runtime").JSX.Element;
44
+ export { DetailLineItem, DetailLineItemLabel, DetailLineItemValue };
45
+ //# sourceMappingURL=detail-line-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detail-line-item.d.ts","sourceRoot":"","sources":["../../../src/components/cards/detail-line-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAU7E;AAID,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAEnE;;;;GAIG;AACH,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,wBAAwB,2CAc1B;AAID,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAEnE;;;;GAIG;AACH,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,wBAAwB,2CAa1B;AAID,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cn } from "../../lib/utils";
4
+ /**
5
+ * A key-value pair row for detail/sidebar cards.
6
+ *
7
+ * Compose with `DetailLineItemLabel` and `DetailLineItemValue` as children.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <DetailLineItem>
12
+ * <DetailLineItemLabel>Sub-Total</DetailLineItemLabel>
13
+ * <DetailLineItemValue>$1,234.56</DetailLineItemValue>
14
+ * </DetailLineItem>
15
+ * ```
16
+ *
17
+ * @example — custom label with tooltip
18
+ * ```tsx
19
+ * <DetailLineItem>
20
+ * <DetailLineItemLabel>
21
+ * <span>Est Margin</span>
22
+ * <Tooltip>…</Tooltip>
23
+ * </DetailLineItemLabel>
24
+ * <DetailLineItemValue className="text-[#2e6dfa]">
25
+ * $500.00 (15.5%)
26
+ * </DetailLineItemValue>
27
+ * </DetailLineItem>
28
+ * ```
29
+ */
30
+ function DetailLineItem({ className, children, ...props }) {
31
+ return (_jsx("div", { className: cn("flex w-full items-start gap-2", className), "data-slot": "detail-line-item", ...props, children: children }));
32
+ }
33
+ /**
34
+ * Left-side label of a key-value row.
35
+ * Renders with 60% opacity by default. Accepts any ReactNode — plain text,
36
+ * icons, tooltips, etc.
37
+ */
38
+ function DetailLineItemLabel({ className, children, ...props }) {
39
+ return (_jsx("div", { className: cn("flex flex-1 items-center text-[14px] leading-[16px] text-[#1a1a1a]", className), style: { opacity: 0.6 }, "data-slot": "detail-line-item-label", ...props, children: children }));
40
+ }
41
+ /**
42
+ * Right-side value of a key-value row.
43
+ * Renders as semibold text. Accepts any ReactNode — formatted currency,
44
+ * status pills, links, etc.
45
+ */
46
+ function DetailLineItemValue({ className, children, ...props }) {
47
+ return (_jsx("div", { className: cn("shrink-0 text-[14px] font-semibold leading-[16px] text-[#1a1a1a]", className), "data-slot": "detail-line-item-value", ...props, children: children }));
48
+ }
49
+ /* ─────────────────────────── Exports ─────────────────────────── */
50
+ export { DetailLineItem, DetailLineItemLabel, DetailLineItemValue };
51
+ //# sourceMappingURL=detail-line-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detail-line-item.js","sourceRoot":"","sources":["../../../src/components/cards/detail-line-item.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAMrC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAuB;IAC5E,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,eAC/C,kBAAkB,KACxB,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAMD;;;;GAIG;AACH,SAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACiB;IACzB,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,oEAAoE,EACpE,SAAS,CACV,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,eACb,wBAAwB,KAC9B,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAMD;;;;GAIG;AACH,SAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACiB;IACzB,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,kEAAkE,EAClE,SAAS,CACV,eACS,wBAAwB,KAC9B,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,qEAAqE;AAErE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { SidebarCard, SidebarCardHeader, SidebarCardTitle, SidebarCardAction, SidebarCardContent, SidebarCardSection, } from "./sidebar-card";
2
+ export type { SidebarCardProps, SidebarCardHeaderProps, SidebarCardTitleProps, SidebarCardActionProps, SidebarCardContentProps, SidebarCardSectionProps, } from "./sidebar-card";
3
+ export { DetailLineItem, DetailLineItemLabel, DetailLineItemValue, } from "./detail-line-item";
4
+ export type { DetailLineItemProps, DetailLineItemLabelProps, DetailLineItemValueProps, } from "./detail-line-item";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/cards/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ // ── SidebarCard (composable) ──
3
+ export { SidebarCard, SidebarCardHeader, SidebarCardTitle, SidebarCardAction, SidebarCardContent, SidebarCardSection, } from "./sidebar-card";
4
+ // ── DetailLineItem (composable key-value row) ──
5
+ export { DetailLineItem, DetailLineItemLabel, DetailLineItemValue, } from "./detail-line-item";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/cards/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,iCAAiC;AACjC,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAUxB,kDAAkD;AAClD,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,87 @@
1
+ import * as React from "react";
2
+ export type SidebarCardProps = React.ComponentProps<"div"> & {
3
+ /**
4
+ * Initial open state for collapsible cards.
5
+ * @default true
6
+ */
7
+ defaultOpen?: boolean;
8
+ /**
9
+ * Whether the card can be collapsed/expanded.
10
+ * When `false`, the card renders as a static (always-open) detail card.
11
+ * @default true
12
+ */
13
+ collapsible?: boolean;
14
+ /** Cypress test identifier */
15
+ "data-cy"?: string;
16
+ };
17
+ /**
18
+ * Root container for a sidebar card.
19
+ *
20
+ * Manages collapse state via internal context so sub-components
21
+ * (`SidebarCardHeader`, `SidebarCardContent`, etc.) can read it
22
+ * without prop drilling.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * <SidebarCard>
27
+ * <SidebarCardHeader>
28
+ * <SidebarCardTitle>Quote</SidebarCardTitle>
29
+ * <SidebarCardAction>
30
+ * <MyDropdownMenu />
31
+ * </SidebarCardAction>
32
+ * </SidebarCardHeader>
33
+ * <SidebarCardContent>
34
+ * <SidebarCardSection bordered>…</SidebarCardSection>
35
+ * <SidebarCardSection>…</SidebarCardSection>
36
+ * </SidebarCardContent>
37
+ * </SidebarCard>
38
+ * ```
39
+ */
40
+ declare function SidebarCard({ defaultOpen, collapsible, className, children, ...props }: SidebarCardProps): import("react/jsx-runtime").JSX.Element;
41
+ export type SidebarCardHeaderProps = React.ComponentProps<"div">;
42
+ /**
43
+ * Header row for the sidebar card (56px height).
44
+ *
45
+ * When the card is collapsible, clicking the header area (excluding the
46
+ * action slot) toggles the card open/closed and renders a chevron icon.
47
+ *
48
+ * Compose with `SidebarCardTitle` and optionally `SidebarCardAction`.
49
+ */
50
+ declare function SidebarCardHeader({ className, children, ...props }: SidebarCardHeaderProps): import("react/jsx-runtime").JSX.Element;
51
+ export type SidebarCardTitleProps = React.ComponentProps<"div">;
52
+ /**
53
+ * Title text inside the header row.
54
+ * Renders as 18px bold text with truncation.
55
+ */
56
+ declare function SidebarCardTitle({ className, children, ...props }: SidebarCardTitleProps): import("react/jsx-runtime").JSX.Element;
57
+ export type SidebarCardActionProps = React.ComponentProps<"div">;
58
+ /**
59
+ * Right-side action slot in the header.
60
+ *
61
+ * The consumer brings their own content (dropdown menu, button, etc.).
62
+ * Clicks inside this slot are stopped from propagating to the toggle button.
63
+ */
64
+ declare function SidebarCardAction({ className, children, ...props }: SidebarCardActionProps): import("react/jsx-runtime").JSX.Element;
65
+ export type SidebarCardContentProps = React.ComponentProps<"div">;
66
+ /**
67
+ * Animated collapsible body of the card.
68
+ *
69
+ * Uses a ResizeObserver to measure content height and smoothly transition
70
+ * between open/closed states. When `collapsible` is `false` in the parent
71
+ * `SidebarCard`, this component simply renders its children without animation.
72
+ */
73
+ declare function SidebarCardContent({ className, children, ...props }: SidebarCardContentProps): import("react/jsx-runtime").JSX.Element;
74
+ export type SidebarCardSectionProps = React.ComponentProps<"div"> & {
75
+ /**
76
+ * Show a bottom border on this section.
77
+ * @default false
78
+ */
79
+ bordered?: boolean;
80
+ };
81
+ /**
82
+ * A padded section inside the card content.
83
+ * Use `bordered` to add a bottom separator between sections.
84
+ */
85
+ declare function SidebarCardSection({ bordered, className, children, ...props }: SidebarCardSectionProps): import("react/jsx-runtime").JSX.Element;
86
+ export { SidebarCard, SidebarCardHeader, SidebarCardTitle, SidebarCardAction, SidebarCardContent, SidebarCardSection, };
87
+ //# sourceMappingURL=sidebar-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-card.d.ts","sourceRoot":"","sources":["../../../src/components/cards/sidebar-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4B/B,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC3D;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,WAAW,CAAC,EACnB,WAAkB,EAClB,WAAkB,EAClB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,gBAAgB,2CA0BlB;AAID,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAEjE;;;;;;;GAOG;AACH,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAuExB;AAID,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAEhE;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,qBAAqB,2CAavB;AAID,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAEjE;;;;;GAKG;AACH,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAWxB;AAID,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAElE;;;;;;GAMG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,uBAAuB,2CA8DzB;AAID,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAClE;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,QAAgB,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,uBAAuB,2CAczB;AAID,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,CAAC"}
@@ -0,0 +1,150 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { ChevronUp } from "lucide-react";
5
+ import { cn } from "../../lib/utils";
6
+ const SidebarCardContext = React.createContext(null);
7
+ function useSidebarCardContext() {
8
+ const ctx = React.useContext(SidebarCardContext);
9
+ if (!ctx) {
10
+ throw new Error("SidebarCard compound components must be used within <SidebarCard>");
11
+ }
12
+ return ctx;
13
+ }
14
+ /**
15
+ * Root container for a sidebar card.
16
+ *
17
+ * Manages collapse state via internal context so sub-components
18
+ * (`SidebarCardHeader`, `SidebarCardContent`, etc.) can read it
19
+ * without prop drilling.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <SidebarCard>
24
+ * <SidebarCardHeader>
25
+ * <SidebarCardTitle>Quote</SidebarCardTitle>
26
+ * <SidebarCardAction>
27
+ * <MyDropdownMenu />
28
+ * </SidebarCardAction>
29
+ * </SidebarCardHeader>
30
+ * <SidebarCardContent>
31
+ * <SidebarCardSection bordered>…</SidebarCardSection>
32
+ * <SidebarCardSection>…</SidebarCardSection>
33
+ * </SidebarCardContent>
34
+ * </SidebarCard>
35
+ * ```
36
+ */
37
+ function SidebarCard({ defaultOpen = true, collapsible = true, className, children, ...props }) {
38
+ const [isOpen, setIsOpen] = React.useState(defaultOpen);
39
+ const toggle = React.useCallback(() => {
40
+ setIsOpen((prev) => !prev);
41
+ }, []);
42
+ const ctx = React.useMemo(() => ({ isOpen: collapsible ? isOpen : true, toggle, collapsible }), [isOpen, toggle, collapsible]);
43
+ return (_jsx(SidebarCardContext.Provider, { value: ctx, children: _jsx("div", { className: cn("overflow-hidden rounded-[12px] w-full bg-white", className), "data-slot": "sidebar-card", ...props, children: children }) }));
44
+ }
45
+ /**
46
+ * Header row for the sidebar card (56px height).
47
+ *
48
+ * When the card is collapsible, clicking the header area (excluding the
49
+ * action slot) toggles the card open/closed and renders a chevron icon.
50
+ *
51
+ * Compose with `SidebarCardTitle` and optionally `SidebarCardAction`.
52
+ */
53
+ function SidebarCardHeader({ className, children, ...props }) {
54
+ const { isOpen, toggle, collapsible } = useSidebarCardContext();
55
+ return (_jsxs("div", { className: cn("flex h-[56px] w-full items-center gap-[8px] border-b px-[24px] py-[8px]", collapsible && "hover:bg-[#fafafa] transition-colors", isOpen ? "border-[#e6e6e6]" : "border-transparent", className), "data-slot": "sidebar-card-header", ...props, children: [collapsible ? (_jsxs("button", { type: "button", onClick: toggle, className: "flex min-w-0 flex-1 items-center gap-[8px] text-left cursor-pointer rounded-[6px] hover:bg-[#fafafa] transition-colors", "aria-expanded": isOpen, "data-cy": "sidebar-card-toggle", children: [_jsx("div", { className: "size-5 shrink-0", children: _jsx(ChevronUp, { className: cn("size-5 transition-transform duration-200 ease-in-out", !isOpen && "rotate-180"), color: "#1a1a1a" }) }), React.Children.map(children, (child) => {
56
+ if (React.isValidElement(child) &&
57
+ child.props?.["data-slot"] ===
58
+ "sidebar-card-title") {
59
+ return child;
60
+ }
61
+ return null;
62
+ })] })) : (_jsx("div", { className: "flex min-w-0 flex-1 items-center gap-[8px]", children: React.Children.map(children, (child) => {
63
+ if (React.isValidElement(child) &&
64
+ child.props?.["data-slot"] ===
65
+ "sidebar-card-title") {
66
+ return child;
67
+ }
68
+ return null;
69
+ }) })), React.Children.map(children, (child) => {
70
+ if (React.isValidElement(child) &&
71
+ child.props?.["data-slot"] ===
72
+ "sidebar-card-action") {
73
+ return child;
74
+ }
75
+ return null;
76
+ })] }));
77
+ }
78
+ /**
79
+ * Title text inside the header row.
80
+ * Renders as 18px bold text with truncation.
81
+ */
82
+ function SidebarCardTitle({ className, children, ...props }) {
83
+ return (_jsx("div", { className: cn("flex-1 truncate text-[18px] font-bold leading-[24px] text-[#1a1a1a]", className), "data-slot": "sidebar-card-title", ...props, children: children }));
84
+ }
85
+ /**
86
+ * Right-side action slot in the header.
87
+ *
88
+ * The consumer brings their own content (dropdown menu, button, etc.).
89
+ * Clicks inside this slot are stopped from propagating to the toggle button.
90
+ */
91
+ function SidebarCardAction({ className, children, ...props }) {
92
+ return (_jsx("div", { className: cn("shrink-0", className), onClick: (e) => e.stopPropagation(), "data-slot": "sidebar-card-action", ...props, children: children }));
93
+ }
94
+ /**
95
+ * Animated collapsible body of the card.
96
+ *
97
+ * Uses a ResizeObserver to measure content height and smoothly transition
98
+ * between open/closed states. When `collapsible` is `false` in the parent
99
+ * `SidebarCard`, this component simply renders its children without animation.
100
+ */
101
+ function SidebarCardContent({ className, children, ...props }) {
102
+ const { isOpen, collapsible } = useSidebarCardContext();
103
+ const contentRef = React.useRef(null);
104
+ const [height, setHeight] = React.useState(isOpen ? undefined : 0);
105
+ // Measure content height when opening/closing
106
+ React.useEffect(() => {
107
+ if (!collapsible || !contentRef.current)
108
+ return;
109
+ if (isOpen) {
110
+ setHeight(contentRef.current.scrollHeight);
111
+ }
112
+ else {
113
+ setHeight(0);
114
+ }
115
+ }, [isOpen, collapsible]);
116
+ // Handle dynamic content changes while open
117
+ React.useEffect(() => {
118
+ if (!collapsible || !contentRef.current || !isOpen)
119
+ return;
120
+ const resizeObserver = new ResizeObserver((entries) => {
121
+ for (const entry of entries) {
122
+ if (isOpen) {
123
+ const newHeight = entry.contentRect.height;
124
+ setHeight((prev) => (prev === newHeight ? prev : newHeight));
125
+ }
126
+ }
127
+ });
128
+ resizeObserver.observe(contentRef.current);
129
+ return () => {
130
+ resizeObserver.disconnect();
131
+ };
132
+ }, [isOpen, collapsible]);
133
+ // Non-collapsible: render children directly
134
+ if (!collapsible) {
135
+ return (_jsx("div", { "data-slot": "sidebar-card-content", className: className, ...props, children: children }));
136
+ }
137
+ return (_jsx("div", { className: cn("overflow-hidden transition-all duration-300 ease-in-out", className), style: {
138
+ height: height !== undefined ? `${height}px` : undefined,
139
+ }, "data-slot": "sidebar-card-content", ...props, children: _jsx("div", { ref: contentRef, children: children }) }));
140
+ }
141
+ /**
142
+ * A padded section inside the card content.
143
+ * Use `bordered` to add a bottom separator between sections.
144
+ */
145
+ function SidebarCardSection({ bordered = false, className, children, ...props }) {
146
+ return (_jsx("div", { className: cn("px-6 py-3", bordered && "border-b border-[#e6e6e6]", className), "data-slot": "sidebar-card-section", ...props, children: children }));
147
+ }
148
+ /* ─────────────────────────── Exports ─────────────────────────── */
149
+ export { SidebarCard, SidebarCardHeader, SidebarCardTitle, SidebarCardAction, SidebarCardContent, SidebarCardSection, };
150
+ //# sourceMappingURL=sidebar-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-card.js","sourceRoot":"","sources":["../../../src/components/cards/sidebar-card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;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,CAAC;IAED,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,yDAAyD,EACzD,SAAS,CACV,EACD,KAAK,EAAE;YACL,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,SAAS;SACzD,eACS,sBAAsB,KAC5B,KAAK,YAET,cAAK,GAAG,EAAE,UAAU,YAAG,QAAQ,GAAO,GAClC,CACP,CAAC;AACJ,CAAC;AAYD;;;GAGG;AACH,SAAS,kBAAkB,CAAC,EAC1B,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACgB;IACxB,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,WAAW,EACX,QAAQ,IAAI,2BAA2B,EACvC,SAAS,CACV,eACS,sBAAsB,KAC5B,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,qEAAqE;AAErE,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,CAAC"}
@@ -1,2 +1,9 @@
1
- export {};
1
+ export { SidebarProvider, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, sidebarMenuButtonVariants, } from "../ui/sidebar";
2
+ export { SidebarNavGroup, SidebarNavItem, SidebarNavDivider } from "./sidebar-nav";
3
+ export type { SidebarNavGroupProps, SidebarNavItemProps, SidebarNavDividerProps, } from "./sidebar-nav";
4
+ export { SidebarNavPopover, SidebarNavPopoverItem, SidebarNavPopoverAction, } from "./sidebar-nav-popover";
5
+ export type { SidebarNavPopoverProps, SidebarNavPopoverItemProps, SidebarNavPopoverActionProps, } from "./sidebar-nav-popover";
6
+ export { SidebarToggle } from "./sidebar-toggle";
7
+ export type { SidebarToggleProps } from "./sidebar-toggle";
8
+ export { useSidebarActive, defaultIsActivePath } from "./use-sidebar-active";
2
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACnF,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,2 +1,9 @@
1
- export {};
1
+ "use client";
2
+ // Layer 1 — Primitives (re-exported from ui/sidebar.tsx)
3
+ export { SidebarProvider, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, sidebarMenuButtonVariants, } from "../ui/sidebar";
4
+ // Layer 2 — Composables
5
+ export { SidebarNavGroup, SidebarNavItem, SidebarNavDivider } from "./sidebar-nav";
6
+ export { SidebarNavPopover, SidebarNavPopoverItem, SidebarNavPopoverAction, } from "./sidebar-nav-popover";
7
+ export { SidebarToggle } from "./sidebar-toggle";
8
+ export { useSidebarActive, defaultIsActivePath } from "./use-sidebar-active";
2
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/sidebar/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/sidebar/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,yDAAyD;AACzD,OAAO,EACL,eAAe,EACf,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAEvB,wBAAwB;AACxB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAOnF,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,70 @@
1
+ import * as React from "react";
2
+ export interface SidebarNavPopoverActionProps {
3
+ className?: string;
4
+ children: React.ReactNode;
5
+ }
6
+ /**
7
+ * Action slot on a popover item (e.g., bookmark button, pin, etc.).
8
+ * The library knows nothing about what goes here — it's purely a layout slot.
9
+ */
10
+ export declare function SidebarNavPopoverAction({ className, children, }: SidebarNavPopoverActionProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare namespace SidebarNavPopoverAction {
12
+ var displayName: string;
13
+ }
14
+ export interface SidebarNavPopoverItemProps {
15
+ /** Link destination */
16
+ href: string;
17
+ /** Icon component */
18
+ icon?: React.ComponentType<{
19
+ className?: string;
20
+ }>;
21
+ /** Description text shown below the title (optional) */
22
+ description?: string;
23
+ /** Override active path matching. Defaults to [href]. */
24
+ activePaths?: string[];
25
+ /** Whether the item is disabled */
26
+ disabled?: boolean;
27
+ className?: string;
28
+ /**
29
+ * Children: label text, and optionally a SidebarNavPopoverAction.
30
+ */
31
+ children: React.ReactNode;
32
+ }
33
+ /**
34
+ * An individual item inside a SidebarNavPopover.
35
+ */
36
+ export declare function SidebarNavPopoverItem({ href, icon: Icon, description, activePaths: activePathsProp, disabled, className, children, }: SidebarNavPopoverItemProps): import("react/jsx-runtime").JSX.Element;
37
+ export declare namespace SidebarNavPopoverItem {
38
+ var displayName: string;
39
+ }
40
+ export interface SidebarNavPopoverProps {
41
+ className?: string;
42
+ /** Optional footer content */
43
+ footer?: React.ReactNode;
44
+ /** Content shown when there are no children */
45
+ emptyState?: React.ReactNode;
46
+ /** Which side to open on. Defaults to "right". */
47
+ side?: "right" | "left" | "top" | "bottom";
48
+ /** Alignment relative to the trigger. Defaults to "start". */
49
+ align?: "start" | "center" | "end";
50
+ /** Offset from the trigger in pixels. Defaults to 12. */
51
+ sideOffset?: number;
52
+ /**
53
+ * Called when the popover should close (e.g., after a link click).
54
+ * Injected automatically by SidebarNavItem — no need to pass manually.
55
+ */
56
+ onClose?: () => void;
57
+ /** Children: SidebarNavPopoverItem components */
58
+ children?: React.ReactNode;
59
+ }
60
+ /**
61
+ * Flyout popover for sub-navigation. Place as a child of SidebarNavItem.
62
+ *
63
+ * The popover renders as a PopoverContent and is wired up to the parent
64
+ * SidebarNavItem's Popover automatically.
65
+ */
66
+ export declare function SidebarNavPopover({ className, footer, emptyState, side, align, sideOffset, onClose, children, }: SidebarNavPopoverProps): import("react/jsx-runtime").JSX.Element;
67
+ export declare namespace SidebarNavPopover {
68
+ var displayName: string;
69
+ }
70
+ //# sourceMappingURL=sidebar-nav-popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-nav-popover.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/sidebar-nav-popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,MAAM,WAAW,4BAA4B;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,QAAQ,GACT,EAAE,4BAA4B,2CAa9B;yBAhBe,uBAAuB;;;AAwBvC,MAAM,WAAW,0BAA0B;IACzC,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,IAAI,EAAE,IAAI,EACV,WAAW,EACX,WAAW,EAAE,eAAe,EAC5B,QAAgB,EAChB,SAAS,EACT,QAAQ,GACT,EAAE,0BAA0B,2CAiF5B;yBAzFe,qBAAqB;;;AAiGrC,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,kDAAkD;IAClD,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3C,8DAA8D;IAC9D,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnC,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,MAAM,EACN,UAAU,EACV,IAAc,EACd,KAAe,EACf,UAAe,EACf,OAAO,EACP,QAAQ,GACT,EAAE,sBAAsB,2CAuCxB;yBAhDe,iBAAiB"}
@@ -0,0 +1,71 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { useMemo } from "react";
5
+ import Link from "next/link";
6
+ import { usePathname } from "next/navigation";
7
+ import { cn, kebabCase } from "../../lib/utils";
8
+ import { PopoverContent, PopoverArrow } from "../ui/popover";
9
+ import { defaultIsActivePath } from "./use-sidebar-active";
10
+ /**
11
+ * Action slot on a popover item (e.g., bookmark button, pin, etc.).
12
+ * The library knows nothing about what goes here — it's purely a layout slot.
13
+ */
14
+ export function SidebarNavPopoverAction({ className, children, }) {
15
+ return (_jsx("div", { "data-slot": "sidebar-nav-popover-action", className: cn("transition-opacity flex-none", className), onClick: (e) => e.stopPropagation(), children: children }));
16
+ }
17
+ SidebarNavPopoverAction.displayName = "SidebarNavPopoverAction";
18
+ /**
19
+ * An individual item inside a SidebarNavPopover.
20
+ */
21
+ export function SidebarNavPopoverItem({ href, icon: Icon, description, activePaths: activePathsProp, disabled = false, className, children, }) {
22
+ const pathname = usePathname();
23
+ const activePaths = activePathsProp ?? [href];
24
+ const isActive = useMemo(() => defaultIsActivePath(pathname, activePaths), [pathname, activePaths]);
25
+ // Separate text children from SidebarNavPopoverAction children
26
+ const { label, actionElement } = useMemo(() => {
27
+ let action = null;
28
+ const labelParts = [];
29
+ React.Children.forEach(children, (child) => {
30
+ if (React.isValidElement(child) &&
31
+ child.type?.displayName === "SidebarNavPopoverAction") {
32
+ action = child;
33
+ }
34
+ else {
35
+ labelParts.push(child);
36
+ }
37
+ });
38
+ return {
39
+ label: labelParts.length === 1 ? labelParts[0] : labelParts,
40
+ actionElement: action,
41
+ };
42
+ }, [children]);
43
+ const itemDataCy = `sidebar-popover-item-${kebabCase(typeof label === "string" ? label : href)}`;
44
+ return (_jsxs("div", { "data-slot": "sidebar-nav-popover-item", className: cn("group/popover-item h-10 flex items-center justify-between gap-2 rounded-[14px] p-2 transition-colors", isActive
45
+ ? "border-primary/20 bg-primary/5"
46
+ : "bg-white hover:bg-primary/5", disabled && "pointer-events-none opacity-50", className), children: [_jsxs(Link, { href: href, className: "flex items-center gap-3 min-w-0 flex-1", "data-cy": itemDataCy, children: [Icon && (_jsx(Icon, { className: cn("size-5 shrink-0", isActive
47
+ ? "text-primary"
48
+ : "text-[#1A1A1A] group-hover/popover-item:text-primary") })), _jsxs("div", { className: "flex flex-col min-w-0", children: [_jsx("span", { className: cn("font-normal text-sm truncate", isActive
49
+ ? "text-primary font-medium"
50
+ : "text-[#1A1A1A] group-hover/popover-item:text-primary"), children: label }), description && (_jsx("span", { className: "text-xs text-muted-foreground truncate", children: description }))] })] }), actionElement] }));
51
+ }
52
+ SidebarNavPopoverItem.displayName = "SidebarNavPopoverItem";
53
+ /**
54
+ * Flyout popover for sub-navigation. Place as a child of SidebarNavItem.
55
+ *
56
+ * The popover renders as a PopoverContent and is wired up to the parent
57
+ * SidebarNavItem's Popover automatically.
58
+ */
59
+ export function SidebarNavPopover({ className, footer, emptyState, side = "right", align = "start", sideOffset = 12, onClose, children, }) {
60
+ const hasChildren = React.Children.count(children) > 0;
61
+ return (_jsxs(PopoverContent, { side: side, align: align, sideOffset: sideOffset, className: cn("min-w-[266px] max-w-fit border-0 p-0 rounded-[20px] overflow-hidden", "[box-shadow:0_12px_20px_0_rgba(0,0,0,0.08),0_4px_6px_0_rgba(0,0,0,0.06)]", className), "data-slot": "sidebar-nav-popover", onInteractOutside: (event) => {
62
+ const target = event.target;
63
+ if (!(target instanceof HTMLElement))
64
+ return;
65
+ if (target.closest("[data-slot='sidebar-nav-popover']")) {
66
+ event.preventDefault();
67
+ }
68
+ }, children: [_jsx(PopoverArrow, { className: "fill-white [animation:none]" }), _jsx("div", { className: "bg-white", children: _jsxs("div", { className: "p-2", children: [_jsx("div", { className: "max-h-[500px] overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden pr-1", children: _jsx("div", { className: "flex flex-col gap-2", onClick: () => onClose?.(), children: !hasChildren && emptyState ? (_jsx("div", { className: "px-4 py-3", children: emptyState })) : (children) }) }), footer && _jsx("div", { className: "pt-2 mt-2 border-t border-[#E6E6E6]", children: footer })] }) })] }));
69
+ }
70
+ SidebarNavPopover.displayName = "SidebarNavPopover";
71
+ //# sourceMappingURL=sidebar-nav-popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-nav-popover.js","sourceRoot":"","sources":["../../../src/components/sidebar/sidebar-nav-popover.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAyB,MAAM,OAAO,CAAC;AACvD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAW,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAW3D;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,EACtC,SAAS,EACT,QAAQ,GACqB;IAC7B,OAAO,CACL,2BACY,4BAA4B,EACtC,SAAS,EAAE,EAAE,CACX,8BAA8B,EAC9B,SAAS,CACV,EACD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,YAElC,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,uBAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC;AAwBhE;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,IAAI,EACJ,IAAI,EAAE,IAAI,EACV,WAAW,EACX,WAAW,EAAE,eAAe,EAC5B,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,QAAQ,GACmB;IAC3B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,WAAW,GAAG,eAAe,IAAI,CAAC,IAAI,CAAC,CAAC;IAE9C,MAAM,QAAQ,GAAG,OAAO,CACtB,GAAG,EAAE,CAAC,mBAAmB,CAAC,QAAQ,EAAE,W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