@customafk/lunas-ui 0.1.25 → 0.1.26
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/{avatar-BaxX-xI9.mjs → avatar-DCbv3HzU.mjs} +1 -1
- package/dist/{avatar-BaxX-xI9.mjs.map → avatar-DCbv3HzU.mjs.map} +1 -1
- package/dist/{avatar-dAu1c0bC.cjs → avatar-aVxo69zP.cjs} +1 -1
- package/dist/{avatar-dAu1c0bC.cjs.map → avatar-aVxo69zP.cjs.map} +1 -1
- package/dist/badge-BncGz_13.mjs +2 -0
- package/dist/badge-BncGz_13.mjs.map +1 -0
- package/dist/badge-xKNC7uv3.cjs +2 -0
- package/dist/badge-xKNC7uv3.cjs.map +1 -0
- package/dist/{button-CPlyY35o.d.cts → button-Bg1fW3Y7.d.mts} +4 -4
- package/dist/{button-CyABYH6s.d.mts → button-C-I1CGSH.d.cts} +5 -5
- package/dist/card-CWAdGhMr.mjs.map +1 -1
- package/dist/card-wGoU4Xiq.cjs.map +1 -1
- package/dist/cards/grid-product-card.cjs +1 -1
- package/dist/cards/grid-product-card.mjs +1 -1
- package/dist/cards/product-card.cjs +1 -1
- package/dist/cards/product-card.mjs +1 -1
- package/dist/{close-CGei_VQ6.mjs → close-BuQ2DHur.mjs} +1 -1
- package/dist/{close-CGei_VQ6.mjs.map → close-BuQ2DHur.mjs.map} +1 -1
- package/dist/{close-CXhpIVAZ.cjs → close-DvsVM8lM.cjs} +1 -1
- package/dist/{close-CXhpIVAZ.cjs.map → close-DvsVM8lM.cjs.map} +1 -1
- package/dist/{command-BLlJzBw9.mjs → command-BKiAU1oU.mjs} +2 -2
- package/dist/{command-BLlJzBw9.mjs.map → command-BKiAU1oU.mjs.map} +1 -1
- package/dist/{command-B8Tbe4oe.cjs → command-BqSzRw6j.cjs} +2 -2
- package/dist/{command-B8Tbe4oe.cjs.map → command-BqSzRw6j.cjs.map} +1 -1
- package/dist/data-display/country.d.mts +1 -1
- package/dist/data-display/date-tooltip.cjs +1 -1
- package/dist/data-display/date-tooltip.cjs.map +1 -1
- package/dist/data-display/date-tooltip.mjs +1 -1
- package/dist/data-display/date-tooltip.mjs.map +1 -1
- package/dist/data-display/empty.d.mts +2 -2
- package/dist/data-display/name.cjs +1 -1
- package/dist/data-display/name.mjs +1 -1
- package/dist/data-display/phone-number.cjs +1 -1
- package/dist/data-display/phone-number.mjs +1 -1
- package/dist/data-display/role-badge.cjs +1 -1
- package/dist/data-display/role-badge.cjs.map +1 -1
- package/dist/data-display/role-badge.d.mts +1 -1
- package/dist/data-display/role-badge.mjs +1 -1
- package/dist/data-display/role-badge.mjs.map +1 -1
- package/dist/data-display/statistic.cjs +1 -1
- package/dist/data-display/statistic.cjs.map +1 -1
- package/dist/data-display/statistic.d.mts +2 -2
- package/dist/data-display/statistic.mjs +1 -1
- package/dist/data-display/statistic.mjs.map +1 -1
- package/dist/data-display/user.cjs +1 -1
- package/dist/data-display/user.mjs +1 -1
- package/dist/{dialog-DZ_gg6Ol.cjs → dialog-DVwvHuQB.cjs} +2 -2
- package/dist/{dialog-DZ_gg6Ol.cjs.map → dialog-DVwvHuQB.cjs.map} +1 -1
- package/dist/{dialog-C1fYq5rO.d.cts → dialog-UKGZcMTI.d.mts} +12 -12
- package/dist/{dialog-DeZVOOmh.mjs → dialog-bd77jxcu.mjs} +2 -2
- package/dist/{dialog-DeZVOOmh.mjs.map → dialog-bd77jxcu.mjs.map} +1 -1
- package/dist/{dialog-eqSp0Cdp.d.mts → dialog-eNVy-E39.d.cts} +12 -12
- package/dist/dialogs/detail-dialog/component/sidebar.cjs +1 -1
- package/dist/dialogs/detail-dialog/component/sidebar.d.cts +28 -28
- package/dist/dialogs/detail-dialog/component/sidebar.d.mts +28 -28
- package/dist/dialogs/detail-dialog/component/sidebar.mjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.mjs +1 -1
- package/dist/dialogs/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.mjs +1 -1
- package/dist/{drawer-272Fecsq.mjs → drawer-ClbO_Gt0.mjs} +1 -1
- package/dist/{drawer-272Fecsq.mjs.map → drawer-ClbO_Gt0.mjs.map} +1 -1
- package/dist/{drawer-y-Yrqskp.cjs → drawer-DluJOnDX.cjs} +1 -1
- package/dist/{drawer-y-Yrqskp.cjs.map → drawer-DluJOnDX.cjs.map} +1 -1
- package/dist/{dropdown-menu-CtU6oBI4.mjs → dropdown-menu-DPhbyDEo.mjs} +1 -1
- package/dist/{dropdown-menu-CtU6oBI4.mjs.map → dropdown-menu-DPhbyDEo.mjs.map} +1 -1
- package/dist/{dropdown-menu-C_dw8mro.cjs → dropdown-menu-DQs_Lvq7.cjs} +1 -1
- package/dist/{dropdown-menu-C_dw8mro.cjs.map → dropdown-menu-DQs_Lvq7.cjs.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.cjs.map +1 -1
- package/dist/features/tables/index.d.cts +36 -5
- package/dist/features/tables/index.d.mts +36 -5
- 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/{image-BwbAQRxx.mjs → image-CbKDFah7.mjs} +2 -2
- package/dist/{image-BwbAQRxx.mjs.map → image-CbKDFah7.mjs.map} +1 -1
- package/dist/{image-C-XEJWcw.cjs → image-D5vQS72z.cjs} +2 -2
- package/dist/{image-C-XEJWcw.cjs.map → image-D5vQS72z.cjs.map} +1 -1
- package/dist/{input-DhUevNkc.cjs → input-C1BXP8dd.cjs} +1 -1
- package/dist/{input-DhUevNkc.cjs.map → input-C1BXP8dd.cjs.map} +1 -1
- package/dist/{input-CC10BdKh.mjs → input-C1K2wbv1.mjs} +1 -1
- package/dist/{input-CC10BdKh.mjs.map → input-C1K2wbv1.mjs.map} +1 -1
- package/dist/{input-B8fOADyL.d.mts → input-CuvhIW05.d.mts} +4 -4
- package/dist/{input-CsRVSfuH.d.cts → input-tIFltAI8.d.cts} +6 -6
- package/dist/{label-CaBktIhh.cjs → label-CkTb259R.cjs} +1 -1
- package/dist/{label-CaBktIhh.cjs.map → label-CkTb259R.cjs.map} +1 -1
- package/dist/{label-DVfxfyG5.mjs → label-DwmJnk4H.mjs} +1 -1
- package/dist/{label-DVfxfyG5.mjs.map → label-DwmJnk4H.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 +3 -3
- 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 +4 -4
- package/dist/layouts/flex.d.mts +4 -4
- package/dist/layouts/service-layout/index.cjs +1 -1
- package/dist/layouts/service-layout/index.d.cts +1 -1
- package/dist/layouts/service-layout/index.d.mts +3 -3
- package/dist/layouts/service-layout/index.mjs +1 -1
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +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-D8XbQdj_.cjs → resizable-C2-dXaDM.cjs} +1 -1
- package/dist/{resizable-D8XbQdj_.cjs.map → resizable-C2-dXaDM.cjs.map} +1 -1
- package/dist/{resizable-B9HHrfKn.mjs → resizable-LConLbS6.mjs} +1 -1
- package/dist/{resizable-B9HHrfKn.mjs.map → resizable-LConLbS6.mjs.map} +1 -1
- package/dist/{scroll-area-CiMS2UY7.mjs → scroll-area-6xusEFm6.mjs} +1 -1
- package/dist/{scroll-area-CiMS2UY7.mjs.map → scroll-area-6xusEFm6.mjs.map} +1 -1
- package/dist/{scroll-area-qE6GqGkn.cjs → scroll-area-D61j6n8I.cjs} +1 -1
- package/dist/{scroll-area-qE6GqGkn.cjs.map → scroll-area-D61j6n8I.cjs.map} +1 -1
- package/dist/{separator-BlXmdu-p.d.cts → separator-B0xZ0amV.d.mts} +3 -3
- package/dist/{separator-DjuElvvp.d.mts → separator-BlCcNC_3.d.cts} +3 -3
- package/dist/{separator-D3CGKwyf.cjs → separator-Crr30ZHa.cjs} +1 -1
- package/dist/{separator-D3CGKwyf.cjs.map → separator-Crr30ZHa.cjs.map} +1 -1
- package/dist/{separator-C2yOD6r_.mjs → separator-yTKDuMWb.mjs} +1 -1
- package/dist/{separator-C2yOD6r_.mjs.map → separator-yTKDuMWb.mjs.map} +1 -1
- package/dist/{sheet-DXLayspn.mjs → sheet-BSeiP8S8.mjs} +1 -1
- package/dist/{sheet-DXLayspn.mjs.map → sheet-BSeiP8S8.mjs.map} +1 -1
- package/dist/{sheet-DtWL6WcJ.cjs → sheet-BYKV6xT_.cjs} +1 -1
- package/dist/{sheet-DtWL6WcJ.cjs.map → sheet-BYKV6xT_.cjs.map} +1 -1
- package/dist/skeleton-C4suljHP.cjs.map +1 -1
- package/dist/skeleton-CvZncisJ.mjs.map +1 -1
- package/dist/{tabs-DSofRReg.cjs → tabs-DldSJjLy.cjs} +1 -1
- package/dist/{tabs-DSofRReg.cjs.map → tabs-DldSJjLy.cjs.map} +1 -1
- package/dist/{tabs-Cjh2jtUZ.mjs → tabs-XrUcxpL1.mjs} +1 -1
- package/dist/{tabs-Cjh2jtUZ.mjs.map → tabs-XrUcxpL1.mjs.map} +1 -1
- package/dist/{title-CMJS7QS7.mjs → title-BK1YcXjX.mjs} +1 -1
- package/dist/{title-CMJS7QS7.mjs.map → title-BK1YcXjX.mjs.map} +1 -1
- package/dist/{title-C4XNLXSe.cjs → title-BNv6aAfA.cjs} +1 -1
- package/dist/{title-C4XNLXSe.cjs.map → title-BNv6aAfA.cjs.map} +1 -1
- package/dist/{tooltip-D0XDvxqi.mjs → tooltip-BDaKTFKI.mjs} +1 -1
- package/dist/{tooltip-D0XDvxqi.mjs.map → tooltip-BDaKTFKI.mjs.map} +1 -1
- package/dist/{tooltip-zYWazsY5.cjs → tooltip-BimfNium.cjs} +1 -1
- package/dist/{tooltip-zYWazsY5.cjs.map → tooltip-BimfNium.cjs.map} +1 -1
- package/dist/{tooltip-BZ-lfeF_.d.mts → tooltip-CCJYVy_H.d.mts} +6 -6
- package/dist/{tooltip-szcBtW8t.d.cts → tooltip-DeAzmFCB.d.cts} +6 -6
- package/dist/{types-D2kMOc_b.d.mts → types-DWnJKJ5r.d.mts} +1 -1
- package/dist/typography/paragraph.d.cts +2 -2
- package/dist/typography/title.cjs +1 -1
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.mts +2 -2
- package/dist/typography/title.mjs +1 -1
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert.d.cts +6 -6
- package/dist/ui/alert.d.mts +4 -4
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.mts +2 -2
- package/dist/ui/avatar.cjs +1 -1
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.mts +4 -4
- package/dist/ui/avatar.mjs +1 -1
- package/dist/ui/badge.cjs +1 -2
- package/dist/ui/badge.d.cts +4 -4
- package/dist/ui/badge.d.mts +2 -2
- package/dist/ui/badge.mjs +1 -2
- 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 +7 -7
- package/dist/ui/button-group.d.mts +5 -5
- 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 +22 -22
- package/dist/ui/field.d.mts +24 -24
- 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 +11 -11
- 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/image.cjs +1 -1
- package/dist/ui/image.mjs +1 -1
- 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 +15 -15
- 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.mts +3 -3
- 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 +6 -6
- 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 +30 -30
- 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.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 +9 -9
- 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 +2 -2
- package/dist/ui/toggle.d.mts +4 -4
- package/dist/ui/tooltip.cjs +1 -1
- package/dist/ui/tooltip.d.cts +1 -1
- package/dist/ui/tooltip.d.mts +1 -1
- package/dist/ui/tooltip.mjs +1 -1
- package/package.json +1 -1
- package/dist/ui/badge.cjs.map +0 -1
- package/dist/ui/badge.mjs.map +0 -1
|
@@ -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-C-I1CGSH.cjs";
|
|
2
|
+
import { t as Separator } from "../../separator-BlCcNC_3.cjs";
|
|
3
|
+
import { n as TooltipContent } from "../../tooltip-DeAzmFCB.cjs";
|
|
4
|
+
import * as react_jsx_runtime292 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_runtime292.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_runtime292.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_runtime292.JSX.Element;
|
|
49
49
|
declare function AppLayoutSidebarRail({
|
|
50
50
|
className,
|
|
51
51
|
...props
|
|
52
|
-
}: React.ComponentProps<'button'>):
|
|
52
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime292.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_runtime292.JSX.Element;
|
|
58
58
|
declare function AppLayoutSidebarHeader({
|
|
59
59
|
className,
|
|
60
60
|
...props
|
|
61
|
-
}: React.ComponentProps<'div'>):
|
|
61
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime292.JSX.Element;
|
|
62
62
|
declare function AppLayoutSidebarFooter({
|
|
63
63
|
className,
|
|
64
64
|
...props
|
|
65
|
-
}: React.ComponentProps<'div'>):
|
|
65
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime292.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_runtime292.JSX.Element;
|
|
70
70
|
declare function AppLayoutSidebarContent({
|
|
71
71
|
className,
|
|
72
72
|
...props
|
|
73
|
-
}: React.ComponentProps<'div'>):
|
|
73
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime292.JSX.Element;
|
|
74
74
|
declare function AppLayoutSidebarGroup({
|
|
75
75
|
className,
|
|
76
76
|
...props
|
|
77
|
-
}: React.ComponentProps<'div'>):
|
|
77
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime292.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_runtime292.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_runtime292.JSX.Element;
|
|
92
92
|
declare function AppLayoutSidebarGroupContent({
|
|
93
93
|
className,
|
|
94
94
|
...props
|
|
95
|
-
}: React.ComponentProps<'div'>):
|
|
95
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime292.JSX.Element;
|
|
96
96
|
declare function AppLayoutSidebarMenu({
|
|
97
97
|
className,
|
|
98
98
|
...props
|
|
99
|
-
}: React.ComponentProps<'ul'>):
|
|
99
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime292.JSX.Element;
|
|
100
100
|
declare function AppLayoutSidebarMenuItem({
|
|
101
101
|
className,
|
|
102
102
|
...props
|
|
103
|
-
}: React.ComponentProps<'li'>):
|
|
103
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime292.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_runtime292.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_runtime292.JSX.Element;
|
|
130
130
|
declare function AppLayoutSidebarMenuBadge({
|
|
131
131
|
className,
|
|
132
132
|
...props
|
|
133
|
-
}: React.ComponentProps<'div'>):
|
|
133
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime292.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_runtime292.JSX.Element;
|
|
141
141
|
declare function AppLayoutSidebarMenuSub({
|
|
142
142
|
className,
|
|
143
143
|
...props
|
|
144
|
-
}: React.ComponentProps<'ul'>):
|
|
144
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime292.JSX.Element;
|
|
145
145
|
declare function AppLayoutSidebarMenuSubItem({
|
|
146
146
|
className,
|
|
147
147
|
...props
|
|
148
|
-
}: React.ComponentProps<'li'>):
|
|
148
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime292.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_runtime292.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,6 +1,6 @@
|
|
|
1
|
-
import { t as Button } from "../../button-
|
|
2
|
-
import { t as Separator } from "../../separator-
|
|
3
|
-
import { n as TooltipContent } from "../../tooltip-
|
|
1
|
+
import { t as Button } from "../../button-Bg1fW3Y7.mjs";
|
|
2
|
+
import { t as Separator } from "../../separator-B0xZ0amV.mjs";
|
|
3
|
+
import { n as TooltipContent } from "../../tooltip-CCJYVy_H.mjs";
|
|
4
4
|
import * as react_jsx_runtime316 from "react/jsx-runtime";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
6
6
|
import * as class_variance_authority_types15 from "class-variance-authority/types";
|
|
@@ -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-D0XDvxqi.mjs";import{t as o}from"../../separator-C2yOD6r_.mjs";import{i as s,o as c,r as l,s as u,t as d}from"../../sheet-DXLayspn.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-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};
|
|
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-zYWazsY5.cjs`);require(`../../input-DhUevNkc.cjs`),require(`../../separator-D3CGKwyf.cjs`);const i=require(`../../sheet-DtWL6WcJ.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(`../../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;
|
|
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-D0XDvxqi.mjs";import"../../input-CC10BdKh.mjs";import"../../separator-C2yOD6r_.mjs";import{i as o,o as s,r as c,s as l,t as u}from"../../sheet-DXLayspn.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"../../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};
|
|
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_runtime25 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";
|
|
@@ -11,8 +11,8 @@ declare const flexVariants: (props?: ({
|
|
|
11
11
|
margin?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
12
12
|
padding?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
13
13
|
gap?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
14
|
-
justify?: "
|
|
15
|
-
align?: "
|
|
14
|
+
justify?: "center" | "start" | "end" | "between" | "around" | "evenly" | "stretch" | null | undefined;
|
|
15
|
+
align?: "center" | "start" | "end" | "stretch" | "baseline" | null | undefined;
|
|
16
16
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
17
17
|
type Props = {
|
|
18
18
|
className?: string;
|
|
@@ -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_runtime25.JSX.Element>;
|
|
32
32
|
//#endregion
|
|
33
33
|
export { Flex };
|
|
34
34
|
//# sourceMappingURL=flex.d.cts.map
|
package/dist/layouts/flex.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime26 from "react/jsx-runtime";
|
|
2
2
|
import * as react0 from "react";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
@@ -11,8 +11,8 @@ declare const flexVariants: (props?: ({
|
|
|
11
11
|
margin?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
12
12
|
padding?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
13
13
|
gap?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
14
|
-
justify?: "
|
|
15
|
-
align?: "
|
|
14
|
+
justify?: "center" | "start" | "end" | "between" | "around" | "evenly" | "stretch" | null | undefined;
|
|
15
|
+
align?: "center" | "start" | "end" | "stretch" | "baseline" | null | undefined;
|
|
16
16
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
17
17
|
type Props = {
|
|
18
18
|
className?: string;
|
|
@@ -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_runtime26.JSX.Element>;
|
|
32
32
|
//#endregion
|
|
33
33
|
export { Flex };
|
|
34
34
|
//# sourceMappingURL=flex.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../card-wGoU4Xiq.cjs`);require(`../../button.variants-C--cfyfH.cjs`);const n=require(`../../button-DtFiUaY7.cjs`);require(`../../skeleton-C4suljHP.cjs`);const r=require(`../../image-C-XEJWcw.cjs`),i=require(`../../tooltip-zYWazsY5.cjs`),a=require(`../../avatar-dAu1c0bC.cjs`);require(`../../close-CXhpIVAZ.cjs`);const o=require(`../../dialog-DZ_gg6Ol.cjs`),s=require(`../../input-DhUevNkc.cjs`),c=require(`../../separator-D3CGKwyf.cjs`),l=require(`../../sheet-DtWL6WcJ.cjs`),u=require(`../../dropdown-menu-C_dw8mro.cjs`),d=require(`../../drawer-y-Yrqskp.cjs`),f=require(`../../tabs-DSofRReg.cjs`),p=require(`../../scroll-area-qE6GqGkn.cjs`);let m=require(`@customafk/react-toolkit/utils`),h=require(`react/jsx-runtime`),g=require(`lucide-react`),_=require(`react`),v=require(`class-variance-authority`),y=require(`radix-ui`),b=require(`@customafk/react-toolkit/hooks/useMobile`),x=require(`@customafk/react-toolkit/hooks/useMediaQuery`),S=require(`@react-oauth/google`),C=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);const w=(0,_.createContext)(null),T=()=>{let e=(0,_.use)(w);if(!e)throw Error(`useServiceLayoutContext must be used within a ServiceLayoutProvider`);return e},E=({id:e,type:i,productName:a,imageUrl:o,quantity:c,price:l,options:u})=>{let{onDeletingCart:d,onUpdatingCart:f}=T(),[p,m]=(0,_.useState)(c),[v,y]=(0,_.useState)(!1),b=(0,C.useDebounceCallback)((0,_.useCallback)(()=>{f?.(e,p,i)},[f,e,p,i]),500),x=(0,_.useCallback)(e=>{e<1&&(e=1),e>99&&(e=99),m(e)},[]),S=(0,_.useCallback)(async()=>{y(!0),await d?.(e),y(!1)},[e,d]);return(0,_.useEffect)(()=>(p!==c&&b(),()=>{b.cancel()}),[p,c,b]),(0,h.jsxs)(t.t,{className:`border-border-weak relative mb-3 overflow-x-auto border p-4 shadow-none`,children:[v&&(0,h.jsx)(`div`,{className:`bg-muted-muted/80 absolute inset-0 z-10 flex items-center justify-center`,children:(0,h.jsx)(`div`,{className:`loader-dots`})}),(0,h.jsxs)(t.r,{className:`p-0`,children:[(0,h.jsxs)(n.t,{variant:`ghost`,size:`icon`,color:`muted`,disabled:v,className:`text-text-positive-weak absolute top-2 right-2 z-10`,onClick:S,children:[(0,h.jsx)(g.Trash2,{className:`h-4 w-4`}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Remove item`})]}),(0,h.jsxs)(`div`,{className:`flex gap-3`,children:[(0,h.jsx)(`div`,{className:`relative size-20 flex-shrink-0`,children:o?(0,h.jsx)(r.t,{src:o,alt:a,className:`rounded-md border-none shadow-xs`,width:80,height:80}):(0,h.jsx)(`div`,{className:`bg-muted text-muted-foreground flex size-full items-center justify-center text-xs`,children:`No image`})}),(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,h.jsx)(`div`,{className:`flex justify-between`,children:(0,h.jsx)(`h3`,{className:`text-text-positive line-clamp-1 text-sm font-medium`,children:a})}),(0,h.jsx)(`p`,{className:`text-text-positive-weak mb-1 text-xs`,children:u.map((e,t)=>(0,h.jsxs)(`span`,{children:[e.label,`: `,e.value,t<u.length-1&&`, `]},e.label))}),(0,h.jsxs)(`div`,{className:`mt-auto flex items-center justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-center space-x-1`,children:[(0,h.jsx)(`button`,{disabled:p<=1,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>x(p-1),children:(0,h.jsx)(g.Minus,{size:12})}),(0,h.jsx)(s.t,{value:p,onChange:e=>x(parseInt(e.target.value||`1`)),className:`border-border h-6.5 w-14 rounded-md border p-1 text-center text-sm`,min:1}),(0,h.jsx)(`button`,{disabled:p>=99,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>x(p+1),children:(0,h.jsx)(g.Plus,{size:12})})]}),(0,h.jsxs)(`div`,{className:`text-sm font-semibold`,children:[(l*p).toLocaleString(),` ₫`]})]})]})]})]})]})},D=({items:e=[],cartType:t,className:r})=>{let i=e.reduce((e,t)=>e+t.price*t.quantity,0);return e.length===0?(0,h.jsxs)(`div`,{className:(0,m.cn)(`bg-muted-muted flex size-full max-h-80 flex-col items-center justify-center rounded-lg p-8`,r),children:[(0,h.jsx)(`div`,{className:`text-text-positive-weak bg-card shadow-card mb-4 flex size-20 items-center justify-center rounded-full text-5xl`,children:(0,h.jsx)(g.ShoppingBasketIcon,{size:42,strokeWidth:1})}),(0,h.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,h.jsx)(`p`,{className:`text-text-positive text-center text-base font-semibold`,children:`Giỏ hàng trống`}),(0,h.jsx)(`p`,{className:`text-text-positive-weak mb-4 text-center text-sm`,children:t===`in_stock`?`Thêm sản phẩm có sẵn vào giỏ hàng của bạn!`:`Thêm sản phẩm đặt trước vào giỏ hàng của bạn!`})]})]}):(0,h.jsxs)(`div`,{className:(0,m.cn)(`flex h-full flex-col space-y-4 overflow-y-auto`,r),children:[(0,h.jsx)(p.t,{className:`h-full flex-1`,children:e.map(e=>(0,h.jsx)(E,{...e,type:t},e.id))}),(0,h.jsxs)(`div`,{className:`flex-0 space-y-3`,children:[(0,h.jsxs)(`div`,{className:`flex justify-between`,children:[(0,h.jsx)(`span`,{className:`text-text-positive-weak text-sm`,children:`Tạm tính:`}),(0,h.jsxs)(`span`,{className:`text-sm`,children:[i.toLocaleString(),` ₫`]})]}),(0,h.jsx)(c.t,{}),(0,h.jsxs)(`div`,{className:`flex justify-between`,children:[(0,h.jsx)(`span`,{className:`text-text-positive font-medium`,children:`Tổng cộng:`}),(0,h.jsxs)(`span`,{className:`text-lg font-semibold`,children:[i.toLocaleString(),` ₫`]})]}),(0,h.jsx)(n.t,{className:`mt-2 w-full`,children:`Thanh toán ngay`}),t===`pre_order`&&(0,h.jsx)(`p`,{className:`text-text-positive-weak text-center text-xs italic`,children:`* Sản phẩm đặt trước sẽ được giao sau khi có hàng`})]})]})},O=(0,_.createContext)(null),k=()=>{let e=(0,_.use)(O);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e},ee=`sidebar_state`,te=3600*24*7,ne=`16rem`,re=`16rem`,ie=`3rem`,ae=`b`;function A({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=(0,b.useIsMobile)(),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(e),p=t??d,g=(0,_.useCallback)(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,p]),v=(0,_.useCallback)(()=>c?u(e=>!e):g(e=>!e),[c,g]);(0,_.useEffect)(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[v]);let y=p?`expanded`:`collapsed`,x=(0,_.useMemo)(()=>({state:y,isMobile:c,toggleSidebar:v,open:p,setOpen:g,openMobile:l,setOpenMobile:u}),[y,p,g,c,l,v]);return(0,h.jsx)(O.Provider,{value:x,children:(0,h.jsx)(i.r,{delayDuration:0,children:(0,h.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:(0,m.cn)(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex h-dvh w-full`,r),...s,children:o})})})}function j({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:s,openMobile:c,setOpenMobile:u}=k();return n===`none`?(0,h.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,m.cn)(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):o?(0,h.jsx)(l.t,{open:c,onOpenChange:u,children:(0,h.jsxs)(l.r,{side:`left`,"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":`16rem`},children:[(0,h.jsxs)(l.o,{className:`sr-only`,children:[(0,h.jsx)(l.s,{children:`Sidebar`}),(0,h.jsx)(l.i,{children:`Displays the mobile sidebar.`})]}),(0,h.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[(0,h.jsx)(M,{}),(0,h.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,h.jsx)(g.ShoppingCartIcon,{size:20})}),(0,h.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,h.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:i})]})]})}):(0,h.jsxs)(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,h.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,m.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,h.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,m.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`,r),...a,children:(0,h.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,m.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 M({className:e,onClick:t,...r}){let{toggleSidebar:i}=k();return(0,h.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,m.cn)(`size-10 rounded-full`,e),onClick:e=>{t?.(e),i()},...r,children:[(0,h.jsx)(g.MenuIcon,{className:`size-6!`}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function N({className:e,children:t,...n}){return(0,h.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,m.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,h.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),(0,h.jsx)(`div`,{className:(0,m.cn)(`inset-shadow-sm flex-1`),children:t})]})}function P({className:e,children:t,...n}){let{open:r}=k(),{onLogout:i}=T();return(0,h.jsxs)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,m.cn)(`flex flex-col gap-2`,e),...n,children:[t,(0,h.jsxs)(z,{children:[(0,h.jsx)(B,{children:(0,h.jsxs)(H,{className:`border border-border`,onClick:i,children:[(0,h.jsx)(g.LogOutIcon,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),r&&(0,h.jsx)(B,{className:`mt-2 border-t border-t-border`,children:(0,h.jsx)(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})]})}function F({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,m.cn)(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function I({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,m.cn)(`relative flex w-full min-w-0 flex-col`,e),...t})}function L({className:e,asChild:t=!1,...n}){return(0,h.jsx)(t?y.Slot.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,m.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-xs 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 R({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,m.cn)(`w-full text-sm`,e),...t})}function z({className:e,...t}){return(0,h.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,m.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function B({className:e,...t}){return(0,h.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,m.cn)(`group/menu-item relative`,e),...t})}const V=(0,v.cva)(`peer/menu-button.cursor-pointer.flex w-full items-center gap-2.overflow-hidden rounded-md p-2 outline-hidden.truncate text-left.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-12!.group-data-[collapsible=icon]:p-3!.group-data-[collapsible=icon]:gap-3!.[&>svg]:size-6.[&>svg]:shrink-0.[&>span:last-child]:truncate`.split(`.`),{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 H({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:a,className:o,...s}){let c=e?y.Slot.Slot:`button`,{isMobile:l,state:u}=k(),d=(0,h.jsx)(c,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:(0,m.cn)(V({variant:n,size:r}),o),...s});return a?(typeof a==`string`&&(a={children:a}),(0,h.jsxs)(i.t,{children:[(0,h.jsx)(i.i,{asChild:!0,children:d}),(0,h.jsx)(i.n,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...a})]})):d}const U=({isLoggedIn:e=!1,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c,children:l})=>(0,h.jsx)(w.Provider,{value:{isLoggedIn:e,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c},children:l}),W=({children:e})=>(0,h.jsx)(A,{children:e}),G=({userName:e=`Keith Kennedy`,userEmail:t=`k.kennedy@originui.com`,onLogout:r})=>(0,h.jsxs)(u.t,{children:[(0,h.jsx)(u.h,{asChild:!0,children:(0,h.jsx)(n.t,{size:`icon`,variant:`ghost`,color:`secondary`,className:`size-10 rounded-full`,children:(0,h.jsxs)(a.t,{className:`size-10`,children:[(0,h.jsx)(a.r,{}),(0,h.jsx)(a.n,{className:`size-full bg-muted-muted`,children:(0,h.jsx)(g.UserIcon,{})})]})})}),(0,h.jsxs)(u.r,{align:`end`,className:`max-w-64`,children:[(0,h.jsxs)(u.o,{className:`flex min-w-0 flex-col`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium text-sm text-text-positive`,children:e}),(0,h.jsx)(`span`,{className:`truncate font-normal text-text-positive-weak text-xs`,children:t})]}),(0,h.jsx)(u.u,{}),(0,h.jsxs)(u.a,{onClick:r,children:[(0,h.jsx)(g.LogOutIcon,{size:16,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`text-text-positive`,children:`Logout`})]})]})]}),K=()=>{let{inStockCarts:e=[],orderedCarts:t=[]}=T(),r=e.length,i=t.length,a=r+i;return(0,h.jsxs)(l.t,{children:[(0,h.jsx)(l.c,{asChild:!0,children:(0,h.jsx)(n.t,{size:`icon`,variant:`ghost`,color:`secondary`,className:`relative size-10 rounded-full`,children:(0,h.jsx)(g.ShoppingCartIcon,{})})}),(0,h.jsxs)(l.r,{className:`w-[95vw] sm:max-w-md`,children:[(0,h.jsx)(l.o,{className:`flex-0 border-border-weak border-b pb-3`,children:(0,h.jsxs)(l.s,{className:`flex items-center gap-2`,children:[(0,h.jsx)(g.ShoppingBag,{size:20}),(0,h.jsx)(`span`,{children:`Giỏ hàng của bạn`}),a>0&&(0,h.jsxs)(`span`,{className:`font-normal text-sm text-text-positive-weak`,children:[`(`,a,` sản phẩm)`]})]})}),(0,h.jsxs)(f.t,{defaultValue:i>0?`pre_order`:`in_stock`,className:`h-full flex-1 overflow-y-auto p-4 pt-0`,children:[(0,h.jsxs)(f.r,{className:`w-full flex-0`,children:[(0,h.jsxs)(f.i,{value:`in_stock`,className:`relative`,children:[`Có sẵn`,r>0&&(0,h.jsxs)(`span`,{children:[`(`,r,`)`]})]}),(0,h.jsxs)(f.i,{value:`pre_order`,className:`relative`,children:[`Đặt trước`,i>0&&(0,h.jsxs)(`span`,{children:[`(`,i,`)`]})]})]}),(0,h.jsx)(f.n,{value:`pre_order`,className:`flex-1 overflow-y-auto`,children:(0,h.jsx)(D,{items:t,cartType:`pre_order`})}),(0,h.jsx)(f.n,{value:`in_stock`,className:`flex-1 overflow-y-auto`,children:(0,h.jsx)(D,{items:e,cartType:`in_stock`})})]})]})]})},q=()=>{let{isLoggedIn:e,username:t,email:r,onGoogleLoginSuccess:i,onLogout:a}=T(),s=(0,x.useMediaQuery)(`(min-width: 640px)`),[l,u]=(0,_.useState)(!1);return(0,h.jsxs)(`header`,{className:(0,m.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:[e&&(0,h.jsx)(M,{}),(0,h.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,h.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,h.jsx)(g.ShoppingCartIcon,{size:20})}),(0,h.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,h.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,h.jsxs)(`div`,{className:`flex flex-1 items-center justify-end gap-x-2`,children:[!e&&(0,h.jsxs)(n.t,{className:`w-8 sm:w-fit`,onClick:()=>u(!0),children:[(0,h.jsx)(g.LogInIcon,{}),(0,h.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:`Đăng nhập`})]}),e&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(G,{userName:t,userEmail:r,onLogout:a}),(0,h.jsx)(c.t,{orientation:`vertical`,className:`min-h-6 w-px`}),(0,h.jsx)(K,{})]})]}),s&&(0,h.jsx)(o.t,{open:l,onOpenChange:u,children:(0,h.jsxs)(o.r,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,h.jsx)(o.o,{className:`flex-0 gap-2 p-6`,children:(0,h.jsx)(o.l,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,h.jsx)(o.a,{className:`p-2`})]})}),!s&&(0,h.jsx)(d.t,{open:l,onOpenChange:u,children:(0,h.jsxs)(d.r,{children:[(0,h.jsx)(d.o,{className:`text-left`,children:(0,h.jsx)(d.l,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,h.jsx)(d.a,{})]})})]})},J=({children:e,...t})=>{let{isLoggedIn:n}=T();return n?(0,h.jsx)(j,{variant:`inset`,collapsible:`icon`,...t,children:e}):null},Y=({children:e})=>{let{isLoggedIn:t,onGoogleLoginSuccess:r}=T(),i=(0,x.useMediaQuery)(`(min-width: 640px)`),[a,s]=(0,_.useState)(!1);return t?(0,h.jsx)(N,{children:(0,h.jsx)(`section`,{className:`relative size-full`,children:(0,h.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}):(0,h.jsx)(`div`,{className:`size-full p-4 pt-[calc(var(--header-height)+1.5rem)]`,children:(0,h.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-6 rounded-lg bg-card p-8 text-center shadow-card`,children:[(0,h.jsx)(`div`,{className:`flex size-20 items-center justify-center rounded-full bg-muted-foreground/10`,children:(0,h.jsx)(g.LockIcon,{className:`size-10 text-primary`})}),(0,h.jsxs)(`div`,{className:`flex max-w-md flex-col gap-2`,children:[(0,h.jsx)(`h2`,{className:`font-semibold text-2xl`,children:`Bạn chưa đăng nhập`}),(0,h.jsx)(`p`,{className:`text-text-positive-weak`,children:`Đăng nhập để khám phá đầy đủ các tính năng của Lunas Store và truy cập vào tài khoản của bạn.`})]}),(0,h.jsxs)(n.t,{size:`lg`,className:`gap-2`,onClick:()=>s(!0),children:[(0,h.jsx)(g.LogInIcon,{size:18}),(0,h.jsx)(`span`,{children:`Đăng nhập ngay`})]}),i&&(0,h.jsx)(o.t,{open:a,onOpenChange:s,children:(0,h.jsxs)(o.r,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,h.jsx)(o.o,{className:`flex-0 gap-2 p-6`,children:(0,h.jsx)(o.l,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),s(!1))}})]})})}),(0,h.jsx)(o.a,{className:`p-2`})]})}),!i&&(0,h.jsx)(d.t,{open:a,onOpenChange:s,children:(0,h.jsxs)(d.r,{children:[(0,h.jsx)(d.o,{className:`text-left`,children:(0,h.jsx)(d.l,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),s(!1))}})]})})}),(0,h.jsx)(d.a,{})]})})]})})},X=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-header`,className:(0,m.cn)(`flex-0 snap-start`,e),children:t}),Z=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-content`,className:(0,m.cn)(`flex w-full flex-1 flex-col gap-4 overflow-y-auto px-2 sm:px-4`,e),children:t}),Q=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-footer`,className:(0,m.cn)(`hidden w-full flex-0 border-border-weak border-t pt-2 sm:flex`,e),children:t}),$=({children:e,className:t})=>(0,h.jsx)(`div`,{"data-slot":`main-group`,className:(0,m.cn)(`flex size-full flex-col gap-4`,t),children:e}),oe=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-group-content`,className:(0,m.cn)(`size-full max-w-8xl flex-1 rounded-md bg-card p-4 shadow-card`,e),children:t});exports.ServiceLayoutCartInfo=K,exports.ServiceLayoutHeader=q,exports.ServiceLayoutMain=Y,exports.ServiceLayoutMainContent=Z,exports.ServiceLayoutMainFooter=Q,exports.ServiceLayoutMainGroup=$,exports.ServiceLayoutMainGroupContent=oe,exports.ServiceLayoutMainHeader=X,exports.ServiceLayoutProvider=U,exports.ServiceLayoutSidebar=J,exports.ServiceLayoutSidebarContent=F,exports.ServiceLayoutSidebarFooter=P,exports.ServiceLayoutSidebarGroup=I,exports.ServiceLayoutSidebarGroupContent=R,exports.ServiceLayoutSidebarGroupLabel=L,exports.ServiceLayoutSidebarMenu=z,exports.ServiceLayoutSidebarMenuButton=H,exports.ServiceLayoutSidebarMenuItem=B,exports.ServiceLayoutUserInfo=G,exports.ServiceLayoutWrapper=W;
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../card-wGoU4Xiq.cjs`);require(`../../button.variants-C--cfyfH.cjs`);const n=require(`../../button-DtFiUaY7.cjs`);require(`../../skeleton-C4suljHP.cjs`);const r=require(`../../image-D5vQS72z.cjs`),i=require(`../../tooltip-BimfNium.cjs`),a=require(`../../avatar-aVxo69zP.cjs`);require(`../../close-DvsVM8lM.cjs`);const o=require(`../../dialog-DVwvHuQB.cjs`),s=require(`../../input-C1BXP8dd.cjs`),c=require(`../../separator-Crr30ZHa.cjs`),l=require(`../../sheet-BYKV6xT_.cjs`),u=require(`../../dropdown-menu-DQs_Lvq7.cjs`),d=require(`../../drawer-DluJOnDX.cjs`),f=require(`../../tabs-DldSJjLy.cjs`),p=require(`../../scroll-area-D61j6n8I.cjs`);let m=require(`@customafk/react-toolkit/utils`),h=require(`react/jsx-runtime`),g=require(`lucide-react`),_=require(`react`),v=require(`class-variance-authority`),y=require(`radix-ui`),b=require(`@customafk/react-toolkit/hooks/useMobile`),x=require(`@customafk/react-toolkit/hooks/useMediaQuery`),S=require(`@react-oauth/google`),C=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);const w=(0,_.createContext)(null),T=()=>{let e=(0,_.use)(w);if(!e)throw Error(`useServiceLayoutContext must be used within a ServiceLayoutProvider`);return e},E=({id:e,type:i,productName:a,imageUrl:o,quantity:c,price:l,options:u})=>{let{onDeletingCart:d,onUpdatingCart:f}=T(),[p,m]=(0,_.useState)(c),[v,y]=(0,_.useState)(!1),b=(0,C.useDebounceCallback)((0,_.useCallback)(()=>{f?.(e,p,i)},[f,e,p,i]),500),x=(0,_.useCallback)(e=>{e<1&&(e=1),e>99&&(e=99),m(e)},[]),S=(0,_.useCallback)(async()=>{y(!0),await d?.(e),y(!1)},[e,d]);return(0,_.useEffect)(()=>(p!==c&&b(),()=>{b.cancel()}),[p,c,b]),(0,h.jsxs)(t.t,{className:`border-border-weak relative mb-3 overflow-x-auto border p-4 shadow-none`,children:[v&&(0,h.jsx)(`div`,{className:`bg-muted-muted/80 absolute inset-0 z-10 flex items-center justify-center`,children:(0,h.jsx)(`div`,{className:`loader-dots`})}),(0,h.jsxs)(t.r,{className:`p-0`,children:[(0,h.jsxs)(n.t,{variant:`ghost`,size:`icon`,color:`muted`,disabled:v,className:`text-text-positive-weak absolute top-2 right-2 z-10`,onClick:S,children:[(0,h.jsx)(g.Trash2,{className:`h-4 w-4`}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Remove item`})]}),(0,h.jsxs)(`div`,{className:`flex gap-3`,children:[(0,h.jsx)(`div`,{className:`relative size-20 flex-shrink-0`,children:o?(0,h.jsx)(r.t,{src:o,alt:a,className:`rounded-md border-none shadow-xs`,width:80,height:80}):(0,h.jsx)(`div`,{className:`bg-muted text-muted-foreground flex size-full items-center justify-center text-xs`,children:`No image`})}),(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,h.jsx)(`div`,{className:`flex justify-between`,children:(0,h.jsx)(`h3`,{className:`text-text-positive line-clamp-1 text-sm font-medium`,children:a})}),(0,h.jsx)(`p`,{className:`text-text-positive-weak mb-1 text-xs`,children:u.map((e,t)=>(0,h.jsxs)(`span`,{children:[e.label,`: `,e.value,t<u.length-1&&`, `]},e.label))}),(0,h.jsxs)(`div`,{className:`mt-auto flex items-center justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-center space-x-1`,children:[(0,h.jsx)(`button`,{disabled:p<=1,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>x(p-1),children:(0,h.jsx)(g.Minus,{size:12})}),(0,h.jsx)(s.t,{value:p,onChange:e=>x(parseInt(e.target.value||`1`)),className:`border-border h-6.5 w-14 rounded-md border p-1 text-center text-sm`,min:1}),(0,h.jsx)(`button`,{disabled:p>=99,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>x(p+1),children:(0,h.jsx)(g.Plus,{size:12})})]}),(0,h.jsxs)(`div`,{className:`text-sm font-semibold`,children:[(l*p).toLocaleString(),` ₫`]})]})]})]})]})]})},D=({items:e=[],cartType:t,className:r})=>{let i=e.reduce((e,t)=>e+t.price*t.quantity,0);return e.length===0?(0,h.jsxs)(`div`,{className:(0,m.cn)(`bg-muted-muted flex size-full max-h-80 flex-col items-center justify-center rounded-lg p-8`,r),children:[(0,h.jsx)(`div`,{className:`text-text-positive-weak bg-card shadow-card mb-4 flex size-20 items-center justify-center rounded-full text-5xl`,children:(0,h.jsx)(g.ShoppingBasketIcon,{size:42,strokeWidth:1})}),(0,h.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,h.jsx)(`p`,{className:`text-text-positive text-center text-base font-semibold`,children:`Giỏ hàng trống`}),(0,h.jsx)(`p`,{className:`text-text-positive-weak mb-4 text-center text-sm`,children:t===`in_stock`?`Thêm sản phẩm có sẵn vào giỏ hàng của bạn!`:`Thêm sản phẩm đặt trước vào giỏ hàng của bạn!`})]})]}):(0,h.jsxs)(`div`,{className:(0,m.cn)(`flex h-full flex-col space-y-4 overflow-y-auto`,r),children:[(0,h.jsx)(p.t,{className:`h-full flex-1`,children:e.map(e=>(0,h.jsx)(E,{...e,type:t},e.id))}),(0,h.jsxs)(`div`,{className:`flex-0 space-y-3`,children:[(0,h.jsxs)(`div`,{className:`flex justify-between`,children:[(0,h.jsx)(`span`,{className:`text-text-positive-weak text-sm`,children:`Tạm tính:`}),(0,h.jsxs)(`span`,{className:`text-sm`,children:[i.toLocaleString(),` ₫`]})]}),(0,h.jsx)(c.t,{}),(0,h.jsxs)(`div`,{className:`flex justify-between`,children:[(0,h.jsx)(`span`,{className:`text-text-positive font-medium`,children:`Tổng cộng:`}),(0,h.jsxs)(`span`,{className:`text-lg font-semibold`,children:[i.toLocaleString(),` ₫`]})]}),(0,h.jsx)(n.t,{className:`mt-2 w-full`,children:`Thanh toán ngay`}),t===`pre_order`&&(0,h.jsx)(`p`,{className:`text-text-positive-weak text-center text-xs italic`,children:`* Sản phẩm đặt trước sẽ được giao sau khi có hàng`})]})]})},O=(0,_.createContext)(null),k=()=>{let e=(0,_.use)(O);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e},ee=`sidebar_state`,te=3600*24*7,ne=`16rem`,re=`16rem`,ie=`3rem`,ae=`b`;function A({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=(0,b.useIsMobile)(),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(e),p=t??d,g=(0,_.useCallback)(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,p]),v=(0,_.useCallback)(()=>c?u(e=>!e):g(e=>!e),[c,g]);(0,_.useEffect)(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[v]);let y=p?`expanded`:`collapsed`,x=(0,_.useMemo)(()=>({state:y,isMobile:c,toggleSidebar:v,open:p,setOpen:g,openMobile:l,setOpenMobile:u}),[y,p,g,c,l,v]);return(0,h.jsx)(O.Provider,{value:x,children:(0,h.jsx)(i.r,{delayDuration:0,children:(0,h.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:(0,m.cn)(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex h-dvh w-full`,r),...s,children:o})})})}function j({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:s,openMobile:c,setOpenMobile:u}=k();return n===`none`?(0,h.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,m.cn)(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):o?(0,h.jsx)(l.t,{open:c,onOpenChange:u,children:(0,h.jsxs)(l.r,{side:`left`,"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":`16rem`},children:[(0,h.jsxs)(l.o,{className:`sr-only`,children:[(0,h.jsx)(l.s,{children:`Sidebar`}),(0,h.jsx)(l.i,{children:`Displays the mobile sidebar.`})]}),(0,h.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[(0,h.jsx)(M,{}),(0,h.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,h.jsx)(g.ShoppingCartIcon,{size:20})}),(0,h.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,h.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:i})]})]})}):(0,h.jsxs)(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,h.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,m.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,h.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,m.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`,r),...a,children:(0,h.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,m.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 M({className:e,onClick:t,...r}){let{toggleSidebar:i}=k();return(0,h.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,m.cn)(`size-10 rounded-full`,e),onClick:e=>{t?.(e),i()},...r,children:[(0,h.jsx)(g.MenuIcon,{className:`size-6!`}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function N({className:e,children:t,...n}){return(0,h.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,m.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,h.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),(0,h.jsx)(`div`,{className:(0,m.cn)(`inset-shadow-sm flex-1`),children:t})]})}function P({className:e,children:t,...n}){let{open:r}=k(),{onLogout:i}=T();return(0,h.jsxs)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,m.cn)(`flex flex-col gap-2`,e),...n,children:[t,(0,h.jsxs)(z,{children:[(0,h.jsx)(B,{children:(0,h.jsxs)(H,{className:`border border-border`,onClick:i,children:[(0,h.jsx)(g.LogOutIcon,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),r&&(0,h.jsx)(B,{className:`mt-2 border-t border-t-border`,children:(0,h.jsx)(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})]})}function F({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,m.cn)(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function I({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,m.cn)(`relative flex w-full min-w-0 flex-col`,e),...t})}function L({className:e,asChild:t=!1,...n}){return(0,h.jsx)(t?y.Slot.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,m.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-xs 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 R({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,m.cn)(`w-full text-sm`,e),...t})}function z({className:e,...t}){return(0,h.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,m.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function B({className:e,...t}){return(0,h.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,m.cn)(`group/menu-item relative`,e),...t})}const V=(0,v.cva)(`peer/menu-button.cursor-pointer.flex w-full items-center gap-2.overflow-hidden rounded-md p-2 outline-hidden.truncate text-left.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-12!.group-data-[collapsible=icon]:p-3!.group-data-[collapsible=icon]:gap-3!.[&>svg]:size-6.[&>svg]:shrink-0.[&>span:last-child]:truncate`.split(`.`),{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 H({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:a,className:o,...s}){let c=e?y.Slot.Slot:`button`,{isMobile:l,state:u}=k(),d=(0,h.jsx)(c,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:(0,m.cn)(V({variant:n,size:r}),o),...s});return a?(typeof a==`string`&&(a={children:a}),(0,h.jsxs)(i.t,{children:[(0,h.jsx)(i.i,{asChild:!0,children:d}),(0,h.jsx)(i.n,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...a})]})):d}const U=({isLoggedIn:e=!1,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c,children:l})=>(0,h.jsx)(w.Provider,{value:{isLoggedIn:e,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c},children:l}),W=({children:e})=>(0,h.jsx)(A,{children:e}),G=({userName:e=`Keith Kennedy`,userEmail:t=`k.kennedy@originui.com`,onLogout:r})=>(0,h.jsxs)(u.t,{children:[(0,h.jsx)(u.h,{asChild:!0,children:(0,h.jsx)(n.t,{size:`icon`,variant:`ghost`,color:`secondary`,className:`size-10 rounded-full`,children:(0,h.jsxs)(a.t,{className:`size-10`,children:[(0,h.jsx)(a.r,{}),(0,h.jsx)(a.n,{className:`size-full bg-muted-muted`,children:(0,h.jsx)(g.UserIcon,{})})]})})}),(0,h.jsxs)(u.r,{align:`end`,className:`max-w-64`,children:[(0,h.jsxs)(u.o,{className:`flex min-w-0 flex-col`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium text-sm text-text-positive`,children:e}),(0,h.jsx)(`span`,{className:`truncate font-normal text-text-positive-weak text-xs`,children:t})]}),(0,h.jsx)(u.u,{}),(0,h.jsxs)(u.a,{onClick:r,children:[(0,h.jsx)(g.LogOutIcon,{size:16,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`text-text-positive`,children:`Logout`})]})]})]}),K=()=>{let{inStockCarts:e=[],orderedCarts:t=[]}=T(),r=e.length,i=t.length,a=r+i;return(0,h.jsxs)(l.t,{children:[(0,h.jsx)(l.c,{asChild:!0,children:(0,h.jsx)(n.t,{size:`icon`,variant:`ghost`,color:`secondary`,className:`relative size-10 rounded-full`,children:(0,h.jsx)(g.ShoppingCartIcon,{})})}),(0,h.jsxs)(l.r,{className:`w-[95vw] sm:max-w-md`,children:[(0,h.jsx)(l.o,{className:`flex-0 border-border-weak border-b pb-3`,children:(0,h.jsxs)(l.s,{className:`flex items-center gap-2`,children:[(0,h.jsx)(g.ShoppingBag,{size:20}),(0,h.jsx)(`span`,{children:`Giỏ hàng của bạn`}),a>0&&(0,h.jsxs)(`span`,{className:`font-normal text-sm text-text-positive-weak`,children:[`(`,a,` sản phẩm)`]})]})}),(0,h.jsxs)(f.t,{defaultValue:i>0?`pre_order`:`in_stock`,className:`h-full flex-1 overflow-y-auto p-4 pt-0`,children:[(0,h.jsxs)(f.r,{className:`w-full flex-0`,children:[(0,h.jsxs)(f.i,{value:`in_stock`,className:`relative`,children:[`Có sẵn`,r>0&&(0,h.jsxs)(`span`,{children:[`(`,r,`)`]})]}),(0,h.jsxs)(f.i,{value:`pre_order`,className:`relative`,children:[`Đặt trước`,i>0&&(0,h.jsxs)(`span`,{children:[`(`,i,`)`]})]})]}),(0,h.jsx)(f.n,{value:`pre_order`,className:`flex-1 overflow-y-auto`,children:(0,h.jsx)(D,{items:t,cartType:`pre_order`})}),(0,h.jsx)(f.n,{value:`in_stock`,className:`flex-1 overflow-y-auto`,children:(0,h.jsx)(D,{items:e,cartType:`in_stock`})})]})]})]})},q=()=>{let{isLoggedIn:e,username:t,email:r,onGoogleLoginSuccess:i,onLogout:a}=T(),s=(0,x.useMediaQuery)(`(min-width: 640px)`),[l,u]=(0,_.useState)(!1);return(0,h.jsxs)(`header`,{className:(0,m.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:[e&&(0,h.jsx)(M,{}),(0,h.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,h.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,h.jsx)(g.ShoppingCartIcon,{size:20})}),(0,h.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,h.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,h.jsxs)(`div`,{className:`flex flex-1 items-center justify-end gap-x-2`,children:[!e&&(0,h.jsxs)(n.t,{className:`w-8 sm:w-fit`,onClick:()=>u(!0),children:[(0,h.jsx)(g.LogInIcon,{}),(0,h.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:`Đăng nhập`})]}),e&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(G,{userName:t,userEmail:r,onLogout:a}),(0,h.jsx)(c.t,{orientation:`vertical`,className:`min-h-6 w-px`}),(0,h.jsx)(K,{})]})]}),s&&(0,h.jsx)(o.t,{open:l,onOpenChange:u,children:(0,h.jsxs)(o.r,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,h.jsx)(o.o,{className:`flex-0 gap-2 p-6`,children:(0,h.jsx)(o.l,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,h.jsx)(o.a,{className:`p-2`})]})}),!s&&(0,h.jsx)(d.t,{open:l,onOpenChange:u,children:(0,h.jsxs)(d.r,{children:[(0,h.jsx)(d.o,{className:`text-left`,children:(0,h.jsx)(d.l,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,h.jsx)(d.a,{})]})})]})},J=({children:e,...t})=>{let{isLoggedIn:n}=T();return n?(0,h.jsx)(j,{variant:`inset`,collapsible:`icon`,...t,children:e}):null},Y=({children:e})=>{let{isLoggedIn:t,onGoogleLoginSuccess:r}=T(),i=(0,x.useMediaQuery)(`(min-width: 640px)`),[a,s]=(0,_.useState)(!1);return t?(0,h.jsx)(N,{children:(0,h.jsx)(`section`,{className:`relative size-full`,children:(0,h.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}):(0,h.jsx)(`div`,{className:`size-full p-4 pt-[calc(var(--header-height)+1.5rem)]`,children:(0,h.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-6 rounded-lg bg-card p-8 text-center shadow-card`,children:[(0,h.jsx)(`div`,{className:`flex size-20 items-center justify-center rounded-full bg-muted-foreground/10`,children:(0,h.jsx)(g.LockIcon,{className:`size-10 text-primary`})}),(0,h.jsxs)(`div`,{className:`flex max-w-md flex-col gap-2`,children:[(0,h.jsx)(`h2`,{className:`font-semibold text-2xl`,children:`Bạn chưa đăng nhập`}),(0,h.jsx)(`p`,{className:`text-text-positive-weak`,children:`Đăng nhập để khám phá đầy đủ các tính năng của Lunas Store và truy cập vào tài khoản của bạn.`})]}),(0,h.jsxs)(n.t,{size:`lg`,className:`gap-2`,onClick:()=>s(!0),children:[(0,h.jsx)(g.LogInIcon,{size:18}),(0,h.jsx)(`span`,{children:`Đăng nhập ngay`})]}),i&&(0,h.jsx)(o.t,{open:a,onOpenChange:s,children:(0,h.jsxs)(o.r,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,h.jsx)(o.o,{className:`flex-0 gap-2 p-6`,children:(0,h.jsx)(o.l,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),s(!1))}})]})})}),(0,h.jsx)(o.a,{className:`p-2`})]})}),!i&&(0,h.jsx)(d.t,{open:a,onOpenChange:s,children:(0,h.jsxs)(d.r,{children:[(0,h.jsx)(d.o,{className:`text-left`,children:(0,h.jsx)(d.l,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),s(!1))}})]})})}),(0,h.jsx)(d.a,{})]})})]})})},X=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-header`,className:(0,m.cn)(`flex-0 snap-start`,e),children:t}),Z=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-content`,className:(0,m.cn)(`flex w-full flex-1 flex-col gap-4 overflow-y-auto px-2 sm:px-4`,e),children:t}),Q=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-footer`,className:(0,m.cn)(`hidden w-full flex-0 border-border-weak border-t pt-2 sm:flex`,e),children:t}),$=({children:e,className:t})=>(0,h.jsx)(`div`,{"data-slot":`main-group`,className:(0,m.cn)(`flex size-full flex-col gap-4`,t),children:e}),oe=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-group-content`,className:(0,m.cn)(`size-full max-w-8xl flex-1 rounded-md bg-card p-4 shadow-card`,e),children:t});exports.ServiceLayoutCartInfo=K,exports.ServiceLayoutHeader=q,exports.ServiceLayoutMain=Y,exports.ServiceLayoutMainContent=Z,exports.ServiceLayoutMainFooter=Q,exports.ServiceLayoutMainGroup=$,exports.ServiceLayoutMainGroupContent=oe,exports.ServiceLayoutMainHeader=X,exports.ServiceLayoutProvider=U,exports.ServiceLayoutSidebar=J,exports.ServiceLayoutSidebarContent=F,exports.ServiceLayoutSidebarFooter=P,exports.ServiceLayoutSidebarGroup=I,exports.ServiceLayoutSidebarGroupContent=R,exports.ServiceLayoutSidebarGroupLabel=L,exports.ServiceLayoutSidebarMenu=z,exports.ServiceLayoutSidebarMenuButton=H,exports.ServiceLayoutSidebarMenuItem=B,exports.ServiceLayoutUserInfo=G,exports.ServiceLayoutWrapper=W;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TooltipContent } from "../../tooltip-
|
|
1
|
+
import { n as TooltipContent } from "../../tooltip-DeAzmFCB.cjs";
|
|
2
2
|
import * as react_jsx_runtime316 from "react/jsx-runtime";
|
|
3
3
|
import * as class_variance_authority_types15 from "class-variance-authority/types";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../button-
|
|
2
|
-
import "../../separator-
|
|
3
|
-
import { n as TooltipContent } from "../../tooltip-
|
|
1
|
+
import "../../button-Bg1fW3Y7.mjs";
|
|
2
|
+
import "../../separator-B0xZ0amV.mjs";
|
|
3
|
+
import { n as TooltipContent } from "../../tooltip-CCJYVy_H.mjs";
|
|
4
4
|
import * as react_jsx_runtime292 from "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import { VariantProps } from "class-variance-authority";
|