periplo-ui 4.16.1 → 4.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-display/DataTable/components/DataTableCell.js +1 -1
- package/dist/components/data-display/DataTable/components/DataTableCell.js.map +1 -1
- package/dist/components/data-display/DataTable/components/DataTableGroupRow.js +1 -1
- package/dist/components/data-display/DataTable/components/DataTableGroupRow.js.map +1 -1
- package/dist/components/data-display/Marquee/Marquee.js +2 -2
- package/dist/components/data-display/Marquee/Marquee.js.map +1 -1
- package/dist/components/data-display/NotificationBadge/NotificationBadge.js +1 -1
- package/dist/components/data-display/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/components/data-display/Tooltip/Tooltip.js +1 -1
- package/dist/components/data-display/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/feedback/Dialog/Dialog.js +2 -2
- package/dist/components/feedback/Dialog/Dialog.js.map +1 -1
- package/dist/components/feedback/Progress/Progress.js +1 -1
- package/dist/components/feedback/Progress/Progress.js.map +1 -1
- package/dist/components/feedback/Skeleton/Skeleton.js +1 -1
- package/dist/components/feedback/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +1 -1
- package/dist/components/inputs/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/inputs/Input/Input.js +1 -1
- package/dist/components/inputs/Input/Input.js.map +1 -1
- package/dist/components/inputs/InputDate/InputDate.js +1 -1
- package/dist/components/inputs/InputDate/InputDate.js.map +1 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/inputs/Select/Select.js +1 -1
- package/dist/components/inputs/Select/Select.js.map +1 -1
- package/dist/components/inputs/Textarea/Textarea.js +1 -1
- package/dist/components/inputs/Textarea/Textarea.js.map +1 -1
- package/dist/components/navigation/DropdownMenu/DropdownMenu.js +2 -2
- package/dist/components/navigation/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/components/navigation/Sheet/Sheet.js +2 -2
- package/dist/components/navigation/Sheet/Sheet.js.map +1 -1
- package/dist/components/navigation/Sidebar/Sidebar.js +6 -2
- package/dist/components/navigation/Sidebar/Sidebar.js.map +1 -1
- package/dist/components/navigation/Sidebar/SidebarMenu.js +28 -54
- package/dist/components/navigation/Sidebar/SidebarMenu.js.map +1 -1
- package/dist/components/navigation/Sidebar/SidebarUser.d.ts +3 -1
- package/dist/components/navigation/Sidebar/SidebarUser.js +17 -4
- package/dist/components/navigation/Sidebar/SidebarUser.js.map +1 -1
- package/dist/components/navigation/Sidebar/index.js +2 -2
- package/dist/components/navigation/Sidebar/styles.d.ts +1 -1
- package/dist/components/navigation/Sidebar/styles.js +1 -1
- package/dist/components/navigation/Sidebar/styles.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/components/surface/Accordion/Accordion.js +3 -3
- package/dist/components/surface/Accordion/Accordion.js.map +1 -1
- package/dist/components/utils/Popover/Popover.js +1 -1
- package/dist/components/utils/Popover/Popover.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/useSlidingIndicator.d.ts +22 -0
- package/dist/lib/useSlidingIndicator.js +65 -0
- package/dist/lib/useSlidingIndicator.js.map +1 -0
- package/dist/theme.css +46 -26
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","names":["React"],"sources":["../../../../src/components/inputs/Textarea/Textarea.tsx"],"sourcesContent":["import { WarningCircleIcon } from '@phosphor-icons/react/dist/ssr/WarningCircle'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nexport type TextareaProps = {\n disabled?: boolean\n error?: boolean | string\n resize?: boolean\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, disabled, error, resize = false, ...props }, ref) => {\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <div className=\"flex w-full items-start\">\n <div\n className={cn(\n 'relative flex w-full rounded-lg border border-neutral-200 bg-white transition-colors focus-within:border-neutral-950',\n disabled && 'bg-neutral-50',\n error && 'border-error-400 focus-within:border-error-700',\n className,\n )}\n >\n <textarea\n className={cn(\n 'min-h-15 w-full rounded-lg bg-transparent p-3 pr-8 outline-0 transition-colors placeholder:text-neutral-300 disabled:cursor-not-allowed disabled:opacity-50',\n !resize && 'resize-none',\n )}\n ref={ref}\n disabled={disabled}\n {...props}\n />\n {error && (\n <div className=\"absolute top-3 right-3\">\n <WarningCircleIcon data-testid=\"exclaim-icon\" className=\"text-error-500\" size={18} />\n </div>\n )}\n </div>\n </div>\n {typeof error === 'string' && <span className=\"text-error-500 text-sm\"
|
|
1
|
+
{"version":3,"file":"Textarea.js","names":["React"],"sources":["../../../../src/components/inputs/Textarea/Textarea.tsx"],"sourcesContent":["import { WarningCircleIcon } from '@phosphor-icons/react/dist/ssr/WarningCircle'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nexport type TextareaProps = {\n disabled?: boolean\n error?: boolean | string\n resize?: boolean\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, disabled, error, resize = false, ...props }, ref) => {\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <div className=\"flex w-full items-start\">\n <div\n className={cn(\n 'relative flex w-full rounded-lg border border-neutral-200 bg-white transition-colors focus-within:border-neutral-950',\n disabled && 'bg-neutral-50',\n error && 'border-error-400 focus-within:border-error-700',\n className,\n )}\n >\n <textarea\n className={cn(\n 'min-h-15 w-full rounded-lg bg-transparent p-3 pr-8 outline-0 transition-colors placeholder:text-neutral-300 disabled:cursor-not-allowed disabled:opacity-50',\n !resize && 'resize-none',\n )}\n ref={ref}\n disabled={disabled}\n {...props}\n />\n {error && (\n <div className=\"absolute top-3 right-3\">\n <WarningCircleIcon data-testid=\"exclaim-icon\" className=\"text-error-500\" size={18} />\n </div>\n )}\n </div>\n </div>\n {typeof error === 'string' && (\n <span className=\"text-error-500 animate-in fade-in-0 slide-in-from-top-1 ease-out-strong motion-reduce:slide-in-from-top-0 text-sm duration-150\">\n {error}\n </span>\n )}\n </div>\n )\n },\n)\nTextarea.displayName = 'Textarea'\n\nexport { Textarea }\n"],"mappings":";;;;;AAWA,IAAM,WAAWA,QAAM,YACpB,EAAE,WAAW,UAAU,OAAO,SAAS,OAAO,GAAG,SAAS,QAAQ;CACjE,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,OAAD;GAAK,WAAU;GACb,UAAA,qBAAC,OAAD;IACE,WAAW,GACT,wHACA,YAAY,iBACZ,SAAS,kDACT,SACF;IANF,UAAA,CAQE,oBAAC,YAAD;KACE,WAAW,GACT,+JACA,CAAC,UAAU,aACb;KACK;KACK;KACV,GAAI;IACL,CAAA,GACA,SACC,oBAAC,OAAD;KAAK,WAAU;KACb,UAAA,oBAAC,mBAAD;MAAmB,eAAY;MAAe,WAAU;MAAiB,MAAM;KAAK,CAAA;IACjF,CAAA,CAEJ;;EACF,CAAA,GACJ,OAAO,UAAU,YAChB,oBAAC,QAAD;GAAM,WAAU;GACb,UAAA;EACG,CAAA,CAEL;;AAET,CACF;AACA,SAAS,cAAc"}
|
|
@@ -22,14 +22,14 @@ var DropdownMenuSubTrigger = React$1.forwardRef(({ className, inset, children, .
|
|
|
22
22
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
23
23
|
var DropdownMenuSubContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubContent, {
|
|
24
24
|
ref,
|
|
25
|
-
className: cn(SURFACE, SURFACE_INSET, "
|
|
25
|
+
className: cn(SURFACE, SURFACE_INSET, "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 ease-out-strong motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[state=open]:zoom-in-100 motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0", "text-popover-foreground z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden border bg-white shadow-lg", className),
|
|
26
26
|
...props
|
|
27
27
|
}));
|
|
28
28
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
29
29
|
var DropdownMenuContent = React$1.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, {
|
|
30
30
|
ref,
|
|
31
31
|
sideOffset,
|
|
32
|
-
className: cn(SURFACE, SURFACE_INSET, "text-popover-foreground z-50 min-w-[min(var(--radix-dropdown-menu-trigger-width),8rem)] overflow-hidden border bg-white shadow-md", "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", className),
|
|
32
|
+
className: cn(SURFACE, SURFACE_INSET, "text-popover-foreground z-50 min-w-[min(var(--radix-dropdown-menu-trigger-width),8rem)] overflow-hidden border bg-white shadow-md", "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 ease-out-strong motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[state=open]:zoom-in-100 motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0", "origin-(--radix-dropdown-menu-content-transform-origin)", className),
|
|
33
33
|
...props
|
|
34
34
|
}) }));
|
|
35
35
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":["React"],"sources":["../../../../src/components/navigation/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { CaretRightIcon } from '@phosphor-icons/react/dist/ssr/CaretRight'\nimport { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { DotIcon } from '@phosphor-icons/react/dist/ssr/Dot'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport * as React from 'react'\n\nimport { SURFACE, SURFACE_INSET, SURFACE_ITEM } from '@/lib/surface'\nimport { cn } from '@/lib/utils'\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.ComponentRef<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 SURFACE_ITEM,\n 'flex items-center gap-2 px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-50 data-[state=open]:bg-neutral-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <CaretRightIcon className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n SURFACE,\n SURFACE_INSET,\n 'text-popover-foreground 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 z-50 min-w-32 overflow-hidden border bg-white shadow-lg',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<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 className={cn(\n SURFACE,\n SURFACE_INSET,\n 'text-popover-foreground z-50 min-w-[min(var(--radix-dropdown-menu-trigger-width),8rem)] overflow-hidden border bg-white shadow-md',\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',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<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 SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex items-center gap-2 px-2 py-1.5 text-sm transition-colors outline-none select-none focus:bg-neutral-50 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.ComponentRef<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 SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex items-center py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-50 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-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex items-center py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-50 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 <DotIcon 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.ComponentRef<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.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('bg-muted -mx-1 my-1 h-px', className)} {...props} />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-xs 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"],"mappings":";;;;;;;;;AASA,IAAM,eAAe,sBAAsB;AAE3C,IAAM,sBAAsB,sBAAsB;AAElD,IAAM,oBAAoB,sBAAsB;AAEhD,IAAM,qBAAqB,sBAAsB;AAEjD,IAAM,kBAAkB,sBAAsB;AAE9C,IAAM,yBAAyB,sBAAsB;AAErD,IAAM,yBAAyBA,QAAM,YAKlC,EAAE,WAAW,OAAO,UAAU,GAAG,SAAS,QAC3C,qBAAC,sBAAsB,YAAvB;CACO;CACL,WAAW,GACT,cACA,wLACA,SAAS,QACT,SACF;CACA,GAAI;CARN,UAAA,CAUG,UACD,oBAAC,gBAAD,EAAgB,WAAU,UAAW,CAAA,CACL;AACnC,CAAA,CAAA;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAEtE,IAAM,yBAAyBA,QAAM,YAGlC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,sBAAsB,YAAvB;CACO;CACL,WAAW,GACT,SACA,eACA,oaACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAEtE,IAAM,sBAAsBA,QAAM,YAG/B,EAAE,WAAW,aAAa,GAAG,GAAG,SAAS,QAC1C,oBAAC,sBAAsB,QAAvB,EAAA,UACE,oBAAC,sBAAsB,SAAvB;CACO;CACO;CACZ,WAAW,GACT,SACA,eACA,qIACA,oVACA,SACF;CACA,GAAI;AACL,CAAA,EAC2B,CAAA,CAC/B;AACD,oBAAoB,cAAc,sBAAsB,QAAQ;AA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W,GAAG,4BAA4B,SAAS;CAAG,GAAI;AAAQ,CAAA,CAC9G;AACD,sBAAsB,cAAc,sBAAsB,UAAU;AAEpE,IAAM,wBAAwB,EAAE,WAAW,GAAG,YAAmD;CAC/F,OAAO,oBAAC,QAAD;EAAM,WAAW,GAAG,8CAA8C,SAAS;EAAG,GAAI;CAAQ,CAAA;AACnG;AACA,qBAAqB,cAAc"}
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","names":["React"],"sources":["../../../../src/components/navigation/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { CaretRightIcon } from '@phosphor-icons/react/dist/ssr/CaretRight'\nimport { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { DotIcon } from '@phosphor-icons/react/dist/ssr/Dot'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport * as React from 'react'\n\nimport { SURFACE, SURFACE_INSET, SURFACE_ITEM } from '@/lib/surface'\nimport { cn } from '@/lib/utils'\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.ComponentRef<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 SURFACE_ITEM,\n 'flex items-center gap-2 px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-50 data-[state=open]:bg-neutral-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <CaretRightIcon className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n SURFACE,\n SURFACE_INSET,\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 ease-out-strong motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[state=open]:zoom-in-100 motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0',\n 'text-popover-foreground z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden border bg-white shadow-lg',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<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 className={cn(\n SURFACE,\n SURFACE_INSET,\n 'text-popover-foreground z-50 min-w-[min(var(--radix-dropdown-menu-trigger-width),8rem)] overflow-hidden border bg-white shadow-md',\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 ease-out-strong motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[state=open]:zoom-in-100 motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0',\n '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.ComponentRef<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 SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex items-center gap-2 px-2 py-1.5 text-sm transition-colors outline-none select-none focus:bg-neutral-50 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.ComponentRef<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 SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex items-center py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-50 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-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex items-center py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-50 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 <DotIcon 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.ComponentRef<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.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('bg-muted -mx-1 my-1 h-px', className)} {...props} />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-xs 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"],"mappings":";;;;;;;;;AASA,IAAM,eAAe,sBAAsB;AAE3C,IAAM,sBAAsB,sBAAsB;AAElD,IAAM,oBAAoB,sBAAsB;AAEhD,IAAM,qBAAqB,sBAAsB;AAEjD,IAAM,kBAAkB,sBAAsB;AAE9C,IAAM,yBAAyB,sBAAsB;AAErD,IAAM,yBAAyBA,QAAM,YAKlC,EAAE,WAAW,OAAO,UAAU,GAAG,SAAS,QAC3C,qBAAC,sBAAsB,YAAvB;CACO;CACL,WAAW,GACT,cACA,wLACA,SAAS,QACT,SACF;CACA,GAAI;CARN,UAAA,CAUG,UACD,oBAAC,gBAAD,EAAgB,WAAU,UAAW,CAAA,CACL;AACnC,CAAA,CAAA;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAEtE,IAAM,yBAAyBA,QAAM,YAGlC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,sBAAsB,YAAvB;CACO;CACL,WAAW,GACT,SACA,eACA,mpBACA,2IACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,uBAAuB,cAAc,sBA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,YAK7B,EAAE,WAAW,OAAO,GAAG,SAAS,QACjC,oBAAC,sBAAsB,OAAvB;CACO;CACL,WAAW,GAAG,qCAAqC,SAAS,QAAQ,SAAS;CAC7E,GAAI;AACL,CAAA,CACF;AACD,kBAAkB,cAAc,sBAAsB,MAAM;AAE5D,IAAM,wBAAwBA,QAAM,YAGjC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,sBAAsB,WAAvB;CAAsC;CAAK,WAAW,GAAG,4BAA4B,SAAS;CAAG,GAAI;AAAQ,CAAA,CAC9G;AACD,sBAAsB,cAAc,sBAAsB,UAAU;AAEpE,IAAM,wBAAwB,EAAE,WAAW,GAAG,YAAmD;CAC/F,OAAO,oBAAC,QAAD;EAAM,WAAW,GAAG,8CAA8C,SAAS;EAAG,GAAI;CAAQ,CAAA;AACnG;AACA,qBAAqB,cAAc"}
|
|
@@ -10,12 +10,12 @@ var SheetTrigger = SheetPrimitive.Trigger;
|
|
|
10
10
|
var SheetClose = SheetPrimitive.Close;
|
|
11
11
|
var SheetPortal = SheetPrimitive.Portal;
|
|
12
12
|
var SheetOverlay = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SheetPrimitive.Overlay, {
|
|
13
|
-
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-neutral-950/32", className),
|
|
13
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ease-out-strong fixed inset-0 z-50 bg-neutral-950/32", className),
|
|
14
14
|
...props,
|
|
15
15
|
ref
|
|
16
16
|
}));
|
|
17
17
|
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
18
|
-
var sheetVariants = cva("fixed z-50 gap-4 bg-background-100 p-6 shadow-lg
|
|
18
|
+
var sheetVariants = cva("fixed z-50 gap-4 bg-background-100 p-6 shadow-lg ease-drawer data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:duration-250 motion-reduce:data-[state=closed]:duration-0 motion-reduce:data-[state=open]:duration-0", {
|
|
19
19
|
variants: { side: {
|
|
20
20
|
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
21
21
|
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.js","names":["React"],"sources":["../../../../src/components/navigation/Sheet/Sheet.tsx"],"sourcesContent":["import { XIcon } from '@phosphor-icons/react/dist/ssr/X'\nimport * as SheetPrimitive from '@radix-ui/react-dialog'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst SheetRoot = SheetPrimitive.Root\n\nconst SheetTrigger = SheetPrimitive.Trigger\n\nconst SheetClose = SheetPrimitive.Close\n\nconst SheetPortal = SheetPrimitive.Portal\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-neutral-950/32',\n className,\n )}\n {...props}\n ref={ref}\n />\n))\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName\n\nconst sheetVariants = cva(\n 'fixed z-50 gap-4 bg-background-100 p-6 shadow-lg
|
|
1
|
+
{"version":3,"file":"Sheet.js","names":["React"],"sources":["../../../../src/components/navigation/Sheet/Sheet.tsx"],"sourcesContent":["import { XIcon } from '@phosphor-icons/react/dist/ssr/X'\nimport * as SheetPrimitive from '@radix-ui/react-dialog'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst SheetRoot = SheetPrimitive.Root\n\nconst SheetTrigger = SheetPrimitive.Trigger\n\nconst SheetClose = SheetPrimitive.Close\n\nconst SheetPortal = SheetPrimitive.Portal\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ease-out-strong fixed inset-0 z-50 bg-neutral-950/32',\n className,\n )}\n {...props}\n ref={ref}\n />\n))\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName\n\nconst sheetVariants = cva(\n 'fixed z-50 gap-4 bg-background-100 p-6 shadow-lg ease-drawer data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:duration-250 motion-reduce:data-[state=closed]:duration-0 motion-reduce:data-[state=open]:duration-0',\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',\n bottom:\n 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',\n right:\n 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',\n },\n },\n defaultVariants: {\n side: 'left',\n },\n },\n)\n\ntype SheetContentProps = {\n showClose?: boolean\n} & React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> &\n VariantProps<typeof sheetVariants>\n\nconst SheetContent = React.forwardRef<React.ComponentRef<typeof SheetPrimitive.Content>, SheetContentProps>(\n ({ side = 'left', className, children, showClose, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>\n {children}\n {showClose && (\n <SheetPrimitive.Close className=\"data-[state=open]:bg-secondary ring-offset-background absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none\">\n <XIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n ),\n)\nSheetContent.displayName = SheetPrimitive.Content.displayName\n\nconst SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />\n)\nSheetHeader.displayName = 'SheetHeader'\n\nconst SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />\n)\nSheetFooter.displayName = 'SheetFooter'\n\nconst SheetTitle = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title ref={ref} className={cn('text-foreground text-lg font-semibold', className)} {...props} />\n))\nSheetTitle.displayName = SheetPrimitive.Title.displayName\n\nconst SheetDescription = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n))\nSheetDescription.displayName = SheetPrimitive.Description.displayName\n\nexport type SheetComponentProps = {\n trigger: string | React.ReactNode\n title: string | React.ReactNode\n content: string | React.ReactNode\n showClose?: boolean\n className?: string\n side?: 'top' | 'bottom' | 'left' | 'right'\n}\n\nexport const Sheet = ({ trigger, title, content, side, className, showClose }: SheetComponentProps) => {\n return (\n <SheetRoot>\n <SheetTrigger>{trigger}</SheetTrigger>\n <SheetContent showClose={showClose} side={side} className={className}>\n <SheetHeader>\n <SheetTitle>{title}</SheetTitle>\n </SheetHeader>\n {content}\n </SheetContent>\n </SheetRoot>\n )\n}\n\nexport {\n SheetRoot,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n"],"mappings":";;;;;;;AAOA,IAAM,YAAY,eAAe;AAEjC,IAAM,eAAe,eAAe;AAEpC,IAAM,aAAa,eAAe;AAElC,IAAM,cAAc,eAAe;AAEnC,IAAM,eAAeA,QAAM,YAGxB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,SAAhB;CACE,WAAW,GACT,gLACA,SACF;CACA,GAAI;CACC;AACN,CAAA,CACF;AACD,aAAa,cAAc,eAAe,QAAQ;AAElD,IAAM,gBAAgB,IACpB,qRACA;CACE,UAAU,EACR,MAAM;EACJ,KAAK;EACL,QACE;EACF,MAAM;EACN,OACE;CACJ,EACF;CACA,iBAAiB,EACf,MAAM,OACR;AACF,CACF;AAOA,IAAM,eAAeA,QAAM,YACxB,EAAE,OAAO,QAAQ,WAAW,UAAU,WAAW,GAAG,SAAS,QAC5D,qBAAC,aAAD,EAAA,UAAA,CACE,oBAAC,cAAD,CAAe,CAAA,GACf,qBAAC,eAAe,SAAhB;CAA6B;CAAK,WAAW,GAAG,cAAc,EAAE,KAAK,CAAC,GAAG,SAAS;CAAG,GAAI;CAAzF,UAAA,CACG,UACA,aACC,qBAAC,eAAe,OAAhB;EAAsB,WAAU;EAAhC,UAAA,CACE,oBAAC,OAAD,EAAO,WAAU,UAAW,CAAA,GAC5B,oBAAC,QAAD;GAAM,WAAU;GAAU,UAAA;EAAW,CAAA,CACjB;CAEF,CAAA,CAAA;AACb,CAAA,CAAA,EAAA,CAAA,CAEjB;AACA,aAAa,cAAc,eAAe,QAAQ;AAElD,IAAM,eAAe,EAAE,WAAW,GAAG,YACnC,oBAAC,OAAD;CAAK,WAAW,GAAG,oDAAoD,SAAS;CAAG,GAAI;AAAQ,CAAA;AAEjG,YAAY,cAAc;AAE1B,IAAM,eAAe,EAAE,WAAW,GAAG,YACnC,oBAAC,OAAD;CAAK,WAAW,GAAG,iEAAiE,SAAS;CAAG,GAAI;AAAQ,CAAA;AAE9G,YAAY,cAAc;AAE1B,IAAM,aAAaA,QAAM,YAGtB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,OAAhB;CAA2B;CAAK,WAAW,GAAG,yCAAyC,SAAS;CAAG,GAAI;AAAQ,CAAA,CAChH;AACD,WAAW,cAAc,eAAe,MAAM;AAE9C,IAAM,mBAAmBA,QAAM,YAG5B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,aAAhB;CAAiC;CAAK,WAAW,GAAG,iCAAiC,SAAS;CAAG,GAAI;AAAQ,CAAA,CAC9G;AACD,iBAAiB,cAAc,eAAe,YAAY;AAW1D,IAAa,SAAS,EAAE,SAAS,OAAO,SAAS,MAAM,WAAW,gBAAqC;CACrG,OACE,qBAAC,WAAD,EAAA,UAAA,CACE,oBAAC,cAAD,EAAA,UAAe,QAAsB,CAAA,GACrC,qBAAC,cAAD;EAAyB;EAAiB;EAAiB;EAA3D,UAAA,CACE,oBAAC,aAAD,EAAA,UACE,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA,EACpB,CAAA,GACZ,OACW;CACL,CAAA,CAAA,EAAA,CAAA;AAEf"}
|
|
@@ -35,6 +35,7 @@ var marquee = createMarquee({
|
|
|
35
35
|
var SidebarProvider = React$1.forwardRef(({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, size = "medium", className, style, children, onPointerOver, onPointerOut, onFocus, onBlur, ...props }, ref) => {
|
|
36
36
|
const isMobile = useIsMobile();
|
|
37
37
|
const [openMobile, setOpenMobile] = React$1.useState(false);
|
|
38
|
+
const [instant, setInstant] = React$1.useState(false);
|
|
38
39
|
const [_open, _setOpen] = React$1.useState(defaultOpen);
|
|
39
40
|
const open = openProp ?? _open;
|
|
40
41
|
const setOpen = React$1.useCallback((value) => {
|
|
@@ -60,7 +61,9 @@ var SidebarProvider = React$1.forwardRef(({ defaultOpen = true, open: openProp,
|
|
|
60
61
|
const isEditing = event.target instanceof HTMLElement && (event.target.isContentEditable || event.target.closest("input, textarea, select") !== null);
|
|
61
62
|
if (isShortcut && !isEditing && !event.defaultPrevented) {
|
|
62
63
|
event.preventDefault();
|
|
64
|
+
setInstant(true);
|
|
63
65
|
toggleSidebarRef.current();
|
|
66
|
+
requestAnimationFrame(() => requestAnimationFrame(() => setInstant(false)));
|
|
64
67
|
}
|
|
65
68
|
};
|
|
66
69
|
window.addEventListener("keydown", handleKeyDown);
|
|
@@ -98,7 +101,8 @@ var SidebarProvider = React$1.forwardRef(({ defaultOpen = true, open: openProp,
|
|
|
98
101
|
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON[size],
|
|
99
102
|
...style
|
|
100
103
|
},
|
|
101
|
-
|
|
104
|
+
"data-instant": instant || void 0,
|
|
105
|
+
className: cn("flex min-h-svh w-full [--page-padding:1rem] data-[instant=true]:**:duration-0! sm:[--page-padding:1.5rem] lg:[--page-padding:2rem]", className),
|
|
102
106
|
ref,
|
|
103
107
|
onPointerOver: (event) => {
|
|
104
108
|
onPointerOver?.(event);
|
|
@@ -130,7 +134,7 @@ var SidebarRoot = React$1.forwardRef(({ variant = "default", className, children
|
|
|
130
134
|
children: /* @__PURE__ */ jsxs(SheetContent, {
|
|
131
135
|
ref,
|
|
132
136
|
"data-sidebar": "sidebar",
|
|
133
|
-
className: cn("bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0
|
|
137
|
+
className: cn("bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0", className),
|
|
134
138
|
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
135
139
|
...props,
|
|
136
140
|
side: "left",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.js","names":["React"],"sources":["../../../../src/components/navigation/Sidebar/Sidebar.tsx"],"sourcesContent":["'use client'\n\nimport { ListIcon } from '@phosphor-icons/react/dist/ssr/List'\nimport { SidebarSimpleIcon } from '@phosphor-icons/react/dist/ssr/SidebarSimple'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { useIsMobile } from '../../../lib/useMobile'\nimport { Separator } from '../../data-display/Separator'\nimport { TooltipProvider } from '../../data-display/Tooltip'\nimport { Typography } from '../../data-display/Typography'\nimport { Input } from '../../inputs/Input'\nimport { SheetContent, SheetDescription, SheetHeader, SheetRoot, SheetTitle } from '../Sheet'\n\nimport { SidebarContext, useSidebar, useResolvedSize } from './context'\nimport type { SidebarSize } from './context'\nimport { MOTION, SCROLLBAR } from './styles'\n\nimport { trackInputModality } from '@/lib/inputModality'\nimport { createMarquee } from '@/lib/marquee'\nimport { cn } from '@/lib/utils'\n\nconst SIDEBAR_COOKIE_NAME = 'sidebar_state'\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7\nconst SIDEBAR_WIDTH = '17.5rem'\nconst SIDEBAR_WIDTH_MOBILE = '18.5rem'\nconst SIDEBAR_KEYBOARD_SHORTCUT = /^b$/i\n\nconst SIDEBAR_WIDTH_ICON: Record<SidebarSize, string> = {\n small: '3.5rem',\n medium: '4rem',\n big: '4.5rem',\n}\n\nconst MARQUEE_ROW = '[data-sidebar=menu-button], [data-sidebar=menu-sub-button], [data-sidebar=user]'\nconst marquee = createMarquee({\n rows: MARQUEE_ROW,\n disabled: (row) => row.closest('[data-side][data-state=collapsed]') !== null,\n})\n\nconst SidebarProvider = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & {\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n size?: SidebarSize\n }\n>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n size = 'medium',\n className,\n style,\n children,\n onPointerOver,\n onPointerOut,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n ) => {\n const isMobile = useIsMobile()\n const [openMobile, setOpenMobile] = React.useState(false)\n\n const [_open, _setOpen] = React.useState(defaultOpen)\n const open = openProp ?? _open\n const setOpen = React.useCallback(\n (value: boolean) => {\n if (setOpenProp) {\n setOpenProp(value)\n } else {\n _setOpen(value)\n }\n\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${value}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n },\n [setOpenProp],\n )\n\n const toggleSidebar = React.useCallback(() => {\n if (isMobile) {\n setOpenMobile((value) => !value)\n } else {\n setOpen(!open)\n }\n }, [isMobile, open, setOpen])\n\n const toggleSidebarRef = React.useRef(toggleSidebar)\n React.useEffect(() => {\n toggleSidebarRef.current = toggleSidebar\n }, [toggleSidebar])\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const isShortcut =\n SIDEBAR_KEYBOARD_SHORTCUT.test(event.key) &&\n (event.metaKey || event.ctrlKey) &&\n !event.shiftKey &&\n !event.altKey\n const isEditing =\n event.target instanceof HTMLElement &&\n (event.target.isContentEditable || event.target.closest('input, textarea, select') !== null)\n\n if (isShortcut && !isEditing && !event.defaultPrevented) {\n event.preventDefault()\n toggleSidebarRef.current()\n }\n }\n\n window.addEventListener('keydown', handleKeyDown)\n return () => window.removeEventListener('keydown', handleKeyDown)\n }, [])\n\n React.useEffect(trackInputModality, [])\n\n React.useEffect(() => {\n if (!open) {\n marquee.stopAll()\n }\n }, [open])\n\n const state = open ? 'expanded' : 'collapsed'\n\n const contextValue = React.useMemo<SidebarContext>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n size,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, size],\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider>\n <div\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH,\n '--sidebar-width-icon': SIDEBAR_WIDTH_ICON[size],\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n 'flex min-h-svh w-full [--page-padding:1rem] sm:[--page-padding:1.5rem] lg:[--page-padding:2rem]',\n className,\n )}\n ref={ref}\n onPointerOver={(event) => {\n onPointerOver?.(event)\n marquee.onPointerOver(event)\n }}\n onPointerOut={(event) => {\n onPointerOut?.(event)\n marquee.onPointerOut(event)\n }}\n onFocus={(event) => {\n onFocus?.(event)\n marquee.onFocus(event)\n }}\n onBlur={(event) => {\n onBlur?.(event)\n marquee.onBlur(event)\n }}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n )\n },\n)\nSidebarProvider.displayName = 'SidebarProvider'\n\nconst SidebarRoot = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & {\n /** @deprecated The sidebar is always on the left; this prop is ignored. */\n side?: 'left' | 'right'\n variant?: 'default' | 'hidden'\n }\n>(({ variant = 'default', className, children, 'aria-label': ariaLabel = 'Main', ...props }, ref) => {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n\n if (isMobile) {\n return (\n <SheetRoot open={openMobile} onOpenChange={setOpenMobile}>\n <SheetContent\n ref={ref}\n data-sidebar=\"sidebar\"\n className={cn(\n 'bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 ease-out data-[state=closed]:duration-200 data-[state=open]:duration-300 motion-reduce:data-[state=closed]:duration-0 motion-reduce:data-[state=open]:duration-0',\n className,\n )}\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n {...props}\n side=\"left\"\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <nav aria-label={ariaLabel} className=\"@container flex h-full w-full flex-col gap-3 px-3 pb-3\">\n {children}\n </nav>\n </SheetContent>\n </SheetRoot>\n )\n }\n\n return (\n <TooltipProvider delayDuration={0}>\n <div ref={ref} className=\"group text-sidebar-foreground hidden md:block\" data-state={state} data-side=\"left\">\n <div\n className={cn(\n 'w-(--sidebar-width) transition-[width]',\n MOTION,\n variant === 'default' && 'group-data-[state=collapsed]:w-(--sidebar-width-icon)',\n variant === 'hidden' && 'group-data-[state=collapsed]:w-0',\n )}\n />\n <div\n className={cn(\n 'fixed inset-y-0 left-0 z-10 flex h-svh w-(--sidebar-width) transition-[left,width]',\n MOTION,\n variant === 'default' && 'group-data-[state=collapsed]:w-(--sidebar-width-icon)',\n variant === 'hidden' && 'group-data-[state=collapsed]:-left-(--sidebar-width)',\n className,\n )}\n {...props}\n >\n <nav\n data-sidebar=\"sidebar\"\n aria-label={ariaLabel}\n className=\"bg-sidebar @container flex h-full w-full flex-col gap-3 px-3 pb-3\"\n >\n {children}\n </nav>\n </div>\n </div>\n </TooltipProvider>\n )\n})\nSidebarRoot.displayName = 'SidebarRoot'\n\nconst SIDEBAR_TRIGGER: Record<SidebarSize, string> = {\n small: 'size-7 [&>svg]:size-4.5',\n medium: 'size-8 [&>svg]:size-5',\n big: 'size-8 [&>svg]:size-6',\n}\n\nconst SidebarTrigger = React.forwardRef<HTMLButtonElement, React.ComponentProps<'button'> & { icon?: React.ReactNode }>(\n ({ className, onClick, icon, ...props }, ref) => {\n const { isMobile, toggleSidebar, size, open, openMobile } = useSidebar()\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-sidebar=\"trigger\"\n aria-expanded={isMobile ? openMobile : open}\n className={cn(\n 'text-sidebar-foreground hover:bg-sidebar-accent focus-visible:ring-sidebar-ring relative flex shrink-0 items-center justify-center rounded-lg outline-hidden focus-visible:ring-2',\n 'transition-colors motion-reduce:transition-none',\n SIDEBAR_TRIGGER[size],\n className,\n )}\n onClick={(event) => {\n onClick?.(event)\n toggleSidebar()\n }}\n {...props}\n >\n {icon ?? (isMobile ? <ListIcon aria-hidden /> : <SidebarSimpleIcon aria-hidden />)}\n <span className=\"sr-only\">Toggle Sidebar</span>\n </button>\n )\n },\n)\nSidebarTrigger.displayName = 'SidebarTrigger'\n\nconst SIDEBAR_HEADER_TRIGGER: Record<SidebarSize, string> = {\n small: 'right-0 group-data-[state=collapsed]:right-0.5',\n medium: 'right-0 group-data-[state=collapsed]:right-1',\n big: 'right-1 group-data-[state=collapsed]:right-2',\n}\n\nconst SidebarHeaderTrigger = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof SidebarTrigger>>(\n ({ className, ...props }, ref) => {\n const { isMobile, size } = useSidebar()\n\n if (isMobile) {\n return null\n }\n\n return (\n <SidebarTrigger\n ref={ref}\n className={cn(\n 'absolute inset-y-0 my-auto transition-[right,background-color]',\n MOTION,\n SIDEBAR_HEADER_TRIGGER[size],\n className,\n )}\n {...props}\n />\n )\n },\n)\nSidebarHeaderTrigger.displayName = 'SidebarHeaderTrigger'\n\nconst SIDEBAR_LOGO: Record<SidebarSize, { frame: string; logo: string; tag: string }> = {\n small: { frame: '[--logo-inset:0.4375rem]', logo: 'h-8.5 w-10', tag: 'mb-[5.75px] ml-[3.75px] text-[8.75px]/none' },\n medium: { frame: '[--logo-inset:0.625rem]', logo: 'h-10 w-12', tag: 'mb-[6.5px] ml-[4.5px] text-[10.5px]/none' },\n big: { frame: '[--logo-inset:0.75rem]', logo: 'h-11.5 w-14', tag: 'mb-[7.25px] ml-[5.25px] text-[12.25px]/none' },\n}\n\nconst SidebarLogo = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & { asChild?: boolean; tag?: React.ReactNode }\n>(({ className, asChild = false, tag, ...props }, ref) => {\n const Comp = asChild ? Slot : 'div'\n const { size, isMobile } = useSidebar()\n\n return (\n <div\n className={cn(\n 'flex w-full items-end overflow-hidden mask-[linear-gradient(to_right,transparent,black_var(--logo-inset))] py-0.5',\n 'transition-[opacity,visibility] group-data-[state=collapsed]:invisible group-data-[state=collapsed]:opacity-0',\n MOTION,\n SIDEBAR_LOGO[size].frame,\n )}\n >\n <Comp\n ref={ref}\n data-sidebar=\"logo\"\n className={cn(\n 'focus-visible:ring-sidebar-ring flex shrink-0 items-center justify-center rounded-lg outline-hidden focus-visible:ring-2',\n '[&>img]:aspect-48/27 [&>img]:w-full [&>img]:object-contain [&>svg]:aspect-48/27 [&>svg]:w-full',\n isMobile ? 'ml-(--logo-inset)' : 'ml-[calc(100%-var(--sidebar-width)+1.5rem+var(--logo-inset))]',\n SIDEBAR_LOGO[size].logo,\n className,\n )}\n {...props}\n />\n {tag && (\n <Typography\n weight=\"bold\"\n data-sidebar=\"logo-tag\"\n className={cn('shrink-0 whitespace-nowrap', SIDEBAR_LOGO[size].tag)}\n >\n {tag}\n </Typography>\n )}\n </div>\n )\n})\nSidebarLogo.displayName = 'SidebarLogo'\n\nconst SIDEBAR_INPUT_HEIGHT: Record<SidebarSize, string> = {\n small: 'h-8',\n medium: 'h-10',\n big: 'h-12',\n}\n\nconst SidebarInput = React.forwardRef<\n React.ComponentRef<typeof Input>,\n Omit<React.ComponentProps<typeof Input>, 'size'> & { size?: SidebarSize }\n>(({ className, size, id, onFocus, ...props }, ref) => {\n const { state, isMobile, setOpen } = useSidebar()\n const generatedId = React.useId()\n const inputId = id ?? generatedId\n const resolvedSize = useResolvedSize(size)\n const isRail = state === 'collapsed' && !isMobile\n\n return (\n <label htmlFor={inputId} className=\"block group-data-[state=collapsed]:cursor-pointer\">\n <Input\n ref={ref}\n id={inputId}\n data-sidebar=\"input\"\n className={cn('md:text-sm', SIDEBAR_INPUT_HEIGHT[resolvedSize], className)}\n onFocus={(event) => {\n onFocus?.(event)\n if (isRail) {\n setOpen(true)\n }\n }}\n {...props}\n />\n </label>\n )\n})\nSidebarInput.displayName = 'SidebarInput'\n\nconst SIDEBAR_HEADER: Record<SidebarSize, string> = {\n small: 'min-h-12',\n medium: 'min-h-14',\n big: 'min-h-16',\n}\n\nconst SidebarHeader = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(({ className, ...props }, ref) => {\n const { size } = useSidebar()\n\n return (\n <div\n ref={ref}\n data-sidebar=\"header\"\n className={cn('relative flex shrink-0 items-center', SIDEBAR_HEADER[size], className)}\n {...props}\n />\n )\n})\nSidebarHeader.displayName = 'SidebarHeader'\n\nconst SidebarFooter = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(({ className, ...props }, ref) => {\n return <div ref={ref} data-sidebar=\"footer\" className={cn('flex flex-col gap-3', className)} {...props} />\n})\nSidebarFooter.displayName = 'SidebarFooter'\n\nconst SidebarSeparator = React.forwardRef<React.ComponentRef<typeof Separator>, React.ComponentProps<typeof Separator>>(\n ({ className, ...props }, ref) => {\n return (\n <Separator ref={ref} data-sidebar=\"separator\" className={cn('bg-sidebar-border w-auto', className)} {...props} />\n )\n },\n)\nSidebarSeparator.displayName = 'SidebarSeparator'\n\nconst SidebarContent = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"content\"\n className={cn(\n '-my-1 -mr-3 -ml-1 flex min-h-0 flex-1 flex-col gap-3 overflow-x-hidden overflow-y-auto py-1 pl-1 md:mt-[calc(var(--page-padding)-15px)]',\n SCROLLBAR,\n '*:w-[min(100cqw,calc(100%-0.25rem))] *:shrink-0',\n className,\n )}\n {...props}\n />\n )\n})\nSidebarContent.displayName = 'SidebarContent'\n\nconst SidebarGroup = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(({ className, ...props }, ref) => {\n return (\n <div ref={ref} data-sidebar=\"group\" className={cn('relative flex w-full min-w-0 flex-col', className)} {...props} />\n )\n})\nSidebarGroup.displayName = 'SidebarGroup'\n\nconst sidebarGroupLabelVariants = cva(\n [\n 'text-sidebar-foreground/70 ring-sidebar-ring flex shrink-0 items-center rounded-md transition-[margin,opacity] outline-hidden focus-visible:ring-2 [&>svg]:shrink-0 group-data-[state=collapsed]:opacity-0',\n MOTION,\n ].join(' '),\n {\n variants: {\n size: {\n small: 'h-8 pl-1.75 [&>svg]:size-4 group-data-[state=collapsed]:-mt-8',\n medium: 'h-10 pl-2.5 [&>svg]:size-4 group-data-[state=collapsed]:-mt-10',\n big: 'h-12 pl-3 [&>svg]:size-5 group-data-[state=collapsed]:-mt-12',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n)\n\nconst SIDEBAR_GROUP_LABEL_TEXT_VARIANT: Record<SidebarSize, 'label-md' | 'label-lg'> = {\n small: 'label-md',\n medium: 'label-md',\n big: 'label-lg',\n}\n\nconst SidebarGroupLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & { asChild?: boolean; size?: SidebarSize }\n>(({ className, asChild = false, size, children, ...props }, ref) => {\n const Comp = asChild ? Slot : 'div'\n const resolvedSize = useResolvedSize(size)\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"group-label\"\n className={cn(sidebarGroupLabelVariants({ size: resolvedSize }), className)}\n {...props}\n >\n {typeof children === 'string' ? (\n <Typography variant={SIDEBAR_GROUP_LABEL_TEXT_VARIANT[resolvedSize]} color=\"secondary\">\n {children}\n </Typography>\n ) : (\n children\n )}\n </Comp>\n )\n})\nSidebarGroupLabel.displayName = 'SidebarGroupLabel'\n\nconst sidebarGroupActionVariants = cva(\n [\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute flex aspect-square items-center justify-center rounded-md p-0 transition-[opacity,visibility,color,background-color] outline-hidden focus-visible:ring-2 after:absolute after:-inset-2 after:md:hidden group-data-[state=collapsed]:invisible group-data-[state=collapsed]:opacity-0 [&>svg]:shrink-0',\n MOTION,\n ].join(' '),\n {\n variants: {\n size: {\n small: 'top-1.5 right-1.5 w-5 [&>svg]:size-4',\n medium: 'top-2.5 right-1.5 w-5 [&>svg]:size-4',\n big: 'top-3 right-1.5 w-6 [&>svg]:size-5',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n)\n\nconst SidebarGroupAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<'button'> & { asChild?: boolean; size?: SidebarSize }\n>(({ className, asChild = false, size, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n const resolvedSize = useResolvedSize(size)\n\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : 'button'}\n data-sidebar=\"group-action\"\n className={cn(sidebarGroupActionVariants({ size: resolvedSize }), className)}\n {...props}\n />\n )\n})\nSidebarGroupAction.displayName = 'SidebarGroupAction'\n\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} data-sidebar=\"group-content\" className={cn('w-full text-sm', className)} {...props} />\n ),\n)\nSidebarGroupContent.displayName = 'SidebarGroupContent'\n\nexport {\n SidebarRoot,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarHeaderTrigger,\n SidebarInput,\n SidebarLogo,\n SidebarProvider,\n SidebarSeparator,\n SidebarTrigger,\n sidebarGroupActionVariants,\n sidebarGroupLabelVariants,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,IAAA,sBAAA;AACA,IAAA,yBAAA;AACA,IAAA,gBAAA;AACA,IAAA,uBAAA;AACA,IAAA,4BAAA;AAEA,IAAA,qBAAA;CACE,OAAA;CACA,QAAA;CACA,KAAA;AACF;AAGA,IAAA,UAAA,cAAA;CACE,MAAA;CACA,WAAA,QAAA,IAAA,QAAA,mCAAA,MAAA;AACF,CAAA;AAEA,IAAA,kBAAA,QAAA,YAAA,EAAA,cAAA,MAAA,MAAA,UAAA,cAAA,aAAA,OAAA,UAAA,WAAA,OAAA,UAAA,eAAA,cAAA,SAAA,QAAA,GAAA,SAAA,QAAA;CA0BI,MAAA,WAAA,YAAA;CACA,MAAA,CAAA,YAAA,iBAAA,QAAA,SAAA,KAAA;CAEA,MAAA,CAAA,OAAA,YAAA,QAAA,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x"],"sourcesContent":["'use client'\n\nimport { ListIcon } from '@phosphor-icons/react/dist/ssr/List'\nimport { SidebarSimpleIcon } from '@phosphor-icons/react/dist/ssr/SidebarSimple'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { useIsMobile } from '../../../lib/useMobile'\nimport { Separator } from '../../data-display/Separator'\nimport { TooltipProvider } from '../../data-display/Tooltip'\nimport { Typography } from '../../data-display/Typography'\nimport { Input } from '../../inputs/Input'\nimport { SheetContent, SheetDescription, SheetHeader, SheetRoot, SheetTitle } from '../Sheet'\n\nimport { SidebarContext, useSidebar, useResolvedSize } from './context'\nimport type { SidebarSize } from './context'\nimport { MOTION, SCROLLBAR } from './styles'\n\nimport { trackInputModality } from '@/lib/inputModality'\nimport { createMarquee } from '@/lib/marquee'\nimport { cn } from '@/lib/utils'\n\nconst SIDEBAR_COOKIE_NAME = 'sidebar_state'\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7\nconst SIDEBAR_WIDTH = '17.5rem'\nconst SIDEBAR_WIDTH_MOBILE = '18.5rem'\nconst SIDEBAR_KEYBOARD_SHORTCUT = /^b$/i\n\nconst SIDEBAR_WIDTH_ICON: Record<SidebarSize, string> = {\n small: '3.5rem',\n medium: '4rem',\n big: '4.5rem',\n}\n\nconst MARQUEE_ROW = '[data-sidebar=menu-button], [data-sidebar=menu-sub-button], [data-sidebar=user]'\nconst marquee = createMarquee({\n rows: MARQUEE_ROW,\n disabled: (row) => row.closest('[data-side][data-state=collapsed]') !== null,\n})\n\nconst SidebarProvider = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & {\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n size?: SidebarSize\n }\n>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n size = 'medium',\n className,\n style,\n children,\n onPointerOver,\n onPointerOut,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n ) => {\n const isMobile = useIsMobile()\n const [openMobile, setOpenMobile] = React.useState(false)\n const [instant, setInstant] = React.useState(false)\n\n const [_open, _setOpen] = React.useState(defaultOpen)\n const open = openProp ?? _open\n const setOpen = React.useCallback(\n (value: boolean) => {\n if (setOpenProp) {\n setOpenProp(value)\n } else {\n _setOpen(value)\n }\n\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${value}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n },\n [setOpenProp],\n )\n\n const toggleSidebar = React.useCallback(() => {\n if (isMobile) {\n setOpenMobile((value) => !value)\n } else {\n setOpen(!open)\n }\n }, [isMobile, open, setOpen])\n\n const toggleSidebarRef = React.useRef(toggleSidebar)\n React.useEffect(() => {\n toggleSidebarRef.current = toggleSidebar\n }, [toggleSidebar])\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const isShortcut =\n SIDEBAR_KEYBOARD_SHORTCUT.test(event.key) &&\n (event.metaKey || event.ctrlKey) &&\n !event.shiftKey &&\n !event.altKey\n const isEditing =\n event.target instanceof HTMLElement &&\n (event.target.isContentEditable || event.target.closest('input, textarea, select') !== null)\n\n if (isShortcut && !isEditing && !event.defaultPrevented) {\n event.preventDefault()\n setInstant(true)\n toggleSidebarRef.current()\n requestAnimationFrame(() => requestAnimationFrame(() => setInstant(false)))\n }\n }\n\n window.addEventListener('keydown', handleKeyDown)\n return () => window.removeEventListener('keydown', handleKeyDown)\n }, [])\n\n React.useEffect(trackInputModality, [])\n\n React.useEffect(() => {\n if (!open) {\n marquee.stopAll()\n }\n }, [open])\n\n const state = open ? 'expanded' : 'collapsed'\n\n const contextValue = React.useMemo<SidebarContext>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n size,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, size],\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider>\n <div\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH,\n '--sidebar-width-icon': SIDEBAR_WIDTH_ICON[size],\n ...style,\n } as React.CSSProperties\n }\n data-instant={instant || undefined}\n className={cn(\n 'flex min-h-svh w-full [--page-padding:1rem] data-[instant=true]:**:duration-0! sm:[--page-padding:1.5rem] lg:[--page-padding:2rem]',\n className,\n )}\n ref={ref}\n onPointerOver={(event) => {\n onPointerOver?.(event)\n marquee.onPointerOver(event)\n }}\n onPointerOut={(event) => {\n onPointerOut?.(event)\n marquee.onPointerOut(event)\n }}\n onFocus={(event) => {\n onFocus?.(event)\n marquee.onFocus(event)\n }}\n onBlur={(event) => {\n onBlur?.(event)\n marquee.onBlur(event)\n }}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n )\n },\n)\nSidebarProvider.displayName = 'SidebarProvider'\n\nconst SidebarRoot = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & {\n /** @deprecated The sidebar is always on the left; this prop is ignored. */\n side?: 'left' | 'right'\n variant?: 'default' | 'hidden'\n }\n>(({ variant = 'default', className, children, 'aria-label': ariaLabel = 'Main', ...props }, ref) => {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n\n if (isMobile) {\n return (\n <SheetRoot open={openMobile} onOpenChange={setOpenMobile}>\n <SheetContent\n ref={ref}\n data-sidebar=\"sidebar\"\n className={cn('bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0', className)}\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n {...props}\n side=\"left\"\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <nav aria-label={ariaLabel} className=\"@container flex h-full w-full flex-col gap-3 px-3 pb-3\">\n {children}\n </nav>\n </SheetContent>\n </SheetRoot>\n )\n }\n\n return (\n <TooltipProvider delayDuration={0}>\n <div ref={ref} className=\"group text-sidebar-foreground hidden md:block\" data-state={state} data-side=\"left\">\n <div\n className={cn(\n 'w-(--sidebar-width) transition-[width]',\n MOTION,\n variant === 'default' && 'group-data-[state=collapsed]:w-(--sidebar-width-icon)',\n variant === 'hidden' && 'group-data-[state=collapsed]:w-0',\n )}\n />\n <div\n className={cn(\n 'fixed inset-y-0 left-0 z-10 flex h-svh w-(--sidebar-width) transition-[left,width]',\n MOTION,\n variant === 'default' && 'group-data-[state=collapsed]:w-(--sidebar-width-icon)',\n variant === 'hidden' && 'group-data-[state=collapsed]:-left-(--sidebar-width)',\n className,\n )}\n {...props}\n >\n <nav\n data-sidebar=\"sidebar\"\n aria-label={ariaLabel}\n className=\"bg-sidebar @container flex h-full w-full flex-col gap-3 px-3 pb-3\"\n >\n {children}\n </nav>\n </div>\n </div>\n </TooltipProvider>\n )\n})\nSidebarRoot.displayName = 'SidebarRoot'\n\nconst SIDEBAR_TRIGGER: Record<SidebarSize, string> = {\n small: 'size-7 [&>svg]:size-4.5',\n medium: 'size-8 [&>svg]:size-5',\n big: 'size-8 [&>svg]:size-6',\n}\n\nconst SidebarTrigger = React.forwardRef<HTMLButtonElement, React.ComponentProps<'button'> & { icon?: React.ReactNode }>(\n ({ className, onClick, icon, ...props }, ref) => {\n const { isMobile, toggleSidebar, size, open, openMobile } = useSidebar()\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-sidebar=\"trigger\"\n aria-expanded={isMobile ? openMobile : open}\n className={cn(\n 'text-sidebar-foreground hover:bg-sidebar-accent focus-visible:ring-sidebar-ring relative flex shrink-0 items-center justify-center rounded-lg outline-hidden focus-visible:ring-2',\n 'transition-colors motion-reduce:transition-none',\n SIDEBAR_TRIGGER[size],\n className,\n )}\n onClick={(event) => {\n onClick?.(event)\n toggleSidebar()\n }}\n {...props}\n >\n {icon ?? (isMobile ? <ListIcon aria-hidden /> : <SidebarSimpleIcon aria-hidden />)}\n <span className=\"sr-only\">Toggle Sidebar</span>\n </button>\n )\n },\n)\nSidebarTrigger.displayName = 'SidebarTrigger'\n\nconst SIDEBAR_HEADER_TRIGGER: Record<SidebarSize, string> = {\n small: 'right-0 group-data-[state=collapsed]:right-0.5',\n medium: 'right-0 group-data-[state=collapsed]:right-1',\n big: 'right-1 group-data-[state=collapsed]:right-2',\n}\n\nconst SidebarHeaderTrigger = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof SidebarTrigger>>(\n ({ className, ...props }, ref) => {\n const { isMobile, size } = useSidebar()\n\n if (isMobile) {\n return null\n }\n\n return (\n <SidebarTrigger\n ref={ref}\n className={cn(\n 'absolute inset-y-0 my-auto transition-[right,background-color]',\n MOTION,\n SIDEBAR_HEADER_TRIGGER[size],\n className,\n )}\n {...props}\n />\n )\n },\n)\nSidebarHeaderTrigger.displayName = 'SidebarHeaderTrigger'\n\nconst SIDEBAR_LOGO: Record<SidebarSize, { frame: string; logo: string; tag: string }> = {\n small: { frame: '[--logo-inset:0.4375rem]', logo: 'h-8.5 w-10', tag: 'mb-[5.75px] ml-[3.75px] text-[8.75px]/none' },\n medium: { frame: '[--logo-inset:0.625rem]', logo: 'h-10 w-12', tag: 'mb-[6.5px] ml-[4.5px] text-[10.5px]/none' },\n big: { frame: '[--logo-inset:0.75rem]', logo: 'h-11.5 w-14', tag: 'mb-[7.25px] ml-[5.25px] text-[12.25px]/none' },\n}\n\nconst SidebarLogo = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & { asChild?: boolean; tag?: React.ReactNode }\n>(({ className, asChild = false, tag, ...props }, ref) => {\n const Comp = asChild ? Slot : 'div'\n const { size, isMobile } = useSidebar()\n\n return (\n <div\n className={cn(\n 'flex w-full items-end overflow-hidden mask-[linear-gradient(to_right,transparent,black_var(--logo-inset))] py-0.5',\n 'transition-[opacity,visibility] group-data-[state=collapsed]:invisible group-data-[state=collapsed]:opacity-0',\n MOTION,\n SIDEBAR_LOGO[size].frame,\n )}\n >\n <Comp\n ref={ref}\n data-sidebar=\"logo\"\n className={cn(\n 'focus-visible:ring-sidebar-ring flex shrink-0 items-center justify-center rounded-lg outline-hidden focus-visible:ring-2',\n '[&>img]:aspect-48/27 [&>img]:w-full [&>img]:object-contain [&>svg]:aspect-48/27 [&>svg]:w-full',\n isMobile ? 'ml-(--logo-inset)' : 'ml-[calc(100%-var(--sidebar-width)+1.5rem+var(--logo-inset))]',\n SIDEBAR_LOGO[size].logo,\n className,\n )}\n {...props}\n />\n {tag && (\n <Typography\n weight=\"bold\"\n data-sidebar=\"logo-tag\"\n className={cn('shrink-0 whitespace-nowrap', SIDEBAR_LOGO[size].tag)}\n >\n {tag}\n </Typography>\n )}\n </div>\n )\n})\nSidebarLogo.displayName = 'SidebarLogo'\n\nconst SIDEBAR_INPUT_HEIGHT: Record<SidebarSize, string> = {\n small: 'h-8',\n medium: 'h-10',\n big: 'h-12',\n}\n\nconst SidebarInput = React.forwardRef<\n React.ComponentRef<typeof Input>,\n Omit<React.ComponentProps<typeof Input>, 'size'> & { size?: SidebarSize }\n>(({ className, size, id, onFocus, ...props }, ref) => {\n const { state, isMobile, setOpen } = useSidebar()\n const generatedId = React.useId()\n const inputId = id ?? generatedId\n const resolvedSize = useResolvedSize(size)\n const isRail = state === 'collapsed' && !isMobile\n\n return (\n <label htmlFor={inputId} className=\"block group-data-[state=collapsed]:cursor-pointer\">\n <Input\n ref={ref}\n id={inputId}\n data-sidebar=\"input\"\n className={cn('md:text-sm', SIDEBAR_INPUT_HEIGHT[resolvedSize], className)}\n onFocus={(event) => {\n onFocus?.(event)\n if (isRail) {\n setOpen(true)\n }\n }}\n {...props}\n />\n </label>\n )\n})\nSidebarInput.displayName = 'SidebarInput'\n\nconst SIDEBAR_HEADER: Record<SidebarSize, string> = {\n small: 'min-h-12',\n medium: 'min-h-14',\n big: 'min-h-16',\n}\n\nconst SidebarHeader = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(({ className, ...props }, ref) => {\n const { size } = useSidebar()\n\n return (\n <div\n ref={ref}\n data-sidebar=\"header\"\n className={cn('relative flex shrink-0 items-center', SIDEBAR_HEADER[size], className)}\n {...props}\n />\n )\n})\nSidebarHeader.displayName = 'SidebarHeader'\n\nconst SidebarFooter = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(({ className, ...props }, ref) => {\n return <div ref={ref} data-sidebar=\"footer\" className={cn('flex flex-col gap-3', className)} {...props} />\n})\nSidebarFooter.displayName = 'SidebarFooter'\n\nconst SidebarSeparator = React.forwardRef<React.ComponentRef<typeof Separator>, React.ComponentProps<typeof Separator>>(\n ({ className, ...props }, ref) => {\n return (\n <Separator ref={ref} data-sidebar=\"separator\" className={cn('bg-sidebar-border w-auto', className)} {...props} />\n )\n },\n)\nSidebarSeparator.displayName = 'SidebarSeparator'\n\nconst SidebarContent = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"content\"\n className={cn(\n '-my-1 -mr-3 -ml-1 flex min-h-0 flex-1 flex-col gap-3 overflow-x-hidden overflow-y-auto py-1 pl-1 md:mt-[calc(var(--page-padding)-15px)]',\n SCROLLBAR,\n '*:w-[min(100cqw,calc(100%-0.25rem))] *:shrink-0',\n className,\n )}\n {...props}\n />\n )\n})\nSidebarContent.displayName = 'SidebarContent'\n\nconst SidebarGroup = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(({ className, ...props }, ref) => {\n return (\n <div ref={ref} data-sidebar=\"group\" className={cn('relative flex w-full min-w-0 flex-col', className)} {...props} />\n )\n})\nSidebarGroup.displayName = 'SidebarGroup'\n\nconst sidebarGroupLabelVariants = cva(\n [\n 'text-sidebar-foreground/70 ring-sidebar-ring flex shrink-0 items-center rounded-md transition-[margin,opacity] outline-hidden focus-visible:ring-2 [&>svg]:shrink-0 group-data-[state=collapsed]:opacity-0',\n MOTION,\n ].join(' '),\n {\n variants: {\n size: {\n small: 'h-8 pl-1.75 [&>svg]:size-4 group-data-[state=collapsed]:-mt-8',\n medium: 'h-10 pl-2.5 [&>svg]:size-4 group-data-[state=collapsed]:-mt-10',\n big: 'h-12 pl-3 [&>svg]:size-5 group-data-[state=collapsed]:-mt-12',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n)\n\nconst SIDEBAR_GROUP_LABEL_TEXT_VARIANT: Record<SidebarSize, 'label-md' | 'label-lg'> = {\n small: 'label-md',\n medium: 'label-md',\n big: 'label-lg',\n}\n\nconst SidebarGroupLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & { asChild?: boolean; size?: SidebarSize }\n>(({ className, asChild = false, size, children, ...props }, ref) => {\n const Comp = asChild ? Slot : 'div'\n const resolvedSize = useResolvedSize(size)\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"group-label\"\n className={cn(sidebarGroupLabelVariants({ size: resolvedSize }), className)}\n {...props}\n >\n {typeof children === 'string' ? (\n <Typography variant={SIDEBAR_GROUP_LABEL_TEXT_VARIANT[resolvedSize]} color=\"secondary\">\n {children}\n </Typography>\n ) : (\n children\n )}\n </Comp>\n )\n})\nSidebarGroupLabel.displayName = 'SidebarGroupLabel'\n\nconst sidebarGroupActionVariants = cva(\n [\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute flex aspect-square items-center justify-center rounded-md p-0 transition-[opacity,visibility,color,background-color] outline-hidden focus-visible:ring-2 after:absolute after:-inset-2 after:md:hidden group-data-[state=collapsed]:invisible group-data-[state=collapsed]:opacity-0 [&>svg]:shrink-0',\n MOTION,\n ].join(' '),\n {\n variants: {\n size: {\n small: 'top-1.5 right-1.5 w-5 [&>svg]:size-4',\n medium: 'top-2.5 right-1.5 w-5 [&>svg]:size-4',\n big: 'top-3 right-1.5 w-6 [&>svg]:size-5',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n)\n\nconst SidebarGroupAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<'button'> & { asChild?: boolean; size?: SidebarSize }\n>(({ className, asChild = false, size, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n const resolvedSize = useResolvedSize(size)\n\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : 'button'}\n data-sidebar=\"group-action\"\n className={cn(sidebarGroupActionVariants({ size: resolvedSize }), className)}\n {...props}\n />\n )\n})\nSidebarGroupAction.displayName = 'SidebarGroupAction'\n\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} data-sidebar=\"group-content\" className={cn('w-full text-sm', className)} {...props} />\n ),\n)\nSidebarGroupContent.displayName = 'SidebarGroupContent'\n\nexport {\n SidebarRoot,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarHeaderTrigger,\n SidebarInput,\n SidebarLogo,\n SidebarProvider,\n SidebarSeparator,\n SidebarTrigger,\n sidebarGroupActionVariants,\n sidebarGroupLabelVariants,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,IAAA,sBAAA;AACA,IAAA,yBAAA;AACA,IAAA,gBAAA;AACA,IAAA,uBAAA;AACA,IAAA,4BAAA;AAEA,IAAA,qBAAA;CACE,OAAA;CACA,QAAA;CACA,KAAA;AACF;AAGA,IAAA,UAAA,cAAA;CACE,MAAA;CACA,WAAA,QAAA,IAAA,QAAA,mCAAA,MAAA;AACF,CAAA;AAEA,IAAA,kBAAA,QAAA,YAAA,EAAA,cAAA,MAAA,MAAA,UAAA,cAAA,aAAA,OAAA,UAAA,WAAA,OAAA,UAAA,eAAA,cAAA,SAAA,QAAA,GAAA,SAAA,QAAA;CA0BI,MAAA,WAAA,YAAA;CACA,MAAA,CAAA,YAAA,iBAAA,QAAA,SAAA,KAAA;CACA,MAAA,CAAA,SAAA,cAAA,QAAA,SAAA,KAAA;CAEA,MAAA,CAAA,OAAA,YAAA,QAAA,SAAA,WAAA;CACA,MAAA,OAAA,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 import { useResolvedSize, useSidebar } from "./context.js";
|
|
|
10
10
|
import { MARQUEE_FADE_MASK } from "../../../lib/marquee.js";
|
|
11
11
|
import { FADE_TEXT, MOTION, SIDEBAR_FLYOUT_SURFACE } from "./styles.js";
|
|
12
12
|
import { getInputModality } from "../../../lib/inputModality.js";
|
|
13
|
+
import { SLIDING_INDICATOR_VERTICAL, slidingIndicatorProps, useSlidingIndicator } from "../../../lib/useSlidingIndicator.js";
|
|
13
14
|
import { cva } from "class-variance-authority";
|
|
14
15
|
import * as React$1 from "react";
|
|
15
16
|
import { Slot } from "@radix-ui/react-slot";
|
|
@@ -45,13 +46,13 @@ var sidebarMenuButtonVariants = cva([
|
|
|
45
46
|
"disabled:pointer-events-none disabled:opacity-40 aria-disabled:pointer-events-none aria-disabled:opacity-40",
|
|
46
47
|
"group-has-[[data-sidebar=menu-action]]/menu-item:pr-8",
|
|
47
48
|
"data-[active=true]:bg-background-200 data-[active=true]:font-semibold",
|
|
48
|
-
"before:absolute before:top-1/2 before:left-0 before:w-0.75 before:-translate-y-1/2 before:rounded-lg before:bg-primary-950 before:opacity-0 data-[active=true]:before:opacity-100 before:transition-opacity motion-reduce:before:transition-none",
|
|
49
|
+
"before:absolute before:top-1/2 before:left-0 before:w-0.75 before:-translate-y-1/2 before:rounded-lg before:bg-primary-950 before:opacity-0 data-[active=true]:before:opacity-100 before:ease-out-strong before:transition-opacity motion-reduce:before:transition-none",
|
|
49
50
|
"[&>span:last-child]:min-w-0 [&>span:last-child]:flex-1 [&>span:last-child]:overflow-hidden [&>span:last-child]:whitespace-nowrap [&>span:last-child]:mask-[linear-gradient(to_right,transparent,black_var(--fade-left,0px),black_calc(100%-var(--fade-right,1rem)),transparent)] [&>span:last-child]:mask-no-repeat [&>span:last-child]:after:inline-block [&>span:last-child]:after:w-4 [&>span:last-child]:after:content-[\"\"]",
|
|
50
51
|
"[&>svg]:shrink-0"
|
|
51
52
|
].join(" "), {
|
|
52
53
|
variants: {
|
|
53
54
|
variant: {
|
|
54
|
-
"navigation-item": "[&>:not(svg:first-child)]:transition-[opacity,rotate] [&>:not(svg:first-child)]:duration-200 [&>:not(svg:first-child)]:ease-
|
|
55
|
+
"navigation-item": "[&>:not(svg:first-child)]:transition-[opacity,rotate] [&>:not(svg:first-child)]:duration-200 [&>:not(svg:first-child)]:ease-out-strong motion-reduce:[&>:not(svg:first-child)]:duration-0 group-data-[state=collapsed]:pr-0 group-data-[state=collapsed]:[&>:not(svg:first-child)]:opacity-0",
|
|
55
56
|
element: "group-data-[state=collapsed]:p-0"
|
|
56
57
|
},
|
|
57
58
|
size: {
|
|
@@ -209,9 +210,8 @@ var SidebarMenuSkeleton = React$1.forwardRef(({ className, showIcon = false, siz
|
|
|
209
210
|
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
210
211
|
var sidebarMenuSubVariants = cva([
|
|
211
212
|
"border-sidebar-border relative flex min-w-0 flex-col gap-1 border-l-2 pl-2 group-data-[state=collapsed]:hidden",
|
|
212
|
-
"before:bg-primary-950 before:absolute before:top-0 before:-left-0.5 before:h-(--indicator-height) before:w-0.5 before:translate-y-(--indicator-top)
|
|
213
|
-
|
|
214
|
-
"data-[indicator-slide=true]:before:transition-[opacity,translate,height] motion-reduce:before:transition-none"
|
|
213
|
+
"before:bg-primary-950 before:absolute before:top-0 before:-left-0.5 before:h-(--indicator-height) before:w-0.5 before:translate-y-(--indicator-top)",
|
|
214
|
+
SLIDING_INDICATOR_VERTICAL
|
|
215
215
|
].join(" "), {
|
|
216
216
|
variants: { size: {
|
|
217
217
|
small: "ml-3.75",
|
|
@@ -220,56 +220,23 @@ var sidebarMenuSubVariants = cva([
|
|
|
220
220
|
} },
|
|
221
221
|
defaultVariants: { size: "medium" }
|
|
222
222
|
});
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if (!active) return prev?.visible ? {
|
|
232
|
-
...prev,
|
|
233
|
-
visible: false,
|
|
234
|
-
slide: false
|
|
235
|
-
} : prev;
|
|
236
|
-
const { offsetTop: top, offsetHeight: height } = active;
|
|
237
|
-
if (prev?.visible && prev.top === top && prev.height === height) return prev;
|
|
238
|
-
return {
|
|
239
|
-
top,
|
|
240
|
-
height,
|
|
241
|
-
visible: true,
|
|
242
|
-
slide: Boolean(prev?.visible)
|
|
243
|
-
};
|
|
244
|
-
});
|
|
245
|
-
};
|
|
246
|
-
update();
|
|
247
|
-
const mutationObserver = new MutationObserver(update);
|
|
248
|
-
mutationObserver.observe(list, {
|
|
249
|
-
subtree: true,
|
|
250
|
-
childList: true,
|
|
251
|
-
attributes: true,
|
|
252
|
-
attributeFilter: ["data-active"]
|
|
253
|
-
});
|
|
254
|
-
const resizeObserver = new ResizeObserver(update);
|
|
255
|
-
resizeObserver.observe(list);
|
|
256
|
-
return () => {
|
|
257
|
-
mutationObserver.disconnect();
|
|
258
|
-
resizeObserver.disconnect();
|
|
259
|
-
};
|
|
260
|
-
}, [listRef]);
|
|
261
|
-
return indicator;
|
|
262
|
-
}
|
|
223
|
+
var SUB_INDICATOR_OPTIONS = {
|
|
224
|
+
activeSelector: "[data-sidebar=menu-sub-button][data-active=true]",
|
|
225
|
+
stateAttribute: "data-active",
|
|
226
|
+
measure: (active) => ({
|
|
227
|
+
top: active.offsetTop,
|
|
228
|
+
height: active.offsetHeight
|
|
229
|
+
})
|
|
230
|
+
};
|
|
263
231
|
var SidebarMenuSub = React$1.forwardRef(({ className, size, style, ...props }, ref) => {
|
|
264
232
|
const resolvedSize = useResolvedSize(size);
|
|
265
233
|
const listRef = React$1.useRef(null);
|
|
266
234
|
React$1.useImperativeHandle(ref, () => listRef.current, []);
|
|
267
|
-
const indicator =
|
|
235
|
+
const indicator = useSlidingIndicator(listRef, SUB_INDICATOR_OPTIONS);
|
|
268
236
|
return /* @__PURE__ */ jsx("ul", {
|
|
269
237
|
ref: listRef,
|
|
270
238
|
"data-sidebar": "menu-sub",
|
|
271
|
-
|
|
272
|
-
"data-indicator-slide": indicator?.slide,
|
|
239
|
+
...slidingIndicatorProps(indicator),
|
|
273
240
|
className: cn(sidebarMenuSubVariants({ size: resolvedSize }), className),
|
|
274
241
|
style: {
|
|
275
242
|
"--indicator-top": `${indicator?.top ?? 0}px`,
|
|
@@ -420,17 +387,24 @@ var SidebarMenuCollapsible = React$1.forwardRef(({ label, icon, isActive = false
|
|
|
420
387
|
className: "block px-3 pt-3 pb-2 text-neutral-500",
|
|
421
388
|
children: label
|
|
422
389
|
}), /* @__PURE__ */ jsx("ul", {
|
|
423
|
-
className: "flex flex-col [&>li]:rounded-(--surface-item-radius)",
|
|
390
|
+
className: "flex flex-col gap-1 [&>li]:rounded-(--surface-item-radius)",
|
|
424
391
|
children
|
|
425
392
|
})]
|
|
426
393
|
})]
|
|
427
394
|
}), /* @__PURE__ */ jsx(CollapsibleContent, {
|
|
428
|
-
|
|
395
|
+
forceMount: true,
|
|
396
|
+
className: "group/section -mx-1 px-1",
|
|
429
397
|
children: /* @__PURE__ */ jsx("div", {
|
|
430
|
-
className: "
|
|
431
|
-
children: /* @__PURE__ */ jsx(
|
|
432
|
-
className:
|
|
433
|
-
children
|
|
398
|
+
className: cn("grid transition-[grid-template-rows,visibility] group-data-[state=closed]/section:invisible group-data-[state=closed]/section:grid-rows-[0fr] group-data-[state=open]/section:grid-rows-[1fr] motion-reduce:transition-none pointer-coarse:duration-0", MOTION),
|
|
399
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
400
|
+
className: "min-h-0 overflow-hidden",
|
|
401
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
402
|
+
className: "pt-1 pb-0.5",
|
|
403
|
+
children: /* @__PURE__ */ jsx(SidebarMenuSub, {
|
|
404
|
+
className: cn("group-data-[state=collapsed]:flex", "transition-opacity group-data-[state=closed]/section:opacity-0 motion-reduce:transition-none", MOTION),
|
|
405
|
+
children
|
|
406
|
+
})
|
|
407
|
+
})
|
|
434
408
|
})
|
|
435
409
|
})
|
|
436
410
|
})]
|