@greatapps/common 1.1.309 → 1.1.310
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.
|
@@ -27,22 +27,25 @@ function SideBarNavigation({
|
|
|
27
27
|
{
|
|
28
28
|
"data-slot": "sidebar-navigation",
|
|
29
29
|
className: cn(
|
|
30
|
-
"relative hidden flex-col h-screen
|
|
31
|
-
isExpanded ? "
|
|
30
|
+
"relative hidden lg:flex flex-col h-screen border-r border-gray-200 transition-all duration-300 ease-in-out",
|
|
31
|
+
isExpanded ? "w-[273px] p-4" : "w-0 p-0 border-r-0 overflow-hidden",
|
|
32
32
|
className
|
|
33
33
|
),
|
|
34
34
|
...props,
|
|
35
35
|
children: [
|
|
36
|
-
|
|
36
|
+
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
37
37
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
38
38
|
"button",
|
|
39
39
|
{
|
|
40
40
|
onClick: collapse,
|
|
41
|
-
className:
|
|
41
|
+
className: cn(
|
|
42
|
+
"absolute top-[68px] -right-4 size-8 flex items-center justify-center rounded-full border border-gray-200 bg-white hover:bg-gray-100 cursor-pointer transition-all duration-300 z-50",
|
|
43
|
+
isExpanded ? "opacity-100 scale-100" : "opacity-0 scale-0 pointer-events-none"
|
|
44
|
+
),
|
|
42
45
|
children: /* @__PURE__ */ jsx(IconChevronLeft, { size: 16, className: "text-gray-500" })
|
|
43
46
|
}
|
|
44
47
|
) }),
|
|
45
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "Recolher menu" })
|
|
48
|
+
isExpanded && /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: "Recolher menu" })
|
|
46
49
|
] }),
|
|
47
50
|
children
|
|
48
51
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/layouts/SideBarNavigation.tsx"],"sourcesContent":["'use client';\n\nimport * as React from \"react\"\nimport { IconChevronLeft } from '@tabler/icons-react'\nimport { useDesktopSidebarStore } from \"../../store/useDesktopSidebarStore\"\nimport { useMdSidebarStore } from \"../../store/useMdSidebarStore\"\nimport { cn } from \"../../infra/utils/clsx\"\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../ui/overlay/Tooltip\"\n\nfunction SideBarNavigation({\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\">) {\n const { isExpanded, collapse } = useDesktopSidebarStore()\n const collapseMd = useMdSidebarStore((s) => s.collapse)\n\n React.useEffect(() => {\n const mql = window.matchMedia('(min-width: 1351px)')\n const handler = (e: MediaQueryListEvent) => {\n if (e.matches) collapseMd()\n }\n if (mql.matches) collapseMd()\n mql.addEventListener('change', handler)\n return () => mql.removeEventListener('change', handler)\n }, [collapseMd])\n\n return (\n <div\n data-slot=\"sidebar-navigation\"\n className={cn(\n \"relative hidden flex-col h-screen
|
|
1
|
+
{"version":3,"sources":["../../../src/components/layouts/SideBarNavigation.tsx"],"sourcesContent":["'use client';\n\nimport * as React from \"react\"\nimport { IconChevronLeft } from '@tabler/icons-react'\nimport { useDesktopSidebarStore } from \"../../store/useDesktopSidebarStore\"\nimport { useMdSidebarStore } from \"../../store/useMdSidebarStore\"\nimport { cn } from \"../../infra/utils/clsx\"\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../ui/overlay/Tooltip\"\n\nfunction SideBarNavigation({\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\">) {\n const { isExpanded, collapse } = useDesktopSidebarStore()\n const collapseMd = useMdSidebarStore((s) => s.collapse)\n\n React.useEffect(() => {\n const mql = window.matchMedia('(min-width: 1351px)')\n const handler = (e: MediaQueryListEvent) => {\n if (e.matches) collapseMd()\n }\n if (mql.matches) collapseMd()\n mql.addEventListener('change', handler)\n return () => mql.removeEventListener('change', handler)\n }, [collapseMd])\n\n return (\n <div\n data-slot=\"sidebar-navigation\"\n className={cn(\n \"relative hidden lg:flex flex-col h-screen border-r border-gray-200 transition-all duration-300 ease-in-out\",\n isExpanded ? \"w-[273px] p-4\" : \"w-0 p-0 border-r-0 overflow-hidden\",\n className,\n )}\n {...props}\n >\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={collapse}\n className={cn(\n \"absolute top-[68px] -right-4 size-8 flex items-center justify-center rounded-full border border-gray-200 bg-white hover:bg-gray-100 cursor-pointer transition-all duration-300 z-50\",\n isExpanded ? \"opacity-100 scale-100\" : \"opacity-0 scale-0 pointer-events-none\",\n )}\n >\n <IconChevronLeft size={16} className=\"text-gray-500\" />\n </button>\n </TooltipTrigger>\n {isExpanded && <TooltipContent side=\"right\">Recolher menu</TooltipContent>}\n </Tooltip>\n {children}\n </div>\n )\n}\n\nexport { SideBarNavigation };\n"],"mappings":";AAqCY,SASY,KATZ;AAnCZ,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AACvC,SAAS,yBAAyB;AAClC,SAAS,UAAU;AACnB,SAAS,SAAS,gBAAgB,sBAAsB;AAExD,SAAS,kBAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA,GAAG;AACP,GAAgC;AAC5B,QAAM,EAAE,YAAY,SAAS,IAAI,uBAAuB;AACxD,QAAM,aAAa,kBAAkB,CAAC,MAAM,EAAE,QAAQ;AAEtD,QAAM,UAAU,MAAM;AAClB,UAAM,MAAM,OAAO,WAAW,qBAAqB;AACnD,UAAM,UAAU,CAAC,MAA2B;AACxC,UAAI,EAAE,QAAS,YAAW;AAAA,IAC9B;AACA,QAAI,IAAI,QAAS,YAAW;AAC5B,QAAI,iBAAiB,UAAU,OAAO;AACtC,WAAO,MAAM,IAAI,oBAAoB,UAAU,OAAO;AAAA,EAC1D,GAAG,CAAC,UAAU,CAAC;AAEf,SACI;AAAA,IAAC;AAAA;AAAA,MACG,aAAU;AAAA,MACV,WAAW;AAAA,QACP;AAAA,QACA,aAAa,kBAAkB;AAAA,QAC/B;AAAA,MACJ;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,6BAAC,WACG;AAAA,8BAAC,kBAAe,SAAO,MACnB;AAAA,YAAC;AAAA;AAAA,cACG,SAAS;AAAA,cACT,WAAW;AAAA,gBACP;AAAA,gBACA,aAAa,0BAA0B;AAAA,cAC3C;AAAA,cAEA,8BAAC,mBAAgB,MAAM,IAAI,WAAU,iBAAgB;AAAA;AAAA,UACzD,GACJ;AAAA,UACC,cAAc,oBAAC,kBAAe,MAAK,SAAQ,2BAAa;AAAA,WAC7D;AAAA,QACC;AAAA;AAAA;AAAA,EACL;AAER;","names":[]}
|
package/package.json
CHANGED
|
@@ -29,25 +29,26 @@ function SideBarNavigation({
|
|
|
29
29
|
<div
|
|
30
30
|
data-slot="sidebar-navigation"
|
|
31
31
|
className={cn(
|
|
32
|
-
"relative hidden flex-col h-screen
|
|
33
|
-
isExpanded ? "
|
|
32
|
+
"relative hidden lg:flex flex-col h-screen border-r border-gray-200 transition-all duration-300 ease-in-out",
|
|
33
|
+
isExpanded ? "w-[273px] p-4" : "w-0 p-0 border-r-0 overflow-hidden",
|
|
34
34
|
className,
|
|
35
35
|
)}
|
|
36
36
|
{...props}
|
|
37
37
|
>
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</
|
|
50
|
-
|
|
38
|
+
<Tooltip>
|
|
39
|
+
<TooltipTrigger asChild>
|
|
40
|
+
<button
|
|
41
|
+
onClick={collapse}
|
|
42
|
+
className={cn(
|
|
43
|
+
"absolute top-[68px] -right-4 size-8 flex items-center justify-center rounded-full border border-gray-200 bg-white hover:bg-gray-100 cursor-pointer transition-all duration-300 z-50",
|
|
44
|
+
isExpanded ? "opacity-100 scale-100" : "opacity-0 scale-0 pointer-events-none",
|
|
45
|
+
)}
|
|
46
|
+
>
|
|
47
|
+
<IconChevronLeft size={16} className="text-gray-500" />
|
|
48
|
+
</button>
|
|
49
|
+
</TooltipTrigger>
|
|
50
|
+
{isExpanded && <TooltipContent side="right">Recolher menu</TooltipContent>}
|
|
51
|
+
</Tooltip>
|
|
51
52
|
{children}
|
|
52
53
|
</div>
|
|
53
54
|
)
|