@customafk/lunas-ui 0.1.40 → 0.1.41
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/{button-CPSR8ewr.d.mts → button-B47JL9_X.d.cts} +6 -6
- package/dist/{button-DM5NJ-7F.d.cts → button-BVyGOvsM.d.mts} +6 -6
- package/dist/cards/simple-card.d.mts +2 -2
- package/dist/{close-BuQ2DHur.mjs → close-CCf5pMYu.mjs} +1 -1
- package/dist/{close-BuQ2DHur.mjs.map → close-CCf5pMYu.mjs.map} +1 -1
- package/dist/{close-DvsVM8lM.cjs → close-D_Ge7gnP.cjs} +1 -1
- package/dist/{close-DvsVM8lM.cjs.map → close-D_Ge7gnP.cjs.map} +1 -1
- package/dist/{command-BKiAU1oU.mjs → command-CLjGZB-7.mjs} +2 -2
- package/dist/{command-BKiAU1oU.mjs.map → command-CLjGZB-7.mjs.map} +1 -1
- package/dist/{command-BqSzRw6j.cjs → command-D5zGkxau.cjs} +2 -2
- package/dist/{command-BqSzRw6j.cjs.map → command-D5zGkxau.cjs.map} +1 -1
- package/dist/data-display/country.d.mts +1 -1
- package/dist/data-display/role-badge.d.mts +1 -1
- package/dist/data-display/statistic.d.mts +2 -2
- package/dist/{dialog-EzJiDxrJ.d.mts → dialog-B9Dvd4Fh.d.mts} +12 -12
- package/dist/{dialog-bd77jxcu.mjs → dialog-BbNb9Lr8.mjs} +2 -2
- package/dist/{dialog-bd77jxcu.mjs.map → dialog-BbNb9Lr8.mjs.map} +1 -1
- package/dist/{dialog-DVwvHuQB.cjs → dialog-DeIMaQO0.cjs} +2 -2
- package/dist/{dialog-DVwvHuQB.cjs.map → dialog-DeIMaQO0.cjs.map} +1 -1
- package/dist/{dialog-B2-c4OTw.d.cts → dialog-WNb5xgv8.d.cts} +12 -12
- package/dist/dialogs/detail-dialog/components/sidebar.cjs +2 -0
- package/dist/dialogs/detail-dialog/components/sidebar.cjs.map +1 -0
- package/dist/dialogs/detail-dialog/{component/sidebar.d.mts → components/sidebar.d.cts} +30 -35
- package/dist/dialogs/detail-dialog/{component/sidebar.d.cts → components/sidebar.d.mts} +31 -36
- package/dist/dialogs/detail-dialog/components/sidebar.mjs +2 -0
- package/dist/dialogs/detail-dialog/components/sidebar.mjs.map +1 -0
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs.map +1 -1
- package/dist/dialogs/detail-dialog/index.d.cts +9 -8
- package/dist/dialogs/detail-dialog/index.d.mts +9 -8
- package/dist/dialogs/detail-dialog/index.mjs +1 -1
- package/dist/dialogs/detail-dialog/index.mjs.map +1 -1
- package/dist/dialogs/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.mjs +1 -1
- package/dist/{drawer-ClbO_Gt0.mjs → drawer-272Fecsq.mjs} +1 -1
- package/dist/{drawer-ClbO_Gt0.mjs.map → drawer-272Fecsq.mjs.map} +1 -1
- package/dist/{drawer-DluJOnDX.cjs → drawer-y-Yrqskp.cjs} +1 -1
- package/dist/{drawer-DluJOnDX.cjs.map → drawer-y-Yrqskp.cjs.map} +1 -1
- package/dist/{dropdown-menu-DQs_Lvq7.cjs → dropdown-menu-BuyuU6uF.cjs} +1 -1
- package/dist/{dropdown-menu-DQs_Lvq7.cjs.map → dropdown-menu-BuyuU6uF.cjs.map} +1 -1
- package/dist/{dropdown-menu-DPhbyDEo.mjs → dropdown-menu-DsWYP0bL.mjs} +1 -1
- package/dist/{dropdown-menu-DPhbyDEo.mjs.map → dropdown-menu-DsWYP0bL.mjs.map} +1 -1
- package/dist/features/search-modal/index.cjs +1 -1
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/search-modal/index.d.mts +2 -2
- package/dist/features/search-modal/index.mjs +1 -1
- package/dist/features/tables/index.cjs +1 -1
- package/dist/features/tables/index.d.cts +7 -7
- package/dist/features/tables/index.d.mts +7 -7
- package/dist/features/tables/index.mjs +1 -1
- package/dist/features/tables/index.mjs.map +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/{input-LDpzfNmy.d.mts → input-BSE6jQaF.d.mts} +3 -3
- package/dist/{input-C1K2wbv1.mjs → input-DD17n9Bv.mjs} +1 -1
- package/dist/{input-C1K2wbv1.mjs.map → input-DD17n9Bv.mjs.map} +1 -1
- package/dist/{input-CMXa_99w.d.cts → input-Dh7Ny5P9.d.cts} +5 -5
- package/dist/{input-C1BXP8dd.cjs → input-qnlHzDDm.cjs} +1 -1
- package/dist/{input-C1BXP8dd.cjs.map → input-qnlHzDDm.cjs.map} +1 -1
- package/dist/{label-CkTb259R.cjs → label-CaBktIhh.cjs} +1 -1
- package/dist/{label-CkTb259R.cjs.map → label-CaBktIhh.cjs.map} +1 -1
- package/dist/{label-DwmJnk4H.mjs → label-DVfxfyG5.mjs} +1 -1
- package/dist/{label-DwmJnk4H.mjs.map → label-DVfxfyG5.mjs.map} +1 -1
- package/dist/layouts/app-layout/index.cjs +1 -1
- package/dist/layouts/app-layout/index.d.cts +28 -28
- package/dist/layouts/app-layout/index.d.mts +28 -28
- package/dist/layouts/app-layout/index.mjs +1 -1
- package/dist/layouts/cms-layout/index.cjs +1 -1
- package/dist/layouts/cms-layout/index.mjs +1 -1
- package/dist/layouts/flex.d.cts +2 -2
- package/dist/layouts/flex.d.mts +2 -2
- package/dist/layouts/service-layout/index.cjs +1 -1
- package/dist/layouts/service-layout/index.d.cts +13 -13
- package/dist/layouts/service-layout/index.d.mts +15 -15
- package/dist/layouts/service-layout/index.mjs +1 -1
- package/dist/layouts/service-layout/index.mjs.map +1 -1
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.mts +2 -2
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.d.mts +2 -2
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/{resizable-C2-dXaDM.cjs → resizable-BS63Xwia.cjs} +1 -1
- package/dist/{resizable-C2-dXaDM.cjs.map → resizable-BS63Xwia.cjs.map} +1 -1
- package/dist/{resizable-LConLbS6.mjs → resizable-Dp4eTFXj.mjs} +1 -1
- package/dist/{resizable-LConLbS6.mjs.map → resizable-Dp4eTFXj.mjs.map} +1 -1
- package/dist/{scroll-area-6xusEFm6.mjs → scroll-area-CiMS2UY7.mjs} +1 -1
- package/dist/{scroll-area-6xusEFm6.mjs.map → scroll-area-CiMS2UY7.mjs.map} +1 -1
- package/dist/{scroll-area-D61j6n8I.cjs → scroll-area-qE6GqGkn.cjs} +1 -1
- package/dist/{scroll-area-D61j6n8I.cjs.map → scroll-area-qE6GqGkn.cjs.map} +1 -1
- package/dist/{separator-Crr30ZHa.cjs → separator-C3ip6sbh.cjs} +1 -1
- package/dist/{separator-Crr30ZHa.cjs.map → separator-C3ip6sbh.cjs.map} +1 -1
- package/dist/{separator-yTKDuMWb.mjs → separator-CZM2q-Ac.mjs} +1 -1
- package/dist/{separator-yTKDuMWb.mjs.map → separator-CZM2q-Ac.mjs.map} +1 -1
- package/dist/{separator-D9m7b_32.d.mts → separator-D6YkFSv3.d.cts} +3 -3
- package/dist/{separator-HDjiaARy.d.cts → separator-DVJtN08T.d.mts} +3 -3
- package/dist/{sheet-BYKV6xT_.cjs → sheet-5MJRtrfG.cjs} +1 -1
- package/dist/{sheet-BYKV6xT_.cjs.map → sheet-5MJRtrfG.cjs.map} +1 -1
- package/dist/{sheet-BSeiP8S8.mjs → sheet-CUMpo5F_.mjs} +1 -1
- package/dist/{sheet-BSeiP8S8.mjs.map → sheet-CUMpo5F_.mjs.map} +1 -1
- package/dist/{tabs-XrUcxpL1.mjs → tabs-Cjh2jtUZ.mjs} +1 -1
- package/dist/{tabs-XrUcxpL1.mjs.map → tabs-Cjh2jtUZ.mjs.map} +1 -1
- package/dist/{tabs-DldSJjLy.cjs → tabs-DSofRReg.cjs} +1 -1
- package/dist/{tabs-DldSJjLy.cjs.map → tabs-DSofRReg.cjs.map} +1 -1
- package/dist/{tooltip-B5gO2RGs.d.cts → tooltip-CVLw9F2s.d.cts} +6 -6
- package/dist/{tooltip-WI0fJ7gP.d.mts → tooltip-Cu2-ZHAv.d.mts} +6 -6
- package/dist/{types-DWnJKJ5r.d.mts → types-D2kMOc_b.d.mts} +1 -1
- package/dist/typography/paragraph.d.cts +2 -2
- package/dist/typography/paragraph.d.mts +2 -2
- package/dist/typography/title.cjs +2 -1
- package/dist/typography/title.cjs.map +1 -0
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.mts +2 -2
- package/dist/typography/title.mjs +2 -1
- package/dist/typography/title.mjs.map +1 -0
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert.d.cts +7 -7
- package/dist/ui/alert.d.mts +7 -7
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.mts +2 -2
- package/dist/ui/avatar.d.mts +4 -4
- package/dist/ui/badge.d.cts +2 -2
- package/dist/ui/badge.d.mts +4 -4
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/button-group.cjs +1 -1
- package/dist/ui/button-group.d.cts +5 -5
- package/dist/ui/button-group.d.mts +7 -7
- package/dist/ui/button-group.mjs +1 -1
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.mts +4 -4
- package/dist/ui/command.cjs +1 -1
- package/dist/ui/command.d.cts +11 -11
- package/dist/ui/command.d.mts +11 -11
- package/dist/ui/command.mjs +1 -1
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.mts +16 -16
- package/dist/ui/dialog.cjs +1 -1
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.mts +1 -1
- package/dist/ui/dialog.mjs +1 -1
- package/dist/ui/drawer.cjs +1 -1
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.mts +11 -11
- package/dist/ui/drawer.mjs +1 -1
- package/dist/ui/dropdown-menu.cjs +1 -1
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/dropdown-menu.mjs +1 -1
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.mts +7 -7
- package/dist/ui/field.cjs +1 -1
- package/dist/ui/field.d.cts +24 -24
- package/dist/ui/field.d.mts +11 -11
- package/dist/ui/field.mjs +1 -1
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/form.cjs +1 -1
- package/dist/ui/form.d.cts +11 -11
- package/dist/ui/form.d.mts +7 -7
- package/dist/ui/form.mjs +1 -1
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.mts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.mts +5 -5
- package/dist/ui/input.cjs +1 -1
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/input.mjs +1 -1
- package/dist/ui/inputs/search-input.cjs +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.mts +3 -3
- package/dist/ui/inputs/search-input.mjs +1 -1
- package/dist/ui/item.cjs +1 -1
- package/dist/ui/item.d.cts +15 -15
- package/dist/ui/item.d.mts +12 -12
- package/dist/ui/item.mjs +1 -1
- package/dist/ui/label.cjs +1 -1
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/label.mjs +1 -1
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.mts +17 -17
- package/dist/ui/multi-select.cjs +1 -1
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.mts +1 -1
- package/dist/ui/multi-select.mjs +1 -1
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.mts +9 -9
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/popover.d.cts +5 -5
- package/dist/ui/popover.d.mts +5 -5
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/resizable.cjs +1 -1
- package/dist/ui/resizable.d.cts +4 -4
- package/dist/ui/resizable.d.mts +4 -4
- package/dist/ui/resizable.mjs +1 -1
- package/dist/ui/scroll-area.cjs +1 -1
- package/dist/ui/scroll-area.d.cts +3 -3
- package/dist/ui/scroll-area.d.mts +3 -3
- package/dist/ui/scroll-area.mjs +1 -1
- package/dist/ui/select.d.cts +11 -11
- package/dist/ui/select.d.mts +11 -11
- package/dist/ui/separator.cjs +1 -1
- package/dist/ui/separator.d.cts +1 -1
- package/dist/ui/separator.d.mts +1 -1
- package/dist/ui/separator.mjs +1 -1
- package/dist/ui/sheet.cjs +1 -1
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.mts +9 -9
- package/dist/ui/sheet.mjs +1 -1
- package/dist/ui/sidebar.cjs +1 -1
- package/dist/ui/sidebar.d.cts +28 -28
- package/dist/ui/sidebar.d.mts +28 -28
- package/dist/ui/sidebar.mjs +1 -1
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.mts +2 -2
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.mts +2 -2
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.mts +2 -2
- package/dist/ui/spinner.d.cts +2 -2
- package/dist/ui/spinner.d.mts +2 -2
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.mts +2 -2
- package/dist/ui/table.d.cts +18 -18
- package/dist/ui/table.d.mts +9 -9
- package/dist/ui/tabs.cjs +1 -1
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.mts +5 -5
- package/dist/ui/tabs.mjs +1 -1
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/toggle-group.d.cts +3 -3
- package/dist/ui/toggle-group.d.mts +3 -3
- package/dist/ui/toggle.d.cts +4 -4
- package/dist/ui/toggle.d.mts +2 -2
- package/dist/ui/tooltip.d.cts +1 -1
- package/dist/ui/tooltip.d.mts +1 -1
- package/package.json +1 -1
- package/dist/dialogs/detail-dialog/component/sidebar.cjs +0 -2
- package/dist/dialogs/detail-dialog/component/sidebar.cjs.map +0 -1
- package/dist/dialogs/detail-dialog/component/sidebar.mjs +0 -2
- package/dist/dialogs/detail-dialog/component/sidebar.mjs.map +0 -1
- package/dist/title-BK1YcXjX.mjs +0 -2
- package/dist/title-BK1YcXjX.mjs.map +0 -1
- package/dist/title-BNv6aAfA.cjs +0 -2
- package/dist/title-BNv6aAfA.cjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../button.variants-C--cfyfH.cjs`);const t=require(`../../button-DtFiUaY7.cjs`),n=require(`../../skeleton-C4suljHP.cjs`),r=require(`../../tooltip-BimfNium.cjs`),i=require(`../../separator-Crr30ZHa.cjs`),a=require(`../../sheet-BYKV6xT_.cjs`);let o=require(`@customafk/react-toolkit/utils`),s=require(`react/jsx-runtime`),c=require(`lucide-react`),l=require(`react`),u=require(`class-variance-authority`),d=require(`radix-ui`),f=require(`@customafk/react-toolkit/hooks/useMobile`);const p=`sidebar_state`,m=3600*24*7,h=`16rem`,g=`16rem`,_=`3rem`,v=`b`,y=(0,l.createContext)(null);function b(){let e=(0,l.use)(y);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function x({defaultOpen:e=!0,open:t,onOpenChange:n,className:i,style:a,children:c,...u}){let d=(0,f.useIsMobile)(),[p,m]=(0,l.useState)(!1),[h,g]=(0,l.useState)(e),_=t??h,v=(0,l.useCallback)(e=>{let t=typeof e==`function`?e(_):e;n?n(t):g(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,_]),b=(0,l.useCallback)(()=>d?m(e=>!e):v(e=>!e),[d,v,m]);(0,l.useEffect)(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),b())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b]);let x=_?`expanded`:`collapsed`,S=(0,l.useMemo)(()=>({state:x,isMobile:d,toggleSidebar:b,open:_,setOpen:v,openMobile:p,setOpenMobile:m}),[x,_,v,d,p,m,b]);return(0,s.jsx)(y.Provider,{value:S,children:(0,s.jsx)(r.r,{delayDuration:0,children:(0,s.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:(0,o.cn)(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex h-dvh w-full`,i),...u,children:c})})})}function S({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...l}){let{isMobile:u,state:d,openMobile:f,setOpenMobile:p}=b();return n===`none`?(0,s.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,o.cn)(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,r),...l,children:i}):u?(0,s.jsx)(a.t,{open:f,onOpenChange:p,...l,children:(0,s.jsxs)(a.r,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden`,style:{"--sidebar-width":`16rem`},side:e,children:[(0,s.jsxs)(a.o,{className:`sr-only`,children:[(0,s.jsx)(a.s,{children:`Sidebar`}),(0,s.jsx)(a.i,{children:`Displays the mobile sidebar.`})]}),(0,s.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,s.jsxs)(`div`,{className:`border-border-weak flex items-center gap-x-2 border-b p-2 pr-4`,children:[(0,s.jsx)(C,{}),(0,s.jsx)(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground ml-2 flex aspect-square size-8 items-center justify-center rounded-lg`,children:(0,s.jsx)(c.ShoppingCartIcon,{size:20})}),(0,s.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,s.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,s.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),i]})]})}):(0,s.jsxs)(`aside`,{className:`group peer text-sidebar-foreground bg-card hidden md:block`,"data-state":d,"data-collapsible":d===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,s.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,o.cn)(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height) + 0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,s.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,o.cn)(`hidden md:flex`,`shadow-nav fixed inset-y-0 top-14 z-10`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...l,children:(0,s.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,o.cn)(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:i})})]})}function C({className:e,onClick:n,...r}){let{toggleSidebar:i}=b();return(0,s.jsxs)(t.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,o.cn)(`size-10 rounded-full`,e),onClick:e=>{n?.(e),i()},...r,children:[(0,s.jsx)(c.MenuIcon,{className:`!size-6`}),(0,s.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function w({className:e,...t}){let{toggleSidebar:n}=b();return(0,s.jsx)(`button`,{"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:n,title:`Toggle Sidebar`,className:(0,o.cn)(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear sm:flex`,`after:absolute after:inset-y-0 after:left-1/2 after:w-[2px]`,`group-data-[side=left]:-right-4`,`group-data-[side=right]:left-0`,`in-data-[side=left]:cursor-w-resize`,`in-data-[side=right]:cursor-e-resize`,`hover:after:bg-sidebar-border`,`hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`group-data-[collapsible=offcanvas]:translate-x-0`,`group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize`,`[[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})}function T({className:e,children:t,...n}){return(0,s.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,o.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,s.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)_+_0.5rem)]`}),(0,s.jsx)(`div`,{className:(0,o.cn)(`flex-1 inset-shadow-sm`),children:t})]})}function E({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:(0,o.cn)(`flex flex-col gap-2 p-2`,e),...t})}function D({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,o.cn)(`flex flex-col gap-2 p-2`,e),...t})}function O({className:e,...t}){return(0,s.jsx)(i.t,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:(0,o.cn)(`bg-sidebar-border mx-2 w-auto`,e),...t})}function k({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,o.cn)(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function A({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,o.cn)(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function j({className:e,asChild:t=!1,...n}){return(0,s.jsx)(t?d.Slot.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,o.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2`,`text-sidebar-foreground/70`,`ring-sidebar-ring`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function M({className:e,asChild:t=!1,...n}){return(0,s.jsx)(t?d.Slot.Slot:`button`,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:(0,o.cn)(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n})}function N({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,o.cn)(`w-full text-sm`,e),...t})}function P({className:e,...t}){return(0,s.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,o.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function F({className:e,...t}){return(0,s.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,o.cn)(`group/menu-item relative`,e),...t})}const I=(0,u.cva)([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`text-left truncate`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:font-medium`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-8!`,`group-data-[collapsible=icon]:p-2!`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function L({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:i=`default`,tooltip:a,className:c,...l}){let u=e?d.Slot.Slot:`button`,{isMobile:f,state:p}=b(),m=(0,s.jsx)(u,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":i,"data-active":t,className:(0,o.cn)(I({variant:n,size:i}),c),...l});return a?(typeof a==`string`&&(a={children:a}),(0,s.jsxs)(r.t,{children:[(0,s.jsx)(r.i,{asChild:!0,children:m}),(0,s.jsx)(r.n,{side:`right`,align:`center`,hidden:p!==`collapsed`||f,...a})]})):m}function R({className:e,asChild:t=!1,showOnHover:n=!1,...r}){return(0,s.jsx)(t?d.Slot.Slot:`button`,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:(0,o.cn)(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,n&&`group-focus-within/menu-item:opacity-100`,n&&`group-hover/menu-item:opacity-100`,n&&`data-[state=open]:opacity-100 md:opacity-0`,e),...r})}function z({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:(0,o.cn)(`text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none`,`peer-hover/menu-button:text-sidebar-accent-foreground`,`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function B({className:e,showIcon:t=!1,...r}){let i=(0,l.useMemo)(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,s.jsxs)(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:(0,o.cn)(`flex h-8 items-center gap-2 rounded-md px-2`,e),...r,children:[t&&(0,s.jsx)(n.t,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,s.jsx)(n.t,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})}function V({className:e,...t}){return(0,s.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:(0,o.cn)(`border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function H({className:e,...t}){return(0,s.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:(0,o.cn)(`group/menu-sub-item relative`,e),...t})}function U({asChild:e=!1,size:t=`md`,isActive:n=!1,className:r,...i}){return(0,s.jsx)(e?d.Slot.Slot:`a`,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:(0,o.cn)(`text-sidebar-foreground`,`ring-sidebar-ring`,`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden`,`focus-visible:ring-2`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>svg]:text-sidebar-accent-foreground`,`[&>span:last-child]:truncate`,`data-[active=true]:bg-sidebar-accent`,`data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,r),...i})}const W=({children:e})=>(0,s.jsx)(x,{children:e}),G=({children:e})=>(0,s.jsxs)(`header`,{className:(0,o.cn)(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`,`group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)`,`sm:group-has-data-[collapsible=icon]/sidebar-wrapper:h-[calc(var(--header-height)+0.5rem)]`),children:[(0,s.jsx)(C,{}),(0,s.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,s.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,s.jsx)(c.ShoppingCartIcon,{size:20})}),(0,s.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,s.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,s.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,s.jsx)(`div`,{className:`flex flex-1 items-center justify-end`,children:e})]}),K=({children:e,...t})=>(0,s.jsx)(S,{variant:`inset`,collapsible:`icon`,...t,children:e}),q=({children:e})=>(0,s.jsx)(T,{children:(0,s.jsx)(`section`,{className:`relative size-full`,children:(0,s.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}),J=({className:e,children:t})=>(0,s.jsx)(`div`,{"data-slot":`main-header`,className:(0,o.cn)(`flex-0`,e),children:t}),Y=({className:e,children:t})=>(0,s.jsx)(`div`,{"data-slot":`main-content`,className:(0,o.cn)(`flex w-full flex-1 flex-col gap-4 overflow-y-auto px-2 sm:px-4`,e),children:t}),X=({className:e,children:t})=>(0,s.jsx)(`div`,{"data-slot":`main-footer`,className:(0,o.cn)(`border-border-weak hidden w-full flex-0 border-t pt-2 sm:flex`,e),children:t}),Z=({children:e,className:t})=>(0,s.jsx)(`div`,{"data-slot":`main-group`,className:(0,o.cn)(`flex size-full flex-col gap-4`,t),children:e}),Q=({className:e,children:t})=>(0,s.jsx)(`div`,{"data-slot":`main-group-content`,className:(0,o.cn)(`bg-card shadow-card size-full max-w-5xl flex-1 snap-start snap-always scroll-mt-4 rounded-md p-4`,e),children:t});exports.AppLayoutHeader=G,exports.AppLayoutMain=q,exports.AppLayoutMainContent=Y,exports.AppLayoutMainFooter=X,exports.AppLayoutMainGroup=Z,exports.AppLayoutMainGroupContent=Q,exports.AppLayoutMainHeader=J,exports.AppLayoutSidebar=K,exports.AppLayoutSidebarContent=k,exports.AppLayoutSidebarFooter=D,exports.AppLayoutSidebarGroup=A,exports.AppLayoutSidebarGroupAction=M,exports.AppLayoutSidebarGroupContent=N,exports.AppLayoutSidebarGroupLabel=j,exports.AppLayoutSidebarHeader=E,exports.AppLayoutSidebarInset=T,exports.AppLayoutSidebarMenu=P,exports.AppLayoutSidebarMenuAction=R,exports.AppLayoutSidebarMenuBadge=z,exports.AppLayoutSidebarMenuButton=L,exports.AppLayoutSidebarMenuItem=F,exports.AppLayoutSidebarMenuSkeleton=B,exports.AppLayoutSidebarMenuSub=V,exports.AppLayoutSidebarMenuSubButton=U,exports.AppLayoutSidebarMenuSubItem=H,exports.AppLayoutSidebarRail=w,exports.AppLayoutSidebarSeparator=O,exports.AppLayoutSidebarTrigger=C,exports.AppLayoutWrapper=W,exports.Sidebar=S,exports.SidebarProvider=x,exports.useSidebar=b;
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../button.variants-C--cfyfH.cjs`);const t=require(`../../button-DtFiUaY7.cjs`),n=require(`../../skeleton-C4suljHP.cjs`),r=require(`../../tooltip-BimfNium.cjs`),i=require(`../../separator-C3ip6sbh.cjs`),a=require(`../../sheet-5MJRtrfG.cjs`);let o=require(`@customafk/react-toolkit/utils`),s=require(`react/jsx-runtime`),c=require(`lucide-react`),l=require(`react`),u=require(`class-variance-authority`),d=require(`radix-ui`),f=require(`@customafk/react-toolkit/hooks/useMobile`);const p=`sidebar_state`,m=3600*24*7,h=`16rem`,g=`16rem`,_=`3rem`,v=`b`,y=(0,l.createContext)(null);function b(){let e=(0,l.use)(y);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function x({defaultOpen:e=!0,open:t,onOpenChange:n,className:i,style:a,children:c,...u}){let d=(0,f.useIsMobile)(),[p,m]=(0,l.useState)(!1),[h,g]=(0,l.useState)(e),_=t??h,v=(0,l.useCallback)(e=>{let t=typeof e==`function`?e(_):e;n?n(t):g(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,_]),b=(0,l.useCallback)(()=>d?m(e=>!e):v(e=>!e),[d,v,m]);(0,l.useEffect)(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),b())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b]);let x=_?`expanded`:`collapsed`,S=(0,l.useMemo)(()=>({state:x,isMobile:d,toggleSidebar:b,open:_,setOpen:v,openMobile:p,setOpenMobile:m}),[x,_,v,d,p,m,b]);return(0,s.jsx)(y.Provider,{value:S,children:(0,s.jsx)(r.r,{delayDuration:0,children:(0,s.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:(0,o.cn)(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex h-dvh w-full`,i),...u,children:c})})})}function S({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...l}){let{isMobile:u,state:d,openMobile:f,setOpenMobile:p}=b();return n===`none`?(0,s.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,o.cn)(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,r),...l,children:i}):u?(0,s.jsx)(a.t,{open:f,onOpenChange:p,...l,children:(0,s.jsxs)(a.r,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden`,style:{"--sidebar-width":`16rem`},side:e,children:[(0,s.jsxs)(a.o,{className:`sr-only`,children:[(0,s.jsx)(a.s,{children:`Sidebar`}),(0,s.jsx)(a.i,{children:`Displays the mobile sidebar.`})]}),(0,s.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,s.jsxs)(`div`,{className:`border-border-weak flex items-center gap-x-2 border-b p-2 pr-4`,children:[(0,s.jsx)(C,{}),(0,s.jsx)(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground ml-2 flex aspect-square size-8 items-center justify-center rounded-lg`,children:(0,s.jsx)(c.ShoppingCartIcon,{size:20})}),(0,s.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,s.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,s.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),i]})]})}):(0,s.jsxs)(`aside`,{className:`group peer text-sidebar-foreground bg-card hidden md:block`,"data-state":d,"data-collapsible":d===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,s.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,o.cn)(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height) + 0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,s.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,o.cn)(`hidden md:flex`,`shadow-nav fixed inset-y-0 top-14 z-10`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...l,children:(0,s.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,o.cn)(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:i})})]})}function C({className:e,onClick:n,...r}){let{toggleSidebar:i}=b();return(0,s.jsxs)(t.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,o.cn)(`size-10 rounded-full`,e),onClick:e=>{n?.(e),i()},...r,children:[(0,s.jsx)(c.MenuIcon,{className:`!size-6`}),(0,s.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function w({className:e,...t}){let{toggleSidebar:n}=b();return(0,s.jsx)(`button`,{"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:n,title:`Toggle Sidebar`,className:(0,o.cn)(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear sm:flex`,`after:absolute after:inset-y-0 after:left-1/2 after:w-[2px]`,`group-data-[side=left]:-right-4`,`group-data-[side=right]:left-0`,`in-data-[side=left]:cursor-w-resize`,`in-data-[side=right]:cursor-e-resize`,`hover:after:bg-sidebar-border`,`hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`group-data-[collapsible=offcanvas]:translate-x-0`,`group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize`,`[[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})}function T({className:e,children:t,...n}){return(0,s.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,o.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,s.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)_+_0.5rem)]`}),(0,s.jsx)(`div`,{className:(0,o.cn)(`flex-1 inset-shadow-sm`),children:t})]})}function E({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:(0,o.cn)(`flex flex-col gap-2 p-2`,e),...t})}function D({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,o.cn)(`flex flex-col gap-2 p-2`,e),...t})}function O({className:e,...t}){return(0,s.jsx)(i.t,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:(0,o.cn)(`bg-sidebar-border mx-2 w-auto`,e),...t})}function k({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,o.cn)(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function A({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,o.cn)(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function j({className:e,asChild:t=!1,...n}){return(0,s.jsx)(t?d.Slot.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,o.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2`,`text-sidebar-foreground/70`,`ring-sidebar-ring`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function M({className:e,asChild:t=!1,...n}){return(0,s.jsx)(t?d.Slot.Slot:`button`,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:(0,o.cn)(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n})}function N({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,o.cn)(`w-full text-sm`,e),...t})}function P({className:e,...t}){return(0,s.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,o.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function F({className:e,...t}){return(0,s.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,o.cn)(`group/menu-item relative`,e),...t})}const I=(0,u.cva)([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`text-left truncate`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:font-medium`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-8!`,`group-data-[collapsible=icon]:p-2!`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function L({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:i=`default`,tooltip:a,className:c,...l}){let u=e?d.Slot.Slot:`button`,{isMobile:f,state:p}=b(),m=(0,s.jsx)(u,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":i,"data-active":t,className:(0,o.cn)(I({variant:n,size:i}),c),...l});return a?(typeof a==`string`&&(a={children:a}),(0,s.jsxs)(r.t,{children:[(0,s.jsx)(r.i,{asChild:!0,children:m}),(0,s.jsx)(r.n,{side:`right`,align:`center`,hidden:p!==`collapsed`||f,...a})]})):m}function R({className:e,asChild:t=!1,showOnHover:n=!1,...r}){return(0,s.jsx)(t?d.Slot.Slot:`button`,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:(0,o.cn)(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,n&&`group-focus-within/menu-item:opacity-100`,n&&`group-hover/menu-item:opacity-100`,n&&`data-[state=open]:opacity-100 md:opacity-0`,e),...r})}function z({className:e,...t}){return(0,s.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:(0,o.cn)(`text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none`,`peer-hover/menu-button:text-sidebar-accent-foreground`,`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function B({className:e,showIcon:t=!1,...r}){let i=(0,l.useMemo)(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,s.jsxs)(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:(0,o.cn)(`flex h-8 items-center gap-2 rounded-md px-2`,e),...r,children:[t&&(0,s.jsx)(n.t,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,s.jsx)(n.t,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})}function V({className:e,...t}){return(0,s.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:(0,o.cn)(`border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function H({className:e,...t}){return(0,s.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:(0,o.cn)(`group/menu-sub-item relative`,e),...t})}function U({asChild:e=!1,size:t=`md`,isActive:n=!1,className:r,...i}){return(0,s.jsx)(e?d.Slot.Slot:`a`,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:(0,o.cn)(`text-sidebar-foreground`,`ring-sidebar-ring`,`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden`,`focus-visible:ring-2`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>svg]:text-sidebar-accent-foreground`,`[&>span:last-child]:truncate`,`data-[active=true]:bg-sidebar-accent`,`data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,r),...i})}const W=({children:e})=>(0,s.jsx)(x,{children:e}),G=({children:e})=>(0,s.jsxs)(`header`,{className:(0,o.cn)(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`,`group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)`,`sm:group-has-data-[collapsible=icon]/sidebar-wrapper:h-[calc(var(--header-height)+0.5rem)]`),children:[(0,s.jsx)(C,{}),(0,s.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,s.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,s.jsx)(c.ShoppingCartIcon,{size:20})}),(0,s.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,s.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,s.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,s.jsx)(`div`,{className:`flex flex-1 items-center justify-end`,children:e})]}),K=({children:e,...t})=>(0,s.jsx)(S,{variant:`inset`,collapsible:`icon`,...t,children:e}),q=({children:e})=>(0,s.jsx)(T,{children:(0,s.jsx)(`section`,{className:`relative size-full`,children:(0,s.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}),J=({className:e,children:t})=>(0,s.jsx)(`div`,{"data-slot":`main-header`,className:(0,o.cn)(`flex-0`,e),children:t}),Y=({className:e,children:t})=>(0,s.jsx)(`div`,{"data-slot":`main-content`,className:(0,o.cn)(`flex w-full flex-1 flex-col gap-4 overflow-y-auto px-2 sm:px-4`,e),children:t}),X=({className:e,children:t})=>(0,s.jsx)(`div`,{"data-slot":`main-footer`,className:(0,o.cn)(`border-border-weak hidden w-full flex-0 border-t pt-2 sm:flex`,e),children:t}),Z=({children:e,className:t})=>(0,s.jsx)(`div`,{"data-slot":`main-group`,className:(0,o.cn)(`flex size-full flex-col gap-4`,t),children:e}),Q=({className:e,children:t})=>(0,s.jsx)(`div`,{"data-slot":`main-group-content`,className:(0,o.cn)(`bg-card shadow-card size-full max-w-5xl flex-1 snap-start snap-always scroll-mt-4 rounded-md p-4`,e),children:t});exports.AppLayoutHeader=G,exports.AppLayoutMain=q,exports.AppLayoutMainContent=Y,exports.AppLayoutMainFooter=X,exports.AppLayoutMainGroup=Z,exports.AppLayoutMainGroupContent=Q,exports.AppLayoutMainHeader=J,exports.AppLayoutSidebar=K,exports.AppLayoutSidebarContent=k,exports.AppLayoutSidebarFooter=D,exports.AppLayoutSidebarGroup=A,exports.AppLayoutSidebarGroupAction=M,exports.AppLayoutSidebarGroupContent=N,exports.AppLayoutSidebarGroupLabel=j,exports.AppLayoutSidebarHeader=E,exports.AppLayoutSidebarInset=T,exports.AppLayoutSidebarMenu=P,exports.AppLayoutSidebarMenuAction=R,exports.AppLayoutSidebarMenuBadge=z,exports.AppLayoutSidebarMenuButton=L,exports.AppLayoutSidebarMenuItem=F,exports.AppLayoutSidebarMenuSkeleton=B,exports.AppLayoutSidebarMenuSub=V,exports.AppLayoutSidebarMenuSubButton=U,exports.AppLayoutSidebarMenuSubItem=H,exports.AppLayoutSidebarRail=w,exports.AppLayoutSidebarSeparator=O,exports.AppLayoutSidebarTrigger=C,exports.AppLayoutWrapper=W,exports.Sidebar=S,exports.SidebarProvider=x,exports.useSidebar=b;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as Button } from "../../button-
|
|
2
|
-
import { t as Separator } from "../../separator-
|
|
3
|
-
import { n as TooltipContent } from "../../tooltip-
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
1
|
+
import { t as Button } from "../../button-B47JL9_X.cjs";
|
|
2
|
+
import { t as Separator } from "../../separator-D6YkFSv3.cjs";
|
|
3
|
+
import { n as TooltipContent } from "../../tooltip-CVLw9F2s.cjs";
|
|
4
|
+
import * as react_jsx_runtime291 from "react/jsx-runtime";
|
|
5
|
+
import * as class_variance_authority_types11 from "class-variance-authority/types";
|
|
6
6
|
import { VariantProps } from "class-variance-authority";
|
|
7
7
|
|
|
8
8
|
//#region packages/components/layouts/app-layout/sidebar.d.ts
|
|
@@ -28,7 +28,7 @@ declare function SidebarProvider({
|
|
|
28
28
|
defaultOpen?: boolean;
|
|
29
29
|
open?: boolean;
|
|
30
30
|
onOpenChange?: (open: boolean) => void;
|
|
31
|
-
}):
|
|
31
|
+
}): react_jsx_runtime291.JSX.Element;
|
|
32
32
|
declare function Sidebar({
|
|
33
33
|
side,
|
|
34
34
|
variant,
|
|
@@ -40,71 +40,71 @@ declare function Sidebar({
|
|
|
40
40
|
side?: 'left' | 'right';
|
|
41
41
|
variant?: 'sidebar' | 'floating' | 'inset';
|
|
42
42
|
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
43
|
-
}):
|
|
43
|
+
}): react_jsx_runtime291.JSX.Element;
|
|
44
44
|
declare function AppLayoutSidebarTrigger({
|
|
45
45
|
className,
|
|
46
46
|
onClick,
|
|
47
47
|
...props
|
|
48
|
-
}: React.ComponentProps<typeof Button>):
|
|
48
|
+
}: React.ComponentProps<typeof Button>): react_jsx_runtime291.JSX.Element;
|
|
49
49
|
declare function AppLayoutSidebarRail({
|
|
50
50
|
className,
|
|
51
51
|
...props
|
|
52
|
-
}: React.ComponentProps<'button'>):
|
|
52
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime291.JSX.Element;
|
|
53
53
|
declare function AppLayoutSidebarInset({
|
|
54
54
|
className,
|
|
55
55
|
children,
|
|
56
56
|
...props
|
|
57
|
-
}: React.ComponentProps<'main'>):
|
|
57
|
+
}: React.ComponentProps<'main'>): react_jsx_runtime291.JSX.Element;
|
|
58
58
|
declare function AppLayoutSidebarHeader({
|
|
59
59
|
className,
|
|
60
60
|
...props
|
|
61
|
-
}: React.ComponentProps<'div'>):
|
|
61
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime291.JSX.Element;
|
|
62
62
|
declare function AppLayoutSidebarFooter({
|
|
63
63
|
className,
|
|
64
64
|
...props
|
|
65
|
-
}: React.ComponentProps<'div'>):
|
|
65
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime291.JSX.Element;
|
|
66
66
|
declare function AppLayoutSidebarSeparator({
|
|
67
67
|
className,
|
|
68
68
|
...props
|
|
69
|
-
}: React.ComponentProps<typeof Separator>):
|
|
69
|
+
}: React.ComponentProps<typeof Separator>): react_jsx_runtime291.JSX.Element;
|
|
70
70
|
declare function AppLayoutSidebarContent({
|
|
71
71
|
className,
|
|
72
72
|
...props
|
|
73
|
-
}: React.ComponentProps<'div'>):
|
|
73
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime291.JSX.Element;
|
|
74
74
|
declare function AppLayoutSidebarGroup({
|
|
75
75
|
className,
|
|
76
76
|
...props
|
|
77
|
-
}: React.ComponentProps<'div'>):
|
|
77
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime291.JSX.Element;
|
|
78
78
|
declare function AppLayoutSidebarGroupLabel({
|
|
79
79
|
className,
|
|
80
80
|
asChild,
|
|
81
81
|
...props
|
|
82
82
|
}: React.ComponentProps<'div'> & {
|
|
83
83
|
asChild?: boolean;
|
|
84
|
-
}):
|
|
84
|
+
}): react_jsx_runtime291.JSX.Element;
|
|
85
85
|
declare function AppLayoutSidebarGroupAction({
|
|
86
86
|
className,
|
|
87
87
|
asChild,
|
|
88
88
|
...props
|
|
89
89
|
}: React.ComponentProps<'button'> & {
|
|
90
90
|
asChild?: boolean;
|
|
91
|
-
}):
|
|
91
|
+
}): react_jsx_runtime291.JSX.Element;
|
|
92
92
|
declare function AppLayoutSidebarGroupContent({
|
|
93
93
|
className,
|
|
94
94
|
...props
|
|
95
|
-
}: React.ComponentProps<'div'>):
|
|
95
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime291.JSX.Element;
|
|
96
96
|
declare function AppLayoutSidebarMenu({
|
|
97
97
|
className,
|
|
98
98
|
...props
|
|
99
|
-
}: React.ComponentProps<'ul'>):
|
|
99
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime291.JSX.Element;
|
|
100
100
|
declare function AppLayoutSidebarMenuItem({
|
|
101
101
|
className,
|
|
102
102
|
...props
|
|
103
|
-
}: React.ComponentProps<'li'>):
|
|
103
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime291.JSX.Element;
|
|
104
104
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
105
105
|
variant?: "default" | "outline" | null | undefined;
|
|
106
106
|
size?: "sm" | "lg" | "default" | null | undefined;
|
|
107
|
-
} &
|
|
107
|
+
} & class_variance_authority_types11.ClassProp) | undefined) => string;
|
|
108
108
|
declare function AppLayoutSidebarMenuButton({
|
|
109
109
|
asChild,
|
|
110
110
|
isActive,
|
|
@@ -117,7 +117,7 @@ declare function AppLayoutSidebarMenuButton({
|
|
|
117
117
|
asChild?: boolean;
|
|
118
118
|
isActive?: boolean;
|
|
119
119
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
120
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>):
|
|
120
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime291.JSX.Element;
|
|
121
121
|
declare function AppLayoutSidebarMenuAction({
|
|
122
122
|
className,
|
|
123
123
|
asChild,
|
|
@@ -126,26 +126,26 @@ declare function AppLayoutSidebarMenuAction({
|
|
|
126
126
|
}: React.ComponentProps<'button'> & {
|
|
127
127
|
asChild?: boolean;
|
|
128
128
|
showOnHover?: boolean;
|
|
129
|
-
}):
|
|
129
|
+
}): react_jsx_runtime291.JSX.Element;
|
|
130
130
|
declare function AppLayoutSidebarMenuBadge({
|
|
131
131
|
className,
|
|
132
132
|
...props
|
|
133
|
-
}: React.ComponentProps<'div'>):
|
|
133
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime291.JSX.Element;
|
|
134
134
|
declare function AppLayoutSidebarMenuSkeleton({
|
|
135
135
|
className,
|
|
136
136
|
showIcon,
|
|
137
137
|
...props
|
|
138
138
|
}: React.ComponentProps<'div'> & {
|
|
139
139
|
showIcon?: boolean;
|
|
140
|
-
}):
|
|
140
|
+
}): react_jsx_runtime291.JSX.Element;
|
|
141
141
|
declare function AppLayoutSidebarMenuSub({
|
|
142
142
|
className,
|
|
143
143
|
...props
|
|
144
|
-
}: React.ComponentProps<'ul'>):
|
|
144
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime291.JSX.Element;
|
|
145
145
|
declare function AppLayoutSidebarMenuSubItem({
|
|
146
146
|
className,
|
|
147
147
|
...props
|
|
148
|
-
}: React.ComponentProps<'li'>):
|
|
148
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime291.JSX.Element;
|
|
149
149
|
declare function AppLayoutSidebarMenuSubButton({
|
|
150
150
|
asChild,
|
|
151
151
|
size,
|
|
@@ -156,7 +156,7 @@ declare function AppLayoutSidebarMenuSubButton({
|
|
|
156
156
|
asChild?: boolean;
|
|
157
157
|
size?: 'sm' | 'md';
|
|
158
158
|
isActive?: boolean;
|
|
159
|
-
}):
|
|
159
|
+
}): react_jsx_runtime291.JSX.Element;
|
|
160
160
|
//#endregion
|
|
161
161
|
//#region packages/components/layouts/app-layout/index.d.ts
|
|
162
162
|
declare const AppLayoutWrapper: React.FC<React.PropsWithChildren>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as Button } from "../../button-
|
|
2
|
-
import { t as Separator } from "../../separator-
|
|
3
|
-
import { n as TooltipContent } from "../../tooltip-
|
|
4
|
-
import * as
|
|
1
|
+
import { t as Button } from "../../button-BVyGOvsM.mjs";
|
|
2
|
+
import { t as Separator } from "../../separator-DVJtN08T.mjs";
|
|
3
|
+
import { n as TooltipContent } from "../../tooltip-Cu2-ZHAv.mjs";
|
|
4
|
+
import * as react_jsx_runtime315 from "react/jsx-runtime";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
6
|
-
import * as
|
|
6
|
+
import * as class_variance_authority_types15 from "class-variance-authority/types";
|
|
7
7
|
|
|
8
8
|
//#region packages/components/layouts/app-layout/sidebar.d.ts
|
|
9
9
|
type SidebarContextProps = {
|
|
@@ -28,7 +28,7 @@ declare function SidebarProvider({
|
|
|
28
28
|
defaultOpen?: boolean;
|
|
29
29
|
open?: boolean;
|
|
30
30
|
onOpenChange?: (open: boolean) => void;
|
|
31
|
-
}):
|
|
31
|
+
}): react_jsx_runtime315.JSX.Element;
|
|
32
32
|
declare function Sidebar({
|
|
33
33
|
side,
|
|
34
34
|
variant,
|
|
@@ -40,71 +40,71 @@ declare function Sidebar({
|
|
|
40
40
|
side?: 'left' | 'right';
|
|
41
41
|
variant?: 'sidebar' | 'floating' | 'inset';
|
|
42
42
|
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
43
|
-
}):
|
|
43
|
+
}): react_jsx_runtime315.JSX.Element;
|
|
44
44
|
declare function AppLayoutSidebarTrigger({
|
|
45
45
|
className,
|
|
46
46
|
onClick,
|
|
47
47
|
...props
|
|
48
|
-
}: React.ComponentProps<typeof Button>):
|
|
48
|
+
}: React.ComponentProps<typeof Button>): react_jsx_runtime315.JSX.Element;
|
|
49
49
|
declare function AppLayoutSidebarRail({
|
|
50
50
|
className,
|
|
51
51
|
...props
|
|
52
|
-
}: React.ComponentProps<'button'>):
|
|
52
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime315.JSX.Element;
|
|
53
53
|
declare function AppLayoutSidebarInset({
|
|
54
54
|
className,
|
|
55
55
|
children,
|
|
56
56
|
...props
|
|
57
|
-
}: React.ComponentProps<'main'>):
|
|
57
|
+
}: React.ComponentProps<'main'>): react_jsx_runtime315.JSX.Element;
|
|
58
58
|
declare function AppLayoutSidebarHeader({
|
|
59
59
|
className,
|
|
60
60
|
...props
|
|
61
|
-
}: React.ComponentProps<'div'>):
|
|
61
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime315.JSX.Element;
|
|
62
62
|
declare function AppLayoutSidebarFooter({
|
|
63
63
|
className,
|
|
64
64
|
...props
|
|
65
|
-
}: React.ComponentProps<'div'>):
|
|
65
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime315.JSX.Element;
|
|
66
66
|
declare function AppLayoutSidebarSeparator({
|
|
67
67
|
className,
|
|
68
68
|
...props
|
|
69
|
-
}: React.ComponentProps<typeof Separator>):
|
|
69
|
+
}: React.ComponentProps<typeof Separator>): react_jsx_runtime315.JSX.Element;
|
|
70
70
|
declare function AppLayoutSidebarContent({
|
|
71
71
|
className,
|
|
72
72
|
...props
|
|
73
|
-
}: React.ComponentProps<'div'>):
|
|
73
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime315.JSX.Element;
|
|
74
74
|
declare function AppLayoutSidebarGroup({
|
|
75
75
|
className,
|
|
76
76
|
...props
|
|
77
|
-
}: React.ComponentProps<'div'>):
|
|
77
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime315.JSX.Element;
|
|
78
78
|
declare function AppLayoutSidebarGroupLabel({
|
|
79
79
|
className,
|
|
80
80
|
asChild,
|
|
81
81
|
...props
|
|
82
82
|
}: React.ComponentProps<'div'> & {
|
|
83
83
|
asChild?: boolean;
|
|
84
|
-
}):
|
|
84
|
+
}): react_jsx_runtime315.JSX.Element;
|
|
85
85
|
declare function AppLayoutSidebarGroupAction({
|
|
86
86
|
className,
|
|
87
87
|
asChild,
|
|
88
88
|
...props
|
|
89
89
|
}: React.ComponentProps<'button'> & {
|
|
90
90
|
asChild?: boolean;
|
|
91
|
-
}):
|
|
91
|
+
}): react_jsx_runtime315.JSX.Element;
|
|
92
92
|
declare function AppLayoutSidebarGroupContent({
|
|
93
93
|
className,
|
|
94
94
|
...props
|
|
95
|
-
}: React.ComponentProps<'div'>):
|
|
95
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime315.JSX.Element;
|
|
96
96
|
declare function AppLayoutSidebarMenu({
|
|
97
97
|
className,
|
|
98
98
|
...props
|
|
99
|
-
}: React.ComponentProps<'ul'>):
|
|
99
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime315.JSX.Element;
|
|
100
100
|
declare function AppLayoutSidebarMenuItem({
|
|
101
101
|
className,
|
|
102
102
|
...props
|
|
103
|
-
}: React.ComponentProps<'li'>):
|
|
103
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime315.JSX.Element;
|
|
104
104
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
105
105
|
variant?: "default" | "outline" | null | undefined;
|
|
106
106
|
size?: "sm" | "lg" | "default" | null | undefined;
|
|
107
|
-
} &
|
|
107
|
+
} & class_variance_authority_types15.ClassProp) | undefined) => string;
|
|
108
108
|
declare function AppLayoutSidebarMenuButton({
|
|
109
109
|
asChild,
|
|
110
110
|
isActive,
|
|
@@ -117,7 +117,7 @@ declare function AppLayoutSidebarMenuButton({
|
|
|
117
117
|
asChild?: boolean;
|
|
118
118
|
isActive?: boolean;
|
|
119
119
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
120
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>):
|
|
120
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime315.JSX.Element;
|
|
121
121
|
declare function AppLayoutSidebarMenuAction({
|
|
122
122
|
className,
|
|
123
123
|
asChild,
|
|
@@ -126,26 +126,26 @@ declare function AppLayoutSidebarMenuAction({
|
|
|
126
126
|
}: React.ComponentProps<'button'> & {
|
|
127
127
|
asChild?: boolean;
|
|
128
128
|
showOnHover?: boolean;
|
|
129
|
-
}):
|
|
129
|
+
}): react_jsx_runtime315.JSX.Element;
|
|
130
130
|
declare function AppLayoutSidebarMenuBadge({
|
|
131
131
|
className,
|
|
132
132
|
...props
|
|
133
|
-
}: React.ComponentProps<'div'>):
|
|
133
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime315.JSX.Element;
|
|
134
134
|
declare function AppLayoutSidebarMenuSkeleton({
|
|
135
135
|
className,
|
|
136
136
|
showIcon,
|
|
137
137
|
...props
|
|
138
138
|
}: React.ComponentProps<'div'> & {
|
|
139
139
|
showIcon?: boolean;
|
|
140
|
-
}):
|
|
140
|
+
}): react_jsx_runtime315.JSX.Element;
|
|
141
141
|
declare function AppLayoutSidebarMenuSub({
|
|
142
142
|
className,
|
|
143
143
|
...props
|
|
144
|
-
}: React.ComponentProps<'ul'>):
|
|
144
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime315.JSX.Element;
|
|
145
145
|
declare function AppLayoutSidebarMenuSubItem({
|
|
146
146
|
className,
|
|
147
147
|
...props
|
|
148
|
-
}: React.ComponentProps<'li'>):
|
|
148
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime315.JSX.Element;
|
|
149
149
|
declare function AppLayoutSidebarMenuSubButton({
|
|
150
150
|
asChild,
|
|
151
151
|
size,
|
|
@@ -156,7 +156,7 @@ declare function AppLayoutSidebarMenuSubButton({
|
|
|
156
156
|
asChild?: boolean;
|
|
157
157
|
size?: 'sm' | 'md';
|
|
158
158
|
isActive?: boolean;
|
|
159
|
-
}):
|
|
159
|
+
}): react_jsx_runtime315.JSX.Element;
|
|
160
160
|
//#endregion
|
|
161
161
|
//#region packages/components/layouts/app-layout/index.d.ts
|
|
162
162
|
declare const AppLayoutWrapper: React.FC<React.PropsWithChildren>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import"../../button.variants-DmUzMbB8.mjs";import{t as e}from"../../button-DIEXNBpi.mjs";import{t}from"../../skeleton-CvZncisJ.mjs";import{i as n,n as r,r as i,t as a}from"../../tooltip-BDaKTFKI.mjs";import{t as o}from"../../separator-yTKDuMWb.mjs";import{i as s,o as c,r as l,s as u,t as d}from"../../sheet-BSeiP8S8.mjs";import{cn as f}from"@customafk/react-toolkit/utils";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{MenuIcon as h,ShoppingCartIcon as g}from"lucide-react";import{createContext as _,use as v,useCallback as y,useEffect as b,useMemo as x,useState as S}from"react";import{cva as C}from"class-variance-authority";import{Slot as w}from"radix-ui";import{useIsMobile as T}from"@customafk/react-toolkit/hooks/useMobile";const E=_(null);function D(){let e=v(E);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function O({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=T(),[l,u]=S(!1),[d,m]=S(e),h=t??d,g=y(e=>{let t=typeof e==`function`?e(h):e;n?n(t):m(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,h]),_=y(()=>c?u(e=>!e):g(e=>!e),[c,g,u]);b(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let v=h?`expanded`:`collapsed`,C=x(()=>({state:v,isMobile:c,toggleSidebar:_,open:h,setOpen:g,openMobile:l,setOpenMobile:u}),[v,h,g,c,l,u,_]);return p(E.Provider,{value:C,children:p(i,{delayDuration:0,children:p(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:f(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex h-dvh w-full`,r),...s,children:o})})})}function k({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:h,openMobile:_,setOpenMobile:v}=D();return n===`none`?p(`aside`,{"data-slot":`sidebar`,className:f(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,r),...a,children:i}):o?p(d,{open:_,onOpenChange:v,...a,children:m(l,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden`,style:{"--sidebar-width":`16rem`},side:e,children:[m(c,{className:`sr-only`,children:[p(u,{children:`Sidebar`}),p(s,{children:`Displays the mobile sidebar.`})]}),m(`div`,{className:`flex size-full flex-col`,children:[m(`div`,{className:`border-border-weak flex items-center gap-x-2 border-b p-2 pr-4`,children:[p(A,{}),p(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground ml-2 flex aspect-square size-8 items-center justify-center rounded-lg`,children:p(g,{size:20})}),m(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[p(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),p(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),i]})]})}):m(`aside`,{className:`group peer text-sidebar-foreground bg-card hidden md:block`,"data-state":h,"data-collapsible":h===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[p(`div`,{"data-slot":`sidebar-gap`,className:f(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height) + 0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),p(`div`,{"data-slot":`sidebar-container`,className:f(`hidden md:flex`,`shadow-nav fixed inset-y-0 top-14 z-10`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:p(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:f(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:i})})]})}function A({className:t,onClick:n,...r}){let{toggleSidebar:i}=D();return m(e,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:f(`size-10 rounded-full`,t),onClick:e=>{n?.(e),i()},...r,children:[p(h,{className:`!size-6`}),p(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function j({className:e,...t}){let{toggleSidebar:n}=D();return p(`button`,{"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:n,title:`Toggle Sidebar`,className:f(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear sm:flex`,`after:absolute after:inset-y-0 after:left-1/2 after:w-[2px]`,`group-data-[side=left]:-right-4`,`group-data-[side=right]:left-0`,`in-data-[side=left]:cursor-w-resize`,`in-data-[side=right]:cursor-e-resize`,`hover:after:bg-sidebar-border`,`hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`group-data-[collapsible=offcanvas]:translate-x-0`,`group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize`,`[[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})}function M({className:e,children:t,...n}){return m(`main`,{"data-slot":`sidebar-inset`,className:f(`relative flex w-full flex-1 flex-col`,e),...n,children:[p(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)_+_0.5rem)]`}),p(`div`,{className:f(`flex-1 inset-shadow-sm`),children:t})]})}function N({className:e,...t}){return p(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:f(`flex flex-col gap-2 p-2`,e),...t})}function P({className:e,...t}){return p(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:f(`flex flex-col gap-2 p-2`,e),...t})}function F({className:e,...t}){return p(o,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:f(`bg-sidebar-border mx-2 w-auto`,e),...t})}function I({className:e,...t}){return p(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:f(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function L({className:e,...t}){return p(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:f(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function R({className:e,asChild:t=!1,...n}){return p(t?w.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:f(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2`,`text-sidebar-foreground/70`,`ring-sidebar-ring`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function z({className:e,asChild:t=!1,...n}){return p(t?w.Slot:`button`,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:f(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n})}function B({className:e,...t}){return p(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:f(`w-full text-sm`,e),...t})}function V({className:e,...t}){return p(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:f(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function H({className:e,...t}){return p(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:f(`group/menu-item relative`,e),...t})}const U=C([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`text-left truncate`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:font-medium`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-8!`,`group-data-[collapsible=icon]:p-2!`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function W({asChild:e=!1,isActive:t=!1,variant:i=`default`,size:o=`default`,tooltip:s,className:c,...l}){let u=e?w.Slot:`button`,{isMobile:d,state:h}=D(),g=p(u,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":o,"data-active":t,className:f(U({variant:i,size:o}),c),...l});return s?(typeof s==`string`&&(s={children:s}),m(a,{children:[p(n,{asChild:!0,children:g}),p(r,{side:`right`,align:`center`,hidden:h!==`collapsed`||d,...s})]})):g}function G({className:e,asChild:t=!1,showOnHover:n=!1,...r}){return p(t?w.Slot:`button`,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:f(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,n&&`group-focus-within/menu-item:opacity-100`,n&&`group-hover/menu-item:opacity-100`,n&&`data-[state=open]:opacity-100 md:opacity-0`,e),...r})}function K({className:e,...t}){return p(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:f(`text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none`,`peer-hover/menu-button:text-sidebar-accent-foreground`,`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function q({className:e,showIcon:n=!1,...r}){let i=x(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return m(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:f(`flex h-8 items-center gap-2 rounded-md px-2`,e),...r,children:[n&&p(t,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),p(t,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})}function J({className:e,...t}){return p(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:f(`border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function Y({className:e,...t}){return p(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:f(`group/menu-sub-item relative`,e),...t})}function X({asChild:e=!1,size:t=`md`,isActive:n=!1,className:r,...i}){return p(e?w.Slot:`a`,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:f(`text-sidebar-foreground`,`ring-sidebar-ring`,`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden`,`focus-visible:ring-2`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>svg]:text-sidebar-accent-foreground`,`[&>span:last-child]:truncate`,`data-[active=true]:bg-sidebar-accent`,`data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,r),...i})}const Z=({children:e})=>p(O,{children:e}),Q=({children:e})=>m(`header`,{className:f(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`,`group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)`,`sm:group-has-data-[collapsible=icon]/sidebar-wrapper:h-[calc(var(--header-height)+0.5rem)]`),children:[p(A,{}),m(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[p(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:p(g,{size:20})}),m(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[p(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),p(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),p(`div`,{className:`flex flex-1 items-center justify-end`,children:e})]}),$=({children:e,...t})=>p(k,{variant:`inset`,collapsible:`icon`,...t,children:e}),ee=({children:e})=>p(M,{children:p(`section`,{className:`relative size-full`,children:p(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}),te=({className:e,children:t})=>p(`div`,{"data-slot":`main-header`,className:f(`flex-0`,e),children:t}),ne=({className:e,children:t})=>p(`div`,{"data-slot":`main-content`,className:f(`flex w-full flex-1 flex-col gap-4 overflow-y-auto px-2 sm:px-4`,e),children:t}),re=({className:e,children:t})=>p(`div`,{"data-slot":`main-footer`,className:f(`border-border-weak hidden w-full flex-0 border-t pt-2 sm:flex`,e),children:t}),ie=({children:e,className:t})=>p(`div`,{"data-slot":`main-group`,className:f(`flex size-full flex-col gap-4`,t),children:e}),ae=({className:e,children:t})=>p(`div`,{"data-slot":`main-group-content`,className:f(`bg-card shadow-card size-full max-w-5xl flex-1 snap-start snap-always scroll-mt-4 rounded-md p-4`,e),children:t});export{Q as AppLayoutHeader,ee as AppLayoutMain,ne as AppLayoutMainContent,re as AppLayoutMainFooter,ie as AppLayoutMainGroup,ae as AppLayoutMainGroupContent,te as AppLayoutMainHeader,$ as AppLayoutSidebar,I as AppLayoutSidebarContent,P as AppLayoutSidebarFooter,L as AppLayoutSidebarGroup,z as AppLayoutSidebarGroupAction,B as AppLayoutSidebarGroupContent,R as AppLayoutSidebarGroupLabel,N as AppLayoutSidebarHeader,M as AppLayoutSidebarInset,V as AppLayoutSidebarMenu,G as AppLayoutSidebarMenuAction,K as AppLayoutSidebarMenuBadge,W as AppLayoutSidebarMenuButton,H as AppLayoutSidebarMenuItem,q as AppLayoutSidebarMenuSkeleton,J as AppLayoutSidebarMenuSub,X as AppLayoutSidebarMenuSubButton,Y as AppLayoutSidebarMenuSubItem,j as AppLayoutSidebarRail,F as AppLayoutSidebarSeparator,A as AppLayoutSidebarTrigger,Z as AppLayoutWrapper,k as Sidebar,O as SidebarProvider,D as useSidebar};
|
|
1
|
+
"use client";import"../../button.variants-DmUzMbB8.mjs";import{t as e}from"../../button-DIEXNBpi.mjs";import{t}from"../../skeleton-CvZncisJ.mjs";import{i as n,n as r,r as i,t as a}from"../../tooltip-BDaKTFKI.mjs";import{t as o}from"../../separator-CZM2q-Ac.mjs";import{i as s,o as c,r as l,s as u,t as d}from"../../sheet-CUMpo5F_.mjs";import{cn as f}from"@customafk/react-toolkit/utils";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{MenuIcon as h,ShoppingCartIcon as g}from"lucide-react";import{createContext as _,use as v,useCallback as y,useEffect as b,useMemo as x,useState as S}from"react";import{cva as C}from"class-variance-authority";import{Slot as w}from"radix-ui";import{useIsMobile as T}from"@customafk/react-toolkit/hooks/useMobile";const E=_(null);function D(){let e=v(E);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function O({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=T(),[l,u]=S(!1),[d,m]=S(e),h=t??d,g=y(e=>{let t=typeof e==`function`?e(h):e;n?n(t):m(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,h]),_=y(()=>c?u(e=>!e):g(e=>!e),[c,g,u]);b(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let v=h?`expanded`:`collapsed`,C=x(()=>({state:v,isMobile:c,toggleSidebar:_,open:h,setOpen:g,openMobile:l,setOpenMobile:u}),[v,h,g,c,l,u,_]);return p(E.Provider,{value:C,children:p(i,{delayDuration:0,children:p(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:f(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex h-dvh w-full`,r),...s,children:o})})})}function k({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:h,openMobile:_,setOpenMobile:v}=D();return n===`none`?p(`aside`,{"data-slot":`sidebar`,className:f(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,r),...a,children:i}):o?p(d,{open:_,onOpenChange:v,...a,children:m(l,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden`,style:{"--sidebar-width":`16rem`},side:e,children:[m(c,{className:`sr-only`,children:[p(u,{children:`Sidebar`}),p(s,{children:`Displays the mobile sidebar.`})]}),m(`div`,{className:`flex size-full flex-col`,children:[m(`div`,{className:`border-border-weak flex items-center gap-x-2 border-b p-2 pr-4`,children:[p(A,{}),p(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground ml-2 flex aspect-square size-8 items-center justify-center rounded-lg`,children:p(g,{size:20})}),m(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[p(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),p(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),i]})]})}):m(`aside`,{className:`group peer text-sidebar-foreground bg-card hidden md:block`,"data-state":h,"data-collapsible":h===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[p(`div`,{"data-slot":`sidebar-gap`,className:f(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height) + 0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),p(`div`,{"data-slot":`sidebar-container`,className:f(`hidden md:flex`,`shadow-nav fixed inset-y-0 top-14 z-10`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:p(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:f(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:i})})]})}function A({className:t,onClick:n,...r}){let{toggleSidebar:i}=D();return m(e,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:f(`size-10 rounded-full`,t),onClick:e=>{n?.(e),i()},...r,children:[p(h,{className:`!size-6`}),p(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function j({className:e,...t}){let{toggleSidebar:n}=D();return p(`button`,{"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:n,title:`Toggle Sidebar`,className:f(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear sm:flex`,`after:absolute after:inset-y-0 after:left-1/2 after:w-[2px]`,`group-data-[side=left]:-right-4`,`group-data-[side=right]:left-0`,`in-data-[side=left]:cursor-w-resize`,`in-data-[side=right]:cursor-e-resize`,`hover:after:bg-sidebar-border`,`hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`group-data-[collapsible=offcanvas]:translate-x-0`,`group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize`,`[[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})}function M({className:e,children:t,...n}){return m(`main`,{"data-slot":`sidebar-inset`,className:f(`relative flex w-full flex-1 flex-col`,e),...n,children:[p(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)_+_0.5rem)]`}),p(`div`,{className:f(`flex-1 inset-shadow-sm`),children:t})]})}function N({className:e,...t}){return p(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:f(`flex flex-col gap-2 p-2`,e),...t})}function P({className:e,...t}){return p(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:f(`flex flex-col gap-2 p-2`,e),...t})}function F({className:e,...t}){return p(o,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:f(`bg-sidebar-border mx-2 w-auto`,e),...t})}function I({className:e,...t}){return p(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:f(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function L({className:e,...t}){return p(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:f(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function R({className:e,asChild:t=!1,...n}){return p(t?w.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:f(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2`,`text-sidebar-foreground/70`,`ring-sidebar-ring`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function z({className:e,asChild:t=!1,...n}){return p(t?w.Slot:`button`,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:f(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n})}function B({className:e,...t}){return p(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:f(`w-full text-sm`,e),...t})}function V({className:e,...t}){return p(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:f(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function H({className:e,...t}){return p(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:f(`group/menu-item relative`,e),...t})}const U=C([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`text-left truncate`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:font-medium`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-8!`,`group-data-[collapsible=icon]:p-2!`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function W({asChild:e=!1,isActive:t=!1,variant:i=`default`,size:o=`default`,tooltip:s,className:c,...l}){let u=e?w.Slot:`button`,{isMobile:d,state:h}=D(),g=p(u,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":o,"data-active":t,className:f(U({variant:i,size:o}),c),...l});return s?(typeof s==`string`&&(s={children:s}),m(a,{children:[p(n,{asChild:!0,children:g}),p(r,{side:`right`,align:`center`,hidden:h!==`collapsed`||d,...s})]})):g}function G({className:e,asChild:t=!1,showOnHover:n=!1,...r}){return p(t?w.Slot:`button`,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:f(`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform`,`focus-visible:ring-2`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,n&&`group-focus-within/menu-item:opacity-100`,n&&`group-hover/menu-item:opacity-100`,n&&`data-[state=open]:opacity-100 md:opacity-0`,e),...r})}function K({className:e,...t}){return p(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:f(`text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none`,`peer-hover/menu-button:text-sidebar-accent-foreground`,`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function q({className:e,showIcon:n=!1,...r}){let i=x(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return m(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:f(`flex h-8 items-center gap-2 rounded-md px-2`,e),...r,children:[n&&p(t,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),p(t,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})}function J({className:e,...t}){return p(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:f(`border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function Y({className:e,...t}){return p(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:f(`group/menu-sub-item relative`,e),...t})}function X({asChild:e=!1,size:t=`md`,isActive:n=!1,className:r,...i}){return p(e?w.Slot:`a`,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:f(`text-sidebar-foreground`,`ring-sidebar-ring`,`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden`,`focus-visible:ring-2`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`[&>svg]:text-sidebar-accent-foreground`,`[&>span:last-child]:truncate`,`data-[active=true]:bg-sidebar-accent`,`data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,r),...i})}const Z=({children:e})=>p(O,{children:e}),Q=({children:e})=>m(`header`,{className:f(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`,`group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)`,`sm:group-has-data-[collapsible=icon]/sidebar-wrapper:h-[calc(var(--header-height)+0.5rem)]`),children:[p(A,{}),m(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[p(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:p(g,{size:20})}),m(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[p(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),p(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),p(`div`,{className:`flex flex-1 items-center justify-end`,children:e})]}),$=({children:e,...t})=>p(k,{variant:`inset`,collapsible:`icon`,...t,children:e}),ee=({children:e})=>p(M,{children:p(`section`,{className:`relative size-full`,children:p(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}),te=({className:e,children:t})=>p(`div`,{"data-slot":`main-header`,className:f(`flex-0`,e),children:t}),ne=({className:e,children:t})=>p(`div`,{"data-slot":`main-content`,className:f(`flex w-full flex-1 flex-col gap-4 overflow-y-auto px-2 sm:px-4`,e),children:t}),re=({className:e,children:t})=>p(`div`,{"data-slot":`main-footer`,className:f(`border-border-weak hidden w-full flex-0 border-t pt-2 sm:flex`,e),children:t}),ie=({children:e,className:t})=>p(`div`,{"data-slot":`main-group`,className:f(`flex size-full flex-col gap-4`,t),children:e}),ae=({className:e,children:t})=>p(`div`,{"data-slot":`main-group-content`,className:f(`bg-card shadow-card size-full max-w-5xl flex-1 snap-start snap-always scroll-mt-4 rounded-md p-4`,e),children:t});export{Q as AppLayoutHeader,ee as AppLayoutMain,ne as AppLayoutMainContent,re as AppLayoutMainFooter,ie as AppLayoutMainGroup,ae as AppLayoutMainGroupContent,te as AppLayoutMainHeader,$ as AppLayoutSidebar,I as AppLayoutSidebarContent,P as AppLayoutSidebarFooter,L as AppLayoutSidebarGroup,z as AppLayoutSidebarGroupAction,B as AppLayoutSidebarGroupContent,R as AppLayoutSidebarGroupLabel,N as AppLayoutSidebarHeader,M as AppLayoutSidebarInset,V as AppLayoutSidebarMenu,G as AppLayoutSidebarMenuAction,K as AppLayoutSidebarMenuBadge,W as AppLayoutSidebarMenuButton,H as AppLayoutSidebarMenuItem,q as AppLayoutSidebarMenuSkeleton,J as AppLayoutSidebarMenuSub,X as AppLayoutSidebarMenuSubButton,Y as AppLayoutSidebarMenuSubItem,j as AppLayoutSidebarRail,F as AppLayoutSidebarSeparator,A as AppLayoutSidebarTrigger,Z as AppLayoutWrapper,k as Sidebar,O as SidebarProvider,D as useSidebar};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../dist-CBsvReQV.cjs`);require(`../../button.variants-C--cfyfH.cjs`);const n=require(`../../button-DtFiUaY7.cjs`);require(`../../skeleton-C4suljHP.cjs`);const r=require(`../../tooltip-BimfNium.cjs`);require(`../../input-C1BXP8dd.cjs`),require(`../../separator-Crr30ZHa.cjs`);const i=require(`../../sheet-BYKV6xT_.cjs`);let a=require(`@customafk/react-toolkit/utils`),o=require(`react/jsx-runtime`),s=require(`lucide-react`),c=require(`react`),l=require(`class-variance-authority`),u=require(`@customafk/react-toolkit/hooks/useMobile`);const d=`sidebar_state`,f=3600*24*7,p=`16rem`,m=`18rem`,h=`3rem`,g=`b`,_=(0,c.createContext)(null);function v(){let e=(0,c.useContext)(_);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function y({defaultOpen:e=!0,open:t,onOpenChange:n,className:i,style:s,children:l,...d}){let f=(0,u.useIsMobile)(),[p,m]=(0,c.useState)(!1),[h,g]=(0,c.useState)(e),v=t??h,y=(0,c.useCallback)(e=>{let t=typeof e==`function`?e(v):e;n?n(t):g(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,v]),b=(0,c.useCallback)(()=>f?m(e=>!e):y(e=>!e),[f,y]);(0,c.useEffect)(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),b())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b]);let x=v?`expanded`:`collapsed`,S=(0,c.useMemo)(()=>({state:x,open:v,setOpen:y,isMobile:f,openMobile:p,setOpenMobile:m,toggleSidebar:b}),[x,v,y,f,p,b]);return(0,o.jsx)(_.Provider,{value:S,children:(0,o.jsx)(r.r,{delayDuration:0,children:(0,o.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...s},className:(0,a.cn)(`group/sidebar-wrapper flex h-dvh w-full has-data-[variant=inset]:bg-sidebar`,i),...d,children:l})})})}function b({side:e=`left`,variant:t=`sidebar`,collapsible:r=`offcanvas`,className:c,children:l,...u}){let{isMobile:d,state:f,openMobile:p,setOpenMobile:m,toggleSidebar:h}=v();return r===`none`?(0,o.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,a.cn)(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,c),...u,children:l}):d?(0,o.jsx)(i.t,{open:p,onOpenChange:m,...u,children:(0,o.jsxs)(i.r,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,style:{"--sidebar-width":`18rem`},side:e,children:[(0,o.jsxs)(i.o,{className:`sr-only`,children:[(0,o.jsx)(i.s,{children:`Sidebar`}),(0,o.jsx)(i.i,{children:`Displays the mobile sidebar.`})]}),(0,o.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,o.jsxs)(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[(0,o.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,a.cn)(`size-10 rounded-full`,c),onClick:e=>{h(),e.preventDefault(),e.stopPropagation()},children:[(0,o.jsx)(s.MenuIcon,{className:`size-6!`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,o.jsx)(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,o.jsx)(s.ShoppingCartIcon,{size:20})}),(0,o.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,o.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,o.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,o.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:l})]})]})}):(0,o.jsxs)(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":f,"data-collapsible":f===`collapsed`?r:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,o.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,a.cn)(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,o.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,a.cn)(`hidden md:flex`,`fixed inset-y-0 top-14 z-10 shadow-nav`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,c),...u,children:(0,o.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,a.cn)(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:l})})]})}function x({className:e,children:t,...n}){return(0,o.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,a.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,o.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),(0,o.jsx)(`div`,{className:`inset-shadow-sm flex-1`,children:t})]})}function S({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,a.cn)(`flex flex-col gap-2 p-2`,e),...t})}function C({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,a.cn)(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function w({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,a.cn)(`relative flex w-full min-w-0 flex-col`,e),...t})}function T({className:e,asChild:n=!1,...r}){return(0,o.jsx)(n?t.t:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,a.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...r})}function E({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,a.cn)(`w-full text-sm`,e),...t})}function D({className:e,...t}){return(0,o.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,a.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function O({className:e,...t}){return(0,o.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,a.cn)(`group/menu-item relative`,e),...t})}const k=(0,l.cva)([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-medium`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function A({asChild:e=!1,isActive:n=!1,variant:i=`default`,size:s=`default`,tooltip:c,className:l,...u}){let d=e?t.t:`button`,{isMobile:f,state:p}=v(),m=(0,o.jsx)(d,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":s,"data-active":n,className:(0,a.cn)(k({variant:i,size:s}),l),...u});return c?(typeof c==`string`&&(c={children:c}),(0,o.jsxs)(r.t,{children:[(0,o.jsx)(r.i,{asChild:!0,children:m}),(0,o.jsx)(r.n,{side:`right`,align:`center`,hidden:p!==`collapsed`||f,...c})]})):m}const j=()=>{let{toggleSidebar:e}=v();return(0,o.jsxs)(`header`,{"data-slot":`cms-layout-header`,className:(0,a.cn)(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[(0,o.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full`,onClick:t=>{t.preventDefault(),t.stopPropagation(),e()},children:[(0,o.jsx)(s.MenuIcon,{className:`size-6!`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,o.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,o.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,o.jsx)(s.ShoppingCartIcon,{size:20})}),(0,o.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,o.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),(0,o.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]})]})},M=({activeNavItemId:e,sidebar:t,children:n,onLogout:r})=>{let i=(0,c.useMemo)(()=>t?.groupcontent||[],[t]);return(0,o.jsxs)(y,{children:[(0,o.jsx)(j,{}),(0,o.jsxs)(b,{variant:`inset`,collapsible:`icon`,children:[(0,o.jsx)(C,{children:i.map(t=>(0,o.jsxs)(w,{children:[(0,o.jsx)(T,{children:t.label}),(0,o.jsx)(E,{children:(0,o.jsx)(D,{children:t.items.map(t=>(0,o.jsx)(O,{children:(0,o.jsxs)(A,{isActive:t.id===e,onClick:e=>{t.onClick?.(),e.preventDefault(),e.stopPropagation()},children:[t.icon,t.label]})},t.id))})})]},t.id))}),(0,o.jsx)(S,{children:(0,o.jsxs)(D,{children:[(0,o.jsx)(O,{children:(0,o.jsxs)(A,{className:`border border-border`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[(0,o.jsx)(s.LogOutIcon,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),(0,o.jsx)(O,{className:`mt-2 border-t border-t-border`,children:(0,o.jsx)(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})})]}),(0,o.jsx)(x,{children:(0,o.jsx)(`section`,{className:`relative size-full`,children:(0,o.jsx)(`div`,{className:`absolute inset-0`,children:n})})})]})};exports.CMSLayout=M;
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../dist-CBsvReQV.cjs`);require(`../../button.variants-C--cfyfH.cjs`);const n=require(`../../button-DtFiUaY7.cjs`);require(`../../skeleton-C4suljHP.cjs`);const r=require(`../../tooltip-BimfNium.cjs`);require(`../../separator-C3ip6sbh.cjs`);const i=require(`../../sheet-5MJRtrfG.cjs`);require(`../../input-qnlHzDDm.cjs`);let a=require(`@customafk/react-toolkit/utils`),o=require(`react/jsx-runtime`),s=require(`lucide-react`),c=require(`react`),l=require(`class-variance-authority`),u=require(`@customafk/react-toolkit/hooks/useMobile`);const d=`sidebar_state`,f=3600*24*7,p=`16rem`,m=`18rem`,h=`3rem`,g=`b`,_=(0,c.createContext)(null);function v(){let e=(0,c.useContext)(_);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function y({defaultOpen:e=!0,open:t,onOpenChange:n,className:i,style:s,children:l,...d}){let f=(0,u.useIsMobile)(),[p,m]=(0,c.useState)(!1),[h,g]=(0,c.useState)(e),v=t??h,y=(0,c.useCallback)(e=>{let t=typeof e==`function`?e(v):e;n?n(t):g(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,v]),b=(0,c.useCallback)(()=>f?m(e=>!e):y(e=>!e),[f,y]);(0,c.useEffect)(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),b())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b]);let x=v?`expanded`:`collapsed`,S=(0,c.useMemo)(()=>({state:x,open:v,setOpen:y,isMobile:f,openMobile:p,setOpenMobile:m,toggleSidebar:b}),[x,v,y,f,p,b]);return(0,o.jsx)(_.Provider,{value:S,children:(0,o.jsx)(r.r,{delayDuration:0,children:(0,o.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...s},className:(0,a.cn)(`group/sidebar-wrapper flex h-dvh w-full has-data-[variant=inset]:bg-sidebar`,i),...d,children:l})})})}function b({side:e=`left`,variant:t=`sidebar`,collapsible:r=`offcanvas`,className:c,children:l,...u}){let{isMobile:d,state:f,openMobile:p,setOpenMobile:m,toggleSidebar:h}=v();return r===`none`?(0,o.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,a.cn)(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,c),...u,children:l}):d?(0,o.jsx)(i.t,{open:p,onOpenChange:m,...u,children:(0,o.jsxs)(i.r,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,style:{"--sidebar-width":`18rem`},side:e,children:[(0,o.jsxs)(i.o,{className:`sr-only`,children:[(0,o.jsx)(i.s,{children:`Sidebar`}),(0,o.jsx)(i.i,{children:`Displays the mobile sidebar.`})]}),(0,o.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,o.jsxs)(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[(0,o.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,a.cn)(`size-10 rounded-full`,c),onClick:e=>{h(),e.preventDefault(),e.stopPropagation()},children:[(0,o.jsx)(s.MenuIcon,{className:`size-6!`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,o.jsx)(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,o.jsx)(s.ShoppingCartIcon,{size:20})}),(0,o.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,o.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,o.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,o.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:l})]})]})}):(0,o.jsxs)(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":f,"data-collapsible":f===`collapsed`?r:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,o.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,a.cn)(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,o.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,a.cn)(`hidden md:flex`,`fixed inset-y-0 top-14 z-10 shadow-nav`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,c),...u,children:(0,o.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,a.cn)(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:l})})]})}function x({className:e,children:t,...n}){return(0,o.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,a.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,o.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),(0,o.jsx)(`div`,{className:`inset-shadow-sm flex-1`,children:t})]})}function S({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,a.cn)(`flex flex-col gap-2 p-2`,e),...t})}function C({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,a.cn)(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function w({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,a.cn)(`relative flex w-full min-w-0 flex-col`,e),...t})}function T({className:e,asChild:n=!1,...r}){return(0,o.jsx)(n?t.t:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,a.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...r})}function E({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,a.cn)(`w-full text-sm`,e),...t})}function D({className:e,...t}){return(0,o.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,a.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function O({className:e,...t}){return(0,o.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,a.cn)(`group/menu-item relative`,e),...t})}const k=(0,l.cva)([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-medium`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function A({asChild:e=!1,isActive:n=!1,variant:i=`default`,size:s=`default`,tooltip:c,className:l,...u}){let d=e?t.t:`button`,{isMobile:f,state:p}=v(),m=(0,o.jsx)(d,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":s,"data-active":n,className:(0,a.cn)(k({variant:i,size:s}),l),...u});return c?(typeof c==`string`&&(c={children:c}),(0,o.jsxs)(r.t,{children:[(0,o.jsx)(r.i,{asChild:!0,children:m}),(0,o.jsx)(r.n,{side:`right`,align:`center`,hidden:p!==`collapsed`||f,...c})]})):m}const j=()=>{let{toggleSidebar:e}=v();return(0,o.jsxs)(`header`,{"data-slot":`cms-layout-header`,className:(0,a.cn)(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[(0,o.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full`,onClick:t=>{t.preventDefault(),t.stopPropagation(),e()},children:[(0,o.jsx)(s.MenuIcon,{className:`size-6!`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,o.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,o.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,o.jsx)(s.ShoppingCartIcon,{size:20})}),(0,o.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,o.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),(0,o.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]})]})},M=({activeNavItemId:e,sidebar:t,children:n,onLogout:r})=>{let i=(0,c.useMemo)(()=>t?.groupcontent||[],[t]);return(0,o.jsxs)(y,{children:[(0,o.jsx)(j,{}),(0,o.jsxs)(b,{variant:`inset`,collapsible:`icon`,children:[(0,o.jsx)(C,{children:i.map(t=>(0,o.jsxs)(w,{children:[(0,o.jsx)(T,{children:t.label}),(0,o.jsx)(E,{children:(0,o.jsx)(D,{children:t.items.map(t=>(0,o.jsx)(O,{children:(0,o.jsxs)(A,{isActive:t.id===e,onClick:e=>{t.onClick?.(),e.preventDefault(),e.stopPropagation()},children:[t.icon,t.label]})},t.id))})})]},t.id))}),(0,o.jsx)(S,{children:(0,o.jsxs)(D,{children:[(0,o.jsx)(O,{children:(0,o.jsxs)(A,{className:`border border-border`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[(0,o.jsx)(s.LogOutIcon,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),(0,o.jsx)(O,{className:`mt-2 border-t border-t-border`,children:(0,o.jsx)(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})})]}),(0,o.jsx)(x,{children:(0,o.jsx)(`section`,{className:`relative size-full`,children:(0,o.jsx)(`div`,{className:`absolute inset-0`,children:n})})})]})};exports.CMSLayout=M;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"../../dist-CT2ZB1PF.mjs";import"../../button.variants-DmUzMbB8.mjs";import{t}from"../../button-DIEXNBpi.mjs";import"../../skeleton-CvZncisJ.mjs";import{i as n,n as r,r as i,t as a}from"../../tooltip-BDaKTFKI.mjs";import"../../input-C1K2wbv1.mjs";import"../../separator-yTKDuMWb.mjs";import{i as o,o as s,r as c,s as l,t as u}from"../../sheet-BSeiP8S8.mjs";import{cn as d}from"@customafk/react-toolkit/utils";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{LogOutIcon as m,MenuIcon as h,ShoppingCartIcon as g}from"lucide-react";import{createContext as _,useCallback as v,useContext as y,useEffect as b,useMemo as x,useState as S}from"react";import{cva as C}from"class-variance-authority";import{useIsMobile as w}from"@customafk/react-toolkit/hooks/useMobile";const T=_(null);function E(){let e=y(T);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function D({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=w(),[l,u]=S(!1),[p,m]=S(e),h=t??p,g=v(e=>{let t=typeof e==`function`?e(h):e;n?n(t):m(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,h]),_=v(()=>c?u(e=>!e):g(e=>!e),[c,g]);b(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let y=h?`expanded`:`collapsed`,C=x(()=>({state:y,open:h,setOpen:g,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:_}),[y,h,g,c,l,_]);return f(T.Provider,{value:C,children:f(i,{delayDuration:0,children:f(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:d(`group/sidebar-wrapper flex h-dvh w-full has-data-[variant=inset]:bg-sidebar`,r),...s,children:o})})})}function O({side:e=`left`,variant:n=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,...m}){let{isMobile:_,state:v,openMobile:y,setOpenMobile:b,toggleSidebar:x}=E();return r===`none`?f(`aside`,{"data-slot":`sidebar`,className:d(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,i),...m,children:a}):_?f(u,{open:y,onOpenChange:b,...m,children:p(c,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,style:{"--sidebar-width":`18rem`},side:e,children:[p(s,{className:`sr-only`,children:[f(l,{children:`Sidebar`}),f(o,{children:`Displays the mobile sidebar.`})]}),p(`div`,{className:`flex size-full flex-col`,children:[p(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[p(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:d(`size-10 rounded-full`,i),onClick:e=>{x(),e.preventDefault(),e.stopPropagation()},children:[f(h,{className:`size-6!`}),f(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),f(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:f(g,{size:20})}),p(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[f(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),f(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),f(`div`,{className:`flex flex-1 flex-col p-2`,children:a})]})]})}):p(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":v,"data-collapsible":v===`collapsed`?r:``,"data-variant":n,"data-side":e,"data-slot":`sidebar`,children:[f(`div`,{"data-slot":`sidebar-gap`,className:d(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,n===`floating`||n===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),f(`div`,{"data-slot":`sidebar-container`,className:d(`hidden md:flex`,`fixed inset-y-0 top-14 z-10 shadow-nav`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,n===`floating`||n===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,i),...m,children:f(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:d(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:a})})]})}function k({className:e,children:t,...n}){return p(`main`,{"data-slot":`sidebar-inset`,className:d(`relative flex w-full flex-1 flex-col`,e),...n,children:[f(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),f(`div`,{className:`inset-shadow-sm flex-1`,children:t})]})}function A({className:e,...t}){return f(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:d(`flex flex-col gap-2 p-2`,e),...t})}function j({className:e,...t}){return f(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:d(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function M({className:e,...t}){return f(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:d(`relative flex w-full min-w-0 flex-col`,e),...t})}function N({className:t,asChild:n=!1,...r}){return f(n?e:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:d(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,t),...r})}function P({className:e,...t}){return f(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:d(`w-full text-sm`,e),...t})}function F({className:e,...t}){return f(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:d(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function I({className:e,...t}){return f(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:d(`group/menu-item relative`,e),...t})}const L=C([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-medium`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function R({asChild:t=!1,isActive:i=!1,variant:o=`default`,size:s=`default`,tooltip:c,className:l,...u}){let m=t?e:`button`,{isMobile:h,state:g}=E(),_=f(m,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":s,"data-active":i,className:d(L({variant:o,size:s}),l),...u});return c?(typeof c==`string`&&(c={children:c}),p(a,{children:[f(n,{asChild:!0,children:_}),f(r,{side:`right`,align:`center`,hidden:g!==`collapsed`||h,...c})]})):_}const z=()=>{let{toggleSidebar:e}=E();return p(`header`,{"data-slot":`cms-layout-header`,className:d(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[p(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full`,onClick:t=>{t.preventDefault(),t.stopPropagation(),e()},children:[f(h,{className:`size-6!`}),f(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),p(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[f(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:f(g,{size:20})}),p(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[f(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),f(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]})]})},B=({activeNavItemId:e,sidebar:t,children:n,onLogout:r})=>{let i=x(()=>t?.groupcontent||[],[t]);return p(D,{children:[f(z,{}),p(O,{variant:`inset`,collapsible:`icon`,children:[f(j,{children:i.map(t=>p(M,{children:[f(N,{children:t.label}),f(P,{children:f(F,{children:t.items.map(t=>f(I,{children:p(R,{isActive:t.id===e,onClick:e=>{t.onClick?.(),e.preventDefault(),e.stopPropagation()},children:[t.icon,t.label]})},t.id))})})]},t.id))}),f(A,{children:p(F,{children:[f(I,{children:p(R,{className:`border border-border`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[f(m,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),f(I,{className:`mt-2 border-t border-t-border`,children:f(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})})]}),f(k,{children:f(`section`,{className:`relative size-full`,children:f(`div`,{className:`absolute inset-0`,children:n})})})]})};export{B as CMSLayout};
|
|
1
|
+
import{t as e}from"../../dist-CT2ZB1PF.mjs";import"../../button.variants-DmUzMbB8.mjs";import{t}from"../../button-DIEXNBpi.mjs";import"../../skeleton-CvZncisJ.mjs";import{i as n,n as r,r as i,t as a}from"../../tooltip-BDaKTFKI.mjs";import"../../separator-CZM2q-Ac.mjs";import{i as o,o as s,r as c,s as l,t as u}from"../../sheet-CUMpo5F_.mjs";import"../../input-DD17n9Bv.mjs";import{cn as d}from"@customafk/react-toolkit/utils";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{LogOutIcon as m,MenuIcon as h,ShoppingCartIcon as g}from"lucide-react";import{createContext as _,useCallback as v,useContext as y,useEffect as b,useMemo as x,useState as S}from"react";import{cva as C}from"class-variance-authority";import{useIsMobile as w}from"@customafk/react-toolkit/hooks/useMobile";const T=_(null);function E(){let e=y(T);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function D({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=w(),[l,u]=S(!1),[p,m]=S(e),h=t??p,g=v(e=>{let t=typeof e==`function`?e(h):e;n?n(t):m(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,h]),_=v(()=>c?u(e=>!e):g(e=>!e),[c,g]);b(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let y=h?`expanded`:`collapsed`,C=x(()=>({state:y,open:h,setOpen:g,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:_}),[y,h,g,c,l,_]);return f(T.Provider,{value:C,children:f(i,{delayDuration:0,children:f(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:d(`group/sidebar-wrapper flex h-dvh w-full has-data-[variant=inset]:bg-sidebar`,r),...s,children:o})})})}function O({side:e=`left`,variant:n=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,...m}){let{isMobile:_,state:v,openMobile:y,setOpenMobile:b,toggleSidebar:x}=E();return r===`none`?f(`aside`,{"data-slot":`sidebar`,className:d(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,i),...m,children:a}):_?f(u,{open:y,onOpenChange:b,...m,children:p(c,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,style:{"--sidebar-width":`18rem`},side:e,children:[p(s,{className:`sr-only`,children:[f(l,{children:`Sidebar`}),f(o,{children:`Displays the mobile sidebar.`})]}),p(`div`,{className:`flex size-full flex-col`,children:[p(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[p(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:d(`size-10 rounded-full`,i),onClick:e=>{x(),e.preventDefault(),e.stopPropagation()},children:[f(h,{className:`size-6!`}),f(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),f(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:f(g,{size:20})}),p(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[f(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),f(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),f(`div`,{className:`flex flex-1 flex-col p-2`,children:a})]})]})}):p(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":v,"data-collapsible":v===`collapsed`?r:``,"data-variant":n,"data-side":e,"data-slot":`sidebar`,children:[f(`div`,{"data-slot":`sidebar-gap`,className:d(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,n===`floating`||n===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),f(`div`,{"data-slot":`sidebar-container`,className:d(`hidden md:flex`,`fixed inset-y-0 top-14 z-10 shadow-nav`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,n===`floating`||n===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,i),...m,children:f(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:d(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:a})})]})}function k({className:e,children:t,...n}){return p(`main`,{"data-slot":`sidebar-inset`,className:d(`relative flex w-full flex-1 flex-col`,e),...n,children:[f(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),f(`div`,{className:`inset-shadow-sm flex-1`,children:t})]})}function A({className:e,...t}){return f(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:d(`flex flex-col gap-2 p-2`,e),...t})}function j({className:e,...t}){return f(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:d(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function M({className:e,...t}){return f(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:d(`relative flex w-full min-w-0 flex-col`,e),...t})}function N({className:t,asChild:n=!1,...r}){return f(n?e:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:d(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,t),...r})}function P({className:e,...t}){return f(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:d(`w-full text-sm`,e),...t})}function F({className:e,...t}){return f(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:d(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function I({className:e,...t}){return f(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:d(`group/menu-item relative`,e),...t})}const L=C([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-medium`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function R({asChild:t=!1,isActive:i=!1,variant:o=`default`,size:s=`default`,tooltip:c,className:l,...u}){let m=t?e:`button`,{isMobile:h,state:g}=E(),_=f(m,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":s,"data-active":i,className:d(L({variant:o,size:s}),l),...u});return c?(typeof c==`string`&&(c={children:c}),p(a,{children:[f(n,{asChild:!0,children:_}),f(r,{side:`right`,align:`center`,hidden:g!==`collapsed`||h,...c})]})):_}const z=()=>{let{toggleSidebar:e}=E();return p(`header`,{"data-slot":`cms-layout-header`,className:d(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[p(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full`,onClick:t=>{t.preventDefault(),t.stopPropagation(),e()},children:[f(h,{className:`size-6!`}),f(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),p(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[f(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:f(g,{size:20})}),p(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[f(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),f(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]})]})},B=({activeNavItemId:e,sidebar:t,children:n,onLogout:r})=>{let i=x(()=>t?.groupcontent||[],[t]);return p(D,{children:[f(z,{}),p(O,{variant:`inset`,collapsible:`icon`,children:[f(j,{children:i.map(t=>p(M,{children:[f(N,{children:t.label}),f(P,{children:f(F,{children:t.items.map(t=>f(I,{children:p(R,{isActive:t.id===e,onClick:e=>{t.onClick?.(),e.preventDefault(),e.stopPropagation()},children:[t.icon,t.label]})},t.id))})})]},t.id))}),f(A,{children:p(F,{children:[f(I,{children:p(R,{className:`border border-border`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[f(m,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),f(I,{className:`mt-2 border-t border-t-border`,children:f(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})})]}),f(k,{children:f(`section`,{className:`relative size-full`,children:f(`div`,{className:`absolute inset-0`,children:n})})})]})};export{B as CMSLayout};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/layouts/flex.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
2
2
|
import * as react0 from "react";
|
|
3
3
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
@@ -28,7 +28,7 @@ declare const Flex: react0.MemoExoticComponent<({
|
|
|
28
28
|
align,
|
|
29
29
|
className,
|
|
30
30
|
children
|
|
31
|
-
}: React.PropsWithChildren<Props>) =>
|
|
31
|
+
}: React.PropsWithChildren<Props>) => react_jsx_runtime2.JSX.Element>;
|
|
32
32
|
//#endregion
|
|
33
33
|
export { Flex };
|
|
34
34
|
//# sourceMappingURL=flex.d.cts.map
|