@arbidocs/react 0.4.4 → 0.4.5
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/README.md +11 -0
- package/dist/artifacts/index.cjs +458 -0
- package/dist/artifacts/index.cjs.map +1 -0
- package/dist/artifacts/index.d.cts +276 -0
- package/dist/artifacts/index.d.ts +276 -0
- package/dist/artifacts/index.js +434 -0
- package/dist/artifacts/index.js.map +1 -0
- package/dist/artifacts/redline-core.cjs +20 -0
- package/dist/artifacts/redline-core.cjs.map +1 -0
- package/dist/artifacts/redline-core.d.cts +36 -0
- package/dist/artifacts/redline-core.d.ts +36 -0
- package/dist/artifacts/redline-core.js +3 -0
- package/dist/artifacts/redline-core.js.map +1 -0
- package/dist/chunk-2DXS7L7M.cjs +302 -0
- package/dist/chunk-2DXS7L7M.cjs.map +1 -0
- package/dist/{chunk-ORKGCXG3.cjs → chunk-7BDGLRQX.cjs} +123 -427
- package/dist/chunk-7BDGLRQX.cjs.map +1 -0
- package/dist/chunk-7V7B7OEM.cjs +318 -0
- package/dist/chunk-7V7B7OEM.cjs.map +1 -0
- package/dist/{chunk-MIJRORQL.js → chunk-DVRJFLE7.js} +8 -302
- package/dist/chunk-DVRJFLE7.js.map +1 -0
- package/dist/{chunk-EJ2BMHYK.js → chunk-FSMIN5VX.js} +4 -3
- package/dist/chunk-FSMIN5VX.js.map +1 -0
- package/dist/chunk-H7ZZQ4ZV.js +305 -0
- package/dist/chunk-H7ZZQ4ZV.js.map +1 -0
- package/dist/{chunk-JKO3NR5L.js → chunk-HDCRPPBW.js} +5 -23
- package/dist/chunk-HDCRPPBW.js.map +1 -0
- package/dist/chunk-J4MX2W4H.js +26 -0
- package/dist/chunk-J4MX2W4H.js.map +1 -0
- package/dist/{chunk-6ALMBER7.js → chunk-N5SVBDLC.js} +4 -9
- package/dist/chunk-N5SVBDLC.js.map +1 -0
- package/dist/{chunk-RZQACYNQ.cjs → chunk-OBNTJEEO.cjs} +14 -20
- package/dist/chunk-OBNTJEEO.cjs.map +1 -0
- package/dist/{chunk-BXP6S34V.cjs → chunk-PGLV23SB.cjs} +13 -12
- package/dist/chunk-PGLV23SB.cjs.map +1 -0
- package/dist/chunk-RKWNX32A.js +299 -0
- package/dist/chunk-RKWNX32A.js.map +1 -0
- package/dist/chunk-S6A6FSG7.cjs +13 -0
- package/dist/chunk-S6A6FSG7.cjs.map +1 -0
- package/dist/chunk-SN5YV6FF.js +11 -0
- package/dist/chunk-SN5YV6FF.js.map +1 -0
- package/dist/{chunk-7IOCMCC5.cjs → chunk-TMPDW7J5.cjs} +3 -23
- package/dist/chunk-TMPDW7J5.cjs.map +1 -0
- package/dist/chunk-VJWAP2HJ.cjs +303 -0
- package/dist/chunk-VJWAP2HJ.cjs.map +1 -0
- package/dist/chunk-ZMTLGO3K.cjs +29 -0
- package/dist/chunk-ZMTLGO3K.cjs.map +1 -0
- package/dist/chunk-ZY53R6I4.js +276 -0
- package/dist/chunk-ZY53R6I4.js.map +1 -0
- package/dist/index.cjs +497 -690
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -282
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +8 -7
- package/dist/shell/index.js +3 -2
- package/dist/ui/index.cjs +156 -154
- package/dist/ui/index.js +4 -2
- package/dist/viewers/index.cjs +9 -8
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.js +3 -2
- package/dist/viewers/index.js.map +1 -1
- package/package.json +19 -3
- package/dist/chunk-6ALMBER7.js.map +0 -1
- package/dist/chunk-7IOCMCC5.cjs.map +0 -1
- package/dist/chunk-BXP6S34V.cjs.map +0 -1
- package/dist/chunk-EJ2BMHYK.js.map +0 -1
- package/dist/chunk-JKO3NR5L.js.map +0 -1
- package/dist/chunk-MIJRORQL.js.map +0 -1
- package/dist/chunk-ORKGCXG3.cjs.map +0 -1
- package/dist/chunk-RZQACYNQ.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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,qBAAA,CAAsB,cAAoC,qBAAA,CAAA,SAAA,CAAU,WAAA;AAEpE,IAAM,iBAAA,GAA0B,MAAA,CAAA,UAAA,CAK9B,CAAC,EAAE,SAAA,EAAW,OAAO,GAAG,KAAA,EAAM,EAAG,GAAA,qBACjCA,GAAAA;AAAA,EAAuB,qBAAA,CAAA,KAAA;AAAA,EAAtB;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,mCAAA,EAAqC,KAAA,IAAS,QAAQ,SAAS,CAAA;AAAA,IAC5E,GAAG;AAAA;AACN,CACD;AACD,iBAAA,CAAkB,cAAoC,qBAAA,CAAA,KAAA,CAAM,WAAA;AAE5D,IAAM,qBAAA,GAA8B,kBAGlC,CAAC,EAAE,WAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1BA,GAAAA;AAAA,EAAuB,qBAAA,CAAA,SAAA;AAAA,EAAtB;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,0BAAA,EAA4B,SAAS,CAAA;AAAA,IAClD,GAAG;AAAA;AACN,CACD;AACD,qBAAA,CAAsB,cAAoC,qBAAA,CAAA,SAAA,CAAU,WAAA;AAEpE,IAAM,uBAAuB,CAAC,EAAE,SAAA,EAAW,GAAG,OAAM,KAA6C;AAC/F,EAAA,uBAAOA,IAAC,MAAA,EAAA,EAAK,SAAA,EAAW,GAAG,4CAAA,EAA8C,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAClG;AACA,oBAAA,CAAqB,WAAA,GAAc,sBAAA","file":"chunk-N5SVBDLC.js","sourcesContent":["import * as React from 'react'\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'\n\nimport { cn } from '../lib/utils'\n\nconst ScrollArea = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn('relative overflow-hidden', className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n))\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName\n\nconst ScrollBar = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = 'vertical', ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex touch-none select-none transition-colors',\n orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent p-[1px]',\n orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent p-[1px]',\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n))\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName\n\nexport { ScrollArea, ScrollBar }\n","/**\n * Collision padding for Radix poppers (menus, popovers, selects, hover cards).\n *\n * 8px on every side, plus, at the bottom, the amount by which the layout viewport is taller than\n * the visible one. Mobile Safari (and its landscape emulation) reports a layout viewport that is\n * larger than `innerHeight` while the toolbars are showing, so Radix would otherwise place a menu\n * under the bottom bar.\n */\nexport function getCollisionPadding(): {\n top: number\n right: number\n bottom: number\n left: number\n} {\n const base = 8\n if (typeof window === 'undefined') return { top: base, right: base, bottom: base, left: base }\n const hidden = Math.max(\n 0,\n (document.documentElement?.clientHeight ?? window.innerHeight) - window.innerHeight\n )\n return { top: base, right: base, bottom: base + hidden, left: base }\n}\n","'use client'\n\nimport * as React from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-react'\n\nimport { cn } from '../lib/utils'\nimport { getCollisionPadding } from '../lib/collision-padding'\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 pointer-coarse:min-h-11 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n collisionPadding={getCollisionPadding()}\n className={cn(\n 'z-50 min-w-[8rem] max-w-[calc(100vw-1rem)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]',\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={getCollisionPadding()}\n className={cn(\n 'z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] max-w-[calc(100vw-1rem)] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]',\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 pointer-coarse:min-h-11 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 pointer-coarse:min-h-11 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-4 w-4 items-center justify-center rounded border border-border bg-popover\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-3.5 w-3.5 text-primary\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 pointer-coarse:min-h-11 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-sm tracking-widest opacity-60', className)} {...props} />\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var tailwindMerge = require('tailwind-merge');
|
|
3
|
+
var chunkS6A6FSG7_cjs = require('./chunk-S6A6FSG7.cjs');
|
|
5
4
|
var React2 = require('react');
|
|
6
5
|
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
|
7
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -30,15 +29,11 @@ var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
|
30
29
|
var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
|
|
31
30
|
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
32
31
|
|
|
33
|
-
// src/lib/utils.ts
|
|
34
|
-
function cn(...inputs) {
|
|
35
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
36
|
-
}
|
|
37
32
|
var ScrollArea = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
38
33
|
ScrollAreaPrimitive__namespace.Root,
|
|
39
34
|
{
|
|
40
35
|
ref,
|
|
41
|
-
className: cn("relative overflow-hidden", className),
|
|
36
|
+
className: chunkS6A6FSG7_cjs.cn("relative overflow-hidden", className),
|
|
42
37
|
...props,
|
|
43
38
|
children: [
|
|
44
39
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
@@ -53,7 +48,7 @@ var ScrollBar = React2__namespace.forwardRef(({ className, orientation = "vertic
|
|
|
53
48
|
{
|
|
54
49
|
ref,
|
|
55
50
|
orientation,
|
|
56
|
-
className: cn(
|
|
51
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
57
52
|
"flex touch-none select-none transition-colors",
|
|
58
53
|
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
59
54
|
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
@@ -85,7 +80,7 @@ var DropdownMenuSubTrigger = React2__namespace.forwardRef(({ className, inset, c
|
|
|
85
80
|
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
86
81
|
{
|
|
87
82
|
ref,
|
|
88
|
-
className: cn(
|
|
83
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
89
84
|
"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 pointer-coarse:min-h-11 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
90
85
|
inset && "pl-8",
|
|
91
86
|
className
|
|
@@ -103,7 +98,7 @@ var DropdownMenuSubContent = React2__namespace.forwardRef(({ className, ...props
|
|
|
103
98
|
{
|
|
104
99
|
ref,
|
|
105
100
|
collisionPadding: getCollisionPadding(),
|
|
106
|
-
className: cn(
|
|
101
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
107
102
|
"z-50 min-w-[8rem] max-w-[calc(100vw-1rem)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
108
103
|
className
|
|
109
104
|
),
|
|
@@ -117,7 +112,7 @@ var DropdownMenuContent = React2__namespace.forwardRef(({ className, sideOffset
|
|
|
117
112
|
ref,
|
|
118
113
|
sideOffset,
|
|
119
114
|
collisionPadding: getCollisionPadding(),
|
|
120
|
-
className: cn(
|
|
115
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
121
116
|
"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] max-w-[calc(100vw-1rem)] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg",
|
|
122
117
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
123
118
|
className
|
|
@@ -130,7 +125,7 @@ var DropdownMenuItem = React2__namespace.forwardRef(({ className, inset, ...prop
|
|
|
130
125
|
DropdownMenuPrimitive__namespace.Item,
|
|
131
126
|
{
|
|
132
127
|
ref,
|
|
133
|
-
className: cn(
|
|
128
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
134
129
|
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 pointer-coarse:min-h-11 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
135
130
|
inset && "pl-8",
|
|
136
131
|
className
|
|
@@ -143,7 +138,7 @@ var DropdownMenuCheckboxItem = React2__namespace.forwardRef(({ className, childr
|
|
|
143
138
|
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
144
139
|
{
|
|
145
140
|
ref,
|
|
146
|
-
className: cn(
|
|
141
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
147
142
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 pointer-coarse:min-h-11 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
148
143
|
className
|
|
149
144
|
),
|
|
@@ -160,7 +155,7 @@ var DropdownMenuRadioItem = React2__namespace.forwardRef(({ className, children,
|
|
|
160
155
|
DropdownMenuPrimitive__namespace.RadioItem,
|
|
161
156
|
{
|
|
162
157
|
ref,
|
|
163
|
-
className: cn(
|
|
158
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
164
159
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 pointer-coarse:min-h-11 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
165
160
|
className
|
|
166
161
|
),
|
|
@@ -176,7 +171,7 @@ var DropdownMenuLabel = React2__namespace.forwardRef(({ className, inset, ...pro
|
|
|
176
171
|
DropdownMenuPrimitive__namespace.Label,
|
|
177
172
|
{
|
|
178
173
|
ref,
|
|
179
|
-
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
174
|
+
className: chunkS6A6FSG7_cjs.cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
180
175
|
...props
|
|
181
176
|
}
|
|
182
177
|
));
|
|
@@ -185,13 +180,13 @@ var DropdownMenuSeparator = React2__namespace.forwardRef(({ className, ...props
|
|
|
185
180
|
DropdownMenuPrimitive__namespace.Separator,
|
|
186
181
|
{
|
|
187
182
|
ref,
|
|
188
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
183
|
+
className: chunkS6A6FSG7_cjs.cn("-mx-1 my-1 h-px bg-muted", className),
|
|
189
184
|
...props
|
|
190
185
|
}
|
|
191
186
|
));
|
|
192
187
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive__namespace.Separator.displayName;
|
|
193
188
|
var DropdownMenuShortcut = ({ className, ...props }) => {
|
|
194
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("ml-auto text-sm tracking-widest opacity-60", className), ...props });
|
|
189
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkS6A6FSG7_cjs.cn("ml-auto text-sm tracking-widest opacity-60", className), ...props });
|
|
195
190
|
};
|
|
196
191
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
197
192
|
|
|
@@ -212,7 +207,6 @@ exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
|
|
|
212
207
|
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
213
208
|
exports.ScrollArea = ScrollArea;
|
|
214
209
|
exports.ScrollBar = ScrollBar;
|
|
215
|
-
exports.cn = cn;
|
|
216
210
|
exports.getCollisionPadding = getCollisionPadding;
|
|
217
|
-
//# sourceMappingURL=chunk-
|
|
218
|
-
//# sourceMappingURL=chunk-
|
|
211
|
+
//# sourceMappingURL=chunk-OBNTJEEO.cjs.map
|
|
212
|
+
//# sourceMappingURL=chunk-OBNTJEEO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/scroll-area.tsx","../src/lib/collision-padding.ts","../src/ui/dropdown-menu.tsx"],"names":["React","jsxs","ScrollAreaPrimitive","cn","jsx","DropdownMenuPrimitive","React2","ChevronRight","Check","Circle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,UAAA,GAAmBA,6BAGvB,CAAC,EAAE,WAAW,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,qBACpCC,eAAA;AAAA,EAAqBC,8BAAA,CAAA,IAAA;AAAA,EAApB;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAWC,oBAAA,CAAG,0BAAA,EAA4B,SAAS,CAAA;AAAA,IAClD,GAAG,KAAA;AAAA,IAEJ,QAAA,EAAA;AAAA,sBAAAC,cAAA,CAAqBF,8BAAA,CAAA,QAAA,EAApB,EAA6B,SAAA,EAAU,iCAAA,EACrC,QAAA,EACH,CAAA;AAAA,qCACC,SAAA,EAAA,EAAU,CAAA;AAAA,sBACXE,cAAA,CAAqBF,uCAApB,EAA2B;AAAA;AAAA;AAC9B,CACD;AACD,UAAA,CAAW,cAAkCA,8BAAA,CAAA,IAAA,CAAK,WAAA;AAElD,IAAM,SAAA,GAAkBF,iBAAA,CAAA,UAAA,CAGtB,CAAC,EAAE,SAAA,EAAW,cAAc,UAAA,EAAY,GAAG,KAAA,EAAM,EAAG,GAAA,qBACpDI,cAA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cAAoCE,gCAAA,CAAA,SAAA,CAAU,WAAA;AAEpE,IAAM,uBAAuB,CAAC,EAAE,SAAA,EAAW,GAAG,OAAM,KAA6C;AAC/F,EAAA,uBAAOD,eAAC,MAAA,EAAA,EAAK,SAAA,EAAWD,qBAAG,4CAAA,EAA8C,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAClG;AACA,oBAAA,CAAqB,WAAA,GAAc,sBAAA","file":"chunk-OBNTJEEO.cjs","sourcesContent":["import * as React from 'react'\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'\n\nimport { cn } from '../lib/utils'\n\nconst ScrollArea = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn('relative overflow-hidden', className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n))\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName\n\nconst ScrollBar = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = 'vertical', ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex touch-none select-none transition-colors',\n orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent p-[1px]',\n orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent p-[1px]',\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n))\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName\n\nexport { ScrollArea, ScrollBar }\n","/**\n * Collision padding for Radix poppers (menus, popovers, selects, hover cards).\n *\n * 8px on every side, plus, at the bottom, the amount by which the layout viewport is taller than\n * the visible one. Mobile Safari (and its landscape emulation) reports a layout viewport that is\n * larger than `innerHeight` while the toolbars are showing, so Radix would otherwise place a menu\n * under the bottom bar.\n */\nexport function getCollisionPadding(): {\n top: number\n right: number\n bottom: number\n left: number\n} {\n const base = 8\n if (typeof window === 'undefined') return { top: base, right: base, bottom: base, left: base }\n const hidden = Math.max(\n 0,\n (document.documentElement?.clientHeight ?? window.innerHeight) - window.innerHeight\n )\n return { top: base, right: base, bottom: base + hidden, left: base }\n}\n","'use client'\n\nimport * as React from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-react'\n\nimport { cn } from '../lib/utils'\nimport { getCollisionPadding } from '../lib/collision-padding'\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 pointer-coarse:min-h-11 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n collisionPadding={getCollisionPadding()}\n className={cn(\n 'z-50 min-w-[8rem] max-w-[calc(100vw-1rem)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]',\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={getCollisionPadding()}\n className={cn(\n 'z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] max-w-[calc(100vw-1rem)] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]',\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 pointer-coarse:min-h-11 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 pointer-coarse:min-h-11 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-4 w-4 items-center justify-center rounded border border-border bg-popover\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-3.5 w-3.5 text-primary\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 pointer-coarse:min-h-11 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-sm tracking-widest opacity-60', className)} {...props} />\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOBNTJEEO_cjs = require('./chunk-OBNTJEEO.cjs');
|
|
4
|
+
var chunkS6A6FSG7_cjs = require('./chunk-S6A6FSG7.cjs');
|
|
4
5
|
var sonner = require('sonner');
|
|
5
6
|
var zustand = require('zustand');
|
|
6
7
|
var lucideReact = require('lucide-react');
|
|
@@ -117,8 +118,8 @@ function NotificationBell({
|
|
|
117
118
|
const markRead = useNotify((s) => s.markRead);
|
|
118
119
|
const tone = (v) => toneClassNames?.[v] ?? DEFAULT_NOTIFY_TONE[v];
|
|
119
120
|
const visible = notifications.filter((n) => !n.ambient);
|
|
120
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
121
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
121
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkOBNTJEEO_cjs.DropdownMenu, { children: [
|
|
122
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkOBNTJEEO_cjs.DropdownMenuTrigger, { asChild: true, children: renderTrigger ? renderTrigger({
|
|
122
123
|
unread,
|
|
123
124
|
ariaLabel: `Notifications${unread ? `, ${unread} unread` : ""}`,
|
|
124
125
|
testId
|
|
@@ -143,7 +144,7 @@ function NotificationBell({
|
|
|
143
144
|
}
|
|
144
145
|
) }),
|
|
145
146
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
146
|
-
|
|
147
|
+
chunkOBNTJEEO_cjs.DropdownMenuContent,
|
|
147
148
|
{
|
|
148
149
|
align,
|
|
149
150
|
side,
|
|
@@ -178,7 +179,7 @@ function NotificationBell({
|
|
|
178
179
|
"aria-pressed": muted,
|
|
179
180
|
title: muted ? "Unmute notifications" : "Mute notifications",
|
|
180
181
|
"aria-label": muted ? "Unmute notifications" : "Mute notifications",
|
|
181
|
-
className:
|
|
182
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
182
183
|
"flex size-6 items-center justify-center rounded-md transition-colors hover:bg-accent pointer-coarse:size-11",
|
|
183
184
|
muted ? "text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
184
185
|
),
|
|
@@ -187,7 +188,7 @@ function NotificationBell({
|
|
|
187
188
|
}
|
|
188
189
|
),
|
|
189
190
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
190
|
-
|
|
191
|
+
chunkOBNTJEEO_cjs.DropdownMenuItem,
|
|
191
192
|
{
|
|
192
193
|
className: "flex size-6 items-center justify-center rounded-md p-0 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:bg-accent pointer-coarse:size-11",
|
|
193
194
|
"aria-label": "Close notifications",
|
|
@@ -205,7 +206,7 @@ function NotificationBell({
|
|
|
205
206
|
children: "Toasts are muted \u2014 everything still lands here."
|
|
206
207
|
}
|
|
207
208
|
),
|
|
208
|
-
visible.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3.5 py-10 text-center text-sm text-muted-foreground", children: emptyText }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
209
|
+
visible.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3.5 py-10 text-center text-sm text-muted-foreground", children: emptyText }) : /* @__PURE__ */ jsxRuntime.jsx(chunkOBNTJEEO_cjs.ScrollArea, { className: "max-h-[380px]", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { "data-testid": `${testId}-list`, children: visible.map((n) => {
|
|
209
210
|
const Glyph = GLYPH[n.variant];
|
|
210
211
|
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
211
212
|
"button",
|
|
@@ -216,13 +217,13 @@ function NotificationBell({
|
|
|
216
217
|
if (n.onSelect) n.onSelect();
|
|
217
218
|
else if (n.href) onNavigate?.(n.href);
|
|
218
219
|
},
|
|
219
|
-
className:
|
|
220
|
+
className: chunkS6A6FSG7_cjs.cn(
|
|
220
221
|
"flex w-full items-start gap-3 border-b border-border/60 px-3.5 py-3 text-left transition-colors hover:bg-accent",
|
|
221
222
|
!n.read && "bg-accent/40"
|
|
222
223
|
),
|
|
223
224
|
"data-testid": `${testId}-item`,
|
|
224
225
|
children: [
|
|
225
|
-
/* @__PURE__ */ jsxRuntime.jsx(Glyph, { className:
|
|
226
|
+
/* @__PURE__ */ jsxRuntime.jsx(Glyph, { className: chunkS6A6FSG7_cjs.cn("mt-0.5 size-4 shrink-0", tone(n.variant)) }),
|
|
226
227
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
227
228
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium leading-snug text-foreground", children: n.title }),
|
|
228
229
|
n.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground", children: n.description }),
|
|
@@ -236,7 +237,7 @@ function NotificationBell({
|
|
|
236
237
|
onViewAll && // A real menu item, not a bare button: selecting it must CLOSE the
|
|
237
238
|
// dropdown on its way to the full surface.
|
|
238
239
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
239
|
-
|
|
240
|
+
chunkOBNTJEEO_cjs.DropdownMenuItem,
|
|
240
241
|
{
|
|
241
242
|
onClick: onViewAll,
|
|
242
243
|
className: "justify-center rounded-none border-t border-border px-3.5 py-2.5 text-xs font-medium text-primary focus:text-primary pointer-coarse:min-h-11",
|
|
@@ -280,5 +281,5 @@ exports.notify = notify;
|
|
|
280
281
|
exports.seedNotifications = seedNotifications;
|
|
281
282
|
exports.selectUnread = selectUnread;
|
|
282
283
|
exports.useNotify = useNotify;
|
|
283
|
-
//# sourceMappingURL=chunk-
|
|
284
|
-
//# sourceMappingURL=chunk-
|
|
284
|
+
//# sourceMappingURL=chunk-PGLV23SB.cjs.map
|
|
285
|
+
//# sourceMappingURL=chunk-PGLV23SB.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/notifications/notify-store.ts","../src/lib/format-relative-time.ts","../src/notifications/NotificationBell.tsx","../src/notifications/Toaster.tsx"],"names":["create","toast","CheckCircle2","XCircle","AlertTriangle","Info","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Bell","DropdownMenuContent","CheckCheck","cn","BellOff","DropdownMenuItem","X","ScrollArea","Sonner"],"mappings":";;;;;;;;;AA+EA,IAAI,GAAA,GAAM,CAAA;AACV,IAAM,GAAA,GAAM,MAAM,CAAA,CAAA,EAAI,IAAA,CAAK,GAAA,EAAI,CAAE,QAAA,CAAS,EAAE,CAAC,CAAA,EAAA,CAAI,GAAA,EAAA,EAAO,QAAA,CAAS,EAAE,CAAC,CAAA,CAAA;AAE7D,IAAM,SAAA,GAAYA,cAAA,CAAoB,CAAC,GAAA,MAAS;AAAA,EACrD,eAAe,EAAC;AAAA,EAChB,QAAA,EAAU,CAAC,EAAA,KACT,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,IACV,aAAA,EAAe,CAAA,CAAE,aAAA,CAAc,GAAA,CAAI,CAAC,CAAA,KAAO,CAAA,CAAE,EAAA,KAAO,EAAA,GAAK,EAAE,GAAG,CAAA,EAAG,IAAA,EAAM,IAAA,KAAS,CAAE;AAAA,GACpF,CAAE,CAAA;AAAA,EACJ,aAAa,MACX,GAAA,CAAI,CAAC,CAAA,MAAO,EAAE,eAAe,CAAA,CAAE,aAAA,CAAc,I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s","sourcesContent":["/**\n * App notification store — the one shared toast + notification-centre. A single\n * `notify.*` call pops a transient toast (rendered by <Toaster/>, on sonner) and,\n * unless `{ record: false }`, records a persistent entry for the topbar bell.\n *\n * notify.success('Saved') // toast + centre entry\n * notify.error('Upload failed', { record: false }) // toast only\n *\n * sonner owns the transient toast lifecycle (stacking, timing, dismissal); this\n * store owns only the persistent centre history (what the <NotificationBell/>\n * shows). Brand-neutral: no seed data (inject via `seedNotifications`), no app\n * imports. For full sonner power (custom content, `toast.dismiss`, …) the raw\n * `toast` is re-exported.\n */\nimport { type ReactNode } from 'react'\n// This module IS the sanctioned toast engine home — the app-level rule that\n// steers callers to sendNotification()/notify() doesn't apply here.\n// eslint-disable-next-line no-restricted-imports\nimport { toast } from 'sonner'\nimport { create } from 'zustand'\n\nexport { toast }\n\nexport type NotifyVariant = 'success' | 'error' | 'info' | 'warning'\n\nexport interface AppNotification {\n id: string\n title: string\n description?: string\n variant: NotifyVariant\n /** Epoch ms the entry was recorded. */\n ts: number\n read: boolean\n /** Optional in-app link the entry deep-links to (passed to the bell's onNavigate). */\n href?: string\n /** Optional click action — wins over `href` when both are present. Session\n * history only; entries are never serialized, so a closure is safe here. */\n onSelect?: () => void\n /** Routine session activity (\"Opening workspace…\", \"Saved\") — kept for the\n * log but not something that demands attention: excluded from the unread\n * badge and from the bell's default list (shown under \"All activity\"). */\n ambient?: boolean\n /** Where the entry comes from. Session entries (`record`) have none; a\n * backend bridge stamps its own (e.g. 'server') so {@link syncSource} can\n * replace exactly its slice on every refetch without touching the rest. */\n source?: string\n}\n\nexport interface NotifyOptions {\n description?: string\n /** Also record a persistent notification-centre entry (default true). */\n record?: boolean\n href?: string\n duration?: number\n /** A toast action button (sonner). */\n action?: { label: ReactNode; onClick: () => void }\n /** Override the toast glyph (sonner). */\n icon?: ReactNode\n /** Record as routine session activity (see {@link AppNotification.ambient}). */\n ambient?: boolean\n}\n\ninterface NotifyState {\n notifications: AppNotification[]\n markRead: (id: string) => void\n markAllRead: () => void\n removeNotification: (id: string) => void\n clearNotifications: () => void\n /** Replace the centre's history (e.g. seed a demo/initial set). */\n seed: (items: AppNotification[]) => void\n /** Record a centre entry (used by `notify.*`; sonner renders the toast). */\n record: (note: AppNotification) => void\n /** Reconcile one source's slice with fresh truth (e.g. a backend list on\n * every refetch): entries stamped with `source` are replaced wholesale —\n * including their read state, which the source owns — while entries from\n * other sources (session activity) stay untouched. Newest first. */\n syncSource: (source: string, items: AppNotification[]) => void\n}\n\nlet seq = 0\nconst uid = () => `n${Date.now().toString(36)}${(seq++).toString(36)}`\n\nexport const useNotify = create<NotifyState>((set) => ({\n notifications: [],\n markRead: (id) =>\n set((s) => ({\n notifications: s.notifications.map((n) => (n.id === id ? { ...n, read: true } : n)),\n })),\n markAllRead: () =>\n set((s) => ({ notifications: s.notifications.map((n) => ({ ...n, read: true })) })),\n removeNotification: (id) =>\n set((s) => ({ notifications: s.notifications.filter((n) => n.id !== id) })),\n clearNotifications: () => set({ notifications: [] }),\n seed: (items) => set({ notifications: items }),\n record: (note) => set((s) => ({ notifications: [note, ...s.notifications].slice(0, 50) })),\n syncSource: (source, items) =>\n set((s) => ({\n notifications: [\n ...items.map((n) => ({ ...n, source })),\n ...s.notifications.filter((n) => n.source !== source),\n ]\n .sort((a, b) => b.ts - a.ts)\n .slice(0, 100),\n })),\n}))\n\n/** Ergonomic helper — `notify.success('Saved')` — toast (sonner) + optional centre entry. */\nfunction make(variant: NotifyVariant) {\n return (title: string, opts: NotifyOptions = {}): string => {\n toast[variant](title, {\n description: opts.description,\n duration: opts.duration,\n action: opts.action,\n icon: opts.icon,\n })\n const id = uid()\n if (opts.record !== false) {\n useNotify.getState().record({\n id,\n title,\n description: opts.description,\n variant,\n ts: Date.now(),\n read: false,\n href: opts.href,\n ambient: opts.ambient,\n })\n }\n return id\n }\n}\nexport const notify = {\n success: make('success'),\n error: make('error'),\n info: make('info'),\n warning: make('warning'),\n}\n\n/** Replace the notification centre's history — inject a seed/initial set. */\nexport function seedNotifications(items: AppNotification[]): void {\n useNotify.getState().seed(items)\n}\n\n/** Unread count selector for the topbar bell — ambient session activity never\n * demands attention, so it never counts. */\nexport const selectUnread = (s: NotifyState): number =>\n s.notifications.filter((n) => !n.read && !n.ambient).length\n\n/** Default glyph colour per variant (raw palette, override via `toneClassNames`). */\nexport const DEFAULT_NOTIFY_TONE: Record<NotifyVariant, string> = {\n success: 'text-green-600',\n error: 'text-destructive',\n warning: 'text-amber-500',\n info: 'text-blue-500',\n}\n","/** Relative-time formatting shared by the notification bell and the DM kit (no type imports, so the\n * SDK-free `/shell` entry can use it). */\n\nconst RELATIVE = new Intl.RelativeTimeFormat(undefined, { numeric: 'auto' })\nconst DIVISIONS: Array<{ amount: number; unit: Intl.RelativeTimeFormatUnit }> = [\n { amount: 60, unit: 'seconds' },\n { amount: 60, unit: 'minutes' },\n { amount: 24, unit: 'hours' },\n { amount: 7, unit: 'days' },\n { amount: 4.34524, unit: 'weeks' },\n { amount: 12, unit: 'months' },\n { amount: Number.POSITIVE_INFINITY, unit: 'years' },\n]\n\n/** Compact relative time, e.g. \"2 hours ago\", \"just now\". */\nexport function formatRelativeTime(iso: string): string {\n const then = Date.parse(iso)\n if (Number.isNaN(then)) return ''\n let duration = (then - Date.now()) / 1000\n if (Math.abs(duration) < 45) return 'just now'\n for (const division of DIVISIONS) {\n if (Math.abs(duration) < division.amount) {\n return RELATIVE.format(Math.round(duration), division.unit)\n }\n duration /= division.amount\n }\n return ''\n}\n","/**\n * NotificationBell — the topbar notification centre: a bell with an unread badge\n * that opens a dropdown of recorded entries (newest first) with an unread dot,\n * relative time and optional deep-link. \"Mark all read\" clears the badge. Backed\n * by the shared {@link useNotify} store (the same one the <Toaster/> renders).\n *\n * Firm-agnostic: navigation is a callback (`onNavigate`), styling tracks semantic\n * tokens, and per-variant glyph colours are overridable via `toneClassNames`.\n */\nimport type { ReactElement } from 'react'\nimport {\n Bell,\n BellOff,\n CheckCheck,\n CheckCircle2,\n AlertTriangle,\n XCircle,\n Info,\n X,\n} from 'lucide-react'\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n} from '../ui/dropdown-menu'\nimport { ScrollArea } from '../ui/scroll-area'\nimport { cn } from '../lib/utils'\nimport { formatRelativeTime } from '../lib/format-relative-time'\nimport { useNotify, selectUnread, DEFAULT_NOTIFY_TONE, type NotifyVariant } from './notify-store'\n\nconst GLYPH: Record<NotifyVariant, typeof Info> = {\n success: CheckCircle2,\n error: XCircle,\n warning: AlertTriangle,\n info: Info,\n}\n\n/** What a custom bell trigger needs to render itself. */\nexport interface NotificationBellTriggerState {\n /** Unread count (0 when none). */\n unread: number\n /** Accessible name, including the count: \"Notifications, 2 unread\". */\n ariaLabel: string\n testId: string\n}\n\nexport interface NotificationBellProps {\n /**\n * Replaces the default icon button with the host's own trigger (for example a labelled sidebar\n * row). It must forward its ref and rest props: it is mounted as the dropdown trigger.\n */\n renderTrigger?: (state: NotificationBellTriggerState) => ReactElement\n /** Called with an entry's `href` when it's clicked (e.g. router navigate). */\n onNavigate?: (href: string) => void\n /** Called after an entry is locally marked read — the hook for a backend\n * bridge to propagate read state upstream (filter by the ids it owns). */\n onMarkRead?: (id: string) => void\n /** Called after \"Mark all read\" — same upstream-propagation hook. */\n onMarkAllRead?: () => void\n /** Toast muting — the bell is where notification behaviour is controlled, so\n * the mute switch lives in its header. Omit `onToggleMute` to hide it. */\n muted?: boolean\n onToggleMute?: () => void\n /** Override per-variant glyph colours (e.g. brand emerald for success). */\n toneClassNames?: Partial<Record<NotifyVariant, string>>\n emptyText?: string\n /** Footer link to the app's full notification surface. Omit to hide. */\n onViewAll?: () => void\n viewAllLabel?: string\n testId?: string\n /** Where the panel opens relative to the bell (a sidebar-footer bell opens upward). */\n side?: 'top' | 'right' | 'bottom' | 'left'\n align?: 'start' | 'center' | 'end'\n}\n\nexport function NotificationBell({\n renderTrigger,\n onNavigate,\n onMarkRead,\n onMarkAllRead,\n muted = false,\n onToggleMute,\n toneClassNames,\n emptyText = \"You're all caught up.\",\n onViewAll,\n viewAllLabel = 'View all',\n testId = 'notifications',\n side = 'bottom',\n align = 'end',\n}: NotificationBellProps) {\n const notifications = useNotify((s) => s.notifications)\n const unread = useNotify(selectUnread)\n const markAllRead = useNotify((s) => s.markAllRead)\n const markRead = useNotify((s) => s.markRead)\n const tone = (v: NotifyVariant) => toneClassNames?.[v] ?? DEFAULT_NOTIFY_TONE[v]\n\n // Ambient entries (routine session activity — \"Opening workspace…\") are kept\n // for the log but never surfaced in the bell panel: they never badge and are\n // always filtered out here.\n const visible = notifications.filter((n) => !n.ambient)\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n {renderTrigger ? (\n renderTrigger({\n unread,\n ariaLabel: `Notifications${unread ? `, ${unread} unread` : ''}`,\n testId,\n })\n ) : (\n <button\n className=\"relative flex size-9 pointer-coarse:size-11 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"\n data-testid={testId}\n aria-label={`Notifications${unread ? `, ${unread} unread` : ''}`}\n title=\"Notifications\"\n >\n <Bell className=\"size-5\" />\n {unread > 0 && (\n <span\n className=\"absolute -right-0.5 -top-0.5 flex min-w-4 items-center justify-center rounded-full bg-primary px-1 text-xs font-semibold leading-4 text-primary-foreground\"\n data-testid={`${testId}-badge`}\n >\n {unread > 9 ? '9+' : unread}\n </span>\n )}\n </button>\n )}\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align={align}\n side={side}\n sideOffset={8}\n collisionPadding={12}\n className=\"w-[360px] rounded-lg border-border/60 p-0 shadow-lg\"\n data-testid={`${testId}-panel`}\n data-topbar-popover=\"\"\n >\n <div className=\"flex items-center justify-between gap-3 border-b border-border px-3.5 py-2.5 pointer-coarse:py-0\">\n <p className=\"text-sm font-semibold text-foreground\">Notifications</p>\n <div className=\"flex items-center gap-3 pointer-coarse:gap-1\">\n {unread > 0 && (\n <button\n onClick={() => {\n markAllRead()\n onMarkAllRead?.()\n }}\n className=\"flex items-center gap-1 text-xs font-medium text-primary transition-colors hover:opacity-80 pointer-coarse:min-h-11 pointer-coarse:px-2\"\n data-testid={`${testId}-mark-all`}\n >\n <CheckCheck className=\"size-3.5\" /> Mark all read\n </button>\n )}\n {onToggleMute && (\n <button\n onClick={onToggleMute}\n aria-pressed={muted}\n title={muted ? 'Unmute notifications' : 'Mute notifications'}\n aria-label={muted ? 'Unmute notifications' : 'Mute notifications'}\n className={cn(\n 'flex size-6 items-center justify-center rounded-md transition-colors hover:bg-accent pointer-coarse:size-11',\n muted ? 'text-foreground' : 'text-muted-foreground hover:text-foreground'\n )}\n data-testid={`${testId}-mute`}\n >\n <BellOff className=\"size-3.5\" />\n </button>\n )}\n {/* Explicit close — the dropdown otherwise only dismisses via\n tap-outside/Escape, which isn't discoverable on touch and (at\n mobile width, see blocks.css) the panel covers most\n of the screen so there's nothing to tap outside of. Radix\n closes a DropdownMenu on any item select by default, so a\n plain item with no other effect doubles as a close button. */}\n <DropdownMenuItem\n className=\"flex size-6 items-center justify-center rounded-md p-0 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:bg-accent pointer-coarse:size-11\"\n aria-label=\"Close notifications\"\n data-testid={`${testId}-close`}\n >\n <X className=\"size-3.5\" />\n </DropdownMenuItem>\n </div>\n </div>\n {muted && (\n <p\n className=\"border-b border-border/60 bg-amber-500/10 px-3.5 py-1.5 text-xs text-muted-foreground\"\n data-testid={`${testId}-muted-note`}\n >\n Toasts are muted — everything still lands here.\n </p>\n )}\n\n {visible.length === 0 ? (\n <div className=\"px-3.5 py-10 text-center text-sm text-muted-foreground\">{emptyText}</div>\n ) : (\n <ScrollArea className=\"max-h-[380px]\">\n <ul data-testid={`${testId}-list`}>\n {visible.map((n) => {\n const Glyph = GLYPH[n.variant]\n return (\n <li key={n.id}>\n <button\n onClick={() => {\n markRead(n.id)\n if (!n.read) onMarkRead?.(n.id)\n // The specific action wins over the generic deep link.\n if (n.onSelect) n.onSelect()\n else if (n.href) onNavigate?.(n.href)\n }}\n className={cn(\n 'flex w-full items-start gap-3 border-b border-border/60 px-3.5 py-3 text-left transition-colors hover:bg-accent',\n !n.read && 'bg-accent/40'\n )}\n data-testid={`${testId}-item`}\n >\n <Glyph className={cn('mt-0.5 size-4 shrink-0', tone(n.variant))} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium leading-snug text-foreground\">\n {n.title}\n </p>\n {n.description && (\n <p className=\"mt-0.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground\">\n {n.description}\n </p>\n )}\n <p className=\"mt-1 text-xs text-muted-foreground/80\">\n {formatRelativeTime(new Date(n.ts).toISOString())}\n </p>\n </div>\n {!n.read && (\n <span className=\"mt-1.5 size-2 shrink-0 rounded-full bg-primary\" />\n )}\n </button>\n </li>\n )\n })}\n </ul>\n </ScrollArea>\n )}\n {onViewAll && (\n // A real menu item, not a bare button: selecting it must CLOSE the\n // dropdown on its way to the full surface.\n <DropdownMenuItem\n onClick={onViewAll}\n className=\"justify-center rounded-none border-t border-border px-3.5 py-2.5 text-xs font-medium text-primary focus:text-primary pointer-coarse:min-h-11\"\n data-testid={`${testId}-view-all`}\n >\n {viewAllLabel}\n </DropdownMenuItem>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n","/**\n * Toaster — the one shared toast surface, built on sonner (the mature engine:\n * stacking, swipe-to-dismiss, a11y, timing). Mount once near the app root; any\n * code then calls `notify.*(...)` (or the re-exported `toast`) from anywhere.\n *\n * Firm-agnostic: every sonner `ToasterProps` passes through, so a consumer sets\n * its own `position` / `theme` / `toastOptions`. The defaults give a neutral\n * shadcn-token card that both apps can override.\n */\nimport { Toaster as Sonner, type ToasterProps } from 'sonner'\n\nexport type { ToasterProps }\n\nconst DEFAULT_TOAST_OPTIONS: ToasterProps['toastOptions'] = {\n classNames: {\n toast:\n 'group toast group-[.toaster]:bg-card group-[.toaster]:text-foreground group-[.toaster]:border group-[.toaster]:border-border group-[.toaster]:shadow-lg group-[.toaster]:rounded-lg',\n description: 'group-[.toast]:text-muted-foreground',\n actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',\n cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',\n },\n}\n\nexport function Toaster({ toastOptions, ...props }: ToasterProps) {\n return (\n <Sonner\n className=\"toaster group\"\n toastOptions={toastOptions ?? DEFAULT_TOAST_OPTIONS}\n {...props}\n />\n )\n}\n"]}
|